text
stringlengths
2.85k
2.55M
label
class label
11 classes
arXiv:1712.08397v1 [math.RA] 22 Dec 2017 KÄHLER–POISSON ALGEBRAS JOAKIM ARNLIND AND AHMED AL-SHUJARY Abstract. We introduce Kähler–Poisson algebras as analogues of algebras of smooth functions on Kähler manifolds, and prove that they share several properties with their classical counterparts on an algebraic level. For instance, the module of inner derivations of a Kähler–Poisson algebra is a finitely generated projective module, and allows for a unique metric and torsion-free connection whose curvature enjoys all the classical symmetries. Moreover, starting from a large class of Poisson algebras, we show that every algebra has an associated Kähler–Poisson algebra constructed as a localization. At the end, detailed examples are provided in order to illustrate the novel concepts. 1. Introduction Poisson manifolds and their geometry have been of great interest over the last decades. Besides from being important from a purely mathematical point of view, they are also fundamental to areas in mathematical and theoretical physics. Many authors have studied the geometric and algebraic properties of symplectic and Poisson manifolds together in relation to concepts such as connections, local structure and cohomology (see e.g. [Lic77, Wei83, Bry88, Hue90]). Moreover, there is a well developed field of deformations of Poisson structures, perhaps most famous through Kontsevich’s result on the existence of formal deformations [Kon03]. The ring of smooth functions on a Poisson manifold is a Poisson algebra and it seems quite natural to ask to what extent geometric properties and concepts may be introduced in an arbitrary Poisson algebra, without making reference to an underlying manifold. The methods of algebraic geometry can readily be extended to Poisson algebras (see e.g. [Ber79]); however, this will not be directly relevant to us as we shall start by focusing on metric aspects. Our work is mainly motivated by the results in [AHH12, AH14], where it is shown that one may reformulate the Riemannian geometry of an embedded Kähler manifold M entirely in terms of the Poisson structure on the algebra smooth functions of M . Let us also mention that the starting point of our approach is quite similar to that of [Hue90] (although metric aspects were not considered there). In this note, we show that any Poisson algebra, fulfilling an “almost Kähler condition”, enjoys many properties similar to those of the algebra of smooth functions on an almost Kähler manifold, opening up for a more metric treatment of Poisson algebras. Such algebras will be called “Kähler–Poisson algebras”, and we show that one may associate a Kähler–Poisson algebra to every algebra in a large class of Poisson algebras. In particular, we prove the existence of a unique Levi-Civita connection on the module generated by the inner derivations, and show that the curvature operator has all the classical symmetries. As our approach is quite close to the theory of Lie-Rinehart algebras, we start by introducing metric Lie-Rinehart 1 2 JOAKIM ARNLIND AND AHMED AL-SHUJARY algebras and recall a few results on the Levi-Civita connection and the corresponding curvature. In physics, the dynamics of quantum systems are found by using a correspondence between Poisson brackets of functions on the classical manifold, and the commutator of operators in the quantum system. Thus, understanding how properties of the underlying manifold may be expressed in Poisson algebraic terms enables both interpretation and definition of quantum mechanical quantities. For instance, this has been used in the context of matrix models to identify emergent geometry (cf. [BS10, AHH12]). Let us briefly outline the contents of the paper. In Section 2 we recall a few the results from [AH14], in order to motivate and understand the introduction of a Kähler type condition for Poisson algebras, and Section 3 explains how the theory of Lie-Rinehart algebras can be extended to include metric aspects. In Section 4, we define Kähler–Poisson algebras and investigate their basic properties as well as showing that one may associate a Kähler–Poisson algebra to an arbitrary Poisson algebra in a large class of algebras. In Section 5 we derive a compact formula for the Levi-Civita connection as well as introducing Ricci and scalar curvature. Section 6 presents a number of examples together with a few detailed computations. Remark 1.1. We have become aware of the fact that the terminology Kähler– Poisson structure (resp. Kähler–Poisson manifold ) is used for certain Poisson structures on a complex manifold where the Poisson bivector is of type (1, 1) (see e.g. [Kar02]), but we hope that this will not be a source of confusion for the reader. 2. Poisson algebraic formulation of almost Kähler manifolds In [AH14] it was shown that the geometry of embedded almost Kähler manifolds can be reformulated entirely in the Poisson algebra of smooth functions. As we shall develop an algebraic analogue of this fact, let us briefly recall the main construction. Let (Σ, ω) denote a n-dimensional symplectic manifold and let g be a metric on Σ. Furthermore, let us assume that x : (Σ, g) → (Rm , ḡ) is an isometric embedding of Σ into Rm (with the metric ḡ), and write  p → x(p) = x1 (p), x2 (p), . . . , xm (p) . The results in [AH14] state that the Riemannian geometry of Σ may be formulated in terms of the Poisson algebra generated by the embedding coordinates x1 , . . . , xm . These results hold true as long as there exists a non-zero function γ ∈ C ∞ (Σ) such that (2.1) γ 2 g ab = θap θbq gpq where θab and gab denote the components of the Poisson bivector and the metric in local coordinates {ua }na=1 , respectively. If (Σ, ω, g) is an almost Kähler manifold then it follows from the compatibility condition ω(X, Y ) = g(X, J(Y )) (where J denotes the almost complex structure on Σ) that relation (2.1) holds with γ = 1. In local coordinates, the isometric embedding is characterized by   gab = ḡ ij ∂a xi ∂b xj , and the Poisson bracket is computed as {f, h} = θab (∂a f )(∂b h). KÄHLER–POISSON ALGEBRAS 3 Note that in the above and following formulas, indices i, j, k, . . . run from 1 to m and indices a, b, c, . . . run from 1 to n. Defining D : Tp Rm → Tp Rm as D(X) ≡ Di j X j ∂i = 1 i k {x , x }ḡkl {xj , xl }ḡjm X m ∂i γ2 for X = X i ∂i ∈ Tp Rm , one computes 1 ab θ (∂a xi )(∂b xk )ḡkl θpq (∂p xj )(∂q xl )ḡ jm X m γ2 1 = 2 θab θpq gbq (∂a xi )(∂p xj )ḡ jm X m = g ap (∂a xi )(∂p xj )ḡ jm X m , γ D(X)i = by using (2.1). Hence, the map D is identified as the orthogonal projection onto Tp Σ, seen as a subspace of Tp Rm . Having the projection operator at hand, one may directly proceed to develop the theory of submanifolds. For instance, the Levi-Civita connection ∇ on Σ is given by  ¯ XY ∇X Y = D ∇ ¯ is the Levi-Civita connection on (Rm , ḡ). In the where X, Y ∈ Γ(T Σ) and ∇ particular case (but generically applicable, by Nash’s theorem [Nas56]) when ḡ is the Euclidean metric, the above formula reduces to ∇X Y i = 1 γ4 m X {xi , xk }{xj , xk }X l {xl , xn }{Y j , xn }. i,j,k,l,n=1 As we intend to develop an analogous theory for Poisson algebras, without any reference to a manifold, we would like to reformulate (2.1) in terms of Poisson algebraic expressions. Using that gab = ḡij (∂a xi )(∂b xj ) and {xi , xk } = θab (∂a xi )(∂b xj ), one derives γ 2 g ab = θap θbq gpq ⇒ γ 2 δca = θap θbq gpq gbc ⇒ γ 2 θar = θap θbq gpq gbc θcr ⇒ γ 2 {xi , xj } = (∂a xi )(∂r xj )θap θbq θcr ḡ kl (∂p xk )(∂q xl )ḡ mn (∂b xm )(∂c xn ) ⇒ γ 2 {xi , xj } = −{xi , xk }ḡkl {xl , xn }ḡnm {xm , xj } which is equivalent to the statement that (2.2) γ 2 {f, h} = −{f, xi }ḡij {xj , xk }ḡkl {xl , h} for all f, h ∈ C ∞ (Σ). Given γ 2 , ḡij and x1 , . . . , xm , the above equation makes sense in an arbitrary Poisson algebra. The main purpose of this paper is to study algebras which satisfy such a relation. 3. Metric Lie-Rinehart algebras The idea of modeling the algebraic structures of differential geometry in a commutative algebra is quite old. We shall follow a pedestrian approach, were we assume that a (commutative) algebra A is given (corresponding to the algebra of functions), together with an A-module g (corresponding to the module of vector fields) which is also a Lie algebra and has an action on A as derivations. Under appropriate assumptions on the ingoing objects, such systems has been studied by many authors over the years, see e.g [Her53, Koz60, Pal61, Rin63, Nel67, Hue90]. Our starting 4 JOAKIM ARNLIND AND AHMED AL-SHUJARY point is the definition given by G. Rinehart [Rin63]. In the following, we let the field K denote either R or C. Definition 3.1 (Lie-Rinehart algebra). Let A be a commutative K-algebra and let g be an A-module which is also a Lie algebra over K. Given a map ω : g → Der(A), the pair (A, g) is called a Lie-Rinehart algebra if  (3.1) ω(aα)(b) = a ω(α)(b)  (3.2) [α, aβ] = a[α, β] + ω(α)(a) β, for α, β ∈ g and a, b ∈ A. (In most cases, we will leave out ω and write α(a) instead of ω(α)(a).) Let us point out some immediate examples of Lie-Rinehart algebras. Example 3.2. Let A be an algebra and let g = Der(A) be the A-module of derivations of A. It is easy to check that Der(A) is a Lie algebra with respect to composition of derivations, i.e. [α, β](a) = α(β(a)) − β(α(a)). The pair (A, Der(A)) is a Lie-Rinehart algebra with respect to the action of elements of Der(A) as derivations. Example 3.3. Let A = C ∞ (M ) be the algebra (over R) of smooth functions on a manifold M , and let g = X (A) be the A-module of vector fields on M . With respect to the standard action of a vector field as a derivation of C ∞ (M ), the pair (C ∞ (M ), X (A)) is a Lie-Rinehart algebra. Morphisms of Lie-Rinehart algebras are defined as follows. Definition 3.4. Let (A1 , g1 ) and (A2 , g2 ) be Lie-Rinehart algebras. A morphism of Lie-Rinehart algebras is a pair of maps (φ, ψ), with φ : A1 → A2 an algebra homomorphism and ψ : g1 → g2 a Lie algebra homomorphism, such that   ψ(aα) = φ(a)ψ(α) and φ α(a) = ψ(α) φ(a) , for all a ∈ A1 and α ∈ g1 . A lot of attention has been given to the cohomology of the Chevalley–Eilenberg complex consisting of alternating A-multilinear maps with values in a module M . Namely, defining C k (g, M ) to be the A-module of alternating maps from gk to an (A, g)-module M , on introduces the standard differential d : C k (g, M ) → C k+1 (g, M ) as dτ (α1 , . . . , αk+1 ) = (3.3) k+1 X i=1 +  (−1)i+1 αi τ (α1 , . . . , α̂i , . . . , αk+1 ) k+1 X i<j  (−1)i+j τ [αi , αj ], α1 , . . . , α̂i , . . . , α̂j , . . . , αk+1 , where α̂i indicates that αi is not present among the arguments. The fact that d ◦ d = 0 implies that one can construct the cohomology of this complex in analogy with de Rahm cohomology of smooth manifolds. However, as we shall be more interested in Riemannian aspects, it is natural to study the case when there exists a metric on the module g. More precisely, we make the following definition. KÄHLER–POISSON ALGEBRAS 5 Definition 3.5. Let (A, g) be a Lie-Rinehart algebra and let M be an A-module. An A-bilinear form g : M × M → A is called a metric on M if it holds that (1) g(m1 , m2 ) = g(m2 , m1 ) for all m1 , m2 ∈ M , (2) the map ĝ : M → M ∗ , given by ĝ(m1 ) (m2 ) = g(m1 , m2 ), is an A-module isomorphism, where M ∗ denotes the dual of M . We shall often refer to property (2) as the metric being non-degenerate. Definition 3.6. A metric Lie-Rinehart algebra (A, g, g) is a Lie-Rinehart algebra (A, g) together with a metric g : g × g → A. Let us introduce morphisms of metric Lie-Rinehart algebras as morphisms of LieRinehart algebras that preserve the metric. Definition 3.7. Let (A1 , g1 , g1 ) and (A2 , g2 , g2 ) be metric Lie-Rinehart algebras. A morphism of metric Lie-Rinehart algebras is a morphism of Lie-Rinehart algebras (φ, ψ) : (A1 , g1 ) → (A2 , g2 ) such that   φ g1 (α, β) = g2 ψ(α), ψ(β) for all α, β ∈ g1 . The theory of affine connections can readily be introduced, together with torsionfreeness and metric compatibility. Definition 3.8. Let (A, g) be a Lie-Rinehart algebra and let M be an A-module. A connection ∇ on M is a map ∇ : g → EndK (M ), written as α → ∇α , such that (1) ∇aα+β = a∇α + ∇β (2) ∇α (am) = a∇α m + α(a)m for all a ∈ A, α, β ∈ g and m ∈ M . Definition 3.9. Let (A, g) be a Lie-Rinehart algebra and let M be an A-module with connection ∇ and metric g. The connection is called metric if  (3.4) α g(m1 , m2 ) = g(∇α m1 , m2 ) + g(m1 , ∇α m2 ) for all α ∈ g and m1 , m2 ∈ M . Definition 3.10. Let (A, g) be a Lie-Rinehart algebra and let ∇ be a connection on g. The connection is called torsion-free if ∇α β − ∇β α − [α, β] = 0 for all α, β ∈ g. As in differential geometry, one can show that there exists a unique torsion-free and metric connection associated to the Riemannian metric. The first step involves proving Kozul’s formula. Proposition 3.11. Let (A, g, g) be a metric Lie-Rinehart algebra. If ∇ is a metric and torsion-free connection on g then it holds that     2g ∇α β, γ = α g(β, γ) + β g(γ, α) − γ g(α, β) (3.5) + g(β, [γ, α]) + g(γ, [α, β]) − g(α, [β, γ]) for all α, β, γ ∈ g. 6 JOAKIM ARNLIND AND AHMED AL-SHUJARY Proof. Starting from the right-hand-side of (3.5) and using the metric condition to rewrite the first three terms as  α g(β, γ) = g(∇α β, γ) + g(β, ∇α γ), together with the torsion-free condition to rewrite the last three terms as g(β, [γ, α]) = g(β, ∇γ α) − g(β, ∇α γ), immediately gives 2g(∇α β, γ).  By using Proposition 3.11 together with the fact that the metric is non-degenerate, one obtains the following result. Proposition 3.12. Let (A, g, g) be a metric Lie-Rinehart algebra. Then there exists a unique metric and torsion-free connection on g. Remark 3.13. The unique connection in Proposition 3.12 will be referred to as the Levi-Civita connection of a metric Lie-Rinehart algebra. Proof. For every α, β ∈ g, the right-hand-side of (3.5) defines a linear form ω ∈ g∗    ω(γ) = 12 α g(β, γ) + 12 β g(γ, α) − 21 γ g(α, β) + 21 g(β, [γ, α]) + 21 g(γ, [α, β]) − 21 g(α, [β, γ]). By assumption (see Definition 3.5), the metric induces an isomorphism map ĝ : g → g∗ , which implies that there exists an element ∇α β = ĝ −1 (ω) ∈ g such that g(∇α β, γ) = ω(γ). This shows that ∇α β exists for all α, β ∈ g such that relation (3.5) is satisfied. Next, let us show that ∇ defines a connection on g, which amounts to checking the four properties in Definition 3.8. This is a straight-forward computation using (3.5) and the fact that, for instance, g(∇aα β, γ) = g(a∇α β, γ) for all γ ∈ g implies that ∇aα β = a∇α β since the metric is non-degenerate. Let us illustrate the computation with the following example. From (3.5) it follows that    2g(∇aα β, γ) = aα g(β, γ) + β g(γ, aα) − γ g(aα, β) + g(β, [γ, aα]) + g(γ, [aα, β]) − g(aα, [β, γ])    = aα g(β, γ) + aβ g(γ, α) + β(a)g(γ, α) − aγ g(α, β) − γ(a)g(α, β) + g(β, γ(a)α + a[γ, α]) + g(γ, −β(a)α + a[α, β]) − ag(α, [β, γ]) = 2ag(∇α β, γ) + β(a)g(γ, α) − γ(a)g(α, β) + γ(a)g(β, α) − β(a)g(γ, α) = 2ag(∇α β, γ). The remaining properties of a connection is proved in an analogous way. To show that ∇ is metric, one again uses (3.5) to substitute g(∇α β, γ) and g(β, ∇α γ) and find that  α g(β, γ) − g(∇α β, γ) − g(β, ∇α γ) = 0. That the torsion-free condition holds follows from g(∇α β, γ) − g(∇β α, γ) − g([α, β], γ) = 0, which can be seen using (3.5). Hence, we conclude that there exists a metric and torsion-free affine connection satisfying (3.5). Moreover, since the metric is nondegenerate, such a connection is unique. Finally, as every metric and torsion-free KÄHLER–POISSON ALGEBRAS 7 connection on g satisfies (3.5) (by Proposition 3.11) we conclude that there exists a unique metric and torsion-free connection on g.  In what follows, we shall recall some of the properties satisfied by a metric and torsion-free connection. The differential geometric proofs goes through with only a change in notation needed, but we provide them here for easy reference, and to adapt the formulation to our particular situation. We refer to [Koz60, Nel67] for a nice overview of differential geometric constructions in modules over general commutative algebras. Following the usual definitions, we introduce the curvature as (3.6) R(α, β)γ = ∇α ∇β γ − ∇β ∇α γ − ∇[α,β] γ as well as R(α, β, γ) = R(α, β)γ R(α, β, γ, δ) = g(α, R(γ, δ)β). Let us also consider the extension of ∇ to multilinear maps T : gk → A k   X T α1 , . . . , ∇β αi , . . . , αk , (∇β T )(α1 , . . . , αk ) = β T (α1 , . . . , αk ) − i=1 k as well as to g-valued multilinear maps T : g → g k   X T α1 , . . . , ∇β αi , . . . , αk . (∇β T )(α1 , . . . , αk ) = ∇β T (α1 , . . . , αk ) − i=1 As in classical geometry, one proceeds to derive the Bianchi identities. Proposition 3.14. Let ∇ be the Levi-Civita connection of a metric Lie-Rinehart algbera (A, g, g) and let R denote corresponding curvature. Then it holds that (3.7) (3.8) R(α, β, γ) + R(γ, α, β) + R(β, γ, α) = 0,    ∇α R (β, γ, δ) + ∇β R (γ, α, δ) + ∇γ R (α, β, δ) = 0, for all α, β, γ, δ ∈ g. Proof. The first Bianchi identity (3.7) is proven by acting with ∇γ on the torsion free condition ∇α β − ∇β α − [α, β] = 0, and then summing over cyclic permutations of α, β, γ. Since [[α, β], γ] + [[β, γ], α] + [[γ, α], β] = 0, the desired result follows. The second identity  is obtained by a cyclic permutation (of α, β, γ) in R ∇α β − ∇β α − [α, β], γ, δ = 0. One has  0 = R ∇α β − ∇β α − [α, β], γ, δ + cycl. = R(∇γ α, β, δ) + R(α, ∇γ β, δ) − R([α, β], γ, δ) + cycl. On the other hand, one has (∇γ R)(α, β, δ) = ∇γ R(α, β, δ) − R(∇γ α, β, δ) − R(α, ∇γ β, δ) − R(α, β, ∇γ δ), and substituting this into the previous equation yields  0 = ∇γ R(α, β, δ) − ∇γ R (α, β, δ) − R(α, β, ∇γ δ) − R([α, β], γ, δ) + cycl. After inserting the definition of R, and using that [[α, β], γ] + cycl. = 0, the second Bianchi identity follows.  8 JOAKIM ARNLIND AND AHMED AL-SHUJARY Finally, one is able to derive the classical symmetries of the curvature tensor. Proposition 3.15. Let ∇ be the Levi-Civita connection of a metric Lie-Rinehart algbera (A, g, g) and let R denote corresponding curvature. Then it holds that (3.9) R(α, β, γ, δ) = −R(β, α, γ, δ) = −R(α, β, δ, γ). (3.10) R(α, β, γ, δ) = R(δ, γ, α, β), for all α, β, γ, δ ∈ g. Proof. The identity R(α, β, γ, δ) = −R(α, β, δ, γ) follows immediately from the definition of R. Let us now prove that R(α, β, γ, δ) = −R(β, α, γ, δ). Starting from γ(δ(a)) − δ(γ(a)) − [γ, δ](a) = 0 and letting a = g(α, β) yields h i h i γ g(∇δ α, β) + g(α, ∇δ β) − δ g(∇γ α, β) + g(α, ∇γ β) − (∇[γ,δ] α, β) − (α, ∇[γ,δ] β) = 0. when using that ∇ is a metric connection; i.e τ (g(α, β)) = g(∇τ α, β) + g(α, ∇τ β) for τ = γ, δ, [γ, δ]. A further expansion using the metric property gives g(∇γ ∇δ α, β) + g(α, ∇γ ∇δ β) − g(∇δ ∇γ α, β) − g(α, ∇δ ∇γ β) − g(∇[γ,δ] α, β) − g(α, ∇[γ,δ] β) = 0, which is equivalent to g(R(γ, δ)α, β) = −g(R(γ, δ)β, α). Next, one can make use of equation (3.7) in Proposition 3.14, from which it follows that (3.11) R(α, β, γ, δ) + R(α, δ, β, γ) + R(α, γ, δ, β) = 0. It is a standard algebraic result that any quadri-linear map satisfying (3.9) and (3.11) also satisfies (3.10) (see e.g. [Hel01]).  4. Kähler–Poisson algebras In this section, we shall introduce a type of Poisson algebras, that resembles the smooth functions on an (isometrically) embedded almost Kähler manifold, in such a way that an analogue of Riemannian geometry may be developed. Namely, let us consider a unital Poisson algebra (A, {·, ·}) and let {x1 , . . . , xm } be a set of distinguished elements of A, corresponding to functions providing an embedding into Rm , in the geometrical case. One may also consider the setting of algebraic (Poisson) varieties where A is a finitely generated Poisson algebra and {x1 , . . . , xm } denotes a set of generators. Our aim is to introduce equation (2.2) in A and investigate just how far one may take the analogy with Riemannian geometry. After introducing Kähler–Poisson algebras below, we will show that they are, in a natural way, metric Lie-Rinehart algebras, which implies that the results of Section 3 can be applied; in particular, there exists a unique torsion-free metric connection on every Kähler–Poisson algebra. Note that Lie-Rinehart algebras related to Poisson algebras have extensively been studied by Huebschmann (see e.g. [Hue90, Hue99]). In Section 2 it was shown that the following identity holds on an almost Kähler manifold: (2.2) γ 2 {f, h} = −{f, xi }ḡij {xj , xk }ḡ kl {xl , h}. KÄHLER–POISSON ALGEBRAS 9 This equation is well-defined in a Poisson algebra, and we shall use it to define the main object of our investigation. Definition 4.1. Let A be a Poisson algebra over K and let {x1 , . . . , xm } ⊆ A. Given gij ∈ A, for i, j = 1, . . . , m, such that gij = gji , we say that the triple K = A, {x1 , . . . , xm }, g is a Kähler–Poisson-algebra if there exists η ∈ A such that m X (4.1) η{a, xi }gij {xj , xk }gkl {xl , b} = −{a, b} i,j,k,l=1 for all a, b ∈ A. Remark 4.2. From now on, we shall use the differential geometric convention that repeated indices are summed over from 1 to m, and omit explicit summation symbols. Given a Kähler–Poisson-algebra K, we let g denote the A-module generated by all inner derivations, i.e. g = {a1 {c1 , ·} + · · · + aN {cN , ·} : ai , ci ∈ A and N ∈ N}. It is a standard fact that g is a Lie algebra over K with respect to   [α, β](a) = α β(a) − β α(a) . The matrix g induces a bilinear symmetric form on g, defined by (4.2) g(α, β) = α(xi )gij β(xj ), and we refer to g as the metric on g. To the metric g one may associate the map ĝ : g → g∗ defined as ĝ(α)(β) = g(α, β).  Proposition 4.3. If K = A, {x1 , . . . , xm }, g is a Kähler–Poisson-algebra then the metric g is non-degenerate; i.e. the map ĝ : g → g∗ is a module isomorphism. Proof. Let us first show that g is injective; i.e. we will show that ĝ(α)(β) = 0, for all β ∈ g, implies that α = 0. Thus, write α = αi {xi , ·}, and assume that g(α, β) = 0 for all β ∈ g. In particular, we can choose β = η{c, xk }gkm {·, xm }, for arbitrary c ∈ A, which implies that 0 = g(α, β) = ηαk {xk , xi }gij {c, xk }gkm {xj , xm } = −αk η{xk , xi }gij {xj , xm }gmk {xk , c}. Using the relation (4.1), one obtains αk {xk , c} = 0 for all c ∈ A, which is equivalent to α = 0. This shows that ĝ is injective. Let us now show that ĝ is surjective. Thus, let ω ∈ g∗ and set α = ηω({xi , ·})gij {xj , ·} ∈ g, which gives ĝ(α)(ak {bk , ·}) = ηω({xi , ·})gij {xj , xl }glm ak {bk , xm } = −ηak {bk , xm }gml {xl , xj }gji ω({xi , ·}). 10 JOAKIM ARNLIND AND AHMED AL-SHUJARY Since ω is a module homomorphism one obtains ĝ(α)(ak {bk , ·}) = ω(−ηak {bk , xm }gml {xl , xj }gji {xi , ·}) = ω(ak {bk , ·}), by using (4.1), which proves that every element of g∗ is in the image of ĝ. We conclude that ĝ is a module isomorphism.  Corollary 4.4. If (A, {x1 , . . . , xm }, g) is a Kähler–Poisson algebra then (A, g, g) is a metric Lie-Rinehart algebra. Proof. It is easy to check that (A, g) satisfies the conditions of a Lie-Rinehart algebra, and Proposition 4.3 implies that the metric is non-degenerate. Hence, (A, g, g) is a metric Lie-Rinehart algebra.  Let us now introduce some notation for Kähler–Poisson algebras. Thus, we set P ij = {xi , xj } P i (a) = {xi , a}, for a ∈ A, as well as Dij = ηP i k P jk = η{xi , xl }glk {xj , xk } Di (a) = ηP k (a)Pk i = η{xk , a}gkl {xl , xi }, and note that Dij = Dji . With respect to this notation, (4.1) can be stated as Di (a)Pi (b) = {a, b}. (4.3) The metric will be used to lower indices in analogy with differential geometry. E.g. P i j = P ik gkj Di j = Dik gkj . Furthermore, one immediately derives the following useful identities (4.4) Dij Pj (a) = P i (a), P ij Dj (a) = P i (a) and Di j Djk = Dik . by using (4.1). There is a natural embedding ι : g → Am , given by ι(ai {bi , ·}) = ai {bi , xk }ek , m where {ek }m k=1 denotes the canonical basis of the free module A . Moreover, g m defines a bilinear form on A via g(X, Y ) = X i gij Y j for X = X i ei ∈ Am and Y = Y i ei ∈ Am , and we introduce the map D : Am → Am by setting D(X) = Di j X j ei for X = X i ei ∈ Am . Proposition 4.5. The map D : Am → Am is an orthogonal projection; i.e. D2 (X) = D(X) and g(D(X), Y ) = g(X, D(Y )) for all X, Y ∈ Am . KÄHLER–POISSON ALGEBRAS 11 Proof. First, it is clear that D is an endomorphism of Am . It follows immediately from (4.4) that D2 (X) = Di j Dj k X k ei = Di j Djl glk X k ei = Dil glk X k ei = Di k X k ei = D(X). Furthermore, using that Dij = Dji one finds that  g D(X), Y = Di j X j gik Y k = X j Dil glj gik Y k = X j glj Dli gik Y k  = X j gjl Dl k Y k = g X, D(Y ) , which completes the proof.  From Proposition 4.5 we conclude that T A = im(D) is a finitely generated projective module. As a corollary, we prove that g is a finitely generated projective module by showing that g is isomorphic to T A. Proposition 4.6. The map ι : g → Am is an isomorphism from g to T A. Proof. First, it is clear from the definition that ι is a module homomorphism. Considered as a submodule of Am , elements of T A can be characterized by the fact that D(X) = X for all X ∈ T A. Thus, by showing that  D ι(ak {bk , ·}) = Di j ak {bk , xj }ei = −ak Di j P j (bk )ak ei = −ak P i (bk ) = ι(ak {bk , ·}) it follows that ι(ak {bk , ·}) ∈ T A. Let us now show that ι is injective; assume that ι(ak {bk , ·}) = 0, which implies that ak {bk , xi } = 0 for i = 1, . . . , m. Next, for arbitrary c ∈ A, we write ak {bk , c} = −ηak {bk , xi }gij P jl glm {xm , c}, by using (4.1). Since ak {bk , xi } = 0, one obtains ak {bk , c} = 0 for all c ∈ A. To prove that ι is surjective, we start from an arbitrary X = X i ei ∈ T A, and note that  ι X i gij Di (·) = X i gij Dik ek = D(X) = X by using that D(X) = X for all X ∈ T A. Hence, we may conclude that ι is an isomorphism from g to T A.  Corollary 4.7. g is a finitely generated projective module. Note that the above result is clearly not dependent on whether or not the underlying Poisson algebra has the structure of a Kähler–Poisson algebra, as the definition of g involves only inner derivations. Hence, as soon as the Poisson algebra admits the structure of a Kähler–Poisson algebra, it follows that the module of inner derivations is projective. Furthermore, the fact that g is a projective module has several implications for the underlying Lie-Rinehart algebra [Rin63, Hue90]. Next, let us show that the derivations Di generate g as an A-module. Proposition 4.8. The A-module g is generated by {D1 , . . . , Dm }. 12 JOAKIM ARNLIND AND AHMED AL-SHUJARY Proof. First of all, it is clear that every element in the module generated by Di , written as α(c) = αi Di (c) = ηαi {xi , xj }gjk {c, xk }, is an element of g. Conversely, let α ∈ g be an arbitrary element written as X α(c) = aN {bN , c}. N for c ∈ A. Using the Kähler–Poisson condition (4.1) one may write this as X X α(a) = aN {bN , c} = − ηaN {bN , xi }gij {xj , xk }gkl {xl , c} N = X N N i  aN {b , x }gij Dj (c), N which clearly lies in the module generated by {D1 , . . . , Dm }.  Thus, every α ∈ g may be written as α = αi Di for some αi ∈ A. It turns out that this is a very convenient way of writing elements of g, which shall be extensively used in the following. Note that if the Kähler–Poisson algebra comes from an almost Kähler manifold M , then Di is quite close to a partial derivative on M in the sense that (∂a xi )gik Dk (f ) = ∂a f , for f ∈ C ∞ (M ). 4.1. The trace of linear maps. As we shall be interested in both Ricci and scalar curvature, which are defined using traces of linear maps, we introduce  (4.5) tr(L) = g L(Di ), Dj Dij . for an A-linear map L : g → g. This trace coincides with the ordinary trace on g∗ ⊗A g; namely, consider X L= ωN ⊗A αN ∈ g∗ ⊗A g N as a linear map L : g → g in the standard way via X L(β) = ωN (β)αN , N together with tr(L) = X ωN (αN ). N i Writing αN = αN i D one finds that X X   k j kj g L(Di ), Dj Dij = g ωN (Di )αN ωN (Di )αN k D , D Dij = k D Dij N = X N k i ωN (αN k D iD ) = X N N k ωN (αN k D ) = X ωN (αN ). N In particular, this implies that the trace defined via (4.5) is independent of the Kähler–Poisson structure. KÄHLER–POISSON ALGEBRAS 13 4.2. Morphisms of Kähler–Poisson algebras. As Kähler–Poisson algebras are also metric Lie-Rinehart algebras, we shall require that a morphism of Kähler– Poisson algebras is also a morphism of metric Lie-Rinehart algebras (as defined in Section 3). However, as the definition of a Kähler–Poisson also involves the choice of a set of distinguished elements, we will require a morphism to respect the subalgebra generated by these elements. To this end, we start by making the following definition. Definition 4.9. Given a Kähler–Poisson algebra (A, {x1 , . . . , xm }, g), let Afin ⊆ A denote the subalgebra generated by {x1 , . . . , xm }. Equipped with this definition, we introduce morphisms of Kähler–Poisson algebras in the following way. ′ Definition 4.10. Let K = (A, {x1 , . . . , xm }, g) and K′ = (A′ , {y 1 , . . . , y m }, g ′ ) be Kähler–Poisson algebras together with their corresponding modules of derivations g and g′ , respectively. A morphism of Kähler–Poisson algebras is a pair of maps (φ, ψ), with φ : A → A′ and ψ : g → g′ , such that (φ, ψ) is a morphism of the metric Lie-Rinehart algebras (A, g, g) and (A, g′ , g ′ ) and φ is a Poisson algebra homomorphism such that φ(Afin ) ⊆ A′fin . Note that if the algebras are finitely generated such that A = Afin and A′ = A′fin (which is the case in many examples), the condition φ(Afin ) ⊆ A′fin is automatically satisfied. Although a morphism of Kähler–Poisson algebras is given by a choice of two maps φ and ψ, it is often the case that φ determines ψ in the following sense. ′ Proposition 4.11. Let (φ, ψ) : (A, {x1 , . . . , xm }, g) → (A′ , {y 1 , . . . , y m }, g ′ ) be a morphism of Kähler–Poisson algebras such that for all α′ ∈ g′  α′ φ(a) = 0 ∀ a ∈ A ⇒ α′ = 0 then Proof. Let  ψ a{b, ·}A = φ(a){φ(b), ·}A′ . ′ (φ, ψ) : (A, {x1 , . . . , xm }, g) → (A′ , {y 1 , . . . , y m }, g ′ ) be a morphism of Kähler–Poisson algebras fulfilling the assumption above. Since φ is a Poisson algebra homomorphism, one obtains for α = a{b, ·}A   φ α(c) = φ a{b, c}A = φ(a){φ(b), φ(c)}A′ for all a ∈ A. By the definition of a Lie-Rinehart morphism, this has to equal ψ(α)(φ(c)); i.e. ψ(α)(φ(c)) = φ(a){φ(b), φ(c)}A′ . Thus, ψ(α) agrees with φ(a){φ(b), ·}A′ on the image of φ, which implies that ψ(α) = φ(a){φ(b), ·}A′ since any derivation is determined by its action on the image of φ by assumption.  For instance, the requirements in Proposition 4.11 are clearly satisfied if φ is surjective. 14 JOAKIM ARNLIND AND AHMED AL-SHUJARY 4.3. Construction of Kähler–Poisson algebras. Given a Poisson algebra (A, {·, ·}) one may ask if there exist {x1 , . . . , xm } and gij such that (A, {x1 , . . . , xm }, g) is a Kähler–Poisson algebra? Let us consider the case when A is a finitely generated algebra, and let {x1 , . . . , xm } be an arbitrary set of generators. If we denote by P the matrix with entries {xi , xj } and by g the matrix with entries gij , the Kähler– Poisson condition (4.1) may be written in matrix notation as ηPgPgP = −P. Given an arbitrary antisymmetric matrix P, we shall find g by first writing P in a block diagonal form, with antisymmetric 2 × 2 matrices on the diagonal. This is a well known result in linear algebra, in which case the eigenvalues appear in the diagonal blocks. For an antisymmetric matrix with entries in a commutative ring, a similar result holds. Lemma 4.12. Let MN (R) denote the set of N × N matrices with entries in R. For N ≥ 2, let P ∈ MN (R) be an antisymmetric matric. Then there exists V ∈ MN (R), an antisymmetric Q ∈ MN −2 (R) and λ ∈ R such that   0 λ 0 . V T PV =  −λ 0 0 Q Proof. We shall construct the matrix V by using elementary row and column operations. Note that if a matrix E represents an elementary row operation, then E T PE is obtained by applying the elementary operation to both the row and the corresponding column. Denoting the matrix elements of P by pij , we start by constructing a matrix Vk such that (VkT PVk )k1 = (VkT PVk )k2 = 0 (which necessarily implies that also the (1k) and (2k) matrix elements are zero). To this end, let Vk1 denote the matrix representing the elementary row operation that multiplies the k’th row by p12 , and let Vk2 represent the operation that adds the first row, multiplied by −pk2 , to the k’th row. Furthermore, Vk3 represents the operation of adding the second row, multiplied by pk1 , to the k’th row. Setting Vk = Vk1 Vk2 Vk3 it is easy to see that VkT PVk is an antisymmetric matrix where the (1k), (2k), (k1) and (k2) matrix elements are zero. Consequently, we set V = V3 V4 · · · VN and conclude that V T PV is of the desired form.  Proposition 4.13. Let P ∈ MN (R) be an antisymmetric matric, and let N̂ denote the integer part of N/2. Then there exists V ∈ MN (R) and λ1 , . . . , λN̂ ∈ R such that V T PV = diag(Λ1 , . . . , ΛN̂ ) if N is even, T V PV = diag(Λ1 , . . . , ΛN̂ , 0) where Λk =  0 −λk if N is odd,  λk . 0 Proof. Let us prove the statement by using induction together with Lemma 4.12. Thus, assume that there exists V ∈ MN (R) such that V T PV = diag(Λ1 , . . . , Λk , Qk+1 ) where Qk+1 ∈ MN −2k is an antisymmetric matrix. Clearly, by Lemma 4.12, this holds true for k = 1. Next, assume that N − 2k ≥ 2. Applying Lemma 4.12 to KÄHLER–POISSON ALGEBRAS 15 T Qk+1 we conclude that there exists Vk+1 ∈ MN −2k (R) such that Vk+1 Qk+1 Vk+1 = diag(Λk+1 , Qk+2 ). Furthermore, defining Wk+1 ∈ MN (R) by Wk+1 = diag(12k , Vk+1 ) one finds that (V Wk+1 )T P(V Wk+1 ) = diag(Λ1 , . . . , Λk+1 , Qk+2 ). By induction, it follows that one may repeat this procedure until N − 2k < 2. If N is even, then N − 2k = 0 and the statement follows. If N is odd, then N − 2k = 1 and, since V T PV is antisymmetric, it follows that the (N N ) matrix element is zero, giving the stated result.  Returning to the case of a Poisson algebra generated by x1 , . . . , xm , assume for the moment that m = 2N for a positive integer N . By Proposition 4.13, there exists a matrix V V T PV = P0 where P0 is a block diagonal matrix of the form P0 = diag(Λ1 , . . . , ΛN ) with Λk =  0 −λk  λk . 0 In the same way, defining g0 = diag(g1 , . . . , gN ) with   λ 1 0 gk = λk 0 1 λ = λ1 · · · λN we set g = V g0 V T . Noting that P0 g0 P0 g0 P0 = −λ2 P0 one finds 0 = P0 g0 P0 g0 P0 + λ2 P0 = V T PV g0 V T P0 V gV T P0 V + λ2 V T PV  = V T PgPgP + λ2 P V It is a general fact that for an arbitrary matrix V there exists a matrix Ṽ such that Ṽ V = V Ṽ = (det V )1. Multiplying the above equation from the left by Ṽ T and from the right by Ṽ yields  (4.6) det(V )2 PgPgP + λ2 P = 0. As long as det(V ) is not a zero divisor, this implies that PgPgP = −λ2 P. Thus, given a finitely generated Poisson algebra A, the above procedure gives a rather general way to associate a localization A[λ−1 ] and a metric g to A, such that (A[λ−1 ], {x1 , . . . , xm }, g) is a Kähler–Poisson algebra. Note that the above argument, with only slight notational changes, also applies to the case when m is odd, in which case an extra block of 0 will appear in P0 . 16 JOAKIM ARNLIND AND AHMED AL-SHUJARY 5. The Levi-Civita connection Since every Kähler–Poisson algebra is also a metric Lie-Rinehart algebra, the results of Section 3 immediately applies. In particular, there exists a unique torsion-free and metric connection on the module g. In this section, we shall derive an explicit expression for the Levi-Civita connection of an arbitrary Kähler–Poisson algebra. It turns out to be convenient to formulate the results in terms of the generators {D1 , . . . , Dm }. Kozul’s formula gives the connection as    2g(∇Di Dj , Dk ) = Di g(Dj , Dk ) + Dj g(Dk , Di ) − Dk g(Di , Dj ) (5.1) − g([Dj , Dk ], Di ) + g([Dk , Di ], Dj ) + g([Di , Dj ], Dk ), and one notes that an element α = a{b, ·} ∈ g may be recovered from g(α, Di ) as g(α, Di )Di (f ) = a{b, xk }Di k Di (f ) = a{b, xk }Dk (f ) = a{b, f } = α(f ). Thus, one immediately obtains ∇Di Dj = g(∇Di Dj , Dk )Dk . However, it turns out that one can obtain a more compact formula for the connection. Let us start by proving the following result.   Lemma 5.1. g([Di , Dj ], Dk ) = Di Djk − Dj Dik . Proof. For convenience, let us introduce the notation P̂ ij = η{xi , xj } and, consequently, P̂ i j = P̂ ik gkj . In this notation, one finds Di (a) = P̂ i j {a, xj }. Thus, one obtains g([Di , Dj ], Dk ) = [Di , Dj ](xl )Dk l = P̂ i m {Djl , xm }Dk l − P̂ j n {Dil , xn }Dk l  = P̂ i m {P̂ j n {xl , xn }, xm } − P̂ j n {P̂ i m {xl , xm }, xn } Dk l  = P̂ i m P̂ j n − {{xn , xl }, xm } − {{xl , xm }, xn } Dk l  + P̂ i m {P̂ j n , xm }{xl , xn } − P̂ j n {P̂ i m , xn }{xl , xm } Dk l = P̂ i m P̂ j n {{xm , xn }, xk } + P̂ i m {P̂ j n , xm }{xk , xn } − P̂ j n {P̂ i m , xn }{xk , xm }, by using the Jacobi identity together with {a, xi }Dk i = {a, xk }. Furthermore, in the second and third term, one uses Leibniz’s rule to obtain g([Di , Dj ], Dk ) = P̂ i m P̂ j n {{xm , xn }, xk } + P̂ i m {P̂ j n {xk , xn }, xm } − P̂ i m P̂ j n {{xk , xn }, xm } − P̂ j n {P̂ i m {xk , xm }, xn } + P̂ j n P̂ i m {{xk , xm }, xn }  = P̂ i m P̂ j n {{xm , xn }, xk } + {{xn , xk }, xm } + {{xk , xm }, xn }   + Di Djk − Dj (Dik ) = Di Djk − Dj (Dik ), by again using the Jacobi identity.  The above result allows for the following formulation of the Levi-Civita connection for a Kähler–Poisson algebra. Proposition 5.2. If ∇ denotes the Levi-Civita connection of a Kähler–Poisson algebra K then 1 1 1 (5.2) ∇Di Dj = Di (Djk )Dk − Dj (Dik )Dk + Dk (Dij )Dk , 2 2 2 KÄHLER–POISSON ALGEBRAS 17 or, equivalently, ∇Di Dj = Γij k Dk where (5.3) Γij k = 1 1 1 i jl D (D )Dlk − Dj (Dil )Dlk + Dk (Dij ). 2 2 2 Proof. Since g(Di , Dj ) = Dij , Kozul’s formula (5.1) together with Lemma 5.1 gives 2g(∇Di Dj , Dk ) = Di (Djk ) + Dj (Dki ) − Dk (Dij ) − Dj (Dki ) + Dk (Dji ) + Dk (Dij ) − Di (Dkj ) + Di (Djk ) − Dj (Dik ) = Di (Djk ) − Dj (Dki ) + Dk (Dij ), which proves (5.2). The fact that one may write the connection as ∇Di Dj = Γij k Dk follows from Dij Dj = Di and Dk (a)Dk (b) = Dk (a)Dk (b).  Thus, for arbitrary elements of g, one obtains ∇α β = α(βi )Di + Γij k αi βj Dk (5.4) where α = αi Di and β = βi Di , and curvature is readily introduced as R(α, β)γ = ∇α ∇β γ − ∇β ∇α γ − ∇[α,β] γ. Ricci curvature is defined as Ric(α, β) = tr γ → R(γ, α)β and using the trace from Section 4.1, one obtains  Ric(α, β) = g(R(Di , α)β, Dj )Dij . To define the scalar curvature, one considers the Ricci curvature as a linear map Ric : g → g with Ric(α) = Ric(α, Di )Di , giving   S = tr α → Ric(α) = g R(Di , Dk )Dl , Dj Dij Dkl . Note that since the metric is nondegenerate, there exists a unique element ∇f ∈ g such that g(∇f, α) = α(f ) for all α ∈ g; we call ∇f the gradient of f . Now, it is easy to see that ∇f = Di (f )Di since g(Di (f )Di , αj Dj ) = Di (f )αj Dij = αj Dj (f ) = α(f ). The divergence of an element α ∈ g is defined as div(α) = tr(β → ∇β α), and, finally, the Laplacian ∆(f ) = div(∇f ). 18 JOAKIM ARNLIND AND AHMED AL-SHUJARY 6. Examples As shown in Section 2, the algebra of smooth functions on an almost Kähler manifold M becomes a Kähler–Poisson algebra when choosing x1 , . . . , xm to be embedding coordinates, providing an isometric embedding into Rm , endowed with the standard Euclidean metric. (Recall that, by Nash’s theorem [Nas56], such an embedding always exists.) In this section, we shall present examples of a more algebraic nature to illustrate the fact that algebras of smooth functions are not the only examples of Kähler–Poisson algebras. Keeping in mind the general construction procedure in Section 4.3, we consider finitely generated Poisson algebras with a low number of generators. 6.1. Poisson algebras generated by two elements. Let A be a unital Poisson algebra generated by the two elements x1 = x ∈ A and x2 = y ∈ A, and set   0 {x, y} P= −{x, y} 0 It is easy to check that for an arbitrary symmetric matrix g PgPgP = −{x, y}2 det(g)P. Thus, as long as {x, y}2 det(g) is not a zero-divisor, one may localize to obtain a Kähler–Poisson algebra K = (A[({x, y}2 det(g))−1 ], {x, y}, g). For the sake of illustrating the concepts and formulas we have developed so far, let us explicitly work out an example based on an algebra A0 , generated by two elements. Let us start by choosing an element λ ∈ A0 for which the localization A = A0 [p−1 , λ−1 ] exists, and then defining the metric as   1 1 0 g= λ 0 1 From the above considerations, we know that (A, {x, y}, g) is a Kähler–Poisson algebra with η = λ2 /p2 , where p = {x, y}. For convenience we also introduce γ = p/λ such that η = 1/γ 2. Let us start by computing the derivations Dx = D1 and Dy = D2 , which generate the module g: λ 1 {·, y} = − {y, ·} p γ λ 1 Dy = η{y, xi }gij {·, xj } = − {·, x} = {x, ·} p γ Dx = η{x, xi }gij {·, xj } = as well as 1 x 1 D and Dy = g2k Dk = Dy . λ λ Moreover, they provide an orthogonal set of generators since Dx = g1k Dk = 1 1 1 p2 {y, xi }gij {y, xj } = 2 =λ γ γ γ λ g(Dy , Dy ) = λ g(Dx , Dy ) = 0, g(Dx , Dx ) = KÄHLER–POISSON ALGEBRAS and one obtains  (Dij ) = g(Di , Dj ) = 19   λ 0 . 0 λ Note that g is a free module with basis {Dx , Dy } since ( ( x y −a γ1 {y, x} = 0 aD (x) + bD (x) = 0 aDx + bDy = 0 ⇒ ⇒ b γ1 {x, y} = 0 aDx (y) + bDy (y) = 0 ⇒ ( a=0 b=0 by using that λ is invertible. Let us introduce the derivation Dλ = γ −1 {λ, ·} and note that 1 x 1 D (λ)Dy − Dy (λ)Dx . λ λ From Proposition 5.2 one computes the connection: 1 1 1 ∇Dx Dx = D1 (D1k )Dk − D1 (D1k )Dk + Dk (D11 )Dk 2 2 2 1 y 1 i 1 x = D (λ)Dx + D (λ)Dy = D (λ)Di 2 2 2 and similarly 1 1 ∇Dy Dy = Dx (λ)Dx + Dy (λ)Dy = ∇Dx Dx 2 2 1 y 1 x y ∇Dx D = D (λ)Dy − D (λ)Dx = Dλ 2 2 1 1 y x ∇Dy D = D (λ)Dx − Dx (λ)Dy = −Dλ 2 2 Moreover, the curvature can readily be computed    1  y 1 x y x 2 2 x y R(D , D )D = Dx (λ) + Dy (λ) − Dx D (λ) − Dy D (λ) D 2 2     x 1 1 x y y 2 2 x y R(D , D )D = − Dx (λ) + Dy (λ) − Dx D (λ) − Dy D (λ) D , 2 2 Dλ = [Dx , Dy ] = as well as the scalar curvature    1 S= Dx Dx (λ) + Dy Dy (λ) − 2Dx (λ)2 − 2Dy (λ)2 . λ Moreover, one finds that ∇f = Dx (f )Dx + Dy (f )Dy div(αx Dx + αy Dy ) = Dx (αx ) + Dy (αy )   ∆(f ) = Dx Dx (f ) + Dy Dy (f )   = Dx Dx (f ) + Dy Dy (f ) − Dx (λ)Dx (f ) − Dy (λ)Dy (f ). 6.2. Poisson algebras generated by three elements. Let A be a unital Poisson algebra generated by x1 = x, x2 = y, x3 = z ∈ A. Writing {x, y} = a, {y, z} = b and {z, x} = c, i.e.   0 a −c b , P = −a 0 c −b 0 20 JOAKIM ARNLIND AND AHMED AL-SHUJARY one readily checks that for an arbitrary symmetric matrix g PgPgP = −τ P with τ = a2 |g|33 + b2 |g|11 + c2 |g|22 + 2ab|g|31 − 2ac|g|32 − 2bc|g|21 , where |g|ij denotes the determinant of the matrix obtained from g by deleting the i’th row and the j’th column. Thus, one may construct the Kähler–Poisson algebra K = {A[τ −1 ], {x, y, z}, g}. In particular, if g = diag(λ, λ, λ), then τ = λ2 (a2 + b2 + c2 ). Let us now construct a particular class of algebras with a natural geometric interpretation and a close connection to algebraic geometry. Let R[x, y, z] be the polynomial ring in three variables over the real numbers, and write x1 = x, x2 = y and x3 = z. For arbitrary C ∈ R[x, y, z], it is straight-forward to show that {xi , xj } = εijk ∂k C, where εijk denotes the totally antisymmetric symbol with ε123 = 1, defines a Poisson structure on R[x, y, z] which is well-defined on the quotient AC = R[x, y, z]/(C) since {xi , C} = {xi , xj }∂j C = εijk (∂k C)(∂j C) = 0. In the spirit of algebraic geometry, the algebra AC has a natural interpretation as the polynomial functions on the level set C(x, y, z) = 0 in R3 . Choosing the metric gij = δij 1 (corresponding to the Euclidean metric on R3 ) one obtains a Kähler–Poisson algebra (AbC , {x, y, z}, g) where 2 2 2 AbC = AC [τ −1 ] and τ = ∂x C + ∂y C + ∂z C , with η = τ −1 . Note that the points in R3 , for which τ (x, y, z) = 0, coincide with the singular points of C(x, y, z) = 0; i.e. points where ∂x C = ∂y C = ∂z C = 0. As an illustration, let us choose C = 21 (ax2 + by 2 + cz 2 − 1) for a, b, c ∈ R, giving {x, y} = cz, {y, z} = ax and and η = a2 x2 + b2 y 2 + c2 z 2 together with  b 2 y 2 + c2 z 2 ij  −abxy (D ) = η −acxz −abxy a2 x2 + c2 z 2 −bcyz {z, x} = by. −1  −acxz −bcyz  . 2 2 a x + b2 y 2 A straight-forward, but somewhat lengthy, calculation gives  x  x  x  x D D D D b D y  b D y  R(Dy , Dz ) Dy  = ax R R(Dx , Dy ) Dy  = cz R Dz Dz Dz Dz    x  x 0 −cz by D D b = abcη 3  cz b Dy  where R 0 −ax , R(Dz , Dx ) Dy  = by R z z −by ax 0 D D KÄHLER–POISSON ALGEBRAS 21 and the scalar curvature becomes S = 2abcη 2 . 7. Summary In this note, we have introduced the concept of Kähler–Poisson algebras as a mean to study Poisson algebras from a metric point of view. As shown, the single relation (4.1) has consequences that allow for an identification of geometric objects in the algebra, which share crucial properties with their classical counterparts. The idea behind the construction was to identify a distinguished set of elements in the algebra that serve as “embedding coordinates”, and then construct the projection operator D that projects from the tangent space of the ambient manifold onto that of the embedded submanifold. It is somewhat surprising that (4.1) encodes the crucial elements that are needed for the algebra to resemble an algebra of functions on an almost Kähler manifold. As outlined in Section 4.3, a large class of Poisson algebras admit a Kähler– Poisson algebra as an associated localization, which shows a certain generality of our treatment. Thus, even if one is not interested in metric structures on a Poisson algebra, the tools we have developed might be of help. For instance, if a Poisson algebra can be given the structure of a Kähler–Poisson algebra, one immediately concludes that the module generated by the inner derivations is a finitely generated projective module. A statement which is clearly independent of any metric structure. A comparison with differential geometry is close at hand, where the structure of a Riemannian manifold can be used to prove results about the underlying manifold (or even the topological structure). Let us end with a brief outlook. After having studied the basic properties of Kähler–Poisson algebras in this paper, there are several natural questions that can be studied. For instance, what is the interplay between the cohomology (of Lie-Rinehart algebras) and the Levi-Civita connection? Can one perhaps use the connection to compute cohomology? Is there a natural way to study the moduli spaces of Poisson algebras; i.e. how many (non-isomorphic) Kähler–Poisson structures does there exist on a given Poisson algebra? We hope to return to these, and many other interesting questions, in the near future. Acknowledgments We would like to thank M. Izquierdo for ideas and discussions. Furthermore, J. A. is supported by the Swedish Research Council. References [AH14] J. Arnlind and G. Huisken. Pseudo-Riemannian geometry in terms of multi-linear brackets. Lett. Math. Phys., 104(12):1507–1521, 2014. [AHH12] J. Arnlind, J. Hoppe, and G. Huisken. Multi-linear formulation of differential geometry and matrix regularizations. J. Differential Geom., 91(1):1–39, 2012. [Ber79] R. Berger. Géométrie algébrique de Poisson. C. R. Acad. Sci. Paris Sér. A-B, 289(11):A583–A585, 1979. [Bry88] J.-L. Brylinski. A differential complex for Poisson manifolds. J. Differential Geom., 28(1):93–114, 1988. [BS10] D. N. Blaschke and H. Steinacker. Curvature and gravity actions for matrix models. Classical Quantum Gravity, 27(16):165010, 15, 2010. 22 JOAKIM ARNLIND AND AHMED AL-SHUJARY [Hel01] S. Helgason. Differential geometry, Lie groups, and symmetric spaces, volume 34 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI, 2001. [Her53] J.-C. Herz. Pseudo-algèbres de Lie. I. C. R. Acad. Sci. Paris, 236:1935–1937, 1953. [Hue90] J. Huebschmann. Poisson cohomology and quantization. J. Reine Angew. Math., 408:57– 113, 1990. [Hue99] J. Huebschmann. Extensions of Lie-Rinehart algebras and the Chern-Weil construction. In Higher homotopy structures in topology and mathematical physics (Poughkeepsie, NY, 1996), volume 227 of Contemp. Math., pages 145–176. Amer. Math. Soc., Providence, RI, 1999. [Kar02] A. Karabegov. A covariant Poisson deformation quantization with separation of variables up to the third order. Lett. Math. Phys., 61(3):255–261, 2002. [Kon03] M. Kontsevich. Deformation quantization of Poisson manifolds. Lett. Math. Phys., 66(3):157–216, 2003. [Koz60] J. L. Kozul. Lectures on fibre bundles and differential geometry. Tata Institute of Fundamental Research, Bombay, 1960. [Lic77] A. Lichnerowicz. Les variétés de Poisson et leurs algèbres de Lie associées. J. Differential Geometry, 12(2):253–300, 1977. [Nas56] J. Nash. The imbedding problem for Riemannian manifolds. Ann. of Math. (2), 63:20– 63, 1956. [Nel67] E. Nelson. Tensor Analysis. Princeton University Press, Princeton, New Jersey, 1967. [Pal61] R. S. Palais. The cohomology of Lie rings. In Proc. Sympos. Pure Math., Vol. III, pages 130–137. American Mathematical Society, Providence, R.I., 1961. [Rin63] G. S. Rinehart. Differential forms on general commutative algebras. Trans. Amer. Math. Soc., 108:195–222, 1963. [Wei83] A. Weinstein. The local structure of Poisson manifolds. J. Differential Geom., 18(3):523– 557, 1983. (Joakim Arnlind) Dept. of Math., Linköping University, 581 83 Linköping, Sweden E-mail address: [email protected] (Ahmed Al-Shujary) Dept. of Math., Linköping University, 581 83 Linköping, Sweden E-mail address: [email protected]
0math.AC
Linear Recursion arXiv:1001.3368v4 [cs.LO] 25 Nov 2016 Sandra Alves1 , Maribel Fernández2 , Mário Florido1 , and Ian Mackie3 1 University of Porto, Faculty of Science & LIACC, R. do Campo Alegre 1021/55, 4169-007, Porto, Portugal 2 King’s College London, Department of Informatics Strand, London WC2R 2LS, U.K. 3 LIX, CNRS UMR 7161, École Polytechnique 91128 Palaiseau Cedex, France Abstract We define two extensions of the typed linear lambda-calculus that yield minimal Turingcomplete systems. The extensions are based on unbounded recursion in one case, and bounded recursion with minimisation in the other. We show that both approaches are compatible with linearity and typeability constraints. Both extensions of the typed linear lambda-calculus are minimal, in the sense that taking out any of the components breaks the universality of the system. We discuss implementation techniques that exploit the linearity of the calculi. Finally, we apply the results to languages with fixpoint operators: we give a compilation of the programming language PCF into a linear lambda-calculus with linear unbounded recursion. 1 Introduction Turing completeness is significant in computer science because it is a standard measure of computational power: all general purpose programming languages are Turing complete. There are a number of Turing-complete models of computation: Turing Machines, the λ-calculus, term rewriting systems, partial recursive functions, etc. We refer to these as computation models rather than programming languages, as the former can be seen as abstract representations of computing devices, where the emphasis is in the essential notions, whereas the latter include additional features to make representing data and algorithms easier. In this paper, we are interested in minimal models of computation that are Turing complete (or universal). In particular, we contribute to the collection of universal systems based on the typed λ-calculus, which is a paradigmatic model of functional computation. There are several approaches to build a Turing complete system starting from a typed λcalculus. To obtain a minimal system, our starting point is the typed linear λ-calculus, and we add the least machinery needed to obtain a complete system. The linear λ-calculus [1] is a restriction of the λ-calculus that models linear functions, defined by syntactically linear terms where each variable occurs exactly once [38]. The linear λ-calculus captures the essence of functional computation, but it is computationally weak: all the functions terminate in linear time. In fact, the linear λ-calculus is operationally linear, that is, functions cannot duplicate or erase arguments during evaluation (see also [8, 41]). Operational linearity has great impact when the management of resources (copying and erasing of arguments) is important, as it can be used to efficiently implement garbage collection, for instance. Note however, that checking if a system is operationally linear relies on evaluation. On the other hand, syntactical linearity is easy to check, and it is well-known that compilers can make use of this information to optimise code. Syntactic linearity is relevant in several program analysis techniques, for instance, strictness analysis, pointer analysis, effects and resource analysis (see, e.g., [16, 22, 56, 54, 55, 1 49, 35, 21]). Linear functions are also relevant in hardware compilation [26]: circuits are static (i.e., they cannot be copied at run-time), so linear computations are more naturally compiled into hardware. Starting from the linear λ-calculus, we define two Turing-complete typed λ-calculi that are universal and syntactically linear: one is based on bounded iteration and minimisation, and the other uses unbounded recursion. In the context of the simply typed λ-calculus, interesting classes of programs can be captured by extensions of the linear λ-calculus based on bounded iteration (see, e.g., [27, 31, 9, 11, 34, 45, 52]). In particular, a linear version of Gödel’s System T , which we call System L, captures exactly the class of primitive recursive functions (PR), if iterators use only closed linear functions [19], whereas the same system with a closed reduction strategy [23] has all the computation power of System T [6]. The latter result shows some redundancy regarding duplication in System T , which can be achieved through iteration or through non-linear occurrences of the bound variable in the body of a function. In recursion theory, Turing completeness can be achieved by adding a minimisation operator to a first-order linear system built from a set of linear initial functions and a linear primitive recursion scheme [4]. A similar result is shown in this paper for the linear λ-calculus: an extension of System L with a minimiser, which we call System Lµ , is Turing-complete. In System Lµ , both iteration and minimisation are needed to achieve completeness. Alternatively, Turing completeness can be achieved by adding a fixpoint operator to a typed λ-calculus (as it is done in PCF [51]). This approach has been used to extend linear functional calculi (see, e.g., [46, 15, 50, 17]), however, it relies on the existence of a non-linear conditional which throws away a possibly infinite computation in one of the branches. The question that arises is, what is the minimal extension of the typed linear λ-calculus that yields a Turing complete system, compatible with the notion of linear function? We show how to obtain a Turing-complete typed linear λ-calculus through the use of an unbounded recursor with a built-in test on pairs, which allows the encoding of both finite iteration and minimisation. More precisely, we define System Lrec , a linear λ-calculus extended with numbers, pairs and a linear unbounded recursor, with a closed-reduction strategy. We show that Lrec is Turing-complete and can be easily implemented: we give an abstract machine whose configurations consist simply of a pair of term and a stack of terms. System L, System Lrec and System Lµ use a closed-reduction strategy in order to preserve linearity and accommodate iteration or recursion. This strategy is inspired by the closed cutelimination strategy defined by Girard [29] for proof nets, which was adapted to the λ-calculus in [23]. Closed cut elimination is a simple and exceptionally efficient strategy in terms of the number of cut elimination steps. In the λ-calculus, it avoids α-conversion while allowing reductions inside abstractions (in contrast with standard weak strategies), thus achieving more sharing of computation. An alternative approach to preserve linearity of systems with iterators or recursors is to consider a “closed-at-construction” discipline: the function used in a bounded or unbounded recursor should be closed when the recursor is built (rather than closed at the time of reduction). In this paper, we consider both approaches and analyse their computational power. Although in the case of linear calculi with bounded recursion closed reduction and closed construction capture different classes of functions, we show that both disciplines yield Turing-complete systems in calculi with unbounded recursion. Summarising, this paper investigates the relationship between linearity and bounded/unbounded recursion in typed functional theories, aiming at obtaining minimal Turing complete systems. The main contributions are: • We define two extensions of the typed linear λ-calculus: Lrec , a linear calculus with numbers, pairs and an unbounded recursor, with a closed-reduction strategy; and Lµ , a linear λcalculus extended with numbers, pairs, a bounded recursor and a minimisation operator, also with a closed-reduction strategy. We show some properties regarding reduction (such as subject-reduction and confluence), and prove Turing completeness of both systems by encoding the set of partial recursive functions in Lrec and Lµ . We also show that both systems 2 are minimal, in the sense that taking out any of their components breaks the universality of the system. Lrec relies only on unbounded recursion, whereas Lµ needs both the iterator and the minimiser. • We explore some implementation issues for Lrec : we give call-by-name and call-by-value evaluation strategies, and define a simple abstract machine, exploiting its linearity. • We study the interplay between linearity and recursion based on fixpoint combinators, and define an encoding of PCF into Lrec , which combined with the definition of an abstract machine for Lrec , gives a new implementation of PCF via a simple stack-based abstract machine. • We study the interplay between linearity and closed-reduction/closed-construction disciplines in systems with bounded iteration and in systems with unbounded recursion. Related Work Extensions of the linear λ-calculus based on bounded iteration capture interesting classes of programs and have been used to characterise complexity classes (see, e.g., [27, 31, 9, 11, 34, 45, 52]). However, in this paper we are interested in Turing complete systems, so bounded iteration is not sufficient. Several approaches to obtain Turing complete system are described in the literature, inspired by the work on linear logic [28]. In linear logic, linearity is the default, and copying is obtained by the use of the “of course” exponential operator (!). To recover the full power of linear logic, the linear calculi defined in [1, 46, 36] provide explicit syntactical constructs for copying and erasing terms, corresponding to the exponentials in linear logic. However, adding only copy and erase constructs to the typed linear λ-calculus does not yield a universal system (see Section 3). In these works, some form of unbounded recursion (using for instance fixpoint combinators and conditionals) is also included. Moreover, copy and erase constructs are superfluous once recursion is added: a PCF-like language with explicit resource management is not minimal (copy and erase constructs are not needed). Instead, copy and erase can be encoded through bounded or unbounded recursion as shown in this paper (see also [10, 2, 3]). Several abstract machines for linear calculi are available in the literature (see for instance [47, 55, 44]). The novelty here is that we implement a calculus that is syntactically linear (in the sense that each variable is linear in Lrec terms) and therefore there is no need to include in the abstract machine an environment (or store in the terminology of [55]) to store bindings for variables. As an application, we give a compilation of the full PCF language into Lrec , establishing a relation between unbounded recursion and recursion through the use of fixpoint operators. For Lrec , which combines syntactical linearity with closed reduction, the fragment without recursion is operationally linear; erasing and duplication can only be done by the recursor (in linear logic [28] this is done by the use of exponentials, and in other linear calculi [1, 46, 36, 55] by explicit syntactical constructs). Moreover, only closed terms can be erased or duplicated in Lrec . There are several other domains where linearity plays a key role. For instance, in the area of quantum computation, the no-cloning theorem, which states that qubits cannot be duplicated, is one of the most important results in the area. This property is captured by a linear calculus [53]. In concurrent calculi, like the π-calculus [48], a key aspect is the notion of name, and the dual role that names play as communication channels and variables. The linear π-calculus [43] has linear (useonce) channels, which leads to clear gains in efficiency and on program analysis avoiding several problems of channel sharing. Also, inspired by the works by Kobayashi, Pierce and Turner [43] and the works by Honda [37] on session types, several type systems for the π-calculus rely directly on linearity to deal with resources, non-interference and effects [32, 57]. In this paper we focus on functional computations, and aim at obtaining linear, universal models of computation that can serve as a basis for the design of programming languages. Our approach is to begin with the linear λ-calculus, and achieve Turing-completeness in a controlled way. This paper is an extended and revised version of [7], where Lrec was first defined. Here, we provide proofs of Subject Reduction, confluence and Turing completeness of Lrec , introduce Lµ , 3 analyse the power of iteration, minimisation, recursion and fixpoint operators in linear calculi, and compare the closed-reduction and closed-construction approaches. 2 Preliminaries: Linear Iteration In this section we recall the definition of System L [6], a linear version of Gödel’s System T (for details on the latter see [30]). We assume the reader is familiar with the λ-calculus [12]. System L is an extension of the linear λ-calculus [1] with numbers, pairs, and an iterator. Linear λ-terms t, u, . . . are inductively defined by: x ∈ Λ, λx.t ∈ Λ if x ∈ fv(t), and tu ∈ Λ if fv(t)∩fv(u) = ∅. Note that x is used at least once in the body of the abstraction, and the condition on the application ensures that all variables are used at most once. Thus these conditions ensure syntactic linearity (variables occur exactly once). In System L we also have numbers, generated by 0 and S, with an iterator: iter t u v if fv(t) ∩ fv(u) = fv(u) ∩ fv(v) = fv(v) ∩ fv(t) = ∅ and pairs: ht, ui let hx, yi = t in u if fv(t) ∩ fv(u) = ∅ if x, y ∈ fv(u) and fv(t) ∩ (fv(u) − {x, y}) = ∅ Since λ and let are binders, terms are defined modulo α-equivalence as usual. Note that, when projecting from a pair, we use both projections. A simple example is the function that swaps the components of a pair: λx.let hy, zi = x in hz, yi. In examples below we use tuples of any size, built from pairs. For example, hx1 , x2 , x3 i = hx1 , hx2 , x3 ii and let hx1 , x2 , x3 i = u in t represents the term let hx1 , yi = u in let hx2 , x3 i = y in t. System L uses a closed reduction strategy. The reduction rules for System L are given in Table 1. Substitution is a meta-operation defined as usual, and reductions can take place in any context. Name Beta Let Iter0 IterS Reduction (λx.t)v → let hx, yi = ht, ui in v → iter 0 u v → iter (S t) u v → t[v/x] (v[t/x])[u/y] u v(iter t u v) Condition fv(v) = ∅ fv(t) = fv(u) = ∅ fv(v) = ∅ fv(v) = ∅ Table 1: Closed reduction in System L Note that the Iter rules are only triggered when the function v is closed. Thanks to the use of a closed reduction strategy, iterators on open linear functions are accepted in System L (since these terms are syntactically linear), and reduction preserves linearity. The closedness conditions in rules Beta and Let are not necessary to preserve linearity (since variables are used linearly in abstractions and lets), but they ensure that all the substitutions created during reduction are closed (thus, there is no need to perform α-conversions during reduction). Normal forms are not the same as in the λ-calculus (for example, λx.(λy.y)x is a normal form), but closed reduction is still adequate for the evaluation of closed terms (if a closed term has a weak head normal form, it will be reached [6]). Closed reduction can also be used to evaluate open terms, using the “normalisation by evaluation” technique [14] as shown in [23, 24] (in the latter director strings are used to implement closedness tests as local checks on terms). System L is a typed calculus. Note that, although linear, some untyped terms are not strongly normalisable. For instance, ∆∆ where ∆ = λx.iter S 2 0 (λxy.xy) (λy.yx) reduces to itself. However, the linear type system defined in [6] ensures strong normalisation. We recall the type definitions for System L below. 4 Axiom and Structural Rule: Γ, x : A, y : B, ∆ ⊢ t : C (Axiom) x:A⊢x:A Γ, y : B, x : A, ∆ ⊢ t : C (Exchange) Logical Rules: Γ, x : A ⊢ t : B Γ ⊢ λx.t : A −◦ B Γ⊢t:A ∆⊢u:B Γ, ∆ ⊢ ht, ui : A ⊗ B Γ ⊢ t : A −◦ B (−◦Intro) (⊗Intro) Γ, ∆ ⊢ tu : B Γ ⊢t: A⊗B Numbers: ⊢0:N Γ⊢t:N ∆⊢u:A (Zero) (−◦Elim) ∆, x : A, y : B ⊢ u : C Γ, ∆ ⊢ let hx, yi = t in u : C (⊗Elim) Γ⊢n:N (Succ) Γ⊢Sn:N Θ ⊢ u : A ∆ ⊢ v : A −◦ A Γ, Θ, ∆ ⊢ iter t u v : A (Iter) Table 2: Type System for System L The syntax of terms in L does not include type annotations, instead we will use a type assignment system based on linear types. The set of linear types is generated by the grammar: A, B ::= N | A −◦ B | A ⊗ B where N is the type of numbers. A type environment Γ is a list of type assumptions of the form x : A where x is a variable and A a type, and each variable occurs at most once in Γ. We write dom(Γ) to denote the set of variables that occur in Γ. We write Γ ⊢ t : A if the term t can be assigned the type A in the environment Γ using the typing rules in Table 2. Note that the only structural rule is Exchange, we do not have Weakening and Contraction rules: we are in a linear system. For the same reason, the logical rules split the context between the premises (i.e., the variable conditions in Table 3 are enforced by the typing rules). System L has all the power of System T ; we refer to [6] for more details and examples. 3 Towards a Minimal Universal Type System In this section we will present two universal type systems which extend the linear λ-calculus: Lrec and Lµ . While Lrec is a linear calculus with an unbounded recursor, Lµ is a linear calculus where recursion is obtained through iteration and minimisation. We show that both typed calculi are universal and minimal (in the sense that all their constructors are necessary for the system to be universal). We avoid introducing superfluous operators and rules, such as copy and erase combinators. Indeed, these can be encoded using recursion, as we will show in this section. The reverse is not true (although in an untyped system, adding copy and erase combinators to the linear λ-calculus would produce a Turing-complete system). More precisely, the untyped linear λ-calculus extended with linear pairs and projections, and copy and erase combinators (c and w) with the following reduction rules: c t → ht, ti fv(t) = ∅ w t → (λx.x) f v(t) = ∅ has the computational power of the pure untyped λ-calculus, but the same does not follow if we 5 Construction 0 St rec t1 t2 t3 t4 x tu λx.t ht, ui let hx, yi = t in u Variable Constraint − − fv(ti ) ∩ fv(tj ) = ∅, for i 6= j − fv(t) ∩ fv(u) = ∅ x ∈ fv(t) fv(t) ∩ fv(u) = ∅ x, y ∈ fv(u), fv(t) ∩ fv(u) = ∅ Free Variables (fv) ∅ fv(t) ∪fv(ti ) {x} fv(t) ∪ fv(u) fv(t) r {x} fv(t) ∪ fv(u) fv(t) ∪ (fv(u) r {x, y}) Table 3: Terms in System Lrec Name Rec0 RecS rec h0, t′ i u v w rec hS t, t′ i u v w Reduction → u → v(rec (wht, t′ i) u v w) Condition fv(t′ vw) = ∅ fv(vw) = ∅ Table 4: Closed reduction for recursion consider typed terms. The typing rules for c and w are: Γ⊢t:A Γ⊢t:B Γ ⊢ c t:A⊗A Γ ⊢ w t : A −◦ A Since this system can be encoded in System L (see [6]), which is not Turing complete (all typable terms are terminating), we conclude that the typed linear λ-calculus with pairs, projections and the combinators c and w is not universal. Another way to obtain Turing completeness of typed λ-calculi is via fixpoint operators and conditionals, as done in PCF [51]. In Section 5 we discuss fixpoints in the presence of linearity and study the relation between Lrec and PCF. 3.1 Linear Unbounded Recursion In this section we define Lrec , an extension of the linear λ-calculus [1] with numbers, pairs, and a typed unbounded recursor with a closed reduction strategy that preserves syntactic linearity. We prove that this system is Turing complete. The syntax of System Lrec is similar to that of System L (recalled in Section 2), except that instead of a bounded iterator we have a recursor working on pairs of natural numbers. Table 3 summarises the syntax of terms in Lrec . We assume Barendregt’s convention regarding names of free and bound variables in terms (in particular, bound names are different from free names). The reduction rules for Lrec are Beta and Let, given in Table 1, together with two rules for the recursor shown in Table 4. Note that the Rec rules are only triggered when the closedness conditions hold, thus linearity is preserved by reduction. The conditions on Beta and Let are orthogonal to the linearity issues (as explained in the previous section, they simply produce a more efficient strategy of reduction) and do not affect the technical results of the paper (we discuss the role of closed reduction in System L and System Lrec in more detail in Section 6). The Rec rules pattern-match on a pair of numbers (the usual bounded recursor works on a single number). This is because we are representing both bounded and unbounded recursion with the same operator (as the examples below illustrate), which requires (for a particular n and function f ) being able to test the value of f (n), and access the value n. An alternative would be to have an extra parameter of type N in the recursor. 6 Example 1 We illustrate the use of the recursor by encoding some standard functions in System Lrec . • Bounded iteration Let I be the identity function λx.x. System L’s iterator can be encoded in Lrec using the term “iter” defined as follows: def “iter” t u v = rec ht, 0i u v I We will show later that this term has the same behaviour as System L’s iterator. • Projections and duplication of natural numbers The first and second projection functions on pairs ha, bi of natural numbers can be defined by using the numbers in a recursor. pr 1 pr 2 = = λx.let ha, bi = x in rec hb, 0i a I I λx.let ha, bi = x in rec ha, 0i b I I The following function C can be used to copy numbers: C = λx.rec hx, 0i h0, 0i (λx.let x = ha, bi in hSa, Sbi) I Other mechanisms to erase and copy numbers in Lrec will be shown later. • Arithmetic functions We can now define some arithmetic functions that we will use in the paper. – add = λmn.rec hm, 0i n (λx.Sx) I; – mult = λmn.rec hm, 0i 0 (add n) I; – pred = λn.pr 1 (rec hn, 0i h0, 0i F I) where F = λx.let ht, ui = C(pr 2 x) in ht, S ui; – iszero = λn.pr 1 (rec hn, 0i h0, S 0i (λx.C(pr 2 x)) I). The correctness of these encodings can be easily proved by induction. • Minimisation The examples above can also be defined in System L, using bounded recursion. Lrec is a more powerful system: it can encode the minimisation operator µf used to define partial recursive functions. Recall that if f : N → N is a total function on natural numbers, µf = min{x ∈ N | f (x) = 0}. Let f be a closed λ-term in Lrec representing a total function f on natural numbers. The encoding of µf is M = rec hf 0, 0i 0 (λx.S(x)) F where F = λx.let hy, zi = C(pr 2 x) in hf (Sy), Szi. We prove the correctness of this encoding below (see Theorem 2). We use the same notation for typing judgements in System L and System Lrec , since there will be no ambiguity. We write Γ ⊢ t : A if the term t can be assigned the type A in the environment Γ using the typing rules in Table 2, where we replace the rule for the iterator by the following rule: Γ⊢t:N⊗N Θ⊢u:A ∆ ⊢ v : A −◦ A Σ ⊢ w : N ⊗ N −◦ N ⊗ N Γ, Θ, ∆, Σ ⊢ rec t u v w : A Note that all the terms given in the example above can be typed. Theorem 1 (Properties of reductions in System Lrec ) 1. If Γ ⊢ t : T then dom(Γ) = fv(t). 2. Subject Reduction: Reductions preserve types. 7 (Rec) 3. Church-Rosser: System Lrec is confluent. 4. Adequacy: If ⊢ t : T in System Lrec , and t is a normal form, then: T =N T =A⊗B T = A −◦ B ⇒ t = S(S . . . (S 0)) ⇒ t = hu, si ⇒ t = λx.s 5. System Lrec is not strongly normalising, even for typeable terms. Proof: 1. By induction on type derivations. 2. By induction on type derivations, using a substitution lemma as usual. We show the case where the term has the form rec ht, t′ i u v w (for the other cases, the proof is the same as for System L [6]). Assume Γ ⊢ rec ht, t′ i u v w : A. If the reduction takes place inside t, t′ , u, v or w the property follows directly by induction. If the reduction takes place at the root, there are two cases: (a) rec h0, t′ i u v w → u if fv(t′ vw) = ∅. Then, by part 1, dom(Γ) = fv(rec h0, t′ i u v w) = fv(u). The type derivation may end with (Exchange), in which case the result is trivial, or with (Rec), in which case the derivation has conclusion Γ ⊢ rec h0, t′ i u v w : A with premises: ⊢ h0, t′ i : N ⊗ N, Γ ⊢ u : A, ⊢ v : A −◦ A, ⊢ w : N ⊗ N −◦ N ⊗ N. Therefore the property holds, directly from Γ ⊢ u : A. (b) rec hS t, t′ i u v w → v(rec (wht, t′ i) u v w) if fv(vw) = ∅. Reasoning in a similar way, we note that when the type derivation ends with an application of the rule (Rec), it has conclusion Γ, ∆ ⊢ rec hSt, t′ i u v w : A with premises Γ ⊢ hSt, t′ i : N ⊗ N, ∆ ⊢ u : A, ⊢ v : A −◦ A, and ⊢ w : N ⊗ N −◦ N ⊗ N. If Γ ⊢ hSt, t′ i : N ⊗ N, then we can deduce Γ ⊢ ht, t′ i : N ⊗ N, therefore we have Γ ⊢ wht, t′ i : N ⊗ N. Thus we can obtain Γ, ∆ ⊢ rec (wht, t′ i) u v w : A. From these we deduce Γ, ∆ ⊢ v(rec wht, t′ i u v w) : A as required. 3. Confluence can be proved directly, using Martin-Löf’s technique (as it was done for System L, see [2]) or can be obtained as a consequence of Klop’s theorem for orthogonal higher-order reduction systems [42]. 4. By induction on t. If t = 0, λx.t′ or ht1 , t2 i, then we are done. Otherwise: • If t = S t, it follows by induction. • If t = rec t0 t1 t2 t3 . Since t is in normal form, so are the terms ti . Since t is typable, t0 must be a term of type N ⊗ N, and by induction, t0 is a pair of numbers. But then one of the recursor rules applies (contradiction). • The cases of application and let are similar. 5. The following term is typable but is not strongly normalisable: rec hS(0), 0i 0 I (λx.let hy, zi = x in hS(y), zi) Another non-terminating typable term will be given later, using the encoding of a fixpoint operator.  8 Γ⊢t:N Γ ⊢ ht, 0i : N ⊗ N Θ⊢u:A ∆ ⊢ v : A −◦ A ⊢ I : N ⊗ N −◦ N ⊗ N Γ, Θ, ∆ ⊢ rec ht, 0i u v I : A Figure 1: Type derivation for “iter” t u v The Computational Power of System Lrec We now prove that System Lrec is Turing complete. Since System L can encode all the primitive recursive functions [2, 6], it suffices to show that System L is a subset of Lrec (therefore Lrec also encodes primitive recursion), and that one can encode minimisation. First we show that the encoding of System L’s iterator, defined in Example 1, behaves as expected. System L is a sub-system of Lrec . Proposition 1 “iter” t u v →∗ u “iter” t u v →∗ v(“iter” t1 u v) if t →∗ 0, fv(v) = ∅ if t →∗ S(t1 ), fv(v) = ∅ Proof: • If t →∗ 0: “iter” t u v def = rec ht, 0i u v I →∗ rec h0, 0i u v I → u, if fv(v) = ∅ • If t →∗ S(t1 ): def = rec ht, 0i u v I →∗ rec hS(t1 ), 0i u v I → v(rec Iht1 , 0i u v I), if fv(t1 v) = ∅ “iter” t u v def → v(rec ht1 , 0i u v I) = v(“iter” t1 u v)  If Γ ⊢ t : N, Θ ⊢ u : A, and ∆ ⊢ v : A −◦ A, then Γ, Θ, ∆ ⊢ rec ht, 0i u v I : A, that is “iter” t u v is properly typed in System Lrec , as shown in Figure 1. Corollary 1 System Lrec has all the computation power of System L, thus, any function definable in System T can be defined in Lrec . We now show that the encoding of the minimiser given in Section 1 behaves as expected. Theorem 2 (Minimisation in System Lrec ) Let f be a closed λ-term in Lrec , encoding the total function f on natural numbers. Consider the term M = rec hf 0, 0i 0 (λx.S(x)) F , with F = λx.let hy, zi = C(pr 2 x) in hf (Sy), Szi. The term M encodes µf . Proof: Consider the non-empty sequence S = f (i), f (i + 1), . . . , f (i + n), such that f (i + n) is the first element in the sequence that is equal to zero. Then rec hf (Si 0), Si 0i 0 (λx.S(x)) F →∗ Sn 0 We proceed by induction on the length of S. • Basis: S = f (i). Thus ∗ → rec hf (Si 0), Si 0i 0 (λx.S(x)) F rec h0, Si 0i 0 (λx.S(x)) F → 0 9 • Induction: If S = f (i), f (i + 1), . . . , f (i + n), then f (i) > 0, therefore f i reduces to a term of the form (S t). One easily notice that ∗ → →∗ (I.H.) ∗ → rec hf (Si 0), Si 0i 0 (λx.S(x)) F rec hSt, Si 0i 0 (λx.S(x)) F S(rec hf (Si+1 0), Si+1 0i 0 (λx.S(x)) F ) S(Sn−1 0) = Sn 0 Now, let j = min{x ∈ N | f (x) = 0}, and consider the sequence f (0), . . . , f (j). One easily notices that rec hf 0, 0i 0 (λx.S(x)) F →∗ Sj 0. Note that, if there exists no x such that f (x) = 0, then rec hf 0, 0i 0 (λx.S(x)) F diverges, and so does the minimisation of f .  Corollary 2 System Lrec is Turing complete. Erasing and Duplicating in Lrec There are various ways of encoding erasing and duplicating in Lrec . First note that, although in the linear λ-calculus we are not able to discard arguments of functions, terms are consumed by reduction. The idea of erasing by consuming is related to the notion of Solvability (see [12], Chapter 8) as it relies on reduction to the identity. Using this technique, in [2, 6] it is shown that in System L there is a general form of erasing. In Lrec this technique can be used to erase terms of type A, where A is a type generated by the grammar: A, B ::= N | A ⊗ B. In the definition of the erasing function E(t, A) we use a function M(A) to build a term of type A (E and M are mutually recursive). Definition 1 (Erasing) If Γ ⊢ t : A, then E(t, A) is defined as follows: E(t, N) E(t, A ⊗ B) E(t, A −◦ B) and M(N) M(A ⊗ B) M(A −◦ B) Theorem 3 = rec ht, 0i I I I = let hx, yi = t in E(x, A)E(y, B) = E(tM(A), B) = 0 = hM(A), M(B)i = λx.E(x, A)M(B) 1. If Γ ⊢ t : T then Γ ⊢ E(t, T ) : B −◦ B, for any type B. 2. M(T ) is closed and typeable: ⊢ M(T ) : T . 3. For any type T , E(M(T ), T ) →∗ I. 4. M(T ) is normalisable. Proof: The first two parts are proved by simultaneous induction on T , as done for System L [6]. The third part is proved by induction on T . • If T = N, then M(T ) = 0, and E(0, N) = rec h0, 0i I I I → I. • If T = A ⊗ B, then M(A ⊗ B) = hM(A), M(B)i, then E(hM(A), M(B)i, A ⊗ B) = let hx, yi = hM(A), M(B)i in E(x, A)E(y, B) (I.H.) → E(M(A), A)E(M(B), B) →∗ II → I Note that, by induction, E(M(A), A) →∗ I and E(M(B), B) →∗ I. 10 • If T = A −◦ B then M(T ) = λx.E(x, A)M(B), therefore = → (I.H.) ∗ → E(λx.E(x, A)M(B), A −◦ B) E((λx.E(x, A)M(B))M(A), B) E(E(M(A), A)M(B), B) (I.H.) E(IM(B), B) → E(M(B), B) →∗ I The last part is proved by induction on T .  Lrec , unlike System L, is not normalising, and there are terms that cannot be consumed using the technique described above. There are even normalising terms that cannot be erased by reduction. For example, consider the following term YN which represents a fixpoint operator (more details are given in Section 5): YN = λf.rec hS(0), 0i 0 f (λx.let hy, zi = x in hS(y), zi) This term is typable (it has type (N −◦ N) −◦ N) and is a normal form (the recursor rules do not apply because f is a variable). However, the term E(YN , (N −◦ N) −◦ N) = rec hYN (λx.E(x, N)0), 0i I I I does not have a normal form. On the positive side, closed terms of type N, or tuples where the elements are terms of type N, can indeed be erased using this technique. Erasing “by consuming” reflects the work that needs to be done to effectively dispose of a data structure (where each component is garbage collected). For arrow types, a different erasing mechanism will be defined in Section 5. Theorem 4 Let T be a type generated by the grammar: A, B ::= N | A ⊗ B. If ⊢ t : T and t has a normal form, then E(t, T ) →∗ I. Proof: By induction on T . • If T = N, then E(t, T ) = rec ht, 0i I I I. Since t is normalising, t →∗ v, and by the Adequacy result (Theorem 1), v = Sn 0, n ≥ 0. Therefore rec ht, 0i I I I →∗ rec hSn 0, 0i I I I →∗ I. • If T = A ⊗ B: E(t, T ) = let hx, yi = t in E(x, A)E(y, B). Since t is normalisable then, by Adequacy (Theorem 1), t →∗ v = hu, si. Thus let hx, yi = t in E(x, A)E(y, B) →∗ let hx, yi = hu, si in E(x, A)E(y, B) → E(u, A)E(s, B). By induction hypothesis E(u, A) →∗ I and E(s, B) →∗ I, therefore E(u, A)E(s, B) →∗ II → I.  There is also a mechanism to copy closed terms in Lrec : Definition 2 (Duplication) Define DA : A −◦ A ⊗ A as: λx.rec hS(S 0), 0i hM(A), M(A)i F I where F = (λy.let hz, wi = y in E(z, A)hw, xi). Theorem 5 If ⊢ t : A then DA t →∗ ht, ti. Proof: By the definition of →. DA t → →∗ →∗ →∗ →∗ rec hS(S 0), 0i hM(A), M(A)i (λy.let hz, wi = y in E(z, A)hw, ti) I (λy.let hz, wi = y in E(z, A)hw, ti)2 hM(A), M(A)i (λy.let hz, wi = y in E(z, A)hw, ti)(E(M(A), A)hM(A), ti) (λy.let hz, wi = y in E(z, A)hw, ti)hM(A), ti E(M(A), A)ht, ti →∗ ht, ti  11 3.2 System Lµ : Minimisation vs. Unbounded Recursion There are two standard ways of extending the primitive recursive functions so that all partial recursive functions are obtained. One is unbounded minimisation, the other is unbounded recursion. For first-order functions (i.e., functions of type level 1), both methods are equivalent, see for instance [13]. In this section we extend System L with a minimisation operator – we will refer to this extension as System Lµ – and establish its relation with System Lrec . Starting from System L, we add a minimiser with a typing rule Γ⊢t:N Θ⊢u:N ∆ ⊢ f : N −◦ N Γ, Θ, ∆ ⊢ µ t u f : N (Min) and two reduction rules: µ0uf µ (S t) u f → u, → µ (f (S u)) (S u) f fv(f ) = ∅ fv(f tu) = ∅ Theorem 6 (Properties of reductions in System Lµ ) 1. If Γ ⊢ t : T then dom(Γ) = fv(t). 2. Subject Reduction: If Γ ⊢ t : T and t −→ t′ then Γ ⊢ t′ : T . 3. System Lµ is confluent: If t −→∗ u and t −→∗ v then there is some term s such that u −→∗ s and v −→∗ s. Proof: 1. By induction on the type derivation. 2. Straightforward extension of the proof given for System L in [6], by induction on the type derivation Γ ⊢ t : T . We show the case where the term t is µ s u f and there is a type derivation ending in: Γ⊢s:N Θ⊢u:N ∆ ⊢ f : N −◦ N Γ, Θ, ∆ ⊢ µ s u f : N (Min) If the reduction step takes place inside s, u or f , the result follows directly by induction. If reduction takes place at the root, we have two cases: (a) µ 0 u f → u, with fv(f ) = ∅. Note that f v(µ 0 u f ) = fv(u) = dom(Θ) by part 1, and we have Θ ⊢ u : N. (b) µ (S t) u f → µ (f (S u)) (S u) f , with fv(tuf ) = ∅. Then f v(µ (S t) u f ) = ∅, and we have: ⊢St:N ⊢u:N ⊢ f : N −◦ N ⊢ µ (S t) u f : N Therefore: ⊢ f : N −◦ N ⊢Su:N ⊢ f (S u) : N (Min) ⊢u:N ⊢Su:N ⊢ f : N −◦ N ⊢ µ (f (S u)) (S u) f : N (Min) 3. Using Tait-Martin-Löf’s method (see [12] for more details).  Since System L, and therefore System Lµ , includes all the primitive recursive functions, to show Turing completeness of System Lµ it is sufficient to show that unbounded minimisation can be encoded. First, we recall the following result from Kleene [39], which uses the well-known minimisation operator µ (already mentioned in Example 1). 12 Theorem 7 (The Kleene normal form) Let h be a partial recursive function on Nk . Then, a number n and two primitive recursive functions f , g can be found such that h(x1 , . . . , xk ) = f (µg (n, x1 , . . . , xk )) where µg is the minimisation operator on the last argument of g, that is, µg (n, x1 , . . . , xk ) = min{y | g(n, x1 , . . . , xk , y) = 0}. As a consequence of Kleene’s theorem, we only have to prove that we can encode minimisation of primitive recursive functions in order to show Turing-completeness of Lµ , relying on the fact that primitive recursive functions can be encoded in System L. Below we give the encoding of minimisation for functions of arity 1 (the extension to functions of arity n > 1 is straightforward). Theorem 8 (Unbounded minimisation in System Lµ ) If f : N → N is a primitive recursive function and f is its encoding in System Lµ , then µf = µ (f 0) 0 f Proof: Similar to the proof for System Lrec (Theorem 2), considering the non-empty sequence S = f (i), f (i + 1), . . . , f (i + j), such that f (i + j) is the first element in the sequence that is equal to zero, and showing (by induction on the length of S) that: µ (f i) i f →∗ i + j.  Corollary 3 System Lµ is Turing complete. We can also encode System Lrec into System Lµ , simulating the recursor with iter and µ. Consider the following term: f = λn.pr 1 (iter n ht, t′ i (w ◦ pred1 ) where pred1 is such that pred1 hS(t), t′ i = ht, ti. The function f , given n, will produce pr 1 ((w ◦ pred1 )n ht, t′ i). Now consider (µ t 0 f ), which will lead to the following sequence: µ t 0 f → µ f (1) 1 f → µ f (2) 2 f → µ f (3) 3 f → ... → n where n is the minimum number such that (w ◦pred1 )n ht, t′ i produces h0, t′′ i. Now, one can encode rec ht, ti u v w as: iter (µ t 0 f ) u v Intuitively, rec hSt, t′ i u v w will iterate v until wht, t′ i is equal to zero, and that µ t 0 f will count the number of iterations that will actually be necessary, or will go on forever if that never happens. System Lµ is a minimal universal system in the sense that the subsystems obtained by taking out iter and µ, respectively, are not universal. Note that the subsystem without µ corresponds to System L and is therefore strongly normalising. Also note that, the minimiser cannot replace bounded iteration, either in recursion theory or in the typed λ-calculus, as we now show. Partial Recursive Functions without Bounded Iteration Lemma 1 For any function f (x1 , . . . , xm ), m ≥ 0, defined from the initial functions (0, S and projections) and composition, without using the primitive recursive scheme, there is a constant k such that, f (n1 , n2 , . . . , nm ) = ni +k or f (n1 , n2 , . . . , nm ) = k, for any given arguments n1 , . . . , nm ∈ N. Proof: Assume f (x1 , . . . , xm ) is defined by the expression e. We proceed by induction on e: The base cases (e = 0, e = S(x) and e = pr in (x1 , . . . , xm )) are trivial. Let us consider the composition case. If e = g(f1 (x1 , . . . , xm ), . . . , fj (x1 , . . . , xm )), where g and fi are previously defined functions, then by induction hypothesis fi (n1 , . . . , nm ) = ki , where ki = ki or ki = ni + ki for some constant ki . But then, by induction hypothesis g(k1 , . . . , kj ) = k or ki + k, and the result follows.  13 V is a value V ⇓V t ⇓ ht1 , t2 i V al s ⇓ λx.u st⇓V t1 ⇓ 0 u ⇓ V rec t u v w ⇓ V u[t/x] ⇓ V Rec1 App t ⇓ ht1 , t2 i (λxy.u)t1 t2 ⇓ V let hx, yi = t in u ⇓ V t ⇓ ht1 , t2 i t1 ⇓ S t′ Let v(rec (wht′ , t2 i) u v w) ⇓ V rec t u v w ⇓ V Rec2 Table 5: CBN evaluation for System Lrec Theorem 9 Minimisation applied to functions in the previous class either returns 0 or is not defined. Proof: By the previous lemma, when f (x1 , . . . , xn ) = 0, then either it is the constant function returning 0, or it returns 0 when the argument xi = 0. In the first case µf returns 0, and in the second case either i = n and then µf returns 0, or µf diverges.  System Lµ without Iteration Lemma 2 If ⊢ f : N −◦ N is a term in System Lµ without iter, µ: f (S t) →∗ S k 0, where k 6= 0 Proof: First note that f (S t) : N, and it is strongly normalisable1 . Therefore, by Adequacy, f (S t) →∗ Sk 0, for some k ≥ 0. Since f is linear, it cannot erase the S in its argument, therefore k 6= 0.  Theorem 10 Let ⊢ t : N, ⊢ u : N, ⊢ f : N −◦ N be terms in System Lµ without iter, µ. Then µ t u f either reduces to a reduct of u, or diverges. Proof: By Adequacy, t →∗ Sk 0, for some k. If k = 0, then µ 0 u f → u →∗ m, using the first rule for µ. If k 6= 0 then, using the second rule for µ, the computation diverges because, by the previous lemma, f (Sk 0) with k 6= 0, will never reduce to 0.  This theorem is stated for closed terms, but is valid also if t →∗ 0 and u is an open term. Otherwise, if we have open terms the rule for µ will not apply. Lrec can be seen as a more compact version of System Lµ where the recursor can perform both bounded iteration or minimisation. 4 Evaluation Strategies for System Lrec In this section we define two evaluation strategies for System Lrec and derive a stack-based abstract machine. Call-by-name The CBN evaluation relation for closed terms in System Lrec is defined in Table 5. The notation t ⇓ V means that the closed term t evaluates in System Lrec to the value V . Values are terms of the form 0, St, λx.t and hs, ti, i.e., weak head normal forms (whnf). Note that System Lrec does not evaluate under a S symbol, since S is used as a constructor for natural numbers. Also note that no closedness conditions are needed in the evaluation rules for closed terms. The rule Let is given using application to simplify the presentation (in this way, we will be able to reuse this rule when we define the call-by-value evaluation relation below). The evaluation relation · ⇓ · corresponds to standard reduction to weak head normal form. Recall that a reduction is called standard if the contraction of redexes is made from left-to-right 1 We are in a proper subset of System L, for which the properties of Strong Normalisation and Adequacy hold [6]. 14 (i.e., leftmost-outermost). It is well known that for the λ-calculus [12], the standard reduction is normalising, that is, if a term has a normal form, then it will be reached. A “standardisation” result holds for closed terms in Lrec , as the following theorem shows. Theorem 11 (Standardisation) If ⊢ t : T (i.e., t is a closed term in Lrec ) and t has a whnf, then t ⇓ V , for some value V . Proof: We rely on Klop’s result [40, 20], which states that leftmost-outermost reduction is normalising for left-normal orthogonal Combinatory Reduction Systems (CRSs). A CRS is orthogonal if its rules are left-linear (i.e., the left hand-sides of the rewrite rules contain no duplicated variables) and non-overlapping (there are no critical pairs). A CRS is left-normal if on the left hand-sides of the rewrite rules, all the function symbols appear before the variables. The λ-calculus is an example of a left-normal orthogonal CRS, as is System Lrec . Therefore, leftmost-outermost reduction is normalising for Lrec . The result follows, since CBN performs leftmost-outermost reduction.  For open terms, the set of weak head normal forms includes not only values but also other kinds of terms, since, for instance, reduction of an application is blocked if the argument is open. However, an evaluation procedure can also be defined for open terms using closed reduction, if we consider all the free variables as constants as shown in [23] (see also [14]). Call-by-value A call-by-value evaluation relation for System Lrec can be obtained from the CBN relation by changing the rule for application, as usual. s ⇓ λx.u t⇓V′ u[V ′ /x] ⇓ V st⇓V There is no change in the Rec and Let rules, since they rely on the App rule. Unlike CBN, the CBV strategy does not always reach a value, even if a closed term has one (Theorem 11 does not hold for a CBV strategy). For example, recall the term YN in Section 3.1, and consider (λxy.rec h0, 0i I E(x, N) I)y)(YN I). This term has a value under the CBN strategy, but not under CBV. In fact, innermost strategies are normalising in an orthogonal system if and only if the system is itself strongly normalising. 4.1 Stack Machine for System Lrec Intermediate languages that incorporate linearity have well known implementation advantages whether in compilers, static analysis, or whenever resources are limited [44, 46, 15, 55]. Inspired by these previous works, we finish this section by illustrating how simply System Lrec can be implemented as a stack machine. We show a call-by-name version, but it is straightforward to modify to other reduction strategies. The basic principle of the machine is to find the next redex, using a stack S to store future computations. The elements of the stack are terms in an extension of Lrec that includes the following additional kinds of terms: LET (x, y, t), REC(u, v, w), REC ′ (n, u, v, w), where x, y are variables bound in LET (x, y, t) and n, t, u, v, w are Lrec terms. The configurations of the machine are pairs consisting of a term and a stack of extended terms. Unlike Krivine’s machine or its variants (see for instance [33, 18, 25]) we do not need to include an environment (sometimes called store, as in [55]) in the configurations. Indeed, the environment is used to store bindings for variables, but here as soon as a binding of a variable to a term is known we can replace the unique occurrence of that variable (the calculus is syntactically linear). In other words, instead of building an environment, we use “assignment” and replace the occurrence of the variable by the term. The transitions of the machine are given in Table 6. For a program (closed term t), the machine is started with an empty stack: (t, []). The machine stops when no rule can apply. The use of “assignment” means that there is no manipulation (no copying, erasing, or even searching for bindings) in environments usually associated to these kinds of implementations. 15 (app) (abs) (let) (pair1) (rec) (pair2) (zero) (succ) (st, S) (λx.u, t : S) (let hx, yi = t in u, S) (ht1 , t2 i, LET (x, y, u) : S) (rec t u v w, S) (ht1 , t2 i, REC(u, v, w) : S) (0, REC ′ (t2 , u, v, w) : S) (S(t1 ), REC ′ (t2 , u, v, w) : S) ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ (s, t : S) (u[t/x], S) (t, LET (x, y, u) : S) (u[t1 /x][t2 /y], S) (t, REC(u, v, w) : S) (t1 , REC ′ (t2 , u, v, w) : S) (u, S) (v, (rec (wht1 , t2 i) u v w) : S) Table 6: Stack machine for System Lrec The correctness of the machine with respect to the CBN evaluation relation is proved in the usual way: first we show that if a typeable term has a value, the machine will find it (it cannot remain blocked) and then we show that if the machine starting with a configuration (t, []) stops at a value, then this value is a reduct of t in the calculus. Theorem 12 (Completeness) If ⊢ t : T and there is a value V such that t ⇓ V , then (t, []) ⇒∗ (V, []). Proof: By induction on the evaluation relation, using Subject Reduction (Theorem 1) and the following property: If (t, S) ⇒ (t′ , S ′ ) then (t, S ++ S ′′ ) ⇒ (t′ , S ′ ++ S ′′ ). This property is proved by induction on (t, S). Intuitively, since only the top of the stack is used to select a transition, it is clear that appending elements at the bottom of the stack does not affect the computation.  Theorem 13 (Soundness) If ⊢ t : T and (t, []) ⇒∗ (V, []) then t →∗ V . Proof: First, we define a readback function that converts a machine configuration (t, S) into a term, by induction on S as follows: Readback(t, []) Readback(t, LET (x, y, u) : S) Readback(t, REC(u, v, w) : S) Readback(t1 , REC ′ (t2 , u, v, w) : S) Readback(s, t : S) = = = = = t Readback(let hx, yi = t in u, S) Readback(rec t u v w, S) Readback(rec ht1 , t2 i u v w, S) Readback(st, S), otherwise Then, we show that a machine transition does not change the meaning of the configuration: If (t, S) ⇒ (t′ , S ′ ) then Readback(t, S) →∗ Readback(t′ , S ′ ). To prove this result we distinguish cases depending on the transition rule applied from Table 6. If the transition (t, S) ⇒ (t′ , S ′ ) is an instance of the rules (app), (let), (rec) or (pair2), the result follows trivially since the readback is the same for both configurations: Readback(t, S) = Readback(t′ , S ′ ). If the transition (t, S) ⇒ (t′ , S ′ ) is an instance of rule (abs), (pair1), (zero) or (succ) then we can prove that Readback(t, S) → Readback(t′ , S ′ ) as follows. We observe that by definition of the readback function, in each of these cases there are terms t1 , t2 such that t1 → t2 , Readback(t, S) = Readback(t1 , S) and Readback(t′ , S ′ ) = Readback(t2 , S). Finally, by induction on the definition of the readback function, we show that if t1 → t2 then Readback(t1 , S) → Readback(t2 , S). Having shown that a single transition (t, S) ⇒ (t′ , S ′ ) is sound, we derive the soundness of the machine by induction on the length of the transition sequence: If (t, []) ⇒∗ (V, []) then t = Readback(t, []) →∗ Readback(V, []) = V .  16 · · · ⊢ hS(0), 0i : N ⊗ N · · · ⊢ M(A) : A f : A −◦ A ⊢ f : A −◦ A · · · ⊢ W : N ⊗ N −◦ N ⊗ N f : A −◦ A ⊢ rec hS(0), 0i M(A) f W : A ⊢ λf.rec hS(0), 0i M(A) f W : (A −◦ A) −◦ A Figure 2: Type derivation for YA 5 Applications: Fixpoint Operators and PCF We now study the relation between Lrec and languages with fixpoint operators, in particular PCF. 5.1 The Role of Conditionals Recursive function definitions based on fixpoint operators rely on the use of a non-linear conditional that should discard the branch corresponding to an infinite computation. For instance, the definition of factorial: fact = Y (λf n.cond n 1 (n ∗ f (n − 1))) relies on the fact that cond will return 1 when the input number is 0, and discard the nonterminating “else” branch. Enabling the occurrence of the (bound) variable, used to iterate the function (f in the above definition), in only one branch of the conditional is crucial for the definition of interesting recursive programs. This is why denotational linear versions of PCF [50] allow stable variables to be used non-linearly but not to be abstracted, since their only purpose is to obtain fixpoints. Fixpoint operators can be encoded in System Lrec : recall the term YN in Section 3.1. More generally, for any type A we define the term YA = λf.rec hS(0), 0i M(A) f W where W represents the term (λx.let hy, zi = x in hS(y), zi). For every type A, YA : (A−◦ A)−◦ A is well-typed in System Lrec (see Figure 2). Note that, for any closed term f of type A −◦ A, we have: YA f = rec hS(0), 0i M(A) f W →∗ f (rec (let hy, zi = h0, 0i in hS(y), zi) M(A) f W ) → f (rec hS(0), 0i M(A) f W ) = f (YA f ) Although YA behaves like a fixpoint operator, one cannot write useful recursive programs using fixpoint operators alone (i.e. without a conditional): if we apply YA to a linear function f , we obtain a non-normalisable term (recall the example in Section 3.1). Instead, in System Lrec , recursive functions, such as factorial, can be easily encoded using rec: λn.pr 2 (rec hn, 0i hS(0), S(0)i (λx.let ht, ui = x in F ) I) where F = let ht1 , t2 i = DN t in hS t1 , mult u t2 i and DN is the duplicator term defined previously (see Definition 2). Note that, although conditionals are not part of System Lrec syntax, reduction rules for rec use pattern-matching. In the remainder of this section we show how we can encode in System Lrec recursive functions defined using fixpoints. 5.2 Encoding PCF in System Lrec PCF (Programming Language for Computable Functions) [51] can be seen as a minimalistic typed functional programming language. It is an extension of the simply typed λ-calculus with numbers, a fixpoint operator, and a conditional. Let us first recall its syntax. PCF is a variant of the typed λ-calculus, with a basic type N for numbers and the following constants: 17 • n : N, for n = 0, 1, 2, . . . • succ, pred : N → N • iszero : N → N, such that iszero 0 → 0 iszero (n + 1) → 1 • for each type A, condA : N → A → A → A, such that condA 0 u v condA (n + 1) u v → u → v • for each type A, YA : (A → A) → A, such that YA f → f (YA f ). Definition 3 PCF types and environments are translated into System Lrec types using h ·ii: h Nii h A → Bii h x1 : T1 , . . . , xn : Tn i = = = N h Aii −◦ h Bii x1 : h T1 i , . . . , xn : h Tn i Since System Lrec is Turing complete, it can simulate any PCF program. Furthermore, it is possible to define an encoding in System Lrec for all the terms in PCF. We give a definition below, which is inspired by the encoding of System T [6]. For convenience, we make the following abbreviations, where the variables x1 and x2 are assumed fresh, and [x]t is defined below: x1 ,x2 t Cx:A Axy t = let hx1 , x2 i = DA x in t = ([x]t)[y/x] Definition 4 Let t be a PCF term such that f v(t) = {x1 , . . . , xn } and x1 : A1 , . . . , xn : An ⊢ t : A. 2 An 1 The compilation into System Lrec , is defined as: [xA 1 ] . . . [xn ]hhtii , where h ·ii is defined in Table 7, and for a term t and a variable x, such that x ∈ fv(t), [x]t is inductively defined in the following way: [x](S u) = S([x]u) [x]x = x [x](λy.u) = λy.[x]u  x ,x 1 2 x x  Cx:A (Ax1 s)(Ax2 u) x ∈ fv(s) ∩ fv(u) [xA ](su) = ([x]s)u x∈ / fv(u)   s([x]u) x∈ / fv(s) Notice that [x]t is not defined for the entire syntax of System Lrec . The reason for this is that, although other syntactic constructors (like recursors or pairs) may appear in t, they are the outcome of h ·ii and therefore are closed terms, where x does not occur free. Some observations about the encoding follow. First, we remark that succ is not encoded as λx.Sx, since Lrec does not evaluate under λ or S. We should not encode a divergent PCF program into a terminating term in Lrec . In particular, the translation of condA (succ(YN I)) P Q is h condA i (hhsuccii(hhYN i I)) h P i h Qii, which diverges (if we encode succ as λx.Sx, then we obtain h Qii, which is not right). Regarding abstractions or conditionals, the encoding is different from the one used in for System T in [6]. We cannot use the same encoding as in System L, where terms are erased by “consuming them”, because PCF, unlike System T , is not strongly normalising. The technique used here for erasing could have been used for System L, but erasing “by consuming” reflects the work needed to erase a data structure. 2 We omit the types of variables when they do not play a role in the compilation. 18 h nii h succii h predii h iszeroii h YA i h condA i h xii h uvii = = = = = = = = h λxA .tii = Sn 0 λn.rec hn, 0i (S 0) (λx.Sx) I λn.pr 1 (rec hn, 0i h0, 0i (λx.let ht, ui = DN (pr 2 x) in ht, S ui) I) λn.pr 1 (rec hn, 0i h0, S 0i (λx.DN (pr 2 x)) I) λf.rec hS(0), 0i M(hhAii) f (λx.let hy, zi = x in hS(y), zi) λtuv.rec ht, 0i u (λx.(rec h0, 0i I E(x, h Aii) I)v) I x h(uiih vii λx.[xA ]hhtii if x ∈ fv(t) λx.(rec h0, 0i I λy.E(E(y, h Bii −◦ h Bii)x, h Aii) I)hhtii otherwise Table 7: PCF compilation into Lrec t : N ⊢ ht, 0i : N ⊗ N u : h Aii ⊢ u : h Aii v : h Aii ⊢ V : h Aii −◦ h Aii ⊢ I : N ⊗ N −◦ N ⊗ N t : N, u : h Aii, v : h Aii ⊢ rec ht, 0i u V I : h Aii · · · ⊢ condA : N −◦ h Aii −◦ h Aii −◦ h Aii Figure 3: Type derivation for condA The second case in the encoding for abstractions (see Table 7) uses a recursor on zero to discard the argument, where the function parameter is λy.E(E(y, h Bii −◦ h Bii)x, h Aii). The reason for this is that one cannot use x directly as the function parameter because that might make the term untypable, and just using E(x, h Aii) would make the types work, but could encode strongly normalisable terms into terms with infinite reduction sequences (because E(x, h Aii) might not terminate). For example, consider the encoding of (λxy.y)YN . The translation of a typable PCF term is also typable in System Lrec (this is proved below). In particular, for any type A, the term h condA i is well-typed. In Figure 3, we show the type derivation for the encoding of the conditional (we use V to represent the term λx.(rec h0, 0i I E(x, h Aii) I)v). The type derivation for V depends on the fact that, if Γ ⊢ t : A, then for any type B, we have Γ ⊢ E(t, A) : B −◦ B by Theorem 3. Note that the recursor on h0, 0i in V discards the remaining recursion (corresponding to the branch of the conditional that is not needed), returning Iv. We prove by induction that the encoding respects types. To make the induction work, we need to define and intermediate system where certain variables (not yet affected by the encoding) may occur non-linearly. More precisely, we consider an extension to System Lrec , which allows variables on a certain set X to appear non-linearly in a term. We call the extended system System L+X rec ; and it is defined by the rules in Table 8. Intuitively, if X is the set of free-variables of t, then h tii will be a System Lrec term, except for the variables X = fv(t), which may occur non-linearly, and [x1 ] . . . [xn ]hhtii, will be a typed System Lrec term. We can prove the following results regarding System L+X rec . ′ Lemma 3 If Γ ⊢+X t : A, where dom(Γ) = fv(t) and x ∈ X ⊆ fv(t), then Γ ⊢+X [x]t : A, where X ′ = X \ {x}. Proof: By induction on t, using the fact that x : A ⊢+∅ DA x : A ⊗ A. We show the cases for variable and application. • t ≡ x. Then [x]x = x, and using the axiom we obtain both x : A ⊢+{x} x : A and x : A ⊢+∅ x : A. • t ≡ uv, and x ∈ fv(u), x ∈ / fv(v) (the case where x ∈ / fv(u), x ∈ fv(v) is similar). Then [x]uv = ([x]u)v and Γ ⊢+X uv : A. Let Γ1 = Γ|fv(u) and Γ2 = Γ|fv(v) . Then Γ1 ⊢+X u : 19 Axiom and Structural Rule: x : A ⊢+X x : A Γ ⊢+X t : B Γ, x : A ⊢ and x ∈ X +X Γ, x : A, y : B, ∆ ⊢+X t : C (Axiom) Γ, y : B, x : A, ∆ ⊢+X t : C Γ, x : A, x : A ⊢+X t : B (Weakening) t:B (Exchange) Γ, x : A ⊢ +X and x ∈ X t:B (Contraction) Logical Rules: Γ, x : A ⊢+X t : B Γ ⊢+X λx.t : A −◦ B (−◦Intro) Γ ⊢+X1 t : A ∆ ⊢+X2 u : B Γ, ∆ ⊢+(X1 ∪X2 ) ht, ui : A ⊗ B (⊗Intro) Γ, ∆ ⊢+(X1 ∪X2 ) tu : B Γ ⊢+X1 t : A ⊗ B Numbers: ⊢ Γ ⊢+X1 t : N ⊗ N +∅ 0:N ∆ ⊢+X2 u : A Γ ⊢+X1 t : A −◦ B (Zero) (−◦Elim) x : A, y : B, ∆ ⊢+X2 u : C Γ, ∆ ⊢+(X1 ∪X2 ) let hx, yi = t in u : C Γ ⊢+X t : N Γ ⊢+X S(t) : N (⊗Elim) (Succ) Θ ⊢+X2 u : A ∆ ⊢+X3 v : A −◦ A Σ ⊢+X4 w : N ⊗ N −◦ N ⊗ N Γ, Θ, ∆, Σ ⊢+(X1 ∪X2 ∪X3 ∪X4 ) rec t u v w : A (Rec) Table 8: Typing rules for System L+X rec B −◦ A and Γ2 ⊢+X v : B, where Γ1 and Γ2 can only share variables in X. By induction ′ hypothesis Γ1 ⊢+X [x]u : B −◦ A. Also, since x ∈ / fv(v) and dom(Γ2 ) = fv(v), we have ′ ′ Γ2 ⊢+X v : B. Therefore Γ ⊢+X (x[u])v : A. • t ≡ uv, x ∈ fv(u), and x ∈ fv(v). Let Γ1 = Γ|fv(u)\{x} and Γ2 = Γ|fv(v)\{x} and assume C is the type associated to x in Γ. Then Γ1 , x : C ⊢+X u : B −◦ A and Γ2 , x : C ⊢+X v : B. ′ ′ By induction hypothesis Γ1 , x : C ⊢+X [x]u : B −◦ A, and Γ2 , x : C ⊢+X [x]v : B. Thus +X ′ +X ′ Γ1 , x1 : C ⊢ ([x]u)[x1 /x] : B −◦ A, and Γ2 , x2 : C ⊢ ([x]v)[x2 /x] : B. Therefore ′ Γ1 , x1 : C, Γ2 , x2 : C ⊢+X (Axx1 u)(Axx2 v) : A. Also x : C ⊢+∅ Dx : C ⊗ C, therefore ′ Γ1 , Γ2 , x : C ⊢+X let hx1 , x2 i = Dx in (Axx1 u)(Axx2 v) : A.  Lemma 4 If t is a PCF term of type A, then h Γ|fv(t) i ⊢+fv(t) h tii : h Aii where the notation Γ|X is used to denote the restriction of Γ to the variables in X. Proof: By induction on the PCF type derivation for t, as done for System T in [6].  Theorem 14 If t is a PCF term of type A under a set of assumptions Γ for its free variables {x1 , . . . , xn }, then h Γ|fv(t) i ⊢ [x1 ] . . . [xn ]hhtii : h Aii Proof: By induction on the number of free variables of t, using Lemmas 3 and 4.  Using the encodings given above, it is possible to simulate the evaluation of a PCF program in System Lrec . More precisely, if t is a closed PCF term of type N, which evaluates to V under a 20 V is a value s ⇓PCF V ′ V ⇓PCF V V ′ t ⇓PCF V u[t/x] ⇓PCF V s is not a value (λx.u) t ⇓PCF V s t ⇓PCF V t ⇓PCF 0 t ⇓PCF n + 1 t ⇓PCF n t ⇓PCF 0 t ⇓PCF n + 1 pred t ⇓PCF 0 pred t ⇓PCF n succ t ⇓PCF n + 1 iszero t ⇓PCF 0 iszero t ⇓PCF 1 t ⇓PCF 0 u ⇓PCF V condA t u v ⇓PCF V t ⇓PCF n + 1 v ⇓PCF V f (YA f ) ⇓PCF V condA t u v ⇓PCF V YA f ⇓PCF V Table 9: CBN evaluation for PCF CBN semantics for PCF [51], then the encoding of t reduces in System Lrec to the encoding of V , and evaluates under a CBN semantics to a value which is equal to the encoding of V . In Table 9 we recall the CBN rules for PCF: t ⇓PCF V means that the closed term t evaluates to the value V (a value is either a number, a λ-abstraction, a constant, or a partially applied conditional). Lemma 5 (Substitution) Let t be a term in System Lrec . 1. If x ∈ fv(t), and fv(u) = ∅, then h tii[hhuii/x] = h t[u/x]ii 2. If x ∈ fv(t), then ([x]t)[u/x] →∗ t[u/x]. Proof: By induction on t.  Lemma 6 Let t be a closed PCF term. If t ⇓PCF V , then h tii →∗ h V i . Proof: By induction on the evaluation relation, using a technique similar to the one used for System T in [6]. Here we show the main steps of reduction for condA t u v where u, v are closed terms by assumption. • If t ⇓PCF 0: h condA t u vii = h condA i h tii h uii h vii (I.H.) ∗ → condA 0 h uii h vii →∗ h uii →∗ h V i (I.H.) • If t ⇓PCF n + 1, let v ′ be the term (λx.(rec h0, 0i I E(x, A) I)hhvii): h condA t u vii = →∗ h condA i (Sn+1 0) h uii h vii rec hSn+1 0, 0i h uii v ′ I →∗ Ihhvii → h vii →∗ h V i . (I.H.) For application, we rely on the substitution lemmas above. Note that for an application uv, where u is a constant, we rely on the correctness of the encodings for constants, which can be easily proved by induction. For example, in the case of succ it is trivial to prove that, if t is a number Sn 0 in Lrec (n ≥ 0), then rec ht, 0i (S 0) (λx.Sx) I →∗ Sn+1 0.  Theorem 15 Let t be a closed PCF term. If t ⇓PCF V , then ∃V ′ such that h tii ⇓ V ′ , and V ′ =Lrec h V i . Proof: By Lemma 6, t ⇓PCF V implies h tii →∗ h V i . By Theorem 11, h tii ⇓ V ′ . Therefore, since  ⇓ ⊂→∗ and the system is confluent (Theorem 1), V ′ =Lrec h V i . 21 Lemma 7 If t ⇓ V and t =Lrec u, then u ⇓ V ′ and V =Lrec V ′ . Proof: By transitivity of the equality relation.  Theorem 16 Let t be a closed PCF term. If h tii ⇓ V , then ∃V ′ , such that, t ⇓PCF V ′ and h V ′ i =Lrec V . Proof: By induction on the evaluation relation, using Lemma 7. Note that, if t is a value different from a partially applied conditional, the result follows because t = V ′ and h tii is also a value, i.e. h tii = V , therefore h tii = h V ′ i = V . If t is an application uv then h tii = h uiih vii, therefore h uiih vii ⇓ V if h uii ⇓ λx.s and s[hhvii/x] ⇓ V . If h uii ⇓ λx.s, then by I.H. u ⇓PCF W , and h W i =Lrec λx.s. Note that W is a value of arrow type, which compilation equals an abstraction, therefore W = λx.s′ , pred, succ, iszero, Y, cond, cond p or cond p q. • If W = λx.s′ , we have two cases: – x ∈ fv(s′ ): then h W i = λx.[x]hhs′ i =Lrec λx.s, thus [x]hhs′ i =Lrec s. Since s[hhvii/x] ⇓ V and s[hhvii/x] =Lrec [x]hhs′ i [hhvii/x] then, by Lemma 5.2 [x]hhs′ i [hhvii/x] →∗ h s′ i [hhvii/x], which, by Lemma 5.1, equals h s′ [v/x]ii, therefore (by Lemma 7) h s′ [v/x]ii ⇓ V ′′ , and V =Lrec V ′′ . By I.H., s′ [v/x] ⇓PCF V ′ and h V ′ i = V , therefore uv ⇓PCF V ′ and h V ′ i =Lrec V ′′ =Lrec V . – x ∈ / fv(s′ ): let v ′ represent the term λy.E(E(y, h Bii −◦ h Bii)x, h Aii). Then h W i = λx.(rec h0, 0i I v ′ I)hhs′ i =Lrec λx.s, therefore (rec h0, 0i I v ′ I)hhs′ i =Lrec s. Note that s[hhvii/x] = (rec h0, 0i I v ′ [hhvii/x] I)hhs′ i and (rec h0, 0i I v ′ [hhvii/x] I)hhs′ i ⇓ V if h s′ i ⇓ V , then, since s′ [v/x] = s′ , by I.H., s′ ⇓PCF V ′ and h V ′ i =Lrec V , therefore uv ⇓PCF V ′ and h V ′ i =Lrec V as required. • W = succ: then h W i = λx.rec hx, 0i S 0 (λx.Sx) I =Lrec λx.s, then rec hx, 0i S 1 (λx.Sx) I =Lrec s. Then s[hhvii/x] = rec hhhvii, 0i S 0 (λx.Sx) I and s[hhvii/x] ⇓ V if h vii ⇓ W ′ , in which case we have two possibilities: – W ′ = 0: then rec hhhvii, 0i S 0 (λx.Sx) I ⇓ V if S 0 ⇓ V , in which case V = S 0. By I.H., v ⇓PCF W ′′ , and h W ′′ i =Lrec 0, therefore W ′′ = 0 (0 is the only value of type N that compiles to 0). Therefore succ v ⇓PCF 1 and h 1ii = S 0 =Lrec V . – W ′ = Sp: then rec hhhvii , 0i S 0 (λx.Sx) I ⇓ V if (λx.Sx)(rec hp, 0i S 0 (λx.Sx) I) ⇓ V . By I.H., v ⇓PCF W ′′ , and h W ′′ i =Lrec Sp, thus W ′′ = n+1 (W ′′ is a number in PCF and it must different from 0, otherwise its compilation would be 0) and p =Lrec Sn 0. Note that (λx.Sx)(rec hSn 0, 0i S 0 (λx.Sx) I) →∗ Sn+2 0, therefore, by Lemma 7, V =Lrec Sn+2 0. Now it suffices to notice that succ v ⇓PCF n + 2, and h n + 2ii = Sn+2 0 =Lrec V as required. • For pred and iszero, the proof is similar to the case of succ. • If W = YA : let w′ represent the term (λy.let hy1 , y2 i = y in hS(y1 ), y2 i). Then h W i = λx.rec hS(0), 0i M(hhAii) x w′ =Lrec λx.s, therefore rec hS(0), 0i M(hhAii) x w′ =Lrec s. Then, since s[hhvii/x] = rec hS(0), 0i M(hhAii) h vii w′ , s[hhvii/x] ⇓ V if h vii(hhYA i h vii) ⇓ V (and h vii(hhYA i h vii) = h v(YA v)ii). Thus, by I.H. v(YA v) ⇓PCF V ′ and h V ′ i =Lrec V , therefore YA v ⇓PCF V ′ and h V ′ i =Lrec V as required. • W = condA : let v ′ represent the term (λz.(rec h0, 0i I E(z, h Aii) I)q). Then h W i = λxpq.rec hx, 0i p v ′ I =Lrec λx.s, therefore λpq.rec hx, 0i p v ′ I =Lrec s. Then s[hhvii/x] = λpq.rec hhhvii , 0i p v ′ I and s[hhvii/x] ⇓ λpq.rec hhhvii , 0i p v ′ I. Note that condA v ⇓PCF condA v, because it is a value, and h condA vii =Lrec λpq.rec hhhvii, 0i p v ′ I. 22 • W = condA p1 : let v ′ represent the term (λz.(rec h0, 0i I E(z, h Aii) I)q). Then h W i = (λpxq.rec hp, 0i x v ′ I)hhp1 i =Lrec λxq.rec hhhp1 i , 0i x v ′ I =Lrec λx.s, therefore λq.rec hhhp1 i , 0i x v ′ I =Lrec s. Then s[hhvii/x] = λq.rec hhhp1 i , 0i h vii v ′ I and s[hhvii/x] ⇓ λq.rec hhhp1 i , 0i h vii v ′ I. Note that condA p1 v ⇓PCF condA p1 v, because it is a value, and h condA p1 vii =Lrec λy.rec hhhp1 i , 0i h vii v ′ I. • W = condA p1 p2 : let v ′ represent the term (λz.(rec h0, 0i I E(z, h Aii) I)x). Then h W i = (λpqx.rec hp, 0i q v ′ I)hhp1 i h p2 i =Lrec λx.rec hhhp1 i , 0i h p2 i v ′ I =Lrec λx.s, therefore s =Lrec rec hhhp1 i , 0i h p2 i v ′ I. Then s[hhvii/x] = rec hhhp1 i , 0i h p2 i v ′ [hhvii/x] I and s[hhvii/x] ⇓ V if h p1 i ⇓ W ′ , in which case we have two possibilities: – W ′ = 0: then rec hhhp1 i , 0i h p2 i v ′ [hhvii/x] I ⇓ V if h p2 i ⇓ V . By I.H., p1 ⇓PCF W ′′ , and h W ′′ i =Lrec 0, therefore W ′′ = 0 (0 is the only value of type N that compiles to 0). Also by I.H, p2 ⇓PCF V ′ and h V ′ i =Lrec V , therefore condA p1 p2 v ⇓PCF V ′ , thus uv ⇓PCF V ′ , and h V ′ i =Lrec V as required. – W ′ = Sp′ : then rec hhhp1 i , 0i h p2 i v ′ [hhvii/x] I ⇓ V if h vii ⇓ V . By I.H., p1 ⇓PCF W ′′ , and h W ′′ i =Lrec Sp′ , thus W ′′ = n + 1 (W ′′ is a number in PCF and it must different from 0, otherwise its compilation would be 0). Also by I.H, t ⇓PCF V ′ and h V ′ i =Lrec V , therefore condA p1 p2 v ⇓PCF V ′ and h V ′ i =Lrec V as required.  This completes the proof of soundness and completeness of the encoding. Note that the terms of the form rec h0, 0i I t I used in the encoding of conditionals and λabstractions allow us to discard terms without evaluating them. This is a feature of the encoding, otherwise terminating programs in PCF could be translated to non-terminating programs in System Lrec . This differs from the definition of erasing given in Section 3.1, where terms are consumed and not discarded (in pure linear systems functions do not discard their arguments). However, allowing terms to be discarded without being evaluated, is crucial when defining recursion based on fixpoints. Once a PCF term is compiled into Lrec it can be implemented using the techniques in Section 4, thus we obtain a new stack machine implementation of PCF. 6 Closed Reduction vs Closed Construction in Calculi with Recursion Both System L and System Lrec use a closed reduction strategy that waits for arguments to become closed before firing redexes. We now look in more detail at the implications of using a closed reduction strategy, instead of imposing functions used in iteration/recursion to be closedby-construction (a viable alternative in the presence of linearity). As mentioned in the Introduction, the closed reduction strategy for the λ-calculus avoids α-conversion while allowing reductions inside abstractions, thus achieving more sharing of computation. When applied to System L and System Lrec , it imposes certain conditions on reduction rules; in particular iterated functions should be closed. The intuition here is that we should only copy closed terms because then all the resources are there. In linear logic words, we can promote a term that is closed. The closed reduction strategy waits, to reduce an iterator/recursor term, until the iterated functions are closed. One can ask a stronger constraint on the construction of terms, that is, to constrain iterators/recursors to be closed on construction (i.e., we have a syntactical constraint that only terms without free variables are used in this context). For System L, to follow the closed-construction approach one imposes an extra condition on the iterated function v, when defining iterators: iter t u v if fv(t) ∩ fv(u) = ∅ and fv(v) = ∅ 23 For System Lrec , one imposes an extra condition on v and w: rec t u v w, if fv(t) ∩ fv(u) = ∅ and fv(vw) = ∅ In the rest of this section we compare the computation power of linear calculi with closed reduction vs closed construction. We consider first calculi with bounded recursion (iterators) and then unbounded recursion. 6.1 Closed Reduction/Closed Construction and Iteration Dal Lago [19] defines a linear λ-calculus with bounded iteration that encodes exactly the set of primitive recursive functions following the closed construction approach. A similar system allowing iterators to be open at construction, but imposing a closed condition on reduction, allows to encode more than the primitive recursive functions, and in particular allows the encoding of the Ackermann function, as shown in [5]. Thus, imposing a closed-at-construction restriction on iterators clearly has an impact in the presence of linearity. For Gödel’s System T , the fact that we do not allow iterators to be open at construction, does not affect the set of definable functions. If we define v = λxy.y(xy), then each iterator term iter n b f in System T , where f may be an open term, can be translated into the typable term (iter n (λx.b) v)f , where x 6∈ fv(b). It is easy to see that iter n b f and (iter n (λx.b) v)f have the same normal form f (. . . (f b)). It is worth remarking that we rely on a non-linear term v to get this result. Indeed, iterating v is essentially equivalent to constructing a Church numeral. For a linear system with iteration such as System L, although some functions are naturally defined using an open function, for example: mult = λmn.iter m 0 (add n), one can encode them using a closed-at-construction iteration. In general, an iterator with an open function where the free variables are of type N can be encoded using a closed-at-construction iterator, as follows. Consider iter t u v, where v is open, for free variables x1 , . . . , xn of type N. Then let F W ≡ ≡ let Cx′1 = hx1 , x′′1 i in . . . let Cxk = hxk , x′′k i in hvx0 , x′′1 , x′′k i λx.let x = hx0 , x′1 , x′k i in F Then we simulate iter t u v using a closed iterator as follows: π1 (iter t hu, x1 , xk i W ). This technique can also be applied to open functions where the free variables are of type τ , for τ generated by the following grammar: τ ::= N | τ ⊗ τ . More generally, open functions where the free variables have base type can be encoded when we consider iteration closed-at-construction. 6.2 Closed Construction and Unbounded Recursion We now consider what happens when we use the closed-at-construction approach in a linear system with unbounded recursion such as System Lrec . Notice that the encoding of µf in Lrec given in Section 3.1 is a term closed-at-construction. Since all the primitive recursive functions are definable using closed-at-construction iterators, which are trivially encoded using closed Lrec recursors, we conclude that imposing a closed-at-construction condition on System Lrec still gives a Turing complete system. Note however that, although System Lrec can encode all the computable functions, that does not mean one can encode all the computational behaviours. For example for any closed function f , one can encode in Lrec a term Y , such that, Y f → f (Y f ). However, this relies on the fact that one can copy any closed function f , which can be done both in System L and System Lrec with closed reduction, but so far there is no known encoding when one imposes a closed-at-construction condition. 7 Conclusions This paper completes a line of work investigating the power of linear functions, from the set of primitive recursive functions to the full set of computable functions, with a strong focus on 24 Turing complete systems based on linear calculi. In previous work, we investigated linear primitive recursive functions, and a linear version of Gödel’s System T . Here, we extended these notions to general recursion, using iteration and minimisation (Lµ ) and, alternatively, unbounded recursion (Lrec ). System Lrec is a syntactically linear calculus, but only the fragment without the recursor is operationally linear. The linear recursor allows us to encode duplicating and erasing, thus playing a similar role to the exponentials in linear logic. It encompasses bounded recursion (iteration) and minimisation in just one operator. Summarising, a typed linear λ-calculus with bounded iteration (System L) is not Turing complete, but replacing the iterator with an unbounded recursor (Lrec ), or adding a minimiser (Lµ ), yields a universal system. Linear calculi have been successfully used to characterise complexity classes, for instance, as a consequence of Dal Lago’s results [19], we know that a closed-by-construction discipline in System L gives exactly the set of PR functions, whereas closed reduction recovers the power of System T . Interestingly, a closed-construction discipline does not weaken Lrec (the encoding of µ is closed). The encoding of PCF in Lrec is type-respecting, and Lrec seems a potentially useful intermediate language for compilation. The meaning of the linear recursor will be further analysed in a denotational setting in future work and the pragmatical impact of these results is currently being investigated within the language Lilac [46]. References [1] S. Abramsky. Computational Interpretations of Linear Logic. Theoretical Computer Science, 111:3–57, 1993. [2] S. Alves. Linearisation of the Lambda Calculus. PhD thesis, Faculty of Science - University of Porto, April 2007. [3] S. Alves, M. Fernández, M. Florido, and I. Mackie. The power of linear functions. In Computer Science Logic, volume 4207 of LNCS, pages 119–134. Springer, 2006. [4] S. Alves, M. Fernández, M. Florido, and I. Mackie. Linear recursive functions. In Rewriting, Computation and Proof, volume 4600 of LNCS, pages 182–195. Springer, 2007. [5] S. Alves, M. Fernández, M. Florido, and I. Mackie. The power of closed reduction strategies. ENTCS, 174(10):57–74, 2007. [6] S. Alves, M. Fernández, M. Florido, and I. Mackie. Gödel’s system T revisited. Theor. Comput. Sci., 411(11-13):1484–1500, 2010. [7] S. Alves, M. Fernández, M. Florido, and I. Mackie. Linearity and recursion in a typed lambda-calculus. In PPDP, 2011. [8] S. Alves and M. Florido. Weak linearization of the lambda calculus. Theoretical Computer Science, 342(1):79–103, 2005. [9] A. Asperti and L. Roversi. Intuitionistic light affine logic. ACM Transactions on Computational Logic, 3(1):137–175, 2002. [10] D. Baelde and D. Miller. Least and greatest fixed points in linear logic. In LPAR 2007: Logic for Programming, Artificial Intelligence and Reasoning. Springer, 2007. [11] P. Baillot and V. Mogbil. Soft lambda-calculus: a language for polynomial time computation. In Proc. FOSSACS’04, volume 2987 of LNCS, pages 27–41. Springer-Verlag, 2004. [12] H. P. Barendregt. The Lambda Calculus: Its Syntax and Semantics, volume 103 of Studies in Logic and the Foundations of Mathematics. North-Holland, 1984. 25 [13] U. Berger. Minimisation vs. recursion on the partial continuous functionals. In In the Scope of Logic, Methodology and Philosophy of Science, volume 1 of Synthese Library 316, pages 57–64. Kluwer, 2002. [14] U. Berger and H. Schwichtenberg. An inverse of the evaluation functional for typed lambdacalculus. In Proc. Logic in Computer Science (LICS’91), pages 203–211. IEEE Computer Society, 1991. [15] G. M. Bierman, A. M. Pitts, and C. V. Russo. Operational properties of Lily, a polymorphic linear lambda calculus with recursion. In Workshop on Higher Order Operational Techniques in Semantics, volume 41 of ENTCS, pages 70–88. Elsevier, 2000. [16] G. Boudol, P.-L. Curien, and C. Lavatelli. A semantics for lambda calculi with resources. MSCS, 9(4):437–482, 1999. [17] T. Braüner. The Girard translation extended with recursion. In Computer Science Logic, 8th International Workshop, CSL’94, Kazimierz, Poland, volume 933 of Lecture Notes in Computer Science, pages 31–45. Springer, 1994. [18] P.-L. Curien. An abstract framework for environment machines. Theor. Comput. Sci., 82(2):389–402, 1991. [19] U. Dal Lago. The geometry of linear higher-order recursion. In Proc. Logic in Computer Science (LICS’05), pages 366–375, June 2005. [20] N. Dershowitz. Term rewriting systems by “terese”. Theory Pract. Log. Program., 5(3):395– 399, 2005. [21] J. Egger, R. E. Møgelberg, and A. Simpson. Enriching an effect calculus with linear types. In Computer Science Logic, 23rd international Workshop, CSL 2009, 18th Annual Conference of the EACSL, Coimbra, Portugal, September 7-11, 2009. Proceedings, volume 5771 of Lecture Notes in Computer Science, pages 240–254. Springer, 2009. [22] T. Ehrhard and L. Regnier. The differential lambda-calculus. Theor. Comput. Sci., 309(13):1–41, 2003. [23] M. Fernández, I. Mackie, and F.-R. Sinot. Closed reduction: explicit substitutions without alpha conversion. MSCS, 15(2):343–381, 2005. [24] M. Fernández, I. Mackie, and F.-R. Sinot. Lambda-calculus with director strings. Applicable Algebra in Engineering, Communication and Computing, 15(6):393–437, 2005. [25] M. Fernández and N. Siafakas. New developments in environment machines. Electr. Notes Theor. Comput. Sci., 237:57–73, 2009. [26] D. R. Ghica. Geometry of synthesis: a structured approach to VLSI design. In POPL, pages 363–375, 2007. [27] J. Girard. Light linear logic. Inf. and Comp., 143(2):175–204, 1998. [28] J.-Y. Girard. Linear Logic. Theor. Comp. Sci., 50(1):1–102, 1987. [29] J.-Y. Girard. Towards a geometry of interaction. In Categories in Computer Science and Logic: Proc. of the Joint Summer Research Conference, pages 69–108. American Mathematical Society, 1989. [30] J.-Y. Girard, Y. Lafont, and P. Taylor. Proofs and Types. Cambridge Tracts in Theor. Comp. Sci. Cambridge University Press, 1989. 26 [31] J.-Y. Girard, A. Scedrov, and P. J. Scott. Bounded linear logic: A modular approach to polynomial time computability. Theoretical Computer Science, 97:1–66, 1992. [32] M. Giunti and V. T. Vasconcelos. A linear account of session types in the pi calculus. In CONCUR, pages 432–446, 2010. [33] C. Hankin. An Introduction to Lambda Calculi for Computer Scientists, volume 2. College Publications, 2004. ISBN 0-9543006-5-3. [34] M. Hofmann. Linear types and non-size-increasing polynomial time computation. In Proc. Logic in Computer Science (LICS’99). IEEE Computer Society, 1999. [35] M. Hofmann and S. Jost. Static prediction of heap space usage for first-order functional programs. In POPL, pages 185–197, 2003. [36] S. Holmström. Linear functional programming. In Proc. of the Workshop on Implementation of Lazy Functional Languages, pages 13–32, 1988. [37] K. Honda. Types for dyadic interaction. In CONCUR’93, volume 715 of LNCS, pages 509– 523. Springer, 1993. [38] A. J. Kfoury. A linearization of the lambda-calculus and consequences. Journal of Logic and Computation, 10(3):411–436, 2000. [39] S. C. Kleene. Introduction to Metamathematics. North-Holland, 1952. [40] J. W. Klop. Combinatory Reduction Systems. PhD thesis, Mathematisch Centrum, Amsterdam, 1980. [41] J. W. Klop. New fixpoint combinators from old. Reflections on Type Theory, 2007. [42] J.-W. Klop, V. van Oostrom, and F. van Raamsdonk. Combinatory reduction systems, introduction and survey. Theor. Computer Science, 121:279–308, 1993. [43] N. Kobayashi, B. C. Pierce, and D. N. Turner. Linearity and the pi-calculus. In POPL, pages 358–371, 1996. [44] Y. Lafont. The linear abstract machine. Theor. Comp. Sci., 59:157–180, 1988. [45] Y. Lafont. Soft linear logic and polynomial time. Theoretical Computer Science, 318(1-2):163– 180, 2004. [46] I. Mackie. Lilac: A functional programming language based on linear logic. Journal of Functional Programming, 4(4):395–433, 1994. [47] I. Mackie. The geometry of interaction machine. In Principles of Programming Languages (POPL), pages 198–208. ACM Press, 1995. [48] R. Milner, J. Parrow, and D. Walker. A calculus of mobile processes, I. Information and Computation, 100(1):1 – 40, 1992. [49] E. Nöcker, J. Smetsers, M. van Eekelen, and M. Plasmeijer. Concurrent clean. In PARLE’91, volume 506 of LNCS, pages 202–219. Springer, 1991. [50] L. Paolini and M. Piccolo. Semantically linear programming languages. In PPDP, pages 97–107, Valencia, Spain, 2008. ACM. [51] G. D. Plotkin. LCF Considered as a Programming Language. Theoretical Computer Science, 5:223–255, 1977. [52] K. Terui. Light affine calculus and polytime strong normalization. In Proc. Logic in Comp Sci. (LICS’01). IEEE Computer Society, 2001. 27 [53] A. v. Tonder. A lambda calculus for quantum computation. SIAM J. Comput., 33(5):1109– 1135, 2004. [54] P. Wadler. Linear types can change the world! In IFIP TC 2 Conf. on Progr. Concepts and Methods, pages 347–359. North Holland, 1990. [55] D. Walker. Substructural type systems. In Adv. Topics in Types and Progr. Languages, chapter 1, pages 3–43. MIT Press, Cambridge, 2005. [56] K. Wansbrough and S. P. Jones. Simple usage polymorphism. In Proc. ACM SIGPLAN Workshop on Types in Compilation. ACM Press, 2000. [57] N. Yoshida, K. Honda, and M. Berger. Linearity and bisimulation. In FoSSaCS, LNCS, pages 417–434. Springer-Verlag, 2002. 28
6cs.PL
1 Synchronization with Guaranteed Clock Continuity using Pulse-Coupled Oscillators arXiv:1704.07201v1 [cs.SY] 20 Apr 2017 Timothy Anglea1 (IEEE Student Member) Abstract—Clock synchronization is a widely discussed topic in the engineering literature. Ensuring that individual clocks are closely aligned is important in network systems, since the correct timing of various events in a network is usually necessary for proper system implementation. However, many existing clock synchronization algorithms update clock values abruptly, resulting in discontinuous clocks which have been shown to lead to undesirable behavior. In this paper, we propose using the pulse-coupled oscillator model to guarantee clock continuity, demonstrating two general methods for achieving continuous phase evolution in any pulse-coupled oscillator network. We provide rigorous mathematical proof that the pulse-coupled oscillator algorithm is able to converge to the synchronized state when the phase continuity methods are applied. We provide simulation results supporting these proofs. We further investigate the convergence behavior of other pulse-coupled oscillator synchronization algorithms using the proposed methods. Index - clock continuity, synchronization, pulse-coupled oscillators, phase jumps Yongqiang Wang1 (IEEE Senior Member) Process 16 Ensuring clock synchronization in a distributed system is a very important and well-studied topic in the fields of electrical engineering and computer science. However, many synchronization algorithms require instantaneous clock value adjustment [1], which leads to discontinuous clocks. These discontinuous clocks are undesirable. If time jumps forward, then there is the potential that a scheduled event will never happen, and if time jumps backwards, then one process may be implemented twice, as shown in Fig. 1. It is desirable that the time value evolve continuously while synchronizing with the other sensors within the network [2], [3]. Many clock synchronization algorithms use packet-based communication to share local information [4], [5], [6] and can achieve synchronization with a continuous clock [2], [3]. However, as noted in [5], such approaches may require constant adjustment to the clock rate, leading to significant runtime overhead. In this paper, we will show that the pulse-coupled oscillator (PCO) model can be used to achieve guaranteed clock continuity. The PCO model was first introduced by Peskin in 1975 [7]. He used pulse-coupled oscillators (PCOs) to model the synchronization of pacemaker cells in the heart. Mirollo and Strogatz later improved the model, providing a rigorous mathematical formulation [8]. Communication latency, packet loss, signal corruption, and energy consumption are all minimized 1 Timothy Anglea and Yongqiang Wang are with the department of Electrical & Computer Engineering, Clemson University, Clemson, SC 29634, USA {tbangle,yongqiw}@clemson.edu 18 19 20 21 22 21 22 Synchronization 20 (a) Process 18 I. I NTRODUCTION 17 19 20 Synchronization Process 18 19 20 (b) Figure 1. Illustration of disadvantages of discontinuous clock synchronization. (a) Synchronization occurs after a jump forward of two time units, and the scheduled process is not executed. (b) Synchronization occurs after a jump backward of two time units, and the scheduled process is executed twice. due to the simplicity of the communication between oscillators in the network (i.e., single pulses). Recently, the PCO model has been widely used to synchronize clocks in wireless sensor networks. However, all of the existing PCO synchronization algorithms achieve synchronization through abrupt jumps in the oscillator phase [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], which, as indicated earlier, may lead to undesired behavior. In this paper, we propose a new synchronization scheme for PCOs, which can guarantee continuity in phase evolution for any jump-based PCO algorithm. We will show that the convergence properties of our previously proposed jump-based synchronization algorithms in [11], [12] are maintained, even when the phase adjustment rule is modified to be continuous. To do so, we will prove that the new mechanism guaranteeing phase continuity amounts to reducing the coupling strength in the conventional PCO model. To our knowledge, this is also the first paper to consider a time-varying coupling strength in 2 a PCO network. In Section II, we will define our terms and notation for a PCO network. We will then introduce two methods for maintaining the continuity of the phase of an oscillator in Section III. In Section IV, we will analyze the behavior of the network under continuous phase evolution, and show that the behavior can be modeled as a time-varying coupling strength. In Section V, we will analyze the convergence properties of PCOs under time-varying coupling strengths, and show that a PCO network will synchronize under guaranteed phase continuity. We will then present simulations to further illustrate phase continuity in Section VI. We will conclude with final remarks and future work in Section VII. II. P ULSE C OUPLED O SCILLATORS P RELIMINARIES Let us consider a network of N identical pulse-coupled oscillators. Let θi ∈ [0, 1) be the associated phase of oscillator i ∈ V = {1, 2, · · · , N }. For our analysis, each oscillator has an identical fundamental frequency, ω0 , and evolves at that rate on the interval [0, 1). As the network evolves, each oscillator increases its phase at rate ω0 . When an oscillator reaches the threshold value of 1, it fires a pulse and resets its phase to zero. Any connected oscillators then receive that pulse, being notified of the firing instance of an oscillator in the network. Receiving a pulse will cause an oscillator to change its phase in accordance with the control algorithm. Let us denote the amount that oscillator i determines to adjust its phase, given a PCO control algorithm, at a firing instance at time t as ψi , where  ψi = αφi = lim θi (t + τ ) − θi (t) = θi (t+ ) − θi (t) (1) τ ↓0 where α is the coupling strength of the network, and φi is the phase change amount determined by the PCO control algorithm. The range of the coupling strength allowed for the network is determined by the algorithm, but typical values of coupling strength are within the interval (0, 1]. III. P ULSE C OUPLED O SCILLATORS WITH C ONTINUOUS P HASE E VOLUTION To our knowledge, all existing literature regarding PCO networks has the phase value of each oscillator jump discontinuously at firing instances. In this section, we will enhance the PCO model such that the phase value must evolve continuously at all times (except when it resets its phase to zero when it reaches the threshold). Thus, under this restriction, when oscillator i receives a pulse, it must increase or decrease its individual rate of evolution, ωi , for a certain amount of time, τi , in order to achieve the required phase adjustment, ψi , while ensuring continuity. If oscillator i receives another pulse before the time needed to achieve ψi is completed, then the oscillator will use its current phase θi to redetermine a new ψi , and thus determine new values for ωi and τi . We propose two methods for adjusting the phase of an oscillator in a continuous fashion: either the frequency at which the oscillator evolves in response to receiving a pulse is kept constant, or the time for which the oscillator evolves is kept constant. A. Constant Frequency Method In the constant frequency method, the frequency of cillator i is increased or decreased by a set amount ωa an adjustable duration of time τi . The amount of time oscillator spends at this new frequency is dependent on phase amount ψi that it needs to adjust: τi = |ψi | ωa osfor the the (2) Thus, once an amount of phase adjustment ψi is determined, the oscillator will increase its frequency to ωi = ω0 + ωa if ψi is positive, or decrease its frequency to ωi = ω0 − ωa if ψi is negative, for time τi determined in (2). Once the time τi has elapsed, the oscillator returns to its fundamental frequency ω0 . If ψi is zero, then the oscillator remains at its fundamental frequency, ω0 , and evolves until the next firing instance. Remark 1. In the constant frequency method, it is possible to have different amounts of frequency change when increasing or decreasing the oscillator’s frequency, i.e., ωa+ and ωa− respectively. In this paper, we will focus on using the same amount of frequency change ωa = ωa+ = ωa− for both increasing and decreasing the frequency of the oscillator. B. Constant Time Method In the constant time method, oscillator i spends a fixed amount of time τ at an adjustable frequency ωi . The new frequency at which the oscillator evolves is dependent on the phase amount ψi the oscillator needs to adjust: ψi (3) τ Note that ωa can be positive or negative. Thus, once an amount of phase adjustment ψi is determined, the oscillator will update its frequency to ωi = ω0 + ωa for time τ . Once the fixed amount of time τ has elapsed, the oscillator again returns to its fundamental frequency ω0 . ωi = ω0 + ωa = ω0 + Remark 2. The constant time method described above is a general case of how other algorithms ensure clock continuity. In packet-based synchronization algorithms, the value of τ is set to be the length of the communication period [3], [4]. Remark 3. Phase jumps, as is standard in the literature, can be seen as a specific case of either of the above phase continuity methods. These cases can be obtained by either taking the limit as ωa goes to infinity in the constant frequency method, or by taking the limit as τ goes to zero in the constant time method. Remark 4. Depending on the parameters chosen in each of the above phase continuity methods, the oscillators may evolve backward in phase (i.e., ωi < 0). Negative frequencies are acceptable in the analysis used in this paper. However, parameters can be chosen to ensure that |ωa | < 1 such that the oscillator frequency remains strictly positive. Remark 5. Both methods above achieve the same basic result of having the phase evolve continuously. However, each has their desirable characteristics. The constant frequency method 3 only requires the oscillators to evolve at a countable set of frequencies. The constant time method, however, ensures that the phase adjustment occurs in a set amount of time. The method used should take into consideration the specific application of the PCO network. B. Time-Varying Coupling Strength Let us consider a PCO network under a control algorithm that allows jumps in the phase variable, θ, but has a coupling strength, α, that varies with time. IV. O SCILLATOR A NALYSIS Proposition 1. The evolution of an oscillator in a PCO network is dependent only upon the value of the coupling strength, α, at firing instances. We now rigorously analyze the dynamics of oscillators maintaining continuous phase evolution according to the proposed methods above, rather than using phase jumps. Once a method is chosen, all that is required is to take the amount of phase adjustment for oscillator i, i.e. ψi , and determine the necessary amount of time, τi , and frequency increase/decrease ωa . We then let the oscillator evolve at the new frequency for the required amount of time before it returns to its fundamental frequency, ω0 . Proof. The proof for this proposition is straightforward. An oscillator only determines the amount that it needs to jump when it receives a pulse. Thus, the value of the coupling strength is only used at firing instances. Any values the coupling strength takes between firing instances is unused and thus independent of the behavior of the network. Furthermore, if the oscillator receives a pulse, but does not jump (or jumps an amount of zero), then the coupling strength is again independent to the behavior of the network. A. Single Oscillator Behavior Let us analyze the behavior of a single oscillator. Once oscillator i has calculated the necessary change in frequency, ωi , to achieve the phase adjustment, ψi , in time τi , two possibilities can follow: 1) the oscillator receives no pulses before time τi that cause a phase adjustment, and 2) the oscillator receives a pulse before time τi that causes a phase adjustment. If the length of the time interval between the current and previous oscillator firing instances is given as t0 , we can divide these two cases mathematically as 1) t0 ≥ τi , 2) t0 < τi . 1) In the first case, oscillator i finishes adjusting its phase by ψi , and returns to evolving at the fundamental frequency ω0 . The same effective change in phase has been achieved as if the oscillator had jumped in phase by ψi and evolved normally for a time of length t0 . Thus, no effective change in the phase update rule occurs compared with the conventional instantaneous jumpbased PCO model. 2) In the second case, the oscillator has not yet achieved its desired amount of phase change. Rather than having adjusted the whole amount ψi , it has adjusted only a portion of that amount, tτ0i ψi , in the time interval between received pulses. It then will use its current phase at the time when the new pulse is received to redetermine new values for ψi , τi , and ωi . This phase evolution is equivalent to having the oscillator jump in phase by τt0i ψi , and then evolve normally for a time of length t0 . This fractional amount of the desired phase change can be seen as a reduction of the coupling strength, α, of oscillator i by the ratio tτ0i . From (1), we can write an expression for the effective coupling strength, αei , of the oscillator: αei = t0 α τi (4) This second case leads us to analyze a standard PCO network under the condition of a time-varying coupling strength. Remark 6. Typically, a larger network coupling strength will cause the network to converge more quickly. When considering phase continuity, the effective coupling strength will be less than or equal to the actual coupling strength of the network, implying that phase continuity will cause the network to converge more slowly in general. The lengthening of convergence time is dependent on the parameters chosen for each method. Remark 7. Note that the phase continuity methods described above do not actively modify the coupling strength between time instances. Only the apparent behavior of the network is being modeled as a reduced coupling strength, αe . The actual coupling strength, α, remains unchanged throughout the entire evolution of the network. V. S YNCHRONIZATION A NALYSIS We will now use the PCO synchronization strategy given in [12] with phase jumps to determine if the convergence properties of the algorithm still hold under a time-varying coupling strength, and thus under the newly proposed phase continuity methods. The algorithm in [12] uses a delayadvance phase response curve (PRC) to describe the phase update at firing instances. Consider a PCO network with N oscillators in a general, (strongly) connected graph. Without loss of generality, we can order the oscillators in the network according to their phase, such that oscillator 1 has the smallest phase and oscillator N has the largest phase (i.e., 0 ≤ θ1 ≤ . . . ≤ θN < 1). When an oscillator receives a pulse, it updates its phase variable according to the phase response curve, or function, Q, as shown in Fig. 2.  −θi if 0 ≤ θi ≤ 21 (5) Q(θi ) = (1 − θi ) if 21 < θi < 1 Note that the phase update is independent of the number and relative positions of other oscillators in the network. Thus, the phase of oscillator i after a firing instance can be described as θi (t+ ) = θi (t) + αQ(θi (t)) (6) 4 As the network synchronizes, the length of the containing arc decreases and converges to zero. This value has been shown in [12] to decrease after all oscillators have fired once with a constant coupling strength if it is initially less than some Λ̄ ∈ (0, 12 ]. We will next show that this quantity also decreases monotonically under a bounded, time-varying coupling strength. 0.5 Phase Response Curve, Q( i) 0.4 0.3 0.2 0.1 0 Theorem 1. Consider pulse-coupled oscillators with a refractory period D in the phase response curve in (5), as in Fig. 3. A strongly connected network of such PCOs using phase jumps will synchronize with oscillators having independent, time-varying, and bounded α ∈ (0, 1] if the containing arc of the oscillators is less than some Λ̄ ∈ (0, 21 ], and if the refractory period D is not greater than 1 − Λ̄. -0.1 -0.2 -0.3 -0.4 -0.5 0 0.2 0.4 0.6 Oscillator Phase, 0.8 1 i Figure 2. Phase Response Curve (PRC) for PRC synchronization given in (5) 0.5 Phase Response Curve, Q( i) 0.4 0.3 0.2 0.1 0 -0.1 -0.2 -0.3 -0.4 -0.5 0 0.2 0.4 0.6 Oscillator Phase, 0.8 1 i Figure 3. Phase Response Curve (PRC) for PRC synchronization given in (5) with an example refractory period D = 0.4. where α is the coupling strength of the network, and, from (1), we have Q(θi (t)) = φi . A refractory period of length D can be included in the phase response curve, as shown in Fig. 3. An oscillator does not respond to incoming pulses if its phase is within the region [0, D), and continues to freely evolve. Such a refractory period can improve energy-efficiency and robustness to communication latency [12]. Let us refer to an arc as a connected subset of the interval [0, 1). We can define the following set of functions, vi,i+1 , for all i ∈ V:  θi+1 − θi if θi+1 > θi (7) vi,i+1 (θ) = 1 − (θi+1 − θi ) if θi > θi+1 where oscillator N + 1 maps to oscillator 1. Notice that these functions do not change between firing instances. We say that the containing arc of the oscillators is the smallest arc that contains all of the phases in the network. The length of this arc, Λ, is given mathematically as Λ = 1 − max{vi,i+1 (θ)} i∈V (8) Proof. Let us consider a PCO network where the initial phases are within some containing arc Λ < Λ̄. Without loss of generality, let us assume that oscillator i has the largest initial phase, θmax at time t = 0, oscillator j has the smallest initial phase such that θj = θmax − Λ, and all other oscillator phases reside between oscillator i and j. Since oscillator i has the largest phase, its phase evolves to 1 without perturbation and it reaches the threshold at t = 1−θmax . At this firing instance, all of the other oscillators have ω0 phases between 1 − Λ (which is larger than 12 ) and 1. In the following time interval of length ωΛ0 , every oscillator will fire once. Since the network is strongly connected, oscillator j receives at least one pulse during its phase evolution from 1−Λ to 1, and its phase is increased. (The value of phase response curve is positive in the interval ( 12 , 1).) We denote the phase increase as φj , which is strictly positive and dependent on the time-varying coupling strength, α ∈ (0, 1], and the phase response curve, and hence is time-dependent. Given that the initial phase difference is Λ, and that the phase of oscillator j is increased by φj , then the containing arc of the network decreases by at least φj , as oscillator i may have decreased its phase due to the pulse received while in the interval [D, Λ), if D < Λ holds. (The value of the phase response curve is negative in the interval (0, 21 )). The network then continues on to the next cycle, and the above analysis repeats. Therefore, since the containing arc of the network decreases with every cycle, and cannot be negative, then the containing arc converges to zero, and the network synchronizes. Remark 8. The coupling strengths of the oscillators can vary independently from each other, and synchronization will still occur, as long as the coupling is bounded (i.e., α ∈ (0, 1]). Theorem 1 proves that a PCO network can synchronize for any potentially time-varying coupling strength, α. As shown in Sec. III, phase continuity can be modeled as a reduction in the coupling strength of an oscillator as in (4). Since the bound of this effective coupling strength is (0, α], the effective coupling strength will also be inside the bound (0, 1]. Thus, we easily have the following theorem. Theorem 2. Consider pulse-coupled oscillators with a refractory period D in the phase response curve in (5), as in Fig. 3. A strongly connected network of such PCOs under one of 5 0.5 0.5 Frequency Method Time Method Jump Method 0.4 Containing Arc Phase 1 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time (seconds) (a) 0.3 0.2 1 Phase 0.1 0.5 0 0 1 2 3 4 5 Time (seconds) 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time (seconds) (b) 0.5 // 1 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Phase Phase 1 Figure 5. Containing arcs, Λ as a function of time for the networks in Fig. 4. The convergence speed of the containing arcs under the constant frequency method, with ωa = 0.3ω0 , and the constant time method, with τ = 0.3 seconds, is reduced compared with the phase jump case. 0.5 Time (seconds) (c) 0 0 VI. S IMULATIONS AND R ESULTS We now simulate PCO synchronization algorithms using the phase continuity methods as discussed above. All simulations are performed in MATLAB, with oscillators evolving over the interval [0, 1), with fundamental frequency ω0 = 1, and period of one second. A. PRC Synchronization We first simulate the PRC synchronization algorithm given in [12]. Fig. 4 shows that the network does indeed synchronize. As expected, the network converges more slowly when under the phase continuity methods from Sec. III, due to the reduced effective coupling strengths of the oscillators at most of the firing events. The rate of convergence is illustrated in Fig. 5 where the length of the containing arc is plotted as a function of time. 1 1.5 2 2.5 3 // 13 13.5 14 14.5 15 13 13.5 14 14.5 15 13 13.5 14 14.5 15 // 1 the phase continuity methods in Sec. III will synchronize with α ∈ (0, 1] if the containing arc of the oscillators is less than some Λ̄ ∈ (0, 12 ], and if the refractory period D is not greater than 1 − Λ̄. 0.5 0 0 0.5 1 1.5 2 2.5 3 // Time (seconds) (b) // 1 Phase Proof. This proof follows easily from Theorem 1. Phase continuity will result in oscillator coupling strengths being independent, time-varying, and bounded within the interval (0, α], as shown in the analysis of section III. Thus the conditions for Theorem 1 are met, and the network will converge to the state of synchronization. 0.5 Time (seconds) (a) Phase Figure 4. Phase evolution of the PRC synchronization algorithm in [12] for N = 6 oscillators in an all-to-all topology, α = 0.5, no refractory period, and random initial conditions in a containing arc Λ < 21 . (a) Continuous phase evolution under the constant frequency method, with ωa = 0.3ω0 . (b) Continuous phase evolution under the constant time method, with τ = 0.3 seconds. (c) Phase jumps, for comparison to the phase continuity methods. 0.5 0 0 0.5 1 1.5 2 2.5 3 // Time (seconds) (c) Figure 6. Phase evolution of the Energy-Efficient Synchronization algorithm in [12] for N = 6 oscillators in an all-to-all topology, α = 0.5, refractory period D = 0.5, and random initial conditions in a containing arc Λ < 21 . (a) Continuous phase evolution under the constant frequency method, with ωa = 0.3ω0 . (b) Continuous phase evolution under the constant time method, with τ = 0.3 seconds. (c) Phase jumps, for comparison to the phase continuity methods. As indicated in [12], a refractory period of length D can be incorporated into the PRC synchronization algorithm, as shown in Fig. 3, and synchronization can still be achieved. We illustrate in Fig. 6 that the network will synchronize using the phase continuity methods in Sec. III. As can be seen in Fig. 7, convergence is slower than when we excluded the refractory period in Fig. 5. Again, the reduced coupling strength of the network due to phase continuity leads to an increased convergence time. The PRC synchronization algorithm in [12] also achieves 6 0.5 0.5 Frequency Method Time Method Jump Method 0.4 Containing Arc Containing Arc 0.4 Frequency Method Time Method Jump Method 0.3 0.2 0.1 0.3 0.2 0.1 0 0 0 5 10 15 0 5 Time (seconds) 10 15 Time (seconds) Figure 7. Containing arcs, Λ as a function of time for the networks in Fig. 6. The convergence speed of the containing arcs under the constant frequency method, with ωa = 0.3ω0 , and the constant time method, with τ = 0.3 seconds, is reduced compared with the phase jump case. Figure 9. Containing arcs, Λ as a function of time for the networks in Fig. 8. The convergence speed of the containing arcs under the constant frequency method, with ωa = 0.3ω0 , and the constant time method, with τ = 0.3 seconds, is reduced compared with the phase jump case. B. Peskin Synchronization Algorithm Phase 13 13.5 14 14.5 15 We will next consider the original PCO model that was first introduced by Peskin in [7]. He described the oscillators as “integrate-and-fire” oscillators, increasing in phase and firing and resetting their phase when they reached a threshold. The phase of an oscillator is mapped onto a state variable, xi (t), using the relation xi (t) = f (θi (t)), where f (θ) is a function that is “smooth, monotonic increasing, and concave down” [8]. When a pulse is received, the oscillator maps its current phase to the state variable, increments the state variable by an amount ǫ, and then maps the state back to the phase using the inverse function g(x) = f −1 (x). That is, the new phase of the oscillator can be written as 13 13.5 14 14.5 15 θi+ (t) = g(f (θi (t)) + ǫ) 15 If the state variable is incremented past the threshold value (i.e., f (θi (t))+ǫ > 1), then the oscillator immediately fires and resets its phase to zero, and becomes completely synchronized with the oscillator that had fired previously. Any function f (θ) that meets the requirements as above can be used to map the phase into the state variable. Peskin used the following function and its associated inverse: // 1 0.5 0 0 0.5 1 1.5 2 2.5 3 // Time (seconds) (a) // Phase 1 0.5 0 0 0.5 1 1.5 2 2.5 3 // Time (seconds) (b) // Phase 1 0.5 0 0 0.5 1 1.5 2 2.5 3 // 13 13.5 14 14.5 Time (seconds) (c) Figure 8. Phase Evolution of PRC Synchronization algorithm in [12] for N = 6 oscillators in a ring topology, α = 0.5, no refractory period, and random initial conditions in a containing arc Λ < 12 . (a) Continuous phase evolution under the constant frequency method, with ωa = 0.3ω0 . (b) Continuous phase evolution under the constant time method, with τ = 0.3 seconds. (c) Phase jumps, for comparison to the phase continuity methods. convergence in networks with a generally connected topology. We illustrate this case in Fig. 8, where we use the general bidirectional ring topology. Again, we see in Fig. 9 that the use of the phase continuity methods in Sec. III still allow the network to synchronize, although the convergence rate is decreased due to the reduced effective coupling strength of the oscillators at various firing instances. f (θ) = (1 − e−γ )(1 − e−γθ ) (9) (10) −γ g(x) = 1−e 1 ln( ) γ 1 − e−γ − x (11) Mirrolo and Strogatz further improved Peskin’s model in [8], and used an alternate function for mapping the phase to the state variable: 1 (12) f (θ) = ln(1 + (eb − 1)θ) b ebx − 1 (13) eb − 1 Using these functions, an equivalent phase response curve (PRC) can be found by determining φi from (1). Fig. 10 illustrates these equivalent PRCs. It is important to note that the Peskin PCO model does not incorporate any kind of coupling strength parameter, α, g(x) = 7 0.014 0.5 Peskin Mirollo-Strogatz RFA Frequency Method Time Method Jump Method 0.4 0.01 Containing Arc Phase Response Curve 0.012 0.008 0.006 0.004 0.3 0.2 0.1 0.002 0 0.2 0.4 0.6 Oscillator Phase, 0.8 0 1 0 20 30 40 50 Time (seconds) Figure 10. Phase Response Curve (PRC) equivalents for the Peskin and Mirollo-Strogatz synchronization algorithms, and the Reachback Firefly Algorithm (RFA). as in the PRC synchronization given in [12]. This is easily verified by noting that the state variable increment ǫ does not simply scale the equivalent PRC function, but modifies the overall shape of the function. The Peskin model assumes that the phase jumps the entire amount necessary according to the state mapping function parameters. Equivalently, the Peskin model assumes that the coupling strength α for the network is always 1. The lack of a coupling strength parameter makes it difficult to extend the analysis of the previous sections to the Peskin model. However, even though there is no coupling strength inherent to the Peskin model, simulations show good synchronization results when the phase continuity methods are applied. For example, using the state variable created from the functions given in (10) and (11), and the equivalent PRC function, we find the amount that the oscillator would jump and apply phase continuity methods from section III. Fig. 11 shows that the phase continuity methods still allow the PCO network to synchronize. Similarly, using the alternate state variable function introduced by Mirollo and Strogatz given in (12) and (13) also allows the network to synchronize under the phase continuity methods, as shown in Fig. 12. As expected, the convergence rates are comparable for the phase continuity methods. C. Reachback Firefly Algorithm Another synchronization algorithm that has been proposed is the Reachback Firefly Algorithm (RFA) by Werner-Allen et. al. in [9]. This algorithm is based on the Peskin PCO model, where the phase is mapped to a state variable. RFA uses a simple mapping function to decrease computational complexity. f (θ) = ln(θ) (14) g(x) = ex 10 i (15) Fig. 10 also illustrates the equivalent PRC function for the functions used in the RFA model. The key difference between the RFA model and Peskin algorithm is that the oscillators wait to jump until the moment they fire. As the oscillator receives pulses, it records how much Figure 11. Containing arcs, Λ, as a function of time for the networks under the Peskin synchronization model with parameters ǫ = 0.002, γ = 3. The convergence property of the containing arcs under the constant frequency method, with ωa = 0.3ω0 , the constant time method, with τ = 0.1 seconds, is maintained compared to the phase jump case. 0.5 Frequency Method Time Method Jump Method 0.4 Containing Arc 0 0.3 0.2 0.1 0 0 10 20 30 40 50 Time (seconds) Figure 12. Containing arcs, Λ, as a function of time for the networks under the Mirollo-Strogatz synchronization model with parameters ǫ = 0.002, b = 5. The convergence property of the containing arcs under the constant frequency method, with ωa = 0.3ω0 , the constant time method, with τ = 0.1 seconds, is maintained compared to the phase jump case. it would jump, according to the state variable mapping, at each time instance. When the oscillator reaches the threshold and fires, it then adds all of the recorded jump amounts from the previous cycle, and jumps by the total amount. This process is then repeated for each cycle until synchronization is achieved. As with the Peskin model, there is no inherent coupling strength parameter α in the RFA model. The coupling strength α is assumed to be always 1. This lack of coupling strength incorporated into the RFA model makes it similarly difficult to extend the analysis from the previous sections. However, like with the Peskin model, simulations show good synchronization results when the phase continuity methods are applied. Fig. 13 illustrates that the phase continuity methods in Sec. III allow the PCO network to synchronize. It is also important to note that the phase continuity method parameters can be within a broader interval than for the simpler Peskin model. Since each oscillator does not jump when it receives a pulse, and only when it fires, the effective coupling strength can be maximized more easily than in the Peskin model. 8 R EFERENCES 0.5 Frequency Method Time Method Jump Method Containing Arc 0.4 0.3 0.2 0.1 0 0 20 40 60 80 100 Time (seconds) Figure 13. Containing arcs, Λ, as a function of time for the networks under the Reachback Firefly Algorithm (RFA) with parameter ǫ = 0.002. The convergence property of the containing arcs under the constant frequency method, with ωa = 0.007ω0 , the constant time method, with τ = 1.1 seconds, is maintained compared to the phase jump case. The RFA algorithm further allows for phase continuity parameters to be in a broader interval than the Peskin algorithm. VII. C ONCLUSIONS In this paper, we consider the problem of synchronizing clocks while guaranteeing time continuity. To do so, we utilize and analyze the behavior of pulse-coupled oscillator (PCO) networks under the constraint of phase continuity. The original PCO network model used discontinuous phase jumps, but sharp discontinuities in the phase variable of the oscillators is usually not desirable. We present a pair of methods in which the phase variable of an oscillator is able to evolve in a continuous manner. Using these phase continuity methods, we show that the behavior of the network under these restraints can be modeled as a time-varying coupling strength in the network. Specifically, the coupling strength may be effectively reduced between firing instances. We mathematically prove that a pulse-coupled oscillator network will synchronize with a time-varying coupling strength using a delay-advance phase response curve. Overall, PCO networks under various synchronization algorithms can still achieve desirable behavior using continuous evolutions in the phase variable. The Peskin model for pulse-coupled oscillators does not include a coupling strength parameter. The model rather assumes that it is constant. Further research may be desirable to consider the effects of having a reduced, and possible timevarying, coupling strength in the Peskin model. Other phase continuity methods besides the ones proposed in this paper are possible. Specifically, methods that ensure a continuous change in oscillator frequency, rather than just a continuous change in oscillator phase, may be desirable in certain applications. Such methods may require more strict conditions to ensure the desired convergence properties. General analysis of the myriad of other PCO algorithms under phase continuity and time-varying coupling strength reveals much research potential. VIII. ACKNOWLEDGMENT We would like to thank those who reviewed the initial drafts of this paper. [1] L. Schenato and F. Fiorentin. Average timesynch: A consensusbased protocol for clock synchronization in wireless sensor networks. Automatica, 47(9):1878 – 1886, 2011. [2] L. Lamport and P. M. Melliar-Smith. Synchronizing clocks in the presence of faults. Journal of the Association for Computing Machinery, 32(1):52–78, January 1985. [3] T. K. Srikanth and S. Toueg. Optimal clock synchronization. Journal of the Association for Computing Machinery, 34(3):626–645, July 1987. [4] M. Mock, R. Frings, E. Nett, and S. Trikaliotis. Continuous clock synchronization in wireless real-time applications. In Proceedings of the 19th IEEE Symposium on Reliable Distributed Systems, SRDS ’00, pages 125–, Washington, DC, USA, 2000. IEEE Computer Society. [5] M. Ryu, J. Park, and S. Hong. Timing constraint remapping to achieve time equi-continuity in distributed real-time systems. IEEE Transactions on Computers, 50(12):1310–1320, Dec 2001. [6] B. Sundararaman, U. Buy, and A. D. Kshemkalyani. Clock synchronization for wireless sensor networks: A survey. Ad Hoc Networks 3, pages 281–323, 2005. [7] C. S. Peskin. Mathematical aspects of heart physiology. Courant Institute of Mathematical Science, New York University, New York, 1975. [8] R. Mirollo and S. Strogatz. Synchronization of pulse-coupled biological oscillators. SIAM Journal on Applied Mathematics, 50(6):1645–1662, 1990. [9] G. Werner-Allen, G. Tewari, A. Patel, M. Welsh, and R. Nagpal. Fireflyinspired sensor network synchronicity with realistic radio effects. In Proceedings of the 3rd International Conference on Embedded Networked Sensor Systems, SenSys ’05, pages 142–153, New York, NY, USA, 2005. ACM. [10] Y.W. Hong and A. Scaglione. A scalable synchronization protocol for large scale sensor networks and its applications. IEEE Journal on Selected Areas in Communications, 23(5):1085–1099, May 2005. [11] Y. Q. Wang and F. J. Doyle III. Optimal phase response functions for fast pulse-coupled synchronization in wireless sensor networks. IEEE Transactions on Signal Processing, 60(10):5583–5588, Oct 2012. [12] Y. Q. Wang, F. Núñez, and F. J. Doyle III. Energy-efficient pulsecoupled synchronization strategy design for wireless sensor networks through reduced idle listening. IEEE Transactions on Signal Processing, 60(10):5293–5306, Oct 2012. [13] F. Dörfler and F. Bullo. Synchronization in complex networks of phase oscillators: A survey. Automatica, 50(6):1539 – 1564, 2014. [14] J. Nishimura. Frequency adjustment and synchrony in networks of delayed pulse-coupled oscillators. Physical Review E, 91:012916, Jan 2015. [15] F. Núñez, Y. Q. Wang, and F. J. Doyle III. Synchronization of pulsecoupled oscillators on (strongly) connected graphs. IEEE Transactions on Automatic Control, 60(6):1710–1715, June 2015. [16] F. Núñez, Y. Q. Wang, and F. J. Doyle III. Global synchronization of pulse-coupled oscillators interacting on cycle graphs. Automatica, 52:202–209, 2015. [17] A. V. Proskurnikov and M. Cao. Synchronization of pulse-coupled oscillators and clocks under minimal connectivity assumptions. CoRR, abs/1510.02338, 2015. [18] R. Gentz, A. Scaglione, L. Ferrari, and Y. W. P. Hong. Pulsess: A pulsecoupled synchronization and scheduling protocol for clustered wireless sensor networks. IEEE Internet of Things Journal, PP(99):1–13, 2016. [19] J. Klinglmayr, C. Bettstetter, M. Timme, and C. Kirst. Convergence of self-organizing pulse-coupled oscillator synchronization in dynamic networks. IEEE Transactions on Automatic Control, PP(99):1–1, 2016. [20] G. Brandner, U. Schilcher, and C. Bettstetter. Firefly synchronization with phase rate equalization and its experimental analysis in wireless systems. Computer Networks, 97:74 – 87, 2016.
3cs.SY
ON ASYMPTOTIC STANDARD NORMALITY OF THE TWO SAMPLE PIVOT BY RAJESHWARI MAJUMDAR* AND SUMAN MAJUMDAR University of Connecticut and University of Connecticut The asymptotic solution to the problem of comparing the means of two heteroscedastic populations, based on two random samples from the populations, hinges on the pivot underpinning the construction of the confidence interval and the test statistic being asymptotically standard Normal, which is known to happen if the two samples are independent and the ratio of the sample sizes converges to a finite positive number. This restriction on the asymptotic behavior of the ratio of the sample sizes carries the risk of rendering the asymptotic justification of the finite sample approximation invalid. It turns out that neither the restriction on the asymptotic behavior of the ratio of the sample sizes nor the assumption of cross sample independence is necessary for the pivotal convergence in question to take place. If the joint distribution of the standardized sample means converges to a spherically symmetric distribution, then that distribution must be bivariate standard Normal (which can happen without the assumption of cross sample independence), and the aforesaid pivotal convergence holds. 1. Introduction. The objective of this note is to critically examine the asymptotic solution to the problem of comparing the means of two populations with finite, unequal variances. Let \"ß" ß âß \"ß8" be a random sample from the first population with mean ." and variance 5"# , and \#ß" ß âß \#ß8# a random sample from the second population with mean .# and variance 5## . When all the parameters ." , .# , 5" , and 5# are unknown, under the assumption of independence of the two samples, the traditional asymptotic "!!"  α% confidence interval for ."  .# is  W# W#  W# W#    \ "  \ #  D α#  "  # ß \ "  \ #  D α#  "  # , 8" 8# 8" 8#    1 83 83   #  \3ß4 and W3# œ 83  ""  \3ß4  \ where, for 3 œ "ß #, \ 3 œ 8" 3  , and Dα 3 denotes the "!!"  α percentile of the standard Normal distribution. The test statistic for testing the null hypothesis L! À ."  .# œ H! is 4œ" 4œ" th MSC 2010 subject classifications: 62E20, 62G20. Keywords and phrases: Asymptotic normality; Iterated and double limit; Net and subnet; One point compactification; Slutsky's theorem.   \ "  \ #  H! ,  W8"  " # W## 8#  2 which is calibrated on the standard Normal scale for the calculation of the observed level of significance and the rejection regions at various levels of significance. The simple idea underlying this widely used method is frequently presented in undergraduate (see, for example, Wackerly, Mendenhall, and Scheaffer (2008)) and beginning graduate (see, for example, Casella and Berger (2002)) textbooks on mathematical statistics. As Casella and Berger (2002, page 492) explain, the idea is to obtain a point estimator s)8 of the parameter of interest ) with variance 58# such that s)8  )58 is asymptotically standard Normal and, if the calculation of 58 involves an unknown parameter other than ), a consistent estimator 5 s 8 of 58 , so that s)  )5 s 8 is also asymptotically standard Normal by Slutsky's theorem [Mukhopadhyay (2000, Theorem 5.3.3)]; s)  )5 s 8 can then be used as a pivot for ) , and the tools for inference on the Normal mean can be applied. However, Mukhopadhyay (2000) seems to be the only one to explicitly consider the two sample problem from this point of view. Assuming that the two samples are independent and the ratio 8" Î8# Ä $ − !ß ∞, he asserts (page 544) the asymptotic standard Normality of the pivot     \ "  \ #  . "  . #   \ "  . "    \ #  .#  [8" ß8# œ œ  3 W"# W## W"# W## 8  8 8  8 " # " # underpinning the formulas of the confidence interval in 1 and the test statistic in 2. While asymptotically studying a statistical problem using two samples, many authors (see, among others, DasGupta (2008), Pyke and Shorack (1968), Ramdas, Trillos, and Cuturi (2017), and van der Vaart and Wellner (1996)) require that 8" Î8# Ä $ − !ß ∞ as 8" ß 8# Ä ∞, though this requirement risks rendering the asymptotic justification of the finite sample approximation invalid. For example, the two sample problem with 8#  8" lnln 8"  (think 8" œ &! and 8# '*) is a fairly common design, at which rate 8" Î8# Ä !; the finite sample approximation involved in using the pivot [8" ß8# to draw inference on ."  .# in such a design may not have a rigorous asymptotic justification. To investigate if we can derive the asymptotic standard Normality of [8" ß8# without the restriction that the ratio of the sample sizes converges to a finite positive number, we formulate the question in terms of weak convergence. For a separable metric space f , let U f  denote the Borel 5-algebra of f and `f  the set of probability measures on U f . Endowed with the topology of weak convergence, `f  is metrizable as a separable metric space [Parthasarathy (1967, Theorem II.6.2)]. Since all the random elements under consideration are Borel measurable, convergence in distribution is equivalent to weak convergence of the induced probability measures [van der Vaart and Wellner (1996, page 18)]. With J8" ß8# − `d  denoting the measure induced by [8" ß8# on U d , 4 the asymptotic standard Normality of [8" ß8# is equivalent to the convergence of the double sequence J8" ß8# to F in `d , where F denotes the standard Normal measure on Ud . Faced with the question of convergence of a double sequence, we examine both the iterated and double limits of J8" ß8# . Before proceeding further, let us spell out without any ambiguity what the assumption of independence of the two samples means in this context. Hereinafter, iid will abbreviate independent and identically distributed. We are making the following three assumptions: \"ß4 À 4 \2ß4 À 4 "  iid sequence of random variables, mean ." and variance 5"# "  iid sequence of random variables, mean .# and variance 5## the sequence \"ß4 À 4 " is independent of the sequence \#ß4 À 4 ".  5  6 7 The assumption in 7 is often stated as the \"ß4 's being independent of the \#ß4 's. Note that the triplet of assumptions 5, 6, and 7 is equivalent to the pair of assumptions \"ß4 ß \#ß4  À 4 for every 4 "  iid sequence of random vectors ", \"ß4 and \#ß4 are independent. 8  9 We are not aware of any result on the iterated limits of J8" ß8# . Proposition 1 observes that both iterated limits of J8" ß8# equal F under only 5 and 6, that is, without 7. As far as the double limit of J8" ß8# is concerned, the only published result we are aware of is Mukhopadhyay (2000) cited above. However, by requiring that 8" Î8# Ä $ − !ß ∞ as 8" ß 8# Ä ∞, Mukhopadhyay (2000) does not obtain the double limit of J8" ß8# . We obtain the double limit of J8" ß8# by using the fact that a double sequence is a net. Let Á denote the set of natural numbers; then Á ‚ Á is a directed set under the partial ordering ¤ defined by the condition that 8" ß 8#  ¤ 7" ß 7#  if and only if 8" 7" and 8# 7# . A double sequence B8" ß8# À 8" ß 8# " taking values in f converges to B − W as 8" ß 8# Ä ∞ if and only if the corresponding net Bα À α − Á ‚ Á converges to B. Thus, our objective reduces to obtaining lim Jα œ F. α 10 Proposition 2 shows that 5 and 6 are not sufficient for 10. Proposition 3 shows that 10 is implied by the convergence of the joint distribution of the standardized sample means to a spherically symmetric distribution, which implies that the limiting spherically symmetric distribution is bivariate standard Normal (see Remark 1). Corollary 1 and Remarks 3 and 4 investigate the question of necessity of the convergence of the joint distribution of the standardized sample means to the bivariate standard Normal distribution for 10, to which Proposition 4 furnishes a partial answer, and Remark 6 outlines the setup wherein a complete answer is obtainable. Detailed statements of these results and their proofs constitute Section 2. The technical results that we draw upon for the proofs of our results are assembled in three Appendices, A.1, A.2, and A.3. 2. Results and Proofs. In what follows, unless otherwise specified, we will assume that the index 3 runs from " to # and \3ß4 À 4 " are as in 5 and 6. Proposition 1 With J8" ß8# as in 4, lim lim J8" ß8# œ lim 8" Ä∞ 8# Ä∞ lim J8" ß8# œ F. 8# Ä∞ 8" Ä∞ 11  For subsequent use, let us introduce the following notations. For 5 − Á, let \ 3ß5 denote 5 5  # #  \3ß4 Î5 and W3ß5 denote  \3ß4  \ 3ß5  Î5  ". For 3 −   "ß ", let F ‚ F3 − `d  denote the bivariate Normal distribution with means !, variances ", and correlation coefficient 3. Thus, F ‚ F! is the product measure F ‚ F, the bivariate standard Normal distribution. For ) !, let a) − `d  denote the centered Normal measure with variance ) so that a" œ F. Let 0 À Á È Á ‚ Á denote the order preserving and cofinal map given by 05  œ 5ß 5 . Further, let 83 À Á ‚ Á È Á denote the order preserving and cofinal map that maps α − Á ‚ Á to its 3th coordinate 83 α. For α − Á ‚ Á, let 4œ" 4œ" # 8α œ min8" αß 8# α, 7α œ 8" α8# α, and /α œ 8" αÎ8# α. Proposition 2 Let \"ß4 ß \#ß4  À 4 " be iid, with F ‚ F3 being the common distribution. Assume 3 Á !. Then 5 and 6 hold, but 10 does not. Definition For 5 − Á, let \ d 5  denote the set of isometries on d 5 [Axler (2015, Definition 7.37)]. An element U − `d 5  is called spherically symmetric if the Pettis integral of the identity function with respect to U is ! − d 5 , and, for every b − \ d 5 , U‰b" œ U, where U‰b" − `d 5  is the measure induced by b, that is, U‰b" F  œ UB" ß âß B5  − d 5 À bB" ß âß B5  − F  for any F − U d 5 . Let f d 5  denote the set of spherically symmetric elements in `d 5 . 3 Proposition 3 For α − Á ‚ Á, let ]α denote the standardized sample mean  83 α\ 3ß83 α  .3 53 and Lα − `d #  the measure induced by ]α œ ]α ß ]α . Then 10 is implied by " lim Lα œ U − f d # . α # 12 Remark 1 The sufficient condition for 10 stated in 12 is equivalent to lim Lα œ F ‚ F. α 13 Since F ‚ F − fd # , 13 implies 12. To show the converse, it suffices to assume 12 and show U œ F ‚ F, equivalently, U‰Ø † ß +" ß +# Ù" œ F for every unit vector +" ß +# . Since given any two unit vectors there exists an isometry mapping one to the other, by the spherical symmetry of U, U‰Ø † ß +" ß +# Ù" œ U‰Ø † ß "ß !Ù" . Since, by the continuous mapping theorem for nets [Lemma A.7] and 12, U‰Ø † ß "ß !Ù" equals lim Lα ‰Ø † ß "ß !Ù" , it suffices to show that lim Lα ‰Ø † ß "ß !Ù" œ F. α α  3 For 5 − Á, let T5 − `d  denote the measure induced by 5 \ 3ß5  .3 Î53 , which, by 5 or 6, converges to F by the Central Limit Theorem (CLT, hereinafter) [Dudley (1989, Theorem 9.5.6)]. Since convergence in `d  is metrizable, 83 is order preserving and cofinal, and any subnet of a convergent net has the same limit [Lemma A.2], 3 3 lim T83 α œ lim T5 œ F. α 5−Á Since Lα ‰Ø † ß "ß !Ù" œ T8" α , the converse follows from 14. " Remark 2 Note that 7 implies " # Lα œ T8" α ‚ T8# α ; 14 // 15 since the product of two weakly convergent nets of probability measures converges to the product of the limits [Lemma A.8], 15 implies 13 via 14. Thus, the folklore sufficient conditions 5, 6, and 7, equivalently, 8 and 9, do imply 13, and consequently 10, without requiring 8" Î8# to converge to $ − !ß ∞. // Remark 3 Does 10 imply 13? While we cannot construct a counterexample where 10 holds, above and beyond 5 and 6, but 13 does not, we do not believe that the affirmative answer holds because of Corollary 1. // Corollary 1 Recall the definition of [α from 3 and define   \ "ß8" α  ."   \ #ß8# α  .#  ; Yα œ  " α # W"ß8 8" α  # α  # W#ß8 8# α let Kα − `d  denote the measure induced by Yα on U d . Then 13 implies lim Kα œ F. α 16 Remark 4 If 10 were to imply 13, by Corollary 1, 10 would have to imply 16. We see no reason why 10, under only 5 and 6, would imply 16 (or vice-versa). However, Proposition 4 does connect 10, 13, and 16. // Proposition 4 If 17 P œ lim Lα α exists, and 10 and 16 hold, then 13 holds. Remark 5 By 14 and Proposition 9.3.4 of Dudley (1989), T5 À 5 − Á is uniformly 3 tight. Consequently, T83 α À α − Á ‚ Á, being contained in T5 À 5 − Á, is 3 3 uniformly tight as well. By Tychonoff's theorem and Bonneferroni's inequality, Lα À α − Á ‚ Á is uniformly tight. 18 Can we establish Proposition 4 without assuming 17, substituting it by the conclusion drawn in 18? We do not think so, though a counterexample eludes us. // Lemma 1 is a vital cog in the wheel of our investigation of whether 10 implies 13. s α − `d  denoting the measure induced by Lemma 1 With J   \ "ß8" α  ."   \ #ß8# α  .#  s [α œ # #  8 5"α  8 5#α " # on Ud , 10 is equivalent to s α œ F. lim J α 19 Remark 6 Proposition 4 strengthens our belief that 10 does not imply 13, but we are, as mentioned above, unable to construct a counterexample. One of the major obstacles to constructing such a counterexample is the fact that it is simply impossible to get a handle on the asymptotic distribution of either [α À α − Á ‚ Á or ]α À α − Á ‚ Á unless we are willing to assume some specific dependence structure for the sequence \"ß4 ß \#ß4  À 4 ". If we assume, above and beyond 5 and 6, that \"ß4 ß \#ß4  À 4 " is an independent sequence of random vectors, 20 then Theorem 1 of Majumdar and Majumdar (2017) shows 10 implies 13 (which renders Proposition 4 moot), by showing that the convergence of the Cesaro means of the sequence of cross sample correlation coefficients to ! is a sufficient condition for 13 that turns out to be necessary for 19, equivalently, by Lemma 1, 10. The assumption in 20, being the assumption in 8 with the identically distributed requirement removed, is weaker than 8. The aforesaid convergence of Cesaro means assumption is substantially weaker than 9. It is easy to see that if we combine the convergence of Cesaro means assumption with 5, 6, and 20, the resulting collection is weaker than the pair of assumptions in 8 and 9. All we have to do is to consider a pair of dependent but uncorrelated random variables and a sequence of iid copies of the resulting random vector. By Theorem 1 of Majumdar and Majumdar (2017), 13 can hold without 7. // We now present the proofs of the results stated above. Proof of Proposition 1 The key to the proof is the algebraic representation    8"  \ 8# \ "  ."  #  .#  " [8" ß8# œ ‚ Z8" ß8#  ‚ Z8"#ß8 # , 5" 5# 21 where Z8""ß8 # œ Z8"#ß8 # œ 5" W"#  88"# ‚ W## 5# . 22  88#" ‚ W"#  W## Now, let us fix 8# and let 8" Ä ∞. Since W"# converges (in probability) to 5"# [Lemma " # A.5], Z8" ß8# converges to ! and Z8" ß8# converges to 5# ÎW# . By the CLT and Slutsky's theorem, the first term in RHS21 converges in distribution (and, by Theorem 4.2.9 of Fabian and Hannan (1985), in probability) to !. Since the second term in RHS21  converges in distribution to 8# \ #  .# ÎW# , another application of Slutsky's theorem leads to the conclusion that, for fixed 8# , as 8" Ä ∞,  [8" ß8# converges in distribution to  8# \ #  .# ÎW# . 23 Since W## converges in probability to 5## [Lemma A.5], by the CLT and Slutsky's theorem,   8# \ #  .# ÎW# converges, as 8# Ä ∞, in distribution to ^# µ F. The same argument, with 8" and 8# interchanged, shows that if we fix 8" and let  8# Ä ∞, [8" ß8# converges in distribution to 8" \ "  ." ÎW" , which, as 8" Ä ∞, converges in distribution to ^" µ F.  Proof of Proposition 2 Clearly, \3ß4 À 4 " is an iid collection of standard Normal random variables, showing that 5 and 6 hold, with .3 œ ! and 53 œ ". The measure induced by H4 œ \"ß4  \#ß4 on U d  is a#"3 for every 4 − Á, implying that the # measure induced by  H4 5 is a#"3 for every 5 − Á. Since W3ß5 converges in 5 4œ" # #  probability to " as 5 Ä ∞ [Lemma A.5] and [05 œ   H4 5 W"ß5  W#ß5 5 "Î# , by Slutsky's theorem the subnet J05 À 5 − Á of Jα À α − Á ‚ Á converges to a"3 , implying, by Lemma A.2 and the assumption 3 Á !, that 10 does not hold.  4œ" Proof of Proposition 3 By Lemma A.3, to show 10 it suffices to show that given an arbitrary subnet J9" À " − Y  of Jα À α − Á ‚ Á, there exists a further subnet J9:$  À $ − · such that lim J9:$  œ F. For α − Á ‚ Á, 22 implies $ Zα3 œ 53 # /α"3 W"ß8 " α  # /α#3 W#ß8 # α . 24 Let !ß ∞ denote the one-point compactification of Ò!ß ∞Ñ [Dudley (1989, Theorem 2.8.1)]. Since every net taking values in a compact set has a convergent subnet [Lemma A.4], every subnet /9" À " − Y  of /α À α − Á ‚ Á has a further subnet /9:$  À $ − · such that lim /9:$  œ , − !ß ∞. $ 25 Since convergence in probability on Euclidian spaces is metrizable [Dudley (1989, # Theorem 9.2.2)] and 83 is order preserving and cofinal, by Lemma A.5, W3ß8 converges 3 α # in probability to 53 ; consequently, by Lemma A.2, 24, and 25, in probability 53 3 26 lim Z9:$  œ +3 œ − !ß ". ,"3 5"#  , #3 5## $ Note that +3 depends on the subnet /9:$  À $ − · through , ; , œ ! implies +" œ " and +# œ !, , œ ∞ implies +" œ ! and +# œ ", and, in general, +"#  +## œ ". 27 By 12 and Lemma A.#, L9:$  À $ − · converges to U. Since [α œ ]α ß Zα  by 21, where Zα œ Zα ß  Zα , by Slutsky's theorem for nets [Lemma A.6] and " Lemma A.7, 26 implies # lim J9:$  œ U‰Ø † ß +" ß  +# Ù" . $ 28 Since given any two unit vectors there exists an isometry mapping one to the other, by 26, 27, and the spherical symmetry of U, RHS28 does not depend on the subnet /9:$  À $ − ·. By Lemma A.3, lim Jα œ J − `d  exists for some J − `d . α Since an iterated limit exists and equals the double limit if the latter and the inner limit of the former exists [Lemma A.1], by 23, lim lim J8" ß8# œ J ; since J œ F by Proposition 1, 10 follows. 8# Ä∞ 8" Ä∞  Remark 7 DasGupta (2008, page 403) considers the Behrens-Fisher problem of comparing the means of two independent heteroscedastic normal populations and the two sample t-statistic that uses the pooled variance 8"  "W"#  8#  "W## 8"  8#  # # W:ß8 œ " ß8# for studentization, that is X8" ß8# œ   \ "  \ #  . "  . #  , " W:#  8"  " 8#  as a potential pivot. He observes that if the ratio 8" Î8# converges to ", that is, the design is asymptotically balanced, then the asymptotic distribution of X8" ß8# is standard Normal. As outlined below, that observation is a consequence of 10. Given an arbitrary subnet X9" À " − Y  of Xα À α − Á ‚ Á, there exists a further subnet X9:$  À $ − · such that 25 holds. Since 83 is order preserving and cofinal, and convergence in probability on Euclidian spaces is metrizable, by Lemma A.5 and Lemma A.2, in probability, lim W:ß#9:$  œ 5"#  $ , " ,5"#  5## # ;  5 œ   # ," ," ," with Vα œ # # W"ß8  /α W#ß8 " α # α W:ß#α "  /α  , we obtain from Lemma A.5 and Lemma A.2 again, that, in probability, lim V9:$  œ $ 5"#  ,5## œ ) , . ,5"#  5## Since Xα œ [α Vα , with Oα − `d  denoting the distribution induced by Xα , by Slutsky's theorem for nets, as long as 10 holds, we obtain lim O9:$  œ a), . $ For asymptotically balanced designs, ,=1 for every subnet /9:$  À $ − ·, and Dasgupta's observation follows, showing that neither the Normality of the populations nor their cross sample independence is necessary for it. However, X8" ß8# is an inferior choice for pivot compared to [8" ß8# , as asymptotic Normality of [8" ß8# in 10 holds for all designs, whereas that of X8" ß8# holds only for asymptotically balanced designs. // Proof of Corollary 1 The proof of Proposition 3 applies verbatim once we replace Zα in " # that proof by Zα‡ œ Zα ß Zα  and note that Yα œ Ø]α ß Zα‡ Ù.  Proof of Proposition 4 As observed in Remark 1, P œ F ‚ F if and only if P‰Ø † ß +" ß +# Ù" œ F for every unit vector +" ß +#  − d # . Corresponding to every +" − !ß ", there exist two unit vectors: +" ß "  +"#  in the first quadrant and +" ß  "  +"#  in the fourth quadrant. Since F is invariant under the map B È  B, it suffices to show that for every +" − !ß ", P‰ † ß +" ß "  +"#  " œ F œ P‰ † ß +" ß  "  +"#  . " 29 We first show that given , − !ß ∞, there exists a directed set Y, and an order preserving and cofinal 9, À Y, È Á ‚ Á such that the subnet /9, " À " − Y,  of /α À α − Á ‚ Á converges to ,. If , œ ∞, let Y∞ œ Á ‚ Á and define 9∞ α œ 8" αß v8" α, where v is the integer part function on "ß ∞. Clearly, 9∞ is order preserving. To show that 9∞ is # cofinal, given α − Á ‚ Á choose α s − Á ‚ Á such that 8" α s œ max8" αß 8# α ; since v8" α s 8# α, 9∞ α s ¤ α. Since /9∞ α œ 8" αÎv8" α 8" α, the convergence of /9∞ α to , œ ∞ follows. If , œ !, let Y! œ Á ‚ Á and define 9! α œ 8# αß 8# α# . Clearly, 9! is order preserving. To see that 9! is cofinal, given α − Á ‚ Á choose α s − Á ‚ Á such that #  max   α   α   ; trivially,  8  α   8  α  , implying 9! α 8# α œ 8 ß 8 s s ¤ α. Since " # # s # # /9! α œ 8# αÎ8# α œ "Î8# α, the convergence of /9! α to , œ ! follows. If , − !ß ∞, let Y, œ Á; define 9,w < œ vmax<  ",  "Î<ß !  " and 9, < œ 9,w <ß <  ". It is easy to see that 9,w < is nondecreasing, implying that 9, is order preserving. To see that 9, is cofinal, given α − Á ‚ Á choose s< − Á to equal maxv‡<,ß α  "ß 8# α, where ‡<,ß α œ ,  "  8" α#  %,  ,  "  8" α #, ; since ,  !, ,  "  8" α#  %, is positive and ‡<,ß α is well-defined. Since ‡<,ß α is the bigger root of the quadratic (in <) ,<#  ,  "  8 α<  ", every " < − Á greater than ‡<, ß α satisfies the inequality ,<#  ,  "  8" α<  "  0, equivalently, the inequality <  ",  "Î<  8" α. Since s<  ‡<,ß α ‡<,ß α, 9,w s<  8" α, implying 9, s< ¤ α. Finally, from the definition of v, 9,w <  " Ÿ max<  ",  "Î<ß !  9,w <, implying max,  "Î<ß !  9,w < " ; Ÿ max,  "Î<ß !  <" <" since ,  ! and 9, < œ 9,w <ß <  ", lim /9, < œ ,. < Given +" − !ß ", let , +"  œ 5" 5#"  +"#  " − !ß ∞, where , ! is interpreted to # be ∞. Let /9,+  " À " − Y  be a subnet of /α À α − Á ‚ Á that converges to , +" . That, as in 26, implies, in probability " 5" " lim Z9 " œ œ +" # 5"  , +" 5## , + "  " 5# # lim Z9 " œ œ "  +"# . # 5" , + "  # "  5 ,+"  # Using [α œ ]α ß Zα  and Yα œ Ø]α ß Zα‡ Ù from the proofs of Proposition 3 and Corollary 1, 17, Lemma A.6, and Lemma A.7, 29 follows from 16 and 10.  Proof of Lemma 1 For α − Á ‚ Á, let Uα œ 5"# 8" α " α  # W"ß8 8" α   5## 8# α # W#ß8 α  8# α # œ /α" 5"#  5## 5"#  /α 5## . œ # # # " W # W"ß8  / W /  W α α α α α α         #ß8 "ß8 #ß8 " # " # 30 By Lemmas A.6 and A.7, it suffices to show that Uα converges in distribution to ". Since convergence in distribution is metrizable, by Lemma A.3 it suffices to show that given an arbitrary subnet U9" À " − Y  of Uα À α − Á ‚ Á, there exists a further subnet U9:$  À $ − · such that U9:$  converges in distribution to 1. Recall from 25 the existence of a subnet /9:$  À $ − · that converges to , . Since /9:$  À $ − · # converges in distribution to , and W3ß8 converges in probability (and hence, in 3 α distribution) to 53# , the assertion follows from 30 (for , œ ∞, use the last representation) and Lemmas A.6 and A.7Þ  A.1. Double and iterated limits. Given a metric space Wß . , a W –valued double sequence is defined to be a function B À Á ‚ Á È W , where Á denotes the set of positive integers. We write B:ß ;  as B:ß; ; recall that B:ß; converges to B − W as :ß ; Ä ∞ if, for every %  !, there exists 8! % − Á such that :  8! and ;  8! imply . B:ß; ß B  %. Now suppose that for every fixed value of :, lim B:ß; œ C: exists. Then, C: À : − Á is ;Ä∞ a W –valued sequence. If lim C: œ C exists, then C is an iterated limit of the double sequence B:ß;  and we write lim lim B:ß; œ C. As illustrated in Section 8.20 of Apostol :Ä∞ :Ä∞ ;Ä∞ (1974), the existence of one iterated limit does not imply the existence of the other one (with W œ d , let B:ß ;  œ   ": ::  ; " ), the existence of both iterated limits does not imply their equality (with W œ d , let B:ß ;  œ ::  ; " ), and the equality of the two iterated limits does not imply the existence of the double limit (with W œ d , let " B:ß ;  œ :; :#  ; #  ). However, an iterated limit exists and equals the double limit if the latter and the inner limit of the former exists. Lemma A.1 If the double limit of B:ß; , as :ß ; Ä ∞, exists and is equal to B, then existence of lim B:ß; for each fixed : implies lim lim B:ß; œ B. ;Ä∞ :Ä∞ ;Ä∞ Proof of Lemma A.1 This is Theorem 8.39 of Apostol (1974), stated and proved when W is the complex plane with . +ß , being the absolute value of the difference +  , . That proof can be repeated verbatim here.  A.2. Nets and subnets. A set · endowed with a reflexive, anti symmetric, and transitive binary relation ¤ is called a partially ordered set. The pair ·ß ¤  is called a directed set if, for each " ß # − ·, there exists ( − · such that ( ¤ " and ( ¤ # . Given a metric space Wß .  and a directed set ·ß ¤ , a W –valued net is defined to be a function B À · È W ; we write the net as B" À " − ·. Recall that the net B" À " − · converges to B − W if, for every %  !, there exists "! % − · such that " ¤ "! % implies . B" ß B  %. It is worth recalling here that a W –valued sequence is a particular W–valued net. Let ·ß ¤  and ¸ ß ¦  be directed sets. Let 9 À ¸ È · be order preserving, that is, 3 ¦ 4 Ê 93 ¤ 94, and cofinal, that is, for each " − ·, there exists # − ¸ such that 9#  ¤ " . Then the composite function C œ B‰9, where B À · È W , defines a net C# À # − ¸  in W , is called a subnet of B" À " − ·, and is written as B9# À # − ¸ . Lemma A.2 Let · be a directed set and B" À " − · a net taking values in W that converges to B − W . Then every subnet of B" À " − · converges to B. Lemma A.3 Let ·ß ¤  be a directed set and B" À " − · a net taking values in W . Then B" À " − · converges to B − W if and only if every subnet of B" À " − · has a further subnet that converges to B. Lemma A.4 W is compact if and only if every net in W has a convergent subnet. We refer the reader to Appendix A.1 of Majumdar and Majumdar (2017) for the proofs of these three lemmas. EÞ$Þ Miscellaneous results from probability. We have used Lemmas A.5, A.6. A.7, and A.8 of this subsection in the paper. Lemma A.5 (Consistency of sample standard deviation) As 5 Ä ∞, W3ß5 converges almost surely (and hence, in probability) to 53 . Proof of Lemma A.5 Since # # 5  "W3ß5 œ \34#  5 \ 3ß5 , 5 4œ" almost sure convergence follows from the SLLN. Since almost sure convergence of a sequence (as opposed to a net) of random variables implies convergence in probability [Fabian and Hannan (1985, Theorem 4.2.7)], the proof follows.  Lemma A.6 (Slutsky's theorem for nets) Let W and X be metric spaces and Ç a directed set. Let \# À # − Ç  and ]# À # − Ç  be nets of random elements taking values in W and X , respectively, such that \# Ä \ weakly and ]# Ä - weakly, where \ is a separable random element, that is, there exists a Borel measurable separable subset ` of W such that T \ − ` œ ", and - is a constant. Then, as a net of random elements taking values in W ‚ X , \# ß ]#  Ä \ß -  weakly. Proof of Lemma A.6 See van der Vaart and Wellner (1996, Section 1.4).  Lemma A.7 (Continuous mapping theorem for nets) Let \# À # − Ç  be a net of random elements taking values in d 5 such that \# Ä \ in distribution. Let 1 À d 5 È d 7 be a continuous function. Then 1\#  Ä 1\  in distribution in d 7 . Proof of Lemma A.7 See Theorem 1.3.6 of van der Vaart and Wellner (1996).  Lemma A.8 Let W" and W# be separable metric spaces such that ." À " − Y  § `W"  and /" À " − Y  § `W#  are two nets converging weakly to . − `W"  and / − `W# , respectively. Then the net ." ‚ /" À " − Y  § `W" ‚ W#  of product measures converges weakly to . ‚ / . Proof of Lemma A.8 This lemma extends Lemma III.1.1 of Parthasarathy (1967) from sequences to nets. The proof of that lemma consists of three steps. In the first step it is shown that the algebra generated by all real valued functions on the product space that are products of bounded real valued uniformly continuous functions on the component spaces is dense (in the supremum norm) in the space of bounded real valued uniformly continuous functions on the product space. This step does not need any extension. In the second step it is shown (using the structure of this dense algebra) that the sequence of integrals of every function in that algebra wrt the sequence of product measures converges to the integral of the same function wrt the product of the limiting measures; this step readily extends to nets of measures from the definition of weak convergence of the component measures, thereby establishing (via the supremum norm approximation) that the net of integrals of every bounded real valued uniformly continuous function wrt the net of product measures converges to the integral of the same function wrt the product of the limiting measures. The third step uses Theorem II.6.1 of Parthasarathy (1967), which asserts the equivalence of weak convergence of a net of measures to another measure and the convergence of integrals of every bounded real valued uniformly continuous function wrt the net of measures to the integral of the same function wrt the limiting measure, so no extension is required for this step.  References [1] Apostol, T. M. (1974). Mathematical Analysis, Addison-Wesley, Reading, MA. [2] Axler, S. (2015). Linear Algebra Done Right, Springer, New York, NY. [3] Casella, G. and Berger, R. L. (2002). Statistical Inference, Second Edition, Brooks/Cole, Belmont, CA. [4] DasGupta, A. (2008). Asymptotic Theory of Statistics and Probability, Springer, New York, NY. [5] Dudley, R. M. (1989). Real Analysis and Probability, Wadsworth & Brooks/Cole, Pacific Grove, CA. [6] Fabian, V. and Hannan, J. (1985). Introduction to Probability and Mathematical Statistics, Wiley, New York, NY. [7] Majumdar, R. and Majumdar, S. (2017). Necessary and Sufficient Condition for Asymptotic Normality of Standardized Sample Means. arXiv preprint, arXiv:1710.07275. [8] Mukhopadhyay, N. (2000). Probability and Statistical Inference, Marcel Dekker, New York, NY. [9] Parthasarathy, K. R. (1967). Probability Measures on Metric Spaces, Academic Press, New York, NY. [10] Pyke, R. and Shorack, G. R. (1968). Weak Convergence of a Two-Sample Empirical Process and a New Approach to Chernoff-Savage Theorems. Ann. Math. Statist. 39 755771. [11] Ramdas, A., Trillos, N. C., and Cuturi, M. (2017). On Wasserstein Two-Sample Testing and Related Families of Nonparametric Tests. Entropy 19 Vol 2 Paper No 47. [12] van der Vaart, A. W. and Wellner, J. A. (1996). Weak Convergence and Empirical Processes, Springer, New York. [13] Wackerly, D. D., Mendenhall, W., and Scheaffer, R. L. (2008). Mathematical Statistics with Applications, Brooks/Cole, Belmont, CA. RAJESHWARI MAJUMDAR [email protected] PO Box 47 Coventry, CT 06238 SUMAN MAJUMDAR [email protected] 1 University Place Stamford, CT 06901
10math.ST
Coupling Control and Human-Centered Automation in Mathematical Models of Complex Systems arXiv:cs/0702149v1 [cs.CE] 25 Feb 2007 Roderick V. N. Melnik∗ Mathematical Modelling & Computational Sciences, Wilfrid Laurier University, Waterloo Campus, 75 University Avenue West, Waterloo, ON, Canada N2L 3C5 Abstract It is known that with the increasing complexity of technological systems that operate in dynamically changing environments and require human supervision or a human operator, the relative share of human errors is increasing across all modern applications. This indicates that in the analysis and control of such systems, human factors should not be eliminated by conventional formal mathematical methodologies. Instead, they must be incorporated into the modelling framework giving rise to an innovative concept of humancentered automation. In this paper we analyze mathematically how such factors can be effectively incorporated into the analysis and control of complex systems. As an example, we focus our discussion around one of the key problems in the Intelligent Transportation Systems (ITS) theory and practice, the problem of speed control, considered here as a decision making process with limited information available. The problem is cast mathematically in the general framework of control problems and is treated in the context of dynamically changing environments where control is coupled to human-centered automation. Since in this case control might not be limited to a small number of control settings, as it is often assumed in the control literature, serious difficulties arise in the solution of this problem. We demonstrate that the problem can be reduced to a set of Hamilton-Jacobi-Bellman equations where human factors are incorporated via estimations of the system Hamiltonian. In the ITS context, these estimations can be obtained with the use of on-board equipment like sensors/receivers/actuators, in-vehicle communication devices, etc. The proposed methodology provides a way to integrate human factor into the solving process of the models for other complex dynamic systems. Key words: complex dynamic systems, artificial intelligence, speed control, intelligent transportation systems, human factors, Hamiltonian estimations. ∗ Tel.: +1-519-884-1970 (3662); E-mail: [email protected] 1 Introduction It is generally accepted that much of human intelligence can be characterized as the ability to recognize complex patterns, to analyze them and, if possible, to control. In this process the visual system, among others, together with cognition play a central role ([3], p.11). In creating advanced technological systems human factors modelling must be incorporated as the processes of complex pattern recognition, their analysis, and ultimately control are intrinsically hierarchical. In this contribution we demonstrate how this can be achieved on an important example from the ITS theory - the problem of speed control. The main reason for this choice lies with the fact that while being strongly dependent on human factors, efficient speed control is known to be one of the key problems in the ITS technology [4, 5, 6, 34]. For the purpose of this paper we limit ourselves to three main technological analogies of human intelligence mentioned already, pattern recognition, analysis, and control. In the context of ITS technology such analogies are pertinent to (a) the application of information-driven functions (software for both control and computation) and (b) communications systems to controlling traffic (i.e. operating transport effectively, handling emergencies and incidents if they arise, automating driving and safety, etc). These aspects are in the heart of the development of intelligent vehicles and highway systems (e.g., [9] and references therein). Having specified our focus area from where all our examples will be drawn, we note further that our discussion will be pertinent to mathematical models for the development of automated driving strategies based on a regulated speed control. Such strategies are important in many areas including collision avoidance (e.g., control the vehicle with respect to a vehicle running ahead, control the merging process into a main traffic steam where the “target” vehicle is running), the minimisation of the fuel consumption, etc. Under the requirements of increased safety, minimisation of the fuel consumption, and strict environmental constraints imposed by the government, many automotive and transport engineering companies have increased their attention to this problem [4, 5, 37, 6, 34, 2, 8, 24]. The increased complexity of intelligent transportation systems in this area and the successful development of automated driving strategies require accounting for human-related design factors and the integration of these factors into mathematical models used. These factors remain an important link in a chain of automated driving strategies developed from the application of mathematical models. Although there is no general model describing the dynamics of human interaction with complex systems in dynamically changing environment [33, 10], by analyzing existing approaches applied previously to some model transport problems, in this paper we suggest a simple and efficient way to account for human factors in the solution of the speed control problem by considering a sequential HJB-equation-based approximation of the system Hamiltonian. Human-centered technologies are used frequently in many applications, including artificial intelligence [35, 39]. As pointed out in [17], although much system development is still currently done by using a technology-centered approach (that is automating the functions the technology is able to perform), we witness an increasing-in-importance potential of human-centered design where we combine skilled human and automated support. This relatively new paradigm, has already demonstrated its importance in complex system development where intervention of humans is still necessary on supervisory basis and/or at certain stages of system evolution (e.g., [25] and references therein). Nevertheless, the body of literature in this area is minimal [1, 22, 25], let alone mathematically rigorous developments. From a methodological point of view the approach we develop in this contribution can be viewed as a blend of control and human-centered automation aspects in the design/control of 2 intelligent transportation systems where we have to satisfy often competing requirements of human and technological objectives accounting for their capability limitations and constraints [10]. The proposed approach is generic enough to be applicable to system developments in application areas outside of the ITS domain. Finally, we note that our approach has much in common with the paradigm of supervisory control [20, 26] where, in the context of our problems, the control algorithm should respond in real time to changing conditions where the underlying process can be represented in a space of discrete events [27]. Taking this point of view into account, we structure the rest of this paper as follows. • In Section II we provide a general mathematical framework for controlling complex systems by using continuous and discrete control settings. The discussion is given in the context of the ITS speed control problem. • In Section III we consider a specific example of the speed control problem subjected to the minimization of the fuel consumption. • In Section IV two important approaches to the development of automated driving strategies are discussed and difficulties in their computational implementation are analyzed in detail with exemplification given for the problem considered in Section III. In this section it is also shown that the general speed control problem can be reduced to a model based on the solution of HJBtype equations where human factors are incorporated naturally via estimations of the system Hamiltonian. • Concluding remarks are given in Section V. 2 Mathematical formulation of the problem, exemplified for advanced vehicle system control While the formulation given in this section can be easily adapted to control of other complex systems, we exemplify our discussion here with an example concerning control of advanced vehicle systems. The model-based computer-aided control has become an intrinsic component of ITS technology. Due to the increased complexity and tight coupling of many different constraints imposed on the automotive systems development process, this control becomes increasingly important [36]. Such constraints come from the growing environmental and economic concerns leading to the rising customer expectations for fuel economy, performance, tightening emission, etc. There is a growing expectation that these constraints could be resolved by developing advanced transportation technologies [21]. Since many of these constraints are dependent strongly on the choice of driving strategies, this leads to the necessity of coupling control with humancentered automation at the level of modelling rather than at the stage of system utilization. Human-centered automation is a relatively new concept that plays an increasingly important role in new technologies, both military and civil [10, 22]. While computers are in the heart of control of most complex man-designed systems, full automation is often either not feasible or not reasonable, in particular if system and/or environment conditions are rapidly changing. In situations like this, function allocation and coupling between human factors and automation become critical [22]. In this contribution, we demonstrate that this coupling can be treated formally via a sequential estimation of the system Hamiltonian, providing an important tool in theory and applications of ITS and other complex systems. First, we formulate the problem of interest in the general framework of control problems providing all the explanations on an example of the analysis of the situation on the road during the interval time [0, T ], followed by the subsequent development of automated control 3 strategies for road participants (driver-vehicle subsystems). This problem can be formulated as minimization of the following functional Z T J(u, v) = f0 (x(t), t, v(t), u(t))dt → min, (2.1) 0 where v, u are Rm → Rm functions that represent the velocity and control of the entire dynamic system consisting of m subsystems (m ∈ N, e.g. the number of vehicles), and the function f0 is the objective (problem-specific) function that could characterise fuel consumption, emissions, etc (or a combinations of those quantities incorporated via corresponding weights). In (2.1) T is the prescribed (or estimated maximum) time, e.g. the time of reaching the final destination, v = dx , x(t) = (x1 , x2 , ..., xm ) ∈ Rm is the position of the road participants at time t with applied dt (speed) control u. The dynamics of coupling between the velocity and control is governed not only by (2.1) but also by the state constraints that are assumed to have the form of the equation of motion dx = f(x, t, u(t)) dt (2.2) dv = F(x, t, v(t), u(t)). dt (2.3) and/or second Newton’s law The vector functions f and F can be viewed as problem-specific approximations to the velocity function and acceleration (see e.g. [13, 37] for some specific examples). The qualitative (and quantitative) behaviour of the solution of this problem will be determined at a large extent by control constraints [26], defined here as u(·) ∈ U(t, x), (2.4) where U(t, x) is a given space-time set. It should be noted that for the solution of the speed control problem for transport engineering systems both groups of models, with continuous control and with discrete control, have been used in the literature (see, e.g., [12] and references therein). Although models with continuous control have limited applicability in this context (moreover, their analysis typically requires the assumption of a finite number of control settings [13]), they provide an important insight into more realistic models with discrete control. A major difficulty with the existing approaches based on continuous control models becomes transparent at the computational level where the quality of results depends heavily on the number and the form of a priori chosen control (traction) phases (e.g. power, coast, brake). A similar difficulty exists for models with discrete control settings, where the total number and locations of ”switching control points” largely determines the quality of computational results. More precisely, the “switching control point” problem can be reduced to the determination of “optimal” times 0 = t0 < t1 < ... < tn (2.5) which correspond to such a partition of the vehicle trajectories xk = x(tk ), k = 0, 1, ..., n that control at those points makes the entire trip optimal in some specified sense. In conventional approaches, the responsibility on choosing the precise sequence of control settings and the determination of the “optimal” positions of these switching points can implicitly be shifted to the 4 driver [14]. However, this becomes undesirable in the context of ITS where the driving strategy should be automated effectively to minimise the probability of accidents and to satisfy other goals of traffic control. Since the performance of the entire dynamic system can be improved greatly by increasing the number of discrete control settings, the ITS technology can provide an effective way to achieve these goals by implementing highly efficient driving control strategies on automated highway systems (AHS), a next generation of road systems that are intended to resolve various traffic issues [34]. Such driving strategies can be developed from the solution of problem (2.1)–(2.4) for a sufficiently high number n in (2.5). The practical implementation of such strategies for large n will require the installation of on-board equipment such as actuators for controlling the breaks and throttle, LCX (leakage coaxial cable) receivers, as well as a laser radar and inter-vehicle communication devices. Then, in principle, the vehicles can be operated according to a vehicle velocity command (the indicated vehicle speed, road grade, road curvature, and accident information) received from the LCX cable installed alongside the road, that allows for automatically maintaining a safe vehicle speed and headway distance. We emphasize that in this case, the definition of switching times (2.5) will be made sequentially on the basis of information accumulated by the given moment of time, as opposed to the conventional techniques based on one of the a priori choices of switching times. An example involving one vehicle only is discussed in the next section in order to clarify the meaning of functions in general control problem (2.1)–(2.5) and to lay the foundation for further discussion of the key issues related to the solution of this problem in the context of ITS. 3 Conventional approaches on the example of vehicle speed control subjected to minimization of fuel consumption The literature on different aspects of control of transportation systems is vast (e.g., [12, 21, 32, 40] to name just a few). A number of authors have attempted to apply different variants of continuity principle to determine switching control times (where, e.g., intervention of the driver is required). A continuity hypothesis found also its application in continuum (fluiddynamics-like) approaches that have been developed for traffic flow models. In the latter case, such models rely frequently on unrealistic sets of assumptions and an a priori optimal velocity is one of them. More recently, several interesting contributions have been made to this area where authors realized that the underlying problem can be modelled with a hyperbolic system (with no conservation of momentum, e.g. [11] and references therein). However, the authors of these recent papers do not discuss control issues and that is where major challenges lie. Let us explain the situation on an example of vehicle speed control subjected to the minimization of the fuel consumption. First note that in a number of practical situations the general formulation of problem (2.1)–(2.4) can be simplified considerably by assuming that control and state aspects of the dynamics of the moving vehicle could be decomposed (or factorized) in the objective function, i.e. if we assume that f0 (x, t, u) = p[u(t)] · q[v(t)], (3.1) where p and q are given functions. For example, according to [13], for a problem where the total mechanical energy consumed by the vehicle is given by (2.1) and (3.1) and control is subject to the minimization of the fuel consumption, the above functions can be defined in the following 5 forms (note that m is set to 1 in this case) 1 p ≡ u+ (t) = [u(t) + |u(t)|], 2 q ≡ v(t). (3.2) As pointed out in [13], Eq. (3.2) makes sense when a maximum applied acceleration is specified and that only positive acceleration consumes energy. We note further that specific forms of constraints (2.2) and/or (2.3) depend on the nature of the problem at hand, and since the vehicle dynamics can be influenced by the engine, automatic transmission, breaks and by many other factors, the constraints can appear to be fairly complex in the general case. Nevertheless, for a number of important situations state constraints can be reasonably simplified. For example, it is often assumed that the control variable is the applied acceleration and that this variable can be determined as the difference between the “controlled” acceleration function s(u, v) (from a physical point of view this function can be interpreted as the driving controlled force per unit mass of the vehicle) and the “uncontrolled” deceleration function r(v) of the vehicle. In this case equation (2.3) takes the form dv = s[x, u(t), v(t)] − r[x, v(t)], dt (3.3) where possible dependency of functions s and r on the position x has been also included. This can be simplified further. Note that the form of the deceleration is again problem-specific depending on the need to account for a number of factors such as contributions of gravitational, aerodynamic, frictional and other forces. In the simplest case it can be approximated by the difference between the frictional resistance, r0 , and the gravitational component g in the direction of the vehicle motion [14]: r[v(t)] = r0 [v(t)] − g(x). (3.4) Note also that (3.4) often takes the form of a quadratic law (so-called Davis’ formula) r[v(t)] = a + bv + cv 2 a, b, c ∈ R. (3.5) It is often the case that additional inequality constraints come naturally into the formulation of the problem. For example, the definition of the control variable might require further constraints such as positivity of the velocity and some control admissibility conditions (e.g. [13]) v(t) ≥ 0, |u(t)| ≤ 1. (3.6) These constraints can be supplemented by additional constraints such as an upper limit on velocity. Inequality constraints (3.6) can be cast in the general vector form as G ≤ 0, with G1 = −v, G2 = u2 − 1. (3.7) Furthermore, some equality constraints might be also required. For example, if we assume that the trip has length L, this leads to the equality constraint expressed by the end-point reachability condition Z T v(t)dt = L, (3.8) 0 supplemented by the boundary conditions v(0) = v1 , v(T ) = v2 6 (3.9) taken typically with v1 = v2 = 0. Next, we note that the above example can be reformulated in the general framework (2.1)– (2.4) by introducing vector x = (x1 , x2 )t with x1 being the state variable, and x2 being the dx1 = v, we can use (3.9) to derive that velocity of the vehicle. Indeed, since dt x1 (T ) − x1 (0) = L. (3.10) Then, taking into account (3.9) we have the initial and terminating conditions in the form x(0) = 0, x(T ) = xT , (3.11) where xT = (L, 0)t . We denote f(x, t, u(t)) = (x2 , s[x1 , x2 , u2] − r[x1 , x2 ])t , (3.12) where u2 plays the role of u in the above example, u = (0, u2 (t))t , and take into account (3.7) and (3.11), i.e. only admit controls u(·) ∈ U(t, x), (3.13) where  U(t, x) = u(·) ∈ U 0 (t) : x2 (t) ≥ 0, x(T ) = xT , |u2 (t)| ≤ 1} . (3.14) Then, the definition of the objective function in the form (see (3.1)) f0 (x(t), t, u(t)) = [u2 (t)]+ x2 (t) (3.15) completes the formulation of the vehicle speed control problem subjected to the minimization of the fuel consumption in the general framework (2.1)–(2.4). Now, we are in a position to highlight major difficulties in applications of conventional methodologies to the above problem. First, we note that in reality the control variable of this problem cannot vary continuously due to the discrete character of the information [27] obtained in this specific case by the moving vehicle in a dynamically changing environment. Therefore, if we consider a finite (possibly very large) set of control settings, for example, throttle settings as it was originally proposed in [13] − 1 = u1 < u2 < ... < un = 1, (3.16) then the analysis of the problem can be reduced (under some severe assumptions such as ”no speed limits”) to the consideration of four basic situations, as shown in [13] (the acceleration, speedholding, coasting, and breaking phases), making use of quite specific forms of functions (3.2). In such cases it might be easier to define the objective function of the total fuel consumption accounting for these settings by splitting the total distance on an appropriate number of sub-intervals according to the discrete dynamic equation xk = x(tk ) with 0 = x0 < x1 < ... < xn = X (3.17) and by assuming that the time ∆ti+1 = ti+1 − ti required to complete the segment trip [xi , xi+1 ] is known (or can be well approximated) for all i = 0, 1, ..., n−1 (see (2.5)). In most conventional 7 approaches referenced here it is assumed that each control setting determines a constant rate supply. If we denote the the fuel consumption and the control setting in the interval [xi , xi+1 ] by ci+1 ≡ c[ui+1 ] and ui+1 (c = 0 if u ≤ 0), respectively, the cost (fuel consumption) functional of the entire trip can be defined as [31, 14] J= n−1 X ci+1 ∆ti+1 . (3.18) i=0 First observe that since in the general case all control settings ci+1 , i = 0, 1, ..., n − 1 are functions of time, a more rigorous approach should be based on the consideration of functional (2.1) rather than function (3.18). We observe also that in some cases (including more realistic situations with speed limits), the development of automated (optimal or sub-optimal) driving strategies can be reduced to the analysis of simple combinations between a small number of control settings (e.g., power when u = 1, coast when u = 0, and break when u = −1). However, due to the very nature of the control problem where we have to consider the ITS in a dynamically changing environment, a more detailed sequential analysis of the whole information sequence (3.16) is required. Such an analysis is intrinsic to other control problems where complex systems require human supervision or a human operator. The proposed methodology for this analysis is discussed in the next section. 4 Sequential analysis of the global Hamiltonian keeps the key to efficient driving strategies In the context of our example, the information sequence for the decision making process obtained by on-board LCX receivers and by inter-vehicle communication devices always contains a certain degree of uncertainty. Indeed, some of the vehicle parameters, as well as the information on road conditions, can be known only partially [37]. A complex dynamics of human performance in traffic systems [33] brings along another factor that complicates the analysis of the entire dynamic system consisting of many driver-vehicle subsystems. This leads to a situation where control cannot be limited by a simple combinations of basic settings, as we have discussed in the previous section, and a general approach should be developed to address the speed control problem in the ITS context. The development of speed control strategies for intelligent transportation systems has become an important and topic of research [37, 18]. In this section, our discussion focuses on a subset of the systems that consist of vehicles capable of measuring/estimating dynamic information from the target (typically, the immediate front) vehicle by its on-board sensors. The computers in the vehicles can process the measured data and generate proper throttling and breaking actions for controlling vehicles’ movements under the constraints of safety, ride comfort, fuel minimization, etc. Recall that algorithms for speed control with constant acceleration/deceleration were developed and tested together with some simple algorithms for “approach” and “merging” control [4]. The authors of [4] developed linear models for passenger cars (in which any acceleration/deceleration can be generated according to the driver’s operations [5]) and generalize their results to a nonlinear model for heavy-duty vehicles where they account for transient responses (it is rather difficult to control the speed in this case, because of poor acceleration performance of such vehicles). As it was shown, it is necessary to account for saturation/delay in acceleration which could be an important characteristic of some vehicles. However, the results of simulations conducted in [4] showed that for long control 8 periods, the model leads to unrealistic speeds, exceeding the target speed, and the maximum vehicle distance could become excessively long. In principle, such overshootings can be avoided by setting a short control period. However, since the dynamic behaviour of the vehicle model is intrinsically nonlinear and considerably complicated [37], in the general case it is necessary to take into account complex dependency between acceleration and speed of the vehicle using the general framework of (2.1)–(2.4). In the reminder of this section we analyse three main approaches to the solution of the general speed control problem with exemplification given for the vehicle speed control subjected to the minimization of the fuel consumption, as considered in Section III. 4.1 The definition of the Hamiltonian via the solution of the adjoint problem Some of the most powerful methodologies to the analysis of speed control problem are based on a heuristic application of the Pontryagin maximum principle. However, the application of these methodologies to solving practical problems in the context of intelligent transportation systems requires overcoming a number of serious difficulties which will be considered below in the case where x ∈ R2 (see details after (3.9) in Section III). Applying formally the Pontryagin maximum principle [30] to the problem considered in Section III (problem (2.1)–(2.4) allows an analogous treatment), we can introduce a local Hamiltonian of the entire dynamic system in the following form ~ H(x(t), u(t), ψ(t), t) = −a0 f0 (x(t), u(t), t) + 2 X ψi fi , (4.1) i=1 where all notations come from the consideration of (2.1)–(2.4) in this special case, f = (f1 , f2 )T , ~ = (ψ1 , ψ2 )T is defined a0 is the normalisation factor [26], while the adjoint vector-function ψ from the following adjoint system 2 ∂f0 X ∂fk ∂ψi ψk − , = ∂t ∂xi k=1 ∂xi where ψi (T ) = 0, i = 1, 2. (4.2) Then the result of the application of the Pontryagin maximum principle to the speed control problem can be formulated as follows [30]. Theorem 4.1 For a driving strategy determined by the pair (u(t), x(t)) to be optimal it is ~ (components of which are not identical necessary the existence of an adjoint vector-function ψ(t) zero), defined by (4.2) such that ~ ~ ∗ (t), x∗ (t), u∗ (t), t) max H(ψ(t), x(t), u(t), t) = H(ψ u∈U (4.3) for almost all t ∈ [0, T ]. Practical difficulties with the application of this approach to the solution of the speed control problem for the intelligent transportation systems lie with the fact that state variables in this problem are not independent. This fact has led many authors to substantial simplifications of the problem (in particular, in the analysis of the system Hamiltonian) by considering a small subset of possible control settings [12]. Unfortunately, this idea cannot be applied in the context 9 of intelligent transportation systems, because both state variables are closely linked with the control function u, and they might be decoupled in some special situations only. Consider, as an example, the problem discussed in Section III. In this case, functions participating in the definition of Hamiltonian (4.1) can be specified more precisely. Indeed, recall that in this case function f0 takes the form (3.15), while the vector function f can be specified by its components as in (3.12). Clearly that even in this relatively simple case the state variables are coupled with the control by the following systems of equations ∂x1 = x2 , ∂t ∂x2 = s[x1 (t), x2 (t), u2(t)] − r[x1 (t), x2 (t)] ∂t (4.4) supplemented by the corresponding boundary conditions and other constraints previously discussed. In this case, according to (4.1) the Hamiltonian of the system can formally be written in the form H = −a0 [u2 ]+ x2 + ψ1 x2 + ψ2 {s[x1 , x2 , t, u2 ] − r[x1 , x2 ]} . (4.5) For example, in a special case where s[x1 , x2 , t, u2 ] = u2 and a0 = 1 [12], control can be confined to the following values u2 = 1, u2 ∈ (0, 1), u2 = 0, u2 ∈ (−1, 0) and u2 = −1 subject to the fulfilment of one of the following five relations (a) ψ2 > x2 , (b) ψ2 = x2 , (c) 0 < ψ2 < x2 , (d) ψ2 = 0, (e) ψ2 < 0, respectively. Such a consideration takes the advantage of an implicit assumption on the possibility of decoupling state and control aspects of the problem. This leads to a substantial simplification of the analysis where we have to account for control constraints (2.4). In the general case, the analysis cannot be reduced to five basic situations described above. Since the intersection between the set defined by control constraints and the set defined by state constraints is not empty [26], we note that even under these special assumptions, the key to the analysis of the Hamiltonian is kept by the coupled system of equations (4.2), (4.4). Indeed, the adjoint function of the speed control problem considered in Section III is the solution of (4.2) which in the case where s equals u2 can be written in the following form dψ2 (t) − r ′ [v0 (t)]ψ2 = F̃ , dt (4.6) F̃ ≡ F̃ (v0 , u0 , f0 , f˜2 , c̃), (4.7) where ∂f2 , f˜2 : R → R is a real function associated with dynamically perturbed function F2 = ∂x2 and ã0 ∈ R is a real constant that can be viewed as a dynamically perturbed parameter of normalization, subject to the dynamics of ψ1 . Getting a specific form of F̃ requires a quite delicate analysis which was performed so far only for fairly simple cases (e.g. [13, 12] and references therein). The determination of function f˜2 and constant ã0 is also far from trivial and in the general case such a determination should be adaptive. Note also that (v0 , u0 ) in (4.7) is assumed to be a fixed point associated with the optimal velocity of the vehicle and its optimal applied control which are not known a priori. However, if an approximate solution of the problem (4.6) is found, then by using (4.1) a local (or pointwise) Hamiltonian function of the system can be defined. In this case, a major source of difficulties in constructive approximations of optimal driving strategies (that can be derived formally from minimising the local Hamiltonian) lies with the intrinsically complex dynamics of the adjoint function and the adequate determination of the normalisation factor. To proceed with such a construction the 10 local Hamiltonian function should be integrated in time over the whole interval [0, T ] which leads to the global Hamiltonian in the form Z T H(u) = H̃0 + H[x1 , x2 , t, u2, ψ1 , ψ2 ]dt, (4.8) 0 where the actual value of H̃0 ∈ R depends not only on v0 , L, and T , but also on the weight coefficients for implementing all remaining constraints of the problem. The optimal control strategies can now be determined by finding local minima of the Hamiltonian (4.8), but in practice this approach leads to serious computational difficulties due to too many degrees of freedom in (4.8). On the other hand, the problem can be reduced to the analysis of (4.1), e.g. by considering a small subset of basic control settings, only in quite simple cases such as those discussed in [13]. 4.2 Using the embedding principle and the Lagrangian multipliers In the context of intelligent transportation systems, more feasible computationally are approaches that are based on the embedding principle. First, we introduce the minimum cost function as follows Z T  ∗ J (x(t), t) = min f0 (x(τ ), u(τ ), τ )dτ , (4.9) u(τ )∈U , t≤τ ≤T t where 0 ≤ t ≤ T and f0 is defined in the context of the problem discussed in Section III. Then, it appears that if the derivative of J ∗ with respect to x = (x1 , x2 ) exists, we can introduce a local Hamiltonian of the system as follows H = −a0 f0 + Jx∗1 x2 + Jx∗2 f2 . (4.10) In this representation we accounted for state constraints (2.2) and (2.3) which in the context of problem discussed in Section III have the form (4.4). Accounting for control constraints (3.6) is straightforward [15] H = H + λ(u2 − 1) + µ(−u2 − 1), (4.11) where λ and µ can be identified with the Lagrangian multipliers. For this specific case, the definition of the Hamiltonian in form (4.11) limits the number of degrees of freedom to two (see details of this approach in [31]) where the objective function was taken in the form (3.18)). However, practical applications of this approach in the context of complex dynamic systems are limited due to the discrete nature of control in such problems which leads to non-existence ∂H in the classical sense. If, however, a formal operation of differentiation is of derivative ∂u performed, it is easy to conclude that ∂H ∂H = + λ − µ, ∂u2 ∂u2 (4.12) where all the derivatives above and hereafter in the text should be understood in a generalized sense. Under some simplifying assumptions this formal approach can be applied to the 11 speed control problem discussed in Section III for which the formal differentiation leads to the following result [12, 15] ( x2 + Jx∗2 + λ − µ, 0 < u2 ≤ 1, ∂H = (4.13) ∂u J ∗ + λ − µ, −1 ≤ u2 < 0. x2 In this case, similar to our discussion in Section 4.1, further analysis can be reduced to the consideration of five different cases, depending on the mutual location of x2 , 0 and x2 + Jx∗2 [15]. From a computational point of view this approach could be efficient in computing critical speeds for automated driving strategies, but in the general case it has the same limitations as the approach described in Section A. Of course, in the case of simple control constraints (such as (3.6)), having the optimal velocity v0 (t), it is a standard procedure to determine the optimal control (acceleration) u0 (t) by minimising the (local) Hamiltonian function. Since the velocity is strongly coupled to control settings over the whole time interval (neither velocity nor control can be given a priori ∀ [0, T ]), practical implementation of this procedure is problematic in the general case. Strictly speaking, in order to determine the optimal velocity and control globally, one needs to know the Hamiltonian which in its turns depends on those functions [26]. However formally the Hamiltonian (or Lagrangian due to the duality principle) can be defined locally provided the coupled system of equations (4.2) and (4.4) is solved. Alternatively, we have to solve the coupled system of equations in the Hamiltonian canonical form ∂H ∗ dx∗ (t) ~ ∗ (t), t), = (x (t), u∗ (t), ψ ~ dt ∂ψ (4.14) ~ ∗ (t) ∂H ∗ dψ ~ ∗ (t), t), =− (x (t), u∗ (t), ψ dt ∂x (4.15) with the function H defined as ~ H(x(t), u(t), ψ(t), t) ≡ f0 (x(t), u(t), t) + ~ T f(x(t), u(t), t). [ψ(t)] (4.16) Then, as follows from Theorem 4.1 for the optimality of control u∗ (t) and trajectory x∗ (t) the following inequality ~ ∗ (t), t) ≤ H(x(t), u(t), ψ(t), ~ H(x∗ (t), u∗ (t), ψ t) (4.17) should hold for all u(·) ∈ U, where U is defined by (2.4). It is well-known that under sufficient smoothness assumptions [19, 23], the adjoint function and the optimal performance measure are connected by ∗ ~ = ∂J (t, x∗ (t)), ψ(t) ∂x (4.18) and hence the function H in (4.16) can be re-written in the form H(x(t), u(t), ∇J ∗ , t) ≡ f0 (x(t), u(t), t) + [∇J ∗ (x(t), t)]T f(x(t), u(t), t). 12 (4.19) In this case the dynamics of system perturbations (including those caused by human factors) is accommodated formally in the derivative of the performance measure. Since complex dynamic systems such as ITS exhibit an intrinsic interplay between state and control aspects of the dynamics, this accommodation does not preclude us from non-uniqueness of the solution of the resulting model. Indeed, following [31] let Vj be the speed of the vehicle at location xj , Wj be the limiting speed for control setting uj , and Uj be the speed at location Xj , where it is assumed that the speed limits are changed at distances 0 = X0 < X1 < ... < Xp = X. (4.20) Then, triple (Uj , Vj , Wj ) can be obtained by using the Lagrangian multipliers under simplified assumptions of only three control settings, u = 1, u = 0, and u = −1. This triple defines critical speeds for the interval (Xj−1 , Xj ) such that 0 ≤ Uj ≤ Vj ≤ Wj ≤ Mj [31]. However, the quality of the “speed-holding” phase approximation by using, for example, coast-power control pairs on each such interval depends strongly on the number of control pairs (denoted here by sj ) for this interval. In fact, in the general case only in the limit sj → ∞ we can obtain a unique holding speed for this interval and to avoid undesirable vehicle speed oscillations between control switchings (e.g. between values Vj < Mj and Vj = min{Wj , Mj } subject to sj , see the results of computational experiments in [31]). Despite these difficulties, the problem of speed control in its general framework can be formalised by writing down the full system of Kuhn-Tacker necessary conditions and by including all constraints in the the globally defined generalised Lagrangian function (or Hamiltonian, as follows from the duality principle). Let us consider this approach in some details. Provided H possesses sufficient smoothness, the minimisation of (4.11) is a standard problem in opti∂H mization theory, and the necessary conditions of control optimality will follow from =0 ∂u [19, 38]. This idea is easy to apply in those cases where control constraints are given a priori in a relatively simple form [12]. However, addressing the speed control problem in the general case and accounting for a complex dynamic interplay between state and control constraints is a much more difficult task. For example, in the case discussed in Section III this problem is reducible to the following constrained optimisation problem H(x(t), u(t), ∇J ∗ , t) → min gi (t) ≤ 0, i = 1, 2, 3, (4.21) gi (t) = 0, i = 4, 5, (4.22) (see (3.15), (4.9), (4.19)), subject to the following constraints g1 (t) = u2 (t), g2 (t) = −u2 (t) − 1, g3 (t) = −x2 (t), (4.23) g4 (t) = x1 (T ) − L, (4.24) g5 (t) = x2 (T ). Then, by using classical Lagrangian multipliers for the equality constraints together with relaxing variables γi2 , i = 1, 2, 3 for the inequality constraints, we can define the generalised Lagrangian function in the following form [38] L(x(t), u(t), t, ~λ, ~γ ) = H + 3 X λi [gi (t) + i=1 13 γi2 ] + 5 X i=4 λi gi (t), (4.25) where vector ~λ is the vector of Lagrangian multipliers. The Kuhn-Tacker necessary conditions for the extremum of this function are ∂L = 0, ∂t ∂L = 0, ∂u2 ∂L = 0, i = 1, 2, ∂xi (4.26) ∂L = 0 ⇐⇒ gi(t) ≤ 0, i = 1, 2, 3, & gi (t) = 0, i = 4, 5, ∂λi (4.27) ∂L = 0 ⇐⇒ λi gi (t) = 0, i = 1, 2, 3, ∂γi (4.28) and, finally λi ≥ 0, i = 1, ..., 5. (4.29) In order to find the solution of the speed control problem we should solve coupled system (4.26)–(4.29) with respect to unknown variables, x1 , x2 , u2, λi . Since control cannot be found globally based on a locally defined velocity function, this system should be solved in an adaptive manner. Note that system (4.26)–(4.29) can be simplified substantially in some special cases, for example when local (rather than global) solutions are sought and/or s in the state equation (3.3) is a linear function of control [13, 12]. Such simplified considerations allow us to reduce the analysis of the Hamiltonian/Lagrangian to a small number of control setting, as it has been explained earlier in this section. Attempts to apply such methodologies to the general speed control problem are confronted with serious difficulties. These difficulties are convenient to explain at the computational level for the problem from section III. Consider a trajectory of the vehicle with n distinct phases Pi = (xi , xi+1 ), i = 0, 1, ..., n − 1, x0 = 0, xn = X, (4.30) each with certain speed limits Mj+1 , and the number sj+1 of control pairs inside of each speed limit interval (Xj , Xj+1) (for example, “coast-power” pairs to approximate the speed-holding phase, etc as argued, e.g., in [31]) (Mj+1 , sj+1 ), x ∈ (Xj , Xj+1 ), j = 0, 1, ..., p − 1, (4.31) where X0 = x0 and Xn = xn . The, we ask the following question: What values of n and p should be chosen to approximate effectively the optimal trip? A simple way would be to choose these values to satisfy the distance and time constraints following the technique described in [13] (e.g. p. 468), and then to determine Lagrangian multipliers by using methodology of [31]. However, this way cannot guarantee global optimality, because additional constraints that appear in the amended formulation of the problem (such as speed limits and an a priori pre-defined number of control pairs) should be included in the definition of the Hamiltonian (Lagrangian), but they are not. If we include these constraints into the definition of the Hamiltonian/Lagrangian, the analysis cannot be reduced to only those five case discussed previously in this section. In the general case, the number of speed holding phases for the entire trip can be determined by a posteriori estimations based on a sequential algorithm of information processing accounting for human factors [27]. Recall that in conventional methodologies this number is postulated a priori. At the same time, Lagrangian multipliers (see (4.11)–(4.13)) can determine only critical speeds 14 within each interval (4.31). Algorithms for the solution of the general speed control problem can be constructed if we take into account that the speed Vk , k = 1, ..., n − 1 at location xk for arbitrary (large) n depends primarily on the behaviour of the system on ∆x1 ,..., ∆xk , where ∆xi = xi − xi−1 . We formalize this idea of the Markovian-type controlled dynamics below by using Hamiltonian estimations. This allows us to couple control with human-centered automation within a general mathematical framework. Note that the model of the system as well as the objective function for the minimization as well as constraints are subject to uncertainties as a result of dynamically changing conditions in which the system operates. Due to such uncertainties, the resulting control strategies may not be optimal in the entire time interval in a classical sense. However, they are optimal within each time interval where the same Hamiltonian estimation is used. 4.3 Hamiltonian estimations and human-centered automation Effective human-centered automation is a necessary element of a well-designed controlled intelligent transportation systems. Of course, it is not necessarily a sufficient element for an optimal performance of the overall system [20]. However, if human factors are incorporated into a mathematical model, then efficient control of the overall system based on human-centered automation becomes a key tool in improving system performance. Recall that by (4.9) we introduced the minimum cost function. This function is based on a performance measure that allows us to include our speed control problem in a larger class of problems by considering the following functional J(x(t), t), u(τ ) : t ≤ τ ≤ T, u ∈ U) = Z T f0 (x(τ ), τ, u(τ ))dτ, (4.32) t where t can be any value from the closed interval [0, T ] and x(t) can be any admissible state value. Now we can follow a general path of the dynamic programming approach [19, 38]. Since our aim is to determine the control that minimizes (4.32) for any admissible x(t) and for any t ∈ [0, T ], we note that the minimum cost function for this problem can be re-written by subdividing the intervals Z t+∆t  Z T ∗ J (x(t), t) = min f0 dτ + f0 dτ . (4.33) u(τ )∈U , t≤τ ≤T t t+∆t From the embedding principle used in the dynamic programming approach (e.g. [19, 38]) and relationships (4.9), (4.33) we have Z t+∆t ∗ J (x(t), t) = min f0 dτ + u(τ )∈U , t≤τ ≤t+∆t t J ∗ (x(t + ∆t), t + ∆t)} , (4.34) where J ∗ (x(t + ∆t), t + ∆t) is the minimum cost of the trip for the time interval t + ∆t ≤ τ ≤ T with the “initial” state x(t + ∆t). Applying now formally Taylor’s series expansion in (4.34) about point (x(t), t), we have: Z t+∆t ∗ J (x(t), t) = min f0 dτ + u(τ )∈U , t≤τ ≤t+∆t 15 t ∗ J (x(t), t) +    ∗ T ∂J ∂J ∗ (x(t), t) ∆t + (x(t), t) × ∂t ∂x [x(t + ∆t) − x(t)] + o(∆t)} . (4.35) Then, using the main property of the Landau symbol, taking into account equation (2.2) for ∆t → 0+ , and dividing (4.35) by ∆t, we obtain n ∂J ∗ 0= (x(t), t) + min f0 (x(t), u(t), t)+ u(t)∈U ∂t  ∂J ∗ (x(t), t) ∂x T o [f(x(t), u(t), t)] . (4.36) Further, it is easy to see that if we set t = T in (4.9) we get J ∗ (x(T ), T ) = 0. (4.37) If we now define the system Hamiltonian by (4.19) and take into account that the optimal ∂J ∗ and t minimising control depends on x, ∂x     ∂J ∗ ∂J ∗ ∗ H x(t), u x(t), ,t , ,t = ∂x ∂x   ∂J ∗ ,t , (4.38) min H x(t), u(t), u(t)∈U ∂x we arrive at a mathematical model for the speed control problem (2.1)–(2.4) represented in the form of the Hamilton-Jacobi-Bellman equation     ∂J ∗ ∂J ∗ ∂J ∗ ∗ 0= (x(t), t) + H x(t), u x(t), ,t , ,t (4.39) ∂t ∂x ∂x and supplemented by condition (4.37). The solution to this problem is understood in the generalized sense [23, 26]. Naturally, it cannot be reduced to the five cases discussed before. Instead, a sequential (in real time) algorithm is required to incorporate human factors into the model via sequential estimations of a time-perturbed Hamiltonian approximation [26, 27] H̃ = min u(t)∈U , t≤τ ≤t+∆t H (4.40) for each time subinterval t ≤ τ ≤ t + ∆t with t ∈ [0, T ]. This formulation is more general than those resulted from conventional methodologies. Indeed, at each time subinterval the Hamiltonian is allowed to change based on the information accumulated up to that point to reflect dynamic changes in the environment in which the system operates. A new Hamiltonian estimation should be provided based on that information. In the context of intelligent transportation systems, Hamiltonian estimations can be obtained efficiently with the assistance of on-board equipment, including sensors, receivers, actuators, inter-vehicle communication systems, and on-board computers. Computational methodologies for solving the problem for each Hamiltonian estimation are known as they were developed for the numerical solution of HJBbased models (e.g., [16, 29, 7, 28]). Finally, a general approach to the analysis of such models (obtained via a decision making process with limited information available) using tools of information theory and the Markov chain approximation method can be found in [26, 27]. 16 5 Concluding Remarks Efficiency of models describing the dynamics of complex systems in general, and intelligent transportation systems in particular, often depends upon allowance made for human (e.g., operators/drivers) capabilities and/or limitations of these systems. As a result, the integration of human-related design and support activities in the engineering of complex systems become important topics of research as exemplified here on the ITS theory and practice. In this contribution we demonstrated how human factors can be effectively incorporated into the analysis and control of complex systems. As an example, the problem of ITS speed control, considered here as a decision making process with limited information available, was cast mathematically in the general framework of control problems and treated in the context of dynamically changing environments where control is coupled to human-centered automation. We demonstrated that the problem can be reduced to a set of Hamilton-Jacobi-Bellman equations where human factors are incorporated via estimations of the system Hamiltonian. These estimations can be obtained with the use of on-board equipment like sensors/receivers/actuators, in-vehicle communication devices, etc. The proposed methodology provides a way to integrate human factor into the solving process of the models for other complex dynamic systems. Acknowledgements This work was originally inspired by discussions with members of the Scheduling and Control Group at the University of South Australia, and the idea was developed further in discussions with the colleagues at the Mads Clausen Institute at the University of Southern Denmark. The author thank all of them for stimulating discussions and a creative multi-disciplinary environment. References [1] Barthelemy, J.P., Bisdorff, R., and Coppin, G., Human centered processes and decision support systems, European Journal of Operational Research, 136(2), 233–252, 2002. [2] Butts, K.R., Sivashankar, N. and Sun, J., Application of L1 optimal control to the engine idle speed control problem, IEEE Trans. Control Systems Technology, 7, 1999, 258–270. [3] Carroll, J.M. (Ed.), HCI Models, Theories, and Frameworks. Toward a Multidisciplinary Science, Morgan Kaufmann Publishers, 2003. [4] Endo, S. et al, Simulation of speed control in acceleration mode of a heavy-duty vehicle, JSAE Journal, 20, 1999, 81–86. [5] Endo, S. et al, A study on speed control law for automated driving of heavy-duty vehicles considering acceleration characteristics, JSAE Journal, 20, 1999, 331–336. [6] Endo, S. et al, A study on speed control law for automated driving of heavy-duty vehicles, JSAE Journal, 21, 2000, 47–52. [7] Falcone, M. and Ferreti, R., Discrete time high high-order schemes for viscosity solutions of HJB equations, Numer. Math, 67, 315–344, 1994. [8] Fontaras, G. and Samaras, Z., A quantitative analysis of the European Automakers voluntary commitment to reduce CO2 emissions from new passenger cars based on independent experimental data ARTICLE Energy Policy, 35(4), 2239–2248, 2007. [9] Gollu, A. and Varaiya, P., SmartAHS: a simulation framework for automated vehicles and highway systems, Math. Comput. Modelling, 27, 103–128, 1998. 17 [10] Goodrich, M.A. and Boer, E.R., Designing human-centered automation: trade-offs in collision avoidance system design, IEEE Trans. ITS, 1, 2000. [11] Herty, M. and Rascle, M., Coupling conditions for a class of second-order models for traffic flow, SIAM J. on Mathematical Analysis, 38 (2), 595-616, 2006. [12] Howlett, P.G. and Pudney, P.J. Energy-Efficient Train Control, Springer-Verlag, 1995. [13] Howlett, P., An optimal stategy for the control of a train, J. Austral. Math. Soc.: B, 31, 1990, 457–471. [14] Howlett, P., Optimal strategies for the control of a train, Automatica, 32, 519–532, 1996. [15] Howlett, P.G., Personal communication, 1996. [16] Ishii, H., Perron’s method for Hamilton-Jacobi equations, Duke Mathematical Journal, 55, 369–384, 1987. [17] Kesseler, E. and Knapen, E.G., Towards human-centrednext term design: Two case studies, Journal of Systems and Software, 79(3), 301–313, 2006. [18] Kiencke, U., Nielsen, L., Sutton, R., et al., The impact of automatic control on recent developments in transportation and vehicle systems, Annual Reviews in Control, 30 (1), 81-89, 2006. [19] Kirk, D.E., Optimal Control Theory, Eglewood, N.J., Prentice Hall, 1970. [20] Kirlik, A., Miller, R. A. and Jagacinski, R. J., Supervisory control in a dynamic and uncertain environment: a process model of skilled human-environment interaction, IEEE Trans. on Systems, Man, and Cybernetics, 23, 1993, 929–951. [21] Kolmanovsky, I., van Nieuwstadt, M. and Sun, J., Optimization of complex powertrain systems for fuel economy and emissions, Nonlinear Analysis: RWA, 1, 2000, 205–221. [22] Kraiss, K.-F. and Hamacher, N., Concepts of user centered automation, Aerospace Science and Technology, 5 (8), 505–510, 2001. [23] Lions, P.-L., Generalized Solutions of Hamilton-Jacobi Equations, Pitman, Boston, 1982. [24] Manzie, C., Watson, H., and Halgamuge, S., Fuel economy improvements for urban driving: Hybrid vs. intelligent vehicles ARTICLE Transportation Research Part C: Emerging Technologies, to appear 2007. [25] Mayer, F. and Stahrea, J., Human-centred systems engineering (Editorial to a special issue), Annual Reviews in Control, 30(2), 193–195, 2006. [26] Melnik, V.N., On consistent regularities of control and value functions, Numer. Funct. Anal. and Optimiz., 18, 401–426, 1997. [27] Melnik, R.V.N., Dynamic system evolution and Markov chain approximation, Discrete Dynamics in Nature and Society, 2, 7–39, 1998. [28] Milner, F.A. and Park, E.-J., Mixed finite-element methods for HJB-type equations, IMA J. Numer. Anal., 16, 399–412, 1996. [29] Osher, S. and Seithian, J.A., Fronts propagating with curvature-dependent speed: algorithms based on Hamilton-Jacobi formulations, J. Comput. Physics, 79, 12–49, 1988. [30] Pontryagin, L.S. et al, The Mathematical Theory of Optimal Processes, Gordon & Breach, 1986. [31] Pudney, P. and Howlett, P., Optimal driving strategies for a train journey with speed limits, J. Austral. Math. Soc. Ser. B, 36, 38–49, 1994. [32] Qi, Y and Zhao, YYJ, Energy-efficient trajectories of unmanned aerial vehicles flying through thermals, J. of Aerospace Engineering, 18 (2), 84-92, 2005. [33] Rouse, W. B., Edwards, S.L. and Hammer, J.M., Modeling the dynamics of mental workload and human performance in complex systems, IEEE Trans. on Systems, Man, and Cybernetics, 23, 1993, 1662–1671. [34] Seto, Y. and Inoue, H., Development of platoon driving in AHS, JSAE Journal, 20, 1999, 93–99. 18 [35] Shahar, Y. et al, Distributed, intelligent, interactive visualization and exploration of timeoriented clinical data and their abstractions, Artificial Intelligence in Medicine , 38(2), 115–135, 2006. [36] Sivashankar, N. and Sun, J., Development of model-based computer-aided engine control systems, Int. J. Vehicle Design, 21, 1999, 325–343. [37] Stotsky, A., Chien, C.-C. and Ioannou, P., Robust platton-stable controller design for autonomous intelligent vehicles, Math. Comput. Modelling, 22, 1995, 287–303. [38] Sucharev, A., Timochov, A., Fedorov, V., Optimization Methods, Nauka, 1989. [39] Wren, C.R., Minnen, D.C., and Rao, S.G., Similarity-based analysis for large networks of ultra-low resolution sensors, Pattern Recognition, 39(10), 2006, 1918-1931. [40] Zhuan, X, and Xia, X., Cruise control scheduling of heavy haul trains, IEEE Trans. on Control Systems Technology, 14(4), 757-766, 2006. 19
5cs.CE
arXiv:1801.06900v1 [cs.DS] 21 Jan 2018 Efficient Learning of Optimal Markov Network Topology with k-Tree Modeling Liang Ding∗ ‡ , Di Chang † , Russell Malmberg § , Aaron Martinez † , David Robinson † , Matthew Wicker † , Hongfei Yan † , and Liming Cai∗ † January 23, 2018 Abstract The seminal work of Chow and Liu (1968) shows that approximation of a finite probabilistic system by Markov trees can achieve the minimum information loss with the topology of a maximum spanning tree. Our current paper generalizes the result to Markov networks of tree width ≤ k, for every fixed k ≥ 2. In particular, we prove that approximation of a finite probabilistic system with such Markov networks has the minimum information loss when the network topology is achieved with a maximum spanning k-tree. While constructing a maximum spanning k-tree is intractable for even k = 2, we show that polynomial algorithms can be ensured by a sufficient condition accommodated by many meaningful applications. In particular, we prove an efficient algorithm for learning the optimal topology of higher order correlations among random variables that belong to an underlying linear structure. Keywords: Markov network, joint probability distribution function, k-tree, spanning graph, tree width, Kullback-Leibler divergence, mutual information 1 Introduction We are interested in effective modeling of complex systems whose the behavior is determined by relationships among uncertain events. When such uncertain events are quantified as random variables X = {X1 , . . . , Xn }, the system is characterizable with an underlying joint probability distribution function P (X) [39, 24]. Nevertheless, estimation of the function P (X) from observed event data poses challenges as relationships among events may be intrinsic and the nth -order function P (X) may be very difficult, if not impossible, to compute. A viable solution is to approximate P (X) with lower order functions, as a result of constraining the dependency relationships among random variables. Such constraints can be well characterized with the notion of Markov network, where the dependency relation of random variables is defined by a non-directed graph G = (X, E), with the edge set E to specify the topology of the dependency relation. In a Markov network, ∗ To whom correspondence should be addressed. Co-authors are listed alphabetically. † Department of Computer Science, The University of Georgia, Athens, GA; ‡ St. Jude Children’s Research Hospital, Memphis, TN; § Department of Plant Biology, The University of Georgia, Athens, GA. 1 two variables not connected with an edge are independent conditional on the rest of the variables [21, 39, 42]. Model approximation with Markov networks needs to address two essential issues: the quality of the approximation, and the feasibility to compute such approximated models. Chow and Liu [11] were the first to address both issues in investigating networks of tree topology. They measured the information loss with Kullback-Leibler divergence [27] between P (X), the unknown distribution function, and PG (X), the distribution function estimated under the dependency graph G. They showed that the minimum information loss is guaranteed by the topology corresponding to a maximum spanning tree which can be computed very efficiently (in linear time in the number of random variables). It has been difficult to extend the seminal work of simultaneous optimal and efficient learning to the realm of arbitrary Markov networks due to the computational intractability nature of the problem [10]. To overcome the barrier, research in Markov network learning has sought heuristics algorithms that are efficient yet without an optimality guarantee in the learned topology [30, 23, 48, 24, 13, 55]. A more viable approach has been to consider the nature of probabilistic networks formulated from real-world applications, which often are constrained and typically treelike [14, 35, 20, 3, 44, 37, 17, 8, 47, 56]. All such models can be quantitatively characterized with networks that have tree width ≤ k, for small k. Tree width is a metric that measures how much a graph is tree-like [7]. It is closely related to the maximum size of a graph separator, i.e., a characteristic of any set of random variables XS upon which two (sets) of random variables XA and XB are conditionally independent XA ⊥XB |XS . Such networks have the advantage to support efficient inference, and other queries over constructed models [28]. In addition, many real-world applications actually imply Markov (Bayesian) networks of small tree width. In spite of these advantages, however, optimal learning of such networks is unfortunately difficult, for example, it is intractable even when tree width k = 2 [20, 44]. Hence, the techniques for learning such Markov networks have heavily relied on heuristics that may not guarantee the quality. In this paper, we generalize the seminal work of Chow and Liu from Markov trees to Markov networks of tree width ≤ k. First, we prove that model approximation with Markov networks of tree width ≤ k has the minimum information loss when the network topology is the one for a maximum spanning k-tree. A k-tree is a maximal graph of tree width k to which no edge can be added without an increase of tree width. Therefore the quality of such Markov networks of tree width ≤ k is also optimal with a maximum spanning k-tree. Second, we reveal sufficient conditions satisfiable by many applications, which guarantee polynomial algorithms to compute the maximum spanning k-tree. That is, under such a condition, the optimal topology of Markov networks with tree width ≤ k can be learned in time O(nk+1 ) for every fixed k. We organize this paper as follows. Section 2 presents preliminaries and introduces Markov k-tree model. In section 3, we prove that Kullback-Leibler divergence DKL (P k PG ) is minimized when the approximated distribution function PG is estimated with a maximum spanning k-tree G. In section 4, we present some conditions, each being sufficient for permitting O(nk+1 )-time algorithms to compute maximum spanning k-tree and thus to learn the optimal topology of Markov networks of tree width ≤ k. Efficient inference with Markov k-tree models is also discussed in section 4. We conclude in section 5 with some further remarks. 2 2 Markov k-Tree Model The probabilistic modeling of a finite system involves random variables X = {X1 , . . . , Xn } with observable values. Such systems are thus characterized by dependency relations among the random variables, which may be learned by estimating the joint probability distribution function P (X). Inspired by Chow and Liu’s work [11], we are interested in approximating the nth -order dependency relation among random variables by a 2nd -order (i.e., pairwise) relation. Our work first concerns how to minimize the information loss in the approximation. A pairwise dependency relation between random variables X = {X1 , . . . , Xn }1 can be defined with a graph G = (X, E), where binary relation E ⊆ X × X is defined such that (Xi , Xj ) 6∈ E if and only if variables Xi and Xj are independent conditional only on the rest of the variables, i.e., let Y = X\{Xi , Xj }, (Xi , Xj ) 6∈ E ⇐⇒ PG (Xi , Xj |Y) = PG (Xi |Y)PG (Xj |Y) (1) We call PG (X) a Markov network with the topology graph G over random variable set X. Condition (1) is called the pairwise property. By [24], it is equivalent to the following global property for positive density. Let Y, Z ⊆ X be two disjoint subsets and S ⊆ X. If S separates Y and Z in the graph G (i.e., removing S disconnects Y and Z in the graph), then PG (Y, Z|S) = PG (Y|S)PG (Z|S) (2) For the convenience of our discussion, we will assume our Markov networks to have the global property. Equation (2) states that random variables in Y and in Z are independent conditional on variables in S. The minimum cardinality of S characterizes the degree of condition for the independency between Y and Z. The conditional independency of X is thus characterized by the upper bound of minimum cardinalities of all such S separating the graph G. This number is closely related to the notion of tree width [41]. In this paper, we are interested in Markov networks whose topology graphs are of tree width ≤ k, for given integer k ≥ 1 [20]. 2.1 k-Tree and Creation Order Intuitively, tree width [7] is a metric for how much a graph is tree-like. It plays one of the central roles in the development of structural graph theory and, in particular, in the well known graph minor theorems [41] by Robertson and Seymour. There are other alternative definitions for tree width. For the work presented in this paper, we relate its definition to the concept of k-tree. Definition 1. [38] Let k ≥ 1 be an integer. The class of k-trees are graphs that are defined inductively as follows: 1. A k-tree of k vertices is a clique of k vertices; 2. A k-tree G of n vertices, for n > k, is a graph consisting of a k-tree H of n − 1 vertices and a new vertex v not in H, such that v forms a (k + 1)-clique with some k-clique already in H. 1 Here we slightly abuse notations. We use the same symbol Xi for random variable and its corresponding vertex in the topology graph and rely on context to distinguish them. 3 Definition 2. [7] For every fixed k ≥ 1, a graph is said to be of tree width ≤ k if and only if it is a subgraph of some k-tree. In particular, all trees are k-trees for k = 1 and they have tree width 1. Graphs of tree width 1 are simply forests. For k ≥ 1, a k-tree can be succinctly represented with the vertices in the order in which they are introduced to the graph by the inductive process in Definition 1. Definition 3. Let k ≥ 1 be an integer. A creation order ΦX for a k-tree G = (X, E), where X = {X1 , . . . , Xn }, is defined as an ordered sequence, inductively   |X| = k, where C = X C ΦX = CX (3) |X| = k + 1, where C ∪ {X} = X   ΦX\{X} CX |X| > k + 1, where X 6∈ C ⊂ X where C is a k-clique and C ∪ {X} is a (k + 1)-clique. Note that creation orders may not be unique for the same k-tree. The succinct notation facilitates discussion of properties for k-trees. In particular, because Markov networks are nondirected graphs, the notion of creation order offers a convenient mechanism to discuss dependency between random variables modeled by the networks. Proposition 1. Let ΦX be a creation order for k-tree G = (X, E). Then κ is a (k + 1)-clique in G if and only if there are X ∈ κ and Y ⊆ X\{X} such that ΦY CX is a prefix of ΦX , where C = κ\{X}. Definition 4. Let k ≥ 1 be an integer and ΦX be a creation order of some k-tree G = (X, E), where X = {X1 , . . . , Xn }. Then ΦX induces an acyclic orientation Ê for E such that given any two different variables Xi , Xj ∈ X, ( Xi , Xj ∈ C, i < j, and C is a prefix of ΦX (4) hXi , Xj i ∈ Ê if and only if Xi ∈ C and ΦY CXj is a prefix of ΦX , for some Y In addition, for any variable X ∈ X, its parent set is defined as πÊ (X) = {Xi : hXi , Xi ∈ Ê} Based on Definition 4, it is clear that the orientation induced by any creation order of k-tree is acyclic. In particular, there exists exactly one variable X with πÊ (X) = ∅. 2.2 Relative Entropy and Mutual Information According to Shannon’s information theory [43], P the uncertainty of a discrete random variable X can be measured with entropy H(X) = − P (X) log2 P (X), where P (X) is the probability x distribution for X and theP sum takes all values x in the range of X. Entropy for a set of random variables X is H(X) = − P (X) log2 P (X), where the sum takes all combined values x in the x ranges of variables in X. Definition 5. [27] Kullback-Leibler divergence between two probability distributions P (X) and Q(X) of the same random variable set X is defined as DKL (P k Q) = X P (X) log x 4 P (X) ≥0 Q(X) (5) where the sum takes combined values x in the ranges of all random variables in X. The last equality holds if and only if P (X) = Q(X). DKL (P k Q) can be used to measure the information gain by distribution P over distribution Q, or information loss by approximation of P with Q as in this work. Let X and Y are two random variables. The mutual information between X and Y , denoted as I(X; Y ), is defined as the Kullback-Leibler divergence between their joint probability distribution and the product of marginal distributions, i.e., X p(X, Y ) I(X; Y ) = DKL (p(X, Y ) k p(X)p(Y )) = p(X, Y ) log p(X)p(Y ) x,y Mutual information I(X; Y ) measures the degree of the correlation between the two random variables. In this work, we slightly extends the mutual information to include more than two variables. Definition 6. Let X be a random variable and C be a set of random variables. Then X p(X, C) I(X; C) = DKL (p(X, C) k p(X)p(C)) = p(X, C) log p(X)p(C) x,c where sum takes combined values x and c in the ranges of X and all random variables in C. Note that I(X; C) is not the same as the multivariate mutual information defined elsewhere [49]. We further point out that mutual information has recently received much attention due to its capability in decoding hidden information from big data [22, 58]. In our derivation of optimal Markov k-tree modeling, estimating mutual information stands out as a critical condition that needs to be satisfied (see next section). These phenomena are unlikely coincidences. 2.3 Markov k-Tree Model Definition 7. Let k ≥ 1 be an integer. A Markov k-tree is a Markov network over n random variables X = {X1 , . . . , Xn } with a topology graph G = (X, E) that is a k-tree. We denote with PG (X) the joint probability distribution function of the Markov k-tree. Theorem 1. Let k ≥ 1 and X = {X1 , . . . , Xn } be random variables with joint probability distribution function P (X). Let G = (X, E) be a Markov k-tree and Ê be an acyclic orientation for its edges. Then n Y P (Xi |πÊ (Xi )) (6) PG (X) = i=1 Proof. Assume that the acyclic orientation Ê is induced by creation order ΦX = Ck Xk+1 . . . Cn−1 Xn where Ck = {X1 , . . . , Xk } PG (X) = P (X|ΦX ) = P (X1 , . . . , Xn |ΦX ) = P (Xn |X1 , . . . , Xn−1 , ΦX )P (X1 , . . . , Xn−1 |ΦX ) = P (Xn |Cn−1 )P (X\{Xn })|ΦX\Xn ) 5 (7) The last equality holds for the reason that Xn is independent from variables in X\Cn−1 conditional on variables in Cn−1 , as shown in the following derivation. Assume Y = X\(Cn−1 ∪{Xn }). Use the Bayes, P (Xn |X1 , . . . , Xn−1 , ΦX ) = P (Xn |Y, Cn−1 , ΦX ) = = P (Xn , Y|Cn−1 , ΦX ) P (Y|Cn−1 , ΦX ) P (Xn |Cn−1 , ΦX )P (Y|Cn−1 , ΦX ) = P (Xn |Cn−1 , ΦX ) = P (Xn |Cn−1 ) P (Y|Cn−1 , ΦX ) The derivation in (7) also results in recurrence ( P (Xn |Cn−1 )P (X\{Xn }|ΦX\{X} ) P (X|ΦX ) = P (Ck ) if n > k if n = k (8) Solving the recurrence yields P (X|ΦX ) = P (Ck ) n Y P (Xi−1 |Ci ) (9) i=k+1 where P (Ck ) = P (X1 , . . . , Xk ). Because for i ≤ k, πÊ (Xi ) = {X1 , . . . , Xi−1 }, it is not hard to prove that k Y P (Xi |πÊ (X)) (10) P (X1 , . . . , Xk ) = i=1 In addition, because πÊ (Xi ) = Ci−1 for all i ≥ k + 1, by equations (9) and (10), we have PG (X) = k Y P (Xi |πÊ (Xi )) i=1 n Y P (Xi |πÊ (Xi )) = n Y P (Xi |πÊ (Xi )) i=1 i=k+1  Though the above proof is based on an explicit creation order for the k-tree G. The probability function computed for PG (X) is actually independent of the choice of a creation order as demonstrated in the following. Theorem 2. The probability function expressed in (6) for Markov k-tree G remains the same regardless the choice of creation order for G. A proof is given in Appendix A (Theorem 7). 3 3.1 Model Optimization Optimal Markov k-Trees Let X = {X1 , . . . , Xn } be random variables in any unconstrained probabilistic model P (X). Let k ≥ 1 and k-tree G = (X, E) be a topology graph of a Markov network PG (X) that approximates 6 P (X). The approximation can be measured using the Kullback-Leibler divergence between two models [27, 31]: X P (X) ≥0 (11) DKL (P k PG ) = P (X) log PG (X) x where x is any combination of values for all random variables in X, and the last equality holds if and only if P (X) = PG (X). Thus the problem to optimally approximate P (X) is to find a Markov k-tree with topology G that minimizes the divergence (11). We are now ready for our first main theorem. Theorem 3. DKL (P k PG ) is minimized when the topology k-tree G = (X, E) for random variables X = {X1 , . . . , Xn } is such that maximizes the sum of mutual information. n X I(Xi , πÊ (Xi )) (12) i=1 where Ê is any acyclic orientation for the edges in G. Proof. Assume Ê to be an acyclic orientation for the edges in G. Apply equation (6) PG (X) = n Y P (Xi |πÊ (Xi )) i=1 to PG (X) in (11), we have DKL (P k PG ) = X P (X) log P (X) − x X P (X) x n X log P (Xi |πÊ (Xi )) i=i The first term on the right hand side (RHS) of above is −H(X), where H(X) is the entropy of n P P X. And the second term − P (X) log P (Xi |πÊ (Xi )) can be further explained with x − X P (X) x i=1 n X log i=1 n X X P (Xi , πÊ (Xi )) log P (Xi ) − P (X) P (Xi )P (πÊ (Xi )) x i=1 (13) Because P (Xi ) and P (Xi , πÊ (Xi )) are components of P (X), the second term in (13) can be formulated as − X x P (X) n X log P (Xi ) = i=1 = = n X X i=1 x n X X i=1 xi n X P (Xi ) log P (Xi ) H(Xi ) i=1 where xi is any value in the range of random variable Xi . 7 P (X) log P (Xi ) (14) Also the first term in (13) gives − n X X i=1 P (X) log x n X X P (Xi , πÊ (Xi )) P (Xi , πÊ (Xi )) P (Xi , πÊ (Xi )) log =− P (Xi )P (πÊ (Xi )) P (Xi )P (πÊ (Xi )) i=1 x ,y i =− n X i (15) I(Xi , πÊ (Xi )) i=1 where yi is any combination of values of all random variables in πÊ (Xi ) and I is the mutual information between variable Xi and its parent set πÊ (Xi ). Therefore, n n X X H(Xi ) − H(X) (16) I(Xi , πÊ (Xi )) + DKL (P k PG ) = − i=1 i=1 Since n P H(Xi ) and H(X) are independent of the choice G (and the acyclic orientation for i=1 the edges), DKL (P k PG ) is minimized when n P i=1 I(Xi , πÊ (Xi )) is maximized.  Though Theorems 3 is about optimal approximation of probabilistic systems with Markov k-trees, they also characterize the optimal Markov k-tree. Theorem 4. Let k ≥ 1 and X = {X1 , . . . , Xn } be a set of random variables. The optimal Markov n P I(Xi , πÊ (Xi )), for some k-tree model for X is the one with topology G = (X, E) that maximize i=1 acyclic orientation of edges in E. Now we let ∆G,Ê (X) = n X I(Xi , πÊ (Xi )) i=1 By Theorem 2 and the proof of Theorem 3, we know that ∆G,Ê is invariant of the choice of an acyclic orientation Ê of edges. So we can simply omit Ê and use ∆G (X) for ∆G,Ê (X). Definition 8. Let X = {X1 , . . . , Xn } be random variables. Define G∗ = arg max{∆G (X)} G (17) to be the topology of optimal Markov k-tree over X. Corollary 1. Let k ≥ 1 and X = {X1 , . . . , Xn } be a set of random variables. Divergence DKL (P k PG∗ ) is minimized with the topology k-tree G∗ satisfying (17). Corollary 2. Let k ≥ 1 and X = {X1 , . . . , Xn } be a set of random variables. The optimal Markov k-tree model for X is the one with topology graph G∗ = (X, E) satisfying (17). 8 3.2 Optimal Markov Networks of Tree Width ≤ k Because k-trees are the maximum graphs of tree width ≤ k, Theorems 3 and 4 are not immediately applicable to optimization of Markov networks of tree width ≤ k. Our derivations so far have not included the situation that, given k ≥ 1, an optimal Markov network of tree width ≤ k is not exactly a l-tree, for any l ≤ k. In this section, we resolve this issue with a slight adjustment to the objective function ∆G (X). Definition 9. Let G = (X, E) be a k-tree and A ⊆ E be a binary relation over X. The spanning subgraph GA = (X, A) is called amended graph of G with A. Proposition 2. A graph has tree width ≤ k if and only if it is an amended graph GA = (X, A) of some k-tree G = (X, E) with relation A. Definition 10. Let Ê be an acyclic orientation for edges in k-tree G = (X, E) and GA = (X, A) be an amended graph of G. Then the orientation  of edges in the graph GA is defined as, for every pair of Xi , Xj ∈ X, hXi , Xj i ∈  ⇐⇒ hXi , Xj i ∈ Ê ∧ (Xi , Xj ) ∈ A Definition 11. Let G = (X, E) be a k-tree, where |X| = n. Let GA = (X, A) be an amended graph of G. Define n X I(Xi , π (Xi )) (18) ∆G, (X) = i=1 where  is an acyclic orientation on edges A. We can apply the derivation in the previous section by replacing πÊ (Xi ) with π (Xi ) and obtain Corollary 3. Let k ≥ 1 and X = {X1 , . . . , Xn } be a set of random variables. The optimal Markov network of tree width ≤ k for X is the amended graph G∗A = (X, A) of some k-tree G = (X, E) that satisfies G∗A = arg max {∆G, (X)} GA , 4 Efficient Computation with Markov k-Trees Optimal topology learning is computationally intractable for Markov networks of arbitrary graph topology [10]. This obstacle is not exception to Markov k-trees. In particular, we are able to relate the optimal learning of Markov k-trees to the following graph-theoretic problem. Definition 12. Let k ≥ 1. The Maximum Spanning k-Tree (MSkT) problem is, on input graph of vertices X = {X1 , . . . , Xn }, to find a spanning k-tree G = (X, E) with an acyclic orientation Ê such that n X f (Xi , πÊ (Xi )) i=1 achieves the maximum. 9 In the definition, function f is pre-defined numerical function for a pair: vertex Xi and its parent set πÊ (Xi ) in the output k-tree. MSkT generalizes the traditional “standard” definition of the maximum spanning k-tree problem [4, 9], where the objective function is the sum of weights w : E → R on all edges involved the output k-tree; that is X w(X, Xi ) (19) f (Xi , πÊ (Xi )) = X∈πÊ (Xi ) Proposition 3. The Markov k-tree learning problem is the problem MSkT defined in Definition 12 in which for every i = 1, . . . , n, f (Xi , πÊ (Xi ) = I(Xi , πÊ (Xi )), the mutual information between Xi and its parent set πÊ (Xi ). It has been proved that, for any fixed k ≥ 2, the problem MSkT with the objective function defined with f given in equation (19) is NP-hard [4]. The intractability appears inherent since a number of variants of the problem remains intractable [9]. It implies that optimal topology learning of Markov k-trees (for k ≥ 2) is computationally intractable. Independent works in learning Markov networks of bounded tree width have also confirmed this unfortunate difficulty [44, 47]. 4.1 Efficient Learning of Optimal Markov Backbone k-Trees We now consider a class of less general Markov k-trees that are of higher order topologies over an underlying linear relation. In particular, such networks carry the signature of relationships among consecutively indexed random variables. Definition 13. Let X = {X1 , X2 , . . . , Xn } be the set of integer-indexed variables. (1) The graph BX = (X, b), where b = {(Xi , Xi+1 ) : 1 ≤ i < n}, is called the backbone of X. And each edge (Xi , Xi+1 ), for 1 ≤ i < n, is called a backbone edge. (2) A graph (resp. k-tree) G = (X, E) is called a backbone graph (resp. backbone k-tree) if it contains BX as a subgraph. Definition 14. Let k ≥ 1. A Markov network is called Markov backbone k-tree if the underlying topology graph of the Markov network is a backbone k-tree. The linearity relation among random variables occurs naturally in many applications with Markov network modeling, for instance, in speech recognition, cognitive linguistics, and higherorder relations among residues on biological sequences. Typically, the linearity also plays an important role in random systems involving variables associated with the time series. For example, Theorem 5. For each k ≥ 1, the topology graph of any finite kth-order Markov chain is a backbone k-tree. Proof. This is because a finite kth-order Markov chain G is defined over labelled variables X1 , . . . , Xn such that PG (Xi |X1 , . . . , Xn ) = PG (Xi |Xi−1 , . . . , Xi−k ), for every i = 1, 2, . . . , n. Clearly, its topology graph contains all edges (Xi , Xi+1 ), for i, 1 ≤ i ≤ n − 1. In addition, the following creation order asserts that the graph is a k-tree: Ck Xk+1 . . . Ci−1 Xi . . . Cn−1 Xn , where Ci−1 = {Xi−k , . . . , Xi−1 }, for all i = k + 1, . . . , n.  10 We now show that learning the optimal topology of Markov backbone k-trees can be accomplished much more efficiently than with unconstrained Markov k-trees. We relate the learning problem to a special version of graph-theoretic problem MSkT that can be computed efficiently. In the rest of this section, we present some technical details for such connection. Definition 15. Let G be a class of graphs. Then the G-retaining MSkT problem is the MSkT problem in which the input graph includes a spanning subgraph H ∈ G that is required to be contained by the output spanning k-tree. The unconstrained MSkT is simply the G-retaining MSkT problem with G being the class of independent set graphs. There are other classes of graphs that are of interest to our work. In particular, we define B to be the class of all backbones. Then it is not difficult to see: Proposition 4. The Markov backbone k-tree learning problem is the B-retaining MSkT problem. In the following, we will show that, for various classes G that satisfy certain graph-theoretic property, including class B, the G-retaining MSkT problems can be solved efficiently. Definition 16. Let fixed k ≥ 1. A k-tree G has bounded branches if every (k + 1)-clique in G separates G into a bounded number of connected components. Definition 17. Let fixed k ≥ 1. A graph H is bounded branching-friendly if every k-tree that contains H as a spanning subgraph has bounded branches. Lemma 1. Let B be the class of all backbones. Any graph in B is bounded branching friendly. Proof. Let G = (X, E) be a k-tree containing a backbone BX = (X, b). Let (k + 1)-clique κ = {x1 , . . . , xk+1 } with x1 < x2 · · · < xk+1 . Let K = {κ′ : κ′ is a (k + 1)-clique and |κ ∩ κ′ | = k} It is not difficult to see that κ separates the k-tree into at most |K| connected components. Note that κ divides set [n] into at most k + 2 intervals. Let κ1 , κ2 ∈ K be two (k + 1)-cliques such that vertices z1 ∈ κ1 \κ and z2 ∈ κ2 \κ. Then z1 and z2 cannot belong to the same interval in order to guarantee all backbone edges are included in G. This implies |K| ≤ k + 2, a constant when k is fixed.  Lemma 2. Let G be a class of bounded branching friendly graphs. Then G-retaining MSkT problem can be solved in time O(nk+1 ) for every fixed k ≥ 1. Proof. (We give a sketch for proof.) Note that the G-retaining MSkT problem is defined as follows: Input: a set of vertices X = {X1 , . . . , Xn } and a graph H = (X, EH ) ∈ G, Output: k-tree G∗ = (X, E) with EH ⊆ E such that G∗ = arg max { G,Ê n X f (Xi , πÊ (Xi )} i=1 where f is a pre-defined function. First, any (k + 1)-clique in a k-tree that contains H as a spanning subgraph can only separate H into a bounded number of connected components. To see this, assume some (k + 1)-clique κ 11 does the opposite. From the graph H and κ we can construct a k-tree by augmenting H with additional edges. We do this without connecting any two of the components in H disconnected by κ. However, the resulted k-tree, though containing H as a spanning subgraph, would be separated by κ into an unbounded number of components, contradicting the assumption that H is bounded branching friendly. Second, consider a process to construct a spanning k-tree anchored at any fixed (k + 1)-clique κ. Note that by the aforementioned discussion, in the k-tree (to be constructed) the number of components separated by κ is some constant c(k) ≥ 1, possibly a function in k which is fixed. For every component, its connection to κ is by some other (k +1)-clique κ′ such that κ′ = κ∪{x}\{y}, where y is drawn from the component to “swap” out x, a vertex chosen from κ. It is easy to see that, once x is chosen, there are only a bounded number of ways (i.e,, at most k + 1 possibilities) to choose y. On the other hand, there are at most O(n) possibilities to choose x from one of the c(k) connected components. If we use 0 and 1 to indicate the permission mode ‘yes’ or ’no’ that x can be drawn from a specified component, an indicator for such permissions for all the components can be represented with c(k) binary bits. Let α be a binary string of length c(k). We define M (κ, α) to be the maximum value of a sub-k-tree created around κ, which is consistent with the permission indicator α for the associated components. We then have the following recurrence for function M : M (κ, α) = max {M (κ′ , β) + M (κ, γ) + f (x, κ\{y})} x,y,β,γ where κ′ = κ ∪ {x}\{y} and f is the function defined over the newly created vertex x and its parent set κ\{y}. The recurrence defines M (κ, α) with two recursive terms M (κ′ , β) and M (κ, γ), where the permission indicators β and γ are such that the state corresponding to the component from which x was drawn should be set ’1’ by β and ’0’ by γ. When a component runs out of vertices, the indicator should be set ’0’. For other components, where α indicates ’1’, either β or γ indicates ’1’ but not both. Finally, base case for the recurrence is that M (κ, α) = 0 when α is all 0’s. The recurrence facilitates a dynamic programming algorithm to compute M for all entries of (k + 1)-clique κ and information α. It runs in time O(nk+2 ) and uses O(nk+1 ) memory which can be improved to O(nk+1 )-time and O(nk ) memory with a more careful implementation of the idea, e.g., by considering κ a k-clique instead of a (k + 1)-clique [15, 16].  Combining Proposition 4 and Lemmas 1 and 2, we have Theorem 6. For every fixed k ≥ 1, optimal topology learning of Markov backbone k-trees can be accomplished in time O(nk+1 ). 4.2 Efficient Inference with Markov k-Trees On learned or constructed Markov k-trees, inferences and queries of probability distributions can be conducted, typically through computing the maximum posterior probabilities for most probably explanations [24]. The topology nature of Markov k-trees offers the advantage of achieving (high) efficiency for such inference computations, especially when values of k are small or moderate. Traditional methods for inference with constructed Markov networks seek additional independency properties that the models may offer. Typically, the method of clique factorization measures the joint probability P (X) of a Markov network in terms of “potential” φ such that it 12 Q can be factorized according to the maximal cliques in the graph: P (X) = κ∈K φκ (Xκ ), where K is the set of maximal cliques and Xκ is the subset of variables associated with clique κ. [5]. For general graphs, by the Hammersley-Clifford theorem [18], the condition to guarantee the equation is non-zero probability P (X) > 0, that may not always be satisfied. For Markov k-trees, such factorization suits well because k-trees are naturally chordal graphs. Nevertheless, inference with a Markov network may involve tasks more sophisticated than computing joint probabilities. The k-tree topology offers a systematic strategy to compute many optimization functions over the constructed network models. This is briefly explained below. Every k-tree of n vertices, n > k, consists of exactly n − k number of (k + 1)-cliques. By Proposition 1 in Section 2, if a k-tree is defined by creation order ΦX , all (k + 1)-cliques uniquely correspond prefixes of ΦX . Thus relations among the (k + 1)-cliques can be defined by relations among the prefixes of ΦX . For the convenience of discussion, with κCX we denote the (k+1)-clique corresponding to prefix ΦY CX of ΦX . Definition 18. Let G = (X, E) be a k-tree and ΦX be any creation order for G. Two (k + 1)-cliques κCX and κC′ X ′ in G are related, denoted with E(κCX , κC′ X ′ ), if and only if their corresponding prefixes ΦY CX and ΦY′ C′ X ′ of ΦX satisfy (1) C ⊂ C′ ∪ {X ′ }; (2) ΦY′ C′ X ′ is a prefix of ΦY CX; (3) No other prefix of ΦY CX satisfies (1) and of which ΦY′ C′ X ′ is a prefix. Proposition 5. Let K be the set of all (k + 1)-cliques in a k-tree and E be the relation of cliques given in Definition 18 for the cliques. Then (K, E) a rooted, directed tree with directed edges from child κCX to its parent κC′ X ′ . Actually, tree (K, E) is a tree decomposition for the k-tree graph. Tree decomposition is a technique developed in algorithmic structural graph theory which makes it possible to measure how much a graph is tree-like. In particular, a tree decomposition reorganizes a graph into a tree topology connecting subsets of the graph vertices (called bags, e.g., (k + 1)-cliques in a k-tree) as tree nodes [41, 7]. A heavy overlap is required between neighboring bags to ensure that the vertex connectivity information of the graph is not lost in such representation. However, finding a tree decomposition with maximum bag size ≤ k for a given arbitrary graph (of tree width k) is computationally intractable. Fortunately, for a k-tree or a backbone k-tree generated with the method presented in section 3, an optimal tree decomposition is already available according to Proposition 5. Tree decomposition makes it possible to compute efficiently a large class of graph optimization problems on graphs of small tree width k, which are otherwise computationally intractable on restricted graphs. In particular, on the tree decompositions (K, E) of a k-tree, many global optimization computation can be systematically solved in linear time [6, 1, 2, 12]. The central idea is to build one dynamic programming table for every (k + 1)-clique, and according to the tree decomposition topology, the dynamic programming table for a parent tree node is built from the tables of its child nodes. For every node (i.e., every (k + 1)-clique), all (partial) solutions associated with the k + 1 random variables are maintained, and (partial) solutions associated with variables only belonging to its children nodes are optimally selected conditional upon the variables it shares with its children node. The optimal solution associated with the whole network is then present at the root of the tree decomposition. The process takes f (k)n time, for some possibly exponential function f , where f (k) is the time to build a table, one for each of the O(n) 13 nodes in the tree decomposition. For small or moderately large values of k, such algorithms scale linearly with the number of random variables in the network. 5 Concluding Remarks We have generalized Chow and Liu’s seminal work from Markov trees to Markov networks of tree width ≤ k. In particular, we have proved that model approximation with Markov networks of tree width ≤ k has the minimum information loss when the network topology is a maximum spanning k-tree. We have also shown that learning Markov network topology of backbone k-trees can be done in polynomial time for every fixed k, in contrast to the intractability in learning Markov k-tree without the backbone constraint. This result also holds for a broader range of constraints. The backbone constraint stipulates a linear structure inherent in many Markov networks. Markov backbone k-trees are apparently suitable for modeling random systems involving the time series. In particular, we have shown the k th order Markov chains are actually Markov backbone k-trees. The constrained model is also ideal for modeling systems that possess higher order relations upon a linear structure and has been successful in modeling 3-dimensional structure of bio-molecules and in modeling semantics in computational linguistics, among others. Acknowledgement This research is supported in part by a research grant from National Institute of Health (NIGMSR01) under the Joint NSF/NIH Initiative to Support Research at the Interface of the Biological and Mathematical Sciences. 14 References [1] Arnborg S. and Proskurowski A., (1989) Linear time algorithms for NP-hard problems restricted to partial k-trees. Discrete Applied Mathematics 23, Pages 1124 [2] Arnborg, S., Lagergren, J., and Seese, D. (1991) Easy problems for tree-decomposable graphs, Journal of Algorithms, 12, 308-340. [3] Bach, F. and Jordan, MI. (2002) Thin Junction trees, in Dietterich, Becker, and Ghahramani, ed., Advances in Neural Information Processing Systems, 14. MIT Press. [4] Bern, M.W., (1987) Network design problems: Steiner trees and spanning k-trees PhD thesis, University of California, Berkeley, CA. [5] Bishop, C.M. (2006) Pattern Recognition and Machine Learning, Springer. [6] Bodlaender, H.L. (1988), Dynamic programming on graphs with bounded treewidth, Proc. 15th International Colloquium on Automata, Languages and Programming, Lecture Notes in Computer Science, 317, 105118. [7] Bodlaender, H.L. (2006) Treewidth: Characterizations, Applications, and Computations. Proceedings of Workshop in Graph Theory, 1-14. [8] Bradley, J. and Guestrin, C. (2010) Learning tree conditional random fields, Proceedings of 21th International Conference on machine Learning, 2010. [9] Cai, L. and Maffray, F. (1993) On the spanning k-tree problem, Discrete Applied Mathematics, 44, 139156. [10] Chickering, DM., Geiger, D., and Heckerman, D. (1994) Learning bayesian networks is NPHard, Technical Rep MSR-TR-94-17, Microsoft Research Advanced Technology Division. [11] Chow, CK. and Liu, CN. (1968) Approximating discrete probability distribution with dependence trees, IEEE Transactions on Information Theory, 14: 462-467. [12] Courcelle, B. (1990) The monadic second-order logic of graphs. I. recognizable sets of finite graphs, Information and Computation, 85, 12-75. [13] Daly, R, Qiang, S. and Aitken, S. (2011), Learning bayesian networks: approaches and issues. Knowledge Engineering Review, vol 26, no. 2, pp. 99-127. [14] Dasgupta, S. (1999) Learning polytree. In Laskey and Prade, ed. Proceedings Conference on Uncertainty in AI, 134-141. [15] Ding, L. Samad, A., Xue, X., Huang, X., Malmberg, R., and Cai, L. (2014) Stochastic k-tree grammar and its application in biomolecular structure modeling. Lecture Notes in Computer Science, 8370, 308-322. [16] Ding, L., Xue, X., LaMarca, S., Mohebbi, M., Samad, A., Malmberg, R., and Cai, L. (2014) Accurate prediction of RNA nucleotide interactions with backbone k-tree model. Bioinformatics, [17] Elidan, G. and Gould, S. (2008) Learning bounded treewidth Bayesian networks, Journal of Machine Learning Research 9, 2699-2731. [18] Grimmett, G. R. (1973), A theorem about random fields, Bulletin of the London Mathematical Society, 5 (1): 8184. 15 [19] Gupta, A. and Nishimura, N. (1996) The complexity of subgraph isomorphism for classes of partial k-trees. Theoretical Computer Science, 164: 287-298. [20] Karger, D., and Srebro, N. (2001) Learning Markov networks: maximum bounded treewidth graphs, Proceedings of 12th ACM-SIAM Symposium on Discrete Algorithms. [21] Kindermann, R. and Snell, J.L. (1980). Markov Random Fields and Their Applications, American Mathematical Society. [22] Kinney, J. B. and Atwal, G. S. (2014) Equitability, mutual information, and the maximal information coefficient. Proceedings of the National Academy of Sciences, 111:9, 33543359 [23] Koivisto, M., and Sood, k. (2004) Exact Bayesian structure discovery in Bayesian networks. Journal of Machine Learning Research, 5:549-573. [24] Koller, D. and N. Friedman (2010) Probabilistic Graphical Models: Principles and Techniques, MIT Press. [25] Koller, D. and Sahami, M. (1996) Toward optimal feature selection. Proceedings of the Thirteenth International Conference on Machine Learning, 284-292. [26] Kramer, N., Schafer, J., and Boulesteix, A. (2009) Regularized estimation of large-scale gene association networks using graphical Gaussian models. BMC bioinformatics, 10 (1):1. [27] Kullback, S. and Leibler, RA. (1951) On information and sufficiency, Annals of Mathematical Statistics, 22(1):79-86. [28] Kwisthout, JH., Bodlaender, HL, van der Gaag, LC. (2010) The necessity of bounded treewidth for efficient inference in Bayesian networks, Proceedings 19th European Conference on Artificial Intelligence, 237-242. [29] Lee, J., and Jun, CH. (2015) Classification of high dimensionality data through feature selection using Markov blanket, Industrial Engineering and Management Systems, 14:2, 210-219. [30] Lee, S. Ganapathi, V., and Koller, D. (2006) Efficient structure learning of Markov networks using L1 -regularization. In Advances in Neural Information Processing Systems, 817-824. [31] Lewis, PM, II, Approximating probabilistic distributions to reduce storage requirements, Information and Control, 2, 214-225. [32] Mao, Q., Wang, L., Goodison, S., and Sun, Y. (2015) Dimensionality reduction via graph structure learning, Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 765-774. [33] Matousek, J. and Thomas, R. (1992) On the complexity of finding iso- and other morphisms for partial k-trees, Discrete Mathematics, 108, 343-364. [34] Meek, C. (2001) Finding a path is harder than finding a tree, Journal of Artificial Intelligence Research, 15: 383-389. [35] Meila, M. and Jordan, MI (2000) Learning with mixtures of trees, Journal of Machine Learning Research, 1: 1-48. [36] Nagarajan, R., Scutari, M., and Lebre., S. (2013) Bayesian Networks in R with Applications in Systems Biology, Springer. [37] Narasimhan, M. and Bilmes, J. (2003) Pac-learning bounded tree-width graphical models, in Chickering and Halpern, ed., Proceedings of Conference on Uncertainty in AI. 16 [38] Patil, H. P. (1986) On the structure of k-tree. Journal of Combinatorics, Information and System Sciences, 11 (2-4):57-64. [39] Pearl, J., (1988) Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference, Morgan Kaufmann Series in Representation and Reasoning. [40] Robertson, N., Seymour, P.D. (1984), Graph minors III: Planar tree-width, Journal of Combinatorial Theory, Series B 36 (1): 4964. [41] Robertson, N. and Seymour, P.D. (1986) Graph minors II. Algorithmic aspects of treewidth, Journal of Algorithms, 7, 309-322. [42] Rue, H. and Held, L. (2005) Gaussian Markov random felds: theory and applications. CRC Press. [43] Shannon, C.E. (1948), A Mathematical Theory of Communication, , Bell System Technical Journal, 27, pp. 379423 & 623656. [44] Srebro, N. (2003) Maximum likelihood bounded tree-width Markov networks, Artificial Intelligence, 143 (2003) 123138. [45] Sun, Y. and Han, J. (2013) Mining heterogeneous information networks: a structural analysis approach, ACM SIGKDD Explorations Newsletter, 14:2, 20–28. [46] Suzuki, J. (1999) Learning Bayesian belief networks based on the MDL principle: An efficient algorithm using the branch and bound technique. IEICE TRANSACTIONS on Information and Systems, 82(2):356-367. [47] Szántai, T. and Kovács E (2012) Hypergraphs as a mean of discovering the dependence structure of a discrete multivariate probability distribution. Annals of Operations Research, vol 193, pp 7190. [48] Teyssier, M. and Koller, D. (2005) Ordering-based search: a simple and effective algorithm for learning Bayesian networks, Proceedings of the Twenty-First Conference on Uncertainty in Artificial Intelligence, 584-590. [49] Timme, N, Alford, W., Flecker, B., and Beggs, J.M. (2014). Multivariate information measures: an experimentalist’s perspective. Journal of Computational Neuroscience, 36 (2), pp 119140. [50] Tomczak, K., Czerwinska, P. and Wiznerowicz, M. (2015) The Cancer Genome Atlas (TCGA): an immeasurable source of knowledge. Contemporary Oncology (Pozn), 19(1A): A68-77. [51] Torti, SV. and Torti, FM. (2013) Iron and cancer: more ore to be mined. Nature Review Cancer, 13(5): 342-55. [52] Valiant, L.G. (1975), General context-free recognition in less than cubic time, Journal of Computer and System Sciences 10 (2): 308314 [53] Wu, X., Zhu, X., Wu, G., and Ding, W. (2014) Data mining with big data, IEEE Transactions on Knowledge and Data Engineering, 26:1, 97–107. [54] Xu, Y., Cui, J., and Puett, D. (2014) Cancer Bioinformatics, Springer. [55] Yuan, C., and Malone, B., (2013) Learning optimal Bayesian networks: A shortest path perspective. J. Artificial Intelligence Research 48:23-65. 17 [56] Yin, W., Garimalla, S., Moreno, A., Galinski, MR., and Styczynski, MP. (2015) A tree-like Bayesian structure learning algorithm for small-sample datasets from complex biological model systems, BMC Systems Bology 9:49. [57] Zhang, Z., Bai, L., Liang, Y., and Hancock, ER. (2015) Adaptive graph learning for unsupervised feature selection, Computer Analysis of Images and Patterns LNCS Vol 9256, 790-800. [58] Zhao, I, Zhou, Y., Zhang, X., and Chen, L. (2015) Part mutual information for quantifying direct associations in networks, Proceedings of the National Academy of Sciences, 113: 18, 51305135. 18 Appendix A Theorem 7. The probability function expressed in (6) for Markov k-tree G remains the same regardless the choice of creation order for G. Proof. Let ΨX and ΦX be two creation orders for k-tree G = (X, E). For the same k-tree G = (X, E), we define PG (X|ΨX ) and PG (X|ΦX ) to be respectively the joint probability distribution functions of X under the topology graph G with creation orders ΨX and ΦX . Without loss of generality, we further assume that ΦX be the creation order for G as given in Definition 3 of the following form: Ck Xk+1 Ck+1 Xk+2 . . . Cn−1 Xn n≥k By induction on n, we will prove in the following the statement that PG (X|ΨX ) = PG (X|ΦX ). Basis: when n = k, PG (X|ΨX ) = P (X1 , . . . , Xk |ΨX ) = P (X1 , . . . , Xk ) = P (Ck ) = PG (X|ΦX ) Assumption: the statement holds for any k-tree of n − 1 random variables. Induction: Let G = (X, E), where X = {X1 , . . . , Xn }, be a k-tree. Then it is not hard to see that subgraph G′ = (X′ , E ′ ) of G, after variable Xn is removed, is indeed a k-tree for random variables X′ = {X1 , . . . , Xn−1 }. Furthermore, according to Definition 3, ΦX′ is a creation order for k-tree G′ . Now we assume creation order Ψ for graph G = (X, E) to be Dk Yk+1 Dk+1 Yk+2 . . . Dn−1 Yn where Dk = {Y1 , . . . , Yk }, and Yi ∈ X for all i = 1, . . . , n. Then there are two possible cases for Xn to be in the creation order ΨX . Case 1. Xn ∈ Dk . Because Xn shares edges only with variables in Ck , we have Dk ∪ {Yk+1 } = Cn−1 ∪ {Xn } and Dk+1 = Dk \{Xn } ∪ {Yk+1 } = Cn−1 . Therefore, ΨX′ = Dk+1 Yk+2 . . . Dn−1 Yn is a creation order for subgraph G′ = (X′ , E ′ ). Thus, based on (6), we have PG (X|ΨX ) = P (Dk )P (Yk+1 |Dk ) n−1 Y P (Yi+1 |Di , ΨX′ ) i=k+1 PG′ (X′ |ΨX′ ) P (Dk+1 ) PG′ (X′ |ΨX′ ) = P (Dk ∪ {Yk+1 }) P (Dk+1 ) PG′ (X′ |ΨX′ ) = P (Cn−1 ∪ {Xn }) P (Dk+1 ) PG′ (X′ |ΨX′ ) = P (Cn−1 )P (Xn |Cn−1 ) P (Dk+1 ) ′ = P (Xn |Cn−1 )PG′ (X |ΨX′ ) = P (Dk )P (Yk+1 |Dk ) 19 (20) By the assumption, PG′ (X′ |ΨX′ ) = PG′ (X′ |ΦX′ ), we have PG (X|ΨX ) = P (Xn |Cn−1 )PG′ (X′ |ΦX′ ) = P (Xn |Cn−1 )P (Ck ) n−1 Y P (Xi |Ci−1 , ΦX′ ) i=k+1 = P (Ck ) n Y (21) P (Xi |Ci−1 , ΦX′ ) i=k+1 = PG (X|ΦX ) Case 2. Xn = Ym for some m ≥ k + 1. Then Dm−1 = Cn−1 , and ΨX′ = Dk Yk+1 . . . Dm−2 Ym−1 Dm+1 Ym+1 . . . Dn Yn is a creation order for subgraph G′ = (X′ , E ′ ). Based on (6), we have PG (X|ΨX ) = P (Dk ) n Y P (Yi |Di−1 , ΨX ) i=k+1   n m−1 Y Y ′ ′ P (Yi |Di−1 , ΨX ) P (Ym |Dm−1 ) = P (Dk ) P (Yi |Di−1 , ΨX ) (22) i=m+1 i=k+1 = PG′ (X′ |ΨX′ )P (Ym |Dm−1 ) = PG′ (X′ |ΨX′ )P (Xn |Cn−1 ) By the assumption, PG′ (X′ |ΨX′ ) = PG′ (X′ |ΦX′ ), we have PG (X|ΨX ) = PG′ (X′ |ΦX′ )P (Xn |Cn−1 ) = P (Ck ) = P (Ck ) n−1 Y i=k+1 n Y P (Xi |Ci−1 , ΦX′ ) P (Xn |Cn−1 ) (23) P (Xi |Ci−1 , ΦX ) i=k+1 = PG (X|ΦX )  20
8cs.DS
Parallel Computing of Discrete Element Method on GPU* Teruyoshi Washizawa, Yasuhiro Nakahara Simulation & Analysis R&D Center, Canon Inc., Tokyo, Japan washizawa.teruyoshi_at_canon.co.jp nakahara.yasuhiro105_at_canon.co.jp Received **** 2011 Abstract General purpose computing on GPU for scientific computing has been rapidly growing in recent years. We investigate the applicability of GPU to discrete element method (DEM) often used in particle motion simulation. NVIDIA provides a sample code for this type of simulation, which obtained superior performance than CPU in computational time. A computational model of the contact force in NVIDIA’s sample code is, however, too simple to use in practice. This paper modifies the NVIDIA’s simple model by replacing it with the practical model. The computing speed of the practical model on GPU is compared with the simple one on GPU and with the practical one on CPU in numerical experiments. The result shows that the practical model on GPU obtains the computing speed 6 times faster than the practical one on CPU while 7 times slower than that of the simple one on GPU. The effects of the GPU architectures on the computing speed are analyzed. Keywords: GPU; particle motion simulation; discrete element method; warp divergence; 1. Introduction Recently, high performance computing on GPU in scientific and industrial fields has attracted much attention. Splendid achievements applied to various information processing problems, physical simulations, and social scientific problems can be found easily on the web site of NVIDIA [1]. The expected speed-up ratio reported in “Complete applications catalog” in [2] ranges from 1.5 to 500 depending on applications. As described later, since GPU obtains high computational performance by employing special hardware architectures and control processes, programmers are requested to tune their programs for fitting the specification of GPU. Fortunately, programmers can utilize NVIDIA’s sample codes included in NVIDIA GPU Computing SDK obtained from the web site, which also demonstrate the superior performance of their products. This paper focuses on discrete element method (DEM) which has properly used in particle motion simulation arising for the last decades [3, 4]. NVIDIA SDK provides a sample code for DEM and demonstrates the computing speed on GPU to be over 40 times faster than on CPU. However, the contact force employed in the sample code is too simple to use in practice. A practical DEM code has several kinds of force between a collided or interacted pair of particles. Hereafter, we *Special description of the title. (dispensable) refer to this model of force as practical model. The first step to use the sample code in practical cases is to replace the NVIDIA’s simple model with the practical model without modification of GPU-tuned parts. Numerical experiments are conducted to compare the computing speed of the following four cases, i.e., the practical model on CPU, the practical model on GPU, and the simple model coded in two languages on GPU. The result shows that the computing speed of the practical model is 6 times faster than that of the practical model on CPU while it is 7 times slower than that of the simple model on GPU. The effects of the GPU architectures on the improvement and the reduction in computing speed are analyzed. The rest of this paper is organized as follows. The next section gives an overview of GPU architecture. Main features which affect the computational performance are described. The simple model and the practical model of the contact force in DEM are shown in section 3. Section 4 is devoted to the implementation of the practical model as well as the simple one. After describing the data structure, we show the process flow. Almost all processes are same for both models except the contact force calculation processes. The results of numerical experiments are shown in Section 5, which is followed by the discussion of the results. 2. An Overview of GPU Computing 2 T. Washizaewa, Y. Nakahara Before the detailed description of the implementation of the practical model, architecture of GPU is overviewed [5]. It helps us to analyze the result of numerical experiments described later. In order to make the following description more comprehensive, a brief introduction of CPU architecture is given first. A CPU has several cores containing several, recently 6 or more processing units, an address counter and a decoder of instruction, a memory unit and other peripherals. Since one core has only one instruction address counter, processing units in each core are allowed to execute concurrently only one instruction. As described below, a GPU has 448 processing units which have their own instruction address counters so that they execute different sequences of instructions. This might be the biggest difference between CPU and GPU. GPU also has hierarchical structure based on its processor hierarchy. GPU employs three types of hierarchy called thread hierarchy, memory hierarchy, and scheduling hierarchy. It employs a unique processing method called SIMT (single-instruction, Multiple-Thread) on these hierarchical structures. Processor hierarchy is organized such that a GPU is composed of 14 streaming multiprocessors (SMs) consisting of 32 processing cores (PCs). GPU’s SM and PC correspond to CPU’s core and processing unit, respectively. The individual threads composing a warp start together at the same program address. They are free to branch and execute independently since they have their own instruction address counter and register state. Under the SIMT architecture, however, they are restricted to execute a common instruction at the same time because only one instruction interpreter is available per SM. This means that if they have M distinct instructions, these instructions are executed sequentially so that the speed up ratio is bounded to 32/M. This can be regarded as a kind of latency of instruction execution. This is called warp divergence and causes reduction of computational performance. Thread hierarchy basically corresponds to the processor hierarchy, which is composed of thread, warp, and thread block. A thread is defined as the minimum unit of execution, which is equal to a sequence of instructions implemented by a user. A warp is defined as a set of 32 threads concurrently executed within a SM. A thread block is defined as a set of threads assigned to a SM. Since one SM executes one warp concurrently, the number of threads in a thread block is usually preferred to be a multiple of the number of threads in a warp. Thread blocks are organized into a data structure called grid. A GPU can execute two or more grids concurrently. Memory hierarchy is composed of three types of memory, i.e., global memory, shared memory, and local mem- ory. In the memory hierarchy, a global memory on a GPU is shared by all SMs while a shared memory on a SM is shared by all PCs. Moreover, each PC has its own local memory. From the global memory to the local memory, the access speed increases while the amount of memory size decreases. The shared memory can be accessed several 10 times faster than the global memory. Explicit description of usage of the shared memory enables us to enhance the efficiency of memory access. One more remarkable feature in memory access must be mentioned. When some threads in a warp are concurrently accessing addresses which are located locally in memory space, the memory access is improved. This function is called coalescing access. The two-level distributed scheduler plays a great role to hide latencies caused by any instructions. At the chip level, a global work distribution scheduler assigns SMs to thread blocks. At the SM level, a dual warp scheduler in each SM distributes instructions in warps to its PCs. This hierarchical scheduling obtains highly effective load balancing among warps. However, it gives no contribution to reduce the warp divergence. SFUs execute transcendental instructions such as sin, cosine, reciprocal, and square root. Each SFU executes one instruction per thread, per clock. All threads in a warp must share only 4 SFUs. If all threads must execute distinct special functions at the same time, only 4 threads are allowed to execute their special functions by using SFUs while other 28 threads must wait for the releases of the SFUs. This causes the speed up ratio of parallel computation is limited to the number of SFUs. 3. A Practical Model of Particle in DEM NVIDIA’s sample code employs a simple model of the force acting on a particle. The force acting on the j-th particle caused by the collision of the k-th particle, FS is defined as following: (1) FS = k sp δ n + k da v + k sh v t + g where δ n , v , g is, respectively, displacement between two particles, velocity of a particle relative to the other one of a contact pair, and the gravitational acceleration. A suffix t and n denotes, respectively, the tangential and the normal component. The simple model is composed of spring force, damping force, sharing force and the gravity. All coefficients of RHS terms are constant. Although this model yields high computational performance of GPU, it is too simple to apply to practical simulations. One of the standard model described in many articles related to DEM are much more complicated than the simple model in Equation (1) [6]. It is composed of a contact force F and a contact torque T described in the following equations, T. Washizawa, Y. Nakahara (2) F = Ft + F n (3) T = ri (n × F t ) where Ft and F n are, respectively, the tangential and the normal component of the contact force defined as (4) Ft = − k t δ t − η v t , F n = − k n δ n − η v n where k , η and ri are the spring coefficient and the damping coefficient of particles and radius of the i-th particle, respectively. The tangential component of the contact force is adjusted if the following condition is satisfied, (5) Ft ← µ F n (Ft Ft ) , if Ft > µ Fn where µ is a coefficient of kinetic friction. The following equations give the definitions of the tangential component of velocity and the displacement between two particles, respectively: (6) v t = v − ( v ⋅ n ) n + ( ri ω i + r j ω j ) × n , δ t = δ t ,old − (δ t ,old ⋅ n ) n + v t ∆ t , (7) where ω , δ t ,old , n , ∆t are angular velocity, displacement between two particles at the previous time, a unit vector between two particles, and a time step respectively. The coefficients of the terms in RHS of Equation (4) is, respectively, defined as functions of the physical properties, k t := C k , t (i , j ) δ n k n := C k , n (i , j ) δ n η := α (i , j ) k n (m (r (r i −1 i ) ), −1 + r j− 1 , (8) −1 + r j−1 (9) i ) + m −j 1 , (10) where Ck (i, j ) , α (i, j ) , m j are spring parameter, restitution parameter, and mass of the j-th particle, respectively. Hereafter, we refer to all variables in above equations as particle properties. 4. Implementation NVIDIA's sample code has been tuned so well as to demonstrate the speed up ratio of over 40 than an ordinary CPU. This performance must be maintained through implementation of practical DEM code. The first step we decided to take is to replace the simple model in the sample code with the practical model in Equations (2) to (10). This implementation can be used as a reference of the lower bound of the DEM performance for the practical model on GPU. When we apply some approximations to speed up, we can evaluate the ratio of both the computing speed and the approximation error to those of the lower bound case. Another factor we have to determine in advance is a programming language. NVIDIA provides a 3 programming environment named CUDA (Compute Unified Device Architecture) [5] which is only available for NVIDIA GPUs. On the other hand, OpenCL has been proposed to platform-independent programming for GPUs. We choose OpenCL to implement the practical model because of its performance-portability [7]. NVIDIA provides sample codes for both languages. The practical model is also implemented in C++ for execution on CPU. Since the contact force is often arranged in practical applications, the comprehensive interface to add or delete a force term should be implemented. Object-oriented programming enables us to obtain such maintainability. The C++ implementation is a reference as the most maintainable case. 4.1. Allocation of Variables To detect particle collisions effectively, DEM simulation usually uses a collision detection grid (CDG). The CDG divides the whole computational space into small sub-regions called cell. Every particle is registered to a cell that occupies its location. It is guaranteed that all particles registered in a cell are close each other. Particles colliding with the j-th particle at the next time step can be found in either the cell containing the j-th particle or its neighbor cells. For example, the number of cells to be searched is 33 in 3-dimensional space. The candidates of colliding pairs decrease as the number of cells of the CDG increases because the number of particles in each cell reduces on average. Hence, the CDG much reduces the computational time to search colliding pairs. It should be noticed, however, that, if the size of the buffer of particles in a cell is greater than the cache memory size, the computational performance is considerably degraded. The number of cells should be selected by considering these factors. The sample code employs the CDG structure. Most straightforward way to manage particles in the CDG is to assign an array to each cell to register particles referred as “array-in-grid” [3]. Since this method is obviously memory consuming, improved methods have been proposed [3]. The sample code uses a correspondence map from particle to cell. The corresponding map CM is a 1D array set to be CM[j] = k when the j-th particle is inside the k-th cell. The number of entries of CM is equal to the number of particles. Locations of variables in memory space affect the computational performance. Variables located consequently in memory space can be uploaded once on high-speed accessed cache memory. If all variables needed for calculation of some value are uploaded on the cache memory at the same time, the minimum memory access time is needed. Otherwise, time-consuming memory access reduces the computational performance. 4 T. Washizaewa, Y. Nakahara The sample code has the process of sorting the particles along the correspondence map. By performing this process, a pair of particles close to each other in calculation space is also located to be close in memory space. It follows that a collision pair of particles is expected to be close in memory space so that they are uploaded simultaneously on cache memory when the contact force is calculated. The sample code uses the bitonic sort algorithm which could be the best for GPU. 4.2. Process Flow Both the NVIDIA’s simple model and the practical complicated one are obtained by executing along the same flow of operations except the calculations described in Equations (1) – (10). The process flow is shown below [8]: 1. Update the all particle properties. 2. Make the correspondence map from a particle to a cell. The correspondence map is contained in an integer array CM. CM[j] = k when the j-th particle is inside the k-th cell. 3. Sort the CM to get the sorted CM, SCM and the map from SCM to CM, SCCM. These arrays satisfy the following relationship: (11) SCM [ j ] = CM [ SCCM [ j ]] . 4. Reorder all the properties along SCM by bitonic sort. 5. Assign the i-th thread to the SCM[i]-th particle. 6. Collect the SCM[i]-th particle’s cell and its neighbor cells. If the particle’s cell is the (i,j,k)-th cell in 3D computational space, a set of these cells is {(l,m,n) | i −1≤ l ≤ i +1, j −1≤ m≤ j +1,k −1≤ n ≤ k +1} . (12) 7. Calculate the contact force between two particles in Equation (1) for the simple model, or Equations (2) to (10) for the practical model. 8. Calculate the contact force between particles and walls for the practical model. A wall can be modeled as a particle with the infinite value of radius. The difference between the simple model and the practical model is only the calculation of force in Step-7 and Step-8. Before the calculation of contact force in Step-7, collision detection is executed for any pair belonging to the cells collected in step-6. The same detection is performed for any pair of a particle and a wall in Step-8. This detection generates huge amount of load unbalance causing the reduction of computational performance. The practical model is implemented in OpenCL and C++ for GPU and CPU, respectively. The implementation in C++ on CPU is a kind of reference of the best code for maintainability for modifying the contact force composition. 5. Numerical Experiments Numerical experiments were conducted to compare the performances of the following four cases, the simple model coded in CUDA on GPU, the simple model coded in OpenCL on GPU, the practical model coded in OpenCL on GPU, and the practical model coded in C++ on CPU. First two cases have been provided by NVIDIA as sample codes. The remains are coded by the authors in OpenCL and C++, respectively. The first two cases are used to find the effect of the difference of programming language for the simple model. The second and third cases show the effect of the difference of the contact force model. The difference of the performance between GPU and CPU for the practical model is evaluated from the comparison of the last two cases. The first and the last case are, especially, regarded as references of the fastest and the most maintainable model, respectively. A sample problem simulates a time evolution of 217=131,072 particles with same radius which fall from a box on a floor through a slit at the bottom of the box. The time evolution is continued until displacements of all particles are less than a predetermined value. Specifications of CPU and GPU are shown in Table 1 and Table 2, respectively. Computing speed [particles/sec] of these four cases are shown in Table 3. The difference between first two cases from the top in Table 3 is only the programming languages used and has little effect on the computing speed. The effect of the difference of the contact force model on computing speed can be evaluated by comparing the second and third cases. The computing speed of the practical model on GPU is 7 times slower than the simple model on GPU. The effect of the difference of processor type and of programming language on computing speed can be also evaluated by comparing the third and fourth cases. The computing speed of the practical model on GPU is 6 times faster than the practical model on CPU. This concludes that the GPU computation is available in practical use even if a complicated practical model of contact force is employed. 6. Discussion Here we consider factors which effect on two cases, one is when the practical model on GPU has greater performance than that on CPU and the other is when the practical model on GPU is less performance than the simple model on GPU. Effects of factors to the computing speed are estimated under the assumption that all factors are independent to each other. The integrated effects of all factors evaluated as the product of all estimates under this assumption give the bounds for both cases. T. Washizawa, Y. Nakahara First, let us focus on the improvement of the computing speed by replacing CPU with GPU. See the first and the second rows from the bottom in Table 3. As described above, we can find that the practical model on GPU is 6 times faster than that on CPU. The following three factors mainly affect the improvement. First, a GPU has 448 PCs (14 SMs per GPU times 32 PCs per SM) which execute concurrently. If all threads execute instructions independently, the computing speed is expected to be increased by 448/(2.93/1.15)/4=44 (the number of PCs divided by the clock frequency ratio and by the number of processing units in one CPU-core). This astonishing improvement is the best case in which all pairs containing the neighbor cells in Equation (12) have collisions. This case, however, can be seldom seen in practice. As the opposite limit, consider case when, among all threads in a grid, only one thread needs to calculate the contact force while the particles assigned to the other threads have no collisions. This is obviously the worst case when the computing speed is same as CPU. All practical cases are located between these two cases. It can be said that the probabilities of collisions of any pairs increase as the density of particles increases. In the application used for our benchmark, particles are located so densely that most particles are expected to have collisions with their closest particles. The effect of this kind of warp divergence can be evaluated. A thread calculates the contact force acting on a particle after detecting the collision with other particles in the collection of 27 cells described in Equation (12). Warp divergence in this case is generated by the difference of the number of particles being checked and by the necessity of contact force calculation for each pair. If all particles have the same diameter d , the number of particles closest packed into a cell is given as 2 Lx L y Lz Lx Ly Lx (13) = d 3d 2 2 / 3d d3 where L x , L y , and L z are the length of edges of a ( ) cell along x-, y-, and z-axis, respectively. In the NVIDIA’s sample code, all lengths of edges are set to be equal to the diameter of a particle. This reduces Equation (13) to 2 . The maximum number of particles being checked is, therefore, 27 times 2 , or about 47. On the other hand, the maximum number of particles collided with one particle simultaneously can be evaluated to be 12. Hence, in case of densely distributed particles, a particle is collided with about a quarter of all particles contained in a cell. This means a thread is idle for three quarters of whole computing time. Since the collided pairs of each particle probably be different from others, all threads must perform the contact force calculation for Table 1. specification of CPU. 5 Specification Model name Intel®Xeon®CPU X5670 Clock frequency 2.93GHz Cache CPU: L1 I cache, 32K, L1 D cache; 32K CPU: L2 cache, 256K CPU L3 cache, 12288K Table 2. specification of GPU. Specification Model name C2050 (Fermi) Number of multiprocessors 14 Total number of threads 448 Clock frequency of processing cores 1.15GHz Maximum band width 144 GB/s Peak performance of Double Precision(FMA) 515.2 GFLOPs Table 3. Comparison of the computing speed of four cases. Computational model Programming language Processor type Computing speed 103[particles/sec] NVIDIA’s simple model CUDA GPU 22,359 OpenCL GPU 21,266 OpenCL GPU 2,960 C++ CPU 474 Practical model all pairs regardless of their validity under the SIMT architecture. The warp divergence in this case makes the computing speed 4 times slower. Notice that the reduction rate would be up to 47 when only one pair has a collision. It should be also noticed that the total number of particles in a cell effects on warp divergence strongly. When the computing time of the contact force calculation is much larger than that of the CDG registration, the cell size in the NVIDIA’s sample code must be the best choice. This is because all the collided particles should be found in the neighbor cells and the ratio of the collided particles to the total ones in a cell is expected to be large. Second, a large amount of threads increases the effective memory access speed. The two-level distributed scheduler arranges uncompleted threads so that the total amount of idol time of all threads would be minimized. If this scheduling works perfect, the latencies caused by the conflicts of memory access and of SFU operations are completely hidden. Third, coalescing access increases the memory access speed. In our implementation, all particle properties are reordered according to the locations of particles. Variables used for calculating the contact forces are, therefore, located locally in memory space. This enables coalescing memory access. T. Washizaewa, Y. Nakahara 6 Next, the reduction of computing speed by replacing the simple model with the practical one is considered. See the second and the third rows from the top in Table 3. We can find that the practical model on GPU is 7 times slower than the simple model on GPU. The major causes of this reduction are the following three factors. First, increment of the amount of computation of the contact force proportionally increases the computing time. Second, increment of the number of if-branches increases the warp divergence. N-layered nested branches generate 2N paths. Since the different paths must be executed sequentially, the computational time increases proportionally to the number of paths. Third, usage of the SFUs causes the pause of operations. If all 32 threads in a warp must calculate special functions at the same time, requests from only 4 threads are accepted and the remaining 28 threads must wait for the releases of SFUs. In this case, the computing speed reduces by at most 8 times than those without using the SFUs. The practical model indeed includes square root functions in Equations (8) to (10), which request to use the SFU twice every calculation of the contact force of a particle. 7. Conclusions We reported the computational performance of GPU for practical DEM computation by comparison with CPU. Since the model of contact force in NVIDIA’s sample code is too simple to evaluate the practical performance, the simple model was replaced with a practical model used in many DEM simulations. The computing speed of the practical model on GPU obtains 6 times faster than that on single core CPU while 7 times slower than the NVIDIA’s simple model on GPU. Because of no approximation and no special tricks in our code, this computing speed is regarded as the lower bound of DEM simulation on GPU. The effects of the GPU architectures on the computing speed were analyzed for the further improvement. Especially, branch divergence among threads in a warp caused by the branches in contact force calculation was discussed. REFERENCES [1] http://www.nvidia.com [2] http://www.nvidia.com/object/gpu-applications.html [3] Y. Shigeto, M. Sakai, “Parallel computing of discrete element method on multi-core processors,” Particuology, 9, pp.398-405, 2011. [4] D. Nishiura, H. Sakaguchi, “Parallel-vector algorithms for particle simulations on shared-memory multiprocessors,” Journal of Computational Physics, 230, pp.1923-1938, 2011. [5] NVIDIA, NVIDIA CUDATM Programming Version 3.0, NVIDIA Corporation, 2010. [6] M. Sakai, “Numerical simulation of granular flows,” pp.17-40, Maruzen Co. Ltd., Tokyo, 2012 (in Japanese) [7] P. Du, R. Weber, P. Luszczek, S. Tomov, G. Peterson, J. Dongarra, “From CUDA to OpenCL: Towards a performance-portable solution for multi-platform GPU programming,” Parallel Computing, 38, pp.391-407, 2012. [8] Y. Nakahara and T. Washizawa, “Obstacles for Applying Discrete Element Method to GPU,” Proceedings of the JSIAM2012, Wakkanai, Japan, August 2012. (in Japanese) Guide
5cs.CE
End-to-end Training for Whole Image Breast Cancer Diagnosis using An All Convolutional Design Li Shen Icahn School of Medicine at Mount Sinai New York, NY 10029 [email protected], [email protected] Abstract We develop an end-to-end training algorithm for whole-image breast cancer diagnosis based on mammograms. It requires lesion annotations only at the first stage of training. After that, a whole image classifier can be trained using only image level labels. This greatly reduced the reliance on lesion annotations. Our approach is implemented using an all convolutional design that is simple yet provides superior performance in comparison with the previous methods. On DDSM, our best single-model achieves a per-image AUC score of 0.88 and three-model averaging increases the score to 0.91. On INbreast, our best single-model achieves a per-image AUC score of 0.96. Using DDSM as benchmark, our models compare favorably with the current state-of-the-art. We also demonstrate that a whole image model trained on DDSM can be easily transferred to INbreast without using its lesion annotations and using only a small amount of training data. Code and model availability: https://github.com/lishen/end2end-all-conv Key Insights • • • • 1 A patch classification network can be converted into an end-to-end trainable whole image network by modifying the input size and adding top layers. The heatmap layer generated by the patch classifier’s output creates an information bottleneck in the whole image network and shall be removed to improve performance. The patch classifier is critical to the performance of the whole image classifier. All convolutional design is superior to a mix of convolutional and fully connected layers. Introduction With the rapid advancement in machine learning and especially, deep learning in recent years, there is a keen interest in the medical imaging community to apply these techniques to cancer screening. Recently, a group of researchers, along with the Sage Bionetworks and the DREAM community organized a challenge for competing teams to develop algorithms to improve breast cancer diagnosis using a large database of digital mammograms (DM) [1]. The main purpose of the challenge is to predict the probability that a patient will develop cancers within 12 months based on mammographic images. We also participated in the challenge [2] and obtained a receiver operating characteristic curve (AUC) score of 0.65, which ranked #12 on the leaderboard [3]. However, much can still be done to further improve the result. Mammography based breast cancer diagnosis is a challenging problem that cannot be simply treated as a normal image classification task. That is because the cancerous status of a whole image is determined by a few small regions that need to be identified. For example, a mammogram is typically in the size of 4000x3000 (height by width) pixels while the cancerous lesion or the region of interest (ROI) can be as small as 100x100 pixels. Resizing a large mammogram to 224x224 – a common choice used by the image classification filed – will likely make the ROI hard to detect and/or classify. If a mammographic database comes with the ROI annotations for all images, then the diagnostic problem can be conveniently solved as an 1 object detection and classification problem that has already been well studied in the computer vision field. For example, the region-based convolutional neural network (R-CNN) approach [4] and its variants [5]–[7] can be applied here. Many of the published works [8]–[17] assume the databases under study are fully annotated with ROIs, thus the developed models cannot be transferred to another database that lacks ROI annotations. It is unrealistic to require all databases to be fully annotated due to the time and monetary costs to obtain ROI annotations, which require expertise from radiologists. For a survey of the public databases, see [18]. If we want to build a breast cancer diagnostic system for production, we will have to consider the situation where a few datasets are annotated with ROIs while most datasets are only annotated at whole image level. That is exactly the situation that the participants faced at the DM challenge [1] during the competitive phase. Participants were allowed to use any public databases to develop their models. However, the DM challenge database itself does not contain ROI annotations. Although the DM challenge boasts a large database with more than 640,000 images from over 86,000 women, its dataset is highly imbalanced: with only 2000 or so positive cases in the public train set, which significantly reduces the effective sample size. Therefore, directly training a classification model on such a dataset from scratch is unlikely to give good performance. In this study, we propose an approach that utilizes a fully annotated database to train a model to recognize localized patches. After that, the model can be converted into a whole image classifier, which can be trained end-to-end without ROI annotations. The approach is based on an idea that we independently formed (see discussion in [2]) during the final stage of the DM competition, which we did not have time to implement before the competition ended. Our original entry [2] to the DM challenge used a patch classification network, built on a fully annotated public database, to predict for all the overlapping patches of a mammogram to generate a so called heatmap. A random forest classifier is then used on top of the heatmap to produce the final label. However, we observed a significant performance drop when we applied the model to the DM challenge data because the patch classifier was developed on a public database that contains a different color profile from the challenge data. It was difficult to transfer the patch classifier onto the challenge data since it does not have ROI annotations. While the whole image classifier is not end-to-end trainable because it involves a sliding window step. We later realized that end-to-end training can be achieved by using the convolutional property to change the input size from patch to whole image, create larger feature maps, and then add additional convolutional layers on top to produce the final labels. Surprisingly, we found that a similar idea was employed by the top-performing team [19] after the final results came out. Encouraged by their success, we want to continue to investigate this line of methods. We propose an all convolutional design to construct the whole image classifier by simply stacking convolutional blocks on top of the patch classifier, which provides very competitive results. We also present a pipeline to build a whole image classifier from scratch and discuss the pros and cons of some important choices. Notice that our method is somewhat related to two recent publications [20], [21] in breast cancer diagnosis. They both claim to be an implementation of multi-instance learning (MIL) and use modified cost functions to satisfy the MIL criterion. Both studies develop whole image models that can be end-to-end trained but they completely ignore the existence of ROI annotations in databases and train models using only image level labels. It seems they focus more on the top layers to summarize predictions from local patches than the patch classifiers to make accurate predictions. However, we will show that the patch classifier is critical to the performance of the whole image classifier. The manuscript is organized as follows. In Section 2, we present our method to convert from a patch classifier to a whole image classifier and the network training algorithm. Section 3 has two parts. In Section 3.1, we will develop whole image classifiers from scratch and evaluate them on a public database that has ROI annotations. In Section 3.2, we will transfer the whole image models developed in Section 3.1 to another database using only image level labels. In Section 4, we provide some discussion of the results and future works. We hope, by virtue of this study, we can provide further insights into this promising method for whole image classification for the medical imaging community. 2 Methods 2.1 Converting a classifier from recognizing patches to whole images To perform classification or segmentation on large, complex images, a commonly used approach is to first develop a classifier to recognize smaller patches, and then use the classifier to scan the whole image using a sliding window. For example, this approach has been exploited to win the competition in automated detection of metastatic breast cancer [22] and to segment neuronal membranes in microscopic images [23]. However, here we want to utilize a patch classifier to initialize the weights of a whole image classification network so 2 Figure 1: The deep learning structure for converting a patch classifier into a whole image classifier by adding convolutional layers on top. Shown is an example using two residual blocks with the same structure of [512-512-1024] x 2. Two alternative strategies are also presented: one is to add heatmaps and FC layers on top and the other is to add a random forest classifier on top of the heatmap. that the latter can be trained without ROI annotations. In other words, we want the whole image classifier to be finetuned in an end-to-end fashion without the explicit reliance on a patch image set. This may not seem to be obvious on the surface but can actually be achieved by exploiting the properties of a convolutional neural network (CNN). The key idea of a CNN is to learn a set of filters with small sizes and apply them to a much larger input by using weight sharing, which greatly reduces the number of parameters to learn. Each time a new convolutional layer is added to the network, the top most layer effectively uses all previous layers to construct a set of new filters that perform more complex transformations (and also have larger effective receptive fields) than its precursors. By this reasoning, we can add on top of a patch classification network a new convolutional layer and turns the patch network itself into part of the new filters of the top layer. Although the patch network is trained to recognize patches, the properties of convolution allow us to change the input from patches to whole images. And by doing this modification, a convolutional operation in the top layer becomes equivalent to applying the patch classifier on all patches of the whole image in one forward propagation and then apply the convolutional operation on the patch classifier’s outputs. Indeed, we can design any kind of operations on top of the patch classifier’s output and eventually connect them with image level labels. For an illustration of this method, see Fig. 1. Notice that variable input size is a feature that is supported by most major deep learning frameworks [24]–[27] and therefore can be easily implemented. The advantage of this method is that we now have a network that takes whole images as input and image level labels as output, cutting the need for a patch image set. This training method can find many applications in medical imaging. Use breast cancer diagnosis as an example. Databases with ROI annotations are rare and expensive to obtain. The largest public database for mammograms – The Digital Database for Screening Mammography (DDSM) [28] – contains thousands of images with pixel-level annotations, which can be exploited to construct a meaningful patch classifier. Once the patch classifier is converted into a whole image classifier, it can be finetuned on another database using only whole image level labels. This way we can significantly reduce the requirement for ROI annotations. 2.2 Network structures for top layers For patch classification, we can use any networks – such as the 16-layer VGG networks (VGG16) [29] and the 50-layer residual networks (Resnet50) [30] – that are already proven to be excellent for image 3 classifications. Therefore, we want to focus more on the structure of the top layers in this study. We propose an all convolutional design that makes no use of the fully connected (FC) layers. Briefly, we first remove the last few layers of a patch network until the last convolutional layer. We then add convolutional layers, such as the residual and VGG blocks, on top of the last convolutional layer so that the feature map reaches a proper size. Lastly, we add a global average pooling layer and an output to complete the network. Notice that we deliberately discard the output layer of the patch network. That is because the patch classifier typically has a small output, which may create an “information bottleneck” that prevents the top layers from fully utilizing the information provided by the patch network. To understand it better, let’s use Resnet50 as an example. Assume it is trained to recognize a patch into one of the five categories of: background, malignant mass, benign mass, malignant calcification and benign calcification. Its last convolutional layer has a dimension of 2048. If we add a residual block of dimension of 512 after the patch classifier’s output, it creates a bottleneck structure of “2048-5-512” in-between the patch network and the top layers. While a network without the patch classifier’s output will have a structure of “2048-512”, allowing the top layers to use more information from the patch network. In contrast to our approach, the top performing team of the DM challenge utilizes the patch classifier’s output layer to construct a so called heatmap to represent the likelihood of a patch on an input image being one of the five categories [19]. In the first version of this manuscript, we mistakenly used softmax activation on this heatmap to generate a probabilistic output for the top layers. This nonlinear transformation would certainly impede gradients flow. After confirming with the top performing team (personal communications), we remove the softmax activation from the heatmap to construct networks similar to theirs. However, as we implement the whole image classifiers, we find the totally inactivated heatmap may cause the top layers to be badly initialized, leading to divergence. We hypothesize that is because the fully unbounded values can make the top layers saturate too early. Therefore, we use relu (which truncates the negative values) on the heatmaps instead in this study and find the convergence to improve. Another important difference between our method and the top performing team’s method is the use of FC layers. We argue that FC layers are a poor fit for image recognition because they require a convolutional layer’s output to be flattened, which eliminates all the spatial information. Our design is fully convolutional and preserves spatial information at every stage of the network. We will compare the two different strategies in the following sections. 2.3 Network training There are two parts in training a whole image classifier from scratch. The first part is to train a patch classification network. We compare the networks that have their weights pretrained on the ImageNet [31] database with randomly initialized ones. Pretraining may help in speedup learning as well as improving generalization of the networks. For a pretrained network, notice that the bottom layers represent primitive features that tend to be invariant across datasets. While the top layers represent higher representations that are more related to the final labels and therefore need to be trained more aggressively. This demands a higher learning rate for the top layers than the bottom layers. However, layer-wise learning rate adjustment is not available in Keras [24] – the deep learning framework that we use for this work. Therefore, we develop a 3stage training strategy that freeze the parameter learning for all layers except the last one and progressively unfreeze the parameter learning from top to bottom and decrease the learning rate at the same time. The details of this training strategy is as follows: 1. 2. 3. Set learning rate to 1e-3 and train the last layer for 3 epochs. Set learning rate to 1e-4, unfreeze the top layers and train for 10 epochs, where the top layer number is set to 46 for Resnet50, 11 for VGG16 and 13 for VGG19. Set learning rate to 1e-5, unfreeze all layers and train for 37 epochs. In the above, an epoch is defined as a sweep through the train set. The total number of epochs is 50 and early stopping (set to 10 epochs) is used if training does not improve the validation loss. For randomly initialized networks, we use a learning rate of 1e-3. Adam [32] is used as the optimizer and the batch size is set to 32. We also adjust the sample weights within a batch to keep the classes balanced. The second part is to create and train a whole image classifier from the patch classifier. It is done by first altering the input size from patch to whole image, which proportionally increases the feature map size for every convolutional layer. In this study, we fix the patch size to be 224x224 and the whole image size to be 1152x896. Use Resnet50 as an example. For the patch network, the last convolutional layer has a feature map of size 7x7. While for the whole image network, the same layer’s feature map size becomes 36x28. In our all convolutional design, we add on top two additional residual blocks each with a stride of 2 to reduce the feature map size to 9x7 before the global average pooling and softmax output. Alternatively, 7x7 average pooling can be applied to the convolutional layer to produce a feature map of size 30x22. The weight matrix 4 of the output layer of the patch network can then be copied and applied onto this feature map to generate the heatmap (the same size of 30x22) but here we replace the softmax with relu to facilitate gradients flow. Similar to what the top performing team did [19], the heatmap (after max pooling) is first flattened and then two FC layers and a shortcut connection are added on top before output. Similar to the patch network training, we also develop a 2-stage training strategy to avoid unlearning the important features at the patch network. After some trial-and-errors, we decide to use smaller learning rates than usual to prevent the training from diverging. The details of the 2-stage training are as follows: 1. 2. Set learning rate to 1e-4, weight decay to 0.001 and train the newly added top layers for 30 epochs. Set learning rate to 1e-6, weight decay to 0.01 and train all layers for 20 epochs. Due to memory constraint, we use a small batch size of 2 for whole image training. The other parameters are the same as the patch classifier training. To make it easier to convert a patch classifier into a whole image classifier, we calculate the pixel-wise mean for the mammograms on the train set and use this value for pixel-wise mean centering for both patch and whole image training. No other preprocessing is applied. To compensate for the lack of sample size, we use the same data augmentation on-the-fly for both patch and whole image training. The followings are the random image transformations we use: horizontal and vertical flips, rotation in [-25, 25] degrees, shear in [0.2, 0.2] radians, zoom in [0.8, 1.2] ratio and channel shift in [-20, 20] pixel values. 3 Results 3.1 Developing patch and whole image classifiers on DDSM 3.1.1 Setup and processing of the dataset The DDSM [28] contains digitized images from scanned films but uses a lossless-JPEG format that is obsolete. We use a modernized version of the database called CBIS-DDSM [33] which contains images that have already been converted into the standard DICOM format. Our downloaded dataset on Mar 21, 2017 from CBIS-DDSM’s website contains the data for 1249 patients or 2584 mammograms, which represents a subset of the original DDSM database. It includes the cranial cardo (CC) and media lateral oblique (MLO) views for most of the screened breasts. Using both views for prediction shall provide better result than using each view separately. However, we will treat each view as a standalone image in this study due to the limitation in sample size. Our purpose is to predict the malignancy status for an entire mammogram. We perform an 85-15 split on the dataset into train and test sets based on the patients. For the train set, we further set aside 10% of the patients as the validation set. The splits are done in a stratified fashion so that the positive and negative patients have the same proportions in the train, validation and test sets. The total numbers of images in the train, validation and test sets are: 1903, 199 and 376, respectively. The DDSM database contains the pixel-level annotation for the ROIs and their pathology confirmed labeling: benign or malignant. It further contains the type of each ROI, such as calcification or mass. Most mammograms contain only one ROI while a small portion contain more than one ROIs. We first convert all mammograms into PNG format and resize them into 1152x896. We then create several patch image sets by sampling image patches from ROIs and background regions. All patches have the same size of 224x224. The first dataset (referred to as S1) is from patches that are centered on each ROI and a random background patch from the same mammogram. The second dataset (S10) is from 10 sampled patches around each ROI with a minimum overlapping ratio of 0.9 and the same number of background patches from the same mammogram. The third dataset (S30) is created the same way as S10 but we increase the number of patches to 30 for both ROI and background per mammogram. According to the annotations of the ROIs, all patches are classified into five different categories: background, calcification-benign, calcification-malignant, mass-benign and mass-malignant. 3.1.2 Development of patch classifiers To train a network to classify a patch into the five categories, we use three popular convolutional network structures: the Resnet50 [30] and the VGG16 and VGG19 [29]. We train the networks on the S10 and S30 sets using the 3-stage training strategy for 50 epochs in total. On the S1 set, we increase the total number of epochs to 200 and adjust the numbers for each training stage accordingly. We evaluate the models using test accuracy of the five classes. The results are summarized in Table 1. On the S1 set, both randomly initialized and pretrained Resnet50 models achieve very high accuracies but the pretrained network converges much faster: cutting down the number of epochs by half. Notice that the S1 set is intrinsically easier to classify than 5 Table 1: Test accuracy of the patch classifiers using the Resnet50, VGG16, and VGG19. #Epochs indicates the epoch when the best validation accuracy has been reached. Model Resnet50 Resnet50 Resnet50 Resnet50 VGG16 VGG19 Resnet50 VGG16 VGG19 Pretrained N Y N Y Y Y Y Y Y Patch set S1 S1 S10 S10 S10 S10 S30 S30 S30 Accuracy 0.97 0.99 0.63 0.89 0.84 0.79 0.91 0.86 0.89 #Epochs 198 99 24 39 25 15 23 22 24 the S10 and S30 sets. On the S10 set, the pretrained Resnet50 performs much better than the randomly initialized Resnet50: a 0.26 difference in test accuracy. We therefore conclude that pretraining can help us train networks faster and produce better models. We use pretrained networks for the rest of the study. On both S10 and S30 sets, Resnet50 outperforms VGG16 and VGG19. VGG16 performs better than VGG19 on the S10 dataset but the order is reversed on the S30 set. 3.1.3 Converting patch to whole image classifiers We now convert the patch classifiers into whole image classifiers by testing many different configurations for the top layers. We evaluate different models using the per-image AUC scores on the test set. We first test the conversion based on the Resnet50 patch classifiers. The results are summarized in Table 2. Notice that in the original residual network design [30], the authors increased the dimension for each residual block from the previous block by two times to compensate for the reduction in feature map size. This avoids creating “bottlenecks” in computation. However, we are not able to do the same here due to memory constraint. In our first test, we use two residual blocks with the same dimension and a bottleneck design (see [30]) of [512-5122048] without repeating the residual units. This gives an AUC score of 0.85 for the Resnet50 trained on the S10 set and 0.63 for the Resnet50 trained on the S1 set, a large 0.22 discrepancy in score. We hypothesize that since the S10 set is 10x larger than the S1 set, it contains much more information about the variations of benign and malignant ROIs and their neighborhood regions. This information helps a lot in training a whole image classifier to locate and classify cancer-related regions for diagnosis. We then focus only on patch classifiers trained on the S10 and S30 sets for the rest of the study. We further vary the design of the residual blocks by reducing the dimension of the last layer in each residual unit to 1024, which allows us to repeat each residual unit twice without exceeding memory constraint, i.e. two [512-512-1024]x2 blocks. This design slightly increases the score to 0.86. We also reduce the dimensions of the first and second blocks and find the scores to drop by only 0.02-0.03. Therefore, we conclude that the dimensions for the newly added residual blocks are not critical to the performance of the whole image classifiers. We then test the conversion based on the VGG16 patch classifier trained on the S10 set. The newly added VGG blocks all use 3x3 convolutions with batch normalization (BN). The results are summarized in Table 3. We find that the VGG structure is more likely to suffer from overfitting than the residual structure. However, this can be alleviated by reducing the model complexity of the newly added VGG blocks. To illustrate this, we plot the train and validation losses for two VGG configurations during training (Fig. 2): one is two VGG blocks with the same dimensions of 512 and 3x repetitions and the other has the same dimensions but no repetition; the first VGG structure contains more convolutional layers and therefore has higher complexity than the second one. It can be seen that the first VGG network has difficulty in identifying a good local minimum and suffers badly from overfitting. While the second VGG network has smoother loss curves and smaller differences between train and validation losses. We further reduce the dimensions of the VGG blocks and find the scores to decrease by only a small margin. This is in line with the results on the Resnet50 based models. Overall, the Resnet50 based whole image classifiers perform better than the VGG16 based ones (Tables 2 & 3). In addition, the Resnet50 based models seem to achieve the best validation score earlier than the VGG16 based models. To understand whether this performance difference is caused by the patch network on the bottom or the newly added top layers, we add two residual blocks on top of the VGG16 patch network to create a “hybrid” model. It gives a score of 0.81, which is in line with the VGG16 based networks but a few points below the best Resnet50 based models. This suggests the patch network part is more important 6 Table 2: Per-image test AUC scores of the whole image classifiers using the Resnet50 as patch classifiers. #Epochs indicates the epoch when the best validation score has been reached. → indicates score change from using softmax to relu on heatmaps. Patch set S1 S10 S10 S10 S10 S10 S30 S30 Block1 S10 S10 [512-512-1024] x 2 [64-64-256] x 2 S10 S10 S10 Heatmap pool size 5x5 2x2 1x1 S10 [512-512-2048] x 1 [512-512-2048] x 1 [512-512-1024] x 2 [256-256-256] x 1 [256-256-256] x 3 [256-256-512] x 3 [512-512-1024] x 2 [256-256-256] x 1 Add residual blocks on top Block2 Single-model AUC [512-512-2048] x 1 0.63 [512-512-2048] x 1 0.85 [512-512-1024] x 2 0.86 [128-128-128] x 1 0.84 [128-128-128] x 3 0.83 [128-128-256] x 3 0.84 [512-512-1024] x 2 0.81 [128-128-128] x 1 0.84 Add heatmap and residual blocks on top [512-512-1024] x 2 0.80 [128-128-512] x 2 0.81 Add heatmap and FC layers on top FC1 FC2 Augmented AUC NA NA 0.88 NA NA NA NA NA #Epochs NA NA 47 41 64 32 NA 0.67→0.73 512 256 NA 0.68→0.72 2048 1024 NA 0.74→0.65 Probabilistic heatmap + random forest classifier #trees=500, max depth=9, min samples 0.73 NA split=300 35 20 25 25 17 48 49 40 28 47 43 Table 3: Per-image test AUC scores of the whole image classifiers using the VGG16 (S10) and VGG19 (S30) as patch classifiers. #Epochs indicates the epoch when the best validation score has been reached. → indicates score change from using softmax to relu on heatmaps. Add VGG blocks on top (* is residual block) Patch Block1 Block2 Single-model Augmented set AUC AUC S10 512 x 3 512 x 3 0.71 NA S10 512 x 1 512 x 1 0.83 0.86 S10 256 x 3 128 x 3 0.78 NA S10 256 x 1 128 x 1 0.80 NA S10 128 x 1 64 x 1 0.82 NA S10 *[512-512-1024] x 2 *[512-512-1024] x 2 0.81, 0.851 0.881 S30 512 x 1 512 x 1 0.75 NA S30 128 x 1 64 x 1 0.75 NA Add heatmap and FC layers on top Heatmap pool size FC1 FC2 S10 5x5 64 32 NA 0.66→0.71 S10 2x2 512 256 NA 0.71→0.68 S10 1x1 2048 1024 NA 0.78→0.69 1 Result obtained from extended model training (See text for more details). than the top layers to whole image classification performance. 7 #Epochs 47 44 30 35 46 46 15 1 26 27 50 Figure 2: Train and validation loss curves of two VGG structures: one is more complex than the other and suffers from overfitting. Encouraged by the performance leap going from the S1 to the S10 set, we choose two residual configurations and two VGG configurations and add them on top of the Resnet50 and the VGG19 patch classifiers trained on the S30 set, respectively. We expect to obtain even further performance gains. Surprisingly, the performance decreases for both Resnet50 and VGG19 based models (Tables 2 & 3). Indeed, overfitting happens for the VGG19 based model training at early stage and the validation loss stops improving further. It is clear that a good patch classifier is critical to the performance of a whole image classifier. However, merely increasing the number of sampled patches does not necessarily lead to better whole image classifiers. We leave to future work to study how to sample patches more efficiently and effectively to help building better image classifiers. We now test the configurations that are inspired by the top performing team [19]: add a heatmap followed by two FC layers and a shortcut connection on top of the patch classifier (Fig. 1). We use the Resnet50 and VGG16 patch classifiers trained on the S10 set. We choose from a few different filter sizes for the max pooling layer after the heatmap and adjust FC layer sizes accordingly so that it gradually decreases the layer size until output. We also add a shortcut between the flattened heatmap and the output, implemented by an FC layer. The results are summarized in Tables 2 & 3. In the first version of the manuscript, we used heatmaps with softmax activation to generate probabilistic outputs and we found the max pooling layer to be destructive to the heatmap features and therefore harm the scores. In this version, we use relu on heatmaps instead and find the trend to be almost reversed: more pooling leads to better score. This could be related to the difficulty in training when heatmap and FC layers are used. Overall, the performance scores of the two different activations are on par with each other. Therefore, the heatmap activation is not critical to the whole image classifier’s performance. Obviously, image classifiers from this design underperform the ones from the all convolutional design. Notice that this implementation is not an exact replicate of the work in [19]. They have used a modified VGG network by using 6 instead of 5 VGG blocks. Their design is more like a hybrid of the two designs compared here by using an additional convolutional block followed by FC layers. We also want to find out whether the heatmaps are of any use or simply create a bottleneck between the patch network and the top layers. We add a heatmap (with relu) on top of the Resnet50 patch classifier and then add two residual blocks with [512-512-1024]x2 design. This network gives a score of 0.80 (Table 2), which is lower than the same design without the heatmap. To exclude the possibility that the top residual blocks may be overfit due to the small heatmap as input, we also add two residual blocks with reduced size: [64-64256]x2 and [128-128-512]x2 on top of the heatmap, which slightly improves the score to 0.81. We conclude that heatmaps shall be removed to facilitate information flow in training whole image networks. Finally, we test the same strategy as [2], [22]: set a cutoff to binarize the heatmaps; extract regional features; and train a random forest classifier based on the features (Fig. 1). The Resnet50 trained on the S10 set is used here as the patch classifier. For heatmaps, we use softmax to obtain probabilistic outputs to help setting cutoffs. We use four different cutoffs – 0.3, 0.5, 0.7, 0.9 and combine the features. We use a random forest 8 Figure 3: Comparison of two example mammograms from DDSM and INbreast. classifier with 500 trees. This gives a test score of 0.73 (Table 2), which seems to be in line with our score of 0.65 in the DM challenge. There are two major reasons for the increase of the score in this study: 1. the patch classifier in this study has been given more training time and produces better accuracy; 2. the train and test sets are both from the same database. Clearly, this method performs worse than the end-to-end trained all convolutional networks. 3.1.4 Augmented prediction and model averaging We pick a few models and use inference-level augmentation by doing horizontal and vertical flips to create four predictions per model and take an average. Three best performing models: Resnet50 with two [512-512-1024]x2 residual blocks, VGG16 with two 512x1 VGG blocks and VGG16 with two [512-512-1024]x2 residual blocks on top (hybrid) are selected. We perform extended training on the hybrid model and improve the single-model AUC score to 0.85. The reason of doing that will be explained in section 3.2.2. The augmented predictions for the three models improve the AUC scores from 0.86→0.88, 0.83→0.86 and 0.85→0.88, respectively (Tables 2 & 3). The average of the three augmented predictions gives an AUC score of 0.91. Notice that in [3], they created four network models each with augmented predictions and predicted for both CC and MLO views for each breast and took an average of all predictions, which is more aggressive than the model averaging used in this study. We deliberately avoid doing too much model averaging so that we can better understand the pros and cons of different network structures. 3.2 Transfer learning for whole image classification on INbreast 3.2.1 Setup and processing of the dataset Once a whole image classifier has been developed, we can finetune it on another database without using ROI annotations. This is a key advantage offered by an end-to-end trained classifier. The INbreast [18] dataset is another public database for mammograms. It is more recent than the DDSM and contains full-field digital images as opposed to digitized images from films. These images have different color profiles from the images of DDSM, which can be visually confirmed by looking at two example images from the two databases (Fig. 3). Therefore, this is an excellent source to test the transferability of a whole image classifier from one database to another. The INbreast database contains 115 patients and 410 mammograms including both CC and MLO views. We will treat the two views as separate samples due to sample size limitation. It includes the BI-RADS readings for the images but lacks biopsy confirmation. Therefore, we manually assign all images with BI-RADS readings of 1 and 2 as negative samples; 4, 5 and 6 as positive samples; and ignore BI-RADS readings of 3 since it has no clear designation of negative or positive class. This excludes 12 patients or 23 mammograms from further analysis. Notice that the categorization based on the BI-RADS readings makes the INbreast dataset inherently easier to classify than the DDSM dataset. This is because two mammograms with different BI-RADS readings are already visually discernible according to radiologists, which biases the labeling. We perform a 70-30 split on the dataset into train and validation sets based on the patients in a stratified fashion. The total numbers of images in the train and validation sets are 280 and 107, respectively. We use exactly the same processing steps on the INbreast images as the DDSM images. 3.2.2 Effectiveness and efficiency of transfer learning 9 Table 4: Transfer learning efficiency with different train set sizes. Shown are per-image validation AUC scores. #Patients #Images Resnet50 VGG16 20 30 40 50 60 79 117 159 199 239 0.78 0.78 0.82 0.80 0.84 0.87 0.90 0.90 0.93 0.95 VGG-Resnet Hybrid 0.89 0.90 0.93 0.93 0.91 Although the INbreast database contains ROI annotations, we simply ignore them to test the transferability of a whole image classifier. We directly finetune the whole image networks on the train set and evaluate the model performance using per-image validation AUC scores. Two best models – the Resnet50 + two [512-512-1024]x2 residual blocks and the VGG16 + two 512x1 VGG blocks – are used for transfer learning. We use Adam [32] as the optimizer and set the learning rate at 1e-6; the number of epochs at 200 and the weight decay to be 0.01. The finetuned Resnet50 based model achieves a score of 0.84. Surprisingly, the finetuned VGG16 based model achieves a score of 0.92, better than the Resnet50 based models. Yaroslav argued in [19] that the VGG structure is better suited than the residual structure for whole image classification because the residual networks reduce the feature map sizes too aggressively to damage the ROI features at the first few layers. Based on this, the underperformance of the Resnet50 based models is likely due to the few bottom most layers, not the top residual blocks. To validate that, we use the hybrid model, which has the VGG16 patch classifier at the bottom and two residual blocks on top, to finetune on the INbreast dataset. This hybrid model achieves a very high score of 0.95, which proves the point. However, if the VGG structure is indeed better than the residual structure as the bottom layers, how does Resnet50 beat VGG16/19 on the DDSM data? We reason that is because the VGG networks need to be trained longer than the residual networks to reach their full potentials. This is in line with the observation that the VGG16 based whole image classifiers achieve the best validation scores on DDSM at later stage than the Resnet50 based ones (Tables 2 & 3). Our choice of 50 epochs on DDSM is mainly driven by computational resource limitation. Since the residual networks are powered by BN and shortcuts to speed up training, they are able to converge better than the VGG networks within the same 50 epochs. To prove that, we perform another run of model training for the hybrid model on the DDSM data with 200 additional epochs. The model improves the test score from 0.81 to 0.85 (Table 3), which is as good as the best Resnet50 based models. We did not perform additional training for the other VGG16 based models due to computational constraint. We also want to find out how much data is required to finetune a whole image classifier to reach satisfactory performance. This has important implications in practice since obtaining labels, even at the whole image level, can be expensive. We sample a subset with 20, 30, …, 60 patients from the train set for finetuning and evaluate the model performance on the same validation set (Table 4). With as little as 20 patients or 79 images, the VGG16 based and the hybrid models can achieve scores of 0.87 and 0.89, respectively. The scores seem to quickly saturate as we increase the train set size. We hypothesize that the “hard” part of the learning is to recognize the textures of the benign and malignant ROIs while the “easy” part is to adjust to different color profiles. This quick adjustment can be a huge advantage for the end-to-end trained whole image networks. In future works, a whole image classifier can be finetuned to make predictions on another database with only a small amount of training data. This greatly reduce the burden of train set construction. Finally, with augmented prediction, the VGG16 based model improves the validation score from 0.92→0.94 and the hybrid model improves the score from 0.95→0.96. The average of the two augmented models gives a score of 0.96. Including the Resnet50 based model in model averaging does not improve the score. 4 Discussion We have shown that accurate whole-image breast cancer diagnosis can be achieved with a deep learning model trained in an end-to-end fashion that is independent from ROI annotations. The network can be based on an all convolutional design that is simple yet powerful. It can be seen that high-resolution mammograms are critical to the accuracy of the diagnosis. However, large image size can easily lead to an explosion of memory requirement. If more GPU memory becomes available in the future, we shall return to this problem and train our models with larger image sizes or even use the original resolution without downsizing. This will provide much more details of the ROIs and can potentially improve the performance. 10 The decrease of the scores from the models based on the S10 to the S30 set is a surprise. Yet it indicates the intricacy of training a whole image classifier. More research is needed to make the whole image training more robust against divergence and overfitting, especially when the train set is not large. Patch sampling can also be made more efficient by focusing more on the difficult cases than the easy ones. Our result supports Yaroslav’s argument [19] that the VGG networks are more suitable than the residual networks for breast cancer diagnosis. However, we also demonstrate the superiority of the residual networks to the VGG networks in several aspects. The only problem with the residual structure is the first few layers that may destroy the fine details of the ROIs. In future works, we can modify the original residual network to make the first few layers less aggressive in reducing the feature map sizes. That shall lead to improved performance for the residual networks. Computational environment The research in this study is carried out on a Linux workstation with 8 CPU cores and a single NVIDIA Quadro M4000 GPU with 8GB memory. The deep learning framework is Keras 2 with Tensorflow as the backend. Acknowledgements We would like to thank Gustavo Carneiro and Gabriel Maicas for providing comments on the manuscript; Quan Chen for discussion on the use of INbreast data. References [1] A. D. Trister, D. S. M. Buist, and C. I. Lee, “Will Machine Learning Tip the Balance in Breast Cancer Screening?,” JAMA Oncol, May 2017. [2] L. Shen, “Breast cancer diagnosis using deep residual nets and transfer learning,” 2017. [Online]. Available: https://www.synapse.org/#!Synapse:syn9773182/wiki/426912. [Accessed: 23-Aug-2017]. [3] “The Digital Mammography DREAM Challenge - Final Ranking of Validation Round.” [Online]. Available: https://www.synapse.org/#!Synapse:syn4224222/wiki/434546. [Accessed: 23-Aug-2017]. [4] R. Girshick, J. Donahue, T. Darrell, and J. Malik, “Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation,” in Proceedings of the 2014 IEEE Conference on Computer Vision and Pattern Recognition, Washington, DC, USA, 2014, pp. 580–587. [5] R. Girshick, “Fast r-cnn,” in Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 1440–1448. [6] S. Ren, K. He, R. Girshick, and J. Sun, “Faster R-CNN: Towards real-time object detection with region proposal networks,” in Advances in neural information processing systems, 2015, pp. 91–99. [7] J. Dai, Y. Li, K. He, and J. Sun, “R-FCN: Object Detection via Region-based Fully Convolutional Networks,” arXiv:1605.06409 [cs], May 2016. [8] A. R. Jamieson, K. Drukker, and M. L. Giger, “Breast image feature learning with adaptive deconvolutional networks,” in Proc. SPIE, 2012, vol. 8315, pp. 831506-831506–13. [9] J. Arevalo, F. A. González, R. Ramos-Pollán, J. L. Oliveira, and M. A. G. Lopez, “Convolutional neural networks for mammography mass lesion classification,” in 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), 2015, pp. 797–800. [10] G. Carneiro, J. Nascimento, and A. P. Bradley, “Unregistered Multiview Mammogram Analysis with Pretrained Deep Learning Models,” in Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015: 18th International Conference, Munich, Germany, October 5-9, 2015, Proceedings, Part III, N. Navab, J. Hornegger, W. M. Wells, and A. F. Frangi, Eds. Cham: Springer International Publishing, 2015, pp. 652–660. [11] N. Dhungel, G. Carneiro, and A. P. Bradley, “Automated Mass Detection in Mammograms Using Cascaded Deep Learning and Random Forests,” in 2015 International Conference on Digital Image Computing: Techniques and Applications (DICTA), 2015, pp. 1–8. [12] M. G. Ertosun and D. L. Rubin, “Probabilistic visual search for masses within mammography images using deep learning,” in 2015 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), 2015, pp. 1310–1315. [13] A. Akselrod-Ballin, L. Karlinsky, S. Alpert, S. Hasoul, R. Ben-Ari, and E. Barkan, “A Region Based Convolutional Network for Tumor Detection and Classification in Breast Mammography,” in Deep Learning and Data Labeling for Medical Applications: First International Workshop, LABELS 2016, and Second International Workshop, DLMIA 2016, Held in Conjunction with MICCAI 2016, Athens, Greece, October 21, 11 2016, Proceedings, G. Carneiro, D. Mateus, L. Peter, A. Bradley, J. M. R. S. Tavares, V. Belagiannis, J. P. Papa, J. C. Nascimento, M. Loog, Z. Lu, J. S. Cardoso, and J. Cornebise, Eds. Cham: Springer International Publishing, 2016, pp. 197–205. [14] J. Arevalo, F. A. González, R. Ramos-Pollán, J. L. Oliveira, and M. A. Guevara Lopez, “Representation learning for mammography mass lesion classification with convolutional neural networks,” Computer Methods and Programs in Biomedicine, vol. 127, pp. 248–257, Apr. 2016. [15] Daniel Lévy and A. Jain, “Breast Mass Classification from Mammograms using Deep Convolutional Neural Networks,” arXiv preprint arXiv:1612.00542, 2016. [16] N. Dhungel, G. Carneiro, and A. P. Bradley, “The Automated Learning of Deep Features for Breast Mass Classification from Mammograms,” in Medical Image Computing and Computer-Assisted Intervention – MICCAI 2016: 19th International Conference, Athens, Greece, October 17-21, 2016, Proceedings, Part II, S. Ourselin, L. Joskowicz, M. R. Sabuncu, G. Unal, and W. Wells, Eds. Cham: Springer International Publishing, 2016, pp. 106–114. [17] A. S. Becker, M. Marcon, S. Ghafoor, M. C. Wurnig, T. Frauenfelder, and A. Boss, “Deep Learning in Mammography: Diagnostic Accuracy of a Multipurpose Image Analysis Software in the Detection of Breast Cancer,” Invest Radiol, Feb. 2017. [18] I. C. Moreira, I. Amaral, I. Domingues, A. Cardoso, M. J. Cardoso, and J. S. Cardoso, “INbreast: Toward a Full-field Digital Mammographic Database,” Academic Radiology, vol. 19, no. 2, pp. 236–248, Feb. 2012. [19] Yaroslav Nikulin, “DM Challenge Yaroslav Nikulin (Therapixel).” [Online]. Available: https://www.synapse.org/#!Synapse:syn9773040/wiki/426908. [Accessed: 23-Aug-2017]. [20] W. Zhu, Q. Lou, Y. S. Vang, and X. Xie, “Deep Multi-instance Networks with Sparse Label Assignment for Whole Mammogram Classification,” arXiv:1705.08550 [cs], May 2017. [21] Yoni Choukroun, Ran Bakalo, Rami Ben-Ari, Ayelet Askelrod-Ballin, Ella Barkan, and Pavel Kisilev, “Mammogram Classification and Abnormality Detection from Nonlocal Labels using Deep Multiple Instance Neural Network,” presented at the Eurographics Workshop on Visual Computing for Biology and Medicine, 2017. [22] D. Wang, A. Khosla, R. Gargeya, H. Irshad, and A. H. Beck, “Deep Learning for Identifying Metastatic Breast Cancer,” arXiv:1606.05718 [cs, q-bio], Jun. 2016. [23] D. Ciresan, A. Giusti, L. M. Gambardella, and J. Schmidhuber, “Deep Neural Networks Segment Neuronal Membranes in Electron Microscopy Images,” in Advances in Neural Information Processing Systems 25, F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, Eds. Curran Associates, Inc., 2012, pp. 2843–2851. [24] F. Chollet and others, Keras. GitHub, 2015. [25] Martín Abadi et al., TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems. 2015. [26] Y. Jia et al., “Caffe: Convolutional Architecture for Fast Feature Embedding,” arXiv:1408.5093 [cs], Jun. 2014. [27] T. Chen et al., “MXNet: A Flexible and Efficient Machine Learning Library for Heterogeneous Distributed Systems,” arXiv:1512.01274 [cs], Dec. 2015. [28] Michael Heath, Kevin Bowyer, Daniel Kopans, Richard Moore, and W. Philip Kegelmeyer, “The Digital Database for Screening Mammography,” in Proceedings of the Fifth International Workshop on Digital Mammography, 2001, pp. 212–218. [29] K. Simonyan and A. Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition,” arXiv:1409.1556 [cs], Sep. 2014. [30] K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” arXiv:1512.03385 [cs], Dec. 2015. [31] O. Russakovsky et al., “ImageNet Large Scale Visual Recognition Challenge,” Int J Comput Vis, vol. 115, no. 3, pp. 211–252, Dec. 2015. [32] D. P. Kingma and J. Ba, “Adam: A Method for Stochastic Optimization,” arXiv:1412.6980 [cs], Dec. 2014. [33] R. S. Lee, F. Gimenez, A. Hoogi, and D. Rubin, “Curated Breast Imaging Subset of DDSM,” The Cancer Imaging Archive, 2016. 12
2cs.AI
Computational complexity lower bounds of certain discrete Radon transform approximations Timur M. Khanipov arXiv:1801.01054v1 [cs.CC] 3 Jan 2018 Institute for Information Transmission Problems of the Russian Academy of Sciences (IITP RAS) January 3, 2018 Abstract For the computational model where only additions are allowed, the Ω(n2 log n) lower bound on operations count with respect to image size n × n is obtained for two types of the discrete Radon transform implementations: the fast Hough transform and a generic strip pattern class which includes the classical Hough transform, implying the fast Hough transform algorithm asymptotic optimality. The proofs are based on a specific result from the boolean circuits complexity theory and are generalized for the case of boolean ∨ binary operation. Keywords: discrete Radon transform, Hough transform, fast Hough transform, computational complexity, lower bound, boolean circuit, ensemble computation. 1 Introduction The Radon transform of a function f : R2 → R maps all straight lines in R2 to line integrals of f : Z l 7→ f ds (1) l It naturally arises in a large variety of applications including X-ray and other types of computed tomography, astronomy, electron microscopy, nuclear magnetic resonance, optics, stress analysis, geophysics and other areas [1]. The Radon transform discrete analogues are defined in at least two different ways. One approach is based on connection between the Radon and Fourier transforms [1], while the other one uses some sort of straightforward discretizations of equation (1) and we will further call it “discrete Radon transform”. A common variation of the discrete Radon transform is also known by the name “Hough transform” [2] when samples fij are summed along all line patterns of type j = [ki + b] or i = [kj + b] for (k, b) ∈ Ln being a specific finite family of pattern parameters for a n × n image In = {fij }: (k, b) 7→ n−1 X fi,[ki+b] , (k, b) ∈ Ln . (2) i=0 The Hough transform is well known in image processing mostly as means of detecting lines and is sometimes defined per se by (2) without mentioning any ties to the Radon transform [3]. If |Ln | 1 grows as n2 then a way of computing (2) by direct summation would take Θ(n3 ) operations which might be critically slow for some applications, especially real-time technical vision. To mitigate this problem a different pattern family and the corresponding algorithm called the fast Hough transform were suggested, with each pattern being an approximation to (2) lines and allowing simultaneous computation in Θ(n2 log n) binary additions. The fast Hough transform was reinvented several times with the earliest known to the author published work being [4] in 1996. Brady’s 1998 paper [5] contains a thorough description of the algorithm and its properties including a logarithmic bound on pattern deviation from straight line. Due to efficient performance and possible in-place implementation, the fast Hough transform found many applications in various object recognition and technical vision areas: automatic documents orientation, vanishing points detection [6] and even vehicle axles calculation in an intellectual transportation system [7] are only a few examples. It should be noted that the term “fast Hough transform” leads to some terminological confusion for it itself computes not the Hough transform (2) but a specific approximation to it. It was previously unknown whether the fast Hough transform could be computed in o(n2 log n) operations. Except for the trivial Ω(n2 ) limitation no lower bounds were also known for the “ordinary” Hough transform (2). In this paper we advance in these questions proving the Ω(n2 log n) lower bound for the minimal number of binary summations of both the fast Hough transform and a certain class of discrete Radon transform approximations covering (2), when only addition operations are allowed. We use additive circuits as a natural computational model and exploit a specific theorem from the theory of boolean function complexity. In fact we prove a stronger result, also providing the Ω(n2 log n) bound for the case when pixels are considered to contain {0, 1} values and summations are replaced with the boolean ∨ operation (using boolean instead of additive circuits). The rest of the paper is organized as follows. Section 2 formally defines images, pixels and pattern sets and reproduces (from [8]) the necessary circuit complexity theory terms (adapted to images environment) as well as the key bounding theorem (without proof) which this paper is based on. In sections 3 and 4 the theorem is applied to the fast Hough transform and strip patterns resp. and section 5 summarizes the results and provides some directions for further research. 2 Image patterns and complexity We will consider raster images of height h > 1 and width w > 2 as a set I of w · h variables (further called pixels) pij , i = 0, ..., h − 1, j = 0, ..., w − 1 with values from either F2 = {0, 1} or N = {0, 1, 2, ...}. We assume that p00 resides in the bottom left corner. Where it does not lead to confusion the word pixel means both the variable and the value it might contain. Suppose that a particular commutative semigroup operation is defined on pixel values: logical ∨ for F2 and arithmetic + for N. The words “sum”, “summation” and the Σ symbol are freely used for both cases, this does not produce ambiguity because F2 and N are considered separately. A pattern T is a non-empty subset of I. A pattern set T = {Tk }m k=1 is a non-empty set of m distinct patterns. Consider the task of simultaneously computing the following m sums using only the semigroup operation (+ or ∨), generalizing (2): yk = X p, k = 1, ..., m. (3) p∈ Tk P An obvious way would be to perform a total of m k=1 (|Tk | − 1) binary operations, calculating each yk separately. The trick, however, is to exploit the patterns specific structure which might allow to greatly reduce the number of additions by reusing the sums of pixel subsets which reoccur in many patterns. A natural model for defining the complexity of problem (3), which takes into 2 account only the internal redundancy of patterns, is the circuit model. Further in this section we briefly describe it. Let circuit be a directed acyclic graph with w · h input nodes (inputs) pij of zero fanin (no incoming edges) and m output nodes (outputs) yk of zero fanout (no outgoing edges). Non-zero fanin nodes are called gates and may have any positive number of incoming edges, each gate performs summation over its fanin nodes. The size of a circuit is the total number of edges in it. We say that a circuit computes pattern set T if after performing all summations starting from the inputs, the outputs will contain the yk values according to (3). At least one trivial computing circuit exists for any T : take m outputs each having |Tk | incoming edges from the appropriate inputs, so the following definitions are correct: Definition 2.1. OR-complexity OR(T ) is the minimal size among all circuits computing T over the (F2 , ∨) semigroup. Definition 2.2. SUM-complexity SUM(T ) is the minimal size among all circuits computing T over the (N, +) semigroup. For practical applications it might be more convenient to consider circuits containing only fanin-2 (i.e. with two or less incoming edges) nodes and count the number of gates instead of edges thus giving the complexity in terms of the minimal number of binary operations used. We will denote these measures as OR2(T ) and SUM2(T ) for (F2 , ∨) and (N, +) resp. From the following proposition, any OR/SUM lower bound yields almost the same OR2/SUM2 bound, so the latter practically more common case is reduced to the former one when considering lower bounds. Proposition 2.3. For L ∈ {OR, SUM} and any pattern set T , L2(T ) > 21 L(T ). Proof. Indeed, for the number of gates g and the number of edges e in any fanin-2 circuit G holds e 6 2g (adding a new gate produces at most two new edges). So if G is the fanin-2 circuit with the minimal gates count, L2(T ) = g > 21 e > 21 L(T ).  Remark 2.4. The question of mere existence of a fanin-2 addition circuit computing T over (N, +) with a given number of binary gates can straightforwardly be reformulated as the so called ensemble computation problem and is thus NP-complete [9]. It is easy to see that any circuit computing T over (N, +) would also compute T over (F2 , ∨) after simply changing the summation operation (see [8, Introduction] for a detailed explanation) which implies Proposition 2.5. SUM(T ) > OR(T ) and SUM2(T ) > OR2(T ) for any T .  The inverse is not true and the complexity gap can be quite large (see, for example, [8, paragraph 5.1]). In image processing the OR-case would seem somewhat “exotic” with the SUM-case being by far more common but due to proposition 2.5 any lower bound on OR(T ) provides the same lower bound on SUM(T ), so it is sufficient to estimate only the stronger OR-case. The two following simple propositions state that adding patterns to a set or extending it onto a larger image does not reduce its complexity. They are useful in further sections when we are reviewing only a distinguished subset (e.g. mostly vertical inclined to the right) of possible line patterns or consider subimages. Proposition 2.6. For L ∈ {OR, SUM, OR2, SUM2} and pattern sets M ⊆ T , L(T ) > L(M). Proof. Any circuit computing T can be reduced to the one computing M by removing the gates and edges which participate only in T \ M computation.  3 Proposition 2.7. If T is a pattern set on image I, I0 ⊆ I is a subimage and M = {T ∩I0 | T ∈ T } then for L ∈ {OR, SUM, OR2, SUM2} holds L(M) 6 L(T ). Proof. Indeed, any circuit computing T can be reduced to a circuit computing M by removing all nodes (and the corresponding edges) which depend only on pixels from I \ I0 and possibly cleaning out the reoccurring outputs might they appear (this procedure is equivalent to permanently zeroing all these inputs).  We can now define a few terms which are needed to formulate the lower bound theorem below. Definition 2.8. Volume of a pattern set T X V (T ) = |T |. T ∈T Definition 2.9. Intersection area of a pattern set T \ S(T ) = |T | · | T |. T ∈T Definition 2.10. Self-intersection measure of a pattern set T r(T ) = max S(R). ∅6=R⊆T Remark 2.11. Terms S(T ), V (T ) and r(T ) directly correspond to terms “area”, |A| and r(A) resp. from [8] for a boolean matrix A corresponding to system (3) when formally written in vector form y = Ap for a size w · h vector p = (p00 , p01 , ..., ph−1 w−1 )T and a size m vector y = (y1 , ..., ym )T . Patterns themselves correspond to the rows of A in this representation. See [8] for more details. With this remark in mind we can now reformulate the area bounding theorem 3.12 from [8, paragraph 3.4] in the following way: Theorem 2.12. For any pattern set T OR(T ) > 3V (T ) V (T ) log3 . r(T ) |T |  Values V (T ) and |T | are easy to calculate but assessing r(T ) may be a non-trivial task. The next two sections give linear relatively to image size upper bounds of this term for the fast Hough transform and strip pattern sets which yield the desired lower bounds on complexity. 3 Fast Hough transform The fast Hough transform uses a special set of inductively defined image patterns constructed to approximate lines and ease their simultaneous computation. These patterns are defined separately for four symmetrical cases of mostly vertical or mostly horizontal, inclined to the right or left lines and it is enough to analyze only one of them. Simply described, FHT patterns H0 of order zero are single bottom pixels and patterns Hk of order k > 0 are produced by putting patterns Hk−1 of order k − 1 onto their own tops with a possible additional horizontal shift of one pixel and cyclic wrapping over the right image border. Each pattern has width 1 and height 2k . Distinct FHT pattern shapes generation for the 4 × 4 case is shown in fig. 1 with “parent” subshapes shaded 4 k=0 k=1 k=2 Figure 1: Distinct 4-pixel FHT pattern shapes generation for h = w = 4 with ∆ = 0, 1, 2, 3 (from left to right below). Figure 2: Similar FHT patterns starting at different bottom pixels, ∆ = 2. at each stage. Every 4-pixel shape may start in 4 different bottom positions giving a total of 16 patterns (see fig. 2 with all 4 positions of the shape in fig. 1 below). For the formal definition we first assume that image height h = 2d , d ∈ N, this restriction is removed in the end of the section. We will need an auxiliary horizontal span function ∆(T ) = (jtop − jbot ) mod w, whith jtop and jbot being horizontal coordinates of pattern T top and bottom pixels resp. and a “width-cyclic translation” operator tran a,b (T ) = {pi+a, (j+b) mod w | pij ∈ T }. Now we can define mostly vertical inclined to the right FHT patterns Hh,w of height h, shortly also denoted as Hd (“of order” d) for fixed w (remember that w > 2), by induction: 1. H0 = {{p00 }, {p01 }, ..., {p0 w−1 }}, 2. Hk = {T ∪ tran 2k−1 , ∆(T )+s (T ) | T ∈ Hk−1 , s ∈ {0, 1}} for k = 1, 2, ..., d. The following propositions give some description to these patterns and follow directly from the definition or may easily be proved using induction (condition w > 2 is important). For convenience we use terms bottom image (pixels) Ibh = {pij | 0 6 j < h/2} and top image (pixels) Ith = {pij | h/2 6 j < h}. Proposition 3.1. For h > 1 the restriction of Hh,w to top image is also FHT pattern of height h/2 (after appropriate pixels renumbering). The same obviously holds for the bottom image.  Proposition 3.2. |Hh,w | = w · h.  Proposition 3.3. ∀ T ∈ Hh,w |T | = h and, hence, V (Hh,w ) = w · h2 .  Proposition 3.4. For every T ∈ Hh,w there is a unique T 0 ∈ Hh,w so that T ∩ Ibh = T ∩ T 0 , such T 0 is called a bottom-sibling of T . The same statement holds for Ith (with top-siblings).  For example, if the two leftmost patterns from fig. 1 started from the same bottom pixel, they would be bottom-siblings. 5 Lemma 3.5. r(Hh,w ) = h. Proof. r(Hh,w ) > h because by proposition 3.3 for any T ∈ Hh,w intersection area S({T }) = h. So it is enough to prove that r(Hh,w ) 6 h. We will use induction over k from the definition of Hh,w . The induction base is obvious: r(H0 ) = 1. Supposing now that r(Hk ) 6 2k we will show that r(Hk+1 ) 6 2k+1 thus proving the induction step. T Indeed, let M ⊆ Hk+1 be a set of q patterns with common pixels P = T and |P | = p > 0. T ∈M k+1 Ib = Ib2 , It 2k+1 . k+1 We need to prove that p · q 6 Denote upper and lower images = It2 and the corresponding pattern set restrictions Mb = {T ∩ Ib | T ∈ M}, Mt = {T ∩ It | T ∈ M} and consider three cases. First assume that P ⊆ Ib . By proposition 3.4 at most two bottom siblings in M may produce the same element in Mb , which yields q 6 2|Mb |. By induction hypothesis, S(Mb ) = p · |Mb | 6 2k , so S(M) = p · q 6 2p · |Mb | 6 2k+1 . Secondly, assume that P ⊆ It . In this case the proof is same as above, we just need to note proposition 3.1 to use the induction hypothesis. Finally, assume that both pb = |P ∩ Ib | > 0 and pt = |P ∩ It | > 0. It follows from proposition 3.4 that in this case M contains neither top- nor bottom-siblings and, hence, |Mb | = |Mt | = q. By separately applying induction hypothesis to these two sets (and again noting proposition 3.1) we get pb · q 6 2k and pt · q 6 2k . For p = pb + pt we also get S(M) = p · q 6 2k+1 . Since M has been chosen arbitrarily, we have r(Hk+1 ) 6 2k+1 . The induction step is proven and we get r(Hh,w ) = r(Hd ) 6 2d = h.  Remember that we assumed h = 2d for d ∈ N. Let us further denote h = 2blog2 hc and h = i.e. h and h are the powers of two closest to h from below and above resp. We can extend the definition of Hh,w for image I with arbitrary h ∈ N in the following way: 2dlog2 he , Hh,w = {T ∩ I | T ∈ Hh,w } From proposition 2.7 follows Proposition 3.6. OR(Hh,w ) > OR(Hh,w ).  By combining theorem 2.12, lemma 3.5 and propositions 3.2, 3.3 and 3.6 we get Theorem 3.7. OR(Hh,w ) > 3wh log3 h.  Remember that the fast Hough transform was originally designed to be calculated in Θ(n2 log n) operations on a n × n image. In our model it can be strictly formulated with the following proposition. For consistency and because it is easy and does not require much space, we provide its proof from [5] adapted to our model. Proposition 3.8 (FHT algorithm). SUM2(Hh,w ) 6 wh log2 h. Proof. Denoting d = dlog2 he ∈ N we will inductively construct a fanin-2 circuit that computes Hh,w = Hd with wd 2d = wh log2 h gates. For k = 0 the circuit computing H0 consists only of input nodes and thus has zero gates, providing the induction base. Suppose now for k > 1 there is a circuit computing Hk with wk2k gates. Let us replicate it for the top and bottom image halves thus 6 producing wk2k+1 gates. Then, following the FHT patterns definition, for every T ∈ Hk we insert two more gates computing its successors T 0 , T 00 ∈ Hk+1 . For |Hk | = w2k , this produces w2k+1 more nodes and finishes the circuit. The total number of nodes in it is wk2k+1 + w2k+1 = w(k + 1)2k+1 . We end the proof by applying proposition 2.7.  The next theorem provides explicit upper and lower bounds on FHT patterns complexity (it looks best for h = 2d ). Theorem 3.9. For L ∈ {OR, SUM}, log3 8 wh log2 h 6 L(Hh,w ) 6 2wh log2 h, and log9 8 wh log2 h 6 L2(Hh,w ) 6 wh log2 h. Proof. After applying elementary logarithm properties, the upper right inequality follows from propositions 2.3 and 3.8, the upper left – from proposition 2.5 and theorem 3.7, the lower right – from propositions 2.5 and 3.8 and the lower left – from proposition 2.3 and theorem 3.7.  Finally, summarizing and omitting the coefficients we can state Proposition 3.10. For L ∈ {OR, SUM, OR2, SUM2}, L(Hn,n ) = Θ(n2 log n). 4  Strip patterns We will now consider a generic class of strip pattern sets consisting of patterns which have a limited distance to some “ideal” straight line and do not form too “dense” congestions, the classical Hough transform (2) being a typical example. As in the previous section we work only with one type of lines (this time mostly horizontal with inclination to the right) which is enough for lower bounds because of proposition 2.6. It is worth noting that FHT patterns from the previous section reach logarithmic deviation from ideal straight lines [10] and thus cannot be reduced to this case. The following embedding of pixels into R2 will be used here. Pixel pij corresponds to integer point (i, j) ∈ R2 . We use the same pij notation for these points if it does not lead to confusion. Definition 4.1. For line l ⊂ R2 and C > 0 C-strip or strip of width C is the set s(l, C) = {r ∈ R2 | ρ(r, l) 6 C/2}. If C is known from the context or not important, this strip is shortly denoted as s(l). Definition 4.2. Line l ⊂ R2 is mostly horizontal inclined to the right if it has equation of form y = ax + b with slope 0 6 a 6 1. In this case strip s(l) is also called mostly horizontal inclined to the right with slope a. Definition 4.3. Mostly horizontal inclined to the right line l is integer at image I with width w if e its slope a = w−1 for some e ∈ {0, 1, ..., w − 1} called elevation. Definition 4.4. Patterns T ∈ M are C-parallel if there is a family of integer lines {l(T ) | T ∈ M} with the same slope that ∀T T ⊂ s(l(T ), C). We can now describe the specific pattern set class which we study and then obtain the selfintersection bound for it. “Strangely looking” item 2 of the following definition states that there cannot be more than a constant number Q of intersecting patterns covered by strips of the same slope. This is of course true for all standard line plotting algorithms: if C is chosen small and a 7 line is shifted up or down by a few pixels, it would not intersect with itself. The idea behind the r-bound proof (lemma 4.12) is quite simple: if we have a lot of intersecting lines, two of them will have differing enough slopes thus limiting the intersection area and with a few lines an even simpler bound works. Definition 4.5. Pattern set L is a strip pattern set of width C > 0 and density Q ∈ N if: 1. For any pattern L ∈ L there is an integer line l so that L ⊂ s(l, C), T 2. For any C-parallel subset M ⊆ L with L 6= ∅ holds |M| 6 Q. L∈M Remark 4.6. The “integer” property of lines above is not important and is imposed only to shorten the proofs. Indeed, for any mostly horizontal inclined to the right line l there is an integer line l0 and constant C 0 so that s(l, C) ⊆ s(l0 , C 0 ) and C 0 depends only on C. Definition 4.7. Integer cardinality of a set D ⊆ R2 is the number N (D) = |Z2 ∩ D| of integer points inside it. √ √ Proposition 4.8. Rectangle R with sides a and b has N (R) 6 (a + 2)(b + 2). Proof. Draw N (R) horizontally aligned squares with unit area centered at the integer points contained in R. Obviously, √ rectangle R0 obtained by moving each R side outward by half of the unit square diagonal length ( 22 ), will contain all the marked squares and hence its area is not less than N (R).  Lemma 4.9. For mostly horizontal inclined to the right C-strips s(l) and s(k) with different slopes a and b C1 N (s(l) ∩ s(k)) 6 , |a − b| where C1 > 0 depends only on C. Proof. Let α = arctan a, β = arctan b and suppose β > α. The strips sides intersect at angle γ = β − α and form a rhombus P QRS (fig. 3). After dropping perpendiculars P H1 on QR and RH2 on P S we get a rectangle P H1 RH2 with side P H1 = 2C. R Q γ H1 γ S P H2 Figure 3: Strips intersection. Another side H1 R = H1 Q + QP = 2C( tan1 γ + sin1 γ ). After denoting z = tan γ 6 1 and applying √ 2 1+ab 12C elementary trigonometric equalities we have H1 R = 2C( z1 + zz +1 ) 6 6C z = 6C b−a 6 b−a for all a, b, z 6 1. √ √ √ By proposition 4.8 N (s(l)∩s(k)) 6 N (P H1 RH2 ) 6 (P H1 + 2)(H1 R+ 2) 6 (2C + 2)( 12C b−a + √ 2).  8 Corollary 4.10. For integer lines l, k with different elevations e1 and e2 N (s(l, C) ∩ s(k, C)) 6 C1 w , |e1 − e2 | where C1 > 0 depends only on C, w is image width.  Further we will utilize the following obvious Proposition 4.11. √ For mostly horizontal inclined to the right line l and image I of width w, N (I ∩ s(l, C)) 6 (2C 2 + 1)w.  Lemma 4.12. For any strip pattern set L of width C and density Q at image I with width w, r(L) 6 C 0 w, where C 0 > 0 depends only on C and Q. Proof. Suppose we have patterns subset M = {Li }m i=1 ⊆ L such that | m T Li | = p > 0. By strip i=1 pattern definition, we have a set of integer lines {li } so that each Li ⊂ s(li ). Consider the set {ej }kj=1 of different li elevations, 1 6 k 6 m and denote by Mj ⊆ M the C-parallel subset of k F patterns covered by lines li with the same slope ej , M = Mj Again, by strip pattern definition, j=1 |Mj | 6 Q for all j, which yields k > m/Q. First suppose that m > 2Q, so k > 2. In this case we can find two distinct indices j1 and j2 so that ej2 − ej1 > k − 1 > m/Q − 1. By corollary 4.10, p 6 N (s(lj1 ), s(lj2 )) 6 C1 w C1 w , 6 ej2 − ej1 m/Q − 1 hence S(M) = pm 6 C1 Q w m 6 2C1 Qw. m−Q Suppose now that m < 2Q. In this case by proposition 4.11 √ S(M) 6 2Q(2C 2 + 1)w. √ By setting C 0 = max(2C1 Q, 2Q(2C 2 + 1)) and noting that M is arbitrary we finish the proof.  From theorem 2.12, lemma 4.12 and propositions 2.3, 2.5 follows Theorem 4.13. If L ∈ {OR, SUM, OR2, SUM2}, {Ln } is a family of strip pattern sets of the same width and density, each Ln defined at image In of size n × n and for all Ln : 1. |Ln | = Θ(n2 ), 2. V (Ln ) = Ω(n3 ), then L(Ln ) = Ω(n2 log n).  The conditions of the theorem include all pattern sets which are enough “large” (item 2) and have mean pattern size of Ω(n). Any lines parametrization from (2) which contains Θ(n) different slopes and Θ(n) lines for each slope falls under these conditions. 9 5 Conclusion In this paper we successfully applied a certain result from the theory of boolean circuits to obtain the Ω(n2 log n) asymptotic lower bounds on additive complexities of the fast Hough transform and strip pattern based discrete Radon transform. For the fast Hough transform this bound is Θ-exact. In fact a stronger result was proved, limiting from below the so called OR-complexity. Also, for the fast Hough transform pairs of simple boundary inequalities with explicit coefficient were provided, covering all the SUM, OR, SUM2 and OR2 cases. We can outline a few further research directions. An intriguing question is if strip patterns complexity is o(n3 ) and, if so, whether the corresponding circuits have constructive description. Obtaining better lower bounds than the proven Ω(n2 log n) would also be interesting. Another question is whether the FHT and strip patterns asymptotic complexities would change after allowing to use the subtraction operation. It seems that the described approach could be applied to analyze the complexity of the generalized Hough transform patterns. Simple shapes might allow something similar to the geometrical analysis of r(T ) which we used in this paper. Acknowledgements I would like to thank my colleagues Dmitry Nikolaev for bringing this subject to my attention and useful advice, Valerii Sokolov for numerous remarks and correcting certain inconsistencies, Igor Polyakov and Alexey Savchik for verifying the proofs and locating a few misprints, and Andrey Gladkov for help with the FHT pictures. References [1] S. Deans. The Radon transform and some of its applications. Dover Publications, 2007. [2] R. Duda, P. Hart. Use of the Hough transformation to detect lines and curves in pictures. Comm. ACM, vol. 15, pp. 11–15, 1972. [3] L. Shapiro, G. Stockman. Computer vision. Prentice Hall, 2001. [4] W. Götz, H. Druckmüller. A fast digital Radon transform – an efficient means for evaluating the Hough transform. Pattern recognition, vol. 29, no. 4, pp. 711–718, 1996. [5] M. Brady. A fast discrete approximation algorithm for the Radon transform. SIAM Journal on Computing, vol. 27 (1), pp. 107–119, 1998. [6] D. Nikolaev, S. Karpenko, I. Nikolaev, P. Nikolayev. Hough transform: underestimated tool in the computer vision field. Proceedings of the 22nd European conference on modelling and simulation, pp. 238–243, 2008. [7] A. Grigoryev, D. Bocharov, A. Terekhin, D. Nikolaev. Vision-based vehicle wheel detector and axle counter. Proceedings of the 29th European conference on modelling and simulation, pp. 521–526, 2015. [8] S. Jukna, I. Sergeev. Complexity of linear boolean operators. Foundations and trends in theoretical computer science, vol. 9, no. 1, pp. 1–123, 2013. 10 [9] M. Gary, D. Johnson. Computers and intractability. W. H. Freeman & Co, 1979. [10] E. Ershov, S. Karpenko. Properties of the fast Hough transform dyadic patterns (in Russian). http://arxiv.org/pdf/1712.05615.pdf, 2017. 11
1cs.CV
Losing Weight by Gaining Edges arXiv:1311.3054v2 [cs.CC] 25 Nov 2015 Amir Abboud∗ [email protected] Kevin Lewi∗ [email protected] Ryan Williams∗† [email protected] Abstract We present a new way to encode weighted sums into unweighted pairwise constraints, obtaining the following results. • Define the k-SUM problem to be: given n integers in [−n2k , n2k ] are there k which sum to zero? (It is well known that the same problem over arbitrary integers is equivalent to the above definition, by linear-time randomized reductions.) We prove that this definition of k-SUM remains W[1]-hard, and is in fact W[1]-complete: k-SUM can be reduced to f (k) · no(1) instances of k-Clique. • The maximum node-weighted k-Clique and node-weighted k-dominating set problems can be reduced to no(1) instances of the unweighted k-Clique and k-dominating set problems, respectively. This implies a strong equivalence between the time complexities of the node weighted problems and the unweighted problems: any polynomial improvement on one would imply an improvement for the other. • A triangle of weight 0 in a node weighted graph with m edges can be deterministically found in m1.41 time. 1 Introduction One of the most basic problems over integers, studied in geometry, cryptography, and combinatorics, is k-SUM, the parameterized version of the classical NP-complete problem SUBSET-SUM. Definition 1.1 (k-SUM). The (k, M )-SUM problem is to determine, given n integers x1 , . . . , xn ∈ [0, M ] and a target integer t ∈ [0, M ], if there exists a subset S ⊆ [n] of size |S| = k such that P 1 2k i∈S xi = t. We define k-SUM , (k, n )-SUM. Our definition of k-SUM is justified via the following known proposition: Proposition 1.1. Every instance S of (k, M )-SUM can be randomly reduced in O(kn log M ) time to an instance S ′ of k-SUM as defined above. That is, there is an efficient randomized reduction from k-SUM over arbitrary integers, which we call k-SUM-Z, to our definition of k-SUM (Appendix B). Furthermore, we show in Appendix B that this reduction can be made deterministic under standard hardness assumptions. ∗ Computer Science Department, Stanford University Supported in part by a David Morgenthaler II Faculty Fellowship, and NSF CCF-1212372. 1 Without loss of generality, the range of integers can be [−M, M ] and the target integer can be zero. † A classical meet-in-the-middle algorithm solves k-SUM in Õ(n⌈k/2⌉ ) time and it has been a longstanding open problem to obtain an O(n⌈k/2⌉−ε ) algorithm for any integer k ≥ 3 and constant ε > 0. Logarithmic improvements are known for the k = 3 case [BDP08, GP14] (that is, the famous 3-SUM problem). The k-SUM conjecture [Pat10, AL13] states that k-SUM requires n⌈k/2⌉−o(1) time and is known to imply tight lower bounds for many problems in computational geometry [GO95, HB96, BHP01] (and many more) and has recently been used to show conditional lower bounds for discrete problems as well [Pat10, VW09, JV13, AW14]. A matching Ω(n⌈k/2⌉ ) lower bound for k-SUM was shown for a restricted model of computation called √ k-linear decision trees (LDTs) [Eri95, AC05], although it was recently shown that depth O(nk/2 log n) suffices for (2k − 2)-LDTs [GP14]. It is also known that if there is an unbounded function s : N → N such that for infinitely many k, k-SUM is in nk/s(k) , then the Exponential Time Hypothesis is false [PW10]. Despite intensive research on this simple problem, our understanding is still lacking in many ways, one of which is from the viewpoint of parameterized complexity. In their seminal work on parameterized intractability, Downey and Fellows [DF92, DF95] proved that k-SUM-Z is W[1]-hard and is contained in W[P ]. The even simpler Perfect Code problem was conjectured to lie between the classes W[1] and W[2] [DF95] until Cesati proved it was W[1]-complete in 2002 [Ces02]. Classifying k-SUM-Z within a finite level of the W-hierarchy was open until in 2007, when Buss and Islam [BI07] proved that k-SUM-Z ∈ W[3]. The primary contribution of this work is a novel and generic way to efficiently convert problems concerning sums of numbers into problems on unweighted pairwise constraints. We call this technique “Losing weight by gaining edges” and report several interesting applications of it. One application is a new parameterized reduction from k-SUM to k-Clique and therefore the resolution of the parameterized complexity of k-SUM (for numbers in [−n2k , n2k ]). Under standard lower bound hypotheses, we also obtain a deterministic reduction from k-SUM-Z to k-Clique as well. Theorem 1.2. k-SUM is W[1]-complete. The significance of showing W[1]-hardness for a problem is well known (as it rules out FPT algorithms). The significance of showing that a problem is in W[1] is less obvious, so let us provide some motivation. First, although W[1]-complete problems are probably not FPT, prominent problems in  W[1] (such as k-Clique) can still be solved substantially faster than exhaustive search over all nk subsets [NP85]. In contrast, analogous problems in W[2] (such as k-Dominating Set) do not have such algorithms unless CNF Satisfiability is in 2δn time for some δ < 1 [PW10], which is a major open problem in exact algorithms. Therefore, understanding which parameterized problems lie in W[1] is closely related to understanding which problems can be solved faster than exhaustive search. Second, showing that a problem is in W[1] rather than W[3] means that it can be expressed in an apparently weaker logic than before, with fewer quantifiers [FG06]. That is, putting a problem in W[1] decreases the descriptive complexity of the problem. Theorem 1.2 has applications to parameterized complexity, yielding a new characterization of the class W[1] as the problems FPT-reducible to k-SUM. Since k-SUM is quite different in nature from the previously known W[1]-complete problems, we are able to put other such “intermediate” problems in W[1], including weighted graph problems and problems with application to coding theory such as Weight Distribution [CP12]. To show that k-SUM ∈ W[1], we prove a very tight reduction from k-SUM to k-Clique. Given an instance of k-SUM on n numbers, we generate f (k) · no(1) instances of k-Clique on n node graphs, such that one of these graphs contains a k-clique if and only if our k-SUM instance has 2 a solution. This implies that any algorithm for k-Clique running in time O(nc ) for some c ≥ 2 yields an algorithm for k-SUM running in time nc+o(1) . Hence, the k-SUM conjecture implies an n⌈k/2⌉−o(1) lower bound for k-Clique as well. Generalizing our ideas further, we are able to prove surprising consequences regarding other weighted problems. Removing node weights. Two fundamental graph problems are k-Clique and k-Dominating Set. Natural extensions of these problems allow the input graph to have weights on its nodes. The problem can then be to find a k-clique or a k-dominating set of minimum or maximum sum of node weights (the min and max versions), or to find a k-clique or a k-dominating set with total weight exactly 0 (the exact version, defined below). Definition 1.3 (The Node-Weight k-Clique-Sum Problem). For integers k, M > 0, the (k, M )-NWCLIQUE problem is to determine, given a graph G, a node-weight function w : V (G) → P [0, M ], and a target weight t ∈ [0, M ], if there is a set S of k nodes which form a clique such that v∈S w(v) = t. We define the Node-Weight k-Clique-Sum problem as (k, n2k )-NW-CLIQUE. Definition 1.4 (Node-Weight k-Dominating-Set-Sum). For an integer k > 0, the Node-Weight kDominating-Set-Sum problem is to determine, given a graph G, a node-weight function w : V (G) → 2k [0, n2k ], and P a target weight t ∈ [0, n ], if there is a set S of k nodes which form a dominating set such that v∈S w(v) = t. These additional node weights increase the expressibility of the problem and allow us to capture more applications. How much harder are these node weighted versions compared to the unweighted versions? By weight scaling arguments, one can show that the “exact” version is harder than the max and min versions, in the sense that any algorithm for “exact” implies an algorithm for max or min with only a logarithmic overhead [NvLvdZ12] (and Theorem 3.3 in [VW09]). But how much harder is (for example) Node-Weight k-Clique-Sum than the case where there are no weights at all? For k divisible by 3, the best k-Clique algorithms reduce the problem to 3-Clique on nk/3 nodes, then use an O(nω ) time algorithm for triangle detection [IR77] for a running time of O(nωk/3 ) [NP85]. This reduction to the k = 3 case works for the node weighted case as well; combined with the recent nω+o(1) algorithms for node weighted triangle (3-clique) problems [CL09, VW09], we obtain nωk/3+o(1) running times for node weighted k-clique problems. The best kDominating Set algorithms reduce the problem to a rectangular matrix multiplication of matrices of dimensions nk/2 × n and n × nk/2 and run in time nk+o(1) [EG04]. These algorithms allow us to find all k-dominating sets in the graph and therefore can also solve the node weighted versions without extra cost. Therefore, the state of the art algorithms for k-Clique and k-Dominating Set suggest that adding node weights does not make the problems much harder. Is that due to our current algorithms for the unweighted problems, or is there a deeper connection? Using the “Losing weight by gaining edges” ideas, we show that the node weighted versions of k-Clique and k-Dominating Set (and, in fact, any problem that allows us to implement certain “pairwise constraints”) are essentially “equivalent” to the unweighted versions. Theorem 1.5. If k-Clique on n node and m edge graphs can be solved in time T (n, m, k), then Node-Weight k-Clique-Sum on n node and m edge graphs can be solved in time no(1) ·T (kn, k2 m, k). 3 If k-Dominating Set on n node graphs can be solved in time T (n, k), then Node-Weight k-DominatingSet on n node graphs can be solved in time no(1) · T (k2 n, k). Interestingly, Theorem 1.5 yields a short and simple nω+o(1) algorithm for the node-weighted triangle problems, while a series of papers were required to recently conclude the same upper bound using different techniques [VW06, VWY06, CL09, VW09]. Moreover, unlike the previous techniques, our approach extends to k > 3 and applies to more problems like k-Dominating Set. 2ω Applying the result of Theorem 1.5 to the O(m ω+1 ) triangle detection algorithm of Alon, Yuster and Zwick [AYZ97], we obtain a deterministic algorithm for Node-Weight Triangle-Sum in sparse graphs, improving the previous nω+o(1) upper bound [VW09] and matching the running time of the best randomized algorithm [VW09]. Corollary 1.1. Node-Weight Triangle-Sum can be solved deterministically in m1.41+o(1) time. 1.1 Overview of the Proofs Let us give some intuition for Theorem 1.2. Both the containment in W[1] and the hardness for W[1] require new technical ideas. Downey and Fellows [DF92, DF95] proved that k-SUM-Z is W[1]-hard by a reduction requiring fairly large numbers: they are exponential in n, but can still be generated in an FPT way. To prove that k-SUM is W[1]-hard even when the numbers are only exponential in k log n, we need a much more efficient encoding of k-Clique instances. We apply some machinery from additive combinatorics, Pk−1namely a construction of large sets of integers avoiding trivial solutions to the linear equation i=1 xi = (k − 1)xk [O’B11]. These sets allow us to efficiently “pack” a k k-Clique instance into a ( 2 + k)-SUM instance on small numbers. Proving that k-SUM is in W[1] takes several technical steps. We provide a parameterized reduction from k-SUM on n numbers to only f (k) · no(1) graphs on O(kn) nodes, such that some graph has a k-clique if and only if the original n numbers have a k-SUM. To efficiently reduce from numbers to graphs, we first reduce the numbers to an analogous problem on vectors. We define an intermediate problem (k, M )-VECTOR-SUM, in which one is given a list of n vectors from {−kM, . . . , 0, . . . , kM }d , and is asked to determine if there are k vectors which sum to the all-zero vector. We give an FPT reduction from k-SUM to (k, M )-VECTOR-SUM where M and d are “small” (such that M d is approximately equal to the original weights of the k-SUM instance). Next, we “push” the weights in these vectors onto the edges of a graph connecting the vectors, where the edge weights are much smaller than the original numbers: we reduce from (k, M )-VECTOR-SUM to edge-weighted k-clique-sum using a polynomial “squaring trick” which creates a graph with “small” edge weights, closely related in size to M . Finally, we reduce from the weighted problem to the unweighted version of the problem by brute-forcing all feasible weight combinations on the edges; as the edge weights are small, this creates f (k) · no(1) unweighted k-Clique instances for some function f. Combining all these steps into one, one can view our  P approach as follows. We enumerate over all k2 -tuples of numbers t = (αi,j )i,j∈[k] such that i,j αi,j = 0 where αi,j ∈ [−M, M ] for M = f (k) · poly log n, and for each such tuple t we generate an instance of the unweighted problem. In this instance, two nodes are allowed to both be a part of our final solution (e.g. there is an edge between them in the k-clique case) if and only if some expression on the weights of the objects vi and vj evaluates to F (w(vi ), w(vj )) = αi,j . The formulas are defined, via the “squaring trick”, in   such a way that there are k nodes satisfying these k2 equations for some k2 -tuple t if and only if the sum of the weights of these k nodes is 0. 4 To implement our approach for k-Dominating Set we follow similar steps, except that we cannot implement the constraints on having a certain pair of objects in our solution by removing the edge between them anymore, since this does not prevent them from being in a feasible k-dominating set. This can be done, however, by adding extra nodes X to the graph such that the inclusion of pairs of nodes vi , vj in the solution S that do not satisfy our equations, F (w(vi ), w(vj )) 6= αi,j , will prevent S from dominating all the nodes in X. 1.2 Related Work There has been recent work in relating the complexity of k-SUM and variations of k-Clique for the specific case of k = 3. Pǎtraşcu [Pat10] shows a tight reduction from 3-SUM to listing 3-cliques; a reduction from listing 3-cliques to 3-SUM is given by Jafargholi and Viola [JV13]. Vassilevska and Williams [VW09] consider the exact edge-weight 3-clique problem and give a tight reduction from 3-SUM. For the case of k > 3, less is known, as the techniques used for the case of k = 3 do not seem to generalize easily. Abboud and Lewi [AL13] give reductions between k-SUM and various exact edge-weighted graph problems where the goal is to find an instance of a specific subgraph whose edge weights sum to 0. 2 Preliminaries For i < j ∈ Z, define [i, j] , {i, . . . , j}. As shorthand, we define [n] , [1, n]. For a vector v ∈ Zd , we denote by v[j] the value in the j th coordinate of v. We let 0 denote the all zeros vector. The default domain and range of a function is N. We define the k-Clique problem as follows. Definition 2.1 (The k-Clique Problem). For integers k, n, m > 0, the k-clique problem is to determine, given a graph G, if there is a size-k subset S ⊆ [n] such that S is a clique in G. The following problems are referred to in Corollary 3.2. They are simply the unparameterized versions of k-SUM and Exact Edge-Weight k-Clique, respectively. Definition 2.2 (The Subset-SUM Problem). The Subset-SUM problem P is to determine, given a set of integers x1 , . . . , xn , t, if there exists a subset S ⊆ [n] such that i∈S xi = t. Definition 2.3 (The Exact Edge-Weight Clique Problem). For integers n, m, M > 0, the Exact Edge-Weight k-Clique problem is to determine, given an instance of a graph G on n vertices and m edges, a weight function w : E(G) → [−M, M ], if there exists a set of nodes which form a clique with total weight 0. 3 From Numbers to Edges Our results begin by showing how to reduce k-SUM to k-Clique. To do this, we first give a new reduction from k-SUM to k-Vector-Sum on n vectors in C d for a set C which is relatively small compared to the numbers in the original instance. From k-Vector-Sum, we give a reduction to Edge-Weight k-Clique-Sum with small weights. Then, we can brute-force all possibilities for the  k 2 edge weights for k-SUM and reduce to the (unweighted) k-Clique problem. Altogether, we conclude that k-SUM is in W[1]. 5 3.1 Reducing k-SUM to k-Vector-Sum We present a generic way to map numbers into vectors over small numbers such that the k-sums are preserved. We define the k-Vector-Sum problem as follows. Definition 3.1 (The k-Vector-Sum Problem). For integers k, n, M, d > 0, the k-vector-sum problem (k, M )-VECTOR-SUM isPto determine, given vectors v1 , . . . , vn , t ∈ [0, kM ]d , if there is a size-k subset S ⊆ [n] such that i∈S vi = t. Note that the problem was considered by Bhattacharyya et al. [BIW+ 11] and also by Cattaneo and Perdrix [CP12]. Lemma 3.1. Let k, p, d, s, M ∈ N satisfy k < p, pd ≥ kM + 1, and s = (k + 1)d−1 . There is a collection of mappings f1 , . . . , fs : [0, M ] × [0, kM ] → [−kp, kp]d , each computable in time O(poly log M + kd ), such that for all numbers x1 , . . . , xk ∈ [0, M ] and targets t ∈ [0, kM ], k X j=1 xj = t ⇔ ∃ i ∈ [s] such that k X fi (xj , t) = 0. j=1 Proof. For x ∈ [0, kM ], define vx ∈ [0, p − 1]d to be the representation of x in base p—that is, let vx [1], . . . , vx [d] ∈ [0, p − 1] be unique integers such that x = vx [1] · p0 + · · · + vx [d] · pd−1 . Note that pd > kM . For every (d − 1)-tuple of numbers γ = (c1 , . . . , cd−1 ) ∈ [0, k]d−1 and a number t ∈ [0, kM ], define the vector τ γ to be such that  if j = 1  vt [1] + c1 · p, τ γ [j] = vt [j] − cj−1 + cj · p, if 2 ≤ j ≤ d − 1   vt [d] − cd−1 , if j = d Intuitively, each tuple γ represents a possible choice of the “carries” obtained in each component when computing the sum of their corresponding base-p numbers, and τ γ corresponds to the target vector in this base-p representation. Note that there are at most s = (k + 1)d−1 such vectors. We arbitrarily number these vectors as t1 , . . . , ts , and for all i ∈ [s] we define the mapping fi (x, t) = k · vx − ti . P Consider a set of k numbers S = {x1 , . . . , xk } ⊆ [0, M ]. We claim that kj=1 xj = t if and P only if there exists some i ∈ [s] such that kj=1 fi (xj , t) = 0. First observe that for any vectors Pk Pk u1 , . . . , uk , t ∈ Zd , j=1 uj = t. It suffices to show that j=1 (k · uj − t) = 0 if and only if Pk P d−1 such that kj=1 vxj = τ γ . j=1 xj = t if and only if there exists some γ ∈ [0, k] P For the first direction, t = ki=1 xi . We can write this equation in base-p representation as   ! k d−1 X k d−1 d−1 X X X X j j  vxi [j + 1] · pj . vxi [j + 1] · p  = vt [j + 1] · p = j=0 i=1 j=0 j=0 i=1 P P Therefore, ki=1 vxi [1] ∈ [0, k(p−1)] = vt [1]+c1 ·p for some c1 ∈ [0, k], c1 + ki=1 vxi [2] = c2 ·p+vt [2] Pk for some c2 ∈ [0, k], and so on. Finally, cd−1 + i=1 vxi [d] = vt [d]. Letting γ = (c1 , . . . , cd−1 ) ∈ P [0, k]d−1 , these equations imply exactly that ki=1 vxi = τ γ . 6 Pk d−1 = τ γ where γ = (c 1 , . . . , cd−1 ) ∈ [0,  k] . Again, Pk Pd−1 Pk j converting from base-p representation we obtain i=1 xi = j=0 i=1 vxi [j + 1] · p , and using the definition of τ γ we can write the sum of the variables in S as ! ! k k k X X X vxi [d] · pd−1 vxi [1] · p1 + · · · + xi = (vt [1] + c1 · p1 ) + For the other direction, suppose i=1 vxi i=1 i=1 i=1 1 1 = vt [1] + (vt [2] + c2 · p ) · p + · · · + 1 k X vxi [d] i=1 d−1 = · · · = vt [1] + vt [2] · p + · · · + vt [d] · p ! · pd−1 = t, which completes the proof. Corollary 3.1. Let k, p, d, M, n > 0 be integers with k < p and pd ≥ kM + 1. k-SUM on n integers in the range [0, M ] can be reduced to O(k d ) instances of (k, p − 1)-VECTOR-SUM on n vectors in [0, p − 1]d . 3.2 Reducing to k-Clique Here, we consider a generalization of the k-SUM problem—namely, the Node-Weight k-CliqueSum problem. We give a reduction from Node-Weight k-Clique-Sum to Edge-Weight k-Clique-Sum (defined below), where the new edge weights are much smaller than the original node weights. We then show how to reduce to many instances of the unweighted version of the problem, where each instance corresponds to a possible setting of edge weights. Then, we give an application of this general reduction to the Node-Weight k-Clique-Sum problem. Definition 3.2 (The Edge-Weight k-Clique-Sum Problem). For integers k, M > 0, the edge-weight k-clique-sum problem (k, M )-EW-CLIQUE is to determine, given a graph G, an edge-weight function w : E(G) → P[0, M ], and a target weight t ∈ [0, M ], if there is a set S of k nodes which form a clique such that (u,v)∈S w(u, v) = t. Lemma 3.2. Let k, p, d, M > 0 be integers such that k < p and pd ≥ kM + 1, and let M ′ = O(k3 dp2 ). The (k, M )-NW-CLIQUE problem can be deterministically reduced to O(k d ) instances of (k, M ′ )-EW-CLIQUE in time O(k d · n2 · poly log M ). Thinking of p + d as “small”, but poly(p, d) ≈ kM as “large”, we get a substantial reduction in the weights of the problem by “spreading” the node weights over the edges. Proof. Let G = (V, E) be a graph with a node weight function w : V → [0, M ] and a target number t ∈ [0, kM ]. Recall the mappings fi : [0, M ] × ×[0, kM ] → [−kp, kp]d for i ∈ [s] from Lemma 3.1, which maps numbers from [0, M ] into a collection of s = O(kd ) length-d vectors with entries in [−kp, kp]. We translate the node-weight vector problem into an edge-weight problem via a “squaring trick,” as follows. For each i ∈ [s], we define an edge weight function wi : E → [−M ′ , M ′ ]. For (u, v) ∈ E, let u = fi (w(u), t) and v = fi (w(v), t), and define wi (u, v) , d X j=1  u[j]2 + v[j]2 + 2(k − 1)u[j] · v[j] . 7 Note that for M ′ = O(kdp2 ), wi (u, v) ∈ [−M ′ , M ′ ]. We show that there is a k-clique in (G, w) of node-weight t if and only if for some i ∈ [s], the edge-weighted graph (G, wi ) contains a k-clique of edge-weight 0. First, observe that for any k vectors v1 , . . . , vk ∈ Zd , k X i=1 k d X X vi = 0 ⇐⇒ j=1 !2 vi [j] i=1 = 0. Consider a set S = {u1 , . . . , uk } ⊆ V that forms a k-clique in G. For any i ∈ [s] and ua , ub ∈ S, let ua = fi (w(ua ), t) and ub = fi (w(ub ), t). Then, the edge-weight of S in (G, wi ) is X 1≤a<b≤k wi (ua , ub ) = (k − 1) k X d X a=1 j=1 ua [j]2 + 2(k − 1) X d X 1≤a<b≤k j=1 ua [j] · ub [j]. Since the sum is evaluated over all pairs a, b ∈ [k] where a < b, the above quantity is equal to (k − 1) · d X X j=1 !2 fi (w(u), t)[j] u∈S . Therefore, for all i ∈ [s], the edge-weight of S in (G, wi ) equals 0 if and only if the sum of the P vectors u∈S fi (w(u), t) equals 0. And, by the properties of the mappings fP i from Lemma 3.1, the latter occurs for some i ∈ [s] if and only if the node-weight of S in (G, w), u∈S w(u), is equal to t, as desired. We observe that in the graphs produced by the above reduction, all k-cliques have non-negative weight. Therefore, Lemma 3.2 can also be viewed as a reduction to the “minimum-weight” k-Clique problem with edge weights, where the edge sum is minimized. Finally, small weights on edges can simply be eliminated using a brute-force step. k Lemma 3.3. For all integers k, M > 0, there is an O(M ( 2) · n2 ) time reduction from the problem  k (k, M )-EW-CLIQUE to O(M (2) ) instances of k-Clique on n nodes and m · k2 edges. Proof. Let G = (V, E) be an edge-weighted graph with weight function w : E → P [−M, M ]. For all k possible 2 -tuples α = (α1,2 , α1,3 , . . . , αk−1,k ) of integers from [−M, M ] such that i<j αi,j = 0, we make a k-partite graph Gα with |V | nodes in each part—that is, V (Gα ) = {(v, i) | i ∈ [k], v ∈ V }. We put an edge in Gα between node (u, i) and node (v, j) if and only if i < j, (u, v) ∈ E, and k w(u, v) = αi,j . Observe that O(M ( 2) ) graphs Gα are generated. We claim that G has a k-clique of weight 0 if and only if at least one of the unweighted graphs Gα contains a k-clique. For the first direction, assume that for some α = (α1,2 , α1,3 , . . . , αk−1,k ), the graph Gα contains a k-clique. Then, by the k-partite construction, it must have the form {(v1 , 1), . . . , (vk , k)} ⊆ V (Gα ). Now let S = {v1 , . . . , vk } ⊆PV and note that by the construction of Gα , S must form a k-clique in G with weight equal to i<j αi,j = 0. For the other direction, assume {u1 , . . . , uk } ⊆ V is a  k-clique in G of weight 0, then consider the k2 -tuple α = (w(u1 , u2 ), w(u1 , u3 ), . . . , w(uk−1 , uk )). Then, by definition, Gα contains the k-clique {(u1 , 1), . . . , (uk , k)}. 8 3.3 k-SUM is in W[1] Using the above lemmas, we can efficiently reduce k-SUM to k-Clique. Consider a k-SUM instance (S, t) where S = {x1 , . . . , xn } ⊆ [0, M ] and t ∈ [0, kM ] with M = n2k . Let G = (V, E) be a node-weighted clique on n nodes V = {v1 , . . . , vn } with weight function w : V → [0, M ] such that w(vi ) = xi for all i ∈ [n]. Clearly, (S, t) has a k-SUM solution if and only if the instance (G, w, t) of (k, M )-NW-CLIQUE has a solution. Set d = ⌈log n/ log log n⌉ and p = ⌈log4k n⌉, so that pd ≥ (n)4k > kM . Using Lemma 3.2 the instance (G, w, t) of (k, M )-NW-CLIQUE can be reduced to O(kd ) = O(nlog k/ log log n ) instances of (k, M ′ )-EW-CLIQUE, where M ′ = O(k3 · log8k+1 n/ log log n). Then, using Lemma 3.3, we can log k 2 2 generate g(n, k) = O(n log log n · k3k log8k +k n) graphs on n nodes and O(n2 ) edges such that some graph has a k-Clique if and only if the original k-SUM instance has a solution. For constant k, note that g(n, k) = no(1) , and hence: Theorem 3.3. For any c > 2, if k-Clique can be solved in time O(nc ), then k-SUM can be solved in time nc+o(1) . Furthermore, we remark that by applying the above reduction from k-SUM to k-Clique to the respective unparameterized versions of these problems, we obtain a reduction from Subset-SUM on arbitrary weights to Exact Edge-Weight Clique with small edge weights. Corollary 3.2. For any ε > 0, Subset-SUM on n numbers in [−2O(n) , 2O(n) ] can be reduced to 2εn instances of Exact Edge-Weight Clique on n nodes with edge weights are in [−nO(1/ε) , nO(1/ε) ]. Note that Subset-SUM on n numbers in [−2O(n) , 2O(n) ] is as hard as the general case of Subset-SUM (by Lemma B.1), and the fastest known algorithm for Subset-SUM on n numbers runs in time O(2n/2 ). The unweighted Max-Clique problem, which asks for the largest clique in a graph on n nodes, can be solved in time O(2n/4 ) [Rob01]. Corollary 3.2 shows that even when the edge weights are small, the edge-weighted version of Max-Clique requires time Ω(2n/2 ) unless Subset-SUM can be solved faster. An FPT Reduction. We show how to make the reduction fixed-parameter tractable. We can modify the oracle reduction for k-Clique above to get a many-one reduction to k-Clique if we simply take the disjoint union of the g(n, k) k-Clique instances as a single k-Clique instance. The resulting graph has n · g(n, k) nodes, O(n2 · g(n, k)) edges, and has a k-clique if and only if one of the original graphs has a k-Clique. Then, we make the following standard argument to appropriately bound g(n, k) via case analysis. If k < ⌈log log n⌉, then g(n, k) ≤ no(1) · 2f (k)·poly(k) . If k ≥ ⌈log log n⌉, k k then since n ≤ 22 , we have that g(n, k) ≤ 22 +f (k)·poly(k) . Therefore, g(n, k) ≤ no(1) · h(k) for some computable h : N → N, and we have shown the following: Lemma 3.4. k-SUM is in W[1]. In Appendix B, we show how to obtain a randomized FPT reduction from the k-SUM problem over the integers to k-Clique, and how under plausible circuit lower bound assumptions, we can derandomize this reduction to show that k-SUM over the integers is in W[1]. This yields the first half of Theorem 1.2 (and we show the remainder, that k-SUM is W[1]-hard, in the next section). 9 3.4 Node-Weight k-Clique-Sum The reduction of Section 3.3 shows that the Node-Weight k-Clique-Sum problem can be reduced to no(1) instances of k-Clique, when k is a fixed constant. We observe that if the input graph has m edges, then the graphs generated by the reduction have no more than k2 m edges. Therefore, we have a tight reduction from node-weight clique to k-Clique. This concludes the proof of the first half of Theorem 1.5 referencing k-Clique. We defer the proof of the second half of Theorem 1.5 concerning k-Dominating Set to Appendix C. 4 From k-Clique to k-SUM In this section, we give a new reduction from k-clique to k-SUM in which the numbers generated are all in the interval [−n2k , n2k ]. This proves that k-SUM is in fact W[1]-hard. We can view the result as an alternate proof for the W[1]-hardness of k-SUM without use of the Perfect Code problem, as done by Downey and Fellows [DF92]. The reduction is given from k-Clique to k-Vector-Sum (recall Definition 3.1), and then from k-Vector-Sum to k-SUM. Lemma  4.1. For an integer k > 1, k-Clique on n nodes and m edges reduces to an instance of (k + k2 , k · n1+o(1) )-VECTOR-SUM deterministically in time O(n2 ). Proof. Given a graph G = (V, E) we reduce an instance of k-Clique to an instance of k-Vector-Sum. First, we construct a k-sum-free set D ⊆ [Q] of size n, where Q can be bounded by n1+o(1) , and uniquely associate each vertex v ∈ V with an element qv ∈ D. By Lemma A.1, the set D can be constructed in time poly(n). Let {e1 , . . . , ed } be the standard basis of Rd . Let T = Q(k − 1) + 1, d = k 2 + k + 1, and define j · ei to be the length-d vector (1-indexed) with entry i consisting of the value j and all other entries being 0. We define a mapping η : (V × [k]) ∪ (E × [k] × [k]) → [0, T ]d from the vertices and edges of the graph to length-d vectors over [0, T ]. For each vertex v ∈ V and i ∈ [k], define η(v, i) , (T − (k − 1)qv ) · ei + ed and for each edge e = (u, v) ∈ E and i, j ∈ [k] with i < j, define η(e, i, j) , qu · ei + qv · ej + ek·i+j . P P Define the target vector t = k · ed + ( ki=1 T · ei ) + ( i,j∈[k],i<j ek·i+j ). Then, there is a k-clique in the instance G of k-Clique on n nodes and m edges if and only if there is a solution  to the instance I = ({η(v, i) | v ∈ V, i ∈ [k]} ∪ {η(e, i, j) | e ∈ E, i, j ∈ [k], i < j}, t) of (k + k2 , T )-VECTOR-SUM. We now show correctness of the reduction. First, assume S = {u1 , . . . , uk } ⊆ V forms a k-clique in G. Let E(S) be the set of edges between vertices in S. We claim the set A = {η(uj , j) | uj ∈ S} ∪ {η(e, i, j) | e = (ui , uj ) ∈ E(S), i < j},  P P with |A| = k + k2 , is a solution to the instance I. To see this, consider v∈A v = uj ∈S η(uj , j) + P e=(ui ,uj )∈E(S) η(e, i, j) and note that it equals k X j=1 k  X (k − 1)qvj · ej + (T − (k − 1)qvj ) · ej + ed + j=1 10 X i,j∈[k],i<j ek·i+j = t. For the other direction, consider some subset of vectors A ⊆ {η(v, P i) | v ∈ V, i ∈ [k]}∪{η(e, i, j) | k e ∈ E, i, j ∈ [k], i 6= j} of size k + 2 for which the sum z = v∈A v equals the target vector t. Let AV ⊆ V × [k] represent the set of pairs (u, i) for u ∈ V and i ∈ [k] such that η(u, i) ∈ A. Similarly, let AE ⊆ E × [k] × [k] represent the set of triples (e, i, j) for e ∈ E and i, j ∈ [k] such that η(e, i, j) ∈ A. Recall that t[d] = k and therefore by the definition of the mapping η from vertices to vectors, k |AV | must equal k. Since |A| = |AV | + |AE |, it follows that |AE | = 2 . Moreover, for all i, j ∈ [k] with i < j, since we defined t[k · i + j] = 1, there is exactly one triple in AE of the form (e, i, j). This implies that for every j ∈ [k], there is at least one pair (u, j) ∈ AV , for otherwise z[j] would be the sum of only (k − 1) numbers from D ⊆ [Q], and since t[j] = T > Q(k − 1), this sum cannot equal t[j]. Note that |AV | = k, and so for each j ∈ [k] there is exactly one pair (u, j) ∈ AV . Denote this vertex u by uj . For each j ∈ [k], let e1 , . . . , ek−1 be the k − 1 edges in E such that for each i ∈ [k − 1], either (ei , y, j) ∈ AE or (ei , j, y) ∈ AE for some y ∈ [k]. If the former holds, then let ei = (x, vi ) and if the latter holds, let ei = (vi , x) for some x, vi ∈ V . We claim that for i ∈ [k − 1], vi must be identical to uj . To see this, note that by the definition of the vectors, for all j ∈ [k], Pk−1 Pk−1 z[j] = η(uj , j)[j] + i=1 η(ei , i, j)[j] = T − (k − 1)quj + i=1 qvi , and since z[j] = t[j] = T , it Pk−1 must be the case that i=1 qvi = (k − 1)quj . Then, since D is k-sum-free, this implies that uj = vi for all i ∈ [k − 1], which concludes the claim. Therefore, the vectors in AV correspond to k vertices V (A) ⊆ V and the vectors in AE correk spond to 2 edges E(A) ⊆ E such that precisely k − 1 edges are incident to each vertex in V (A). Thus, each edge must be incident to two vertices in V (A), and so the vertices in V (A) along with the edges in E(A) form a k-clique in G. The following lemma gives a simple reduction from k-Vector-Sum to k-SUM, by the usual trick of converting from vectors to integers (via a Freiman isomorphism of order k). Lemma 4.2. (k, M )-VECTOR-SUM can be reduced to k-SUM on n integers in the range [0, (kM +1)d ] in O(n log M ) time. Proof. Let p = kM + 1. Let v1 , . . . , vn be the n vectorsPof a k-Vector-Sum instance with target t. Pd−1 d−1 d−1 j For each vector vi = hvi [j]ij=0 , define the integer xi , j=0 vi [j] · p , and define t = j=0 tj · pj . Then the k-SUM instance ({xi }i∈[n] , t) has a solution if and only if the k-Vector-Sum instance ({vi } , t) has a solution. For correctness, let S = {i1 , . . . , ik } be a set of k indices. Then, P i∈[n] P Pℓ−1 vi [j] · pj . By switching the order of the summations, we have that this i∈S xi = i∈S Pℓ−1 Pj=0 P quantity is j=0 i∈S vi [j] · pj . P Since i∈S vi [j] ∈ [0, p − 1], we conclude by the uniqueness of the representation of t that tj = i∈S vi [j] for all integers j ∈ [0, d − 1]. Hence, the k-Vector-Sum instance has a solution described by the index set S as well. For the other direction, if tj = P Pd−1 Pd−1 P j j i∈S vi [j] for all j ∈ [0, d − 1], then j=0 tj · p = j=0 i∈S vi [j] · p . The P left side is equal to t P and, by a switch of the order of summations, the right side is equal to i∈S xi . Therefore, t = i∈S xi and so the k-SUM instance has a solution described by the index set S, as desired. We remark that in some cases, the proof can be changed slightly to yield smaller numbers in the k-SUM instance produced by the reduction. In particular, when reducing k-Clique to k-Vector-Sum, only the numbers in the first k coordinates can be as large as k·n1+o(1) while the numbers in the last  k2 +1 coordinates are bounded by k, and therefore, when reducing to (k + k2 , M )-SUM on kn+ k2 m 11 2 2 k+o(k) 2k numbers, the numbers generated can be bounded by M = kd ·(kn1+o(1) )k ·kk +1 = O(k h √·n √ i). ′ ′ In other words, we have reduced k-Clique to k′ -SUM with numbers in the range −n k , n k ,  where k′ = k + k2 . The composition of Lemma 4.1 and Lemma 4.2 yields an FPT reduction, and we have obtained: Lemma 4.3. k-SUM is W[1]-hard. This concludes the proof of Theorem 1.2. Acknowledgements. We would like to thank the anonymous reviewers for their helpful comments. This work was supported in part by a David Morgenthaler II Faculty Fellowship, and NSF CCF-1212372. References [AC05] N. Ailon and B. Chazelle. Lower bounds for linear degeneracy testing. J. ACM, 52(2):157–171, 2005. [AL13] A. Abboud and K. Lewi. Exact Weight Subgraphs and the k-Sum Conjecture. In ICALP (1), pages 1–12, 2013. [AW14] A. Abboud and V. V. Williams. Popular conjectures imply strong lower bounds for dynamic problems. CoRR, abs/1402.0054, 2014. [AYZ97] N. Alon, R. Yuster, and U. Zwick. Finding and counting given length cycles. Algorithmica, 17(3):209–223, 1997. [BDP08] I. Baran, E. D. Demaine, and M. Pǎtraşcu. Subquadratic algorithms for 3SUM. Algorithmica, 50(4):584–596, 2008. [Beh46] F. A. Behrend. On sets of integers which contain no three terms in arithmetical progression. NAS of the United States of America, 32(12):331, 1946. [BHP01] G. Barequet and S. Har-Peled. Polygon Containment and Translational MinHausdorff-Distance Between Segment Sets are 3SUM-Hard. Int. J. Comput. Geometry Appl., 11(4):465–474, 2001. [BI07] J. F. Buss and T. Islam. Algorithms in the W-Hierarchy. Theory Comput. Syst., 41(3):445–457, 2007. [BIW+ 11] A. Bhattacharyya, P. Indyk, D. P. Woodruff, and N. Xie. The complexity of linear dependence problems in vector spaces. In ICS, pages 496–508, 2011. [Ces02] M. Cesati. Perfect Code is W[1]-complete. Inf. Process. Lett., 81(3):163–168, 2002. [CL09] A. Czumaj and A. Lingas. Finding a heaviest vertex-weighted triangle is not harder than matrix multiplication. SIAM J. Comput., 39(2):431–444, 2009. 12 [CP12] D. Cattanéo and S. Perdrix. The parameterized complexity of domination-type problems and application to linear codes. CoRR, abs/1209.5267, 2012. [DF92] R. G. Downey and M. R. Fellows. Fixed-parameter intractability. In Structure in Complexity Theory Conference, pages 36–49, 1992. [DF95] R. G. Downey and M. R. Fellows. Fixed-parameter tractability and completeness II: On completeness for W[1]. Theor. Comput. Sci., 141(1&2):109–131, 1995. [EG04] F. Eisenbrand and F. Grandoni. On the complexity of fixed parameter clique and dominating set. Theor. Comput. Sci., 326(1-3):57–67, 2004. [Eri95] J. Erickson. Lower bounds for linear satisfiability problems. In SODA, pages 388–395, 1995. [FG06] J. Flum and M. Grohe. Parameterized Complexity Theory. Springer Verlag, 2006. [GO95] A. Gajentaan and M. H. Overmars. On a class of O(n2 ) problems in computational geometry. Computational Geometry, 5(3):165 – 185, 1995. [GP14] A. Grønlund and S. Pettie. Threesomes, Degenerates, and Love Triangles. CoRR, abs/1404.0799, 2014. [HB96] A. Hernández-Barrera. Finding an O(n2 log n) Algorithm Is Sometimes Hard. In CCCG, pages 289–294, 1996. [IR77] A. Itai and M. Rodeh. Finding a minimum circuit in a graph. STOC ’77, pages 1–10, New York, NY, USA, 1977. ACM. [JV13] Z. Jafargholi and E. Viola. 3SUM, 3XOR, Triangles. CoRR, abs/1305.3827, 2013. [KvM02] A. Klivans and D. van Melkebeek. Graph nonisomorphism has subexponential size proofs unless the polynomial-time hierarchy collapses. SIAM J. Comput., 2002. [NP85] J. Nešetřil and S. Poljak. On the complexity of the subgraph problem. Commentationes Mathematicae Universitatis Carolinae, 26(2):415–419, 1985. [NSS95] M. Naor, L. J. Schulman, and A. Srinivasan. Splitters and near-optimal derandomization. In FOCS, pages 182–191, 1995. [NvLvdZ12] J. Nederlof, E. J. van Leeuwen, and R. van der Zwaan. Reducing a target interval to a few exact queries. In MFCS, pages 718–727, 2012. [O’B11] K. O’Bryant. Sets of integers that do not contain long arithmetic progressions. Electr. J. Comb., 18(1), 2011. [Pat10] M. Patrascu. Towards polynomial lower bounds for dynamic problems. In STOC, pages 603–610, 2010. [PW10] M. Pǎtraşcu and R. Williams. On the Possibility of Faster SAT Algorithms. In SODA, pages 1065–1075, 2010. 13 [Rob01] J. M. Robson. Finding a maximum independent set in time O(2n/4 ). Technical report, 1251-01, LaBRI, Université de Bordeaux I, 2001. [VW06] V. Vassilevska and R. Williams. Finding a maximum weight triangle in n3-delta time, with applications. In STOC, pages 225–231, 2006. [VW09] V. Vassilevska and R. Williams. Finding, minimizing, and counting weighted subgraphs. In STOC, pages 455–464, 2009. [VWY06] V. Vassilevska, R. Williams, and R. Yuster. Finding the smallest h-subgraph in real weighted graphs and related problems. In ICALP (1), pages 262–273, 2006. A Additional Preliminaries We review some useful combinatorial results that are needed in Section 4. Definition A.1 ((n, k)-perfect hash function family). For integers n, k, s > 0, a set of functions F = {fi }i∈[s] where fi : [n] → [k] is a (n, k)-perfect hash function family of size s if and only if for every size-k subset S ⊆ [n], there exists some fi ∈ F such that ∪j∈S fi (j) = [k]. Proposition A.1 (cf. [NSS95, Theorem 3]). An (n, k)-perfect hash function family of size ek · kO(1) log n can be constructed deterministically in time kO(k) · poly(n). Lemma A.1. For any ε > 0, there exists a c > 0 such that a k-sum-free set S of size n with S ⊂ [0, (ckn)1+ε ] can be constructed in poly(n) time. Definition A.2 (k-sum-free set). For any kP ≥ 2, a set S ⊆ Z is a k-sum-free set if and only if for all (not necessarily distinct) x1 , . . . , xk ∈ S, i∈[k−1] xi = (k − 1) · xk implies that x1 = · · · = xk . We outline a construction of a k-sum-free set, derived from a small modification to Behrend’s original construction [Beh46]. Constructing k-sum-free Sets. For a vector v, let kvk represent the ℓ2 norm of v, and let |hv1 , v2 i| represent the dot product of two vectors v1 and v2 . Let p =P (k − 1)d − 1. Consider i the set Sr (m, d) consisting of all integers x that can be written as x = m−1 i=0 ai p , where for all √ i ∈ [0, m P − 1], ai ∈ [0, d − 1] and kha0 , . . . , am−1 ik = r. For an integer x ∈ Sr (m, d) of the form x = i∈[0,m−1] ai · pi , let kxk represent the ℓ2 norm of the vector hai ii∈[0,m−1] . By definition, √ kxk = r. P P Claim A.1. For any vectors v1 , . . . , vk , if kv1 k = · · · = kvk k and i∈[k] kvi k = i∈[k] vi , then v1 = · · · = vk . Proof. Note that 2 X i∈[k] vi = X hvi , vi i + 2 i∈[k] X i,j∈[k],i<j |hvi , vj i| = X i∈[k] kvi k2 + 2 X i,j∈[k],i<j |hvi , vj i|. By the Cauchy-Schwarz inequality, |hvi , vj i| ≤ kvi k·kvj k. Thus, in order for the above quantity P 2 to be equal to i∈[k] kvi k , it must be the case that |hvi , vj i| = kvi k·kvj k for all i, j ∈ [k]. Hence, 14 also by Cauchy-Schwarz, vi and vj are linearly dependent. Then, using the fact that kvi k = kvj k, it follows that vi = vj for all pairs i, j ∈ [k], which completes the proof. Lemma A.2. For all integers k ≥ 2, for all ℓ ∈ [0, m(d − 1)2 ], Sℓ is k-sum-free. P P Proof. Let x1 , . . . , xk ∈ Sℓ (m, d) be such that i∈[k−1] xi = (k − 1) · xk . Then, k i∈[k−1] xi k = (k − 1) · kxk k. Since kx1 k = kx2 k = · · · = kxk k, it follows that X i∈[k−1] kxi k = X xi . i∈[k−1] Hence, by Claim A.1, it follows that x1 = · · · = xk . There are dm possible settings for a0 , . . . , am−1 where each ai ∈ [0, d − 1], and the value khai ii∈[0,m−1] k2 lies within the range [0, m(d − 1)2 ]. Hence, by the pigeonhole principle, there exists dm m−2 /m. Note that S (m, d) ⊂ [0, pm ]. some r ∈ [0, m(d − 1)2 ] such that |Sr (m, d)| ≥ m(d−1) 2 +1 ≥ d r 1 Hence, to obtain a k-sum-free set of size n, we have that d = (m · n) m−2 . Recall that p = Θ(kd), m and so pm = O(kmn) m−2 . For any ε > 0, we can set m = 2/ε + 2 so that pm = (ckn)1+ε for some constant c > 0. Hence, Sr (m, d) ⊂ [0, (ckn)1+ε ]. For any n, we can compute, for each ℓ ∈ [0, m(d − 1)2 ], the exact size of Sℓ (m, d), returning the ℓ for which |Sℓ (m, d)| is maximized. Note that m(d − 1)2 = O(nε ), and the construction of Sℓ (m, d) requires time linear in |Sℓ (m, d)|. Lemma A.1 follows. A.1 Background on Parameterized Complexity For an exposition of fixed parameter tractability, reducibility, and the W-hierarchy, we refer the reader to [DF92, DF95, FG06]. Here we give a brief overview. A parameterized problem is defined to be a subset of {0, 1}⋆ × N. Let L, L′ be parameterized problems. L is in the class FPT if there is an algorithm A, constant c, and computable function f : N → N, such that on all inputs y = (x, k), A(y) decides whether y is in L and runs in time at most f (k)·|x|c . A FPT reduction from L to L′ is an algorithm R mapping {0, 1}⋆ ×N to {0, 1}⋆ ×N, such that for all y = (x, k), R(y) ∈ L′ if and only if y ∈ L, R(y) runs in f (k) · |x|c time (for some c and f ), and R(y) = (x′ , k′ ) where k′ ≤ g(k) for some computable function g. Although it is not the original definition, it is equivalent to define W[1] to be the class of parameterized problems which have an FPT reduction to k-Clique [DF95, FG06]. B A Deterministic FPT Reduction from k-SUM to k-Clique In this section we show how, by assuming a plausible circuit lower bound assumption, we are able to strengthen our result from Section 3.3 to a reduction from general k-SUM to k-Clique (as opposed to only reducing k-SUM on numbers in [−n2k , n2k ] to k-Clique). To do this, we give a randomized process which takes a k-SUM instance and outputs a collection of k-SUM instances on numbers in [−n2k , n2k ] which, with high probability, are such that a member of the collection contains a solution if and only if the original k-SUM instance contains a solution. Then, we apply a theorem which allows us to derandomize this reduction given the appropriate circuit lower bound. 15 A Randomized Weight Reduction. We first define a randomized process (cf. [KvM02, Definition 4.1]) consisting of an algorithm F along with a predicate π. In what follows, the algorithm F will represent a (randomized) oracle reduction from general k-SUM to k-SUM on numbers in [−n2k , n2k ] which succeeds on some random bit sequences, and the predicate π represents whether or not the input random bit sequence is such that F produces a valid oracle reduction. Let z = O(k · poly log n), and let D represent the domain of k-SUM instances on n integers. Let F : D × {0, 1}z → D k be a process which takes as input x a k-SUM instance along with a random bit sequence r ∈ {0, 1}z . Let the instance x describe a k-SUM instance consisting of a set S of n integers in the range [0, M ] with target value 0 (without loss of generality). F uses the sequence of random bits r to choose a prime p ∈ [2, dnk log n log(kM )] by picking random integers within the interval until a prime is obtained. Let S ′ represent the set of integers derived by taking each integer in S modulo p. The output of F is a collection of k instances of k-SUM, each with base set S ′ , and the ith instance has target value i · p, for i ∈ [0, k − 1]. Let π : D × {0, 1}z → {0, 1} be a predicate which takes as input x a k-SUM instance along with a random bit sequence r ∈ {0, 1}z and outputs a single bit. The predicate π(x, r) runs F (x, r) to obtain a collection C of k instances of k-SUM, and outputs 1 if and only if the k-SUM instance x has a solution and there exists some k-SUM instance in C which does not have a solution, or, the original k-SUM instance does not have a solution and none of the k-SUM instances in C have a solution. The following lemma is folklore, and also informally stated in [BDP08], but we provide a proof here for completeness, as it also justifies Proposition 1.1. Lemma B.1. Let k, n, M, M ′ > 0 be integers such that M ′ = O(knk log n log(kM )), and let d > 0 be a sufficiently large constant. Let C be the collection of k-SUM instances output by F on input x, a k-SUM instance on n integers in the range [0, M ], and a random bit sequence r ∈ {0, 1}z . Then, each k-SUM instance in C is on n integers in the range [0, M ′ ], and π(x, r) = 1 with probability at least 1 − 1/(cd). for some fixed constant c > 0. Proof. Let S be the set of integers of the k-SUM instance. For a sufficiently large constant d > 0, for a randomly chosen prime p ∈ [2, d · nk log n log(kM )], consider the new set S ′ where we take all integers of S modulo p. Clearly, if S has a k-SUM solution, then S ′ also has a solution, and hence, there exists a member of the collection of k-SUM instances output by F which contains a solution. For any k-tuple of integers in [0, M ] with nonzero sum s, we have s ∈ [kM ] so s has at most log(kM ) prime factors. By the prime number theorem, for sufficiently large n, there are at least cd · nk log(kM ) primes in this interval for a fixed constant c > 0, and so the probability that p is a prime factor of s is at most   1 log(kM ) ≤ . cdnk log(kM ) cd · nk By a union bound over all k-tuples of numbers from S ′ , the probability of a false positive in S ′ is at most 1/(cd). We have shown that if the k-SUM instance S with target value 0 does not contain a solution, then with probability at least 1 − 1/(cd) over the choice of a random prime p, S does not contain a k-tuple of integers which sum to a multiple of p, and hence, there does not exist a member of the collection of k-SUM instances output by F which contains a solution. Finally, we can remove the “modulo p” constraint from S ′ as follows. Treating all elements in ′ S as integers in [0, p − 1], for each zP ∈ {−k · p, . . . , −p, 0, p, . . . , k · p} we reduce to checking whether ′ there are x1 , . . . , xk P ∈ S such that i xi = z (where this sum is over the integers). Such a k-tuple exists if and only if i xi equals 0 mod p. 16 Derandomizing the Reduction. Let B be an oracle for SAT, and assume there exists a function f ∈ E with B-oracle circuit complexity 2εn for some ε > 0. We note that, for all k-SUM instances x and random bit sequences r, π(x, r) can be decided by a B-oracle circuit of size na for some positive constant a, since we can construct a circuit which creates and then solves the k-SUM instances to check the predicate. We also have by Lemma B.1 that for all x, for uniformly sampled r ∈ {0, 1}z , Pr[π(x, r) = 1] with probability 1 − 1/(cd), where c is a universal constant and d can be chosen to be arbitrarily large. We now apply the following derandomization theorem due to Klivans and van Melkebeek [KvM02]. Theorem B.1 (cf. [KvM02, Theorem 4.4]). Let B be an oracle, b a positive constant, and ℓ : N → N a constructible function. Let (F, π) be a randomized process using a polynomial number of random bits such that B can efficiently check (F, π). If there exists a Boolean function f ∈ E such that CfB (ℓ(n)) = Ω(n), then there exists a function G computable in E and a constructible function s(n) = O(ℓ2 (nO(1) )/ log n) such that for any input x of length n, |Prr [π(x, r) = 1] − Prs [π(x, G(s)) = 1]| ≤ O(1/nb ) where r is uniformly distributed over {0, 1}r(n) and s over {0, 1}s(n) . By applying Theorem B.1 with ℓ(n) = log n, there exists a constant s > 0 and an efficiently computable function G computable in with seed length s log n such that for any input x of length n, |Pr[π(x, r) = 1] − Pr[π(x, G(σ)) = 1]| = O(1/nb ). By choosing d = Ω(n), we have that Pr[π(x, G(σ)) = 1] ≥ 1 − 1/n. The Deterministic FPT Reduction. Given an instance x of k-SUM, for each σ ∈ {0, 1}s log n , let Cσ be the collection of instances of k-SUM output by F (x, G(σ)). Note that Cσ is in fact a collection of instances of k-SUM on numbers in [−n2k , n2k ] by Lemma B.1. Hence, as described in Section 3.3, we can reduce each member of Cσ to an instance of k-Clique—let Sσ represent this collection of k-Clique instances, obtained by applying the reduction to each member of Cσ . Let S ∗ be a family of k-Clique instances obtained by taking the union of Sσ over all σ ∈ {0, 1}s log n . The original k-SUM instance x contains a solution if and only if at least a 1/n fraction of the members of S ∗ contain a k-Clique. To see the correctness of this deterministic reduction, note that at most a 1/n fraction of σ ∈ {0, 1}s log n are such that π(x, G(σ)) = 0. For all other seeds σ, π(x, G(σ)) = 1 and the process F correctly reduces its input x to a collection of k-SUM instances. Therefore, if x contains a solution, then all members of S ∗ will contain a k-Clique, and if x does not contain a solution, then at most a 1/n fraction of the members of S ∗ could possibly contain a k-Clique. As the constant s in the seed length is fixed, we note that the process F also runs in time polynomial in its input and therefore our reduction is FPT. We have shown the following theorem. Theorem B.2. Let B be an oracle for SAT. If there is a function f ∈ E with B-oracle circuit complexity 2εn for some ε > 0, then k-SUM ∈ W[1]. We note that the oracle B can be replaced with any oracle sufficient to efficiently compute the predicate π—for example, Theorem B.2 follows where B is an oracle for k-SUM. 17 C Node-Weight Dominating Set Lemma C.1. For every fixed k ≥ 2, Node-Weight k-Dominating-Set-Sum can be reduced to no(1) instances of k-Dominating Set on graphs on O(k2 n) nodes. The reduction runs in n2+o(1) time. Proof. Given a node-weighted graph G = (V, E), w : V → [−n2k , n2k ], we first use Lemma 3.1 with d = O(log n/ log log n) and p = O(k2k log n) to get s = O(nlog k/ log log n ) = no(1) instances of the problem where the weight of every node is a vector in [p]d instead of a number in [−n2k , n2k ]. We treat each instance i ∈ [s] separately, as follows. For a pair of nodes u, v ∈ V , let their weights be u, v ∈ [p]d and define the expression F (u, v) = d X j=1  u[j]2 + v[j]2 + 2(k − 1)u[j] · v[j] , which corresponds to the “squaring trick” from Lemma 3.2. P k We enumerate over all 2 -tuples of numbers t = (αi,j )i,j∈[k] such that i,j αi,j = 0 where αi,j ∈ [−M, M ] where M = O(poly log n) is an upper bound on the F (u, v) values, and for each such tuple t we generate an instance of k-Dominating Set, an unweighted graph Gt . Note that the number of such tuples is logO(k) n = no(1) .  Let V0 , V1 , . . . , Vk , andSVi,j forSevery i < j, i, j ∈ [k] be k2 + k + 1 copies of the node set V . The node set of Gt is V0 ∪ i Vi ∪ i<j Vi,j . Let us denote the copy of node v in the set VX by vX . For every edge (u, v) ∈ E of G we add the edges (ui , v0 ) and (vi , u0 ), for every i ∈ [k], to Gt . We also make the copies V1 , . . . , Vk cliques by adding edges (vi , ui ) for every u, v ∈ V and i ∈ [k]. Note that this forces every k-dominating set in Gt to contain exactly one node vi in every set Vi , and that such k nodes dominate every node in V0 if and only if they correspond to a k-dominating set in G. Finally, we add the following edges that simulate “gaining edges” by allowing pairs of nodes ui , vj to be in a k-dominating set in Gt if and only if they are consistent with the tuple t which is chosen to guarantee that the total sum of weights is zero. For every pair of nodes u 6= v in G and indices i < j in [k] we add the edge (ui , vi,j ) to Gt and then check if F (u, v) = αi,j , and if so, we add the edge (uj , vi,j ) to Gt . We now claim that a subset S ⊆ V of size k is k-dominating set of weight zero in G if and only if the nodes S ′ = {xi(x) | x ∈ S} where i(x) is the index of x in an arbitrary ordering of S, are a k-dominating set in Gt , for some tuple t and some instance i ∈ [s]. To see this, first note that a set of k nodes S[1]1 ∈ V1 , . . . , S[k]k ∈ Vk are a dominating set in Gt if and only if S[1], . . . , S[k] are a dominating set in G and for every pair i < j in [k], the condition F (w(S[i]), w(S[j])) = αi,j is satisfied. By definition of our formulas F (·, ·) and the proofs of Lemmas 3.1, 3.2, and 3.3, we get that S[1]1 , . . . , S[k]k are a dominating set in Gt for some tuple t and instance i ∈ [s] if and only if S[1], . . . , S[k] are a dominating set in G of total weight zero. 18
8cs.DS
Limiting Distributions of Spectral Radii for Product of Matrices from the Spherical Ensemble arXiv:1801.06877v1 [math.ST] 21 Jan 2018 Shuhua Chang1 , Deli Li2 , Yongcheng Qi3 1 Coordinated Innovation Center for Computable Modeling in Management Science, Tian- jin University of Finance and Economics, Tianjin 300222, PR China. Email: [email protected] 2 Department of Mathematical Sciences, Lakehead University, Thunder Bay, ON P7B 5E1, Canada Email: [email protected] 3 Department of Mathematics and Statistics, University of Minnesota Duluth, 1117 Uni- versity Drive, Duluth, MN 55812, USA. Email: [email protected] Abstract. Consider the product of m independent n × n random matrices from the spherical ensemble for m ≥ 1. The spectral radius is defined as the maximum absolute value of the n eigenvalues of the product matrix. When m = 1, the limiting distribution for the spectral radii has been obtained by Jiang and Qi (2017). In this paper, we investigate the limiting distributions for the spectral radii in general. When m is a fixed integer, we show that the spectral radii converge weakly to distributions of functions of independent Gamma random variables. When m = mn tends to infinity as n goes to infinity, we show that the logarithmic spectral radii have a normal limit. Keywords: limiting distribution, spectral radius, spherical ensemble, product ensemble, random matrix 1 1 Introduction In the last few decades, random matrix theory has expanded very quickly and found applications in many areas such as heavy-nuclei (Wigner, 1955), condensed matter physics (Beenakker, 1997), number theory (Mezzadri and Snaith, 2005), wireless communications (Couillet and Debbah, 2011), and high dimensional statistics (Johnstone (2001, 2008) and Jiang (2009)), just to mention a few. Interested readers are referred to the Oxford Handbook of Random Matrix Theory edited by Akemann, Baik and Francesco (2011) for more references and a wide range of applications in both mathematics and physics. The study of the largest eigenvalues of Hermitian random matrices has been very active after the discovery of the so-called Tracy-Widom distributions. For the three Hermitian matrices including Gaussian orthogonal ensemble, Gaussian unitary ensemble and Gaussian symplectic ensemble, Tracy and Widom (1994, 1996) have proved that the largest eigenvalues converge in distribution to some distributions, now known as the Tracy-Widom laws. Later developments in this direction can be found in Baik et al. (1999), Tracy and Widom (2002), Johansson (2007), Johnstone (2001, 2008) and Jiang (2009), and Ramı́rez et al. (2011). The study of non-Hermitian matrices, initiated by Ginibre (1965) for Gaussian random matrices, has attracted much attention as well, and applications are found in areas such as quantum chromodynamics, chaotic quantum systems and growth processes; see, e.g., Akemann, Baik and Francesco (2011) for more descriptions. For non-Hermitian matrices, the largest absolute values of their eigenvalues are refereed to as the spectral radii. Rider (2003, 2004) and Rider and Sinclair (2014) consider the real, complex and symplectic Ginibre ensembles. In particular, for the complex Ginibre ensemble, Rider (2003) shows that the spectral radius converges in distribution to the Gumbel distribution. Jiang and Qi (2017) investigate the limiting distributions for the spectral radii for the spherical ensemble, truncation of circular unitary ensemble and product of independent matrices with entries being independent complex standard normal random variables. These limiting distributions are 2 no longer the Tracy-Widom laws. Gui and Qi (2018) further extend Jiang and Qi’s (2017) result for the truncations of circular unitary ensemble. A common feature for all these random matrices is the intrinsic independence structure for the absolute values of their eigenvalues, which is shared by certain determinantal point processes; see e.g., Hough et al. (2009). Let m ≥ 1 be an integer and assume X1 , · · · , Xm are m independent and iden- tically distributed (i.i.d.) n × n random matrices. The product of the m matrices is an n × n random matrix, denoted by X(m) = X1 X2 · · · Xm . (1.1) The product of random matrices have been applied in wireless telecommunication, disordered spin chain, the stability of large complex system, quantum transport in disordered wires, among others. See Ipsen (2015) for a survey of applications. Some recent interests focus on the study of the limiting properties of the product ensemble X(m) , including the limit of the empirical spectral distributions and the spectral radii. For example, Götze and Tikhomirov (2010), Bordenave (2011), O’Rourke and Soshnikov (2011) and O’Rourke et al. (2015) have investigated the limiting empirical spectral distribution for the product from the complex Ginibre ensemble when m is fixed, Götze, Kösters and Tikhomirov (2015) and Zeng (2016) have obtained the limits of the empirical spectral distribution for the product from the spherical ensemble when m is fixed, and Chang and Qi (2017) obtain the the limit of the empirical distributions based on scaled eigenvalues when m = mn changes with n. The universality of convergence for the empirical spectral distribution is also obtained by Bordenave (2011) and Götze, Kösters and Tikhomirov (2015) when m is a fixed integer. When the n2 entries of X1 are i.i.d. complex standard normal random variables, the limiting distribution for the spectral radii of X(mn ) depends on the limits of mn /n. Three different types of limiting distributions are obtained in Jiang and Qi (2017) when limn→∞ mn /n = 0, limn→∞ mn /n = α ∈ (0, ∞), and limn→∞ mn /n = ∞. 3 Assume that A and B are two n × n random matrices and all of the 2n2 entries of the matrices are i.i.d. standard complex normal random variables. A spherical ensemble is defined as X := A−1 B; see e.g., Hough et al. (2009). Denote z1 , · · · , zn as the eigenvalues of X. Then it follows from Krishnapur (2009) that the joint probability density function of the n eigenvalues is given by C1 · Y 2 |zj − zk | · j<k n Y 1 , (1 + |zk |2 )n+1 k=1 (1.2) where C1 is a normalizing constant. In this paper, we consider the product of m independent matrices from the spherical ensemble. We are interested in the limiting distributions of the spectral radii for the product ensemble X(m) when n goes to infinity. We also allow that m = mn changes with n. Let X1 , · · · , Xm be m independent and identically distributed n × n random matrices that have the same distribution as X defined above. The product ensemble X(m) is defined as in (1.1). Then we have from Adhikari et al. (2016) that the n eigenvalues z1 , · · · , zn of X(m) have a joint probability density function Cm · Y j<k 2 |zj − zk | · n Y wm (zk ), (1.3) k=1 where Cm is a normalizing constant and wm (z) can be expressed in terms of a Meijer G-function. A recursive formula for wm is obtained by Zeng (2016) as follows Z ∞ z 1 dr wk+1 (z) = 2π wk ( ) 2 n+1 r (1 + r ) r 0 for k ≥ 1 with initial w1 (z) = when m = 1. 1 . Clearly, (1.2) is a special case of (1.3) (1 + |z|2 )n+1 When m = 1, the limiting distribution has been obtained in Jiang and Qi (2017). In this paper, our objective is to obtain the limiting distributions for the spectral radii for the product ensemble X(m) in the following two cases: (a) m ≥ 1 is a fixed 4 integer, and (b) m = mn tends to infinity as n goes to infinity. We will show that the limiting distributions of the spectral radii can be expressed as the distributions of functions of independent Gamma random variables when m is fixed, and the limiting distributions for the logarithmic spectral radii are normal when m = mn diverges as n → ∞. The rest of the paper is organized as follows. The main results of the paper are introduced in Section 2, and their proofs are given in Section 3. 2 Main Results We assume that the product X(m) defined in (1.1) is the product of m i.i.d. random matrices from the spherical ensemble. Note that the eigenvalues z1 , · · · , zn of X(m) are complex random variables with the joint density distribution function given in (1.3). The spectral radius of X(m) is defined as Mn = max |zj |. (2.1) 1≤j≤n Let {Eijk , i ≥ 1, j ≥ 1, k ≥ 1} be i.i.d random variables with standard P2 exponential distribution (ie., Gamma(1) distribution). Set Γij [k1 : k2 ] = kk=k Eijk 1 Pi for any k2 ≥ k1 ≥ 1, i ≥ 1, j ≥ 1, and denote Γij = Γij [1 : i] = k=1 Eijk for i ≥ 1, j ≥ 1. Then Γij , j ≥ 1, i ≥ 1 are independent random variables and Γij has a Gamma(i) distribution with density function xi−1 e−x I(x > 0)/Γ(i), where I(A) denotes the indicator function of set A, and Γ(x) denotes the Gamma function defined as Γ(x) = Z ∞ tx−1 e−t dt, x > 0. 0 We have the following two theorems on the limiting distributions of the spectral radius Mn for the product ensemble X(m) . The two theorems reveal two different types of limiting distributions according to whether m is fixed or divergent. Theorem 2.1. Assume m ≥ 1 is a fixed integer. Then Mn d 1 → max Qm 1/2 m/2 1≤i<∞ n Γij j=1 5 as n → ∞, (2.2) d where → denotes convergence in distribution. Theorem 2.2. Assume that m = mn → ∞ as n → ∞. Then we have log Mn − µn d → N(0, 1) σn where µn = as n → ∞, (2.3) n−1 mn X 1 and σn2 = mn π 2 /24. 2 k=1 k Remark 1. The limiting distributions are expressed in terms of functions of independent Gamma random variables in Theorem 2.1. The random variable on the right-hand side of (2.2) is well defined. See Lemma 3.3 for a proof. Remark 2. There is no explicit form for the distribution of the random variable defined on the right-hand side of (2.2) except the case m = 1. In fact, if we define P xj Hi (x) = e−x i−1 j=0 j! for i ≥ 1, then for any x > 0 P( 1 1/2 Γi1 ≤ x) = P (Γi1 ≥ x−2 ) = Hi (x−2 ) for i ≥ 1, and consequently, the distribution of the random variable on the right-hand side of (2.2) when m = 1 is H(x) = P ( max 1≤i<∞ 1 1/2 Γi1 ≤ x) = P ( max 1 1≤i<∞ 1/2 Γi1 ≤ x) = ∞ Y Hi (x−2 ), x > 0. i=1 This is exactly what Jiang and Qi (2017) have obtained in their Theorem 1. Meanwhile, they have verified that 1 − H(x) ∼ heavy-tailed distribution. 1 x2 as x → ∞, and therefore, H(x) is a Remark 3. In Theorem 2.2, the limiting distributions are obtained for logarithmic spectral radius log Mn . It is possible to show that there do not exist real constants an and bn > 0 such that (Mn − an )/bn converges in distribution to a non-degenerate distribution function. 6 3 Proofs First, we will introduce some notation, and then present some important lemmas. The proofs of the two main results are given afterwards. d p Let = and → denote equality in distribution and convergence in probability. For a sequence of random variables Xn , n ≥ 1 and any sequence of positive constants d an , n ≥ 1, notation Xn = op (an ) means Xn /an → 0 as n → ∞. Notation Xn = Op (an ) implies that limc→∞ lim supn→∞ P (|Xn /an | > c) = 0. In particular, if Xn /an converges in distribution, then we have Xn = Op (an ). Let U1 , · · · , Un be independent random variables uniformly distributed over (0, 1) and define U(1) ≤ · · · ≤ U(n) as the order statistics of U1 , · · · , Un . Assume that {sj,r , 1 ≤ r ≤ m, 1 ≤ j ≤ n} are independent random variables, and the density of sj,r is proportional to y j−1 I(y (1+y)n+1 > 0) for 1 ≤ r ≤ m, 1 ≤ j ≤ n. Recall that Γ(x) denotes the Gamma function. Write ψ(x) = Γ′ (x)/Γ(x), x > 0, which is called the digamma function. Since ψ(x) =   Γ(b) = exp log Γ(b) − log Γ(a) = exp Γ(a) Z b a d dx log Γ(x), we have  ψ(x)dx for a > 0, b > 0. (3.1) Lemma 3.1. Let random variable Y have a Gamma(α) distribution and X = log(Y ). Then the moment generating function of X is given by β(t) := E(etX ) = Γ(α + t) Γ(α) for t > −α. Moreover, E(X) = ψ(α) and Var(X) = ψ ′ (α). Proof. Note β(t) = E(Y t ). We have for t > −α Z ∞ Z ∞ 1 Γ(α + t) 1 t α−1 −y y y e dy = y α+t−1 e−y dy = . β(t) = Γ(α) 0 Γ(α) 0 Γ(α) Then E(X) = β ′ (0) = Γ′ (α)/Γ(α) = ψ(α). Further, we have E(X 2 ) = β ′′ (0) = Γ′′ (α)/Γ(α). Hence we have Var(X) = E(X 2 ) − ψ 2 (α) = Γ′′ (α) Γ′ (α) 2 d Γ′ (t) −( ) = Γ(α) Γ(α) dt Γ(t) 7 t=α = ψ ′ (α). This completes the proof of the lemma.  Next, we collect some properties of the bigamma function ψ(x). Lemma 3.2. For the bigamma function ψ(x) we have a. (Formulas 6.3.18 in Abramowitz and Stegun (1972)) 1 1 ψ(x) = log x − +O 2 2x x as x → ∞. b. (Formula 6.3.2 in Abramowitz and Stegun (1972)) ψ(1) = −γ, ψ(n) = −γ + n−1 X 1 k=1 for n ≥ 2, k where γ = 0.57721 · · · is the Euler constant. c. (Formula 6.4.10 in Abramowitz and Stegun (1972)) ψ ′ (x) = ∞ X k=0 1 , (k + x)2 x > 0. From Lemmas 3.2 and 3.1 we have ∞ n−1 X X 1 1 π2 ψ (1) = = , ψ(n) − ψ(1) = 2 k 6 k k=1 k=1 ′ and Var(log Γij ) = ψ ′ (i). E(log Γij ) = ψ(i), Therefore, the constants µn and σn2 in Theorem 2.2 can be rewritten as µn = mn (ψ(n) − ψ(1)) and σn2 = mn π 2 /24 = mn ψ ′ (1) . 4 Lemma 3.3. For each fixed integer m ≥ 1, the random variable M := lim max Qm n→∞ 1≤i≤n 1 j=1 is well defined, and P (M < ∞) = 1. 8 1/2 Γij (3.2) Proof. Since max1≤i≤n Qm 1 j=1 1/2 Γij is non-decreasing in n with probability one, the limit M exists and M > 0. Note that 1 M = max Qm 4 1≤i<∞ 2 j=1 Γij It follows from Lemma 3.2 that ≤ ∞ X Rx i=1 x−2 ∞ Y m X 1 . = 2 Γ2 j=1 Γij i=1 j=1 ij 1 Qm (3.3) ψ(t)dt ≥ 1.5 log x for all large x ≥ i0 for some integer i0 ≥ 3. Therefore, it follows from Lemma 3.1 and equation (3.1) that for i ≥ i0  Γ(i − 2) 1 = exp − E( 2 ) = Γij Γ(i) Z i i−2  ψ(t)dt ≤ exp(−1.5 log(i)) = i−1.5 . By using the independence of Γij we have m ∞ Y m m m ∞ ∞ Y ∞ Y ∞ X Y X X X X 1 1 1 1 E( E( E( 2 ) ≤ E( 2 ) ≤ i−1.5m < ∞, )= )≤ 2 2 Γ Γ Γ Γ ij ij i=i j=1 ij j=1 ij i=i i=i j=1 i=i j=1 i=i 0 0 and hence, P ( 0 P∞ Qm i=i0 1 j=1 Γ2ij ) 0 0 < ∞) = 1, which together with (3.3) implies P (M < ∞) = 1. This completes the proof of the lemma.  Qm Q Lemma 3.4. g(|z1|2 , · · · , |zn |2 ) and g( m j=1 sn,j ) have the same disj=1 s1,j , · · · , tribution function for any symmetric function g(x1 , · · · , xn ). See Lemma 2.1 in Zeng (2006). Lemma 3.5. For 1 ≤ j ≤ m, 1 ≤ i ≤ n, si,j and U(i) 1−U(i) are identically distributed. See the proof of Lemma 2.3 in Zeng (2016). S1 n 2 Lemma 3.6. (U(1) , U(2) , · · · , U(n) ) and ( Sn+1 , SSn+1 , · · · , SSn+1 ) have the same joint Pk distribution, where Sk = j=1 Ej for k ≥ 1, and Ej , j ≥ 1 are independent random variables with the standard exponential distribution See, e.g., equation (2.2.1) on page 12 in Ahsanullah and Nevzorov (2015). Lemma 3.7. For any fixed m ≥ 1 max 1≤i≤n,1≤j≤m | Γij [2 : (n + 1)] − 1| → 0 n as n → ∞. 9 with probability one Proof. For any i, j ≥ 1, Γij [2 : (n + 1)] is the sum of n i.i.d. random variables with a Gamma(1) distribution, we have P( max 1≤i≤n,1≤j≤m | Γ11 [2 : (n + 1)] Γij [2 : (n + 1)] − 1| > ε) ≤ mnP (| − 1| > ε) n n for any ε > 0. Since Γij [2 : (n+1)] is a partial sum from a sequence of i.i.d. standard exponential random variables with E(Γ111 ) = 1 and E(Γ3111 ) = 6 < ∞, we have from Theorem 3 in Baum and Katz (1963) that ∞ X nP (| n=1 Γ11 [2 : (n + 1)] − 1| > ε) < ∞ n for any ε > 0, which implies that ∞ X n=1 P( max 1≤i≤n,1≤j≤m | Γij [2 : (n + 1)] − 1| > ε) < ∞ for any ε > 0. n Then the lemma follows from Borel-Cantelli lemma.  Mn2 By setting g(x1 , · · · , xn ) = max1≤i≤n xi in Lemma 3.4 we have that = Q Q m max1≤i≤n |zi |2 and max1≤i≤n m j=1 si,j = max1≤i≤n j=1 sn+1−i,j have the same distribution. From Lemma 3.6, Γij /Γij [1 : (n + 1)] = Γij [1 : i]/Γij [1 : (n + 1)] is identically distributed as U(i) . Since 1 − U(i) has the same distribution as U(n+1−i) , we have 1− Γij Γij [(i + 1) : (n + 1)] = Γij [1 : (n + 1)] Γij [1 : (n + 1)] has the same distribution as U(n+1−i) . Then it follows from Lemma 3.5 that 1 Γij [(i+1):(n+1)] Γij [1:(n+1)] Γij − (1 − Γij [1:(n+1)] ) = Γij [(i + 1) : (n + 1)] Γij Γ [(i+1):(n+1)] has the same distribution as sn+1−i,j for any j ≥ 1. Note that ij Γij , i ≥ 1, Qm Γij [(i+1):(n+1)] j ≥ 1 are independent random variables. Therefore, j=1 has the same Γij Qm Q Γ [(i+1):(n+1)] m distribution as j=1 sn−i+1,j , and max1≤i≤n |zi |2 and max1≤i≤n j=1 ij Γij have the same distribution. This implies s m Y Γij [(i + 1) : (n + 1)] d Mn = max . 1≤i≤n Γij j=1 10 (3.4) Now we define Vi = m Y j=1 s Γij [(i + 1) : (n + 1)] Γij for 1 ≤ i ≤ n. Then we have for any i ∈ {1, · · · , n − 1} s s m m Y Γij [(i + 1) : (n + 1)] Y Γij [(i + 2) : (n + 1)] d Vi = = Vi+1 , ≥ Γ [1 : i] Γ [1 : (i + 1)] ij ij j=1 j=1 which implies P (Vi ≤ x) is non-decreasing in i ∈ {1, · · · , n} (3.5) for any x ∈ R. Proof of Theorem 2.1. It follows from Lemma 3.7 that as n → ∞ Γij [2 : (n + 1)] Γij [2 : (n + 1)] → 1, rn := min min →1 1≤j≤m 1≤i≤n 1≤j≤m 1≤i≤n n n (3.6) Rn := max max with probability one. Define for r ≥ 1 Wr = max 1≤i≤r and set Zr = max1≤i≤r m Y j=1 Qm r 1 j=1 Γ1/2 . ij m Γij [(i + 1) : (n + 1)] Y 1 1/2 n j=1 Γij ! . d Then we have from (3.4) that Mn /nm/2 = Wn . To show the theorem, it suffices to prove that Wn → M with probability one. Let k ≥ 1 be any fixed integer. Then we have r m Y Γij [2 : (n + 1)] Wn ≤ max Zn ≤ Rnm/2 M, 1≤i≤n n j=1 which together with (3.6) yields lim sup Wn ≤ M. n→∞ For any fixed k ≥ 2, we have for all large n  max1≤i≤k max1≤j≤m Γij [2 : k] m/2 Zk . Wn ≥ Wk ≥ rn − n 11 Again, in view of (3.6) we have that lim inf n→∞ Wn ≥ Zk with probability one. Hence, by letting k → ∞, and using Lemma 3.3 we get that lim inf n→∞ Wn ≥ M. Therefore, we conclude that lim inf n→∞ Wn = lim supn→∞ Wn = M with probability one.  Proof of Theorem 2.2. In view of (3.4) we have P (log Mn ≤ µn + σn x) = n Y ani (x) (3.7) i=1 for every x ∈ R, where ani (x) = P (log Vi ≤ µn + σn x) for 1 ≤ i ≤ n. Moreover, it follows from (3.5) that for each x ∈ R, ani (x) is non-decreasing in i ∈ {1, · · · , n}. (3.8) Our goal is to show that the limit on the right-hand side of (3.7) is Φ(x), which is defined as the cumulative distribution of a standard normal random variable. It suffices to show that lim an1 (x) = Φ(x) (3.9) n→∞ and lim n→∞ for every x ∈ R. n Y ani (x) = 1 (3.10) i=2 Note that (3.9) is equivalent to log V1 − µn d → N(0, 1). σn (3.11) For each i ≥ 1, log(Γij ), j = 1, · · · , mn are i.i.d. random variables with mean ψ(i) and variance ψ ′ (i). Then we have Pmn j=1 log(Γij ) − mn ψ(i) d p → N(0, 1) as n → ∞ mn ψ ′ (i) (3.12) by the classic central limit theorem, and as n → ∞ 1 √ mn mn X j=1 log(Γij [(i + 1) : (n + 1)]) − mn ψ(n + 1 − i) 12 ! p →0 (3.13) since E = mn 1 X log(Γij [(i + 1) : (n + 1)]) − mn ψ(n + 1 − i)) √ ( mn j=1 !2 mn X 1 log(Γij [(i + 1) : (n + 1)])) Var( mn j=1 1 mn ψ ′ (n + 1 − i) mn 1 = O( ) n → 0 as n → ∞ = from Lemma 3.2 (c). Note that for 1 ≤ i ≤ n 1 log Vi = 2 mn X j=1 log(Γij [(i + 1) : (n + 1)]) − mn X j=1 ! log(Γij ) . For i = 1, we have from (3.12) and (3.13) log V1 − µn σ Pmn n Pmn j=1 log(Γ1j [2 : (n + 1)]) − mn ψ(n) j=1 log(Γ1j ) − mn ψ(1) p p = − mn ψ ′ (1) mn ψ ′ (1) Pmn j=1 log(Γ1j ) − mn ψ(1) p + op (1) = − mn ψ ′ (1) d → N(0, 1), proving (3.11). 13 (3.14) For i = 2, by using (3.12) and (3.13) and Lemma 3.2 (b) we get log V2 − µn σn s Pmn Pmn log(Γ ) − m ψ(2) log(Γ [3 : (n + 1)]) − m ψ(n − 1) ψ ′ (2) 2j n 2j n j=1 j=1 p p − = ψ ′ (1) mn ψ ′ (1) mn ψ ′ (2) mn (ψ(2) − ψ(1) + ψ(n − 1) − ψ(n)) p − mn ψ ′ (1) √ 1 ) mn (1 − n−1 p = − + Op (1) ψ ′ (1) p → −∞, which implies 1 − an2 (x) = P (log V2 > µn + σn x) → 0 as n → ∞ for any x ∈ R. Hence, we conclude from (3.8) that max2≤i≤n (1 − ani (x)) = 1 − an2 (x) → 0 as n → ∞. To show (3.10), it suffices to show lim n→∞ since 1 − Pn i=2 (1 − ani (x)) ≤ Qn n X i=2 i=1 (1 (1 − ani (x)) = 0 − (1 − ani (x))) = (3.15) Qn i=2 ani (x) ≤ 1. By applying inequality P (X > 0) ≤ E(eX ) and noting that all summands on the right-hand side of (3.14) are independent, we have from Lemma 3.1 and (3.1) that 1 − ani (x) mn mn X X p log(Γij ) − mn (ψ(n) − ψ(1)) − mn ψ ′ (1)x > 0) log(Γij [(i + 1) : (n + 1)]) − = P( j=1 j=1 ≤ E exp( = mn X j=1 log(Γij [(i + 1) : (n + 1)]) −  Γ(n + 2 − i) mn  Γ(i − 1) mn exp mn X  j=1 log(Γij ) − mn (ψ(n) − ψ(1)) − − mn (ψ(n) − ψ(1)) − √  mn x √ mn x) Γ(n + 1 − i) Γ(i) Z 1 √ = exp(mn (ψ(n + 1 − i + t) − ψ(i − 1 + t))dt − mn (ψ(n) − ψ(1)) − mn x) Z0 1 √ = exp(mn (ψ(n + 1 − i + t) − ψ(n) − (ψ(i − 1 + t) − ψ(1)))dt − mn x). 0 14 We have ψ(x) is increasing in x > 0 since ψ ′ (x) > 0 from Lemma 3.2. Therefore, ψ(n + 1 − i + t) − ψ(n) ≤ 0 and ψ(i − 1 + t) − ψ(1) ≥ ψ(i − 1) − ψ(1) for t ∈ [0, 1] and i ≥ 3. Thus, we have 1 − ani (x) ≤ exp(−mn (ψ(i − 1) − ψ(1))) = exp(−mn i−2 X 1 k=1 k + p mn ψ ′ (1)x) for 3 ≤ i ≤ n. Now we choose a positive integer i0 ≥ 3 such that p P 1 ψ ′ (1)|x|. Since i−2 k=1 k ≥ log(i − 1), we get 1 − ani (x) ≤ exp(− mn log(i − 1)) = (i − 1)−mn /2 , 2 1 2 log(i0 − 1) ≥ i0 ≤ i ≤ n and n X i=i0 (1 − ani (x)) ≤ n X i=i0 (i − 1) − m2n ≤ Z n−1 i0 −2 1 xmn /2 dx < mn 2 (i0 − 2)1− 2 mn − 2 which converges to zero as n → ∞. Consequently, we have as n → ∞ n X i=2 (1 − ani (x)) ≤ (i0 − 2)(1 − an2 (x)) + n X i=i0 (1 − ani (x)) → 0, which proves (3.15). This completes the proof of the theorem.  Acknowledgements. We would like to thank the reviewer whose constructive suggestions have led to improvement in the readability of the paper. Chang’s research was supported in part by the Major Research Plan of the National Natural Science Foundation of China (91430108), the National Basic Research Program (2012CB955804), the National Natural Science Foundation of China (11171251), and the Major Program of Tianjin University of Finance and Economics (ZD1302). Li’s research was partially supported by a grant from the Natural Sciences and Engineering Research Council of Canada (Grant #: RGPIN-2014-05428). 15 References [1] Abramowitz, M. and Stegun, I. A. (1972). Handbook of Mathematical Functions. Dover, New York. [2] Adhikari, K., Reddy, N. K., Reddy, T. R. and Saha, K. (2016). Determinantal point processes in the plane from products of random matrices. Ann. Inst. H. Poincare Probab. Statist. 52 (1), 16-46. [3] Ahsanullah, M. and Nevzorov, V. B. (2015). Records via Probability Theory. Springer/Atlantis Press. [4] Akemann, G., Baik, J. and Francesco, P. D. (2011). The Oxford Handbook of Random Matrix Theory. Oxford University Press, New York. [5] Baik, J., Deift, P. and Johansson, K. (1999). On the distribution of the length of the longest increasing subsequence of random permutations. Jour. Amer. Math. Soc. 12(4), 1119-1178. [6] Baum, L. E. and Katz, M. (1963). Convergence rates in the law of large numbers. Bull. Amer. Math. Soc. 69, 771-772. [7] Beenakker, C. W. J. (1997). Random-matrix theory of quantum transport. Rev. Mod. Phys. 69, 731-809. [8] Bordenave, C. (2011). On the spectrum of sum and product of non-Hermitian random matrices. Elect. Comm. in Probab. 16, 104-113. [9] Chang, S. and Qi, Y. (2017). Empirical distribution of scaled eigenvalues for product of matrices from the spherical ensemble Statistics & Probability Letters 128, 8-13. [10] Couillet, R. and Debbah, M. (2011). Random matrix methods for wireless communications. Cambridge Univ Press. [11] Ginibre, J. (1965). Statistical ensembles of complex, quaternion, and real matrices. J. Math. Phys. 6, 440-449. [12] Götze F., Kösters H. and Tikhomirov, A. (2015). Asymptotic spectra of matrix-valued functions of independent random matrices and free probability. Random Matrices: Theory Appl. 4, 1550005. [13] Götze, F. and Tikhomirov, T. (2010). On the asymptotic spectrum of products of independent random matrices. http://arxiv.org/pdf/1012.2710v3.pdf. [14] Gui, W. and Qi, Y. (2018). Spectral radii of truncated circular unitary matrices. J. Math. Anal. Appl. 458, 536-554. 16 [15] Hough, J. B., Krishnapur, M., Peres, Y. and Virág, B. (2009). Zeros of Gaussian Analytic Functions and Determinantal Point Processes. American Mathematical Society. [16] Ipsen, J. R. (2015). Products of Independent Gaussian Random Matrices. Doctoral Dissertation. Bielefeld University. [17] Jiang, T. (2009). Approximation of Haar distributed matrices and limiting distributions of eigenvalues of Jacobi ensembles. Probability Theory and Related Fields 144 (1), 221-246. [18] Jiang, T. and Qi, Y. (2017). Spectral radii of large non-Hermitian random matrices. Journal of Theoretical Probability 30 (1), 326-364. [19] Johansson, K. (2007). From Gumbel to Tracy-Widom. Probab. Theory Relat. Fields 138, 75-112. [20] Johnstone, I. (2001). On the distribution of the largest eigenvalue in principal components analysis. Ann. Stat. 29, 295-327. [21] Johnstone, I. (2008). Multivariate analysis and Jacobi ensembles: Largest eigenvalue, Tracy-Widom limits and rates of convergence. Ann. Stat., 36 (6), 2638-2716. [22] Krishnapur, M. (2009). From random matrices to random analytic functions. Ann. Probab. 37 (1), 314-346. [23] Mezzadri, F. and Snaith, N. C. (2005). Recent perspectives in random matrix theory and number theory. Cambridge Univ Press. [24] O’Rourke, S. and Soshnikov, A. (2011). Products of independent nonHermitian random matrices. Electrical Journal of Probability 16(81), 22192245. [25] O’Rourke, S., Renfrew, D., Soshnikov, A. and Vu, V. (2015). Products of independent elliptic random matrices. Journal of Statistical Physics 160, 89119. [26] Ramı́rez, J., Rider, B. and Virág, B. (2011). Beta ensembles, stochastic Airy spectrum and a diffusion. J. Amer. Math . Soc. 24, 919-944. [27] Rider, B. C. (2003). A limit theorem at the edge of a non-Hermitian random matrix ensemble. J. Phys. A 36(12), 3401-3409. [28] Rider, B. C. (2004). Order statistics and Ginibres ensembles. Journal of Statistical Physics 114, 1139-1148. [29] Rider, B. C. and Sinclair, C. D. (2014). Extremal laws for the real Ginibre ensemble. Ann. Appl. Probab. 24(4), 1621-1651. 17 [30] Tracy, C. A. and Widom, H. (1994). Level-spacing distributions and Airy kernal. Comm. Math. Physics 159, 151-174. [31] Tracy, C. A. and Widom, H. (1996). On the orthogonal and symplectic matrix ensembles. Comm. Math. Physics 177, 727-754. [32] Tracy, C. A. and Widom, H. (2002). Distribution functions for largest eigenvalues and their applications. Proceedings of the ICM, Beijing 1, 587-596. [33] Wigner, E. P. (1955). Characteristic vectors of bordered matrices with infinite dimensions. Ann. Math. 62, 548-564. [34] Zeng, X. (2016). Eigenvalues distribution for products of independent spherical ensmbles. J. Phys. A: Math. Theor. 49, 235201. 18
10math.ST
The projective dimension of sequentially Cohen-Macaulay monomial ideals arXiv:1310.5598v2 [math.AC] 22 Oct 2013 Sara Faridi∗ March 26, 2018 Since posting this paper we have found that the same result regarding projective dimension of square-free monomial ideals appears in the paper of Morey and Villarreal [MV]. In this short note we prove that the projective dimension of a sequentially Cohen-Macaulay square-free monomial ideal is equal to the maximal height of its minimal primes (also known as the big height), or equivalently, the maximal cardinality of a minimal vertex cover of its facet complex. Along the way we also give bounds for the depth and the dimension of any monomial ideal. This in particular gives a formula for the projective dimension of facet ideals of these classes of ideals, which are known to be sequentially CohenMacaulay: graph trees and simplicial trees and forests [F1], chordal graphs and some cycles [FV], chordal clutters and graphs [W], some path ideals [SKT] to mention a few. Since polarization preserves projective dimension, our result also gives the projective dimension of any sequentially Cohen-Macaulay monomial ideal. Our result is a precise and simple description of the projective dimension that is not dependent on the ground field. There has been much activity surrounding combinatorial characterizations of the projective dimension, see for example [C, DHS, DS, Ku, LM]. The authors in [KhM] and [DS] in particular prove the same result for graphs that are forests and some other classes of graphs. A simplicial complex ∆ over a set of vertices V is a set of subsets of V with the property that if F ∈ ∆ then all subsets of F are also in ∆. An element of ∆ is called a face, the dimension of a face F is |F | − 1, and the dimension of ∆ is the largest dimension of a face of ∆. The maximal faces of ∆ under inclusion are called facets, and the set of facets of ∆ is denoted by Facets(∆). If Facets(∆) = {F1 , . . . , Fq } we write ∆ = hF1 , . . . , Fq i. Let k be any field. To a square-free monomial ideal I in a polynomial ring R = k[x1 , . . . , xn ] one can associate two unique simplicial complexes N (I) and F (I) on the vertex set labeled {x1 , . . . , xn }. Conversely given a simplicial complex ∆ with vertices labeled x1 , . . . , xn one can associate two unique square-free monomials N (∆) and F (∆) in the polynomial ring k[x1 , . . . , xn ]; these are all defined below. Facet complex of I Stanley-Reisner complex of I Facet ideal of ∆ Stanley-Reisner ideal of ∆ F (I) = h{xa1 , . . . , xam } | xa1 . . . xam minimal generator of Ii / I}. N (I) = {{xa1 , . . . , xam } | xa1 . . . xam ∈ F (∆) = (xa1 . . . xam | {xa1 , . . . , xam } ∈ Facets(∆)) / ∆). N (∆) = (xa1 . . . xam | {xa1 , . . . , xam } ∈ Sequentially Cohen-Macaulay ideals were introduced by Stanley in relation to the concept of nonpure shellability by Björner and Wachs [BW]. Definition 1 ([S] Chapter III, Definition 2.9). Let M be a finitely generated Z-graded module over a finitely generated N-graded k-algebra, with R0 = k. We say that M is sequentially Cohen-Macaulay if there exists a finite filtration 0 = M0 ⊆ M1 ⊆ . . . ⊆ Mr = M of M by graded submodules Mi satisfying the following two conditions. ∗ Department of Mathematics and Statistics, Dalhousie University, Halifax, Canada, [email protected], +1(902)-494-2658. Research supported by NSERC. 1 (a) Each quotient Mi /Mi−1 is Cohen-Macaulay. (b) dim (M1 /M0 ) < dim (M2 /M1 ) < . . . < dim (Mr /Mr−1 ), where dim denotes Krull dimension. Our goal is to find the projective dimension of sequentially Cohen-Macaulay square-free monomial ideal. In this setting Duval gave an equivalent characterization in terms of simplicial complexes. Given a simplicial complex ∆ and an integer i let • ∆i = {F ∈ ∆ | dim F ≤ i} =i-skeleton of ∆, • ∆i = hF ∈ ∆ | dim F = ii =pure i-skeleton of ∆. Theorem 2 ([D] Theorem 3.3). Let I be square-free monomial ideal I in a polynomial ring R over a field k, and let ∆ = N (I). Then R/I is sequentially Cohen-Macaulay if and only if R/N (∆i ) is Cohen-Macaulay for all i ∈ {−1, . . . , dim ∆}. The main tool we will use is a result of Fröberg. For a given simplicial complex ∆, let Proposition 3 ([Fr] Theorem 8). Let ∆ be the Stanley-Reisner complex of I. Then depth (R/I) = max{i | ∆i is Cohen-Macaulay } + 1. Theorem 4. Let I be a monomial ideal in the polynomial ring R = k[x1 , . . . , xn ]. Suppose that the maximal height of an associated prime of I is d. Then depth (R/I) ≤ n − d and pd(R/I) ≥ d. In particular, if R/I is sequentially Cohen-Macaulay then depth (R/I) = n − d and pd(R/I) = d. Proof. If I is a monomial ideal it has the same projective dimension as its polarization, which is squarefree. Moreover by Proposition 2.5 of [F2] the maximal height of an associated prime of I is the same as the maximal height of an associated prime of its polarization, so we only consider square-free monomial ideals. Suppose I is a square-free monomial ideal in R = k[x1 , . . . , xn ] with primary decomposition written as I = (p1 ∩ · · · ∩ pa1 ) ∩ · · · ∩ (pas−1 +1 ∩ · · · ∩ pas ) where • height pai−1 +1 = · · · = height pai = di for i ∈ {1, . . . , s}, assuming a0 = 0, and • d1 < d2 < . . . < ds . We know then that dim (R/I) = n − d1 . We wish to prove that if R/I is sequentially Cohen-Macaulay, then depth (R/I) = n − ds . Note that since I is a square-free monomial ideal, each of the pi is generated by a subset of {x1 , . . . , xn } and the generating set of each pi corresponds uniquely to a minimal vertex cover of F (I); that is, a set of vertices A such that every facet of F (I) contains one of the elements of this set, and no proper subset of A has this property. Suppose ∆ is the Stanley-Reisner complex of I. Then by the Proposition 2.4 of [F1] the facets of are complements of the pi and therefore ∆ have dimensions n − d1 − 1 > . . . > n − ds − 1. Now consider ∆i . If i > n − ds − 1, then ∆i will have facets of dimension greater than n − ds − 1 as well as facets of dimension n − ds − 1. So the largest i where ∆i is pure is n − ds − 1. Since ∆i being pure is a necessary condition for the Cohen-Macaulayness of R/N (∆i ), we already know that R/N (∆i ) is not Cohen-Macaulay for i > n − ds − 1. It follows immediately from Proposition 3 that depth (R/I) ≤ n − ds . 2 Now by applying the Auslander-Buchsbaum formula [AB] we have pd(R/I) = n − depth (R/I) ≥ ds . Also notice that ∆n−ds −1 = ∆n−ds −1 , so if I is sequentially Cohen-Macaulay by Theorem 2 we know R/N (∆n−ds ) is Cohen-Macaulay. It follows that depth (R/I) = n − ds . The Auslander-Buchsbaum formula [AB] gives pd(R/I) = n − depth (R/I) = ds . Remark 5. It is natural to expect that the same statement holds for any sequentially Cohen-Macaulay module, since their primary components behave in the same way as described in the proof above; see the appendix and in particular Theorem A4 of [F2] for more details of primary decomposition of sequentially Cohen-Macaulay modules. Indeed, after showing our result to Jürgen Herzog he pointed out that this follows from his joint work in [HP]. References [AB] M. Auslander, D. A. Buchsbaum, Homological dimension in local rings, Transactions of the American Mathematical Society 85: 390405 (1957). [BW] A. Björner, M.L. Wachs, Shellable nonpure complexes and posets, I. Trans. Amer. Math. Soc. 348 (1996), no. 4, 1299–1327. [C] D. Cook II, The uniform face ideals of a simplicial complex, arXiv:1308.1299, (2013). [DHS] H. Dao, C. Huneke, J. Schweig, Bounds on the regularity and projective dimension of ideals associated to graphs, J. Algebraic Combin. 38, no. 1, 37-55 (2013). [DS] H. Dao, J. Schweig, Projective dimension, graph domination parameters, and independence complex homology, J. Combin. Theory Ser. A, 120, no. 2, 453-469 (2013). [D] Duval, A.M. Algebraic shifting and sequentially Cohen-Macaulay simplicial complexes, Electron. J. Combin. 3 (1996), no. 1, Research Paper 21 [F1] S. Faridi, Simplicial trees are sequentially Cohen-Macaulay, J. Pure and Applied Algebra, Volume 190, Issues 1-3, Pages 121-136 (June 2004). [F2] S. Faridi, Monomial ideals via square-free monomial ideals, Lecture Notes in Pure and Applied Mathematics, volume 244, 85–114 (2005). [Fr] R. Fröberg, On Stanley-Reisner rings, Topics in algebra, Part 2 (Warsaw, 1988), 57-70, Banach Center Publ., 26, Part 2, PWN, Warsaw, 1990. [FV] C. Francisco, A. Van Tuyl, Sequentially Cohen-Macaulay Edge Ideals, Proceedings American Mathematical Society 135 (2007) 2327-2337. [HP] J. Herzog, D. Popescu, Finite filtrations of modules and shellable multicomplexes, Manuscripta Math. 121 (2006), no. 3, 385-410. [KhM] F. Khosh-Ahang, S. Moradi, Regularity and projective dimension of edge ideal of C5 -free vertex decomposable graphs, Proc. Amer. Math. Soc., to appear. [Ku] M. Kummini, Regularity, depth and arithmetic rank of bipartite edge ideals, J. Algebraic Combin. 30, no. 4, 429-445 (2009). [LM] K.N. Lin, P. Mantero, Projective Dimension of String and Cycle Hypergraphs, arXiv:1309.7948 (2013). 3 [MV] S. Morey, R.H. Villarreal, Edge Ideals: Algebraic and Combinatorial Properties, Progress in Commutative Algebra: Ring Theory, Homology, and Decomposition, Publisher: de Gruyter.S, to appear (arXiv:1012.5329v3). [S] R.P. Stanley, Combinatorics and commutative algebra, Second edition. Progress in Mathematics, 41. Birkhuser Boston, Inc., Boston, MA, 1996. x+164 pp. ISBN: 0-8176-3836-9. [SKT] S. Saeedi Madani, D. Kiani, N. Terai, Sequentially Cohen-Macaulay path ideals of cycles, Bull. Math. Soc. Sci. Math. Roumanie (N.S.) 54(102) (2011), no. 4, 353-363. [W] R. Woodroofe, Chordal and sequentially Cohen-Macaulay clutters, Electron. J. Combin. 18(1), Paper 208, (2011). 4
0math.AC
1 Approximation errors of online sparsification criteria arXiv:1409.6046v1 [stat.ML] 21 Sep 2014 Paul Honeine, Member IEEE Abstract—Many machine learning frameworks, such as resource-allocating networks, kernel-based methods, Gaussian processes, and radial-basis-function networks, require a sparsification scheme in order to address the online learning paradigm. For this purpose, several online sparsification criteria have been proposed to restrict the model definition on a subset of samples. The most known criterion is the (linear) approximation criterion, which discards any sample that can be well represented by the already contributing samples, an operation with excessive computational complexity. Several computationally efficient sparsification criteria have been introduced in the literature, such as the distance, the coherence and the Babel criteria. In this paper, we provide a framework that connects these sparsification criteria to the issue of approximating samples, by deriving theoretical bounds on the approximation errors. Moreover, we investigate the error of approximating any feature, by proposing upper-bounds on the approximation error for each of the aforementioned sparsification criteria. Two classes of features are described in detail, the empirical mean and the principal axes in the kernel principal component analysis. Index Terms—Sparse approximation, adaptive filtering, kernelbased methods, resource-allocating networks, Gaussian processes, Gram matrix, machine learning, pattern recognition, online learning, sparsification criteria. I. I NTRODUCTION ATA DELUGE in the era of “Big Data” brings new challenges (and opportunities) in the area of machine learning and signal processing [1], [2], [3]. Demanding online learning, this paradigm cannot be addressed directly by most (if not all) conventional learning machines, such as resourceallocating networks [4], kernel-based methods for classification and regression [5], Gaussian processes [6], radialbasis-function networks [7] and kernel principal component analysis [8], only to name a few. Indeed, these machines share essentially the same underlying model, with as many parameters to be estimated as training samples, as defined by the “Representer Theorem” [9]. This model is inappropriate in online learning, where a new sample is available at each instant. To stay computationally tractable, one needs to restrict the incrementation in the model complexity, by selecting the subset of samples that contributes to a reduced-order model as an approximation of the full-order feature to be estimated. In order to overcome this bottleneck in online learning, sparsification schemes have been proposed for all the aforementioned machines, defined as follows: at each instant, it determines if the new sample can be safely discarded from contributing to the order growth of the model; otherwise, the sample needs to take part in the order incrementation. The most known online sparsification criteria is the approximation criterion, also called approximate linear dependency. It D P. Honeine is with the Institut Charles Delaunay (CNRS), Université de technologie de Troyes, 10000, Troyes, France. Phone: +33(0)325715625; Fax: +33(0)325715699; E-mail: [email protected] has been widely investigated in the literature, for Gaussian processes [10], kernel recursive least squares algorithm [11], kernel least mean square algorithm [12], and kernel principal component analysis [8]. This criterion determines the relevance of discarding or accepting the current sample by comparing, to a predefined threshold, the residual error of approximating it with a representation (i.e., linear combination) of samples — or nonlinearly mapped samples as in kernel methods — already contributing to the model. A crucial issue in the approximation criterion is its computational complexity, which scales cubically with the model order. Several computationally efficient sparsification criteria have been introduced in the literature, with essentially the same computational complexity that scales linearly with the model order. These sparsification criteria rely on the topology of the samples in order to select the most relevant samples. The most widely investigated criteria are the distance and the coherence criteria, as well as the Babel criterion. The distance criterion, introduced by Platt in [4] to control the complexity of resource-allocating networks in radial-basis-function networks, retains the most mutually distant samples ; see also [13], [14] for recent advances. The coherence criterion, introduced by Honeine, Richard, and Bermudez in [15], [16] with the recent advances in compressed sensing [17], [18], retains samples that are mutually least coherent. As an extension of the coherence criterion, the Babel criterion uses the cumulative coherence as a measure of diversity [19]. These sparsification criteria have been separately investigated in the literature. To the best of our knowledge, there is no work that studies all these sparsification criteria together. The conducted analyses have been often based on the computational complexity, as advocated in [16], [20] by criticizing the computational cost of the approximation criterion in favor of the other sparsification criteria. In [15], [16], [21], we have developed with colleagues several theoretical results that allows to compare the coherence to the approximation criterion. These results have not been extended to other sparsification criteria, and were demonstrated for the particular case of unitnorm data. This paper presents a framework to study online sparsification criteria by cross-fertilizing previously derived results, by obtaining often tighter bounds, and by extending these results to other sparsification criteria such as the distance and the Babel criteria. One the one hand, we bridge the gap between the approximation criterion and the other online sparsification criteria, firstly by providing upper bounds on the error of approximating, with samples already retained, any sample discarded by the sparsification criterion, and secondly by providing lower bounds on the error of approximating accepted samples. On the other hand, we examine the relevance of approximating any feature with a sparse model obtained with Approximation Coherence Babel Reference: most known work Reference: more recent work Approximation of any sample Error on discarded samples Error on any atom Approximation of any feature Error on the mean (centroid) Error on the principal axes Distance 2 Section [4] [20] X X X X X X [10] [8] · · · X X [11] [16] [25] X [15] [16] X [21] [15] [17] [19] X X [19] X X X IV IV-A IV-B V V-A V-B     TABLE I A BIRDS EYE VIEW OF THIS PAPER . S OME OF THE RESULTS WERE PREVIOUSLY STUDIED FOR UNIT- NORM KERNELS , AS SHOWN WITH THE REFERENCES GIVEN IN THE TABLE ( WHERE · DENOTES TRIVIALITY ). I N THIS WORK , WE PROVIDE AN EXTENSIVE STUDY THAT COMPLETES THE ANALYSIS TO ALL SPARSIFICATION CRITERIA , OFTEN WITH TIGHTER BOUNDS ( SHOWN IN GRAY COLOR ), AND WE DERIVE NEW THEORETICAL RESULTS . M OREOVER , WE GENERALIZE THESE RESULTS TO ANY TYPE OF KERNEL , BEYOND UNIT- NORM KERNELS . where H is the feature space of candidate solutions and η is a parameter that controls the tradeoff between the fitness error (first term) and the regularity of the solution (second term) with R(·) being a monotonically increasing function. Examples of loss functions are the quadratic loss |ψ(xi )−yi |2 , the hinge loss (1 − ψ(xi )yi )+ of the SVM [5], the logistic regression log(1 + exp(−ψ(xi )yi )), as well as the unsupervised loss function −|ψ(xi )|2 which is related to the PCA. Let κ : X × X → R be a positive definite kernel, and (H, h·, ·iH ) the induced reproducing kernel Hilbert space (RKHS) with its inner product. The reproducing property states that any function ψ(·) of H can be evaluated at any sample xi of X using ψ(xi ) = hψ(·), κ(·, xi )iH . This property shows that any sample xi of X is represented with κ(·, xi ) in the space H. Moreover, the reproducing property leads to the so-called kernel trick, that is for any pair of samples (xi , xj ), we have hκ(·, xi ), κ(·, xj )iH = κ(xi , xj ). In particular, kκ(·, xi )kH = hκ(·, xi ), κ(·, xi )iH = κ(xi , xi ). The most used kernels and there expressions are as follows: κ(xi , xj ) Kernel any of the aforementioned sparsification criteria, including the approximation criterion. We provide upper bounds on the error of approximating any feature in the general case. Furthermore, we explore in detail two particular features, the empirical mean (i.e., centroid, studied for instance in [22], [23]) and the principal axes in the kernel principal component analysis (kernel-PCA, [24]). The big picture of the cross-fertilization and extensions given in this paper is illustrated in TABLE I. The remainder of this paper is organized as follows. Next section introduces the kernel-based machines for online learning and presents the key issues studied in this work. Section III presents the aforementioned computationally efficient sparsification criteria. Section IV investigates bounds on the error of approximation samples, either discarded or accepted by any sparsification criterion. These results are extended in Section V to the problem of approximating any feature. Section VI concludes this document with some discussions. II. K ERNEL - BASED MACHINES FOR ONLINE LEARNING In this section, we introduce the kernel-based machines for online learning, by presenting the approximation criterion with the key issues studied in this paper. A. Machine learning and online learning Machine learning seeks a feature ψ(·) connecting an input space X ⊂ Rd to an output space Y ⊂ R, by using a set of training samples, denoted {(x1 , y1 ), (x2 , y2 ), . . . , (xn , yn )} with (xk , yk ) ∈ X × Y. Considering a loss function C(·, ·) defined on Y × Y that measures the error between the desired output and the estimated one with ψ(·), the optimization problem consists in minimizing a regularized empirical risk of the form n X C(ψ(xi ), yi ) + η R(kψ(·)k2H ), (1) argmin ψ(·)∈H i=1 Linear Polynomial Exponential Gaussian hxi , xj i p (hxi , xj i + c) exp (hxi , xj i)  −1 2 exp 2σ 2 kxi − xj k Among these kernels, only the Gaussian kernel is unit-norm, that is kκ(x, ·)kH = 1 for any sample x ∈ X. Other kernels can be unit-norm on some restricted X, such as the linear kernel when dealing with unit-norm samples. In this paper, we do not restrict ourselves to any particular kernel or space X. We denote r2 = inf κ(x, x) x∈X and R2 = sup κ(x, x) . x∈X For unit-norm kernels, we get R = r = 1. The Representer Theorem provides a principal result that is essential in kernel-based machines for classification and regression, as well as unsupervised learning. It states that the solution of the optimization problem (1) takes the form ψ(·) = n X i=1 αi κ(xi , ·). (2) The proof of this theorem is derived in [9], and a sketch of proof is given in the footnote1. This theorem shows that the optimal solution has as many parameters αi to be estimated as the number of available samples (xi , yi ). This result constitutes the principal bottleneck for online learning. Indeed, in an online setting, the solution should be adapted based on a new sample available at each instant, namely (xt , yt ) at instant t. Thus, by including the new pair (xt , yt ) in the training 1 To prove the Representer Theorem (2), we decompose any function ψ(·) of P ⊥ ⊥ H into ψ(·) = n i=1 αi κ(xi , ·) + ψ (·), where hψ (·), κ(xi , ·)iH = 0 for all i = 1, 2, . . . , n. On the one hand, any evaluation ψ(xi ) is independent of ψ⊥ (·) since ψ(xi ) = hψ(·), κ(xi , ·)iH . On the other hand, the monotonically increasing function R(·) guarantees that R(kψ(·)k2H ) = P Pn ⊥ (·)k2 ) ≥ R(k 2 R(k n α κ(x , ·) + ψ α i i=1 i i=1 i κ(xi , ·)kH ), where H the Pythagorean theorem is used. Therefore, a null ψ⊥ (·) minimizes the regularization term without affecting the fitness term. HONEINE: APPROXIMATION ERRORS OF ONLINE SPARSIFICATION CRITERIA 3 set, the corresponding parameter αt is be added to the set of parameters to be estimated, by following the Representer Theorem. As a consequence, the order of the model (2) is continuously increasing. To overcome this bottleneck, one needs to control the growth of the model order at each instant, by keeping only a fraction of the kernel functions in the expansion (2). The reduced-order model takes the form m X αj κ(x̀j , ·) (3) ψ(·) = where κ̀(xt ) is the column vector of entries κ(x̀j , xt ), for j = 1, 2, . . . , m. By injecting this expression in the condition (4), we get the following condition of accepting the current kernel function: j=1 with m ≪ t, predefined or dependent on t. In this expression, {x̀1 , x̀2 , . . . , x̀m } is a subset of {x1 , x2 , . . . , xt }, namely x̀j is some xωj with ωj ∈ {1, 2, . . . , t}. We denote by dictionary the set D = {κ(x̀1 , ·), κ(x̀2 , ·), . . . , κ(x̀m , ·)}, and by atoms its elements. Throughout this paper, all quantities associated to the dictionary have an accent (by analogy to phonetics, where stress accents are associated to prominence). This is the case for instance of the m-by-m Gram matrix K̀ whose (i, j)-th entry is κ(x̀i , x̀j ). The eigenvalues of this matrix are denoted λ̀1 , λ̀2 , . . . , λ̀m , given in non-increasing order. The optimization problem is two-fold at each instant: selecting the proper dictionary D = {κ(x̀1 , ·), κ(x̀2 , ·), . . . , κ(x̀m , ·)} and estimating the corresponding parameters α1 , α2 , . . . , αm . New challenges (and opportunities) arise in an online learning setting. Determining the optimal dictionary at each instant is a combinatorial optimization problem, when optimality is measured by comparing reduced-order solution (3) to the feature in its full-order form (2). An elegant way to overcome this computationally intractable problem, is a recursive update, by determining if the new kernel function κ(xt , ·) needs to be included to the dictionary, or it can be discarded since it is efficiently approximated with atoms already belonging to the dictionary. This is the essence of the approximation criterion. B. Approximation criterion The (linear) approximation criterion was initially proposed in [26] for classification and regression, and in [27] for Gaussian processes. In online learning with kernels, as studied for system identification in [11] and more recently for kernel principal component analysis in [8], it operates as follows: the current sample is discarded (not included in the dictionary), if it can be sufficiently represented by a linear combination of atoms already belonging to the dictionary; otherwise, it is included in the dictionary. Formally, the kernel function κ(xt , ·) is included in the dictionary if m X 2 ξj κ(x̀j , ·) ≥ δ2, (4) min κ(xt , ·) − ξ1 ···ξm H j=1 where δ is a positive threshold parameter that controls the level of sparseness. The above norm is the residual error obtained by projecting κ(xt , ·) onto the space spanned by the dictionary. The optimal value of each coefficient ξj is obtained by nullifying the derivative of the above cost function with respect to it, which leads to ξ = K̀ −1 κ̀(x̀t ), κ(xt , xt ) − κ̀(xt )⊤ K̀ −1 κ̀(xt ) ≥ δ 2 . (5) The resulting dictionary is called δ-approximate, satisfying the relation m X min min κ(x̀i , ·) − ξj κ(x̀j , ·) ≥ δ. i=1···m ξ1 ···ξm j=1 j6=i H One could also include a removal process, in the same spirit as the fixed-budget concept, by discarding the atom that can be well approximated with the other atoms, as investigated for instance in [28]. Nonetheless, the dictionary is still δapproximate. The use of a removal process does not affect the results given in this paper. C. Issues studied in this paper In the following, we describe several issues that motivates (and structures) this work, illustrated here with respect to the approximation criterion. Computational complexity The approximation criterion requires the inversion of the Gram matrix associated to the dictionary, which is the most computational expensive process. Its computational complexity scales cubically with the size of the dictionary, i.e., O(m3 ) operations. Moreover, the evaluation of the condition expressed in (5) requires two matrix multiplications at each instant. These computation cost may counteract the benefits of several online learning techniques, such as gradient-based and least-mean-square algorithms (e.g., LMS, NLMS, affine projection, ...). To reduce the computational burden of the approximation criterion, several computationally efficient sparsification criteria have been proposed in the literature, sharing essentially the same computational complexity that scales linearly with the size of the dictionary, i.e., O(m) operations at each instant. The most known criteria are the distance, the coherence and the Babel criteria; see Section III for a description. Approximation error of any sample The approximation criterion relies on establishing a dictionary such that the error of approximating each of its atoms, with a linear combination of the other atoms, cannot be smaller than the given threshold δ. Moreover, the decision of discarding any sample from the dictionary is defined by the same process, namely when its approximation error, with a linear combination of the other atoms, is smaller than the same threshold δ. While the approximation criterion possesses such duality between accepting and discarding samples at the very same value of thresholding the approximation error, this is not the case of the other sparsification criteria. 4 In Section IV, we bridge the gap between the approximation criterion and the other online sparsification criteria. For this purpose, on the one hand in Section IV-A, we derive upper bounds on the error of approximating a discarded samples with atoms of a dictionary obtained by the distance, the coherence, or the Babel criterion. One the other hand in Section IV-B, we derive lower bounds on the error of approximating any atom with the other atoms of the sparse dictionary under scrutiny. From approximating samples to approximating features All the aforementioned sparsification criteria operate in a pre-processing scheme, by selecting samples independently of the resulting sparse representation of the feature. In other words, the selection of the relevant subset {x̀1 , x̀2 , . . . , x̀m } from the set {x1 , x2 , . . . , xt } is only based on the topology of the samples; it is independent of the power of the dictionary to approximate accurately any feature of the form (2) with the reduced-order model (3). In Section V, we study the relevance of approximating any feature with a sparse dictionary obtained by any sparsification criterion, including the approximation criterion. We derive upper bounds on the approximation error of any feature, before examining in detail two particular class of features, the empirical mean studied in Section V-A and the most relevant principal axes in kernel-PCA investigated in Section V-B. approximation criterion). This allows to simplify the condition (6) to get   κ(xt , x̀j )2 ≥ δ2. (7) min κ(xt , xt ) − j=1···m κ(x̀j , x̀j ) The resulting dictionary, called δ-distant, satisfies for any pair (x̀i , x̀j ): κ(x̀i , x̀j )2 ≥ δ2. (8) κ(x̀i , x̀i ) − κ(x̀j , x̀j ) For unit-norm √ atoms, this expression reduces to the condition |κ(x̀i , x̀j )| ≤ 1 − δ 2 . This sparsification criterion has been extensively used in the literature under different names, such as the novelty criterion proposed in [4] (where the scaling factor was dropped and a prediction error mechanism was included in a second stage; see also [29], [7]) and the quantized criterion defined in [30]. B. Coherence criterion The coherence measure has been extensively studied in the literature of compressed sensing in the particular case of the linear kernel with unit-norm samples [17], [18]. In the more general case with the kernel formalism, the coherence of a dictionary is defined with the measure |κ(x̀i , x̀j )| p , i,j=1···m κ(x̀i , x̀i ) κ(x̀j , x̀j ) max (9) i6=j III. O NLINE SPARSIFICATION CRITERIA With a novel sample xt available at each instant t, a sparsification rule determines if κ(xt , ·) should be included in the dictionary, by incrementing the model order m and setting x̀m+1 = xt . The sparsification criteria measure the relevance of such complexity-incrementation by comparing the current kernel function κ(xt , ·) with the atoms of the dictionary. They are defined by either a dissimilarity measure, i.e., constructing the dictionary with the most mutually distant atoms, or a similarity measure, i.e., constructing the dictionary with the least coherent or correlated atoms. To this end, a threshold is used to control the level of sparsity of the dictionary. The most investigated criteria are outlined in the following. It is natural to propose a sparsification criterion that constructs a dictionary with large distances between its entries, thus discarding samples that are too close to any of the atoms already belonging to the dictionary. The current kernel function κ(xt , ·) is included in the dictionary if min min kκ(xt , ·) − ξ κ(x̀j , ·)kH ≥ δ, ξ The coherence criterion introduced in [15], [16] constructs a dictionary with atoms that are mutually least coherent, by restricting this measure below some predefined value γ ∈ [0 ; 1], where a null value yields an orthogonal basis. The criterion includes the current kernel function κ(xt , ·) in the dictionary if |κ(xt , x̀j )| ≤ γ. (10) max p j=1···m κ(xt , xt ) κ(x̀j , x̀j ) It is worth noting that the denominator in each of the above expressions reduces to 1 when dealing with unit-norm atoms, thus expression (10) becomes A. Distance criterion j=1···m which corresponds to the largest value of the cosine angle between any pair of atoms, since the above objective function can be written as |hκ(x̀i , ·), κ(x̀j , ·)iH | . kκ(x̀i , ·)kH kκ(x̀j , ·)kH (6) for a predefined positive threshold δ; otherwise, it can be efficiently approximated, up to a multiplicative constant, with an atom of the dictionary. It is easy to see that the optimal value of the scaling factor ξ is κ(xt , x̀j )/κ(x̀j , x̀j ), since the left-hand-side in the above expression is residual error of the projection of κ(xt , ·) onto κ(x̀j , ·) (in the same spirit as the max |κ(xt , x̀j )| ≤ γ. j=1···m C. Babel criterion While the coherence measure examines the largest correlation between all pairs of atoms in a dictionary, a more thorough analysis is provided by the Babel measure, which considering the maximum cumulative correlation between an atom and all the atoms of the dictionary [31], [17]. The Babel criterion for online sparsification is defined as follows: the current kernel function κ(xt , ·) is included in the dictionary if m X j=1 |κ(xt , x̀j )| ≤ γ, (11) HONEINE: APPROXIMATION ERRORS OF ONLINE SPARSIFICATION CRITERIA for a given positive threshold γ [19]. The resulting dictionary, called γ-Babel, satisfies m X max |κ(x̀i , x̀j )| ≤ γ. (12) i=1···m j=1 j6=i By analogy with the coherence measure, which corresponds to the ∞-norm when dealing with unit-norm atoms, the Babel measure2 is related P to the 1-norm of the Gram matrix, where kK̀k1 = maxi j |κ(x̀i , x̀j )|. IV. A PPROXIMATION ERROR OF ANY SAMPLE In this section, we study the elementary issue of approximating a sample by the span of a sparse dictionary, in the kernel-based framework. To this end, this issue is considered in its two folds: one the one hand, the error of approximating a discarded sample, and on the other hand, the error of approximating any accepted sample, namely approximating any atom of the dictionary with all the other atoms. We provide upper bounds on the former and lower bounds on the latter, for each of the sparsification criteria studied in previous section. It is worth noting that only the approximation criterion relies on a duality of discarding and accepting samples at the very same value in thresholding the approximation error, which is not the case of the other criteria, as examined in the following. Let P̀ be the projection operator onto the subspace spanned by the atoms κ(x̀1 , ·), . . . , κ(x̀m , ·) of a dictionary resulting from a sparsification criterion. Thus, for any sample x, the projection of the kernel function κ(x, ·) onto this subspace is given by P̀κ(x, ·). The quadratic norm of the latter corresponds to the maximum inner product hκ(x, ·), ϕ(·)iH over all the unit-norm functionsP ϕ(·) of that subspace. By writing P m ϕ(·) = m β κ( x̀ , ·)/k j j=1 j j=1 βj κ(x̀j , ·)kH , one gets Pm h j=1 βj κ(x̀j , ·), κ(x, ·)iH Pm kP̀κ(x, ·)k2H = max β k j=1 βj κ(x̀j , ·)kH Pm j=1 βj κ(x, x̀j ) . (13) = max Pm β k j=1 βj κ(x̀j , ·)kH Moreover, the Pythagorean Theorem allows to measure the residual norm of this projection, with k(I − P̀)κ(x, ·)k2H = kκ(x, ·)k2H − kP̀κ(x, ·)k2H = κ(x, x) − kP̀κ(x, ·)k2H , where I is the identity operator. Therefore, the quadratic approximation error is Pm j=1 βj κ(x, x̀j ) 2 . k(I − P̀)κ(x, ·)kH = κ(x, x) − max Pm β k j=1 βj κ(x̀j , ·)kH (14) In the following, we investigate this expression in order to derive proper bounds on the approximation error, either when the sample is discarded or when it already belongs to the dictionary. 2 One can also consider a normalized version of the Babel measure, p by substituting κ(xt , x̀j ) in (11) with κ(xt , x̀j )/ κ(xt , xt ) κ(x̀j , x̀j ). These two definitions are equivalent when dealing with unit-norm atoms. To the best of our knowledge, this formulation is not used in the literature. Moreover, it looses the matrix-norm notion. 5 A. Approximation error of discarded samples When the sample xt is discarded, we propose to upper bound the quadratic approximation error (14) with |κ(xt , x̀j )| k(I − P̀)κ(xt , ·)k2H ≤ κ(xt , xt ) − max p , (15) j κ(x̀j , x̀j ) where the inequality corresponds to the special choice of the coefficients, with β1 = . . . = βm = 0 except for βj = sign(κ(x p t , x̀j )). Next, we show that the quotient |κ(xt , x̀j )|/ κ(x̀j , x̀j ) in the above expression is bounded, with a lower bound that depends on the threshold of the investigated sparsification criterion. For this purpose, we examine separately the distance (Theorem 1), the coherence (Theorem 2), and the Babel (Theorem 3) criteria. Theorem 1 (Discarding error for the distance criterion): Let xt be a sample not satisfying the distance condition (7) for some given threshold δ. The quadratic error of approximating κ(xt , ·) with a linear combination of atoms from the resulting dictionary is upper-bounded by p δ2 and κ(xt , xt ) − κ(xt , xt ) − δ 2 . The latter upper bound is sharper when δ 2 > κ(xt , xt ) − 1. This is the case when dealing √ with unit-norm atoms, where we get the upper bound 1 − 1 − δ 2 . Proof: Firstly, one can easily derive the first expression of the upper bound, since min κ(xt , ·) − ξ1 ···ξm m X i=1 ξi κ(x̀i , ·) 2 H ≤ min min κ(xt , ·) − ξj κ(x̀j , ·) j=1···m ξj 2 H < δ2, where the first inequality follows from the special case when all ξi are null except for a single one, and the second inequality is due to the violation of (6). Secondly, the second expression of the upper bound is a bit more trickier. The approximation error is given by the norm of the residual of the projection of κ(xt , ·) onto the subspace spanned by the dictionary atoms, namely as given in (15). Since xt does not satisfy the condition (6)-(7), we have   κ(xt , x̀j )2 < δ2, min κ(xt , xt ) − j=1...m κ(x̀j , x̀j ) and as a consequence, since κ(xt , xt ) ≥ δ 2 , we can easily show that p |κ(xt , x̀j )| κ(xt , xt ) − δ 2 < max p . j=1...m κ(x̀j , x̀j ) By injecting this inequality in (15), we get the second expression of the upper bound with p  2 I − P̀ κ(xt , ·) H < κ(xt , xt ) − κ(xt , xt ) − δ 2 . Finally, we compare these two expressions. It is easy to see p that κ(xt , xt ) − κ(xt , xt ) − δ 2 is sharper than δ 2 when p κ(xt , xt ) − κ(xt , xt ) − δ 2 < δ 2 , 6 p namely when κ(xt , xt ) − δ 2 < κ(xt , xt ) − δ 2 . This condition, of the form u2 < u, is satisfied when u < 1, namely κ(xt , xt ) − δ 2 < 1. Theorem 2 (Discarding error for the coherence criterion): Let xt be a sample not satisfying the coherence condition (10) for some given threshold γ. The quadratic error of approximating κ(xt , ·) with a linear combination of atoms from the resulting dictionary is upper-bounded by p κ(xt , xt ) − γ κ(xt , xt ). In the particular case of unit-norm atoms, we get 1 − γ. Proof: The unfulfilled coherence condition (10), namely |κ(xt , x̀j )| max p > γ, j=1···m κ(xt , xt ) κ(x̀j , x̀j ) can be written in the equivalent form p |κ(xt , x̀j )| > γ κ(xt , xt ). max p j=1···m κ(x̀j , x̀j ) By injecting this inequality in (15), we get an upper bound on the approximation error as follows: p k(I − P̀)κ(xt , ·)k2H < κ(xt , xt ) − γ κ(xt , xt ), which concludes the proof. Theorem 3 (Discarding error for the Babel criterion): Let xt be a sample not satisfying the Babel condition (11) for some given threshold γ. The quadratic error of approximating κ(xt , ·) with a linear combination of atoms from the resulting dictionary is upper-bounded by γ κ(xt , xt ) − p , m(R2 + γ) which becomes 1 − √ γ m(1+γ) for unit-norm atoms. Proof: To prove this result, we use the quadratic approximation error given in expression (14) where, for the particular case of βj = sign(κ(xt , x̀j )), we get Pm j=1 βj κ(xt , x̀j ) 2 k(I − P̀)κ(xt , ·)kH = κ(xt , xt ) − max Pm β k j=1 βj κ(x̀j , ·)kH Pm j=1 |κ(xt , x̀j )| ≤ κ(xt , xt ) − 1 (β ⊤K̀β) 2 The above numerator is bounded Pm since the Babel condition (11) is not satisfied, namely j=1 |κ(xt , x̀j )| > γ. The above denominator is bounded thanks to the min-max theorem (i.e., the Rayleigh-Ritz quotient), with β⊤K̀β ≤ λ̀1 kβk2 . It turns out that the this upper bound is equal P to m(R2 + m 2 γ). j=1 βj = PmTo show this, on 2the one hand, we have = m due to the aforementioned j=1 |sign(κ(xt , x̀j ))| particular choice of the βj . On the other hand, the eigenvalues of a Gram matrix K̀ associated to a γ-Babel dictionary are upper-bounded by R2 + γ, as given in the Appendix; see [32, Theorem 5] for more details. The combination of all these results concludes the proof. B. Approximation error of an atom from the dictionary In this section, we study the approximation of an atom of a dictionary with a linear combination of its other atoms. We provide a lower bound on the approximation error for each sparsification criterion. Let κ(x̀i , ·) be an atom of the dictionary, and consider its projection onto the subspace spanned by the other m − 1 atoms. By following the same derivations as in the beginning of Section IV, we have Pm j=1,j6=i βj κ(x̀i , x̀j ) 2 . k(I − P̀)κ(x̀i , ·)kH = κ(x̀i , x̀i )−max Pm β k j=1,j6=i βj κ(x̀j , ·)kH On the one hand, the numerator in the above expression is upper-bounded, since we have from the Cauchy-Schwarz inequality: !2 m m m X X X 2 βj κ(x̀i , x̀j ) βj2 |κ(x̀i , x̀j )| . ≤ j=1 j6=i j=1 j6=i j=1 j6=i On the other hand, the denominator has a lower bound, since we have: m X j=1 j6=i βj κ(x̀j , ·) 2 H = β⊤K̀\{i}β ≥ λ̀\{i}m−1 kβk2 , where K̀\{i} is the (m − 1)-by-(m − 1) submatrix of the Gram matrix K̀ obtained by removing its i-th row and its i-th column, i.e., the entries associated to x̀i , and λ̀\{i}m−1 is its smallest eigenvalue. By combining these two inequalities, we get v u m X 1 u |κ(x̀i , x̀j )|2 , k(I − P̀)κ(x̀i , ·)k2H ≥ κ(x̀i , x̀i )−u t λ̀ m−1 \{i} j=1 j6=i (16) This expression is investigated in the following for the distance (Theorem 4), the coherence (Theorem 5), and the Babel (Theorem 6) criteria. For each sparsification criterion, the above lower bound is written by using the corresponding summation expression and the appropriate lower bound on the eigenvalues, as derived in [32, Section IV] and put in a nutshell in the Appendix. Theorem 4 (Acceptance error for the distance criterion): For a dictionary resulting from the distance criterion for some given threshold δ, the quadratic error of approximating any atom κ(x̀i , ·) with a linear combination of the other atoms is lower-bounded by s  κ(x̀i , x̀i ) − δ 2 (m − 1)R2 √ κ(x̀i , x̀i ) − . r2 − (m − 2)R R2 − δ 2 For unit-norm atoms, we get a lower bound for all atoms, with s (m − 1)(1 − δ 2 ) √ . 1− 1 − (m − 2) 1 − δ 2 HONEINE: APPROXIMATION ERRORS OF ONLINE SPARSIFICATION CRITERIA 7 Proof: The proof is split in two parts, by investigating expression (16). Firstly, the summation term is upper-bounded since, from (8), we have that any pair (x̀i , x̀j ) satisfies Proof: The proof is obtained by substituting the ℓ2 -norm 1 P 2 2 , with an ℓ1 -norm, since we in (16), i.e., j |κ(x̀i , x̀j )| have the relation kuk2 ≤ kuk1 . This yields m X j=1 j6=i |κ(x̀i , x̀j )|2 ≤ m X j=1 j6=i κ(x̀j , x̀j ) κ(x̀i , x̀i ) − δ 2 = κ(x̀i , x̀i ) − δ m X 2  κ(x̀j , x̀j ) j=1 j6=i  = κ(x̀i , x̀i ) − δ 2 (m − 1) max κ(x̀j , x̀j ) j=1···m j6=i 2  = κ(x̀i , x̀i ) − δ 2 (m − 1)R . Secondly, the eigenvalue in this expression is lower-bounded √ by r2 −(m−2)R R2 − δ 2 for a δ-distant dictionary of m−1 atoms, as shown in Lemma A.1 of the Appendix. Theorem 5 (Acceptance error for the coherence criterion): For a dictionary resulting from the coherence criterion for some given threshold γ, the quadratic error of approximating any atom κ(x̀i , ·) with a linear combination of the other atoms is lower-bounded by s (m − 1) γ 2 R2 κ(x̀i , x̀i ) . κ(x̀i , x̀i ) − r2 − (m − 2)γR2 For unit-norm atoms, this bounds becomes independent of x̀i , with s (m − 1) γ 2 . 1− 1 − (m − 2) γ Proof: The proof follows the same procedure as in the previous proof. On the one hand, we have m X j=1 j6=i |κ(x̀i , x̀j )|2 ≤ (m − 1) max |κ(x̀i , x̀j )|2 m X 1 k(I − P̀)κ(x̀i , ·)k2H ≥ κ(x̀i , x̀i ) − q |κ(x̀i , x̀j )|. λ̀\{i}m−1 j=1 j6=i The above summation term is upper-bounded by γ thanks to the Babel definition in (12). Moreover, the above eigenvalue is lower-bounded by r2 − γ, as derived in Lemma A.3 of the Appendix. This concludes the proof. This theorem should be compared with the work of [19, Theorem 1], where the authors propose a lower bound on the quadratic approximation error for unit-norm atoms, with 1−γ. It is easy to see that the lower bound given in Theorem 6 is tighter than the previously proposed bound, and extends the result to atoms that are not unit-norm. V. A PPROXIMATION In this section, we study the relevance of approximating any feature with its projection onto the subspace spanned by the atoms of a dictionary. An upper bound on the approximation error is derived in the following theorem for any sparsification criterion, while specific bounds in term of the threshold of each criterion are given in the following Theorem 8. Moreover, these results are explored in two particular kernel-based learning algorithms, with the empirical mean (see Section V-A) and the principal axes (see Section V-B) as features to be estimated. Theorem Consider the approximation of some feature P7: n ψ(·) = i=1 αi κ(xi , ·) with a sparse solution given by projecting it onto the subspace spanned by the m atoms of a given dictionary. The quadratic error of such approximation is upper-bounded by (n − m) kαk2 ǫ2 , j=1···m j6=i ≤ (m − 1) γ 2 max κ(x̀i , x̀i ) κ(x̀j , x̀j ) ≤ (m − j=1···m j6=i 1) γ 2 R2 κ(x̀i , x̀i ), where the second inequality follows from the coherence condition. On the other hand, we use the lower bound r2 − (m − 2)γR2 on the eigenvalues associated to a γ-coherent dictionary of m − 1 atoms, as derived in Lemma A.2 of the Appendix. To complete the proof, we combine these results in (16). Theorem 6 (Acceptance error for the Babel criterion): For a dictionary resulting from the Babel criterion for some given threshold γ, the quadratic error of approximating any atom κ(x̀i , ·) with a linear combination of the other atoms is lower-bounded by γ κ(x̀i , x̀i ) − p . r2 − γ For unit-norm atoms, we get the following lower bound for all atoms: γ . 1− √ 1−γ OF A FEATURE where ǫ is an upper bound on the approximation of any κ(xi , ·) with a linear combination of atoms from the dictionary. Proof: Let P̀ be the projection operator onto the subspace spanned by the P atoms of the dictionary under P scrutiny, approxim n mating ψ(·) = i=1 αi κ(xi , ·) with ψ̀(·) = j=1 ὰj κ(x̀j , ·). The error of such approximation is k(I − P̀)ψ(·)kH = k ≤ n X i=1 n X i=1 αi (I − P̀) κ(xi , ·)kH |αi | k(I − P̀) κ(xi , ·)kH , (17) where the inequality is due to the generalized triangular inequality. By applying the Cauchy-Schwarz inequality, we get the quadratic approximation error k(I − P̀)ψ(·)k2H ≤ n X i=1 α2i n X i=1 k(I − P̀) κ(xi , ·)k2H . (18) The first summation is the quadratic ℓ2 -norm of the vector of coefficients, namely kαk2 . For the second summation, we separate it in two terms, entries belonging to the dictionary 8 and those discarded thanks to the used sparsification criterion. While the former do not contribute to the error, only the latter take part in the summation, namely the n − m discarded samples where m is the size of the dictionary. Let ǫ2 be an upper bound on the quadratic error of discarding samples, as given in Section IV-A. Then, we get k(I − P̀)ψ(·)k2H ≤ (n − m) kαk2 ǫ2 , which concludes the proof. By revisiting the upper bounds given in Section IV-A for each sparsification criterion, we can easily show the following results. Expressions for non-unit-norm atoms can be derived without difficulty from Theorems 1, 2, 3. Theorem 8: The upper bound given in Theorem 7 can be specified for each sparsification criterion in terms of the used threshold. For unit-norm√atoms, we have 2 • (n − m)kαk (1 − 1 − δ 2 ) for the δ-distant criterion. 2 2 • (n − m)kαk δ for the δ-approximate criterion. 2 • (n − m)kαk (1 − γ)p for the γ-coherent criterion.  2 • (n − m)kαk 1 − γ/ m(1 + γ) for the γ-Babel criterion. We explore next these results for two particular kernel-based learning algorithms, in order to clarify the relevance of these bounds. A. Approximation of the empirical mean The empirical mean is a fundamental feature of the set of sample, and its use is essential in many statistical methods. For instance, it is investigated in [23] for visualization and clustering of nonnegative data and in [22], [33] for one-class classification with kernel-based methods. In the following, we study the relevance of approximating the empirical mean by its projection onto the subspace spanned by the atoms of a Pn dictionary. Let ψ(·) = n1 i=1 κ(xi , ·) be the empirical mean, namely αi = 1/n for any i = 1, 2, . . . , n. From Theorem 7, we get  m 2 ǫ , (19) k(I − P̀)ψ(·)k2H ≤ 1 − n where maxi k(I − P̀)κ(xi , ·)kH ≤ ǫ. In the following, we give a sharper bound. Indeed, we provide a sharper bound by relaxing the use of the Cauchy-Schwarz inequality in (18), thanks to the fact that the coefficients αi are constant, i.e., independent of i. As a consequence, we get by revisiting expression (17): n X |αi |k(I − P̀) κ(xi , ·)kH k(I − P̀)ψ(·)kH ≤ i=1 n = 1X k(I − P̀) κ(xi , ·)kH n i=1 1 (n − m) ǫ, n where we have followed the same decomposition as in the proof of Theorem 7, with only the n − m discarded samples contribute to the summation term. Therefore, the quadratic approximation error is upper-bounded as follows:  m 2 2 ǫ . k(I − P̀)ψ(·)k2H ≤ 1 − n ≤ This bound is sharper than the one in (19) since 1 − m n < 1. By revisiting Theorem 8 in the light of this result, the upper bound on the quadratic approximation error k(I − P̀)ψ(·)k2H can be described in terms of the threshold of each sparsification criterion, as follows:  p  m 2 1 − 1 − δ 2 for the δ-distant criterion. • 1− n  m 2 2 • 1− δ for the δ-approximate criterion. n  m 2 • 1− (1 − γ) for the γ-coherent criterion. n !   γ m 2 1− p for the γ-Babel crite• 1− n m(1 + γ) rion. These results generalize the work in [21], where only the case of the coherence criterion is studied. Expressions for dictionaries with atoms that are not unit-norm can be easily obtained thanks to Theorems 1, 2, 3. B. Approximation of the most relevant principal axes Any sparsification criterion can be seen as a dimensionality reduction technique, because it identifies a subspace by selecting relevant samples from the available ones. Since it is an unsupervised approach, it is natural to connect it with the kernel principal component analysis. For the sake of clarity, it is assumed that the data are centered in the feature space; see [34] for connections to the uncentered case. The principal component analysis (PCA) seeks the principal axes that capture the most of the data variance. The principal axes correspond to the eigenvectors associated to the largest eigenvalues of the covariance matrix. In its kernel-based counterpart, i.e., theP kernel-PCA, the k-th principal axis takes the form ψk (·) = ni=1 αi,k κ(xi , ·), where the coefficients αi,k are the entries of the k-th eigenvector of the Gram matrix K. Moreover, to get unit-norm principal axes, the coefficients Pn 2 αi,k are normalized such that α i=1 i,k = 1/nλk . In this expression, λk is the k-th eigenvalue of the Gram matrix, also called principal value. In the following, we highlight the connections between the kernel-PCA and the online sparsification criteria. Theorem 9: Let ψk (·) be the k-th principal axe of the kernel functions κ(xi , ·), for i = 1, 2, . . . , n, associated to the eigenvalue λk of the corresponding Gram matrix. Its approximation with a dictionary of m kernel functions has a quadratic error that can be upper-bounded by  m  ǫ2 , 1− n λk where ǫ is an upper bound on the approximation of any κ(xi , ·) with a linear combination of atoms from the dictionary. The proof of this theorem is straightforward, by substituting kαk2 with 1/nλk in Theorem 7. Theorem 9 shows that, under the only condition that the used dictionary has an upper bound on the error of approximating each kernel function, the principal axes associated to the largest principal values have the smallest approximation errors. One can therefore say that the most relevant principal axes lie, with a small error, in the span of the sparse dictionary. HONEINE: APPROXIMATION ERRORS OF ONLINE SPARSIFICATION CRITERIA 9 Moreover, we derive expressions for each sparsification criterion, as given next √ in terms of the used threshold:  m  1 − 1 − δ2 • 1− for the δ-distant criterion. n λk   2 m δ for the δ-approximate criterion. • 1− n λk  m 1 − γ • 1− for the γ-coherent criterion. n λk !  γ m 1 1− p • 1− for the γ-Babel criten λk m(1 + γ) rion. These results generalize previous work on the approximation and the coherence criteria, and provide tighter bounds than the ones previously known in the literature. Indeed, the upper bound δ 2 /λk was derived for the approximation criterion in [11, Theorem 3.3] and in [8, Theorem 5], while the coherence criterion is studied in [15, Proposition 5] with the upper bound (1 − γ)/λk . entries from the same row. In other words, for each λ̀i , there exists at least one j ∈ {1, 2, . . . , m} such that VI. F INAL REMARKS In this paper, we studied the approximation errors of any sample when dealing with the distance, the coherence, or the Babel criterion, revealing that these criteria are roughly based on an approximation process. By deriving an upper bound on the error of approximating a sample discarded from the dictionary, we explored that the atoms are “sufficient” to represent any sample. The dual condition, namely showing that each atom of the dictionary is “necessary”, was also exhibited by providing a lower bound on the approximation of any atom of the dictionary with the other atoms. Moreover, beyond the analysis of a single sample, we extended these results to the estimation of any feature, by describing in detail two classes of features, the empirical mean (i.e., centroid) and the principal axes in kernel-PCA. This work did not devise any particular sparsification criterion. It provided a framework to study online sparsification criteria. We argued that these criteria behave essentially in an identical mechanism, and share many interesting and desirable properties. Without loss of generality, we considered the framework of kernel-based learning algorithms. It is worth noting that these machines are intimately connected with the Gaussian processes [6], where the approximation criterion was initially proposed [10]. |λ̀i − κ(x̀j , x̀j )| ≤ j=1 j6=i |κ(x̀i , x̀j )|. (20) This theorem provides upper and lower bounds on the eigenvalues of a Gram matrix associated to a sparse dictionary, as described in the following for each sparsity measure. Lemma A.1: The eigenvalues of a Gram matrix associated to a δ-distant dictionary of m atoms are bounded as follows: p r2 − (m − 1)R R2 − δ 2 ≤ λ̀m ≤ · · · p · · · ≤ λ̀1 ≤ R2 + (m − 1)R R2 − δ 2 . Proof: From (8), a δ-distant dictionary satisfies q  |κ(x̀i , x̀j )| ≤ κ(x̀j , x̀j ) κ(x̀i , x̀i ) − δ 2 , for any i = 1, 2, . . . , m, which yields Xq X  |κ(x̀i , x̀j )| ≤ κ(x̀j , x̀j ) κ(x̀i , x̀i ) − δ 2 j j Xq p κ(x̀j , x̀j ). = κ(x̀i , x̀i ) − δ 2 j By substituting this relation in (20), we get that, for each eigenvalue λ̀k , there exists at least one i such that m q X p |λ̀k − κ(x̀i , x̀i )| ≤ κ(x̀i , x̀i ) − δ 2 κ(x̀j , x̀j ). j=1 j6=i Lemma A.2: The eigenvalues of a Gram matrix associated to a γ-coherent dictionary of m atoms are bounded as follows: r2 − (m − 1)γR2 ≤ λ̀m ≤ · · · ≤ λ̀1 ≤ R2 + (m − 1)γR2 . Proof: A γ-coherent dictionary satisfies |κ(x̀i , x̀j )| max p ≤ γ, κ(x̀i , x̀i ) κ(x̀j , x̀j ) j=1···m j6=i for any i, j = 1, 2, . . . , m, which yields q max |κ(x̀i , x̀j )| ≤ γ max κ(x̀i , x̀i ) κ(x̀j , x̀j ) j=1···m j6=i j=1···m j6=i =γ A PPENDIX This appendix provides bounds on the eigenvalues of a Gram matrix associated to a sparse dictionary, for each of the sparsity measures investigated in this paper. For completeness, these bounds are put here in a nutshell ; see [32, Section IV] for more details. A cornerstone of these results is the wellknown Geršgorin Discs Theorem [35, Chapter 6]. Revisited here for a Gram matrix associated to a sparse dictionary, it states that any of its eigenvalues lies in the union of the m discs, centered on each diagonal entry of K̀ with a radius given by the sum of the absolute values of the other m − 1 m X q p κ(x̀i , x̀i ) max κ(x̀j , x̀j ) j=1···m j6=i p ≤ γR κ(x̀i , x̀i ). By injecting this expression in (20), we get m X j=1 j6=i |κ(x̀i , x̀j )| ≤ (m − 1) max |κ(x̀i , x̀j )| j=1···m j6=i p ≤ (m − 1)γR κ(x̀i , x̀i ). Since κ(x̀i , x̀i ) ≤ R2 , this completes the proof. 10 Lemma A.3: The eigenvalues of a Gram matrix associated to a γ-Babel dictionary are bounded as follows: r2 − γ ≤ λ̀m ≤ · · · ≤ λ̀1 ≤ R2 + γ. Proof: The proof is straightforward from the Geršgorin Discs Theorem, since expression (20) becomes |λ̀k − κ(x̀i , x̀i )| ≤ m X j=1 j6=i |κ(x̀i , x̀j )| ≤ γ, where the last inequality is due to the Babel measure. R EFERENCES [1] “Special issue on signal processing for big data,” Selected Topics in Signal Processing, IEEE Journal of, vol. 8, pp. 507–507, June 2014. [2] “Special issue on signal processing for big data,” Signal Processing, IEEE Transactions on, vol. 62, pp. 1899–1899, April 2014. [3] G. Giannakis, F. Bach, R. Cendrillon, M. Mahoney, and J. Neville, “Signal processing for big data [from the guest editors],” Signal Processing Magazine, IEEE, vol. 31, pp. 15–16, Sept 2014. [4] J. Platt, “A resource-allocating network for function interpolation,” Neural Comput., vol. 3, pp. 213–225, June 1991. [5] V. N. Vapnik, Statistical Learning Theory. New York, NY, USA: Wiley, September 1998. [6] C. E. Rasmussen and C. Williams, Gaussian Processes for Machine Learning. MIT Press, 2006. [7] G. bin Huang, P. Saratch, S. Member, and N. Sundararajan, “A generalized growing and pruning rbf (ggap-rbf) neural network for function approximation,” IEEE Transactions on Neural Networks, vol. 16, pp. 57– 67, 2005. [8] P. Honeine, “Online kernel principal component analysis: a reducedorder model,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 34, pp. 1814–1826, September 2012. [9] B. Schölkopf, R. Herbrich, and A. J. Smola, “A generalized representer theorem,” in Proc. 14th Annual Conference on Computational Learning Theory and 5th European Conference on Computational Learning Theory, COLT/EuroCOLT, (London, UK), pp. 416–426, Springer-Verlag, 2001. [10] L. Csató and M. Opper, “Sparse online gaussian processes,” Neural Computation, vol. 14, pp. 641–668, 2002. [11] Y. Engel, S. Mannor, and R. Meir, “The kernel recursive least squares algorithm,” IEEE Trans. Signal Processing, vol. 52, no. 8, pp. 2275– 2285, 2004. [12] P. P. Pokharel, W. Liu, and J. C. Principe, “Kernel least mean square algorithm with constrained growth,” Signal Processing, vol. 89, no. 3, pp. 257 – 265, 2009. [13] G. S. Babu and S. Suresh, “Meta-cognitive rbf network and its projection based learning algorithm for classification problems,” Appl. Soft Comput., vol. 13, pp. 654–666, Jan. 2013. [14] Y.-K. Yang, T.-Y. Sun, C.-L. Huo, Y.-H. Yu, C.-C. Liu, and C.-H. Tsai, “A novel self-constructing radial basis function neural-fuzzy system,” Applied Soft Computing, vol. 13, no. 5, pp. 2390 – 2404, 2013. [15] P. Honeine, C. Richard, and J. C. M. Bermudez, “On-line nonlinear sparse approximation of functions,” in Proc. IEEE International Symposium on Information Theory, (Nice, France), pp. 956–960, June 2007. [16] C. Richard, J. C. M. Bermudez, and P. Honeine, “Online prediction of time series data with kernels,” IEEE Transactions on Signal Processing, vol. 57, pp. 1058–1067, March 2009. [17] J. A. Tropp, “Greed is good: algorithmic results for sparse approximation,” IEEE Trans. Information Theory, vol. 50, pp. 2231–2242, 2004. [18] M. Elad, Sparse and Redundant Representations: From Theory to Applications in Signal and Image Processing. Springer, 2010. [19] H. Fan, Q. Song, and S. B. Shrestha, “Online learning with kernel regularized least mean square algorithms,” Knowledge-Based Systems, vol. 59, no. 0, pp. 21 – 32, 2014. [20] W. Liu, J. C. Principe, and S. Haykin, Kernel Adaptive Filtering: A Comprehensive Introduction. Wiley Publishing, 1st ed., 2010. [21] Z. Noumir, P. Honeine, and C. Richard, “One-class machines based on the coherence criterion,” in Proc. IEEE workshop on Statistical Signal Processing, (Ann Arbor, Michigan, USA), pp. 600–603, 5–8 August 2012. [22] Z. Noumir, P. Honeine, and C. Richard, “On simple one-class classification methods,” in Proc. IEEE International Symposium on Information Theory, (MIT, Cambridge (MA), USA), pp. 2022–2026, 1–6 July 2012. [23] R. Jenssen, “Mean vector component analysis for visualization and clustering of nonnegative data,” Neural Networks and Learning Systems, IEEE Transactions on, vol. 24, pp. 1553–1564, Oct 2013. [24] B. Schölkopf, A. Smola, and K.-R. Müller, “Nonlinear component analysis as a kernel eigenvalue problem,” Neural Comput., vol. 10, pp. 1299–1319, July 1998. [25] C. Saidé, R. Lengellé, P. Honeine, and R. Achkar, “Online kernel adaptive algorithms with dictionary adaptation for mimo models,” IEEE Signal Processing Letters, vol. 20, pp. 535–538, May 2013. [26] G. Baudat and F. Anouar, “Kernel-based methods and function approximation,” in In International Joint Conference on Neural Networks (IJCNN), vol. 5, (Washington, DC, USA), pp. 1244–1249, July 2001. [27] L. Csató and M. Opper, “Sparse representation for gaussian process models,” in Advances in Neural Information Processing Systems 13, pp. 444–450, MIT Press, 2001. [28] D. Nguyen-Tuong and J. Peters, “Incremental online sparsification for model learning in real-time robot control,” Neurocomputing, vol. 74, no. 11, pp. 1859 – 1867, 2011. [29] R. Rosipal, M. Koska, and I. Farkas, “Prediction of chaotic time-series with a resource-allocating RBF network,” in Neural Processing Letters, pp. 185–197, 1997. [30] B. Chen, S. Zhao, P. Zhu, and J. Principe, “Quantized kernel least mean square algorithm,” Neural Networks and Learning Systems, IEEE Transactions on, vol. 23, pp. 22–32, Jan 2012. [31] A. C. Gilbert, S. Muthukrishnan, M. J. Strauss, and J. Tropp, “Improved sparse approximation over quasi-incoherent dictionaries,” in International Conference on Image Processing (ICIP), vol. 1, (Barcelona, Spain), pp. 37–40, Sept. 2003. [32] P. Honeine, “Analyzing sparse dictionaries for online learning with kernels,” IEEE Transactions on Signal Processing, 2014 submitted. [33] Z. Noumir, P. Honeine, and C. Richard, “Online one-class machines based on the coherence criterion,” in Proc. 20th European Conference on Signal Processing, (Bucharest, Romania), pp. 664–668, 27–31 August 2012. [34] P. Honeine, “An eigenanalysis of data centering in machine learning,” IEEE Transactions on Pattern Analysis and Machine Intelligence, 2014 submitted. [35] R. A. Horn and C. R. Johnson, Matrix analysis. New York, NY, USA: Cambridge University Press, 2nd edition ed., December 2012. Paul Honeine (M’07) was born in Beirut, Lebanon, on October 2, 1977. He received the Dipl.-Ing. degree in mechanical engineering in 2002 and the M.Sc. degree in industrial control in 2003, both from PLACE the Faculty of Engineering, the Lebanese University, PHOTO Lebanon. In 2007, he received the Ph.D. degree in HERE Systems Optimisation and Security from the University of Technology of Troyes, France, and was a Postdoctoral Research associate with the Systems Modeling and Dependability Laboratory, from 2007 to 2008. Since September 2008, he has been an assistant Professor at the University of Technology of Troyes, France. His research interests include nonstationary signal analysis and classification, nonlinear and statistical signal processing, sparse representations, machine learning. Of particular interest are applications to (wireless) sensor networks, biomedical signal processing, hyperspectral imagery and nonlinear adaptive system identification. He is the co-author (with C. Richard) of the 2009 Best Paper Award at the IEEE Workshop on Machine Learning for Signal Processing. Over the past 5 years, he has published more than 100 peerreviewed papers.
9cs.NE
Statistical estimation of the Shannon entropy Alexander Bulinski1 , Denis Dimitrov2 arXiv:1801.02050v1 [math.ST] 6 Jan 2018 Steklov Mathematical Institute of Russian Academy of Sciences; Dept. of Mathematics and Mechanics, Lomonosov Moscow State University, Moscow 119234, Russia Abstract The behavior of the Kozachenko - Leonenko estimates for the (differential) Shannon entropy is studied when the number of i.i.d. vector-valued observations tends to infinity. The asymptotic unbiasedness and L2 -consistency of the estimates are established. The conditions employed involve the analogues of the Hardy - Littlewood maximal function. It is shown that the results are valid in particular for the entropy estimation of any nondegenerate Gaussian vector. Key words Shannon differential entropy; Kozachenko - Leonenko estimates; Hardy - Littlewood maximal function analogues; asymptotic unbiasedness and L2 -consistency; Gaussian vectors MR (2010) Subject Classification 60F25, 62G20, 62H12 1 Introduction The notion of entropy belongs to the principle ones in Physics and Mathematics. R.Clausius is considered as the father of the entropy concept. The important contributions to the development of this concept were made by L.Boltzmann, J.Gibbs and M.Planck. Mathematicians also were preoccupied with the entropy. The works by C.Shannon, A.N.Kolmogorov, Ya.G.Sinai, A.Rényi, A.S.Holevo, T.Tsallis are worth mentioning in this regard. On the history of different paths to entropy see, e.g., [2], [3]. Thus there are various definitions of entropy. We recall that proposed by C.Shannon in [21]. Namely, if a random variable ξ takes values in a finite or numerable set S, then the Shannon entropy of ξ (or of ξ distribution) is given by the formula X H := − px log px x∈S where px := P(ξ = x), x ∈ S. Here the logarithm base is 2 but we will employ the base e since a constant factor is not essential below. As usual we set 0 log 0 := 0. Now, for a random vector ξ taking values in Rd and having a density f w.r.t. the Lebesgue measure µ, one can introduce in a similar way the entropy (also called differential entropy) Z H(f ) := − f (x) log f (x)µ(dx). (1) Rd For a density version f denote the support S(f ) := {x ∈ Rd : f (x) > 0}. Clearly, the integral in (1) is taken over S(f ). To simplify notation we will write dx instead of µ(dx). We mention in passing the Rényi entropy Hα and the Tsallis entropy Sq depending on certain parameters α and q, respectively (when α → 1 and q → 1 the Shannon entropy arises). On these and other divergence measures see, e.g., [11]. Statistical estimates of H(f ) constructed by means of i.i.d. observations X1 , . . . , XN having the same law as ξ are very important. They permit to estimate some other characteristics of distributions, e.g., the mutual information for two random vectors. Such estimates are 1 2 E-mail: [email protected] E-mail: [email protected] widely used in machine learning, they are employed in entropy-based goodness-of-fit tests, they are applied in the feature selection theory and in the detection of texture inhomogeneities (see, e.g., [1], [4], [16], [20]). We leave apart many other domains where an entropy (entropies) estimates are quite useful. There exist several approaches to H(f ) estimation. We are interested in nonparametric models. Note that H(f ) = E(− log f (ξ)). The “plug-in” method leads to the estimates P b N := − 1 N log fb(Xk ) where fb(x) is a (kernel) estimate of a density f at a point H k=1 N x ∈ Rd . In this regard we refer to the review [4]. Considering H(f ) estimation problem E.G.Miller writes in [18] that plug-in estimates work well in low dimensions and for densities with known parametric form, and the difficult problem of density estimation makes them impractical for small sample sizes in higher dimensions. He introduced the m-Voronoi and m-Delaunay estimators for H(f ), however the theorems concerning these estimates behavior were not provided. The method of a recursive rectilinear partitioning for H(f ) estimation is proposed in [26]. The author compares his method with Miller’s one and discusses the complexity of various partitioning schemes. J.Ma and Z.Sun [17] analyzed the copula entropy estimation to get the mutual information estimate. The Gaussian copula in the entropy estimation is also used in [7]. A nonparanormal information estimation is considered in [23]. An approach involving the nearest neighbor statistics to estimate an entropy was proposed by L.F.Kozachenko and N.N.Leonenko in a well-known paper [13] and developed by N.N.Leonenko with coauthors in a series of papers (see, e.g., [16]). These estimates can be viewed as the basis for the widely applied mutual information estimates introduced by A.Kraskov et al. [14]. During the last two decades many authors employed and analyzed the Kozachenko - Leonenko estimates. Unfortunately, in a number of papers the proofs of asymptotic properties of H(f ) estimates were not correct as it was pointed out, e.g., in [19]. The main goal of our research is to provide, under wide conditions, the proof of the asymptotic unbiasedness of H(f ) estimates and, moreover, to establish their L2 -consistency. Note that paper [19] is devoted to proving the strong consistency of the specified estimates of the Rényi entropy Hα for α ∈ (0, 1) when ξ has a density f with bounded support. If f is a Lipschitz function, then for any δ ∈ (0, 1) with probability at least 1 − δ the convergence rate (depending on d and δ) of these estimates to Hα is provided in [19] as well. The authors of [19] indicated that their theory would need significant changes to comprise the Shannon entropy estimation. For certain estimates, the convergence rate to H(f ) and the convergence in distribution to the normal law under appropriate normalization are established, e.g., in [8], [15]. The proofs exploit assumption that a density f is rather smooth. We do not impose such requirement. To complete the brief introduction we mention that, according to [25], the ensemble methods using the combinations of weighted statistics can improve the convergence rate for initially constructed statistics. Note also that it is interesting to consider estimates of H(f ) involving k-NN statistics (see, e.g., [7] and [24] where the authors use conditions on f different from those employed here). The paper is organized as follows. In Section 2 we introduce the estimates HN of H(f ) and formulate two main results. Section 3 is devoted to the proof of HN asymptotical unbiasedness. The L2 -consistency of HN is demonstrated in Section 4. The proofs of some auxiliary results are given in Appendix. 2 Main results Let X1 , . . . , XN be i.i.d. random vectors having the same law as a vector ξ with values in Rd . All random vectors (variables) under consideration are defined on a complete probability space (Ω, F , P). Assume that ξ (i.e. the distribution Pξ of ξ) has a density f w.r.t. the Lebesgue measure µ in Rd . For each i = 1, . . . , N, set ρi := min{ρ(Xi , Xj ) : j ∈ {1, . . . , N} \ {i}}, where ρ(x, y) is the Euclidean distance between x, y ∈ Rd . In other words ρi is the distance from Xi to its nearest neighbor in the sample {X1 , . . . , XN } \ {Xi }. Further on we consider N ≥ 2. Introduce ρ := (ρ1 · . . . · ρN )1/N . Recall that the Kozachenko-Leonenko estimate of an entropy H is provided by the formula where γ := − R HN := d log ρ + log Vd + γ + log (N − 1) (0,∞) e−t log t dt ≈ 0.5772 and Vd := d π2 Γ( d2 +1) (2) are the Euler constant and the volume (i.e. the Lebesgue measure) of a unit ball in Rd , respectively. We can write γ := exp{γ}. Let B(x, r) = {y ∈ Rd : ρ(x, y) ≤ r} be the ball HN = log(ρd Vd γe(N − 1)) with e of a radius r ≥ 0 with a center x ∈ Rd . Clearly, its volume |B(x, r)| := µ(B(x, r)) = r d Vd . Set ( 0, 0 ≤ t < 1, (3) G(t) := t log t, t ≥ 1. For a probability density f in Rd , x ∈ Rd , r > 0 and R > 0, introduce the functions (or functionals depending on parameters) R f (y) dy B(x,r) , (4) If (x, r) := r d Vd Mf (x, R) := sup If (x, r), mf (x, R) := inf If (x, r). r∈(0,R] r∈(0,R] (5) We use the following elementary result. Lemma 1 For a probability density f in Rd , the function If (x, r) defined in (4) is continuous in (x, r) ∈ Rd × (0, ∞). The proof is provided in Appendix. Thus, invoking, e.g., Theorem 15.84 [27], we can claim that, for each R > 0, the functions mf (·, R) and Mf (·, R) are upper semicontinuous and lower semicontinuous, respectively. Hence, in view of Proposition 15.82 [27] these nonnegative functions are Borel measurable. Clearly, for each x ∈ Rd , mf (x, ·) is nonincreasing and Mf (x, ·) is nondecreasing. Note in passing that changing supr∈(0,R] by supr∈(0,∞) in the definition of Mf (x, R) leads to the celebrated Hardy - Littlewood maximal R function Mf (x) widely used in the harmonic analysis. Some properties of a function B(x,r) f (y) dy are considered, e.g., in [9]. For a probability density f in Rd , positive εi , Rj , where i = 0, 1, 2 and j = 1, 2, we define the following functionals with values in [0, ∞] Z Z 1+ε0  Kf (ε0 ) := G | log ρ(x, y)| f (y) dy f (x) dx, (6) Rd Rd Z Qf (ε1 , R1 ) := Mfε1 (x, R1 )f (x) dx, (7) d R Z Tf (ε2 , R2 ) := mf−ε2 (x, R2 )f (x) dx. (8) Rd  Remark 1 One has to write Rd \{x} G | log ρ(x, y)| f (y) dy in (6) as ρ(x, x) = 0. However, we can formally set log 0 := −∞ and G(∞) := ∞ to keep formula (6) since Pξ ({x}) = 0 for any x ∈ Rd . We also suppose that 1/0 := ∞ (consequently mf−ε2 (x, R2 ) := ∞ when mf (x, R2 ) = 0). For each version of a function f ∈ L1 (Rd ), we can write in (6), (7), (8) the integral over the support S(f ) := {x ∈ Rd : f (x) > 0} instead of integrating over Rd (evidently, the results do not depend on the choice of f version). R Theorem 1 Assume that, for some positive εi , Rj , where i = 0, 1, 2 and j = 1, 2, the functionals appearing in (6), (7), (8) are finite, so Kf (ε0 ) < ∞, Qf (ε1 , R1 ) < ∞, Tf (ε2 , R2 ) < ∞. Then the estimates HN are asymptotically unbiased, i.e. lim EHN = H. (9) N→∞ Remark 2 It is useful to note that if Qf (ε1 , R1 ) < ∞ and Tf (ε2 , R2 ) < ∞ for some positive R ε1 , ε2 , R1 , R2 then Rd | log f (x)|f (x) dx < ∞. Indeed, definition (5) and the Lebesgue differentiation theorem (see, e.g., Theorem 25.17 [27]) yield that mf (x, R2 ) ≤ f (x) ≤ Mf (x, R1 ) for µ-almost all x ∈ Rd . Evidently, log z ≤ 1ε z ε for any z ≥ 1 and each ε > 0. Consequently, Z Z Z | log f (x)|f (x) dx = log f (x)f (x) dx + (− log f (x))f (x) dx Rd f (x)≥1 f (x)<1 1 1 ≤ Qf (ε1 , R1 ) + Tf (ε2 , R2 ) < ∞. ε1 ε2 So, the finiteness of integrals (7) and (8) implies |H(f )| < ∞. We formulate a simple but useful result. Lemma 2 Let f be a probability density in Rd . Then the following statements are valid. 1) If Kf (ε0 ) < ∞ for some ε0 > 0 then Kf (ε) < ∞ for any ε ∈ (0, ε0 ]. 2) If Qf (ε1 , R1 ) < ∞ for some ε1 > 0 and R1 > 0 then Qf (ε, R) < ∞ for any ε ∈ (0, ε1 ] and each R > 0. 3) If Tf (ε2 , R2 ) < ∞ for some ε2 > 0 and R2 > 0 then Tf (ε, R) < ∞ for any ε ∈ (0, ε2 ] and each R > 0. The proof of this Lemma is provided in Appendix. In view of Lemma 2 one can recast Theorem 1 as follows. Corollary 1 Let f be a probability density in Rd such that, for some ε > 0, Kf (ε), Qf (ε) and Tf (ε) are finite where Qf (ε) := Qf (ε, ε), Tf (ε) := Tf (ε, ε). Then (9) holds. Let us consider the following conditions. (A) For some p > 1, Z Rd Z Rd | log ρ(x, y)|p f (x)f (y) dxdy < ∞. (10) (B) There exists a version of density f such that, for some M > 0, f (x) ≤ M < ∞, x ∈ Rd . (C1) There exists a version of density f such that, for some m > 0, f (x) ≥ m > 0, x ∈ S(f ). Corollary 2 Any assumption of Theorem 1 concerning the finiteness of integrals (6), (7), (8) can be replaced by conditions (A), (B), (C1), respectively, and then (9) will be true as well. Moreover, if (B) and (C1) are satisfied then (9) holds whenever f has a bounded support. The proof of this Corollary is provided in Section 3. Along with (6), for a probability density f in Rd and positive ε0 , we define the following functional with values in [0, ∞] Z Z 1+ε0  Kf,2 (ε0 ) := G log2 ρ(x, y) f (y) dy f (x) dx. (11) Rd Rd Note that the statement 1) of Lemma 2 is true for Kf,2 as well, so if Kf,2 (ε0 ) < ∞ then Kf,2 (ε) < ∞ for any ε ∈ (0, ε0] (see the proof of Lemma 2). Let us formulate the conditions that guarantee L2 -consistency of (2). Theorem 2 Assume that, for some positive εi , Rj where i = 0, 1, 2, j = 1, 2, the functionals appearing in (11), (7), (8) are finite, so Kf,2 (ε0 ) < ∞, Qf (ε1 , R1 ) < ∞, Tf (ε2 , R2 ) < ∞. Then the estimates HN are L2 -consistent, i.e. E(HN − H)2 → 0, N → ∞. (12) Corollary 3 Any assumption of Theorem 2 concerning the finiteness of integrals (11), (7) and (8) can be replaced, respectively, by the following ones: (10) is valid for some p > 2, (B) and (C1). Then (12) will be true. Moreover, if (B) and (C1) are satisfied then (12) holds whenever f has a bounded support. Now instead of (C1) we consider the following condition. (C2) For a fixed R > 0, there exists a constant c > 0 and a version of a density f such that mf (x, R) ≥ cf (x), x ∈ Rd . (13) Note that D.Evans considered the “positive density condition” in Definition 2.1 of [9] R d meaning that there exist constants β > 1 and δ > 0 such that rβ ≤ B(x,r) f (y)dy ≤ βr d for all 0 ≤ r ≤ δ and x ∈ Rd . Consequently mf (x, δ) ≥ βV1 d , x ∈ Rd . It was proved in [10] that if f is smooth and its support is a compact convex body in Rd then the mentioned inequalities from Definition 2.1 of [9] hold. Remark 3 If, for some positive ε, R and c, condition (C2) is true and Z f (x)1−ε dx < ∞ (14) Rd then obviously Tf (ε, R) < ∞. Thus in Theorems 1 and 2 we can employ (C2) and (14) instead of the assumption concerning Tf (ε, R). To illustrate this observation we provide the following result for a density with unbounded support. Corollary 4 Let ξ be a Gaussian random vector in Rd with Eξ = ν and a nondegenerate covariance matrix Σ (i.e. ξ has a density). Then relations (9) and (12) hold where H = 1 log det(2πeΣ). 2 The proofs of Corollaries 3 and 4 are given in Section 4. 3 Proof of Theorem 1 According to the Lebesgue differentiation theorem if f ∈ L1 (Rd ) then, for µ-almost all x ∈ Rd , the following relation holds Z 1 lim |f (y) − f (x)| dy = 0. (15) r→0+ |B(x, r)| B(x,r) Let Λ(f ) stand for a set of all the Lebesgue points of a function f , i.e. for x ∈ Rd satisfying (15). Clearly Λ(f ) depends on the chosen version of f belonging to the class of equivalent functions from L1 (Rd ). For each version of f we have µ(Rd \ Λ(f )) = 0. We can rewrite the estimate HN as follows N  1 X ζi (N), ζi (N) = log ρdi Vd e γ (N − 1) , i = 1, . . . , N. HN = N i=1 Recall that ρi = min{ρ(Xi , Xj )| : j ∈ {1, . . . , N}\{i}}. The random variables ζ1 (N), . . . , ζN (N) are identically distributed since X1 , . . . , XN are i.i.d. random vectors, and therefore to prove Theorem 1 we will show that E|ζ1 (N)| < ∞ for all N large enough and Eζ1 (N) → H, N → ∞. (16) Note that if V is a nonnegative (a.s.) random variable (hence EV ≤ ∞) and X is an arbitrary random vector with values in Rd then there exists E(V |X). Moreover, E(V |X) = ψ(X) where a measurable function ψ takes values in [0, ∞] and Z EV = E(V |X = x)PX (dx), (17) Rd i.e. E(V |X = x) := ψ(x), x ∈ Rd . Formula (17) means that simultaneously both sides are finite or infinite and coincide (to verify (17) one can use the usual formula for a random variables Vk := V I{k ≤ V < k + 1} with finite expectation and the representation V = P ∞ k=0 Vk for nonnegative (a.s) random variable V with EV ≤ ∞). Let F (u, ω) be a regular conditional distribution function of V given X where u ∈ [0, ∞) and ω ∈ Ω, i.e. F (u, ω) is the specified version of P(V ≤ u|X)(ω), see, e.g., Theorem 4, Ch. 2, Sect. 7 in [22]. We will consider only such version since it provides the possibility to evaluate the conditional expectation according to the extension of Theorem 3, Ch. 2, Sect. 7 in [22]. Namely, if h is a measurable function such that h : R → [0, ∞) then, for PX -almost all x ∈ Rd , one has without assumption Eh(V ) < ∞ that Z E(h(V )|X = x) = h(u)dF (u, x). (18) [0,∞) It means that both sides of (18) are finite or infinite simultaneously and coincide (if Eh(V ) = ∞, to establish (18) we consider hn (u) := h(u)I{0 ≤ u ≤ n}, n ∈ N, and use the monotone convergence theorem). By means of (17) and (18) one can prove that E|ζ1(N)| < ∞ for all N large enough and (16) holds. For this purpose we take V = eζ1 (N ) , X = X1 and h(u) = | log u|, u > 0 (we take h(u) = log2 u in the proof of Theorem 2). Writing log U for a positive a.s. Rrandom variable U we set log U(ω) := −∞ when U(ω) = 0, and as usual we stipulate that A g(y)Q(dy) = 0 whenever g(y) = −∞ (or +∞) for y ∈ A and Q(A) = 0. To reduce the volume of the paper we only consider below the evaluation of Eζ1 (N) as all steps of the proof are the same when treating E|ζ1 (N)|. We divide the proof of Theorem 1 into four steps. Steps 1-3 are devoted to the demonstration of relation E(ζ1 (N)|X1 = x) → − log f (x), x ∈ A ⊂ S(f ), N → ∞, (19) where A depends on an f version and Pξ (S(f ) \ A) = 0. Step 4 contains the proof of the desired statement (16). Step 1. For x ∈ Rd and u > 0 we study the asymptotic behavior (as N → ∞) of the following function   FN,x (u) := P eζ1 (N ) ≤ u|X1 = x = P ρd1 (N)Vd γe(N − 1) ≤ u|X1 = x     d1 u =P min ρ(X1 , Xj ) ≤ Vd eγ (N −1) X1 = x (20) j=2,...,N  = P min ρ(x, Xj ) ≤ rN (u) = P(ξN,x ≤ u) j=2,...,N where rN (u) :=  u Vd e γ (N − 1)  d1 , (21) ξN,x := (N − 1)Vd e γ min ρd (x, Xj ), j=2,...,N (22) and we have employed in (20) the independence of random vectors X1 , . . . , XN . Therefore  FN,x (u) = 1 − P min ρ(x, Xj ) > rN (u) j=2,...,N Z  N −1  N −1 (23) = 1 − 1 − P ξ ∈ B(x, rN (u)) f (y) dy =1− 1− B(x,rN (u)) because X1 , . . . , XN are independent copies of a vector ξ. Formula (23) shows that FN,x (u) is the regular conditional distribution function of eζ1 (N ) given X1 = x. d Note that, for each u > 0, rN (u) → 0 as N → ∞ and |B(x, rN (u))| = Vd rN (u) = u . Hence in view of (15), for any fixed x ∈ Λ(f ) and u > 0, γ e(N −1) γ (N − 1) e u Z f (y) dy = f (x) + αN (x, u) B(x,rN (u)) where αN (x, u) = ō¯(1), N → ∞. Thus (23) implies that, for u > 0 and x ∈ Λ(f ) ∩ S(f ), we get (as f (x) > 0 for x ∈ S(f ))   N −1 u f (x) + αN (x, u) lim FN,x (u) = 1 − lim 1 − N→∞ N→∞ γ (N − 1) e (24) where ξx ∼ Exp  f (x) γ e  = 1 − e− f (x)u γ e =: Fx (u) = P(ξx ≤ u) , x ∈ S(f ). Relation (24) means that law ξN,x → ξx , x ∈ Λ(f ) ∩ S(f ), N → ∞. (25) We assume w.l.g. that, for all x ∈ S(f ), the random variables ξx and {ξN,x }N ≥2 are defined on a probability space (Ω, F , P) since in view of the Lomnicki - Ulam theorem (see, e.g. [12], p. 93) one can consider the independent copies of X1 , X2 , . . . and {ξx }x∈S(f ) defined on a certain probability space. The convergence in law of random variables is preserved under continuous mapping. Hence, for any x ∈ Λ(f ) ∩ S(f ), we come to the relation law log ξN,x → log ξx , N → ∞. (26) We took into account that, for each x ∈ Λ(f ) ∩ S(f ), one has ξx > 0 a.s. and since ξ has a density we infer that P(ξN,x > 0) = (P(ρ(x, ξ) > 0))N −1 = (1 − P(ξ = x))N −1 = 1, N ≥ 2. More precisely, we can ignore zero values of nonnegative random variables (having zero values with probability zero) when we take their logarithms. Step 2. Now we will prove that, for µ-almost every x ∈ S(f ), E log ξN,x → E log ξx , N → ∞. Note that if η ∼ Exp(λ) where λ > 0 then Z Z −λu E log η = (log u) λe du = (0,∞) (0,∞) (27) log ve−v dv − log λ = − log(λe γ ). Consequently, as f (x) > 0 for x ∈ S(f ) and λ = f (x) , we get E log ξx = − log f (x). It is γ e d easily seen that, for each x ∈ R , Z Z E log ξN,x = log u dFN,x(u) = log u dP(eζ1 (N ) ≤ u|X1 = x) (0,∞) (0,∞) ζ1 (N ) = E(log e |X1 = x) = E(ζ1 (N)|X1 = x). Thus, for x ∈ Λ(f ) ∩ S(f ), the relation E(ζ1 (N)|X1 = x) → − log f (x) holds if and only if E log ξN,x → E log ξx (N → ∞). According to Theorem 3.5 [5] we will establish (27) if relation (26) can be accompanied, for µ-almost all x ∈ S(f ), by the uniform integrability of a family {log ξN,x }N ≥N0 (x) . Note → ∞ as t → ∞. that G introduced by (3) is an increasing function on (0, ∞) and G(t) t Therefore, by the de la Valle Poussin theorem (see, e.g., Theorem 1.3.4 [6]) to guarantee, for µ-almost every x ∈ S(f ), the uniform integrability of {log ξN,x }N ≥N0 (x) it is sufficient to prove for such x, a positive C0 (x) and N0 (x) ∈ N that sup EG(| log ξN,x |) ≤ C0 (x) < ∞. (28) N ≥N0 (x) Step 3 is devoted to validity of (28). We will employ the following statement, its proof is contained in Appendix. Lemma 3 Let F (u), u ∈ R, be a cumulative distribution function and F (0) = 0. Then R R u)+1 du, 1) (0, 1 ] (− log u) log (− log u) dF (u) = (0, 1 ] F (u) log (− log u e e R R 2) (e,∞) log u log log u dF (u) = (e,∞) (1 − F (u)) log logu u+1 du. Note that, for u ∈ ( 1e , e], we have | log u| ≤ 1 and consequently G(| log u|) = 0. Obviously, FN,x (0) = 0 according to (22) if x ∈ Rd and N ≥ 2. Therefore due to Lemma 3, for such x and N, EG(| log ξN,x |) = Z Z (0, 1e ] (− log u) log (− log u) dFN,x (u) + log (− log u) + 1 = FN,x (u) du + u (0, 1e ] Z log u log log u dFN,x(u) [e,∞) Z [e,∞) (1 − FN,x (u)) log log u + 1 du u := I1 (N, x) + I2 (N, x). Consider I1 (N, x). Set, for N ≥ 2, x ∈ Rd and u > 0, Z pN,x (u) = f (y) dy. (29) B(x,rN (u)) Then, for R1 > 0 and any u ∈ (0, 1e ], we get rN (u) =  u γ (N − 1)Vd e 1/d ≤  1 ee γ (N − 1)Vd 1/d ≤ R1 if N ≥ N1 where N1 = N1 (R1 ). Thus, for R1 > 0, u ∈ (0, 1e ], x ∈ Rd and N ≥ N1 , R R f (y) dy f (y) dy pN,x (u) B(x,rN (u)) B(x,r) = = Mf (x, R1 ) ≤ sup d |B(x, rN (u))| r d Vd rN (u)Vd r∈(0,R1 ] and we obtain an inequality pN,x (u) ≤ Mf (x, R1 ) |B(x, rN (u))| = Note that if ε ∈ (0, 1] and x ∈ [0, 1] then, for all N ≥ 1, Mf (x, R1 )u . γ (N − 1) e 1 − (1 − x)N ≤ (Nx)ε . (30) (31) Indeed, according to the Bernoulli inequality 1 − (1 − x)N ≤ Nx. If x ∈ [0, N1 ] then Nx ≤ 1 and Nx ≤ (Nx)ε . If x ∈ ( N1 , 1] then Nx > 1 and (Nx)ε > 1 ≥ 1 − (1 − x)N . By assumptions of the Theorem Qf (ε1 , R1 ) < ∞ for some ε1 > 0, R1 > 0. According to Lemma 2 one can assume that ε1 < 1. Thus, due to (31) and since pN,x (u) ∈ [0, 1] for all x ∈ Rd , u > 0 and N ≥ 2, one has 1 − (1 − pN,x (u))N −1 ≤ ((N − 1)pN,x (u))ε1 . (32) In view of (23), (29), (30) and (32) one can claim now that, for all x ∈ Λ(f ) ∩ S(f ), u ∈ (0, 1e ] and N ≥ N1 ,  Mf (x, R1 )u ε1 (Mf (x, R1 ))ε1 ε1 FN,x (u) = 1 − (1 − pN,x (u))N −1 ≤ (N − 1) = u . (33) γ (N − 1) e γeε1 Therefore, for any x ∈ Λ(f ) ∩ S(f ) and N ≥ N1 , one has Z log (− log u) + 1 (Mf (x, R1 ))ε1 du I1 (N, x) ≤ ε 1 γe u1−ε1 (0, 1e ] Z (Mf (x, R1 ))ε1 (Mf (x, R1 ))ε1 −ε1 t (log t + 1)e dt = = L(ε1 ) γ ε1 e γ ε1 e [1,∞) R where L(ε) := [1,∞) (log t + 1)e−εt dt < ∞ for each ε > 0. (34) Now consider I2 (N, x). For N ≥ 10 > 1 + e2 , we can write Z  Z log log u + 1 I2 (N, x) = du := J1 (N, x) + J2 (N, x). + √ (1 − FN,x (u)) √ u [e, N −1] ( N −1,∞) √ For R2 > 0 and any u ∈ [e, N − 1], take N2 = N2 (R2 ) ≥ 10 such that if N ≥ N2 then 1/d  1/d  1 u √ ≤ ≤ R2 . (35) rN (u) = γ (N − 1)Vd e γ N − 1Vd e For the same u, an elementary inequality 1 − t ≤ e−t , t ∈ [0, 1], leads to the following one (   )  N −1 n o u pN,x (u) 1 − FN,x (u) = 1 − pN,x (u) ≤ exp − (N − 1)pN,x (u) = exp − γ γe(Nu−1) e (  R )   f (y) dy u u B(x,rN (u)) (36) = exp − ≤ exp − mf (x, R2 ) . d γ e γ e rN (u)Vd We use an auxiliary result, its proof is provided in Appendix. Lemma 4 For a version of a density f and each R > 0, one has µ(S(f ) \ Df (R)) = 0 where Df (R) := {x ∈ S(f ) : mf (x, R) > 0} and mf (·, R) is defined in (5). −t −δ It is easily seen that, for any √ t > 0 and each δ ∈ (0, e], one has e ≤ t . Thus, for x ∈ Df (R2 ), N ≥ N2 , u ∈ [e, N − 1] and arbitrary ε ∈ (0, e], taking into account that mf (x, R2 ) > 0 for x ∈ Df (R2 ) and applying relation (36), we have −ε  u mf (x, R2 ) . (37) 1 − FN,x (u) ≤ γ e Thus for all x ∈ Λ(f ) ∩ S(f ) ∩ Df (R2 ) and any N ≥ N2 Z γε e γeε log log u + 1 ε ε L(ε). du = J1 (N, x) ≤ u1+ε mf (x, R2 ) mf (x, R2 ) [e,∞) Further on  √ J2 (N, x) ≤ 1 − pN,x ( N − 1) N −2 Z (1) √ ( N −1,∞) (2) (38)  log log u + 1  1 − pN,x (u) du u := J2 (N, x) · J2 (N, x). √ −2 Note that rN ( N − 1) ≤ R2 for N ≥ N2 by virtue of (35) and, for N ≥ 3, one has N ≥ 12 . N −1 Hence, for N ≥ N2 , ε ∈ (0, e] and x ∈ Df (R2 ), Lemma 4 entails N −2 o n  √ √ (1) ≤ exp −(N − 2)pN,x ( N − 1) J2 (N, x) = 1 − pN,x ( N − 1) (  ) √ √     √ N − 1 pN,x ( N − 1) N −1 N −2 √ mf (x, R2 ) = exp − ≤ exp − (39) N −1 N −1 γe 2e γ γ e(N −1) ε ≤ (2e γ) ε ε . mf (x, R2 ) (N − 1) 2 law According to (22) we see that ξ2,x = ρe(x, ξ) := Vd e γ ρd (x, ξ). Consequently, Z    EG | log ξ2,x | = EG | log ρe(x, ξ)| = G | log ρe(x, y)| f (y) dy. Rd Lemma 5 There are constants a, b ≥ 0 such that, for each x ∈ Rd , Z Z   G | log ρe(x, y)| f (y) dy ≤ a G | log ρ(x, y)| f (y) dy + b. Rd (40) Rd The proof is given in Appendix. Set Af (G) := {x ∈ S(f ) : EG(| log ξ2,x |) < ∞}. By Lemma 5 one has µ(S(f )\Af (G)) = 0 as we assumed that Kf (ε0 ) < ∞. Further we write A := Λ(f ) ∩ S(f ) ∩ Df (R2 ) ∩ Af (G) where µ(S(f ) \ A) = 0. Introduce w = Nu−1 . Then Z  log log (w(N − 1)) + 1  1 − pN,x (w(N − 1)) dw = 1 w ,∞) ( √N−1 Z  Z  log log (w(N − 1)) + 1 = + 1 − F2,x (w) dw w ( √ 1 ,e] (e,∞) (2) J2 (N, x) N−1 (2) (2) := J2,1 (N, x) + J2,2 (N, x)    d1 = r2 (w) and p2,x (w) = F2,x (w) in view of where we have used that rN w(N − 1) = Vwd γe (23). Thus Z  (2) J2,1 (N, x) ≤ log log (w(N − 1)) + 1 d log w 1 ( √N−1 ,e] (41)   1 ≤ log log (e(N − 1)) + 1 1 + log (N − 1) . 2 (2) Now we estimate J2,2 (N). For w ≥ e and N ≥ 4 log log (w(N − 1)) = log (log w + log (N − 1)) = log log w log (N −1) ≤ log (log w + 1) + log log (N − 1). Consider a function g(w) = g ′(w) = log (log w+1) log log w  + 1 + log log (N − 1) for w > e. Clearly,  log log w 1 log (log w + 1)  < 0, w > e. − log w w(log log w)2 log w + 1 Take an arbitrary ∆ > 0. Then, for any w > e1+∆ , g(w) ≤ g(e1+∆ ) = log (2 + ∆) := K(∆). log (1 + ∆) Hence, log (log w + 1) ≤ K(∆) log log w for w ≥ e1+∆ and consequently (for N ≥ 4) log log (w(N − 1)) + 1 ≤ log (log w + 1) + log log (N − 1) + 1  ≤ K(∆) log log w + log log (N − 1) + 1 ≤ K(∆) log log w + 1 + log log (N − 1) since K(∆) > 1. Relation (42) yields Z Z (2) + J2,2 (N, x) = (e,e1+∆ ] (e1+∆ ,∞)   log log (w(N − 1)) + 1 1 − F2,x (w) dw w (42)  1+∆ Z ≤ log log (e (N − 1)) + 1 d log w (e,e1+∆ ] Z  log log w + 1 +K(∆) 1 − F2,x (w) dw w (e1+∆ ,∞) Z    1 + log log (N − 1) 1 − F2,x (w) dw ≤ log log (e1+∆ (N − 1)) + 1 ∆ (e1+∆ ,∞) w Z Z   log log w + 1 1 +K(∆) 1 − F2,x (w) dw + log log (N − 1) 1 − F2,x (w) dw. w (e,∞) (e,∞) w By Lemma 3 Z Z   1 log log w + 1 1 − F2,x (w) dw ≤ 1 − F2,x (w) dw w (e,∞) w (e,∞) Z = log(w) log log(w)dF2,x (w) ≤ EG(| log ξ2,x |) := R(x) < ∞ (e,∞) whenever x ∈ A. Therefore   (2) J2,2 (N, x) ≤ log log (e1+∆ (N − 1)) + 1 ∆ + K(∆)R(x) + log log (N − 1)R(x). (43) For x ∈ A and N ≥ N2 , relations (39), (41), (43) imply (1) (2) (2) J2 (N, x) = J2 (N, x)(J2,1 (N, x) + J2,2 (N, x))    (2e γ )ε 1 ≤ ε log log (e(N − 1)) + 1 1 + log (N − 1) ε (44) 2 (N − 1) 2 mf (x, R2 )   + log log (e1+∆ (N − 1)) + 1 ∆ + K(∆)R(x) + log log (N − 1)R(x) := Rf (N, x, ∆). Thus, for each κ > 0, x ∈ A and N > N3 (x), we can claim that J2 (N, x) < κ. In such a way, for any N ≥ max{N2 , N3 (x)} := N4 (x), taking into account (38) one infers that I2 (N, x) = J1 (N, x) + J2 (N, x) ≤ L(ε)e γε + κ < ∞. (mf (x, R2 ))ε 0 in conditions of Theorem 1. Choose Due to Lemma 2 we can assume that ε2 ≤ e 1+ε ε0 ε0 ε2 ε0 1+ε0 ε := 1+ε0 then ε ≤ 1+ε0 e ε0 ≤ e. Thus, for x ∈ A and N ≥ max{N1 , N4 (x)} := N0 (x) and ε0 ε2 ε = 1+ε , according to (34) 0 ≤ L(ε1 )e γ −ε1 EG(| log ξN,x |) = I1 (N, x) + I2 (N, x) (Mf (x, R1 ))ε1 + L(ε)e γ ε (mf (x, R2 ))−ε + κ := C0 (x) and we come to the desired relation (28). Hence relation (19) holds as well. Step 4. Now we are able to verify (9). We have already proved for each x ∈ A (thus, for Pξ -almost every x into the support S(f )) that E(ζ1 (N)|X1 = x) → − log f (x), N → ∞. Set YN (x) := E(ζ1 (N)|X1 = x). We have seen that E(ζ1 (N)|X1 = x) = E log ξN,x . Consider x ∈ A and take any N ≥ max{N1 , N2 }. Function G is nondecreasing and convex. On account of the Jensen inequality G(|YN (x)|) = G(|E log ξN,x |) ≤ G(E| log ξN,x |) ≤ EG(| log ξN,x |). (45) Relations (34), (38), (44) and (45) guarantee that, for each x ∈ A and all N ≥ max{N1 , N2 }, L(ε1 )(Mf (x, R1 ))ε1 L(ε)e γε ε + Rf (N, x, ∆). + γeε1 mf (x, R2 ) G(|YN (x)|) ≤ Thus, for any N ≥ max{N1 , N2 }, Z Z G(|YN (x)|)f (x) dx = G(|YN (x)|)f (x) dx Rd A Z Z L(ε1 ) ε1 ε m−ε Mf (x, R1 )f (x) dx + L(ε)e γ ≤ ε1 f (x, R2 )f (x) dx γ e A A    (2e γ )ε 1 + log log (e(N − 1)) + 1 1 + log (N − 1) ε 2 (N − 1) 2 Z  m−ε + log log (e1+∆ (N − 1)) + 1 ∆ f (x, R2 )f (x) dx A  Z (2e γ )ε + K(∆) + log log (N − 1) R(x) m−ε ε f (x, R2 )f (x) dx. (N − 1) 2 A Clearly, Z A Mfε1 (x, R1 )f (x) dx = Z Rd Mfε1 (x, R1 )f (x) dx = Qf (ε1 , R1 ) < ∞ (46) (47) according to Theorem 1 assumptions. ε0 ε2 . By the Lyapunov inequality one has Recall that ε = 1+ε 0 Z A m−ε f (x, R2 )f (x) dx ≤ Z Rd −ε mf 1+ε0 ε0 ε0  1+ε  ε0 0 = Tf (ε2 , R2 ) 1+ε0 < ∞. (48) (x, R2 )f (x) dx Now the Hölder inequality, relation (40) and the conditions Tf (ε2 , R2 ) < ∞, Kf (ε0 ) < ∞ yield Z R(x) m−ε f (x, R2 )f (x) dx ≤ = Z A R Rd Z Z Rd 1+ε0 Rd 1 Z  1+ε 0 (x)f (x) dx  G | log ρe(x, y)| f (y) dy −ε mf Rd 1+ε0 1+ε0 ε0 ε0  1+ε 0 (x, R2 )f (x) dx 1  1+ε  ε0 0 f (x) dx Tf (ε2 , R2 ) 1+ε0 (49) 1 1+ε0  1+ε Z  Z   ε0 0 a G | log ρ(x, y)| f (y) dy + b f (x) dx ≤ Tf (ε2 , R2 ) 1+ε0 Rd Rd ε0 ≤ 2 1+ε0 (a Kf (ε0 ) 1  1+ε 0 + b) Tf (ε2 , R2 ) ε0  1+ε 0 < ∞. where a, b ≥ 0 are the same as in Lemma 5. Accordingly, for N ≥ max{N1 , N2 } we can rewrite (46) in the following way Z G(|YN (x)|)f (x) dx ≤ S1 + S2 + S3 (N) + S4 (N) Rd where S3 (N) → 0, S4 (N) → 0 as N → ∞. Thus, Z sup G(|YN (x)|)f (x) dx < ∞. N ≥max{N1 ,N2 } Rd We have established uniform integrability of the family {YN }N ≥max{N1 ,N2 } (w.r.t. measure Pξ ). Therefore, we conclude that Z Z Eζ1 (N) = YN (x)f (x) dx → − log f (x)f (x) dx = H, N → ∞. Rd Rd So we come to (9). The proof of Theorem 1 is complete.  Proof of Corollary 2. Assume that condition (A) is satisfied. In Section 2 we used the elementary inequality: log z ≤ 1δ z δ for any z ≥ 1 and δ > 0. Hence, for any t ≥ 0 and δ > 0, G(t) ≤ 1δ t1+δ . By the Lyapunov inequality, for any δ > 0 and ε0 > 0, Z 1+ε0 Z 1+δ | log ρ(x, y)| f (y) dy ≤ | log ρ(x, y)|(1+δ)(1+ε0 ) f (y) dy. Rd Rd p−1 For a given p > 1 take δ := p+1 and ε0 := p−1 then (1 + δ)(1 + ε0 ) = p. Thus 2  1+ε0 Z Z 1 | log ρ(x, y)|p f (x)f (y) dx dy < ∞. Kf (ε0 ) ≤ δ d d R R . Hence condition (A) implies that Kf (ε0 ) < ∞ for ε0 = p−1 2 d If (B) is true then, for each x ∈ R and any R > 0, one has Mf (x, R) ≤ M. Therefore Qf (ε1 , R1 ) < ∞ for any ε1 > 0 and R1 > 0. Assume that (C1) is satisfied. Accordingly mf (x, R) ≥ m > 0 for any x ∈ Rd and R > 0. Then evidently Tf (ε2 , R2 ) < ∞ for any ε2 > 0 and R2 > 0. It remains to show that if (B) and (C1) are satisfied then (9) holds whenever f has a bounded support. It is sufficient to verify that if f ≤ M and f has a bounded support then (A) is valid. Clearly, for any ball B(0, r) ⊂ Rd such that S(f ) ⊂ B(0, r), Z Z Z Z p 2 | log ρ(x, y)|p dx dy. | log ρ(x, y)| f (x)f (y) dx dy ≤ M Rd Rd B(0,r) B(0,r) Note that µ(B(0, r)) < ∞. Changing the variables of integration in inner integral over x (now we use the spherical coordinates) and taking into account that, for any p > 1, Z | log u|p ud−1 du < ∞ (0,2r) we see that (A) is true.  4 Proof of Theorem 2 First of all note that, for any t > 0, G(| log t|) ≤ G(log2 t). Indeed, if t ∈ (0, 1e ] ∪ (e, ∞) then | log t| ≥ 1. Thus, for such t, | log t| ≤ log2 t and the desired inequality holds since G is a nondecreasing function. If t ∈ ( 1e , e] then G(| log t|) = G(log2 t) = 0. Consequently if Kf,2 (ε0 ) < ∞ then Kf (ε0 ) < ∞ and the conditions of Theorem 2 guarantee the statement of Theorem 1 validity. We will show that Theorem 2 conditions permit to claim that ζi (N) ∈ L2 for i = 1, . . . , N and N ≥ N0 where N0 ∈ N. Then we can write E(HN − H)2 = var(HN ) + (EHN − H)2 and accordingly we come to (12) if var(HN ) → 0, N → ∞. Taking into account that ζ1 (N), . . . , ζN (N) are identically distributed one has X 2 1 cov(ζi (N), ζj (N)). (50) var(HN ) = var(ζ1(N)) + 2 N N 1≤i<j≤N We do not strictly adhere to the notation used in Theorem 1 proof. Namely, the choice of positive constants Ck , Ck (x) and integers Nk , Nk (x) where k ∈ {0} ∪ N and x ∈ Rd could be different. The proof of Theorem 2 is also divided into several steps. Step 1. We study Eζ1 (N)2 . Let us formulate the following result. Lemma 6 There are constants a, b ≥ 0 such that, for each x ∈ Rd , Z Z   2 G log ρe(x, y) f (y) dy ≤ a G log2 ρ(x, y) f (y) dy + b. Rd Rd The proof is quite similar to that of Lemma 5 and therefore is skipped. Let A := Λ(f ) ∩ S(f ) ∩ Df (R2 ) ∩ Af,2 (G) where the first three sets appeared in the Theorem 1 proof and Af,2 (G) := {x ∈ S(f ) : EG(log2 ξ2,x ) < ∞}. It is easily seen that Pξ (A) = 1 because Pξ (Λ(f ) ∩ S(f ) ∩ Df (R2 )) = 1 and Pξ (Af,2 (G)) = 1 (we take into account the result of Lemma 6 and the fact that Kf,2 (ε0 ) < ∞). In view of (20), for each x ∈ A, Z  2 ζ1 (N ) 2 E(ζ1 (N) |X1 = x) = E (log e ) |X1 = x = log2 (u) dFN,x(u) = E log2 ξN,x . (0,∞) f (x)  Since ξx ∼ Exp γ e , x ∈ S(f ), one has Z 2 E log ξx = log2 (u) dFx (u) = log2 f (x) + σ 2 (0,∞) where 2 σ := Z 2 −v log v e (0,∞) dv − Z −v log v e dv (0,∞) 2 < ∞. law Due to (25) we have (log ξN,x )2 → (log ξx )2 for x ∈ A as N → ∞. Now we show that for x ∈ A a family log2 ξN,x N ≥N0 (x) is uniformly integrable for some N0 (x) ∈ N. It is sufficient to verify that, for all x ∈ A, sup EG(log2 ξN,x ) ≤ C0 (x) < ∞. (51) N ≥N0 (x) To show (51) we employ the following result. Lemma 7 Let F be a cumulative distribution function such that F (0) = 0. Then the following relations hold:  R R u) 1) (0, 1 ] log2 u log(− log u) dF (u) = 2 (0, 1 ] F (u) (− log log (− log u) + 21 du, u e  R e R 2 2) [e,∞) log u log log u dF (u) = 2 [e,∞)(1 − F (u)) logu u log log u + 12 du. The proof is quite similar to that of Lemma 3 and therefore is skipped. By Lemma 7 Z Z 2 2 EG(log ξN,x ) = G(log u) dFN,x (u) + G(log2 u) dFN,x (u) =2 Z (0, 1e ] (0, 1e ] log2 u log (− log u) dFN,x (u) + 2 Z Z (e,∞) log2 u log log u dFN,x(u) (e,∞) 1 (− log u) log (− log u) + du u 2 (0, 1e ] Z log u 1 +4 (1 − FN,x (u)) log log u + du u 2 (e,∞) =4 FN,x (u) := 4I1 (N, x) + 4I2 (N, x). (52) Employment of (33) leads, for x ∈ A and N ≥ N1 (N1 is the same as in the proof of Theorem 1), to relations Z 1 (− log u) log (− log u) + du I1 (N, x) = FN,x (u) u 2 (0, 1e ] Z (− log u)(log (− log u) + 12 ) (Mf (x, R1 ))ε1 ≤ γ) du = Mfε1 (x, R1 )L1 (ε1 , e ε 1−ε 1 1 1 γ e u (0, e ] where L1 (ε1 , e γ) = R 1 γ eε1 I2 (N, x) = [1,∞) Z v(log v + 12 )e−ε1 v dv < ∞. Furthermore, one has √ (e, N −1] + Z √ ( N −1,∞)  1 − FN,x (u) := J1 (N, x) + J2 (N, x).  log u 1 log log u + du u 2 ε0 ε2 Set ε := 1+ε (as in the proof of Theorem 1 w.l.g. we can assume that ε ≤ e). For 0 N ≥ N2 (N2 is the same as in the proof of Theorem 1), taking into account inequality (37) we get Z log u(log log u + 21 ) γε e ε du = m−ε γ) J1 (N, x) ≤ f (x, R2 )L2 (ε, e 1+ε u mf (x, R2 ) (e,∞) γ) = γ eε where L2 (ε, e we infer that R v(log v + 21 )e−εv dv < ∞. Since (1 − FN,x (u)) = 1 − pN,x (u) [1,∞) √ J2 (N, x) ≤ 1 − pN,x ( N − 1) N −2 Z √ ( N −1,∞) log u(log log u + 21 ) (1 − pN,x (u)) du. u By employing (39) and (42) we deduce, for w = J2 (N, x) ≤ × Z 1 ,e1+∆ ] ( √N−1 + Z (e1+∆ ,∞) ! N −1 u , N −1 the inequality (2e γ )ε ε ε × mf (x, R2 ) (N − 1) 2  log (w(N − 1))(log log (w(N − 1)) + 21 ) 1 − F2,x (w) dw w ε (2e γ) ≤ ε ε × mf (x, R2 ) (N − 1) 2   1 1 1 + ∆ + log (N − 1) + log (N − 1) × × log(e1+∆ (N − 1)) log log (e1+∆ (N − 1)) + 2 2 Z Z h   i log log w + 21 1 × K(∆) 1 − F2,x (w) dw + log log (N − 1) 1 − F2,x (w) dw w (e,∞) (e,∞) w Z  log w(log log w + 21 ) +K(∆) 1 − F2,x (w) dw w (e,∞) (53)  Z  log w 1 − F2,x (w) dw + log log (N − 1) w (e,∞) where ∆ > 0 is an arbitrary number and K(∆) = log (2+∆) . log (1+∆) R log w(log log w+ 12 ) dw ≤ Set P (x) := EG(log2 ξ2,x ), x ∈ Af,2 (G). Then [e,∞)(1 − F2,x (w)) w P (x) < ∞ in view of Lemma 7. Each integrals appearing in (53) admits the same bound (up to a constant factor). Therefore, for all x ∈ A and N ≥ N2  J2 (N, x) ≤ m−ε γ ) + P (x)h2 (N, ε, e γ) . f (x, R2 ) h1 (N, ε, e where h1 (N, ε, e γ ) → 0 and h2 (N, ε, e γ ) → 0 as N → ∞. Thus, according to (52), for any ε0 ε2 , we see that x ∈ A, N ≥ max{N1 , N2 } and ε = 1+ε 0 EG(log2 ξN,x ) ≤ C1 Mfε1 (x, R1 ) + m−ε f (x, R2 )(C2 + C3 (N) + C4 (N)P (x)) (54) where C1 , C2 , C3 (N) and C4 (N) can depend only on ε0 , ε1 , ε2 and e γ (∆ is fixed). Moreover, C3 (N) → 0, C4 (N) → 0 as N → ∞. Hence, for any κ > 0 and N ≥ N0 (x) := max {N1 , N2 , N3 (x)}, sup EG(log2 ξN,x ) ≤ C1 Mfε1 (x, R1 ) + C2 m−ε f (x, R2 ) + κ := C0 (x). N ≥N0 (x)  Therefore, a family log2 ξN,x N ≥N0 (x) is uniformly integrable. Hence for any x ∈ A, E(ζ1 (N)2 |X1 = x) → log2 f (x) + σ 2 , N → ∞. Set now ZN (x) := E(ζ1 (N)2 |X1 = x) ≥ 0. We have already seen that E log2 ξN,x = E(ζ1 (N)2 |X1 = x). Also it was proved that ZN (x) → log2 f (x) + σ 2 for each x ∈ A as N → ∞ (thus, for Pξ -almost every x into the support S(f )). By the Jensen inequality G(ZN (x)) = G(E log2 ξN,x ) ≤ EG(log2 ξN,x ) because G(·) is convex. Then according to (54), for any x ∈ A and for any N ≥ max{N1 , N2 }, one has −ε −ε G(ZN (x)) ≤ C1 Mfε1 (x, R1 ) + C2 m−ε f (x, R2 ) + C3 (N)mf (x, R2 ) + C4 (N)mf (x, R2 )P (x). Thus, for all N ≥ max{N1 , N2 }, in view of (47), (48) and analogue of (49) for P (x) instead of R(x) Z Z Z ε1 G(ZN (x))f (x) dx ≤ C1 Mf (x, R1 )f (x) dx + C2 m−ε f (x, R2 )f (x) dx Rd Rd Rd Z Z +C3 (N) m−ε m−ε f (x, R2 )f (x) dx + C4 (N) f (x, R2 )P (x)f (x) dx Rd Rd ≤ Se1 + Se2 + Se3 (N) + Se4 (N), where Se3 (N) → 0, Se4 (N) → 0 as N → ∞. Thus Z sup G(ZN (x))f (x) dx < ∞. N ≥max{N1 ,N2 } Rd Consequently, a family {ZN (·)}N ≥max{N1 ,N2 } is uniformly integrable and we can claim that Z 2 Eζ1 (N) → f (x) log2 f (x) dx + σ 2 . Rd R Hence var(ζ1 (N)) = Eζ12(N) − (Eζ1 (N))2 → σ 2 + Rd f (x) log2 f (x) dx − H 2 as N → ∞. As in Remark 2 one can prove in a similar way that finiteness of integrals in (7) and (8) implies R that Rd f (x) log2 f (x) dx < ∞. Clearly, we have inferred that N1 var(ζ1 (N)) → 0 as N → ∞. Step 2. Now we consider cov(ζi (N), ζj (N)) for i 6= j, where i, j ∈ {1, . . . , N}. For x ∈ A and y ∈ A (where A has been defined at the beginning of Step 1 ), introduce conditional cumulative distribution function i,j FeN,x,y (u, w) := P (eζi (N ) ≤ u, eζj (N ) ≤ w|Xi = x, Xj = y), u, w ≥ 0. Here i, j ∈ {1, . . . , N}, i 6= j. For any events C and D, one can write I{C ∩ D} = 1 − I{C} − I{D} + I{C ∩ D} where C := Ω \ C. Thus, for x, y ∈ Rd , u, w ≥ 0, i 6= j and N ≥ 3, i,j FeN,x,y (u, w) = 1 − P (eζi (N ) > u|Xi = x, Xj = y) − P (eζj (N ) > w|Xi = x, Xj = y) +P (eζi (N ) > u, eζj (N ) > w|Xi = x, Xj = y) = 1 − P (min ρ(Xi , Xk ) > rN (u)|Xi = x, Xj = y) k6=i −P (min ρ(Xj , Xk ) > rN (w)|Xi = x, Xj = y) k6=j (55) +P (min ρ(Xi , Xk ) > rN (u), min ρ(Xj , Xk ) > rN (w)|Xi = x, Xj = y) k6=i k6=j   = 1 − I ρ(x, y) > rN (u) P min ρ(x, Xk ) > rN (u) k6=i,j   −I ρ(x, y) > rN (w) P min ρ(y, Xk ) > rN (w) k6=i,j   +I ρ(x, y) > max{rN (u), rN (w)} P min ρ(x, Xk ) > rN (u), min ρ(y, Xk ) > rN (w) k6=i,j k6=i,j  a Vd γ e(N −1)  d1 , a ≥ 0. One can write where k ∈ {1, . . . , N} and, as before in (21), rN (a) := i,j FeN,x,y (u, w) because FeN,x,y (u, w) is the same for all i, j ∈ {1, . . . , N}, i 6= j.   Set A1 := (x, y) : x ∈ A, y ∈ A, x 6= y and A2 := (x, y) : x ∈ A, y ∈ A, x = y . Evidently, (Pξ ⊗ Pξ ) (A1 ) = 1 and (Pξ ⊗ Pξ ) (A2 ) = 0. In case of (x, y) ∈ A2 , one has FeN,x,y (u, w) ≡ 1, u ≥ 0, w ≥ 0. Further we consider (x, y) ∈ A1 . For such (x, y) and any a > 0, rN (a) → 0 as N → ∞. Hence we can find N0 = N0 (x, y, u, w) such that rN (u) < ρ(x, y), rN (w) < ρ(x, y) and B(x, rN (u)) ∩ B(y, rN (w)) = ∅ for N ≥ N0 . Then, according to (55) for these N ≥ N0 one has   FeN,x,y (u, w) = 1 − P min ρ(x, Xk ) > rN (u) − P min ρ(y, Xk ) > rN (w) k6=i,j k6=i,j  +P min ρ(x, Xk ) > rN (u), min ρ(y, Xk ) > rN (w) k6=i,j =1− + Y Y k6=i,j k6=i,j  Y  P Xk ∈ / B(x, rN (u)) − P Xk ∈ / B(y, rN (w)) k6=i,j   P Xk ∈ / B(x, rN (u)) ⊔ B(y, rN (w)) = 1 − 1 − k6=i,j  − 1− Z B(y,rN (w)) f (z) dz N −2  + 1− Z B(x,rN (u)) Z f (z) dz B(x,rN (u)) f (z) dz − Z B(y,rN (w)) f (z) dz N −2 N −2 Taking into account that f (x) > 0 and f (y) > 0 we establish that there exists  u f (x) N −2 e e Fx,y (u, w) := lim FN,x,y (u, w) = 1 − lim 1 − N→∞ N→∞ γ (N − 1) e N −2    u f (x) + w f (y) N −2 w f (y) + lim 1 − − lim 1 − N→∞ N→∞ γ (N − 1) e γ (N − 1) e . = 1 − e− f (x)u γ e − e− f (y)w γ e + e− f (x)u+f (y)w γ e = (1 − e− f (x)u γ e )(1 − e− f (y)w γ e ) = Fx (u)Fy (w). ), Thus Fex,y (·, ·) is the distribution function of a vector ηx,y := (ηx , ηy ) where ηx ∼ Exp( f (x) γ e ηy ∼ Exp( f (y) ) and the components of ηx,y are independent. For (x, y) ∈ A1 , i 6= j and γ e N ≥ 3, set   y,i,j d d ηN,x := (N − 1)Vd e γ min min ρ (x, Xk ), ρ (x, y) . k∈{1,...,N }\{i,j} y,i,j Observe that the distribution function of ηN,x is y,i,j y P(ηN,x ≤ u) = 1 − I{ρ(x, y) > rN (u)}(1 − pN,x (u))N −2 := FeN,x (u) for all i, j ∈ {1, . . . , N}, i 6= j, where pN,x (u) is defined by (29). Moreover FeN,x,y (·, ·) is a i,j y,i,j x,i,j distribution function of a random vector ηN,x,y := (ηN,x , ηN,y ), (x, y) ∈ A1 , i, j ∈ {1, . . . , N}, law i,j i 6= j, N ≥ 3. Thus we have shown that ηN,x,y → ηx,y as N → ∞. Therefore law y,i,j x,i,j → log ηx log ηy , N → ∞. log ηN,x log ηN,y Here we exclude a set of zero probability where random variables under consideration can be equal to zero. Note that Z Z y,i,j x,i,j E log ηN,x log ηN,y = log u log w dFeN,x,y (u, w) = (0,∞) ζi (N ) = E log e ζj (N ) log e (0,∞)   |Xi = x, Xj = y = E ζi (N)ζj (N)|Xi = x, Xj = y . Consequently, Eζi (N)ζj (N) = Eζ1 (N)ζ2 (N) for all i, j ∈ {1, . . . , N}, i 6= j. Hence in view of (50) to prove that varHn → 0 as N → ∞ it is sufficient to show that cov(ζ1 (N), ζ2 (N)) → 0, N → ∞. Obviously, E log ηx log ηy = E log ηx E log ηy = log f (x) log f (y), since ηx and ηy are independent.  For any fixed M > 0, let us introduce A1,M := (x, y) ∈ A1 : ρ(x, y) > M . Our goal now is to prove, for any M > 0 and for all (x, y) ∈ A1,M , that  E ζ1 (N)ζ2 (N)|X1 = x, X2 = y → log f (x) log f (y), N → ∞. (56) y x First of all, we will establish the uniform integrability of a family {log ηN,x log ηN,y }N ≥Ne0 (x,y) y y,1,2 x,1,2 x for such (x, y) ∈ A1,M , where to simplify notation we write ηN,x := ηN,x and ηN,y := ηN,y . The function G(·) is nondecreasing and convex. Thus, for any (x, y) ∈ A1,M and N ≥ 3, ! y 2 x 2 (log η ) (log η ) N,y N,x y x + EG(| log ηN,x log ηN,y |) ≤ EG 2 2 (57)  1 y x EG((log ηN,x )2 ) + EG((log ηN,y )2 ) . ≤ 2 y If u ∈ (0, 1e ], then one has FeN,x (u) = 1−(1−pN,x (u))N −2 for any N > 1 +1. M d ee γ Vd In similarity e1 (N e1 does not depend to (33) one can show that, if ρ(x, y) > M and u ∈ (0, 1e ], for any N ≥ N e1 := N e1 (M)), Fey (u) ≤ e on x and y, but can depend on M, whence N γ −ε1 (Mf (x, R1 ))ε1 uε1 . N,x Moreover, for all u > 0, y 1 − FeN,x (u) = I{ρ(x, y) > rN (u)}(1 − pN,x (u))N −2 ≤ (1 − pN,x (u))N −2. e2 (N e2 does not depend on x and y) Then analogously to (39) we derive that, for all N ≥ N ε0 ε2 and ε := 1+ε0 (we can assume as before that ε ≤ e),  −ε u y e 1 − FN,x (u) ≤ mf (x, R2 ) . 2e γ The same reasoning as was used at Step 1 of the proof of Theorem 2 leads, for N ≥ e1 , N e2 }, to the inequality max{N y e1 M ε1 (x, R1 ) + m−ε (x, R2 )(C e2 + C e3 (N) + C e4 (N)P (x)) EG(log2 ηN,x )≤C f f (58) e3 (N) → 0 and C e4 (N) → 0 as N → ∞. Then, in view of (57) and (58) for all where C e1 , N e2 }, N ≥ max{N y x EG(| log ηN,x log ηN,y |) e2 e1 C C −ε (Mfε1 (x, R1 ) + Mfε1 (y, R1)) + (m−ε ≤ f (x, R2 ) + mf (y, R2 )) (59) 2 2 e3 (N) e4 (N) C C −ε −ε + (m−ε (x, R ) + m (y, R )) + (m−ε 2 2 f f f (x, R2 )P (x) + mf (y, R2 )P (y)). 2 2 e0 (x, y) = max{N e1 , N e2 , N e3 (x, y)}, Consequently, in view of (59), for all κ > 0 and N ≥ N y x EG(| log ηN,x log ηN,y |) e1 e2 C C e ≤ (Mfε1 (x, R1 ) + Mfε1 (y, R1)) + (mf−ε (x, R2 ) + m−ε f (y, R2 )) + κ := C0 (x, y). 2 2 y x Hence, for any (x, y) ∈ A1,M , a family {log ηN,x log ηN,y }N ≥Ne0 (x,y) is uniformly integrable. Thus we come to (56) for (x, y) ∈ A1,M .  y x Let us define TN (x, y) := E ζ1 (N)ζ2 (N)|X1 = x, X2 = y = E log ηN,x log ηN,y where (x, y) ∈ A1 and N ≥ 3. The statement (56) is equivalent to the following one: for any (x, y) ∈ A1,M , TN (x, y) → log f (x) log f (y) as N → ∞. Take any (x, y) ∈ A1 . Then, for any fixed M > 0, we have proved that TN (x, y)I{ρ(x, y) > M} → log f (x) log f (y)I{ρ(x, y) > M}, N → ∞. (60) Note that y x G(|TN (x, y)|I{ρ(x, y) > M}) ≤ G(|TN (x, y)|) = G(|E log ηN,x log ηN,y |) y y x x ≤ G(E| log ηN,x log ηN,y |) ≤ EG(| log ηN,x log ηN,y |). e1 , N e2 }, Due to (59) and (61) one can conclude that, for all N ≥ {N Z Z G(|TN (x, y)|I{ρ(x, y) > M})f (x)f (y) dx dy RdZ Rd Z ε1 e e ≤ C1 Mf (x, R1 )f (x) dx + C2 m−ε f (x, R2 )f (x) dx d d R R Z Z −ε e e +C3 (N) mf (x, R2 )f (x) dx + C4 (N) m−ε f (x, R2 )P (x)f (x) dx. Rd Rd e4 (κ) > 0 such that Therefore, for any κ > 0, there exists N Z Z G(|TN (x, y)|I{ρ(x, y) > M})f (x)f (y) dx dy Rd Rd e1 Qf (ε1 , R1 ) + C e2 Tf (ε, R2 ) + κ < ∞ ≤C (61) e := max{N e1 (M), N e2 , N e4 (κ)}, since ε = ε0 ε2 < ε2 . Hence, for (x, y) ∈ A1 , a for N ≥ N 1+ε0  0 family TN (x, y)I{ρ(x, y) > M} N ≥Ne0 is uniformly integrable w.r.t. Pξ ⊗ Pξ . Consequently, in view of (60), for each M > 0, Z Z TN (x, y)f (x)f (y) dx dy → log f (x) log f (y)f (x)f (y) dx dy, N → ∞. (62) ρ(x,y)>M ρ(x,y)>M Now we consider the case ρ(x, y) ≤ M. For each M < 1, one has     EG(| log ρ(X , X )|) 1 2 P ρ(X1 , X2 ) ≤ M = P G(| log ρ(X1 , X2 )|) ≥ G(| log M|) ≤ →0 G(| log M|) as M → 0, since EG(| log ρ(X1 , X2 )|) < ∞ due to the condition Kf,2 (ε0 ) < ∞. In view of the elementary inequality t ≤ G(t) + 1 for all t ≥ 0 we can write = Z Rd ≤ Z Z Eζ1 (N)ζ2 (N)I{ρ(X1 , X2 ) ≤ M} E(ζ1 (N)ζ2 (N)I{ρ(X1 , X2 ) ≤ M}|X1 = x, X2 = y)f (x)f (y) dx dy Z Z y x ≤ I{ρ(x, y) ≤ M}f (x)f (y) dx dy E log ηN,x log ηN,y d d R R   y x EG(| log ηN,x log ηN,y |)f (x)f (y) dx dy + P ρ(X1 , X2 ) ≤ M . Rd ρ(x,y)≤M e1 , N e2 }, one has Hence by (59), for all N ≥ max{N Z y x EG(| log ηN,x log ηN,y |)f (x)f (y) dx dy ρ(x,y)≤M e2 Em−ε (X1 , R2 )I{ρ(X1 , X2 ) ≤ M} ≤ M} + C f −ε e3 (N) Em (X1 , R2 )I{ρ(X1 , X2 ) ≤ M} + C e4 (N) Em−ε (X1 , R2 )P (X1)I{ρ(X1 , X2 ) ≤ M} +C f f e1 C e5 (M) + C e2 C e6 (M) + C e3 (N)C e7 (M) + C e4 (N)C e8 (M) =C ≤ e1 EM ε1 (X1 , R1 )I{ρ(X1 , X2 ) C f ek (M) → 0 as M → 0 for k = 5, 6, 7, 8. Here we take into account that the where C Lebesgue integral is absolutely continuous function (EMfε1 (X1 , R1 ) < ∞, Em−ε f (X1 , R2 ) < −ε ∞, Emf (X1 , R2 )P (X1 ) < ∞) and P (ρ(X1 , X2 ) ≤ M) → 0 as M → 0. Hence, for any κ > 0, one can find M1 = M1 (κ) > 0 such that, for all M ∈ (0, M1 ] and e1 , N e2 , N e5 (κ)}, N ≥ max{N Z κ TN (x, y)f (x)f (y) dx dy = Eζ1 (N)ζ2 (N)I{ρ(X1 , X2 ) ≤ M} < . 3 ρ(x,y)≤M Also (from absolute continuity of the Lebesgue integral) one can find M2 = M2 (κ) > 0 such that, for all M ∈ (0, M2 ], Z κ log f (x) log f (y)f (x)f (y) dx dy < 3 ρ(x,y)≤M e6 (M, κ) such that for all N ≥ N e6 (M, κ) Take M = min{M1 , M2 }. Due to (62) one can find N the following inequality holds Z Z κ TN (x, y)f (x)f (y) dx dy − log f (x) log f (y)f (x)f (y) dx dy < . 3 ρ(x,y)>M ρ(x,y)>M e0 (κ) := max{N e1 , N e2 , N e5 (κ), N e6 (M, κ)} such So, for any κ > 0 one can find M(κ) > 0 and N e0 (κ): that for all N ≥ N Z Z Z Z TN (x, y)f (x)f (y) dx dy − log f (x) log f (y)f (x)f (y) dx dy < κ. Rd Rd Rd Rd Therefore Eζ1 (N)ζ2 (N) → H 2 , N → ∞, and consequently cov(ζ1 (N), ζ2 (N)) → 0 as N → ∞ because limN →∞ Eζ1 (N) = limN →∞ Eζ2 (N) = H. The proof is complete.  Proof of Corollary 3. In view of the proof of Corollary 2, it remains to demonstrate that condition (10) for some p > 2 implies the finiteness of Kf,2 (ε0 ) for some ε0 > 0. Assume that condition (10) is satisfied for some p > 2. In Section 2 we used the elementary inequality: for any z ≥ 1 and δ > 0 log z ≤ 1δ z δ . Hence, for any t ≥ 0 and δ > 0, G(t2 ) ≤ 1δ t2(1+δ) . By the Lyapunov inequality, for any δ > 0 and ε0 > 0, Z 1+ε0 Z 2(1+δ) | log ρ(x, y)| f (y) dy ≤ | log ρ(x, y)|2(1+δ)(1+ε0 ) f (y) dy. Rd Rd p−2 and ε0 := p−2 then 2(1 + δ)(1 + ε0 ) = p. Thus For a given p > 2 take δ := p+2 4  1+ε0 Z Z 1+ε0 1 2(1+δ) Kf,2 (ε0 ) ≤ | log ρ(x, y)| f (y) dy f (x) dx δ Rd Rd  1+ε0 Z Z 1 | log ρ(x, y)|p f (x)f (y) dx dy < ∞. ≤ δ d d R R We conclude that condition (10) for p > 2 implies the required finiteness: Kf,2 (ε0 ) < ∞ for ε0 = p−2 .  4 Proof of Corollary 4. Let ξ ∼ N(ν, Σ), where ν ∈ Rd and Σ is a (strictly) positive-definite d × d matrix. Thus ξ has a density f (x) = 1 1 d 2 (2π) (det Σ) 1 2 e− 2 (Σ −1 (x−ν),x−ν) , x ∈ Rd , (63) where (·, ·) stands for a scalar product in Rd related to the Euclidean norm k · k. First of all we prove that for such f relation (13) holds. Denote by {λ1 , · · · , λd } the set of all eigenvalues of a matrix Σ. Then λmin := mini=1,...,d λi > 0 since λi > 0 for all i ∈ {1, . . . , d}. Thus Σ = C ⊤ ΛC for a diagonal matrix Λ := diag(λ1 , . . . , λd ) and an 1 1 1 −1/2 −1/2 orthogonal matrix C. Hence, Σ− 2 := C T Λ− 2 C, where Λ− 2 = diag(λ1 , . . . , λd ). Now one can rewrite (63) as follows f (x) = 1 1 d 2 (2π) (det Σ) 1 2 e− 2 kΣ −1 2 (x−ν)k2 , x ∈ Rd . (64) Note also that, for all v, w ∈ Rd , the relation kvk2 = kwk2 + kv − wk2 + 2(w, v − w) holds. Therefore  1 1 1 1 1 kΣ− 2 (z − ν)k2 = kΣ− 2 (x − ν)k2 + kΣ− 2 (z − x)k2 + 2 Σ− 2 (x − ν), Σ− 2 (z − x) (65) 1 1 kz − xk2 + 2(Σ−1 (x − ν), z − x) ≤ kΣ− 2 (x − ν)k2 + λmin 1 where the last inequality is true because kΣ− 2 (z − x)k2 ≤ and (65) we have for all z, x ∈ Rd − 2λ 1 f (z) ≥ f (x) e min 1 kz λmin kz−xk2 (Σ−1 (ν−x), z−x) e . − xk2 . According to (64) (66) Let us fix arbitrary x ∈ Rd , R > 0 and take any r such that 0 < r ≤ R. By (66) we get Z Z − 1 kz−xk2 (Σ−1 (ν−x), z−x) f (z) dz ≥ f (x) e 2λmin e dz B(x,r) B(x,r) Z Z (67) 2 2 − 2λr − 2λR (Σ−1 (ν−x), z−x) (Σ−1 (ν−x) y) min min ≥ f (x) e e dz ≥ f (x) e e dy B(x,r) B(0,r) because kz − xk2 ≤ r 2 for z ∈ B(x, r). Simple inequality et ≥ 1 + t, t ∈ R, leads to formula Z Z  (Σ−1 (ν−x), y) e dy ≥ 1 + (Σ−1 (ν − x), y) dy B(0,r) B(0,r) Z (68) d −1 d = r Vd + (Σ (ν − x), y) dy = r Vd B(0,r) R d (v, y) dy = 0 for any fixed v ∈ R (as u du = 0 for any B(0,r) (−a,a) R R2 − a > 0). In view of (67) and (68) we have B(x,r) f (z) dz ≥ f (x) e 2λmin r d Vd . Consequently, since by the Fubini theorem R − 2λR for any 0 < r ≤ R and any x ∈ Rd , we come to (13) with c = e as, for ε ∈ (0, 1),  d Z (2π)ε 2 1−ε f (x) dx = < ∞. 1−ε Rd 2 min . Note that (14) holds Then for an arbitrary Gaussian random vector, the integral in (8) is finite for all ε2 ∈ (0, 1) and all R2 > 0. 1 d Clearly, (B) is valid with M = (2π)− 2 (det Σ)− 2 . So, (7) is finite for any ε1 > 0 and R1 > 0. Now we prove that, for each p > 1, condition (10) is satisfied, thus condition (A) is satisfied as well. In other words we show that E| log kξ1 − ξ2 k|p < ∞ where ξ1 and ξ2 are independent copies of ξ. One can write E| log kξ1 − ξ2 k|p = E| log kξ1 − ξ2 k|p 1{kξ1 − ξ2 k ≤ 1} + E| log kξ1 − ξ2 k|p 1{kξ1 − ξ2 k > 1}. For each x ∈ Rd , one has E(| log kξ1 − ξ2 k|p 1{kξ1 − ξ2 k ≤ 1}|ξ2 = x) = E| log kξ1 − xk|p 1{kξ1 − xk ≤ 1} = E(− log kηx k)p 1{kηx k ≤ 1} where ηx = ξ − x, ηx ∼ N(ν − x, Σ). Taking the spherical coordinates we infer that Z 1 p (− log kyk)p dy E(− log kηx k) 1{kηx k ≤ 1} ≤ 1 d (2π) 2 (det Σ) 2 kyk≤1 = Γ(p + 1) 1 2d/2−1 dp+1(det Σ) 2 Γ( d2 ) := C(p, d). Hence E| log kξ1 − ξ2 k|p 1{kξ1 − ξ2 k ≤ 1} ≤ C(p, d) < ∞. For t > 1, | log t| = log t < t and, for p > 1 and u, w ∈ R, one has |u + w|p ≤ 2p−1 (|u|p + |w|p ). Thus E| log kξ1 − ξ2 k|p 1{kξ1 − ξ2 k > 1} ≤ E kξ1 − ξ2 kp ≤ E(kξ1 − νk + kξ2 − νk)p ≤ 2p−1 (E kξ1 − νkp + E kξ2 − νkp ) = 2p E kξ − νkp < ∞. as one can easily verify that p Γ( p+d ) p+d 2 2 E kξ − νk ≤ (λ ) < ∞. max 1 d (det Σ) 2 Γ( 2 ) 22 p Consequently, the finiteness of (6) and (11) are established for any ε0 > 0. We do not use here the explicit formula for H. The proof of Corollary 4 is complete.  Acknowledgements The work is supported by the Russian Science Foundation under grant 14-21-00162 and performed at the Steklov Mathematical Institute of Russian Academy of Sciences. The authors are grateful to Professor E.Spodarev for drawing their attention to the entropy estimation problems. 5 Appendix R Proof of Lemma 1. Let us fix x0 ∈ Rd , r0 > 0. For B ∈ B(Rd ), set p(B) := B f (y)dy. The function r −d is continuous on (0, ∞). Thus it is sufficient to verify that |p(B(x, r)) − p(B(x0 , r0 ))| is small whenever (x, r) is close to (x0 , r0 ). One has |p(B(x, r)) − p(B(x0 , r0 ))| ≤ |p(B(x, r)) − p(B(x, r0 ))| + |p(B(x, r0 )) − p(B(x0 , r0 ))| (69) ≤ p(B(x, r)△B(x, r0)) + p(B(x, r0 )△B(x0 , r0 )). Since f ∈ L1 (Rd ), for any ε > 0, there exists δ = δ(ε) > 0 such that p(B) < ε if µ(B) < δ. Clearly, µ(B(x, r)△B(x, r0)) = Vd |r d − r0d | and B(x, r0 )△B(x0 , r0 ) ⊂ (B(x0 , r0 + kx − x0 k) \ B(x0 , r0 )) ∪ (B(x, r0 + kx − x0 k) \ B(x, r0 )). Thus µ(B(x, r0 )△B(x0 , r0 )) ≤ 2Vd ((r0 + kx − x0 k)d − r0d ). Taking into account (69) we come to the statement of Lemma.  Proof of Lemma 2. 1) The Lyapunov inequality (i.e. the Jensen inequality for a power 1+ε function) yields that, for any ε ∈ (0, ε0 ], Kf (ε) ≤ Kf (ε0 ) 1+ε0 < ∞. 2) Assume that Qf (ε1 , R1 ) < ∞. Consider Qf (ε1 , R) where R > 0. If 0 < R ≤ R1 then, for each x ∈ Rd , according to the definition of Mf one has Mf (x, R) ≤ Mf (x, R1 ). Hence Qf (ε1 , R) ≤ Qf (ε1 , R1 ) < ∞. Let now R > R1 . One has ( R R ) f (x)dx + f (x)dx B(x,R1 ) B(x,r)\B(x,R1 ) Mf (x, R) ≤ max Mf (x, R1 ), sup |B(x, r)| R1 <r≤R Therefore  1 ≤ max Mf (x, R1 ), Mf (x, R1 ) + |B(x, R1 )| Z Z   = Mf (x, R1 ) + 1 . |B(x, R1 )| 1 Qf (ε1 , R) = (Mf (x, R)) f (x) dx ≤ Mf (x, R1 ) + d R Vd Rd Rd ε1  1   1 < ∞. ≤ max{1, 2ε1 −1 } Qf (ε1 , R1 ) + d R1 Vd ε1  ε1 f (x) dx Assume now that Qf (ε1 , R) < ∞ for some ε1 > 0 and R > 0. Then, for any ε ∈ (0, ε1], ε the Lyapunov inequality yields Qf (ε, R) ≤ (Qf (ε1 , R)) ε1 < ∞. 3) Now we turn to Tf (ε, R), ε ∈ (0, ε2 ], R > 0. Let Tf (ε2 , R2 ) < ∞ and take 0 < R ≤ R2 . Then, for each x, according to the definition of mf we get 0 ≤ mf (x, R2 ) ≤ mf (x, R). Hence Tf (ε2 , R) ≤ Tf (ε2 , R2 ) < ∞. Consider R > R2 . According to Lemma 1, for each x ∈ Rd and every a > 0, the function If (x, r) is continuous in r on (0, a]. If x ∈ S(f ) ∩ Λ(f ) then there exists limr→0+ If (x, r) = f (x). For such x, set If (x, 0) := f (x). Further in the proof we consider an arbitrary fixed x ∈ S(f ) ∩ Λ(f ). Then If (x, ·) is continuous on any interval e2 in [0, R2 ] such that mf (x, R2 ) = If (x, R e2 ) and there exists R0 [0, a]. Thus one can find R in [0, R] such that mf (x, R) = If (x, R0 ). If R0 ≤ R2 then mf (x, R) = mf (x, R2 ) (since mf (x, R) ≤ mf (x, R2 ) for R > R2 and mf (x, R) = If (x, R0 ) ≥ mf (x, R2 ) as R0 ∈ [0, R2 ]). Assume that R0 ∈ (R2 , R]. Obviously R0 > 0 as R2 > 0. One has R R f (y)dy + B(x,R0 )\B(x,R2 ) f (y)dy B(x,R2 ) mf (x, R) = If (x, R0 ) = |B(x, R0 )| R f (y)dy |B(x, R2 )| |B(x, R2 )| B(x,R2 ) ≥ = If (x, R2 ) ≥ mf (x, R2 ) |B(x, R0 )| |B(x, R0 )| |B(x, R0 )|  d  d R2 R2 = mf (x, R2 ) ≥ mf (x, R2 ). R0 R d Thus for all cases (R0 ∈ [0, R2 ] and R0 ∈ (R2 , R]) one has mf (x, R) ≥ RR2 mf (x, R2 ) as R2 < R. Taking into account Remark 1 and the relation µ(S(f ) \ (S(f ) ∩ Λ(f ))) = 0 we come to the inequality  ε2 d R Tf (ε2 , R) ≤ Tf (ε2 , R2 ) < ∞. R2 Assume now that Tf (ε2 , R) < ∞ for some ε2 > 0 and R > 0. Then, for any ε ∈ (0, ε2], the ε Lyapunov inequality yields Tf (ε, R) ≤ (Tf (ε2 , R)) ε2 < ∞. The proof is complete.  Proof of Lemma 3. We start with relation 1). Note that if a function g is measurable and R bounded on a finite interval (a, b] then (a,b] g(x)ν(dx) is finite where ν is a finite measure on the Borel subsets of (a, b]. Thus, for each a ∈ (0, 1e ], using the integration by parts formula (see, e.g., [22], p. 245) we get Z Z log (− log u) + 1 du = F (u) F (u)d(−(− log u) log(− log u)) u (a, 1e ] (a, 1e ] Z (70) = (− log a) log(− log a)F (a) + (− log u) log(− log u)dF (u). (a, 1e ] Assume now that theorem R (0, 1e ] (− log u) log (− log u) dF (u) < ∞. Then by the monotone convergence Z lim (− log u) log(− log u)dF (u) = 0. (71) a→0+ (0,a] Clearly, the following nonnegative integral admits an estimate Z Z (− log u) log (− log u) dF (u) ≥ (− log a) log (− log a) (0,a] dF (u) (0,a] = (− log a) log (− log a)(F (a) − F (0)) = (− log a) log (− log a)F (a) ≥ 0. Therefore (71) implies that (− log a) log (− log a)F (a) → 0, a → 0 + . (72) Taking a → 0+ in (70) we come by the monotone convergence theorem to relation 1) of the statements of our Lemma. Suppose now that Z (0, 1e ] F (u) log (− log u) + 1 du < ∞. u (73) In view of (70), (73) and monotone convergence theorem we have Z F (u)d(−(− log u) log(− log u)) du = 0. lim b→0+ (0,b] For any c ∈ (0, b) we obtain the inequalities Z Z F (u)d(−(− log u) log(− log u)) ≥ (0,b] F (u)d(−(− log u) log(− log u)) (c,b] = F (b)(−(− log b) log(− log b)) + F (c)(− log c) log(− log c) + Z (− log u) log(− log u) dF (u) (c,b] ≥ F (b)(log b) log(− log b) − F (c)(log c) log(− log c) + (− log b) log(− log b)(F (b) − F (c))   log b log(− log b) . = F (c)(− log c) log(− log c) 1 − log c log(− log c) Let c = b2 (b ≤ 1 e < 1). Then 1− 1 log 2 1 log b log(− log b) = + ≥ log c log(− log c) 2 2 log(−2 log b) 2 for all positive b small enough. Hence we can claim that F (b2 )(− log(b2 )) log(− log(b2 )) → 0 as b → 0. Therefore we come to (72) taking a = b2 . Consequently we get (72). Then (70) yields relation 1). If one of (nonnegative) integrals appearing in 1) is infinite and other one is finite we come to the contradiction. Hence 1) is established. In a similar way one can prove that relation 2) is valid. Therefore, we omit further details.  Proof of Lemma 4. Take x ∈ S(f ) ∩ Λ(f ) and R > 0. Assume that mf (x, R) = 0. e ∈ [0, R] (R e = R(x, e R)) such that mf (x, R) = If (x, R) e According to Lemma 1, there exists R e = 0 (recall that If (x, 0) := limr→0+ If (x, r) = f (x) for all x ∈ Λ(f ) by continuity). If R e ∈ (0, R]. If then mf (x, r) = f (x) > 0 as x ∈ S(f ) ∩ Λ(f ). Hence we have to consider R R e = 0 then e Thus (15) ensures that f (x) = 0. If (x, R) f (y)dy = 0 for any 0 < r ≤ R. B(x,r) However, x ∈ S(f ) ∩ Λ(f ). Consequently, for all x ∈ S(f ) ∩ Λ(f ) we have mf (x, R) > 0. Hence, S(f ) ∩ Λ(f ) ⊂ Df (R) := {x ∈ S(f ) : mf (x, R) > 0}. It remains to note that S(f ) \ Λ(f ) ⊂ Rd \ Λ(f ) and µ(Rd \ Λ(f )) = 0. Therefore µ(S(f ) \ Df (R)) = 0.  Proof of Lemma 5. We verify that, for a given c > 0 and any t > 0 (t := ρd (x, y)), there exist D, F ≥ 0 such that G(| log(ct)|) ≤ DG(| log t|) + F. (74) Instead of (74) one can prove that, for any v ∈ R (v := log t) and c1 := log c ∈ R, G(|v+c1 |) ≤ DG(|v|) + F. Obviously |v + c1 | ≤ |v| + |c1 |. Since G is non decreasing function it is enough to verify that G(|v| + |c1 |) ≤ DG(|v|) + F . Thus we prove that (s := |v|, c2 := |c1 |) G(s + c2 ) ≤ DG(s) + F, s ≥ 0, c2 ≥ 0. (75) Let 0 ≤ s ≤ 2. Then G(s + c2 ) ≤ G(2 + c2 ) and, for s ∈ [0, 2], the inequality (75) holds with any D = 0 and F = G(2+c2 ). Let s > 2. Then G(s) = s log s, G(s+c2 ) = (s+c2 ) log(s+c2 ) and (s + c2 ) log(s + c2 )  c2  log(s + c2 )  c2  log(s + c2 ) = 1+ ≤ 1+ . s log s s log s 2 log s One can find T0 > 2 such that viously, log(s+c2 ) log s 0 +c2 ) ≤ log(T for log 2 log(T0 +c2 ) } and F log 2 log(s+c2 ) log s ≤ 2 for s > T0 as lims→∞ log(s+c2 ) log s = 1. Ob- 2 < s ≤ T0 . Consequently we come to (75) with D = = G(2 + c2 ). (1 + c22 ) max{2, Now we establish that, for some D0 , F0 ≥ 0 and all t > 0, G(| log td |) ≤ D0 G(| log t|) + F0 . Note that G(| log td |) = G(d| log t|). Thus it is sufficient to show that, for a given c ≥ 0 and any v ≥ 0 (v := | log t|) and c ≥ 0, one has G(cv) ≤ D0 G(v) + F0 . This is verified in a similar way to (75) proof. Thus, for some a, b ≥ 0 (actually a := DD0 , b := DF0 + F ) and all x, y ∈ Rd , x 6= y, we come toRthe inequality G(| log ρe(x, y)|) ≤ aG(| log ρ(x, y)|) + b and consequently (40) is valid (since Rd f (y)dy = 1).  References [1] Alonso-Ruiz, P., Spodarev, E.: Entropy-based inhomogeneity detection in porous media, arXiv preprint, arXiv:1611.02241 [2] Balibrea, F.: On Clausius, Boltzmann and Shannon notions of entropy. Journal of Modern Physics, 7, 219–227 (2016) [3] Benguigui, L.: The different paths to entropy. European Journal of Physics, 34, 303–321 (2013) [4] Beirlant, J., Dudewicz, E.J., Györfi, L., van der Meulen, E.C.: (1997) Nonparametric entropy estimation: An overview. International Journal of Mathematical and Statistical Sciences, 6, 17–39 (1997) [5] Billingsley, P.: Convergence of Probability Measures (2nd ed.), J.Wiley and sons Inc., New York, 1999 [6] Borkar, V.S.: Probability Theory. An Advanced Course, Springer-Verlag, New York, 1995 [7] Charzyńska, A., Gambin, A.: Improvement of of the k-NN entropy estimator with applications in systems biology. Entropy, 18(1), 13 (2016); doi:10.3390/e18010013 [8] Delattre, S., Fournier, N.: On the Kozachenko-Leonenko Entropy Estimator. Journal of Statistical Planning and Inference, (2017), DOI: http://dx.doi.org/10.1016/j.jspi.2017.01.004 (accepted manuscript) [9] Evans, D.: A computationally efficient estimator for mutual information. Proc. R. Soc. A, 464, 1203-1215 (2008) [10] Evans, D., Jones, A.J., Schmidt, W.M.: Asymptotic moments of near-neighbour distance distributions. Proc. R. Soc. A, 458, 2839-2849 (2002) [11] Gorban, A.N., Gorban, P.A., Judge, G.: Entropy: the Markov ordering approach. Entropy, 12, 1145–1193 (2010) [12] Kallenberg, O.: Foundations of Modern Probability, Springer, New York, 1997. [13] Kozachenko, L.F., Leonenko, N.N.: Sample estimate of the entropy of a random vector. Problems of Information Transmission, 23, Issue 2, 9-16 (1987) [14] Kraskov, A., Stögbauer, H., Grassberger, P.: Estimating mutual information. Phys. Rev. E, 69:066138 (2004) [15] Laurent, B.: Efficient estimation of integral functionals of a density. The Annals of Statistics, 24, 659–681 (1996) [16] Leonenko, N.N., Pronzato, L., Savani V.: A class of Rényi information estimations for multidimensional densities. The Annals of Statistics, 36, 2153–2182 (2008). Correction: The Annals of Statistics, 38, 3837-3838 (2010) [17] Ma, J., Sun, Z.: Mutual information is copula entropy. Tsinghua Science and Tech., 16(1), 51–54 (2011) [18] Miller, E.G.: A new class of entropy estimators for multidimensional densities. In: Proceedings of the International Conference on Acoustics, Speech, and Signal Processing (ICASSP03), Hong Kong, China, 6-10 April 2003, 3, 297–300. [19] Pál, D., Póczos, B., Szepesvári C.: Estimation of Rényi entropy and mutual information based on generalized nearest-neighbor graphs. In: NIPS’10 Proceedings of the 23rd International Conference on Neural Information Processing Systems, Vancouver, British Columbia, Canada (December 06 - 09, 2010), 1849–1857 [20] Peng, H., Long, F., Ding, C. Feature selection based on mutual information criteria of max-dependency, max-relevance, and min-redundancy. IEEE Trans. on Pattern Analysis and Machine Intelligence, 27(8):1226–1238 (2005) [21] Shannon, C.E.: A Mathematical Theory of Communication. Bell Systems Technical Journal, 27, July and October, 379–423 and 623–656 (1948) [22] Shiryaev, A.N. Probability - 1 (3rd ed.), Springer, New York, 2016. [23] Singh, S., Pószoc, B.: Nonparanormal information estimation. In: Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, PMLR 70, 3210–3219, 2017 [24] Singh, S., Pószoc, B.: Analysis of k-nearest neighbor distances with application to entropy estimation, arXiv preptint, arXiv: 1603.08578v2 [25] Sricharan, K., Wei, D., Hero, A.O.: Ensemble estomators for multivariate entropy estimation. IEEE Transactions on Information Theory, 59, NO. 7, July, 4374–4388 (2013) [26] Stowell, D., Plumbley, M.D.: Fast multidimensional entropy estimation by k-d partitionaing. IEEE Signal Processing Letters, 16, NO. 6, JUNE (2009), preprint [27] Yeh, J.: Real Analysis: Theory of Measure and Integration (3rd edition), World Scientific, Singapore, 2014
10math.ST
1 Constructive Stabilization and Pole Placement by Arbitrary Decentralized Architectures arXiv:1704.01674v1 [cs.SY] 6 Apr 2017 Alborz Alavian and Abstract—A seminal result in decentralized control is the development of fixed modes by Wang and Davison in 1973 - that plant modes which cannot be moved with a static decentralized controller cannot be moved by a dynamic one either, and that the other modes which can be moved can be shifted to any chosen location with arbitrary precision. These results were developed for perfectly decentralized, or block diagonal, information structure, where each control input may only depend on a single corresponding measurement. Furthermore, the results were claimed after a preliminary step was demonstrated, omitting a rigorous induction for each of these results, and the remaining task is nontrivial. In this paper, we consider fixed modes for arbitrary information structures, where certain control inputs may depend on some measurements but not others. We provide a comprehensive proof that the modes which cannot be altered by a static controller with the given structure cannot be moved by a dynamic one either, and that the modes which can be altered by a static controller with the given structure can be moved by a dynamic one to any chosen location with arbitrary precision, thus generalizing and solidifying Wang and Davison’s results. This shows that a system can be stabilized by a linear timeinvariant controller with the given information structure as long as all of the modes which are fixed with respect to that structure are in the left half-plane; an algorithm for synthesizing such a stabilizing decentralized controller is then distilled from the proof. Index Terms—Network Analysis and Control, Decentralized Control, Stability of Linear Systems, Linear Systems I. I NTRODUCTION This paper is concerned with the stabilization of decentralized control systems, for which certain controller inputs may depend on some measurements but not others. This corresponds to finding a stabilizing controller which satisfies a given sparsity constraint. A special case of this, sometimes referred to as perfectly decentralized control, occurs when each control input may depend only on a single associated measurement, which corresponds to finding a stabilizing controller which is (block) diagonal. This special case is sometimes itself referred to as decentralized control, particularly in the literature from a few decades ago. This malleability or evolution of the definition has not only caused some confusion, but has also resulted in some A. Alavian is with the Department of Electrical and Computer Engineering, University of Maryland, College Park, MD 20742 USA, [email protected]. M. C. Rotkowitz is with the Institute for Systems Research and the Department of Electrical and Computer Engineering, The University of Maryland, College Park, MD 20742 USA, [email protected]. This material is based upon work supported by the National Science Foundation under Grant No. 1351674. Michael Rotkowitz important results in the field only being studied for this special case. We assume that plants and controllers are finitedimensional, linear time-invariant (FDLTI), except for when we say otherwise. A seminal result in decentralized control is the development of fixed modes by Wang and Davison in 1973 [1]. This paper studied FDLTI perfectly decentralized stabilization of FDLTI systems. Its contributions can be broken into three main components - a definition establishing the framework, and two subsequent results. Fixed modes were defined as those modes of the plant which could not be altered by any static perfectly decentralized controller (that is, by any diagonal matrix). The first result was that these fixed modes could also not be altered by any dynamic perfectly decentralized controller; if you can’t move it with a static diagonal controller, you can’t move it with a dynamic diagonal controller. The second result was that if a mode is not fixed, then it can be moved arbitrarily close to any chosen location in the complex plane (provided that it has a complex conjugate pair if it is not real). These can be taken together to state that a system is stabilizable by a (dynamic) perfectly decentralized controller if and only if all of its (static) fixed modes are in the left half-plane (LHP). When proving these results, it was shown that allowing one part of the controller to be dynamic does not result in any fewer fixed modes than a static controller, and then claimed that the first result followed; that is, that a dynamic controller would not be able to move any of the fixed modes. Similarly, it was shown that a single non-fixed mode could be moved to any chosen location, and then claimed that the second result followed; that is, that an arbitrary number of non-fixed modes could be simultaneously moved to chosen locations by a single controller. Getting from these initial steps to a rigorous inductive argument, however, is not trivial. We seek to study these fundamental concepts for arbitrary information structure, while developing robust notation and rigorous proofs, thus placing the new and existing results on a sound mathematical footing. We first introduce notation for fixed modes that allows it to vary with information structure, as well as with the type of controllers allowed (static, dynamic, linear, etc.). We then show that, for arbitrary information structure, the fixed modes with respect to dynamic controllers are the same as the fixed modes with respect to static controllers. Moreover, we provide a rigorous proof that the non-fixed modes can then be moved to within an arbitrarily small distance of chosen (conjugate) locations, using a dynamic LTI controller with the given structure, thus extending and solidifying the seminal results of 2 Wang and Davison. The proof is constructive, and we lastly distill an explicit algorithm for the stabilizing decentralized controller synthesis from the proof. The obvious potential benefits of this are an increased understanding of decentralized stabilizability, and the verification of important existing results. It is also our hope that the notation developed will be useful in further extending our understanding of decentralized stabilizability to richer classes of controllers for which the fixed modes may diminish relative to the original static definition, particularly non-linear and/or time-varying controllers [2]–[5]. We further note that demonstrating the results of this paper directly for arbitrary structure, as opposed to attempting to diagonalize the problem and then prove the original perfectly decentralized results, would likely be useful when other types of stability are required which are not invariant under such transformations, such as boundedinput bounded-output (BIBO) stability, though we currently focus on internal state stability. As an example of the diagonalization approach, readers are referred to [6], where existence of a stabilizing controller under arbitrary information constraint has been demonstrated by transforming the problem into a diagonal one to which [1] could be applied. Furthermore, [6] demonstrates an analytical test for determining structural fixed modes under arbitrary information constraint and shows its equivalence to a graph-theoretical condition. Dealing with the original structure is also preferable since stabilizing controllers can be constructed without having to first expand their size. Finally, while the proofs in [1], (as well as [5]), are constructive in nature, they do not clearly lead to an explicit synthesis algorithm. Many of the ideas for the rigorous proof of the necessity of the fixed mode condition were first presented in [7], while many of the ideas for the rigorous proof of its sufficiency, along with the development of the algorithm, were first presented in [8], before being refined and generalized here. The organization of this paper is as follows. In Section II we define notation and preliminaries, including our definition of fixed modes and the controller types that we will later need. In Section III we review and establish some results for centralized controllers. In Section IV, we then state and prove our main results in two parts; Section IV-A will prove the necessity of having fixed modes in the LHP for existence of a FDLTI stabilizing controller, and Section IV-B will prove the sufficiency of the aforementioned assumption. In Section V, we give the explicit computational algorithm, along with a numerical example, followed by some concluding remarks in Section VI. II. P RELIMINARIES We proceed with the following preliminary definitions. Let ℜ(·) denote the real part of any complex number. Define C to be the complex plane, C− , {λ ∈ C | ℜ(λ) < 0} to be the open left-half plane, and C+ , C\C− = {λ ∈ C | ℜ(λ) ≥ 0} to be the closed right-half plane. Let ei denote the unit vector of all zeros except for the ith element which is 1. Note that the dimension of ek should be clear from the context and thus we suppress the explicit dimension of ek in the notation. For a real matrix A, define the following norm: X  kAk∞ = max |Aij | , i j and let B(λ0 , ǫ) , {λ ∈ C : |λ − λ0 | < ǫ} denote the open ǫ-ball around λ0 . We consider an FDLTI plant P (σ) (where σ = s, z depending on whether we are considering continuous or discretetime cases; we use σ for statements that apply to both). We assume that P has nu inputs, ny outputs, and a statespace representation of P is given by (AP , BP , CP , DP ). All controllers under consideration in this paper will also be FDLTI. We impose information constraints on the controller to encapsulate that each part of the controller may access certain sensor measurements, but not others. We define a set of admissible indices Adm(S), such that (i, j) ∈ Adm(S) if and only if controller i is allowed to access measurement j. The information constraint is then denoted by the constraint K ∈ S, where Kij = 0 for all (i, j) ∈ / Adm(S), for all K ∈ S. We will make use of the following specific sparsity patterns: • • Sc : Centralized sparsity patterns, i.e., no sparsity constraints are imposed on the controller. Adm(S) = {(i, j) ∀ i, j}. Sd : Diagonal sparsity patterns, i.e., K(σ) must be zero for all off-diagonal terms (for almost all σ). Adm(S) = {(i, i) ∀ i}. We also define types of controllers that will help us to easily refer to whether a controller K is static, dynamic, or static for some elements but dynamic for others. We will make use of the following controller types: • • • • T d : Set of finite order dynamic controllers, i.e., AK , BK , CK , DK each are real matrices of compatible dimension. T s : Set of static controllers, i.e., AK , BK , and CK are all zero and only DK could be non-zero. s+1 Ti,j : Set of controllers such that all of the elements of the controller are static except for the (i, j)th element which could be dynamic; i.e., for all (k, l) 6= (i, j), we have Kkl ∈ R, while Kij may be a proper transfer function in σ. This could be read as “static plus one”. TIs+k : Set of controllers such that all the elements of controller are static except for k indices in the set I , {(i1 , j1 ), · · · , (ik , jk )}; i.e., for all (k, l) ∈ / I, we have Kkl ∈ R, while Kij is a proper transfer function in σ for all (i, j) ∈ I. This could be read as “static plus k”. For any information structure S, let a , |Adm(S)| be the number of admissible non-zero indices of the controller, and let the tuple I , {(i1 , j1 ), · · · , (ia , ja )} be any arbitrary ordering of these admissible non-zero indices. For any D ∈ T s ∩ S, we define the sequence of matrices D|(m) ∈ Rnu ×ny , m ∈ {0, 1, · · · , a} as: D|(0) , 0, D|(m) , m X l=1 eil Dil jl eTjl for m ∈ {1, · · · , a} (1) 3 where eil ∈ Rnu and ejl ∈ Rny , for l ∈ {1, · · · , a}. This D|(m) gives the static controller matrix with only the first m admissible indices. The closed-loop has a state-space representation with dynamics matrix denoted by ACL (P, K), given by: ACL (P, K) ,  AP + BP M DK CP BK N CP BP M CK AK + BK DP M CK , (2) Γ(P, K) P + r K Fig. 1. The map from reference inputs to outputs when K is closed around P . Γ(P, K) is given by:  Γ(P, K) =  ACL (P, K) N CP s ∼ s Λ∼ (P, S, T s ) = Λ∼ + (P, S, T ) ∪ Λ− (P, S, T ), where s s Λ∼ + (P, S, T ) = {α ∈ ζ(P ) | ℜ(α) ≥ 0} \ Λ (P, S, T ) = Λ∼ (P, S, T s ) ∩ C+  where M , (I − DK DP )−1 and N , (I − DP DK )−1 . We have M DK = DK N and similarly DP M = N DP , as well as N = I + DP M DK . As illustrated in Figure 1, let Γ(P, K) denote the map from the reference inputs to the outputs of P (i.e., from r to y), when K is closed around P . A state-space representation for y gives the non-fixed modes, which we then further partition as: DP M CK BP M BK D P M DP M We have the following property of Γ(·, ·): Γ(Γ(P, K1 ), K2 ) = Γ(P, K1 + K2 ),  . (3) (4) which can be verified by working out the state-space representation of both sides. Definition 1: The set of fixed modes of a plant P with respect to a sparsity pattern S and a type T , is defined to be: Λ (P, S, T ) , {λ ∈ C | λ ∈ eig (ACL (P, K)) ∀ K ∈ S ∩ T } \ = eig (ACL (P, K)) . = {α1 , · · · , α|Λ∼ } + (P )| are distinct unstable non-fixed open-loop eigenvalues of P , and s s Λ∼ − (P, S, T ) = {β ∈ ζ(P ) | ℜ(β) < 0} \ Λ (P, S, T ) = Λ∼ (P, S, T s ) ∩ C− = {β1 , · · · , β|Λ∼ } − (P )| are distinct stable non-fixed open-loop eigenvalues of P . We may suppress the dependence of these collections of eigenvalues on some of their arguments when clear from context. We note that one can adopt the notion of the multiset to discriminate between copies of a mode with multiplicity greater than one. This would have some conceptual advantages, but would unnecessarily complicate some definitions and proofs, and so we maintain the use of standard sets, while tracking the multiplicities of the modes which we will want to move (the unstable non-fixed modes). This is equally acceptable, provided that a fixed and a non-fixed mode do not have the same value, which would require the non-fixed modes to be defined as something other than the complement of those which are fixed, as above (and multiset complementation could handle this aspect nicely). Even that situation could not be problematic if we are considering the complex plane as being split into an acceptable and an unacceptable region, since such an overlap would either represent an acceptable situation, or one which is fatal anyway. Denote the total (with multiplicities) number of unstable non-fixed modes of a plant P by X µ(α, P ). ν(P ) , α∈Λ∼ + (P ) For a matrix A, we refer to the non-negative and negative eigenvalues respectively by eig+ (A) , eig (A) ∩ C+ , and eig− (A) , eig (A) ∩ C− . When eig− (·), and eig+ (·) are applied on a general LTI system P , with a slight abuse of notation, we mean the negative, and non-positive eigenvalues of the dynamic matrix of that system, i.e., eig− (P ) , eig− (AP ), and eig+ (P ) , eig+ (AP ). K∈S∩T Remark 2: This reduces to the definition of fixed modes in [1] if S = Sd and T = T s . For any FDLTI system P , denote its open-loop modes by ζ(P ) = eig (AP ), and for each mode λ ∈ ζ(P ), let µ(λ, P ) denote its multiplicity. We can partition the open-loop modes as: ζ(P ) = Λ (P, S, T s ) ∪ Λ∼ (P, S, T s ) (5) where Λ∼ (P, S, T s ) = eig (AP ) \ Λ (P, S, T s ) III. C ENTRALIZED R ESULTS In this section we review and establish results on controllability, observability, and fixed modes for centralized control of linear time-invariant systems. We begin with Kalman canonical form with the help of the following lemma: Lemma 3: For every FDLTI plant P , there exists a similarity transformation matrix T such that #" # " #" AP BP T −1 0 T 0 0 I 0 I CP DP 4     =    Ã11 Ã21 0 0 C̃1 0 Ã22 0 0 0 Ã13 Ã23 Ã33 Ã43 C̃2 0 Ã24 0 Ã44 0 B̃1 B̃2 0 0 DP     .    (6) In the above equation we have the following correspondence between eigenvalues of Ãii and modes of P : • • • • Ã11 : Ã22 : Ã33 : Ã44 : controllable and observable modes of P , controllable and unobservable modes of P , uncontrollable and observable modes of P , uncontrollable and unobservable modes of P . Proof: See, for example, [9]. In order to reduce some of the notation, we do not explicitly show the dependence of Ãij , B̃i , C̃j on AP , BP , CP , and T , but it should be kept in mind that wherever we use Lemma 3 ˜ variables are function of that on a system, the resulting (·) system’s state-space matrices with its respective Kalman similarity transformation matrix. The following lemma is useful in connecting centralized fixed modes with the familiar notion of controllability and observability. It was shown for strictly proper plants in [10]; we establish the following generalization before proceeding. Lemma 4: Given a proper controllable and observable plant Pco , for almost any DK ∈ T s ∩ Sc , we have that: eig (ACL (Pco , DK )) ∩ eig (Pco ) = ∅. (7) Proof: For a strictly proper plant refer to [10, Theorem 2]. Given the proper plant Pco , consider the strictly proper part of it, namely Pco −D. Then, by [10, Theorem 2] the set of static   feedback gains D̃K for which eig ACL (Pco − D, D̃K ) ∩ eig (Pco − D) 6= ∅ constitute a finite union of hyperplanes in the ambient space, and hence almost any D̃K ∈ T s ∩ Sc moves the open-loop eigenvalues of Pco − D. If (I + D̃K D) is invertible, then by the change of variable DK = (I + D̃K D)−1 D̃K , we have: ACL (Pco − D, D̃K ) = ACL (Pco , DK ). The proof would be finished if (I + D̃K D) is invertible for almost any D̃K . This can be seen as det(I + D̃K D) = 0 is a non-trivial polynomial in D̃K (choosing D̃K = 0 would yield non-zero determinant), and hence the set of D̃K for which det(I + D̃K D) = 0 is a set with dimension less than the ambient space and has zero measure. Next we state the following result regarding fixed modes with respect to a centralized sparsity pattern Sc , which tells us that the fixed modes of a plant with respect to a centralized information structure are precisely its uncontrollable or unobservable modes. Lemma 5: For any FDLTI plant P ,   [ eig Ãii , Λ (P, Sc , T s ) = i=2,3,4 where Ãii are the blocks in the Kalman canonical decomposition of plant P , such that the fixed modes are the union of uncontrollable or unobservable modes of P . Proof: Denote the controllable and observable part of P by Pco , C̃1 (sI − Ã11 )−1 B̃1 + DP . We first establish that for any arbitrary DK ∈ Sc ∩ T s that is closed around P , we have:   [ eig (ACL (P, DK )) = eig (ACL (Pco , DK ))∪( eig Ãii ). i=2,3,4 (8) To see this, apply the similarity transformation T given in Lemma 3 on ACL (P, DK ). Then T ACL (P, DK )T −1 would only differ in blocks Ã11 , Ã21 , Ã13 , and Ã23 compared to the open-loop à in (6). This leaves the structure of à unchanged, and renders (8). For any DK ∈ Sc ∩ T s , and for i = 2, 3, 4, we then have:    eig Ãii ⊆ eig T ACL (P, DK )T −1 = eig (ACL (P, DK )) ,   S eig Ãii ⊆ Λ (P, Sc , T s ) . and so i=2,3,4   For any remaining modes of P , i.e., λ ∈ eig Ã11 , it follows from (8) and Lemma 4 that there exists a static controller DK ∈ Sc ∩ T s such that λ ∈ / eig (ACL (P, DK )), and so λ ∈ / Λ (P, Sc , T s ) . Remark 6: Due to Lemma 4 and Lemma 5, almost any randomly chosen DK ∈ T s ∩ Sc moves all the open-loop modes of P , except those of Λ (P, Sc , T s ). Also to make this paper sufficiently self-contained we use our notation to restate the following result, which tells us that the fixed modes of a plant with centralized information structure are the same with respect to static or dynamic control. Theorem 7: Given an FDLTI plant P ,  Λ (P, Sc , T s ) = Λ P, Sc , T d . Proof: The ⊇ inclusion follows immediately since T s ⊆ T d.  We now need to show that Λ (P, Sc , T s ) ⊆ Λ P, Sc , T d ; using Lemma this by showing that  5, we can achieve  S d eig Ãii ⊆ Λ P, Sc , T , which can be achieved i=2,3,4   S by showing that eig Ãii ⊆ eig (ACL (P, K)) for i=2,3,4 arbitrary K ∈ Sc ∩ T d . Given an arbitrary K ∈ Sc ∩ T d , and letting T be the similarity transformation matrix from Lemma 3, we can then apply (6) to (2) to get    −1  T 0 T 0 ACL (P, K) 0 I 0 I   B̃M CK à + B̃M DK C̃ = BK N C̃ AK + BK DP M CK   ∗ 0 ∗ 0 B̃1 M CK    ∗ Ã22 ∗ ∗ B̃2 M CK      =  0 0 Ã33 0 0      0 0 ∗ à 0 44   BK N C̃1 0 BK N C̃2 0 ∗ where we have let (Ã, B̃, C̃, DP ) give the blocks of (6). 5 If we apply another similarity transformation which swaps the first/second and third/fifth row and column blocks, the result is an upper block triangular matrix for which the eigenvalues clearly include those of Ã22 , Ã33 , and Ã44 , as desired. P+ y IV. M AIN R ESULT We will generalize the result of [1] to arbitrary information structures, and provide a comprehensive proof in this section. Section IV-A will establish the invariance of fixed modes with respect to static and dynamic controllers, thereby demonstrating the necessity of having all of the fixed modes in the LHP for decentralized stabilizability, and Section IV-B will give a constructive proof for obtaining a stabilizing controller when all of the fixed modes of P are in the LHP, thereby demonstrating the sufficiency. A. Invariance of fixed modes We will show in this subsection that for any arbitrary sparsity pattern S, the set of fixed modes with respect to static controllers is the same as the set of fixed modes with respect to dynamic controllers. We first state a lemma which is unsurprising but which will be helpful. This lemma states that if λ is a fixed mode of a system with respect to static controllers and sparsity pattern S, then after closing the loop with an arbitrary matrix DK ∈ S, if we further allow only one of the static elements of the controller to vary, then λ will remain as a fixed mode. Given any matrix DK ∈ S, and any (i, j) ∈ Adm(S), define P + (DK ), as illustrated in Figure 2, as:   AP + BP + △ + T , P (DK ) = ej Γ(P, DK )ei = CP + DP + where AP + , ACL (P, DK ) = AP + BP M DK CP , BP + , BP M ei , CP + , eTj N CP , and DP + , eTj DP M ei . We note that this notation suppresses the dependence of P + on the particular choice of the admissible index pair. Lemma 8: Given any matrix DK ∈ S ∩ T s , and any (i, j) ∈ Adm(S), if λ ∈ Λ (P, S, T s ), then λ ∈ Λ (P + (DK ), Sc , T s ), s + i.e., Λ (P, S, T ) ⊆ Λ (P (DK ), Sc , T ). Proof: Suppose that λ ∈ Λ (P, S, T s ). For an arbitrary real scalar V , we have: ei y′ u′ Fig. 2. P + is the SISO map from u′ to y ′ . to be dynamic; that is, to “static plus one” controllers. The lemma will prove useful because closing such a controller around the plant is equivalent to interconnecting a SISO dynamic controller with P + , and we can then leverage our knowledge of centralized controllers. This result will be the foundation of the induction that we want to use later on. The outline of the proof is similar to that of [1, Proposition 1]. Theorem 9: For any sparsity pattern S, and any arbitrarily fixed indices (i, j) ∈ Adm(S):  s+1 Λ (P, S, T s ) = Λ P, S, Ti,j . Proof: The ⊇ inclusion follows immediately s+1 since T s ⊆ Ti,j .  s+1 We now need to show that Λ (P, S, T s ) ⊆ Λ P, S, Ti,j . We have: \ Lem.8  Λ (P, S, T s ) ⊆ Λ P + (DK ), Sc , T s DK ∈S∩T s Thm.7 = \ = = = ACL (Γ(P, DK ), ei V (4) = ACL (P, DK + ei V eTj ) \ = V = ACL (P, DK ), where we have defined , D K + ei V as the static controller which is now effectively being closed around the V plant. Since we clearly have DK ∈ S ∩ T s and since s λ ∈ Λ (P, S, T ), it follows that λ ∈ eig (ACL (P + (DK ), V )). Since V was arbitrary, we have λ ∈ Λ (P + (DK ), Sc , T s ). Next, we relate fixed modes with respect to static controllers to those where only one of the admissible elements is allowed eTj \ DK ∈S∩T s kd ∈T d \ \ \ DK ∈S∩T s (9) Λ P + (DK ), Sc , T d DK ∈S∩T s DK ∈S∩T s eTj ) + eTj (4) ACL (P + (DK ), V ) = ACL (eTj Γ(P, DK )ei , V ) V DK DK = s u P \ kd ∈T d \   eig ACL (P + (DK ), k d )  eig Γ(Γ(P, DK ), ei k d eTj ) eig Γ(P, DK + ei k d eTj ) kd ∈T d s+1 K s+1 ∈S∩Ti,j s+1 = Λ P, S, Ti,j  eig Γ(P, K s+1 )   where the penultimate equality follows since (S ∩ T s ) + s+1 , and this completes the proof. ei T d eTj = S ∩ Ti,j We note that it was this result, showing that modes which are fixed with respect to static controllers are still fixed with respect to “static plus one” controllers, that was established for S = Sd in [1], and at which point Theorem 13 was claimed to hold true. We will now show how to extend this result to show that modes which are fixed with respect to controllers 6 with any given number of dynamic indices; that is, with respect to “static plus k” controllers, are still fixed when an additional index is allowed to become dynamic; that is, with respect to “static plus k + 1” controllers. The main result will indeed follow once that has been established. We will proceed with the following definitions. Let K (k) (σ) be the controller after k steps, with k of its indices allowed to be dynamic, and define I (k) , {(i1 , j1 ), · · · , (ik , jk )} ⊂ Adm(S) as the set of such indices where K (k) (σ) is allowed to be dynamic, such that K (k) ∈ TIs+k (k) ∩ S. Also (k) (k) (k) (k) let (AK , BK , CK , DK ) be a state-space representation for K (k) (σ). k + 1” controllers, then Theorem 12 would follow similarly and easily, and the upcoming lemma would be trivial and unnecessary. It is not clear, however, that a ”static plus k + 1” controller can always be decomposed in that manner. We thus first introduce the following lemma, which states that, regardless of whether those two sets are the same, the modes which remain fixed as the controller varies over them are indeed identical. Lemma 11: Given a set of indices I (k) ⊂ Adm(S), an additional index pair (i, j) ∈ Adm(S) \ I (k) , set I (k+1) to be I (k+1) , I (k) ∪ (i, j), and let P (k) be as in (10), then we have: P y (k) P  Λ P, S, TIs+k+1 = (k+1) u + K (k) ∈S∩T s+k (k) I   s+1 Λ P (k) , S, Ti,j . (11) Proof: For ease of notation, when the controllers are unambiguous such that we can suppress the dependency (k+1) upon them, define ALHS ) and ARHS CL = ACL (P, K CL = (k) (⋆) ACL (P , K ) to be the closed-loop dynamics matrices arising on each side of the equation for given controllers. Also let KLHS , {K (k+1) |K (k+1) ∈ TIs+k+1 ∩ S}, and (k+1) s+1 (⋆) KRHS , {(K (k) , K (⋆) )|K (k) ∈ TIs+k ∩ S, K ∈ Ti,j ∩ S} (k) give the sets of controllers that must be considered on each  T eig ALHS side, such that the LHS can be abbreviated as CL , KLHS  T eig ARHS and the RHS can be abbreviated as CL . K (k) K (⋆) KRHS Fig. 3. Plant P (k) and its respective controller K (⋆) . Define P (k) (σ), illustrated in Figure 3, by closing K (k) (σ) around P (σ) in such a way that the outputs of P (k) are the same as the outputs of P , and such that the inputs of P (k) are added to the outputs of K (k) and fed into P . A state-space representation for P (k) (σ) is given by P (k) , Γ(P, K (k) ), \ (10) i.e., by replacing (AK , BK , CK , DK , M ) with in (3), where (AK (k) , BK (k) , CK (k) , DK (k) , M (k) ) M (k) = (I − DK (k) DP )−1 . We prove one remaining lemma before our main inductive step. This lemma relates the modes which are fixed when closing controllers with k + 1 dynamic elements around the plant, to the modes which are fixed when first closing controllers with k dynamic elements around the plant, and then closing a controller with an additional dynamic element around the resulting plant, as in Figure 3. This will allow us to use our result relating static and “static plus one” controllers to make conclusions relating “static plus k” and “static plus k + 1” controllers. Remark 10: We used the fact that (S ∩ T s ) + ei T d eTj = s+1 S ∩ Ti,j ; that is, that adding static controllers and a dynamic element is equivalent to taking all of the ”static plus one” controllers, at the end of the proof of Theorem 9. If this could s+1 be extended to state that (S ∩ TIs+k = S ∩ TIs+k+1 (k) ) + Ti,j (k) ∪(i,j) ; that is, that adding ”static plus k” controllers and ”static plus one” controllers is equivalent to taking all of the ”static plus First we prove the ⊆ part by showing that for every s+1 admissible K (⋆) (σ), i.e., K (⋆) ∈ S ∩ Ti,j , and admissible (k) (k+1) K (σ) in RHS, there exist a K (σ) in LHS such that LHS ARHS CL = ACL . To see this observe that: (4) Γ(Γ(P, K (k) ), K (⋆) ) = Γ(P, K (k) + K (⋆) ). Thus we choose K (k+1) (σ) = K (k) (σ) + K (⋆) (σ). This K (k+1) is admissible because it has only one further dynamic element at position (i, j) ∈ Adm(S), and thus is in TIs+k+1 (k+1) . (k) (⋆) Hence for every admissible (K , K ), there exists an admissible K (k+1) ∈ KLHS constructed as above such that   T T RHS eig ARHS eig ALHS ⊆ ALHS CL . CL CL = ACL , and so KLHS KRHS We will prove the ⊇ part by contradiction. Assume that (11) does not hold, that there  exT and thus s+1 Λ P (k) , S, Ti,j , but ists a λ such that λ ∈ K (k) ∈S∩T s+k I (k)  λ∈ /Λ . Then we have:   λ ∈ eig ACL (P (k) , K (⋆) ) ∀ (K (k) , K (⋆) ) ∈ KRHS , (12a)   ∃ K (k+1) ∈ KLHS s.t. λ ∈ / eig ACL (P, K (k+1) ) . (12b) P, S, TIs+k+1 (k+1) Starting with K (k+1) from (12b), we will show that we can then construct a K (k) and K (⋆) to falsify (12a). Based on K (k+1) in (12b), we let K̃ (⋆) be the dynamic part of the final dynamic index by defining K̃ (⋆) = 7 (⋆) (⋆) (⋆) (⋆) (A˜K , B˜K , C˜K , D˜K ) as: (⋆) A˜K (⋆) B˜K (⋆) C˜K (⋆) D˜K (k+1) = AK that is, K̂ (k+1) is defined by: (k+1) AˆK = (k+1) ˆ CK = , (k+1) ej eTj = BK h (k+1) = 0 · · · BK,j ··· (k+1) = ei eTi CK h (k+1) T = 0 · · · (CK,i ) 0 = 0, (⋆) For sufficiently small ǫ this yields   (k+1) . λ∈ / eig AˆK i 0 , ··· iT , (k+1) with all its is of the same dimension as BK i.e., B˜K (⋆) is of columns being zero except the j-th column, and C˜K (k+1) the same dimension as CK with all of its rows being zero except the i-th row. Then define K̃ (k) , K (k+1) − K̃ (⋆) , thus a state-space representation for K̃ (k) is: (k) (k+1) (k+1) A˜K = diag(AK , AK ), iT h (k) (⋆) T (k+1) T ˜ B˜K = (BK , ) (BK ) i h (k) (⋆) (k+1) , C˜K = CK −C˜K (k) (k+1) D˜K = DK . Construct P̃ (k) in the same way as illustrated in Figure 3 by closing K̃ (k) around P . Now if we use the following similarity transformation T on ACL (P̃ (k) , K̃ (⋆) ),   0 0 I 0 I 0 0 0  T =  0 I 0 0 , 0 0 −I I then T ACL (P̃ (k) , K̃ (⋆) )T −1 results in an upper block triangu(k+1) (k+1) lar matrix with blocks AK , ACL (P, K (k+1) ), and AK , indicating that:   eig ACL (P̃ (k) , K̃ (⋆) ) =     (13) (k+1) . eig ACL (P, K (k+1) ) ∪ eig AK Thus (12) can only be satisfied if:   (k+1) . λ ∈ eig AK (k+1) (k+1) (k+1) , + ǫI, BˆK = B˜K A˜K (k+1) (k+1) (k+1) ˆ ˜ ˜ . , DK = DK CK (14) We have shown that the only way to have an eigenvalue which is not on the LHS (when K (k+1) is closed around the plant) but which is on the RHS (when K̃ (⋆) and K̃ (k) are then constructed as above), is if it comes from the dynamics matrix of K (k+1) . We will now finish the proof by showing that if this is the case, we can make a small perturbation to the matrix such that it no longer has this eigenvalue, thus removing it from the RHS, while it is still not a closed-loop eigenvalue on the LHS. Construct K̂ (k+1) by perturbing the A matrix of K (k+1) ; (15) Using the same steps as before to construct K̂ (⋆) and K̂ (k) (k) (⋆) results in ǫI also being added to A˜K and A˜K . Then using the same similarity transformation T used to derive (13), we have   eig ACL (P̂ (k) , K̂ (⋆) ) =     (16) (k+1) , eig ACL (P, K̂ (k+1) ) ∪ eig AˆK where P̂ (k) is constructed by closing K̂ (k) around P , as illustrated for the unperturbed systems in Figure 3. Since ACL (P, K (k+1) ) is continuous in the entries of K (k+1) , and since the eigenvalues of a matrix are continuous in its entries (see, for example [11, Theorem 5.2. on p. 89]), it follows that by a sufficiently small perturbation made to K (k+1) ,  along with (12b), we still have  (k+1) λ ∈ / eig ACL (P, K̂ ) . It then follows from (15) and   (k) (16) that λ ∈ / eig ACL (P̂ , K̂ (⋆) ) . Thus we have been able to show that there exists a (K̂ (k) , K̂ (⋆) ) ∈ KRHS such that λ ∈ / eig ACL (P̂ (k) , K̂ (⋆) ) , which contradicts our assumption. Now we are ready to prove our main inductive step: that given a certain number of controller indices which are allowed to be dynamic, and the associated set of fixed modes, allowing one additional index to become dynamic does not change the fixed modes. Theorem 12: Given an FDLTI plant P , a sparsity pattern S, an admissible set of dynamic elements at step k denoted by I (k) ⊂ Adm(S), an index pair (i, j) ∈ Adm(S) \ I (k) that is further allowed to be dynamic at step k + 1, and the resulting I (k+1) = I (k) ∪ (i, j), we have:   Λ P, S, TIs+k = Λ P, S, TIs+k+1 . (k) (k+1) Proof: Beginning with the quantity on the right-hand side, we get:   \  Lem.11 s+1 Λ P, S, TIs+k+1 = Λ P (k) , S, Ti,j (k+1) K (k) ∈S∩T s+k (k) I Thm.9 = \ K (k) ∈S∩T s+k (k) I   Λ P (k) , S, T s  = Λ P, S, TIs+k , (k) where the final equality follows since clearly s+k s (S ∩ TIs+k and this completes (k) ) + (S ∩ T ) = S ∩ TI (k) , the proof. We can now state and easily prove our main result. The 8 following shows that for any FDLTI plant P , and any sparsity pattern S, the set of fixed modes with respect to static and dynamic controllers are the same. Theorem 13: Given plant P , and sparsity constraint S:  (17) Λ (P, S, T s ) = Λ P, S, T d . Proof: This follows by induction from Theorem 12. B. Stabilization The results from the previous subsection tell us that having all of the fixed modes in the LHP is necessary for stabilizability with respect to FDLTI controllers with the given structure. We now address the sufficiency of the condition. With a constructive proof, we will show that we can stabilize a plant P with arbitrary information structure S, as long as it has no unstable fixed modes. We will achieve this by showing that we can always find a controller which will reduce the number of unstable modes, while leaving all of the fixed modes in the LHP, which can then be applied as many times as required. We will first state the following lemma from [1], which gives some properties regarding continuity and topology of non-fixed modes with respect to static controllers. It tells us that we can keep the modes within a given distance of the original ones by closing a small enough matrix D around the plant, and that an arbitrarily small D can move all of the nonfixed modes. Lemma 14: For any plant P , and any information structure S, partition the open-loop eigenvalues of P as in (5), then we have: 1) For all ǫ > 0, there exist γ > 0 such that for all D ∈ S ∩ T s with kDk∞ < γ, there are exactly µ(λ, P ) eigenvalues of ACL (P, D) in B(λ, ǫ), for all λ ∈ Λ∼ (P ). 2) For all γ > 0, there exist D ∈ T s ∩ S with kDk∞ < γ, such that λ ∈ / eig (ACL (P, D)), for all λ ∈ Λ∼ (P ). Proof: See Lemma 4 in [1]. The proof was developed for strictly proper plants with diagonal information structure, however, it does not use any property specific to only blockdiagonal information structure and thus could be replaced by any arbitrary information structure. To generalize it for the proper plants, a similar change of variable technique as in proof of Lemma 4 can be used, which would add an invertability constraint that almost always holds. Remark 15: It follows from the proof that the set of D which violate part 2 of Lemma 14, forms a subset with zero Lebesgue measure, and thus a random D ∈ S that is sufficiently small satisfies all of the conditions of Lemma 14. Precisely, the space of static controllers that does not move the non-fixed modes is constructed by a finite union of hypersurfaces in (T s ∩ S) ⊂ Rnu ×ny . Thus, a D that satisfies all of the conditions of Lemma 14, can be found with probability one by randomly choosing the direction of D ∈ T s ∩ S, and then scaling it appropriately such that kDk∞ < γ. We now establish the following theorem, which shows how a given non-fixed mode can be extracted as a controllable and observable mode of a specific SISO system, as illustrated in Figure 4. Theorem 16: For any plant P with |Λ∼ + (P )| ≥ 1, and all fixed modes in the LHP (i.e., Λ (P, S, T s ) ⊂ C− ), there exists a DK ∈ T s ∩ S, and an integer m ∈ {1, · · · , a}, such that if we define the following SISO system:   Am Bm Pm = eTjm Γ(P, DK )eim = Cm Dm   (18) AP + BP M DK CP BP M eim , , eTjm DP M eim eTjm N CP the following then hold: 1) There exists α ∈ Λ∼ + (P ), such that α is a controllable and observable mode of Pm ; 2) The total number of unstable modes of Pm is no greater than that of P , i.e., ν(Pm ) ≤ ν(P ). Proof: The outline of the proof is as follows. We will first find a D ∈ S ∩ T s that when closed around P , will move all of its non-fixed modes, and will identify the index m ∈ {1, · · · , a} for which D|(m) is the first in the sequence to alter all of them. This means that only changing the (im , jm )th element of the static controller will change unstable mode(s) of the closed-loop, and thus those modes must be in the controllable and observable modes of the SISO plant from uim to yjm . ∼ Proof of part 1: Since Λ∼ + (P ) ⊆ Λ (P ), Lemma 14 guarantees that we can take the static gain D ∈ S ∩ T s such that when closed around P , would move all of its unstable non-fixed modes. It also asserts that by choosing this D small enough, the closed loop ACL (P, D) would have no more unstable modes than P itself. Construct a sequence of matrices D|(m) ∈ T s ∩ S as in (1), so that D|(a) = D and D|(0) = 0, thus:  ∀ α ∈ Λ∼ α∈ / eig ACL (P, D|(a) ) , + (P ) :  ∀ α ∈ Λ∼ α ∈ eig ACL (P, D|(0) ) . + (P ) : By decreasing m from a to 1, there must exist a value of m ∈ {1, · · · , a}, such that:  ∀ α ∈ Λ∼ α∈ / eig ACL (P, D|(m) ) , (19a) + (P ) :  ∼ ∃ α ∈ Λ+ (P ) : α ∈ eig ACL (P, D|(m−1) ) ; (19b) that is, m is the first index for which all of the unstable nonfixed modes have been moved. If we then set DK = D|(m−1) and use the definitions from (18), as illustrated in Figure 4, similar to (9) we have: ACL (P, D|(m) ) = ACL (P, D|(m−1) + eim Dim ,jm eTjm ) (4) = ACL (Γ(P, D|(m−1) ), eim Dim ,jm eTjm ) = ACL (eTjm Γ(P, D|(m−1) )eim , Dim ,jm ) = ACL (Pm , Dim ,jm ). (20) From (19b), there exists at least one α ∈ Λ∼ (P ) such that: +  α ∈ eig ACL (P, D|(m−1) ) = eig (Am ) , but due to (19a),  (20) α ∈ / eig ACL (P, D|(m) ) = eig (ACL (Pm , Dim ,jm )) . For all such α that are thus moved by only closing Dim ,jm 9 around the SISO system Pm (for which the only information structure is the centralized one, Sc ), we have: / eig (ACL (Pm , Dim ,jm )) ∃ Dim ,jm ∈ R s.t. : α ∈ ⇒ α∈ / Λ (Pm , Sc , T s ) . Finally, due to Lemma 5, the fixed modes of any FDLTI plant with centralized information structure are equal to its unobservable or uncontrollable modes, we must have that those α are controllable and observable modes of Pm . Proof of part 2: since Am = ACL (P, D|(m−1) ), we need to show that this D|(m−1) satisfies Lemma 14.1 when we take the ǫ-balls in Lemma 14 small enough such that they do not intersect with C+ . However this is the case since the given D in part 1 of the proof satisfies Lemma 14, and D|(m) that are constructed from this D, satisfy kD|(m) k∞ ≤ kDk∞ ≤ γ for any m ∈ {0, 1, · · · , a} based on the definition. Pm y u P D|(m−1) eim y′ K′ u′ Fig. 4. Pm is the SISO map from u′ to y ′ , and Km is the map from y to u, giving the total control for the original plant. In the following proposition, we will use observer-based pole placement for a centralized information structure to show how one can stabilize unstable, non-fixed modes of Pm in (18). We will add one further design constraint that the unstable modes of the controller would be different than that of Pm , and will show that this constraint is always achievable by a small perturbation of the gains. This ensures that an induction-based argument can be used later on. This constraint is not mentioned in [1], and it is unclear that without such a constraint how one can guarantee that a rigorous induction could follow, even for a diagonal information structure. Proposition 17: All of the controllable and observable unstable modes of the plant Pm can be stabilized by an observer-based controller K ′ such that: eig+ (K ′ ) ∩ eig+ (Γ(Pm , K ′ )) = ∅. 43 C̃1m 0 C̃2m 44 0 Dm ˜ parameters depend on the transforwhere as before, all the (·) mation matrix T and the state-space representation of Pm . We want to stabilize all the unstable modes in Ã11 . Since based on definition (Ã11 , B̃1 ) is a controllable pair and (Ã11 , C̃1 ) is an observable pair, there exists a state feedback gain F and an observer gain L, such that eigenvalues of Ã11 − B̃1 F and Ã11 − LC̃1 can be arbitrary assigned, and hence can be stabilized. We will now show that the following controller will stabilize all the unstable modes of Ã11 . Take the controller as:     ′ A B′ Ã11 − B̃1 F − LC̃1 + LDm F L = ; K′ = C′ 0 −F 0 apply T from (22) on Pm and close K ′ around it, then the closed-loop ACL (Pm , K ′ ) would be:   Ã11 0 Ã13 0 −B̃1 F   Ã21 Ã22 Ã23 Ã24 −B̃2 F     0 0 à 0 0 33     0 0 0 Ã43 Ã44 LC̃1 0 LC̃2 0 Ã11 − B̃1 F − LC̃1 + eTjm First find a similarity transformation T that will put Pm in its Kalman canonical form, therefore we would have:     −1  Am Bm T 0 T 0 = 0 I 0 I Cm Dm   m Ã11 0 Ãm 0 B̃1m 13 m m m m   Ãm (22)  21 Ã22 Ã23 Ã24 B̃2  m ,  0 0 à 0 0 33    0 0  0 Ãm Ãm (21) Proof: Our proof is in a constructive manner, we will first find a K ′ to only stabilize the controllable and observable modes of Pm without considering (21). We will then show that (21) is not satisfied only on a set with zero measure, and thus almost any small perturbation in the specific elements of K ′ will satisfy (21). Apply another similarity transformation T1 , which keeps first four rows the same and subtract the first row from fifth, then we have:  eig (ACL (Pm , K ′ )) = eig T1 ACL (Pm , K ′ )T1−1 = eig  Ã11 − B̃1 F 0 Ã13 0 −B̃1 F  Ã21 − B̃2 F Ã22 à − B̃2 F à 24 23   0 0 Ã33 0 0   0 Ã44 0 0 Ã43 0 0 LC̃2 − Ã13 0 Ã11 − LC̃1 Thus the eigenvalue of the closed loop would be the the       eig (ACL (Pm , K ′ )) =   S     4 eig Ã11 − B̃1 F ∪ eig Ã11 − LC̃1 ∪ eig Ãii i=2 Therefore for all observer-based controllers that naturally    − satisfy eig Ã11 − B̃1 F ∈ C and eig Ã11 − LC̃1 ∈ C− ; unstable modes of Γ(Pm , K ′ ) would be independent of F and L, i.e.: eig+ ((Γ(Pm , K ′ )) = 4 [ eig+ (Ãii ), (23) i=2 and all unstable modes in Ã11 can be stabilized by appropriate choice of matrices F and L. We will now show that (21) is not met on a set with zero 10 measure in the ambient space of L. Replacing (23) in (21) yield that constraint (21) is met if and only if: ! 4 \ [ ′ eig+ (Ãii ) = ∅, (24) eig+ (K ) i=2 and if not, we enforce (21) by appropriately perturbing the L matrix. Construct the perturbed controller K̂ ′ by replacing L in K ′ with L̂ = L + Lǫ , i.e.:   Â′ L̂ ′ K̂ , , −F 0 with Â′ , Ã11 − B̃1 F − L̂C̃1 + L̂Dm F . We want to show that K̂ ′ satisfies (24) for almost any Lǫ . To see this, first define W as:   A′ I . W , −C̃1 + Dm F 0 It is also straightforward to verify that ACL (W, Lǫ ) = Â′ . We want to apply Remark 6 on W to show that almost any perturbation Lǫ moves all the unstable open-loop modes of W (which is equivalent to the unstable modes of K ′ as eig (W ) = eig (K ′ )). This would be achieved by showing that non of the unstable modes of W would be a fixed one, precisely: ACL (W, −L) = Ã11 − B̃1 F ⇒ Λ (W, Sc , T s ) ⊆ eig Ã11 − B̃1 F  ν(Γ(P, Km )) ≤ ν(P ) − 1, (25) = ∅. (26) Proof: Use Theorem 16 to find DK and m, use Proposition 17 to find K ′ , and construct the MIMO controller Km , D|(m−1) + eim K ′ eTjm . As illustrated in Figure 4, this Km has the following state-space representation:  K    K A′ B ′ eTjm Am Bm Km = = , (27) K K Cm Dm DK eim C ′ and clearly satisfies: ′ ACL (Pm , K ) = ACL (P, Km ). G(k+1) y G(k) + u (k) Km (k) perturbation Lǫ will make K̂ ′ satisfy (21) while still keeping Ã11 − L̂C̃1 stable. We will encapsulate the desired properties of the intermediate controller at each step that partially stablizes the plant in the following corollary, which combines Theorem 16 and Proposition 17. Corollary 18: For every plant P that satisfies the assumptions of Theorem 16, there exists an m ∈ {1, · · · , a} and a controller Km ∈ S ∩ Tis+1 such that: m ,jm eig+ (Km ) ∩ (k) ) α∈Λ∼ + (G ⊂ C− , as F is  stabilize Ã11 . Moreover, given  chosen to ⊂ C− , if we chose Lǫ sufthat eig Ã11 − LC̃1 ficiently small, then  due to a continuity argument we have eig Ã11 − L̂C̃1 ⊂ C− . Thus any sufficiently small Λ∼ + (Γ(P, Km )) ν(P ) − 1, and thus (25) would be an immediate result of this property of K ′ combined with (28). Finally, (26) ′ ∼ ′ follows from (21) as AK m = A and Λ+ (Γ(Pm , K )) = ∼ Λ+ (Γ(P, Km )), due to (27) and (28). We use induction to prove that if all the fixed modes of P are in LHP, then we can stabilize P by dynamic controller. We will first define the following interconnection that will be useful in the induction. Let G(0) , P and at each step k, denote the transfer function from u to y, as illustrated (k) in Figure 5, by G(k+1) , i.e., G(k+1) = Γ(G(k) , Km ). Let (k) (k) (k) (k) (AG , BG , CG , DG ) be a state-space representation for (k) G , also denote the total number of unstable modes of G(k) by ν (k) : X µ(α, G(k) ). ν (k) , Fig. 5. Plant G(k+1) , Γ(G(k) , Km ). The induction will be in such a way that in each step k, (k) we will find an integer m(k) ∈ {1, · · · , a}, and a Km ∈ s+1 (k) Ti (k) ,j (k) ∩ S that when closed around G , will stabilize m m at least one unstable mode of G(k) , thus ν (k+1) ≤ ν (k) − 1. Then we will treat the corresponding G(k+1) as the new plant for which we want to stabilize the rest of remaining ν (k+1) unstable eigenvalues, thus in at most ν (0) steps, P will be stabilized. A crucial part of induction is that G(k+1) must have no fixed mode in closed RHP, this is not addressed in [1] and at this point it is directly claimed that Theorem 21 holds true. We will formalize this fact with the help of following lemma. It is enough to show that closing Km around P does not add any unstable fixed modes to Γ(P, Km ). Lemma 19: Assume that all the fixed modes of P are in LHP, i.e.: Λ (P, S, T s ) ⊂ C− , (29) also, assume that a controller Km is such that it satisfies (26), then we have: Λ (Γ(P, Km ), S, T s ) ⊂ C− . Proof: Proof is done by contradiction, we will first create the following set-up to state the idea. Let (AK , BK , CK , DK ) be a state-space representation for Km . We have: Λ (P, S, T s ) ⊆ Λ (Γ(P, Km ), S, T s ) , (28) Due to Theorem 16 and Proposition 17, K ′ will stabilize at least one unstable mode of P , hence we have ν(Γ(Pm , K ′ )) ≤ since the RHS is the set of fixed modes with respect to controllers in the form Km + S ∩ T s , whereas the LHS equals Λ P, S, T d (by Theorem 13), that is the set of fixed 11 modes with respect to controllers in S ∩ T d , which is a bigger set than Km ∈ S ∩ T d . Next, it is trivial to check that if we close −Km around Γ(P, Km ), then by applying a similarity transformation T2 , a state-space realization that does not omit non-minimal modes of Γ(Γ(P, Km ), −Km ) can be written as:     −1 T2 0 0 T2 Γ(Γ(P, Km ), −Km ) 0 I 0 I   AP BP CK 0 BP (30)   0 AK 0 0 , =  BK CP BK DP CK AK BK DP  CP DP CK 0 DP thus we have G(k) in Corollary 18, we can find a m(k) ∈ {1, · · · , a}, and (k) , that will stabilize at a controller Km ∈ S ∩ Tis+1 (0) ,j (0) m m (k) least one of unstable modes of G(k) . This Km satisfies (26) (with P replaced by G(k) ), and thus by Lemma 19, G(k+1) = (k) Γ(G(k) , Km ), would have all of its fixed modes in LHP, i.e.,  (k+1) Λ G , S, T s ∈ C− . This guarantees that we can proceed with the induction by taking k ← k + 1, as long as G(k) has any remaining unstable mode. Since at each step at least one unstable mode is stabilized, P would be stabilized in at most ν(P ) steps. The final K ∈ S ∩ T d that will stabilize P , is equal to the summation of controllers at each step, i.e.: (4) X (k) K(s) = Km (s). k eig (Γ(Γ(P, Km ), −Km )) = eig (AP ) ∪ eig (AK ) . Furthermore, due to (29), there exist a D ∈ T s ∩ S that will move all the unstable modes of AP . If we apply the same D on (30), due to the block-diagonal structure we have eig (ACL (Γ(Γ(P, Km ), −Km ), D)) = eig (ACL (P, D)) ∪ eig (AK ), which yields: Λ (Γ(P, Km ), S, T s ) ⊆ Λ (P, S, T s ) ∪ eig (AK ) . (31) Now we are ready to do the main contradiction part, assume that there exist an α ∈ Λ (Γ(P, Km ), S, T s ), with ℜ(α) ≥ 0, then α ∈ Λ (Γ(P, Km ), S, T s ) , ℜ(α) ≥ 0 (31) We can easily show that stability of all the fixed modes of P , Λ (P, S, T s ) ⊂ C− , is also a necessary condition for the existence of stabilizing controller: Theorem 21: A plant P is stabilizable by a controller K ∈ S ∩ T d , if and only if Λ (P, S, T s ) ⊂ C− . Proof: The sufficiency part is done in Theorem 20. For the necessity part note that static fixed modes can not be moved by the dynamic controller either (Theorem 13), i.e.: Λ (P, S, T s ) 6⊂ C−  Thm.13 ⇒ Λ P, S, T d 6⊂ C− bydef ⇒ ∄ K ∈Td ∩S s.t. ACL (P, K) ⊂ C− . α ∈ Λ (P, S, T s ) ∪ eig (AK ) (29) ⇒ α ∈ eig (AK ) (26) ⇒α∈ / eig (Γ(P, Km )) ⇒α∈ / Λ (Γ(P, Km ), S, T s ) thus we have achieved the desired contradiction. Constraint (26) in Corollary 18 ensures that the unstable modes be non-overlapping, and is one sufficient condition to prove Lemma 19. When this condition is not met for an arbitrary choice of the feedback/observer gain, one way to always make it feasible is by adding the perturbation Lǫ to the observer gain, which in turn might prevent exact pole placement. However, one can place the poles arbitrarily close to the desired locations by choosing Lǫ sufficiently small. Now we are ready to claim that if all the fixed modes of P are in the LHP, then we can stabilize P by a dynamic controller. This stabilizing controller would be a summation (k) of individual controllers Km , each obtained in one step of (k) the induction, where in each step k, Km would only have (k) s+1 one dynamic element (i.e., Km ∈ Ti (k) ,j (k) ∩ S, for some m m m(k) ∈ {1, · · · , a}). Theorem 20: For any FDLTI plant P , and any information structure S, if Λ (P, S, T s ) ⊂ C− , then there exist a controller K ∈ S ∩ T d that will stabilize P . Proof: Proof is done by induction. Take k ← 0 and let G(0) , P . As per assumption of this theorem, Λ G(0) , S, T s = Λ (P, S, T s ) ⊂ C− . At each induction step k, we would stabilize at least one of the unstable modes of G(k) by Corollary 18. Specifically, with P replaced by V. S YNTHESIS AND N UMERICAL E XAMPLE In this section we provide an explicit algorithm to stabilize a plant which has no unstable fixed modes, and run it on one numerical example to illustrate its implementation. Algorithm 1 is distilled from the steps taken in the paper to prove the main theorem, and thus can almost certainly be improved upon in several respects. In Algorithm 1, D is chosen randomly at each outerstep, and as stated in Remark 15, would be a valid choice with probability one. This D must be chosen small enough (kDk∞ < γ (k) ) such that the total number of unstable modes would not increase when each element of the sequence {D|(m) }am=1 is closed around G(k) . A prior knowledge of such an upper bound on D, denoted by γ (k) , is not available and is hard to attain. This leads us to consider the alternative approach of repeatedly making D smaller in a loop until Theorem 16.2 holds. This iterative scaling repeats itself when (21) is not met. In this case, as proof suggests, we perturb L(k) by L̂(k) . This perturbation must be chosen small enough that it (k) (k) will not make any modes of Ã11 −(L(k) + L̂(k) )C̃1 unstable. The upper bound on the perturbation L̂(k) is unknown, and thus, similar to the case for D, we iterate to make it small enough to meet the constraints. Remark 22: The intersection in the if-then section in Algorithm 1 would almost always result in a null set if interpreted with unlimited precision. However, choosing to replace the exact intersection with a proximity condition could possibly avoid very large feedback and observer gains. 12 Algorithm 1 Finding a controller K ∈ T d ∩ S to stabilize P Input: Plant P , information structure S Output: Controller K ∈ T d ∩ S that will stabilize P k ← 0, G(0) ← P , K(σ) ← 0 /* Repeat the outer loop until the plant is stabilized */ (k) while |Λ∼ )| ≥ 1 do + (G /* Select a static controller as in Rem. 15 */ Choose a random D ∈ T s ∩ S while ν(Γ(G(k) , D)) > ν(G(k) ) do D ← D/2 end while /* Find a controllable index as in Thm. 16 */ m(k) ← a (k) (k) while Λ∼ , D|(m(k) −1) )) ∩ Λ∼ ) = ∅ do + (Γ(G + (G (k) (k) m ←m −1 end while /* Form the SISO plant as in Fig. 4 */ (k) Gm(k) ← eTj (k) Γ(G(k) , D|(m(k) −1) )eim(k) m /* Stabilize the SISO plant as in Prop. 17 */ (k) Find a Kalman similarity transformation T (k) for Gm(k) (k) Name all the corresponding partitions by (˜·) (k) (k) Find a F (k) to stabilize Ã11 − B̃1 F (k) (k) (k) Find a L(k) to stabilize Ã11 − L(k) C̃1 /* Ensuring that constraint (26) holds */ (k) M (k) ← (I − D|(m(k) −1) DG )−1 (k) D̆(k) ← eTj (k) DG M (k) eim(k) m (k) (k) (k) if eig+ (Ã11 −  B̃1 F (k) + L(k) (D̆(k) F (k) − C̃1 )) ∩  4 S (k) eig+ (Ãii ) 6= ∅ then i=2 /* Perturb the observer gain if (26) does not hold */ (k) Choose a random Lǫ /* Make the perturbation sufficiently small not to have any new unstable mode */ (k) (k) (k) while |eig+ (Ã11 − (L(k) + Lǫ )C̃1 )| ≥ 1 do (k) (k) Lǫ ← Lǫ /2 end while (k) L(k) ← L(k) + Lǫ end if /* Construct the MIMO controller as in Cor. 18 */   (k) (k) (k) à +  11 − B̃1 F (k) T L ej (k)   (k) m K (k) ←  L(k) D̆(k) F (k) − C̃1  (k) −eim(k) F (k) K ←K +K G(k+1) ← Γ(G(k) , K (k) ) k ←k+1 end while return K D|(m(k) −1) Remark 23: We can replace C− throughout the paper with another open set of acceptable closed-loop eigenvalues, letting its complement replace C+ as the closed set of unacceptable closed-loop eigenvalues. The results of Section IV-A hold up to show that the fixed modes must not be in the unacceptable region, the results of Section IV-B hold up to show that if they are not, then all of the modes can be moved to the acceptable region, and Algorithm 1 can be applied to find a controller which achieves that objective. One can further define a smaller open set of desirable closed-loop eigenvalues into which all of the non-fixed modes can be moved by Algorithm 1, taking note of the possibility of fixed and non-fixed modes overlapping in the acceptable-yet-undesirable region, as mentioned in Section II. The following numerical example will use Algorithm 1 to stabilize the plant P . Example 24: Consider the following plant:  0 0  B= 0 1 0 A = diag(2, 3, 5, −1, −1)   0 3 0 2 4 0 0 1 0 0 1 0    0 2 0 5  C = 6 0 0 0 0 0 0 0 2 0 0 0 0 0 8 0 3 0 0 0 0 0 5 0  0 0  0  0 6 and D = 0. Let the information constraint for the controller be given by the admissible-to-be-nonzero indices: Adm(S) = {(1, 1), (3, 1), (4, 1), (5, 2), (1, 3), (3, 3), (4, 3), (5, 4), (5, 5)}. This plant has fixed mode Λ (P, S, T s ) = {−1}. If we follow Algorithm 1 to stabilize P , and choose our desired closed-loop modes of Γ(P, K) to be  T −0.5 −1 −1 −1.5 −2 −2.5 −3 −3.5 , this is achieved by the following resulting controller:   14.9224 −460.4053 −4.6620 0.7485  AK =  0.3742 −24.4429 22.9223 −763.8424 −25.4224   317.1161 27.4429 BK =  03×1 03×3  405.6193  T 3.9020 −71.6446  CK =  03×4 −7.4494   0.0854   0    DK =  0.4265 05×4  .   0.0936 0 An alternative approach is taken in [12], in which, at each step, a (possibly dynamic) stabilizing controller is applied at the next diagonal element of the controller, and it is shown that by adding stabilizing controllers at each step, the set of (possibly unstable) fixed modes are reduced, until the last step where the remaining fixed modes must be necessarily stable. Applying the method of [12] on this plant would result in a stabilizing controller of order 7, as compared to 3 here. An explanation could be that in [12], a (possibly dynamic) 13 stabilizing controller is applied at each of the elements, resulting in abundant of controller states, whereas in here, only for each unstable mode, a stabilizing controller (not necessarily of order 1) is needed. If we look at each of the nine SISO maps from uim to yjm in P , then the union of controllable and observable modes of all these SISO maps are {2, 5}, which does not contain the unstable mode 3. This shows that a static gain (the Dm−1 of Figure 4) might be necessary to assign some modes in decentralized settings, which is counter-intuitive compared to the centralized case where a stabilizing observer-based controller would have zero static gain. VI. C ONCLUSION We revisited, verified, and generalized classic work in the stabilizability of decentralized systems. We generalized the notion of fixed modes to arbitrary information structure, and provided a rigorous inductive proof that plant modes which cannot be moved by static LTI controllers with the prescribed structure cannot be moved by dynamic LTI controllers either. We addressed the placement of the modes which are not fixed, and showed that they can be moved to within a chosen accuracy of any desired pole locations, thus solidifying and generalizing the main result of [1]. Combining these results, we have shown that having all fixed modes in the LHP with respect to static LTI controllers of a given information structure is necessary and sufficient for stabilizability by dynamic LTI controllers with the same structure. We lastly presented an explicit algorithm for finding such a stabilizing decentralized controller. R EFERENCES [1] S.-H. Wang and E. J. Davison, “On the stabilization of decentralized control systems,” IEEE Transactions on Automatic Control, vol. 18, no. 5, pp. 473–478, 1973. [2] H. Kobayashi, H. Hanafusa, and T. Yoshikawa, “Controllability under decentralized information structure,” IEEE Transactions on Automatic Control, vol. 23, no. 2, pp. 182–188, 1978. [3] B. Anderson and J. Moore, “Time-varying feedback laws for decentralized control,” IEEE Transactions on Automatic Control, vol. 26, no. 5, pp. 1133–1139, 1981. [4] S.-H. Wang, “Stabilization of decentralized control systems via timevarying controllers,” IEEE Transactions on Automatic Control, vol. 27, no. 3, pp. 741–744, 1982. [5] Z. Gong and M. Aldeen, “Stabilization of decentralized control systems,” Journal of Mathematical Systems Estimation and Control, vol. 7, pp. 111–114, 1997. [6] V. Pichai, M. Sezer, and D. Šiljak, “A graph-theoretic characterization of structurally fixed modes,” Automatica, vol. 20, no. 2, pp. 247 – 250, 1984. [7] A. Alavian and M. C. Rotkowitz, “Fixed modes of decentralized systems with arbitrary information structure,” in Proc. Mathematical Theory of Networks and Systems, 2014, pp. 913–919. [8] ——, “Stabilizing decentralized systems with arbitrary information structure,” in Proc. IEEE Conference on Decision and Control, 2014, pp. 4032–4038. [9] R. E. Kalman, “Canonical structure of linear dynamical systems,” Proceedings of the National Academy of Sciences of the United States of America, vol. 48, no. 4, p. 596, 1962. [10] E. J. Davison and S.-H. Wang, “Properties of linear time-invariant multivariable systems subject to arbitrary output and state feedback,” IEEE Transactions on Automatic Control, vol. 18, no. 1, pp. 24–32, 1973. [11] D. Serre, Matrices: Theory and Applications, 2nd ed. Springer, 2010. [12] E. Davison and T. Chang, “Decentralized stabilization and pole assignment for general proper systems,” IEEE Transactions on Automatic Control, vol. 35, no. 6, pp. 652–664, Jun 1990.
3cs.SY
A remark on incoherent feedforward circuits as change detectors and feedback controllers Eduardo D. Sontag Rutgers Uninversity arXiv:1602.00162v1 [cs.SY] 30 Jan 2016 Abstract This note analyzes incoherent feedforward loops in signal processing and control. It studies the response properties of IFFL’s to exponentially growing inputs, both for a standard version of the IFFL and for a variation in which the output variable has a positive self-feedback term. It also considers a negative feedback configuration, using such a device as a controller. It uncovers a somewhat surprising phenomenon in which stabilization is only possible in disconnected regions of parameter space, as the controlled system’s growth rate is varied. 1 Introduction This note derives several theoretical results regarding the use of incoherent feedforward loops (IFFL’s) in signal processing and control. We will study the system: ẋ = −ax + bu u ẏ = c − δy x u̇ = (λ − κy)u (1a) (1b) (1c) as well as a modified system in which there is also an autocatalytic term in (1b): ẏ = c V yn u − δy + n x K + yn (1b’) which represents a positive feedback of the y variable on itself. The constants a, b, c, δ, κ, V, K are positive (but λ is allowed to be negative), dot indicates d/dt, n is typically an integer> 1 that represents molecular cooperativity, and the scalar functions of time x = x(t), y = y(t), and u = u(t) take positive values. (It is easy to verify that, for any positive initial conditions, solutions remain positive for all times.) Of course, setting V = 0 allows seeing (1b’) as a special case of (1b), but it is more interesting to treat the non-autocatalytic case by itself. We will separately study the first two equations (1ab) (or (1ab’) when there is an autocatalytic term), viewing u = u(t) as an external input to the IFFL described by (1ab) (or (1ab’)), and viewing y = y(t) as an output or response of the system. Later, we “close the loop” by letting u be described by (1c), thinking of it as a variable that is controlled by y through a negative feedback with gain κ, and which, conversely, feeds back into the IFFL through the x variable. In that context, we study the full system (1abc) (or (1ab’c)). The motivation for this work is the potential role that these motifs might play in immunology [3]. In that context, one might view the x variable as representing the level of activity of a regulatory inhibitory component (such as a population of Treg cells at a particular infection site or in a certain tumor microenvironment), y as the level of activity of an immune response component (such as cytotoxic T cells), and u as a population of pathogens or the volume of a tumor, which might grow exponentially (if λ > 0) in the absence of 1 immune action, but which is killed at a rate proportional to the immune response. The feedback into x and y represents the activation of both the response and of the regulatory mechanism in response to the infection or tumor. As remarked in [3], a very interesting feature of the IFFL controller is its capability of detecting change as well as the fact that the level of activity is proportional to the rate of growth of the input, which may account for tolerance of slow-growing infections and cancers as well as Weber-like logarithmic sensing and “fold change detection” of inputs. In an immunological context, autocatalytic feedback might be implemented by a cytokine-mediated recruiting of additional immune components, or by autocrine stimulation. This results in an excitable system, which allows y to “lock” into a high state of activity given a sufficiently rapid rate of change in its input. Changing the growth rate λ of the pathogen or tumor, while fixing all other parameters, results in elimination of u for small growth rates λ, and in proliferation as λ increases. This is, of course, obvious. However, and very surprisingly, it may happen in this model that further increase of the growth rate λ, that is, when presented with a more aggressive pathogen or tumor, leads to the eventual elimination of the pathogen or tumor. This might be intuitively interpreted as a higher growth rate triggering locking of the immune response at a higher value. An even larger increase in λ leads again to proliferation. In other words, the pattern “elimination, proliferation, elimination, proliferation” can be obtained simply by gradually increasing λ. Remark 1.1 In the system (1abc), and in particular in the system (1ab), one may assume without loss of generality that a = b = c = 1. This is because we may eliminate these parameters by rescaling variables. Indeed, substituting x= b ∗ c 1 δ λ cκ x , y = y ∗ , t = t∗ , δ ∗ = , λ ∗ = , κ ∗ = , a b a a a ab (2) into system (1abc), one obtains: dx∗ dt∗ dy ∗ dt∗ du dt∗ = −x∗ + u = u − δ∗y∗ x∗ = (λ − κy ∗ )u (3a) (3b) (3c) 2 2 IFFL’s responses to various classes of inputs Let us consider the system (1ab), a differentiable function u = u(t) viewed as an external input or forcing function, and any (positive) solution (x(t), y(t)) corresponding to this input. We are interested first in understanding how the growth rate of the input affects the asymptotic values of the output variable y. We denote the derivative of ln u(t) with respect to t as follows: v(t) := u̇(t) u(t) and its limsup and liminf as t → ∞ µ = lim inf v(t) , µ = lim sup v(t) . t→∞ t→∞ We assume that v is bounded, and thus both of these numbers are finite. We also introduce the following function: u(t) p(t) := . x(t) 2 Since ṗ = u̇/x − uẋ/x2 = (u/x)[u̇/u − ẋ/x] = (u/x)[u̇/u − (−ax + bu)/x] = (u/x)[u̇/u + a − bu/x] , we have that p satisfies the following ODE with input v: ṗ = p(a + v − bp) . (4) Lemma 2.1 Let u be a differentiable input to system (1ab) with a = b = c = 1. With the above notations, max{0, 1 + µ} ≤ lim inf p(t) ≤ lim sup p(t) ≤ max{0, 1 + µ} t→∞ (5) t→∞ Proof. Since a = b = c = 1, ṗ = p(1 + v − p) . To prove the upper bound, we consider two cases, 1 + µ < 0 and 1 + µ ≥ 0. In the first case, let ε := −(1 + µ) > 0; the definition of µ gives that, for some T ≥ 0, 1 + v(t) < −ε/2 for all t ≥ T . It follows that ṗ ≤ p(−ε/2 − p) for all t ≥ T . Thus, ṗ < 0 whenever p > 0, from which it follows that lim supt→∞ p(t) = limt→∞ p(t) = 0. Suppose now that 1 + µ ≥ 0. Pick any ε > 0 and a T = T (ε) ≥ 0 such that v(t) ≤ µ + ε for all t ≥ T . For such t, ṗ = p(1 + v − p) ≤ p(1 + µ + ε − p). This implies that ṗ < 0 whenever p(t) > 1 + µ + ε, which implies that lim supt→∞ p(t) ≤ 1 + µ + ε. Letting ε → 0, we conclude that lim supt→∞ p(t) ≤ 1 + µ. We next prove the lower bound. Pick any ε > 0 and a T = T (ε) ≥ 0 such that v(t) ≥ µ − ε for all t ≥ T . Thus ṗ = p(1 + v − p) ≥ p(1 + µ − ε − p) for all t ≥ T . This implies that ṗ > 0 whenever p(t) < 1 + µ − ε (recall that p(t) > 0 for all t, since by assumption u(t) > 0 and x(t) > 0 for all t). Therefore lim inf t→∞ p(t) ≥ 1 + µ − ε, and letting ε → 0 we have lim inf t→∞ p(t) ≥ 1 + µ. Since p(t) ≥ 0 for all t, we also have lim inf t→∞ p(t) ≥ max{0, 1 + µ}. This completes the proof. In particular, if v(t) → µ as t → ∞ then µ = µ = µ, so we have as follows. Corollary 2.2 If v(t) → µ as t → ∞ then lim p(t) = max{0, 1 + µ}. t→∞ 2 For the original system (1ab), we have as follows. Proposition 2.3 Consider a solution of (1ab), with a differentiable u(t) > 0 as input and x(t) > 0, y(t) > 0. Assuming that v = u̇/u is bounded, we have:  c c max 0, a + µ ≤ lim inf y(t) ≤ lim sup y(t) ≤ max {0, a + µ} (6) t→∞ bδ bδ t→∞ Proof. We first assume that a=b=c=1. Let p := lim inf t→∞ p(t) and p := lim supt→∞ p(t). Equation (1b) can be written as ẏ = p − δy. This is a linear system forced by the input p = p(t). Pick any ε > 0. Then there is some T = T (ε) such that p − ε < p(t) < p + ε for all t ≥ T . For such t, ẏ(t) > 0 whenever y(t) < (1/δ)(p − ε) and ẏ(t) < 0 whenever y(t) > (1/δ)(sup +ε). It follows that (1/δ)(p − ε) ≤ y(t) ≤ (1/δ)(p + ε) for all t ≥ T . Letting ε → 0 we conclude that p/δ ≤ lim inf y(t) ≤ lim sup y(t) ≤ p/δ t→∞ (7) t→∞ and the inequalities (6) follow when a=b=c=1. To deal with general parameters, we recall that (2ab) are obtained with x = ab x∗ , y = cb y ∗ , t = a1 t∗ , and δ ∗ = aδ . Note that t∗ → ∞ if and only if t → ∞. Thus (7) holds for p∗ = u/x∗ = (b/a)p, y ∗ , and δ ? in place of p, y, and δ. Similarly, (5) holds for p∗ = u/x∗ and µ∗ = lim inf v ∗ (t∗ ) , µ = lim sup v ∗ (t∗ ) , t→∞ t→∞ 3 where v ∗ = du/dt∗ u = (1/a)v, so µ∗ = (1/a)µ and µ∗ = (1/a)µ. Therefore,  c ∗ ∗ c p∗ c p∗ ac ∗ ac lim inf y(t) = lim inf y (t ) ≥ = = p = max 0, 1 + µ∗ t→∞ t∗ →∞ b b δ? b δ/a bδ bδ =  c max a + µ . bδ A similar remark applies to lim sup, and the result follows. Corollary 2.4 If v(t) → µ as t → ∞ then lim y(t) = t→∞ c max{0, a + µ}. bδ 2 Three particular cases are: • When u(t) has sub-exponential growth, meaning that d ln u/dt ≤ 0, then lim sup y(t) ≤ t→∞ ac . bδ ac • In particular, if u(t) = α + βt is linear, then µ = 0 and thus lim y(t) = . t→∞ bδ c • If u(t) = βeµt is exponential, then lim y(t) = max{0, a + µ}. t→∞ bδ In conclusion, when u is constant, or even with linear growth, the value of the output y(t) converges to a constant, which does not depend on the actual constant value, or even the growth rate, of the input. For constant inputs, this is called the “perfect adaptation” property. If, instead, u grows exponentially, then y(t) converges to a steady state value that is a linear function of the logarithmic growth rate. Remark 2.5 A possible alternative IFFL model is that in which y follows this equation: ẏ = cu − δxy . (8) instead of (1b). This model represents a different way of implementing the negative effect of x on y, through degradation instead of inhibition of production A reduction to a = b = c = 1 is again possible. Now the substitutions b c 1 bδ λ cκ x = x∗ , y = y ∗ , t = t∗ , δ ∗ = 2 , λ∗ = , κ∗ = 2 , (9) a a a a a a into (1a-8-1c) transform the system into: dx∗ dt∗ dy ∗ dt∗ du dt∗ = −x∗ + u (10a) = u − δ ∗ x∗ y ∗ (10b) = (λ∗ − κ∗ y ∗ )u (10c) Consider a model that uses (8) instead of equation (1b) and suppose that, for some γ > 0, u(t) ≥ γ > 0 for all t ≥ 0 (for example, u(t) = βeµt or u(t) = α + βt). Then (6) again holds, as does Corollary 2.4. This is because we one may rewrite ẏ = cu − cδy as ẏ = x(cu/x − δy), and, provided that, for some ξ > 0, x(t) > ξ > 0 for all t, solutions have the same asymptotic behavior as for (1b). On the other hand, from the fact that p(t) = u(t)/x(t) is bounded, we know that, for some γ 0 > 0, for all t, x(t) ≥ γ 0 u(t) > γ 0 γ > 0. 2 4 3 IFFL’s as feedback controllers c max{0, a + µ}. This t→∞ bδ holds both for (1ab) and for the combination (1a)-(8). Now suppose that, in turn, u(t) satisfies equation (1c), which means means that v(t) = λ − κy(t), and therefore µ = limt→∞ v(t) = λ − κȳ. This gives an implicit equation for the rate µ: As we remarked, in the case of exponential inputs u(t) = βeµt , lim y(t) = ȳ = µ = λ − κȳ = λ − cκ max{0, a + µ} . bδ (11) We now solve this equation. Suppose first that a + µ ≥ 0. In that case, a solution has to satisfy µ = λ − cκ bδ (a + µ) and therefore there is a unique µ ≥ −a that solves the equation, namely: µ = λbδ − cκa . bδ + cκ (12) Observe that µ ≥ −a implies that λbδ − cκa ≥ (−a)(bδ + cκ) = −abδ − acκ and therefore λbδ ≥ −abδ, or λ ≥ −a. (And conversely, λ ≥ −a implies λbδ ≥ −abδ and so λbδ − cκa ≥ −abδ − cκa and hence µ ≥ −a.) So, if λ < −a, there is no such solution. Now we look for a solution with a + µ ≤ 0. Such an µ must satisfy µ = λ − 0 = λ. In summary, when λ < −a, the unique solution of (11) is (12), and when λ ≥ −a it is µ = λ. Note that when caκ > bδλ (13) (which happens automatically when λ < 0) the formula (12) gives that m < 0, that is, u(t) → 0 as t → +∞. Conversely, if caκ < bδλ, then µ > 0 and so u(t) → ∞ as t → +∞. Qualitatively, this makes sense: a large feedback gain κ, or a small growth rate λ in the absence of feedback, leads to the asymptotic vanishing of the u variable. In addition, from the formula ȳ = bδc max{0, a + µ} we conclude the following piecewise linear formula for the dependence of the limit of the output on the parameter λ that gives the growth rate of u when there is no feedback:   0 if λ < −a ȳ = (14) c(a + λ)  if λ ≥ −a . bδ + cκ These considerations provide helpful intuition about the closed-loop system, but they do not prove that (13) is necessary and sufficient for stability, nor do they show the validity of (14) for the closed-loop system. The reason that the argument is incomplete is that there is no a priori reason for u(t) to have the exponential form u(t) = βeµt . We next provide a rigorous argument. 3.1 Analysis of the closed-loop system Theorem 1 Suppose that (x(t), y(t), u(t) is a (positive) solution of (1abc), and define v(t) := u̇(t)/u(t) = λ − κy(t) , p(t) := u(t)/x(t) , ȳ by formula (14), which we repeat here:   0 ȳ = c(a + λ)  bδ + cκ 5 if a + λ < 0 if a + λ ≥ 0 p̄ := (δ/c)ȳ. and v̄ =   λ if a + λ < 0 c(a + λ)  λ−κ bδ + cκ if a + λ ≥ 0 . Then: lim y(t) = ȳ t→∞ lim p(t) = p̄ t→∞ lim v(t) = v̄ .  0 lim u(t) = t→∞ ∞ t→∞ if acκ > bδλ if acκ < bδλ . Proof. Substituting v(t) = λ − κy(t) into (4), we have the surprising and very useful fact that there is a closed system of just two differential equations for p and y: ṗ = p(a + λ − κy − bp) (15a) ẏ = cp − δy . (15b) (This system could be viewed as a non-standard predator-prey of system, where y behaves as a predator and p as a prey.) In all of the real plane, there are two equilibria of this system, one at p = y = 0 and the other c(a+λ) at p = δ(a+λ) bδ+cκ , y = bδ+cκ . The second equilibrium point is in the interior of first quadrant if and only if a + λ > 0. We start by evaluating the Jacobian matrix of the linearized system. This is:   a + λ − κy − 2bp −pκ J= c −δ which, when evaluated at p = y = 0, has determinant −δ(a + λ) and trace a + λ − δ, and when evaluated at (p̄, ȳ) has trace −bδ(a + λ) −δ cκ + bδ and determinant δ(a + λ). Thus, when a + λ > 0, the trace is negative and the determinant is positive, so the equilibrium (p̄, ȳ) is stable, and (0, 0) is a saddle because the determinant of the Jacobian is negative at that point. When instead a + λ ≤ 0, the only equilibrium with non-negative coordinates is (0, 0), and the determinant of the Jacobian is positive there, while the trace is negative, so this equilibrium is stable. We note that, in general, if have shown that there is a limit v(t) → v̄ as t → ∞ then u(t) → 0 as t → ∞ if v̄ < 0 and u(t) → ∞ as t → ∞ if v̄ > 0 Indeed, in the first case there is some T ≥ 0 so that for t ≥ T , v = u̇/u < v̄/2, meaning that d(e−v̄t/2 u(t))/dt ≤ 0, and hence e−v̄t/2 u(t) ≤ e−v̄T /2 u(T ), so u(t) ≤ ev̄(t−T )/2 u(T ) → 0 (since v̄ < 0). Similarly, in the second case we use that there is some T ≥ 0 so that for t ≥ T , v = u̇/u > v̄/2, meaning that d(e−v̄t/2 u(t))/dt ≥ 0, and hence e−v̄t/2 u(t) ≥ e−v̄T /2 u(T ), so u(t) ≥ ev̄(t−T )/2 u(T ) → ∞ (since v̄ > 0). Consider first the case a + λ ≤ 0. Then ṗ = p(a + λ − κy − bp) ≤ p(−κy − bp) < 0 for all p > 0, and therefore p(t) → p̄ = 0 as t → ∞. We may now view the linear system ẏ = cp − δy as a onedimensional system with input p(t) → 0, which implies that also y(t) → ȳ = 0. In turn, this implies that v = λ − κy → v̄ = λ < 0. By the general fact proved earlier about limits for u(t), we know that u(t) → 0 as t → ∞. This completes the proof when a + λ ≤ 0. So we assume from now on that a + λ > 0. We will show that, in this case, all solutions with p(t) > 0 and y(t) > 0 globally converge to the unique equilibrium (p̄, ȳ). Once that this is proved, it will follow that 6 v(t) → v̄ = λ − κȳ. Now, this value of v̄, for ȳ picked as in (14) (case a + λ ≥ 0), coincides with µ in (12), λbδ−cκa bδ+cκ . So v̄ < 0 if cκa > λbδ and v̄ > 0 if λbδ > cκa, and this provides the limit statement for u(t), completing the proof. We next show global convergence. A sketch of nullclines (see Fig. 1 for a numerical example) makes convergence clear, and helps guide the proof. Consider any P ≥ (a + λ)/b and any Y ≥ cP/δ and the rectangle [0, P ] × [0, Y ] (see Fig. 1). On the sides of this rectangle, the following properties hold: Figure 1: Phase plane for (15), with several representative trajectories plotted. Nullclines are the y axis, corresponding to the stable manifold of (0, 0), and the lines given by y = (a + λ − bp)/κ (dashed red line) and y = cp/δ (dashed magenta line). In this plot, we picked a = b = c = λ = δ = 1 and κ = 2, but the qualitative picture is similar for all valid parameter values. With these values, trajectories converge to the equilibrium (p̄, ȳ) = (2/3, 2/3). Shown also is an invariant region [0, P ] × [0, Y ] with P = Y = 2.5 (green dash-dotted lines and axes). 1. On the set {0} × (0, Y ), ṗ ≥ 0, because ṗ = 0. 2. On the set {P } × (0, Y ), ṗ ≤ 0, because ṗ = p(a + λ − bP ) ≤ 0, by the choice of P . 3. On the set (0, P ) × {0}, ẏ ≥ 0, because ẏ = cp > 0. 4. On the set (0, P ) × {Y }, ẏ ≤ 0. because ẏ = cp − δY ≤ cP − δY ≤ 0 by the choice of Y . 5. At the corner point (0, 0), ṗ ≥ 0, ẏ ≥ 0, because ṗ = ẏ = 0. 6. At the corner point (0, Y ), ṗ ≥ 0, ẏ ≤ 0, because ṗ = 0, ẏ = −δY < 0. 7. At the corner point (P, 0), ṗ ≤ 0, ẏ ≥ 0, because ṗ = p(a + λ − bP ) ≤ 0, ẏ = cP > 0. 7 8. At the corner point (P, Y ), ṗ ≤ 0, ẏ ≤ 0, because ṗ = p(a + λ − bP − κY ) < p(a + λ − bP ) ≤ 0, ẏ = cP − κy ≥ 0. These properties imply that the vector field points inside the set at every boundary point and therefore it is forward-invariant, meaning that every trajectory that starts in this set remains there for all positive times [1]. The rest of the proof of stability uses the Poincaré-Bendixson Theorem together with the Dulac-Bendixson criterion. Note that, for any initial condition ξ = (p(0), y(0)) one can always pick a large enough value of P and Y so that (p(0), y(0)) ∈ [0, P ] × [0, Y ]. The invariance property guarantees that the omega limit set ω + (ξ) is a nonempty compact connected set, and the Poincaré-Bendixson Theorem insures that such a set is one of the following: (a) the equilibrium (0, 0), (b) a periodic orbit in the interior of the square, or (c) the equilibrium (p̄, ȳ) [2]. Note that a homoclinic orbit around (0, 0) cannot exist, because the unstable manifold of this equilibrium is the entire y axis. For the same reason, if ξ has positive coordinates, ω + (ξ) 6= (0, 0). Therefore, all that we need to do is rule out periodic orbits. Consider the function ϕ(p, y) = 1/p. The divergence of the vector field !   1 a + λ − κy − bp p (p(a + λ − κy − bp)) = 1 c − δy/p p (cp − δy) + ∂c−δy is ∂a+λ−κy−bp ∂p ∂y = −b − δ/p, which has a constant sign (negative). The Dulac-Bendixson criterion [2] then guarantees that no periodic orbits can exist, and the proof is complete. 4 Adding positive feedback We now study a model in which there is an additional autocatalytic positive feedback on y variable. We first consider the open loop system (1ab’), and then discuss the full feedback system (1ab’c), which we repeat here for convenience: ẋ = −ax + bu u V yn ẏ = c − δy + n x K + yn u̇ = (λ − κy)u 4.1 (16a) (16b) (16c) Open-loop system with autocatalysis We first consider only the open-loop system (16ab), in which u = u(t) is seen as an input function (stimulus) and y as an output (response). For appropriate parameters, and assuming that the Hill exponent (cooperativity index) n is greater than one, the system V yn ẏ = q − δy + n (17) K + yn admits more than one steady state. (In contrast, if there is no autocatalytic feedback, V = 0, then there is a unique steady state, ȳ = q/δ.) Let us fix all parameters except q, which we temporarily view as a bifurcation parameter. Adjusting the value of q, one may obtain a low steady state, multiple steady states, or a higher steady state. As an illustration, pick a = b = c = 1, δ = 3, n = 2, V = 10, and K = 2. Fig, 2 shows the right-hand side of (17) plotted for q = 0.8 and q = 1.1. For the latter value of q, there is larger steady state. (Intermediate values typically give a system with two stable states and one unstable state.) Let us now write q(t) = c u(t) x(t) in the system (16ab). Suppose that we consider an input u which has a step increase at time t = 0, from u(t) = u− for t < 0 to u(t) = u+ for t ≥ 0. Suppose also that 8 n y Figure 2: Plots of f (y) = q − δy + KVn +y n , with a = b = c = 1, δ = 3, n = 2, V = 10, and K = 2, comparing q = 0.8 (brown) and q = 1.1 (blue). The steady state changes from a low to a high value. x(0) = x0 = (b/a)u− , that is, that the system at time t = 0 has an internal steady state preadapted to u− . Since x(t) is a continuous function of time, we have that, for small times t > 0, x(t) ≈ x0 and u(t) = u0 , and thus q(t) ≈ αu+ /u− , where α = ac/b. This means that the value of q(t) for 0 ≤ t  1 is proportional to the “fold change” in the input. On the other hand, as t → ∞, x(t) → b/a, so q(t) → ac/b = α. In the system with no autocatalytic effect (V = 0), the differential equation ẏ = q − δy has a unique globally asymptotically stable equilibrium, and therefore y(t) → q/δ = α/δ. That is to say, there is complete adaptation: after a step increase in the input u, y responds in a way that transiently depends on the fold change, but it eventually returns to its adapted value. On the other hand, if there is an autocatalytic feedback term (V 6= 0), the initial input q(t) to the y-subsystem may trigger an irreversible transition to a different state y than the adapted value. Since the initial value of q(t) depends on the fold change of the input, this implies that for different ranges of fold-change magnitudes, y might switch to different states, and remain there even after the excitation goes away. As an example, using the same parameters a = b = c = 1, δ = 3, n = 2, V = 10, and K = 2 as earlier, Fig, 3 shows how a step change in the input can result in an irreversible locking to a higher activation state, for the system with feedback, compared with the system without feedback, which does not switch but has only a transient change in activity. Figure 3: Response to an input stepping from u=1 to u=2 (fold change of input is 2). Comparing system with no positive feedback to system with positive feedback. State x(t) is the same in both systems, so only one panel is shown. Parameters are a = b = c = 1, δ = 3, n = 2, V = 10, and K = 2 in system with feedback, substituting V = 0 in system without feedback. 4.2 Closed-loop system with autocatalysis We now turn to the full feedback system (16abc). Just as in the case in which there was no autocatalytic terms, we may again reduce to a two-dimensional system written in terms of p = u/x and y. The system is now: ṗ = p(a + λ − κy − bp) V yn ẏ = cp − δy + n . K + yn 9 (18a) (18b) For appropriate parameter regimes, there is a unique positive steady state √ (p̄, ȳ). Specifically, for n > 1 the V yn n−1 1/n derivative of K n +yn attains its maximum at y = ( n+1 ) K = K/ 3 when n = 2, and the derivative is √ 3V 3 8K there. Thus, the function  g(y) = a + λ − κy − (b/c) δy − V yn K n + yn  , √ whose roots determine the nonzero equilibrium values of y, has derivative ≤ −κ − bδ/c + 3V8K 3 . Thus, when √ 3V 3 < κ + bδ/c 8K the function g is strictly decreasing and therefore (in the nontrivial case a + λ > 0), since g(0) > 0 and g(y) → −∞ as y → ∞, there is a unique zero ȳ. See for example the phase plane drawn in Fig. 4. Figure 4: Phase-plane for system (18), with a = 0.8, b = 1, c = 0.1, δ = 1, n = 2, V = 1.95, K = 1, yn κ = 20 λ = 25. The y-nullcline is cp − δy + KVn +y n = 0 (dot-dashed orange). The p-nullcline has two components: p = 0 (the y-axis) and the line y = (a + λ − bp)/κ (dashed red). Three representative trajectories are shown (solid blue). Notice the vertical-looking motion of one trajectory near the y-axis: along such solutions, p(t) = u(t)/x(t) stays ≈ 0 for a time interval, after which this ratio converges to p̄. Gray arrows indicate directions of movement in phase plane. The equilibrium point (p̄, ȳ) is such that p < 0.8 and thus, since u̇ = (λ−κy)u, u(t) behaves like αeµt for large t, where µ = λ−κȳ = bp−a = p−0.8, we have µ < 0 (elimination). A remarkable feature emerges for this system. When does u(t) → 0 as t → ∞, corresponding to elimination of a pathogen or tumor, in the motivating context of immunology? When does u(t) → ∞ as t → ∞, corresponding to proliferation? Note that, if (p(t), y(t)) → (p̄, ȳ) as t → ∞, then, since u̇ = (λ − κy)u, u(t) behaves like αeµt for large t. On the other hand, at steady state a + λ − κȳ − bp̄ = 0, which means that µ − λ − κȳ = bp̄ − a. Therefore: a ⇒ u(t) → 0 as t → ∞ p̄ < b a p̄ > ⇒ u(t) → ∞ as t → ∞ . b 10 Note that (p̄, ȳ) is a positive equilibrium if and only if bp̄ = a + λ − κȳ and cp̄ = −f (ȳ). To find equilibria, we can first solve a + λ − κȳ = −(b/c)f (ȳ) for ȳ, and then obtain p̄ simply as (1/b)(a + λ − κȳ). Note that µ = λ − κȳ < 0 is equivalent to p̄ > a/b, or −(1/c)f (ȳ) > a/b, and µ = λ − κȳ < 0 is equivalent to p̄ < a/b, or −(1/c)f (ȳ) < a/b. Therefore, leaving all other parameters constant, µ switches sign whenever f (ȳ) = −ac/b. The formula λ = κȳ − (b/c)f (ȳ) − a gives those values of λ where there is change from µ < 0 (which means u(t) → 0 as t → ∞) to µ > 0 (u(t) → ∞ as t → ∞), or viceversa. As λ increases, we may expect several such switches, as may be seen graphically as one draws parallel nullclines corresponding to different values of λ. For the example in Fig. 4, several of these are shown in Fig. 5. Simulations confirm these phase planes, see Fig. 6. The heatmap Figure 5: Phase plane for system (18), with a = 0.8, b = 1, c = 0.1, δ = 1, n = 2, V = 1.95, K = 1, κ = 20, same parameters as in Fig. 4, but now with several values of λ. The y-nullcline is yn cp − δy + KVn +y n = 0 (dot-dashed orange). The p-nullcline has two components: one is p = 0 (the y-axis, dashed magenta) and the second component is the line y = (a + λ − bp)/κ which depends on the value of λ, and is shown for λ = 1 (green), λ = 5 (blue), λ = 15 (red), λ = 25 (magenta), and λ = 30 (black). Gray arrows indicate directions of movement in phase plane for λ = 25. Observe that the equilibrium point (p̄, ȳ) is such that p < 0.8 for λ = 1, p > 0.8 for λ = 5, p < 0.8 for λ = 15 and λ = 25, and p > 0.8 for λ = 30. Since u̇ = (λ − κy)u, u(t) behaves like αeµt for large t, where µ = λ − κȳ = bp − a = p − 0.8, these growth rates λ corresponds respectively to µ < 0 (elimination), µ < 0 (proliferation), again µ < 0 (elimination, two nullclines values shown), and yet again µ > 0 (proliferation). in Fig. 7 shows graphically how various combinations of λ and κ lead to growth or elimination, for these parameters. The ranges of growth rates λ for which each of the intermediate proliferation and elimination regimes can hold could be quite large. To illustrate how large these ranges could potentially be, consider the following parameters: b = 1, c = 0.1, κ = 20 K = 1, V = 2, δ = 1, and a = 0.1. There is then a more than three order of magnitude range of λ’s (from λ ≈ 0.004 to λ ≈ 17) for which u(t) → ∞, but a larger λ results in elimination of u (up to λ ≈ 27, after which again u(t) → ∞). As another example, letting a = 1.2, we 11 Figure 6: Simulations of system (18), with a = 0.8, b = 1, c = 0.1, δ = 1, n = 2, V = 1.95, K = 1, κ = 20, same parameters as in Fig. 4, but now with several values of λ. Initial states x(0) = y(0) = u(0) = 1. Left to right: λ = 1, 5, 15, 30. Asymptotic behavior of u(t) shown in bottom panel is as expected from Fig. 5. As the growth rate λ increases, we obtain elimination (for λ = 1), proliferation (λ = 5), elimination (λ = 15; plot for λ = 25 not shown but similar), and again proliferation (λ = 30) find that there is an over four-fold possible change in λ (from λ ≈ 1.4 to λ ≈ 6) that results in u(t) → ∞, followed by another over four-fold possible change in λ (from λ ≈ 6 to λ ≈ 28) that results in u(t) → 0 (after which again u(t) → ∞). 12 Figure 7: Values of the effective rate µ = λ − κȳ at steady state. Colors scale shown at bottom. Values are obtained by algebraically solving for a steady state (p̄, ȳ) in system (18) and then computing µ = λ − κȳ. Since u̇ = µu, it follows that u(t) behaves like αeµt for large t. Therefore µ < 0 corresponds to u(t) → 0 as t → ∞ and µ > 0 to u(t) → ∞ as t → ∞. Parameters are: V = 1.95, K = 1, δ = 1, a = 0.8, b = 1, c = 0.1, as in Fig. 4, but now showing the effect of varying both κ and λ. For κ = 20, as the growth rate λ increases from 0 to 30 (going down a column), we obtain elimination, proliferation, again elimination, and finally again proliferation 13 References [1] F.H. Clarke, Y.S. Ledyaev, R.S. Stern, and P.R. Wolenski. Nonsmooth Analysis and Control Theory (Graduate Texts in Mathematics. Springer-Verlag, New York, 1998. [2] M. W. Hirsch and S. Smale. Differential Equations, Dynamical Systems and Linear Algebra. Academic Press, 1974. [3] E.D. Sontag. Incoherent feedforward motifs as immune change detectors. Technical report, bioRxiv http://dx.doi.org/10.1101/035600, December 2015. 14
3cs.SY
arXiv:1603.08023v2 [cs.CL] 3 Jan 2017 How NOT To Evaluate Your Dialogue System: An Empirical Study of Unsupervised Evaluation Metrics for Dialogue Response Generation Chia-Wei Liu1∗, Ryan Lowe1∗ , Iulian V. Serban2∗ , Michael Noseworthy1∗ , Laurent Charlin1 , Joelle Pineau1 1 School of Computer Science, McGill University {chia-wei.liu,ryan.lowe,michael.noseworthy}@mail.mcgill.ca {lcharlin, jpineau}@cs.mcgill.ca 2 DIRO, Université de Montréal [email protected] Abstract We investigate evaluation metrics for dialogue response generation systems where supervised labels, such as task completion, are not available. Recent works in response generation have adopted metrics from machine translation to compare a model’s generated response to a single target response. We show that these metrics correlate very weakly with human judgements in the non-technical Twitter domain, and not at all in the technical Ubuntu domain. We provide quantitative and qualitative results highlighting specific weaknesses in existing metrics, and provide recommendations for future development of better automatic evaluation metrics for dialogue systems. 1 Introduction An important aspect of dialogue response generation systems, which are trained to produce a reasonable utterance given a conversational context, is how to evaluate the quality of the generated response. Typically, evaluation is done using human-generated supervised signals, such as a task completion test or a user satisfaction score (Walker et al., 1997; Möller et al., 2006; Kamm, 1995), which are relevant when the dialogue is task-focused. We call models optimized for such supervised objectives supervised dialogue models, while those that do not are unsupervised dialogue models. This paper focuses on unsupervised dialogue response generation models, such as chatbots. These ∗ Denotes equal contribution. models are receiving increased attention, particularly using end-to-end training with neural networks (Serban et al., 2016; Sordoni et al., 2015; Vinyals and Le, 2015). This avoids the need to collect supervised labels on a large scale, which can be prohibitively expensive. However, automatically evaluating the quality of these models remains an open question. Automatic evaluation metrics would help accelerate the deployment of unsupervised response generation systems. Faced with similar challenges, other natural language tasks have successfully developed automatic evaluation metrics. For example, BLEU (Papineni et al., 2002a) and METEOR (Banerjee and Lavie, 2005) are now standard for evaluating machine translation models, and ROUGE (Lin, 2004) is often used for automatic summarization. These metrics have recently been adopted by dialogue researchers (Ritter et al., 2011; Sordoni et al., 2015; Li et al., 2015; Galley et al., 2015b; Wen et al., 2015; Li et al., 2016). However these metrics assume that valid responses have significant word overlap with the ground truth responses. This is a strong assumption for dialogue systems, where there is significant diversity in the space of valid responses to a given context. This is illustrated in Table 1, where two reasonable responses are proposed to the context, but these responses do not share any words in common and do not have the same semantic meaning. In this paper, we investigate the correlation between the scores from several automatic evaluation metrics and human judgements of dialogue response quality, for a variety of response generation models. We consider both statistical word-overlap similar- Context of Conversation Speaker A: Hey John, what do you want to do tonight? Speaker B: Why don’t we go see a movie? Ground-Truth Response Nah, I hate that stuff, let’s do something active. Model Response Oh sure! Heard the film about Turing is out! Table 1: Example showing the intrinsic diversity of valid responses in a dialogue. The (reasonable) model response would receive a BLEU score of 0. ity metrics such as BLEU, METEOR, and ROUGE, and word embedding metrics derived from word embedding models such as Word2Vec (Mikolov et al., 2013). We find that all metrics show either weak or no correlation with human judgements, despite the fact that word overlap metrics have been used extensively in the literature for evaluating dialogue response models (see above, and Lasguido et al. (2014)). In particular, we show that these metrics have only a small positive correlation on the chitchat oriented Twitter dataset, and no correlation at all on the technical Ubuntu Dialogue Corpus. For the word embedding metrics, we show that this is true even though all metrics are able to significantly distinguish between baseline and state-of-the-art models across multiple datasets. We further highlight the shortcomings of these metrics using: a) a statistical analysis of our survey’s results; b) a qualitative analysis of examples from our data; and c) an exploration of the sensitivity of the metrics. Our results indicate that a shift must be made in the research community away from these metrics, and highlight the need for a new metric that correlates more strongly with human judgement. 2 Related Work We focus on metrics that are model-independent, i.e. where the model generating the response does not also evaluate its quality; thus, we do not consider word perplexity, although it has been used to evaluate unsupervised dialogue models (Serban et al., 2015). This is because it is not computed on a per-response basis, and cannot be computed for retrieval models. Further, we only consider metrics that can be used to evaluate proposed responses against ground-truth responses, so we do not consider retrieval-based metrics such as recall, which has been used to evaluate dialogue models (Schatzmann et al., 2005; Lowe et al., 2015). We also do not consider evaluation methods for supervised evaluation methods.1 Several recent works on unsupervised dialogue systems adopt the BLEU score for evaluation. Ritter et al. (2011) formulate the unsupervised learning problem as one of translating a context into a candidate response. They use a statistical machine translation (SMT) model to generate responses to various contexts using Twitter data, and show that it outperforms information retrieval baselines according to both BLEU and human evaluations. Sordoni et al. (2015) extend this idea using a recurrent language model to generate responses in a context-sensitive manner. They also evaluate using BLEU, however they produce multiple ground truth responses by retrieving 15 responses from elsewhere in the corpus, using a simple bag-of-words model. Li et al. (2015) evaluate their proposed diversity-promoting objective function for neural network models using BLEU score with only a single ground truth response. A modified version of BLEU, deltaBLEU (Galley et al., 2015b), which takes into account several humanevaluated ground truth responses, is shown to have a weak to moderate correlation to human judgements using Twitter dialogues. However, such human annotation is often infeasible to obtain in practice. Galley et al. (2015b) also show that, even with several ground truth responses available, the standard BLEU metric does not correlate strongly with human judgements. There has been significant previous work that evaluates how well automatic metrics correlate with human judgements in in both machine translation (Callison-Burch et al., 2010; Callison-Burch et al., 2011; Bojar et al., 2014; Graham et al., 2015) and natural language generation (NLG) (Stent et al., 2005; Cahill, 2009; Reiter and Belz, 2009; Espinosa et al., 2010). There has also been work criticizing the usefulness of BLEU in particular for machine translation (Callison-Burch et al., 2006). While many of the criticisms in these works apply to dialogue generation, we note that generating dialogue responses conditioned on the conversational 1 Evaluation methods in the supervised setting have been well studied, see (Walker et al., 1997; Möller et al., 2006; Jokinen and McTear, 2009). context is in fact a more difficult problem. This is because most of the difficulty in automatically evaluating language generation models lies in the large set of correct answers. Dialogue response generation given solely the context intuitively has a higher diversity (or entropy) than translation given text in a source language, or surface realization given some intermediate form (Artstein et al., 2009). 3 Evaluation Metrics Given a dialogue context and a proposed response, our goal is to automatically evaluate how appropriate the proposed response is to the conversation. We focus on metrics that compare it to the ground truth response of the conversation. In particular, we investigate two approaches: word based similarity metrics and word-embedding based similarity metrics. 3.1 Word Overlap-based Metrics We first consider metrics that evaluate the amount of word-overlap between the proposed response and the ground-truth response. We examine the BLEU and METEOR scores that have been used for machine translation, and the ROUGE score that has been used for automatic summarization. While these metrics have been shown to correlate with human judgements in their target domains (Papineni et al., 2002a; Lin, 2004), they have not been thoroughly investigated for dialogue systems.2 We denote the ground truth response as r (thus we assume that there is a single candidate ground truth response), and the proposed response as r̂. The j’th token in the ground truth response r is denoted by wj , with ŵj denoting the j’th token in the proposed response r̂. BLEU. BLEU (Papineni et al., 2002a) analyzes the co-occurrences of n-grams in the ground truth and the proposed responses. It first computes an n-gram precision for the whole dataset (we assume that there is a single candidate ground truth response 2 To the best of our knowledge, only BLEU has been evaluated in the dialogue system setting quantitatively by Galley et al. (2015a) on the Twitter domain. However, they carried out their experiments in a very different setting with multiple ground truth responses, which are rarely available in practice, and without providing any qualitative analysis of their results. per context): P Pn (r, r̂) = k min(h(k, r), h(k, r̂i )) P k h(k, ri ) where k indexes all possible n-grams of length n and h(k, r) is the number of n-grams k in r.3 To avoid the drawbacks of using a precision score, namely that it favours shorter (candidate) sentences, the authors introduce a brevity penalty. BLEU-N, where N is the maximum length of n-grams considered, is defined as: BLEU-N := b(r, r̂) exp( N X βn log Pn (r, r̂)) n=1 βn is a weighting that is usually uniform, and b(·) is the brevity penalty. The most commonly used version of BLEU uses N = 4. Modern versions of BLEU also use sentence-level smoothing, as the geometric mean often results in scores of 0 if there is no 4-gram overlap (Chen and Cherry, 2014). Note that BLEU is usually calculated at the corpus-level, and was originally designed for use with multiple reference sentences. METEOR. The METEOR metric (Banerjee and Lavie, 2005) was introduced to address several weaknesses in BLEU. It creates an explicit alignment between the candidate and target responses. The alignment is based on exact token matching, followed by WordNet synonyms, stemmed tokens, and then paraphrases. Given a set of alignments, the METEOR score is the harmonic mean of precision and recall between the proposed and ground truth sentence. ROUGE. ROUGE (Lin, 2004) is a set of evaluation metrics used for automatic summarization. We consider ROUGE-L, which is a F-measure based on the Longest Common Subsequence (LCS) between a candidate and target sentence. The LCS is a set of words which occur in two sentences in the same order; however, unlike n-grams the words do not have to be contiguous, i.e. there can be other words in between the words of the LCS. 3 Note that the min in this equation is calculating the number of co-occurrences of n-gram k between the ground truth response r and the proposed response r̂, as it computes the fewest appearances of k in either response. 3.2 Embedding-based Metrics An alternative to using word-overlap based metrics is to consider the meaning of each word as defined by a word embedding, which assigns a vector to each word. Methods such as Word2Vec (Mikolov et al., 2013) calculate these embeddings using distributional semantics; that is, they approximate the meaning of a word by considering how often it co-occurs with other words in the corpus.4 These embeddingbased metrics usually approximate sentence-level embeddings using some heuristic to combine the vectors of the individual words in the sentence. The sentence-level embeddings between the candidate and target response are compared using a measure such as cosine distance. Greedy Matching. Greedy matching is the one embedding-based metric that does not compute sentence-level embeddings. Instead, given two sequences r and r̂, each token w ∈ r is greedily matched with a token ŵ ∈ r̂ based on the cosine similarity of their word embeddings (ew ), and the total score is then averaged across all words: P w∈r; maxŵ∈r̂ cos sim(ew , eŵ ) G(r, r̂) = |r| G(r, r̂) + G(r̂, r) GM (r, r̂) = 2 This formula is asymmetric, thus we must average the greedy matching scores G in each direction. This was originally introduced for intelligent tutoring systems (Rus and Lintean, 2012). The greedy approach favours responses with key words that are semantically similar to those in the ground truth response. Embedding Average. The embedding average metric calculates sentence-level embeddings using additive composition, a method for computing the meanings of phrases by averaging the vector representations of their constituent words (Foltz et al., 1998; Landauer and Dumais, 1997; Mitchell and Lapata, 2008). This method has been widely used in other domains, for example in textual similarity 4 To maintain statistical independence between the task and each performance metric, it is important that the word embeddings used are trained on corpora which do not overlap with the task corpus. tasks (Wieting et al., 2015). The embedding average, ē, is defined as the mean of the word embeddings of each token in a sentence r: P ew ēr = P w∈r . | w0 ∈r ew0 | To compare a ground truth response r and retrieved response r̂, we compute the cosine similarity between their respective sentence level embeddings: EA := cos(ēr , ēr̂ ). Vector Extrema. Another way to calculate sentence-level embeddings is using vector extrema (Forgues et al., 2014). For each dimension of the word vectors, take the most extreme value amongst all word vectors in the sentence, and use that value in the sentence-level embedding:  maxw∈r ewd if ewd > | minw0 ∈r ew0 d | erd = minw∈r ewd otherwise where d indexes the dimensions of a vector; ewd is the d’th dimensions of ew (w’s embedding). The min in this equation refers to the selection of the largest negative value, if it has a greater magnitude than the largest positive value. Similarity between response vectors is again computed using cosine distance. Intuitively, this approach prioritizes informative words over common ones; words that appear in similar contexts will be close together in the vector space. Thus, common words are pulled towards the origin because they occur in various contexts, while words carrying important semantic information will lie further away. By taking the extrema along each dimension, we are thus more likely to ignore common words. 4 Dialogue Response Generation Models In order to determine the correlation between automatic metrics and human judgements of response quality, we obtain response from a diverse range of response generation models in the recent literature, including both retrieval and generative models. 4.1 Retrieval Models Ranking or retrieval models for dialogue systems are typically evaluated based on whether they can retrieve the correct response from a corpus of predefined responses, which includes the ground truth R-TFIDF C-TFIDF DE LSTM HRED Ubuntu Dialogue Corpus Embedding Greedy Vector Averaging Matching Extrema 0.536 ± 0.003 0.370 ± 0.002 0.342 ± 0.002 0.571 ± 0.003 0.373 ± 0.002 0.353 ± 0.002 0.650 ± 0.003 0.413 ± 0.002 0.376 ± 0.001 0.130 ± 0.003 0.097 ± 0.003 0.089 ± 0.002 0.580 ± 0.003 0.418 ± 0.003 0.384 ± 0.002 Embedding Averaging 0.483 ± 0.002 0.531 ± 0.002 0.597 ± 0.002 0.593 ± 0.002 0.599 ± 0.002 Twitter Corpus Greedy Matching 0.356 ± 0.001 0.362 ± 0.001 0.384 ± 0.001 0.439 ± 0.002 0.439 ± 0.002 Vector Extrema 0.340 ± 0.001 0.353 ± 0.001 0.365 ± 0.001 0.420 ± 0.002 0.422 ± 0.002 Table 2: Models evaluated using the vector-based evaluation metrics, with 95% confidence intervals. response to the conversation (Schatzmann et al., 2005). Such systems can be evaluated using recall or precision metrics. However, when deployed in a real setting these models will not have access to the correct response given an unseen conversation. Thus, in the results presented below we remove one occurrence of the ground-truth response from the corpus and ask the model to retrieve the most appropriate response from the remaining utterances. Note that this does not mean the correct response will not appear in the corpus at all; in particular, if there exists another context in the dataset with an identical ground-truth response, this will be available for selection by the model. We then evaluate each model by comparing the retrieved response to the ground truth response of the conversation. This closely imitates real-life deployment of these models, as it tests the ability of the model to generalize to unseen contexts. TF-IDF. We consider a simple Term Frequency - Inverse Document Frequency (TF-IDF) retrieval model (Lowe et al., 2015). TF-IDF is a statistic that intends to capture how important a given word is to some document, which is calculated as: N tfidf(w, c, C) = f (w, c) × log |{c∈C:w∈c}| , where C is the set of all contexts in the corpus, f (w, c) indicates the number of times word w appeared in context c, N is the total number of dialogues, and the denominator represents the number of dialogues in which the word w appears. In order to apply TF-IDF as a retrieval model for dialogue, we first compute the TF-IDF vectors for each context and response in the corpus. We then return the response with the largest cosine similarity in the corpus, either between the input context and corpus contexts (C-TFIDF), or between the input context and corpus responses (R-TFIDF). Dual Encoder. Next we consider the recurrent neural network (RNN) based architecture called the Dual Encoder (DE) model (Lowe et al., 2015). The DE model consists of two RNNs which respectively compute the vector representation of an input context and response, c, r ∈ Rn . The model then calculates the probability that the given response is the ground truth response given the context, by taking a weighted dot product: p(r is correct|c, r, M ) = σ(cT M r + b) where M is a matrix of learned parameters and b is a bias. The model is trained using negative sampling to minimize the cross-entropy error of all (context, response) pairs. To our knowledge, our application of neural network models to large-scale retrieval in dialogue systems is novel. BLEU-1 BLEU-2 Spearman 0.1580 0.2030 p-value 0.12 0.043 Pearson 0.2074 0.1300 p-value 0.038 0.20 Table 4: Correlation between BLEU metric and human judgements after removing stopwords and punctuation for the Twitter dataset. BLEU-1 BLEU-2 Average METEOR Human Mean score ∆w <= 6 ∆w >= 6 (n=47) (n=53) 0.1724 0.1009 0.0744 0.04176 0.6587 0.6246 0.2386 0.2073 2.66 2.57 p-value < 0.01 < 0.01 0.25 < 0.01 0.73 Table 5: Effect of differences in response length for the Twitter dataset, ∆w = absolute difference in #words between a ground truth response and proposed response 4.2 Generative Models In addition to retrieval models, we also consider generative models. In this context, we refer to a model Metric Greedy Average Extrema METEOR BLEU-1 BLEU-2 BLEU-3 BLEU-4 ROUGE Human Spearman 0.2119 0.2259 0.2103 0.1887 0.1665 0.3576 0.3423 0.3417 0.1235 0.9476 Twitter p-value Pearson 0.034 0.1994 0.024 0.1971 0.036 0.1842 0.06 0.1927 0.098 0.1288 < 0.01 0.3874 < 0.01 0.1443 < 0.01 0.1392 0.22 0.09714 < 0.01 1.0 p-value 0.047 0.049 0.067 0.055 0.2 < 0.01 0.15 0.17 0.34 0.0 Spearman 0.05276 -0.1387 0.09243 0.06314 -0.02552 0.03819 0.0878 0.1218 0.05405 0.9550 Ubuntu p-value Pearson 0.6 0.02049 0.17 -0.1631 0.36 -0.002903 0.53 0.1419 0.8 0.01929 0.71 0.0586 0.38 0.1116 0.23 0.1132 0.5933 0.06401 < 0.01 1.0 p-value 0.84 0.10 0.98 0.16 0.85 0.56 0.27 0.26 0.53 0.0 Table 3: Correlation between each metric and human judgements for each response. Correlations shown in the human row result from randomly dividing human judges into two groups. as generative if it is able to generate entirely new sentences that are unseen in the training set. LSTM language model. The baseline model is an LSTM language model (Hochreiter and Schmidhuber, 1997) trained to predict the next word in the (context, response) pair. During test time, the model is given a context, encodes it with the LSTM and generates a response using a greedy beam search procedure (Graves, 2013). HRED. Finally we consider the Hierarchical Recurrent Encoder-Decoder (HRED) (Serban et al., 2015). In the traditional Encoder-Decoder framework, all utterances in the context are concatenated together before encoding. Thus, information from previous utterances is far outweighed by the most recent utterance. The HRED model uses a hierarchy of encoders; each utterance in the context passes through an ‘utterance-level’ encoder, and the output of these encoders is passed through another ‘context-level’ encoder, which enables the handling of longer-term dependencies. 4.3 Conclusions from an Incomplete Analysis When evaluation metrics are not explicitly correlated to human judgement, it is possible to draw misleading conclusions by examining how the metrics rate different models. To illustrate this point, we compare the performance of selected models according to the embedding metrics on two different domains: the Ubuntu Dialogue Corpus (Lowe et al., 2015), which contains technical vocabulary and where conversations are often oriented towards solv- ing a particular problem, and a non-technical Twitter corpus collected following the procedure of Ritter et al. (2010). We consider these two datasets since they cover contrasting dialogue domains, i.e. technical help vs casual chit-chat, and because they are amongst the largest publicly available corpora, making them good candidates for building data-driven dialogue systems. Results on the proposed embedding metrics are shown in Table 2. For the retrieval models, we observe that the DE model significantly outperforms both TFIDF baselines on all metrics across both datasets. Further, the HRED model significantly outperforms the basic LSTM generative model in both domains, and appears to be of similar strength as the DE model. Based on these results, one might be tempted to conclude that there is some information being captured by these metrics, that significantly differentiates models of different quality. However, as we show in the next section, the embedding-based metrics correlate only weakly with human judgements on the Twitter corpus, and not at all on the Ubuntu Dialogue Corpus. This demonstrates that metrics that have not been specifically correlated with human judgements on a new task should not be used to evaluate that task. 5 Human Correlation Analysis Data Collection. We conducted a human survey to determine the correlation between human judgements on the quality of responses, and the score assigned by each metric. We aimed to follow the procedure for the evaluation of BLEU (Papineni et al., (a) Twitter (b) Ubuntu Figure 1: Scatter plots showing the correlation between metrics and human judgements on the Twitter corpus (a) and Ubuntu Dialogue Corpus (b). The plots represent BLEU-2 (left), embedding average (center), and correlation between two randomly selected halves of human respondents (right). 2002a). 25 volunteers from the Computer Science department at the author’s institution were given a context and one proposed response, and were asked to judge the response quality on a scale of 1 to 5.5 ; a 1 indicates that the response is not appropriate or sensible given the context, and a 5 indicates that the response is very reasonable. Out of the 25 respondents, 23 had Cohen’s kappa scores κ > 0.2 w.r.t. the other respondents, which is a standard measure for inter-rater agreement (Cohen, 1968). The 2 respondents with κ < 0.2, indicating slight agreement, were excluded from the analysis below. The median κ score was approximately 0.55, roughly indicating moderate to strong annotator agreement. Each volunteer was given 100 questions per dataset. These questions correspond to 20 unique contexts, with 5 different responses: one utterance 5 Studies asking humans to evaluate text often rate different aspects separately, such as ‘adequacy’, ‘fluency’ and ‘informativeness’ of the text (Hovy, 1999; Papineni et al., 2002b) Our evaluation focuses on adequacy. We did not consider fluency because 4 out of the 5 proposed responses to each context were generated by a human. We did not consider informativeness because in the domains considered, it is not necessarily important (in Twitter), or else it seems to correlate highly with adequacy (in Ubuntu). randomly drawn from elsewhere in the test set, the response selected from each of the TF-IDF, DE, and HRED models, and a response written by a human annotator. These were chosen as they cover the range of qualities almost uniformly (see Figure 1). Survey Results. We present correlation results between the human judgements and each metric in Table 3. We compute the Pearson correlation, which estimates linear correlation, and Spearman correlation, which estimates any monotonic correlation. The first observation is that in both domains the BLEU-4 score, which has previously been used to evaluate unsupervised dialogue systems, shows very weak if any correlation with human judgement. In fact we found that the BLEU-3 and BLEU-4 scores were near-zero for a majority of response pairs; for BLEU-4, only four examples had a score > 10−9 . Despite this, they still correlate with human judgements on the Twitter Corpus at a rate similar to BLEU-2. This is because of the smoothing constant, which gives a tiny weight to unigrams and bigrams despite the absence of higher-order n-grams. BLEU-3 and BLEU-4 behave as a scaled, noisy version of BLEU-2; thus, if one is to evaluate dialogue Context of Conversation A: dearest! question. how many thousands of people can panaad occupy? B: @user panaad has <number> k seat capacity while rizal has <number> k thats why they choose rizal i think . Ground Truth Response A: now i know about the siting capacity . thanks for the info @user great evening. Proposed Response A: @user makes sense. thanks! Context of Conversation A: never felt more sad than i am now B: @user aww why ? A: @user @user its a long story ! sure you wanna know it ? bahaha and thanks for caring btw <heart> Ground Truth Response A: @user i don ’t mind to hear it i ’ve got all day and youre welcome <number> Proposed Response A: @user i know , i ’m just so happy for you ! ! ! ! ! ! ! ! !!!!!!!!!!!!!!!!! Figure 2: Examples where the metrics rated the response poorly and humans rated it highly (left), and the converse (right). Both responses are given near-zero score by BLEU-N for N> 1. While no metric will perform perfectly on all examples, we present these examples to provide intuition on how example-level errors become aggregated into poor correlation to human judgements at the corpus-level. responses with BLEU, we recommend the choice of N = 2 over N = 3 or 4. Note that using a test corpus larger than the size reported in this paper may lead to stronger correlations for BLEU-3 and BLEU4, due to a higher number of non-zero scores. It is interesting to note that, while some of the embedding metrics and BLEU show small positive correlation in the non-technical Twitter domain, there is no metric that significantly correlates with humans on the Ubuntu Dialogue Corpus. This is likely because the correct Ubuntu responses contain specific technical words that are less likely to be produced by our models. Further, it is possible that responses in the Ubuntu Dialogue Corpus have intrinsically higher variability (or entropy) than Twitter when conditioned on the context, making the evaluation problem significantly more difficult. Figure 1 illustrates the relationship between metrics and human judgements. We include only the best performing metric using word-overlaps, i.e. the BLEU-2 score (left), and the best performing metric using word embeddings, i.e. the vector average (center). These plots show how weak the correlation is: in both cases, they appear to be random noise. It seems as though the BLEU score obtains a positive correlation because of the large number of responses that are given a score of 0 (bottom left corner of the first plot). This is in stark contrast to the inter-rater agreement, which is plotted between two randomly sampled halves of the raters (right-most plots). We also calculated the BLEU scores after removing stopwords and punctuation from the responses. As shown in Table 4, this weakens the cor- relation with human judgements for BLEU-2 compared to the values in Table 3, and suggests that BLEU is sensitive to factors that do not change the semantics of the response. Finally, we examined the effect of response length on the metrics, by considering changes in scores when the ground truth and proposed response had a large difference in word counts. Table 4 shows that BLEU and METEOR are particularly sensitive to this aspect, compared to the Embedding Average metric and human judgement. Qualitative Analysis. In order to determine specifically why the metrics fail, we examine qualitative samples where there is a disagreement between the metrics and human rating. Although these only show inconsistencies at the example-level, they provide some intuition as to why the metrics don’t correlate with human judgements at the corpuslevel. We present in Figure 2 two examples where all of the embedding-based metrics and BLEU-1 score the proposed response significantly differently than the humans. The left of Figure 2 shows an example where the embedding-based metrics score the proposed response lowly, while humans rate it highly. It is clear from the context that the proposed response is reasonable – indeed both responses intend to express gratitude. However, the proposed response has a different wording than the ground truth response, and therefore the metrics are unable to separate the salient words from the rest. This suggests that the embedding-based metrics would ben- efit from a weighting of word saliency. The right of the figure shows the reverse scenario: the embedding-based metrics score the proposed response highly, while humans do not. This is most likely due to the frequently occurring ‘i’ token, and the fact that ‘happy’ and ‘welcome’ may be close together in the embedding space. However, from a human perspective there is a significant semantic difference between the responses as they pertain to the context. Metrics that take into account the context may be required in order to differentiate these responses. Note that in both responses in Figure 2, there are no overlapping n-grams greater than unigrams between the ground truth and proposed responses; thus, all of BLEU-2,3,4 would assign a score near 0 to the response. 6 Discussion We have shown that many metrics commonly used in the literature for evaluating unsupervised dialogue systems do not correlate strongly with human judgement. Here we elaborate on important issues arising from our analysis. Constrained tasks. Our analysis focuses on relatively unconstrained domains. Other work, which separates the dialogue system into a dialogue planner and a natural language generation component for applications in constrained domains, may find stronger correlations with the BLEU metric. For example, Wen et al. (2015) propose a model to map from dialogue acts to natural language sentences and use BLEU to evaluate the quality of the generated sentences. Since the mapping from dialogue acts to natural language sentences has lower diversity and is more similar to the machine translation task, it seems likely that BLEU will correlate better with human judgements. However, an empirical investigation is still necessary to justify this. there is no standard method for doing this in the literature. Future work should examine how retrieving additional responses affects the correlation with word-overlap metrics. Searching for suitable metrics. While we provide evidence against existing metrics, we do not yet provide good alternatives for unsupervised evaluation. Despite the poor performance of the word embedding-based metrics in this survey, we believe that metrics based on distributed sentence representations hold the most promise for the future. This is because word-overlap metrics will simply require too many ground-truth responses to find a significant match for a reasonable response, due to the high diversity of dialogue responses. As a simple example, the skip-thought vectors of Kiros et al. (2015) could be considered. Since the embedding-based metrics in this paper only consist of basic averages of vectors obtained through distributional semantics, they are insufficiently complex for modeling sentence-level compositionality in dialogue. Instead, these metrics can be interpreted as calculating the topicality of a proposed response (i.e. how on-topic the proposed response is, compared to the ground-truth). All of the metrics considered in this paper directly compare a proposed response to the ground-truth, without considering the context of the conversation. However, metrics that take into account the context could also be considered. Such metrics could come in the form of an evaluation model that is learned from data. This model could be either a discriminative model that attempts to distinguish between model and human responses, or a model that uses data collected from the human survey in order to provide human-like scores to proposed responses. Finally, we must consider the hypothesis that learning such models from data is no easier than solving the problem of dialogue response generation. If this hypothesis is true, we must concede and always use human evaluations together with metrics that only roughly approximate human judgements. Incorporating multiple responses. Our correlation results assume that only one ground truth response is available given each context. Indeed, this is the common setting in most of the recent literature References on training end-to-end conversation models. There [Artstein et al.2009] R. Artstein, S. Gandhe, J. Gerten, A. has been some work on using a larger set of autoLeuski, and D. Traum. 2009. Semi-formal evaluamatically retrieved plausible responses when evalution of conversational characters. In Languages: From Formal to Natural, pages 22–35. Springer. ating with BLEU (Galley et al., 2015b). However, [Banerjee and Lavie2005] S. Banerjee and A. Lavie. [Forgues et al.2014] G. Forgues, J. Pineau, J.-M. 2005. METEOR: An automatic metric for mt evaluaLarcheveque, and R. Tremblay. 2014. Bootstrapping tion with improved correlation with human judgments. dialog systems with word embeddings. In Proceedings of the ACL workshop on intrinsic and [Galley et al.2015a] M. Galley, C. Brockett, A. Sordoni, extrinsic evaluation measures for machine translation Y. Ji, M. Auli, C. Quirk, M. l, J. Gao, and B. Dolan. and/or summarization. 2015a. deltaBLEU: A discriminative metric for generation tasks with intrinsically diverse targets. In Pro[Bojar et al.2014] O. Bojar, C. Buck, C. Federmann, B. ceedings of the Annual Meeting of the Association for Haddow, P. Koehn, J. Leveling, C. Monz, P. Pecina, Computational Linguistics and the International Joint M. Post, H. Saint-Amand, et al. 2014. Findings of the Conference on Natural Language Processing (Short 2014 workshop on statistical machine translation. In Papers). Proceedings of the Ninth Workshop on Statistical Machine Translation, pages 12–58. Association for Com- [Galley et al.2015b] M. Galley, C. Brockett, A. Sordoni, Y. Ji, M. Auli, C. Quirk, M. Mitchell, J. Gao, and putational Linguistics Baltimore, MD, USA. B. Dolan. 2015b. deltableu: A discriminative metric [Cahill2009] A. Cahill. 2009. Correlating human and aufor generation tasks with intrinsically diverse targets. tomatic evaluation of a german surface realiser. In arXiv preprint arXiv:1506.06863. Proceedings of the ACL-IJCNLP 2009 Conference [Graham et al.2015] Y. Graham, N. Mathur, and T. BaldShort Papers, pages 97–100. Association for Compuwin. 2015. Accurate evaluation of segment-level matational Linguistics. chine translation metrics. In Proc. of NAACL-HLT, [Callison-Burch et al.2006] C. Callison-Burch, M. Ospages 1183–1191. Citeseer. borne, and P. Koehn. 2006. Re-evaluation the role [Graves2013] A. Graves. 2013. Generating sequences of bleu in machine translation research. In EACL, volwith recurrent neural networks. arXiv preprint ume 6, pages 249–256. arXiv:1308.0850. [Callison-Burch et al.2010] C. Callison-Burch, P. Koehn, [Hochreiter and Schmidhuber1997] S. Hochreiter and J. C. Monz, K. Peterson, M. Przybocki, and O. F. Zaidan. Schmidhuber. 1997. Long short-term memory. Neu2010. Findings of the 2010 joint workshop on staral Computation, 9(8):1735–1780. tistical machine translation and metrics for machine [Hovy1999] E. Hovy. 1999. Toward finely differentiated translation. In Proceedings of the Joint Fifth Workshop evaluation metrics for machine translation. In Proon Statistical Machine Translation and MetricsMATR, ceedings of the Eagles Workshop on Standards and pages 17–53. Association for Computational LinguisEvaluation. tics. [Jokinen and McTear2009] K. Jokinen and M. McTear. [Callison-Burch et al.2011] C. Callison-Burch, P. Koehn, 2009. Spoken Dialogue Systems. Morgan Claypool. C. Monz, and O. F. Zaidan. 2011. Findings of the [Kamm1995] C. Kamm. 1995. User interfaces for voice 2011 workshop on statistical machine translation. In applications. Proceedings of the National Academy of Proceedings of the Sixth Workshop on Statistical MaSciences, 92(22):10031–10037. chine Translation, pages 22–64. Association for Com[Kiros et al.2015] R. Kiros, Y. Zhu, R. R. Salakhutdinov, putational Linguistics. R. Zemel, R. Urtasun, A. Torralba, and S. Fidler. 2015. [Chen and Cherry2014] B. Chen and C. Cherry. 2014. Skip-thought vectors. In Advances in Neural InformaA systematic comparison of smoothing techniques for tion Processing Systems, pages 3276–3284. sentence-level bleu. ACL 2014, page 362. [Landauer and Dumais1997] T. K. Landauer and S. T. Du[Cohen1968] J. Cohen. 1968. Weighted kappa: Nominal mais. 1997. A solution to plato’s problem: The latent scale agreement provision for scaled disagreement or semantic analysis theory of acquisition, induction, and partial credit. Psychological bulletin, 70(4):213. representation of knowledge. Psychological review, [Espinosa et al.2010] D. Espinosa, R. Rajkumar, M. 104(2):211. White, and S. Berleant. 2010. Further meta- [Lasguido et al.2014] N. Lasguido, S. Sakti, G. Neubig, evaluation of broad-coverage surface realization. In T. Tomoki, and S. Nakamura. 2014. Utilizing humanProceedings of the 2010 Conference on Empirical to-human conversation examples for a multi domain Methods in Natural Language Processing, pages 564– chat-oriented dialog system. IEICE TRANSACTIONS 574. Association for Computational Linguistics. on Information and Systems, 97(6):1497–1505. [Foltz et al.1998] P. W. Foltz, W. Kintsch, and T. K. Lan- [Li et al.2015] J. Li, M. Galley, C. Brockett, J. Gao, dauer. 1998. The measurement of textual coherence and B. Dolan. 2015. A diversity-promoting objecwith latent semantic analysis. Discourse processes, tive function for neural conversation models. arXiv 25(2-3):285–307. preprint arXiv:1510.03055. [Li et al.2016] J. Li, M. Galley, C. Brockett, J. Gao, and B. Dolan. 2016. A persona-based neural conversation model. arXiv preprint arXiv:1603.06155. [Lin2004] C.-Y. Lin. 2004. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out: Proceedings of the ACL-04 workshop, volume 8. [Lowe et al.2015] R. Lowe, N. Pow, I. V. Serban, and J. Pineau. 2015. The ubuntu dialogue corpus: A large dataset for research in unstructured multi-turn dialogue systems. In SIGDIAL. [Mikolov et al.2013] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. 2013. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119. [Mitchell and Lapata2008] J. Mitchell and M. Lapata. 2008. Vector-based models of semantic composition. In ACL, pages 236–244. [Möller et al.2006] S. Möller, R. Englert, K. Engelbrecht, V. Hafner, A. Jameson, A. Oulasvirta, A. Raake, and N. Reithinger. 2006. MeMo: towards automatic usability evaluation of spoken dialogue services by user error simulations. In INTERSPEECH. [Papineni et al.2002a] K. Papineni, S. Roukos, T. Ward, and W. Zhu. 2002a. BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on Association for Computational Linguistics (ACL). [Papineni et al.2002b] K. Papineni, S. Roukos, T. Ward, J. Henderson, and F. Reeder. 2002b. Corpus-based comprehensive and diagnostic MT evaluation: Initial Arabic, Chinese, French, and Spanish results. In Proceedings of the second international conference on Human Language Technology Research, pages 132–137. [Reiter and Belz2009] E. Reiter and A. Belz. 2009. An investigation into the validity of some metrics for automatically evaluating natural language generation systems. Computational Linguistics, 35(4):529–558. [Ritter et al.2010] A. Ritter, C. Cherry, and B. Dolan. 2010. Unsupervised modeling of twitter conversations. In North American Chapter of the Association for Computational Linguistics (NAACL). [Ritter et al.2011] A. Ritter, C. Cherry, and W. B. Dolan. 2011. Data-driven response generation in social media. In Proceedings of the conference on empirical methods in natural language processing, pages 583– 593. Association for Computational Linguistics. [Rus and Lintean2012] V. Rus and M. Lintean. 2012. A comparison of greedy and optimal assessment of natural language student input using word-to-word similarity metrics. In Proceedings of the Seventh Workshop on Building Educational Applications Using NLP, pages 157–162, Stroudsburg, PA, USA. Association for Computational Linguistics. [Schatzmann et al.2005] J. Schatzmann, K. Georgila, and S. Young. 2005. Quantitative evaluation of user simulation techniques for spoken dialogue systems. In 6th Special Interest Group on Discourse and Dialogue (SIGDIAL). [Serban et al.2015] I. V. Serban, A. Sordoni, Y. Bengio, A. Courville, and J. Pineau. 2015. Building End-ToEnd Dialogue Systems Using Generative Hierarchical Neural Networks. In AAAI Conference on Artificial Intelligence. [Serban et al.2016] I. V. Serban, A. Sordoni, R. Lowe, L. Charlin, J. Pineau, A. Courville, and Y. Bengio. 2016. A hierarchical latent variable encoder-decoder model for generating dialogues. arXiv preprint arXiv:1605.06069. [Sordoni et al.2015] A. Sordoni, M. Galley, M. Auli, C. Brockett, Y. Ji, M. Mitchell, J. Nie, J. Gao, and B. Dolan. 2015. A neural network approach to contextsensitive generation of conversational responses. In Conference of the North American Chapter of the Association for Computational Linguistics (NAACL-HLT 2015). [Stent et al.2005] A. Stent, M. Marge, and M. Singhai. 2005. Evaluating evaluation methods for generation in the presence of variation. In International Conference on Intelligent Text Processing and Computational Linguistics, pages 341–351. Springer. [Vinyals and Le2015] O. Vinyals and Q. Le. 2015. A neural conversational model. arXiv preprint arXiv:1506.05869. [Walker et al.1997] M. Walker, D. Litman, C. Kamm, and A. Abella. 1997. Paradise: A framework for evaluating spoken dialogue agents. In Proceedings of the eighth conference on European chapter of the Association for Computational Linguistics, pages 271–280. ACL. [Wen et al.2015] T.-H. Wen, M. Gasic, N. Mrksic, P.-H. Su, D. Vandyke, and S. Young. 2015. Semantically conditioned lstm-based natural language generation for spoken dialogue systems. arXiv preprint arXiv:1508.01745. [Wieting et al.2015] J. Wieting, M. Bansal, K. Gimpel, and K. Livescu. 2015. Towards universal paraphrastic sentence embeddings. CoRR, abs/1511.08198. Appendix Distribution of kappa scores Table 6 shows the full distribution over κ scores for each pair of human annotators. It is apparent that most of the scores (88.9%) are over 0.4, indicating a moderate agreement. This suggests that the task was reasonable and well understood by the annotators. κ > 0.2 > 0.3 > 0.4 > 0.5 > 0.6 > 0.7 > 0.8 # pairs 253/253 251/253 225/253 162/253 50/253 3/253 0/253 % pairs 100% 99.2% 88.9% 64.0% 19.8% 1.2% 0% Table 6: Distribution of pairwise κ scores between each pair of human annotators, other than the annotators that were discarded due to low scores. Full scatter plots We present the scatterplots for all of the metrics consider and their correlation with human judgement, in Figures 3-7 below. As previously emphasized, there is very little correlation for any of the metrics, and the BLEU-3 and BLEU-4 scores are often close to zero. Figure 3: Scatter plots showing the correlation between two randomly chosen groups of human volunteers on the Twitter corpus (left) and Ubuntu Dialogue Corpus (right). (a) ROUGE (b) METEOR Figure 4: Scatter plots showing the correlation between metrics and human judgement on the Twitter corpus (left) and Ubuntu Dialogue Corpus (right). The plots represent ROUGE (a) and METEOR (b). (a) Vector Extrema (b) Greedy Matching (c) Vector Averaging Figure 5: Scatter plots showing the correlation between metrics and human judgement on the Twitter corpus (left) and Ubuntu Dialogue Corpus (right). The plots represent vector extrema (a), greedy matching (b), and vector averaging (c). (a) BLEU-1 (b) BLEU-2 (c) BLEU-3 (d) BLEU-4 Figure 6: Scatter plots showing the correlation between metrics and human judgement on the Twitter corpus (left) and Ubuntu Dialogue Corpus (right). The plots represent BLEU-1 (a), BLEU-2 (b), BLEU-3 (c), and BLEU-4 (d).
9cs.NE
Characterization of an inconsistency ranking for pairwise comparison matrices László Csató* arXiv:1610.07388v3 [cs.AI] 12 Jun 2017 Institute for Computer Science and Control, Hungarian Academy of Sciences (MTA SZTAKI) Laboratory on Engineering and Management Intelligence, Research Group of Operations Research and Decision Systems Corvinus University of Budapest (BCE) Department of Operations Research and Actuarial Sciences Budapest, Hungary June 13, 2017 Abstract Pairwise comparisons between alternatives are a well-known method for measuring preferences of a decision-maker. Since these often do not exhibit consistency, a number of inconsistency indices has been introduced in order to measure the deviation from this ideal case. We axiomatically characterize the inconsistency ranking induced by the Koczkodaj inconsistency index: six independent properties are presented such that they determine a unique linear order on the set of all pairwise comparison matrices. Keywords: Pairwise comparisons; Analytic Hierarchy Process (AHP); inconsistency index; axiomatic approach; characterization JEL classification number: C44 MSC classes: 90B50, 91B08 1 Introduction Pairwise comparisons are a fundamental tool in many decision-analysis methods such as the Analytic Hierarchy Process (AHP) (Saaty, 1980). However, when different entities1 are compared with regard to abstract, non-measurable criteria by fallible humans, it may happen that the set of comparisons is not consistent: for example, entity 𝐴 is two times better than entity 𝐵, entity 𝐵 is three times better than entity 𝐶, but entity 𝐴 is not six (= 2 × 3) times better than entity 𝐶. Inconsistency can also be an inherent feature of the data (see e.g. Bozóki et al. (2016)). * e-mail: [email protected] Throughout paper, the term entity is used for the ’things’ that are compared. They are sometimes called alternatives, objects, etc. 1 1 Therefore, measuring the inconsistency of pairwise comparison matrices – that is, assigning a numerical value to the question ’How much a given matrix deviates from one representing consistent preferences?’ – emerges as an important issue. According to our knowledge, the first concept of inconsistency was presented by Kendall and Smith (1940). Since then, a large number of inconsistency indices has been proposed such as Saaty’s eigenvalue-based index (Saaty, 1977), the Koczkodaj inconsistency index (Koczkodaj, 1993; Duszak and Koczkodaj, 1994), the relative error (Barzilai, 1998), the geometric consistency index (Aguaron and Moreno-Jiménez, 2003), the inconsistency index by Peláez and Lamata (Peláez and Lamata, 2003), or the harmonic consistency index (Stein and Mizzi, 2007). Deeper understanding of inconsistency indices is not only a mathematical exercise. Brunelli et al. (2013) and Brunelli (2016a) show that the application of various indices may lead to different, even almost opposite conclusions, so choosing among them properly really counts. It is not by chance that a number of articles deals with the study and comparison of different inconsistency indices (see e.g. Bozóki and Rapcsák (2008) and Brunelli et al. (2013)). Recently, an axiomatic approach has been followed: the introduction and justification of reasonable properties may help to narrow the general definition of inconsistency index as well as highlight those problematic indices that do not satisfy certain requirements (Brunelli and Fedrizzi, 2011; Brunelli, 2016a, 2017; Brunelli and Fedrizzi, 2015; Cavallo and D’Apuzzo, 2012; Koczkodaj and Szwarc, 2014; Koczkodaj and Szybowski, 2015). Nonetheless, while logical consistency (Is the set of properties devoid of logical contradiction? Does there exist any inconsistency index that satisfies all axioms?) and independence (Is there any redundant axiom, implied by some of the others?) are usually discussed by the authors (Brunelli, 2017; Brunelli and Fedrizzi, 2015), we do not know any result on the axiomatic characterization of inconsistency indices. Characterization means proposing a set of properties such that there exists a unique measure satisfying all requirements. It is an extensively used approach in social choice, illustrated by the huge literature, for instance, on the axiomatization of the Shapley value in game theory (see e.g. Shapley (1953); Dubey (1975); Young (1985); Hart and Mas-Colell (1989); van den Brink (2002)), or on the Hirsch index in scientometrics (see e.g. Woeginger (2008); Quesada (2010); Miroiu (2013); Bouyssou and Marchant (2014)). It is not unknown in the case of methods used for deriving weights from pairwise comparison matrices (Fichtner, 1984, 1986; Barzilai, 1997), too. The central contribution of this study is a characterization of the so-called Koczkodaj inconsistency ranking, induced by the Koczkodaj inconsistency index. The first axiomatization on this field suggests that inconsistency ranking may be a more natural concept than inconsistency index, since any monotonic transformation of the latter results in the same ranking. In other words, it makes no sense to differentiate between these variants of a given inconsistency index (see also Brunelli (2016b)). It is worth to note that our approach is somewhat different from the previous ones in this topic, which aimed at finding a set of suitable properties to be satisfied by any reasonable inconsistency measure. Providing an axiomatic characterization implies neither we accept all properties involved as wholly justified and unquestionable nor we reject the axioms proposed by others. Therefore, the current paper does not argue against the application of other inconsistency indices. The sole implication of our result is that if one agrees with these – rather theoretic – axioms, then the Koczkodaj inconsistency ranking remains the only choice. Hence we follow characterizations on other fields by assigning modest importance for 2 the motivation behind the properties used and for the issue of inconsistency thresholds. Nonetheless, the Koczkodaj index seems to be a reasonable inconsistency index as it meets all reasonable axioms suggested by Brunelli and Fedrizzi (2015); Brunelli (2017); Koczkodaj and Szybowski (2015). In our view, it mitigates the problem caused by the possible hard verification of our properties in practice. Note also that only one index has been associated to a general level of acceptance. However, if a threshold of acceptable inconsistency is given for the Koczkodaj index, then one can find the minimal number of matrix elements to be modified in order to get an acceptable matrix (Bozóki et al., 2015). The paper is organized as follows. Section 2 presents the main notions and notations. Section 3 introduces the axioms used in the characterization of the Koczkodaj inconsistency ranking offered by Section 4. Independence of the axioms is shown in Section 5. Finally, Section 6 discusses our results and highlights some directions of future research. 2 Preliminaries Let R𝑛×𝑛 denote the set of positive matrices (with all elements greater than zero) of size + 𝑛 × 𝑛. is a pairwise Definition 1. Pairwise comparison matrix: Matrix A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 + comparison matrix if 𝑎𝑗𝑖 = 1/𝑎𝑖𝑗 for all 1 ≤ 𝑖, 𝑗 ≤ 𝑛. In a pairwise comparison matrix, 𝑎𝑖𝑗 is an assessment of the relative importance of the 𝑖th entity with respect to the 𝑗th one. Definition 2. Pairwise comparison submatrix: Let 2 ≤ 𝑚 < 𝑛. Matrix B = [𝑏𝑖𝑗 ] ∈ R𝑚×𝑚 + is a pairwise comparison submatrix of pairwise comparison matrix A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 if + there exists an injection 𝜎 : {1; 2; . . . ; 𝑚} → {1; 2; . . . ; 𝑛} such that 𝑏𝑖𝑗 = 𝑎𝜎(𝑖)𝜎(𝑗) for all 1 ≤ 𝑖, 𝑗 ≤ 𝑚. This relation is denoted by B ⊂ A. of pairwise comparison Definition 3. Triad: Pairwise comparison submatrix B ∈ R𝑚×𝑚 + 𝑛×𝑛 matrix A ∈ R+ is a triad of matrix A if 𝑚 = 3. The term triad will be analogously used for a pairwise comparison matrix of size 3 × 3. A triad T can be entirely described by the three elements in its upper triangle: T = (𝑡1 ; 𝑡2 ; 𝑡3 ) such that 𝑡1 is the outcome of the comparison between the 1st and the 2nd, 𝑡2 is the outcome of the comparison between the 1st and the 3rd, and 𝑡3 is the outcome of the comparison between the 2nd and the 3rd entities, respectively. Definition 4. Consistency: Pairwise comparison matrix A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 is consistent if + 𝑎𝑖𝑘 = 𝑎𝑖𝑗 𝑎𝑗𝑘 for all 1 ≤ 𝑖, 𝑗, 𝑘 ≤ 𝑛. When the consistency condition does not hold, the pairwise comparison matrix is said to be inconsistent. Remark 1. Triad T = (𝑡1 ; 𝑡2 ; 𝑡3 ) is consistent if and only if 𝑡2 = 𝑡1 𝑡3 . Note that a pairwise comparison matrix is consistent if and only if all of its triads are consistent. The set of all pairwise comparison matrices is denoted by 𝒜. Inconsistency is measured by associating a value for each pairwise comparison matrix. Definition 5. Inconsistency index: Function 𝐼 : 𝒜 → R is an inconsistency index. 3 The paper discusses a specific inconsistency indicator, which is the following. Definition 6. Koczkodaj inconsistency index (Koczkodaj, 1993; Duszak and Koczkodaj, 1994): Consider a pairwise comparison matrix A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 + . Its inconsistency 𝐾 according to the index 𝐼 is (︃ 𝐼 𝐾 (A) = max 𝑖<𝑗<𝑘 {︃⃒ ⃒ ⃒ min ⃒⃒1 − ⃒ ⃒ ⃒ ⃒1 − ⃒ 𝑎𝑖𝑘 ⃒⃒ ⃒; 𝑎𝑖𝑗 𝑎𝑗𝑘 ⃒ ⃒}︃)︃ 𝑎𝑖𝑗 𝑎𝑗𝑘 ⃒⃒ 𝑎𝑖𝑘 ⃒ (1) Note that the Koczkodaj inconsistency index is based on the maximally inconsistent triad such that its inconsistency is measured by its deviation from a consistent triad. Inconsistency ranking ⪰ is a linear order (complete, antisymmetric and transitive binary relation) on the set of all pairwise comparison matrices 𝒜 with respect to inconsistency. A ⪰ B is interpreted such that pairwise comparison matrix A is at most as inconsistent as matrix B. The relations ∼ and ≻ are derived from ⪰ in the usual way. Any inconsistency index induces an inconsistency ranking: A ⪰ B if and only if matrix A has a not worse (typically, not larger) value of inconsistency than matrix B according to the given index. Definition 7. Koczkodaj inconsistency ranking: Consider pairwise comparison matrices A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 and B = [𝑏𝑖𝑗 ] ∈ R𝑚×𝑚 . Then A ⪰𝐾 B if + + (︃ {︃ 𝑎𝑖𝑗 𝑎𝑗𝑘 𝑎𝑖𝑘 max max ; 𝑖<𝑗<𝑘 𝑎𝑖𝑘 𝑎𝑖𝑗 𝑎𝑗𝑘 }︃)︃ (︃ {︃ 𝑏𝑖𝑗 𝑏𝑗𝑘 𝑏𝑖𝑘 ≤ max max ; 𝑖<𝑗<𝑘 𝑏𝑖𝑘 𝑏𝑖𝑗 𝑏𝑗𝑘 }︃)︃ . (2) The Koczkodaj inconsistency ranking is the inconsistency ranking induced by the Koczkodaj inconsistency index since, for any triad T = (𝑡1 ; 𝑡2 ; 𝑡3 ), there exists a differentiable one-to-one correspondence between the Koczkodaj inconsistency index and the inconsistency index 𝐼 𝑇 (T) = max {(𝑡1 𝑡3 )/𝑡2 ; 𝑡2 /(𝑡1 𝑡3 )} (Bozóki and Rapcsák, 2008, Theorem 3.1). 3 Axioms for an inconsistency ranking We start by giving some properties that one could expect an inconsistency ranking to satisfy. After that, they will be commented. Axiom 1. Positive responsiveness (𝑃 𝑅): Consider two triads S = (1; 𝑠2 ; 1) and T = (1; 𝑡2 ; 1) such that 𝑠2 , 𝑡2 ≥ 1. Inconsistency ranking ⪰ satisfies 𝑃 𝑅 if S ⪰ T ⇐⇒ 𝑠2 ≤ 𝑡2 . Axiom 2. Invariance under inversion of preferences (𝐼𝐼𝑃 ): Consider a triad T and its transpose T⊤ . Inconsistency ranking ⪰ satisfies 𝐼𝐼𝑃 if T ∼ T⊤ . Axiom 3. Homogeneous treatment of entities (𝐻𝑇 𝐸): Consider the triads T = (1; 𝑡2 ; 𝑡3 ) and T′ = (1; 𝑡2 /𝑡3 ; 1). Inconsistency ranking ⪰ satisfies 𝐻𝑇 𝐸 if T ∼ T′ . Axiom 4. Scale invariance (𝑆𝐼): Take the triads T = (𝑡1 ; 𝑡2 ; 𝑡3 ) and T′ = (𝑘𝑡1 ; 𝑘 2 𝑡2 ; 𝑘𝑡3 ). Inconsistency ranking ⪰ satisfies 𝑆𝐼 if T ∼ T′ for all 𝑘 > 0. Axiom 5. Monotonicity (𝑀 𝑂𝑁 ): Consider a pairwise comparison matrix A and its triad T. Inconsistency ranking ⪰ satisfies 𝑀 𝑂𝑁 if A ⪯ T. 4 Axiom 6. Reducibility (𝑅𝐸𝐷): Consider a pairwise comparison matrix A. Inconsistency ranking ⪰ satisfies 𝑅𝐸𝐷 if A has a triad T such that A ∼ T. Positive responsiveness is based on the observation that triad T differs more from the basic consistent triad of (1; 1; 1) than triad S. It is a similar, but more relaxed requirement than monotonicity on single comparisons, proposed by Brunelli and Fedrizzi (2015): 𝑃 𝑅 contains only one implication instead of two, and the condition is demanded for triads, not for all pairwise comparison matrices.2 Invariance under inversion of preferences means that inverting all the preferences does not affect inconsistency. This axiom was introduced in Brunelli (2017) for all pairwise comparison matrices. A fundamental reason for this requirement is that 𝑎𝑖𝑗 is an assessment of the relative importance of the 𝑖th entity with respect to the 𝑗th one. However, it may equivalently reflect the relative importance of the 𝑗th entity with respect to the 𝑖th one. The two values are logically reciprocal, but one gets the pairwise comparison matrix A⊤ instead of A (Bozóki and Rapcsák, 2008). Therefore, triads T and T⊤ should be in the same equivalence class of inconsistency. Homogeneous treatment of entities can be justified in the following way. According to triads T and T′ , we have two entities (the 1st and the 2nd) equally important on their own. After they are compared with a third entity, the inconsistency of the resulting triad should not depend on the relative importance of the new entity. The violation of 𝐻𝑇 𝐸 would mean that inconsistency is influenced by the absolute importance of entities, contradicting to the notion of pairwise comparisons. Scale invariance means that the level of inconsistency is independent from the mathematical representation of the preferences. For example, take the 𝑖th, the 𝑗th and the 𝑘th entities such that the 𝑖th is ’moderately more important’ than 𝑗th and 𝑗th is ’moderately more important’ than the 𝑘th with the same intensity of the two relations. Then it makes sense to expect the inconsistency ranking to be the same if ’moderately more important’ is identified by the number 2, or 3, or 4, and so on, even allowing for a change in the direction of the two preferences. Naturally, this transformation should preserve consistency, which finalizes the definition of 𝑆𝐼. Monotonicity is formulated on the idea that ’no pairwise comparison submatrix may have a worse inconsistency indicator than the given pairwise comparison matrix’ by Jacek Szybowski in Koczkodaj and Szybowski (2015). Hence an extension of the set of entities compared cannot improve on inconsistency. For our characterization, it is enough to expect that no triad of the original matrix is allowed to be more inconsistent. Reducibility ensures that there exists a ’critical’ triad whose inconsistency is responsible for the inconsistency of the original pairwise comparison matrix. It will be a crucial axiom in the main result, simplifying the problem by conmtracting its size. Readers familiar with characterizations in other fields of science will not be surprised: for example, the reduced game property is widely used in axiomatizations of different game theory concepts (see e.g. Davis and Maschler (1965)). Note that 𝑀 𝑂𝑁 and 𝑅𝐸𝐷 together imply monotonicity not only for triads, but for all pairwise comparison submatrices, similarly to the definition of monotonicity by Koczkodaj and Szybowski (2015). 2 The term ’monotonicity’ is not used in the name of this property in order to avoid confusion with 𝑀 𝑂𝑁 . 5 4 Characterization of the Koczkodaj inconsistency ranking Theorem 1. The Koczkodaj inconsistency ranking is the unique inconsistency ranking satisfying positive responsiveness, invariance under inversion of preferences, homogeneous treatment of entities, scale invariance, monotonicity and reducibility. Proof. We will first argue that the Koczkodaj inconsistency ranking satisfies all axioms. 𝑃 𝑅, 𝐻𝑇 𝐸 and 𝑆𝐼 immediately follows from (2). 𝐼𝐼𝑃 is met due to taking the maximum of 𝑎𝑖𝑗 𝑎𝑗𝑘 /𝑎𝑖𝑘 and its inverse in (2). The Koczkodaj inconsistency ranking considers only the maximally inconsistent triad, and the set of triads of a pairwise comparison submatrix is a subset of the set of triads of the original matrix, therefore it meets 𝑀 𝑂𝑁 and 𝑅𝐸𝐷. Uniqueness: it is shown that any inconsistency ranking satisfying the six axioms coincides with the Koczkodaj inconsistency ranking. Assume that there exist pairwise comparison matrices A and B such that A ⪰ B according to an inconsistency ranking ⪰, which meets 𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸, 𝑆𝐼, 𝑀 𝑂𝑁 and 𝑅𝐸𝐷. The idea is to gradually simplify – with the use of the axioms – the comparison of inconsistencies of pairwise comparison matrices A and B by considering matrices with the same inconsistency level until their ranking depends on a single mathematical relation. 1. Due to 𝑅𝐸𝐷, there exist triads A1 = (𝑎1 ; 𝑎2 ; 𝑎3 ) and B1 = (𝑏1 ; 𝑏2 ; 𝑏3 ) such that A1 ∼ A and B1 ∼ B. 2. 𝑀 𝑂𝑁 provides that A1 ⪯ A′ for all triads A′ ⊂ A and B1 ⪯ B′ for all triads B′ ⊂ B, respectively. 3. Consider A2 = (1; 𝑎2 /𝑎21 ; 𝑎3 /𝑎1 ) and B2 = (1; 𝑏2 /𝑏21 ; 𝑏3 /𝑏1 ). 𝑆𝐼 implies that A2 ∼ A1 and B2 ∼ B1 . 4. Consider A3 = (1; 𝑎2 /(𝑎1 𝑎3 ); 1) and B3 = (1; 𝑏2 /(𝑏1 𝑏3 ); 1). 𝐻𝑇 𝐸 results in A3 ∼ A2 and B3 ∼ B2 . 5. 𝐼𝐼𝑃 provides that 𝑎2 /(𝑎1 𝑎3 ) ≥ 1 and 𝑏2 /(𝑏1 𝑏3 ) ≥ 1 can be assumed without loss of generality in A3 and B3 , respectively. 6. To summarize, A3 ∼ A2 ∼ A1 ∼ A ⪰ B ∼ B1 ∼ B2 ∼ B3 . It leads to 1 ≤ 𝑎2 /(𝑎1 𝑎3 ) ≤ 𝑏2 /(𝑏1 𝑏3 ) because of the property 𝑃 𝑅. However, 1 ≤ 𝑎2 /(𝑎1 𝑎3 ) ≤ 𝑏2 /(𝑏1 𝑏3 ) means that A1 ⪰𝐾 B1 due to Definition 6. Analogously, since A1 ⪯ A′ for all triads A′ ⊂ A and B1 ⪯ B′ for all triads B′ ⊂ B, we get A1 ⪯𝐾 A′ for all triads A′ ⊂ A and B1 ⪯𝐾 B′ for all triads B′ ⊂ B, respectively. It is equivalent to A ∼ A1 ⪰𝐾 B1 ∼ B, so ⪰ is the Koczkodaj inconsistency ranking. The six properties can be classified in at least two ways. The proof of Theorem 1 reveals that the first four axioms (𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸 and 𝑆𝐼) characterize an inconsistency ranking on the set of triads, while 𝑀 𝑂𝑁 and 𝑅𝐸𝐷 are responsible for its extension to pairwise comparison matrices with at least four entities. Therefore, by accepting 𝑀 𝑂𝑁 and 𝑅𝐸𝐷, other inconsistency rankings based on the maximally inconsistent triad can be characterized. From another perspective, two axioms, 𝑃 𝑅 and 𝑀 𝑂𝑁 contain a ’preference’ relation, whereas 𝐼𝐼𝑃 , 𝐻𝑇 𝐸 and 𝑆𝐼 define some equivalence classes. 𝑅𝐸𝐷 plays a special role by imposing equivalence between matrices of different size. 6 The six axioms above (𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸, 𝑆𝐼, 𝑀 𝑂𝑁 and 𝑅𝐸𝐷) are not enough to uniquely determine the Koczkodaj inconsistency index 𝐼 𝐾 as any monotonic function of it generates the same inconsistency ranking. It means that some technical axioms are necessary in order to obtain the Koczkodaj inconsistency index. Definition 8. Consistency detection (𝐶𝑇 ): Consider a consistent triad T. Inconsistency index 𝐼 satisfies 𝐶𝑇 if 𝐼(T) = 0. 𝐶𝑇 was suggested by Koczkodaj and Szybowski (2015) and is a specific version of the property Existence of a unique element representing consistency in Brunelli and Fedrizzi (2015). Nonetheless, adding 𝐶𝑇 to the previous properties is still not enough to exclude some transformations of 𝐼 𝐾 . Since it does not make much sense to differentiate between inconsistency indices which generate the same inconsistency ranking (Brunelli, 2016b), the axiomatic characterization of the Koczkodaj inconsistency index remains a topic of future research. 5 Independence of the axioms According to Theorem 1, the six properties determine a unique inconsistency ranking. However, it may turn out that there is some redundancy in the result, certain axioms can be left out. Therefore, six examples, all of them different from the Koczkodaj inconsistency ranking, are given such that they satisfy all but one properties. and B = Example 1. Consider two pairwise comparison matrices A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 + 𝑚×𝑚 1 [𝑏𝑖𝑗 ] ∈ R+ . Then A ⪰ B if (︃ min 𝑖<𝑗<𝑘 {︃ 𝑎𝑖𝑗 𝑎𝑗𝑘 𝑎𝑖𝑘 max ; 𝑎𝑖𝑘 𝑎𝑖𝑗 𝑎𝑗𝑘 }︃)︃ (︃ ≥ min 𝑖<𝑗<𝑘 {︃ 𝑏𝑖𝑗 𝑏𝑗𝑘 𝑏𝑖𝑘 max ; 𝑏𝑖𝑘 𝑏𝑖𝑗 𝑏𝑗𝑘 }︃)︃ . (3) Lemma 1. The inconsistency ranking ⪰1 in Example 1 meets 𝐼𝐼𝑃 , 𝐻𝑇 𝐸, 𝑆𝐼, 𝑀 𝑂𝑁 and 𝑅𝐸𝐷, but fails 𝑃 𝑅. Proof. 𝐼𝐼𝑃 , 𝐻𝑇 𝐸 and 𝑆𝐼 contain an equivalence relation on the set of triads, and the inconsistency ranking ⪰1 shows the same behaviour as the Koczkodaj inconsistency ranking from this point of view. Inconsistency ranking ⪰1 is also based on triads, so it meets 𝑅𝐸𝐷. Monotonicity is satisfied because minimum over a subset cannot be larger than minimum over the original set. However, it does not satisfy 𝑃 𝑅 since it completely reverses the ranking of triads. Example 2. Consider two pairwise comparison matrices A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 and B = + 2 [𝑏𝑖𝑗 ] ∈ R𝑚×𝑚 . Then A ⪰ B if + 𝑎𝑖𝑗 𝑎𝑗𝑘 𝑏𝑖𝑗 𝑏𝑗𝑘 ≤ max . 𝑖<𝑗<𝑘 𝑎𝑖𝑘 𝑖<𝑗<𝑘 𝑏𝑖𝑘 max (4) Lemma 2. The inconsistency ranking ⪰2 in Example 2 meets 𝑃 𝑅, 𝐻𝑇 𝐸, 𝑆𝐼, 𝑀 𝑂𝑁 and 𝑅𝐸𝐷, but fails 𝐼𝐼𝑃 . Proof. 𝑃 𝑅, 𝐻𝑇 𝐸 and 𝑆𝐼 consider only the upper triangle of a triad, thus they are satisfied. Inconsistency ranking ⪰2 is based on the maximally inconsistent triad, and the set of 7 triads of a pairwise comparison submatrix is a subset of the set of triads of the original matrix, therefore it satisfies 𝑀 𝑂𝑁 and 𝑅𝐸𝐷. Take the following triads: ⎡ ⎤ 1 1 1 ⎢ ⎥ A=⎣ 1 1 1 ⎦ 1 1 1 ⎡ and ⎤ 1 1 2 ⎢ ⎥ B = ⎣ 1 1 1 ⎦. 1/2 1 1 Now 1 > 1/2 implies A ≺2 B, but 1 < 2, so A⊤ ≻2 B⊤ , showing the violation of invariance under inversion of preferences. Example 3. Consider two pairwise comparison matrices A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 and B = + 𝑚×𝑚 3 [𝑏𝑖𝑗 ] ∈ R+ . Then A ⪰ B if (︃ {︃ 2 𝑎 𝑎𝑖𝑘 ; 2 max max 𝑖<𝑗<𝑘 𝑎𝑖𝑘 𝑎𝑗𝑘 }︃)︃ {︃ 2 𝑏 (︃ 𝑏𝑖𝑘 ; 2 ≤ max max 𝑖<𝑗<𝑘 𝑏𝑖𝑘 𝑏𝑗𝑘 }︃)︃ 𝑗𝑘 𝑗𝑘 . (5) Lemma 3. The inconsistency ranking ⪰3 in Example 3 meets 𝑃 𝑅, 𝐼𝐼𝑃 , 𝑆𝐼, 𝑀 𝑂𝑁 and 𝑅𝐸𝐷, but fails 𝐻𝑇 𝐸. Proof. 𝑃 𝑅 is satisfied because of the analogous role of 𝑎𝑖𝑘 in (2) and (5). 𝐼𝐼𝑃 and 𝑆𝐼 is met due to the substitution of 𝑎𝑖𝑗 with 𝑎𝑗𝑘 . Inconsistency ranking ⪰3 is based on the maximally inconsistent triad, and the set of triads of a pairwise comparison submatrix is a subset of the set of triads of the original matrix, therefore it satisfies 𝑀 𝑂𝑁 and 𝑅𝐸𝐷. Take the following triads: ⎡ ⎤ 1 1 3 ⎢ 1 2 ⎥ A=⎣ 1 ⎦ 1/3 1/2 1 ⎡ and ⎤ 1 1 5 ⎢ 1 4 ⎥ B=⎣ 1 ⎦. 1/5 1/4 1 Now 22 /3 < 42 /5 implies A ≻3 B. A possible transformation of triads A and B according to 𝐻𝑇 𝐸 leads to A′ = (1; 3/2; 1) and B′ = (1; 5/4; 1), so A′ ≺3 B′ since 3/2 > 5/4. It reveals the violation of homogeneous treatment of entities by the inconsistency ranking ⪰3 . Example 4. Consider two pairwise comparison matrices A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 and B = + 𝑚×𝑚 4 [𝑏𝑖𝑗 ] ∈ R+ . Then A ⪰ B if (︃ {︃ 𝑎𝑗𝑘 𝑎𝑖𝑘 max max ; 𝑖<𝑗<𝑘 𝑎𝑖𝑘 𝑎𝑗𝑘 }︃)︃ (︃ {︃ 𝑏𝑗𝑘 𝑏𝑖𝑘 ≤ max max ; 𝑖<𝑗<𝑘 𝑏𝑖𝑘 𝑏𝑗𝑘 }︃)︃ . (6) Lemma 4. The inconsistency ranking ⪰4 in Example 4 meets 𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸, 𝑀 𝑂𝑁 and 𝑅𝐸𝐷, but fails 𝑆𝐼. Proof. 𝑃 𝑅 is satisfied because of the analogous role of 𝑎𝑖𝑘 in (2) and (6). 𝐼𝐼𝑃 and 𝐻𝑇 𝐸 hold as only 𝑎𝑖𝑗 is eliminated from the original definition. Inconsistency ranking ⪰4 is based on the maximally inconsistent triad, and the set of triads of a pairwise comparison submatrix is a subset of the set of triads of the original matrix, therefore it satisfies 𝑀 𝑂𝑁 and 𝑅𝐸𝐷. Take the following triads: ⎡ ⎤ 1 1 1 ⎢ ⎥ A=⎣ 1 1 1 ⎦ 1 1 1 ⎡ ⎤ 1 2 4 ⎢ ⎥ ′ A = ⎣ 1/2 1 2 ⎦ . 1/4 1/2 1 and 8 Now 1/1 > 2/4 implies A ≺4 A′ , but A′ can be obtained by a transformation of triad A according to 𝑆𝐼, showing the violation of scale invariance. Example 5. Consider two pairwise comparison matrices A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 and B = + 𝑚×𝑚 5 [𝑏𝑖𝑗 ] ∈ R+ . Then A ⪰ B if (︃ min 𝑖<𝑗<𝑘 {︃ 𝑎𝑖𝑗 𝑎𝑗𝑘 𝑎𝑖𝑘 max ; 𝑎𝑖𝑘 𝑎𝑖𝑗 𝑎𝑗𝑘 }︃)︃ (︃ {︃ 𝑏𝑖𝑗 𝑏𝑗𝑘 𝑏𝑖𝑘 max ; 𝑏𝑖𝑘 𝑏𝑖𝑗 𝑏𝑗𝑘 ≤ min 𝑖<𝑗<𝑘 }︃)︃ (7) . Lemma 5. The inconsistency ranking ⪰5 in Example 5 meets 𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸, 𝑆𝐼 and 𝑅𝐸𝐷, but fails 𝑀 𝑂𝑁 . Proof. Inconsistency ranking ⪰5 is equivalent to the Koczkodaj inconsistency ranking on the set of triads. 𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸 and 𝑆𝐼 consider only a triad, hence these properties are satisfied. There exists a minimally inconsistent triad in any pairwise comparison matrix, so 𝑅𝐸𝐷 is met. The set of triads of a pairwise comparison submatrix is a subset of the set of triads of the original matrix, therefore inconsistency ranking ⪰5 violates 𝑀 𝑂𝑁 . Example 6. Consider two pairwise comparison matrices A = [𝑎𝑖𝑗 ] ∈ R𝑛×𝑛 and B = + 𝑚×𝑚 6 [𝑏𝑖𝑗 ] ∈ R+ . Then A ⪰ B if (︃ {︃ 𝑎𝑖𝑗 𝑎𝑗𝑘 𝑎𝑖𝑘 max max ; 𝑖<𝑗<𝑘 𝑎𝑖𝑘 𝑎𝑖𝑗 𝑎𝑗𝑘 }︃)︃𝑛 (︃ {︃ 𝑏𝑖𝑗 𝑏𝑗𝑘 𝑏𝑖𝑘 ≤ max max ; 𝑖<𝑗<𝑘 𝑏𝑖𝑘 𝑏𝑖𝑗 𝑏𝑗𝑘 }︃)︃𝑚 (8) . Lemma 6. The inconsistency ranking ⪰6 in Example 6 meets 𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸, 𝑆𝐼 and 𝑀 𝑂𝑁 , but fails 𝑅𝐸𝐷. Proof. Inconsistency ranking ⪰6 is equivalent to the Koczkodaj inconsistency ranking when 𝑛 = 𝑚, for example, on the set of triads. Thus 𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸 and 𝑆𝐼 are all satisfied. Since max{𝑎𝑖𝑗 𝑎𝑗𝑘 /𝑎𝑖𝑘 ; 𝑎𝑖𝑘 /(𝑎𝑖𝑗 𝑎𝑗𝑘 )} ≥ 1, inconsistency ranking ⪰6 meets 𝑀 𝑂𝑁 . However, it violates 𝑅𝐸𝐷 because of the appearance of 𝑛 and 𝑚 in (8). Table 1 summarizes the above discussion on the independence of the axioms. Table 1: Axiomatic properties of inconsistency rankings Inconsistency ranking Definition Koczkodaj ⪰1 ⪰2 ⪰3 ⪰4 ⪰5 ⪰6 𝑃𝑅 𝐼𝐼𝑃 𝐻𝑇 𝐴 𝑆𝐼 𝑀 𝑂𝑁 𝑅𝐸𝐷 Definition 7 4 4 4 4 4 4 Example Example Example Example Example Example 7 4 4 4 4 4 4 7 4 4 4 4 4 4 7 4 4 4 4 4 4 7 4 4 4 4 4 4 7 4 4 4 4 4 4 7 1 2 3 4 5 6 Note that inconsistency rankings ⪰1 and ⪰5 differ only in the direction of the inequality. Analogously to Theorem 1, ⪰1 is characterized by 𝐼𝐼𝑃 , 𝐻𝑇 𝐸, 𝑆𝐼, 𝑀 𝑂𝑁 , 𝑅𝐸𝐷 (the five axioms it satisfies) and negative responsiveness, the inverse of positive responsiveness defined as S ⪰ T if and only if 𝑡2 ≥ 𝑠2 . In a similar way, ⪰5 is the unique inconsistency 9 ranking satisfying 𝑃 𝑅, 𝐼𝐼𝑃 , 𝐻𝑇 𝐸, 𝑆𝐼, 𝑅𝐸𝐷 and reversed monotonicity, that is, A ⪰ B for any pairwise comparison matrix A and its triad B. Inconsistency rankings ⪰1 –⪰5 have not much practical use. On the other hand, inconsistency ranking ⪰6 may be meaningful if inconsistency is assumed to (deterministically) increase with size due to the possible presence of other inconsistent triads. 6 Discussion The paper has provided an axiomatic characterization of the inconsistency ranking induced by the Koczkodaj inconsistency index. The theorem requires six properties, some of them directly borrowed from previous axiomatic discussions (𝐼𝐼𝑃 from Brunelli (2017) and 𝑀 𝑂𝑁 from Koczkodaj and Szybowski (2015)), some of them similar to the axioms used in the literature (𝑃 𝑅 is a relaxed version of monotonicity on single comparisons by Brunelli and Fedrizzi (2015) and 𝑅𝐸𝐷 is implicitly contained in monotonicity by Koczkodaj and Szybowski (2015)), and some of them introduced here (𝐻𝑇 𝐸 and 𝑆𝐼). Although we have given a few arguments for homogeneous treatment of entities and scale invariance, their justification can be debated. However, it does not influence the essence of our characterization, which only states that the Koczkodaj inconsistency ranking should be accepted when all properties are adopted. It remains to be seen how this characterization can be modified. The proof of Theorem 1 shows that 𝐼𝐼𝑃 can be eliminated if 𝑃 𝑅 is defined without the condition 𝑠2 , 𝑡2 ≥ 1. Although it seems to be a simplification (we will have only five axioms instead of six), the current form better reflects the role of different properties, highlighted by the discussion of logical independence in Section 5. Another direction can be the use of other known properties in the characterization. A natural candidate is the following one, suggested by Brunelli and Fedrizzi (2015) and applied by Koczkodaj and Szybowski (2015), too. Definition 9. Order invariance (𝑂𝐼): Consider a pairwise comparison matrix A and a permutation matrix P of the same size. Inconsistency ranking ⪰ satisfies 𝑂𝐼 if PAP⊤ ∼ A. 𝑂𝐼 says that changing the order of the entities does not affect the inconsistency of preferences. In our characterization, homogeneous treatment of entities and scale invariance have a somewhat analogous role, but they cannot be substituted immediately by 𝑂𝐼. To summarize, the current study clearly does not mean the end of the discussion on inconsistency indices. The main aim of this topic is perhaps the identification of the best universal measure, or at least, the perfect in a certain field. For this purpose, a thorough understanding of inconsistency indicators is indispensable. We hope the current study may give new insights by presenting the first axiomatic characterization in this field for the ranking derived from the Koczkodaj inconsistency index. Acknowledgements I would like to thank to Matteo Brunelli, Michele Fedrizzi, Waldemar W. Koczkodaj and Jacek Szybowski for inspiration. I am also grateful to Matteo Brunelli, Sándor Bozóki and Miklós Pintér for reading the manuscript and for useful advices. Three anonymous reviewers provided valuable comments and suggestions on earlier drafts. The research was supported by OTKA grant K 111797 and by the MTA Premium Post 10 Doctorate Research Program. This research was partially supported by Pallas Athene Domus Scientiae Foundation. The views expressed are those of the author’s and do not necessarily reflect the official opinion of Pallas Athene Domus Scientiae Foundation. References Aguaron, J. and Moreno-Jiménez, J. M. (2003). The geometric consistency index: approximated thresholds. European Journal of Operational Research, 147(1):137–145. Barzilai, J. (1997). Deriving weights from pairwise comparison matrices. Journal of the Operational Research Society, 48(12):1226–1232. Barzilai, J. (1998). Consistency measures for pairwise comparison matrices. Journal of Multi-Criteria Decision Analysis, 7(3):123–132. Bouyssou, D. and Marchant, T. (2014). An axiomatic approach to bibliometric rankings and indices. Journal of Informetrics, 8(3):449–477. Bozóki, S., Csató, L., and Temesi, J. (2016). An application of incomplete pairwise comparison matrices for ranking top tennis players. European Journal of Operational Research, 248(1):211–218. Bozóki, S., Fülöp, J., and Poesz, A. (2015). On reducing inconsistency of pairwise comparison matrices below an acceptance threshold. Central European Journal of Operations Research, 23(4):849–866. Bozóki, S. and Rapcsák, T. (2008). On Saaty’s and Koczkodaj’s inconsistencies of pairwise comparison matrices. Journal of Global Optimization, 42(2):157–175. Brunelli, M. (2016a). Recent advances on inconsistency indices for pairwise comparisons – a commentary. Fundamenta Informaticae, 144(3-4):321–332. Brunelli, M. (2016b). A technical note on two inconsistency indices for preference relations: a case of functional relation. Information Sciences, 357:1–5. Brunelli, M. (2017). Studying a set of properties of inconsistency indices for pairwise comparisons. Annals of Operations Research, 248(1):143–161. Brunelli, M., Canal, L., and Fedrizzi, M. (2013). Inconsistency indices for pairwise comparison matrices: a numerical study. Annals of Operations Research, 211(1):493– 509. Brunelli, M. and Fedrizzi, M. (2011). Characterizing properties for inconsistency indices in the AHP. In Proceedings of the International Symposium on the Analytic Hierarchy Process (ISAHP), pages 15–18. Brunelli, M. and Fedrizzi, M. (2015). Axiomatic properties of inconsistency indices for pairwise comparisons. Journal of the Operational Research Society, 66(1):1–15. 11 Cavallo, B. and D’Apuzzo, L. (2012). Investigating properties of the ⊙-consistency index. In Greco, S., Bouchon-Meunier, B., Coletti, G., Fedrizzi, M., Matarazzo, B., and Yager, R. R., editors, Advances in Computational Intelligence: 14th International Conference on Information Processing and Management of Uncertainty in KnowledgeBased Systems, IPMU 2012, Catania, Italy, July 9-13, 2012, Proceedings, Part IV, volume 300 of Communications in Computer and Information Science, pages 315–327. Springer, Berlin-Heidelberg. Davis, M. and Maschler, M. (1965). The kernel of a cooperative game. Naval Research Logistics Quarterly, 12(3):223–259. Dubey, P. (1975). On the uniqueness of the Shapley value. International Journal of Game Theory, 4(3):131–139. Duszak, Z. and Koczkodaj, W. W. (1994). Generalization of a new definition of consistency for pairwise comparisons. Information Processing Letters, 52(5):273–276. Fichtner, J. (1984). Some thoughts about the mathematics of the Analytic Hierarchy Process. Technical report, Institut für Angewandte Systemforschung und Operations Research, Universität der Bundeswehr München. Fichtner, J. (1986). On deriving priority vectors from matrices of pairwise comparisons. Socio-Economic Planning Sciences, 20(6):341–345. Hart, S. and Mas-Colell, A. (1989). Potential, value, and consistency. Econometrica, 9(11):589–614. Kendall, M. G. and Smith, B. B. (1940). On the method of paired comparisons. Biometrika, 31(3/4):324–345. Koczkodaj, W. W. (1993). A new definition of consistency of pairwise comparisons. Mathematical and Computer Modelling, 18(7):79–84. Koczkodaj, W. W. and Szwarc, R. (2014). On axiomatization of inconsistency indicators for pairwise comparisons. Fundamenta Informaticae, 132(4):485–500. Koczkodaj, W. W. and Szybowski, J. (2015). Axiomatization of inconsistency indicators for pairwise comparisons matrices revisited. Manuscript. arXiv:1509.03781v1. Miroiu, A. (2013). Axiomatizing the Hirsch index: Quantity and quality disjoined. Journal of Informetrics, 7(1):10–15. Peláez, J. I. and Lamata, M. T. (2003). A new measure of consistency for positive reciprocal matrices. Computers & Mathematics with Applications, 46(12):1839–1845. Quesada, A. (2010). More axiomatics for the Hirsch index. Scientometrics, 82(2):413–418. Saaty, T. L. (1977). A scaling method for priorities in hierarchical structures. Journal of Mathematical Psychology, 15(3):234–281. Saaty, T. L. (1980). The Analytic Hierarchy Process: planning, priority setting, resource allocation. McGraw-Hill, New York. 12 Shapley, L. S. (1953). A value for 𝑛-person games. In Kuhn, H. W. and Tucker, A. W., editors, Contributions to the Theory of Games Volume II, volume 28 of Annals of Mathematical Studies, pages 307–317. Princeton University Press, Princeton, New Jersey. Stein, W. E. and Mizzi, P. J. (2007). The harmonic consistency index for the analytic hierarchy process. European Journal of Operational Research, 177(1):488–497. van den Brink, R. (2002). An axiomatization of the Shapley value using a fairness property. International Journal of Game Theory, 30(3):309–319. Woeginger, G. J. (2008). An axiomatic characterization of the Hirsch-index. Mathematical Social Sciences, 56(2):224–232. Young, H. P. (1985). Monotonic solutions of cooperative games. International Journal of Game Theory, 14(2):65–72. 13
2cs.AI
On the Noise-Information Separation of a Private Principal Component Analysis Scheme Mario Diaz∗ , Shahab Asoodeh† , Fady Alajaji‡ , Tamás Linder‡ , Serban Belinschi§ and James Mingo‡ ∗ Arizona arXiv:1801.03553v1 [cs.IT] 10 Jan 2018 State University and Harvard University, mdiaztor@{asu,g.harvard}.edu † The University of Chicago, [email protected] ‡ Queen’s University, {fady,linder,mingo}@queensu.ca § Institut de Mathématiques de Toulouse, [email protected] Abstract—In a survey disclosure model, we consider an additive noise privacy mechanism and study the trade-off between privacy guarantees and statistical utility. Privacy is approached from two different but complementary viewpoints: information and estimation theoretic. Motivated by the performance of principal component analysis, statistical utility is measured via the spectral gap of a certain covariance matrix. This formulation and its motivation rely on classical results from random matrix theory. We prove some properties of this statistical utility function and discuss a simple numerical method to evaluate it. I. I NTRODUCTION In the last decades, privacy breaches made clear the necessity of privacy mechanisms with provable guarantees. In this context, additive noise mechanisms are a popular choice among practitioners given their ease of implementation and mathematical tractability [1]. In order to understand the trade-off between the privacy guarantees provided by and the statistical cost of this type of mechanism, it is necessary to precisely quantify privacy and statistical utility. In this paper we consider two common measures of privacy, one based on mutual information and the other one on the minimum mean-squared error (MMSE). In the context of a survey with p queries and n respondents, we introduce a measure of statistical utility motivated by the performance of principal component analysis (PCA), a statistical method aimed at finding the least number of variables that explain a given data set [2, Ch. 9]. More specifically, statistical utility is measured by the gap between the eigenvalues of a certain covariance matrix associated with the responses. This formulation and its motivation rely on classical results from random matrix theory. To facilitate mathematical tractability, we focus on a toy model where the eigenvalues of the data covariance matrix are either large or negligible. For this model, we derive a simple numerical method to compute the utility function. A general treatment of spectrum separation can be found in [3, Ch. 6]. Private versions of PCA have been analyzed in the past, specially under the framework of differential privacy, see [4] and references therein. Many of these analyses rely on results stemming from finite dimensional (random) matrix theory, see, e.g., [5]. The approach in the present paper follows a different path, relying on asymptotic random matrix theory considerations. Our main motivation is two-fold: the behavior of the eigenvalues of certain random matrices becomes simpler when the dimensions go to infinity (Thm. 1) and this asymptotic behavior essentially appears in finite dimension (Thm. 2). In Sec. II we present the setting of our problem. The statistical utility function and some of its properties are then introduced in Sec. III, followed by a privacy analysis in Sec. IV. In particular, we study the privacy-utility trade-off in the spirit of [6], which is also related with the privacy-utility trade-offs in [7] and references therein. In Sec. V a simple numerical method for the computation of the utility function is provided. Due to space limitations, all the proofs are deferred to [8]. Notation. Let C+ = {z ∈ C : =z > 0} and C− = −C+ , where C is the set of complex numbers and =z is the imaginary part of z ∈ C. For a p × p complex matrix A ∈ Mp (C), we let Aij be its i, j-entry and A∗ be its conjugate transpose. The indicator function of a set E is denoted by 1E . For a probability distribution F , we let Supp (F ) be its support, i.e., the smallest closed set E with F (E) = 1. For A ∈ Mp (C) with eigenvalues λ1 , . . .P , λp , the probability distribution defined by FA ([a, b]) = p1 k 1λk ∈[a,b] is called the eigenvalue distribution of A. II. S ETTING Assume that a survey with p queries is handed to n b be the p × n matrix associated to this respondents. Let X b is a realization of a random matrix survey. We assume that X X = Σ1/2 W, where Σ is a p × p (deterministic) covariance matrix and W is a p×n random matrix whose entries are independent and identically distributed (i.i.d.) real random variables with zero mean b are independent and unit variance. Note that the columns of X realizations of a random vector with covariance Σ. A popular instance of this model corresponds to the case where the entries of W are i.i.d. Gaussian random variables; thus the entries of X are possibly correlated Gaussian random variables. The covariance matrix Σ possesses valuable statistical information about the respondent population. Hence, in many applications the data aggregator is interested in obtaining an estimation of Σ. In this setting, the canonical estimator is the sample covariance matrix bX b ∗. b := 1 X Σ n Because of privacy concerns, the respondents might not b to the data aggregator. want to disclose their answers, X, Instead, they might want to use a randomized mechanism to alter their answers, giving them the position of plausible where t > 0 is a design parameter and Zb is a realization of Z, a p × n random matrix which is independent of X and whose entries are i.i.d. random variables with zero mean and unit variance. In this case, the sample covariance matrix equals 0, where a.s. stands for almost surely. Hence, the data aggregator b t − tIp as an estimate of Σ without incurring a big might use Σ statistical loss. However, when both p and n are large (p, n → b t − tIp is known to be a poor estimate of ∞), the estimator Σ b t − tIp might be very different Σ, e.g., the eigenvalues of Σ from those of Σ, see Thm. 1. Since in many contemporary applications p and n are within the same order of magnitude, it is necessary to quantify the statistical cost incurred by the additive noise mechanism in this regime. In the next section we do so by introducing a utility function connected to the performance of PCA. III. 0.4 0.3 0.2 0.1 6 8 10 S TATISTICAL U TILITY F UNCTION We now introduce a statistical utility function that captures b t . In order to motivate the performance of PCA applied to Σ its definition, let us consider the following example. To simplify the exposition, in this section we assume that the entries of W and Z are Gaussian. At the end of this section we comment on the universality of the subsequent analysis. Example 1. Let p = 50 and n = 2000. Assume that Σ is diagonal with eigenvalues 0, 7, and 10 with multiplicities 35, 10, and 5, respectively. A histogram of the eigenvalues b = Σ b 0 is given in Fig. 1. Note that this of an instance of Σ distribution is a blurred version of the eigenvalue distribution 4 6 8 10 t=5 12 14 16 0.3 0.2 0.0 0.1 0.2 0.3 0.4 t=0 0.1 If for the application at hand the noise distribution is fixed, then the trade-off between privacy and statistical utility becomes evident: when t increases the respondents’s privacy improves as their answers get more distorted but, at the same b t differs more from Σ. time, the sample covariance matrix Σ Note that for p fixed and n large (n → ∞), the latter is not a problem. Indeed, under some mild assumptions, the law of large numbers implies lim kΣt − (Σ + 4 0.0 √ a realization of Σt = n−1 Xt Xt∗ , where Xt := X + tZ. b0 = Σ b and that E (Σt ) = Σ + tIp , where Ip Note that Σ denotes the p × p identity matrix. The probability distribution of the additive noise may change according to the nature of the data, e.g., discrete or continuous. In particular, both t and the distribution of the noise are the design parameters of the privacy mechanism. Observe that given these parameters, this additive mechanism can be implemented locally at each user, making unnecessary the presence of a trustworthy data aggregator. n→∞ 2 0.4 0 bt = 1 X bt X bt∗ , Σ n a.s. tIp )k22 = 0.0 0.0 0.1 0.2 0.3 0.4 deniability towards their responses. In this paper we focus on b to the data an additive noise model: instead of providing X aggregator, the respondents provide √ bt := X b + tZ, b X 10 15 t = 10 20 15 20 25 t = 20 30 35 b t for different values of t. Histogram of the eigenvalues of Σ Figure 1. of Σ, 7 2 1 10∈[a,b] + 17∈[a,b] + 110∈[a,b] . (1) 10 10 10 √ b becomes stronger, As t increases, the additive noise tZ b t more diffuse, as making the eigenvalue distribution of Σ shown in Fig. 1. This behavior has a direct impact on the benefits of PCA, which provides a dimensionality reduction inversely proportional to the number of largest eigenvalues. b =Σ b 0 would propose the For example, PCA performed on Σ five largest eigenvalues as the most informative components. b 5 or Σ b 10 would suggest the Similarly, PCA performed on Σ b 20 are fifteen largest eigenvalues. Since all the eigenvalues of Σ merged together, PCA in this latter case might be ineffective. FΣ ([a, b]) = The forthcoming definition of the statistical utility function U relies on the following asymptotic considerations. The Gaussianity assumed in this section implies √ d Xt = Σ1/2 W + tZ = (Σ + tIp )1/2 W, (2) d where = stands for equality in distribution. In particular, 1 (Σ + tIp )1/2 W W ∗ (Σ + tIp )1/2 . (3) n The next theorem [9, Thm. 1.1] is a generalization of the Marchenko-Pastur theorem, a cornerstone of random matrix theory. For a probability distribution function F , its Cauchy transform G : C+ → C− is the (analytic) function defined by Z 1 dF (x). G(z) = R z−x d Σt = The Cauchy transform characterizes a distribution function. Indeed, the Stieltjes inversion formula states that Z b 1 F ([a, b]) = − lim+ =G(x + i)dx, π →0 a for all a < b continuity points of F . When F is regular enough, 1 its density equals f (x) = − lim =G(x + i). π →0+ Theorem 1 ([9]). Assume on a common probability space: (a) For p = 1, 2, . . ., Wp = (Wp (i, j)) is p × n, Wp (i, j) ∈ C are identically distributed for all p, i, j, independent across i, j  for each p, E |W1 (1, 1) − E (W1 (1, 1)) |2 = 1; (b) n = n(p) with p/n → c ∈ (0, ∞) as p → ∞; 0.20 0.15 0.05 2 4 6 8 p = 50 ; n = 2000 10 0.00 0 12 0 2 4 6 8 10 p = 500 ; n = 20000 12 b = Σ b 0 and the asymptotic Figure 2. Histogram of the eigenvalues of Σ density predicted by Thm. 1. (c) Tp is p × p random Hermitian nonnegative definite, with eigenvalue distribution converging a.s. in distribution to a probability distribution H on [0, ∞) as p → ∞; (d) Wp and Tp are independent. 1/2 Let Tp be the Hermitian nonnegative square root of 1/2 1/2 Tp , and let Σp = (1/n)Tp Wp Wp∗ Tp . Then, a.s., the eigenvalue distribution of Σp converges in distribution, as p → ∞, to a non-random probability distribution F , whose Cauchy transform G(z) satisfies Z 1 dH(x), (4) G(z) = z − x(1 − c + czG(z)) R Then, with probability one, no eigenvalue of Σp appears in [a, b] for all large p. The previous theorem readily implies that the gaps in the support of F c,H appear in finite dimension. This is of particular interest for this paper, as PCA is more useful when there are few large eigenvalues, i.e., there is a gap between large and small eigenvalues. Now we introduce the promised statistical utility function. In order to keep the analysis tractable, we consider the following toy model for the situation in which there is a clear distinction between large and small eigenvalues: the covariance matrix Σ has only one non-zero eigenvalue, say s, with multiplicity brpc for some r ∈ (0, 1). Under this assumption, the eigenvalue distribution of Σ + tIp equals1 Ht (x) = (1 − r)1x≥t + r1x≥s+t . Note that if H is discrete, the integral in (4) reduces to a sum. In particular, if |Supp (H) ∩ (0, ∞)| = n, then G(z) is the only root in Dc,z of a polynomial of degree n + 1. For instance, if H(x) = 1x≥1 , then G = G(z) solves the equation czG2 + (1 − c − z)G + 1 = 0, a quadratic polynomial in G. The next example shows the predictive power of Thm. 1. Example 2. In Fig. 2, the histogram of the eigenvalues b 0 is depicted for two different values of a realization of Σ of p and n with c = 1/40. In both cases, the eigenvalue distribution of Σ is given by (1). The asymptotic density of the eigenvalues provided by Thm. 1 is also depicted. Observe the close agreement between the empirical and asymptotic eigenvalue distributions, even for p as small as 50. The previous example demonstrates that not only the distribution of the eigenvalues follows closely the corresponding asymptotic density, but also that there are no eigenvalues outside the support of the asymptotic prediction. This observation is formalized in the following theorem [10]. Given c ∈ (0, ∞) and H a probability distribution on [0, ∞), we let F c,H be the limiting distribution determined by (4). Theorem 2 ([10]). Assume: (a) W (i, j) ∈ C, i, j = 1, 2, . . ., are i.i.d. random variables with E(W (1, 1)) = 0, E |W (1, 1)|2 = 1, and E |W (1, 1)|4 < ∞; (b) n = n(p) with cp = p/n → c ∈ (0, ∞) as p → ∞; (c) For each p, Tp is p × p Hermitian nonnegative definite with eigenvalue distribution Hp converging in distribution to a probability distribution H; 1/2 1/2 where Wp = (Wp (i, j)) with (5) By (3) and Thm. 1, a.s., the eigenvalue distribution of Σt converges, as p → ∞, to in the sense that, for each z ∈ C+ , G(z) is the unique solution to (4) in Dc,z = {G ∈ C : (1 − c)/z + cG ∈ C− }. (d) Σp = (1/n)Tp Wp Wp∗ Tp is any Hermitian (e) The interval [a, b] with a > 0 lies outside the support of F c,H and F cp ,Hp for all large p. 0.10 0.20 0.00 0.05 0.10 0.15 1/2 i = 1, 2, . . . , p, j = 1, 2, . . . , n and Tp square root of Tp ; Ft := F c,Ht . (6) Finally, let Supp (Ft ) be the support of Ft and N (t) be the number of its connected components. Note that, by Lemma 1, N (t) is finite for every t ∈ [0, ∞). Definition 1. The utility function U : [0, ∞) → R is defined as follows. If N (t) = 1, we let U(t) = 0. If N (t) = 2 and At , Bt are the connected components of Supp (Ft ), U(t) = min a∈At ,b∈Bt |a − b|. In words, U(t) approximates the separation between the b t , as long as such large and the small eigenvalues of Σ separation exists. As exhibited by equations (2) and (3), the b t correspond mainly to the non-zero large eigenvalues of Σ eigenvalues of Σ, while the small ones come from the added √ noise tZ. Note that in order for U to be well defined, it is necessary for the range of N to be a subset of {1, 2}, as established next. Theorem 3. With the assumptions from (5) and (6), we have that N (t) ∈ {1, 2} for all t ∈ [0, ∞). One way to compute U(t) is finding Ft , determining its connected components, and measuring their distance. However, there is a more efficient method based on the discriminant of a cubic equation. To avoid an unnecessary digression, this method is discussed in Sec. V. Using this method, in Fig. 3 we plot the graph of U. Under our standing assumptions, the performance of PCA is heavily compromised for a noise power t such that U(t) = 0, as the gap between noise and information disappears. Indeed, for t large enough the gap always disappears, as established by the following proposition. 1 More precisely, kHt − FΣ+tIp k∞ ≤ 1/p which is negligible. 0 2 4 6 8 In particular, for the toy model of the previous section,  brpc s r,s,p PIT (t) = . log 1 + 2 t In the context of the last remark of the previous section, i.e., when data and/or noise are not necessarily Gaussian, it is relevant to consider the following. 0 Figure 3. 5 10 15 t 20 25 30 The graph of U for c = 1/40, r = 3/10, and s = 10. Proposition 1. There exists T = T (c, r, s) ≥ 0 such that N (t) = 1 for all t ≥ T . Note that in Fig. 3 there exists a t∗ such that U(t) = 0 if and only if t ≥ t∗ . Thus, in principle, any noise power t ∈ [0, t∗ ] does not compromise the performance of PCA. This property makes t∗ useful in the design of privacy mechanisms. In view of Thm. 3 and Prop. 1, the existence of such t∗ is equivalent to the following. Conjecture 1. N is non-increasing in t. In addition to simulations, there are theoretical reasons to believe in the above conjecture, e.g., similar results are known to be true for other random matrix models [11]. Ultimately, we are interested in the statistical utility function U and not only in the set {t ≥ 0 : U(t) = 0} = {t ≥ 0 : N (t) = 1}. For this utility function, there is numerical evidence supporting the following stronger conjecture. Conjecture 2. U is non-increasing and convex in t. Remark. In this section we assumed that both data and noise are Gaussian. Nonetheless, one can appeal to universality arguments to establish that the conclusions reached in this section hold for a much wider range of random matrix models. In the square case, when p = n, one can appeal to the universality of the circular law, as established in [12], and the asymptotic freeness of several random matrices, see, e.g., [13], [14]. The non-square case can be handled similarly using the ideas in [15] and references therein. IV. P RIVACY M EASURES Having defined U as the utility function, we need to specify a privacy function to quantify the trade-off between utility and privacy. A natural option is to measure the information leakage of the user’s raw data in its perturbed version. In this section we discuss two specific measures of information leakage: mutual information and MMSE. (j) Mutual Information. Let X (j) and Xt , j ≤ n, denote the j-th column of X and Xt , respectively. Since the entries of (j) W and Z are i.i.d., the mutual information I(X (j) ; Xt ) does not depend on j. Thus, w.l.o.g., we define (1) PIT (t) := I(X (1) ; Xt ), as a privacy measure. Measuring privacy in terms of mutual information has been explored extensively in the past, see, e.g., [16]. Assuming that both data and noise are Gaussian,   1 Σ G PIT (t) = log det Ip + . 2 t Assume that the noise is Gaussian but the data is drawn from an arbitrary distribution having a density and finite third moment. Let θ = √1t . With this notation,   p PIT (t) = h θX (1) + Z (1) − log 2πe, 2 where h(·) denotes differential entropy. In particular, studying t 7→ PIT (t) amounts to studying θ 7→ h(θX (1) + Z (1) ). If p = 1, then it follows from [17, Lemma 1] that, as θ → 0, I(X (1) ; θX (1) + Z (1) ) = θ2 + o(θ2 ), 2 1 in the high privacy regime (t → ∞). For and thus PIT (t) ∼ 2t p ≥ 1, the chain rule implies pTr(Σ)θ2 + o(θ2 ), 2 p Tr(Σ) in the high privacy regime. and hence PIT (t) . 2t I(X (1) ; θX (1) + Z (1) ) ≤ Now assume that neither data nor noise is Gaussian. Recall that the non-Gaussianity D(V ) of a random vector V is defined as D(V ) := D(V kVG ), where D(·k·) denotes the KullbackLeibler divergence, and VG is a Gaussian random vector with the same mean and covariance matrix as V . It can be shown that √ (1) (1) G I(X (1) ; Xt ) = PIT (t) + D( tZ (1) ) − D(Xt ). In this case, regardless of distributions of X and Z, √ √ G G PIT (t) ≤ PIT (t) + D( tZ (1) ) = PIT (t) + pD( tZ11 ), where the last equality holds as the entries of Z are i.i.d. MMSE. In [18], see also [16], the authors proposed an estimation-theoretic measure in terms of MMSE. Following this approach, we define p h i X 2 PET (t) := mmse(Xi1 |Xt ) = E X (1) − E[X (1) |Xt ] , i=1 where mmse(U |V ) := E[(U − E[U |V ])2 ]. If both data and noise are Gaussian, then we can write h −1 i G PET (t) = Tr Ip + t−1 Σ Σ . In particular, for the toy model in the previous section r,s,p PET (t) = brpc ts . t+s It is worth pointing out that PET (t) and PIT (t) are connected by the so-called I-MMSE relation, see [19]. For example, when 0 the noise is Gaussian, PET (t) = −(2t2 )PIT (t). In this case, PET quantifies the rate of decrease of the information-theoretic privacy leakage PIT . Privacy-Utility Function. In order to formally connect pri- 8 6 4 2 0 0 5 10 15 eps 20 25 30 r,s,p The graph of gIT for r = 3/10, s = 10 and p = 50. Figure 4. Figure 5. vacy and utility, we define the following privacy-utlity function in the spirit of [6], see also [7] and references therein. For  > 0, we define gIT () := sup R EFERENCES [1] In words, gIT () equals the largest utility U(t) under the privacy constraint PIT (t) ≤ . Conditional on the non-increasing behavior of U(t) (Conj. 2), it is easy to verify that for the model of the previous section = r,s,p −1 U((PIT ) ()), r,s,p −1 (PIT ) () 2/brpc (7) The privacy-utility trade-off for PET can be handled similarly by replacing PIT (t) ≤  with PET (t) ≥ , as two highly correlated random variables posses a high mutual information but, at the same time, a small MMSE. N UMERICAL C OMPUTATION OF U Throughout this section c ∈ (0, ∞), r ∈ (0, 1), and s > 0 are fixed. For t ≥ 0, we let Gt be the Cauchy transform of Ft = F c,Ht with Ht defined as in (5). By Thm. 1, for each z ∈ C+ , Gt (z) is a solution to the equation G= [2] [3] [4] −1 where = s(e − 1) . Since U(t) can be computed using the tools from the following section, (7) provides a useful way to compute the privacy-utility function r,s,p r,s,p gIT . Fig. 4 depicts gIT for r = 3/10, s = 10 and p = 50. Observe that, conditional on the existence of t∗ (Conj. 1), gIT () = 0 if and only if  ≤ PIT (t∗ ). V. support of Ft is represented by thick blue lines and the value of U(t) equals the third minus the second positive root of ∆t . U(t). t:PIT (t)≤ r,s,p gIT () Graph of ∆t for c = 1/40, r = 3/10, s = 10, and t = 10. 1−r r + . z − t(1 − c + czG) z − (t + s)(1 − c + czG) [5] [6] [7] [8] [9] [10] [11] [12] Alternatively, Gt (z) is a root of the polynomial Pt,z (G) = At,z G3 + Bt,z G2 + Ct,z G + Dt,z ∈ C[G], 2 2 where Az,t := t(t + s)c z , Bz,t := at,z (t + s)cz + bt,z tcz, Cz,t := rtcz + (1 − r)(t + s)cz + at,z bt,z , and Dz,t := rat,z + (1−r)bt,z with at,z = (t(1−c)−z) and bt,z = (t+s)(1−c)−z. The following lemma provides a characterization of Supp (Ft ). Lemma 1. Let ∆t : R → R be the (real) polynomial given by 3 x 7→18Ax,t Bx,t Cx,t Dx,t − 4Bx,t Dx,t 2 2 3 2 + Bx,t Cx,t − 4Ax,t Cx,t − 27A2x,t Dx,t . Then, Supp (Ft ) is the closure of {x ∈ [0, ∞) : ∆t (x) < 0}. The above lemma suggests a simple method to compute U(t): find the positive roots of ∆t , identify where ∆t is positive and negative, and subtract the roots delimiting the gap of interest. This process is depicted in Fig. 5, where the [13] [14] [15] [16] [17] [18] [19] C. Dwork, K. Kenthapadi, F. McSherry, I. Mironov, and M. Naor, Our Data, Ourselves: Privacy Via Distributed Noise Generation. Springer Heidelberg, 2006, pp. 486–503. R. J. Muirhead, Aspects of multivariate statistical theory. John Wiley & Sons, 2009, vol. 197. Z. Bai and J. W. Silverstein, Spectral analysis of large dimensional random matrices. Springer, 2010, vol. 20. K. Chaudhuri, A. D. Sarwate, and K. Sinha, “A near-optimal algorithm for differentially-private principal components,” JMLR, vol. 14, no. 1, pp. 2905–2943, 2013. L. Wei, A. D. Sarwate, J. Corander, A. Hero, and V. Tarokh, “Analysis of a privacy-preserving PCA algorithm using random matrix theory,” in Signal and Information Processing (GlobalSIP). IEEE, 2016, pp. 1335–1339. S. Asoodeh, M. Diaz, F. Alajaji, and T. Linder, “Information extraction under privacy constraints,” Information, vol. 7, no. 1, p. 15, 2016. L. Sankar, S. R. Rajagopalan, and H. V. Poor, “Utility-privacy tradeoffs in databases: An information-theoretic approach,” IEEE Transactions on Information Forensics and Security, vol. 8, no. 6, pp. 838–852, 2013. M. Diaz, S. Asoodeh, F. Alajaji, T. Linder, S. Belinschi, and J. Mingo, “On the noise-information separation of a private principal component analysis scheme,” To appear. J. W. Silverstein, “Strong convergence of the empirical distribution of eigenvalues of large dimensional random matrices,” Journal of Multivariate Analysis, vol. 55, no. 2, pp. 331–339, 1995. Z.-D. Bai and J. W. Silverstein, “No eigenvalues outside the support of the limiting spectral distribution of large-dimensional sample covariance matrices,” Annals of Probability, pp. 316–345, 1998. P. Biane, “On the free convolution with a semi-circular distribution,” Indiana University Mathematics Journal, pp. 705–718, 1997. T. Tao and V. Vu, “Random matrices: Universality of ESDs and the circular law,” The Ann. Probability, vol. 38, no. 5, pp. 2023–2065, 2010, with an appendix by M. Krishnapur. A. Nica and R. Speicher, Lectures on the combinatorics of free probability. Cambridge University Press, 2006, vol. 13. J. Mingo and R. Speicher, Free Probability and Random Matrices, ser. Fields Institute Monographs. Springer-Verlag New York, 2017, vol. 35. F. Benaych-Georges, “Rectangular random matrices, entropy, and Fisher’s information,” Journal of Operator Theory, pp. 371–419, 2009. F. P. Calmon, A. Makhdoumi, M. Médard, M. Varia, M. Christiansen, and K. R. Duffy, “Principal inertia components and applications,” IEEE Trans. Inf. Theory, vol. 63, no. 8, pp. 5011–5038, Aug 2017. M. S. Pinsker, V. V. Prelov, and S. Verdú, “Sensitivity of channel capacity,” IEEE Trans. Inf. Theory, vol. 41, no. 6, pp. 1877–1888, Nov 1995. S. Asoodeh, F. Alajaji, and T. Linder, “Privacy-aware MMSE estimation,” in IEEE International Symposium on Information Theory (ISIT), July 2016, pp. 1989–1993. D. Guo, S. Shamai, and S. Verdú, “Mutual information and minimum mean-square error in gaussian channels,” IEEE Trans. Inf. Theory, vol. 51, no. 4, pp. 1261–1282, April 2005.
7cs.IT
Long-Term Ensemble Learning of Visual Place Classifiers arXiv:1709.05470v1 [cs.CV] 16 Sep 2017 Fei Xiaoxiao Tanaka Kanji Abstract— This paper addresses the problem of cross-season visual place classification (VPC) from a novel perspective of long-term map learning. Our goal is to enable transfer learning efficiently from one season to the next, at a small constant cost, and without wasting the robot’s available longterm-memory by memorizing very large amounts of training data. To realize a good tradeoff between generalization and specialization abilities, we employ an ensemble of convolutional neural network (DCN) classifiers and consider the task of scheduling (when and which classifiers to retrain), given a previous season’s DCN classifiers as the sole prior knowledge. We present a unified framework for retraining scheduling and discuss practical implementation strategies. Furthermore, we address the task of partitioning a robot’s workspace into places to define place classes in an unsupervised manner, rather than using uniform partitioning, so as to maximize VPC performance. Experiments using the publicly available NCLT dataset revealed that retraining scheduling of a DCN classifier ensemble is crucial and performance is significantly increased by using planned scheduling. I. I NTRODUCTION This paper addresses the problem of visual robot selflocalization from a novel perspective of long-term map learning. We follow the recent self-localization paradigm based on a deep convolutional neural network (DCN) [1]. Thus, an environment map is learned as a DCN-based visual place classifier, and which is used to classify a query image into one of the learned place classes. We address the difficult long-term scenario of visual place classification (VPC), termed cross-season VPC [2], where training and test images involve different seasons. One of most basic schemes to handle this difficulty, is to train a DCN classifier from all available training images. However, this requires a robot to explicitly memorize and learn a number of training images proportional to the number of places and seasons, which severely limits the scalability of the algorithm in both time and memory space. Our goal is to develop a long-term map learning framework that enables efficient retraining of the VPC system, at a small constant cost, and without wasting the robot’s available long-term-memory by memorizing very large amounts of training data. This study is inspired by recent progress in domain adaptation and transfer learning [3]–[9], where the aim is to learn a classifier model for a target domain by exploiting rich information present in a source domain. In our study, classifiers learned in previous seasons represent the source knowledge, and we aim to exploit the source knowledge to Our work has been supported in part by JSPS KAKENHI Grant-in-Aid for Scientific Research (C) 26330297, and (C) 17K00361. The authors are with Graduate School of Engineering, University of Fukui, Japan. [email protected] Fang Yichu Takayama Akitaka Fig. 1. Long-term map learning for cross-season visual place classification. To realize a good tradeoff between generalization and specialization abilities, we employ an ensemble of DCN classifiers and consider the task of scheduling when and which classifiers to retrain, given previous season’s DCN classifiers as the sole prior knowledge. improve the current season’s VPC performance. We follow the literature of domain adaptation and transfer learning, although a key difference is that in our application scenario of autonomous robotics, the definitions of place classes and domains are not provided, and the robot must discover their optimal definitions in an unsupervised manner. To obtain an acceptable tradeoff between generalization and specialization, it is crucial to adequately train and retrain DCN classifiers (Fig. 1). Thus, if a DCN classifier is retrained (i.e., fine-tuned) to a specific season’s training data, its specialization ability is expected to increase, but its generalization ability tends to decrease. Thus, we have two possible choices: to either retrain a specific DCN classifier with a specific training set or not. After collecting N different training sets, there are 2N possible choices and 2N possible DCN classifiers. Training and using this exponential number of DCN classifiers is often intractable. We suggest a solution based on ensemble learning that requires only a fixed set of classifiers that integrate information from multiple domains using fine-tuning and classifier fusion. More formally, we address two different questions. The first question is how to choose which DCN classifiers to retrain, with the current season’s training set, out of the available DCN classifiers trained in the previous season. Recent advances in fine-tuning techniques for DCN have simplified the retraining task [3]. However, there is no straightforward method for retraining scheduling that achieves an optimal tradeoff between VPC accuracy and training efficiency. Secondly, we address the question of how to integrate the outputs from multiple classifiers from different seasons. Because individual classifiers are trained using different amounts of training data from different sea- sons, they often provide conflicting classification results with different levels of variances. The key to this question is to fuse probability estimates from individual DCN classifiers. In this study, we present and evaluate several strategies for retraining scheduling and for applying classifier fusion. An open question is how to partition the robot’s workspace into places to define place classes. Intuitively, each place class should be defined as a continuous region in the robot’s workspace with similar visual features. The main difficulty is the chicken and egg problem: If we have a well-trained classifier, it is rather easy to partition the robot’s workspace into place regions, but the training of a classifier requires a set of pre-defined place classes. Optimal definition of places is a practical concern, as the definition of place classes strongly influences VPC performance. It simplifies the inference over the space of robot pose and enables efficient self-localization, by using non-uniform planned partitioning of the space, as opposed to typical uniform partitioning. From a broader perspective, optimal place definition is interesting because it may facilitate a unifying framework for compact map representation. In this study, we present several strategies for the place-definition and workspace-partitioning discovery. The main contribution of this study is an extension of the VPC framework to setups with long-term map learning. This study is inspired by our previous studies on crossseason self-localization [10] and DCN-based localization [11]; however, a key novelty is the formulation of crossseason VPC. The optimal definition of place classes is inspired by our previous study in [12]; however, the additional problem of domain adaptation between seasons arises in the long-term map learning scenario. We address this important issue and present a practical solution for it. We follow the literature such as [3] that suggests the use of the Alexnet architecture to analyze transfer learning and we focus on the problem of when and which DCN classifiers to retrain so as to maximize performance of the ensemble classifier. Our experimental results using the publicly available NCLT dataset [13] revealed that retraining scheduling of a DCN classifier ensemble is crucial and performance is significantly increased using planned scheduling. II. R ELATED W ORKS End-to-end training of DCN for visual self-localization has attracted interest in recent years. In [14], DCN is introduced as the regressor to achieve end-to-end training of 6DOF camera relocalization using RGB and RGB-D. Very recently [15], the two regression approaches of random forest (RF) [16] and DCN are compared, and furthermore the novel task of mapping RF to a neural network is considered to achieve a good efficiency-accuracy tradeoff. On the other hand, a major limitation of regression approaches is that they require finegrained training sets, such as images annotated with 6DOF camera poses, which severely limits their applicability to large-scale long-term map learning. One of the most similar formulations to ours is the formulation of topological localization [17], which has some desirable properties including map compactness and robustness against map errors. Alexnet has been a popular tool for analyzing transfer learning. In [3], analysis of transfer learning, rather than achieving state-of-the-art performance, is the main focus. The reference implementation by Caffe is used in its original form, so that the analysis results will be comparable, extensible and useful to larger number of researchers. In [18], the authors argue that a large image dataset such as ImageNet contains much more information than officially announced, and most often such existing knowledge resources are ignored. Based on this idea, they presented a novel method for zero-shot learning (i.e., transfer learning). In [19], the problem of topological self-localization is addressed using fusion and binarization of DCN features. In the study, the DCN architecture is based on a pre-trained model using the ImageNet dataset, to confirm the generalization of the automatically learned features, and to demonstrate that the description power acquired by the DCN is transferable to specific datasets. Our approach is informed by domain adaptation and transfer learning approaches, ranging from parameter adaptation, feature transformation, and metric learning, to deep learning techniques, which have been applied to wide variety of visual recognition tasks [6]. In [20], a feature transformation termed marginalized denoising autoencoder (MDA) has been extended to denoise both the source and target data in such a way that the features become domain invariant and adaptation is easier. In [7], scalable greedy algorithms for transfer learning are presented, where the authors focus on how to select and combine sources from a large pool of data to yield good performance on a target task. In [8], the problem of classifier learning from only positive and unlabeled data is addressed on binary classifier (e.g., SVM), and exploit the fact that the conditional probability of a model trained on labeled and unlabeled examples is not very different from a model trained on fully labeled examples, assuming that positive examples are labeled at random. In [21], the problem of transfer learning is addressed in an interesting setting, where the target class has very few training examples. The authors aim to discover similar classes and transfer knowledge among them, by assuming that the classes have been organized into a fixed tree hierarchy and that the hierarchy is available or learnable. Our study is related to the paradigm of life-long learning or open world recognition, in which knowledge is accumulated and maintained across domains. We also employ midlevel image representation provided by DCN. In [22], the authors present a novel region-based image representation where the Naive Bayes nearest neighbor model is applied and seamlessly integrated into a DCN. Very recently [23], a new region-based feature encoding is presented using multiple convolutional layers for feature extraction and saliency identification. Our approach is also related to ensemble learning of DCNs; However, use of DCN ensembles in visual self-localization has not been explored in the context of longterm map learning. In this study, we present a novel DCN ensemble approach that is specifically customized for visual place classifiers. III. A PPROACH The long-term map learning framework consists of two alternately repeated missions (one iteration): exploration and adaptation (Fig. 2). The framework is initialized with a size one classifier set C0 = {C10 }, which consists of a single DCN classifier C10 that is obtained by pretraining a DCN using Bigdata such as ImageNet. A new classifier set Ci ={Cij } is then obtained by using additional training data in each i-th iteration (i ≥ 1). In experiments, we use as the initial DCN classifier C10 the Alexnet architecture pretrained on the ImageNet LSVRC-2012 dataset, and we consider one iteration of the two missions per season. The exploration mission aims at robot exploration of the entire environment, while keeping track of the robot’s global position (e.g., using pose tracking and relocation), as much as possible, in order to collect mapped images that have global viewpoint information, and optionally, the collected data may be further post-processed to refine the viewpoint information by structure-from-motion [24] or SLAM [25]. All the collected images that have viewpoint information are used as training data for the subsequent i-th adaptation mission (See Fig. 2). We denote training data that is collected in the i-th exploration as Di = {(v, I)}, where I and v respectively are an image and its viewpoint. The adaptation mission aims to obtain a new set of DCN classifiers Ci by fine-tuning existing DCN classifiers Ci−1 based on transfer learning and domain adaptation, given training data Di that is obtained in the latest i-th exploration mission. As mentioned previously, we have a binary choice: whether a specific DCN classifier in Ci−1 should be finetuned with a specific training set or not, where there are 2i possible DCN classifiers. We denote a new classifier that is obtained by fine-tuning an existing classifier Ci−1 j i . For by incorporating a new training set Di as Ci−1 ⊕ D j example, if we fine-tune a DCN C10 using training data D3 and then the resulting DCN is further fine-tuned using D4 , the final DCN is C = C10 ⊕ D3 ⊕ D4 . We discuss the topic of retraining scheduling (i.e., the questions of when and which DCN classifiers should be fine tuned) in III-A. The adaptation mission also involves the discovery of a new set of place classes that is suitable for VPC. Since the area covered by the robot exploration and its appearance differs among different explorations, the way of defining place classes should also differ among different environments. We discuss the topic of unsupervised place-definition and workspace-partitioning discovery in III-B. The VPC task is a part of the exploration mission and attempts visual robot localization using the latest classifiers Ci−1 . The VPC task assumes no prior knowledge of the robot pose, which is a challenging self-localization scenario called global localization [17], although our VPC would also be useful for other scenarios, including pose tracking. Ideally one would like to use only a single classifier C = C10 ⊕ij=1 D j that has been repeatedly fine-tuned using all available training data as it is expected to be most informative among all possible DCN classifiers. However, in practice, this simple Fig. 2. Long-term map learning framework. strategy turns out to yield poor VPC performance, due to overfitting and numerous false positives. Therefore we apply fusing information C∗ = F(Ci ) from an ensemble of DCN classifiers to obtain more reliable classification results. The definition of place classes can be different among different classifiers, so transform outputs from individual classifiers to a unified global map coordinate system using a fusion function. We discuss the information fusion function F in III-C. A. Retraining Scheduling Recall that the i-th adaptation mission selects a subset of existing DCN classifiers {C10 } ∪ Ci−1 , retrains (i.e., fine-tunes) each of the selected classifiers using the newly obtained training data Di , and then replaces one of the existing classifiers with each newly trained one. Therefore, we need to schedule which classifier to retrain and which classifier to replace, given the classifier set {C10 } ∪ Ci−1 . Note that a DCN classifier k ∈ [1, |Ci |] at the i-th mission can be uniquely identified by its history of retraining in the j-th mission ( j ∈ [1, i]). For simplicity, let us denote this history by a bit string Bi = [b1 · · · bi ] where each bit b j ( j ∈ [1, i]) represents whether the specific DCN classifier has been retrained (b j = 1) or not (b j = 0) at the j-th adaptation mission with the j-th training data. In this study, we developed three different strategies for scheduling. The first strategy, termed ST1, is based on the idea that the newest training set (acquired at the current i-th season) is expected to be best suited for future missions and hence is preferentially selected for the current mission’s retraining. This strategy is represented by ! i N(Bik ) i T i . (1) B̂ = arg max ∑ Bk · [0 · · · 01] + 1+i Bi k=1 The function N(B) returns the number of 1-bits in B N(B) = B · [1 · · ·11]T (2) and is used here as a lower priority objective for maximizing the number of 1-bits in Bik . The second strategy, termed ST2, is based on the idea that the number of fine-tuning steps for each DCN should be adequately controlled so as to achieve a good tradeoff between generalization and specialization abilities. This strategy is represented by ! i) i N(B k B̂i = arg max ∑ − N(Bik ) − N̄ + . (3) 1+i Bi k=1 N̄ is a pre-set integer parameter and represents the appropriate number of fine-tunings. In our experiments, we test three different values N̄ =1, 2, and 3. The third strategy, termed ST3, is based on the idea that individual training sets are not equally important and there must be a single most useful training set, which should be preferentially selected for the current mission’s retraining. This strategy is represented by ! i  i T i i (4) B̂ = arg max ∑ Bk · B̄ · δ N(Bk ) − 1 . Bi k=1 B̄ is a pre-set vector parameter where the j-th element is exp(−|k̄ − j|) and k̄ is the identifier (ID) of the appropriate training set. In our experiments, we test all the i different IDs (k̄ =1, 2, through i). Fig. 3 shows different settings for the scheduling strategies described above. We considered a sequence of four seasons, three different parameter settings N̄ = 1, 2, 3 for ST2, and four different settings k̄ = 1, 2, 3, 4 for ST3. Fig. 3. Visualization of different scheduling strategies. For each method, each row corresponds to a specific DCN. Each column corresponds to a specific training set, from left to right, “3/31,” “8/4,” “11/17,” and “1/22” respectively. Each colored box (green, red, orange, blue) indicates that a specific DCN is fine-tuned by a specific training set (“3/31,” “8/4,” “11/17,” “1/22”). B. Unsupervised Place Definition The unsupervised place definition is a pre-processing part of the per-classifier fine-tuning procedure, used to partition the robot’s workspace into places, so as to maximize VPC performance. A place definition algorithm takes as input a set of images and viewpoints collected by the mobile robot in the target environment. Once place classes are defined, we group images into clusters with the same place ID. Note that the place definition should occur prior to training of the classifier, and influences both training and classification performance. We developed three different place definition strategies. The first is location cue strategy. It partitions the sequence of images by the robot’s travel distance, and assigns each sub-sequence a place label. This strategy is robust against variations in the robot’s speed but does not take into account appearance information that is available from the DCN. Length of travel distance for each sub-sequence is predefined as a constant Td . In this study, we performed a coarse optimal discretization search among Td =3i [m] (i ≥ 1), and chose Td = 18, which provided a good balance between efficiency and accuracy. The second strategy is combined location-appearance cue strategy. The basic idea is to use an intermediate layer’s response from an independent DCN as an additional cue for clustering images into place classes. We use the 6-th layer from a DCN C∗ as the visual cue, as it demonstrated excellent performance in image classification tasks in [26]. The workspace partitioning procedure is as follows. (1) Images are represented by 4,096 dimensional 6-th layer features from the DCN. (2) These are used as input for kmeans clustering to obtain image clusters. (3) The location cue is performed on each cluster to further partition the cluster into sub-clusters. For the DCN C∗ , we used the aforementioned C10 that is pre-trained on ImageNet LSVRC2012 dataset. The third strategy is an incremental clustering based on location and appearance cues. We represent appearance of a place class by a keyframe with its L2-normalized 4,096 dimensional 6-th layer feature ( f ) from the DCN, and represent location of each keyframe or each mapped image by its viewing location (x, y) and viewing angle θ with respect to the global map coordinate. The clustering algorithm begins with an empty set of place classes, and then iterates for each mapped image. During each iteration, it tries to insert the mapped image into a spatially nearest place class, whose viewing location is closest to that of the mapped image. If viewing location (x, y), viewing angle θ and appearance feature f of the spatially nearest place class are sufficiently similar with xi , yi , θi , fi of the mapped image, such that |(x − xi , y − yi )| < 30, |θ − θi | < π /6 and | f − fi | < 0.8, it inserts the mapped image into the class. Otherwise it creates a new place class using the mapped image as the sole member. 100 80 60 40 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 1 2 3 4 mission ID error:10m upd:1 Fig. 4. Experimental environment. The trajectories of the four training sets, “2012/3/31,” “2012/8/04,” “2012/11/17,” and “2012/1/22,” used in our experiments are visualized in purple, blue, light-blue, and green curves and are overlaid using a bird’s eye view imagery. 100 80 60 C. Information Fusion The information fusion function F takes as input a set of |Ci | classifier responses and produces a list of top-X ranked place classes. We exploit the probability value returned by the last layer of each DCN classifier. The procedure begins by concatenating the top-X ranked place classes from each DCN classifier, to obtain a list with length |Ci |X. We do not calibrate the probability distribution of individual DCN classifiers prior to the concatenation. Then, the concatenated list is sorted in the order of highest to lowest probability value and the top-X ranked classes are output as the final classification result. 40 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 1 2 3 4 mission ID error:10m upd:2 100 80 60 40 IV. E XPERIMENTS We evaluated the suitability of the methods presented above for long-term map learning using the NCLT dataset [13]. The NCLT dataset is a long-term autonomy dataset for robotics research collected on the University of Michigan’s North Campus (Fig. 4). The dataset consists of omnidirectional imagery, 3D lidar, planar lidar, GPS, and odometry data, and we use the monocular images from the frontdirected camera (“camera #5”) for our VPC tasks. During vehicle travel through both indoor and outdoor environments, various types of appearance changes are encountered with respect to the mapped images. These originate from the movement of people, parked cars, furniture, construction of the building, opening/closing of doors, placing/removing of posters, as well as other nuisance changes originating from illumination changes, viewpoint dependent changes of object appearances and occlusions, weather changes, falling leaves and snow. These appearance changes make our crossseason VPC task a challenging one. We repeated the longterm map learning in Fig. 2 four times (See Fig. 3), by using four datasets from four different seasons “2012/3/31,” “2012/8/04,” “2012/11/17,” and “2012/1/22” as individual training sets, and an additional set “2012/2/19” as test data for the last (i.e., 4-th) mission. We followed a standard procedure for fine-tuning. The classification function in the DCN is a softmax classifier that computes the probability ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 1 2 3 4 mission ID error:10m upd:3 Fig. 5. Performance results. Vertical axis: success ratio. Horizontal axis: mission ID. The mission IDs j = 1, 2, 3, and 4 respectively correspond to the seasons of “3/31,” “8/4,” “11/17,” and “1/22.” “error” indicates the location error allowed [m] that is used to judge whether a VPC task is successful or not to compute success ratio. “upd:1, 2, and 3” respectively indicate the place definition strategies “location,” “location-appearance,” and “incremental clustering” described in III-B. of all the place classes. To fine-tune the DCN, we changed the softmax classifier using a new value equal to the number of place classes. The DCN parameters were then fine-tuned on the new training datasets. Input images were resized to 256 × 256. The DCN parameters were then fine-tuned on the new training datasets. Fig. 4 shows a bird’s eye view of the environment and the robot’s trajectories of the four adaptation missions. Fig. 5 shows performance results. We conducted performance evaluations for the different UPD algorithms described in III-B: location cue strategy (“#1”), locationappearance cue strategy (“#2”), and incremental clustering strategy (“#3”). We also conducted performance evaluations 100 100 100 80 80 80 60 60 60 40 40 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 40 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 1 2 3 0 1 4 2 mission ID 3 4 1 80 80 80 60 60 60 40 40 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 0 40 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 3 4 2 mission ID 3 4 1 100 80 80 60 60 60 40 40 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 0 40 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 3 4 mission ID Fig. 6. ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 1 2 3 4 mission ID err:20m test:ex upd:1 4 mission ID 100 20 3 err:10m test:ex upd:3 80 2 2 mission ID err:10m test:ex upd:2 100 1 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 0 1 err:10m test:ex upd:1 4 err:20m upd:3 100 20 3 mission ID err:20m upd:2 100 2 2 mission ID err:20m upd:1 100 1 ST1 ST2 N=1 ST2 N=2 ST2 N=3 ST3 k=1 ST3 k=2 ST3 k=3 ST3 k=4 20 err:20m test:ex upd:2 1 2 3 4 mission ID err:20m test:ex upd:3 Fig. 8. Failure examples. For each example, from left to right, the query image, followed by the 1st ranked image through the 10th ranked image. Additional results using different settings. Fig. 7. Success examples. For each example, from left to right, the query image, followed by the 1st ranked image through the 10th ranked image. for two different VPC scenarios, “fine localization” and “coarse localization”, in which allowed localization errors were set to 10 m and 20 m, respectively. We also considered a different type of test data, which is identified by “test:ex”. Unlike the default setting where the (i + 1)-th exploration season’s set is used as test data for the i-th adaptation mission, the setting “test:ex” uses a fixed test set “2012/2/19” regardless of the mission ID (i). Note that the scheduling strategy ST2 with N̄ = 1 is competitive or outperforms the other strategies for almost all missions and for both the fine and coarse localization scenarios as well as for both types of test data. As mentioned, this strategy controls finetuning number as close to N̄ as possible so as to achieve a good trade-off between generalization and specialization abilities. Moreover, the appropriate parameter N̄ turned out to be 1, meaning that in the case of ST2, fine-tuning should be performed only once for each DCN. The reason may be that fine-tuning more than once led to over-fitting and could not generalize well to the unseen test data. Among the other strategies, ST3 with k̄ = 1 exhibited relatively good performance. The reason may be that the single DCN trained on the specific season k̄ = 1 (“2012/3/31”) was well-suited for much of the test data considered here. From the above results, it could be concluded that the proposed framework of planned retraining scheduling combined with information fusion is effective for cross-season VPC tasks, particularly when fine-tuning number is controlled. Figs. 7 and 8 show success and failure examples. We used strategy ST2 with N̄ = 1 for the ensemble classifier. As shown in Fig. 7, the classifier captures scene structure and discriminative characteristics of the scenes both for indoor and outdoor environments. On the other hand, failure often occurs from non-discriminative scenes as shown in Fig. 8. Fig. 9 shows instances of unsupervised place definition. We show results for three different definition algorithms. As can be seen, the location cue strategy uniformly partitioned the robot’s trajectories into equal-length sub-trajectories (i.e., place classes). On the other hand, the location-appearance cue strategy and the incremental clustering strategy tend to group similar successive locations into the same class. These two strategies yielded the best performances and the former was slightly better than the latter in the experiments conducted (See Figs. 5 and 6). V. C ONCLUSIONS We presented a long-term map learning framework for cross-season VPC. This framework enabled efficient transfer learning from one season to the next, at a small constant cost, and without wasting the robot’s available long-termmemory by memorizing very large amounts of training data. To realize an acceptable tradeoff between generalization and specialization abilities, we employed an ensemble of DCN classifiers and considered the task of scheduling when and which classifiers to retrain, given a previous season’s DCN classifiers as the sole prior knowledge. We also presented a unified framework and proposed practical strategies to implement retraining scheduling. Furthermore, we addressed the task of partitioning the robot’s workspace into places to define place classes in an unsupervised manner, to maximize Fig. 9. Qualitative results of unsupervised place definition algorithms. Locations on the robot’s trajectories are classified into different place classes and overlaid on bird’s eye view imagery of the environment using different colors for different classes. VPC performance. Through long-term map learning and VPC experiments, we have shown that (a) the ensemble DCN classifier performs comparably or better than a single DCN classifier, and (b) retraining scheduling of DCN classifiers is crucial, to achieve a good balance between generalization and specialization. Future work should address the map building stage. Currently, our experimental implementation assumes finegrained viewpoint information for mapped images and future work should focus on the issue of map errors. Furthermore, visual place classifiers should be modified when viewpoint information of mapped images is incrementally updated during the long-term multi-session map building process. Adaptation of the place definition to changing environments is another important direction for future research. R EFERENCES [1] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” in Advances in neural information processing systems, 2012, pp. 1097–1105. [2] T. Naseer, L. Spinello, W. Burgard, and C. Stachniss, “Robust visual robot localization across seasons using network flows,” in TwentyEighth AAAI Conference on Artificial Intelligence, 2014. [3] J. Yosinski, J. Clune, Y. Bengio, and H. Lipson, “How transferable are features in deep neural networks?” in Advances in neural information processing systems, 2014, pp. 3320–3328. [4] K. Saenko, B. Kulis, M. Fritz, and T. Darrell, “Adapting visual category models to new domains,” Computer Vision–ECCV 2010, pp. 213–226, 2010. [5] S. Chopra, S. Balakrishnan, and R. Gopalan, “Dlid: Deep learning for domain adaptation by interpolating between domains,” in ICML workshop on challenges in representation learning, vol. 2, no. 6, 2013. [6] V. M. Patel, R. Gopalan, R. Li, and R. Chellappa, “Visual domain adaptation: A survey of recent advances,” IEEE signal processing magazine, vol. 32, no. 3, pp. 53–69, 2015. [7] I. Kuzborskij, F. Orabona, and B. Caputo, “Scalable greedy algorithms for transfer learning,” Computer Vision and Image Understanding, vol. 156, pp. 174–185, 2017. [8] C. Elkan and K. Noto, “Learning classifiers from only positive and unlabeled data,” in Proceedings of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2008, pp. 213–220. [9] M. Oquab, L. Bottou, I. Laptev, and J. Sivic, “Learning and transferring mid-level image representations using convolutional neural networks,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2014, pp. 1717–1724. [10] A. Masatoshi, C. Yuuto, T. Kanji, and Y. Kentaro, “Leveraging image-based prior in cross-season place recognition,” in Robotics and Automation (ICRA), 2015 IEEE International Conference on. IEEE, 2015, pp. 5455–5461. [11] T. Kanji, “Self-localization from images with small overlap,” in Intelligent Robots and Systems (IROS), 2016 IEEE/RSJ International Conference on. IEEE, 2016, pp. 4497–4504. [12] F. Xiaoxiao, T. Kanji, I. Kouya, and H. Guoqing, “Unsupervised place discovery for visual place classification,” in Machine Vision Applications (MVA), 2017 Fifteenth IAPR International Conference on. IEEE, 2017, pp. 109–112. [13] N. Carlevaris-Bianco, A. K. Ushani, and R. M. Eustice, “University of michigan north campus long-term vision and lidar dataset,” The International Journal of Robotics Research, vol. 35, no. 9, pp. 1023– 1035, 2016. [14] A. Kendall, M. Grimes, and R. Cipolla, “Posenet: A convolutional network for real-time 6-dof camera relocalization,” in Proceedings of the IEEE international conference on computer vision, 2015, pp. 2938–2946. [15] D. Massiceti, A. Krull, E. Brachmann, C. Rother, and P. H. Torr, “Random forests versus neural networks?what’s best for camera localization?” in Robotics and Automation (ICRA), 2017 IEEE International Conference on. IEEE, 2017, pp. 5118–5125. [16] J. Shotton, B. Glocker, C. Zach, S. Izadi, A. Criminisi, and A. Fitzgibbon, “Scene coordinate regression forests for camera relocalization in rgb-d images,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2013, pp. 2930–2937. [17] R. Arroyo, P. F. Alcantarilla, L. M. Bergasa, and E. Romera, “Are you able to perform a life-long visual topological localization?” Autonomous Robots, pp. 1–21, 2017. [18] E. Gavves, T. Mensink, T. Tommasi, C. G. Snoek, and T. Tuytelaars, “Active transfer learning with zero-shot priors: Reusing past datasets for future tasks,” in Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 2731–2739. [19] R. Arroyo, P. F. Alcantarilla, L. M. Bergasa, and E. Romera, “Fusion and binarization of cnn features for robust topological localization across seasons,” in Intelligent Robots and Systems (IROS), 2016 IEEE/RSJ International Conference on. IEEE, 2016, pp. 4656–4663. [20] G. Csurka, B. Chidlowskii, S. Clinchant, and S. Michel, “Unsupervised domain adaptation with regularized domain instance denoising,” in Computer Vision–ECCV 2016 Workshops. Springer, 2016, pp. 458– 466. [21] N. Srivastava and R. R. Salakhutdinov, “Discriminative transfer learning with tree-based priors,” in Advances in Neural Information Processing Systems, 2013, pp. 2094–2102. [22] M. Mancini, S. R. Bulo, E. Ricci, and B. Caputo, “Learning deep nbnn representations for robust place categorization,” IEEE Robotics and Automation Letters, 2017. [23] Z. Chen, F. Maffra, I. Sa, and M. Chli, “Only look once, mining distinctive landmarks from convnet for visual place recognition,” in 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2017), 2017. [24] J. L. Schonberger and J.-M. Frahm, “Structure-from-motion revisited,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 4104–4113. [25] Y. Latif, C. Cadena, and J. Neira, “Robust loop closing over time for pose graph slam,” The International Journal of Robotics Research, vol. 32, no. 14, pp. 1611–1626, 2013. [26] A. Babenko, A. Slesarev, A. Chigorin, and V. Lempitsky, “Neural codes for image retrieval,” in European conference on computer vision. Springer, 2014, pp. 584–599.
1cs.CV
Coalgebraic Logic Programming: from Semantics to Implementation arXiv:1312.6568v1 [cs.PL] 23 Dec 2013 Ekaterina Komendantskaya∗ School of Computing, University of Dundee, UK John Power† Department of Computer Science, University of Bath, UK Martin Schmidt Institute of Cognitive Science, Osnabrück University, Germany Abstract Coinductive definitions, such as that of an infinite stream, may often be described by elegant logic programs, but ones for which SLD-refutation is of no value as SLD-derivations fall into infinite loops. Such definitions give rise to questions of lazy corecursive derivations and parallelism, as execution of such logic programs can have both recursive and corecursive features at once. Observational and coalgebraic semantics have been used to study them abstractly. The programming developments have often occurred separately and have usually been implementation-led. Here, we give a coherent semantics-led account of the issues, starting with abstract category theoretic semantics, developing coalgebra to characterise naturally arising trees, and proceeding towards implementation of a new dialect, CoALP, of logic programming, characterised by guarded lazy corecursion and parallelism. Keywords: Logic Programming, Coalgebra, Observational Semantics, Corecursion, Coinduction, Parallelism 1 Introduction The central algorithm of logic programming is SLD-resolution [33, 35, 46]. It is primarily used to obtain SLD-refutations; it is usually given least fixed point semantics; and it is typically implemented sequentially [35, 46]. All three of these traditions have been challenged over the years, for related reasons. For example, infinite streams of bits can be described naturally in terms of a logic program Stream: ∗ The work was supported by the Engineering and Physical Sciences Research Council, UK: Postdoctoral Fellow in TCS grant EP/F044046/1-2, EPSRC First Grant EP/J014222/1, and EPSRC Grant EP/K031864/1. † The work was supported by Royal Society grant ”Universal Algebra and its dual: monads and comonads, Lawvere theories and what?”, EPSRC grant EP/K028243/1, and SICSA Distinguished Visiting Fellow grant. 1 bit(0) ← bit(1) ← stream(scons (x,y)) ← bit(x), stream(y) SLD-resolution is of value here, but SLD-refutations are not, and that is standard for coinductively defined structures [18, 23, 35, 37, 45]. Consequently, least fixed point semantics, which is based on finiteness of derivations, is unhelpful. Stream can be given greatest fixed point semantics [35], but greatest fixed point semantics is incomplete in general, failing for some infinite derivations. Stream can alternatively be given coalgebraic semantics [6, 9] or observational semantics [9, 14]. Coalgebraic semantics is, in general, well-suited to describing parallel processes [22, 43]. In this paper, we propose a single coherent, conceptual semantics-led framework for this, developing and extending three recent conference papers [27, 29, 30]. We start from the theoretical, with an abstract category theoretic semantics for logic programming, and we proceed to the applied, ultimately proposing a new dialect, CoALP, of logic programming based on our abstract development. We do not change the definition of a logic program; we rather change the analysis of it. Stream is a leading and running example for us. In more detail, a first-order logic program consists of a finite set of clauses of the form A ← A1 , . . . , An where A and the Ai ’s are atomic formulae, typically containing free variables, and with the Ai ’s mutually distinct. In the ground case, i.e., if there are no free variables, such a logic program can be identified with a function p : At −→ Pf (Pf (At)), where At is the set of atomic formulae and p sends an atomic formula A to the set of sets of atomic formulae in each antecedent of each clause for which A is the head [6, 9, 22]. Such a function is called a coalgebra for the endofunctor Pf Pf on the category Set. Letting C(Pf Pf ) denote the cofree comonad on Pf Pf , given a ground logic program qua Pf Pf -coalgebra, we characterise and-or parallel derivation trees [17,19,41] in terms of the C(Pf Pf )-coalgebra structure corresponding to p, see Section 3. And-or parallel derivation trees subsume SLD-trees and support parallel implementation and the Theory of Observables [9, 14]. The extension from ground logic programs to first-order programs is subtle, requiring new abstract category theory. Nevertheless, it remains in the spirit of the situation for ground logic programs. Our characterisation of and-or parallel derivation trees does not extend from ground to arbitrary logic programs exactly, but it fails in particularly interesting ways: the relationship between and-or trees and ours is at the heart of the paper. Indeed, the analysis of trees is fundamental to us. We end our abstract development by proving soundness, completeness, correctness and full abstraction results for coalgebraic semantics in Section 3. Proceeding from the abstract to the applied, two aspects of logic programming that are both desirable and problematic in practice are corecursion and parallelism. Many accounts of corecursion in logic programming, e.g., CoLP [18, 45], use explicit annotation of corecursive loops to terminate infinite derivations, see Section 4. In such accounts, inductive and coinductive predicates are labelled in order to make the distinction between admissible (in corecursion) and non-admissible (in recursion) infinite loops. But some predicates need to be treated as recursive or corecursive depending on the context, making annotation prior to program execution impossible. Example 48, extending Stream, illustrates this. 2 We propose an alternative approach to corecursion in logic programming: a new derivation algorithm based on the coinductive trees – structures directly inspired by our coalgebraic semantics. The resulting dialect CoALP is based on the same syntax of Horn-clause logic programming, but, in place of SLD-resolution, it features a new coinductive derivation algorithm. CoALP’s lazy corecursive derivations and syntactic guardedness rules are similar to those implemented in lazy functional languages, cf. [5,10,15]. Unlike alternative approaches [18, 45], CoALP does not require explicit syntactic annotations of coinductive definitions. We discuss coinductive trees and derivations in Section 4. There, we prove soundness and completeness of CoALP relative to the coalgebraic semantics of Section 3. Another distinguishing feature of logic programming languages is that they allow implicit parallel execution of programs. The three main types of parallelism used in implementations are and-parallelism, or-parallelism, and their combination: [17, 19, 41]. However, many first-order algorithms are P-complete and hence inherently sequential [11, 24]. This especially concerns first-order unification and variable substitution in the presence of variable dependencies. Care is required here. For example, in Stream, the goal stream(scons(x, scons(y,x))), if processed sequentially, leads to a failed derivation owing to ill-typing, whereas if proof search proceeds in a parallel fashion, it may find substitutions for x, e.g., 0 and nil, in distinct parallel branches of the derivation tree, but such a derivation is not sound, see Example 74. Existing implementations [17,19,41] of parallel SLD-derivations require keeping records of previous substitutions and so involve additional data structures and algorithms that coordinate variable substitution in different branches of parallel derivation trees; which ultimately restricts parallelism. If such synchronisation is omitted, parallel SLD-derivations may lead to unsound results as in Stream above. Again, this can be seen as explicit resource handling, where resources are variables, terms, and substitutions. In Kowalski’s terms of Logic Programming = Logic + Control [33], this leads to the separation of issues of logic (unification and SLD-resolution) and control (underlying implementation tools) in most parallel logic programming implementations, as we explain in Section 5. CoALP offers an alternative solution to this problem. The coinductive resolution of CoALP has an inherent ability to handle parallelism. Namely, coinductive trees with imposed guardedness conditions provide a natural formalism for parallel implementation of coinductive derivations. Parallelisation of CoALP is sound by (guarded) program construction and the construction of coinductive trees. The main distinguishing features of parallelism in CoALP are implicit resource handling and convergence of the issues of logic and control: no explicit scheduling of parallel processes is needed, and parallelisation is handled by the coinductive derivation algorithm. We explain this in Section 5. Ultimately, in Section 6, we propose the first implementation of CoALP, available for download from [44]. Its main distinguishing features are guarded corecursion, parallelism, and implicit handling of corecursive and parallel resources. In Section 7 we conclude and discuss future work. 2 SLD Derivations and Trees they Generate We recall the definitions surrounding the notion of SLD-derivation [35], and we consider various kinds of trees the notion generates. 3 2.1 Background Definitions Definition 1 A signature Σ consists of a set of function symbols f , g, . . . each equipped with an arity. The arity of a function symbol is a natural number indicating the number of arguments it has. Nullary (0-ary) function symbols are called constants. Given a countably infinite set Var of variables, denoted x, y, z, sometimes with indices x1 , x2 , x3 , . . ., terms are defined as follows. Definition 2 The set Ter(Σ) of terms over Σ is defined inductively: • x ∈ Ter(Σ) for every x ∈ Var. • If f is an n-ary function symbol and t1 , . . . ,tn ∈ Ter(Σ), then f (t1 , . . . ,tn ) ∈ Ter(Σ). Definition 3 A substitution is a function θ : Ter(Σ) → Ter(Σ) which satisfies θ( f (t1 , . . . ,tn )) = f (θ(t1 ), . . . , θ(tn )) for every n-ary function symbol f . An alphabet consists of a signature Σ, the set Var, and a set of predicate symbols P1 , P2 , . . ., each assigned an arity. If P is a predicate symbol of arity n and t1 , . . . ,tn are terms, then P(t1 , . . . ,tn ) is a formula, also called an atomic formula or an atom. The firstorder language L given by an alphabet consists of the set of all formulae constructed from the symbols of the alphabet. Definition 4 Given a first-order language L , a logic program consists of a finite set of clauses of the form A ← A1 , . . . , An , where A is an atom and A1 , . . . An (n ≥ 0) are distinct atoms. The atom A is called the head of the clause, and A1 , . . . , An is called its body. Clauses with empty bodies are called unit clauses. A goal is given by ← A1 , . . . An , where A1 , . . . An (n ≥ 0) are distinct atoms. Logic programs of Definition 4 are also called Horn-clause logic programs [35]. Example 5 Program Stream from Introduction defines infinite streams of binary bits. Its signature consists of two constants, 0 and 1, and a binary function symbol scons. It involves two predicate symbols, bit and stream, and it has five atoms, arranged into three clauses, two of which are unit clauses. The body of the last clause contains two atoms. Example 6 ListNat denotes the logic program nat(0) ← nat(s(x)) ← nat(x) list(nil) ← list(cons ( x, y )) ← nat(x), list(y) Operational semantics for logic programs is given by SLD-resolution, a goal-oriented proof-search procedure. 4 Definition 7 Let S be a finite set of atoms. A substitution θ is called a unifier for S if, for any pair of atoms A1 and A2 in S, applying the substitution θ yields A1 θ = A2 θ. A unifier θ for S is called a most general unifier (mgu) for S if, for each unifier σ of S, there exists a substitution γ such that σ = θγ. If θ is an mgu for A1 and A2 , moreover, A1 θ = A2 , then θ is a term-matcher. We assume that, given a goal G = ← B1 , . . . , Bn , there is an algorithm that, given B1 , . . . , Bn , outputs Bi , i ∈ {1, . . . , n}. The resulting atom Bi is called the selected atom. Most PROLOG implementations use the algorithm that selects the left-most atom in the list B1 , . . . , Bn and proceeds inductively. Definition 8 Let a goal G be ← A1 , . . . , Am , . . . , Ak and a clause C be A ← B1 , . . . , Bq . Then G′ is derived from G and C using mgu θ if the following conditions hold: • θ is an mgu of the selected atom Am in G and A; • G′ is the goal ← (A1 , . . . , Am−1 , B1 , . . . , Bq , Am+1 , . . . , Ak )θ. A clause Ci∗ is a variant of the clause Ci if Ci∗ = Ci θ, with θ being a variable renaming substitution such that variables in Ci∗ do not appear in the derivation up to Gi−1 . This process of renaming variables is called standardising the variables apart; we assume it throughout the paper without explicit mention. Definition 9 An SLD-derivation of P ∪ {G} consists of a sequence of goals G = G0 , G1 , . . . called resolvents, a sequence C1 ,C2 , . . . of variants of program clauses of P, and a sequence θ1 , θ2 , . . . of mgu’s such that each Gi+1 is derived from Gi and Ci+1 using θi+1 . An SLDrefutation of P ∪ {G} is a finite SLD-derivation of P ∪ {G} for which the last goal Gn is empty, denoted by ✷. If Gn = ✷, we say that the refutation has length n. The composite θ1 θ2 , . . . is called a computed answer. Traditionally, logic programming has been modelled by least fixed point semantics [35]. Given a logic program P, one lets BP (also called a Herbrand base) denote the set of atomic ground formulae generated by the syntax of P, and one defines TP (I) on 2BP by sending I to the set {A ∈ BP : A ← A1 , ..., An is a ground instance of a clause in P with {A1 , ..., An } ⊆ I}. The least fixed point of TP is called the least Herbrand model of P and duly satisfies modeltheoretic properties that justify that expression [35]. SLD-resolution is sound and complete with respect to least fixed point semantics [35]. The classical theorems of soundness and completeness of this operational semantics [12,13, 35] show that every atom in the set computed by the least fixed point of TP has a finite SLDrefutation, and vice versa. Alternatively, in [26, 28], we described an algebraic (fibrational) semantics for logic programming and proved soundness and completeness results for it with respect to SLD-resolution. Other forms of algebraic semantics for logic programming have been given in [2, 8]. See also Figure 1. However, Programs like Stream induce infinite SLD-derivations and require a greatest fixed point semantics. The greatest fixed point semantics for SLD derivations yields soundness, but not completeness results. Example 10 The program Stream is characterised by the greatest fixed point of the TP operator, which contains stream(sconsω (X ,Y )); whereas no infinite term can be computed via SLD-resolution. 5 ?> =< ?>Algebraic=< ✽[ ✽ ✽✽ ✽✽ ✽ 89semantics:; ✟C ✟✟ ✟ ✟ ✟ ✟ Least fixed 89point of TP:; ?> =< ?> =< Coalgebraic Greatest fixed 89 point of TP :; fibrational [✼✼ ✼✼ ✼✼ ✼ fibrational 89semantics:; C  Finite and Infinite SLD-derivations Finite SLD-derivations Figure 1: Alternative semantics for finite and infinite SLD-derivations. The arrows ↔ show the semantics that are both sound and complete, and the arrow → indicates sound incomplete semantics. The dotted arrow indicates the sound and complete semantics we propose here. Example 11 For the program R(x) ← R( f (x)), the greatest fixed point of the TP operator contains R( f ω (a)), but no infinite term is computed by SLD-resolution. There have been numerous attempts to resolve the mismatch between infinite derivations and greatest fixed point semantics [18, 23, 35, 37, 45]. Here, extending [29, 30], we give a uniform semantics of infinite SLD derivations for both finite and infinite objects, see Figure 1. Coalgebraic semantics has been used to model various aspects of programming [22, 39, 43], in particular, logic programming [6, 9]; here, we use it to remedy incompleteness for corecursion. 2.2 Tree Structures in Analysis of Derivations Coalgebraic Logic Programming (CoALP) we introduce in later sections uses a variety of tree-structures both for giving semantics to logic programming and for implementation of CoALP. Here, we briefly survey the kinds of trees traditionally used in logic programming. For a given goal G, there may be several possible SLD-derivations as there may be several clauses with the same head. The definition of SLD-tree allows for this as follows. Definition 12 Let P be a logic program and G be a goal. An SLD-tree for P ∪ {G} is a possibly infinite tree T satisfying the following: 1. the root node is G 2. each node of the tree is a (possibly empty) goal 3. if ← A1 , . . . , Am , m > 0 is a node in T , and it has n children, then there exists Ak ∈ A1 , . . . , Am such that Ak is unifiable with exactly n distinct clauses C1 = A1 ← B11 , . . . , B1q , ..., Cn = An ← Bn1 , . . . , Bnr in P via mgu’s θ1 , . . . θn , and, for every i ∈ {1, . . . n}, the ith child node is given by the goal ← (A1 , . . . , Ak−1 , Bi1 , . . . , Biq , Ak+1 , . . . , Am )θi 4. nodes which are the empty clause have no children. Each branch of an SLD-tree is an SLD-derivation of P ∪ {G}. Branches corresponding to successful derivations are called success branches, branches corresponding to infinite derivations are called infinite branches, and branches corresponding to failed derivations are called failure branches. A distinctive feature of the SLD-trees is that they allow to 6 exploit alternative choices of clauses in the proof-search; for this reason, they are also known as or-trees. See Figure 2. In parallel logic programming [19], or-parallelism is exploited when more than one clause unifies with the goal. It is thus a way of efficiently searching for solutions to a goal, by exploring alternative solutions in parallel. It has been implemented in Aurora [36] and Muse [1], both of which have shown good speed-up results over a considerable range of applications. Each SLD-derivation, or, equivalently, each branch of an SLD-tree, can be represented by a proof-tree, defined as follows. Definition 13 Let P be a logic program and G = ← A be an atomic goal. A proof-tree for A is a possibly infinite tree T such that • A is the root of T . • Each node in T is an atom. • For every node A′ occurring in T , if A′ has children C1 , . . . ,Cm , then there exists a clause B ← B1 , . . . , Bm in P such that B and A′ are unifiable with mgu θ, and B1 θ = C1 , ... ,Bm θ = Cm . Proof-trees exploit the branching occurring when one constructs derivations for several atoms in a goal; and are also known as and-trees. In parallel logic programming, andparallelism arises when more than one atom is present in the goal. That is, given a goal G = ← B1 , . . . Bn , an and-parallel algorithm for SLD-resolution looks for SLD-derivations for each Bi simultaneously, subject to the condition that the atoms must not share variables. Such cases are known as independent and-parallelism. Independent and-parallelism has been successfully exploited in &-PROLOG [20]. Example 14 Figure 2 depicts a proof tree and an SLD-tree for the goal list(x) in ListNat. Example 15 Stream, i.e., Example 5, allows the following infinite SLD-derivation x/scons(y,z) y/0 stream(x) −−−−−−→ bit(y),stream(z) −−→ stream(z) → . . . containing an infinite repetition of stream(x) for various variables x. So Stream gives rise to infinite SLD-trees. The and-trees, or-trees and their combination have been used in parallel implementations of logic programming, [17, 19, 41]. The main idea was that branches in the SLD-trees and proof-trees can be exploited in parallel. For certain cases of logic programs, such as ground logic programs or some fragments of DATALOG programs, one can do refutations for all the atoms in the goal in parallel [24, 48]. But in general, SLD-resolution is P-complete, and hence inherently sequential [11]. The next definition formalises the notion of and-or parallel trees [17,19], but we restrict it to the ground cases, where such derivations are sound. Definition 16 Let P be a ground logic program and let ← A be an atomic goal (possibly with variables). The and-or parallel derivation tree for A is the possibly infinite tree T satisfying the following properties. • A is the root of T . 7 list(x) list(x) nat(y) θ0 θ1 ✷ list(z) θ0 θ2 ✷ ✷ θ4 θ0 nat(y), list(z) θ1 list(z) θ2 ✷ nat(y1), list(z) list(z) list(z1) ✷ .. ✷ . nat(y2), list(z) list(z1) list(z) nat(y3), list(z) .. ✷ . .. . ✷ .. . Figure 2: A proof tree and an SLD-tree for ListNat with the goal list(x). A possible computed answer is given by the composition of θ0 = x/cons(y, z), θ1 = y/0, θ2 = z/nil; Another computed answer is θ4 = x/nil. • Each node in T is either an and-node or an or-node. • Each or-node is given by •. • Each and-node is an atom. • For every node A′ occurring in T , if A′ is unifiable with only one clause B ← B1 , . . . , Bn in P with mgu θ, then A′ has n children given by and-nodes B1 θ, . . . Bn θ. • For every node A′ occurring in T , if A′ is unifiable with exactly m > 1 distinct clauses C1 , . . . ,Cm in P via mgu’s θ1 , . . . , θm , then A′ has exactly m children given by or-nodes, such that, for every i ∈ {1, . . . , m}, if Ci = Bi ← Bi1 , . . . , Bin , then the ith or-node has n children given by and-nodes Bi1 θi , . . . , Bin θi . Examples of and-or trees are given in Figures 3 and 9. In Section 5, we return to the questions of parallelism for CoALP. 3 Coalgebraic Semantics In this section, we develop the coalgebraic semantics of logic programming, starting from the coalgebraic calculus of infinite trees, through to the observational semantics of SLDderivations. 3.1 A Coalgebraic Calculus of Infinite Trees For the purposes of this paper, a tree T consists of a set Tn for each natural number n, together with a function δn : Tn+1 −→ Tn , yielding . . . Tn+1 −→ Tn −→ . . . −→ T1 −→ T0 = 1 An element of Tn is called a node of T at height n. The unique element of T0 is the root of the tree; for any x ∈ Tn+1 , δn (x) is called the parent of x, and x is called a child of δn (x). Observe that trees may have infinite height, but if all Tn ’s are finite, the tree is finitely branching. F An L-labelled tree is a tree T together with a function l : n∈N Tn −→ L. The definitions of SLD-tree and proof tree, Definitions 12 and 13 respectively, are of finitely branching 8 labelled trees. Both satisfy a further property: for any node x, the children of x, i.e., the elements of δ−1 (x), have distinct labels. This reflects the definition of a logic program, following [35], as a set of clauses rather than as a list, and the distinctness of atoms in the body of a clause. We accordingly say an L-labelled tree is locally injective if for any node x, the children of x have distinct labels. Given a set L of labels, we denote the set of finitely branching locally injective L-labelled trees by TreeL . We briefly recall fundamental constructs of coalgebra, see also [22]. Definition 17 For any endofunctor H : C −→ C, an H-coalgebra consists of an object X of C together with a map x : X −→ HX . A map of H-coalgebras from (X , x) to (Y, y) is a map f : X −→ Y in C such that the diagram X Y HX HY commutes. H-coalgebras and maps of H-coalgebras form a category H-coalg, with composition determined by that in C, together with a forgetful functor U : H-coalg −→ C, taking an Hcoalgebra (X , x) to X . Example 18 Let Pf denote the endofunctor on Set that sends a set X to the set of its finite subsets, and sends a function h : X −→ Y to the function Pf (h) : Pf (X ) −→ Pf (Y ) sending a subset A of X to its image f (A) in Y . A Pf -coalgebra (X , x) is a finitely branching transition system, one of the leading examples of coalgebra [22]. For any set L, the set TreeL of finitely branching locally injective L-labelled trees possesses a canonical Pf -coalgebra structure on it, sending (T, l) to the set of L-labelled trees determined by the children of the root of T . With mild overloading of notation, we denote this Pf -coalgebra by TreeL . Theorem 19 The functor U : Pf -Coalg −→ Set has a right adjoint sending any set L to TreeL . Proof We have already seen that for any set L, the set TreeL possesses a canonical Pf coalgebra structure given by sending an L-labelled tree (T, l) to the set of labelled trees determined by the children of the root of T . For the universal property, suppose we are given a Pf -coalgebra (X , x) and a function h : X −→ L. Put h0 = h : X −→ L. For any a ∈ X , x(a) is a finite subset of X . So Pf (h0 )(x(a)) is a finite subset of L. Send a to the tree generated as follows: the root is labelled by h0 (a); it has Pf (h0 )(x(a)) children, each labelled by the corresponding element of Pf (h0 )(x(a)); replace h0 : X −→ L by h1 = Pf (h0 )(x(−)) : X −→ Pf (L), and continue inductively. The unicity of this as a map of coalgebras is determined by its construction together with the local injectivity condition; its well-definedness follows from the finiteness of any element of Pf (X ). ✷ 9 We adapt this analysis to give a semantic account of the way in which a logic program generates a tree of computations. Given a set L of labels, an L-labelled &∨-tree is a finitely branching tree T together F with a function l : n∈N T2n −→ L. In an L-labelled &∨-tree, the nodes of even height are called &-nodes, and the nodes of odd height are called ∨-nodes. So the &-nodes, such as the root, are labelled, while the ∨-nodes are not. The and-or parallel derivation trees of Definition 16 are labelled &∨-trees satisfying an additional property that reflects logic programs consisting of sets rather than lists of clauses and the distinctness of atoms in the body of a clause. We express the condition semantically as follows: an L-labelled &∨-tree is locally injective if the children of any ∨-node have distinct labels, and if, for any two distinct children of an &-node, the sets of labels of their children are distinct (but may have non-trivial intersection), i.e., for any x, for any y, z ∈ δ−1 (x), one has l(δ−1 (y)) 6= l(δ−1 (z)). Given a set L of labels, we denote the set of locally injective L-labelled &∨-trees by &∨-TreeL . For any set L, the set &∨-TreeL has a canonical Pf Pf -coalgebra structure on it, sending (T, l) to the set of sets of labelled &∨-trees given by the set of sets of L-labelled &∨-trees determined by the children of each child of the root of T . Again, we overload notation, using &∨-TreeL to denote this coalgebra. Theorem 20 The functor U : Pf Pf -Coalg −→ Set has a right adjoint sending any set L to &∨-TreeL . Proof A proof is given by a routine adaption of the proof of Theorem 19. ✷ There are assorted variants of Theorem 20. We shall need one for L-labelled &∨c -trees, an L-labelled &∨c -tree being the generalisation of L-labelled &∨-tree given by allowing countable branching at even heights, i.e., allowing the root to have countably many children, but each child of the root to have only finitely many children, etcetera. Letting Pc denote the functor sending a set X to the set of its countable subsets, we have the following result. Theorem 21 The functor U : Pc Pf -Coalg −→ Set has a right adjoint sending any set L to &∨c -TreeL . 3.2 Coalgebraic Semantics for Ground Programs Using our coalgebraic calculus of trees, we now make precise, in the ground case, the relationship between logic programs and Gupta et al’s and-or parallel derivation trees of Definition 16. In general, if U : H-coalg −→ C has a right adjoint G, the composite functor U G : C −→ C possesses the canonical structure of a comonad C(H), called the cofree comonad on H. A coalgebra for a comonad is subtly different to a coalgebra for an endofunctor as the former must satisfy two axioms, see also [4, 34]. We denote the category of C(H)-coalgebras by C(H)-Coalg. Theorem 22 [22] For any endofunctor H : C −→ C for which the forgetful functor U : Hcoalg −→ C has a right adjoint, the category H-coalg is canonically isomorphic to the category C(H)-Coalg. The isomorphism commutes with the forgetful functors to C. Theorem 22 implies that for any H-coalgebra (X , x), there is a unique C(H)-coalgebra structure corresponding to it on the set X . 10 Recall from the Introduction that, in the ground case, a logic program can be identified with a coalgebra for the endofunctor Pf Pf on Set. By Theorem 20, the forgetful functor U : Pf Pf -coalg −→ Set has a right adjoint taking a set L to the coalgebra &∨-TreeL . Thus the cofree comonad C(Pf Pf ) on Pf Pf sends the set L to the set &∨-TreeL . So Theorem 22 tells us that every ground logic program P seen as a Pf Pf -coalgebra induces a canonical C(Pf Pc )-coalgebra structure on the set At of atoms underlying P, i.e., a function from At to &∨-TreeAt . Theorem 23 Given a Pf Pf -coalgebra p : At −→ Pf Pf (At), the corresponding C(Pf Pf )coalgebra has underlying set At and action p̄ : At −→ &∨-TreeAt as follows: For A ∈ At, the root of the tree p̄(A) is labelled by A. If p(A) ∈ Pf Pf (At) consists of n subsets of Pf (At), then the root of p̄(A) has n children. The number and labels of each child of each of those n children are determined by the number and choice of elements of At in the corresponding subset of Pf (A). Continue inductively. Proof In general, for any endofunctor H for which the forgetful functor U : H-coalg −→ C has a right adjoint G, the C(H)-coalgebra induced by an H-coalgebra (X , x) is given as follows: U (X , x) = X , so the identity map id : X −→ X can be written as id : U (X , x) −→ X . By the definition of adjoint, it corresponds to a map of the form ε(X,x) : (X , x) −→ GX . Applying U to ε(X,x) gives the requisite coalgebra map U ε(X,x) : X −→ C(H)X . Applying this to H = Pf Pf , this C(Pf Pf )-coalgebra structure is determined by the construction in the proof of Theorem 20, which is rewritten as the assertion of this theorem. ✷ Comparing Theorem 23 with Definition 16, subject to minor reorganisation, given a logic program P seen as a Pf Pf -coalgebra, the corresponding C(Pf Pf )-coalgebra structure on At sends an atom A to Gupta et al’s and-or parallel derivation tree, characterising their construction in the ground case. Example 24 Consider the ground logic program q(b,a) ← s(a,b) ← p(a) ← q(b,a), s(a,b) q(b,a) ← s(a,b) The program has three atoms, namely q(b,a), s(a,b) and p(a). So At = {q(b,a), s(a,b), p(a)}. The program can be identified with the Pf Pf -coalgebra structure on At given by p(q(b,a)) = {{}, {s(a,b)}}, where {} is the empty set. p(s(a,b)) = {{}}, i.e., the one element set consisting of the empty set. p(p(a)) = {{q(b,a),s(a,b)}}. The corresponding C(Pf Pf )-coalgebra sends p(a) to the parallel refutation of p(a) depicted on the left side of Figure 3. Note that the nodes of the tree alternate between those labelled by atoms and those labelled by •. The set of children of each • represents a goal, made up of the conjunction of the atoms in the labels. An atom with multiple children is the head of multiple clauses in the program: its children represent these clauses. We use the traditional notation ✷ to denote {}. 11 Where an atom has a single •-child, we can elide that node without losing any information; the result of applying this transformation to our example is shown on the right side of Figure 3. The resulting tree is precisely the and-or parallel derivation tree for the atomic goal ← p(a). ← p(a) ← p(a) q(b, a) q(b, a) s(a, b) s(a, b) ✷ s(a, b) ✷ ✷ s(a, b) ✷ ✷ ✷ Figure 3: The action of p : At −→ C(Pf Pf )(At) on p(a) and the corresponding and-or parallel derivation tree. 3.3 Coalgebraic Semantics for Arbitrary Programs Extending from ground logic programs to first-order programs is not routine. Following normal category theoretic practice, we model the first-order language underlying a logic program by a Lawvere theory [2, 6, 8]. Definition 25 Given a signature Σ of function symbols, the Lawvere theory LΣ generated by Σ is the following category: ob(LΣ ) is the set of natural numbers. For each natural number n, let x1 , . . . , xn be a specified list of distinct variables. Define ob(LΣ )(n, m) to be the set of m-tuples (t1 , . . . ,tm ) of terms generated by the function symbols in Σ and variables x1 , . . . , xn . Define composition in LΣ by substitution. One can describe LΣ without the need for a specified list of variables for each n: in a term t, a variable context is always implicit, i.e., x1 , . . . , xm ⊢ t, and the variable context may be considered as a binder. For each signature Σ, we extend the set At of atoms for a ground logic program to the functor At : LΣop → Set that sends a natural number n to the set of all atomic formulae generated by Σ, variables among a fixed set x1 , . . . , xn , and the predicate symbols appearing in the logic program. A map f : n → m in LΣ is sent to the function At( f ) : At(m) → At(n) that sends an atomic formula A(x1 , . . . , xm ) to A( f1 (x1 , . . . , xn )/x1 , . . . , fm (x1 , . . . , xn )/xm ), i.e., At( f ) is defined by substitution. Given a logic program P with function symbols in Σ, we would like to model P by the putative [LΣop , Pf Pf ]-coalgebra p : At −→ Pf Pf At on the category [LΣop , Set] whose ncomponent takes an atomic formula A(x1 , . . . , xn ) with at most n variables, considers all substitutions of clauses in P whose head agrees with A(x1 , . . . , xn ), and gives the set of sets of atomic formulae in antecedents. Unfortunately, it does not work. Consider the logic program ListNat of Example 6. There is a map in LΣ of the form 0 → 1 that models the nullary function symbol 0. Naturality of the map p : At −→ Pf Pf At op in [LΣ , Set] yields commutativity of the diagram 12 At(1) Pf Pf At(1) At(0) Pf Pf At(0) There being no clause of the form nat(x) ← in ListNat, commutativity implies that there cannot be a clause in ListNat of the form nat(0) ← either, but in fact there is one. We resolve this by relaxing the naturality condition on p to a subset condition, yielding op lax naturality. To define it, we extend At : LΣ → Set to have codomain Poset, which we do by composing At with the inclusion of Set into Poset. Mildly overloading notation, we op denote the composite by At : LΣ → Poset. Poset canonically possesses the structure of a locally ordered category, i.e., there is a canonical partial order on each homset Poset(P, Q) and it is respected by composition. It is given pointwise: f ≤ g if and only if for all x ∈ P, one has f (x) ≤ g(x) in Q. The category LΣ also has a canonical locally ordered structure given by the discrete structure, i.e., f ≤ g if and only if f = g. Any functor from LΣop to Poset is trivially locally ordered, i.e., preserves the partial orders. Definition 26 Given locally ordered functors H, K : D −→ C, a lax natural transformation from H to K is the assignment to each object d of D, of a map αd : Hd −→ Kd such that for each map f : d −→ d ′ in D, one has (K f )(αd ) ≤ (αd ′ )(H f ). Locally ordered functors and lax natural transformations, with pointwise composition and pointwise ordering, form a locally ordered category we denote by Lax(D,C). A final problem arises in regard to the finiteness of the outer occurrence of Pf in Pf Pf . The problem is that substitution can generate infinitely many instances of clauses with the same head. For instance, if one extends ListNat with a clause of the form A ← nat(x) with no occurrences of x in A, substitution yields the clause A ← nat(sn (0)) for every natural number n, giving rise to a countable set of clauses with head A. Graph connectivity, GC, gives another example, see Example 35. We address this issue by replacing Pf Pf by Pc Pf , where Pc is the countable powerset functor, extending Pc Pf from Set to a locally ordered endofunctor on Poset, upon which composition yields the locally ordered endofunctor we seek on Lax(LΣop , Poset). Definition 27 Define Pf : Poset −→ Poset by letting Pf (P) be the partial order given by the set of finite subsets of P, with A ≤ B if for all a ∈ A, there exists b ∈ B for which a ≤ b in P, with behaviour on maps given by image. Define Pc similarly but with countability replacing finiteness. A cofree comonad C(Pc Pf ) exists on Pc Pf and, by Theorem 21, we can describe it: C(Pc Pf )(P) = &∨c -TreeP , with partial order structure generated by Definition 27. In order to extend the correspondence between Pc Pf -coalgebras p : At −→ Pc Pf At and C(Pc Pf )op coalgebras p̄ : At −→ C(Pc Pf )At from Poset to Lax(LΣ , Poset), we need to do some abstract category theory. Let H be an arbitrary locally ordered endofunctor on an arbitrary locally ordered category C. Denote by H-coalgoplax the locally ordered category whose objects are H-coalgebras and whose maps are oplax maps of H-coalgebras, meaning that, in the square 13 X Y ≤ HX HY the composite via HX is less than or equal to the composite via Y . Since C and H are arbitrary, one can replace C by Lax(D,C), for any category D; and replace H by Lax(D, H), yielding the locally ordered category Lax(D, H)-coalgoplax . Proposition 28 The locally ordered category Lax(D, H)-coalgoplax is canonically isomorphic to Lax(D, H-coalgoplax ). Proof Unwinding the definitions, to give a functor J : D −→ H-coalgoplax is, by definition, to give, for each object d of D, a map in C of the form Jd : J0 d −→ HJ0 d, and, for each map f : d −→ d ′ in D, a map in C of the form J0 f : J0 d −→ J0 d ′ , such that J0 d J0 f J/ 0 d ′ ≤ Jd   HJ0 d Jd HJ0 f ′ / HJ 0d subject to locally ordered functoriality equations. These data and axioms can be re-expressed as a locally ordered functor J0 : D −→ C together with a lax natural transformation j : J0 −→ HJ0 , the condition for lax naturality of j in regard to the map f in D being identical to the condition that J0 f be an oplax map of coalgebras from Jd to Jd ′ . This yields a canonical bijection between the sets of objects of Lax(D, H-coalgoplax ) and Lax(D, H)-coalgoplax , that bijection canonically extending to a canonical isomorphism of locally ordered categories. ✷ Proposition 29 Given a locally ordered comonad G on a locally ordered category C, the data given by Lax(D, G) : Lax(D,C) → Lax(D,C) and pointwise liftings of the structural natural transformations of G yield a locally ordered comonad we also denote by Lax(D, G) on Lax(D,C). Proof This holds by tedious but routine checking of all the axioms in the definition of locally ordered comonad. ✷ Given a locally ordered comonad G, denote by G-Coalgoplax the locally ordered category whose objects are G-coalgebras and whose maps are oplax maps of G-coalgebras. Proposition 30 Given a locally ordered comonad G, Lax(D, G)-Coalgoplax is canonically isomorphic to Lax(D, G-Coalgoplax ). Proof A proof is given by routine extension of the proof of Proposition 28. ✷ 14 Theorem 31 [25] Given a locally ordered endofunctor H on a locally ordered category with finite colimits C, if C(H) is the cofree comonad on H, then H-coalgoplax is canonically isomorphic to C(H)-Coalgoplax . Combining Proposition 28, Proposition 30 and Theorem 31, we can conclude the following: Theorem 32 Given a locally ordered endofunctor H on a locally ordered category with finite colimits C, if C(H) is the cofree comonad on H, then there is a canonical isomorphism Lax(D, H)-Coalgoplax ≃ Lax(D,C(H))-Coalgoplax Corollary 33 For any locally ordered endofunctor H on Poset, if C(H) is the cofree comonad on H, then there is a canonical isomorphism Lax(LΣop , H)-Coalgoplax ≃ Lax(LΣop ,C(H))-Coalgoplax Putting H = Pc Pf , Corollary 33 gives us the abstract result we need. The lax natural transformation p : At −→ Pc Pf At generated by a logic program P, evaluated at a natural number n, sends an atomic formula A(x1 , . . . , xn ) to the set of sets of antecedents in substitution instances of clauses in P for which the head of the substituted instance agrees with A(x1 , . . . , xn ). That in turn yields a lax natural transformation p̄ : At −→ C(Pc Pf )At, which, evaluated at n, is the function from the set At(n) to the set &∨c -TreeAt(n) determined by the construction of Theorem 23 if one treats the variables x1 , . . . , xn as constants. See also [7] for a Laxness-free semantics for CoALP. Example 34 Consider ListNat as in Example 6. Suppose we start with A(x, y) ∈ At(2) given by the atomic formula list(cons(x, cons(y, x))). Then p̄(A(x, y)) is the element of C(Pc Pf )At(2) = &∨c -TreeAt(2) expressible by the tree on the left hand side of Figure 4. This tree agrees with the start of the and-or parallel derivation tree for list(cons(x, cons(y, x))). It has leaves nat(x), nat(y) and list(x), whereas the and-or parallel derivation tree follows those nodes, using substitutions determined by mgu’s that might not be consistent with each other, e.g., there is no consistent substitution for x. Lax naturality means a substitution potentially yields two different trees: one given by substitution into the tree, then pruning to remove redundant branches, the other given by substitution into the root, then applying p̄. For example, we can substitute s(z) for both x and y in list(cons(x, cons(y, x))). This substitution is given by applying At to the map (s, s) : 1 −→ 2 in LΣ . So At((s, s))(A(x, y)) is an element of At(1). Its image under p̄(1) : At(1) −→ C(Pc Pf )At(1) is the element of C(Pc Pf )At(1) = &∨c -TreeAt(1) given by the tree in the middle of Figure 4. The laxness of the naturality of p̄ is indicated by the increased length, in two places, of this tree. Before those two places, the two trees have the same structure. Now suppose we make the further substitution of 0 for z. This substitution is given by applying At to the map 0 : 0 → 1 in LΣ . In Figure 4, we depict p̄(0)At(0)At((s, s))(A(x, y)) ∈ &∨c -TreeAt(1) on the right. Two of the leaves of the latter tree are labelled by ✷, but one leaf, namely list(s(0)) is not, so the tree does not yield a proof. Again, observe the laxness. This requires care. Consider the following example, studied in [46]. 15 → → list(c(x, c(y, x))) list(c(s(z), c(s(z), s(z)))) list(c(s(0), c(s(0), s(0)))) nat(x) list(c(y, x)) nat(s(z)) list(c(s(z), s(z))) nat(s(0)) list(c(s(0), s(0))) nat(y) list(x) nat(z) nat(s(z)) list(s(z)) nat(0) nat(s(0)) list(s(0)) nat(z) ✷ nat(0) ✷ Figure 4: The left hand tree depicts p̄(list(cons(x, cons(y, x)))), the middle tree depicts p̄At(s, s)(list(cons(x, cons(y, x)))), i.e., p̄(list(cons(s(z), cons(s(z), s(z))))), and the right tree depicts p̄At(0)At(s, s)(list(cons(x, cons(y, x)))); cons is abbreviated by c. Example 35 (GC) Let GC (for graph connectivity) denote the logic program connected(x,x) ← connected(x,y) ← edge(x,z), connected(z,y). There may be additional function symbols, such as a unary s, and additional clauses to give a database, such as edge(0,s(0)) ← and edge(s(0),s(s(0))) ← . Note the presence of a variable z in the body but not the head of the clause connected(x,y) ← edge(x,z), connected(z,y) That allows derivations involving infinitely many variables, thus not directly yielding a subtree of p̄(connected(x,y)) ∈ &∨c -TreeAt(n) for any n. The subtle relationship between the finite and the infinite illustrated by Example 35 is fundamental to the idea of coalgebraic logic programming, which we develop in the latter sections of the paper. See also Figure 6. Definition 36 Let P be a logic program, G be an atomic goal, and T be the &∨c -tree determined by P and G ∈ At(n). A subtree T ′ of T is called a derivation subtree of T if it satisfies the following conditions: • the root of T ′ is the root of T (up to variable renaming); • if an and-node belongs to T ′ , then at most one of its children belongs to T ′ . • if an or-node belongs to T ′ , then all its children belong to T ′ . A finite derivation tree is successful if its leaves are all or-nodes (equivalently, they are followed only by ✷ in the usual pictures). By Example 35, derivations need not directly yield derivation subtrees. Nevertheless, all subderivations of finite length of a derivation do form derivation subtrees. 16 Theorem 37 (Soundness and Completeness of SLD-refutations) Let P be a logic program, and G be an atomic goal. 1. Soundness. If there is an SLD-refutation for G in P with computed answer θ, then for some n with Gθ ∈ At(n), the &∨c -tree for Gθ contains a successful derivation subtree. 2. Completeness. If the &∨c -tree for Gθ ∈ At(n) contains a successful derivation subtree, then there exists an SLD-refutation for G in P, with computed answer λ for which λσ = θ for some σ. Proof The finiteness of refutations makes this a routine adaptation of the soundness and completeness of the collectivity of SLD-trees for SLD-refutation. 3.4 Coalgebraic Semantics and the Theory of Observables Our coalgebraic analysis relates closely to the Theory of Observables for logic programming developed in [9]. In that theory, the traditional characterisation of logic programs in terms of input/output behaviour and successful derivations is not sufficient for the purposes of program analysis and optimisation. One requires more complete information about SLD-derivations, specifically the sequences of goals and most general unifiers used. Infinite derivations can be meaningful. The following observables are critical to the theory [9, 14]. Definition 38 1. A call pattern is a sequence of atoms selected in an SLD-derivation; a correct call pattern is a sequence of atoms selected in an SLD-refutation. 2. A partial answer is a substitution associated with a resolvent in an SLD-derivation; a correct partial answer is a substitution associated with a resolvent in an SLDrefutation. As explained in [9, 14], semantics of logic programs aims to identify observationally equivalent logic programs and to distinguish logic programs that are not observationally equivalent. So the definitions of observation and semantics are interdependent. Observational equivalence was defined in [14] as follows. Definition 39 Let P1 and P2 be logic programs with the same alphabet. Then P1 is observationally equivalent to P2 , written P1 ≈ P2 , if for any goal G, the following conditions hold: 1. G has an SLD-refutation in P1 if and only if G has an SLD-refutation in P2 . 2. G has the same set of computed answers in P1 as in P2 . 3. G has the same set of (correct) call patterns in P1 as in P2 . 4. G has the same set of (correct) partial answers in P1 as in P2 . Theorem 40 (Correctness) For logic programs P1 and P2 , if the Lax(LΣop ,C(Pc Pf ))-coalgebra structure p̄1 generated by P1 is isomorphic to the Lax(LΣop ,C(Pc Pf ))-coalgebra structure p̄2 generated by P2 (denoted p¯1 ∼ = p¯2 ), then P1 ≈ P2 . The converse of Theorem 40, full abstraction, does not hold, i.e., with the above definition of observational equivalence, there are observationally equivalent programs that have different &∨c -Trees. 17 Example 41 Consider logic programs P1 and P2 with the same clauses except for one: P1 contains A ← B1 , false, B2 ; and P2 contains the clause A ← B1 , false instead. The atoms in the clauses are such that B1 has a refutation in P1 and P2 , and false is an atom that has no refutation in the programs. In this case, assuming a left-to-right sequential evaluation strategy, all derivations that involve the two clauses in P1 and P2 will always fail on false, and P1 will be observationally equivalent to P2 , but they generate different trees because of B2 . We can recover full abstraction if we adapt Definitions 38 and 39 so that they do not rely upon an algorithm to choose a selected atom but rather allow arbitrary choices. This is typical of coalgebra, yielding essentially an instance of bisimulation [22]. In order to do that, we need to modify Definitions 8 and 9 to eliminate the algorithm used in the definitions leading to SLD-derivations. Definition 42 Let a goal G be ← A1 , . . . , Ak and a clause C be A ← B1 , . . . , Bq . Then G′ is non-deterministically derived from G and C using mgu θ if the following conditions hold: • θ is an mgu of some atom Am in the body of G and A; • G′ is the goal ← (A1 , . . . , Am−1 , B1 , . . . , Bq , Am+1 , . . . , Ak )θ. Definition 42 differs from Definition 8 in precisely one point: the former refers to “some atom” where the latter refers to “the selected atom”, with the selection being determined by an algorithm. The distinction means that Definition 42 has nondeterminism built into the choice of atom, which in turn implies the possibility of parallelism in implementation. We will exploit that later. It further implies that a verbatim restatement of Definition 39 but with “SLD-derivation” replaced by “coinductive derivation” also implies the possibility of implementation based on parallelism. Definition 43 A non-deterministic derivation of P ∪ {G} consists of a sequence of goals G = G0 , G1 , . . . called non-deterministic resolvents, a sequence C1 ,C2 , . . . of variants of program clauses of P, and a sequence θ1 , θ2 , . . . of mgu’s such that each Gi+1 is derived from Gi using θi+1 . A non-deterministic refutation of P ∪ {G} is a finite non-deterministic derivation of P ∪ {G} such that its last goal is empty, denoted by ✷. If Gn = ✷, we say that the refutation has length n. The composite θ1 θ2 . . . is called a computed answer. Figure 5 exhibits a non-deterministic derivation for the goal G = stream(x) and the program Stream from Example 5. Given logic programs P1 and P2 over the same alphabet, we write P1 ≈n P2 if, consistently replacing SLD-derivation and SLD-refutation by non-deterministic derivation and nondeterministic refutation in Definitions 38 and 39, P1 and P2 are observationally equivalent. Theorem 44 (Full abstraction) For any logic programs P1 and P2 with the same alphabet, P1 ≈n P2 if and only if p̄1 ∼ = p̄2 . Proof This is routine: as we have allowed any choice of atom rather than depending upon an algorithm to choose a selected atom, observational equivalence accounts for all branches. ✷ The way in which coalgebra models nondeterministic derivations is necessarily complex for a few reasons: 18 →?← stream(x) stream(x) θ1 = {x/cons(y,z)} θ1 = {x/cons(y,z)} bit(y), stream(z) bit(y), stream(z) stream(x) θ1 bit(y), stream(z) θ2 = {y/0} θ′2 = {y/1} stream(z) stream(z) θ3 = {z/cons(y1 ,z1 )} θ′3 = {z/cons(y1 ,z1 )} .. . .. . stream(z)θ2 stream(z)θ′2 θ3 θ′3 .. . .. . Figure 5: Left: Two possible choices for non-deterministic derivation for the goal G = stream(x) and the program Stream, with θ1 = {x/scons(y, z)}, θ2 = {y/0}, θ′2 = {y/1} and θ3 = θ′3 = {y/scons(y1 , z1 )}. Right: the two non-deterministic derivations shown in the form of an SLD-tree. 1. a non-deterministic derivation might involve infinitely many variables, but each At(n) only allows for a finite number of variables. 2. a non-deterministic derivation could involve an infinite chain of substitutions, but an element of At(n) does not allow for that. Consider e.g. Example 11. So, within coalgebra, one can only give a chain of finite approximants to a nondeterministic derivation. Theorem 37 extends routinely from SLD-refutations to non-deterministic refutations. We can further extend it to non-deterministic derivations too, with due care for the possibility of derivations involving infinitely many variables as induced by Example 35. Theorem 45 (Soundness and Completeness of non-deterministic derivations) Let P be a logic program, with p its induced Lax(LΣop , Pc Pf )-coalgebra, and let G be an atomic goal. 1. Soundness. Given any finite subderivation of a non-deterministic derivation of P ∪ {G} with partial answer θ, the subderivation generates a derivation subtree of p̄(Gθ) for some n with Gθ ∈ At(n). 2. Completeness. Given a list θ0 , θ1 , . . . of substitutions, and a list T0 , T1 , . . . of finite derivation subtrees of p̄(Gθ0 ), p̄(Gθ0 θ1 ), etcetera, with Tn θn a subtree of Tn+1 for each n, there is a non-deterministic derivation of P ∪ {G} that generates the Tn ’s. Proof The soundness claim follows from induction on the length of a finite subderivation. For length 0, the statement is trivial. Assume it is true for length n, with derivation subtree Tn of p̄(Gθ). Suppose Gn+1 is derived from Gn using θn+1 and clause Cn+1 , with respect to the atom Am in Gn . Apply θn+1 to the whole of Tn , yielding a derivation subtree of p̄(Gθθn+1 ), and extend the tree at the leaf Am θn+1 by applying θn+1 to each atom in the body of the Cn+1 to provide the requisite and-nodes. Completeness also holds by induction. For n = 0, given a finite derivation subtree T0 of p̄(Gθ0 ), if follows from the finiteness of T0 and the fact that it is a subtree of p̄(Gθ0 ) 19 that it can be built from a finite sequence of derivation steps starting from G, followed by a substitution. Now assume that is the case for Tn , and we are given Tn+1 subject to the conditions stated in the theorem. By our inductive hypothesis, we have a finite derivation from G, followed by a substitution, that yields the tree Tn . That is therefore also true for Tn θn+1 . As Tn+1 is a finite extension of Tn and is a subtree of p̄(Gθ0 . . . θn+1 ), one can make a finite extension of the finite derivation from G that, followed by a substitution, yields Tn+1 . ✷ 4 Corecursion in Logic Programming We now move from abstract theory towards the development of coalgebraic logic programming. Central to this is the relationship between the finite and the infinite. We introduce a new kind of tree in order to make the subtle relationship precise and underpin our formulation of CoALP, a variant of logic programming based on our coalgebraic semantics. 4.1 Coinductive derivations We first return to our running example of program Stream. In Section 2 and Figure 5, we have seen that this program gives rise to non-terminating SLD-derivations and infinite SLD-trees; moreover, the conventional greatest fixed point semantics is unsound for such cases. Coalgebraic semantics of Section 3 suggests the following tree-based semantics of derivations in Stream, see Figure 6. Comparing Figure 5 and Figure 6, we see that computations described by &∨c -Trees suggest parallel branching, much like and-or parallel trees [19], and also – finite height trees in the case of Stream. These two features will guide us in this Section, when we develop the computational algorithms for CoALP, and then follow them with implementation in Section 6. We suggest the following definition of coinductive tree as a close computational counterpart of the &∨c -Trees of the previous section. Definition 46 Let P be a logic program and G = A be an atomic goal. The coinductive tree for A is a possibly infinite tree T satisfying the following properties. • A is the root of T . • Each node in T is either an and-node or an or-node. • Each or-node is given by •. • Each and-node is an atom. • For every and-node A′ occurring in T , if there exist exactly m > 0 distinct clauses C1 , . . . ,Cm in P (a clause Ci has the form Bi ← Bi1 , . . . , Bini , for some ni ), such that A′ = B1 θ1 = ... = Bm θm , for mgu’s θ1 , . . . , θm , then A′ has exactly m children given by or-nodes, such that, for every i ∈ m, the ith or-node has ni children given by andnodes Bi1 θi , . . . , Bini θi . Three coinductive trees for program Stream are shown in Figure 6. In contrast to SLDtrees, coinductive trees restrict unification to term matching, i.e., we have A′ = Bθ, rather than A′ θ = Bθ. Unification in general is inherently sequential [11], but term matching is parallelisable. At the same time, this restriction provides a powerful tool for implicit resource control as it allows one to unfold coinductive trees lazily, keeping each individual 20 stream(x) θ θ θ →2 . . . →3 →1 stream(scons(0, scons(y1, z1 ))) stream(scons(z, y)) bit(z) bit(0) stream(scons(y1, z1 )) stream(y) ✷ bit(y1 ) stream(z1) Figure 6: According to the coalgebraic semantics of the previous section, the left hand tree depicts p̄(stream(x)), the middle tree depicts p̄ At(scons)(stream(x)), and the right tree depicts p̄ At(scons)At(0)At(scons)(stream(x)). The same three trees represent a coinductive derivation for the goal G = stream(x) and the program Stream, with θ1 = x/scons(z, y), θ2 = z/0 andθ3 = y/scons(y1, z1 ). tree at a finite size, provided the program is well-founded; as we discuss in detail in Section 4.2. In our implementation, we assume that every branch of the coinductive tree can by constructed in parallel to other branches, that is, no extra algorithm coordinating the variable substitutions is needed. See also Sections 5 and 6. As can be seen from Figures 4 and 6, one coinductive tree T may not produce the answer corresponding to a refutation by the SLD-resolution. Instead, a sequence of coinductive trees may be needed to advance the derivation. We introduce a new derivation algorithm that allows proof search using coinductive trees. We modify the definition of a goal by taking it to be a pair < A, T >, where A is an atom, and T is the coinductive tree determined by A. Definition 47 Let G be a goal given by an atom ← A and the coinductive tree T induced by A, and let C be a clause H ← B1 , . . . , Bn . Then goal G′ is coinductively derived from G and C using mgu θ if the following conditions hold: • A′ is an atom in T . • θ is an mgu of A′ and H. • G′ is given by the atom ← Aθ and the coinductive tree T θ. Coinductive derivations resemble tree rewriting. They produce the “lazy” corecursive effect: derivations are given by potentially infinite number of steps, where each individual step is executed in finite time. Example 48 Figure 5 shows how Stream gives rise to infinite SLD-trees. But it only gives rise to finite coinductive trees because of the term matching condition in the definition of coinductive tree. Moreover, there is only one coinductive tree for any goal. An infinite derivation can be modelled by an infinite coinductive derivation, as illustrated in Figure 6. Example 49 ListNat, i.e., Example 6, also gives rise to infinite SLD-trees, see Figure 2, but it also only gives rise to finite coinductive trees as, again, all clauses in ListNat are guarded by constructors 0, s, nil, cons. A coinductive derivation for ListNat and the goal list(cons(x, cons(y, x))) is illustrated in Figure 4. Again, an infinite derivation can be modelled by an infinite chain of finite coinductive trees. 21 Note that the definition of coinductive derivation allows for non-deterministic choice of the leaf atoms; compare e.g. with previously seen non-deterministic derivations from Definition 42. Transitions between coinductive trees can be done in a sequential or parallel manner. That is, if there are several non-empty leaves in a tree, any such leaf can be unified with some clause in P. Such leaves can provide substitutions for sequential or parallel tree transitions. In Figure 6, the substitution θ′ = θ2 θ3 is derived by considering mgu’s for two leaves in G1 =< stream(scons(z,y)), T1 >; but, although two separate and-leaves were used to compute θ′ , θ′ was computed by composing the two substitutions sequentially, and only one tree, T3 , was produced. However, we could concurrently derive two trees from T2 instead, G′2 =< stream(scons(0,y)), T2 > and G′′2 =< stream(scons(z,scons(y1 ,z1 ))), T2′ >. We exploit parallelism of such transitions in Sections 5 and 6. Definition 50 Let P be a logic program, G be an atomic goal, and T be a coinductive tree determined by P and G. A subtree T ′ of T is called a coinductive subtree of T if it satisfies the following conditions: • the root of T ′ is the root of T (up to variable renaming); • if an and-node belongs to T ′ , then one of its children belongs to T ′ . • if an or-node belongs to T ′ , then all its children belong to T ′ . A finite coinductive (sub)tree is called a success (sub)tree if its leaves are empty goals (equivalently, they are followed only by ✷ in the usual pictures). Note that coinductive subtrees are not themselves coinductive trees: coinductive trees give account to all possible and-or-parallel proof choices given the terms determined by the goal, whereas a coinductive subtree corresponds to one possible sequential SLD-derivation for the given goal, where unification in the SLD-derivation is restricted to term-matching, cf. Definition 46. In what follows, we will assume that the goal in Definition 47 is given by an atom ← A, and T is implicitly assumed. This convention agrees with the standard logic programming practice, where goals are given by first-order atoms. For example, we say that the goal stream(x) generates the coinductive derivation of Figure 6. The next definition formalises this convention. Definition 51 A coinductive derivation of P ∪ {G} consists of a sequence of goals G = G0 , G1 , . . . called coinductive resolvents and a sequence θ1 , θ2 , . . . of mgu’s such that each Gi+1 is derived from Gi using θi+1 . A coinductive refutation of P ∪ {G} is a finite coinductive derivation of P ∪ {G} such that its last tree contains a success subtree. If Gn contains a success subtree, we say that the refutation has length n. We now modify Definitions 38 and 39 of observational equivalence. Suppose the definitions of a (correct) call pattern and a (correct) partial answer from Definition 38 are re-formulated with respect to coinductive derivations, rather than SLD-derivations. Unlike SLD-derivations, coinductive derivations perform computations in “two dimensions” – at the level of coinductive trees and at the level of transitions between coinductive trees. Both dimensions of computations can be observed. The next definition formalises this. Definition 52 Let P1 and P2 be logic programs with the same alphabet. Then P1 is coinductively observationally equivalent to P2 , written P1 ≈c P2 , if for any goal G, the following conditions hold: 22 1.-4. Conditions of Definition 39, but with coinductive derivations replacing SLD-derivations. 5. The coinductive tree T1 for G and P1 contains a coinductive subtree C iff the coinductive tree T2 for G and P2 contains C, modulo variable renaming. For ground programs, all coinductive derivations will have length 0, and the coinductive tree generated for a given goal will account for all alternative derivations by SLDresolution. Therefore, conditions [1.-4.] of coinductive observational equivalence will be trivially satisfied for all ground logic programs. However, condition [5.] will be able to distinguish different logic programs in such cases. Theorem 53 (Full abstraction) For any logic programs P1 and P2 with the same alphabet, P1 ≈c P2 if and only if p̄1 ∼ = p̄2 . Proof Similarly to Theorem 44, we allowed any choice of resolvents, and observational equivalence accounts for all branches. This accounts for conditions [1.-4.] in Definition 52. For condition [5.] of coinductive observational equivalence, consider coinductive trees: their structure and labels account for all possible clauses that can be matched with the current goal and subgoals via mgu’s. If, for any goal G with n distinct variables, P1 and P2 produce equivalent coinductive trees, then the image of G under p̄1 will be isomorphic to the image of G under p̄2 . The other direction is straightforward. ✷ In general, the definition of the coinductive tree permits generation of coinductive trees containing infinitely many variables. So a coinductive tree for a goal A need not be a subtree of p̄(A) ∈ &∨c -TreeAt(n) for any n. But every finite one must be, and establishment or otherwise of finiteness of coinductive trees is critical for us. Example 54 GC, i.e., Example 35, has a clause connected(x,y) ← edge(x,z), connected(z,y) in which there is a variable in the body but not the head. If one includes a unary function symbol s in GC, the clause induces infinite coinductive trees, all subtrees of p̄(connected(x,y)) ∈ &∨c -TreeAt(2) , as there are infinitely many possible substitutions for z. The clause also induces infinitely many coinductive trees that do not lie in p̄(connected(x,y)) ∈ &∨c -TreeAt(n) for any n. Note that, in Section 3, we established two different kinds of soundness and completeness results: one related the coalgebraic semantics to finite SLD-refutations (cf Theorem 37), another – to potentially infinite non-deterministic derivations (cf Theorem 45). The second theorem subsumed the first for special cases of logic programs. As we explain in the next section, one of the main advantages of CoALP is graceful handling of corecursive programs and coinductive definitions. This is why we consider derivations of arbitrary size in our next statement of soundness and completeness for CoALP, as follows. Theorem 55 (Soundness and Completeness of coinductive derivations) Let P be a logic program, with p̄ its induced Lax(LΣop , Pc Pf )-coalgebra, and let G be an atomic goal. 1. Soundness. Given a coinductive tree T resulting from a coinductive derivation of P ∪ {G} with partial answer θ, there is a coinductive subtree C of T , such that C is a derivation subtree of p̄(Gθ) for some n for which Gθ ∈ At(n). 23 2. Completeness. Given a list θ0 , θ1 , . . . of substitutions, and a list T0 , T1 , . . . of finite derivation subtrees of p̄(Gθ0 ), p̄(Gθ0 θ1 ), etcetera, with Tn θn a subtree of Tn+1 for each n, there is a coinductive derivation of P ∪ {G}, involving computed substitutions θ0 , θ1 , . . . and coinductive trees T0 , T1 , . . . such that, for each n, Tn contains a coinductive subtree Cn , such that Cn contains Tn , modulo variable renaming. Proof Soundness. Consider a coinductive derivation of P ∪ {G} with partial answer θ = θ0 , θ1 , . . . , θk : it contains a sequence of coinductive trees T0 , T1 , . . . , (Tk = T ) for Gθ0 , Gθ1 , . . . , Gθk . Each Ti is uniquely determined by Gθi , although Ti may have infinite branches (cf. Example 11). In general case, T may contain several coinductive subtrees, each giving an account to one possible combination of clauses determining or-nodes. Consider one such coinductive subtree C, and suppose it contains n distinct variables. Then, by construction of &∨c -TreeAt(n) and Definition 36, there will be a derivation subtree in p̄(Gθ) corresponding to C. Completeness. The proof is similar to the proof of Theorem 45, but here, we also note that each step in a coinductive derivation is given by a coinductive tree, rather than by a resolvent. The role of a non-deterministic SLD-derivation is now delegated to a coinductive subtree Cn of the coinductive tree Tn . Note that coinductive trees may be finite for guarded clauses like Stream (cf. Example 48), and hence a sequence of coinductive trees T1 , T2 , . . . will yield all Tn ’s (cf. Theorem 45). However, non-guarded clauses (cf. Example 11) give rise to infinite coinductive trees, in which case Tn will be only a fragment of a coinductive subtree Cn of the coinductive tree Tn . In that case, an infinite sequence of Tn s would approximate one Cn , similarly to Theorem 45. ✷ Discussion of the constructive componenent of the completeness results for CoALP and the constructive reformulation of the above completeness theorem can be found in [32]. The problem of distinguishing cases with finite and infinite coinductive trees will be the main topic of the next section. 4.2 Guarding Corecursion In this section, we consider various methods used in logic programming to guard (co-) recursion, and introduce our own method for guarding corecursion in CoALP. As Example 15 illustrates, SLD-derivations may yield looping infinite derivation chains for programs like stream. In Coinductive Logic Programming (Co-LP) [18, 45], such were addressed by introducing a procedure allowing one to terminate derivations with the flag “stream(x) is proven”, whenever such a loop was detected. Extending this “rule” to inductive computations leads to unsound results: in the inductive case, infinite loops normally indicate lack of progress in a derivation rather than “success”. Thus, explicit annotation of predicates was required. Consider the following example. Example 56 The annotated logic program below comprises both inductive and coinductive clauses. biti (0) ← biti (1) ← streamc (scons(x, y)) ← biti (x), streamc (y) listi (nil) ← listi (cons(x, y)) ← biti (x), listi (y) 24 Only infinite loops produced for corecursive goals (marked by c) are gracefully terminated; others are treated as “undecided” proof branches. In practice, these annotations act as locks and keys in resource logics, allowing or disallowing infinite data structures. There are drawbacks: ⋆ some predicates may behave inductively or coinductively depending on the arguments provided, and such cases need to be resolved dynamically, not statically, in which case predicate annotation fails. ⋆⋆ the coinductive algorithm [18, 45] is not in essence a lazy infinite (corecursive) computation. Instead, it substitutes an infinite proof by a finite derivation, on the basis of guarantees of the data regularity in the corecursive loops. But such guarantees cannot always be given: consider computing the number π. The coinductive derivations we introduced in the previous section give an alternative solution to the problem of guarding corecursion. We have already seen that Definition 46 determined finite coinductive trees both for the coinductive program Stream and inductive program ListNat; and no explicit annotation was needed to handle this. These two programs were well-founded, however, not all programs will give rise to finite coinductive trees. This leads us to the following definition of well-foundness of logic programs. Definition 57 A logic program P is well-founded if, for any goal G, P ∪ {G} generates the coinductive tree of finite size. There are logic programs that allow infinite coinductive trees. Example 58 Consider R(x) ← R( f (x)). The coinductive tree arising from this program contains a chain of alternating •’s and atoms R(x), R( f (x)), R( f ( f (x))), etcetera, yielding an infinite coinductive tree. This tree is a subtree of p̄(R(x)) ∈ &∨c -TreeAt(1) . In line with the existing practice of functional languages, we want the notion of wellfoundness to be transformed into programming practices. For this, a set of syntactic guardedness conditions needs to be introduced, compare e.g. with [5, 10, 15]. Coinductive trees we introduced in the previous section allow us to formulate similar guardedness conditions. They correspond to the method of guarding (co)recursive function applications by constructors in [10, 15]. In our running examples, function symbols 0, 1, s, cons, scons, f play the role of guarding constructors. Guardedness check 1 (Presence of Constructors): If a clause has the form P(t¯) ← [atoms], P(t¯′ ), [atoms], where P is a predicate, t¯, t¯′ are lists of terms, and [atoms] are finite (possibly empty) lists of first-order atoms, then at least one term ti ∈ t¯ must contain a function symbol f . For example, Stream is guarded. But Check-1 is not sufficient to guarantee wellfoundness of coinductive trees. Consider the following examples. Example 59 Consider the variant of Example 58 given by R( f (x)) ← R( f ( f (x))). It generates an infinite coinductive tree, given by a chain of alternating •’s and atoms R( f (x)), R( f ( f (x))), etcetera. Example 60 (Stream2) Another non-well-founded program that satisfies Guardedness check 1 is given below: stream2(scons(x,y)) ← bit(x), stream2(scons(x,y)) 25 To address such problems, a second guarding condition is needed. Guardedness check 2 (Constructor Reduction): If a clause has the form P(t¯) ← [body], where P is an n-ary predicate, t¯ is a list of terms t1 , . . . ,tn , and [body] is a finite nonempty list of first-order atoms, then, for each occurence of P(t¯′ ) (with some t¯′ = t1′ , . . . ,tn′ ) in [body], the following conditions must be satisfied. There should exist a term ti ∈ t¯ such that, there is a function f that occurs in ti m times (m ≥ 1) and occurs in ti′ k times with k < m. Moreover, if f ∈ ti has arguments containing variables x̄i , then f ∈ ti′ must have arguments containing variables x̄′i , with x̄′i ⊆ x̄i ; if f occurs in ti but not in ti′ , then all variables x̄′i ∈ ti′ must satisfy x̄′i ⊆ x̄i . Example 61 Suppose we want to define a program that computes and infinite stream of natural numbers: 0, 1, 2, 3, 4, 5, ... The corresponding logic program will be given by nats(scons(x,scons(y,z))) ← nat(x), nat(s(x)), nats(scons(y,z)) It is a well-founded and guarded program, so will result in potentially infinite coinductive derivations featuring coinductive trees of finite size. This program will satisfy Guardedness conditions 1 and 2: the function symbol (constructor) scons reduces in the body. Example 62 In Example 59, function symbol f appears twice in the body, while appearing only once in the head; this breaks the guardedness condition 2. Note that Guardedness check 2 imposes strict discipline on argument positions at which constructors reduce, and on variables appearing as arguments to the constructors. The next example explains why these restrictions matter. Example 63 Consider the following clause: Q(s(x),y) ← Q(y,y). The constructor s clearly reduces, and the clause could pass the guardedness check if it was checking only the constructor reduction. However, the goal Q(s(x), s(x)) would result in an infinite coinductive tree. The problem here is the new variable y in the body, in the same argument position as s(x): it allows to form the goals like Q(s(x), s(x)) falling into infinite loops. To avoid such cases, Guardedness check 2 imposes the restriction on the argument positions and variables. Therefore, the programmer would be forced to change the clause to Q(s(x),y) ← Q(x,y) to pass the guardedness checks. Finally, the (co-)recursive nature of the predicates may show only via several clauses in the program. Consider the following example. Example 64 Consider programs P1 and P2 below. For both programs, Guardedness conditions 1 and 2 are satisfied for every single clause, but the programs give rise to infinite coinductive trees. P1: Q(cons(x,y)) ← Q2(cons(z,cons(x,y))). Q2(cons(z,cons(x,y)) ← Q(cons(x,y)). P2: Q(cons(x,y)) ← Q2(cons(z,cons(x,y))). Q2(y) ← Q(y). 26 To address the problem above, a further guardedness check needs to be introduced. Definition 65 Given a logic program P, a goal G, and the coinductive tree for P ∪ {G}, we say T contains a loop if there exists a coinductive subtree C of T , such that: there exists a predicate Q ∈ P such that Q(t¯) appears as an and-node in C, and also Q(t¯′ ) appears as a child and-node of that node in C, for some t¯ and t¯′ . In this case, we say that atom Q(t¯) is a head loop factor, and Q(t¯′ ) is a tail loop factor. Guardedness check 3 (Detection of Non-guarded Loops): If a program P satisfies guardedness conditions 1 and 2, do the following. For every clause C ∈ P, such that C has the shape A ← B1 , . . . Bn , construct the coinductive tree T for A, imposing the following termination conditions during the tree construction: i. If T contains a loop with the head and tail factors Q(t¯) and Q(t¯′ ), apply Guardedness conditions 1 and 2 to Q(t¯) ← Q(t¯′ ). If the Guardedness conditions 1 and 2 are violated for Q(t¯) ← Q(t¯′ ), terminate the coinductive tree construction for A; report non-guardedness. ii. If construction of T reaches the leaf nodes and none of the guardedness conditions (i.) and (ii.) is violated, the program P is guarded. Proposition 66 Guardedness check 3 terminates, for any logic program. Proof Note that a given program P has a finite and fixed number of clauses. If there are n clauses in the given program, only n coinductive trees will be constructed. It remains to show that each tree construction will be terminated in finite time. Given that P contains a finite number of predicates, an infinite coinductive tree T for P would need to contain a loop. If all loops occuring in T are guarded, they could not have constructor reduction infinite number of times, so there should be at least one non-guarded loop. But then the tree construction will be terminated, by item i. ✷ Note that, although the procedure above requires some computations to be performed, the guardedness checks can be done statically, prior to the program run. Example 67 Consider the program P3: Q(cons(x,y)) ← Q2(cons(z,cons(x,y)). Q2(cons(cons(x,y)) ← Q(y). It satisfies guardedness checks 1, 2 and 3. In particular, coinductive trees for both of its clauses are finite, and show constructor reduction. The Guardedness checks 1-3 are necessary, but not sufficient conditions for guaranteeing well-foundness of all logic programs. This is why, we include some further checks, involving applying checks 1-3 to program heads modulo some chosen substitutions. We will not go into further details here, but will illustrate the issue by the following example. Example 68 Consider the logic program P4: Q(s(x),y) ← P(x,y) P(t(x),y) ← Q(y,y) Each clause passes the Guardedness checks 1-2 trivially, as they do not have immediate loops. When we construct coinductive trees for each of the clause heads, they do not exhibit the loops, either, due to the restrictive nature of the term matching. However, for the goal Q(s(t(x)),s(t(x))), the program will give rise to an infinite coinductive tree. 27 Guardedness conditions of CoALP guarantee that, if a program P passed the guardedness checks, then any goal will give rise to only finite coinductive trees. Very often, in functional programming, the guardedness conditions reject some well-founded programs [5,10,15]. Termination of recursive programs is in general undecidable, and syntactic guardedness conditions are used only to approximate the notion of termination. Here, as well as in functional programming, there will be examples of well-founded but non-guarded programs: Example 69 The Program P5 is well-founded but not guarded: Q(s(x)),y) ← Q(y,x) Q(x,s(y)) ← Q(y,x) Furthermore, the guardedness checks are too restrictive to capture the notion of termination in sequential logic programs as given by e.g. SLD-resolution. Example 70 The following program is non-well-founded and not guarded in CoALP setting, but terminates if SLD-resolution is used: Q(x) ← Q(a). Q(a) ← . As we discuss in the next section, the program GC gives a similar effect. Our approach allows us to guard (co-)recursion implicitly, without annotating the predicates as inductive or coinductive, as it was the case in [18, 45]. The advantages of this implicit method of handling (co-)recursive computational resources can be summarised as follows. It solves both difficulties that explicit coinductive resource management causes: in response to ⋆, the method uniformly treats inductive and coinductive definitions, and it can be used to detect non-well-founded cases in both; and in response to ⋆⋆, it is a corecursive process in spirit. Thus, instead of relying on guarantees of loop regularity, it relies on well-foundness of every coinductive tree in the process of lazy infinite derivations. 4.3 Programming with Guarded Corecursion We proceed with a case study of how guardedness conditions can be used in logic programming practice. First, we consider the effects of coalgebraic logic programming on corecursive resource handling by comparing GC (cf. Example 35) with Stream. GC uses recursion to traverse all the connected nodes in a graph. Two kinds of infinite SLD-derivations are possible: computing finite or infinite objects. Example 71 (GC*) Consider the program GC*. Adding the following clause to GC makes the graph cyclic: edge(s(s(0)),0) ←. Taking a query ← connected(0,y) as a goal may lead to an infinite SLD-derivation corresponding to an infinite path starting from 0 in the cycle. It would also give rise to infinite coinductive trees, see Figure 7. However, the object that is described by this program, the cyclic graph with three nodes, is finite. In the standard practice of logic programming, where the ordering of the clauses is as in GC, the program behaves gracefully, giving finitely computed answers, but potentially 28 connected(O, z) edge(O, y) connected(y, z) edge(y, y1) connected(y1, z) edge(y1, y2 ) connected(y2, z) .. . Figure 7: The infinite coinductive tree for the programs GC from Example 35, GC’ from Example 72 and GC* from Example 71. → conn(O, cons(y, z)) edge(O, y) conn(y, z) → conn(O, cons(sO, z)) edge(0, s0) conn(s0, z) ✷ conn(0, cons(s0, nil)) edge(0, s0) conn(s0, nil) ✷ ✷ Figure 8: A finite and well-founded coinductive derivation for a guarded variant of GCg ; we use conn to abbreviate connected; s0 abbreviates s(0). infinitely many times. But this balance is fragile. For example, the following program, with different ordering of the clauses and of the atoms in the body, results in non-terminating derivations: Example 72 (GC’) Let GC’ denote the logic program 1. connected(x,y) ← connected(z,y), edge(x,z) 2. connected(x,x) ← together with the database of Example 35, SLD-derivation loops as follows: connected(0,y) → (connected(z,y), edge(0,z)) → (connected(z1,y), edge(z,z1 ), edge(0,z)) → . . . It never produces an answer as it falls into an infinite loop irrespective of the particular graph in question. There is a one-step non-deterministic derivation for connected(0,y) given by unifying y with 0 (see Definition 43.) But there is no coinductive derivation that does that: see Figure 7. Spelling out nondeterministic semantics (Theorem 45), T1 = connected(0, y); T0 = connected(0, 0) → ✷. In traditional logic programming, the burden of deciding which programs might result in loops like the one above falls completely to the programmer: semantically, GC and GC’ 29 are equivalent. Moreover, in the Co-LP [18, 45] setting, if the atoms in the programs above are labelled as inductive, the behaviour of Co-LP is exactly as it is for SLD-resolution. If, on the contrary, the atoms are marked as coinductive, we may find the derivation loop terminated as “successful” when we should be warned of its being non-well-founded. In contrast, compare the coalgebraic semantics of GC, GC’, GC* and Stream. Figures 7 and 6 show the difference between the coinductive trees for ill-founded GC, GC’ and GC* and well-founded programs like Stream. Notably, coinductive definition of Stream is wellfounded, while traditional inductive definition of GC* is not. GC, GC’ and GC* give rise to infinite coinductive trees, whereas Stream gives rise only to finite coinductive trees. In CoALP, a set of syntactic guardedness checks 1-3 is embedded, to make sure that only programs that satisfy the semantic notion of well-foundness are allowed in CoALP. Programs like GC, GC’ and GC* will be automatically rejected by CoALP’s guardedness checks, see Section 6. To make the programs like GC guarded, The user will have to reformulate it as follows: Example 73 (GCg ) The program GCg below addresses both non-terminating problem for SLD-derivations for GC’, and non-well-foundness of GC and GC*. connected(x,cons(y,z)) ← edge(x,y),connected(y,z) connected(x,nil) ← edge(0,0) ← edge(x,s(x)) ← The coinductive derivation for it is shown in Figure 8, duly featuring coinductive trees of finite size. 5 Guarding Parallelism by Guarded Corecursion One of the distinguishing features of logic programming languages is that they allow implicit parallel execution of programs. In the last two decades, an astonishing variety of parallel logic programming implementations have been proposed, see [19] for a detailed survey. The three main types of parallelism used in implementations of logic programs are and-parallelism, or-parallelism and their combination; see also Section 2.2. The coalgebraic models we discuss in this paper exhibit a synthetic form of parallelism: and-or parallelism. The most common way to express and-or parallelism in logic programs is and-or parallel derivation trees [17, 19], see Definition 16. In the ground case, coinductive trees and and-or parallel derivation trees agree, as illustrated by Example 24. But as we have discussed several times, that does not extend. In the general case, in the absence of synchronisation, parallel and-or-trees may lead to unsound results. Example 74 Figure 9 depicts an and-or parallel derivation tree that finds a refutation θ = {x/0, y/0, x/nil} for the goal list(cons(x,cons(y,x))), although this answer is not sound. 30 list(cons(x, cons(y, x))) list(cons(y, x)) nat(x) nat(y) ✷ list(x) nat(x1 ) .. . ✷ nat(x1 ) .. . ✷ nat(z1 ) list(z2) .. . .. . Figure 9: An unsound refutation by an and-or parallel derivation tree, with θ = {x/0, y/0, x/nil} . A solution proposed in [17] was given by composition (and-or parallel derivation) trees. Construction of composition trees involves additional algorithms that synchronise substitutions in the branches of and-or parallel derivation trees. Composition trees contain a special kind of composition nodes, used whenever both and- and or-parallel computations are possible for one goal. A composition node is a list of atoms in the goal. If, in a goal G = ← B1 , . . . Bn , an atom Bi is unifiable with k > 1 clauses, then the algorithm adds k children (composition nodes) to the node G; similarly for every atom in G that is unifiable with more than one clause. Every such composition node has the form B1 , . . . Bn and has n and-parallel edges emanating from it. Thus, all possible combinations of or-choices at every and-parallel step are given. Predominantly, the existing parallel implementations of logic programming follow Kowalski’s principle [33]: Programs = Logic + Control. This principle separates the control component (backtracking, occur check, goal ordering/selection, parallelisation, variable synchronisation ) from the logical specification of a problem (first-order Horn logic, SLD-resolution, unification). Thus the control of program execution becomes independent of programming semantics. With many parallel solutions on offer [19], some form of resource handling and process scheduling are inevitable ingredients of parallel logic programming as the algorithms of unification and SLD-resolution are P-complete [24, 48] and cannot be parallelised in general, see Example 74. Parallel implementations of PROLOG typically hide all additional control-handling algorithms at the level of implementation, away from program specification or semantics [19]. The algorithms used for variable synchronisation pose a sequential barrier for parallelisation. Several properties are shared by many parallel implementations of PROLOG: ⋆ Although and-or-parallelism is called “implicit parallelism” in the literature [19], it boils down to explicit resource handling at compiler level: this includes both annotating the syntax and maintaining special schedulers/arrays/hash tables to synchronise variable substitutions computed by different processes; these are separated from the language and semantics. ⋆⋆ Issues of logic and control are separated to the point that parallel PROLOG systems are usually built as speed-ups to SLD-resolution and have neither “logic” algorithms nor semantics of their own. For composition trees, they are implemented by adding 31 extra features to SLD-resolution. Specifically, composition nodes are handled by binding arrays at compiler level. In the previous sections, we have proposed coinductive trees (cf Definition 46), as an alternative to composition trees. Coinductive trees serve as computational units in lazy (co)recursive derivations, and therefore, these coinductive tree transitions can be parallelised, as well. For guarded logic programs, coinductive derivations allow for parallel and even non-deterministic implementations, as Sections 4.1 and 6 explain. Here, we explain the two levels of parallelism in CoALP: Level 1: Parallel construction of coinductive trees. Comparing coinductive derivation trees with and-or parallel derivation trees, coinductive trees are more intrinsic: and-or parallel trees have mgu’s built into a single tree, whereas mgu’s are restricted to term-matching within the coinductive tree. Taking issues of variable substitution from the level of individual leaves to the level of trees affects computations at least in two ways. Parallel proof-search in branches of a coinductive tree does not require synchronisation of variables in different branches: they remain synchronised by construction of the coinductive tree. We illustrate with ListNat. Example 75 The coinductive trees of Figure 11 agree with the first part of the and-or parallel derivation tree for list(cons(x,cons(y,x))) in Figure 9. But the top left coinductive tree has leaves nat(x), nat(y) and list(x), whereas the and-or parallel derivation tree follows those nodes, using substitutions determined by mgu’s. Moreover, those substitutions need not be consistent with each other: not only are there two ways to unify each of nat(x), nat(y) and list(x), but also there is no consistent substitution for x at all. In contrast, the coinductive trees handle such cases lazily. Term-matching in coinductive trees permits the construction of every branch in a coinductive tree independently of the other branches. Moreover, for programs that are guarded by constructors, such as Stream and ListNat, we avoid infinite branches or an infinite number of variables in a single tree. Since both term-matching and guardedness are components of the “logic” algorithm of coinductive derivation, the Kowalski’s principle can be reformulated for CoALP as follows: CoALP = Logic is Control. This distinguishes two approaches: Parallel LP = and-or parallel derivation trees + explicit handling of parallel resources at compiler level; and CoALP = coinductive derivation trees + implicit handling of parallel resources “by program construction”. Case-study: Coalgebraic logic programming and resources for parallelism. In this case study, our focus is on resource handling of parallelism in logic programming. We start by illustrating ground cases of parallel derivations: these can be parallelised straightforwardly, and coinductive trees and and-or parallel derivation trees coincide. We consider the inductive program ListNat, although a similar case-study could be done with a coinductive logic program such as Stream. Example 76 Consider the and-or parallel derivation tree for ListNat with goal list(cons(0,cons(0,nil))) in Figure 10. 32 list(cons(0, cons(0, nil))) nat(0) list(cons(0, nil)) ✷ nat(0) list(nil) ✷ ✷ Figure 10: An and-or parallel derivation for the goal list(cons(O,cons(O,nil))). → list(cons(x, cons(y, x))) nat(x) list(cons(y, x)) nat(y) list(x) → list(cons(O, cons(y, O))) nat(O) list(cons(y, O)) ✷ nat(y) list(O) list(cons(O, cons(O, O))) nat(O) list(cons(O, O) ✷ nat(O) list(O) ✷ Figure 11: A coinductive derivation for the goal list(cons(x,cons(y,x))). No additional syntactic annotations or variable synchronisation algorithms is required by CoALP when extending from ground cases to the full fragment of first-order Horn logic with recursion and corecursion. Not only termination, but also soundness of parallelism will be guarded by program construction. Example 77 Consider the coinductive derivation for the goal list(cons(x, cons(y, x))) given in Figure 11. In contrast to the and-or parallel derivation tree, and owing to the restriction of unification to term matching, every coinductive tree in the derivation pursues fewer variable substitutions than the corresponding and-or parallel derivation tree does, cf Figure 9. This allows one to keep variables synchronised while pursuing parallel proof branches in the tree. In particular, coinductive derivation of Figure 11 will report failure, as required for this example. Note that coinductive trees not only permit to achieve soundness where parallelism normally is not sound, but also they achieve this without any kind of explicit resource handling. Level 2: Parallel transitions between coinductive trees. Consider the leftmost coinductive tree of Figure 11. It has three leaves with two distinct variables. Hence, three independent mgu’s can be computed to unfold that tree; and the three tree transitions can be done in parallel. As the lazy nature of coinductive trees and guardedness checks of CoALP insure both soundness and termination of computations at the level of each individual tree, this opens a possibility for parallel proof search through the state space of such trees. We discuss this in detail in Section 6. To conclude, CoALP gives a different view of parallel resource handling: 1. We avoid explicit resource handling either at “logic” or “control” level; instead, we use implicit methods to control parallel resources. (a) In particular, we restrict unification to term matching: in contrast to the inherently sequential unification algorithm [11], it is parallelisable. As a result, par- 33 allel proof search in separate branches of a coinductive tree does not require explicit synchronisation of variables. (b) Static guardedness checks of CoALP, introduced to guard corecursion, in fact insure that parallel scheduling of computations within the coinductive trees will never fall into a non-terminating thread; and parallel scheduling of coinductive tree transitions will never produce unsound results. Again, this is achieved without introducing new syntax, just by the guarded program construction. 2. The issues of logic and control are now bound together: coinductive trees provide both logic specification and resource control. Moreover, CoALP comes with its own coalgebraic semantics that accounts for observational behaviour of coinductive derivations. As the next section explains, this approach to parallelism can be viable and efficient. See also [32] for a detailed study of CoALP’s parallel features, in ground, Datalog, and full first-order case. 6 Implementation In [31], we developed the first minimal prototype of CoALP in PROLOG, to show the feasibility of the coalgebraic logic programming approach, see CoALP Prototype-1 in [44]. However, it did not make use of parallelisation in modern computer architectures and was constrained by the mechanisms employed by the underlying PROLOG engine. Here, we present a new binary standalone implementation engineered using the Go programming language [47] available as CoALP Prototype-2 in [44]. Its most important new feature is the use of Go’s built in support for multithreading to achieve parallelisation by using goroutines which are coroutines that can be executed in distinct threads. This new implementation also features two levels of parallelism (for coinductive trees and their transitions), static guardedness checks, and implicit handling of corecursion and parallelism. In this section, we describe the most important features arising in the implementation of CoALP. Construction of Coinductive trees (cf. Definition 46) lies at the heart of CoALP’s implementation. They are implemented by linking structural records (structs) which represent or-nodes and and-nodes through the use of arrays and pointers. And-nodes represent goal terms and contain a list of pointers to clauses that have heads which are still unifiable with the goal. An and-node with a list containing at least one such pointer is regarded as an open node. The root of any coinductive tree is an and-node constructed by the initial goal. Guardedness plays an important role in CoALP implementation, as Sections 4 and 5 explain. For the proper operation of the CoALP algorithm, it needs to be ensured that a derivation step never produces an infinite and therefore non-well-founded coinductive tree. This would block the search process by taking up infinite time to expand the tree. We have incorporated the Guardedness checks in CoALP (cf Section 4.2); they are used to statically check the input programs, prior to the program run. Note that, in line with lazy corecursion in functional languages, while a coinductive tree may only be finite, the coinductive derivation may still be infinite (cf. Stream in Figure 6). Coinductive derivations are transitions of coinductive trees. Whether the CoALP implementation is viewed as a sequential or parallel process, it can be described as follows. Construction of coinductive derivations for a given input program and goal is modeled as a uniform cost search through the graph of coinductive trees connected by the derivation 34 operation. A derivation step here is constrained to first order unification of the first unifiable open node that has the lowest level in the tree; cf. Definition 42 and Figures 6 and 11. Other strategies, including non-deterministic methods are possible for selecting such open nodes; thereby determining substitutions for new coinductive tree transitions. Example 78 Looking at the ListNat program from Example 6, the tree with root list(cons(x, cons(y, x))) is connected to list(cons(0, cons(y, 0))) by unification of the open node nat(x) with nat(0). This step is also shown in Figure 4. The following derivation and the resulting coinductive tree for list(cons(0, cons(0, 0))) contains no unifiable open nodes – note that list(0) cannot be unified with any clause head of the input program. Only a very thin layer of sequential control in the implementation for this search is needed in the form of a priority search queue. Using the substitution length of all the substitutions in the derivation chain as priority ranking, we gain an enumeration order even for a potentially infinite lazy derivation processes. Therefore, while an infinite number of coinductive trees can in principle be produced for the goal list(x), the algorithm returns list(nil), list(cons(0, nil)) and then list(cons(s(0), nil)) in a finite number of time-steps and keeps producing finite coinductive trees thereafter. Running CoALP [44] for list(x), we get as output the substitutions for the first three success trees: 1 {x/nil}, 3 {x/cons(x1 , y1 ), x1 /0, y1 /nil} and 4 {x/cons(x1 , y1 ), x1 /s(x2 ), x2 /0, y1 /nil}. Each possible coinductive tree will be produced after finite time, but since there may be infinitely many such trees, the coinductive derivations are implemented as lazy corecursive computations. Contrast this to PROLOG which produces the solutions list(nil) , list(cons(0, nil)) , list(cons(0, cons(0, nil))), . . . but never list(cons(s(0), nil)) for the ListNat program and goal list(x). Thereby, it does not generate the same set of solutions even if run indefinitely and does not discover some of the solutions that CoALP does. A new approach to Backtracking is taken, as CoALP explores simultaneously several and-or-choices in a coinductive tree. In contrast to PROLOG, no trail stack is maintained and no backtracking (in the classical sense of [35]) is needed. If a coinductive tree has no open unifiable nodes, it will simply be discarded. If alternative mgu’s existed during the derivation steps, they open up different branches in coinductive derivations. Therefore, CoALP implicitly represents alternative mgu’s by coinductive trees in the priority search queue. The only time variable bindings may be undone is when checking for unifiability of terms during the derivation step. However, this is only done on copies of the original terms to ensure thread safety and to avoid unnecessary locks and therefore sequential barriers. Furthermore, this is done locally and does not characterize or regulate the overall global search flow. Parallelisation of coinductive trees. Given that no infinite derivation tree can be generated by a guarded program, the CoALP approach provides multiple points where parallelisation takes place, while still enumerating every possible coinductive success subtree. The use of term matching to traverse and expand trees allows for parallelisation of work without explicit variable synchronization while operating directly on a single tree. 35 4 datalog 1 datalog 2 datalog 3 speedup 3 datalog 4 datalog 5 datalog 6 2 1 1 2 3 4 threads 5 6 Figure 12: Speedup of Datalog programs, relative to the base case with 1 thread, with different number of threads expanding the derivation tree. However, if the coinductive trees are small or few open nodes exist, such as in the running examples Stream and ListNat, the setup and initial communication overhead between parallel threads that process the tree does not usually offset speedup that can be achieved. Therefore, it is dynamically decided during execution whether a program generates sufficiently complex coinductive trees to warrant this parallelisation strategy. Future research will focus on efficient heuristics to decide how this trade-off should be made. Term matching can be performed in parallel, but if the terms are small, no practical speedup will be obtained when working with multiple threads. In such cases, it is more efficient to perform distinct term matching operations in parallel by dispatching work on multiple coinductive trees in parallel. Ground logic programs do not need transitions between the coinductive trees to complete the computation. Logic programs containing variables but no function symbols of arity n > 0 can all be soundly translated into finitely-presented ground logic programs. The most famous example of such a language is Datalog [24, 48]. The advantages of Datalog are easier implementations and a greater capacity for parallelisation. Figure 12 shows the speedup that can be gained by constructing and-or parallel trees for Datalog programs in our system. The Datalog programs are randomly generated and can be examined in [44]. As can be seen in Figure 12, the speedup is significant and scales with the number of threads. Parallelisation of coinductive derivations is more efficient than parallelisation within one coinductive tree for programs like ListNat and Stream. On the search queue level of the algorithm, multiple trees that still have open nodes and possible derivations are dispatched to one or more worker threads. They perform the coinductive derivation steps in parallel. To keep communication minimal, the coinductive trees are compacted by e.g. pruning closed leaves and shortening chains that have no branches in the tree. Since expanding and checking coinductive trees does not always take the same amount of time for each tree, some worker threads might return results earlier than others and thereby disrupt the enumeration order. So, we do not allow them to show results immediately and directly to the user. CoALP guarantees that success trees which are enumerated sequentially will also be found when working in multithreaded context albeit maybe later. Returning results in the enumeration order of substitution lengths to the user can still be achieved by a little more sequential overhead. For example, the user can specify the option to buffer and sort 36 success coinductive trees until it is guaranteed that no lower order coinductive trees are still being processed or are in the priority search queue. Considering the other direction of reducing sequential overhead in maintaining the search queue, there is the possibility of using complementary enumeration schemes and thereby partition the search queue into smaller queues that each worker thread maintains on its own. However, this may shift the order of solutions since some worker threads may enumerate only solutions that are computationally easier to find. Thereby a trade-off is to be made between maintaining a perfect ordering or faster processing of coinductive trees. At any rate, the derivations remain sound by the program guardedness and coinductive tree construction, cf Sections 4 and 5; and this allows for a range of experiments on parallelisation for the future. 7 Conclusions and Future Work The main feature of the coalgebraic logic programming approach is its generality: it is suitable for both inductive and coinductive logic programs, for programs with variable dependencies or not, and for programs that are unification-parallelisable or inherently sequential. Many distinctions that led to a variety of engineering solutions in the design of corecursive and concurrent logic programs [18, 19, 45] are erased here, with resource-handling delegated to a logic algorithm; and issues of logic and control, semantics and execution, become inseparable. The original contributions of this paper relative to the earlier papers [27, 29, 30] are the Coalgebraic Calculus of Infinite trees (Section 3.1), operational semantics for nondeterministic derivations (Section 3.4), extended Guardedness conditions for CoALP (Section 4.2), and Parallel and Corecursive Implementation of CoALP in Go (Section 6). Additionally, the paper develops a unfying theory and notation for paralelleism and corecursion in logic programming, putting a new perspective on earlier results [27, 29, 30]. All proofs appear here for the first time. In future, we plan to investigate the integration of coalgebraic logic programming with methods of resource handling in state-of-the-art coinductive logic programming [18, 19, 45], as well as in modern concurrent logic programming systems [19]. Furthermore, we would like to investigate whether coalgebraic logic programming has potential to play a positive role in type inference, cf. [3]. The analysis of this paper can be extended to more expressive logic programming languages, such as [16, 21, 38, 42], also to functional programming languages in the style of [3, 40]. We deliberately chose our running examples to correspond to definitions of inductive or coinductive types in such languages. The key fact driving our analysis has been the observation that the implication ← acts at a meta-level, like a sequent rather than a logical connective. That observation extends to first-order fragments of linear logic and the Logic of Bunched Implications [16, 42]. So we plan to extend the work in the paper to logic programming languages based on such logics. The situation regarding higher-order logic programming languages such as λ-PROLOG [38] is more subtle. Despite their higher-order nature, such logic programming languages typically make fundamental use of sequents. So it may well be fruitful to consider modelling them in terms of coalgebra too, albeit probably on a sophisticated base category such as a category of Heyting algebras. 37 References [1] K. Ali and R. Karlsson. Full prolog and scheduling or-parallelism in muse. Int. Journal Of Parallel Programming, 19(6):445–475, 1991. [2] G. Amato, J. Lipton, and R. McGrail. On the algebraic structure of declarative programming languages. Theor. Comput. Sci., 410(46):4626–4671, 2009. [3] D. Ancona, G. Lagorio, and E. Zucca. Type inference by coinductive logic programming. In TYPES, volume 5497 of LNCS, pages 1–18, 2009. [4] M. Barr and C. Wells. Category Theory for Computing Science. Prentice-Hall, 1990. [5] Y. Bertot and E. Komendantskaya. Inductive and coinductive components of corecursive functions in Coq. ENTSC, 203(5):25–47, 2008. [6] F. Bonchi and U. Montanari. Reactive systems, (semi-)saturated semantics and coalgebras on presheaves. Theor. Comput. Sci., 410(41):4044–4066, 2009. [7] F. Bonchi and F. Zanasi. Saturated semantics for coalgebraic logic programming. In CALCO, volume 8089 of Lecture Notes in Computer Science, pages 80–94. Springer, 2013. [8] R. Bruni, U. Montanari, and F. Rossi. An interactive semantics of logic programming. TPLP, 1(6):647–690, 2001. [9] M. Comini, G. Levi, and M. C. Meo. A theory of observables for logic programs. Inf. Comput., 169(1):23–80, 2001. [10] T. Coquand. Infinite objects in type theory. In Types for Proofs and Programs, Int. Workshop TYPES’93, volume 806 of LNCS, pages 62–78. Springer-Verlag, 1994. [11] C. Dwork, P. Kanellakis, and J. Mitchell. On the sequential nature of unification. J. Logic Prog., 1:35–50, 1984. [12] M. Falaschi, G. Levi, M. Martelli, and C. Palamidessi. A model-theoretic reconstruction of the operational semantics of logic programs. Inf. Comput., 103(1):86–113, 1993. [13] M. Falaschi, G. Levi, C. Palamidessi, and M. Martelli. Declarative modeling of the operational behavior of logic languages. TCS, 69(3):289–318, 1989. [14] M. Gabrielli, G. Levi, and M. Meo. Observable behaviors and equivalnences of logic programs. Information and Computation, 122(1):1–29, 1995. [15] E. Giménez. Structural recursive definitions in type theory. In ICALP, volume 1443 of LNCS, pages 397–408. Springer, 1998. [16] J.-Y. Girard. Linear logic. Theor. Comput. Sci., 50:1–102, 1987. [17] G. Gupta and V. Costa. Optimal implementation of and-or parallel prolog. PARLE’92, pages 71–92, 1994. In [18] G. Gupta and et al. Coinductive logic programming and its applications. In ICLP 2007, volume 4670 of LNCS, pages 27–44, 2007. [19] G. Gupta, E. Pontelli, K. Ali, M. Carlsson, and M. Hermenegildo. Parallel execution of prolog programs: a survey. ACM Trans. Computational Logic, pages 1–126, 2012. [20] M. Hermenegildo and K. J. Greene. &-prolog and its performance: Exploiting independent and-parallelism. In ICLP, pages 253–268, 1990. 38 [21] J. S. Hodas and D. Miller. Logic programming in a fragment of intuitionistic linear logic. Inf. Comput., 110(2):327–365, 1994. [22] B. Jacobs and J. Rutten. A tutorial on (co)algebras and (co)induction. Bulletin of EATCS, 62:222–259, 1997. [23] M. Jaume. On greatest fixpoint semantics of logic programming. J. Log. Comput., 12(2):321–342, 2002. [24] P. C. Kanellakis. Logic programming and parallel complexity. In Foundations of Deductive Databases and Logic Prog., pages 547–585. Morgan Kaufmann, 1988. [25] G. M. Kelly. Coherence theorems for lax algebras and for distributive laws. In Category seminar, volume 420 of LNM, pages 281 – 375, 1974. [26] Y. Kinoshita and J. Power. A fibrational semantics for logic programs. In Proc. Int. Workshop on Extensions of Logic Programming, volume 1050 of LNAI, 1996. [27] E. Komendantskaya, G. McCusker, and J. Power. Coalgebraic semantics for parallel derivation strategies in logic programming. In AMAST’2010, volume 6486 of LNCS, 2010. [28] E. Komendantskaya and J. Power. Fibrational semantics for many-valued logic programs: Grounds for non-groundness. In JELIA’08, volume 5293 of LNCS, pages 258–271, 2008. [29] E. Komendantskaya and J. Power. Coalgebraic derivations in logic programming. In CSL, LIPIcs, pages 352–366. Schloss Dagstuhl, 2011. [30] E. Komendantskaya and J. Power. Coalgebraic semantics for derivations in logic programming. In CALCO, LNCS, pages 268–282. Spinger, 2011. [31] E. Komendantskaya, J. Power, and M. Schmidt. Coalgebraic logic programming: implicit versus explicit resource handling. In Coinductive Logic Programming Workshop, ICLP’12, 2012. [32] E. Komendantskaya, M. Schmidt, and J. Heras. Exploiting parallelism in coalgebraic logic programming. In Accepted for Wessex Seminar ENTCS Post-Proceedings, 2013. [33] R. Kowalski. Logic for problem Solving. Elsevier, Amsterdam, 1979. [34] J. Lambek and P. Scott. Higher Order Categorical Logic. Cambridge University Press, 1986. [35] J. Lloyd. Foundations of Logic Programming. Springer-Verlag, 2nd edition, 1987. [36] E. L. Lusk, D. H. D. Warren, and S. Haridi. The aurora or-parallel prolog system. New Generation Computing, 7(2,3):243–273, 1990. [37] Z. Majkic. Coalgebraic semantics for logic programming. In 18th Workshop on (Constraint) Logic Programming, WLP 2004, March 04-06, 2004. [38] D. Miller and G. Nadathur. Higher-order logic programming. In ICLP, pages 448– 462, 1986. [39] R. Milner. Communication and Concurrency. Prentice Hall, 1989. [40] L. C. Paulson and A. W. Smith. Logic programming, functional programming, and inductive definitions. In ELP, pages 283–309, 1989. [41] E. Pontelli and G. Gupta. On the duality between or-parallelism and and-parallelism in logic programming. In Euro-Par, pages 43–54, 1995. 39 [42] D. Pym. The Semantics and Proof Theory of the Logic of Bunched Implications, volume 26 of Applied Logic Series. Kluwer Academic Publishers, 2002. [43] J. Rutten. Universal coalgebra: a theory of systems. TCS, 2000. [44] M. Schmidt and E. Komendantskaya. Coalgebraic gramming (coalp): Implementation. Prototypes 1 and www.computing.dundee.ac.uk/staff/katya/CoALP/. logic pro2, 2012. [45] L. Simon and et al. Co-logic programming: Extending logic programming with coinduction. In ICALP, volume 4596 of LNCS, pages 472–483. Springer, 2007. [46] L. Sterling and E. Shapiro. The art of Prolog. MIT Press, 1986. [47] M. Summerfield. Programming in Go: Creating Applications for the 21st Century. Addison-Wesley, 2012. [48] J. D. Ullman and A. V. Gelder. Parallel complexity of logical query programs. Algorithmica, 3:5–42, 1988. 40
6cs.PL
Hierarchical Attentive Recurrent Tracking arXiv:1706.09262v2 [cs.CV] 5 Sep 2017 Adam R. Kosiorek Department of Engineering Science University of Oxford [email protected] Alex Bewley Department of Engineering Science University of Oxford [email protected] Ingmar Posner Department of Engineering Science University of Oxford [email protected] Abstract Class-agnostic object tracking is particularly difficult in cluttered environments as target specific discriminative models cannot be learned a priori. Inspired by how the human visual cortex employs spatial attention and separate “where” and “what” processing pathways to actively suppress irrelevant visual features, this work develops a hierarchical attentive recurrent model for single object tracking in videos. The first layer of attention discards the majority of background by selecting a region containing the object of interest, while the subsequent layers tune in on visual features particular to the tracked object. This framework is fully differentiable and can be trained in a purely data driven fashion by gradient methods. To improve training convergence, we augment the loss function with terms for a number of auxiliary tasks relevant for tracking. Evaluation of the proposed model is performed on two datasets: pedestrian tracking on the KTH activity recognition dataset and the more difficult KITTI object tracking dataset. 1 Introduction In computer vision, the task of class-agnostic object tracking is challenging since no target-specific model can be learnt a priori and yet the model has to handle target appearance changes, varying lighting conditions and occlusion. To make it even more difficult, the tracked object often constitutes but a small fraction of the visual field. The remaining parts may contain distractors, which are visually salient objects resembling the target but hold no relevant information. Despite this fact, recent models often process the whole image, exposing them to noise and increases in associated computational cost or use heuristic methods to decrease the size of search regions. This in contrast to human visual perception, which does not process the visual field in its entirety, but rather acknowledges it briefly and focuses on processing small fractions thereof, which we dub visual attention. Attention mechanisms have recently been explored in machine learning in a wide variety of contexts [27, 14], often providing new capabilities to machine learning algorithms [11, 12, 7]. While they improve efficiency [22] and performance on state-of-the-art machine learning benchmarks [27], their architecture is much simpler than that of the mechanisms found in the human visual cortex [5]. Attention has also been long studied by neuroscientists [18], who believe that it is crucial for visual perception and cognition [4], since it is inherently tied to the architecture of the visual cortex and can affect the information flow inside it. Whenever more than one visual stimulus is present in the receptive field of a neuron, all the stimuli compete for computational resources due to the limited processing capacity. Visual attention can lead to suppression of distractors, by reducing the size of the receptive field of a neuron and by increasing sensitivity at a given location in the visual field 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) (b) Figure 1: KITTI image with the ground-truth and predicted bounding boxes and an attention glimpse. The lower row corresponds to the hierarchical attention of our model: 1st layer extracts an attention glimpse (a), the 2nd layer uses appearance attention to build a location map (b). The 3rd layer uses the location map to suppress distractors, visualised in (c). (c) (spatial attention). It can also amplify activity in different parts of the cortex, which are specialised in processing different types of features, leading to response enhancement w. r. t. those features (appearance attention). The functional separation of the visual cortex is most apparent in two distinct processing pathways. After leaving the eye, the sensory inputs enter the primary visual cortex (known as V1) and then split into the dorsal stream, responsible for estimating spatial relationships (where), and the ventral stream, which targets appearance-based features (what). Inspired by the general architecture of the human visual cortex and the role of attention mechanisms, this work presents a biologically-inspired recurrent model for single object tracking in videos (cf. section 3). Tracking algorithms typically use simple motion models and heuristics to decrease the size of the search region. It is interesting to see whether neuroscientific insights can aid our computational efforts, thereby improving the efficiency and performance of single object tracking. It is worth noting that visual attention can be induced by the stimulus itself (due to, e. g., high contrast) in a bottom-up fashion or by back-projections from other brain regions and working memory as top-down influence. The proposed approach exploits this property to create a feedback loop that steers the three layers of visual attention mechanisms in our hierarchical attentive recurrent tracking (HART) framework, see Figure 1. The first stage immediately discards spatially irrelevant input, while later stages focus on producing deictic filters to emphasise visual features particular to the object of interest. By factoring the problem into its constituent parts, we arrive at a familiar statistical domain; namely that of maximum likelihood estimation (MLE). This follows from our interest in estimating the distribution over object locations, in a sequence of images, given the initial location from whence our tracking commenced. Formally, given a sequence of images x1:T ∈ RH×W ×3 and an initial location for the tracked object given by a bounding box b1 ∈ R4 , the conditional probability distribution factorises as Z p(b2:T | x1:T , b1 ) = p(h1 | x1 , b1 ) T Z Y p(bt | ht )p(ht | xt , bt−1 , ht−1 ) dht dh1 , (1) t=2 where we assume that motion of an object can be described by a Markovian state ht . Our bounding b 2:T , found by the MLE of the model parameters. In sum, our contributions box estimates are given by b are threefold: Firstly, a hierarchy of attention mechanisms that leads to suppressing distractors and computational efficiency is introduced. Secondly, a biologically plausible combination of attention mechanisms and recurrent neural networks is presented for object tracking. Finally, our attentionbased tracker is demonstrated using real-world sequences in challenging scenarios where previous recurrent attentive trackers have failed. Next we briefly review related work before describing how information flows through the components of our hierarchical attention in Section 3. Section 3 details the losses applied to guide attention. Section 5 presents experiments on KTH and KITTI datasets with comparison to related neural network based trackers. Section 6 discusses the results and intriguing properties of our framework and Section 7 concludes the work. Code and results will be available online1 . 1 https://github.com/akosiorek/hart 2 2 Related Work A number of recent studies have demonstrated that visual content can be captured through a sequence of spatial glimpses or foveation [22, 12]. Such a paradigm has the intriguing property that the computational complexity is proportional to the number of steps as opposed to the image size. Furthermore, the fovea centralis in the retina of primates is structured with maximum visual acuity in the centre and decaying resolution towards the periphery, Cheung et al. [4] show that if spatial attention is capable of zooming, a regular grid sampling is sufficient. Jaderberg et al. [14] introduced the spatial transformer network (STN) which provides a fully differentiable means of transforming feature maps, conditioned on the input itself. Eslami et al. [7] use the STN as a form of attention in combination with a recurrent neural network (RNN) to sequentially locate and identify objects in an image. Moreover, Eslami et al. [7] use a latent variable to estimate the presence of additional objects, allowing the RNN to adapt the number of time-steps based on the input. Our spatial attention mechanism is based on the two dimensional Gaussian grid filters of [16] which is both fully differentiable and more biologically plausible than the STN. Whilst focusing on a specific location has its merits, focusing on particular appearance features might be as important. A policy with feedback connections can learn to adjust filters of a convolutional neural network (CNN), thereby adapting them to features present in the current image and improving accuracy [25]. De Brabandere et al. [6] introduced dynamic filter network (DFN), where filters for a CNN are computed on-the-fly conditioned on input features, which can reduce model size without performance loss. Karl et al. [17] showed that an input-dependent state transitions can be helpful for learning latent Markovian state-space system. While not the focus of this work, we follow this concept in estimating the expected appearance of the tracked object. In the context of single object tracking, both attention mechanisms and RNNs appear to be perfectly suited, yet their success has mostly been limited to simple monochromatic sequences with plain backgrounds [16]. Cheung [3] applied STNs [14] as attention mechanisms for real-world object tracking, but failed due to exploding gradients potentially arising from the difficulty of the data. Ning et al. [23] achieved competitive performance by using features from an object detector as inputs to a long-short memory network (LSTM), but requires processing of the whole image at each time-step. Two recent state-of-the-art trackers employ convolutional Siamese networks which can be seen as an RNN unrolled over two time-steps [13, 26]. Both methods explicitly process small search areas around the previous target position to produce a bounding box offset [13] or a correlation response map with the maximum corresponding to the target position [26]. We acknowledge the recent work2 of Gordon et al. [10] which employ an RNN based model and use explicit cropping and warping as a form of non-differentiable spatial attention. The work presented in this paper is closest to [16] where we share a similar spatial attention mechanism which is guided through an RNN to effectively learn a motion model that spans multiple time-steps. The next section describes our additional attention mechanisms in relation to their biological counterparts. 3 Hierarchical Attention Dorsal Stream xt Spatial Attention gt ht−1 st vt V1 Ventral Stream νt LSTM ht αt+1 ot   s̃t ot MLP bt ∆b at+1 Figure 2: Hierarchical Attentive Recurrent Tracking Framework. Spatial attention extracts a glimpse gt from the input image xt . V1 and the ventral stream extract appearance-based features while the dorsal stream computes a foreground and background segmentation of the attention glimpse st . Masked features vt contribute to the working memory ht . The LSTM output ot is then used b t . Dashed lines to compute attention at+1 , appearance αt+1 and a bounding box correction ∆b correspond to temporal connections, while solid lines describe information flow within one time-step. 2 [10] only became available at the time of submitting this paper. 3 αt−1 DFN gt Shared CNN CNN vt Figure 3: Architecture of the appearance attention. V1 is implemented as a CNN shared among the dorsal stream (DFN) and the ventral stream (CNN). The symbol represents the Hadamard product and implements masking of visual features by a locaiton map. Inspired by the architecture of the human visual cortex, we structure our system around working memory responsible for storing the motion pattern and an appearance description of the tracked object. If both quantities are known, it would be possible to compute the expected location of the object at the next time step. Given a new frame, however, it is not immediately apparent which visual features correspond to the appearance description. If we were to pass them on to an RNN, it would have to implicitly solve a data association problem. As it is non-trivial, we prefer to model it explicitly by outsourcing the computation to a separate processing stream conditioned on the expected appearance. This results in a location-map, making it possible to neglect features inconsistent with our memory of the tracked object. We now proceed with describing the information flow in our model. Given attention parameters at , the spatial attention module extracts a glimpse gt from the input image xt . We then apply appearance attention, parametrised by appearance αt and comprised of V1 and dorsal and ventral streams, to obtain object-specific features vt , which are used to update the hidden state ht of an LSTM. The LSTM’s output is then decoded to predict both spatial and b t for appearance attention parameters for the next time-step along with a bounding box correction ∆b the current time-step. Spatial attention is driven by top-down signal at , while appearance attention depends on top-down αt as well as bottom-up (contents of the glimpse gt ) signals. Bottom-up signals have local influence and depend on stimulus salience at a given location, while top-down signals incorporate global context into local processing. This attention hierarchy, further enhanced by recurrent connections, mimics that of the human visual cortex [18]. We now describe the individual components of the system. Spatial Attention Our spatial attention mechanism is similar to the one used by Kahoú et al. [16]. Given an input image xt ∈ RH×W , it creates two matrices Axt ∈ Rw×W and Ayt ∈ Rh×H , respectively. Each matrix contains one Gaussian per row; the width and positions of the Gaussians determine which parts of the image are extracted as the attention glimpse. Formally, the glimpse gt ∈ Rh×w is defined as T gt = Ayt xt (Axt ) . (2) Attention is described by centres µ of the Gaussians, their variances σ 2 and strides γ between centers of Gaussians of consecutive rows of the matrix, one for each axis. In contrast to the work by Kahoú et al. [16], only centres and strides are estimated from the hidden state of the LSTM, while the variance depends solely on the stride. This prevents excessive aliasing during training caused when predicting a small variance (w. r. t. strides) leading to smoother convergence. The relationship between variance and stride is approximated using linear regression with polynomial basis functions (up to 4th order) before training the whole system. The glimpse size we use depends on the experiment. Appearance Attention This stage transforms the attention glimpse gt into a fixed-dimensional vector vt comprising appearance and spatial information about the tracked object. Its architecture depends on the experiment. In general, however, we implement V1 : Rh×w → Rhv ×wv ×cv as a number of convolutional and max-pooling layers. They are shared among later processing stages, which corresponds to the primary visual cortex in humans [5]. Processing then splits into ventral and dorsal streams. The ventral stream is implemented as a CNN, and handles visual features and outputs feature maps ν t . The dorsal stream, implemented as a DFN, is responsible for handling spatial relationships. Let MLP(·) denote a multi-layered perceptron. The dorsal stream uses appearance αt to dynamically compute convolutional filters ψ a×b×c , where the superscript denotes the size of the t filters and the number of feature maps, as n oK Ψt = ψ ht i ×bi ×ci = MLP(αt ). (3) i=1 The filters with corresponding nonlinearities form K convolutional layers applied to the output of V1. Finally, a convolutional layer with a 1 × 1 kernel and a sigmoid non-linearity is applied to transform the output into a spatial Bernoulli distribution st . Each value in st represents the probability of the tracked object occupying the corresponding location. 4 The location map of the dorsal stream is combined with appearance-based features extracted by the ventral stream, to imitate the distractor-suppressing behaviour of the human brain. It also prevents drift and allows occlusion handling, since object appearance is not overwritten in the hidden state when input does not contain features particular to the tracked object. Outputs of both streams are combined as3 vt = MLP(vec(ν t st )), (4) with being the Hadamard product. State Estimation Our approach relies upon being able to predict future object appearance and location, and therefore it heavily depends upon state estimation. We use an LSTM, which can learn to trade-off spatio-temporal and appearance information in a data-driven fashion. It acts like a working memory, enabling the system to be robust to occlusions and oscillating object appearance e. g., when an object rotates and comes back to the original orientation. ot , ht = LSTM(vt , ht−1 ), (5) b t = MLP(ot , vec(st )), αt+1 , ∆at+1 , ∆b (6) at+1 = at + tanh(c)∆at+1 , (7) b t = at + ∆b bt b (8) Equations (5) to (8) detail the state updates. Spatial attention at time t is formed as a cumulative sum of attention updates from times t = 1 to t = T , where c is a learnable parameter initialised to a small value to constrain the size of the updates early in training. Since the spatial-attention mechanism b t is estimated is trained to predict where the object is going to go (section 4), the bounding box b relative to attention at time t. 4 Loss We train our system by minimising a loss function comprised of: a tracking loss term, a set of terms for auxiliary tasks and regularisation terms. Auxiliary tasks are essential for real-world data, since convergence does not occur without them. They also speed up learning and lead to better performance for simpler datasets. Unlike the auxiliary tasks used by Jaderberg et al. [15], ours are relevant for our main objective — object tracking. In order to limit the number of hyperparameters, we automatically learn loss weighting. The loss L(·) is given by LHART (D, θ) = λt Lt (D, θ) + λs Ls (D, θ) + λa La (D, θ) + R(λ) + βR(D, θ), with dataset D = (9) n oM i (x1:T , b1:T ) , network parameters θ, regularisation terms R(·), adaptive i=1 weights λ = {λt , λs , λd } and a regularisation weight β. We now present and justify components of our loss, where expectations E[·] are evaluated as an empirical mean over a minibatch of samples  i M x1:T , bi1:T i=1 , where M is the batch size. Tracking To achieve the main tracking objective (localising the object in the current frame), we base the first loss term on Intersection-over-Union (IoU) of the predicted bounding box w. r. t. the area of overlap ground truth, where the IoU of two bounding boxes is defined as IoU(a, b) = a∩b a∪b = area of union . The IoU is invariant to object and image scale, making it a suitable proxy for measuring the quality of localisation. Even though it (or an exponential thereof) does not correspond to any probability distribution (as it cannot be normalised), it is often used for evaluation [20]. We follow the work by Yu et al. [28] and express the loss term as the negative log of IoU: h i b t , bt ) , Lt (D, θ) = Ep(bb1:T |x1:T ,b1 ) − log IoU(b (10) with IoU clipped for numerical stability. 3 vec : Rm×n → Rmn is the vectorisation operator, which stacks columns of a matrix into a column vector. 5 time Figure 4: Tracking results on KTH dataset [24]. Starting with the first initialisation frame where all three boxes overlap exactly, time flows from left to right showing every 16th frame of the sequence captured at 25fps. The colour coding follows from Figure 1. The second row shows attention glimpses multiplied with appearance attention. Spatial Attention Spatial attention singles out the tracked object from the image. To estimate its parameters, the system has to predict the object’s motion. In case of an error, especially when the attention glimpse does not contain the tracked object, it is difficult to recover. As the probability of such an event increases with decreasing size of the glimpse, we employ two loss terms. The first one constrains the predicted attention to cover the bounding box, while the second one prevents it from becoming too large, with logarithmic arguments are appropriately clipped to avoid numerical instabilities:     at ∩ bt − log(1 − IoU(at , xt )) . (11) Ls (D, θ) = Ep(a1:T |x1:T ,b1 ) − log area(bt ) Appearance Attention The purpose of appearance attention is to suppress distractors while keeping full view of the tracked object e. g., focus on a particular pedestrian moving within a group. To guide this behaviour, we put a loss on appearance attention that encourages picking out only the tracked h ×w object. Let τ (at , bt ) : R4 × R4 → {0, 1} v v be a target function. Given the bounding box b and attention a, it outputs a binary mask of the same size as the output of V1. The mask corresponds to the the glimpse g, with the value equal to one at every location where the P bounding box overlaps with the glimpse and equal to zero otherwise. If we take H(p, q) = − z p(z) log q(z) to be the cross-entropy, the loss reads La (D, θ) = Ep(a1:T ,s1:T |x1:T ,b1 ) [H(τ (at , bt ), st )]. (12) Regularisation We apply the L2 regularisation to the model parameters θ and to the expected value 2 2 of dynamic parameters ψ t (αt ) as R(D, θ) = 12 kθk2 + 12 Ep(α1:T |x1:T ,b1 ) [Ψt | αt ] 2 . Adaptive Loss Weights To avoid hyper-parameter tuning, we follow the work by Kendall et al. [19] and learn the loss weighting λ. After initialising the weights P with a vector of ones, we add the following regularisation term to the loss function: R(λ) = − i log(λ−1 i ). 5 5.1 Experiments KTH Pedestrian Tracking Kahoú et al. [16] performed a pedestrian tracking experiment on the KTH activity recognition dataset [24] as a real-world case-study. We replicate this experiment for comparison. We use code provided by the authors for data preparation and we also use their pre-trained feature extractor. Unlike them, we did not need to upscale ground-truth bounding boxes by a factor of 1.5 and then downscale them again for evaluation. We follow the authors and set the glimpse size (h, w) = (28, 28). We replicate the training procedure exactly, with the exception of using the RMSProp optimiser [9] with learning rate of 3.33 × 10−5 and momentum set to 0.9 instead of the stochastic gradient descent with momentum. The original work reported an IoU of 55.03% on average, on test data, while the presented work achieves an average IoU score of 77.11%, reducing the relative error by almost a factor of two. Figure 4 presents qualitative results. 5.2 Scaling to Real-World Data: KITTI Since we demonstrated that pedestrian tracking is feasible using the proposed architecture, we proceed to evaluate our model in a more challenging multi-class scenario on the KITTI dataset [8]. It consists 6 Figure 5: IoU curves on KITTI over 60 timesteps. HART (train) presents evaluation on the train set (we do not overfit). Method Avg. IoU Kahoú et al. [16] Spatial Att App Att HART 0.14 0.60 0.78 0.81 Table 1: Average IoU on KITTI over 60 time-steps. of 21 high resolution video sequences with multiple instances of the same class posing as potential distractors. We split all sequences into 80/20 sequences for train and test sets, respectively. As images in this dataset are much more varied, we implement V1 as the first three convolutional layers of a modified AlexNet [1]. The original AlexNet takes inputs of size 227 × 227 and downsizes them to 14 × 14 after conv3 layer. Since too low resolution would result in low tracking performance, and we did not want to upsample the extracted glimpse, we decided to replace the initial stride of four with one and to skip one of the max-pooling operations to conserve spatial dimensions. This way, our feature map has the size of 14 × 14 × 384 with the input glimpse of size (h, w) = (56, 56). We apply dropout with probability 0.25 at the end of V1. The ventral stream is comprised of a single convolutional layer with a 1 × 1 kernel and five output feature maps. The dorsal stream has two dynamic filter layers with kernels of size 1 × 1 and 3 × 3, respectively and five feature maps each. We used 100 hidden units in the RNN with orthogonal initialisation and Zoneout [21] with probability set to 0.05. The system was trained via curriculum learning [2], by starting with sequences of length five and increasing sequence length every 13 epochs, with epoch length decreasing with increasing sequence length. We used the same optimisation settings, with the exception of the learning rate, which we set to 3.33 × 10−6 . Table 1 and Figure 5 contain results of different variants of our model and of the RATM tracker by Kahoú et al. [16] related works. Spatial Att does not use appearance attention, nor loss on attention parameters. App Att does not apply any loss on appearance attention, while HART uses all described modules; it is also our biggest model with 1.8 million parameters. Qualitative results in the form of a video with bounding boxes and attention are available online 4 . We implemented the RATM tracker of Kahoú et al. [16] and trained with the same hyperparameters as our framework, since both are closely related. It failed to learn even with the initial curriculum of five time-steps, as RATM cannot integrate the frame xt into the estimate of bt (it predicts location at the next time-step). Furthermore, it uses feature-space distance between ground-truth and predicted attention glimpses as the error measure, which is insufficient on a dataset with rich backgrounds. It did better when we initialised its feature extractor with weights of our trained model but, despite passing a few stags of the curriculum, it achieved very poor final performance. 6 Discussion The experiments in the previous section show that it is possible to track real-world objects with a recurrent attentive tracker. While similar to the tracker by Kahoú et al. [16], our approach uses additional building blocks, specifically: (i) bounding-box regression loss, (ii) loss on spatial attention, (iii) appearance attention with an additional loss term, and (iv) combines all of these in a unified approach. We now discuss properties of these modules. Spatial Attention Loss prevents Vanishing Gradients Our early experiments suggest that using only the tracking loss causes an instance of the vanishing gradient problem. Early in training, the system is not able to estimate object’s motion correctly, leading to cases where the extracted glimpse does not contain the tracked object or contains only a part thereof. In such cases, the supervisory signal is only weakly correlated with the model’s input, which prevents learning. Even when the object is contained within the glimpse, the gradient path from the loss function is rather long, since any teaching signal has to pass to the previous timestep through the feature extractor stage. Penalising attention parameters directly seems to solve this issue. 4 https://youtu.be/Vvkjm0FRGSs 7 (a) The model with appearance attention loss (top) learns to focus on the tracked object, which prevents an ID swap when a pedestrian is occluded by another one (bottom). (b) Three examples of glimpses and locations maps for a model with and without appearance loss (left to right). Attention loss forces the appearance attention to pick out only the tracked object, thereby suppressing distractors. Figure 6: Glimpses and corresponding location maps for models trained with and without appearance loss. The appearance loss encourages the model to learn foreground/background segmentation of the input glimpse. Is Appearance Attention Loss Necessary? Given enough data and sufficiently high model capacity, appearance attention should be able to filter out irrelevant input features before updating the working memory. In general, however, this behaviour can be achieved faster if the model is constrained to do so by using an appropriate loss. Figure 6 shows examples of glimpses and corresponding location maps for a model with and without loss on the appearance attention. In figure 6a the model with loss on appearance attention is able to track a pedestrian even after it was occluded by another human. Figure 6b shows that, when not penalised, location map might not be very object-specific and can miss the object entirely (left-most figure). By using the appearance attention loss, we not only improve results but also make the model more interpretable. Spatial Attention Bias is Always Positive To condition the system on the object’s appearance and make it independent of the starting location, we translate the initial bounding box to attention parameters, to which we add a learnable bias, and create the hidden state of LSTM from corresponding visual features. In our experiments, this bias always converged to positive values favouring attention glimpse slightly larger than the object bounding box. It suggests that, while discarding irrelevant features is desirable for object tracking, the system as a whole learns to trade off attention responsibility between the spatial and appearance based attention modules. 7 Conclusion Inspired by the cascaded attention mechanisms found in the human visual cortex, this work presented a neural attentive recurrent tracking architecture suited for the task of object tracking. Beyond the biological inspiration, the proposed approach has a desirable computational cost and increased interpretability due to location maps, which select features essential for tracking. Furthermore, by introducing a set of auxiliary losses we are able to scale to challenging real world data, outperforming predecessor attempts and approaching state-of-the-art performance. Future research will look into extending the proposed approach to multi-object tracking, as unlike many single object tracking, the recurrent nature of the proposed tracker offer the ability to attend each object in turn. Acknowledgements We would like to thank Oiwi Parker Jones and Martin Engelcke for discussions and valuable insights and Neil Dhir for his help with editing the paper. Additionally, we would like to acknowledge the support of the UK’s Engineering and Physical Sciences Research Council (EPSRC) through the Programme Grant DFR01420 and the Doctoral Training Award (DTA). The donation from Nvidia of the Titan Xp GPU used in this work is also gratefully acknowledged. References [1] A. Krizhevsky, I. Sutskever, and Geoffrey E. Hinton. ImageNet Classification with Deep Convolutional 8 Neural Networks. In NIPS, pages 1097–1105, 2012. [2] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML, New York, New York, USA, 2009. ACM Press. [3] Brian Cheung. Neural Attention for Object Tracking. In GPU Technol. Conf., 2016. [4] Brian Cheung, Eric Weiss, and Bruno Olshausen. Emergence of foveal image sampling from learning to attend in visual scenes. ICLR, 2017. [5] Peter. Dayan and L. F. Abbott. Theoretical neuroscience : computational and mathematical modeling of neural systems. Massachusetts Institute of Technology Press, 2001. [6] Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic Filter Networks. NIPS, 2016. [7] S. M. Ali Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, David Szepesvari, Koray Kavukcuoglu, and Geoffrey E. Hinton. Attend, Infer, Repeat: Fast Scene Understanding with Generative Models. In NIPS, 2016. [8] A. Geiger, P. Lenz, C. Stiller, and R. Urtasun. Vision meets robotics: The KITTI dataset. Int. J. Rob. Res., 32(11):1231–1237, sep 2013. [9] Hinton Geoffrey, Nitish Srivastava, and Kevin Swersky. Overview of mini-batch gradient descent, 2012. [10] Daniel Gordon, Ali Farhadi, and Dieter Fox. Re3 : Real-Time Recurrent Regression Networks for Object Tracking. In arXiv:1705.06368, 2017. [11] Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwińska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, Adrià Puigdomènech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471–476, oct 2016. [12] K Gregor, I Danihelka, A Graves, and D Wierstra. DRAW: A Recurrent Neural Network For Image Generation. ICML, 2015. [13] David Held, Sebastian Thrun, and Silvio Savarese. Learning to track at 100 FPS with deep regression networks. In ECCV Work. Springer, 2016. [14] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial Transformer Networks. In NIPS, 2015. [15] Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement Learning with Unsupervised Auxiliary Tasks. In arXiv:1611.05397, 2016. [16] Samira Ebrahimi Kahoú, Vincent Michalski, and Roland Memisevic. RATM: Recurrent Attentive Tracking Model. CVPR Work., 2017. [17] Maximilian Karl, Maximilian Soelch, Justin Bayer, and Patrick van der Smagt. Deep Variational Bayes Filters: Unsupervised Learning of State Space Models from Raw Data. In ICLR, 2017. [18] Sabine Kastner and Leslie G. Ungerleider. Mechanisms of visual attention in the human cortex. Annu. Rev. Neurosci., 23(1):315–341, 2000. [19] Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics. arXiv:1705.07115, may 2017. [20] Matej Kristan, Jiri Matas, Aleš Leonardis, Michael Felsberg, Luk Cehovin, Gustavo Fernández, Tomáš Vojí, Gustav Häger, Georg Nebehay, Roman Pflugfelder, Abhinav Gupta, Adel Bibi, Alan Lukežič, Alvaro Garcia-Martin, Amir Saffari, Philip H S Torr, Qiang Wang, Rafael Martin-Nieto, Rengarajan Pelapur, Richard Bowden, Chun Zhu, Stefan Becker, Stefan Duffner, Stephen L Hicks, Stuart Golodetz, Sunglok Choi, Tianfu Wu, Thomas Mauthner, Tony Pridmore, Weiming Hu, Wolfgang Hübner, Xiaomeng Wang, Xin Li, Xinchu Shi, Xu Zhao, Xue Mei, Yao Shizeng, Yang Hua, Yang Li, Yang Lu, Yuezun Li, Zhaoyun Chen, Zehua Huang, Zhe Chen, Zhe Zhang, Zhenyu He, and Zhibin Hong. The Visual Object Tracking VOT2016 challenge results. In ECCV Work., 2016. [21] David Krueger, Tegan Maharaj, János Kramár, Mohammad Pezeshki, Nicolas Ballas, Nan Rosemary Ke, Anirudh Goyal, Yoshua Bengio, Aaron Courville, and Chris Pal. Zoneout: Regularizing RNNs by Randomly Preserving Hidden Activations. In ICLR, 2017. [22] Volodymyr Mnih, Nicolas Heess, Alex Graves, and Koray Kavukcuoglu. Recurrent Models of Visual Attention. In NIPS, 2014. [23] Guanghan Ning, Zhi Zhang, Chen Huang, Zhihai He, Xiaobo Ren, and Haohong Wang. Spatially Supervised Recurrent Convolutional Neural Networks for Visual Object Tracking. arXiv Prepr. arXiv1607.05781, 2016. [24] Christian Schuldt, Ivan Laptev, and Barbara Caputo. Recognizing human actions: A local SVM approach. In ICPR. IEEE, 2004. [25] Marijn Stollenga, Jonathan Masci, Faustino Gomez, and Juergen Schmidhuber. Deep Networks with Internal Selective Attention through Feedback Connections. In arXiv Prepr. arXiv . . . , page 13, 2014. [26] Jack Valmadre, Luca Bertinetto, João F. Henriques, Andrea Vedaldi, and Philip H. S. Torr. End-to-end representation learning for Correlation Filter based tracking. In CVPR, 2017. [27] Oriol Vinyals, Lukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. Grammar as a Foreign Language. In NIPS, 2015. [28] Jiahui Yu, Yuning Jiang, Zhangyang Wang, Zhimin Cao, and Thomas Huang. UnitBox: An Advanced Object Detection Network. In Proc. 2016 ACM Multimed. Conf., pages 516–520. ACM, 2016. 9
9cs.NE
Combinets: Learning New Classifiers via Recombination arXiv:1802.03605v1 [cs.LG] 10 Feb 2018 Matthew Guzdial, Mark O. Riedl, School of Interactive Computing, Georgia Institute of Technology [email protected], [email protected], Abstract Problems with few examples of a new class of objects prove challenging to most classifiers. One solution to is to reuse existing data through transfer methods such as one-shot learning or domain adaption. However these approaches require an explicit hand-authored or learned definition of how reuse can occur. We present an approach called conceptual expansion that learns how to reuse existing machine-learned knowledge when classifying new cases. We evaluate our approach by adding new classes of objects to the CIFAR-10 dataset and varying the number of available examples of these new classes. 1 Introduction Image recognition systems perform well with large amounts of training data on known classes. This limitation means image recognition systems struggle to recognize classes with small amounts of training data. This is a general problem given the invention or discovery of novel classes, rare or illusive classes, or the imagining of fantastical classes. If a new traffic sign were invented tomorrow, it would have a severe, negative impact on autonomous driving efforts. Modern machine learning success has depended more on the size of datasets than the strength of algorithms [Pereira et al., 2009]. This makes problems with low training data especially difficult. Attempts have been made to make use of smaller datasets, such as in zero-shot [Xian et al., 2017] and one-shot learning [Fei-Fei et al., 2006]. However, in these cases the typical framework of image recognition— predicting a class label for an image—is replaced with predicting features for an image. This requires the humanauthored or automated construction of a set of allowed features that can represent all seen and potentially unseen cases. Ideally, one would want a system to adapt to unseen cases without needing to author a representation that could represent them. We observe that a significant amount of training data for many classes exists. In addition, many of the novel, rare, or fantastical classes we’d like to recognize can be understood as derivations or combinations of existing classes with sufficient training data. Consider a pegasus, a fantastical creature that appears to be a horse with wings, and therefore can be thought of a combination of a horse and a bird. Combinational creativity is a set of techniques that looks to recombine existing knowledge and concepts for the purposes of inventing novel concepts [Boden, 2004]. One could imagine applying these techniques to problems with image recognition of classes with low training data. However, traditional combinational creativity techniques have depended upon humanauthored representations of symbolic variables, which makes them ill-suited to most machine learning approaches. We introduce a novel approach, conceptual expansion, that applies combinational creativity to machine learning. In the domain of image recognition we demonstrate how conceptual expansion outperforms backpropagation and retraining classifier layers for a fixed neural network architecture. The remainder of the paper is organized as follows: first we discuss related work and differentiate this technique from similar approaches to low training data problems. Second, we discuss the conceptual expansion representation in detail and the search-based approach we employ to construct them for this paper. Third, we present a variety of experiments to demonstrate the limitations and successes of the approach. We end with conclusions and considerations for future work. 2 Related Work In this section we briefly summarize prior work in combinational creativity and neural network knowledge adaption and transfer. 2.1 Combinational Creativity There have been many approaches to combinational creativity over the years. Case-based reasoning (CBR) represents a general AI problem solving approach that relies on the storage, retrieval, and adaption of existing solutions [De Mantaras et al., 2005]. The adaption function has lead to a large class of combinational creativity approaches [Wilke and Bergmann, 1998; Fox and Clarke, 2009; Manzano et al., 2011]. These techniques tend to be domain-dependent, for example for the problem of text generation or tool creation [Hervás and Gervás, 2006; Sizov et al., 2015]. Murdock and Goel 2001 combine reinforcement learning with case-based reasoning, which aligns with our work to combine computational creativity and machine learning research. However, the tech- nique does not look to automatically derive cases or concept spaces and then combine these structures. Beyond CBR there exists a wide range of combinational creativity techniques. The area of belief revision, modeling how beliefs change, includes a function to merge prior existing beliefs with new beliefs [Cojan and Lieber, 2009; Konieczny and Pérez, 2011; Fox and Clarke, 2009]. Amalgams represent an extension of this belief merging process that looks to output the simplest combination [Ontañón and Plaza, 2010]. The mathematical notion of convolution has been applied to blend weights between two neural nets in work that parallels our desire to combine combinational creativity and ML, but without promising results [Thagard and Stewart, 2011]. Conceptual blending is perhaps the most popular computational creativity technique, though it has traditionally been limited to hand-authored input [Fauconnier, 2001]. Li et al. [2012] introduced goals to conceptual blending, which parallels our usage of training data to direct the creation of a combination. However, conceptual blending only deals with symbolic values, which makes it ill-suited to machinelearned models. Guzdial and Riedl [2016] utilized conceptual blending to recombine machine-learned models of video game level design by treating all numbers as ordinal values, but their approach does not generalize to neural networks. 2.2 Reusing Learned Data in Neural Networks We note a wide range of prior approaches in reuse or transfer of knowledge in neural networks, such as zero-shot learning [Xian et al., 2017], one-shot learning [Fei-Fei et al., 2006], domain adaption [Daumé III, 2009], and transfer learning [Lampert et al., 2009]. In many of these approaches an author must first determine the exact ways in which reuse can occur, frequently defining a set of features or transformations [Lampert et al., 2009; Kulis et al., 2011; Ganin et al., 2016]. Alternatively a set of features might be learned from text for the purposes of transfer for associated images [Levy and Markovitch, 2012; Ba et al., 2015; Elhoseiny et al., 2017]. Both approaches require extra effort that our approach avoids. Alternatively one can pretend that the two domains or classes represent the same domain, which is common in teacher-student frameworks [Wong and Gales, 2016; Li et al., 2017], but this assumes a significant amount of training data for the new domain or class. Levy and Markovitch’s work in metaphor learning is perhaps closest to our own work, representing a general method for using small sample sizes to transfer between domains [Levy and Markovitch, 2012]. However, this work requires a handauthored set of possible transformations/metaphors that can be learned. 3 Conceptual Expansion Imagine tomorrow we discover that pegasi (the plural of pegasus) exist. Initially we don’t have enough images of this newly discovered flying horse to build a traditional classifier. However, suppose we have a machine learned model trained to detect many classes including horses and birds. Conceptual expansion allows us to reuse the learned features from a Figure 1: Illustrative example of a conceptual expansion of three pixelated faces. Black pixels represent 0’s and white pixels represent 1’s. The rectangles are the a values and the faces are the f values. machine learned model to produce a new model for a pegasus detector. A conceptual expansion can be understood as the following function: CE(X) = a1 ∗ f1 + a2 ∗ f2 ...an ∗ fn (1) where X = {f1 ...fn } is the is the set of all mapped features and A = {a1 , ...an } is a filter representing how much each mapped feature fi should be represented in the final conceptual expansion. The exact shape of ai depends upon the feature representation. If features are symbolic, ai can have values of either 0 to 1 (including the mapped feature or not) or vary from 0 to 1 if features are numeric. If features are matrices, as in a neural net, each ai is also a matrix. In the case of matrices the multiplication is an element-wise multiplication or Hadamard product. Conceptual expansion is a process of finding an A for input X such that CE(X) optimizes for a given objective. For illustration, consider conceptual expansion for pixelated images of faces (Figure 1). In this example, the features f1 ...f3 are a set example pixelated faces, possibly learned. Conceptual expansion is the process of finding a set of a1 ...a3 such that a new class of pixelated face is constructed from elements of the original faces. In the case of neural image recognition, {f1 , ..., fn } are the weights and biases in a convolutional neural network learned via backpropagation. At a high level conceptual expansion has two stages. First, a mapping is constructed based on the existing knowledge in the input machine learned model(s). The mapping determines what particular knowledge, in this case the weights and biases of a neural network, will be combined to address a novel case. Second, this mapping is used to construct an initial conceptual expansion—a set of {f1 , ..., fn } and an A = {a1 , ..., an }—that is iterated upon to optimize for domain specific notions of quality (in this case image recognition accuracy). We discuss the creation of the initial mapping in Section 3.1 and the refinement of the conceptual expansion in Section 3.2. 3.1 Mapping Construction The heart of conceptual expansion is the intuition that we can make use of knowledge about existing classes in order to recognize a new class. In this case, the knowledge is neural network variables, though we can apply this approach to any variable type. The mapping is the collection of existing classes we will be combining knowledge from to repre- Figure 2: Illustrated example of a conceptual expansion mapping. Algorithm 1: Mapping Construction input : an initial model model, training data for class 11 newData, and combined CIFAR10 and class 11 data totalData output: A mapping of existing classification filters and the heuristic score associated with them 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 predictions ← model.predict(newData); maxMapping ← new Mapping(predictions); m ← AddClass(model, maxMapping); maxScore ← Heuristic(m, totalData); v ← [maxScore ]; while improving < 10 do n ← maxMapping.GetNeighbor(v); v ← v +n; m ← AddClass(model, n); mapScore ← Heuristic(m, totalData); oldMax ← maxMapping; maxScore, maxMapping ← max([maxScore, maxMapping ], [mapScore, n ]); if oldMax < maxScore then improving ← 0; else improving ++; return maxMapping maxScore; sent some new class. In the afore mentioned pegasus example it is unlikely one would have a trained image recognition model that only recognized horses and birds. For example the widely used CIFAR-10 dataset [Krizhevsky and Hinton, 2009] contains ten classes, including horses and birds. If we were to use the CIFAR-10 dataset as our starting point, some of the information from some of the 10 classes might be useful, but much of it likely isn’t. We differentiate between these two cases with the mapping. We note that we could just make use of all possible classes, and simply set the alpha values to all 0’s to remove the impact of some mapped classes. However, doing so would expand the memory cost and search space of the second phase, searching for the conceptual expansion. The mapping allows us to select only the portions of a model that will contribute to the recognition of the new class. The mapping is itself a conceptual expansion, but limited only to our new class. It is used to make up for the fact that the existing model architecture, which classifies n classes, needs to expand to n + 1 classes. In particular this means expanding the final fully-connected layer of the initial neural network to account for an eleventh class, meaning an expansion of both weights and biases. The procedure for constructing the initial mapping is shown in Algorithm 1 and visualized in Figure 2. As input we assume we have an existing trained model (CifarNet trained on CIFAR-10 for the purposes of this paper), data for a novel class (whatever pegasus images we have), and a combination of the original model’s original training data plus the data for the novel class. The original data and the data for the new class are kept separate because we need to construct an initial mapping with only the data for the novel class, but we use the total data to refine this mapping to ensure it does not negatively impact existing classes. We construct an initial mapping with the novel class data by looking at the predictions our trained model makes for the novel class data. The initial mapping is constructed according to the ratio of the new images classified into each of the old classes. For example, suppose our trained model is a CifarNet trained on CIFAR-10 and we additionally have four pegasus images [Krizhevsky and Hinton, 2009]. Further suppose that CifarNet classifies two of the four pegasus images as a horse and two as a bird. We construct a mapping of: f1 consisting of the weights and baises associated with the horse class, and f2 consisting of the weights and biases associated with the bird class. We initialize the alpha values for both variables to all be 0.5—the classification ratio—meaning a floating point value for the biases and a matrix for the weights. We use this initial mapping and the trained model to create a new model. The difference between the trained model and the new model is that the former classified n classes, while the new model classifies n + 1 classes. We expand the last fully connected layer to account for a new class based upon the current best mapping. For example, the CifarNet has 10 final classes and a hidden layer of 192 neurons resulting in a 10 × 192 matrix of weights and a 10 × 1 bias vector. We expand this to 11 × 192 and 11 × 1 for each variable, respectively, through a conceptual expansion of the existing weights and biases. We visualize the conceptual expansion of an 11th class in Figure 2. On the left of the figure we visualize the connections from the penultimate fully connected layer of a neural image recognition model to the final fully connected layer, with an eleventh set of weights W 11 added, which is itself a combination of the weights from W 1 and W 3, rep- Algorithm 2: Conceptual Expansion Search input : combined CIFAR10 and class 11 data totalData, an initial model model, a mapping m, and a score score output: The maximum expansion found according to the heuristic 1 2 3 4 5 6 7 8 9 10 11 12 13 14 maxE ← DefaultExpansion(model)+m; maxScore ← score; v ← [maxE ]; improving ← 0; while improving < 10 do n ← maxE.GetNeighbor(v); v ← v + n; s ← Heuristic(n, totalData); oldMax ← maxScore maxScore, maxE ← max([maxScore, maxE ], [s, n ]); if oldMax < maxScore then improving ← 0; else improving ++; return maxE; resenting two classes in the initial mapping. On the right side of the figure we include the actual numbers associated with this process. W 11 is constructed by multiplying a1 = [0.0, 0.0...1.0, 1.0] with f1 = W1 and adding this to a2 = [1.0, 1.0...0.0, 0.0] multiplied by f2 = W3 . This conceptual mapping is selecting from the first half of W1 and the second half of W3 , visualized by the gradient of colors representing W1 1. We evaluate the expanded model according to some heuristic, such as clasification accuracy. Lines 7 to 16 in Algorithm 1 represent a random search that attempts a fixed number of random alterations to the current best mapping (10 worked well for our experiments). The alterations change the ways the mapped classes are combined by changing the ai multiplier values. The ai values can be changed by multiplying the entire matrix by some random number or by matrix subtraction or addition by a random matrix with values [01). If a new maximum mapping is found, this process begins again, if not the loop ends. Notably we ensure we do not repeat the same mapping twice by keeping a history of alterations, but otherwise this search is unguided. The output of the mapping construction is a maximum mapping and a heuristic score associated with that mapping. 3.2 Conceptual Expansion Search The mapping construction stage of this approach finds a course initial solution, and the algorithm discussed in this section refines that solution. We present the pseudocode for the Conceptual Expansion Search in Algorithm 2. Line 1 finds a default expansion. This is simply a expansion equivalent to the original model, in that each variable is replaced by an expanded variable with its original value and an ai of 1.0 (or matrix of 1.0’s). This means that the expansion is functionally identical to the original model. However, this representation means we can alter individual values of variables easily. The rest of the algorithm follows much the same as the Mapping Construction algorithm. Random search is used with a fixed number of random alterations permitted before the search ends. Notably in this stage the set of possible alterations is much larger. Neighboring expansions can be found by altering a single element of a single ai , swapping out an associated original variable of an expanded variable, or adding an addition variable (and corresponding random ai ). The final output of this process is the maximum scoring expanded model found during the random search. For the purposes of clarity we refer to these expanded models as combinets or recombined neural networks. Our initial refinement algorithm is a random search as a starting point for our investigation of conceptual expansion, to keep computation tractable, and to establish the baseline for this approach. We anticipate better performance with stronger optimization methods. 4 Experiments We present a series of experiments meant to quantify the strengths and limitations of conceptual expansion when applied to image recognition with deep neural networks. We chose CIFAR-10 and CIFAR-100 [Krizhevsky and Hinton, 2009] as the domain for this approach due to these representing well-understood datasets. For the deep neural network model we chose CifarNet [Krizhevsky and Hinton, 2009], again due to existing understanding of its performance on the more traditional applications of these datasets. We do not include a full description of CifarNet but note that it is a two-layer convolutional neural net with three fully-connected layers. For each experiment we ran each stage of conceptual expansion (mapping construction and revision search) ten times and took the maximum mapping/expansion found across each of the ten runs. We did this to account for the fact that the random search would unsurprisingly occasionally give poor results. However we note that this approach was still many times faster than initially training the CifarNet on CIFAR-10 with backpropagation. Our first experiment expands a CifarNet trained on CIFAR10 to recognize the fox class from CIFAR-100, iteratively varying the size of the fox training data. For the second experiment we keep the size of the data of the new class constant and randomly choose ten other classes from CIFAR-100 to demonstrate that this process is not limited to foxes. Our third experiment fully expands a CifarNet model trained on CIFAR-10 recognize the one-hundred classes of CIFAR-100. Finally, we evaluate the running example throughout this paper, expanding a CifarNet model trained on CIFAR-10 to detect the pegasus class. 4.1 CIFAR-10 + Fox For our initial experiment we chose to add fox detection to the CifarNet, as this label exists within CIFAR-100, but not within CIFAR-10. However we note that CIFAR-10 does include dog and cat classes; thus we might naively expect the Approach combinet-H1 combinet-H2 combinet-H3 backprop retrain 500 foxes fox orig-10 2.0 86.87 86.0 77.08 41.0 84.58 83.0 62.51 67.0 87.07 250 foxes fox orig-10 2.0 86.78 76.0 79.98 40.0 84.12 76.0 62.09 29.0 87.20 100 foxes fox orig-10 38.0 83.21 74.0 79.04 48.0 83.19 54.0 62.54 3.0 86.92 50 foxes fox orig-10 44.0 84.94 50.0 83.26 49.0 81.85 42.0 62.18 0.0 86.91 10 foxes fox orig-10 71.0 82.84 65.0 82.89 49.0 83.63 0.0 61.67 0.0 86.96 5 foxes fox orig-10 6 86.21 26.0 82.10 42.0 82.51 0.0 62.27 0.0 87.20 Table 1: A table with the test accuracies for the first experiment. The 10 column displays the accuracy for the 10,000 test images for the original 10 classes of CifarNet. The fox column displays the accuracy for the 100 fox test images (thus the disparity in decimal places). We mark in bold the approach that for a particular fox sample size had the best accuracy across all 11 classes, fox included. fox class to be an easy expansion. We vary the amount of training data used, up to the full 500 fox samples available as training data in CIFAR-100. We also vary the heuristic used in the mapping construction and conceptual expansion search phases. The results of expanding a CifarNet model to recognize foxes are summarized in Table 1. For training data we drew from the 50,000 training examples for the ten classes of CIFAR-10, adding a varying number of training fox instances. For test data we made use of the full 10,000 CIFAR10 test set and the 100 foxes in the CIFAR-100 test set. We present the test accuracies across all approaches and with all sample sizes in Table 1. The images chosen for each different size of fox training set were chosen at random from the 500 available fox images in the CIFAR-100 training set. We constructed three versions of our approach, based on the choice of heuristic to apply. Combinet-H1 makes use of the accuracy across all eleven classes, treating them as equivalent. Combinet-H2 looks only at fox classification accuracy. Combinet-H3 makes use of a heuristic of a normalized combination of Combinet-H1 and Combinet-H2. We evaluated against two baselines. For the first, we approached this problem as one might naively, training CifarNet with backpropagation from scratch. Essentially we made the assumption that the new class was part of the same domain as the other classes as in [Daumé III, 2009]. For our second baseline we took inspiration from student-teacher models [Wong and Gales, 2016; Li et al., 2017], training an initial CifarNet on only the CIFAR-10 data and then retraining the classification layers to transform it to predict the eleventh class with the available data. In all cases we trained till convergence. In Table 1 we mark in bold the results for the approach with the highest average accuracy across all eleven classes for each fox training set data size. We note that this average accuracy is not always the result with the highest accuracy from the original ten classes (marked orig-10) or fox accuracy. As can be seen in Table 1, when there is significant training data (approaching ∼ 250), the retrained baseline performs best at this measure, though notably it is out-performed on fox accuracy. However, for all values of foxes ranging from (5-100], the combinets perform best. Technically the retrain baseline performs the best according to the fox test accuracy for the 5 fox training set. However, it has 0 percent accuracy at predicting foxes. We note that the expected CifarNet test accuracy for CIFAR-10 is 85-87%. We found that Combinet-H2 had the highest fox classification accuracy, but with a five-ten percent loss in CIFAR-10 accuracy. This loss in CIFAR-10 accuracy was almost always due to overgeneralizing, with at least one CIFAR-10 class being predicted as foxes. For example for the ten fox training images, 443 of the 1000 test images for the airplane class were misclassified as foxes. All the combinets have this issue of false positives to blame for their hit to CIFAR-10 accuracy. However, the false positives were more evenly spread across all classes for the remaining two approaches. For example in the case with ten fox training images for Combinet-H1: 189 airplanes, 46 deer, and smaller values for the remaining cases were misclassified as foxes. 4.2 CIFAR10 + Random 11th To address the question of whether our technique hyperspecializes to a single class, we conducted a second experiment in which we randomly select 10 classes from CIFAR100 that are not present in CIFAR0-10. For this experiment we made use of Combinet-H1 and a sample size of 10 images. We note that we do not include the two baselines we made use of in the last experiment given that they both had 0% accuracy with a sample size of 10 for the eleventh class. We present the results of this experiment in Table 2. We note final test accuracies of 15-42 percent across all cases, which exceeds random chance. The difference in performance seems to depend upon whether CIFAR-10 contains sufficiently similar classes to the new class. For example note the disparate performance between predicting tiger (32%) and oak (22%). Since the original training set contains no trees, it is understandable that the approach performs poorly when attempted to recombine existing knowledge to correctly classify oak trees. We note that some 11th labels lead to low CIFAR-10 accuracy with high accuracy for the eleventh label, such as the woman label. This indicates that the classes were sufficiently similar to classify this label, but only after the combinet changed significantly from the original trained CifarNet. In contrast, the combinet for beetle, which has relatively high accuracy for both, did not have to be altered significantly. 4.3 Expanding CIFAR-10 to CIFAR-100 For both prior experiments we added a single eleventh class to a CifarNet. This experiment looks at the problem of shifting a trained CifarNet from classifying the ten original classes Class 11 Original-10 aquarium fish 29.0 76.49 beetle 33.0 84.39 tiger 36.0 83.02 cloud 32.0 79.32 cattle 15.0 84.53 worm 33.0 85.36 woman 42.0 79.25 shrew 27.0 81.52 oak 22.0 80.44 lawn-mower 28.0 84.63 Table 2: A table with the test accuracies for the second experiment. The novel class label is given for each column, with the novel class accuracy (class 11) and average accuracy for the original ten classes (CIFAR-10) given in the rows. Accuracy combinet-H1 10.59 backprop 1.20 retrain 6.43 Table 3: A table summarizing the results of the third experiment, adaption of a CifarNet from classifying the ten classes of CIFAR-10 to the one-hundred classes of CIFAR-100 with only 10 images from the 100 new classes. from the CIFAR-10 dataset to the one-hundred classes from the CIFAR-100 dataset. For this experiment we limited our training day to ten randomly chosen samples of each class. We slightly altered our approach to account for the change in task, constructing an initial mapping for each class as if we were to expand a CifarNet to just that eleventh class individually. This entails using training data from CIFAR-10 in the mapping phase. For the conceptual expansion search phase we only made use of the 10 samples for each of the one-hundred classes for a total of 1000 training images. We utilized the same two baselines as with the first experiment, given this 1000 image training set. We note that one would not typically utilize CifarNet for this task. Even given access to all 50,000 training samples a CifarNet trained using backpropagation only achieves around 30% test accuracy for CIFAR-100. These results are meant to show the relative scale of accuracy before and after conceptual expansion and not attempting to achieve state of the art on CIFAR-100 with the full dataset. We present the results of this experiment in Table 3. We note that our approach is the only one to do better than chance, and significantly outperforms both baselines. However no approach reaches anywhere near the 30 percent accuracy that could be achieved with full training data. 4.4 Pegasus We return to our running example of wanting an image recognition system that can recognize pegasi. Unfortunately we lack actual images of a pegasus. To approximate this we collected fifteen photo-realistic, open-use pegasus images from Flickr. Using the same combinet-H1 formulation as the above two experiments we tested this approach with a 10-5 training/test split and a 5-10 training/test split. For the former we recognized 4 of the pegasus images (80% accuracy), with 80% CIFAR-10 accuracy, and for the latter we recognized 5 of the 10 pegasus images (50% accuracy) with 84% CIFAR10 accuracy. 5 Discussion and Limitations Overall we consider our approach to successfully achieve the stated purpose of created new models capable of recognizing novel classes with little training data. We out-performed two baselines that represent current efforts to solve this problem outside of altering the representation as in zero-shot and oneshot approaches. We note that much work remains to be done, the optimization approach in particular (random search), being an obvious place for improvement. However, we wishes to show the initial strength of this representation and approach outside of a stronger optimizer. We expect these results to generalize to other domains, but we recognize that our choice of dataset is a potential limiting factor. CIFAR-10 and CIFAR-100 have very low resolution images (32x32 RGB images). We expect this is part of the reason for some of the strange mappings that our approach constructed. For example, the most common fox mapping was a combination of planes, deer, and dogs in that order of significance. We did not make use of traditional data augmentation techniques such as noising or horizontal flipping of the images. However, we note that had we applied these techniques to the experiments with five or ten fox training images, we would expect results at best like those of the experiment with fifty fox training images, at which point our approach would still out-perform the two baselines. 6 Conclusions We present conceptual expansion, an approach to produce expanded versions of existing machine learned deep neural net models we call combinets. We ran four experiments of this approach compared to two common baselines, and found we were able to achieve far greater accuracy with far less data. Our technique relies upon a flexible representation of recombination of existing knowledge that allows us to represent novel classes as a combination of particular knowledge from existing classes. To our knowledge this represents the first such technique to recombine existing machine learned knowledge without requiring an explicit learned or authored function of transfer or reuse. Acknowledgments We gratefully acknowledge the NSF for supporting this research under NSF award 1525967. References [Ba et al., 2015] Lei Jimmy Ba, Kevin Swersky, Sanja Fidler, and Ruslan Salakhutdinov. Predicting deep zero-shot convolutional neural networks using textual descriptions. In ICCV, pages 4247–4255, 2015. [Boden, 2004] Margaret A Boden. The creative mind: Myths and mechanisms. Psychology Press, 2004. [Cojan and Lieber, 2009] Julien Cojan and Jean Lieber. Belief merging-based case combination. In ICCBR, pages 105–119. Springer, 2009. [Daumé III, 2009] Hal Daumé III. Frustratingly easy domain adaptation. arXiv preprint arXiv:0907.1815, 2009. [De Mantaras et al., 2005] Ramon Lopez De Mantaras, David McSherry, Derek Bridge, David Leake, Barry Smyth, Susan Craw, Boi Faltings, Mary Lou Maher, MICHAEL T COX, Kenneth Forbus, et al. Retrieval, reuse, revision and retention in case-based reasoning. The Knowledge Engineering Review, 20(3):215–240, 2005. [Elhoseiny et al., 2017] Mohamed Elhoseiny, Yizhe Zhu, Han Zhang, and Ahmed Elgammal. Link the head to the” beak”: Zero shot learning from noisy text description at part precision. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. [Fauconnier, 2001] Gilles Fauconnier. Conceptual blending and analogy. The analogical mind: Perspectives from cognitive science, pages 255–286, 2001. [Fei-Fei et al., 2006] Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE transactions on pattern analysis and machine intelligence, 28(4):594–611, 2006. [Fox and Clarke, 2009] Jorge Fox and Siobhán Clarke. Exploring approaches to dynamic adaptation. In Proceedings of the 3rd International DiscCoTec Workshop on Middleware-Application Interaction, pages 19–24. ACM, 2009. [Ganin et al., 2016] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016. [Guzdial and Riedl, 2016] Matthew Guzdial and Mark Riedl. Learning to blend computer game levels. arXiv preprint arXiv:1603.02738, 2016. [Hervás and Gervás, 2006] Raquel Hervás and Pablo Gervás. Case-based reasoning for knowledge-intensive template selection during text generation. In European Conference on Case-Based Reasoning, pages 151–165. Springer, 2006. [Konieczny and Pérez, 2011] Sébastien Konieczny and Ramón Pino Pérez. Logic based merging. Journal of Philosophical Logic, 40(2):239–270, 2011. [Krizhevsky and Hinton, 2009] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. [Kulis et al., 2011] Brian Kulis, Kate Saenko, and Trevor Darrell. What you saw is not what you get: Domain adaptation using asymmetric kernel transforms. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pages 1785–1792. IEEE, 2011. [Lampert et al., 2009] Christoph H Lampert, Hannes Nickisch, and Stefan Harmeling. Learning to detect unseen object classes by between-class attribute transfer. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 951–958. IEEE, 2009. [Levy and Markovitch, 2012] Omer Levy and Shaul Markovitch. Teaching machines to learn by metaphors. Technion-Israel Institute of Technology, Faculty of Computer Science, 2012. [Li et al., 2012] Boyang Li, Alexander Zook, Nicholas Davis, and Mark O Riedl. Goal-driven conceptual blending: A computational approach for creativity. In Proceedings of the 2012 International Conference on Computational Creativity, Dublin, Ireland, pages 3–16, 2012. [Li et al., 2017] Jinyu Li, Michael L Seltzer, Xi Wang, Rui Zhao, and Yifan Gong. Large-scale domain adaptation via teacher-student learning. arXiv preprint arXiv:1708.05466, 2017. [Manzano et al., 2011] Sergio Manzano, Santiago Ontanón, and Enric Plaza. Amalgam-based reuse for multiagent case-based reasoning. In International Conference on Case-Based Reasoning, pages 122–136. Springer, 2011. [Murdock and Goel, 2001] J Murdock and Ashok Goel. Meta-case-based reasoning: Using functional models to adapt case-based agents. Case-based reasoning research and development, pages 407–421, 2001. [Ontañón and Plaza, 2010] Santiago Ontañón and Enric Plaza. Amalgams: A formal approach for combining multiple case solutions. In Case-Based Reasoning. Research and Development, pages 257–271. Springer, 2010. [Pereira et al., 2009] Fernando Pereira, Peter Norvig, and Alon Halevy. The unreasonable effectiveness of data. IEEE Intelligent Systems, 24(undefined):8–12, 2009. [Sizov et al., 2015] Gleb Sizov, Pinar Öztürk, and Agnar Aamodt. Evidence-driven retrieval in textual cbr: bridging the gap between retrieval and reuse. In International Conference on Case-Based Reasoning, pages 351–365. Springer, 2015. [Thagard and Stewart, 2011] Paul Thagard and Terrence C Stewart. The aha! experience: Creativity through emergent binding in neural networks. Cognitive science, 35(1):1–33, 2011. [Wilke and Bergmann, 1998] Wolfgang Wilke and Ralph Bergmann. Techniques and knowledge used for adaptation during case-based problem solving. In International Conference on Industrial, Engineering and Other Applications of Applied Intelligent Systems, pages 497–506. Springer, 1998. [Wong and Gales, 2016] Jeremy HM Wong and Mark John Gales. Sequence student-teacher training of deep neural networks. 2016. [Xian et al., 2017] Yongqin Xian, Bernt Schiele, and Zeynep Akata. Zero-shot learning-the good, the bad and the ugly. arXiv preprint arXiv:1703.04394, 2017.
1cs.CV
STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES arXiv:1802.02225v1 [math.AG] 6 Feb 2018 ULRICH GÖRTZ Abstract. Affine Deligne-Lusztig varieties are analogues of Deligne-Lusztig varieties in the context of affine flag varieties and affine Grassmannians. They are closely related to moduli spaces of p-divisible groups in positive characteristic, and thus to arithmetic properties of Shimura varieties. We compare stratifications of affine Deligne-Lusztig varieties attached to a basic element b. In particular, we show that the stratification defined by Chen and Viehmann using the relative position to elements of the group Jb , the σ-centralizer of b, coincides with the Bruhat-Tits stratification in all cases of Coxeter type, as defined by X. He and the author. 0. Introduction Affine Deligne-Lusztig varieties are closely related to moduli spaces of p-divisible groups (so-called Rapoport-Zink spaces), and hence to the reduction of Shimura varieties and their arithmetic properties. They are also interesting in their own: Similarly as with classical Deligne-Lusztig varieties, their cohomology gives rise to representations (of certain p-adic groups). For instance, one can hope that this gives an approach to the local Langlands correspondence, compare the papers by Chan [Ch] and Ivanov [Iv1], [Iv2]. In general, the geometric structure of affine Deligne-Lusztig varieties is hard to understand. Even foundational properties such as the dimension and the sets of connected and irreducible components are not yet fully understood in general. See the survey papers by Rapoport [Ra] and He [He] and the references given there. A general approach to understanding the geometry and cohomology of an affine Deligne-Lusztig variety is to stratify it as a union of better understood varieties. In [CV], Chen and Viehmann define a stratification (which we below call the J-stratification) of affine Deligne-Lusztig varieties in a very general setting, using the relative position to elements of the group J, the σ-centralizer of the underlying element b. While in their paper they consider the case where the level structure is hyperspecial (and so in particular the underlying algebraic group G is assumed to be unramified), it is clear that their underlying definition applies in the general case, as well. However, it is extremely difficult to give a good description of this stratification: Neither the index set of the stratification nor the geometric structure of the strata are easy to understand. Also, the J-stratification is a stratification only in the loose sense that it is a decomposition into disjoint locally closed subsets; in general, the closure of a stratum is not a union of strata. Nevertheless, Chen and Viehmann are able to give a convincing justification of their definition by showing that in several specific cases their stratification coincides with stratifications which were studied previously and which have nice properties. One of these is the so-called Bruhat-Tits (BT) stratification, a stratification indexed in terms of the Bruhat-Tits building of the algebraic group J (whence the name), whose strata are classical Deligne-Lusztig varieties. This stratification exists only in particular 2010 Mathematics Subject Classification. 11G18, 14G35, 20G25. Key words and phrases. Affine Deligne-Lusztig varieties. The author was partially supported by DFG Transregio-Sonderforschungsbereich 45. 1 2 U. GÖRTZ cases, called of Coxeter type in [GH], where the situation was discussed in detail from the point of view of affine Deligne-Lusztig varieties; see also [GHN]. Even though this is quite a special situation, it includes many important cases and this phenomenon had been studied extensively in the context of Rapoport-Zink spaces and Shimura varieties (see e. g. [Ka], [VW], [RTW]) where it plays an important role, for instance in the Kudla-Rapoport program. The purpose of this paper is to provide the technical result ensuring that the Jstrata are locally closed subsets of F lagK without the restriction to hyperspecial level structure, and to prove that the J-stratification coincides with the BT stratification in all cases of Coxeter type, as conjectured in [CV]. To describe the results in more detail, we fix some notation. Let F be a nonarchimedean local field, i.e., a finite extension of Qp , the field of p-adic numbers for a prime p, or of the form Fq ((t)) where Fq denotes the finite field with q elements. Let F̆ be the completion of the maximal unramified extension of F , and let σ be the Frobenius automorphism of F̆ with fixed field F . Let G be a connected semisimple group of adjoint type over F . We denote by W̃ the extended affine Weyl group over F̆ , and by S̃ ⊂ W̃ the set of simple affine reflections. Let K ⊂ S̃ (a “level structure”), and let K̆ ⊂ G(F̆ ) be the corresponding parahoric subgroup (see Section 1.2 for more details). For b ∈ G(F̆ ) and w ∈ W̃ we have the affine Deligne-Lusztig variety Xw (b) = {g ∈ G(F̆ )/K̆; g −1 bσ(g) ∈ K̆wK̆}, a locally closed subscheme of the ind-scheme G(F̆ )/K̆ (in the case of mixed characteristic, we view G(F̆ )/K̆ and Xw (b) as ind-perfect schemes in the sense of Zhu [Zh] and Bhatt and Scholze [BS]). We also have the variant X(µ, b)K for µ a translation, the union of the above Xw (b) for w in the µ-admissible set. See Section 1.5. To state the definition of the J-stratification, denote by J := {g ∈ G(F̆ ); g−1 bσ(g) = b} the σ-centralizer of b. (Since b is usually fixed in the discussion, we mostly omit it from the notation.) By definition, two points g, g′ ∈ F lagK lie in the same J-stratum, if and only if for all j ∈ J, invK (j, g) = invK (j, g′ ). Here invK denotes the relative position map for level K̆ (see Def. 2.1). For the definition of the Bruhat-Tits stratification, we refer to Section 3 and to [GH]. The main theorem in this paper is Theorem 0.1. ([CV], Conj. 4.2; Theorem 3.4, Remark 3.5) Let (G, µ, K) be of Coxeter type. Then the Bruhat-Tits stratification on X(µ, b)K coincides with the J-stratification. See Section 3.1 for details on the setup, including the (important) choices of the particular elements b. To prove that the Bruhat-Tits stratification is a refinement of the J-stratification we use a result of Lusztig (Prop. 1.1) saying that a classical DeligneLusztig variety attached to a twisted Coxeter element is contained in the open cell of the ambient flag variety. The converse is more difficult and relies, in addition, on combinatorial arguments on the affine root system and the building of G; one of the ingredients is the theory of acute cones developed by Haines and Ngô, [HN]. Before we come to the main theorem, we generalize the following finiteness property of the J-stratification which was proved for hyperspecial level in [CV], Prop. 2.6. Theorem 0.2. (Theorem 2.8) Let b ∈ G(F̆ ), let Jb be its σ-centralizer, and let J = Jb (F ). Fix a parahoric level K ⊂ S̃ and a quasi-compact subscheme S ⊂ F lagK in the partial flag variety for K. STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 3 There exists a finite subset J ′ ⊂ J such that for all g, g ′ ∈ S with inv(j, g) = inv(j, g′ ) for all j ∈ J ′ , we have inv(j, g) = inv(j, g ′ ) for all j ∈ J. The result of the theorem ensures that the J-stratification has certain reasonable finiteness properties; in particular, the J-strata are locally closed. See [CV] Cor. 2.10, Prop. 2.11. Outline of the paper. In Section 1, we recall Lusztig’s result on classical DeligneLusztig varieties mentioned above, give the details for the setup concerning affine DeligneLusztig varieties and recall some properties of the Bruhat-Tits building that we are going to use. In Section 2, we discuss the definition and general properties of the Jstratification, including the finiteness property stated in the introduction. Finally, in Section 3 we recall the notion of data of Coxeter type and the Bruhat-Tits stratification, and prove that it coincides with the J-stratification. 1. Preliminaries 1.1. Deligne-Lusztig varieties. Let k0 be a finite field, and let k be an algebraic closure of k0 . We consider a connected reductive group G0 /k0 together with a maximal torus and a Borel subgroup T0 ⊂ B0 ⊂ G0 . By T , B and G, resp., we denote the base change of these groups to k. Let σ denote the Frobenius automorphism on k with fixed field k0 , and likewise the isomorphism induced on G(k), etc. In the following, we often implicitly identify a variety over an algebraically closed field k with its k-valued points. We denote by W the Weyl group of T , and by w0 its longest element. Let S ⊂ W denote the set of simple reflections defined by B. This defines the Bruhat order and the length function ℓ on W . For any w ∈ W , we have the Deligne-Lusztig variety attached to w: X(w) = {gB ∈ G/B; g −1 σ(g) ∈ BwB}. This is a smooth locally closed subvariety of the flag variety G/B of dimension ℓ(w). Now σ acts on S since T and B are defined over k0 , and we call an element w ∈ W a twisted Coxeter element, if w can be written as the product of elements of S which lie in different σ-orbits, and such that every σ-orbit occurs among the factors. Proposition 1.1. (Lusztig, [Lu] Cor. 2.5) Let X ⊂ G/B the Deligne-Lusztig variety attached to a twisted Coxeter element. Then X ⊆ Bw0 B/B. Example 1.2. Let us explain the case of G = GLn , k0 = Fp . We identify the Weyl group for the diagonal torus with the symmetric group in the usual way, and use the transpositions si = (i, i + 1), i = 1, . . . , n − 1, as Coxeter generators corresponding to the Borel subgroup of upper triangular matrices. As explained in [DL] 2.2, the Deligne– Lusztig variety X for the (twisted) Coxeter element w = s1 s2 · · · sn−1 consists of those flags (Fi )i in kn such that Fi = i X σ j (F1 ) for all i. j=1 P Looking at the Moore determinant, we see that a line of the form h ai ei i gives rise to a point in X (i.e., all sums on the right hand side of the displayed formula are in fact direct sums) if and only if the ai are linearly independent over Fp , or in other words, if and only if this line is not contained in a rational hyperplane. 4 U. GÖRTZ From this, it is easy to see that a point (Fi )i ∈ X satisfies dim Fi ∩ he1 , . . . , ej ik = max(0, i + j − n). This is precisely the Schubert condition which ensures that X is contained in the open cell Bw0 B/B. See the paper [RTW] by Rapoport, Terstiege and Wilson, Section 5, and Wu’s paper [Wu], Examples 4.2, 4.3, 4.6, 4.7, for further examples for other classical groups. 1.2. Notation. Now we return to the setting of the introduction: Let F be a nonarchimedean local field, F a separable closure of F , and F̆ the completion of its maximal unramified extension F un . We denote by ε ∈ F a uniformizer, by κ the residue class field of F , and by κ the residue class field of F̆ , an algebraic closure of κ. Let σ denote the Frobenius automorphism of F̆ over F . Let G/F be a connected semisimple group of adjoint type. (It is easy to extend the results below to reductive groups, but we restrict to the key case of semisimple adjoint groups here.) We have the Kottwitz homomorphism κG : G(F̆ ) → π1 (G)Gal(F /F un ) , where π1 (G) denotes the algebraic fundamental group of G. See [Ko2] §7, [RR]. Its kernel G(F̆ )1 := Ker(κG ) is the subgroup of G(F̆ ) generated by all parahoric subgroups. The analogous result also holds over F , and we again denote the concerning subgroup by G(F )1 . See [Ri] Lemma 4.3. Fix a maximal F̆ -split torus of G over F and denote by T its centralizer, a maximal torus in G (because G is quasi-split over F̆ ). Let N be the normalizer of T in G. These choices give rise to the (relative) finite Weyl group W0 = N (F̆ )/T (F̆ ) and the IwahoriWeyl group W̃ = N (F̆ )/T (F̆ )1 , where T (F̆ )1 ⊂ T (F̆ ) is the unique parahoric subgroup, or equivalently the kernel of the Kottwitz homomorphism for the group T . We denote by B̆ = B(G, F̆ ) the building of G over F̆ . Associated with S ⊂ G, there is the “standard apartment” A˘, an affine space under the vector space V = X∗ (T )Gal(F /F un ) ⊗Z R on which W̃ acts by affine transformations. The Frobenius σ also acts on A˘, and we fix a σ-invariant alcove a which we call the base alcove. We fix a special vertex 0 in the closure of a which is fixed under the Frobenius automorphism of the unique quasi-split inner form of G, and using this vertex as the base point, we identify A˘ with V . This choice of special vertex also gives rise to a decomposition of W̃ as a semi-direct product W̃ = X∗ (T )Gal(F /F un ) ⋊ W0 (but note that the inclusion W0 ⊂ W̃ is not σ-equivariant in general). Inside W̃ we have the affine Weyl group Wa ; we can define it as the extended affine Weyl group of the simply connected cover of the derived group of G. In terms of the Kottwitz homomorphism κG , we can express Wa as Wa = (N (F̆ ) ∩ G(F̆ )1 )/T (F̆ )1 , see [Ri]. From the choice of a base alcove, we obtain a system of simple affine reflections S̃ ⊂ Wa . Then S̃ generates Wa and (Wa , S̃) is a Coxeter system. We extend the length function and the Bruhat order to W̃ in the usual way; an element has length 0 if and only if it fixes the base alcove a. For a subset P ⊆ S̃, we denote by WP ⊆ Wa the subgroup generated by the elements of P , and by P W̃ the set of minimal length representatives in W̃ of the cosets in WP \W̃ . The set P also gives rise to a standard parahoric subgroup P̆: It is the subgroup of G(F̆ ) generated by Ĭ and (lifts to N (F̆ ) of) the elements of P . We denote by Φ the set of finite roots in the unique reduced affine root system in V attached to the relative affine root system of G over F̆ , and for α ∈ Φ and k ∈ Z, we denote by Hα,k = {v ∈ V ; hα, vi = k} the corresponding affine root hyperplane. STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 5 2 1 3 0 Figure 1. The base alcove in the building B(G, F̆ ) (gray lines) and part of the standard apartment in the rational building B(J, F ) (black line). We denote by Λ the lattice of translations of A˘ which arise from the action of W̃ . Since G is assumed to be of adjoint type, X∗ (T )Gal(F /F un ) is torsion-free, so that Λ = X∗ (T )Gal(F /F un ) . For λ ∈ Λ, we denote by ελ the corresponding element in W̃ . 1.3. The Bruhat-Tits building of G. We now come back to the building of G and discuss it in a little more detail. The extended affine Weyl group W̃ acts on the set of alcoves of Ă. Having chosen a base alcove a, mapping w ∈ Wa to wa, we can identify the affine Weyl group Wa with the set of alcoves in A˘. The Frobenius σ acts on the building B̆ = B(G, F̆ ) of G over F̆ . If we consider the building as a metric space (which carries a simplicial structure), then we can identify the set of fixed points of σ with the rational building B = B(G, F ) of G over F . Note that in general the embedding B ⊂ B̆ is not induced by a morphism of simplicial complexes, i.e., a vertex of B does not necessarily map to a vertex of B̆ (see the example below). The same situation is, of course, obtained if we pass to another form of G over F . In particular, for τ ∈ N (F̆ ) with τ Ĭτ −1 = Ĭ, i.e., τ gives a length 0 element in W̃ , we can consider the twisted Frobenius σJ := Int(τ ) ◦ σ : x 7→ τ σ(x)τ −1 on G(F̆ ) and the corresponding inner form J of G over F (where the notation is chosen in view of the applications to affine Deligne-Lusztig varieties, see below). In this situation, the affine and extended affine Weyl groups over F can be identified with the subgroups of Wa and W̃ , respectively, consisting of the elements fixed by the Frobenius automorphism (induced by) σJ . We denote the rational affine Weyl group corresponding to J by WaJ . For the buildings, we get B(J, F ) ⊂ B(J, F̆ ) = B(G, F̆ ). See [Ri] for a detailed discussion of the relation between the affine Weyl groups over F and over F̆ . See also [RZ]. Example 1.3. Let G/F be a quasi-split unitary group of rank 3 which splits over an unramified quadratic extension of F . The affine Dynkin diagram of G then is a circle with 4 vertices 0, 1, 2, 3, on which the Frobenius acts by exchanging 1 and 3, and fixing 0 and 2. In W̃ , there is a length 0 element τ which acts on S̃ (by conjugation) by mapping 1 7→ 2 7→ 3 7→ 0 7→ 1. The twisted Frobenius Int(τ ) ◦ σ exchanges 0 and 1, and 2 and 3. The fix points of the twisted Frobenius inside the base alcove are the points on the line from the midpoint of the edge connecting 0 and 1 to the midpoint of the edge connecting 2 and 3. See the figure. In particular, the origin of the apartment over F̆ does not lie in the rational apartment. (As the origin of the rational apartment we choose the unique vertex of the rational base alcove such that closure of corresponding F̆ -face contains the F̆ -origin.) 6 U. GÖRTZ 1.4. The gate property. In this section we recall a number of building theoretic concepts and results. Our reference is the book [AB] by Abramenko and Brown. For any two alcoves x, y in B̆, we have the relative position or Weyl distance δ(x, y) ∈ Wa , which we can obtain by choosing an apartment containing x and y, identifying the set of alcoves in the apartment with the affine Weyl group, and setting δ(x, y) = x−1 y, where x, y ∈ Wa are the elements corresponding to x and y, resp., under this identification. This element is independent of all choices. Let (t1 , . . . , tr ) with ti ∈ S̃ be the type of a gallery from x to y which is contained in one apartment (which is always the case if the gallery is minimal). Then δ(x, y) = t1 · · · tr . For K ⊂ S̃, we also define the K-Weyl distance δK (x, y) := WK δ(x, y)WK ∈ WK \W̃ /WK . With this notation, δ = δ∅ . If M and N are sets of alcoves, we define δ(M, N ) := {δ(x, y); x ∈ M, y ∈ N }. We also define the distance dist(x, y) := ℓ(δ(x, y)) between alcoves x and y as the length of their Weyl distance. Given an alcove x and a set S of alcoves, we write dist(x, S) := miny∈S dist(x, y). Definition 1.4. ([AB], Def. 5.26) Let P ⊆ S̃. For an alcove x we call the set {y; δ(x, y) ∈ WP } the P -residue of x. A set of alcoves is called a P -residue, if it is of the above form for some alcove x. The set P is called the type of the residue. It is easy to see that every residue has a unique type. In fact, we have δ(R, R) = P , and more generally one easily checks: Lemma 1.5. ([AB], Lemma 5.29) Let R be a P -residue, and R′ a P ′ -residue for subsets P, P ′ ⊆ S̃. Then there exists w ∈ Wa such that δ(R, R′ ) = WP wWP ′ . Example 1.6. For P ⊂ S̃ with associated parahoric subgroup P̆, we can consider the quotient P̆/Ĭ as a set of alcoves, and this set is a P -residue. If R is a residue of type P , and g ∈ G(F̆ )1 , then gR is also a residue of type P (since the action of G(F̆ )1 on the building is type-preserving). All residues of type P have the form g P̆/Ĭ for some g ∈ G(F̆ )1 . A key property of residues is the following proposition, called the gate property. The main ingredient in its proof, see loc. cit., is the following fact: For w ∈ W̃ and P, P ′ ⊆ S̃, there exists a unique element of minimal length in the double coset WP wWP ′ which we denote by min(WP wWP ′ ); see [AB] Prop. 2.23. Proposition 1.7. ([AB], Prop. 5.34) Let R be a residue, and b an alcove. There exists a unique alcove g ∈ R such that dist(b, g) = min{dist(b, x); x ∈ R}. The alcove g is called the gate from b to R and is denoted by projR (b). It has the following properties: (1) δ(b, g) is the unique element of minimal length in δ(b, R). (2) For all alcoves x ∈ R, we have δ(b, x) = δ(b, g)δ(g, x). (3) For all alcoves x ∈ R, we have dist(b, x) = dist(b, g) + dist(g, x). STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 7 We obtain a “projection” projR from the set of all alcoves in B(G, F̆ ) to R by mapping each alcove b to the gate from b to R. With the notation of the proposition, we can interpret part (2) as saying that for every x ∈ R, there exists a minimal gallery from b to x passing through g. Note however that usually there will also exist other minimal galleries from b to x not passing through g. Remark 1.8. The uniqueness of the gate from b to R implies that every automorphism which preserves b and R also fixes the gate from b to R. In particular, if b and R are defined over F (i.e., stable under all Galois automorphisms), then so is the gate. We will also need the following generalization of the gate property: Proposition 1.9. ([AB], Prop. 5.37) Let R be a P -residue, and R′ a P ′ -residue for subsets P, P ′ ⊆ S̃. Let w1 = min(δ(R, R′ )), R1 = projR (R′ ), R′1 = projR′ (R). (1) The set R1 is a residue of type P ∩ w1 P ′ w1−1 , and likewise R′1 is a residue of type w1−1 P w1 ∩ P ′ . (2) The maps projR′ |R1 : R1 → R′1 and projR|R′1 : R′1 → R1 are inverse to each other and hence induce a bijection R1 ∼ = R′1 . ′ ′ (3) Let x ∈ R1 . The alcove x ∈ R1 corresponding to x under the bijection in (2) is the unique alcove in R′1 such that δ(x, x′ ) = w1 . 1.5. Affine Deligne-Lusztig varieties. We fix a triple (G, K, µ), where G is a connected semisimple group of adjoint type over F , as above, K ⊂ S̃ and µ ∈ Λ is a translation element of the corresponding affine root system. Attached to µ, we have the µ-admissible set Adm(µ) := {w ∈ W̃ ; there exists v ∈ W0 : w ∈ εv(µ) }. From K ⊂ S̃ we obtain the parahoric subgroup K̆ ⊂ G(F̆ ), and in case K is stabilized by σ, a rational parahoric subgroup K ⊂ G(F ). We denote the corresponding partial affine flag variety by F lagK (this is the ind-scheme representing the sheaf quotient of the loop group of G by the positive loop group scheme corresponding to K̆). For K = ∅, K̆ is the standard Iwahori subgroup Ĭ which we fixed by fixing a base alcove in the standard apartment. We write F lag for F lag∅ . In the case of mixed characteristic, the notion of ind-scheme here has to be understood in the setting of perfect schemes, see [Zh], [BS]. The affine Deligne-Lusztig variety attached to w ∈ W̃ and b ∈ G(F̆ ) is Xw (b) = {g ∈ G(F̆ )/Ĭ; g −1 bσ(g) ∈ ĬwĬ}. More precisely, the right hand side denotes the set of κ-valued points of a unique reduced locally closed subscheme of the affine flag variety F lag, which we also denote by Xw (b). As before, in the mixed characteristic case, Xw (b) is a perfect scheme. Then Xw (b) is (perfectly) locally of finite type over κ and is finite-dimensional. We also consider the following variants: For K ⊆ S̃ and w ∈ WK \W̃ /WK , we have Xw (b) = {g ∈ G(F̆ )/K̆; g −1 bσ(g) ∈ K̆wK̆}, where again b ∈ G(F̆ ). Often it is better to consider the space [ K̆wK̆}, X(µ, b)K = {g ∈ G(F̆ )/K̆; g −1 bσ(g) ∈ w∈Adm(µ) a finite disjoint union of usual affine Deligne-Lusztig varieties which is more directly related to the corresponding Rapoport-Zink space if the group-theoretic data arises from a suitable (local) Shimura datum, see [Ra]. 8 U. GÖRTZ In the case considered in [CV], K = S̃ \ {0} corresponds to a hyperspecial parahoric group and µ is minuscule, and then X(µ, b)K is an affine Deligne-Lusztig variety in the S usual sense, because the union w∈Adm(µ) K̆wK̆ is equal to the K̆-double coset K̆εµ K̆. In the general case, we will formulate the results in Section 3 for the union X(µ, b)K , as in [GH], but it will be clear from the statements and proofs that we could also consider the individual affine Deligne-Lusztig varieties in the union X(µ, b)K separately. Definition 1.10. Let b ∈ G(F̆ ). We denote by Jb the σ-centralizer of b: Jb (R) = {g ∈ G(R ⊗F F̆ ); g−1 bσ(g) = b} (where R is any F -algebra). This defines an algebraic group Jb over F . We usually fix b and write J = Jb (F ). The element b, or its σ-conjugacy class, is called basic, if the algebraic group J is an inner form of G. See [Ko1], [RR], [GHN] Section 1.2 for a more detailed discussion. 2. The J-stratification 2.1. Definition of the J-stratification. To state the definition of the J-stratification, we introduce the relative position map: Definition 2.1. Let K ⊂ S̃, and let K̆ be the corresponding parahoric subgroup. We denote by invK the relative position map invK : G(F̆ ) × G(F̆ ) −→ K̆\G(F̆ )\K̆ ∼ = WK \W̃ /WK , (g, h) 7−→ K̆g −1 hK̆, where the identification K̆\G(F̆ )\K̆ ∼ = WK \W̃ /WK comes from the “parahoric IwahoriBruhat decomposition” for K̆. For K = ∅, K̆ = Ĭ, this is the usual Iwahori-Bruhat decomposition, for K̆ hyperspecial, it is the Cartan decomposition. See [HR] Prop. 8. The map invK factors through F lag × F lag (and even through F lagK × F lagK ). Remark 2.2. Note that the relative position map is closely related to the Weyl distance δ defined above. In fact, if G(F̆ )1 denotes the kernel of the Kottwitz homomorphism, then the action of G(F̆ ) on the building B̆ gives us a commutative diagram G(F̆ )1 × G(F̆ )  Alc(B̆) × Alc(B̆) inv // W̃ δ  // Wa , where Alc(B̆) denotes the set of alcoves in B̆, the vertical map on the left is (g, h) 7→ (ga, ha), and the vertical map on the right is the projection W̃ = Wa ⋊ {w ∈ W̃ ; ℓ(w) = 0} → Wa . We need to restrict the values in the first factor of the top left corner to G(F̆ )1 , because the action of G(F̆ ) is not type-preserving in general. Projecting to the double quotients by WK , we get a similar diagram for invK and δK , K ⊂ S̃. Definition 2.3. ([CV] Section 2) Fix b ∈ G(F̆ ) and denote by Jb its σ-centralizer, J := Jb (F ). For K ⊂ S̃ and a family w = (wj )j∈J , we let SJ (w) = {x ∈ G(F̆ )/K̆; ∀j ∈ J : invK (j, x) = wj }. The strata of the J-stratification (of G(F̆ )/K̆ = F lagK (κ)) are those sets SJ (w) which are non-empty. By intersecting SJ (w) with X(µ, b)K , we obtain the J-stratification on X(µ, b)K . STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 9 As explained in [CV] Section 2, it follows from Theorem 2.8 below that each stratum is equal to the set of κ-valued points of a (unique) reduced locally closed subscheme of F lagK , and we usually identify the set of κ-valued points and this scheme. 2.2. A finiteness property of the J-stratification. We start with some general preparations which are independent of the group J. Definition 2.4. Let x be an alcove in the apartment A˘. We denote by DR (x) the set of walls of x separating x from the base alcove a. So the elements if DR (x) are the affine root hyperplanes which intersect the closure of x in a face of codimension 1. Their types in S̃ form the right descent set DR (x) of x (considered as an element of the affine Weyl group). Recall that in our terminology the maximal simplices in the affine building are called alcoves, while the notion of chamber is used for the finite Weyl chambers, i.e., the chambers of the spherical building given by our choice of origin. If v is any vertex in the standard apartment A˘, the collection of affine root hyperplanes passing through v is a (finite) root system in the vector space with origin v obtained from A˘. We call this the root system obtained by change of origin to v. Note that if v is not special, then this root system will have a different Dynkin type. Cf. [GHN] 5.7. Lemma 2.5. Let x be an alcove in the standard apartment A˘, and let H be an affine root hyperplane which is a wall of x. Let v be a vertex of x not lying in H. Let C be the chamber opposite to the chamber containing x with respect to the root system given by change of origin to v. Let H be a finite set of affine root hyperplanes in A˘. Then there exists a translation λ ∈ Λ with the following property: For all alcoves y = εµ x (for some µ ∈ Λ) such that H is a wall of y and such that y is not contained in ελ C, DR (y) 6⊆ H . Note that typically H will contain H and H ∈ DR (x) (otherwise the statement is trivially satisfied). If the affine Dynkin diagram of G is connected, then v in the lemma is unique; but otherwise, alcoves will be products of simplices (polysimplices), and v is not unique. Proof. We first prove the lemma in the case that H = {H}, and will discuss the general case afterwards. In this case, we choose λ such that ελ C contains the base alcove a. Let us check that the conclusion of the lemma is then satisfied. Denote by v ′ the vertex of y obtained by translating v by µ, and denote by C ′ the “chamber” with vertex v ′ which contains y. (So up to translation C and C ′ are opposite to each other.) Because v ′ 6∈ ελ C, one of the walls of ελ C separates v ′ from the base alcove, say Hα,k . Replacing α by −α and k by −k, if necessary, we may assume that k > 0. Let k′ be such that Hα,k′ passes through v ′ (and hence is a wall of y). Then Hα,k′ has “larger distance” to the base alcove than Hα,k , i.e., k′ > k, and Hα,k′ separates y from the base alcove (because up to translation the “chambers” ελ C and the one with apex v ′ and containing y are opposite to each other). Thus Hα,k′ ∈ DR (y) \ {H}. We now discuss how to modify the choice of λ in order to deal with the general case. By changing λ, we may replace the number k in the above argument by any given larger number. The walls of the alcoves y not in ελ C which we produce will have the form Hα,k′ with k′ > k. For k sufficiently large, no Hα,k′ can be in H . Choosing λ which works simultaneously for all α, it is then clear that we may ensure that the wall of y we find is not in the set H .  10 U. GÖRTZ Proposition 2.6. Let H be a finite set of affine root hyperplanes in the apartment A˘. Then there are only finitely many alcoves x in this apartment with DR (x) ⊆ H . Proof. Let H ∈ H . Since H is finite and the set DR (x) is empty only if x is the base alcove, it is enough to show that there are only finitely many alcoves x with H ∈ DR (x) ⊆ H . Let M denote the set of all of these alcoves. Call two alcoves in M equivalent, if one is mapped to the other by some translation element. In view of the above lemma, it is enough to show that there are only finitely many equivalence classes for this equivalence relation. (Because, with the notation of the lemma, only finitely many alcoves which have H as a wall lie in all the finitely many chambers ελ C produced by the lemma for x and the different choices for v.) This finiteness assertion follows from the fact that H ∩ Λ is a lattice of full rank in the space H: Hence a fundamental mesh for this lattice is bounded, and meets only finitely many alcoves. In fact, every finite root is part of some system of simple roots for the root system. Say H = Hα,k for α ∈ Φ. Choosing a system of simple roots α = β1 , β2 , . . . , βr , and denoting the corresponding fundamental coweights by ω1∨ , . . . , ωr∨ , we find linearly independent  points kω1∨ + ωi∨ , i = 2, . . . , r, in H ∩ Λ. Corollary 2.7. Given a bounded subset S ⊂ B̆, there exists c > 0 such that for all alcoves j in B̆ with dist(j, a) > c, there exists an adjacent alcove j′ of the alcove j such that every alcove in S can be reached from j by a minimal gallery passing through j′ . Proof. We may replace S by a larger subset, so we may assume that S is the set of all alcoves of distance 6 dS to the base alcove a, for some dS . Let j be an alcove with dist(j, a) > dS , and let A ′ be an apartment containing j and the base alcove a. Every minimal gallery from j to an alcove in S passes through an alcove y in A ′ with dist(j, y) = dS . In fact, consider such a minimal gallery. Looking at the retraction from the building onto A ′ fixing a (cf. [AB] Def. 4.38), we see that as soon as this gallery leaves A ′ , the distance to a increases with each step. Therefore it is enough to find a wall of j such that the half-space of A ′ containing j contains none of the alcoves in S. By the defining axioms of buildings ([AB] Def. 4.1), there is an isomorphism A ′ ∼ = A˘ fixing a pointwise, we may just as well assume that A ′ = A˘. Let c1 > 1 be so large that for all affine root hyperplanes Hα,k with |k| > c1 , all alcoves in S contained in A˘ lie on the same side of Hα,k . Now apply Prop. 2.6 in A˘ for the finite set H of affine root hyperplanes Hα,k with |k| 6 c1 . Choose c > dS such that dist(j, a) 6 c for all j with DR (j) ⊆ H .  Theorem 2.8. Let b ∈ G(F̆ ), let Jb be its σ-centralizer, and let J = Jb (F ). Fix a parahoric level K ⊂ S̃ and a quasi-compact subscheme S ⊂ F lagK in the partial flag variety for K. There exists a finite subset J ′ ⊂ J such that for all g, g ′ ∈ S with invK (j, g) = invK (j, g ′ ) for all j ∈ J ′ , we have invK (j, g) = invK (j, g′ ) for all j ∈ J. Equivalently, we can express the theorem as saying that there exist only finitely many families (wj )j∈J of the form (inv(j, g))j with g ∈ S, i.e., only finitely many J-strata intersect S. STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 11 For G unramified, and K = S̃ \ {0} hyperspecial, this is [CV] Prop. 2.6. We give a new proof of this result which works for general G and which proceeds solely in terms of the building of G. Proof. We begin by some reduction steps which simplify the situation. Since the inverse image of S in the full affine flag variety is again a quasi-compact subscheme, and the invariant inv = inv∅ for the Iwahori subgroup is finer than invK , it is enough to prove the theorem in the case K = ∅. Assume that we can show the existence of a finite set J ′ ⊆ G(F̆ ) with the property of the theorem, but without requiring J ′ ⊂ J. It still follows that there are only finitely many families (inv(j, g))j∈J with g ∈ S. These finitely many families can then be separated by finitely many suitably chosen elements of J, so that we obtain the theorem as stated. In particular, this implies that we may replace J = Jb (F ) by a larger group. For s sufficiently large, the base change of Jb to the unramified extension Fs of F of degree s is a subgroup of GFs (more precisely, the centralizer of a 1-parameter subgroup depending on b). It is therefore enough to prove the statement for G(Fs ) in place of J. Increasing s further, we may assume that σ s acts trivially on S̃ and fixes the standard apartment A˘, i.e., GFs is residually split. To ease the notation, we keep the notation J and assume that it is residually split over F . Furthermore, it is easy to check that inv(j, g) = inv(j, g′ ) for all j ∈ J if this is true for all j ∈ J1 . It follows that we can just as well replace S by the set {sa; s ∈ S(κ)} of alcoves in B(G, F̆ ), and inv(j, g) by the Weyl distance δ(ja, ga). It is then enough to show the existence of a finite set J ′ of alcoves j in B(G, F̆ ) such that the values δ(j, ga) for j ∈ J ′ determine all δ(j, ga) for j in B(J, F ). Claim. There exists a finite set J ′ of alcoves in B(G, F̆ ) such that for every alcove j in B(J, F ) there exists an alcove j′ ∈ J ′ such that for every (*) x in S there exists a minimal gallery from j to x passing through j′ . The claim implies the theorem: for j ∈ B(J, F ) and j′ ∈ J ′ chosen with this property, and x ∈ S, δ(j, x) = δ(j, j′ )δ(j′ , x), so if x, x′ ∈ S have δ(j′ , x) = δ(j′ , x′ ), it follows that δ(j, x) = δ(j, x′ ). Therefore J ′ has the desired property. To prove the claim, let J ′ be the set of alcoves in B(J, F ) of distance 6 c to the base alcove, where c is as in Cor. 2.7. Then J ′ is a finite set, because we can view it as a subset of the set of κ-valued points of some Schubert variety over the finite field κ. To show that J ′ satisfies the above property (*), it is enough to prove that the alcove j′ produced by the corollary is again a J-rational alcove, i.e., lies in B(J, F ). Then we can inductively apply the corollary until we reach an alcove of distance 6 c to a. Looking at the proof of the corollary, we see that in our situation we can work with a rational apartment A ′ containing j and the base alcove. Since J is residually split by our previous reductions, every F̆ -alcove in A ′ lies in B(J, F ), and we are done.  3. The Coxeter case 3.1. The setting. We begin by recalling some of the results of [GH]. We start with a group G over a local non-archimedean field F as above, see Section 1.2, a translation element µ ∈ Λ and a “level structure” K ⊂ S̃. We assume that the affine Dynkin diagram of G is connected. 12 U. GÖRTZ Let K = S̃ \ {v} be a subset fixed by σ, i.e., the parahoric subgroup K̆ is a rational, maximal parahoric subgroup. We are interested in the geometry of the spaces X(µ, b)K , as defined in Section 1.5, the most interesting case being the case where b is basic. For w ∈ Wa , we denote by supp(w) ⊆ S̃ the set of simple affine reflections occurring in a reduced expression for w. Note that this set is the same for each reduced expression; it is called the support of w. Let τ ∈ W̃ be an element of length ℓ(τ ) = 0. Then τ acts on S̃ by conjugation. We define the σ-support suppσ (wτ ) of wτ as the smallest τ σ-stable subset of S̃ which contains supp(w), or equivalently, as the smallest τ σ-stable subset P of S̃ with w ∈ WP . We call an element w ∈ W̃ a σ-Coxeter (or twisted Coxeter) element (with respect to its σ-support), if exactly one simple reflection from each τ σ-orbit on suppσ (w) occurs in every (equivalently, some) reduced expression for w. Note that we do not require that every τ σ-orbit in S̃ occurs in w; for example, the identity element is σ-Coxeter with respect to its σ-support. So there is a slight difference to the terminology of Section 1.1. Attached to these data, we have the set K EOK σ,cox := {w ∈ Adm(µ) ∩ W̃ ; suppσ (w) 6= S̃, and w is σ-Coxeter for suppσ (w)}. Here EO stands for Ekedahl-Oort; the above set is the index set for the set of “EkedahlOort strata” contained in the basic locus. Now assume that the triple (G, µ, K) is “of Coxeter type” as defined in [GH] Section 5, i.e., we require that for b basic, G X(µ, b)K = π(Xw (b)), w∈EOK σ,cox where π : F lag → F lagK is the projection. This is a strong condition with a number of pleasant consequences. Loc. cit. Theorem 5.1.2 contains a complete classification of these triples. Also compare with [GHN]. This implies that for b non-basic, X(µ, b)K , if non-empty, is equal to a union of π(Xw (b)) for elements w ∈ Adm(µ) ∩ K W̃ which are σ-straight (see [GH] Section 1.4), and dim Xw (b) = 0. For b basic, w ∈ Adm(µ) ∩ K W̃ , we have Xw (b) 6= ∅ if and only if w ∈ EOK σ,cox ; the resulting decomposition is discussed in more detail in the next section. As proved in [GH], we have a very explicit description of the elements in EOK σ,cox in terms of the affine Dynkin diagram of G. For our purposes, we note the following consequences: If ′ ′ for w, w′ ∈ EOK σ,cox we have suppσ (w) = suppσ (w ), then w = w . We identify the set of vertices of the affine Dynkin diagram with S̃, and for w ∈ EOK σ,cox denote by Σw ⊂ S̃ the set of vertices of the affine Dynkin diagram which are adjacent to suppσ (w) (but do not lie in suppσ (w)). If suppσ (w) = ∅, i.e., ℓ(w) = 0, we define Σw to be the τ σ-orbit of v. It is shown in loc. cit., that Σw determines w, and is either a single τ σ-orbit, or the union of two τ σ-orbits. Instead of repeating further details from [GH], we spell out the above objects in two examples: Example 3.1. We start with the case of a unitary group which splits over an unramified quadratic extension, with µ = ω1∨ (“signature (n − 1, 1)”), cf. [GH] 6.3. This is the case considered by Vollaard and Wedhorn [VW]. The affine Dynkin diagram of type Ãn−1 is a circle with vertices 0, 1, . . . , n − 1, on which σ acts by fixing 0, and exchanging i and n − i for i = 1, . . . , n − 1. (So if n is even, σ has another fix point at n/2.) As level structure, we choose K = S̃ \ {0}; the corresponding parahoric subgroup is hyperspecial. STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 13 8 0 7 1 6 2 5 3 4 Figure 2. Example 3.1 for n = 9, w = s0 s8 τ , Σw = {3, 7}. Conjugation by τ acts by i 7→ i + 1 and n − 1 7→ 0, so the composition τ σ exchanges 0 and 1, 2 and n − 1, etc. Cf. Example 1.3 above (where n = 4). The elements in EOK σ,cox are the elements τ , s0 τ , . . . , s0 sn−1 · · · s⌈ n+3 ⌉ τ , and the 2 corresponding sets Σw are the τ σ-orbits in S̃, i.e., {0, 1}, . . . , {⌈ n2 ⌉, ⌈ n+1 2 ⌉}. In the figure, the situation for n = 9, w = s0 s8 τ , and Σw = {3, 7} (the two vertices marked with gray circles), suppσ (w) = {8, 0, 1, 2} (the vertices marked with black circles) is shown. Example 3.2. Second, we give an example where one of the sets Σw is the union of two τ σ-orbits. This case arises from a unitary group which splits over a ramified quadratic extension, see [GH] 6.3, 7.1.2, 7.4.2 and [RTW] for an analysis of the Rapoport-Zink space pertaining to this case. In this case, the affine Dynkin diagram is of type B̃m with vertices 0, 1, . . . , m, and σ acts by exchanging 0 and 1, and fixing all other vertices. Conjugation by τ also exchanges 0 and 1 and fixes the other vertices, so that τ σ = id. The level K in this example is given by S̃ \ {m}. It corresponds to a non-special rational maximal parahoric subgroup. Let µ = ω1∨ . The set EOK σ,cox consists of τ , sm τ , . . . , sm sm−1 · · · s2 τ , sm sm−1 · · · s2 s1 τ , sm sm−1 · · · s2 s0 τ . The corresponding σ-supports are just the usual supports (∅, {m}, . . . , {2, . . . , m}, {1, 2, . . . , m}, {0, 2, . . . , m}). The sets Σw are the sets {i} for i = 0, . . . , m, and the set {0, 1} (the latter case for m = 6 is shown in the figure; w = s6 s5 s4 s3 s2 τ , Σw = {0, 1} (the two vertices marked with gray circles), suppσ (w) = {2, 3, 4, 5, 6} (the vertices marked with black circles). 0 2 3 4 5 6 1 Figure 3. Example 3.2 for m = 6, w = s6 s5 s4 s3 s2 τ , Σw = {0, 1}. Now we return to the general case. The choice of representative of the σ-conjugacy class. The most interesting among the spaces X(µ, b)K is the one where the σ-conjugacy class of b is basic. In this case, we choose as a representative (an arbitrary lift of) the unique length 0 element τ ∈ W̃ such that εµ ∈ Wa τ . Equivalently, τ is the unique length 0 element such that X(µ, τ )K is non-empty. This is the choice made in [GH], as well, and the 14 U. GÖRTZ choice suggested as a reasonable one in [CV] Remark 2.1. (As explained there, the J-stratification varies significantly if a different representative, and correspondingly, a different group J, is used. But note that also the treatment in [GH], e.g. Prop. 2.2.1 there, relies on the use of the particular representative τ .) Lemma 3.3. For w ∈ W̃ , any two lifts of w to N (F̆ ) ⊂ G(F̆ ) are T (F̆ )1 -σ-conjugate and hence the J-stratification is independent of the choice of lift. Proof. We use Lang’s theorem for the parahoric subgroup T (F̆ )1 of T (F̆ ) (equipped with a “twisted” Frobenius Int(w) ◦ σ, where w is a fixed lift), see [Gr], Prop. 3. We obtain that the map T (F̆ )1 → T (F̆ )1 , g 7→ g−1 wσ(g)w−1 is surjective. But an element t is in the image if and only if tw is σ-conjugate under T (F̆ )1 to w. As pointed out in [CV] Remark 2.1, elements b1 , b2 ∈ G(F̆ ) which are σ-conjugate under K̆ give rise to the same J-stratification, in the following sense: for b2 = k−1 b1 σ(k), the isomorphism X(µ, b2 )K → X(µ, b1 )K , g 7→ kg identifies Jb2 -strata with Jb1 -strata. This is clear using the isomorphism Jb2 → Jb1 , j 7→ kjk−1 .  3.2. The Bruhat-Tits stratification. As above, let π : F lag → F lagK be the projection. By definition of the notion of Coxeter type in [GH] (right before Theorem 5.1.2) we obtain a decomposition of X(µ, τ )K as a disjoint union G X(µ, τ )K = π(Xw (τ )) w∈EOK σ,cox Further, each π(Xw (τ )) can be decomposed as G π(Xw (τ )) = iY (w), i∈J/(J∩P̆S̃\Σw ) with Y (w) = π({g ∈ P̆suppσ (w) /Ĭ; g−1 τ σ(g) ∈ ĬwĬ}). The resulting stratification of X(µ, τ )K , G X(µ, τ )K = w∈EOK σ,cox G iY (w) i∈J/(J∩P̆S̃\Σw ) is called the Bruhat-Tits stratification of X(µ, τ )K . Here P̆S̃\Σw denotes the parahoric subgroup of G(F̆ ) attached to S̃ \ Σw ⊂ S̃. Since we identify J(F̆ ) = G(F̆ ), we can intersect it with J = J(F ). The term Bruhat-Tits stratification is used because the index set can be described in terms of the Bruhat-Tits building for J. In the most common case where Σw is a single τ σ-orbit, J ∩ P̆S̃\Σw is the stabilizer of the corresponding vertex of the base alcove in the rational building of J and hence J/(J ∩ P̆S̃\Σw ) can be identified with the set of all vertices of “type Σw ”. The Bruhat-Tits stratification is a stratification in the strict sense that the closure of each stratum is a union of strata. In fact, the closure relations between strata can be described explicitly in terms of the building, see [GH] Section 7. Note that Y (w) is (isomorphic to) a classical Deligne-Lusztig variety. Indeed, the projection π induces an isomorphism {g ∈ P̆supp (w) /Ĭ; g −1 τ σ(g) ∈ ĬwĬ} ∼ = Y (w) σ since w is a σ-Coxeter element (with respect to suppσ (w)). The quotient P̆suppσ (w) /Ĭ can be identified with the finite-dimensional flag variety for the maximal reductive quotient Gw of the reduction of the parahoric subgroup P̆suppσ (w) (with respect to its Borel STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 15 subgroup induced by Ĭ). Equipping Gw with the Frobenius x 7→ τ σ(x)τ −1 , we find that Y (w) is defined by the usual Deligne-Lusztig condition for the Weyl group element wτ −1 ∈ Wsuppσ (w) . The Dynkin diagram of Gw is given by the part of the affine Dynkin diagram with vertices suppσ (w), and the Frobenius action on this Dynkin diagram is given by τ σ. The finite Weyl group of Gw can be identified with Wsuppσ (w) and the element wτ −1 is a twisted Coxeter element in this group. For instance, in the situation of Example 3.1, we obtain classical Deligne-Lusztig varieties in a special unitary group. Theorem 3.4. Let (G, µ, K) be of Coxeter type, and let τ ∈ W̃ be the length 0 element representing the unique basic σ-conjugacy class such that X(µ, τ )K 6= ∅. Then the Bruhat-Tits stratification on X(µ, τ )K coincides with the J-stratification. The theorem will be proved in the following sections. In particular we see that in these special cases, the J-stratification is a stratification in the strict sense and has many nice properties. In the case of G = GSp4 with hyperspecial level structure, and in the case of Example 3.1, the Theorem was proved in [CV], 4.2.1 and 4.2.2, resp., by direct considerations in terms of Dieudonné modules. Note that in the case where K is not assumed to be hyperspecial, X(µ, b)K will in general be a disjoint union of several affine Deligne-Lusztig varieties. Of course, as a corollary we see that the statement of the theorem also holds for these usual affine Deligne-Lusztig varieties contained in X(µ, b)K . Remark 3.5. If b is not basic, then under the above assumptions, X(µ, b)K , if nonempty, is 0-dimensional (see [GH] Thm. 5.2.1, cf. also [GHN], Theorem 2.3). The strata of the Bruhat-Tits stratification are the S individual points of this scheme. More precisely, X(µ, b)K is a union of the form i π(Xwi (b)) for certain σ-straight elements wi ∈ Adm(µ), where π : F lag → F lagK denotes the projection. The group J = Jb (F ) acts transitively on each Xwi (b), and hence on its image π(Xwi (b)). In particular, if the index set for the above union has only one element w, then J acts transitively. In this case it is immediate that the strata of the J-stratification are the individual single points of X(µ, b)K , if we choose the element w as the representative of the σ-conjugacy class [b]. However, in certain cases, the index set for the above union has more than one element. In this case, the J-action on X(µ, b)K is not transitive (contrarily to what is claimed in [GH] Thm. B (2)). See [GH] 6.4 and 6.6 for the two cases where this occurs. As one checks from the data given in loc. cit., the index set then consists of exactly two elements w1 , w2 with w2 = τ w1 τ −1 , and conjugation by τ stabilizes the subset K ⊂ S̃, and hence conjugation by τ stabilizes the parahoric subgroup K̆. We choose one of the σ-straight elements w1 , w2 as the representative of the σ-conjugacy class of b. Since conjugation by τ stabilizes K̆, it is again easy to check that the J-stratification obtained in this situation has as its strata the individual points of X(µ, b)K . 3.3. The BT-stratification is finer than the J-stratification. We start by proving the easier direction of Theorem 3.4. Recall that J is an inner form of G since τ is basic. We fix an identification G(F̆ ) = J(F̆ ). We have the action of σ on G(F̆ ) with fixed points G(F ), and the twisted action by Int(τ ) ◦ σ, x 7→ τ σ(x)τ −1 , with fixed points J. Given w ∈ EOK σ,cox , we have P := suppσ (w) and the corresponding parahoric subgroup P̆. We need to show that for all j ∈ J, the value invK (j, −) is constant on each BT stratum j ′ Y (w). We may pass to Iwahori level and will show the stronger statement that inv(j, −) is constant on j ′ Y (w) ⊂ j ′ P̆/Ĭ. 16 U. GÖRTZ Since inv(j, j ′ h) = inv((j ′ )−1 j, h), we may assume that j ′ = 1. Similarly, given j ∈ J, there exists ̃ ∈ J1 such that ja = ̃a; then conjugation by j −1 ̃ preserves Ĭ and so Ĭj −1 hĬ = j −1 ̃Ĭ̃−1 hĬ. This allows us to restrict ourselves to the case that j ∈ J1 . Altogether we see that it is enough to show that for every alcove j in B(J, F ), δ(j, h) is independent of h ∈ Y (w), where we now consider the latter set as a set of alcoves in B(J, F̆ ) = B(G, F̆ ). Now let g be the gate from j to the residue P̆/Ĭ in the sense of Section 1.4. It is an alcove inside the rational building B(J, F ) (Remark 1.8), and hence Lusztig’s result about Deligne-Lusztig varieties attached to twisted Coxeter elements, Proposition 1.1, give us that δ(g, h) = w0,P , the longest element of WP , for all h ∈ Y (w). We then have that δ(j, h) = δ(j, g)δ(g, h) = δ(j, g)w0,P is independent of h ∈ Y (w). 3.4. Acute cones and extension of galleries. We recall some definitions and results from [HN] Section 5. The notion of acute cone and the discussion until and including Definition 3.9 applies to a fixed apartment A (and the corresponding finite Weyl group W0 , set of positive roots Φ+ , and the affine root hyperplanes Hα,k , . . . ) in some affine building. We will eventually apply it to the rational building of the group J. Let w ∈ W0 . An affine root hyperplane H = Hα,k (= H−α,−k ) defines two halfspaces in A. To distinguish between them, let us assume that α ∈ w(Φ+ ). Then we let H w+ = {v ∈ A; hα, vi > k} and call this the w-positive half-space. We call the other half-space the w-negative half-space and denote it by H w− . Definition 3.6. ([HN] Def. 5.2) Let w ∈ W0 . We say that a non-stuttering gallery Γ = (b0 , . . . , bℓ ) in A goes in the w-direction, if for all i = 1, . . . , ℓ, denoting by Hi the wall separating bi−1 and bi , the alcove bi lies in Hiw+ . Proposition 3.7. ([HN] Lemma 5.3, Cor. 5.6) (1) Let Γ be a gallery going in the w-direction (w ∈ W0 ). Then Γ is a minimal gallery, and every minimal gallery between the two end alcoves of Γ goes in the w-direction. (2) Let Γ be a minimal gallery in A. Then there exists w ∈ W0 such that Γ goes in the w-direction. Corollary 3.8. Let w ∈ W0 , and let Γ1 , Γ2 be galleries which both go in the w-direction, and such that the final alcove of Γ1 is the first alcove of Γ2 . Then the concatenation of Γ1 and Γ2 is minimal. Proof. By the proposition, it is enough so show that the concatenation of Γ1 and Γ2 again goes in the w-direction, and this is clear by definition.  Definition 3.9. ([HN] Def. 5.4) Let b be an alcove in A, and let w ∈ W0 . The acute cone C(b, w) is the set of all alcoves b′ in A such that there exists a gallery from b to b′ going in the w-direction. Now we will apply these general notions to the situation at hand. Below, when we say that a translation element ελ in A˘ lies far from all F̆ -walls, we mean that it lies far from all finite root hyperplanes, in other words: |hα, λi| ≫ 0 for all α ∈ Φ. Similarly, we have the notion of an alcove lying far from all F̆ -walls. (Another way to say this would be to say that the alcove lies in a “very shrunken” Weyl chamber.) Lemma 3.10. Suppose that the affine Dynkin diagram of G is connected, and that J has F -rank > 0. There exists a J-rational translation of the base alcove which is far from all F̆ -walls. STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 17 Proof. According to our setup, the J-rational apartment contains the barycenter v of the F̆ -base alcove. Since rkF J > 0, the origin v ′ of the J-rational standard apartment is the barycenter of some proper facet of the F̆ -base alcove. It follows from a simple computation (relying on the assumption that the affine Dynkin diagram is connected, i.e., that alcoves and their faces are simplices, not just “polysimplices”) that for all roots α, hα, vi = 6 hα, v ′ i. Therefore for N sufficiently divisible, v ′ + N (v − v ′ ) is a rational translation element which is far from all F̆ -walls.  Lemma 3.11. Suppose that the affine Dynkin diagram of G is connected, and that rkF J > 0. Let Γ = (b0 , b1 , . . . , bℓ ) be a minimal gallery in B̆ such that bℓ and δ(b0 , bℓ ) are fixed by σJ . Then there exists a minimal gallery Γ′ in A˘ which starts in bℓ , ends in an alcove which is fixed by σJ and which is far away from all F̆ -walls, and such that the concatenation of Γ and Γ′ is a minimal gallery. Proof. Applying a suitable element of J to the whole situation, we may assume that bℓ = a. We have the canonical retraction ρ from the building to the standard apartment with respect to a (cf. [AB] Def. 4.38). If A ′ is any apartment containing a, it induces an isomorphism between A ′ and the standard apartment. Since Γ is minimal, there exists an apartment A ′ containing Γ, and ρ thus maps Γ to a minimal gallery in the standard apartment. Therefore it is enough to extend the image of Γ under ρ inside the standard apartment. In other words, we may assume that Γ is contained in the standard apartment and ends in a. Since δ(b0 , bℓ ) and bℓ = a are fixed by σJ , b0 is also fixed by σJ (not necessarily point-wise). Here we use that we have reduced, in the first step, to the case that Γ is contained in a J-rational apartment. We apply Prop. 3.7 to the building B(J, F ) (i.e., we consider δ(b0 , bℓ ) as an element of the Coxeter group WaJ , and accordingly get a minimal gallery in the standard apartment of B(J, F )): There exists w in the corresponding finite Weyl group such that Γ goes in the w-direction. All the alcoves in the acute cone C(a, w) (understood inside the standard apartment of B(J, F )) can, by definition, be reached from a by a gallery in the w-direction, and concatenating such a gallery with Γ gives us another minimal gallery, by Cor. 3.8 (equivalently, a reduced word in WaJ with initial piece δ(b0 , bℓ )). So it is enough to show that C(a, w) contains alcoves arbitrarily far from all F̆ -walls. Since C(a, w) contains a translate of the finite Weyl chamber corresponding to w (cf. [HN] Prop. 5.5), and the finite Weyl group of the J-rational standard apartment acts transitively on the set of J-rational finite Weyl chambers, the desired statement follows from Lemma 3.10.  Example 3.12. Clearly, the hypothesis that the affine Dynkin diagram of G is connected e1 × A e1 with Z/2Z acting on the first factor is required in the above lemmas: Consider A by the non-trivial diagram automorphism, and on the second factor as the identity. Then the rational apartment is parallel to one of the walls. Lemma 3.13. Let u, u′ ∈ W̃ such that uWK 6= u′ WK , and let w ∈ W̃ such that wa is sufficiently far away from the walls (depending on u, u′ ). Then WK wuWK 6= WK wu′ WK . Proof. For K = S̃ \ {v}, we define the set of K-walls as the set of root hyperplanes of the (finite) root system obtained by changing the origin to v, i.e., the set of affine root hyperplanes passing through the vertex of the base alcove a corresponding to K (this construction also appeared in Section 2.2). E.g., if v = s0 , then the K-walls are precisely the finite root hyperplanes. The K-walls are the root hyperplanes of a root system with Weyl group WK . The chambers of this root system will be called the K-chambers. 18 U. GÖRTZ Since the origin we fixed in A˘ is by assumption a special point, every K-wall is parallel to some finite root hyperplane. It follows that an alcove which is far from all finite root hyperplanes is also far from all K-walls. If w is far away from the K-walls, the finite sets wuWK and wu′ WK are contained in the same K-chamber. Therefore to show the claim it is enough to ensure that wuWK 6= wu′ WK which follows directly from the assumption uWK 6= u′ WK .  3.5. Subexpressions. Given a Coxeter system (W, S) and w ∈ W , we say that a reduced expression w = f1 , . . . fℓ(w) (with the fi being simple affine reflections) has a tuple (t1 , . . . , tr ) ∈ Sr as a subexpression, if the tuple (t1 , . . . , tr ) can be obtained from (f1 , . . . , fℓ(w) ) by omitting some of the entries (but without changing their order). Lemma 3.14. Let (W, S) be a Coxeter system. Let t0 , . . . , tr ∈ S be pairwise different elements such that ti ti−1 6= ti−1 ti for all i = 1, . . . , r. Let w ∈ W such that t0 · · · tr 6 w. (1) Every reduced expression for w has (t0 , . . . , tr ) as a subexpression. (2) Let s ∈ S, s 6= t0 . Then t0 · · · tr 6 sw. In particular tr is contained in the support of sw. Proof. We start by proving the following special case of part (1): The element t0 · · · tr ∈ W has a unique reduced expression (namely the specified one). This follows immediately from the result of Tits that any two reduced expressions for an element of a Coxeter group can be obtained from each other by a sequence of “elementary homotopies” (see [AB] Prop. 3.24), i.e., by applying the braid relations for a pair s, s′ ∈ S of simple reflections (including the case where s, s′ commute). To prove (1) in the general case, assume t0 · · · tr 6 w for some w. The subword property of the Bruhat order (see e.g., [BB] Thm. 2.2.2) states that starting from any reduced expression for w we can obtain some reduce expression for t0 · · · tr by omitting certain factors. By the special case proved already, this implies part (1). Now part (2) follows easily: If ℓ(sw) = ℓ(w) + 1, then there is nothing to prove. But if ℓ(sw) = ℓ(w) − 1, then w has a reduced expression starting with s, and sw can then be obtained by omitting the first s in that reduced expression. Since s 6= t0 , the assertion follows from (1).  3.6. The J-stratification is finer than the BT-stratification. We will now show that given EO types w, w′ and j ′ ∈ J with Y (w) 6= j ′ Y (w′ ), there exists j ∈ J such that invK (j, −) has different values on Y (w) and j ′ Y (w′ ). (We know already that these values are constant on Y (w) and j ′ Y (w′ ), resp.) This clearly implies that any two strata can be separated by the relative position with respect to some element of J. We may and will also assume without loss of generality that P = P ′ or P ′ 6⊆ P . It is easy to see that for j ′ ∈ J \ J1 and arbitrary j, the values of invK (j, −) on Y (w) and j ′ Y (w′ ) lie in different Wa -cosets within W̃ (i.e., the length 0 component is different). Therefore we will assume from now on that j ′ ∈ J1 , and we will find j ∈ J1 separating the two strata. This means that we may rephrase the problem by saying that we search an alcove j in the J-rational building such that the K-Weyl distance δK (j, −) separates the strata Y (w) and j ′ Y (w′ ). Remark 3.15. (1) It is easy to separate different strata in the full affine flag variety, using the Iwahori-Weyl distance. To ensure that the relative positions remain different after passing to K̆-double cosets, we will use Lemma 3.13 to reduce to a problem of comparison of left cosets rather than double cosets. This can eventually be handled using Lemma 3.14. (2) The elements j ∈ J produced by the proof below which separate different BruhatTits strata will typically lie far away from the origin (when considered as alcoves). STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 19 It seems difficult to give an explicit bound on this distance. It is easy to check in examples that the identity element j = 1 does not necessarily separate all BruhatTits strata of the form Y (w), Y (w′ ), w 6= w′ . Denote by P and P ′ , resp., the σ-supports of w and w′ , and by P̆, P̆ ′ the corresponding parahoric subgroups, so Y (w) ⊆ P̆/Ĭ, j ′ Y (w′ ) ⊆ j ′ P̆ ′ /Ĭ. We consider P̆/Ĭ and j ′ P̆ ′ /Ĭ as sets of alcoves in B(G, F̆ ). Both sets are residues in the sense of Section 1.4 and we apply Prop. 1.9 with R = P̆/Ĭ, R′ = j ′ P̆ ′ /Ĭ. Denote by w1 the “minimal distance” between R and R′ , i.e., w1 = min(δ(R, R′ )) ∈ WaJ , and let R1 = projR (R′ ), R′1 = projR′ (R). The proposition gives us a bijection between R1 and R′1 such that the relative position between any two alcoves corresponding to each other is w1 . Let h ∈ Y (w), h′ ∈ j ′ Y (w′ ). Fix any J-rational alcove b in R1 , and let b′ ∈ R′1 be the element corresponding to b under the above bijection. By Rmk. 1.8, b′ lies in the rational building. We obtain (using Prop. 1.1), denoting by w0,P ′ the longest element in WP ′ , δ(b, h′ ) = δ(b, b′ )δ(b′ , h′ ) = w1 w0,P ′ and ℓ(w1 w0,P ′ ) = ℓ(w1 ) + ℓ(w0,P ′ ), i.e., choosing reduced expressions for w1 and w0,P ′ we obtain a minimal gallery starting at the alcove h′ with end point the alcove b. We extend this minimal gallery to a minimal gallery from h′ to an alcove j ∈ B(J, F ) which is far from the K-walls. Here the element is sufficiently far away from the walls as soon as we can apply Lemma 3.13 for any u ∈ WP and u′ ∈ WP w1 w0,P ′ . This imposes only finitely many conditions and can therefore be achieved by Lemma 3.11 (the affine Dynkin diagram is connected, and the F -rank of J is > 0 in all Coxeter type situations). If we replace the part from b to j in our gallery by any other minimal gallery from b to j, the resulting gallery will still be minimal. Therefore we may assume that the gate g from j to R is one of the alcoves of the gallery. This is a J-rational alcove, and writing w3 = δ(j, g) we have δ(j, h) = δ(j, g)δ(g, h) = w3 w0,P . Let w2 := δ(g, b) be the relative position between g and b. Note that w2 ∈ WP because R is convex and thus contains every minimal gallery between any two of its elements. Summarizing, we have δ(j, h) = δ(j, g)δ(g, h) = w3 w0,P , δ(j, h′ ) = δ(j, g)δ(g, b)δ(b, b′ )δ(b′ , h′ ) = w3 w2 w1 w0,P ′ . The inequality δK (j, h) = 6 δK (j, h′ ) which we would like to show thus amounts to the inequality WK w3 w0,P WK 6= WK w3 w2 w1 w0,P ′ WK . By Lemma 3.13 we see that it is enough to show that w0,P WK 6= w2 w1 w0,P ′ WK , or in other words that w0,P w2 w1 w0,P ′ 6∈ WK . Another equivalent reformulation of this condition is that sv ∈ supp(w0,P w2 w1 w0,P ′ ) (where {v} = S̃ \ K as above). To prove this, we distinguish cases. 3.6.1. The case j ′ Y (w′ ) = Y (w′ ). In this case, we may assume that j ′ = 1, and have that w1 = 1. Since Y (w) 6= Y (w′ ), we have w 6= w′ , P 6= P ′ , and by the reduction step in the very beginning, we then have P ′ 6⊆ P . There exist simple reflections sv = tr , tr−1 , . . . , t0 ∈ WP ′ such that the ti are pairwise different, ti ∈ WP if and only if i > 0, and such that ti ti−1 6= ti−1 ti for all i. In fact, to find such elements, choose an arbitrary element of P ′ \ P , and connect it in the affine 20 U. GÖRTZ Dynkin diagram to v. Now define the ti starting with tr = sv and following the chosen path until it leaves P for the first time. Then t0 t1 · · · tr 6 w0,P ′ . Applying Lemma 3.14 multiple times and using that t0 6∈ WP , we see that for every element u ∈ WP , the product uw0,P ′ also has (t0 , t1 , . . . , tr ) as a subexpression, and in particular its support contains tr = sv . We apply this to u = w0,P w2 and obtain that w0,P w2 w1 w0,P ′ = uw0,P ′ 6∈ WK . 3.6.2. The case j ′ Y (w′ ) 6= Y (w′ ). We use the notation introduced in Section 3.2. Specifically, let Σ = Σw and Σ′ = Σw′ denote the τ σ-stable subsets of S̃ consisting of the vertices in the affine Dynkin diagram adjacent to P but 6∈ P (resp., P ′ ). The assumption that j ′ Y (w′ ) 6= Y (w′ ) in F lagK means that j ′ 6∈ P̆S̃\Σ′ . In other words, supp(w1 ) ∩ Σ′ 6= ∅. Claim. There exist simple reflections sv = tr , . . . , t1 ∈ WP ′ and t0 6 w1 , t0 6∈ WP such that the elements tr , . . . t0 satisfy the assumptions of Lemma 3.14. Let us first show that with elements as in the claim, we can finish the proof. Since ℓ(w1 w0,P ′ ) = ℓ(w1 ) + ℓ(w0,P ′ ), t0 6 w1 and t1 · · · tr 6 w0,P ′ imply that t0 t1 · · · tr 6 w1 w0,P ′ . We also have that t0 6∈ supp(w0,P w2 ) since the latter set is a subset of P . By Lemma 3.14 it follows that sv = tr ∈ supp(w0,P w2 w1 w0,P ′ ), as desired. It remains to prove the claim. We have already seen that Σ′ ∩ supp(w1 ) 6= ∅, and if Σ′ ∩ P = ∅, we can choose any element in Σ′ ∩ supp(w1 ) as t0 , and then define t1 , . . . , tr ∈ WP ′ by “connecting” the vertex corresponding to t0 with v in the affine Dynkin diagram. It remains to discuss the case Σ′ ∩ P 6= ∅. Since we have also (in the very beginning of the proof) reduced to the case P ′ 6⊆ P , this can only happen in the case where the sets suppσ (u), u ∈ EOK σ,cox , are not linearly ordered by inclusion. More precisely, we must be in the case of Example 3.2 (the affine Dynkin diagram is of type B̃, and σ and τ both act by exchanging 0 and 1 and fixing all other vertices), and we have either Σ = {0}, Σ′ = {1}, or Σ = {1}, Σ′ = {0}. We then want to choose as t0 the simple reflection associated with the element of Σ. Looking at the affine Dynkin diagram in this case, we see immediately that we then find t1 , . . . , tr as required in the claim. To justify this choice, we need to show that t0 6 w1 . We know that w1 is the minimal length element in WP w1 WP ′ , and that it is 6= 1. Therefore, we cannot have supp(w1 ) ⊆ P . Since S̃ \ P = Σ = {t0 } consists of only one element in the case at hand, it follows that indeed t0 ∈ supp(w1 ). References [AB] [BB] [BS] [BT1] [BT2] [Ch] [CV] [DL] P. Abramenko, K. Brown, Buildings: Theory and Applications, Springer Graduate Texts in Math. 248 (2008). A. Björner, F. Brenti, Combinatorics of Coxeter Groups, Springer Graduate Texts in Math. 231 (2005). B. Bhatt, P. Scholze, Projectivity of the Witt vector Grassmannian, Invent. Math. 209 (2017), no. 2, 329–423. F. Bruhat, J. Tits, Groupes réductifs sur un corps local. I. Données radicielles valuées, Publ. Math. IHES 41 (1972), 5–251. F. Bruhat, J. Tits, Groupes réductifs sur un corps local. II. Schémas en groupes. Existence d’une donnée radicielle valuée, Publ. Math. IHES 60 (1984), 197–376. C. Chan, Deligne-Lusztig constructions for division algebras and the local Langlands correspondence, Adv. Math. 294 (2016), 332–383. M. Chen, E. Viehmann, Affine Deligne-Lusztig varieties and the action of J, to appear in J. Alg. Geom., arXiv:1507.02806 (2015). P. Deligne, G. Lusztig, Representations of reductive groups over finite fields, Ann. Math. (2), 103 no. 1 (1976), 103–161. STRATIFICATIONS OF AFFINE DELIGNE-LUSZTIG VARIETIES 21 [GH] U. Görtz, X. He, Basic loci in Shimura varieties of Coxeter type, Cambridge J. Math. 3 (2015), no. 3, 323–353. [GHN] U. Görtz, X. He, S. Nie, Fully Hodge-Newton decomposable Shimura varieties, arXiv:1610.05381 (2016). [Gr] M. Greenberg, Schemata over local rings II, Ann. Math. (2), 780, No. 2. (1963), 256–266. [HN] T. Haines, B.-C. Ngô, Alcoves associated to special fibers of local models, Amer. J. Math. 124 (2002), 1125–1152. [HR] T. Haines, M. Rapoport, On parahoric subgroups, Appendix to: G. Pappas, M. Rapoport, Twisted loop groups and their affine flag varieties, Adv. math. 219 (2008), 118–198. [He] X. He, Hecke algebras and p-adic groups, to appear in Current Developments in Mathematics, arXiv:1511.01386 (2015). [Iv1] A. Ivanov, Affine Deligne-Lusztig varieties of higher level and the local Langlands correspondence for GL2 , Adv. in Math. 299 (2016), 640–686. [Iv2] A. Ivanov, Ramified automorphic induction and zero-dimensional affine Deligne-Lusztig varieties, Math. Z. https://doi.org/10.1007/s00209-017-1896-x, (2017), 52. pp. [Ka] C. Kaiser, Ein getwistetes fundamentales Lemma für die GSp4 , PhD Thesis Bonn 1997. [Ko1] R. Kottwitz, Isocrystals with additional structure, Compos. Math. 56 (1985), 201–220. [Ko2] R. Kottwitz, Isocrystals with additional structure. II, Compositio Math. 109 (1997), 255–339. [La] E. Landvogt, Some functorial properties of the Bruhat-Tits building, J. Reine Angew. Math. 518 (2000), 213–241. [Lu] G. Lusztig, Coxeter Orbits and Eigenspaces of Frobenius, Invent. math. 38 (1976), 101–159. [Ra] M. Rapoport, A guide to the reduction modulo p of Shimura varieties, Astérisque 298 (2005), 271–318. [RR] M. Rapoport, M. Richartz, On the classification and specialization of F -isocrystals with additional structures, Compos. Math. 103 no. 2 (1996), 153–181. [RTW] M. Rapoport, U. Terstiege, S. Wilson, The supersingular locus of the Shimura variety for GU (1, n − 1) over a ramified prime, Math. Z. 276 (2014), 1165–1188. [RZ] M. Rapoport, Th. Zink, A finiteness theorem in the Bruhat-Tits building: an application of Landvogt’s embedding theorem, Indag. Math., N.S., 10 (3) (1999), 449–458. [Ri] T. Richarz, On the Iwahori-Weyl group, Bull. Soc. Math. France 144 (2016), no. 1, 117–124. [VW] I. Vollaard, T. Wedhorn, The supersingular locus of the Shimura variety of GU(1,n-1) II, Invent. Math. 184 (2011), 591–627. [Wu] H. Wu, The supersingular locus of unitary Shimura varieties with exotic good reduction, PhD thesis, University of Duisburg-Essen, arXiv:1609.08775 (2016). [Zh] X. Zhu, Affine Grassmannians and the geometric Satake in mixed characteristic, Ann. Math. 185 (2017), Issue 2, 403–492. Ulrich Görtz, Institut für Experimentelle Mathematik, Universität Duisburg-Essen, 45117 Essen, Germany E-mail address: [email protected]
4math.GR
Deep Multi-instance Networks with Sparse Label Assignment for Whole Mammogram Classification Wentao Zhu, Qi Lou, Yeeleng Scott Vang, and Xiaohui Xie arXiv:1705.08550v1 [cs.CV] 23 May 2017 Dept. of Computer Science, University of California, Irvine {wentaoz1, xhx}@ics.uci.edu, {qlou, ysvang}@uci.edu Abstract. Mammogram classification is directly related to computer-aided diagnosis of breast cancer. Traditional methods rely on regions of interest (ROIs) which require great efforts to annotate. Inspired by the success of using deep convolutional features for natural image analysis and multi-instance learning (MIL) for labeling a set of instances/patches, we propose end-to-end trained deep multiinstance networks for mass classification based on whole mammogram without the aforementioned ROIs. We explore three different schemes to construct deep multi-instance networks for whole mammogram classification. Experimental results on the INbreast dataset demonstrate the robustness of proposed networks compared to previous work using segmentation and detection annotations. 1 Keywords: Deep multi-instance learning, whole mammogram classification, max pooling-based MIL, label assignment-based MIL, sparse MIL 1 Introduction According to the American Cancer Society, breast cancer is the most frequently diagnosed solid cancer and the second leading cause of cancer death among U.S. women [1]. Mammogram screening has been demonstrated to be an effective way for early detection and diagnosis, which can significantly decrease breast cancer mortality [15]. Traditional mammogram classification requires extra annotations such as bounding box for detection or mask ground truth for segmentation [17,5,11]. Other work have employed different deep networks to detect ROIs and obtain mass boundaries in different stages [6]. However, these methods require hand-crafted features to complement the system [12], and training data to be annotated with bounding boxes and segmentation ground truths which require expert domain knowledge and costly effort to obtain. In addition, multi-stage training cannot fully explore the power of deep networks. Due to the high cost of annotation, we intend to perform classification based on a raw whole mammogram. Each patch of a mammogram can be treated as an instance and a whole mammogram is treated as a bag of instances. The whole mammogram classification problem can then be thought of as a standard MIL problem. Due to the great representation power of deep features [9,21,19,20], combining MIL with deep neural networks is an emerging topic. Yan et al. used a deep MIL to find discriminative 1 The code can be downloaded from https://github.com/wentaozhu/deep-mil-for-wholemammogram-classification.git. 2 W. Zhu et al. Fig. 1. The framework of whole mammogram classification. First, we use Otsu’s segmentation to remove the background and resize the mammogram to 227 × 227. Second, the deep MIL accepts the resized mammogram as input to the convolutional layers. Here we use the convolutional layers in AlexNet [13]. Third, logistic regression with weight sharing over different patches is employed for the malignant probability of each position from the convolutional neural network (CNN) feature maps of high channel dimensions. Then the responses of the instances/patches are ranked. Lastly, the learning loss is calculated using max pooling loss, label assignment, or sparsity loss for the three different schemes. (a) (b) (c) (d) Fig. 2. Histograms of mass width (a) and height (b), mammogram width (c) and height (d). Compared to the size of whole mammogram (1, 474 × 3, 086 on average after cropping), the mass of average size (329 × 325) is tiny, and takes about 2% of a whole mammogram. patches for body part recognition [18]. Patch based CNN added a new layer after the last layer of deep MIL to learn the fusion model for multi-instance predictions [10]. Shen et al. employed two stage training to learn the deep multi-instance networks for pre-detected lung nodule classification [16]. The above approaches used max pooling to model the general multi-instance assumption which only considers the patch of max probability. In this paper, more effective task-related deep multi-instance models with end-to-end training are explored for whole mammogram classification. We investigate three different schemes, i.e., max pooling, label assignment, and sparsity, to perform deep MIL for the whole mammogram classification task. The framework for our proposed end-to-end trained deep MIL for mammogram classification is shown in Fig. 1. To fully explore the power of deep MIL, we convert the traditional MIL assumption into a label assignment problem. As a mass typically composes only 2% of a whole mammogram (see Fig. 2), we further propose sparse deep MIL. The proposed deep multi-instance networks are shown to provide robust performance for whole mammogram classification on the INbreast dataset [14]. Deep MIL with Sparse Label Assignment for Whole Mamm Class. 2 3 Deep MIL for Whole Mammogram Mass Classification Unlike other deep multi-instance networks [18,10], we use a CNN to efficiently obtain features of all patches (instances) at the same time. Given an image I, we obtain a much smaller feature map F of multi-channels Nc after multiple convolutional layers and max pooling layers. The (F )i,j,: represents deep CNN features for a patch Qi,j in I, where i, j represents the pixel row and column index respectively. The goal of our work is to predict whether a whole mammogram contains a malignant mass (BI-RADS ∈ {4, 5, 6} as positive) or not, which is a standard binary classification problem. We add a logistic regression with weights shared across all the pixel positions following F , and an element-wise sigmoid activation function is applied to the output. To clarify it, the malignant probability of feature space’s pixel (i, j) is ri,j = sigmoid(a · Fi,j,: + b), (1) where a is the weights in logistic regression, b is the bias, and · is the inner product of the two vectors a and Fi,j,: . The a and b are shared for different pixel positions i, j. We can combine ri,j into a matrix r = (ri,j ) of range [0, 1] denoting the probabilities of patches being malignant masses. The r can be flattened into a one-dimensional vector as r = (r1 , r2 , ..., rm ) corresponding to flattened patches (Q1 , Q2 , ..., Qm ), where m is the number of patches. 2.1 Max Pooling-based Multi-instance Learning The general multi-instance assumption is that if there exists an instance that is positive, the bag is positive [7]. The bag is negative if and only if all instances are negative. For whole mammogram classification, the equivalent scenario is that if there exists a malignant mass, the mammogram I should be classified as positive. Likewise, negative mammogram I should not have any malignant masses. If we treat each patch Qi of I as an instance, the whole mammogram classification is a standard multi-instance task. For negative mammograms, we expect all the ri to be close to 0. For positive mammograms, at least one ri should be close to 1. Thus, it is natural to use the maximum component of r as the malignant probability of the mammogram I p(y = 1|I, θ) = max{r1 , r2 , ..., rm }, (2) where θ is the weights in deep networks. If we sort r first in descending order as illustrated in Fig. 1, the malignant probability of the whole mammogram I is the first element of ranked r as {r0 1 , r0 2 , ..., r0 m } = sort({r1 , r2 , ..., rm }), p(y = 1|I, θ) = r0 1 , and p(y = 0|I, θ) = 1 − r0 1 , (3) where r 0 = (r0 1 , r0 2 , ..., r0 m ) is descending ranked r. The cross entropy-based cost function can be defined as Lmaxpooling N λ 1 X log(p(yn |In , θ)) + kθk2 =− N n=1 2 (4) 4 W. Zhu et al. where N is the total number of mammograms, yn ∈ {0, 1} is the true label of malignancy for mammogram In , and λ is the regularizer that controls model complexity. One disadvantage of max pooling-based MIL is that it only considers the patch Q0 1 , and does not exploit information from other patches. A more powerful framework should add task-related priori, such as sparsity of mass in whole mammogram, into the general multi-instance assumption and explore more patches for training. 2.2 Label Assignment-based Multi-instance Learning For the conventional classification tasks, we assign a label to each data point. In the MIL scheme, if we consider each instance (patch) Qi as a data point for classification, we can convert the multi-instance learning problem into a label assignment problem. After we rank the malignant probabilities r = (r1 , r2 , ..., rm ) for all the instances (patches) in a whole mammogram I using the first equation in Eq. 3, the first few r0 i should be consistent with the label of whole mammogram as previously mentioned, while the remaining patches (instances) should be negative. Instead of adopting the general MIL assumption that only considers the Q0 1 (patch of malignant probability r0 1 ), we assume that 1) patches of the first k largest malignant probabilities {r0 1 , r0 2 , ..., r0 k } should be assigned with the same class label as that of whole mammogram, and 2) the rest patches should be labeled as negative in the label assignment-based MIL. After the ranking/sorting layer using the first equation in Eq. 3, we can obtain the malignant probability for each patch p(y = 1|Q0 i , θ) = r0 i , and p(y = 0|Q0 i , θ) = 1 − r0 i . (5) The cross entropy loss function of the label assignment-based MIL can be defined Llabelassign. N  k 1 X X log(p(yn |Q0 j , θ))+ =− mN n=1 j=1  m X λ log(p(y = 0|Q0 j , θ)) + kθk2 . 2 (6) j=k+1 One advantage of the label assignment-based MIL is that it explores all the patches to train the model. Essentially it acts a kind of data augmentation which is an effective technique to train deep networks when the training data is scarce. From the sparsity perspective, the optimization problem of label assignment-based MIL is exactly a ksparse problem for the positive data points, where we expect {r0 1 , r0 2 , ..., r0 k } being 1 and {r0 k+1 , r0 k+2 , ..., r0 m } being 0. The disadvantage of label assignment-based MIL is that it is hard to estimate the hyper-parameter k. Thus, a relaxed assumption for the MIL or an adaptive way to estimate the hyper-parameter k is preferred. 2.3 Sparse Multi-instance Learning From the mass distribution, the mass typically comprises about 2% of the whole mammogram on average (Fig. 2), which means the mass region is quite sparse in the whole Deep MIL with Sparse Label Assignment for Whole Mamm Class. 5 mammogram. It is straightforward to convert the mass sparsity to the malignant mass sparsity, which implies that {r0 1 , r0 2 , ..., r0 m } is sparse in the whole mammogram classification problem. The sparsity constraint means we expect the malignant probability of part patches r0 i being 0 or close to 0, which is equivalent to the second assumption in the label assignment-based MIL. Analogously, we expect r0 1 to be indicative of the true label of mammogram I. After the above discussion, the loss function of sparse MIL problem can be defined Lsparse = N  λ 1 X − log(p(yn |In , θ)) + µkrn0 k1 + kθk2 , N n=1 2 (7) where p(yn |In , θ) can be calculated in Eq. 3, rn = (r0 1 , r0 2 , ..., r0 m ) for mammogram In , k · k1 denotes the L1 norm, µ is the sparsity factor, which is a trade-off between the sparsity assumption and the importance of patch Q0 1 . From the discussion of label assignment-based MIL, this learning is a kind of exact k-sparse problem which can be converted to L1 constrain. One advantage of sparse MIL over label assignment-based MIL is that it does not require assign label for each patch which is hard to do for patches where probabilities are not too large or small. The sparse MIL considers the overall statistical property of r Another advantage of sparse MIL is that, it has different weights for general MIL assumption (the first part loss) and label distribution within mammogram (the second part loss), which can be considered as a trade-off between max pooling-based MIL (slack assumption) and label assignment-based MIL (hard assumption). 3 Experiments We validate the proposed models on the most frequently used mammographic mass classification dataset, INbreast dataset [14], as the mammograms in other datasets, such as DDSM dataset [4], are of low quality. The INbreast dataset contains 410 mammograms of which 100 containing malignant masses. These 100 mammograms with malignant masses are defined as positive. For fair comparison, we also use 5-fold cross validation to evaluate model performance as [6]. For each testing fold, we use three folds for training, and one fold for validation to tune hyper-parameters. The performance is reported as the average of five testing results obtained from cross-validation. We employ techniques to augment our data. For each training epoch, we randomly flip the mammograms horizontally, shift within 0.1 proportion of mammograms horizontally and vertically, rotate within 45 degree, and set 50 × 50 square box as 0. In experiments, the data augmentation is essential for us to train the deep networks. For the CNN network structure, we use AlexNet and remove the fully connected layers [13]. Through CNN, the mammogram of size 227×227 becomes 256 6×6 feature maps. Then we use steps in Sec. 2 to do MIL. Here we employ weights pretrained on the ImageNet due to the scarce of data. We use Adam optimization with learning rate 5 × 10−5 for training models [2]. The λ for max pooling-based and label assignmentbased MIL are 1 × 10−5 . The λ and µ for sparse MIL are 5 × 10−6 and 1 × 10−5 respectively. For the label assignment-based MIL. 6 W. Zhu et al. Table 1. Accuracy Comparisons of the proposed deep MILs and related methods on test sets. Methodology Ball et al. [3] Varela et al. [17] Domingues et al. [8] Pretrained CNN [6] Pretrained CNN+Random Forest [6] AlexNet AlexNet+Max Pooling MIL AlexNet+Label Assign. MIL AlexNet+Sparse MIL Dataset DDSM DDSM INbr. INbr. INbr. INbr. INbr. INbr. INbr. Set-up Manual+feat. Manual+feat. Manual+feat. Auto.+feat. Auto.+feat. Auto. Auto. Auto. Auto. Accu. 0.87 0.81 0.89 0.84±0.04 0.91 ± 0.02 0.81±0.02 0.85±0.03 0.86±0.02 0.90±0.02 AUC N/A N/A N/A 0.69±0.10 0.76±0.23 0.79±0.03 0.83±0.05 0.84±0.04 0.89 ± 0.04 We firstly compare our methods to previous models validated on DDSM dataset and INbreast dataset in Table 1. Previous hand-crafted feature-based methods require manually annotated detection bounding box or segmentation ground truth even in test denoting as manual [3,17,8]. The feat. denotes requiring hand-crafted features. Pretrained CNN uses two CNNs to detect the mass region and segment the mass, followed by a third CNN to do mass classification on the detected ROI region, which requires handcrafted features to pretrain the network and needs multi-stages training[6]. Pretrained CNN+Random Forest further employs random forest and obtained 7% improvement. These methods are either manually or need hand-crafted features or multi-stages training, while our methods are totally automated, do not require hand-crafted features or extra annotations even on training set, and can be trained in an end-to-end manner. The max pooling-based deep MIL obtains better performance than the pretrained CNN using 3 different CNNs and detection/segmentation annotation in the training set. This shows the superiority of our end-to-end trained deep MIL for whole mammogram classification. According to the accuracy metric, the sparse deep MIL is better than the label assignment-based MIL, which is better than the max pooling-based MIL. This result is consistent with previous discussion that the sparsity assumption benefited from not having hard constraints of the label assignment assumption, which employs all the patches and is more efficient than max pooling assumption. Our sparse deep MIL achieves competitive accuracy to random forest-based pretrained CNN, while much higher AUC than previous work, which shows our method is more robust. The main reasons for the robust results using our models are as follows. Firstly, data augmentation is an important technique to increase scarce training datasets and proves useful here. Secondly, the transfer learning that employs the pretrained weights from ImageNet is effective for the INBreast dataset. Thirdly, our models fully explore all the patches to train our deep networks thereby eliminating any possibility of overlooking malignant patches by only considering a subset of patches. This is a distinct advantage over previous networks employing several stages. To further understand our deep MIL, we visualize the responses of logistic regression layer for four mammograms on test set, which represents the malignant probability of each patch, in Fig. 3. We can see the deep MIL learns not only the prediction of whole mammogram, but also the prediction of malignant patches within the whole mammogram. Our models are able to learn the mass region of the whole mammogram Deep MIL with Sparse Label Assignment for Whole Mamm Class. (a) (b) (c) 7 (d) Fig. 3. The visualization of predicted malignant probabilities for instances/patches in four resized mammograms. The first row is the resized mammogram. The red rectangle boxes are mass regions from the annotations on the dataset. The color images from the second row to the last row are the predicted malignant probability from logistic regression layer for (a) to (d) respectively, which are the malignant probabilities of patches/instances. Max pooling-based, label assignment-based, sparse deep MIL are in the second row, third row, fourth row respectively. without any explicit bounding box or segmentation ground truth annotation of training data. The max pooling-based deep multi-instance network misses some malignant patches in (a), (c) and (d). The possible reason is that it only considers the patch of max malignant probability in training and the model is not well learned for all patches. The label assignment-based deep MIL mis-classifies some patches in (d). The possible reason is that the model sets a constant k for all the mammograms, which causes some mis-classifications for small masses. One of the potential applications of our work is that these deep MIL networks could be used to do weak mass annotation automatically, which provides evidence for the diagnosis. 4 Conclusion In this paper, we propose end-to-end trained deep MIL for whole mammogram classification. Different from previous work using segmentation or detection annotations, we conduct mass classification based on whole mammogram directly. We convert the general MIL assumption to label assignment problem after ranking. Due to the sparsity of masses, sparse MIL is used for whole mammogram classification. Experimental 8 W. Zhu et al. results demonstrate more robust performance even without detection or segmentation annotation in the training. In future work, we plan to extend the current work by: 1) incorporating multi-scale modeling such as spatial pyramid to further improve whole mammogram classification, 2) employing the deep MIL to do annotation or provide potential malignant patches to assist diagnoses, and 3) applying to large datasets if the big dataset is available. References 1. American cancer society. what are the key statistics about breast cancer? 2. Ba, J., Kingma, D.: Adam: A method for stochastic optimization. ICLR (2015) 3. Ball, J.E., Bruce, L.M.: Digital mammographic computer aided diagnosis (cad) using adaptive level set segmentation. In: EMBS (2007) 4. Bowyer, K., Kopans, D., Kegelmeyer, W., et al.: The digital database for screening mammography. In: IWDM (1996) 5. Carneiro, G., Nascimento, J., Bradley, A.P.: Unregistered multiview mammogram analysis with pre-trained deep learning models. In: MICCAI. pp. 652–660. Springer (2015) 6. Dhungel, N., Carneiro, G., Bradley, A.P.: The automated learning of deep features for breast mass classification from mammograms. In: MICCAI. pp. 106–114. Springer (2016) 7. Dietterich, T.G., Lathrop, R.H., Lozano-Pérez, T.: Solving the multiple instance problem with axis-parallel rectangles. Artificial intelligence 89(1), 31–71 (1997) 8. Domingues, I., Sales, E., Cardoso, J., Pereira, W.: Inbreast-database masses characterization. XXIII CBEB (2012) 9. Greenspan, H., van Ginneken, B., Summers, R.M.: Guest editorial deep learning in medical imaging: Overview and future promise of an exciting new technique. IEEE Transactions on Medical Imaging 35(5), 1153–1159 (2016) 10. Hou, L., Samaras, D., Kurc, T.M., et al.: Patch-based convolutional neural network for whole slide tissue image classification. arXiv:1504.07947 (2015) 11. Jiao, Z., Gao, X., Wang, Y., Li, J.: A deep feature based framework for breast masses classification. Neurocomputing (2016) 12. Kooi, T., Litjens, G., van Ginneken, B., et al.: Large scale deep learning for computer aided detection of mammographic lesions. Medical image analysis 35, 303–312 (2017) 13. Krizhevsky, A., Sutskever, I., Hinton, G.E.: Imagenet classification with deep convolutional neural networks. In: NIPS. pp. 1097–1105 (2012) 14. Moreira, I.C., Amaral, I., Domingues, I., et al.: Inbreast: toward a full-field digital mammographic database. Academic radiology (2012) 15. Oeffinger, K.C., Fontham, E.T., Etzioni, R., et al.: Breast cancer screening for women at average risk: 2015 guideline update from the american cancer society. Jama (2015) 16. Shen, W., Zhou, M., Yang, F., et al.: Learning from experts: Developing transferable deep features for patient-level lung cancer prediction. In: MICCAI (2016) 17. Varela, C., Timp, S., Karssemeijer, N.: Use of border information in the classification of mammographic masses. Physics in Medicine and Biology 51(2), 425 (2006) 18. Yan, Z., Zhan, Y., Peng, Z., et al.: Multi-instance deep learning: Discover discriminative local anatomies for bodypart recognition. IEEE transactions on medical imaging 35(5) 19. Zhu, W., Lan, C., Xing, J., et al.: Co-occurrence feature learning for skeleton based action recognition using regularized deep lstm networks. In: AAAI (2016) 20. Zhu, W., Miao, J., Qing, L., Huang, G.B.: Hierarchical extreme learning machine for unsupervised representation learning. In: IJCNN. pp. 1–8. IEEE (2015) 21. Zhu, W., Xie, X.: Adversarial deep structural networks for mammographic mass segmentation. arXiv:1612.05970 (2016)
9cs.NE
arXiv:1505.00965v1 [math.NA] 5 May 2015 An Introduction to Multilevel Monte Carlo for Option Valuation∗ Desmond J. Higham† May 6, 2015 Abstract Monte Carlo is a simple and flexible tool that is widely used in computational finance. In this context, it is common for the quantity of interest to be the expected value of a random variable defined via a stochastic differential equation. In 2008, Giles proposed a remarkable improvement to the approach of discretizing with a numerical method and applying standard Monte Carlo. His multilevel Monte Carlo method offers a speed up of O(−1 ), where  is the required accuracy. So computations can run 100 times more quickly when two digits of accuracy are required. The “multilevel philosophy” has since been adopted by a range of researchers and a wealth of practically significant results has arisen, most of which have yet to make their way into the expository literature. In this work, we give a brief, accessible, introduction to multilevel Monte Carlo and summarize recent results applicable to the task of option evaluation. Keywords computational complexity, control variate, Euler–Maruyama, Monte Carlo, option value, stochastic differential equation, variance reduction. 1 Aims Finding the appropriate market value of a financial option can usually be formulated as an expected value computation [20, 23, 38]. In the case where the product underlying the option is modelled as a stochastic differential equation (SDE), we may ∗ Submitted to International Journal of Computer Mathematics, special issue on Computational Methods in Finance † Department of Mathematics and Statistics, University of Strathclyde, UK 1 • simulate the SDE numerically to compute many independent sample paths, and then • combine the option payoff from each path in order to obtain a Monte Carlo estimate, and an accompanying confidence interval. Compared with other approaches, notably the direct discretization of a partial differential equation based formulation of the problem, a Monte Carlo computation has the advantages of (a) being simple to implement and (b) being flexible enough to cope with a wide range of underlying SDE models and option payoffs. On the downside, Monte Carlo is typically expensive in terms of computation time [20, 23]. In the seminal 2008 paper [14], Giles pulled together ideas from numerical analysis, stochastic analysis and applied statistics in order to deliver a dramatic improvement on the efficiency of the “SDE simulation plus Monte Carlo” approach. If the required level of accuracy, in terms of confidence interval, is , the multilevel approach essentially improves the computational complexity by a factor of . So for a calculation requiring two digits of accuracy, we obtain a hundredfold improvement in computation time. Multilevel Monte Carlo has rapidly become an extremely hot topic in the field of stochastic computation, impacting on a wide range of application areas. In particular, technical reviews of research progress in the field have begun to appear [16, 18] and a comprehensive survey is currently in progress by Giles for the journal Acta Numerica. However, the area is still sufficiently new that most textbooks in computational finance do not introduce the topic, and hence it has not been fully integrated into typical graduate-level classes and development courses for practitioners. For this reason, we present here an accessible introduction to the multilevel Monte Carlo approach, and give a brief overview of the current state of the art with respect to financial option valuation. In section 2 we discuss the underlying SDE simulation. Section 3 then considers the complexity of standard Monte Carlo in this setting. In section 4 we give some motivation for the multilevel approach, which is introduced and analysed in section 5. Section 6 illustrates the performance of the algorithm in practice, using code that has been made available by Giles. In section 7 we give pointers to multilevel research in option valuation that has built on [14]. Section 8 concludes with a brief discussion. 2 2 Convergence in SDE Simulation We consider an Ito SDE of the form dX(t) = f (X(t))dt + g(X(t))dW (t), X(0) = X0 . (1) Here, f : Rm → Rm and g : Rm → Rm×d are given functions, known as the drift and diffusion coefficients, respectively, and W (t) ∈ Rd is standard Brownian motion. The initial condition X0 is supplied and we wish to simulate the SDE over the fixed time interval [0, T ]. The Euler–Maruyama method [31, 33] computes approximations Xn ≈ X(tn ), where tn = n∆t, according to X0 = X(0) and, for n = 1, 2, . . . N − 1, Xn+1 = Xn + f (Xn )∆t + g(Xn )∆Wn , (2) where ∆t = T /N is the stepsize and ∆Wn = W (tn+1 ) − W (tn ) is the relevant Brownian motion increment. In the study of the accuracy of SDE simulation methods, the two most widely used convergence concepts are referred to as weak and strong [31, 33]. Roughly, • weak convergence controls the error of the means, whereas, • strong convergence controls the mean of the error. To prove weak and strong convergence results, we must impose conditions on the SDE. For example it is standard to assume that f and g in (1) satisfy global Lipschitz conditions; that is, there exists a constant L such that for all x, y ∈ Rm . (3) Here and throughout we take k·k to be the Euclidean norm. Under such conditions, and for appropriate initial data, it follows that the Euler–Maruyama method has weak order one, so that |f (x) − f (y)| ≤ L|x − y| and |g(x) − g(y)| ≤ L|x − y|, sup (E[X(tn )] − E[Xn ]) = O(∆t). (4) 0≤tn ≤T In the sense of strong error, which involves the mean of the absolute difference between the two random variables at each grid point, Euler–Maruyama achieves only an order of one half in general:   1 (5) E sup |X(tn ) − Xn | = O(∆t 2 ). 0≤tn ≤T 3 More generally, for any m > 1 and sufficiently small ∆t there is a constant C = C(m) such that   m (6) E sup |X(tn ) − Xn | ≤ C∆tm/2 . 0≤tn ≤T Strong convergence is sometimes described as a pathwise property. This can be understood via the Borel-Cantelli Lemma. For example, in [30] it is shown that given any  > 0 there exists a path-dependent constant K = K() such that, for all sufficiently small ∆t, 1 sup |X(tn ) − Xn | ≤ K()h 2 − . 0≤tn ≤T In the setting of this work, it is tempting to argue that strong convergence is not relevant; if we wish to compute an expected value based on the SDE solution then following individual paths accurately is not important. However, we will see in section 5 that the analysis in [14] justifying multilevel Monte Carlo makes use of both weak and strong convergence properties. To conclude this section, we remark that the analysis of SDE simulation on problems that violate the global Lipschitz conditions (3) is far from complete. In the case of SDE models for financial assets and interest rates, issues may arise through faster than linear growth at infinity and also through unbounded derivatives at the origin. For example, both complications occur in the class of scalar interest rate models from [1],  dX(t) = α−1 X(t)−1 − α0 + α1 X(t) − α2 X(t)r dt + α3 X(t)ρ dW (t), where the αi are positive constants and r, ρ > 1. Although some positive results are available for specific nonlinear structures [24, 25, 26, 39], there has also been a sequence of negative results showing how Euler–Maruyama can break down on nonlinear SDEs [24, 27, 34]. 3 SDE Simulation and Standard Monte Carlo Given the SDE (1), suppose we wish to approximate the final time expected value of the solution, E[X(T )], using Monte Carlo with Euler–Maruyama. We will let  denote the accuracy requirement in terms of confidence interval width; fixing on a 95% confidence level to be concrete, we therefore wish to be in a position where applying the algorithm independently a large number of times, the exact answer would be within ± of our computed answer with frequency at least 0.95. 4 [s] Let XN denote the Euler–Maruyama final time approximation along the sth path. Using M Monte Carlo samples we may form the sample average aM M 1 X [s] = X . M s=1 N The overall error in our approximation has the form aM − E[X(T )] = aM − E[X(T ) − XN + XN ] = aM − E[XN ] + E[XN − X(T )]. (7) Note that XN denotes a random variable describing the result of applying [s] Euler–Maruyama (2), whereas each XN is an independent sample from the distribution given by XN . The expression (7) breaks down the error into two terms. The statistical error, aM − E[Xn ], is concerned with how well we can approximate an expected value from a finite number of samples; it does not depend on how accurately the numerical method approximates the SDE (in particular it does not depend significantly on ∆t) and it will generally decrease if we take more sample paths. The discretization error, or bias, E[XN − X(T )], arises because we have approximated the SDE with a difference equation; this is the discrepancy that would remain if we had access to the exact expected value of the numerical solution and it will generally decrease if we reduce the stepsize. Standard results [20, 37] tell us that the statistical error √ aM − E[Xn ] can be described via a confidence interval of width O(1/ M ). The weak convergence property (4) shows that the bias E[XN − X(T )] behaves like O(∆t); so we must add this amount to the confidence √ interval width. We arrive at an overall confidence interval of width O(1/ √M ) + O(∆t). To achieve our required target accuracy of , we see that 1/ M and ∆t should scale like . In other words, M should scale like −2 and ∆t should scale like . It is reasonable to measure computational cost by counting either the number of times that the drift and diffusion coefficients, f and g, are evaluated, or the number of times that a random number generator is called. In either case, the cost per path is proportional to 1/∆t, and hence the total cost of the computation scales like M/∆t. We argued above that M should scale like −2 and ∆t should scale like . Here is the conclusion: we may achieve accuracy  by combining Euler–Maruyama and standard Monte Carlo at an overall cost that scales like −3 . One approach to improving the computational complexity is to replace Euler–Maruyama with a simulation method of higher weak order [4, 31, 33]. 5 If we use a second order method, so that (4) is replaced by sup (E[X(tn )] − E[Xn ]) = O(∆t2 ), 0≤tn ≤T then a straightforward adaption of the arguments above lead to the following conclusion: we may achieve accuracy  by combining a second order weak method and standard Monte Carlo at an overall cost that scales like −2.5 . We note, however, that establishing second order weak convergence requires extra smoothness assumptions to be placed on the SDE coefficients. As we show in section 5, the method of Giles [14] has the following feature: we may achieve accuracy  by using Euler–Maruyama in a multilevel Monte Carlo setting at an overall cost that scales like −2 (log )2 . Moreover, by using a higher strong order method, such as Milstein [31, 33], it is possible to reduce the multilevel Monte Carlo cost to the order of −2 [13]. It is worth pausing to admire an O(−2 ) computational complexity count. Suppose we are given an exact expression for the SDE solution, as a function of W (t). Hence, we are able to compute exact samples, without the need to √ apply a numerical method. A standard Monte Carlo approach requires 1/ M to scale like  in order to achieve the required confidence interval width. If we regard the evaluation of each exact X(T ) sample as having O(1) cost, then the cost overall will be proportional to M ; that is, −2 . In this sense, with a multilevel approach the numerical analysis comes for free; we can solve the problem as quickly as one for which we have an exact pathwise expression for the SDE solution. 4 Motivation for the Multilevel Approach We can motivate the multilevel approach by considering a series expansion of Brownian motion, where the coefficients are random variables. The PaleyWiener representation over [0, 2π] has the form ∞ 2 X sin( 12 nt) t W (t) = Z0 √ + √ Zn , n π n=1 2π 6 (8) where the {Zi }i≥0 are i.i.d. and N (0, 1); see, for example, [32]. In Figure 1 we draw samples for the P Zi and plot the curves arising when the infinite series in (8) is truncated to M n=1 , for M = 1, 2, 5, 10, 50 and 200. It is clear that the early terms in the series affect the overall shape, while the later terms add fine detail. From this perspective, it is intuitively reasonable that we can build up information at different resolution scales, with the finer scales having less impact on the overall picture. Now, we may view Monte Carlo as requiring a “black box” that returns independent samples. In our numerical SDE context, the samples come from a distribution that is only approximately correct, and the black box (the Euler–Maruyama method) comes with a dial. Turning the dial corresponds to changing ∆t. Samples with a smaller ∆t are more expensive—we have to wait longer for them because the paths contain more steps. The multilevel Monte Carlo algorithm cleverly exploits this dial. The black box is used to produce samples across a range of stepsizes. Most of the samples that we ask for will be obtained quickly with relatively large ∆t values. Relatively few samples will be generated at the expensive small ∆t levels. In a sense, the large ∆t paths cover the low-frequency information so that expensive, high-frequency paths are used sparingly. Figure 1 might convince you that this idea has some merit. The next section works through the details. 5 Multilevel Monte Carlo with Euler–Maruyama We focus now on the more general case where we wish to approximate the expected value of some function of the final time solution, E[h(X(T ))]. We have in mind the case where X(t) represents an underlying asset, in riskneutral form, and h(·) is the payoff of a corresponding European-style option [20, 23]. For example, h(x) = max(x − E, 0) for a European call option with exercise price E and expiry time T . For simplicity, we will consider the scalar case, so that m = d = 1 in (1), but we note that all arguments generalise to the case of systems, with the same conclusions. We assume that the payoff function h satisfies a global Lipschitz condition; this covers the call and put option cases. Multilevel Monte Carlo uses a range of different discretization levels. At level l we have a stepsize of the form ∆tl = M −l T, where l = 0, 1, 2, . . . , L. (9) Here M > 1 is a fixed quantity whose precise value does not affect the overall complexity of the method, in terms of the asymptotic rate as  → 0. For 7 simplicity we may think of M = 2. As the upper limit on the level index we choose log −1 L= . (10) log M In this way, at the coarsest level, l = 0, we have the largest stepsize, ∆t0 = T , covering the whole interval in one step. At the most refined level, l = L, we have ∆tL = O()—from (4), this the stepsize needed by Euler–Maruyama to achieve weak error of O(). With each choice of stepsize, ∆tl , we may apply Euler–Maruyama to the SDE (1) and evaluate the payoff function h at the final time. We will let the random variable Pbl denote this approximation to h(X(T )). Now, from the linearity of the expectation operator we have the telescoping sum E[PbL ] = E[Pb0 ] + L X E[Pbl − Pbl−1 ]. (11) l=1 In multilevel Monte Carlo, we use the expansion on the right hand side as an indirect means to evaluate the left hand side. This may be thought of as a recursive application of the control variate technique, which is widely used in applied statistics [20, 23, 37, 38]. To estimate E[Pb0 ] we form the usual sample mean, based on, say, N0 , paths. This gives N0 1 X [s] b Pb . Y0 = N0 s=1 0 (12) Generally, for E[Pbl − Pbl−1 ] with l > 0 we will use Nl paths so that Nl   1 X [s] [s] Pbl − Pbl−1 . Ybl = Nl s=1 (13) [s] [s] It is vital to point out that Pbl and Pbl−1 in (13) come from the same discretized Brownian path, with different stepsizes ∆tl and ∆tl−1 , respectively. Figure 2 illustrates the idea for the case M = 2. In words, at a general level l, we compute Nl Brownian paths and, for each path, apply Euler– Maruyama twice; once with stepsize ∆tl and once with stepsize ∆tl−1 . (In practice, we compute a path at resolution ∆tl and then combine Brownian increments over pairs of steps in order to get a path at resolution ∆tl−1 .) Having constructed our Nl independent paths for level l, we start afresh at level l + 1; none of the earlier information is re-used and new (independent) pseudo-random numbers are generated. 8 Because of the choice of L in (10) we know from (11) that our estimator will have the required O() bias. Now we will see how to choose the values of {Nl }Ll=0 to achieve the corresponding accuracy in the overall confidence interval. Considering a general level where l > 0, appealing to the strong convergence behaviour (6) of Euler–Maruyama and our assumption that h is globally Lipschitz, we have var[Pbl − h(X(T ))] = E[(Pbl − h(X(T )))2 ] − (E[Pbl − h(X(T ))])2 (14) ≤ E[(Pbl − h(X(T )))2 ] (15) 2 ≤ constant × E[(XN − X(T )) ] (16) = O(∆tl ). (17) It then follows from Minkowski’s Inequality [8] that var[Pbl − Pbl−1 ] = var[Pbl − h(X(T )) + h(X(T )) − Pbl−1 ] 2 q q b b var[Pl − h(X(T ))] + var[h(X(T )) − Pl−1 ] ≤ = O(∆tl ). (18) Applying this result in (13) we conclude that Ybl has a variance of O(∆tl /Nl ) for l > 1. Because all levels are independent, we deduce that # " L L X X b b b Yl = var[Y0 ] + O(∆tl /Nl ). var Y0 + l=1 l=1 To balance the variance evenly across levels l = 1, 2, . . . , L and to control the variance at level l = 0, we choose Nl = O(−2 L∆tl ). It then follows that our overall estimator has variance 2 O( ) + L X O(2 /L) = O(2 ). l=1 In this way, we have achieved the bias and variance required to give a confidence interval of the specified  level of accuracy. To quantify how the complexity of this algorithm scales with , we sum the cost of level l from l = 0 to L to give L X l=0 Nl ∆t−1 l = L X = L2 −2 . −2 L∆tl ∆t−1 l l=0 From (10) this expression becomes O(−2 (log )2 ), as we quoted in section 3. At this stage, a few remarks are in order: 9 Constructive Upper Bound: In the course of the analysis above, we came up with a general-purpose choice for the number of paths at each level, {Nl }Ll=0 . The final complexity count is therefore an upper bound on the best possible value. In practice, for a given problem and accuracy requirement, we can perform a cheap pre-processing step where appropriate variances are estimated and an optimization problem is solved in order to give a sequence {Nl }Ll=0 ; see, for example, [18]. Weak versus Strong: The key inequality (18), which guarantees tight coupling between coarse and fine paths, made use of the strong convergence property. For small ∆tl , both paths are close to the true path, so the paths must be close to each other. In this sense, both strong and weak error rates are key ingredients in the analysis. We note, however, that Giles [13] has also developed estimators that do not rely directly on strong convergence. Variance and Second Moment In deriving the inequality (17), we discarded the square of the first moment and used the second moment as an upper bound for the variance. This may appear to be a very crude step, but in our context it does not degrade the final conclusion. (In a different, Poisson-driven setting where a multilevel method was developed and analysed, the step (14)–(15) is no longer optimal—it is beneficial to analyse the variance directly [3].) Exploiting Structure: As mentioned above, multilevel Monte Carlo may be viewed as a recursive version of the control variate approach. In the simplest version of control variates, if we wish to compute E[X], we may instead compute E[X − Y ] and add E[Y ], where Y is a suitably constructed random variable such that X − Y has small variance and E[Y ] is readily available [20, 23]. However, the success of this technique usually relies on incorporating some extra knowledge of the problem: a structure such as symmetry or convexity, or the existence of a “nearby” problem that is analytically tractable. In this respect, the multilevel Monte Carlo method for SDEs is very different from traditional control variates: the analysis is completely general and no special insights are needed about the nature of the underlying SDE, other than knowledge of the basic weak and strong convergence properties. Multilevel versus Multigrid: In [16], Giles explains that the multigrid approach in numerical PDEs was “the inspiration for the author in developing the MLMC method for SDE path simulation.” There are clear similarities between the two: the use of geometrically refined/coarsened 10 grids and the idea that relatively little work needs to be expended on the fine grids in order to resolve high frequency components. However, it is important to keep in mind that there are also conceptual differences between the two techniques: multilevel Monte Carlo is distinct, and novel. For example, multilevel Monte Carlo does not involve the notion of passing information up and down the refinement levels, as is done with multigrid V or W cycles. Related Earlier Methods: As discussed in [16, section 1.3], related earlier work on improving Monte Carlo when samples are generated via discretization was performed by Heinrich, see, for example [21, 22], and Kebaier [29] devised a two-level approach to path simulation. Based on the type of analysis that we summarized above, it is possible to state a general theorem about multilevel simulation: Theorem 5.1 (Giles; see for example, [16]) Let P denote a random variable, and let Pl denote the corresponding level l numerical approximation. If there exist independent estimators Yl based on Nl Monte Carlo samples, and positive constants α, β, γ, c1 , c2 , c3 such that α ≥ 21 min(β, γ) and 1. |E[Pl − P ]| ≤ c1 2−αl 2. E[Y0 ] = E[P0 ] and E[Yl ] = E[Pl − Pl−1 ] for l > 0 3. var[Yl ] ≤ c2 Nl−1 2−βl 4. E[Cl ] ≤ c3 Nl 2γl , where Cl is the computational complexity of Yl then there exists a positive constant c4 such that for any  < e−1 there are values L and Nl for which the multilevel estimator Y = L X Yl l=0 has a mean-square error with bound   E (Y − E[P ])2 < 2 with a computational complexity C with bound  β>γ  c4 −2 , c4 −2 (log())2 , β = γ E[C] ≤  c4 −2−(γ−β)/α , β < γ. 11 Giles [13] has also shown how to construct estimators for which β > γ = 1, by replacing Euler–Maruyama with the more strongly accurate Milstein scheme. For European-style options with Lipschitz payoff functions, this makes O(−2 ) complexity achievable. From the arguments in section (3), it is intuitively reasonable that this is the optimal rate. The issue is formalized in [35], and optimality is confirmed. In section 2 we mentioned that the basic Euler–Maruyama method (1) may fail to converge in a weak or strong sense on nonlinear SDEs in the asymptotic limit ∆t → 0. A closely related question, of direct relevance to this review, is whether the combination of “Euler–Maruyama plus Monte Carlo” converges in the  → 0 limit. In [25, 26], Hutzenthaler and Jentzen showed that Euler–Maruyama Monte Carlo can achieve convergence in a Palmost sure sense in cases where the underlying Euler–Maruyama scheme diverges. This can happen when the events causing Euler–Maruyama to diverge are so rare that they are extremely unlikely to impact on any of the Monte Carlo samples. However, in [28] Hutzenthaler, Jentzen and Platen showed that the multilevel Monte Carlo method does not inherit this property. They established this result using a counterexample of the form dX(t) = −X(t)5 dt, (19) with X(0) having a standard Gaussian distribution, where E[X(t)2 ] is the required moment. Note that the SDE (19) has a zero drift term, so it may also be regarded as a random ODE. A modified version of Euler–Maruyama, known as a tamed method, was shown in [28] to recover convergence in the multilevel setting. 6 Computational Experiments Asymptotic,  → 0, analysis indicates that multilevel Monte Carlo offers a dramatic improvement in computational complexity. Numerous computational studies have confirmed that this potential can be realised in practice. Giles has made MATLAB code available at \protect\vrule width0pt\protect\href{http://people.maths.ox.ac.uk/gilesm/acta/}{h that can be used as the basis for computational experimentation. In Figure 3 we show results based on this code. Here, we have an asset model given by geometric Brownian motion dX(t) = 0.05X(t)dt + 0.25X(t)dW (t), 12 X(0) = 100. We consider (a) a European call and (b) a digital call option over [0, T ] with T = 1 and exercise price 100. So the payoff functions, after discounting for interest, are h(x) = e−0.05T max(x − 100, 0) for the call option and  h(x) = e−0.05T 100 0 when x > 100 when x < 100 for the digital option. (For those who worry about probability zero events, the code defines h(100) = e−0.05T (100 + 0)/2.) The code repeats the Monte Carlo simulation for accuracy requests of  = 0.1, 0.05, 0.02, 0.01, 0.005. The upper left picture in Figure 3 shows, for the call option, the number of paths Nl used at each level l in the multilevel method. We see that for a given  more paths are used at the cheaper (small l) levels, and as  is decreased, so that more accuracy is required, extra levels are added. The upper right picture indicates the corresponding computational cost in terms of run time. More precisely, the asterisks (joined by dashed lines) show the cost weighted by 2 as a function of . We see that this quantity remains approximately constant, as predicted by the analysis. The picture also shows the scaled cost for an equivalent standard Monte Carlo computation, using a solid linetype. We see a much larger cost that appears to grow faster than −2 . The lower pictures in Figure 3 give the same results for the case of the digital option, and again the multilevel version is seen to be more efficient than standard Monte Carlo. 7 Follow-on Research In this section we summarize some of the key advances that have been made since the original multilevel breakthrough [14]. We focus on work that is directly relevant to financial option valuation. The comprehensive overviews [16, 18] can be consulted for further details on these, and other, areas. The webpage maintained by Giles at \protect\vrule width0pt\protect\href{http://people.maths.ox.ac.uk/\string~gilesm/ is also an excellent source of up-to-date information. 7.1 Beyond European Calls and Puts A key step in the analysis of section 5 was to show that the coarse and refined paths are tightly coupled, in the sense that they produce payoffs 13 whose difference has small variance. The logic behind the analysis may be loosely summarized as A strong convergence of Euler–Maruyama ⇒ B coarse and refined paths close to the true path ⇒ C coarse and refined paths close to each other ⇒ D coarse and refined payoffs close to each other. The C ⇒ D step appealed to the global Lipschitz property of h. This is valid for European call and put options, where h(x) = max(x − E, 0) and h(x) = max(E − x, 0), respectively. However, the analysis must be refined for those European-style options where E[h(X(T ))] is required for functions h that violate the global Lipschitz criterion. We may also wish to deal with path-dependent options where an expected value operation is applied to a functional depending on some or all of the values X(t) for 0 ≤ t ≤ T . These more exotic options include problematic classes where, for certain SDE paths, the payoff may be very sensitive to small changes. For example, with digital options that expire close to the money, a small change in the asset path can lead to an O(1) change in the payoff. Similarly, the payoff from a barrier option is very sensitive to those paths that flirt with the barrier. In these cases, the logical flow above above must be adapted. Intuitively, we should be able to exploit the fact that troublesome paths are the exception rather than the rule, and hence C ⇒ D with high probability. In some cases this allows us to recover the computational complexity that we saw for European calls and puts. In other cases we must accept a slight increase in cost. The behaviour of multilevel Monte Carlo for Asian, lookback and digital options was considered computationally in the original work of Giles [14]. Rigorous analysis to back up these results for barrier, lookback and digital options was first given in [17]. Further work has been targeted at binary options [5], Asian options [2], basket options [15], barrier options [10] and American options [6]. The use of multilevel Monte Carlo to compute sensitivities with respect to problem parameters, that is, Greeks, was considered in [7]. 7.2 Further Developments It is common practice to combine more than one variance reduction technique. Given that antithetic variables can be effective in option valuation 14 [20, 23], it is natural to consider embedding this approach within the multilevel framework. Giles and Szpruch [11, 19] have shown that this can be effective, particularly when Milstein is used for the numerical integration. A conditional Monte Carlo approach has also been shown to be fruitful in the mutlilevel setting [13]. In a different direction, Rhee and Glynn [36] have proposed an extra level of randomization that produces an unbiased multilevel estimator. To go beyond the asymptotic O(−2 ) complexity barrier it is possible to move to quasi Monte Carlo, where a low-discrepancy sequence replaces a pseudo-random sequence. Giles and Waterhouse [12] have demonstrated that a combination of quasi Monte Carlo and multilevel can outperform each separate technique. Finally, we note that the multilevel methodology has also been extended to asset models that are not driven purely by Brownian motion [9, 40]. 8 Discussion Our aim in this article was to explain in an accessible manner the key ideas behind the multilevel Monte Carlo method. We focussed on the case of SDE-based financial option valuation, where Monte Carlo is a widely used tool. At the heart of the technique is a very general and widely applicable philosophy—a recursive application of control variates that relies on tight coupling between simulations at different resolutions. The resulting algorithm is sufficiently simple and effective that it can be implemented straightforwardly and used to produce noticable gains in computational efficiency in very general circumstances. However, as evidenced by the wealth of current research activity, there is also substantial scope for (a) refining the multilevel approach in order to exploit problem-specific information and (b) developing multilevel methods in many other stochastic simulation scenarios. For these reasons we envisage multilevel Monte Carlo evolving into a cornerstone of computational finance. Acknowledgement The author is funded by a Royal Society/Wolfson Research Merit Award and an EPSRC Digital Economy Fellowship. He is grateful to Mike Giles for creating and placing in the public domain the code that was used as the basis for Figure 3. References [1] Y. Ait-Sahalia, Testing continuous-time models of the spot interest 15 rate, Review of Financial Studies, (1999), pp. 385–426. [2] M. B. Alaya and A. Kebaier, Multilevel Monte Carlo for Asian options and limit theorems, Monte Carlo Methods and Applications, 20 (2014), pp. 181–194. [3] D. F. Anderson, D. J. Higham, and Y. Sun, Complexity of multilevel Monte Carlo tau-leaping, SIAM Journal on Numerical Analysis, 52 (2015), pp. 3106–3127. [4] D. F. Anderson and J. C. Mattingly, A weak trapezoidal method for a class of stochastic differential equations, Communications in Mathematical Sciences, 9 (2011), pp. 301–318. [5] R. Avikainen, Convergence rates for approximations of functionals of SDEs, 13 (2009), pp. 381–401. [6] D. Belomestny, J. Schoenmakers, and F. Dickmann, Multilevel dual approach for pricing American style derivatives, Finance and Stochastics, 17 (2013), pp. 717–742. [7] S. Burgos and M. B. Giles, Computing Greeks using multilevel path simulation, in Monte Carlo and Quasi Monte Carlo Methods 2010, L. Plaskota and H. Wozniakowski, eds., Springer, 2012, pp. 281–296. [8] M. Capiński and E. Kopp, Measure, Integral and Probability, Springer, Berlin, 1999. [9] S. Dereich and F. Heidenreich, A multilevel Monte Carlo algorithm for Lévy-driven stochastic differential equations, Stochastic Processes and their Applications, (2011), pp. 1565–1587. [10] M. Giles, K. Debrabant, and A. Rößler, Numerical analysis of multilevel Monte Carlo path simulation using the Milstein discretisation, ArXiv preprint: 1302.4676, (2013). [11] M. Giles and L. Szpruch, Antithetic multilevel Monte Carlo estimation for multidimensional SDEs, in Monte Carlo and Quasi-Monte Carlo Methods 2012, J. Dick, F. Kuo, G. Peters, and I. Sloan, eds., Springer, 2013, pp. 367–384. [12] M. Giles and B. Waterhouse, Multilevel quasi-Monte Carlo path simulation, in Advanced Financial Modelling, Radon Series on Computational and Applied Mathematics, De Gruyter, 2009, pp. 165–181. 16 [13] M. B. Giles, Improved multilevel Monte Carlo convergence using the Milstein scheme, in Monte Carlo and Quasi-Monte Carlo Methods, Springer, 2007, pp. 343–358. [14] , Multilevel Monte Carlo path simulation, Operations Research, 56 (2008), pp. 607–617. [15] , Multilevel Monte Carlo for basket options, in Proceedings of the 2009 Winter Simulation Conference, Austin, M. D. Rossetti, R. R. Hill, B. Johansson, A. Dunkin, and R. G. Ingalls, eds., IEEE, 2009, pp. 1283– 1290. [16] , Multilevel Monte Carlo methods, in Monte Carlo and Quasi Monte Carlo Methods 2012, J. Dick, F. Y. Kuo, G. W. Peters, and I. H. Sloan, eds., Springer, 2014, pp. 79–98. [17] M. B. Giles, D. J. Higham, and X. Mao, Analysing multi-level Monte Carlo for options with non-globally Lipschitz payoff, Finance and Stochastics, 13 (2009), pp. 403–413. [18] M. B. Giles and L. Szpruch, Multilevel Monte Carlo methods for applications in finance, in Recent Developments in Computational Finance, T. Gerstner and P. E. Kloeden, eds., World Scientific, 2013. [19] , Antithetic multilevel Monte Carlo estimation for multidimensional SDEs without Lévy area simulation, Annals of Applied Probability, 24 (2014), pp. 15850–1620. [20] P. Glasserman, Monte Carlo Methods in Financial Engineering, Springer, Berlin, 2004. [21] S. Heinrich, Monte Carlo complexity of global solution of integral equations, Journal of Complexity, 14 (1998), pp. 151–175. [22] , Monte Carlo approximation of weakly singular integral operators, Journal of Complexity, 22 (2006), pp. 192–219. [23] D. J. Higham, An Introduction to Financial Option Valuation: Mathematics, Stochastics and Computation, Cambridge University Press, Cambridge, 2004. [24] D. J. Higham, X. Mao, and A. M. Stuart, Strong convergence of Euler-type methods for nonlinear stochastic differential equations, SIAM J. Num Anal., 40 (2002), pp. 1041–1063. 17 [25] M. Hutzenthaler and A. Jentzen, Convergence of the stochastic Euler scheme for locally Lipschitz coefficients, Found. Comput. Math., 11 (2011), pp. 657–706. [26] , Numerical approximations of stochastic differential equations with non-globally Lipschitz continuous coefficients, Memoirs of the American Mathematical Society, 236 (2014), p. in press. [27] M. Hutzenthaler, A. Jentzen, and P. E. Kloeden, Strong and weak divergence in finite time of Euler’s method for stochastic differential equations with non-globally Lipschitz continuous coefficients, Proc. R. Soc. A, 467 (2011), pp. 1563–1576. [28] M. Hutzenthaler, A. Jentzen, and P. E. Kloeden, Divergence of the multilevel Monte Carlo Euler method for nonlinear stochastic differential equations, Annals of Applied Probability, 23 (2013), pp. 1913– 1966. [29] A. Kebaier, Statistical Romberg extrapolation: a new variance reduction method and applications to option pricing, Annals of Applied Probabilty, 14 (2005), pp. 2681–2705. [30] P. E. Kloeden and A. Neuenkirch, The pathwise convergence of approximation schemes for stochastic differential equations, London Mathematical Society, 10 (2007), pp. 235–253. [31] P. E. Kloeden and E. Platen, Numerical Solution of Stochastic Differential Equations, Springer Verlag, Berlin, Third Printing, 1999. [32] T. Mikosch, Elementary Stochastic Calculus (with Finance in View), World Scientific, Singapore, 1998. [33] G. N. Milstein and M. V. Tretyakov, Stochastic Numerics for Mathematical Physics, Springer-Verlag, Berlin, 2004. [34] G. N. Milstein and M. V. Tretyakov, Numerical integration of stochastic differential equations with nonglobally Lipschitz coefficients, SIAM J. Numer. Anal., 43 (2005), pp. 1139–1154. [35] T. Müller-Gronbach and K. Ritter, Variable subspace sampling and multi-level algorithms, in Monte Carlo and Quasi-Monte Carlo Methods 2008, P. L’Ecuyer and A. Owen, eds., Springer, 2009, pp. 131– 156. 18 [36] C. Rhee and P. W. Glynn, A new approach to unbiased estimation for SDE’s, in Proceedings of the 2012 Winter Simulation Conference, C. Laroque, J. Himmelspach, R. Pasupathy, O. Rose, and A. Uhrmacher, eds., 2012, pp. 201–207. [37] C. P. Robert and G. Casella, Monte Carlo Statistical Methods, Springer, Berlin, 2nd ed., 2004. [38] R. Seydel, Tools for Computational Finance, Springer, Berlin, fifth ed., 2012. [39] L. Szpruch, X. Mao, D. J. Higham, and J. Pan, Strongly nonlinear Ait-Sahalia-type interest rate model and its numerical approximation, BIT Numerical Mathematics, 51 (2011), pp. 405–425. [40] Y. Xia and M. B. Giles, Multilevel path simulation for jumpdiffusion SDEs, in Monte Carlo and Quasi Monte Carlo Methods 2010, L. Plaskota and H. Wozniakowski, eds., Springer, 2012, pp. 695–708. 19 4 3 4 M=1 3 4 M=2 3 2 2 2 1 1 1 0 0 0 −1 0 2*pi 4 3 −1 0 2*pi 4 M=10 3 −1 0 M=50 3 2 2 1 1 1 0 0 0 2*pi −1 0 2*pi 4 2 −1 0 M=5 2*pi −1 0 M=200 2*pi 20 Figure 1: Paths based on the Paley-Wiener representation (8). As indicated, the six plots show the sum truncated after M = 1, 2, 5, 10, 50 and 200 sine terms. 2 Fine Path Course Path 1.8 1.6 X 1.4 1.2 1 0.8 0.6 0.4 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 t 21 Figure 2: Illustration of how the estimator Ybl in (13) is constructed. Circles (joined by straight lines for clarity) show the refined Euler–Maruyama path, with stepsize ∆t = 2−l T . Asterisks show the coarser Euler–Maruyama path, with stepsize ∆t = 2−l+1 T , computed with the same Brownian increments. Figure 3: Output from the multilevel Monte Carlo code made available by Giles (see text for web site address). Left hand pictures show the number of paths per level at each target accuracy. Right hand pictures show the computation time, scaled by 2 . Upper pictures are for a European call option. Upper pictures are for a digital option. 22
5cs.CE
1 Deep D-bar: Real time Electrical Impedance Tomography Imaging with Deep Neural Networks arXiv:1711.03180v1 [math.NA] 8 Nov 2017 S. J. Hamilton and A. Hauptmann Abstract—The mathematical problem for Electrical Impedance Tomography (EIT) is a highly nonlinear ill-posed inverse problem requiring carefully designed reconstruction procedures to ensure reliable image generation. D-bar methods are based on a rigorous mathematical analysis and provide robust direct reconstructions by using a low-pass filtering of the associated nonlinear Fourier data. Similarly to low-pass filtering of linear Fourier data, only using low frequencies in the image recovery process results in blurred images lacking sharp features such as clear organ boundaries. Convolutional Neural Networks provide a powerful framework for post-processing such convolved direct reconstructions. In this study, we demonstrate that these CNN techniques lead to sharp and reliable reconstructions even for the highly nonlinear inverse problem of EIT. The network is trained on data sets of simulated examples and then applied to experimental data without the need to perform an additional transfer training. Results are presented on experimental EIT data from the ACT4 and KIT4 EIT systems. Index Terms—electrical impedance tomography, D-bar methods, deep learning, conductivity imaging I. I NTRODUCTION LECTRICAL IMPEDANCE TOMOGRAPHY (EIT) images traditionally display the tissue-dependent conductivity distribution of a patient in the plane of the attached measurement electrodes allowing, e.g., visualization of heart and lung function as well as injuries [1]–[6]. The resulting images are of high-contrast and data acquisition is done by harmless electrical measurements without the need for contrast agents or ionizing radiation. However, the image recovery process of forming the EIT image from the current/voltage measurement data is a severely ill-posed nonlinear inverse problem, and thus requires a noise-robust regularization strategy for stability. The ‘D-bar method’, the only proven regularization strategy for the full nonlinear problem [7], provides real-time noise-robust image recovery by using a low-pass filter of the associated nonlinear Fourier data. Unfortunately, this results in images that suffer a loss of sharp features often important in medical imaging applications. In this work, we propose combining Dbar with Deep Learning, specifically with a Convolutional Neural Network, to ‘learn’ and undo the image blurring resulting in real-time sharp EIT images. EIT reconstructions are typically computed with iterative algorithms that are based on minimizing a penalty functional, such as [8], [9]. These methods perform very well in reconstruction quality due to a flexibility of incorporating prior E S. J. Hamilton is with the Department of Mathematics, Statistics, and Computer Science, Marquette University, Milwaukee, WI, 53233 USA (email: [email protected]). A. Hauptmann is with the Department of Computer Science; University College London, London, United Kingdom, (email: [email protected]) knowledge, but require careful modeling of the boundary shape in the repeated simulation of the forward problem. Possibilities to overcome the boundary sensitivity are proposed in [10], [11], but tend to be computationally demanding. On the other hand, direct (non-iterative) reconstruction algorithms do not need the simulation of the forward operator. One such method is known as the D-bar algorithm which is based on a nonlinear Fourier transformation of the measured surface current/voltage data. The method employs a low-pass filtering of this transformed data as a regularization strategy to stabilize the image reconstruction process against noise in the measured data. This filtering results in reconstructed images that suffer from a significant loss of sharpness, but unlike other modalities (such as CT) the D-bar method does not suffer from undersampling artefacts. Furthermore, unlike iterative methods, the direct D-bar method is robust to incorrect or incomplete knowledge of electrode locations as well as errors in boundary shape [12], therefore removing the need for meticulously specific forward models that make or break most EIT methods for absolute EIT imaging. Recent advances in the larger field of image reconstruction have demonstrated the power of Deep Learning and Neural Networks for improving low quality or corrupted images. In particular, combining fast direct reconstruction procedures with deep neural networks can provide high quality images with low latency, leading to prospective real-time imaging in many applications. Convolutional Neural Networks (CNN) are especially suitable for post-processing initial reconstructions that come from algorithms based on, or related to, Fourier transforms, as suggested in [13]. Such initial reconstructions typically suffer from a loss of spatial resolution, due to some sort of low-pass filtering, as well as additional undersampling artefacts. Training a CNN to remove these artefacts to improve the information content of the reconstructed image has been studied for several linear inverse problems in medical imaging, including CT [13], [14], MRI [15], and PAT [16], [17]. Although the EIT problem is nonlinear in nature, the low-pass filtered images from the low-passed D-bar method naturally fit into this setting. In this study we formulate a real-time capable reconstruction algorithm that produces high quality sharp EIT images by combining the D-bar algorithm with subsequent processing by a CNN. For this task we utilize an established CNN architecture, known as U-net, adjusted to cope with the typical image structures of D-bar EIT reconstructions. We train the network on simulated training data and directly apply the trained network to experimental data with no training on experimental data itself. This successful transition to experimental 2 data underlines the robustness of the D-bar algorithm and is especially important as the need for good training data is often the bottleneck for the success of such network-based approaches for other imaging modalities, [13], [17], [18]. This paper is organized as follows. Section II presents a brief review of the mathematical problem of EIT and the Dbar solution method. The deep learning CNN for D-bar, coined ‘Deep D-bar’ is introduced in Section III. The experimental setup as well as simulation of training data are described in Section IV and results presented in Section V. A discussion of the results is given in Section VI and conclusions drawn in Section VII. The reader is encouraged to view the manuscript on a computer screen as details in the image contrast may be masked in printed versions. II. E LECTRICAL I MPEDANCE T OMOGRAPHY AND THE D- BAR RECONSTRUCTION METHOD Electrical impedance tomography is a nonlinear inverse problem in which we aim to determine the interior conductivity from current-to-voltage measurements at the boundary. The problem can be formulated as a generalized Laplace equation  ∇ · σ∇u = 0 in Ω, (1) σ ∂ν u = ϕ on ∂Ω, modeling the electrical potential u inside the domain Ω ⊂ Rn for a given conductivity σ, with the Neumann boundary condition describing the boundary voltage occurring from the applied mean-free current ϕ. The measurement data consists of pairs of current and voltage measurements and is modeled by the current-to-voltage map Rσ defined by Rσ ϕ := u|∂Ω . conductivity σ is then recovered directly from the solution to the D-bar equation. The D-bar approach [20] is to transform the physical conductivity equation ∇ · σ∇u = 0 into a nonphysical Schrödinger equation, solve that problem instead using the D-bar methods popularized by Beals and Coifman [21], and then transform back to the physical setting. The change of variables ũ = σ 1/2 u and q(z) = σ −1/2 (z)∆σ 1/2 (z) produces the desired Schrödinger equation [−∆ + q(z)]ũ(z) = 0, where z ∈ Ω. Provided that σ(z) is constant in a neighborhood of the boundary, without loss of generality σ = 1 near ∂Ω, the conductivity can be extended from Ω to the entire plane by setting σ(z) ≡ 1 for z ∈ C \Ω. Note that this gives the potential q(z) compact support in Ω. We make use of special solutions ψ(z, k) to the Schrödinger equation z ∈ C, k ∈ C \{0}, [−∆ + q(z)]ψ(z, k) = 0, (2) called Complex Geometrical Optics (CGO) solutions, that have a specific asymptotic behavior for large |z| or |k|, ψ(z, k) ∼ eikz . Note that we associate R2 with C via the mapping z = (z1 , z2 ) 7→ z1 + iz2 and thus kz = (k1 + ik2 ) (z1 + iz2 ) denotes complex multiplication. The CGO solutions µ(z, k) = e−ikz ψ(z, k) ∼ 1 solve a D-bar equation in the nonphysical scattering variable k ∂ k µ(z, k) = 1 t(k)e(z, −k)µ(z, k), 4π k̄ (3) where e(z, k) := exp{i(kz + k̄z̄)} and t(k) is the nonlinear scattering data defined by This measurement operator is also known as the Neumannto-Dirichlet (ND) map, and knowledge of it allows one to predict the resulting voltage for any injected current pattern for n = 2, 3. In practice, an approximation to the ND map is formed by applying a basis of current patterns and tracking the responses of the voltages. The D-bar algorithm we use below requires the corresponding Dirichlet-to-Neumann (DN) map, which can be obtained as the inverse of the ND map, −1 Λσ = (Rσ ) , for full (vs. partial) boundary data. In this work we consider the n = 2 case as the D-bar reconstruction framework is further developed in 2D. However, we expect a natural extension to 3D [19]. Note that this scattering data t can be thought of as nonlinear Fourier data by the following observation. Replacing the CGO solutions µ(z, k) in (4) with the asymptotic behavior 1 yields A. Real-time reconstructions using an approximate D-bar method and thus the ‘Born’ approximation texp is essentially a shifted Fourier transform of the potential q. A connection to the measurement data Λσ can be established via Alessandrini’s identity [22] By the D-bar method, we refer to the regularized D-bar method [7] based on the theoretical proof given in [20]. The approach uses a nonlinear Fourier transform, called a scattering transform, tailor-made for the EIT problem which is applied to the measured current/voltage data in the form of the DN map Λσ . That scattering data is then used as input data into a partial differential equation, a ∂ k or ‘D-bar’ equation, giving the method its name. Note that the derivative operators ∂ z and ∂ z are defined as ∂ z = 21 (∂z1 − i∂z2 ) and ∂ z = 12 (∂z1 + i∂z2 ), where z = z1 + iz2 ∈ C. The Z t(k) := e(z, k)q(z)µ(z, k) dz. (4) C Z texp (k) = e(z, k)q(z)(1) dz = q̂(−2k1 , 2k2 ), C Z texp (k) = Z e(z, k)q(z)dz = C eik̄z̄ (Λσ − Λ1 )eikz dz. ∂Ω In this work we use this ‘Born’ approximation texp to the scattering data, first presented in [23], as it allows the D-bar method to solve the EIT problem fast enough to be considered ‘real-time’ [24] and is robust against noisy data. The main steps in the algorithm are outlined below: 3 σ exp = =σ e ReLU(conv5×5 ) maxpool2×2 ReLU(convt5×5 ) ReLU(conv1×1 ) concat Fig. 1. Deep D-bar network structure. The input is given by the D-bar reconstruction σ exp with a resolution of 64 × 64 and the output is denoted by σ e. The numbers on top of the blue bars denote the channels for each layer. The resolution for each multilevel decomposition is shown in gray on the left. Each convolutional layer is equipped with a Rectified Linear Unit as nonlinearity, given by ReLU(x) = max(0, x). 1 2 Current/Voltage Data Scattering Data Conductivity −→ −→ (Λσ , Λ1 ) texp (k) σ(z) Step 1: For each k ∈ C \{0}, evaluate the approximate scattering data exp t (k) = (R ∂Ω 0 eik̄z̄ (Λσ − Λ1 ) eikz dS(z), 0 < |k| ≤ R |k| > R. (5) Step 2: For each z ∈ Ω, solve the D-bar equation (3) using the integral equation µexp (z, κ) = 1 + 1 4π 2 Z C texp (k)e(z, −k) exp µ (z, k) dκ1 dκ2 , (κ − k)k̄ (6) and recover the approximate conductivity 2 σ exp (z) = [µexp (z, 0)] . (7) III. D EEP D- BAR The aim of this study is to formulate a real-time reconstruction algorithm for electrical impedance tomography that produces sharp and robust images. To achieve this we combine the D-bar algorithm, described in Section II-A, with a convolutional neural network (CNN). This idea relies on a network architecture known as U-Net [25], originally developed for image segmentation. It has been shown for several linear inverse problems [13]–[17] that this particular network structure can be modified to successfully remove artefacts in medical image reconstructions. The basic recipe is to use a fast and simple reconstruction algorithm to obtain corrupted images and then train the network to remove those artefacts. A related study for electrical impedance tomography is [26], where the authors used artificial neural networks to postprocess initial reconstructions from one step of a linear GaussNewton algorithm. This approach is fundamentally different, since it requires the simulation of a forward model. The network architecture we have chosen relies on the established U-Net [25], which consists of a multilevel decomposition and several skip connections to avoid singularities in the training procedure, see Figure 1 for an illustration of our specific architecture. The output of our network is the sharpened image, since the main goal is to identify organ boundaries and deconvolve the reconstruction, similar to the original purpose of U-Net for image segmentation. This is in contrast to the studies in [13]–[17], where the authors learn a residual update to the initial reconstruction. As an additional modification to the original architecture we needed to increase the convolutional filter size to 5 × 5 (compared to 3 × 3), presumably to deal with the nonlinearity of the reconstructions and enforce consistency of the reconstructions. A. Training of the network Given the true conductivity σ, we simulate measurement data, as will be described in Section IV-A, and reconstruct the approximate conductivity σ exp with the D-bar method outlined in II-A. Since the reconstruction step (6) in the Dbar algorithm can be done for any z ∈ R2 we reconstruct σ exp on the square [−1, 1]2 to obtain a square image as input to the network. The resolution is chosen to be 64 × 64. The ground truth σ is similarly extended to [−1, 1]2 by extending the background conductivity. Having obtained the training set {σi , σiexp }i , we train the Deep D-bar network, denoted by Dθ , for the set of network parameters θ, i.e. the convolutional filters and biases in each convolutional layer. Given the output of the network 4 HLSA H EALTHY I NJURY 1 σ e = Dθ (σ ) we seek to minimize the ` -error of network output to phantom, given by the loss exp 2 loss(e σ ) := ke σ − σk22 . The network is implemented with the Python library TensorFlow and the optimization is performed for 60 epochs in batches of 16, with TensorFlow’s implementation of the Adam algorithm and an initial learning rate of 10−4 . The training procedure takes 4 hours on a single Titan XP GPU with 12GB memory. As we will discuss in the following section, we do not need to perform a transfer training to apply the trained Deep D-bar network to experimental data, the training on simulated data proved to be sufficient. I NJURY 2 I NJURY 3 IV. E XPERIMENTAL S ETUP AND C OMPUTATIONAL N OTES We will demonstrate the new Deep D-bar method using experimental data from two different EIT machines: ACT4 [27], [28] from Rensselaer Polytechnic Institute (RPI) as well as KIT4 [29] from the University of Eastern Finland (UEF). The ACT4 data uses agar (4%) based targets with added graphite (10%) to simulate a heart, two lungs, an aorta, and a spine. All images are shown in DICOM orientation, meaning that the right lung corresponds to the viewer’s left, as if we are looking up through the patient’s feet. Injuries were simulated in the right (DICOM) lung away from the heart by removing a portion of the lung and (1) replacing the missing portion with a piece of agar/graphite with the same conductivity as the heart to simulate an injury such as a pleural effusion, (2) placing three plastic tubes in the missing region to simulate an area of very low conductivity such as a pneumothorax, and (3) replacing the missing portion with three metal tubes. The experiments are shown in Figure 2. The approximate conductivities of the targets are displayed in Table I. The admittivity spectrum of the agar/graphite targets were measured on testcells with Impedimed’s SFB-7 bioimpedance meter1 . Note that the ACT4 system applies voltages and measures currents rather than vice-versa. In these experiments, trigonometric voltage patterns of maximum amplitude 0.5V (and frequency 3kHz) were applied on a circular tank (radius 15cm), with 32 electrodes (width 2.5cm), filled with saline (0.3 S/m) to a height of 2.25cm. When reconstructing the conductivity via the D-bar method described in Section II-A, a change of basis was performed on the measured ACT4 currents and voltages to synthesize the voltages that would have occurred if 1mA maximum amplitude trigonometric current patterns had been applied. Fig. 2. Experimental Setups for test phantoms taken on the ACT4 system from RPI. Agar/graphite targets were used to simulate a chest phantom with a heart, two lungs, aorta, and spine. The first image shows the healthy phantom. Three injuries are explored: ‘Injury 1’, replaced the cut portion of the right lung with agar/graphite of the same conductivity as the heart target to simulate a potential pleural effusion, ‘Injury 2’, replaced the cut portion of the right lung replaced with three plastic tubes, and‘Injury 3’, replaced the cut portion with three copper tubes. The KIT4 data was taken on a circular tank of radius 14cm with 16 electrodes of width 2.5cm and tap water with conductivity 0.03 S/m filled to a height of 7cm. Conductive (metal) and resistive (plastic) targets were placed in the tank, as shown in Figure 3, and adjacent current patterns with amplitude 2mA were applied. P HANTOM 1.1 P HANTOM 2.2 P HANTOM 3.4 P HANTOM 4.4 TABLE I C ONDUCTIVITY VALUES FOR ACT4 TARGETS AT 3 K H Z H EART /AORTA L UNGS /S PINE S ALINE BACKGROUND I NJURY 1: AGAR /G RAPHITE I NJURY 2: P LASTIC T UBES I NJURY 3: C OPPER T UBES M EASURED VALUES (S/m) 0.67781 0.056714 0.3 0.67781 0 infinite S IMULATED VALUES Ranges (S/m) [0.5, 0.8] [0.01, 0.2] [0.29, 0.31] [0.01, 1.5] [0.01, 1.5] [0.01, 1.5] 1 https://www.impedimed.com/products/sfb7-for-body-composition/ Fig. 3. Experimental Setups with conductive and resistive targets on the KIT4 EIT system from UEF. The white objects are made of solid plastic and are resistive. The hollow circular objects are conductive metal rings. 5 A. Simulation of 2D EIT data The boundary conditions of (1) assume a continuum model for the boundary measurements, completely ignoring discrete positioning of the electrodes. When simulating the training data, we use a modified version of the continuum model, called the continuum electrode model introduced in [30], which was developed to simulate realistic electrode data in a continuum setting. In essence, the continuum current/voltage traces are optimally projected onto subsets of the boundary corresponding to the electrode locations. The training could be done with a more complicated electrode model, such as the Complete Electrode Model (CEM) [31], however our simplified continuum electrode model proved sufficient for this proof of concept study. We aim to represent the ND map as matrix approximation Rσ with respect to an orthonormal basis on the boundary. Let L be an even number of electrodes, then the basis functions are chosen for n ∈ {−L/2, · · · − 1, 1, . . . , L/2} as ( √1 sin(nθ) if n < 0, π ϕn (θ) = √1 cos(nθ) if n > 0. π The ACT4 system uses L = 32 electrodes and the KIT4 system uses L = 16. The measured voltages are then projected to a continuum trace gn , see [30], [32], and we obtain the ND matrix Rσ by evaluating inner products in L2 (∂Ω) as follows Z (Rσ )n,` = (gn , ϕ` ) = gn (s)ϕ` (s)ds. (8) ∂Ω for each included target by generating a random number from a uniform distribution in the ranges shown in Table I, last column. A total of 2048 such simulations were made. Elementary injuries were simulated by generating a horizontal dividing line in the lung and assigning randomly generated values in each of the two portions of the divided lung from the uniform distribution of values in [0.01, 1.5]. Each lung had an independent chance of such an injury (60%). More complex injuries could be simulated but are outside the scope of this study. An additional 2048 of such simulations were performed for this approach and combined with the 2048 above giving a total of 4096 phantoms for the ACT4 training. ACT 4 T RUE & A PPROXIMATE B OUNDARIES HLSA H EALTHY T RUE VS . N OISY B OUNDARIES N OISY B OUNDARIES WITH I NJURIES 0.55 1.2 0.5 The matrix approximation of the DN map, Lσ , is then formed −1 by inverting the ND matrix, i.e. Lσ = (Rσ ) . If the radius r of the domain is not 1, the DN matrix can be scaled by r to correspond to the data that would be obtained if the radius were 1. Similarly, if σ = σ0 6= 1 near ∂Ω, the DN matrix is scaled by σ10 to produce the DN matrix that would correspond to σ = 1 near the boundary. If an estimate for σ0 is not available, the best constant conductivity approximation to the data can be formed as described in [23]. The scaling is undone at the end of the D-bar algorithm by multiplying the conductivity by σ0 . 0.45 1 0.4 0.8 0.35 0.3 0.6 0.25 0.2 0.4 0.15 0.2 0.1 Fig. 4. Depiction of the simulation of the training data for the ACT4 experiments of Figure 2. The first image shows the healthy phantom from which the ‘true boundary’ (black dots) and ‘approximate boundary’ (red stars) were extracted, shown in the second image. The third and fourth images display sample simulated phantoms using in the training data with and without injuries with the true boundaries overlaid in black dots. B. Simulation of Training Data Training data for the neural network was created using solely simulated data: one group for the ACT4 data and another group for the KIT4 data. The ACT4 training data was created as follows. Using the ‘HLSA Healthy’ image, shown in Figure 2 (top left), approximate organ boundaries were extracted by clicking around the targets in the image for the heart, aorta, left lung, right lung, and spine (Fig. 2, top right). Random numbers were generated to decide whether each individual target was included, heart (95%), aorta (95%), left lung (90%), right lung (90%), spine (100%). If a given target was included, white Gaussian noise (25db) was added to the approximate boundary points of the target using the awgn command in M ATLAB to create ‘noisy’ boundary locations. Figure 4 shows the effect of the white noise on the boundary locations. Noise was added to each target/organ independently. Conductivities were assigned After each conductivity phantom was constructed, the mathematical forward problem (1) was solved to recover the corresponding theoretical boundary voltages and currents using a FEM mesh with 65,536 triangular elements using the continuum electrode model described in Section IV-A. Relative white noise with variance of 10−4 was added to the measured voltages. The resulting simulated voltages/currents were used to solve the inverse problem using the D-bar method described in Section II-A with a low-pass filtering radius of R = 4.5 in the scattering domain using the procedure outlined in [33] and uniformly spaced 64 × 64 k and z-grids on [−4.5, 4.5]2 with stepsize hk = 0.3234, and [−1, 1]2 with stepsize hz = 0.0317, respectively. A non-uniform cutoff threshold was enforced on the scattering data for frequencies such that texp (k) = 0 if either |<(texp (k)| or |=(texp (k)| exceeds 24. Then, the 4096 pairs of data in the form of ‘Truth’ and ‘Low-pass D-bar 6 Reconstruction’ were used to train the convolutional neural network described in Section III. Training data for the KIT4 experiments was simulated in a similar manner. In this case, one to three circular inclusions of varying radii drawn from the uniform distribution on [0.2, 0.4] were simulated. Inclusions were not allowed to overlap and each inclusion had an equal probability of being ‘conductive’ or ‘resistive’, and values were assigned from the Uniform distributions [0.05,0.12] and [0.005,0.015] in S/m, respectively. The conductivity of the background drawn from [0.027, 0.033] S/m. The conductivity ranges for the inclusions were determined from initial higher-pass (larger filtering radius in the scattering domain) D-bar reconstructions of the KIT4 current/voltage data. While we note that the infinite (metal) conductors should have much higher conductivities, this range was observed in the initial testing and proved sufficient for classifying objects as conductors/resistors in our study. Note that such infinite conductors/resistors violate the theory of Dbar which requires inclusions to have non-negative conductivities bounded away from zero and infinity. Nevertheless, the method provides useful conductor/resistor information. The same k and z grids were used in the D-bar reconstructions of the KIT4 example as in the ACT4 example. However, we reduced the non-uniform cutoff threshold of the scattering data from 24 to 8 to reduce oscillatory artefacts that can result from noise in the scattering data for higher frequencies. Figure 5 shows sample phantoms used in the training data for the KIT4 example. A total of 4096 simulations were performed and pairs of ‘Truth’ vs. ‘Low-pass D-bar Reconstruction’ used to train the network. KIT 4 S AMPLE P HANTOMS Using the approach introduced in [23], the (m, n) entry of the ND matrix Rσ was formed as the discrete inner product Rσ (m, n) = L X φm v n ` ` |e` | `=1 , 1 ≤ m, n ≤ L − 1 1≤`≤L (9) where φm denotes the m-th normalized current pattern, v n the voltage resulting from applying the m-th current pattern (normalized such that the voltages sum to zero and are scaled by the `2 norms of the applied current patterns), and |e` | denotes the area of the `-th electrode. This formula holds for a system with L electrodes where L − 1 linearly independent current patterns have been applied. The discrete DN matrix Lσ was then formed by Lσ = −1 (Rσ ) and scaled by σr0 as described above. As the scattering data texp (5) requires the difference in DN matrices (Lσ − L1 ), the discrete DN matrices L1 must be formed for both the ACT4 and KIT4 system with L = 32 and L = 16 electrodes, respectively. To this end, the conductivity equation in (1) was solved with boundary conditions given by the Complete Electrode Model [31] on a FEM mesh with 3,493 triangular elements simulating injected trigonometric current patterns of amplitude 1mA and non-optimized constant contact impedances of 0.00024. The scattering data texp (5) was evaluated as a simple Simpson’s rule approximation  h i  2π ik̄z T e φ [Lσ − L1 ] eψ (k) 0 < |k| ≤ R exp t (k) ≈ L 0 |k| > R where z is the vector of the positions of the centers of the electrodes, T denotes the traditional matrix transpose, and eψ` (k) := L X aj (k)φj` ≈ eikz` ` is the expansion of the asymptotic behavior ψ ∼ eikz at the center of the `-th electrode, z` , in the basis of normalized applied current patterns φ. Then, the d-bar equation (6) can be solved using Fast Fourier Transforms using Vainikko’s method [34]. The interested reader is referred to [33] for further details. Fig. 5. Depiction of the simulation of the training data for the KIT4 experiments of Figure 3. The images shown are sample simulations of inclusions present in the training data. Zero to three, non-overlapping, circular inclusions were allowed in each simulation. V. R ESULTS We now demonstrate the effect of the Deep D-bar method on simulated as well as experimental data. A. Reconstructions from Simulated Data C. Computational Notes for D-bar Reconstructions from Experimental EIT Data The D-bar reconstructions from the experimental ACT4 and KIT4 data were computed in the same manner as the simulated data case described above in Section IV-B with the exception of the formation of the DN matrices Lσ and L1 , which now come from discrete vs. continuous measurements. For convenience, for both the ACT4 and KIT4 data, we synthesized the current/voltage measurements that would have occurred if trigonometric current patterns of amplitude 1mA had been applied by using a change of basis. We begin with purely simulated data for the ACT4 and KIT4 examples. For the ACT4 setting, we consider three scenarios, as shown in Figure 6: one consistent with the training data but not used in the training (top), and two examples violating the training data - one with horizontally divided regions in the left lung (middle) and the final with a vertical division in the left lung (bottom). Note that the ‘Low-pass D-bar’ and ‘Deep D-bar’ images are shown on the same scale for visual comparison. The complete ‘input’ and ‘output’ of the CNN are on the unit square [−1, 1]2 . Reconstructions here are clipped to the disc for visualization purposes only. Next, Figure 7 shows 7 the results of the new algorithm on simulated data for the KIT4 example. Three scenarios consistent with the training data, but not used in the training, are presented. L OW- PASS D- BAR I MAGE D EEP D- BAR I MAGE 0.1 0.08 S IM 1 P HANTOM L OW- PASS D- BAR I MAGE P HANTOM D EEP D- BAR I MAGE 0.06 0.04 0.02 0.6 0.4 0.1 0.2 0.08 S IM 2 S IM 1 0.8 0.06 0.04 0.8 S IM 2 0.02 0.6 0.035 0.4 0.03 0.2 S IM 3 0.025 0.02 0.015 2.5 0.01 1.5 0 Fig. 6. Results for simulated test data from the ACT4 geometry. The phantom in the first row conforms with the training data and the phantoms in the second and third row include pathologies not supported by the training data. The initial D-bar image is compared to the Deep D-bar image. The D-bar images, on the full square are used as the ‘input’ images for the CNN. Images are displayed here on the circular geometry of the tank, for presentation only. Each row is plotted on its own scale. Structural Similarity Indices (SSIMs) were computed for the ACT4 and KIT4 examples, shown in Figures 8 and 9, respectively. Additionally, we evaluated the minimized `2 -loss by computing the mean relative error for a test set of 16 samples drawn from the same distribution as the training data. The For the ACT4 simulations we improved from 28.05% to 9.92% and for the KIT4 test data from 16.82% to 9.12% relative `2 -error. B. Reconstructions from Experimental Data Now we proceed to the reconstructions from experimental data. Figure 10 depicts the results of the Deep D-bar approach on four experiments with ACT4 data: H EALTHY and I NJURIES 1-3 as shown in Figure 2. The black dots represent the approximate boundaries of the ‘healthy’ organs, extracted from the photograph. SSIMs (Figure 11) were computed for the experimental reconstructions with the exception of I NJURY 3, which has the infinite conductors (copper tubes). The SSIM comparisons used approximate ‘truth’ images formed by assigning the measured conductivity values (Table I) in the respective regions. Lastly, Figure 12 shows results of the method on the four KIT4 scenarios shown in Figure 3. The overlaid black dots depict the approximate ‘true’ locations of the targets as SSIM C OMPARISON FOR ACT4 S IM . R ECONS D-bar Deep D-bar ‘S IM 1’ 0.5 Fig. 7. Results for simulated test data from the KIT4 geometry. All phantom are drawn from the same distribution as the training data. The initial D-bar image is compared to the Deep D-bar image. The D-bar images, on the full square are used as the ‘input’ images for the CNN. Images are displayed here on the circular geometry of the tank, for presentation only. Each row is plotted on its own scale. ‘S IM 2’ 1 ‘S IM 3’ S IM 3 2 0 0.2 0.4 0.6 0.8 1 SSIM Fig. 8. SSIM measurements are compared for the D-bar method and the new ‘Deep D-bar’ method for the ACT4 reconstructions for the simulated data shown in Figure 6. extracted from their corresponding photographs. No SSIMs were computed here since the objects are infinite conductors and resistors. VI. D ISCUSSION The reconstructions shown in Figures 6, 7, 10, and 12 demonstrate that Deep D-bar provides superior reconstructions giving both visual and quantitative improvements. In partic- 8 SSIM C OMPARISON FOR KIT4 S IM . R ECONS E XPERIMENT L OW PASS D- BAR I MAGE D EEP D- BAR I MAGE ‘S IM 1’ D-bar Deep D-bar 0.7 ‘S IM 2’ H EALTHY 0.6 0.5 0.4 0.3 0.2 0.1 ‘S IM 3’ 0.7 0.8 0.85 0.9 0.95 1 I NJURY 1 0.6 0.5 0.4 0.3 0.2 SSIM 0.1 Fig. 9. SSIM measurements are compared for the D-bar method and the new ‘Deep D-bar’ method for the KIT4 reconstructions for the simulated data shown in Figure 7. 0.8 0.7 0.5 0.4 0.3 0.2 0.1 0.8 0.7 0.6 I NJURY 3 ular, the SSIMs (Figs. 8, 9, and 11 show significant SSIM increases for the Deep D-bar vs. Low-pass D-bar. Note that for the SSIM computation for ACT4 Injury 2 (plastic tubes), the ‘truth’ image was unrealistically set to zero in the lower portion of the right lung, even though the tubes do not entirely fill that region. We remind the reader that no experimental (truth, reconstruction) pairs were used in training the network and no adaptation to the experimental system was necessary, apart from the number of electrodes in the system. The training was done purely with simulated data. In most applications, either a transfer training [17] or training with a golden standard from the same system must be performed. This demonstrates the robustness of our approach. Additionally, we expect further improvements in the ACT4 reconstructions if more complicated injuries are included in the training and remind the reader that the Low-pass D-bar and Deep D-bar reconstructions are shown on the same scale, which does mask the true dynamic range of the Low-pass D-bar images. We review additional simplifications used in our process: 1) we used the continuum electrode model for the boundary conditions in the training data, 2) the FEM solver used to form L1 for the ACT4 and KIT4 experimental data examples was not finely tuned to either EIT device (which is required for iterative minimization-based methods), and 3) the D-bar solver was not optimized for the respective ACT4/KIT4 data. Rather it was used merely to provide the low-pass reconstructions used as inputs in the CNN. These simplifications were used to demonstrate the robustness of the approach to both noise in the data and tolerance to modeling errors at multiple stages of the reconstruction process. Furthermore, evaluation of the CNN is highly efficient on a GPU and takes in average 7.65ms for a single sample, hence we expect Deep D-bar to be real-time capable. This can be done by combining the D-bar reconstruction, as outlined in [24], with the application of the CNN in a unified framework I NJURY 2 0.6 0.5 0.4 0.3 0.2 0.1 Fig. 10. ACT4 Results for the various test scenarios: Healthy, Injuries 1-3 corresponding to conductive agar, plastic tubes, and conductive copper tubes, respectively. The initial D-bar image is compared to the Deep D-bar image. The D-bar images, on the full square are used as the ‘input’ images for the CNN. Images are displayed here on the circular geometry of the tank, for presentation only. Each row is plotted on its own scale. to reduce overhead due to data transmission.2 An important aspect for medical imaging is the robustness and consistency of reconstructions. The successful transition to experimental data suggests that the proposed Deep Dbar method is robust to changes in the system. Furthermore, Figures 6 and 10 illustrate that the network can handle reconstructions of phantoms that do not conform with the training data. Additionally the robustness of obtaining the reconstructions as input to the network is crucial, here we point out that the D-bar algorithm is known to be robust with respect to perturbations of electrode positions or domain shapes [12]. VII. C ONCLUSION The D-bar method for 2D EIT provides reliable reconstructions of the conductivity but suffers from a blurring due to a low-pass filtering of the scattering data. Sharp improvements in image quality can be achieved by coupling the D-bar reconstruction method with a convolutional neural 2A simplified version of our codes will be published at a later point. 9 SSIM C OMPARISON FOR ACT4 R ECONS E XPERIMENT L OW PASS D- BAR I MAGE D EEP D- BAR I MAGE H EALTHY P HANTOM 1.1 D-bar Deep D-bar 0.03 0.025 0.02 I NJURY 1 0.015 I NJURY 2 P HANTOM 2.2 0.03 0 0.1 0.2 0.3 0.4 SSIM 0.5 0.6 0.7 0.8 0.025 0.02 0.015 0.01 P HANTOM 3.4 0.07 Fig. 11. SSIM measurements are compared for the D-bar method and the new ‘Deep D-bar’ method for the ACT4 experimental data reconstructions shown in Figure 10. Note that meaningful SSIMs could not be computed for ‘Injury 3’ due to the copper inclusions which have infinite conductivity. 0.06 0.05 0.04 ACKNOWLEDGMENTS We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan Xp GPU used for this research. The authors would like to thank the Isaac Newton Institute for Mathematical Sciences, Cambridge, for support and hospitality during the programme ’Variational methods and effective algorithms for imaging and vision’ where work on this paper was undertaken, EPSRC grant no EP/K032208/1. AH acknowledges support from EPSRC project EP/M020533/1, ’Medical image computing for next-generation healthcare technology’. We additionally thank the EIT group at RPI [https://www.ecse.rpi.edu/homepages/saulnier/eit/eit.html] for their assistance and for providing the ACT4 tank data. R EFERENCES [1] Gilda Cinnella, Salvatore Grasso, Pasquale Raimondo, Davide D’Antini, Lucia Mirabella, Michela Rauseo, and Michele Dambrosio. Physiological effects of the open lung approach in patients with early, mild, diffuse acute respiratory distress syndromean electrical impedance tomography study. The Journal of the American Society of Anesthesiologists, 123(5):1113–1121, 2015. [2] C.A. Grant, T. Pham, J. Hough, T. Riedel, C. Stocker, and A. Schibler. Measurement of ventilation and cardiac related impedance changes with electrical impedance tomography. Critical Care, 15(1):R37, 2011. P HANTOM 4.4 0.03 network. We demonstrated that a CNN can effectively learn the deblurring using only simulated data and still transition to experimental data without including any experimental data in the training itself. As the training can be done offline ahead of time, and the D-bar method provides real-time conductivity reconstructions [24], the post-processing step by the trained CNN adds minimal time to the overall image recovery process, due to the highly efficient evaluation on a GPU. While this work is shown in 2D, we expect the approach to extend to 3D once the D-bar computational framework has been further developed. 0.05 0.04 0.03 0.02 0.01 Fig. 12. KIT4 Results for the various phantoms with conductive and/or resistive targets, as shown in the first column. The initial D-bar image is compared to the Deep D-bar image. The D-bar images, on the full square are used as the ‘input’ images for the CNN. Images are displayed here on the circular geometry of the tank, for presentation only. Each row is plotted on its own scale. [3] Christian Karagiannidis, Andreas D. Waldmann, Carlos Ferrando Ortolá, Manuel Muñoz Martinez, Anxela Vidal, Arnoldo Santos, Peter L. Róka, Manuel Perez Márquez, Stephan H. Bohm, and Fernando SuarezSpimann. Position-dependent distribution of ventilation measured with electrical impedance tomography. European Respiratory Journal, 46(suppl 59), 2015. [4] Antonio Pesenti, Guido Musch, Daniel Lichtenstein, Francesco Mojoli, Marcelo B. P. Amato, Gilda Cinnella, Luciano Gattinoni, and Michael Quintel. Imaging in acute respiratory distress syndrome. Intensive Care Medicine, 42(5):686–698, 2016. [5] H. Reinius, J. B. Borges, F. Fredén, L. Jideus, E. D. L. B. Camargo, M. B. P. Amato, G. Hedenstierna, Larsson A., and F. Lennmyr. Realtime ventilation and perfusion distributions by electrical impedance tomography during one-lung ventilation with capnothorax. Acta Anaesthesiologica Scandinavica, 59(3):354–368, 2015. [6] A. Schlibler, T.M.Y. Pham, A.A. Moray, and C. Stocker. Ventilation and cardiac related impedance changes in children undergoing corrective open heart surgery. Physiological Measurement, 34:1319–1327, 2013. [7] K. Knudsen, M. Lassas, J.L. Mueller, and S. Siltanen. Regularized Dbar method for the inverse conductivity problem. Inverse Problems and Imaging, 3(4):599–624, 2009. [8] Zhou Zhou, Gustavo Sato dos Santos, Thomas Dowrick, James Avery, Zhaolin Sun, Hui Xu, and David S Holder. Comparison of total variation algorithms for electrical impedance tomography. Physiological measurement, 36(6):1193, 2015. [9] Gerardo González, Ville Kolehmainen, and Aku Seppänen. Isotropic 10 [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] and anisotropic total variation regularization in electrical impedance tomography. Computers & Mathematics with Applications, 2017. Jérémi Dardé, N Hyvönen, A Seppänen, and Stratos Staboulis. Simultaneous reconstruction of outer boundary shape and admittivity distribution in electrical impedance tomography. SIAM Journal on Imaging Sciences, 6(1):176–198, 2013. A. Nissinen, V. Kolehmainen, and J. P. Kaipio. Compensation of modelling errors due to unknown domain boundary in electrical impedance tomography. IEEE Transaction on Medical Imaging, 30(2):231–242, 2011. E. K. Murphy and J. L. Mueller. Effect of domain-shape modeling and measurement errors on the 2-d D-bar method for electrical impedance tomography. IEEE Transactions on Medical Imaging, 28(10):1576– 1584, 2009. Kyong Hwan Jin, Michael T McCann, Emmanuel Froustey, and Michael Unser. Deep convolutional neural network for inverse problems in imaging. IEEE Transactions on Image Processing, 26(9):4509–4522, 2017. Eunhee Kang, Junhong Min, and Jong Chul Ye. A deep convolutional neural network using directional wavelets for low-dose x-ray ct reconstruction. Medical Physics, 44(10), 2017. Christopher M Sandino, Neerav Dixit, Joseph Y Cheng, and Shreyas S Vasanawala. Deep convolutional neural networks for accelerated dynamic magnetic resonance imaging. preprint. Stephan Antholzer, Markus Haltmeier, and Johannes Schwab. Deep learning for photoacoustic tomography from sparse data. arXiv preprint arXiv:1704.04587, 2017. Andreas Hauptmann, Felix Lucka, Marta Betcke, Nam Huynh, Ben Cox, Paul Beard, Sebastien Ourselin, and Simon Arridge. Model based learning for accelerated, limited-view 3d photoacoustic tomography. arXiv preprint arXiv:1708.09832, 2017. Jonas Adler and Ozan Öktem. Solving ill-posed inverse problems using iterative deep neural networks. arXiv preprint arXiv:1704.04058, 2017. Fabrice Delbary, Per Christian Hansen, and Kim Knudsen. Electrical impedance tomography: 3d reconstructions using scattering transforms. Applicable Analysis, 91(4):737–755, 2012. A. I. Nachman. Global uniqueness for a two-dimensional inverse boundary value problem. Annals of Mathematics, 143:71–96, 1996. Richard Beals and Ronald R. Coifman. Multidimensional inverse scatterings and nonlinear partial differential equations. In Pseudodifferential operators and applications (Notre Dame, Ind., 1984), pages 45–70. Amer. Math. Soc., Providence, RI, 1985. G. Alessandrini. Stable determination of conductivity by boundary measurements. Applicable Analysis, 27:153–172, 1988. D. Isaacson, J. L. Mueller, J. C. Newell, and S. Siltanen. Reconstructions of chest phantoms by the D-bar method for electrical impedance tomography. IEEE Transactions on Medical Imaging, 23:821–828, 2004. Melody Dodd and Jennifer L Mueller. A real-time D-bar algorithm for 2-D electrical impedance tomography data. Inverse problems and imaging, 8(4):1013–1031, 2014. Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 234–241. Springer, 2015. Sébastien Martin and Charles TM Choi. A post-processing method for three-dimensional electrical impedance tomography. Scientific Reports, 7, 2017. N. Liu, G.J. Saulnier, J.C. Newell, D. Isaacson, and T-J. Kao. Act4: a high-precision, multi-frequency electrical impedance tomograph. Presented at 6th Conference on Biomedical Applications of Electrical Impedance Tomography, June 2005. London, U.K. G. Saulnier, N. Liu, C. P. Tamma, H. Xia, T.-J. Kao, J. Newell, and D. Isaacson. An electrical impedance spectroscopy system for breast cancer detection. Proc. 29th Int. Conf. IEEE Eng. Med. Biol. Soc, (1):4154–4157, Aug. 2007. Andreas Hauptmann, Ville Kolehmainen, Nguyet Minh Mach, Tuomo Savolainen, Aku Seppänen, and Samuli Siltanen. Open 2d Electrical Impedance Tomography data archive. arXiv:1704.01178, 2017. Andreas Hauptmann. Approximation of full-boundary data from partialboundary electrode measurements. Inverse Problems (accepted), arXiv preprint arXiv:1703.05550, 2017. Erkki Somersalo, Margaret Cheney, and David Isaacson. Existence and uniqueness for electrode models for electric current computed tomography. SIAM Journal on Applied Mathematics, 52(4):1023–1040, 1992. [32] N. Hyvönen. Approximating idealized boundary data of electric impedance tomography by electrode measurements. Mathematical Models and Methods in Applied Sciences, 19(07):1185–1202, 2009. [33] J. Mueller and S. Siltanen. Linear and Nonlinear Inverse Problems with Practical Applications, volume 10 of Computational Science and Engineering. SIAM, 2012. [34] Gennadi Vainikko. Fast solvers of the Lippmann-Schwinger equation. In Direct and inverse problems of mathematical physics (Newark, DE, 1997), volume 5 of Int. Soc. Anal. Appl. Comput., pages 423–440. Kluwer Acad. Publ., Dordrecht, 2000.
9cs.NE
1 Model-Robust Counterfactual Prediction Method arXiv:1705.07019v4 [math.ST] 7 Feb 2018 Dave Zachariah and Petre Stoica Abstract—We develop a method for assessing counterfactual predictions with multiple groups. It is tuning-free and operational in high-dimensional covariate scenarios, with a runtime that scales linearly in the number of datapoints. The computational efficiency is leveraged to produce valid confidence intervals using the conformal prediction approach. The method is model-robust in that it enables inferences from observational data even when the data model is misspecified. The approach is illustrated using both real and synthetic datasets. Index Terms—counterfactuals, causal inference, conformal prediction I. I NTRODUCTION In many casual inference problems, the subject or unit of analysis belongs to a group, indexed by z, and is associated with a continuous outcome (or response) y. For instance, groups z ∈ {0, 1} may correspond to ‘not receiving’ or ’receiving’ medication. The inferential question is then typically posed in counterfactual terms: “What would the outcome have been, had the unit belonged to a different group ze 6= z?” The ability to address this question using observational data is relevant in a wide variety of fields, including clinical trials, epidemiology, econometrics, policy evaluation, etc. [1] Each unit is typically associated with a range of covariates (or features), collected in a vector x, which may affect its outcome and/or group selection. When x contains all variables that simultaneously affect both y and z, it is possible to provide causal interpretations from observed data. The onus is on the researcher to include such potentially confounding variables [2]. Under this standard condition, the dependencies between group, outcome and covariates can be encoded by a graph as in Figure 1 along with an associated joint distribution p(x, y, z). x z x y z z̃ y(z̃) Fig. 1: Dependency graphs, where • and  represent random and deterministic variables, respectively. Left: Observed outcome. Right: Counterfactual outcome when assigning group z̃. The counterfactual question above can now be directly translated into predicting the counterfactual (or potential) E-mail: [email protected]. This work has been partly supported by the Swedish Research Council (VR) under contracts 621-2014-5874 and 2016-06079 outcome, y(z̃), had the unit been set to z̃, thus overriding the covariate-dependency of the group assignment [3]– [8]. The resulting dependencies for y(z̃) can also be encoded in a graph shown in Figure 1 with an associated joint distribution p(x, y(z̃), z) [1], [9]. Since it follows that p(y(z̃)|x) = p(y|x, z = z̃), the counterfactual outcome y(z̃) can be predicted by the conditional mean   µz̃ (x) , E y | x, z = z̃ . This target quantity can be learned using observed data from n units:  D = (x1 , y1 , z1 ), . . . , (xn , yn , zn ) , assuming that the units are drawn independently from the data generating process p(x, y, z) and that there is an overlap of covariates in all groups p(z|x) > 0 [10]. In most prior works, the targeted quantity has been the difference between means, that is,     E y(1) | x − E y(0) | x = µ1 (x) − µ0 (x), (1) but after averaging out the covariates x, cf. [2], [11].1 Many methods that estimate this target quantity, model either the outcome of each group or the group selection mechanism as functions of x. Much effort has been made to formulate modelrobust methods as well as extending them to the case of highdimensional x so as to include more potential confounders, cf. [12]–[15]. For the counterfactual question above, it is however more relevant to compare the covariate-specific predictions directly, rather than averaging them over x, cf. [16]–[18]. This is the focus of several methods based on fitting flexible predictive models from statistical machine learning, such as decision trees [19], [20] and deep neural networks [21]. One limitation of targeting the difference between predictions is that the dispersions of the counterfactual outcomes are omitted. While correctly inferring that, say, µ1 (x) < µ0 (x), it may still be the case that y(1) frequently exceeds the value of y(0). Such considerations are important in applications where different groups involve differential risks. Then reporting the difference (1) alone omits valuable information. The dispersion of outcomes around the prediction µz̃ (x) can be quantified by a prediction interval Cz̃ (x) in a straightforward manner if the variance function Var[y|x, z = z̃] were known. Since both mean and variance functions are unknown, the challenge here is to provide model-robust predictions and intervals. We develop a counterfactual prediction method with the following key features: 1 Eq. (1) is often called ‘conditional average treatment effect’ (CATE) and ’average treatment effect’ (ATE) after marginalizing out x. 2 C1,β (x) z=1 C0,β (x) z=0 y Fig. 2: Prediction intervals for outcome y given x, in groups z = 0 and z = 1, respectively. Point predictions are illustrated as circles and denoted µ b0 (x) and µ b1 (x). it produces prediction intervals that are statistically valid, even under model misspecification and with finite number of samples n, • it takes into account the outcome dispersions in each group, and therefore targets a different level of inferences than the difference of averages in (1), • it is operational even in the undersampled case, that is, when the number of covariates in x exceeds n, • it performs variable selection within each group by pruning out covariates in x that have no effect on the outcome, • it does not require cross-validation or other tuning techniques and is computationally efficient. The method builds upon results in the conformal prediction literature [22] and online sparse learning [23]. Notation: k · k1 and k · k2 denote the ℓ1 and ℓ2 -norms, respectively. ⊙ denotes the element-wise Hadamard product. The cardinality of a set D is |D|. The operator col{x1 , . . . , xk } stacks all elements into a single column vector and [X]j selects the jth column of matrix X. Remark: Code for the proposed method available at https://github.com/dzachariah/counterfactual. • II. C OUNTERFACTUAL PREDICTIONS Consider a unit with covariates x and let C0,β (x) denote a finite interval that covers the outcome y ∈ C0,β (x) when z = 0, with a probability of at least β. We define C1,β (x) in a similar manner for group z = 1. See Figure 2 for an illustration. Based on the standard dependency assumptions considered in the previous section, we will assess the counterfactual effect of group z̃ on units with covariates x, by comparing the prediction intervals. The above reasoning is readily generalized into a framework with multiple groups z ∈ {0, . . . , K − 1}. Using a subset of the observed data,  Dz̃ = (xi , yi ) , where (xi , yi ) ∼ p( x, y | z = z̃ ), our aim is to obtain a point prediction µ bz̃ (x) and an interval Cz̃,β (x) with valid coverage properties, even when lacking a correctly specified model of the data generating process p(x, y, z). This provides a model-robust means of evaluating the effects of the groups that is complementary to evaluating just the differences between predictions. Example: Consider an observational study with K = 3 groups and a scalar covariate x, as illustrated in Fig. 3. Using the method described in the subsequent section, we form µ bz (x) and the corresponding prediction intervals Cz,β (x), for a given x and all groups z ∈ {0, 1, 2}. The plots enable an intuitive assessment of both the size and significance of the effects of each group. Definition II.1. Given x, the predicted outcome for group z̃ 6= z is counterfactually significant if the prediction intervals do not overlap. That is, they are mutually exclusive Cz̃,β (x) ∩ Cz,β (x) = ∅. (2) The prediction is said to have 100β% counterfactual confidence, where β is the largest value for which (2) holds. Note that the definitions are symmetric with respect to all pairs of groups. They take into account the dispersions of each group, unlike measures such as (1). Example, cont’d: In Fig. 3 we see that for a unit with covariate x = −1, the counterfactual confidence group of 1 relative to group 2 is greater than 90%. The confidences for the counterfactual predictions are tabulated pairwise below for covariate x = −1 (left) and x = 2 (right): z̃ 1 2 0 81% 64% 1 – 96% z̃ 1 2 0 24% 45% 1 – 58% It is seen that for x = −1, the inferred effects of z̃ can be asserted with greater confidence than for x = 2. This is corroborated by comparing the datasets shown in Fig. 3. III. C OUNTERFACTUAL PREDICTION METHOD Starting from the perspective of counterfactual predictions outlined above, we now develop a method for obtaining µ bz (x) and Cz,β (x). We begin by considering a regression model class n o Mµ = µ : µ(x) = φ⊤ (x)w, w ∈ Rp , parameterized by w and where φ(x) is a p-dimensional regressor vector discussed in Subsection III-C. When the model class is well-specified it includes the unknown mean function µz (x) ∈ Mµ . A. Learning method To learn a model in Mµ from data Dz , we build upon the convex S PICE-method [23], for which the learned weights are given by b = arg min ky − Φwk2 + kϕ ⊙ wk1 , w (3) w where y is the vector of observed outcomes and Φ is the matrix of regressors with ith row φ⊤ (xi ). The elements of ϕ are given by ( 1 √ k[Φ]j k2 , j > 1 |Dz | ϕj = 0, otherwise. The learning method (3) is globally convergent, tuningparameter free and employs an adaptive regularization that 3 8 gr ou p z y 4 2 2 gr ou p z 2 6 1 1 0 0 −2 −4 −6 −4 −2 0 x 2 4 6 0 −2 −1 0 ou t c om e y 1 2 0 1 2 ou t c om e y 3 Fig. 3: Example of counterfactual predictions with K = 3 groups and scalar covariate x. Left: Datasets Dz for groups z = 0 (◦), 1 (+) and 2 (×). The resulting predictions µ bz (x) along with 90%-intervals Cz,0.90 (x). Center: x = −1. Right: x = 2. mitigates overfitting. The regularization leads to sparse solutions and therefore performs covariate selection with a predictive performance that can be related to the best subset predictor, see [23] for more details. In addition, (3) can be computed sequentially with a runtime that is linear in the number of samples, O(|Dz |p2 ). This computational property is leveraged to produce tractable and model-robust prediction intervals. function µz (x) belongs to the model class Mµ , the interval exhibits asymptotic conditional coverage, that is,  Pr y ∈ Cz,β (x) x, z = β + oP (1), B. Prediction intervals The principle of conformal prediction can be described as follows [22]: For the covariate of interest x, consider a new sample (x, ye) where ye is a variable. Then quantify how well this sample conforms to the observed data Dz via the learned model (3). All points ye that conform well, form a prediction interval. The conformity is quantified by including (x, ye) in the learned model (3), which achieved by a sequential update in O(p2 ). Then, following [24], we define a measure   X  1 b , (4) π(e y) = I ri ≤ |e y − φ⊤ (x)w| 1+ |Dz | + 1 i Note that this does not require a well-specified model class Mµ . In other words, the more accurate the learned regression model, the tighter the prediction interval but its validity remains not matter if the model is correct or not. This confers a robustness property to the proposed inference method in cases when µz (x) 6∈ Mµ . b is the ith fitted residual and I{·} is where ri = |yi −φ⊤ (xi )w| the indicator function. The measure is bounded between 0 and 1, where lower values correspond to higher conformity. We e as construct Cz,β (x) by varying ye over a set of grid points Y, summarized in Algorithm 1. By leveraging the computational properties of the learning method, the prediction interval is e computed with a total runtime of O(|Y|p(p+|D z |)). The range e of Y is set to exceed that of the outcomes in the observed dataset. A point prediction µ bz (x) is obtained as the minimizer of π(e y ). Algorithm 1 : Conformal prediction interval 1: 2: 3: 4: 5: 6: Input: covariate x, target coverage β and data Dz for all ye ∈ Ye do b using (x, ye) Update w Compute {ri } and π(e y ) in (4) end for  Output: Cz,β (x) = ye ∈ Ye : (n + 1)π(e y ) ≤ ⌈β(n + 1)⌉ Despite the fact that no dispersion model of the data generating process is required, the resulting prediction intervals exhibit valid coverage properties. If the unknown mean under certain regularity conditions [24, thm. 6.2]. More generally, Cz,β (x) is calibrated to ensure marginal coverage [24, thm. 2.1]  Pr y ∈ Cz,β (x) z ≥ β. C. Regression models We consider two simple regression models that minimize or eliminate the need for user input. Suppose x contains d covariates, which can be continuous, discrete, or mixed. The default regressor type is a simple linear function: φ(x) = col{ 1, x }. (5) The regressor (5) has dimension p = d + 1. However, by modeling nonlinear effects, one can often obtain tighter prediction intervals. When x contains a smaller number of continuous covariates denoted x′ (and the remaining covariates x′′ are discrete), we suggest a second regressor type n o e (x′ ), . . . , φ e (x′ ), x′′ , φ(x) = col 1, φ (6) 1 1 d0 d0 e (x′ ) denotes an m-dimensional subvector for each where φ j j dimension of x′ . Specifically, we use a basis expansion with excellent approximation properties [25], where the kth term e (x′ ) is given by: of φ j j   πk(x′j − x′j + Lj ) 1 p sin , k = 1, . . . , m, 2Lj Lj where x′j denotes the sample mean and Lj is the maximum deviation from the mean (both are obtained from D). The regressor (6) has dimension p = md0 + d1 + 1, where d0 and d1 denote the number of continuous and discrete covariates, respectively. 4 IV. N UMERICAL EXPERIMENTS In this section we demonstrate the proposed counterfactual prediction approach by means of three examples. In the following examples, we consider K = 2 groups. A. Nonlinear effects To illustrate the use of the nonlinear regression function (6), we consider the example in [19] where the data is generated as follows. For each unit, a group z is assigned with equal probability. Then the covariate x (with d = 1) is drawn as x|(z = 0) ∼ N (40, 102 ) and x|(z = 1) ∼ N (20, 102 ) and the counterfactual outcomes as p y(0)|x ∼ N (72 + 3 |x|, 1) and y(1)|x ∼ N (90 + exp(0.06x), 1). (7) A simulated observational dataset D with n = 120 is illustrated in Fig. 4. To obtain the predictions in the figure, we use m = 8 in (6). For a unit with covariate x = 30, as an example, we note that µ b1 (30) is larger than µ b0 (30) and that both confidence intervals are tight, as is expected by inspecting the data generating process (7) at the given covariate. In addition, the counterfactual confidence is found to be greater than 90%. To illustrate the robustness property of the prediction intervals, we repeat the experiment using 1000 Monte Carlo simulations. For each simulation, we generate new data D and also draw a new unit from both groups. For a unit in group z = 0, the outcome is found to belong to interval C0,β (x) with probability 0.931 when β = 0.90. Similarly, for group z = 1, the outcome is contained in the interval C1,β (x) with probability 0.905. This coverage property holds eventhough the predictions relied on a misspecified model (6). B. High-dimensional covariates The desire to include all potential confounders in the covariate vector x, may lead in many applications to dimensions d that can be larger than n [14]. To address this issue, we simulate an experimental setting with d = 200 covariates but only n = 100 samples. The predictors are learned using a linear regression function, see (5). The groups z = 0 and z = 1 are assigned with probabilities 0.6 and 0.4, respectively. The covariates are drawn as x|(z = 0) ∼ N (0, Σ0 ) and x|(z = 1) ∼ N (0, Σ1 ), where Σ0 and Σ1 are randomly generated covariance matrices with unit trace. The matrices have numerical rank 150 and are constructed using outer products of Gaussian vectors. This generates highly correlated covariates, as is typical in real applications. The counterfactual outcomes are generated as y(0)|x ∼ N (x1 + 5x10 + 5x20 + 0.5, 0.52 ) 2 y(1)|x ∼ N (x1 + x10 − x30 , 0.5 ). and (8) However, this is not a problem for the learning method which automatically prunes away irrelevant covariates due to the adaptive regularization in (3). A simulated observational dataset D is shown in Fig. 5. We also illustrate the predicted outcomes for a unit with all covariates equal to one, x = 1. We observe that µ b0 (1) is considerably larger than µ b1 (1), also when taking into account the prediction intervals. This is consistent with the data generating process (8) evaluated at the fixed x. The interval for group z = 0 is also seen to be significantly wider than that for group z = 1, reflecting the larger uncertainty of the predicted outcome. In this case it is possible to assert counterfactual confidence greater than 90%. We repeat this experiment as well to validate the coverage properties of the intervals, using 1000 Monte Carlo simulations. For each simulation, we generate new data D and also draw a new unit from both groups. For a unit in group z = 0, the outcome is found to be contained in interval C0,β (x) with probability 0.921 when β = 0.90. Similarly, for group z = 1, the outcome is contained in the interval C1,β (x) with probability 0.915. C. Schooling data Following the example in [26], we assess the effect of schooling on income for adults in the US born in the 1930s, using data from [27]. The observed outcome y is the weekly earnings (on a logarithmic scale) of a subject in 1970. Each subject belongs to one of two groups: z = 1 corresponds to receiving 12 years of schooling or more and z = 0 corresponds to receiving less than 12 years. We consider 26 discrete covariates in x. Ten covariates indicate the year of birth 1930-1939, and eight indicate the census region. In addition, eight indicators represent ethnic identification, marital status and whether or not the subject lives in the central city of a metropolitan area. The observational study consists of n = 329 509 samples. (See [26] for details.) Discrete covariates can be partitioned into separate subclasses, and a direct inference approach would be to estimate the average outcomes of groups 0 and 1 for each class. However, the number of classes grows quickly and there are not sufficient samples in the dataset D for each class and group. Therefore we apply the proposed method, using the regression function (5). The predicted effects of schooling on income are illustrated for subjects in different covariate classes in Fig 6. All subjects in these classes were born in the same year and came from the same region. The prediction interval widths are likely to be affected by the very coarse division of schooling used here, since z = 0 includes 0 to 11 years of schooling, which is a substantial variation, while z = 1 includes 12 years and more. The three classes are x1 : Caucasian, unmarried and not in a major city, x2 : Caucasian, married and in a major city, and x3 : African-American, married, and in a major city. Given that the units are logarithmic, the differences of predicted earnings, µ b1 (x) − µ b0 (x), correspond to +52%, +26% and +39% of weekly earnings, for x1 , x2 and x3 , respectively. This means that the inferred effect of schooling is greatest for x1 while considerably less for x2 . The prediction intervals in Fig. 6 suggest, however, that there is a considerable dispersion of the outcome around the predictions. The predicted outcome 5 140 1 g r ou p z y 120 100 0 80 60 −10 0 10 20 30 x 40 50 60 86 70 88 90 92 94 96 o u t c om e y 98 100 Fig. 4: Left: Dataset D with n = 120 samples. Groups z = 0 (◦) and 1 (+). Right: Predictions with 90%-prediction intervals at x = 30. 20 gr ou p z y 10 0 0 −10 −20 −3 1 −2 0 2 4 6 8 10 12 0 1 2 3 ou t c om e y x Fig. 5: Left: Dataset D with n = 100 samples. Only one covariate, x1 , is shown for the sake of two-dimensional visualization. Groups z = 0 (◦) and 1 (+). Right: Predictions with 90%-prediction intervals at x = 1. −2 −1 of schooling has a counterfactual confidence of 33%, 20% and 25% for the three cases. Thus for class x2 , the predicted gains from schooling are not only the lowest but also have the weakest significance. The findings appear to be consistent with features of US society in the 1970s: a Caucasian person in a major city with a family was expected to have greater access to economic opportunities, such that schooling experience mattered less to earnings. For the unmarried counterpart who lived outside of the major city, such alternative opportunities were fewer so that schooling could have a more significant impact. An AfricanAmerican person in a major city with a family represents an intermediate case. V. C ONCLUSIONS We have developed an inference framework for assessing counterfactuals using prediction intervals for multiple groups. The proposed inference method does not require the tuning of any user-parameters, is computationally efficient, and operational even when the number of covariates exceeds the number of samples. Moreover, the method is model-robust in that the prediction intervals are statistically valid, even without a correct specification of the data model. We demonstrated the method using both real and synthetic data. R EFERENCES [1] M. M. Hernán and J. M. Robins, Causal Inference. Chapman & Hall/CRC, 2018. forthcoming. [2] S. L. Morgan and C. Winship, Counterfactuals and causal inference. Cambridge University Press, 2014. [3] J. Neyman, “Sur les applications de la théorie des probabilités aux experiences agricoles: Essai des principes,” Roczniki Nauk Rolniczych, vol. 10, pp. 1–51, 1923. [4] D. B. Rubin, “Estimating causal effects of treatments in randomized and nonrandomized studies.,” Journal of Educational Psychology, vol. 66, no. 5, p. 688, 1974. [5] J. Pearl, Causality. Cambridge University Press, 2009. [6] J. Pearl et al., “Causal inference in statistics: An overview,” Statistics surveys, vol. 3, pp. 96–146, 2009. [7] A. Sjölander, “The language of potential outcomes,” in Causality: Statistical Perspectives and Applications, John Wiley & Sons, 2012. [8] S. Greenland, “Causal inference as a prediction problem: Assumptions, identification and evidence synthesis,” in Causality: Statistical Perspectives and Applications, John Wiley & Sons, 2012. [9] T. S. Richardson and J. M. Robins, “Single world intervention graphs: a primer,” in Second UAI workshop on causal structure learning, Bellevue, Washington, 2013. [10] L. Wasserman, All of Statistics: A Concise Course in Statistical Inference. Springer Texts in Statistics, Springer New York, 2004. [11] G. W. Imbens, “Nonparametric estimation of average treatment effects under exogeneity: A review,” Review of Economics and statistics, vol. 86, no. 1, pp. 4–29, 2004. [12] J. M. Robins and Y. Ritov, “Toward a curse of dimensionality appropriate (coda) asymptotic theory for semi-parametric models,” Statistics in medicine, vol. 16, no. 3, pp. 285–319, 1997. [13] A. Belloni, V. Chernozhukov, and C. Hansen, “Inference on treatment effects after selection among high-dimensional controls,” The Review of Economic Studies, vol. 81, no. 2, pp. 608–650, 2014. 0 1 g r ou p z 1 g r ou p z g r ou p z 6 0 4 4.5 5 5.5 6 ou t c om e y 6.5 7 1 0 4 4.5 5 5.5 6 ou t c om e y 6.5 7 4 4.5 5 5.5 6 ou t c om e y 6.5 7 Fig. 6: Inferred effect of schooling on weekly earnings (in logarithmic units) using 90%-prediction intervals. Left: Caucasian, unmarried and not in major city. Center: Caucasian, married and in city. Right: African-american, married and in city. [14] M. H. Farrell, “Robust inference on average treatment effects with possibly more covariates than observations,” Journal of Econometrics, vol. 189, no. 1, pp. 1–23, 2015. [15] V. Chernozhukov, D. Chetverikov, M. Demirer, E. Duflo, C. Hansen, and W. Newey, “Double/debiased/neyman machine learning of treatment effects,” arXiv preprint arXiv:1701.08687, 2017. [16] P. M. Rothwell, “Can overall results of clinical trials be applied to all patients?,” The Lancet, vol. 345, no. 8965, pp. 1616–1619, 1995. [17] D. M. Kent and R. A. Hayward, “Limitations of applying summary results of clinical trials to individual patients: the need for risk stratification,” Jama, vol. 298, no. 10, pp. 1209–1212, 2007. [18] J. Weiss, F. Kuusisto, K. Boyd, J. Liu, and D. Page, “Machine learning for treatment assignment: Improving individualized risk attribution,” in AMIA Annual Symposium Proceedings, vol. 2015, p. 1306, American Medical Informatics Association, 2015. [19] J. L. Hill, “Bayesian nonparametric modeling for causal inference,” Journal of Computational and Graphical Statistics, vol. 20, no. 1, pp. 217–240, 2011. [20] S. Wager and S. Athey, “Estimation and inference of heterogeneous treatment effects using random forests,” Journal of the American Statistical Association, no. just-accepted, 2017. [21] J. Hartford, G. Lewis, K. Leyton-Brown, and M. Taddy, “Counterfactual prediction with deep instrumental variables networks,” arXiv preprint arXiv:1612.09596, 2016. [22] V. Vovk, A. Gammerman, and G. Shafer, Algorithmic learning in a random world. Springer Science & Business Media, 2005. [23] D. Zachariah, P. Stoica, and T. B. Schön, “Online learning for distribution-free prediction,” arXiv preprint arXiv:1703.05060, 2017. [24] J. Lei, M. G’Sell, A. Rinaldo, R. J. Tibshirani, and L. Wasserman, “Distribution-free predictive inference for regression,” Journal of the American Statistical Association, no. just-accepted, 2017. [25] A. Solin and S. Särkkä, “Hilbert space methods for reduced-rank Gaussian process regression,” 2014. arXiv preprint arXiv:1401.5508. [26] J. Esarey, “Causal inference with observational data,” in Analytics, Policy, and Governance, Yale University Press, 2017. [27] J. D. Angrist and A. B. Krueger, “Does compulsory school attendance affect schooling and earnings?,” The Quarterly Journal of Economics, vol. 106, no. 4, pp. 979–1014, 1991.
10math.ST
Performance Bounds of Concatenated Polar Coding Schemes Dina Goldin and David Burshtein, Senior Member, IEEE Abstract arXiv:1710.08379v1 [cs.IT] 23 Oct 2017 A concatenated coding scheme over binary memoryless symmetric (BMS) channels using a polarization transformation followed by outer sub-codes is analyzed. Achievable error exponents and upper bounds on the error rate are derived. The first bound is obtained using outer codes which are typical linear codes from the ensemble of parity check matrices whose elements are chosen independently and uniformly. As a byproduct of this bound, it determines the required rate split of the total rate to the rates of the outer codes. A lower bound on the error exponent that holds for all BMS channels with a given capacity is then derived. Improved bounds and approximations for finite blocklength codes using channel dispersions (normal approximation), as well as converse and approximate converse results, are also obtained. The bounds are compared to actual simulation results from the literature. For the cases considered, when transmitting over the binary input additive white Gaussian noise channel, there was only a small gap between the normal approximation prediction and the actual error rate of concatenated BCH-polar codes. I. I NTRODUCTION Polar coding, introduced by Arikan [1], is an exciting development in coding theory. Arikan showed that, for a sufficiently large blocklength, polar codes can be used for reliable communications at rates arbitrarily close to the symmetric capacity of an arbitrary binary-input channel. Various decoding algorithms that improve Arikan’s successive cancellation (SC) decoder were shown since then. A notable example is list SC decoding [2] with the possible incorporation of CRC bits. Various architectures have been considered for parallel efficient implementation of SC and list SC decoding with improved throughput, e.g. [3], [4], [5], [6]. Those architectures involve decomposing the overall polar code into an inner code and an outer code, and using SC to decode the inner code and maximum-likelihood (ML) to decode the outer code. Using other outer codes such as powerful algebraic codes with approximated ML decoding is also possible. Interleaved concatenation of inner polar codes with outer Reed-Solomon (RS) and Bose Chaudhuri and Hocquenghem (BCH) outer codes was studied in [7] and [8], respectively, and further studied in [9], that also proposed using convolution outer codes. In this work, we study the interleaved concatenated scheme of polar codes with good outer codes [7], [8], [9]. This scheme is described in Fig. 1. The encoding is performed from right to left as follows. First, we use 2λ outer codes with rates Ri , i = 0, . . . , 2λ − 1, to encode the information bits, creating 2λ codewords, each of length N1 . The resulting codewords are interleaved and processed by N1 polar encoders of length 2λ as shown in Fig. 1. We obtain a code with blocklength N = N1 ·2λ P2λ −1 and rate R = i=0 Ri /2λ . The decoding can also be described using Fig. 1. However it is performed from left to right. As described in [9], the first information bit of each of the N1 polar codes is decoded in parallel, using a soft-decision algorithm that produces log-likelihood ratio (LLR) values. These LLRs are used as the input of the decoder of the code A0 , and the decisions of that decoder are This research was supported by the Israel Science Foundation, grant no. 1082/13. D. Goldin is with the school of Electrical Engineering, Tel-Aviv University, tel-aviv 6997801, Israel (email: [email protected]). D. Burshtein is with the school of Electrical Engineering, Tel-Aviv University, tel-aviv 6997801, Israel (email: [email protected]). This material in this paper was presented in part in ISIT 2017. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 2 2λ .. . P0 .. . 2λ .. . P1 .. . .. . A0 .. . .. . 2λ .. . PN1 −1 .. . .. . A2λ −1 Fig. 1. Concatenation of N1 polar codes of length 2λ with 2λ outer codes of length N1 passed back to the polar decoders, and used in calculating the LLR of the second information bit of each polar code. These LLRs are then used as the input of the decoder of A1 , etc. In general, when the LLRs of the i-th information bits of the N1 polar codes are calculated, the previous i − 1 information bits of these codes are available from decoding A0 , A1 , . . . , Ai−2 . We described this coding scheme as a combination of block SC decoding and optimal (ML), or non-optimal decoding of sub-codes with blocklength N1 in [10]. If the outer codes are polar as well, this is the scheme proposed in [4] for efficient parallel decoding of polar codes. If the outer codes are Reed-Solomon, BCH or convolutional codes, this is the scheme studied in [7], [8], [9]. Note that unlike standard polar codes, in the concatenated polar coding scheme there are no frozen bits, unless Ri = 0, when the whole block Ai is frozen. We also note that a close to ML, computationally efficient decoding of short outer codes can be realized using various algorithms such as the ordered statistics decoder (OSD) [11], the box-and-match decoder [12], used in [8], or the recent machine learning-based schemes presented in [13], [14], [15], [16] and references therein, that may be efficient for small blocklength codes (especially when using hardware implementations). The decoder of the concatenated coding scheme may possess an improved throughput compared to list SC decoding of polar codes, provided the outer codes can be decoded efficiently. In this work we analyze the performance of the concatenated polar coding scheme. Our main interest is in the case where λ is small (e.g., λ = 1, 2, 3), and the blocklength of each outer code, N1 , is also relatively small (e.g., of order 100) such that the OSD algorithm or the other methods mentioned above, can be used to decode the outer codes with a reasonable computational effort. As a motivating example, suppose we need to design an error correcting code with blocklength which is about N = 256, and rate which is about 1/2. As will be described in detail later in the paper, in order to closely approach the error rate of the best code under these conditions, as predicted by the normal approximation in [17], one may apply the OSD algorithm to a BCH code with blocklength 255 and rate R = 131/255 ≈ 1/2. However, the resulting computational complexity would be prohibitive for actual, real time, low cost and low power applications. Alternatively, as will be shown in Section V, one may construct a BCH-polar concatenated scheme with λ = 1 and N1 = 128. The total blocklength is N = 256, and the total rate is R = 1/2. The first outer code is a BCH code with rate R1 = 36/128. The second outer code is a BCH code with rate R2 = 92/128 (these rates were determined from our analysis in Section IV). In order to decode the scheme, SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 3 one needs to apply the OSD algorithm twice, first to the lower rate code, and then to the higher rate code. As Fig. 7 shows, the computational complexity of the decoder of the first scheme (BCH with blocklength 255) is larger by about three orders of magnitude compared to the BCH-polar concatenated scheme. On the other hand, as Fig. 6 shows, the resulting performance degradation, when using the BCH-polar concatenated code, for frame error rate of 10−3 , is only about 0.6dB in the signal to noise ratio. Fig. 6 also shows that our prediction to the performance of the BCH-polar concatenated scheme is very accurate. In Section II we provide some brief background on polar codes, and fix the notations. In Section III we obtain achievable error exponents and upper bounds on the error rate for the concatenated polar coding scheme. Our first lower bound on the error exponent (upper bound on the error rate) can be achieved using outer codes which are typical linear codes from the ensemble of parity check matrices whose elements are chosen independently and uniformly (i.e., they are set to {0, 1} with probabilities {1/2, 1/2}). As a byproduct of this bound, we determine the required rate split of the total rate to the rates of the outer codes. We then obtain a lower bound on the error exponent that holds for all binary memoryless symmetric (BMS) channels with capacity I. In Section IV we derive improved bounds and approximations using channel dispersions (normal approximation) for finite blocklength codes. We also derive converse and approximated converse results. In Section V we compare our bounds to actual simulation results. For the cases considered, when transmitting over the binary input additive white Gaussian noise channel (BIAWGNC), there was only a small gap between the normal approximation prediction and the actual error rate of concatenated BCH-polar codes. Section VI concludes the paper. II. BACKGROUND ON P OLAR C ODES Consider a BMS W : X → Y with input alphabet X = {0, 1} and output alphabet1 Y. The capacity of the channel, I(W ), is2 ∆ I(W ) = XX x∈X y∈Y 0.5W (y | x) log P W (y | x) . 0.5W (y | x0 ) x0 ∈X Channel polarization [1] is based on mapping two identical copies of the channel W into the pair of BMS channels W − : X → Y 2 and W + : X → X × Y 2 defined as W − (y1 , y2 | u1 ) = X u2 ∈X 0.5W (y1 | u1 ⊕ u2 ) W (y2 | u1 ) W + (y1 , y2 , u1 | u2 ) = 0.5W (y1 | u1 ⊕ u2 ) W (y2 | u2 ) ∗ W and W + = W ~ W Recalling that the channels W + and W − can be defined using density evolution operators, W − = W     −1 [18], [19], and applying [20, Theorem 4.141], yields I 2 (W ) ≤ I (W − ) ≤ 1 − h2 2h−1 2 [1 − I(W )] · 1 − h2 [1 − I(W )] + − with h2 (x) = −x log x−(1−x) log(1−x), and h−1 2 is the inverse of h2 with values in [0, 0.5]. In addition, I(W )+I(W ) = ∆ 2I(W ) [20, Lemma 4.41]. This means I (W + ) − I(W ) = I(W ) − I (W − ) ∈ [l (I(W )) , h (I(W ))], where h (x) = x − x2    −1 and l (x) = x − 1 + h2 h−1 2 (1 − x) 2 − 2h2 (1 − x) . This procedure can now be reapplied to W − and W + , creating W −− , W −+ , W +− and W ++ . Repeating the procedure λ times we obtain 2λ BMS sub-channels, whose average capacity is I(W ). It was shown [1] that these channels are polarized, i.e. for all δ ∈ (0, 1) n lim |{s ∈ {+, −} : I (W s ) ∈ (0, δ)}| /2λ = 1 − I(W ) λ→∞ 1 The 2 The assumption that the channel is discrete is made for notational convenience only. For continuous output channels, sums should be replaced by integrals. default basis of logarithms in this paper is 2 SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 4 n lim |{s ∈ {+, −} : I (W s ) ∈ (1 − δ, 1)}| /2λ = I(W ) λ→∞ Those 2λ sub channels, denoted W0 , W1 , . . . , W2λ −1 , are the channels that the outer codes in the scheme described in Fig. 1 see. Each outer code Ai sees the channel Wi , and is designed to operate over this channel. III. B OUNDS ON THE ERROR EXPONENT Consider the concatenated, polarization based code that was described above. The blocklength of the code is N and it uses outer sub-codes with blocklength N1 . The number of polarization steps is λ = log(N/N1 ). We derive a lower bound on the error exponent (upper bound on the error rate) of the scheme by choosing the elements of the generating matrices of the linear sub-codes, Ai , uniformly at random, as described in [21, Section 6.2]. We can obtain an upper bound on the average error probability of the ensemble of codes that we have just defined, Pe , using the successive decoding method outlined in Section I, when transmitting over a given BMS channel, W (y|x), as follows. We first compute the distributions (given that the zero codeword was transmitted) of the LLRs of the sub-channels after λ polarization steps, using density evolution (DE) for polar codes as in [18], [19]. Denote these distributions by aWi (x), i = 0, 1, . . . , 2λ − 1. By [21, Sections 5.6 and 6.2], when using successive cancellation to decode the polar concatenated scheme described in Fig. 1, Pe ≤ λ 2X −1 e−N1 Er (Wi ,Ri ) i=0 where Wi is the ith sub-channel, Ri is the rate of the corresponding outer sub-code, and Er (W, R) is the error exponent, given by3   max 0≤ρ≤1 E0 (W, ρ) − ρR· ln 2 R 6= 0 Er (W, R) =  ∞ R=0 (1) where E0 (W, ρ) = − ln X h i1+ρ 1 1 0.5 W (y|0) 1+ρ + W (y|1) 1+ρ y = (1 + ρ) ln 2 − ln i1+ρ Xh 1 1 aW (l) 1+ρ + aW (−l) 1+ρ l The second equality follows by modifying the original channel as in [20, Lemma 4.35]: We add a processing block that computes the LLR from the original channel output. The new channel is also a BMS, and is operationally equivalent to the original channel. According to [21, Chapter 5.7], for low rates the average error probability is different from the typical error probability, since poor codes in the ensemble, although quite improbable, have a very high error probability. Using the expurgated error exponent provides a tighter estimate of the error probability of good codes than the random-coding exponent. This improved bound is [21, Theorem 5.7.1]. It asserts that the average error probability of the ensemble of typical codes with rate R is upper   bounded by exp −N Eex W, R + N2 , where Eex (W, R) = sup Ex (W, ρ) − ρR · ln 2 ρ≥1 3 By [21, Section 5.6] Er (W, R) = max0≤ρ≤1 E0 (W, ρ) − ρR, where the rate R is defined using natural logarithms, and measured in nats per channel use [21, Paragraph after Equation (5.1.2)]. In order to use the more widespread notation, by which R is the number of bits per channel use, we substitute R with R ln 2. In order to further improve the bound on Pe , we define Er (W, 0) = ∞ instead of the actual error exponent, since there cannot be errors if no information bits were transmitted. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 5 and  1 + Ex (W, ρ) = −ρ ln  P p y W (y | 0)W (y | 1)  ρ1    2 ! ρ1   Xp = −ρ ln 1 + aW (l)aW (−l)  + ρ ln 2 l Therefore, in our polar concatenated scheme, we obtain the following upper bound on Pe , the ensemble average error probability when using only typical outer codes, Pe ≤ λ 2X −1 e−N1 E(Wi ,Ri ,N1 ) (2) i=0 where E (W, R, N1 ) = max [Er (W, R), Eex (W, R + 2/N1 )] This construction is called expurgated random code. Define also E(W, R) , lim E (W, R, N1 ) = max [Er (W, R), Eex (W, R)] (3) N1 →∞ For the binary symmetric channel (BSC), the true error exponent of a typical linear code with rate R, transmitted over W , is E(W, R) [22]. It is conjectured to be the true exponent for other BMS channels as well. By (2), the error exponent, Eλ (W, R), of the polarization-based code of blocklength N with λ polarization steps followed by 2λ typical random linear codes of blocklength N1 = N/2λ , with the best rate split, is lower bounded by, and conjectured to be equal to, 1 max min E (Wi , Ri ) 2λ R0 ,...,R2λ −1 i,Ri 6=0 where the maximization is over all possible combinations of rates R0 , . . . , R2λ −1 with total code rate R. In [10] we calculated this error exponent by searching for those values of Ri for which E(Wi , Ri ) are equal. We now present an improved approach that yields an explicit recursive expression for Eλ (W, R) and produces the maximizing rates as a byproduct. Denote the minimal value of the right hand side (RHS) of (2) by exp {−N Eλ (W, R, N1 )} such that (s.t.) 1 Eλ (W, R, N1 ) = N1 · 2λ max R0 ,...,R2λ −1 − ln λ 2X −1 e−N1 E(Wi ,Ri ,N1 ) (4) i=0 where the maximization is over all possible combinations of rates, R0 , . . . , R2λ −1 , s.t. P2λ −1 i=0 Ri = 2λ · R, and for all i, Ri · N1 is an integer. Lemma 1: Define  A , x|x ∈ [max(0, 2R − 1), min(1, 2R)], x · N1 2λ−1 ∈ Z For any positive integers, λ, N1 and RN1 2λ ,    λ−1 − λ−1 + Eλ (W, R, N1 ) = max − ln e−N1 2 Eλ−1 (W ,R1 ,N1 ) + e−N1 2 Eλ−1 (W ,2R−R1 ,N1 ) / N1 2λ R1 ∈A (5) where E0 (W, R, N1 ) = E (W, R, N1 ). Proof: For λ = 1 the claim follows immediately from (4) for λ = 1. The condition R1 ∈ [max(0, 2R − 1), min(1, 2R)] follows from R1 , 2R − R1 ∈ [0, 1]. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 6 For λ > 1, note that Wi are sub-channels of W − for i = 0, . . . , 2λ−1 − 1, and sub-channels of W + for i = 2λ−1 , . . . , 2λ − 1. (4) can be rewritten as 1 Eλ (W, R, N1 ) = max N1 2λ R0 ∈A − ln max R0 ...R2λ −1 P2λ−1 −1 i=0 P2λ −1 i=2λ−1 Ri =R0 ·2λ−1 λ 2X −1 e−N1 E(Wi ,Ri ,N1 ) i=0 Ri =(2R−R0 )·2λ−1  2λ−1 X−1 = 1  max − ln  min R0 ,...,R2λ−1 −1 N1 2λ R0 ∈A = λ−1 − 0 λ−1 + 0 1 max − ln e−N1 ·2 Eλ−1 (W ,R ,N1 ) + e−N1 ·2 Eλ−1 (W ,2R−R ,N1 ) λ 0 N1 2 R ∈A P Ri =R0 ·2λ−1 e−N1 E(Wi ,Ri ,N1 ) + i=0 λ 2X −1 min R2λ−1 ,...,R2λ −1 P Ri =(2R−R0 )·2λ−1  i=2λ−1   e−N1 E(Wi ,Ri ,N1 )   where the first equality follows from rewriting (4), the second one follows from splitting the inner maximization into two separate ones and inserting them into the monotonic decreasing function − ln(), and the third equality follows from applying (4) for λ − 1 instead of λ. We conjecture that the condition R1 ∈ [max(0, 2R − 1), min(1, 2R)] in (5) can be replaced by R1 ∈ [max(0, 2R − 1), R]. This is due to the fact that, compared to W − , W + is a better channel. Hence the information rate of the sub-code corresponding to W + should be larger than the rate of the sub-code corresponding to W − . Denote B , [max(0, 2R − 1), min(1, 2R)] Lemma 2: Define E0 (W, R) = E(W, R) (defined in (3)), and for λ ≥ 1 define recursively, Eλ (W, R) = 0.5 max Em,λ (W, R, R1 ) (6)   Em,λ (W, R, R1 ) , min[Eλ−1 W − , R1 , Eλ−1 W + , 2R − R1 ] (7) R1 ∈B where Then for λ ≥ 0,  Eλ (W, R) − Θ 1 N1  ≤ Eλ (W, R, N1 ) ≤ Eλ (W, R) The bound shows that for large N1 , Eλ (W, R, N1 ) approaches Eλ (W, R). Proof: We prove by induction that Eλ (W, R, N1 ) ≤ Eλ (W, R), with Eλ (W, R) defined recursively in (6). This claim is true for λ = 0 since E0 (W, R, N1 ) = E (W, R, N1 ) = max [Er (W, R), Eex (W, R + 2/N1 )] ≤ max [Er (W, R), Eex (W, R)] = E(W, R) = E0 (W, R) where the inequality is due to the fact that Eex (W, R) is a decreasing function of R. For shortness of notation, define    Em,λ (W, R, R1 , N1 ) , min Eλ−1 W − , R1 , N1 , Eλ−1 W + , 2R − R1 , N1 Assuming the claim is true for λ − 1, we have Eλ (W, R, N1 ) ≤   λ−1 1 max − ln e−N1 ·2 Em,λ (W,R,R1 ,N1 )] λ N1 2 R1 ∈A SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 7 = 0.5 max Em,λ (W, R, R1 , N1 ) ≤ 0.5 max Em,λ (W, R, R1 ) R1 ∈A R1 ∈A ≤ 0.5 max Em,λ (W, R, R1 ) = Eλ (W, R) R1 ∈B where the first inequality follows from (5), and the induction assumption yields the second inequality.   Similarly, we can prove that Eλ (W, R) − Θ N11 ≤ Eλ (W, R, N1 ) using induction: The claim is true for λ = 0 since   2 ∂Eex (W, r) 1 Eex (W, R + 2/N1 ) ≥ Eex (W, R) − = Eex (W, R) − Θ N1 ∂r N1 r=R where the inequality follows from the fact that Eex (W, R) is a convex and decreasing function of R. This yields E0 (W, R, N1 ) = max [Er (W, R), Eex (W, R + 2/N1 )]     1 1 = E0 (W, R) − Θ ≥ max [Er (W, R), Eex (W, R)] − Θ N1 N1 Assuming that the claim is true for λ − 1, we have Eλ (W, R, N1 )   1 −N1 ·2λ−1 Em,λ (W,R,R1 ,N1 ) max − ln 2e ≥ N1 2λ R1 ∈A  = 0.5 max Em,λ (W, R, R1 , N1 ) − ln 2/ N1 2λ R1 ∈A ≥ 0.5 max Em,λ (W, R, R1 ) − Θ (1/N1 ) (8) R1 ∈A where the first inequality follows from (5), and the second follows from the induction assumption. Define R̂1 , argmax Em,λ (W, R, R1 ) R1 ∈B − + Since Eλ−1 (W , R1 ) and Eλ−1 (W , 2R − R1 ) are convex functions of R1 (see Lemma 3 below, Appendix A and Fig. 10),    Em,λ (W, R, R1 ) = min Eλ−1 W − , R1 , Eλ−1 W + , 2R − R1    ∂Eλ−1 (W − ,r )   Eλ−1 W − , R̂1 − (R1 − R̂1 ) R1 > R̂1  ∂r r=Rˆ1 ≥   ∂Eλ−1 (W + ,2R−r )   (R1 − R̂1 ) R1 < R̂1  Eλ−1 W + , 2R − R̂1 + ∂r r=Rˆ1 = 2Eλ (W, R) −     ∂Eλ−1 (W − ,r ) ∂r    ∂Eλ−1 (W + ,2R−r ) ∂r r=Rˆ1 (R1 − R̂1 ) r=Rˆ1 R1 > R̂1 (R̂1 − R1 ) R1 < R̂1 Maximizing this expression over R1 ∈ [max(0, 2R − 1), min(1, 2R)] s.t. R1 · N1 2λ−1 ∈ Z yields a result for R1 − R̂1 =       Θ N1 21λ−1 = Θ N11 . Therefore, the result of the maximization is 2Eλ (W, R) − Θ N11 . Combining this with (8) yields   Eλ (W, R, N1 ) ≥ Eλ (W, R) − Θ N11 . Lemma 3: For any integer λ ≥ 0, and any BMS W , Eλ (W, R) is a finite, decreasing and convex function of R for R > 0. Furthermore, for R > 0, |∂Eλ (W, R)/∂R| < ∞. We prove the lemma in Appendix A. In Fig. 2 we plot the resulting error exponent Eλ (W, R) for a code with rate R = 1/2 and λ = 1, 2, 3 as a function of the SNR when transmitting over a BIAWGNC. This is compared to a naive approach where we simply use 2λ codewords of a code with blocklength N1 = N/2λ (without using the polar transformation at all). Denote the error exponent of the polar-based (naive, respectively) approach by Eλ and En,λ . We also plot the error exponent of an optimal code, E, corresponding to λ = 0. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 8 10 0 10 -1 ERROR EXP 10 -2 10 -3 10 -4 optimal =1, polar =2, polar =3, polar =1, naive =2, naive =3, naive 10 -5 10 -6 0 1 2 3 4 5 6 7 8 9 10 SNR[dB] Fig. 2. Error exponents of codes created by λ polar transforms followed by 2λ codewords of outer codes with blocklength N/2λ and optimal rate-splitting, and naively using 2λ codewords of a code with blocklength N/2λ . The channel is BIAWGNC, and the total rate is 1/2. Note that En,λ = E/2λ . As expected, polarization is useful, i.e. Eλ ≥ En,λ . All the plots in Fig. 2 have an asymptote at the SNR corresponding to the capacity C = R = 1/2, which equals 0.19dB, since for this SNR, E, Eλ and En,λ approach zero. This explains why in all the discussed codes, the gap to the optimal error exponent plot is small for low SNR. Although as the channel capacity increases (as in the case of high SNR), polarization is less effective (because for high capacity, the polarization gap, I(W + ) − I(W ) = I(W ) − I(W − ), approaches zero, and therefore polarization has almost no affect on the channel), En,λ /Eλ 9 1 for high SNR. This is due to the fact, that for expurgated ensembles limSN R→∞ E(W, R) = ∞, so En,λ and Eλ approach infinity for high SNR. It should be noted, that for the random coding ensemble limSN R→∞ Er (W, R) = ln 2(1 − R), so if we have not considered expurgated ensembles (i.e., ensembles with typical outer codes only), we would have obtained En,λ /Eλ → 1 for high SNR. It should also be noted that the error exponent improvement increases with λ, i.e, for a desired error exponent, the SNR improvement by applying λ polarization steps, compared to the naive approach, increases with λ. For example, for desired error exponent of 0.01, the SNR gain for λ = 1, 2, 3 is 0.2dB, 0.5dB and 0.95dB respectively. Fig. 2 demonstrates that polarization improves the error exponent compared to the naive approach. In the following we provide some partial theoretical justification. Define Er,λ (W, R) the same way as Eλ (W, R) in Lemma 2, except that Er,0 (W, R) = Er (W, R). That is, we only consider a random coding (non-expurgated) error exponent analysis. Similarly, define En,r,λ (W, R) , Er (W, R)/2λ . Using the results in [23], we claim that under certain conditions, Er,λ (W, R) ≥ En,r,λ (W, R). We demonstrate this for the case λ = 1, although the argument may be extended to larger values of λ. The combination of   2E0 (W, ρ) ≤ E0 W + , ρ + E0 W − , ρ [23] and (1) yields that for R 6= 0 and all R1 :    2Er (W, R) = max 2 [E0 (W, ρ) − ρR ln 2] ≤ max E0 (W + , ρ) − ρR1 ln 2 + E0 W − , ρ − ρ (2R − R1 ) ln 2 ρ∈[0,1] ρ∈[0,1]       ≤ max E0 W + , ρ − ρR1 ln 2 + max E0 W − , ρ − ρ (2R − R1 ) ln 2 ρ∈[0,1] ρ∈[0,1] = Er W − , R1 + Er W + , 2R − R1   (9) SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 9 This is true in particular for R1 = R̂1 , defined by    R̂1 , argmax min Er W − , R1 , Er W + , 2R − R1 R1 ∈B − Now, Er (W , R1 ) is decreasing in R1 , and Er (W + , 2R − R1 ) is increasing in R1 . If the following condition (which parallels (25) in Appendix A)   E (W − , 0+ ) ≥ E (W + , 2R) r r  Er (W − , 2R) ≤ Er (W + , 0+ ) (10) holds (where for any W and R > 1 we define Er (W, R) ≡ 0), then Er (W − , R1 ) and Er (W + , 2R − R1 ) intersect at R̂1 (see Fig. 10 in Appendix A with Er (W − , r) replaced by Eλ−1 (W − , r) and Er (W + , 2R − r) replaced by Eλ−1 (W + , 2R − r)). In this case        Er W − , R̂1 + Er W + , 2R − R̂1 = 2 max min Er W − , R1 , Er W + , 2R − R1 = 4Er,1 (W, R) R1 But the LHS of (9) equals 4En,r,1 (W, R). We conclude that if (10) holds then Er,1 (W, R) ≥ En,r,1 (W, R). However, if (10) does not hold then either R̂1 = max(0, 2R − 1) or R̂1 = min(1, 2R) and the argument fails. We now obtain a lower bound on the achievable error exponent Eλ (W, R) that depends on the channel, W , only through its capacity, I(W ). By [24, Equation (26)], for a given channel capacity I(W ), Er,BSC (I(W ), R) ≤ Er (W, R) ≤ Er,BEC (I(W ), R) where Er,BEC (I(W ), R) (Er,BSC (I(W ), R), respectively) is the error exponent corresponding to random codes of rate R over a binary erasure channel (binary symmetric channel) of capacity I(W ). By [24, Equation (27), Theorem 2] this is also true for expurgated error exponents. Therefore, EBSC (I(W ), R) ≤ E (W, R) ≤ EBEC (I(W ), R) is also true for expurgated random codes and their error exponents as defined in (3). Recalling that   I W + − I(W ) = I(W ) − I W − ∈ [l (I(W )) , h (I(W ))] (see Section II), we define Êλ (I(W ), R) , 0.5 min max Êm,λ (I(W ), , R, R1 ) ∈[l ,h ] R1 ∈B where l = l (I(W )), h = h (I(W )), h i Êm,λ (I(W ), , R, R1 ) = min Êλ−1 (I(W ) − , R1 ) , Êλ−1 (I(W ) + , 2R − R1 ) and Ê0 (I(W ), R) = EBSC (I(W ), R) Note that Êλ (I(W ), R) does not depend on the channel W , but only on its capacity. Theorem 1: For any BMS channel W with capacity I(W ), any desired code rate R, and a concatenated code with λ ≥ 0 polarization steps for the inner polar code and (randomly generated linear) outer codes with blocklength N1 → ∞, the best achievable error exponent Eλ (W, R) is lower bounded by Eλ (W, R) ≥ Êλ (I(W ), R). Proof: We will prove the theorem using induction. The claim is trivial for λ = 0. We will prove it for λ assuming it is true for λ − 1. Eλ (W, R) = 0.5 max Em,λ (W, R, R1 ) R1 ∈B h    i ≥ 0.5 max min Êλ−1 I W − , R1 , Êλ−1 I W + , 2R − R1 R1 ∈B SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 10 ERROR EXP 10 -1 10 -2 optimal =1, polar =2, polar =3, polar =1, naive =2, naive =3, naive 10 -3 10 -4 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 I(W) Fig. 3. Lower bounds for error exponents of codes created by λ polar transforms followed by 2λ outer codes of blocklength N/2λ and rate R = 1/2 with optimal rate-splitting, and naively using 2λ outer codes of blocklength N/2λ , for a general BMS channel with capacity I(W ) and total rate R = 1/2. ≥ 0.5 min max Êm,λ (I(W ), , R, R1 ) = Êλ (I(W ), R) ∈[l ,h ] R1 ∈B where the first equality follows from (6), the first inequality follows from the induction assumption, and the second one follows from the fact that there exists l (I(W )) ≤  ≤ h (I(W )) s.t. I(W ) − I (W − ) = I (W + ) − I(W ) = . We thus showed that Êλ (I(W ), R) is a lower bound on the error exponent Eλ (W, R) for all BMS channels with a given capacity I(W ). In Fig. 3, we plot the asymptotic lower bound for the error exponent, Êλ (I(W ), R), for a code with rate R = 1/2 and λ = 1, 2, 3 as a function of I(W ). This is compared to the lower bound for the naive approach, where we use 2λ codewords with blocklength N1 = N/2λ , without using the polar transformation. This lower bound is EBSC (I(W ), R) /2λ . As expected, the lower bound for the scheme with polarization is higher, i.e. Êλ ≥ Ên,λ . All the plots in Fig. 3 have an asymptote at I(W ) = R = 1/2, since when the rate approaches capacity, EBSC , Êλ and Ên,λ approach zero. We also see that Êλ and Ên,λ have an asymptote at I(W ) = 1. This asymptote follows from using expurgated codes, and since it is a lower bound on the error exponent, it follows that Eλ and En,λ approach infinity as SNR → ∞ (I(W ) → 1) in Fig. 2 for the BIAWGNC. It should also be noted that the difference between the lower bounds on the error exponents of the polarization-based and naive schemes increases with λ. IV. I MPROVED BOUNDS AND APPROXIMATIONS A. Achievable bound for BEC [17, Theorem 37] provides an upper bound on the achievable frame error rate (FER) of an error-correcting code with blocklength N and rate R for the binary erasure channel (BEC) with erasure probability . Combining this upper bound with (2), we obtain that for a polar-concatenated code with outer codes of length N1 , and rates Ri , i = 0, . . . , 2λ − 1, an achievable upper bound is Pe ≤ ∆ = λ 2X −1 i=0 λ 2X −1 i=0 (N   ) i+ h  N R 1 X 2 1 i −1 N1 t N1 −t − N1 −t−log −N1 E(Wi ,Ri ,N1 ) 2 ,e min (1 − I(Wi )) I(Wi ) 2 t t=0 γi (Ri ) (11) SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 11 where x+ , max(x, 0). We compute an upper bound on the achievable FER for polar codes of length 2λ concatenated with codes of length N1 and the best rate division between sub-codes given the total code rate R, by minimizing the RHS of P2λ −1 P2λ −1 λ (11) given i=0 Ri N1 = RN ) using the following efficient dynamic i=0 Ri = 2 R (which can also be written as programming algorithm. Denote ∆ δl (ρ) = min l X R0 ,...,Rl γi (Ri ) i=0 for integer ρ ∈ [0, RN ]. The minimization is under the constraint that N1 Ri are all positive integers, satisfying Pl i=0 Ri N1 = ρ. For each l = 0, 1, . . . , 2λ − 1, and each integer value of ρ ∈ [0, RN ], the algorithm computes δl (ρ) recursively using δl (ρ) = min {δl−1 (ρ − N1 Rl ) + γl (Rl )} Rl subject to the constraint that N1 Rl is an integer and N1 Rl ∈ [0, ρ]. The recursion is initialized using δ0 (ρ) = γ0 (ρ/N1 ) The output of the algorithm is δ2λ −1 (RN ), which is the minimum of the RHS of (11). The minimizing rates, R0 , . . . , R2λ −1 , can be easily obtained as a byproduct of this recursive algorithm. B. Dispersion-based (normal) approximation Consider transmission over a BMS channel, W , with capacity I(W ) and dispersion V (W ), defined as  2 P ∆ P W (y | x) 1 P V (W ) = − I(W )2 . By [17], the maximal rate of transmission at error 1 0) x∈X y∈Y 2 W (y | x) log W (y | x x0 ∈X 2 q ) −1 () where Q() is the complementary probability  and blocklength N is closely approximated by I(W ) − V (W N Q Gaussian cumulative distribution function. The approximation improves as N gets larger, but is known to be tight already for N as short as about 100. The error probability of the best code with blocklength N and rate R can be approximated by nq h  io log N N Q I(W ) − R + O [17] (this is sometimes referred to as the normal approximation in the literature). V (W ) N However, for some channels this expression can be improved. For BIAWGNC [25] and BSC [17, Theorem 52], Pe ≈ nq h io log N N −1 Q , and for BEC it is the same expression without 0.5 log N/N [17, Theorem V (W ) I(W ) − R + 2N + O N  q N (I(W ) − R) , 53]. Therefore, for the BEC and for general channels we approximate the error probability as Q V (W ) while for the BIAWGNC and BSC we use "s Q N V (W )  log N I(W ) − R + 2N # (12) The smallest achievable error probability of our concatenated polar coding scheme is thus approximated by s ! λ 2X −1 N1 Pe ≈ min Q (I (Wi ) − Ri + C(N1 )) R0 ...R2λ −1 V (Wi ) i=0 (13) Ri ∈[0,I(Wi )] P2λ −1 Ri =2λ R i=0 s ≤2 λ min R0 ...R2λ −1 Ri ∈[0,I(Wi )] P2λ −1 Ri =2λ R i=0 max Q (I (Wi ) − Ri + C(N1 )) i N1 V (Wi ) ! (14) where C(N1 ) is a correction term. For the BIAWGNC and BSC, C(N1 ) = log N1 /(2N1 ), and for other channels C(N1 ) = 0. Note that Pe is also approximately lower bounded by the same expression in (14) without the multiplying 2λ term. In the simulations section it will be shown that (13) provides a tight approximation to the actual performance of concatenated BCH-polar codes over the BIAWGNC. The minimization in (13) is computed efficiently using a dynamic programming SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 12 1 0.9 0.8 RATE 0.7 0.6 0.5 0.4 I(W) Rmin , =1 0.3 Rmin , =2 0.2 0 2 4 6 8 10 12 SNR[dB] Fig. 4. The minimal rate for which (17) holds compared to the channel capacity for the BIAWGNC algorithm, similarly to the algorithm that was described in Section IV-A. The algorithm also provides the rates R0 , . . . , R2λ −1 as a byproduct. To gain insight on the min-max problem (14), we first look at the simpler problem s ! N1 max Q (I (Wi ) − Ri ) min i R0 ...R2λ −1 V (Wi ) P2λ −1 i=0 (15) Ri =2λ R P2λ −1 λ √ i )−Ri , i = 0, . . . , 2λ − 1 are equal and This problem is solved when I(W i=0 Ri = 2 R. Hence, I (Wi ) − Ri = V (Wi ) √   q 2λ [I(W )−R] V (Wi ) where , and the solution of (15) is Q [I(W ) − R] VλN P2λ −1 √ (W ) j=0 V (Wj ) P ∆ Vλ (W ) = 2λ −1 i=0 p 2 V (Wi ) (16) 2λ Since (15) is a relaxed version of the min-max problem in (14), if the solution of (15) obeys all the constraints of the min-max problem in (14), then it is the solution of this problem as well. Therefore, if ∀i = 0, . . . , 2λ − 1 p 2λ [I(W ) − R] V (Wi ) Ri = I (Wi ) − ≥0 P2λ −1 p V (Wj ) j=0 (17) then s λ Pe ≈ 2 Q [I(W ) − R] N Vλ (W ) ! For R sufficiently close to I(W ) the condition (17) is guaranteed to hold. The minimal R, for which (17) holds is s ! Vλ (W ) Rmin = I(W ) − min I (Wi ) i 2λ V (Wi ) (18) (19) Fig. 4 shows Rmin for different values of λ for the BIAWGNC. Fig. 4 suggests that limSN R→∞ Rmin = 1 − 1/2λ . This will be proved theoretically later. In this entire derivation, we ignore the requirement that Ri · N1 ∈ Z, since this requirement becomes redundant as N1 increases. For the same reason, we also ignore the correction term. This is compared to a naive SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 13 optimal λ=1, polar λ=1, naive λ=2, polar λ=2, naive 100 DISPERSION 10-1 10-2 10-3 10-4 0 2 4 6 8 10 12 SNR[dB] Fig. 5. Vλ (W ) and Vn,λ (W ) for a BIAWGNC approach where we simply use 2λ codewords with blocklength N1 = N/2λ (without using the polar transformation at all). In this approach, s λ Pe ≈ 2 Q [I(W ) − R] N1 V (W ) s ! λ = 2 Q [I(W ) − R] N Vn,λ (W ) ! (20) where Vn,λ (W ) , 2λ V (W ). Showing that Vλ (W ) ≤ Vn,λ (W ) would mean that polarization is helpful. As can be seen in Fig. 5, for codes of rate R > Rmin , transmitted over the BIAWGNC, Vλ (W ) < Vn,λ (W ), so polarization helps. For high SNR, Fig. 5 suggests that Vλ (W ) ≈ V (W ). This can be proved theoretically, but it requires the following lemma first. Lemma 4: If R is sufficiently large, s.t. (17) holds, i.e. R > Rmin , then, for λ ≥ 1, Vλ (W ) can be calculated recursively 2 p p Vλ−1 (W − ) + Vλ−1 (W + ) where V0 (W ) , V (W ). using Vλ (W ) = 0.5 Proof: For λ > 1, note that Wi are sub-channels of W − for i = 0, . . . , 2λ−1 − 1, and sub-channels of W + for i = 2λ−1 , . . . , 2λ − 1. !2 P2λ−1 −1 p P2λ −1 p V (Wi ) V (Wi ) i=0 i=2λ−1 √ √ Vλ (W ) = 0.5 + 2λ−1 2λ−1 p  p 2 = 0.5 Vλ−1 (W − ) + Vλ−1 (W + ) where the first equality follows from rewriting (16), and the second one follows from applying (16) for λ − 1 instead of λ. We now consider the case of I(W ) close to 1 (the high SNR case) and claim the following. Lemma 5: Consider a BMS channel W and suppose that V (W ) can be linearly approximated as4 V (W ) = αδ(W )+o(δ(W )) ∆ where α is some constant and δ(W ) = 1 − I(W ). Also assume that W + and W − satisfy the same property (with the same value of α). Then Vλ (W ) = V (W ) + o (δ(W )) for λ ≥ 1. Furthermore, under our assumptions, limI(W )→1 Rmin = 1 − 1/2λ . We prove the Lemma in Appendix B The conditions of Lemma 5 hold in particular for the BEC. The condition regarding W holds with α = 1 since V (W ) = I(W ) [1 − I(W )]. The conditions regarding W + and W − hold since by [1, Proposition 6], if W is a BEC, so are W + and W − . For the BIAWGNC, [24, Fig. 4] suggests that the condition on W is valid. Furthermore, if W is a BIAWGNC, then W + 4 o(δ) denotes a term which is negligible in its absolute value compared to δ for sufficiently small δ SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 14 and W − can be approximated as BIAWGNCs as well [8]. These arguments suggest that the conditions of Lemma 5 are also valid for the BIAWGNC. Fig. 5 supports this conjecture. Consider transmission over a BMS channel W with code rate R > Rmin , where I(W ) is sufficiently close to 1. One could think that under the conditions of Lemma 5 on W , W − and W + , and the normal approximation to the error probability, the best achievable error probability of the polar concatenated coding scheme, (18), is larger only by a factor of 2λ compared to the best p p achievable error probability of an arbitrary code with the same total blocklength and rate, i.e. Q(x/ V (W ))/Q(x/ Vλ (W )) ≈ √ 1 for x , N [I(W ) − R] and I(W ) close to 1.  Unfortunately, this is not true. Since Q(u) ∼ exp −0.5u2 for large u, and, according to the conditions and claims of Lemma 5, limI(W )→1 V (W ), Vλ (W ) = 0, we have  Q x/ p V (W ) .  Q x/ p  2  x 1 1 Vλ (W ) ≈ exp − − 2 V (W ) Vλ (W )  (21) for I(W ) sufficiently close to 1. The condition lim I(W )→1 1 1 − =0 V (W ) Vλ (W ) is required for claiming that the RHS of (21) approaches one for I(W ) → 1. This condition is stronger than the one proved in Lemma 5, and it does not necessarily hold, since 1/V (W ) − 1/Vλ (W ) = o(δ) α2 δ 2 +αo(δ 2 ) does not necessarily approach zero for δ → 0. I removed the example illustrated in the previous Fig. 6 in order to focus on our main contributions. As an example,  it is easy to prove using Lemma 4, that for the BEC and I(W ) = 1 − δ, V (W ) = δ(1 − δ), but V1 (W ) = δ + Θ δ 1.5 , so  1/V (W ) − 1/V1 (W ) = Θ δ −0.5 and the RHS of (21) approaches zero for I(W ) → 1. Suppose that the condition R > Rmin holds. Then the error rate of the polar concatenated (naive) scheme is given by (18) ((20), respectively). Hence, comparing Vλ (W ) to Vn,λ (W ), we can assess the usefulness of polarization compared to the naive approach with the same value of λ. The following result shows that for large N , Vλ (W ) and Vn,λ (W ) can be used to compare between schemes with different values of λ. Define V̂λ (N, W ) as the solution to s ! ! s N N λ 2 Q [I(W ) − R] = Q [I(W ) − R] Vλ (W ) V̂λ (N, W ) (22) for given I(W ) − R, λ and N . Also define V̂n,λ (N, W ) as the solution of s λ 2 Q [I(W ) − R] Lemma 6: V̂λ (N, W ) − Vλ (W ) = Θ 1 N  N Vn,λ (W ) ! s = Q [I(W ) − R] N ! V̂n,λ (N, W ) , so limN →∞ V̂λ (N, W ) = Vλ (W ). The same claim also holds for V̂n,λ (N, W ) and Vn,λ (W ). We prove the lemma in Appendix C. For asymptotically large blocklengths the error probabilities predicted by Gallager’s error exponents are more accurate (the error exponents are conjectured to be the correct ones under our sub-optimal decoding scheme). However, in the finite blocklength regime, the normal approximation is better. In our setting, we target the case of N1 values which are not very large (e.g., of order 100). In the following section we show a very good match between the normal approximation and simulation results, using close to ML decoded, powerful outer algebraic codes. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 15 C. Approximated converse for BIAWGNC In [26], a lower bound on the optimal FER of optimal spherical codes over additive white Gaussian noise channels (AWGNCs) is provided. Since the BIAWGNC is a constrained version of a AWGNC with the same SNR, this bound can be treated as a lower bound on the FER for a BIAWGNC as well, i.e. for the same SNR = 1/σ 2 , rate R and block size N , Pe,BIAW GN C (σ, R, N ) ≥ Pe,AW GN C (σ, R, N ). We obtain the following approximated lower bound on the achievable frame error rate after λ polarization steps. Pe ≥ 1 − ≈1− ≥1− λ 2Y −1 i=0 λ 2Y −1 i=0 λ 2Y −1 i=0 [1 − Pe (Wi , Ri , N1 )] (23) [1 − Pe,BIAW GN (σi , Ri , N1 )] [1 − Pe,AW GN (σi , Ri , N1 )]  ≥ min 1 − λ 2Y −1 Ri i=0  [1 − Pe,AW GN (σi , Ri , N1 )] The first inequality is under the assumption that each outer code Ai is ML decoded given the channel observations and the previously decoded codewords of the outer codes A0 , . . . , Ai−1 . We bound the error rate from below by assuming a genie aided decoder: the genie informs us what was the actual transmitted codeword of the outer code, Ai , immediately after we decode it (so that it can be used for decoding the codewords of the following outer codes, Ai+1 , Ai+2 , . . .). The approximation in the second line follows from the approximation of the sub-channels Wi as BIAWGNCs, when W is a BIAWGNC [8, Equations (7)-(8)]. The second inequality follows from the explanation above. The term Pe,AW GN (σ, R, N ) is calculated using [26]   cos θ N G sin θ exp − 2σ1 2 + G 2σ 1 1 √ · Pe,AW GN (σ, R, N ) ≈ √ G sin2 θ/σ − cos θ N π 1 + G2 sin θ   √ p θ cos θ where G = 0.5 cos θ/σ + cos2 θ/σ 2 + 4 and θ is computed by solving 2N R ≈ 2πNsinsin . The two approximations N θ above are extremely accurate for N ≥ 100. D. Converse for the BEC Combining (23) with [17, Theorem 38] and the fact that the sub-channels of a BEC are also BEC, yields that for all polar concatenated codes over the BEC with capacity I(W ), λ polarization steps, and blocklength N1 Pe ≥ 1 − ≥1− λ 2Y −1 i=0 λ 2Y −1 i=0 [1 − Pe (Wi , Ri , N1 )] [1 − Pc,BEC (I (Wi ) , Ri , N1 )]  ≥ min 1 − Ri λ 2Y −1 i=0  [1 − Pc,BEC (I (Wi ) , Ri , N1 )] where ∆ Pc,BEC (I(W ), R, N ) = N X l=bN (1−R)c+1     N l [1 − I(W )] I(W )N −l 1 − 2N (1−R)−l l (24) SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 16 TABLE I R ATES OF OUTER CODES IN THE (λ, N1 , R) = (1, 64, 1/2) SCHEME FOR THE BIAWGNC SNR[dB] N1 · R0 N1 · R1 1 17 47 1.5 16 48 2 16 48 2.5 16 48 3 15 49 3.5 15 49 4 14 50 TABLE II R ATES OF OUTER CODES IN THE (λ, N1 , R) = (1, 128, 1/2) SCHEME FOR THE BIAWGNC SNR[dB] N1 · R0 N1 · R1 0.5 34 94 1 33 95 1.5 33 95 2 32 96 2.5 31 97 3 31 97 3.5 30 98 V. C OMPARISON WITH SIMULATION RESULTS We start by comparing the actual performance of BCH-polar codes, for short blocklengths and one polarization step (λ = 1) transmitted over a BIAWGNC, with the normal approximation-based expression (13), for the best polar-concatenated code with these parameters using the dynamic programming algorithm described in Section IV. The total code rate was R = 1/2. We used two setups. In the first, N1 = 64 and N = 128. In the second setup, N1 = 128 and N = 256. We also calculated the normal approximation (12) to the best achievable error probability when using a (128, 64) ((256, 128)) code. For each SNR, the outer code rates that minimize (13) were calculated as a by-product of the dynamic programming algorithm, and are shown in Tables I and II. Due to the results in Table I, we used (64,18,22) and (64,45,8) extended BCH codes, whose generator matrices appear in [27], as outer codes in the simulated BCH-polar coding scheme for N = 128, and decoded them using OSDs of order 5 [27]. The total rate of the scheme is R = 63/128, which is close to the planned rate. The (128,64,22) BCH code was decoded using OSD of order 5 as well. The consumed processor time (measured in clock ticks) normalized by the number of information bits of the decoders of BCH-polar and BCH codes were compared as well. The error rates and decoding times of the various schemes are shown in Figs. 6 and 7. Fig. 6 suggests that the normal approximation we use is accurate in the SNR range examined. We also see that the BCH-polar code suffers a loss of 0.7dB compared to the BCH code (Fig. 6), but is about 25 to 1000 times faster, depending on the SNR (Fig. 7). Compared to the (128,64) list SC decoder with CRC (with list size 32), whose FER results were taken from [28], the BCH-polar code suffers a loss of only 0.25dB. For extended BCH with N = 128 and R = 1/2 we see in Fig. 6 that the normal approximation is accurate for low SNR, but for high SNR it slightly underestimates the FER. We conjecture the same behavior for other blocklengths and rates. Therefore, SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 10 FER 10 10 10 10 10 17 -1 -2 -3 -4 -5 -6 (256,128) polar-concat normal approx. (256,128) normal approx. BCH-polar (256,128) OSD BCH (255,131) OSD (128,64) polar-concat normal approx. (128,64) normal approx BCH-polar (128,63) OSD BCH (128,64) OSD List+CRC (128,64) 0.5 1 1.5 2 2.5 3 3.5 4 SNR[dB] Fig. 6. FER normal approximations and simulation results for BCH-polar codes with λ = 1, and BCH codes with different blocklengths and rates close to 1/2 for the BIAWGNC, compared with (128,64) List decoder with CRC from [28] using (13) to estimate the optimal rates for BCH-polar codes would be accurate for low SNR (considering that not all BCH rates are feasible), but for high SNR it would overestimate the rates of the good sub-channels. That’s why we pick slightly lower R1 and slightly higher R0 than the ones in Table I while designing the BCH-polar codes. The results for N = 256 show a similar trend. Due to the rates in Table II, and since R1 should be slightly lowered (and R0 slightly increased) the chosen extended BCH codes were (128,36,32) and (128,92,12), whose generator matrices appear in [27]. For comparison, we have taken the FER results of the (255,131) BCH code from [29], and measured the average processing time of the OSD of order 5 of this code. This time, the BCH-polar code suffers a loss of only 0.5dB compared to the BCH code (Fig. 6), but is about 1000 times faster (Fig. 7). Figs. 6 and 7 also show the following: 1) For SNR < 2dB, the (256,128) BCH-polar code has a higher FER compared to the (128,64) BCH code, but it requires a lower processing time per information bit. 2) For 2dB < SNR < 3dB, the (256,128) BCH-polar code has a lower FER and lower processing time per information bit compared to the (128,64) BCH code. 3) For SNR > 3dB, the (256,128) BCH-polar code has a lower FER than the (128,64) BCH code, but it requires higher processing time per information bits. Note that when decoding a (256,128) BCH-polar code, we need to decode two BCH codes of blocklength 128. However, the rate of the first is lower than 1/2 while the rate of the second is higher than 1/2. Also, the required complexity of the OSD algorithm is maximal for rate 1/2 codes. Therefore, it is usually more efficient to decode a (256,128) BCH-polar code compared to the decoding of two (128,64) BCH codes. However, the decoding of the (256,128) BCH-polar code also requires some handling of soft information due to the polar transformation. We did not attempt to implement this part in our algorithm efficiently. We also compared our results to simulation results from the literature. First, we considered the setup in [9, Section VIII.A], where λ = 3, N1 = 128, N = 1024, and the channel is a BEC. The overall rate of the code is R = 0.4. We calculated the achievable upper bound on the FER, with typical random (the expurgated random ensemble) outer codes, using the recursive algorithm from Lemma 1. We then computed an upper bound on the achievable FER by finding the best rate division between SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 18 1e+8 BCH-polar (128,63) BCH (128,64) BCH-polar (256,128) BCH (255,131) 1e+7 CPU time/inf. bits 1e+6 1e+5 1e+4 1e+3 1e+2 1e+1 0.5 1 1.5 2 2.5 3 3.5 4 SNR[dB] Fig. 7. Comparison of processor time per information bits of BCH-polar codes with λ = 1, and BCH codes with different lengths and rate close to 1/2 for the BIAWGNC. 10 0 expurgated random - opt. expurgated random - BEC(0.4) achievable, Eq. (11) - opt. achievable, Eq. (11) - BEC(0.4) normal approximation - opt. normal approximation - BEC(0.4) converse, Eq. (24) - opt. BCH outer code - BEC(0.4) 10 -1 FER 10 -2 10 -3 10 -4 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 capacity of the BEC Fig. 8. FER upper bounds for concatenated polar codes with outer code length N1 = 128 and inner polar code length 8, compared with BCH-polar code results from [9, Fig. 5]. sub-codes given the total code rate 2λ R, that brings the RHS of (11) to a minimum as described in Section IV-A. Our upper bounds were computed twice. Once by optimizing the rate division for a fixed BEC, W , with erasure rate 0.4 as in [9], and once by optimizing the rate division for the actual BEC we are transmitting over, for each point in the graph. The corresponding graphs are denoted by “BEC(0.4)” and “opt.” in Fig. 8. We have also plotted the normal approximation (13) to the best achievable error probability, and the converse bound in Section IV-D. The graphs show small gaps between the achievable bound, Equation (11), and the actual results with BCH codes. The normal approximation (13) has a somewhat lower FER, while the bound based on Lemma 1 is less tight. The converse (24) is close to the normal approximation. For comparison, note that a standard SC decoded polar code of length N = 1024, yields FER ≈ 2 · 10−3 for I(W ) = 0.6 [9]. The second setup we considered is taken from [8, Section IV], where λ = 3, N1 = 127, N = 1016, and the channel is a SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 19 10 0 expurgated outer code, opt. Polar SC decoder BCH outer code - SNR=3dB normal approximation - opt. normal approximation - SNR=3dB converse, Eq. (23) - opt. 10 -1 FER 10 -2 10 -3 10 -4 10 -5 10 -6 10 -7 1.5 2 2.5 3 3.5 SNR[dB] Fig. 9. FER upper bounds for concatenated polar codes with outer random code length N1 = 127, inner polar code length 8, compared with BCH-polar code from [8] BIAWGNC. The overall rate of the code is R = 1/2. We first calculated the achievable upper bound on the FER from Lemma 1. Then we calculated the normal approximation (13) to the best achievable error probability. Both graphs were obtained by optimizing over the best rate split for each SNR point in the graph. We also plot the normal approximation given optimal rate division for fixed SNR = 3dB. We compared these bounds with a simulation of the BCH-polar code in [8] using an outer OSD of order 5. Note that in [8] the outer code rates were optimized only for SNR = 3dB. As can be seen, the normal approximation is close to the performance of the scheme with outer BCH codes and almost not affected by using a fixed rate division. The figure also shows the performance of a standard polar code with N = 1024 and R = 1/2. Finally, we have plotted the converse for polar concatenated scheme as was described in Section IV-C, Equation (23). We see that for a desired FER of ≈ 2 · 10−4 the BCH-polar code is only 0.75dB worse than the converse, so under the given λ, N1 and R, we cannot gain more than 0.75dB by smartly choosing the outer codes. Finally note that the normal approximation for the best (1016,508) code at SNR = 1.25dB shows only 1dB improvement compared to the BCH-polar code. VI. C ONCLUSION We studied the properties of a concatenated scheme of polar codes with good outer codes. We obtained an upper bound on the error exponent using the corresponding expurgated random coding ensemble, and calculated a lower bound on the error exponent, which is valid for all channels with a given capacity. We obtained converse and approximated converse results, as well as a dispersion-based normal approximation to the performance for finite length codes, which can also be used to determine the required rate split between the outer codes. We showed good agreement between this prediction and simulation results for BCH-polar codes, when transmitting over the BIAWGNC. A PPENDIX A P ROOF OF L EMMA 3 We first prove by induction that Eλ (W, R) is finite for all integer λ and R > 0. Eλ (W, R) is finite for λ = 0 and R > 0, since both Er (W, R) and Eex (W, R) are finite: Er (W, R) ≤ E0 (W, 1), and for binary-input channels (except for a perfect channel for which the two inputs can never be confused at the receiver), Eex (W, R) is finite for R > 0, which can be derived from [21, SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 20 Equations (5.7.14)-(5.7.16)]. Now, assume Eλ−1 (W, R) is a finite function of R for R > 0. Then, Em,λ (W, R, R1 ) defined in (7) is finite, since Eλ−1 (W − , R1 ) can be infinite only for R1 = 0, but then 2R − R1 = 2R > 0 and Eλ−1 (W + , 2R − R1 ) is finite, so Em,λ (W, R, R1 ) is finite too. This also means that Eλ (W, R) = 0.5 maxR1 Em,λ (W, R, R1 ) is finite. This shows that Eλ (W, R) is finite for all integer λ and R > 0. Note however that Eλ (W, 0) = ∞ for all integer λ and any channel W . This can be shown by induction, since for R = 0 (6) yields Eλ (W, 0) = 0.5 min [Eλ−1 (W + , 0) , Eλ−1 (W − , 0)] and Eλ (W, 0) = ∞ for λ = 0 due to (1). Next, we prove by induction that Eλ (W, R) is decreasing in R. The claim is trivial for λ = 0 since E0 (W, R) = E(W, R) is defined in (3) as a maximum between two continuous, decreasing functions. Hence it is decreasing whether it equals Eex (W, R) or Er (W, R). Now assume that Eλ−1 (W, R) is decreasing in R for any W . First consider rates R for which   E − + + λ−1 (W , 0 ) ≥ Eλ−1 (W , 2R)  Eλ−1 (W − , 2R) ≤ Eλ−1 (W + , 0+ ) (25) (for rates R > 1 we define for all λ, Eλ (W, R) ≡ 0). This case is depicted in Fig. 10. By (6) and Fig. 10, 2Eλ (W, R) is the height of the intersection point of Eλ−1 (W − , R1 ), which is a decreasing function of R1 , and Eλ−1 (W + , 2R − R1 ), which is an increasing function of R1 . Therefore, increasing R would move Eλ−1 (W + , 2R − R1 ) to the right, as can be seen in Fig. 10, thus decreasing the intersection point height, 2Eλ (W, R), and increasing R̂1 = argmaxR1 min [Eλ−1 (W − , R1 ) , Eλ−1 (W + , 2R − R1 )]. This means Eλ (W, R) is decreasing, and R̂1 = R̂1 (R) is an increasing function of R, as can be seen in Fig. 10: R̂2 , R̂1 (R + ∆R) > R̂1 (R) for ∆R > 0. If (25) does not hold, i.e., Eλ−1 (W − , 0+ ) < Eλ−1 (W + , 2R) (Eλ−1 (W + , 0+ ) < Eλ−1 (W − , 2R), respectively), R̂1 = max(0, 2R − 1) (R̂1 = min(1, 2R)) and Eλ (W, R) = 0.5Eλ−1 (W − , max(0+ , 2R − 1)) (0.5Eλ−1 (W + , 2R − min(1, 2R))). Trivially, Eλ (W, R) is decreasing in this case as well. Thus we have shown that Eλ (W, R) is decreasing in R for all integer λ, and that R̂1 is an increasing (but not strictly increasing) function of R. We proceed by proving by induction that Eλ (W, R) is convex. The claim is trivial for λ = 0 since E0 (W, R) = E(W, R) is defined in (3) as a maximum between two continuous, convex functions, Er (W, R) and Eex (W, R), and since maximization preserves convexity. Now assume that Eλ−1 (W, R) is convex in R for all BMS channels W . Since it was already shown that Eλ−1 (W, R) is also decreasing for all BMS channels W , it follows that |∂Eλ−1 (W − , r) /∂r|r=Rˆ1 (R) is decreasing   in R (recalling that R̂1 (R) is an increasing function of R). Since Eλ−1 W + , 2R − R̂1 = 2Eλ (W, R), and Eλ (W, R)   is a decreasing function of R, Eλ−1 W + , 2R − R̂1 (R) is also decreasing in R. But Eλ−1 (W + , r) is decreasing in r. Thus 2R − R̂1 (R) is increasing in R. Since in addition Eλ−1 (W + , r) is convex and decreasing, it follows that |∂Eλ−1 (W + , 2R − r) /∂r|r=Rˆ1 (R) is decreasing in R. We proceed by claiming that |∂Eλ (W, R) /∂R| = 1 1 + − + |∂Eλ−1 (W , r) /∂r|r=Rˆ1 (R) |∂Eλ−1 (W , 2R − r) /∂r|r=Rˆ1 (R) !−1 (26) Assume that (26) holds. Since both |∂Eλ−1 (W − , r) /∂r|r=Rˆ1 (R) and |∂Eλ−1 (W + , 2R − r) /∂r|r=Rˆ1 (R) decrease with R, it follows that |∂Eλ (W, R) /∂R| is also decreasing in R. Since, in addition, ∂Eλ (W, R) /∂R < 0 (due to the fact that Eλ (W, R) is decreasing in R), this means Eλ (W, R) is convex. It remains to prove (26). First assume that (25) holds. Consider Fig. 10, which shows Eλ−1 (W − , r), Eλ−1 (W + , 2R − r) and Eλ−1 (W + , 2(R + ∆R) − r) (∆R is small fixed value) as a function of r, together with intersection points standing for 2Eλ (W, R) and 2Eλ (W, R + ∆R). Now, 2∆E , 2Eλ (W, R) − 2Eλ (W, R + ∆R) is the height of the triangle formed by the SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 21 Eλ−1 (W + , 2R − r) Eλ−1 (W − , r) Eλ−1 (W + , 2(R + ∆R) − r) 2∆R 2Eλ (W, R) 2∆E 2Eλ (W, R + ∆R) r R̂1 R̂2 Fig. 10. Functions required to calculate Eλ (W, R) and its derivative. vertices (R̂1 , 2Eλ (W, R)), (R̂2 , 2Eλ (W, R + ∆R)) and (R̂1 + 2∆R, 2Eλ (W, R)) in Fig. 10. For ∆R → 0, the slopes of this triangle’s edges are approximated as  a , 2∆E/(R̂2 − R̂1 ) ≈ ∂Eλ−1 W − , r /∂r r=Rˆ1 +  b , 2∆E/(R̂1 + 2∆R − R̂2 ) ≈ ∂Eλ−1 W , 2R − r /∂r r=Rˆ1 It can be easily verified that 2∆E = 2∆R(1/a + 1/b)−1 , and together with ∆E/∆R → |∂Eλ (W, R) /∂R|, the approximations above yield (26). Now, if (25) does not hold, then as was noted above, either Eλ (W, R) = 0.5Eλ−1 (W − , max(0+ , 2R − 1)) or Eλ (W, R) = 0.5Eλ−1 (W + , 2R − min(1, 2R)). In both cases Eλ (W, R) is convex. Finally, the claim that for R > 0, |∂Eλ (W, R) /∂R| < ∞ is due to the fact that Eλ (W, R) is a finite, convex, decreasing function for all R > 0. A PPENDIX B P ROOF OF L EMMA 5 We first prove by induction on λ that Vλ (W ) = V (W ) + o (δ(W )). This claim is trivial for λ = 0. Now assume it holds for λ − 1. By the induction assumption, Vλ−1 (W ) = V (W ) + o (δ(W )) = αδ(W ) + o (δ(W )) Now, l () and h (), defined in Section II, satisfy l (I(W )) = δ(W ) + o(δ(W )) , h (I(W )) = δ(W ) − δ(W )2 (the claim on l (I(W )) follows by a first order Taylor expansion of l (1 − δ) for small δ). Hence, recalling Section II,  I(W ) − I W − = I(W + ) − I (W ) = δ(W ) + o (δ(W )) SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 22 so that I(W − ) = 1 − 2δ(W ) + o (δ(W )) I(W + ) = 1 + o (δ(W )) , By the assumption of the theorem regarding W − and W + , V (W − ) = αδ(W − ) + o(δ(W − )) = 2αδ(W ) + o(δ(W )) , V (W + ) = αδ(W + ) + o(δ(W + )) = o(δ(W )) Applying the induction assumption to W − and W + , we know that   Vλ−1 W − = V (W − ) + o(δ(W − )) = 2αδ(W ) + o (δ(W )) , Vλ−1 W + = V (W + ) + o(δ(W + )) = o (δ(W )) By Lemma 4, Vλ (W ) = 0.5 p 2αδ(W ) + o (δ(W )) + p o (δ(W )) 2 = αδ(W ) + o (δ(W )) = V (W ) + o (δ(W )) This concludes the proof of the first part of the lemma. We proceed by proving by induction on λ that after 2λ polarization steps of the channel W ,  I (W0 ) = I W −···− = 1 − 2λ δ(W ) + o(δ(W )) (27) and I (Wi ) = 1 + o(δ(W )) i 6= 0 (28) This claim is trivial for λ = 0. Assuming it holds for λ − 1, we note that if I (Wi ) = 1 + o(δ(W )), then, using essentially the same arguments that were used in the beginning of the proof   I (Wi ) − I Wi− = I Wi+ − I (Wi ) = o(δ(W )) Therefore, for i 6= 0,  I Wi− = 1 + o(δ(W )) , i 6= 0  I Wi+ = 1 + o(δ(W )) In addition, by the induction assumption,   I (W0 ) − I W0− = I W0+ − I (W0 ) = 2λ−1 δ(W ) + o(δ(W )) Hence, reapplying the induction assumption,  I W0− = 1 − 2λ δ(W ) + o(δ(W )) ,  I W0+ = 1 + o(δ(W )) This concludes the proof of (27) and (28). Thus, after λ polarization steps, V (W0 ) = 2λ αδ(W ) + o(δ(W )) and V (Wi ) = o(δ(W )) for i 6= 0. We conclude that s s   Vλ (W ) αδ(W ) + o(δ(W )) = lim 1 − 2λ δ(W ) + o(δ(W )) = 1/2λ lim I (W0 ) 2λ V (W0 ) δ(W )→0 22λ αδ(W ) + o(δ(W )) I(W )→1 and for i 6= 0, s lim I(W )→1 I (Wi ) Vλ (W ) = lim [1 + o(δ(W ))] 2λ V (Wi ) δ(W )→0 s αδ(W ) + o(δ(W )) =∞ 2λ o(δ(W )) Therefore, s lim I(W )→1 Thus, by (19), limI(W )→1 Rmin = 1 − 1/2λ . min I (Wi ) i Vλ (W ) 2λ V (Wi ) ! = 1/2λ SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 23 A PPENDIX C P ROOF OF L EMMA 6 For shortness of notation, define x , I(W ) − R. Also denote V̂ = V̂λ (N, W ) and V = Vλ (W ). First, we will find a sufficient condition for r λ 2 Q x N V ! r ≤Q x N ! (29) V̂ Recall that for u > 0 the complementary Gaussian cumulative distribution function, Q(), satisfies,   2 2 1 1 1 √ 1 − 2 e−u /2 ≤ Q(u) ≤ √ e−u /2 u 2πu 2πu The left hand side (LHS) of (30) implies that p V̂ √ x 2πN V̂ 1− 2 x N ! e while the RHS of (30) implies that r λ 2 Q x N V Therefore, p V̂ V̂ 1− 2 x N ! r 2 − x2V̂N ≤Q x N ! V̂ √ 2λ V − x2 N ≤ √ e 2V x 2πN ! e− x2 N 2V̂ √ x2 N ≥ 2λ V e− 2V is a sufficient condition for (29). But (31) is equivalent to ! ln V ln V̂ V̂ x2 N x2 N ≥ λ ln 2 + + ln 1 − 2 − − 2 x N 2 2V 2V̂ Since V̂ ln 1 − 2 x N (30) ! =− V̂ +Θ x2 N  x2  1 N2 (31) (32)  the inequality (32) can be written as V̂ ln V̂ − 2 2 +Θ 2N x N  1 N3 − λ ln 2 ln V x2 + − N 2N 2V ≥ 2V̂ That is, 1 1 − ≥Θ V V̂  1 N  which leads to  V̂ − V ≥ Θ 1 N  Now, we will find a sufficient condition for r λ 2 Q x The LHS of (30) implies that r λ 2 Q x N V ! N V ! r ≥Q x N ! V̂ √   x2 N 2λ V V ≥ √ 1− 2 e− 2V x N x 2πN while the RHS of (30) implies that r Q x Therefore, N V̂ ! p x2 N V̂ ≤ √ e− 2V̂ x 2πN p √   2 x2 N V̂ 2λ V V − x2V̂N √ e ≤ √ 1− 2 e− 2V x N x 2πN x 2πN (33) SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 24 is a sufficient condition for (33). This condition is equivalent to   ln V̂ ln V x2 N V x2 N ≤ − + λ ln 2 + ln 1 − 2 − 2 2 x N 2V 2V̂ which means V2 ln V̂ x2 ln V λ ln 2 V − ≤ + − 2 2 + 4Θ 2N 2N N x N x 2V̂  1 N3  − x2 2V Therefore, 1 1 − ≤Θ V V̂  1 N  and  V̂ − V ≤ Θ 1 N  Summarizing, for some constants κ1 and κ2 (both independent of N ) and N sufficiently large, we have shown that if V̂λ (N, W ) − Vλ (W ) ≥ κ1 /N (V̂λ (N, W ) − Vλ (W ) ≤ κ2 /N , respectively) then the LHS of (22) is smaller (larger) than the RHS. In addition, note that the RHS of (22), that defines V̂λ (N, W ), is monotonically increasing in V̂λ (N, W ). This proves our claim. The proof for Vn,λ (W ) and V̂n,λ (N, W ) is identical to the proof for Vλ (W ) and V̂λ (N, W ), and is therefore omitted. R EFERENCES [1] E. Arikan, “Channel polarization: A method for constructing capacity-achieving codes for symmetric binary-input memoryless channels,” IEEE Transactions on Information Theory, vol. 55, no. 7, pp. 3051–3073, 2009. [2] I. Tal and A. Vardy, “List decoding of polar codes,” IEEE Transactions on Information Theory, vol. 61, no. 5, pp. 2213–2226, 2015. [3] C. Leroux, A. J. Raymond, G. Sarkis, and W. J. Gross, “A semi-parallel successive-cancellation decoder for polar codes,” IEEE Transactions on Signal Processing, vol. 61, no. 2, pp. 289–299, 2013. [4] B. Li, H. Shen, D. Tse, and W. Tong, “Low-latency polar codes via hybrid decoding,” in Proc. 8th Int. Symp. Turbo Codes and Iterative Inf. Processing (ISTC), August 2014, pp. 223–227. [5] B. Yuan and K. Parhi, “Low-latency successive-cancellation list decoders for polar codes with multibit decision,” IEEE Trans. Very Large Scale Integr. (VLSI) Syst., vol. 23, no. 10, pp. 2268–2280, 2015. [6] C. Xiong, J. Lin, and Z. Yan, “Symbol-decision successive cancellation list decoder for polar codes,” IEEE Transactions on Signal Processing, vol. 64, no. 3, pp. 675–687, February 2016. [7] H. Mahdavifar, M. El-Khamy, J. Lee, and I. Kang, “Performance limits and practical decoding of interleaved reed-solomon polar concatenated codes,” Communications, IEEE Transactions on, vol. 62, no. 5, pp. 1406–1417, May 2014. [8] P. Trifonov and P. Semenov, “Generalized concatenated codes based on polar codes,” in Proc. 8th International Symposium on Wireless Communication Systems (ISWCS), Nov 2011, pp. 442–446. [9] Y. Wang, K. R. Narayanan, and Y. C. Huang, “Interleaved concatenations of polar codes with BCH and convolutional codes,” IEEE Journal on Selected Areas in Communications, vol. 34, no. 2, pp. 267–277, Feb 2016. [10] D. Goldin and D. Burshtein, “Block successive cancellation decoding of polarization-based codes,” in Proc. 9th Int. Symp. Turbo Codes and Iterative Inf. Processing (ISTC), September 2016, pp. 256–260. [11] M. P. Fossorier and S. Lin, “Soft-decision decoding of linear block codes based on ordered statistics,” IEEE Transactions on Information Theory, vol. 41, no. 5, pp. 1379–1396, 1995. [12] A. Valembois and M. Fossorier, “Box and match techniques applied to soft-decision decoding,” IEEE Transactions on Information Theory, vol. 50, no. 5, pp. 796–810, 2004. [13] E. Nachmani, Y. Be’ery, and D. Burshtein, “Learning to decode linear codes using deep learning,” in Communication, Control, and Computing (Allerton), 2016 54th Annual Allerton Conference on. IEEE, 2016, pp. 341–346. [14] E. Nachmani, E. Marciano, L. Lugosch, W. J. Gross, D. Burshtein, and Y. Beery, “Deep learning methods for improved decoding of linear codes,” arXiv preprint arXiv:1706.07043, 2017. [15] T. Gruber, S. Cammerer, J. Hoydis, and S. t. Brink, “On deep learning-based channel decoding,” accepted for CISS 2017, arXiv preprint arXiv:1701.07738, 2017. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION THEORY 25 [16] S. Cammerer, T. Gruber, J. Hoydis, and S. t. Brink, “Scaling deep learning-based decoding of polar codes via partitioning,” arXiv preprint arXiv:1702.06901, 2017. [17] Y. Polyanskiy, H. V. Poor, and S. Verdu, “Channel coding rate in the finite blocklength regime,” IEEE Transactions on Information Theory, vol. 56, no. 5, pp. 2307–2359, May 2010. [18] S. B. Korada, “Polar codes for channel and source coding,” Ph.D. dissertation, EPFL, Lausanne, Switzerland, 2009. [19] R. Mori and T. Tanaka, “Performance and construction of polar codes on symmetric binary-input memoryless channels,” in Proc. IEEE International Symposium on Information Theory (ISIT), Seoul, Korea, June 2009, pp. 1496 – 1500. [20] T. Richardson and R. Urbanke, Modern Coding Theory. Cambridge, UK: Cambridge University Press, 2008. [21] R. G. Gallager, Information Theory and Reliable Communication. New York: Wiley, 1968. [22] A. Barg and G. D. Forney, “Random codes: minimum distances and error exponents,” IEEE Transactions on Information Theory, vol. 48, no. 9, pp. 2568–2573, Sep 2002. [23] M. Alsan and E. Telatar, “Polarization improves E0 ,” IEEE Transactions on Information Theory, vol. 60, no. 5, pp. 2714–2719, May 2014. [24] A. G. i Fabregas, I. Land, and A. Martinez, “Extremes of error exponents,” IEEE Transactions on Information Theory, vol. 59, no. 4, pp. 2201–2207, April 2013. [25] T. Erseghe, “Coding in the finite-blocklength regime: bounds based on Laplace integrals and their asymptotic approximations,” IEEE Transactions on Information Theory, vol. 62, no. 12, pp. 6854–6883, Dec 2016. [26] C. E. Shannon, “Probability of error for optimal codes in a gaussian channel,” The Bell System Technical Journal, vol. 38, no. 3, pp. 611–656, May 1959. [27] R. H. Morelos-Zaragoza, The Art of Error Correcting Coding, 2nd ed. New York: Wiley, 2006, web site: http://www.the-art-of-ecc.com. [28] G. Liva, L. Gaudio, T. Ninacs, and T. Jerkovits, “Code design for short blocks: a survey,” arXiv preprint arXiv:1610.00873, 2016. [29] J. V. Wonterghem, A. Alloumf, J. J. Boutros, and M. Moeneclaey, “Performance comparison of short-length error-correcting codes,” in 2016 Symposium on Communications and Vehicular Technologies (SCVT), Nov 2016, pp. 1–6.
7cs.IT
Theoretical and Practical Advances on Smoothing for Extensive-Form Games arXiv:1702.04849v2 [cs.GT] 9 May 2017 Christian Kroer∗ Computer Science Department Carnegie Mellon University [email protected] Kevin Waugh Department of Computing Science University of Alberta [email protected] Fatma Kılınç-Karzan† Tepper School of Business Carnegie Mellon University [email protected] Tuomas Sandholm‡ Computer Science Department Carnegie Mellon University [email protected] May 10, 2017 Abstract Sparse iterative methods, in particular first-order methods, are known to be among the most effective in solving large-scale two-player zero-sum extensive-form games. The convergence rates of these methods depend heavily on the properties of the distance-generating function that they are based on. We investigate the acceleration of first-order methods for solving extensive-form games through better design of the dilated entropy function—a class of distance-generating functions related to the domains associated with the extensive-form games. By introducing a new weighting scheme for the dilated entropy function, we develop the first distance-generating function for the strategy spaces of sequential games that only a logarithmic dependence on the branching factor of the player. This result improves the convergence rate of several first-order methods by a factor of Ω(bd d), where b is the branching factor of the player, and d is the depth of the game tree. Thus far, counterfactual regret minimization methods have been faster in practice, and more popular, than first-order methods despite their theoretically inferior convergence rates. Using our new weighting scheme and practical tuning we show that, for the first time, the excessive gap technique can be made faster than the fastest counterfactual regret minimization algorithm, CFR+, in practice. 1 Introduction Extensive-form games (EFGs) are a broad class of games; they model sequential interaction, imperfect information, and outcome uncertainty. Nash equilibria prescribe a particular notion of rational behavior in such games. In the specific case of two-player zero-sum EFGs with perfect recall, an exact Nash equilibrium can be computed in polynomial time using a Linear Program (LP) whose ∗ Supported by a Facebook Fellowship, the NSF under grants IIS-1617590, IIS-1320620, and IIS-1546752, and the ARO under awards W911NF-16-1-0061 and W911NF-17-1-0082. † Supported by NSF grant CMMI 1454548. ‡ Supported by the NSF under grants IIS-1617590, IIS-1320620, and IIS-1546752, and the ARO under awards W911NF-16-1-0061 and W911NF-17-1-0082. 1 size is linear in the size of the game tree [von Stengel, 1996]. However, in practice the LP approach has two major drawbacks limiting its applicability. First, the LP may be prohibitively large and may not fit in memory. Second, even when it does, the iterations of interior-point methods or the simplex algorithm are prohibitively expensive [Sandholm, 2010]. Practical methods for EFG solving tackle this issue through two complementary approaches: Abstraction and iterative game solvers with low memory requirements [Sandholm, 2010]. In this paper we focus on the second approach. Iterative game solvers mainly fall in two categories: (i) counterfactual-regret-based methods [Zinkevich et al., 2007, Lanctot et al., 2009] achieving a convergence rate on the order of O( 12 ), and (ii) first-order methods (FOMs) [Hoda et al., 2010, Kroer et al., 2015] achieving a convergence rate of O( 1 ). The better convergence rate of FOMs makes them more attractive from a theoretical viewpoint. This paper investigates the acceleration of such FOMs for EFGs, from both a theoretical and a numerical perspective. Nash equilibrium computation of a two-player zero-sum EFG with perfect recall admits a Bilinear Saddle Point Problem (BSPP) formulation where the domains are given by the polytopes that encode strategy spaces of the players. The most efficient FOMs are designed to solve this BSPP. The classical FOMs to solve BSPPs such as mirror prox (MP) [Nemirovski, 2004] or the excessive gap technique (EGT) [Nesterov, 2005a] utilize distance-generating functions (DGFs) to measure appropriate notions of distances over the domains. Then the convergence rate of these FOMs relies on the DGFs and their relation to the domains in three critical ways: Through the strong convexity parameters of the DGFs, the norm associated with the strong convexity parameter, and set widths of the domains as measured by the DGFs. Hoda et al. [2010] introduced a general framework for constructing DGFs for treeplexes—a class of convex polytopes that generalize the domains associated with the strategy spaces of an EFG. While they also established bounds on the strong convexity parameter for their DGFs in some special cases, these lead to very weak bounds and result in slow convergence rates. Kroer et al. [2015] developed explicit strong convexity-parameter bounds for entropy-based DGFs (a particular subclass of DGFs) for general EFGs, and improved the bounds for the special cases considered by Hoda et al. [2010]. These bounds from Kroer et al. [2015] generate the current state-of-the-art parameters associated with the convergence rate for FOMs with O( 1 ) convergence. In this paper we construct a new weighting scheme for such entropy-based DGFs. This weighting scheme leads to new and improved bounds on the strong convexity parameter associated with general treeplex domains. In particular, our new bounds are first-of-their kind as they have no dependence on the branching operation of the treeplex. Informally, our strong convexity result allows us to improve the convergence rate of FOMs by a factor of Ω(bd d) (where b is the average branching factor for a player and d is the depth of the EFG) compared to the prior state-of-the-art results from Kroer et al. [2015]. Our bounds parallel the simplex case for matrix games where the entropy function achieves a logarithmic dependence on the dimension of the simplex domain. Finally, we complement our theoretical results with numerical experiments to investigate the speed up of FOMs with convergence rate O( 1 ) and compare the performance of these algorithms with the premier regret-based methods CFR and CFR+ [Tammelin et al., 2015]. CFR+ is the fastest prior algorithm for computing Nash equilibria in EFGs when the entire tree can be traversed (rather than sampled). Bowling et al. [2015] used it to essentially solve the game limit Texas hold’em. CFR+ is also the algorithm used to accurately solve endgames in the Libratus agent, which showed superhuman performance against a team of top Heads-Up No-Limit Texas hold’em poker 2 specialist professional players in the Brains vs AI event 1 . A slight variation2 of CFR+ was used in the DeepStack agent Moravčı́k et al. [2017], which beat a group of professional players. Our experiments show that FOMs are substantially faster than both CFR algorithms when using a practically tuned variant of our DGF. We also test the impact of stronger bounds on the strong convexity parameter: we instantiate EGT with the parameters developed in this paper, and compare the performance to the parameters developed by Kroer et al. [2015]. These experiments illustrate that the tighter parameters developed here lead to better practical convergence rate. The rest of the paper is organized as follows. Section 2 discusses related research. We present the general class of problems that we address—bilinear saddle-point problems—and describe how they relate to EFGs in Section 3. Then Section 4 describes our optimization framework. Section 5 introduces treeplexes, the class of convex polytopes that define our domains of the optimization problems. Our focus is on dilated entropy-based DGFs; we introduce these in Section 6 and present our main results—bounds on the associated strong convexity parameter and treeplex diameter. In Section 7 we demonstrate the use of our results on instantiating EGT. We compare our approach with the current state-of-art in EFG solving and discuss the extent of theoretical improvements achievable via our approach in Section 7.1. Section 8 presents numerical experiments testing the effect of various parameters on the performance of our approach as well as comparing the performance of our approach to CFR and CFR+. We close with a summary of our results and a few compelling further research directions in Section 9. 2 Related work Nash equilibrium computation has received extensive attention in the literature [Littman and Stone, 2003, Lipton et al., 2003, Gilpin and Sandholm, 2007, Zinkevich et al., 2007, Daskalakis et al., 2009, Jiang and Leyton-Brown, 2011, Kroer and Sandholm, 2014, Daskalakis et al., 2015]. The equilibrium-finding problems vary quite a bit based on their characteristics; here we restrict our attention to two-player zero-sum sequential games. Koller et al. [1996] present an LP whose size is linear in the size of the game tree. This approach, coupled with lossless abstraction techniques, was used to solve Rhode-Island hold’em [Shi and Littman, 2002, Gilpin and Sandholm, 2007], a game with 3.1 billion nodes (roughly size 5 · 107 after lossless abstraction). However, for games larger than this, the resulting LPs tend to not fit in the computer memory thus requiring approximate solution techniques. These techniques fall into two categories: iterative -Nash equilibrium-finding algorithms and game abstraction techniques [Sandholm, 2010]. The most popular iterative Nash equilibrium algorithm is the counterfactual-regret-minimization framework instantiated with regret matching (CFR) [Zinkevich et al., 2007], its sampling-based variant monte-carlo CFR (MCCFR) [Lanctot et al., 2009], and CFR instantitated with a new regret minimization technique called regret matching plus (CFR+). These regret-minimization algorithms perform local regret-based updates at each information set. Despite their slow convergence rate of O( 12 ), they perform very well in pratice, especially CFR+. Recently, Waugh and Bagnell [2015] showed, with some caveats, an interpretation of CFR as a FOM with O( 12 ) rate. Nonetheless, in this paper we make a distinction between regret-based methods and O( 1 ) FOMs for ease of exposition. Hoda et al. [2010] initially proposed DGFs for EFGs leading to O( 1 ) convergence rate when used with EGT. Kroer et al. [2015] improved these result for the dilated entropy function. Gilpin 1 2 Confirmed through author communication This variation was chosen for implementation reasons, though, and has inferior practical iteration complexity. 3 et al. [2012] give an algorithm with convergence rate O(ln( 1 )). Their bound has a dependence on a certain condition number of the payoff matrix, which is difficult to estimate; and as a result they show a bound of O( 1 ) which is independent of the condition number. Detailed comparisons to all three algorithms discussed here are given in Section 7.1. Finally, Bosansky et al. [2014] develop an iterative double-oracle algorithm for exact equilibrium computation. This algorithm only scales for games where it can identify an equilibrium of small support, and thus suffers from the same performance issues as the general LP approach. In addition to equilibrium-finding algorithms, another central topic in large-scale game solving has been automated abstraction [Sandholm, 2010, 2015]. Initially, this was used mostly for information abstraction [Gilpin and Sandholm, 2007, Shi and Littman, 2002, Zinkevich et al., 2007]. Lately, action abstraction approaches have gained considerable interest [Hawkin et al., 2011, 2012, Brown and Sandholm, 2014, Kroer and Sandholm, 2014, 2016]. Sequential game abstraction approaches with solution quality bounds have also emerged for stochastic [Sandholm and Singh, 2012] and extensive-form [Lanctot et al., 2012, Kroer and Sandholm, 2014, 2016] games more recently. 3 Problem setup Computing a Nash equilibrium in a two-player zero-sum EFG with perfect recall can be formulated as a Bilinear Saddle Point Problem (BSPP): min maxhx, Ayi = max minhx, Ayi. x∈X y∈Y y∈Y x∈X (1) This is known as the sequence-form formulation [Romanovskii, 1962, Koller et al., 1996, von Stengel, 1996]. In this formulation, x and y correspond to the nonnegative strategy vectors for players 1 and 2 and the sets X , Y are convex polyhedral reformulations of the sequential strategy space of these players. Here X , Y are defined by the constraints Ex = e, F y = f , where each row of E, F encodes part of the sequential nature of the strategy vectors, the right hand-side vectors e, f are |I1 | , |I2 |-dimensional vectors, and Ii is the information sets for player i. For a complete treatment of this formulation, see von Stengel [1996]. Our theoretical developments mainly exploit the treeplex domain structure and are independent of other structural assumptions resulting from EFGs. Therefore, we describe our results for general BSPPs. We follow the presentation and notation of Juditsky and Nemirovski [2011a,b] for BSPPs. For notation and presentation of treeplex structure, we follow Kroer et al. [2015]. 3.1 Basic notation We let hx, yi denote the standard inner product of vectors x, y. Given a vector x ∈ Rn , we let kxkp P denote its `p norm given by kxkp := ( ni=1 |xi |p )1/p for p ∈ [1, ∞) and kxk∞ := maxi∈[n] |xi | for p = ∞. Throughout this paper, we use Matlab notation to denote vector and matrices, i.e., [x; y] denotes the concatenation of two column vectors x, y. For a given set P Q, we let ri (Q) denote its n relative interior. Given n ∈ N, we denote the simplex ∆n := {x ∈ Rn+ : i=1 xi = 1}. 4 Optimization setup In its most general form a BSPP is defined as Opt := max min φ(x, y), y∈Y x∈X 4 (S) where X , Y are nonempty convex compact sets in Euclidean spaces Ex , Ey and φ(x, y) = υ + ha1 , xi + ha2 , yi + hy, Axi. We let Z := X × Y; so φ(x, y) : Z → R. In the context of EFG solving, φ(x, y) is simply the inner product given in (1). The BSPP (S) gives rise to two convex optimization problems that are dual to each other: Opt(P ) = minx∈X [φ(x) := maxy∈Y φ(x, y)] Opt(D) = maxy∈Y [φ(y) := minx∈X φ(x, y)] (P ), (D), with Opt(P ) = Opt(D) = Opt. It is well known that the solutions to (S) — the saddle points of φ on X × Y — are exactly the pairs z = [x; y] comprised of optimal solutions to the problems (P ) and (D). We quantify the accuracy of a candidate solution z = [x; y] with the saddle point residual     sad (z) := φ(x) − φ(y) = φ(x) − Opt(P ) + Opt(D) − φ(y) . | {z } | {z } ≥0 ≥0 In the context of EFG, sad (z) measures the proximity to being an -Nash equilibrium. 4.1 General framework for FOMs Most FOMs capable of solving BSPP (S) are quite flexible in terms of adjusting to the geometry of the problem characterized by the domains X , Y of the BSPP (S). The following components are standard in forming the setup for such FOMs (we present components for X , analogous components are used for Y): • Vector norm: k · kX on the Euclidean space E where the domain X of (S) lives, along with its dual norm kζk∗X = max hζ, xi. kxkX ≤1 • Matrix norm: kAk = maxy {kAyk∗X : kykY = 1} based on the vector norms k · kX , k · kY . • Distance-Generating Function (DGF): A function ωX (x) : X → R, which is convex and 0 (x) on the set X ◦ := continuous on X , and admits a continuous selection of subgradients ωX {x ∈ X : ∂ωX (x) 6= ∅} (here ∂ωX (x) is a subdifferential of ωX taken at x), and is strongly convex with modulus ϕX w.r.t. the norm k · kX : 0 0 ∀x0 , x00 ∈ X ◦ : hωX (x0 ) − ωX (x00 ), x0 − x00 i ≥ ϕX kx0 − x00 k2X . (2) 0 (x), u − xi for all x ∈ X ◦ and u ∈ X . • Bregman distance: V (ukx) := ωX (u) − ωX (x) − hωX • Prox-mapping: Given a prox center x ∈ X ◦ , Proxx (ξ) := argmin {hξ, ui + V (ukx)} : E → X ◦ . u∈X For properly chosen stepsizes, the prox-mapping becomes a contraction. This is critical in the convergence analysis of FOMs. Furthermore, when the DGF is taken as the squared `2 norm, the prox mapping becomes the usual projection operation of the vector x − ξ onto X . • ω-center : xω := argmin ωX (x) ∈ X ◦ of X . x∈X • Set width: Ωx := max V (xkxω ) ≤ max ωX (x) − min ωX (x). x∈X x∈X x∈X 5 The distance-generating functions ωX , ωY can be used to create smoothed approximations to φ, φ as follows [Nesterov, 2005b]: φµ2 (x) = max {φ(x, y) − µ2 ωY (y)} , (3) φµ (y) = min {φ(x, y) + µ1 ωX (x)} , (4) y∈Y 1 x∈X where µ1 , µ2 > 0 are smoothness parameters denoting the amount of smoothing applied. Let yµ2 (x) and xµ1 (y) refer to the y and x values attaining the optima in (3) and (4). These can be thought of as smoothed best responses. Nesterov [2005b] shows that the gradients of the functions φµ2 (x) and φµ (y) exist and are Lipschitz continuous. The gradient operators and Lipschitz constants are 1 given as follows and ∇φµ (y) = a2 + A> xµ1 (y), 1   kAk2 and L2 φµ = . 1 ϕX µ1 ∇φµ2 (x) = a1 + Ayµ2 (x)  kAk2 L1 φµ2 = ϕY µ2 Based on this setup, we formally state the Excessive Gap Technique (EGT) of Nesterov [2005a] in Algorithm 1. ALGORITHM 1: EGT input : ω-center zω , DGF weights µ1 , µ2 , and  > 0 output: z t (= [xt ; y t ])  x0 = Proxxω µ−1 1 ∇φµ2 (xω ) ; y 0 = yµ2 (xω ); t = 0; z1 := zω ; while sad (z t ) >  do 2 ; τt = t+3 if t is even then t+1 , y t+1 ) = (µt+1 1 ,x Step(µt1 , µt2 , xt , y t , τ ) else t+1 , xt+1 ) = (µt+1 2 ,y Step(µt2 , µt1 , y t , xt , τ ) end t = t + 1; end ALGORITHM 2: Step input : µ1 , µ2 , x, y, τ output: µ+ 1 , x+ , y+ x̂ = (1 − τ ) x + τ xµ1 (y); y+ = (1 − τ ) y + τ yµ2 (x̂); x̃ =   Proxxµ1 (y) (1−ττ )µ1 ∇φµ2 (x̂) ; x+ = (1 − τ ) x + τ x̃; µ+ 1 = (1 − τ ) µ1 ; The EGT algorithm alternates between taking steps focused on X and Y. Algorithm 2 shows a single step focused on X . Steps focused on y are completely analogous. Algorithm 1 shows how the alternating steps and stepsizes are computed, as well as how initial points are selected. Suppose the initial values µ1 , µ2 in the EGT algorithm satisfy µ1 = L ϕ(φX ) . Then, at every 1 µ2 iteration t ≥ 1 of the EGT algorithm, the corresponding solution z t = [xt ; y t ] satisfies xt ∈ X , y t ∈ Y, and s 4kAk ΩX ΩY φ(xt ) − φ(y t ) = sad (z t ) ≤ . T + 1 ϕX ϕY Consequently, [Nesterov, 2005a] proves that the EGT algorithm has a convergence rate of O( 1 ). 6 5 Treeplexes Hoda et al. [2010] introduce the treeplex, a class of convex polytopes that encompass the sequenceform description of strategy spaces in perfect-recall EFGs. Definition 1. Treeplexes are defined recursively: 1. Basic sets: The standard simplex ∆m is a treeplex. 2. Cartesian product: If Q1 , . . . , Qk are treeplexes, then Q1 × · · · × Qk is a treeplex. 3. Branching: Given a treeplex P ⊆ [0, 1]p , a collection of treeplexes Q = {Q1 , . . . , Qk } where Qj ⊆ [0, 1]nj , and l = {l1 , . . . , lk } ⊆ {1, . . . , p}, the set defined by n o P P l Q := (u, q1 , . . . , qk ) ∈ Rp+ j nj : u ∈ P, q1 ∈ ul1 · Q1 , . . . , qk ∈ ulk · Qk is a treeplex. In this setup, we say ulj is the branching variable for the treeplex Qj . A treeplex is a tree of simplexes where children are connected to their parents through the branching operation. In the branching operation, the child simplex domain is scaled by the value of the parent branching variable. Understanding the treeplex structure is crucial because the proofs of our main results rely on induction over these structures. For EFGs, the simplexes correspond to the information sets of a single player and the whole treeplex represents that player’s strategy space. The branching operation has a sequential interpretation: The vector u represents the decision variables at certain stages, while the vectors qj represent the decision variables at the k potential following stages, depending on external outcomes. Here k ≤ p since some variables in u may not have subsequent decisions. For treeplexes, von Stengel [1996] has suggested a polyhedral representation of the form Eu = e where the matrix E has its entries from {−1, 0, 1} and the vector e has its entries in {0, 1}. For a treeplex Q, we denote by SQ the index set of the set of simplexes contained in Q (in an EFG SQ is the set of information sets belonging to the player). For each j ∈ SQ , the treeplex rooted at the j-th simplex ∆j is referred to as Qj . Given vector q ∈ Q and simplex ∆j , we let Ij denote the set of indices of q that correspond to the variables in ∆j and define q j to be the sub vector of q corresponding to the variables in Ij . For each simplex ∆j and branch i ∈ Ij , the set Dji represents the set of indices of simplexes reached immediately after ∆j by taking branch i (in an EFG Dji is the set of potential next-step information sets for the player). Given a vector q ∈ Q, simplex ∆j , and index i ∈ Ij , each child simplex ∆k for every k ∈ Dji is scaled by qi . Conversely, for a given simplex ∆j , we let pj denote the index in q of the parent branching variable qpj that ∆j is scaled by. We use the convention that qpj = 1 if Q is such that no branching operation precedes ∆j . For each j ∈ SQ , dj is the maximum depth of the treeplex rooted at ∆j , that is, the maximum number of simplexes reachable through a series of branching operations at ∆j . Then dQ gives the depth of Q. We use bjQ to identify the number of branching operations preceding the j-th simplex in Q. We will say that a simplex j such that bjQ = 0 is a root simplex. Figure 1 illustrates an example treeplex Q. Q is constructed from nine two-to-three-dimensional simplexes ∆1 , . . . , ∆9 . At level 1, we have two root simplexes, ∆1 , ∆2 , obtained by a Cartesian product (denoted by ×). We have maximum depths d1 = 2, d2 = 1 beneath them. Since there are no preceding branching operations, the parent variables for these simplexes ∆1 and ∆2 are qp1 = qp2 = 1. For ∆1 , the corresponding set of indices in the vector q is I1 = {1, 2}, while for ∆2 we have I2 = {3, 4, 5}. At level 2, we have the simplexes ∆3 , . . . , ∆7 . The parent variable of 7 ∆3 is qp3 = q1 ; therefore, ∆3 is scaled by the parent variable qp3 . Similarly, each of the simplexes ∆3 , . . . , ∆7 is scaled by their parent variables qpj that the branching operation was performed on. So on for ∆8 and ∆9 as well. The number of branching operations required to reach simplexes ∆1 , ∆3 and ∆8 is b1Q = 0, b3Q = 1 and b8Q = 2, respectively. × ∆1 q1 q2 q2 · ∆ 4 q1 · ∆ 3 q6 q8 q7 q7 · ∆ 8 q16 q17 × q18 ∆2 q3 q9 q3 · ∆ 5 q10 q11 q5 q4 q4 · ∆ 6 q12 q13 q5 · ∆ 7 q14 q15 q7 · ∆ 9 q19 q20 Figure 1: An example treeplex constructed from 9 simplexes. Cartesian product operation is denoted by ×. Note that we allow more than two-way branches; hence our formulation follows that of Kroer et al. [2015] and differs from that of Hoda et al. [2010]. As discussed in Hoda et al. [2010], it is possible to model sequence-form games by treeplexes that use only two-way branches. Yet, this can cause a large increase in the depth of the treeplex, thus leading to significant degradation in the strong convexity parameter. Because we handle multi-way branches directly in our framework, our approach is more effective in taking into account the structure of the sequence-form game and thereby resulting in better bounds on the associated strong convexity parameters and thus overall convergence rates. Our analysis requires a measure of the size of a treeplex Q. Thus, we define MQ := maxq∈Q kqk1 . In the context of EFGs, suppose Q encodes player 1’s strategy space; then MQ is the maximum number of information sets with nonzero probability of being reached when player 1 has to follow a pure strategy while the other player may follow a mixed strategy. We also let X MQ,r := max kq j k1 . (5) q∈Q j∈SQ :bjQ ≤r Intuitively, MQ,r gives the maximum value of the `1 norm of any vector q ∈ Q after removing the variables corresponding to simplexes that are not within r branching operations of the root of Q. Example 1. In order to illustrate MQ and compare it to the size of |SQ |, let us now consider an example of an EFG and its corresponding treeplexes. Consider a game where two players take turns choosing among k actions, and each player chooses actions d times before leaf nodes are reached. In the treeplex Q of Player 1, each time Player 1 chooses among k actions constitutes a size k branching operation, and every time Player 2 chooses among k actions constitutes a size k Cartesian product operation. The total dimensionality of the treeplex, |SQ |, is k 2d , while the value of MQ is k d (since only Cartesian products blow up). Thus, MQ is square root of the size of |SQ |. 6 Dilated entropy functions with bounded strong convexity In this section we introduce DGFs for domains with treeplex structures and establish their strong convexity parameters with respect to a given norm (see (2)). 8 P The basic building block in our construction is the entropy DGF given by ωe (z) = ni=1 zi log(zi ), for the simplex ∆n . It is well-known that ωe (·) is strongly convex with modulus 1 with respect to the `1 norm on ∆n (see Juditsky and Nemirovski [2011a]). We will show that a suitable modification of this function achieves a desirable strong convexity parameter for the treeplex domain. The treeplex structure is naturally related to the dilation operation [Hiriart-Urruty and Lemaréchal, 2001] defined as follows: Given a compact set K ⊆ Rd and a function f : K → R, we first define n o K̄ := (t, z) ∈ Rd+1 : t ∈ [0, 1] , z ∈ t · K . Definition 2. Given a function f (z), the dilation operation is the function f¯ : K̄ → R given by ( t · f (z/t) if t > 0 f¯(z, t) = . 0 if t = 0 The dilation operation preserves convexity, and thus we define the following convex function by dilating the entropy function over the simplexes of a treeplex: Definition 3. Given a treeplex Q and weights βj > 0 for each j ∈ SQ , we define the dilated entropy function as X X qi ω(q) = βj qi log for any q ∈ Q, qp j j∈SQ i∈Ij where we follow the treeplex notation and pj is the index of the branching variable preceding ∆j , with the convention that qpj = 1 if ∆j has no branching operation preceding it. Remark 1. Note that the dilated entropy function ω(·) defined above is twice differentiable in the relative interior of treeplex Q and admits a continuous gradient selection. Moreover, for weights βj that scale appropriately with depth dj , we will demonstrate that it is strongly convex w.r.t. the `1 norm. Thus, the dilated entropy function is compatible with the `1 norm, as required by the BSPP setup. We would also like the prox-mapping associated with our DGF to be efficiently computable. Hoda et al. [2010] show that for any dilated function, its prox operator on a treeplex can be easily computed through a recursive bottom-up traversal involving the prox mappings associated with the function being dilated on individual simplexes. Since the entropy prox function can be computed in closed form on a simplex, the dilated entropy function can be computed by a single treeplex traversal involving closed-form expressions on each simplex. Definition 3 above leads to a subset of the DGFs considered by Hoda et al. [2010]. Our main theoretical result shows that by a careful selection of the weights βj , we can significantly improve the strong convexity bounds associated with the dilated entropy function. We will consider weights that satisfy the following recurrence: αj = 1 + max i∈Ij X k∈Dji αk β k , βk − αk ∀j ∈ SQ , βj > αj , ∀i ∈ Ij and ∀j ∈ SQ s.t. bjQ > 0, βj = αj , ∀i ∈ Ij and ∀j ∈ SQ s.t. bjQ = 0. 9 (6) Intuitively, αj represents the negative terms that the weight βj has to cancel out: the constant 1 represents the negative term resulting from the squared norm in the strong convexity requirement; the summation term represents the amount of negative terms accumulated from the induction on simplexes descending from simplex j. The qualifications on βj ensure that βj is set such that it at least cancels out the negative terms; the difference βj − αj controls the amount of negative value the parent simplex has to make up. This is why we set βj = αj when bjQ = 0. As part of the proof of Lemma 2 we will see why we require a strict inequality βj > αj for non-root simplexes. Based on recurrence (6), our main results establish strong convexity of our dilated entropy DGF w.r.t. the `2 and `1 norms: Theorem 1. For a treeplex Q, the dilated entropy function with weights satisfying recurrence (6) is strongly convex with modulus 1 with respect to the `2 norm. Theorem 2. For a treeplex Q, the dilated entropy function with weights satisfying recurrence (6) is strongly convex with modulus M1Q with respect to the `1 norm. We give the proofs of Theorems 1 and 2 in Section 6.2. Based on Theorem 2, we get the following corollary: Pdj r 2 (MQj ,r −1) Corollary 1. For a treeplex Q, the dilated entropy function with weights βj = 2+ r=1 1 for all j ∈ SQ is strongly convex with modulus MQ w.r.t. the `1 norm. Corollary 1 follows easily from Theorem 2 and a recursive interpretation of the weights, which is presented as Fact 2 in the next section. In particular, a specific choice of weights in Fact 2 immediately satisfies the recurrence (6) and leads to Corollary 1. To our knowledge, the best strong convexity bounds for general treeplexes were proved in Kroer et al. [2015]. Using weights βj = 2dj MQj they show strong convexity modulus |S1Q | w.r.t. the `1 norm. Corollary 1 improves the prior bounds by exchanging a factor of |SQ | with a factor of MQ . Note that |SQ | is tied to the branching factor associated with branching operations in the treeplex Q whereas MQ is not. Thus, our result removes the dependence of the strong convexity parameter on the branching factor and hence significantly improves upon Kroer et al. [2015]. In Theorem 3 we use our strong convexity result to establish a polytope diameter that has only a logarithmic dependence on the branching factor. As a consequence, the associated dilated entropy DGF when used in FOMs such as MP and EGT for solving EFGs leads to the same improvement in their convergence rate. 6.1 Preliminary results for the proofs of our main results We start with some simple facts and a few technical lemmas that are used in our proofs. Fact 1. Given a treeplex Q, we have, respectively, for all i ∈ Ij , j ∈ SQ and all d = 1, . . . , dQ , q ∈ Q: X X (a) MQj ≥ 1 + MQ l , (b) MQ ≥ qpj MQj . l∈Dji j∈SQ :dj =d Proof. The first P inequality was established in Kroer et al. [2015, Lemma 5.7]. The second follows by using MQ = j qi for some q, and inductively replacing terms belonging to simplexes j at the bottom with MQj . The result follows because branching operations cancel out by summing to 1. 10 Our next observation follows from Fact 1(a) and is advantageous in suggesting a practically useful choice of the weights βj that can be used for Theorem 2 to arrive at Corollary 1. Pdj r Fact 2. Let Q be a treeplex and P βj = 2 + r=1 2 (MQj ,r − 1) for all j ∈ SQ as in Corollary 1. Then Fact 1(a) implies βj ≥ 2 + k∈Di 2βk , ∀i ∈ Ij and ∀j ∈ SQ . j Pdj r−1 Consequently, by selecting βj = 2αj , and αj = 1 + r=1 2 (MQj ,r − 1) for all i ∈ Ij and for j all j ∈ SQ such that bQ > 0, we immediately satisfy the conditions of the recurrence in (6). Given a twice differentiable function f , we let ∇2 f (z) denote its Hessian at z. Our analysis is based on the following sufficient condition for strong convexity of a twice differentiable function: Fact 3. A twice-differentiable function f is strongly convex with modulus ϕ with respect to a norm k · k on nonempty convex set C ⊂ Rn if h> ∇2 f (z)h ≥ ϕkhk2 , ∀h ∈ Rn , z ∈ C ◦ . For simplexes ∆j at depth 1, there is no preceding branching operation; so the variables hpj , qpj do not exist. We circumvent this with the convention hpj = 0, qpj = 1 for such j ∈ SQ . In our proofs we will use the following expression for h> ∇2 ω(q)h. Lemma 1. Given a treeplex Q and a dilated entropy function ω(·) with weights βj > 0, we have   X X  h2 2hi hpj  h2pj i  ∀q ∈ ri (Q) and ∀h ∈ Rn . − + (7) h> ∇2 ω(q)h = βj  qi qp j qp j j∈SQ i∈Ij We provide the proof of Lemma 1 in the appendix. It simply follows from taking the secondorder partial derivatives and rearranging terms. 6.2 Proofs of our main theorems The majority of the work for our strong-convexity results is performed by the following lemma, from which our strong convexity results follow easily. Lemma 2. For any treeplex Q, the dilated entropy function with weights satisfying recurrence (6) satisfies the following inequality: X X h2 i h> ∇2 ω(q)h ≥ ∀q ∈ ri (Q) and ∀h ∈ Rn . (8) qi j∈SQ i∈Ij Proof.nWe will first show o the following inductive hypothesis over the set of non-root simplexes j b SQ = j ∈ SQ : bQ > 0 for any depth d ≥ 0:   2 X  h2 2hi hpj  h2pj X X X h2 X βj αj hpj i i   βj − + − ≥− qi qp j qp j qi βj − αj qpj bQ :dj ≤d j∈S i∈Ij bQ :dj ≤d i∈Ij j∈S bQ :dj =d j∈S We begin with the inductive step, as the base case will follow from the same logic. Consider a treeplex Q of depth d > 0. By applying the inductive hypothesis we have   X X  h2 2hi hpj  h2pj X X h2 i i − βj  − + qi qp j qp j qi i∈Ij bQ :dj ≤d bQ :dj ≤d i∈Ij j∈S j∈S   2 X X h2 X X  h2 2hi hpj  h2pj X βj αj hpj i i   ≥ βj − + − − (9) qi qp j qp j qi β j − α j qp j bQ :dj =d j∈S i∈Ij bQ :dj =d i∈Ij j∈S 11 bQ :dj =d−1 j∈S Now we can rearrange terms: The sum over j ∈ SbQ such that dj = d − 1 is equivalent to a sum over the immediate descendant information sets k ∈ Dji inside the square brackets, and we can move P the sum over i ∈ Ij outside the square brackets by using the fact that i∈Ij qqpi = 1 and splitting j the term h2pj qpj qi qpj into separate terms multiplied by X (9) =  X  X βj − 1 − " X ≥ X bQ :dj =d i∈Ij j∈S  h2i k∈Dji bQ :dj =d i∈Ij j∈S h2 (βj − αj ) i − qi , this gives βk αk  −  βk − αk qi  2βj hi hpj qp j  +  2βj hi hpj qp j qi βj h2pj qp2j  + qi βj h2pj qp2j    # , (10) where the last inequality follows from the definition of αj . For indices j ∈ SQ such that bjQ > 0 and i ∈ Ij , the relations in (6) imply βj > αj , and so the expression inside the square brackets in (10) is a convex function of hi . Taking its derivative w.r.t. βj qi hpj . Thus, we arrive at hi and setting it to zero gives hi = βj −α j qp j " (10) ≥ X X bQ :dj =d i∈Ij j∈S = X bQ :dj =d j∈S h2pj qp j # qi βj h2pj βj2 qi h2pj βj2 2qi h2pj − + βj − αj qp2j βj − αj qp2j qp2j " # P 2 X −βj2  i∈Ij qi βj αj hpj + βj =− . βj − αj qp j βj − αj qpj bQ :dj =d j∈S Hence, the induction step is complete. For the base case d = 0 we do not need the inductive assumption: Because Dji = ∅, αj = 1, and we get (10) by definition; we can then apply the same convexity argument. This proves our inductive hypothesis. Then using Lemma 1, we now have   X X  h2 2hi hpj  h2pj X X h2 X X h2 i i i − = βj  − + h> ∇2 ω(q)h − qi qi qp j qpj qi j∈SQ j∈SQ i∈Ij j∈SQ i∈Ij i∈Ij   X X h2 X βk αk h2 h2  i ≥ βj i − − i  ≥ 0.  q β − α q qi i k k i j i j∈SQ :bQ =0 i∈Ij k∈Dj The first inequality follows from the fact that hpj = 0 for all j ∈ SQ such that bjQ = 0, and for all j ∈ SQ such that bjQ > 0, we used our induction. The last inequality follows from (6) and qi , h2i ≥ 0. This then proves (8). We are now ready to prove our two main theorems, which we restate before proving them. Theorem 1. For a treeplex Q, the dilated entropy function with weights satisfying recurrence (6) is strongly convex with modulus 1 with respect to the `2 norm. P P Proof. Since qi ≤ 1, Lemma 2 implies h> ∇2 ω(q)h ≥ j∈SQ i∈Ij h2i = khk22 for all q ∈ ri (Q) and for all h ∈ Rn . Because the dilated entropy function ω(q) is twice differentiable on ri (Q), from Fact 3, we conclude that ω(·) is strongly convex w.r.t. the `2 norm on Q with modulus 1. 12 This analysis is tight: By choosing a vector q ∈ {0, 1}|Q| such that kqk1 = MQ , and setting βj qi hpj for all indices i such that qi = 1 and hi = 0 otherwise, every inequality in the hi = βj −α j qp j proof of Lemma 2 becomes an equality. Theorem 2. For a treeplex Q, the dilated entropy function with weights satisfying recurrence (6) is strongly convex with modulus M1Q with respect to the `1 norm. Proof. To show strong convexity with modulus 1 w.r.t. the `1 norm, we lower bound the right-hand side of (8) in Lemma 2:  X X  X X 2  X X  X X h2 1 1 1 |hi | √ 2 hi i ≥ ≥ khk21 , q = qi √ i qi MQ qi MQ qi MQ j∈SQ i∈Ij j∈SQ i∈Ij j∈SQ i∈Ij j∈SQ i∈Ij where the first inequality follows from the fact that MQ is an upper bound on kqk1 for any q ∈ Q, and the second inequality follows from the Cauchy-Schwarz inequality. Hence, we deduce h> ∇2 ω(q)h ≥ M1Q khk21 holds for all q ∈ ri (Q) and for all h ∈ Rn . Because the dilated entropy function ω(q) is twice differentiable on ri (Q), from Fact 3, we conclude that ω(·) is strongly convex w.r.t. the `1 norm on Q with modulus ϕ = M1Q . 6.3 Treeplex width The convergence rates of FOMs such as MP and EGT algorithms depend on the diameter-to-strong convexity parameter ratio Ω ϕ , as described in Section 4.1. In order to establish full results on the convergence rates of these FOMs, we now bound this ratio using Corollary 1 scaled by MQ . Theorem 3. For a treeplex Q, the dilated entropy function with simplex weights βj = MQ (2 + Pdj r Ω 2 dQ +2 log m where m is the dimension of r=1 2 (MQj ,r − 1)) for each j ∈ SQ results in ϕ ≤ MQ 2 the largest simplex ∆j for j ∈ SQ in the treeplex structure. 7 EGT for extensive-form game solving We now describe how to instantiate EGT for solving two-player zero-sum EFGs of the form (1) with treeplex domains. Below we state the customization of all the definitions from Section 4 for our problem. Let m be the size of the largest simplex in either of the treeplexes X , Y. Because X and Y are treeplexes, it is immediately apparent that they are closed, convex, and bounded. We use the `1 norm on both of the embedding spaces Ex , Ey . As our DGFs for X , Y are compatible with the `1 norm, we use the dilated entropy DGF scaled with weights given in Theorem 3. Then Theorem 3 ΩY X gives our bound on Ω ϕX and ϕY . Because the dual norm of the `1 norm is the `∞ norm, the matrix norm is given by: kAk = maxy∈Y {kAyk∗1 : kyk1 = 1} = maxi,j |Ai,j |. Remark 2. Note that kAk is not at the scale of the maximum payoff difference in the original game. The values in A are scaled by the probability of the observed nature outcomes on the path of each sequence. Thus, kAk is exponentially smaller (in the number of observed nature steps on the path to the maximizing sequence) than the maximum payoff difference in the original EFG. Theorem 3 immediately leads to the following convergence rate result for FOMs equipped with dilated entropy DGFs to solve EFGs (and more generally BSPPs over treeplex domains). 13 Theorem 4. Consider a BSPP over treeplex domains X , Y. Then EGT algorithm equipped with the Pdj r dilated entropy DGF with weights βj = 2 + r=1 2 (MXj ,r − 1) for all j ∈ SX and the corresponding setup for Y will return an -accurate solution to the BSPP in at most the following number of iterations: q maxi,j |Ai,j | MX2 2dX +2 MY2 2dY +2 log m .  This rate in Theorem 4, to our knowledge, establishes the state-of-the-art for FOMs with O( 1 ) convergence rate for EFGs. 7.1 Improvements in extensive-form game convergence rate The ratio Ω ϕ of set diameter over the strong convexity parameter is important for FOMs that rely on a prox function, such as EGT and MP. Compared to the rate obtained by [Kroer et al., 2015], we get the following improvement: for simplicity, assume that the number of actions available at each information set is on average a, then our bound improves the convergence rate of [Kroer et al., 2015] by a factor of Ω(dX · adX + dY · adY ). As mentioned previously, Hoda et al. [2010] proved only explicit bounds for the special case of uniform treeplexes that are constructed as follows: 1) A base treeplex Qb along with a subset of b indices from it for branching operations is chosen. 2) At each depth d, a Cartesian product operation of size k is applied. 3) Each element in a Cartesian product is an instance of the base treeplex with a size b branching operation leading to depth d − 1 uniform treeplexes constructed in the same way. Given bounds Ωb , ϕb for the base treeplex, the bound of Hoda et al. [2010] for a uniform treeplex with d uniform treeplex levels (note that the total depth of the constructed treeplex is d · dQb , where dQb is the depth of the base treeplex Qb ) is   Ω 2d−2 2d+2 2 2 Ωb ≤O b k d MQ b . ϕ ϕb Then when the base treeplex is a simplex of dimension m, their bound for the dilated entropy on a uniform treeplex Q becomes   Ω ≤ O |SQ |2 d2Q log m . ϕ Even for the special case of a uniform treeplex with a base simplex, comparing Theorem 3 to their bound, we see that our general bound improves the associated constants by exchanging O(|SQ |2 d2Q ) 2 2dQ ). Since M does not depend on the branching operation in the treeplex, whereas with O(MQ Q |SQ | does, these are also the first bounds to remove an exponential dependence on the branching operation (we have only p a logarithmic dependence). In Example 1 we showed that there exist games where MQ = |SQ |, and in general MQ is much smaller than |SQ |. Consequently, our results establish the best known convergence results for all FOMs based on dilated entropy DGF such as EGT, MP, and stochastic variants of BSPP algorithms. CFR, CFR+, and EGT all need to keep track of a constant number of current and/or average iterates, so the memory usage of all three algorithms is of the same order; when gradients are computed using an iterative approach as opposed to storing matrices or matrix decompositions, each algorithm requires a constant times the number of sequences in the sequence-form representation. Therefore, we compare mainly the number of iterations required by each algorithm. Since the theoretical properties of CFR and CFR+ are comparable, we compare to CFR, with all statements being valid for CFR+ as well. 14 CFR has a O( 12 ) convergence rate; but its dependence on the number of information sets is only linear (and sometimes sublinear [Lanctot et al., 2009]). Since our results have a quadratic 2 , CFR sometimes has a better dependence on game constants and can be more dependence on MQ attractive for obtaining low-quality solutions quickly for games with many information sets. MCCFR and CFR+ have a similar convergence rate [Lanctot et al., 2009], though MCCFR has cheaper iterations. Gilpin et al. [2012] give an equilibrium-finding algorithm presented as O(ln( 1 )); but this form of their bound has a dependence on a certain condition number of the A matrix. Specifically, their √ kAk2,2 ·ln(kAk2,2 /)· D iteration bound for sequential games is O( ), where δ(A) is the condition number δ(A) 2 of A, kAk2,2 = supx6=0 kAxk kxk2 is the Euclidean matrix norm, and D = maxx,x̄∈X ,y,ȳ∈Y k(x, y) − (x̄, ȳ)k22 . Unfortunately, the condition number δ(A) is only shown to be finite for these games. Without any such unknown quantities based on condition numbers, Gilpin et al. [2012] establish a kAk ·D convergence rate of O( 2,2 ). This algorithm, despite having the same dependence on  as ours in  its convergence rate, i.e., O( 1 ), suffers from worse constants. In particular, there exist matrices such p that kAk2,2 = kAk1,∞ kAk∞,1 , where kAk1,∞ and kAk∞,1 correspond to the maximum absolute column and row sums, respectively. Then together with the value of D, this leads to a cubic dependence on the dimension of Q. For games where the players have roughly equal-size strategy 4 ) as opposed to our constant of O(M 2 ). spaces, this is equivalent to a constant of O(MQ Q 8 Numerical experiments We carry out numerical experiments to investigate the practical performance of EGT on EFGs when instantiated with our DGF. We test these algorithms on a scaled up variant of the poker game Leduc holdem [Southey et al., 2005], a benchmark problem in the imperfect-information game-solving community. In our version, the deck consists of k pairs of cards 1 . . . k, for a total deck size of 2k. Each player initially pays one chip to the pot, and is dealt a single private card. After a round of betting, a community card is dealt face up. After a subsequent round of betting, if neither player has folded, both players reveal their private cards. If either player pairs their card with the community card they win the pot. Otherwise, the player with the highest private card wins. In the event both players have the same private card, they draw and split the pot. First, we investigate the impact of applying the weights used in recurrence (6), as compared to the previous scheme introduced in Kroer et al. [2015]. To instantiate recurrence (6) we have to choose a way to set βj relative to αj . Experimentally, we found that the best way to instantiate the recurrence is to use βj = αj for all j, in spite of the strict inequality required for our proof. This scheme will henceforth be referred to as new weights. We compare these new weights to the weights used in Kroer et al. [2015] (henceforth referred to as old weights). Figure 2 shows the result of running EGT with the old and the new weights. For both the old and the new weights, we found that the scalars MQ and |SQ | applied to each DGF in order to achieve strong convexity modulus 1 according to Corollary 1 and Theorem 5.4 of Kroer et al. [2015], respectively, are too conservative. Instead, we show the results after tuning these parameters for the corresponding algorithms to yield the best results for each weight scheme. Anecdotally, we found that the old weights are more sensitive and more difficult to tune. The performance also seems more jittery; this is evident even in the strongest parameter we found (especially noticeable on 10, 16, and 30-card Leduc in Figure 2). We compare the performance of EGT to that of CFR and CFR+ algorithms on a scaled up variant of the poker game Leduc hold’em [Southey et al., 2005], a benchmark problem in the 15 6−card Leduc 10−card Leduc ● ● Algorithm ● ● ● ● ● ● ● ● ● 0.10 ● ● ● ● ● ● EGT new ● ● ● ● ● ● ● ● ● ● 100 ● ● ● ● EGT new ● ● ● 0.10 ● ● ● ● ● ● ● ● ● ● ● ● 0.01 ● 1000 10 100 tree traversals ● 1000 tree traversals 16−card Leduc 30−card Leduc ● ● Algorithm 1.00 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.01 ● ● ● ● 100 ● ● ● ● 1000 EGT new ● 0.10 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 10 tree traversals EGT old ● ● ● 0.01 ● 10 ● EGT new ● 0.10 Algorithm 1.00 EGT old regret ● regret EGT old ● ● ● ● 0.01 10 Algorithm 1.00 EGT old regret regret 1.00 100 1000 tree traversals Figure 2: Regret as a function of the number of iterations for EGT with our weighting scheme (EGT new) and with the weighting scheme from Kroer et al. [2015] (EGT old). Both axes are on a log scale. 16 6−card Leduc 10−card Leduc ● ● ● ● regret 1.00 Algorithm ● ● ● ● ● ● ● ●● ● ●● ● ●● ●● ●● ● CFR ● Algorithm ● ● 1.00 ● ● ●● CFR+ ●● ●● ● ●● ●●● ●● ● EGT ● ●● 0.10 ●● ● ● ●● ●● regret ● ● ● ●● ●● ●● CFR+ ●● ●● ●● ● ●●● 0.10 ● ● ● ●● EGT ●● ● ● ●● ●● ●● ● 0.01 0.01 10 100 1000 10 100 tree traversals 1000 tree traversals 16−card Leduc 30−card Leduc ● ● ● Algorithm ● ● ● ● ●● ● ● ● ●● ●● ● ●● ● ●● ● ● CFR 1.00 CFR+ ●● ●● ●●● 0.10 ●● ●●● EGT ●● ●● ● ●● ●● ● ● ●● regret ● 1.00 regret CFR ● ● ● ● ● Algorithm ● ● ● ● ● ● ● ●● ● ● ●● ●●● ● CFR CFR+ ●● ●● ●● ●● 0.10 ●● EGT ●●● ●●● ●● ●●● ●● ●●● 0.01 0.01 10 100 1000 10 tree traversals 100 1000 tree traversals Figure 3: Regret as a function of the number of tree traversals in four different variants of Leduc hold’em for the CFR, CFR+, and EGT algorithms. Both axes are shown on a log scale. imperfect-information game-solving community. In our version, the deck consists of k pairs of cards 1 . . . k, for a total deck size of 2k. Setting k = 3 yields the standard Leduc game. Each player initially pays one chip to the pot, and is dealt a single private card. After a round of betting, a community card is dealt face up. After a subsequent round of betting, if neither player has folded, both players reveal their private cards. If either player pairs their card with the community card, they win the pot. Otherwise, the player with the highest private card wins. In the event both players have the same private card, they draw and split the pot. The results are shown in Figure 3. Each graph is a loglog plot that shows the results for a particular instance of Leduc with 6, 10, 16 and 30 card decks, respectively. For each graph, we show the performance of all three algorithms, with the x-axis showing the number of tree traversals, and the y-axis showing the sum of regrets over the two players. We note that tree-travels is a good proxy for overall computational effort because the majority of the time in FOMs is spent on gradient computations, which in our case directly translates into tree-traversals. We find that EGT instantiated with our DGF significantly outperforms both CFR and CFR+ across all four variants of Leduc. This is the case across all iterations; EGT finds a stronger initial point in x0 , y 0 (see Algorithm 1), and maintains a stronger convergence rate across all iterations. The performance we get from EGT relative to CFR and CFR+ is surprising due to what the conventional wisdom in the field has been. In Kroer et al. [2015] it was found that, while EGT has better convergence rate, CFR (which performs worse than CFR+) had better initial performance, and it was only after a certain number of iterations that EGT took over. Furthermore, the switch point where EGT is preferable was found to shift outward on the x-axis as the Leduc game size was increased. This sentiment has been mirrored by Brown and Sandholm [2016]. In contrast to this, we find that our DGF along with proper initialization leads to EGT performing better than 17 not only CFR, but also CFR+, at every point on the x-axis. Furthermore, scaling up the game size does not seem to adversely affect this relationship. While the experiments in Figure 3 are very interesting from the perspective of which algorithm to use for large-scale EFG-solving in practice going forward, there are some caveats to keep in mind. First, we only considered number of tree traversals in our performance calculations. However, CFR algorithms have the ability to avoid parts of the tree traversal. For games where accelerated bestresponse calculation [Johanson et al., 2011] can be applied, e.g., poker-like games, this is unlikely to have a big effect. But, for some other games, this aspect can be important, though note that Brown et al. [2017] showed experimentally that pruning can be used in EGT as well. Second, to get superior performance from EGT, we had to hand-tune initialization parameters relating to our DGF, whereas CFR+ requires no tuning. Development of an algorithmic scheme for choosing this tuning parameter in EGT can make it significantly easier to apply the tuned variant of EGT in practice. Third, on another practical aspect, CFR+ is a conceptually very simple algorithm, and thus also easy to implement. In contrast to this, EGT and our DGF requires a safe-guarded numerical implementation because the prox operator associated with our DGF requires taking exponentials. 9 Conclusions We have investigated FOMs for computing Nash equilibria in two-player zero-sum perfect-recall EFGs. On the theoretical side, we analyzed the strong convexity properties of the dilated entropy DGF over treeplexes. By introducing specific weights that are tied to the structure of the treeplex, 2 2dQ +2 log m), we improved prior results on treeplex diameter from O(|SQ |MQ d2d log m) to O(MQ thereby removing all but a logarithmic dependence on branching associated with the branching operator in the treeplex definition. These results lead to significant improvements in the convergence rates of many FOMs that can be equipped with dilated entropy DGFs and used for EFG solving including but not limited to EGT, MP, and Stochastic MP. We numerically investigated the performance of EGT and compared it to the practical state-ofthe-art algorithms CFR and CFR+. Our experiments showed that EGT with the dilated entropy DGF, when tuned with a proper scaling, has better practical, as well as theoretical, convergence rate than CFR+, the current state-of-the-art algorithm in practice. While our scaling parameter for the DGF did not require extensive tuning, we believe a more principled way of setting it is worthy of further future investigation. Theorems 1 and 2 establish bounds for a general class of weights βj satisfying the recurrence (6). Then in Corollary 1, we have selected a particular weighting scheme for βj satisfying (6) and performed our numerical tests. There may be other interesting choices of βj satisfying the recurrence (6). Thus, finding a way to optimally choose among the set of weights satisfying (6) to minimize the polytope diameter for specific games is appealing. On a separate note, in practice CFR is often paired with an abstraction technique [Sandholm, 2010] such as those mentioned in Section 2. This is despite the lack of any theoretical justification. Effective ways to pair FOMs such as MP and EGT with practical abstraction techniques [Brown et al., 2015] or abstraction techniques that achieve solution-quality guarantees [Lanctot et al., 2012, Kroer and Sandholm, 2014, 2016] are also worth further consideration. 18 References Branislav Bosansky, Christopher Kiekintveld, Viliam Lisy, and Michal Pechoucek. An exact doubleoracle algorithm for zero-sum extensive-form games with imperfect information. Journal of Artificial Intelligence Research, pages 829–866, 2014. Michael Bowling, Neil Burch, Michael Johanson, and Oskari Tammelin. Heads-up limit hold’em poker is solved. Science, 347(6218):145–149, January 2015. Noam Brown and Tuomas Sandholm. Regret transfer and parameter optimization. In AAAI Conference on Artificial Intelligence (AAAI), 2014. Noam Brown and Tuomas Sandholm. Strategy-based warm starting for regret minimization in games. In AAAI Conference on Artificial Intelligence (AAAI), 2016. Noam Brown, Sam Ganzfried, and Tuomas Sandholm. Hierarchical abstraction, distributed equilibrium computation, and post-processing, with application to a champion no-limit Texas Hold’em agent. In International Conference on Autonomous Agents and Multi-Agent Systems (AAMAS), 2015. Noam Brown, Christian Kroer, and Tuomas Sandholm. Dynamic thresholding and pruning for regret minimization. In AAAI Conference on Artificial Intelligence (AAAI), 2017. Constantinos Daskalakis, Paul W Goldberg, and Christos H Papadimitriou. The complexity of computing a nash equilibrium. SIAM Journal on Computing, 39(1), 2009. Constantinos Daskalakis, Alan Deckelbaum, and Anthony Kim. Near-optimal no-regret algorithms for zero-sum games. Games and Economic Behavior, 92:327–348, 2015. Andrew Gilpin and Tuomas Sandholm. Lossless abstraction of imperfect information games. Journal of the ACM, 54(5), 2007. Andrew Gilpin, Javier Peña, and Tuomas Sandholm. First-order algorithm with O(ln(1/)) convergence for -equilibrium in two-person zero-sum games. Mathematical Programming, 133(1–2): 279–298, 2012. Conference version appeared in AAAI-08. John Hawkin, Robert Holte, and Duane Szafron. Automated action abstraction of imperfect information extensive-form games. In AAAI Conference on Artificial Intelligence (AAAI), 2011. John Hawkin, Robert Holte, and Duane Szafron. Using sliding windows to generate action abstractions in extensive-form games. In AAAI Conference on Artificial Intelligence (AAAI), 2012. Jean-Baptiste Hiriart-Urruty and Claude Lemaréchal. Fundamentals of convex analysis. 2001. Samid Hoda, Andrew Gilpin, Javier Peña, and Tuomas Sandholm. Smoothing techniques for computing Nash equilibria of sequential games. Mathematics of Operations Research, 35(2): 494–512, 2010. Conference version appeared in WINE-07. Albert Jiang and Kevin Leyton-Brown. Polynomial-time computation of exact correlated equilibrium in compact games. In Proceedings of the ACM Conference on Electronic Commerce (EC), 2011. 19 Michael Johanson, Kevin Waugh, Michael Bowling, and Martin Zinkevich. Accelerating best response calculation in large extensive games. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), 2011. Anatoli Juditsky and Arkadi Nemirovski. First order methods for nonsmooth convex large-scale optimization, i: general purpose methods. Optimization for Machine Learning, pages 121–148, 2011a. Anatoli Juditsky and Arkadi Nemirovski. First order methods for nonsmooth convex large-scale optimization, ii: utilizing problems structure. Optimization for Machine Learning, pages 149–183, 2011b. Daphne Koller, Nimrod Megiddo, and Bernhard von Stengel. Efficient computation of equilibria for extensive two-person games. Games and Economic Behavior, 14(2):247–259, 1996. Christian Kroer and Tuomas Sandholm. Extensive-form game abstraction with bounds. In Proceedings of the ACM Conference on Economics and Computation (EC), 2014. Christian Kroer and Tuomas Sandholm. Imperfect-recall abstractions with bounds in games. In Proceedings of the ACM Conference on Economics and Computation (EC), 2016. Christian Kroer, Kevin Waugh, Fatma Kılınç-Karzan, and Tuomas Sandholm. Faster first-order methods for extensive-form game solving. In Proceedings of the ACM Conference on Economics and Computation (EC), 2015. Marc Lanctot, Kevin Waugh, Martin Zinkevich, and Michael Bowling. Monte Carlo sampling for regret minimization in extensive games. In Proceedings of the Annual Conference on Neural Information Processing Systems (NIPS), pages 1078–1086, 2009. Marc Lanctot, Richard Gibson, Neil Burch, Martin Zinkevich, and Michael Bowling. No-regret learning in extensive-form games with imperfect recall. In International Conference on Machine Learning (ICML), 2012. Richard Lipton, Evangelos Markakis, and Aranyak Mehta. Playing large games using simple strategies. In Proceedings of the ACM Conference on Electronic Commerce (ACM-EC), pages 36–41, San Diego, CA, 2003. ACM. Michael Littman and Peter Stone. A polynomial-time Nash equilibrium algorithm for repeated games. In Proceedings of the ACM Conference on Electronic Commerce (ACM-EC), pages 48– 54, San Diego, CA, 2003. Matej Moravčı́k, Martin Schmid, Neil Burch, Viliam Lisỳ, Dustin Morrill, Nolan Bard, Trevor Davis, Kevin Waugh, Michael Johanson, and Michael Bowling. Deepstack: Expert-level artificial intelligence in no-limit poker. arXiv preprint arXiv:1701.01724, 2017. Arkadi Nemirovski. Prox-method with rate of convergence o (1/t) for variational inequalities with lipschitz continuous monotone operators and smooth convex-concave saddle point problems. SIAM Journal on Optimization, 15(1):229–251, 2004. Yurii Nesterov. Excessive gap technique in nonsmooth convex minimization. SIAM Journal of Optimization, 16(1):235–249, 2005a. 20 Yurii Nesterov. Smooth minimization of non-smooth functions. Mathematical Programming, 103: 127–152, 2005b. I. Romanovskii. Reduction of a game with complete memory to a matrix game. Soviet Mathematics, 3:678–681, 1962. Tuomas Sandholm. The state of solving large incomplete-information games, and application to poker. AI Magazine, pages 13–32, Winter 2010. Special issue on Algorithmic Game Theory. Tuomas Sandholm. Abstraction for solving large incomplete-information games. In AAAI Conference on Artificial Intelligence (AAAI), 2015. Senior Member Track. Tuomas Sandholm and Satinder Singh. Lossy stochastic game abstraction with bounds. In Proceedings of the ACM Conference on Electronic Commerce (EC), 2012. Jiefu Shi and Michael Littman. Abstraction methods for game theoretic poker. In CG ’00: Revised Papers from the Second International Conference on Computers and Games, pages 333–345, London, UK, 2002. Springer-Verlag. Finnegan Southey, Michael Bowling, Bryce Larson, Carmelo Piccione, Neil Burch, Darse Billings, and Chris Rayner. Bayes’ bluff: Opponent modelling in poker. In Proceedings of the 21st Annual Conference on Uncertainty in Artificial Intelligence (UAI), pages 550–558, July 2005. Oskari Tammelin, Neil Burch, Michael Johanson, and Michael Bowling. Solving heads-up limit Texas hold’em. In Proceedings of the 24th International Joint Conference on Artificial Intelligence (IJCAI), 2015. Bernhard von Stengel. Efficient computation of behavior strategies. Games and Economic Behavior, 14(2):220–246, 1996. Kevin Waugh and Drew Bagnell. A unified view of large-scale zero-sum equilibrium computation. In Computer Poker and Imperfect Information Workshop at the AAAI Conference on Artificial Intelligence (AAAI), 2015. Martin Zinkevich, Michael Bowling, Michael Johanson, and Carmelo Piccione. Regret minimization in games with incomplete information. In Proceedings of the Annual Conference on Neural Information Processing Systems (NIPS), 2007. 21 A A.1 Omitted proofs Proof of Lemma 1 Proof. Consider q ∈ ri (Q) and any h ∈ Rn . For each j ∈ SQ and i ∈ Ij , the second-order partial derivates of ω(·) w.r.t. qi are: X X βk ql X βk βj βj + + , (11) ∇2q2 ω(q) = = 2 i qi qi qi qi i i k∈Dj l∈Ik k∈Dj P where the last equality holds because k ∈ Dji and thus l∈Ik ql = kq k k1 = qpk = qi . Also, for each j ∈ SQ , i ∈ Ij , k ∈ Dji , and l ∈ Ik , the second-order partial derivates w.r.t. qi , ql are given by: ∇2qi ,ql ω(q) = ∇2ql ,qi ω(q) = − βk . qi (12) Then equations (11) and (12) together imply     X X   βj X βk  X X 2βk  2 h> ∇2 ω(q)h = hi hl hi  + − . qi qi qi i i j∈SQ i∈Ij k∈Dj (13) k∈Dj l∈Ik Given j ∈ SQ and i ∈ Ij , we have pk = i for each k ∈ Dji and for any k ∈ Dji , there exists some other j 0 ∈ SQ corresponding to k in the outermost summation. Then we can rearrange the following terms: X X X βk X XX X X h2pj X X 2hi hpj 2βk 2 hi and hi hl . = βj = βj qi qp j qi qp j i i j∈SQ i∈Ij j∈SQ i∈Ij k∈Dj l∈Ik j∈SQ k∈Dj j∈SQ i∈Ij Using these two equalities in (13) leads to (7) and proves the lemma. A.2 Proof of Theorem 3 Proof. For our choice of scaled weights βj , Corollary 1 implies that the resulting dilated entropy function is strongly convex with modulus ϕ = 1. Hence, we only need to bound Ω. Any vector q ∈ Q satisfying qi ∈ {0, 1} for all i maximizes ω(q) and results in maxq∈Q ω(q) = 0. For the minimum value, consider any q ∈ ri (Q). Applying the well-known lower bound of − log m for the negative entropy function on an m-dimensional simplex, we have ω(q) = X j∈SQ dQ X qi X X qi β j qp j log ≥− βj qpj log m = − qp j qp j j∈SQ i∈Ij X βj qpj log m d=0 j∈SQ :dj =d dQ =− X X βj qpj log m − d=1 j∈SQ :dj =d = −MQ log m dQ X X X   d X r qp j 2 + 2 (MQj ,r − 1) − MQ r=1 d=1 j∈SQ :dj =d ≥ −MQ log m dQ X βj qpj log m j∈SQ :dj =0 X d=1 j∈SQ :dj =d qpj MQj d X 2r − 2MQ log m r=1 22 X 2qpj log m j∈SQ :dj =0 X j∈SQ :dj =0 qpj , (14) where the last inequality follows because for each j ∈ SQ with dj = 0, the definition of MQ imP P plies j∈SQ :dj =0 qpj ≤ MQ , and for each j ∈ SQ with dj = d ≥ 1, we have 2 + dr=1 2r (MQj ,r − 1) ≤ P Pd Pd r r r=1 2 MQj since MQj,r ≤ MQj . Also, from Fact 1(b), we have j∈SQ :dj =d qpj MQj ≤ r=1 2 MQj ,r ≤ MQ . Then we arrive at (14) ≥ 2 −MQ log m    dQ d dQ X X  X 2 r d+1 2+ 2 = −MQ log m 2 + (2 − 2) d=1 r=1 d=1   dQ X 2 2 d+1 = −MQ log m 2 + (log m)2dQ +2 , 2 − 2dQ ≥ −MQ d=1 where the last inequality follows because for dQ = 0 we have 2dQ +2 = 4 > 2 and for dQ ≥ 1 we have 2dQ ≥ 2. 2 (log m)2dQ +2 , coupled with This lower bound on the minimum value, i.e., minq∈Q ω(q) ≥ −MQ maxq∈Q ω(q) ≤ 0, establishes the theorem. 23
2cs.AI
Analytical modeling and analysis of interleaving on correlated wireless channels Dmitri Moltchanova,c,∗, Pavel Kustarevb , Yevgeni Kucharyavya,d a Department of Electronics and Communications Engineering, Tampere University of Technology, Tampere, Finland b Department of Embedded Systems, ITMO University, St.-Petersburg, Russia c Peoples Friendship University of Russia (RUDN University) 6 Miklukho-Maklaya St, Moscow, 117198, Russian Federation arXiv:1801.09923v1 [cs.IT] 30 Jan 2018 d School of Business Informatics Faculty of business and management National Research University Higher School of Economics, Moscow, Russia Abstract Interleaving is a mechanism universally used in wireless access technologies to alleviate the effect of channel correlation. In spite of its wide adoption, to the best of our knowledge, there are no analytical models proposed so far. In this paper we fill this void proposing three different models of interleaving. Two of these models are based on numerical algorithms while one of them allows for closed-form expression for packet error probability. Although we use block codes with hard decoding to specify the models our modeling principles are applicable to all forward error correction codes as long as there exists a functional relationship (possibly, probabilistic) between the number of incorrectly received bits in a codeword and the codeword error probability. We evaluate accuracy of our models showing that the worst case prediction is limited by 50% across a wide range of input parameters. Finally, we study the effect of interleaving in detail demonstrating how it varies with channel correlation, bit error rate and error correction capability. Numerical results reported in this paper allows to identify the optimal value of the interleaving depth that need to be used for a channel with a given degree of correlation. The reference implementations of the models are available [1]. Keywords: wireless channels, per-source performance analysis, cross-layer, wireless backhauling, mm-waves 1. Introduction In spite of significant progress in hardware design and associated signal processing algorithms made over the last decades wireless channels still remain prone to transmission errors. The reason is that reliability and hardware complexity is often traded for additional capacity at the air interface. Forward error correction (FEC) codes along with retransmission techniques are supposed to be responsible for concealing residual errors. FEC codes are nowadays used in most modern wireless access technologies. It is well documented that FEC codes show their best performance when bit errors happen at random without any sort of dependence between them. On the other hand, wireless channels are known to exhibit a high degree of correlation manifesting itself in clipping of bit errors. Although there are codes that may tolerate a certain degree of error clipping (e.g. Reed-Solomon codes) correlated channel statistics lead to their sub-optimal performance. ∗ Corresponding Author. Email addresses: [email protected] (Dmitri Moltchanov), [email protected] (Pavel Kustarev), [email protected] (Yevgeni Kucharyavy) Preprint submitted to Computer Communications In spite of universal usage of interleaving, to the best of our knowledge there are no analytical models capturing its performance. The reason is twofold. First, most studies of wireless channel performance have been carried out assuming that the correlation in the bit error process is effectively removed using interleaving. In those investigations, where the correlation in the bit error process has been explicitly assumed, no interleaving functionality was considered. System level simulators that are widely used nowadays to evaluate performance of wireless access technologies may include interleaving as a basic block at the physical layer. However, interleaving is still implemented in rather unguided manner, i.e. the interleaving depth is set to some default value. Due to these reasons, interleaving is regarded as one of the features of wireless channels prohibiting their detailed cross-layer analytical studies. In this paper we will fill this void proposing three analytical models for interleaving having different degree of complexity and accuracy. Our models are suitable for any FEC codes with hard decoding that can correct k bits (symbols) in a codeword of length n. This is the case for block codes such as BCH and RS codes. Minor modifications January 31, 2018 are required for codes with soft decoding, e.g. RS or turbo codes. Nevertheless, the models are applicable as long as there is relationship, possibly probabilistic, between the number of incorrectly received bits in a codeword and the codeword error probability. The rest of the paper is organized as follows. In Section 2 we highlight the importance of accurate modeling of interleaving process and introduce the system model we work with. Further, in Section 3, three models for interleaving having different degree of complexity and accuracy are introduced. We assess accuracy of the models in Section 4. The effect of interleaving is analyzed in detail in Section 5. Conclusions are given in the last section. 2.1. Wireless channel model In this study, to make the model universally applicable we abstract the channel organization mechanisms assuming the bit error statistics as the input to the model. We consider the bit error process as a covariance stationary binary process, where 1 and 0 denote incorrect and correct bit reception, respectively. Consider a discretetime environment with constant slot duration ∆t corresponding to the amount of time required to transmit a single bit over a wireless channel. We model the bit error process using the discrete-time Markov modulated process with irreducible aperiodic Markov chain {S(u), u = 0, 1, . . . }, S(u) ∈ {0, 1}. When at most single event is allowed to occur in a slot this process is known as switched Bernoulli process (SBP). To parameterize a covariance stationary binary process only mean value and lag-1 normalized autocorrelation (NACF) coefficient have to be captured. It was shown in [2] that there is a special case of SBP called interrupted Bernoulli process (IBP) exactly matching mean and lag-1 NACF value. It is given by ( ( α = (1 − c)pE f1 (1) = 0 , (1) β = (1 − c)(1 − pE ) f2 (1) = 1 2. System Model The notation used in the paper is provided in Table 1. Table 1: Notation used in the paper. Parameter ∆t I n k l M (i) cj {S(u)} α, β c pE pI p pC cC ν00 , ν11 f1 (1), f2 (1) D D(1), D(0) A(0), A(1) 1I D(i, n) D(i, j, n) ~h ~v P Q qij ~0 T FT (k) ~ πC DC (0) αC , β C Φ(x) µ, σ p̂ N γ IL Definition Time to transmit a single bit Number of codewords Length of the codewords in bits Number of data bits in a codewords Number of data bits that can be corrected Number of interleaved codeblocks in a packet where f1 (1) and f2 (1) are bit error probabilities in states 1 and 2, respectively, α and β are transition probabilities from state 1 to state 2 and from state 2 to state 1, respectively, c is the lag-1 NACF value of bit error observations, pE is the BER. Letting D be transition probability matrix and defining the following matrices     1 0 0 0 A(0) = , A(1) = (2) 0 0 0 1 Bit j of codeword i Bit error process Transition probabilities of bit error process Lag-1 NACF of the bit error process Bit error probability Interleaved codeblock error probability Packet error probability Codeword error probability Lag-1 NACF of the codeword error process Probability of correct/incorrect first two codewords Bit error probability is states 1 and 2 Transition matrix of the bit error process Transition matrices with and without error Supplementary matrices, A(0) + A(1) = 1I Identity matrix nI-steps matrix with i incorrect bits nI-steps matrix with i and j incorrect bits Initial state probability vector Transitions rates from transient to absorbing state Rate matrix of the absorbing chain Rate matrix of transient states Transition rate between state i and j Zero vector of appropriate size Time till absorption CDF of time till absorption in k steps Stationary distribution of the codeword process Transition matrix of codeword process with error Transition probabilities of codeword error process Error function Mean and variance of pI estimate Estimate of the packet error probability Number of experiments Confidence probability Indicator of the packet loss event the model is described by two matrices D(0) = D × A(0) and D(1) = D×A(1) describing transitions between states of the model with correct and incorrect reception of a bit. Since A(0) + A(1) = 1I , where 1I is the identity matrix. Note that the channel model introduced above may not exactly capture correlation properties of various propagation environments. However, in practical situations, exact behavior of NACF is not known. The proposed model provide the so-called ”first-order” approximation of correlated channel behavior. A special advantage of the model is that it can be easily tuned to explore the qualitative and quantitative effects of correlation. Still the extension of the model to the case of general finite-state Markov chain (FSMC, [3]) is straightforward. Indeed, irrespective of the number of states used to represent the bit error process and probabilities of bit errors in each state we can always partition D into D(0) and D(1) such that D = D(0) + D(1). Finally, if wireless channels conditions exhibit piecewise stationary behavior as was reported in a number of studies (see e.g. [4, 5]), this model may represent statistical characteristics of covariance stationary parts. In this case, (1) is interpreted as a model for a limited duration of time during which mean value and NACF of bit error observations remain constant. 2 2.2. Interleaving process developed using Bose-Hocquenghem-Chaudhuri (BCH) FEC codes as an example, they can be extended to the case of any type of FEC code. For those codes having no closedform expression for codeword error probability (e.g. convolutional, turbo or low-density parity check codes) it can be obtained via simulation studies. A BCH code is represented by a triplet (n, k, l), where n is the size of the codeword, k is the number of data bits in a codeword, l is the number of incorrectly received bits that can be corrected. A codeword is correctly decoded when the number of bit errors is less or equal to l. Assume that data are encoded into I, I > 0, codewords of the same length n. We denote these codewords by c(i) , (i) i = 1, 2, . . . where bit j of ith codeword is cj . Without interleaving these bits would have been sent as (1) (1) (I) (I) c1 , c2 , . . . , c(1) n , . . . , c1 , . . . , c n , (3) and in case of a deep channel fade we may incorrectly receive a significant amount of bits belonging to the same codeword. This may eventually lead to inability to decode this codeword even when the overall ”average” channel quality is acceptable. Let us now introduce interleaving of depth I, I > 1. According to the concept, we first combine I codewords into a matrix of size n×I, where each codeword represents a row, i.e.  (1) (1) (1)  (1) c1 c2 c3 . . . cn  (2) (2) (2) (2)  c1 c2 c3 . . . cn   . (4) .. .. ..  ..  .  .  . . . .  (I) c1 (I) c2 (2) c3 ... 2.3. Related work There have been several attempts to model the interleaving mechanism in the past, see e.g., [6, 7, 8, 9, 10, 11] for a brief account of studies. The authors in [6] the authors develop an optimal interleaving scheme for convolutional codes when the error burst size, known in advance, is greater than the allowed interleaving depth. In [7] the authors proposed to combine the functionality of FEC codes and interleaver into a single module. The modification allows to dynamically change the interleaving depth and strength of the FEC to dynamically adapt to changing wireless channel conditions. The performance of the proposed scheme has been evaluated using the computer simulations. An optimal interleaving scheme for transmission of audio information over the wireless channels has been developed in [8]. The simulation approach has been chosen for performance assessment. The study in [9] analyze interleaving as a part of the signal space diversity concept for wireless channel, where they derived a closed form expression for the upper bound of bit error rate M -ary phase shift keying in Rayleigh fading channel. A comprehensive analytical model for delay analysis of FEC codes with interleaving over fading channels has been proposed in [10, 11]. The bit error process was assumed to follow FSMC. As the major emphasis of the work was on delay induced by the interleaving procedure no results on the interleaved codeblock and packet error probabilities have been provided. Summarizing the related work we conclude that the interleaving studies performed so far introduced significant simplifications to the wireless channel behavior or relied on the simulation studies to derive performance metrics of interest or concentrated on simple bounds on optimal interleaving depth. Is spite of the universal use of the interleaving mechanism, the simple yet accurate interleaving model is still missing. (I) cn Given the matrix (4), we perform its column-wise trans(1) mission, i.e. column n is transmitted first with c1 being (1) the first bit sent, then column n − 1 starting with c2 , etc. The transmitted sequence of bits looks as (1) (2) (I) (2) (I) c1 , c1 , . . . , c1 , . . . , c(1) n , cn , . . . , cn . (5) Observing (5) we see that those bits that go back-toback in a codeword are transmitted I bits apart. The interleaving procedure tries to ensure that adjacent bits in a codeword are not similarly affected by the current channel conditions of a channel. Thus, interleaving tries to reduce the memory of a channel. The parameter I is called the interleaving depth. The reverse operation is performed at the receiving end. When interleaving of depth I > 1 is used the length of a packet is M In bits, where M is the number of interleaving blocks. When the product In is not small (i.e., more than few tens) a good approximation of the packet error probability is obtained by p = 1 − (1 − pI )M , (6) where pI is the probability of incorrect reception of I interleaved codeblock. Thus, it is sufficient to estimate the probability of correct reception of an interleaving block consisting of I codewords. Applying (6) we shrink the memory of the channel model at In. Since In is often large, this effect is negligible in practical applications. In this paper we study interleaving using packet error probability as the main metric of interest. We define the packet error probability as the probability that at least one codeword is incorrectly decoded. Although our models are 3. Interleaving Model 3.1. Approach at the glance The core idea of the models specified below consists in translating the memory of the bit error model to the interleaved codeblock error probability. such that the Markov 3 structure of the model is preserved. This is done by formulating a new absorbing Markov process describing the dynamics of the codeword transmission process by explicitly tracking the number of incorrectly received bits in successive codewords. To determine the interleaved codeblock error probability we need to estimate the joint distribution of the number of incorrectly received bit in first two codewords parameterizing the model and then estimate the absorption time. As both steps are computationally intensive, we further formulate two simplified models. The first simplified model address the problem of absorption time estimation by defining a two-state Markov chain whose parameter are directly derived from the joint distribution of the number of incorrectly received bits in the first two codewords. For this model the interleaved codeword error probability is provided in closed-form. The last model assumes that the correlation between codewords is the same as correlation between individual bits removing the need for calculating the joint distribution. cumulative distribution function (CDF) of the number of transitions till absorption is given by FT (k) = P r{T ≤ k} = 1 − ~hQk~e, (9) where ~h is the initial state probability vector. Letting k = I in (9) gives us the probability we are looking for. We need three parameters to specify the model: matrix Q, describing transition probabilities between transient states, ~v , describing transitions between transient and absorbing states and the initial state probability vector, ~h. Both Q and ~v can be obtained by estimating twodimensional distribution of the number of incorrectly received bits received in the first and second codewords. The idea of the numerical algorithm is that bits of the first and second codewords are transmitted back-to-back over the wireless channel and these pairs of bits are separated by I − 2 transmission slots as shown in Fig. 1. steady-state 3.2. Absorbing Markov chain model DI We represent the process of transmission of codewords in an interleaved codeblock using an absorbing Markov chain {S(u0 ), u0 = 0, 1, . . . } with the state-space S(u0 ) ∈ {0, 1, . . . , l, l + 1}, where states 0, 1, . . . , l corresponds to the correct reception of a codeword, while state l + 1 aggregates those states resulting in incorrect reception of a codeword. We start with the initial state distribution ~h = (h0 , h1 , ..., hl+1 ) and observe the process for exactly I steps. As one may observe, the probability of absorption in no more than I steps is the interleaved codeblock error probability, pI . The canonical form of the absorbing Markov chain is [12]   Q ~v P = ~T (7) 0 1 c1(1) c1(2) D(i)D(j) ... DI-2 c1(I) c2(1) c2(2) D(i)D(j) ... c2(I) t DI-2 Figure 1: Estimating two-dimensional distribution. between states of the bit error model associated with i and j, i, j = 0, 1 incorrectly received bit in the first and second slots, respectively. We have D(i, j) = D(i)D(j). Let the set of matrices D(i, j, n) contain nI-step conditional transition probabilities of the bit error process associated with with i, j, i, j = 0, 1, . . . , n, incorrectly received bits in the first and second codeword, respectively. We get D(i, j, n) recursively as D(i, j, n) = where Q is l×l matrix whose elements, qij , i, j = 0, 1, . . . , l, define transition probabilities between transient states of the absorbing Markov chain, ~0T is the vector of zeros, and ~v = (v0 , v1 , . . . , vl ) is the vector containing transitions between transient and absorbing states. Introducing ~e as a vector of ones of size l, and noticing that the sum of all rows in (7) must be 1 we have that ~v + Q~e = ~e, DI 1 X 1 X D(i − k, j − l, k − 1)D(i)D(j). (10) k=0 k=0 Now, we can estimate probabilities of transitions as qij = ~π D(i, j, n)~e, i, j = 0, 1, . . . , l. n X vi = ~π D(i, j, n)~e, i = 0, 1, . . . , l. (11) j=l+1 (8) where ~π is the steady-state distribution of the bit error process, ~e is the vector of ones of appropriate size. The only thing left is to compute the elements of the initial state probability vector ~h. According to the definition hi , i = 0, 1, . . . , l, is the probability that there are exactly i incorrectly received bits in a first codeword. To get elements ~h it is sufficient to know one-dimensional distribution of the number of incorrectly received bits in a codeword. This distribution can be obtained from twodimensional distribution qij by summing up over all j. implying that the model is completely characterized by Q. For a Markov chain defined in (7)-(8) we are interested in the probability of absorption in no more than I steps. We compute it as follows. Recall, that the time till absorption is a discrete distribution of phase-type over the set of positive integers [13]. This distribution is also the first passage time distribution to the state l + 1. Let T denote the random variable describing the time till absorption. The 4 3.3. Two-state Markov chain model over the number of incorrectly received errors in a codeword, by the two-state Markov chain we loose in accuracy of the model. Particularly, this procedure deteriorates the memory structure of the original model. Still, if the loss in accuracy is not drastic, the gain we potentially get avoiding estimation of first passage time distribution can be a deciding factor for choosing this model, especially for large values of I and l. The model introduced in the previous section consists of two successive steps. We first estimate two-dimensional distribution of the number of errors in first two codewords and then apply an absorbing Markov chain to model the process of successive reception of I codewords. Further, we need to compute the interleaved codeblock error probability, pI , by taking an l × l matrix Q into a power of I. When the error correction capability l and interleaving depth I are both rather large this incurs an additional computational overhead. Once two-dimensional distribution of incorrectly received bits in first two codewords is obtained we can define a new discrete-time two-step Markov chain {SC (u0 ), u0 = 0, 1, . . . }, SC (u0 ) ∈ {0, 1} modeling the process of codeword reception, where 0 denotes a correctly received codeword while 1 implies incorrect reception. Note that a new interval duration is exactly n times that of the bit error process, where n is the length of a codeword. Having twodimensional distribution qij , i, j = 0, 1, . . . , n one can estimate both the codeword error probability and lag-1 NACF value as pC = l X n X 3.4. Simple two-state Markov chain model Both models introduced above involve estimation of two-dimensional distribution. For large values of n, say n > 1000, we need to estimate a matrix containing 10E6 elements. For practical applications we would like to have an easy-to-compute approximation, preferably providing closed form expression, that is developed below. The major assumption is that for any I > 1 the correlation between outcomes of codewords reception is likely similar to that between individual bit transmissions. To parameterize the codeword error process we need the codeword error probability and the lag-1 NACF value. The latter is readily available. Although the codeword error probability can be obtained from two-dimensional distribution of the number of errors in two adjacent codewords we avoid this step estimating the number of errors in a single codeword directly. Let D(j, n), j = 0, 1, . . . , n, be the set of matrices describing transitions of a channel model with exactly j errors in a bit pattern of length n. Starting from D(j, 1) = DI−1 (j), j = 0, 1, where DI−1 (j) is defined as DI−1 (j) = D(j)DI−1 , j = 0, 1, we estimate these matrices recursively using qij , i=0 j=0 P1 cC = i=0 P1 j=0 (i − pC )(j − pc )νij pC − p2C , (12) where in the denominator of the latter expression we used a well-known property of binary processes. Here, νij , i = 0, 1, is the probability of outcome of first two codewords transmissions that can be estimated using qij as ν00 = l l X X i=0 j=0 qij , ν11 = n X n X D(j, i) = 1 X D(j − k, i − 1)DI−1 (k), i = 1, 2, . . . , n − 1, k=0 qij , (13) (14) where ~πC is the steady-state probability vector of the codeword error process, DC (0) is the matrix having transitions between states with correct reception of a codeword. The transition matrix DC (0) can be found similarly D(0) of the bit error process using (1) and (2). Note that (14) is easier to compute compared to finding the first passage time in absorbing Markov chain as steady-state probabilities of the model as well as eigenvectors and eigenvalues of the transition probability matrix are available in closed form as ~πC = (αC /(αC + βC ), βC /(αC + βC )). (16) leading to the following codeword error probability   l X pC = 1 − ~πC  D(j, n) ~e. (17) k=0 and ν01 = 1 − ν00 , ν10 = 1 − ν11 . The interleaved codeblock error probability, pI , is pI = ~πC [DC (0)]I ~e, 1 X D(j − k, n − 1)D(k), D(j, n) = i=l+1 j=l+1 j=0 Once pC is found we use apply (14) to estimate pI . Recall that the number of visits to a state of a two-state Markov chain can be found using closed-form as shown in [14] reducing the complexity of the model further. 3.5. Feasible extensions In this paper we use BCH codes as an example. However, our model can be extended to the case of other block codes with hard decoding. For example, consider ReedSolomon (RS) codes. As opposed to BCH codes RS codes operates over symbols with each symbols consisting of 2d bits. An RS code is defined as (n, k), where n is the length of the codeword, k is the number of error correcting (15) Replacing the absorbing Markov chain model, where we used transitions between states of the process defined 5 bits, while the difference (n − k) represents the number of data symbols. The correction capability of any RS code is b(n − k)/2c symbols. A symbol is incorrectly received if there is at least one bit error in this symbol. It is easy to see that RS codes are inherently more resistant to correlation as it does not matter how many bits are incorrectly received in a single symbol. In practice d = 3, resulting in the symbol length of eight bits is used. Adapting the proposed approach to the case of RS code is intuitively simple. The only difference is that we need to define the symbol error process by firstly estimating matrices describing transitions between states of the channel model with i, i = 0, 1, . . . , 2d , incorrectly received bits and then relating them to the matrices describing correct and incorrect reception of a symbol. Then, we proceed similarly to BCH codes. The proposed approach can also be extended to the case of codes with soft decoding for which there is no deterministic relationship between the number of errors occurring in a codeword and the outcome of a codeword transmission (e.g. convolutional or turbo codes). For these codes the relationship takes probabilistic form and can be obtained via simulations for any finite code length. Knowing the probabilities of i, i = 0, 1, . . . , n, errors in a codeword of size n and the probability of incorrect reception of a codeword conditioned on i errors, we can estimate the probability of incorrect reception of a codeword. The difference compared to BCH or RS codes is that it might be non-negligible for any number of bit errors. Then, we proceed similarly to the BCH case described above. errors in each codeword. Let IL be the loss indicator of the packet. If all the codewords are received correctly this interleaved codeblock is marked as received correctly. We then proceed with the next interleaved codeblock. If all v codeblocks belonging to a packet are received correctly then this packet is marked as correctly received and associated with indicator value is IL = 0. Otherwise, it is incorrectly received and the associated value of loss indicator is set to 1. In order to obtain reliable statistics in all our experiments we simulated for N = 100000 packets. The metric of interest is the packet error probability, p, i.e. the probability that at least one interleaved codeblock out of IM is received incorrectly. Observe that the packet error probability is actually the mean of the loss indicator of a packet IL . Thus, we can replace the problem of estimating the probability of an event by the problem of estimation of the mean of the loss process represented by a binary sequence of 1s and 0s. The unbiased, consistent and effective point estimate of the packet loss probability, p̂, is obtained by averaging the values of all obtained indicators. In addition to the point estimate of the packet error probability we are interested in interval estimates as they allow to make reliable conclusions about deviations of our models from the actual performance. There are a number of ways how to obtain the interval estimate for our data. Here, we briefly explain the approach we use. When the number of experiments N (simulated packets) is large while the point estimate of the packet error probability is not extremely small or very close to 1 the distribution of the point estimate p̂ is approximately Normal. The following holds for a Normal distribution with mean µ and standard deviation σ 4. Comparison of models The purpose of this section is to evaluate the accuracy of the proposed model. We do it by comparing the results obtained using our model with those derived with simulations of the packet transmission process. We use the following short notation to refer to the defined models: P r{|X − µ| < c} = 2Φ(C/σ) = γ, (18) where Φ(·) is the error function, C is some positive constant, and γ is the p confidence probability. Observing that we see that µ = p√andpσ = p(1 − p)/N from 2Φ(C/σ) p t = σ N / p(1 − p) leading to c = t p(1 − p)/N and we may rewrite (18) as p P r{|X − p| < t p(1 − p)/N } = 2Φ(t) = γ. (19) • model 1: two-dimensional distribution, two-state MC; • model 2: one-dimensional distribution, two-state MC; • model 3: two-dimensional distribution, absorbing MC. Thus, the following holds with probability γ p |p̂ − p| < t p(1 − p)/N , 4.1. Simulations and data analysis The simulator is written in C and implements the following simple algorithm for simulating interleaving of BCH codewords. To generate the bit error sequence with a predefined bit error probability and lag-1 NACF value we use discrete autoregressive model of order one, DAR(1). Note that DAR(1) and Markov model we used to represent the bit error process in this paper are stochastically equivalent. The reason for using DAR(1) is that the process is given by a recursion which is more convenient for simulation studies. In our simulations we count the number of bits and once it reaches nI we estimate the number of (20) whose solutions are p p1 = p̂ ± t p̂(1 − p̂)/N , (21) where t is found as Φ(t) = γ/2. For comparison purposes we use BCH codes of length 63 with correction capabilities l = 1, 3, 5, corresponding to k = 57, 45, 36 data bits. The results presented here are representative implying that our conclusions holds for BCH codes with other codeword lengths but similar code 6 p, packet loss probability p, packet loss probability 1 1 0.01 0.01 1´10 1´10 1´10 1´10 -4 1´10 Model, l=1 Simulations, l=1 Model, l=3 Simulations, l=3 Model, l=5 Simulations, l=5 -6 -8 1´10 1´10 - 10 1´10 -4 5.075´10 -3 1´10 0.01005 0.015025 -4 Model, l=1 Simulations, l=1 Model, l=3 Simulations, l=3 Model, l=5 Simulations, l=5 -6 -8 - 10 0.02 1´10 -4 5.075´10 -3 0.01005 pE, bit error probability (a) c = 0.0 p, packet loss probability p, packet loss probability 1 0.1 0.1 0.01 0.01 1´10 1´10 1´10 1´10 -3 1´10 -4 Model, l=1 Simulations, l=1 Model, l=3 Simulations, l=3 Model, l=5 Simulations, l=5 -5 -6 1´10 1´10 1´10 -7 1´10 -4 5.075´10 -3 1´10 0.01005 0.02 (b) c = 0.3 1 1´10 0.015025 pE, bit error probability 0.015025 0.02 -3 -4 Model, l=1 Simulations, l=1 Model, l=3 Simulations, l=3 Model, l=5 Simulations, l=5 -5 -6 -7 1´10 -4 5.075´10 -3 0.01005 pE, bit error probability 0.015025 0.02 pE, bit error probability (c) c = 0.6 (d) c = 0.9 Figure 2: First codeword error probability. rates k/n. The size of a packet is nIv, where v is the number of interleaved codeblocks. In order to demonstrate the effect of different interleaving depths we need to keep the packet size constant. We keep the product vI constant by choosing the following pairs of (I, v): (1, 16), (2, 8), (4, 4), (8, 2), (16, 1). With this choice of (I, v) the whole packet size (including all headers) is always 63×16 = 1008 bits (126 bytes). We exclude the cases c = 0 and (I, v) = (1, 16) as they are trivial. of the first codeword error probability for model 2, while in the next subsection we will take a look at the probability of incorrect reception of the first two codewords. Fig. 2 compares the modeling results with those obtained via simulations for different values l and c. We see that our approach allows to closely approximate this metric implying that the first part of the model correctly predicts the first codeword error probability. Some deviations from the simulation data are again seen when the first codeword error probability approaches 10E − 5. However, these deviations are not systematic and rather randomly spread around the line representing the modeling results. They are attributed to the limited number of experiments set to N = 105 . Comparison of the modeling results with interval estimations (the confidence level set to 0.05) for different values of c and l shown in Fig. 3 approves our conclusions. All analytical results are in-between intervals obtained using simulations except for that region, where the packet error probability falls below 10E − 4. One may also observe that as the absolute value of the BER increases the confidence intervals gets shorter. As we already discussed 4.2. Identifying the ranges of parameters of interest 4.2.1. First codeword error probability All the models proposed in this paper consist of two steps. In one of them (model 2) we estimate the first codeword error probability at the first step. In the other two, the first step consists in estimation of two-dimensional distribution of the number of incorrectly received bits in the first two codewords. A widely used approach for verification of complex models is to check their parts separately. This gives us information as to which part of the model provides accurate approximation and/or which part of the model is the source of bias. Here, we will evaluate accuracy 7 above this is the inherent feature of our interval estimator. So far we observed that all the models are highly sensitive to the value of the lag-1 NACF and the choice of the best model depends on it. Here, we will study the effect of correlation on accuracy of our models. The relative accuracy of all the models for different values of l and (I, v) and fixed value of BER (p = 0.01) is shown in Fig. 6. First of all, notice that the absolute error is not greater than 40% in the worst possible case. Further, it is clear that model 2 differs from the other two. For small and medium values of c this model underestimates the packet error probability. Moreover, its absolute deviation in most cases is greater compared to other models. On the other hand, models 1 and 3 always overestimate the actual performance demonstrating qualitatively similar behavior. The important difference is that for large values of c (c > 0.9) the model 3 clearly outperforms the model 1. Recalling that both these models are computationally intensive incorporating numerical estimation of two-dimensional distribution we see that from the practical point of view model 3 is always preferable. Finally, we would like to note that the accuracy of all the models for finite values of c is almost a convex function of c having a peak at a certain c. The value of c maximizing the error is a function of the interleaving depth I and is independent of l. However, these values do not coincide for models 2 and 3. As one may observe the accuracy of model 2 is always better when model 3 provides the worst possible prediction. The best approximation out of these two models is shown by thick lines in Fig. 6. Concluding this section we claim that model 3 outperforms the other two models for all the considered values of BER, l, and c when accuracy is the only metric of interest. For most input values the results of this model deviate by at most 10% and does not allow for extreme bias for small values of BER. However, if computational complexity comes into play, for all values of input parameters there is an alternative model (either model 1 or model 2) performing as good as model 3, while requiring way less computational efforts. For extremely high values of lag-1 NACF model and high values of l the model 2 performs comparably to the model 3. In other cases model 1 provides provides similar performance. 4.2.2. Incorrect reception of first two codewords Estimation of two-dimensional distribution of the number of incorrectly received bits in the first two codewords is the first step for models 1 and 3. We use it at the second step of the modeling procedure to specify transition probabilities of the absorbing Markov chain. To evaluate accuracy of this step it is sufficient to consider the probability of incorrect reception of at least one of these codewords. This gives the probability of the complement of the event consisting in correct reception of both codewords. There is a strict functional relationship between this event and the joint two-dimensional distribution of the number of incorrectly received bits in first two codewords. The comparison between the point estimates obtained via simulations and the modeling data for probability of incorrect reception of at least one codeword out of the first two is shown in Fig. 4. We see that the modeling results closely match the simulation ones implying that we make no mistakes at this step. It is important to note that (as we will see in the next section) such a good approximation means that these two models correctly predict the probability of incorrect reception of a packet for any packet size and interleaving scheme (I, v) = (2, 8). 4.3. Performance comparison of models Fig. 5 illustrates the relative error of approximation of the packet error probability for all three models and different values of c, l and (I, v) = (16, 1) interleaving scheme. The comparative behavior of models is similar to the case (I, v) = (2, 8) for all considered values of l and small to medium correlation (c = 0.3 and c = 0.6). For small to medium values of c the model 2 is the worst one while the models 1 and 3 provide approximately similar accuracy. In this range of c these two models deviate from empirical results at most by 10% while the prediction according to the model 2 deviates by at most 30%. As the lag-1 NACF grows these conclusions are no longer valid. First of all, surprisingly, model 3 is not the best for c = 0.9 and l = 1 as both models 1 and 2 outperform it by few percents. As l grows while c remains set at 0.9, the model 1 performs worse and worse with deviations reaching two orders of magnitude for small values of BER and l = 3, 5. The model 2 continues to outperform the model 1 for l = 3 and is comparable to the model 3 for l = 5. If one should chose a single model for all the values of BER, c, and l the model 3 is recommended. Another advantage of model 3 is that it does not allow for extreme bias for the small values of BER. However, for all the input values there are simpler model that performs as good as (sometimes better than) model 3. For c = 0.3, 0.6, l = 1, 3, 5, this is the model 1 while for c = 0.9 this is the model 2. Anyway, for any choice of the input parameters there is a model allowing to get results deviating from the empirical data by at most 10%. 5. Numerical study of interleaving In this section we study the effect of interleaving on the packet loss performance of a channel. In what follows, all the presented results are based on model 3 that is found to provide the most accurate results across all ranges of BER, c, and l. We are interested in both qualitative and quantitative effects. 5.1. The effect of interleaving First, consider the effect of interleaving qualitatively, i.e. studying what happens when we increase I from 1 to 16 keeping the packet size constant. Fig. 7 demonstrates 8 p, packet loss probability p, packet loss probability 0.1 0.01 0.01 1´10 1´10 1´10 1´10 1´10 -3 1´10 -4 1´10 Model, c = 0.6 Simulations, c = 0.6 -5 1´10 Model, c = 0.9 Simulations, c = 0.9 -6 1´10 -4 5.075´10 -3 1´10 0.01005 0.015025 0.02 -3 -4 -5 Model, c = 0.6 Simulations, c = 0.6 -6 Model, c = 0.9 Simulations, c = 0.9 -7 1´10 -4 5.075´10 -3 0.01005 pE, bit error probability 0.015025 0.02 pE, bit error probability (a) l = 3 (b) l = 5 Figure 3: Interval estimations for first codeword error probability. Pr. of incorrect reception of at least one codeword Pr. of incorrect reception of at least one codeword 1 1 0.1 0.1 0.01 0.01 -3 1´10 Model, l=1 Simulations, l=1 Model, l=3 Simulations, l=3 -4 1´10 -5 1´10 -4 1´10 Model, l=1 Simulations, l=1 Model, l=3 Simulations, l=3 -3 1´10 -4 -3 5.075´10 0.01005 0.015025 1´10 -4 1´10 0.02 -3 5.075´10 0.01005 pE, bit error probability 0.015025 0.02 pE, bit error probability (a) c = 0.6 (b) c = 0.9 Figure 4: Incorrect reception of at least one out of two first codewords. bigger than 0.916 ≈ 0.18. Similar behavior is observed for l = 3. However, as the correction capability increases the difference becomes bigger. The aim of interleaving is to remove the autocorrelation from the bit error process of a wireless channel. We clearly see it observing the results provided in Fig. 7. However, we also see that even high values of I cannot make the channel completely uncorrelated. This is best exemplified observing Fig. 7(c) and Fig. 7(f) showing the packet loss probability for c = 0.9. We see that for small values of BER completely uncorrelated channel outperforms a correlated one even for I = 16. The reason is again the residual correlation which is non-negligible even for I = 16, 0.916 ≈ 0.18. The difference is as large as one order of magnitude, see Fig. 7(f). For large values of BER the correlated channel with I = 16 is better than that with c = 0.0. The correlated channel also performs better in the region of high BER for other values of I as well. The abovementioned behavior the packet error probability for all the interleaving depths and several values of c and l. We limit presentation to only two values of l as results for higher l are similar. The best performance in terms of the packet error probability is provided by the maximum possible value of the interleaving depth; in our case this is (16, 1) scheme. As the correlation increases the difference between the interleaving schemes grows. The reason is that the residual correlation left between successive bits in a codeword (R = cI ) is higher for bigger values of c and it becomes tougher to conceal these errors due to their grouping in a single codeword. For example, for c = 0.3, l = 1, (8, 2), interleaving scheme performs as good as (16, 1) scheme. The reason is that the residual correlation is negligible for I = 8 and I = 16 (0.38 ≈ 6.5E − 5 and 0.316 ≈ 4.3E − 9). For c = 0.6 the difference between these two schemes is also almost unnoticeable as the residual correlations are still fairly close to zero, 0.68 ≈ 0.02, 0.616 ≈ 2.8E − 4. For c = 0.9 it the difference is noticeable as 0.98 ≈ 0.43 which is significantly 9 Relative error, percent Relative error, percent Relative error, percent 100 Model 1 Model 2 Model 3 100 Model 1 Model 2 Model 3 10 1´10 3 Model 1 Model 2 Model 3 100 1 10 0.1 10 0.01 -3 1´10 -4 1´10 -3 5.075´10 0.01005 0.015025 0.02 1 -4 1´10 5.075´10 -3 0.01005 0.015025 0.02 1 -4 1´10 (a) l = 1, c = 0.3 1´10 Model 1 Model 2 Model 3 100 0.015025 0.02 (c) l = 1, c = 0.9 Relative error, percent Relative error, percent 3 0.01005 pE, bit error probabilit (b) l = 1, c = 0.6 1´10 -3 5.075´10 pE, bit error probability pE, bit error probability Relative error, percent 3 Model 1 Model 2 Model 3 100 1´10 1´10 4 Model 1 Model 2 Model 3 3 100 10 10 10 1 1 1 0.1 0.1 0.01 -3 1´10 -4 1´10 -3 5.075´10 0.01005 0.015025 0.02 0.01 -4 1´10 0.1 -3 5.075´10 0.01005 (d) l = 3, c = 0.3 100 1´10 Model 1 Model 2 Model 3 10 1´10 1 10 5.075´10 -3 0.01005 0.015025 0.02 0.01 -4 1´10 0.02 4 Model 1 Model 2 Model 3 3 10 5.075´10 -3 0.01005 0.015025 0.02 pE, bit error probability pE, bit error probability (g) l = 5, c = 0.3 0.015025 100 0.1 1 0.01005 Relative error, percent 100 Model 1 Model 2 Model 3 -3 (f) l = 3, c = 0.9 Relative error, percent Relative error, percent 5.075´10 pE, bit error probability (e) l = 3, c = 0.6 3 0.1 -4 1´10 0.02 pE, bit error probability pE, bit error probability 1´10 0.015025 0.01 -4 1´10 (h) l = 5, c = 0.6 1 -4 1´10 5.075´10 -3 0.01005 0.015025 0.02 pE, bit error probability (i) l = 5, c = 0.9 Figure 5: Comparison of three models for (I, v) = (16, 1). is related to the way how correlation is removed by interleaving or, precisely, to the insufficient interleaving depth. The reason is that the correlation manifests itself not only in grouping of bit errors but in grouping of correctly received bits as well. In fact, for large values of c, I = 16 is insufficient to completely remove the correlation between successive bits of a single codeword. Since 0.916 ≈ 0.18, bit errors in a codeword still tend to group rather that be completely uncorrelated. Thus, for small values of BER the probability that there will be more than l errors in a codeword is bigger compared to the completely uncorrelated case. On the other hand, when BER is high the correction capability of a code may not be sufficient to correct all the errors in completely uncorrelated case. However, when memory is high these errors tend to group in a single codeword implying that correctly received bits also happen in batches. Since it does not matter how many bits are received in error as long as the codeword is incorrectly received, correlated channel with high lag-1 NACF performs better for large values of BER. When l increases this special effect fades away. In practice, it rarely happens that NACF is strictly exponential, thus, allowing us to use simple approximation for the residual correlation R = cI . If the NACF decays slowly than that the residual correlation is bigger and the correlated channel starts to perform better than completely uncorrelated one sooner compared to what is shown in Fig. 7. This effect is of theoretical interest as the absolute values of the packet error probability in this regime are unacceptable. Note that we cannot increase the interleaving depth arbitrarily for a given packet size and a codeword length. For our choice of n and v we are limited to I = 16. However, choosing shorter codewords with comparable code rate k/n we may increase the interleaving depth and get closer to completely uncorrelated channel behavior. For example, choosing a BCH code out of n = 31 family we may increase the maximum interleaving to approximately 32 instead of 16. Applying the rule of thumb R = cI we see 10 Relative error, percent Relative error, percent Relative error, percent 15 30 20 Model 1 Model 2 Model 3 Best approximation 10 Model 1 Model 2 Model 3 Best approximation 20 10 5 10 -5 0 Model 1 Model 2 Model 3 Best approximation 0 0 0.2 0.4 0.6 0 0.8 1 - 10 0 0.2 0.4 c, lag-1 NACF value 0.6 0.8 1 - 10 0 (a) (I, v) = (4, 4), l = 1 Relative error, percent 0.4 0 0 1 Relative error, percent Relative error, percent 20 0.8 (c) (I, v) = (16, 1), l = 1 40 40 10 0.6 c, lag-1 NACF val (b) (I, v) = (8, 2), l = 1 20 0.2 c, lag-1 NACF value Model 1 Model 2 Model 3 Best approximation Model 1 Model 2 Model 3 Best approximation 20 0 - 20 Model 1 Model 2 Model 3 Best approximation - 10 - 20 0 0.2 0.4 0.6 0.8 - 20 1 - 40 - 40 0 0.2 0.4 0.6 0.8 1 - 60 0 (d) (I, v) = (4, 4), l = 3 Relative error, percent 0.4 0.6 0.8 1 c, lag-1 NACF value (e) (I, v) = (8, 2), l = 3 (f) (I, v) = (16, 1), l = 3 Relative error, percent 40 0.2 c, lag-1 NACF value c, lag-1 NACF value Relative error, percent 40 50 20 20 0 0 0 - 20 Model 1 Model 2 Model 3 Best approximation - 20 - 40 0 0.2 0.4 0.6 0.8 1 - 60 0 0.2 0.4 c, lag-1 NACF value (g) (I, v) = (4, 4), l = 5 - 50 Model 1 Model 2 Model 3 Best approximation - 40 0.6 0.8 1 - 100 c, lag-1 NACF value (h) (I, v) = (8, 2), l = 5 Model 1 Model 2 Model 3 Best approximation 0 0.2 0.4 0.6 0.8 1 c, lag-1 NACF value (i) (I, v) = (16, 1), l = 5 Figure 6: Relative difference as a function of c for pE = 0.01. that the residual correlation between successive bits of the same codeword will be approximately 0.932 = 0.034 implying that the channel becomes almost uncorrelated and approximately five times less correlated (0.18/0.034 ≈ 5) compared to n = 63 and I = 16. as such behavior may actually lead to better performance due to extreme grouping of correctly received bits in the whole packet. Here, we will study the detailed response of a channel to lag-1 NACF. The relative difference between different (I, v) interleaving schemes and (16, 1) scheme as a function of c is shown in Fig. 8. The working expression is (a−b)/b, where a is the value corresponding to (16, 1) scheme. Simply put, these figures show by how many percents (I, v) interleaving schemes are worse compared to the maximum possible interleaving depth I = 16. As one may observe the maximum difference sometimes approaches four orders of magnitude (l = 5, p = 0.005). Another interesting observation is that going from (1, 16) through (2, 8), (4, 4), and (8, 2) to (16, 1) scheme increases performance by the same 5.2. The detailed response to lag-1 NACF So far we considered the detailed response of our models to a wide range of BER values for three values of lag-1 NACF. We see that c and l are the two factors affecting the behavior of interleaving schemes (I, v). In previous section we noticed that the increase of the lag-1 NACF value leads to worse performance in terms of the packet loss probability due to grouping of bit errors in codewords. However, this may or may not hold for extremely high values of c 11 p, packet loss probability p, packet loss probability 1 p, packet loss probability 1 1 0.1 0.1 0.8 0.6 (I,v) = (1,16) (I,v) = (2,8) (I,v) = (4,4) (I,v) = (8,2) (I,v) = (16,1) Simulations, c = 0.0 0.4 0.2 0 -4 1´10 5.075´10 -3 0.01005 0.015025 (I,v) = (1,16) (I,v) = (2,8) (I,v) = (4,4) (I,v) = (8,2) (I,v) = (16,1) Simulations, c = 0.0 0.01 0.02 1´10 -3 1´10 pE, bit error probability -4 5.075´10 -3 1´10 0.01005 0.015025 (I,v) = (1,16) (I,v) = (2,8) (I,v) = (4,4) (I,v) = (8,2) (I,v) = (16,1) Simulations, c = 0.0 0.01 0.02 -3 1´10 -4 5.075´10 -3 0.01005 pE, bit error probability (a) l = 1, c = 0.3 (b) l = 1, c = 0.6 p, packet loss probability 0.02 (c) l = 1, c = 0.9 p, packet loss probability p, packet loss probability 1 1 0.015025 pE, bit error probability 1 0.1 0.01 0.01 1´10 1´10 1´10 1´10 1´10 -4 1´10 1´10 (I,v) = (1,16) (I,v) = (2,8) (I,v) = (4,4) (I,v) = (8,2) (I,v) = (16,1) Simulations, c = 0.0 -6 -8 1´10 1´10 1´10 -3 0.01 -4 -5 (I,v) = (1,16) (I,v) = (2,8) (I,v) = (4,4) (I,v) = (8,2) (I,v) = (16,1) Simulations, c = 0.0 -6 -7 -8 -9 - 10 1´10 0.1 -4 -3 5.075´10 0.01005 0.015025 0.02 1´10 -4 1´10 5.075´10 -3 1´10 1´10 0.01005 pE, bit error probability (d) l = 3, c = 0.3 1´10 0.015025 0.02 pE, bit error probability (e) l = 3, c = 0.6 (I,v) = (1,16) (I,v) = (2,8) (I,v) = (4,4) (I,v) = (8,2) (I,v) = (16,1) Simulations, c = 0.0 -3 -4 -5 1´10 -4 5.075´10 -3 0.01005 0.015025 0.02 pE, bit error probability (f) l = 3, c = 0.9 Figure 7: The effect of interleaving depth I. over N packet transmissions as N → ∞ and can be computed as 1 − Ivkp, where k is the number of data bits per codeword, p is the packet error probability, I is the interleaving depth, and v is the number of interleaving codeblocks per packet. Fig. 9 compares the throughput of several codes with increasing correction capabilities for few values of (I, v) and c. Depending on the lag-1 NACF value different codes need to be used across the considered range of BER. For example, for (2, 8) scheme and c = 0.6, going from pE = 0.0001 to pE = 0.02 we need to change five difference codes. When c goes up to 0.9 the choice of the code becomes simpler as (63, 56, 1) is the best over the (0.0001 − 0.01) range of BER while (63, 36, 5) is the best for (0.01 − 0.02) range. The choice is obviously different as we increase the interleaving depth to (4, 4) and then to (16, 1). The analysis carried out in this section highlights several special effects. One of them is that for a certain value of c stronger FEC code may perform worse compared to those having smaller l even though it may result in smaller packet error probability. Few such examples for (I, v) = (16, 1) interleaving scheme are shown in Fig. 10. As one may observe FEC code (63, 57, 1) operating over the channel with c = 0.9 is vastly outperformed by (63, 51, 2) code operating over the channel with c = 0.0 over the (0.0001−0.01) range of BER. In terms of throughput the former code is better for the whole range of BER. amount, i.e. increasing interleaving depth twice roughly doubles performance of a wireless channel. Further, we see that the gain is different for various values of c. The biggest gains are experienced at moderate values of c and the gain decreases as lag-1 NACF values approaches 1. It is understandable as for extremely high values of c we either do not experience errors at all or they tend to happen inside a single frame eventually leading to the loss of the whole packet. It is also interesting to observe that the effect of correlation is significant even for very small values of c. All the performance curves demonstrated in Fig. 8 start in the same point corresponding to c = 0.0 and then quickly start to deviate from each other. Already for c = 0.02 they may deviate by as much as one order of magnitude. 5.3. Throughput The packet error probability we concentrated on in previous sections is indeed the most important metric when deciding upon the choice of the interleaving depth for a code with a given error correction capability l. However, the code rate k/n usually decreases faster than a linear function as the correction capability increases. We also saw that the packet error probability decreases faster than a linear function as l increases. Thus, when choosing an optimal code rate we need to rely on the achievable throughput not on the packet error probability alone. In this subsection we highlight how the throughput changes when codes with different l are used. The throughput, E[T ], is defined as the number of delivered bits averaged 12 Relative difference, percent Relative difference, percent 3 1´10 Relative difference, percent 100 100 100 10 10 10 1 1 1 0.1 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) 0.1 0.1 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) 0.01 -3 0.01 0 0.25 0.5 0.75 1´10 1 -3 0 0.25 0.5 c, lag-1 NACF value 0.75 1 1´10 0 1 Relative difference, percent 4 3 1´10 4 0.75 (c) l = 1, p = 0.015 Relative difference, percent Relative difference, percent 5 0.5 c, lag-1 NACF value (b) l = 1, p = 0.010 1´10 0.25 c, lag-1 NACF value (a) l = 1, p = 0.005 1´10 3 1´10 1´10 100 3 1´10 100 100 10 10 10 1 1 1 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) 0.1 0.01 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) 0.1 -3 1´10 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) 0.01 0.01 0 0.25 0.5 0.75 0.01 0 1 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) 0.1 0.25 0.5 0.75 1 0 0.25 0.5 c, lag-1 NACF value c, lag-1 NACF value (d) l = 3, p = 0.005 (e) l = 3, p = 0.010 Relative difference, percent 0.75 1 c, lag-1 NACF value (f) l = 3, p = 0.015 Relative difference, percent Relative difference, percent 7 7 1´10 1´10 6 1´10 5 1´10 5 1´10 4 1´10 3 1´10 3 10 1 0.1 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) -3 1´10 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) 0.01 -5 1´10 1´10 100 10 -4 0 0.25 0.5 0.75 1 1´10 -3 0 0.25 0.5 c, lag-1 NACF value (g) l = 5, p = 0.005 vs. (1,16) vs. (2,8) vs. (4,4) vs. (8,2) 0.1 0.75 1 c, lag-1 NACF value (h) l = 5, p = 0.010 1´10 0 0.25 0.5 0.75 1 c, lag-1 NACF value (i) l = 5, p = 0.015 Figure 8: Relative difference between (I, v) and (16, 1). 6. Conclusions data has a very special form with two peaks. One of these peaks depends on the interleaving depth I and and happens when the values of lag-1 NACF are close to 1. For all the considered parameters the worst observed deviation was 20%. However, we also observed that that less complex models such as those based on two-state Markov chains perform only slightly worse than the abovementioned one. What is more important is that the simplest model based on one-dimensional distribution shows the closest results. This simplest model also allows for closed form expression for the packet error probability making it attractive for analytical performance optimization studies. Finally, given a computational package with arbitrary precision arithmetic (e.g. GNU Multiple Precision Arithmetic Library, GNP, used in Mathematica, [15]) our model allows to compute packet error probabilities for any desirable arbitrarily small value of BER which is hardly possible using simulation studies. Motivated by both the lack of analytical models for interleaving we proposed three models characterized by different degree of complexity. Another motivation behind this work was to enable interleaving in cross-layer performance evaluation and optimization studies of modern and future wireless access technologies. Although we used BCH code to specify the model we also discussed extensions of the model to the case of other code including both block codes and convolutional ones. We study performance of the all proposed models in details. The model based on estimation of two-dimensional distribution of the number of errors in adjacent codewords and successive application of absorbing Markov chain provide the best possible results for all ranges of lag-1 NACF values, BER, error correction capabilities and interleaving depths. The deviation of this model from the statistical 13 E[T], throughput E[T], throughput 3 E[T], throughput 3 1´10 3 1´10 l=1 l=2 l=3 l=4 l=5 800 600 1´10 l=1 l=2 l=3 l=4 l=5 800 600 600 400 400 400 200 200 200 0 -4 1´10 5.075´10 -3 0.01005 0.015025 0.02 0 -4 1´10 5.075´10 -3 0.01005 pE, bit error probability 0.015025 0 -4 1´10 0.02 800 600 0.015025 0.02 E[T], throughput 3 3 1´10 l=1 l=2 l=3 l=4 l=5 0.01005 (c) (I, v) = (16, 1), c = 0.6 E[T], throughput 3 -3 pE, bit error probability (b) (I, v) = (4, 4), c = 0.6 E[T], throughput 5.075´10 pE, bit error probability (a) (I, v) = (2, 8), c = 0.6 1´10 l=1 l=2 l=3 l=4 l=5 800 1´10 l=1 l=2 l=3 l=4 l=5 800 l=1 l=2 l=3 l=4 l=5 800 600 600 400 400 400 200 0 -4 1´10 5.075´10 -3 0.01005 0.015025 0.02 200 -4 1´10 5.075´10 -3 0.01005 pE, bit error probability (d) (I, v) = (2, 8), c = 0.9 0.015025 0.02 pE, bit error probability (e) (I, v) = (4, 4), c = 0.9 200 -4 1´10 5.075´10 -3 0.01005 0.015025 0.02 pE, bit error probability (f) (I, v) = (16, 1), c = 0.9 Figure 9: Throughput as a function of BER for different l and c. We also studied the effect of interleaving in detail using the most accurate model based on absorbing Markov chain. Aside from the common belief that small values of interleaving depth (i.e. up to 5, say) are sufficient for correlated channel we saw that the best possible choice of I depends on the channel memory and should be chosen carefully. In fact, increasing the interleaving depth makes the channel more and more random. For the working range of BER and big values of the lag-1 NACF the advise would be to use as big value of I as possible. Such big values of I do not affect the complexity of the system significantly but allow for complete removal of channel correlation. However, one needs to recall that, the value of interleaving depth is often limited by the size of a packet to be transmitted. For extremely large packet sizes, when we can use rather big values of I, the simple rule of thumb would be to estimate the residual value of autocorrelation R = cI , where c is the lag-1 NACF. The first allowed valued of I for which R is sufficiently close to zero can be used. [2] D. Moltchanov, Y. Koucheryavy, and J. Harju, “Simple, accurate and computationally efficient wireless channel modeling algorithm,” in Proc. WWIC, Xanthi, Greece, May 2005, pp. 234–245. [3] Q. Zhang and S. Kassam, “Finite-state markov model for rayleigh fading channels,” Perf. Eval., vol. 47, no. 11, pp. 1688– 1692, Nov. 1999. [4] A. Konrad, B. Zhao, and R. Ludwig, “Markov-based channel model algorithm for wireless networks,” Wir. Netw., vol. 9, no. 3, pp. 189–199, 2003. [5] D. Moltchanov, “State description of wireless channels using change-point statistical tests,” in Proc. WWIC, Bern, Switzerland, May 2006, pp. 275–286. [6] E. Dunscombe and F. Piper, “Optimal interleaving scheme for convolutional coding,” Electronics Letters, vol. 25, no. 22, pp. 1517–1518, 1989. [7] L.-J. Chen, T. Sun, M. Sanadidi, and M. Gerla, “Improving wireless link throughput via interleaved fec,” in Computers and Communications, 2004. Proceedings. ISCC 2004. Ninth International Symposium on, vol. 1. IEEE, 2004, pp. 539–544. [8] M. A. M. M. El-Bendary, A. E. Abou-El-azm, N. A. El-Fishawy, F. Shawki, F. E. Abd-ElSamie, M. A. R. El-Tokhy, and H. B. Kazemian, “Performance of the audio signals transmission over wireless networks with the channel interleaving considerations,” EURASIP Journal on Audio, Speech, and Music Processing, vol. 2012, no. 1, pp. 1–14, 2012. [9] N. F. Kiyani, J. H. Weber, A. G. Zajić, and G. L. Stüber, “Performance analysis of a system using coordinate interleaving and constellation rotation in rayleigh fading channels,” in Vehicular Technology Conference, 2008. VTC 2008-Fall. IEEE 68th. IEEE, 2008, pp. 1–5. [10] K. Kang, “Probabilistic analysis of data interleaving for reedsolomon coding in bcmcs,” Wireless Communications, IEEE Transactions on, vol. 7, no. 10, pp. 3878–3888, 2008. [11] K. Kang, C. Kim, and K.-J. Park, “A hybrid architecture for delay analysis of interleaved fec on mobile platforms,” Vehicular Technology, IEEE Transactions on, vol. 59, no. 4, pp. 2087– 2092, 2010. Acknowledgement The publication was supported by the Ministry of Education and Science of the Russian Federation (project No. 2.3397.2017). References References [1] D. Moltchanov, “Source code of interleaving models,” Department of Electronics and Communications, Available at http://www.cs.tut.fi/˜moltchan/bchInterleavingModels.zip. 14 E[T], throughput p, packet loss probability 1´10 1 800 0.01 1´10 1´10 1´10 1´10 600 -4 -6 400 l = 1, C = 0.9 l = 2, C = 0.0 l = 2, C = 0.3 l = 2, C = 0.6 l = 2, C = 0.9 -8 -4 5.075´10 -3 0.01005 0.015025 l = 1, C = 0.9 l = 2, C = 0.0 l = 2, C = 0.3 l = 2, C = 0.6 l = 2, C = 0.9 200 - 10 1´10 3 0 -4 1´10 0.02 5.075´10 -3 0.01005 0.015025 0.02 pE, bit error probability pE, bit error probability (a) p for l = 1 and l = 2 (b) Throughput for l = 1 and l = 2 E[T], throughput p, packet loss probability 900 1 800 0.01 1´10 1´10 1´10 1´10 700 -4 -6 600 l = 2, C = 0.9 l = 3, C = 0.0 l = 3, C = 0.3 l = 3, C = 0.6 l = 3, C = 0.9 -8 500 - 10 1´10 -4 5.075´10 -3 0.01005 0.015025 400 -4 1´10 0.02 l = 2, C = 0.9 l = 3, C = 0.0 l = 3, C = 0.3 l = 3, C = 0.6 l = 3, C = 0.9 5.075´10 -3 0.01005 0.015025 0.02 pE, bit error probability pE, bit error probability (c) p for l = 2 and l = 3 (d) Throughput for l = 2 and l = 3 Figure 10: Packet error probability and throughput for (I, v) = (16, 1). markov chains,” Disc. Appl. Math., vol. 2, no. 3, pp. 249–250, March 1980. [15] C. library, “Gnu multiple precision arithmetic (gmp),” GNU General Public License, Available at http://gmplib.org/, Acessed on 16.07.2013. [12] J. G. Kemeny, J. L. Snell et al., Finite markov chains. van Nostrand Princeton, NJ, 1960, vol. 356. [13] C. A. O’cinneide, “Phase-type distributions: open problems and a few properties,” Stochastic Models, vol. 15, no. 4, pp. 731–757, 1999. [14] S. Bhattacharya and A. Gupta, “Occupation times for two-state 15
7cs.IT
Information topology identifies emergent model classes Mark K. Transtrum,1 Gus L. W. Hart,1 and Peng Qiu2 arXiv:1409.6203v2 [physics.data-an] 13 Jul 2016 2 1 Department of Physics and Astronomy, Brigham Young University, Provo, Utah 84602, USA∗ Department of Biomedical Engineering, Georgia Tech and Emory University, Atlanta, Georgia 30332, USA We develop a language for describing the relationship among observations, mathematical models, and the underlying principles from which they are derived. Using Information Geometry, we consider geometric properties of statistical models for different observations. As observations are varied, the model manifold may be stretched, compressed, or even collapsed. Observations that preserve the structural identifiability of the parameters also preserve certain topological features (such as edges and corners) that characterize the model’s underlying physical principles. We introduce Information Topology in analogy with information geometry as characterizing the “abstract model” of which statistical models are realizations. Observations that change the topology, i.e., “manifold collapse,” require a modification of the abstract model in order to construct identifiable statistical models. Often, the essential topological feature is a hierarchical structure of boundaries (faces, edges, corners, etc.) which we represent as a hierarchical graph known as a Hasse diagram. Low-dimensional elements of this diagram are simple models that describe the dominant behavioral modes, what we call emergent model classes. Observations that preserve the Hasse diagram are diffeomorphically related and form a group, the collection of which form a partially ordered set. All possible observations have a semi-group structure. For hierarchical models, we consider how the topology of simple models is embedded in that of larger models. When emergent model classes are unstable to the introduction of new parameters, we classify the new parameters as relevant. Conversely, the emergent model classes are stable to the introduction of irrelevant parameters. In this way, information topology provides a general language for exploring representations of physical systems and their relationships to observations. I. INTRODUCTION Mathematical modeling is a central component of nearly all scientific inquiry. Simple models of real systems, coupled with robust methods for interacting with them, is one of the primary engines for scientific progress[1–3]. From an information theoretic perspective, mathematical models act as both a type of “information container” for storing the answers to experimental questions (in the form of parameter confidence regions, for example) and as a transfer mechanism for using that information to predict the outcome of new experiments. In order to facilitate these functions, models reflect the properties of the physical system that are relevant for explaining the outcome of experiments while disregarding irrelevant degrees of freedom. Generically, which properties are relevant or irrelevant depend on the observations, and a complete understanding of the system is best achieved when the relationship among all the potential representations and observations is characterized. For example, a complete microscopic description of an ideal gas is neither necessary nor insightful for understanding its thermodynamic properties. On the other hand, a macroscopic description has a limited domain of applicability and masks the microscopic mechanisms that control the system behavior. By relating the macroscopic description (temperature and pressure) to microscopic variables (kinetic energy) one simultaneously explains the ∗ Electronic address: [email protected] emergence of the thermodynamic model and identifies its domain of applicability (i.e., the thermodynamic limit). These deep insights derived from understanding the relationship among different representations and their appropriate domains are lost when either representation is considered alone. Another context in which this type of insight is useful is that of effective field theories. Effective field theories demonstrate the utility of including only the appropriate degrees of freedom for describing a particular phenomenon, and the Renormalization Group (RG) makes systematic the process of removing irrelevant degrees of freedom. Although the actual procedure is usually limited to systems with an emergent scale invariance or conformal symmetry, the analysis makes clear the utility of effective theories and how they emerge from a more complete underlying physical theory. Recently it has been suggested that the general success of effective models and emergent theories can be attributed to an information theoretic “parameter space compression” resulting from coarse observations[3]. The present work builds upon this relationship as a vehicle for extending concepts and insights originating in RG to other concepts. This work should not be interpreted as a direct translation of RG principles, although the concepts we discuss are motivated by analogy with renormalization. We assume that the appropriate model of a physical system depends not just on the intrinsic properties of the system itself, but also the questions one wishes to ask about it, i.e., the observations to be made at specific experimental conditions. We develop a new mathemati- 2 FIG. 1: Abstract and Statistical Models An abstract model, Y , maps a parameter space Θ into a behavior space B. The behavior space consists of all possible model behaviors under all possible experimental conditions, (even those measurements that may be impractical or impossible). A real experiment X defines a data space D as all possible outcomes of the experiment and is a subset of B. The statistical model, y, maps the parameter space into the data space of the specific experiments. Statistical inference consists of identifying an inverse function y −1 that encodes the information from the experiments into the parameter space for extrapolation to new experiments. Information Topology characterizes the experimental conditions X for which the inverse y −1 is welldefined for a given abstract model. cal language, which we call Information Topology for describing the relationships among mathematical models, observations, and the underlying principles from which they are derived. Understanding these relationships leads to a more complete understanding of the physical system. The foundation for this theory is a distinction between two types of models as we graphically illustrate in Figure 1. The first, what we call the abstract model and denote by Y , is characterized by parameters Θ and a set of rules that describe the underlying physical principles implemented by the model. Applying these rules to specific experimental conditions, X, leads to what we call the statistical model and denote by y. Importantly it is the statistical model that makes falsifiable predictions that can be compared to observations. We express this relationship by saying a statistical model is a realization of a particular abstract model. Statistical inference is performed by comparing the statistical model to experimental data through the inverse function y −1 . This process induces a metric on the parameter space of the abstract model; however, without any observations, there is no natural metric to the parameter space of the abstract model. As a concrete example, consider Newton’s law of gravitation. The abstract model is characterized by a parameter (i.e, the universal gravitational constant G) and a set of rules (i.e., the inverse square law) for predicting the motion of objects. Varying the parameter defines a family of abstract gravitational models, and the optimal value is found by comparing the predictions of a statistical model to observation, e.g., predicting the position of the moon, that are a small subset of all possible prediction that the abstract model could make. The distinguishability of the statistical model’s predictions for different values of G defines a metric on the parameter space. The metric is not intrinsic to the physical system, however, but depends on the observations. Furthermore, the metric would be different if the moon’s position were measured to different accuracy or if another experiment (such as observing the position of Mars or measuring the acceleration near the surface of the Earth) were performed. Each of these potential observations corresponding to different X’s in Figure 1 and therefore lead to different statistical models y. Since statistical models (unlike abstract models) make predictions for the outcomes of specific experiments, they are naturally interpreted as a manifold of potential predictions embedded in data space. The interpretation of models as manifolds is the basis for the field of information geometry[4–13]. To study the properties of the abstract model, we consider those properties of the model manifold that are invariant to changes in the metric, i.e., what properties are shared by different realizations of the same abstract model. We therefore consider how geometric properties of statistical models vary depending on specific observations and which properties are invariant to these changes. This paper is organized as follows: first, we focus on the observations for which statistical inference can be performed, i.e., for which y −1 exists. We find that the observations for which this holds are diffeomorphisms of the model manifold. Therefore, properties of the model manifold that are invariant under diffeomorphisms characterize the abstract model. Information topology is therefore the synthesis of differential topology and information theory just as information geometry is the combination of differential geometry and information theory as we illustrate in Figure 2 and elaborate in section II. In section III, we consider the effect of coarsening the observations. Coarsened observations may lead to structural changes in the manifold compared to the identifiable case, what we call manifold collapse. Manifold collapse leads to unidentifiable statistical manifolds that require modifying the abstract models in order to formulate identifiable statistical models. In other cases, coarse observations can lead to a collapse of the boundaries of the model manifold, which in turn leads to practically unidentifiable statistical models. In many cases, the parameters in a practically unidentifiable model can be arranged in a hierarchy of decreasing relative importance[3], a phenomenon known as sloppiness and observed in many different models[14–20]. We suggest that sloppiness may be a local manifestation of the collapse of manifold boundaries. 3 FIG. 2: Information Topology and Abstract Models An abstract model is characterized by a parameter space without a metric. Comparing the predictions of the model to experimental observations leads to a family of statistical models and imposes a metric on the model’s parameter space. This statistical model can be interpreted as a manifold embedded in the space of all possible experimental outcomes and is the domain of information geometry. Changing the details of the experimental conditions leads to different models with the same parameter space but different metrics and by extension different model manifolds. Experimental conditions that do not change the key structural characteristics of the manifold (i.e., are diffeomorphically related to one another) form an information topological description of the abstract model from which they arise. In section IV, we show that the topological structure of an abstract model can be graphically represented as a hierarchical graph known as a Hasse diagram. This visualization naturally leads to a reinterpretation of the model parameters in terms of refining approximations to simple reduced models[21]. These reduced models are low dimensional elements of the Hasse diagram and identify distinct behavioral modes of the model. In this way, the topology of the abstract model identifies the relationships among distinct system behaviors and minimal representations of those behaviors. We find that set of all possible observations form a semi-group structure with diffeomorphism subgroups characterized by unique Hasse diagrams. In section V we consider how topologies of hierarchical models are embedded within one another. This allows us to identify stable and unstable model classes and classify parameters as either relevant or irrelevant (in analogy with corresponding classifications in the context of renormalization group analysis[22, 23]). II. INFORMATION TOPOLOGY AND MATHEMATICAL MODELS To formalize the concepts outlined in the introduction, we consider statistical models that are defined as a probability distribution for specific observations, P (ξ). Here P represents the probability of observing some outcome ξ. We focus on probability distributions because they have broad applicability and have a natural metric (i.e., the Fisher Information defined below) for measuring dis- tances among model predictions. This assumption is not strictly necessary, however, and we discuss other possible metrics in the supplement. We assume these statistical models are derived as specific applications of some abstract model to particular experimental conditions, so that there are many statistical models that share a common parameter space. We now consider the concept of identifiability of a statistical model. In general, there are two classes of identifiability issues, structural and practical. A model y with structurally identifiable parameters is an injective map from parameters to predictions so that an inverse, y −1 can be constructed. Structural identifiability is often described as the potential to accurately infer unique parameter values from a model given perfect, noise-free data and is a necessary condition for parameter inference in a real experiment[24]. Structural identifiability is further categorized as either global or local. Global identifiability means that the inferred parameters are unique when considering the entire domain of physically relevant parameters. Local identifiability, on the other hand, means that there exists an open neighborhood centered on the inferred parameters in which the inferred parameters are unique[25, 26]. Local identifiability is closely related to the Fisher Information Matrix (FIM): * 2 +  2  ∂ log P ∂ log P g= = , (1) ∂θ ∂θ2 where h·i means expectation with respect to the model. It can be shown that a model is locally identifiable at parameter values θ if and only if the FIM is non-singular at θ[25]. Qualitatively, a locally unidentifiable model has redundant parameters so that the parameter values can be changed in a coordinated way without changing the predictions of the model. The null space of the FIM is precisely the linear subspace in which parameter values can be shifted without changing the model behavior. The other type of identifiability is practical. Although in principle it may be possible to uniquely identify true parameter values, in practice the number of repeated observations necessary to obtain a reasonable estimate may be impractical. Practical unidentifiability is also related to the FIM through the Cramer-Rao inequality: Cov(θ̂) ≥ g −1 /n, (2) where Cov(θ̂) is the asymptotic covariance matrix of an unbiased estimator θ̂ and n is the number of repeated samples. If the FIM is not singular but approximately so, it may take an unreasonable sample size, i.e., large value of n, to obtain accurate estimates. It is not uncommon, particularly in models with many parameters, for the FIM to be poorly conditioned leading to practical identifiability problems, a phenomenon sometimes known as sloppiness[14–20]. Parameter identifiability can be improved through repeated application 4 of experimental design techniques[19, 27–34] or model reduction[21]. The basic principle behind the geometric interpretation of statistics is that the FIM in Eq. (1) can be interpreted as a Riemannian metric tensor. (Although we use the FIM as the measure of distance throughout this paper, our results generalize to any distance measure among models as we discuss in the supplement.) A parameterized statistical model is therefore equivalent to a Riemannian manifold. We present here four simple illustrative examples that will then serve to illustrate the topological principles we explore later. First, we consider a model as the sum and difference of exponentials:  −θ t e 1 i + e−θ2 ti + zi 1 ≤ i ≤ Ms ξi (θ1 , θ2 ) = e−θ1 ti − e−θ2 ti + zi Ms < i ≤ Ms + Md (3) where zi is normally distributed random variable with zero mean and standard deviation σi and Ms and Md are the number of observations of the sum and differences respectively. This model could describe, for example, the radioactivity of a sample with two radioactive components in the case it is possible to distinguish between the two types of radiation, i.e., it is possible to measure both the total radiation and the difference in radiation types as in Eq. (3). For the model in Eq. (3), model manifolds for two different observations (i.e., different choices of time points ti and experimental accuracies σi ) are given in Figures 3 and 4. Specifically, both manifolds correspond to a sampling of time points logarithmically spaced between 0.1 and 10. Figure 3 corresponds to σi = 1 for all values of i while Figure 4 has σi = 1 for i < Ms and σi = 1/2 for i > Ms . The manifolds are then generated by considering the model predictions for all physically allowed values of θ1 and θ2 . Notice that since the observations that led to Figures 3 and 4 are different, geometrical features (e.g., distances and curvatures) of the manifolds are also different. However, because these manifolds are both identifiable realizations of the same abstract model, they share important structural characteristics. Specifically in this case, they are both square-like, in the sense of having four edges and four corners. Next, we consider two generalizations of the Ising model given by the Hamiltonians X H=− Ji si si+1 , (4) i and H=− X Jα si si+α . (5) i,α In Eqs. (4) and (5), si are spin random variables arranged in a one-dimensional chain that can take values ±1. The probability of a particular configuration is then given by a Boltzmann distribution P ∝ e−H , (6) FIG. 3: Exponential Model Visualization. A visualization of the of the model manifold described by Eq. (3) for one possible realization of the abstract model. An alternative realization is given in Figure 4. FIG. 4: Alternate Exponential Model Visualization. An alternative realization of the model described by Eq. (3) with different observations that those that led to Figure 3. Notice that by changing the observations, the geometric properties of the model manifold also change. The manifold may stretch and bend, but the manifold remains topologically equivalent to a square. where we have taken kB T = 1 and the normalization is determined by summing over all configurations. The parameters Ji in Eq. (4) are the site-specific nearest neighbor coupling of the magnetic moments si . This could describe an inhomogeneous magnet with short range interactions. On the other hand, the parameters Jα in Eq. (5) are the nearest and second nearest neighbor coupling of the magnetic moments describing a homogeneous magnet with long(er) range interactions. A visualization of the model manifold for Eq. (4) is given in Figure 5 for the case of three spins and two parameters. The model manifold for Eq. (5) is given in Figure 6 for the case of two parameters and four spins with periodic boundary conditions. Because these models are derived from different abstract models, the topological features are different (a square vs. a triangle). A final example is drawn from biochemistry, an enzyme substrate reaction: E + S ES → E + P. Modeled as 5 FIG. 5: Model Manifold of the Ising Model in Eq. (4). The generalized Ising model given by Eq. (4) with three spins and two parameters is topologically a square. FIG. 6: Model Manifold of the Ising Model in Eq. (5). The generalized Ising model given by Eq. (5) with four spins and two parameters is topologically a triangle. three mass-action reactions, the time-dependence of the concentration of each chemical species is determined by the set of differential equations d [E] dt d [S] dt d [ES] dt d [P] dt = −kf [E][S] + kr [ES] + kcat [ES] (7) = −kf [E][S] + kr [ES] (8) = kf [E][S] − kr [ES] − kcat [ES] (9) = kcat [ES]. (10) We take the observations to be the values of each of the chemical species at various times with added random Gaussian noise of variable size. This model has three parameters, the three reaction rates kf , kr , kcat , so that the model manifold is a volume rather than a surface. The model manifold is shown in Figure 7 where the five colors are five sides (which we consider below) that enclose the volume. Initial conditions are chosen to be a known mixture of [E], [S] and [ES]. This is an unrealistic initial condition since [ES] is unstable and spontaneously FIG. 7: Model Manifold of the Enzyme-Substrate Model is a three dimensional volume with five sides (colored red, green, blue, yellow, and purple). decays into its constituent parts. We consider a more realistic scenario in a later section when we discuss manifold collapse. To this point, the observations for all of the statistical models were chosen so that all the parameters of the model were identifiable (both structurally and practically). As such, repeated sampling from these models contains all the information to uniquely identify the parameters in the abstract model, which in turn leads to precise predictions for other observations (i.e., extrapolate to other statistical models). We now consider for which other observations the structural identifiability of the parameters in the abstract model will be preserved (at least locally). To answer this question, we use the fact mentioned above above that a statistical model is locally structurally identifiable, if and only if the FIM is non-singular. Therefore, structural preserving experimental conditions can distort the distances measured on the model manifold provided there are no new singularities introduced into the metric tensor. These types of transformations are known as diffeomorphisms, i.e., differentiable transformations of the model manifold. Therefore the manifolds in Figures 3- 5 are diffeomorphic to a square, Figure 6 is diffeomorphic to a triangle and Figure 7 is diffeomorphic to a pentahedron. As an aside, throughout this paper we say that a manifold that is square-like (as in Figures 3- 5) is topologically a square (and similarly for other shapes). By this we mean the manifold is diffeomorphic to a square. We warn the reader that the phrase “topological equivalence” is colloquially used to mean invariance under homeomorphisms rather than diffeomorphisms. In this paper we restrict ourselves to the study of differential topological properties of manifolds, so we use this phrase without ambiguity although it is not standard. Notice that each of the manifolds in Figures 3-7 are bounded by edges which are in turn bounded by corners. If we restrict our attention to observations that are diffeomorphic to those in these figures, then this hierarchi- 6 cal structure of boundaries and edges will be preserved. This indicates that the hierarchical boundary structure is a feature of the abstract model and not of the specific observations. Indeed, we now give explicit formulas and interpretations for each of these limits and find that these boundaries always represent an extreme limit of the principles in the abstract model. The simplest example is in Figures 3-4 in which the model manifold is topologically a square. The limits of the four edges correspond to either of the parameters reaching their physically limiting values individually: θµ → ∞ or θµ → 0. Because these limits act on the underlying physical principles, it is not difficult to ascribe a physical interpretation to these edges. They are the cases in which one of the radioactive species either decays instantly or not at all (relative to the experimental time scales). The generalized Ising model in Eq. (4) (depicted graphically in Figure 5) is likewise diffeomorphic to a square. The four limiting cases are likewise each of the two parameters reaching the limits of their physically relevant values: Jµ → ±∞. These limits physically correspond to perfect, local ferromagnetism or anti-ferromagnetism between two neighboring spins. Now consider the generalized Ising model in Eq. (5) and visualized in Figure 6. This model manifold is diffeomorphic to a triangle. Because this model is constructed to be translationally invariant, it is natural to consider a Fourier transform of the spins as in[21, supplement]. One limiting case corresponds to the limit of J1 → ∞, J2 → −∞ such that J1 + 2J2 → finite. Careful analysis shows that in this limit, configurations with the highest Fourier frequency have infinite energy (i.e., have zero probability). We refer to this as the ferromagnetic limit (high-frequency configurations in the spins correspond to anti-ferromagnetic order and have zero probability). Another limit occurs when J1 − → ∞, J2 → −∞ such that J1 − 2J2 → finite which in a similar way removes the low-frequency configurations in the spins, i.e., an antiferromagnetic limit. Finally, the limit J2 → ∞ with J1 remaining finite corresponds to the limit of no midfrequency configurations. Finally, we consider the five surfaces bounding the pentahedron in Figure 7. The green surface corresponds to the limit kr → 0, i.e., the first reaction is no longer reversible. The red surface corresponds to kf , kr → ∞ such that Kd = kr /kf remains finite, interpreted as the case in which the first reaction is always in equilibrium. The blue surface corresponds to kcat → 0, i.e., the second reaction does not occur. The yellow surface corresponds to kf → 0, i.e., the first reaction proceeds only in the reverse direction. The purple surface correspond to the limit kr , kcat → ∞ such that the ratio kr /kcat remains finite, corresponding to the case that the intermediate complex [ES] never accumulates. The topological relationship among the faces, edges, corners, etc. of the model is rich with physical meaning as we will see in section IV. III. MANIFOLD COLLAPSE LEADS TO CHANGES IN MODEL STRUCTURE We now consider how the analysis described in section II changes when the observations alter the topological structures of the manifolds, i.e., are not related by diffeomorphisms. Since the models in section II were constructed to be identifiable, a structural change here corresponds to a coarsening of the observations. In most cases, this means simply not observing some of the potential model predictions. In the language of mathematical probability, this means the distribution is marginalized over a subset of the random variables resulting is a coarsegrained set of observations. Geometrically, the corresponding manifolds are compressed along some direction. In this way, manifolds may be compressed, folded, or edges may be glued together. On the other hand, reversing this process can result in manifolds that are stretched or torn. Consider the exponential model in Eq. (3) for the limit in which the difference in the exponential terms are not observed. This occurs if the specific radioactive products of the two decay channels are indistinguishable, or if the experimental cost of observing the difference is prohibitive so that the experiment is not performed. In this case, Eq. (3) is modified to be ξi (θ1 , θ2 ) = e−θ1 ti + e−θ2 ti + zi . (11) The manifold of this model is given in Figure 8. Notice that the topological structure of the manifold is fundamentally different from that in Figures 3 and 4. The relationship between the coarsened manifold and the original manifold is illustrated by the colored lines in Figures 8 and 9. In effect, the manifold has been folded in half such that the two white lines in Figure 9 are identified with each other and correspond to the white line in Figure 8. Similarly for the blue, green and red lines. The black line is the “fold line.” The black “fold line” in Figures 8 and 9 corresponds to the curve for which θ1 = θ2 in the model. This line is significant because for the coarsened model in Eq. (11), the Fisher Information is singular along this line. This singularity is the mathematical indication of the corresponding structural change. For all other points on the model, the Fisher Information remains nonsingular, so that the model is still structurally identifiable in the local sense almost everywhere. However, the model is no longer globally identifiably since each point on the manifold corresponds to two points in parameter space. The structural change illustrated in Figures 8 and 9 indicates that the observations carry qualitatively different information about the parameters of the abstract model. Specifically, there is a loss of information regarding the distinguishability of the radioactive products. In order to construct an identifiable model, the abstract model must be modified. In this case, the physical domain of the parameters can be restricted to θ1 > θ2 , i.e., we arbitrarily 7 FIG. 8: Coarse-grained Exponential Model. If only the sum of the exponential terms is observed, then the model manifold is structurally different from that in Figures 3 and 4; it is now a triangle. The topological change reflects a change in the information content of the observations about the underlying theory and manifests itself as a structural unidentifiability in the resulting model. FIG. 9: Full Exponential Model showing which points will be identified under coarse-graining. In transitioning from the manifolds in Figures 3 and 4, the (square) manifold is effectively folded in half to produce the triangle structure in Figure 8. Here, lines of the same color on the original topology become identified with each other after coarsening. The black line corresponds to the fold line. order the parameters so that they are no longer identified with a specific radioactive agent. Now consider the generalized Ising model in Eq. (4). For the specific case of three spins visualized in Figure 5, we now consider the effect of observing only spins one and three and marginalizing the distribution over spin two. In this case, the two dimensional manifold in Figure 5 collapses to a one-dimensional curve. The nature of this collapse is illustrated by the colored lines in Figure 10. After marginalizing the distribution, the colored lines each collapse to a single point. Additionally, the manifold is “folded up” so that the disconnected lines of the same color each map to the same point. That is, the blue line near the top and near the bottom each collapse to a single point and the manifold is folded in half to FIG. 10: Identified points for the generalized Ising model in Eq. (4). After coarsening, the two dimensional square topology collapses to a line segment. Here, lines of the same color are the set of points that collapse to an single point on the final line segment. Notice that this collapse involves both a type of compression, in which a sequence of connected points are squeezed together, and a global folding, in which blue lines (for example) on opposite sides of the manifold are identified with each other. The black line represents the model in which the two parameters are equal, i.e., the usual one-parameter nearest neighbor Ising model. Notice that this line is folded in half under coarsening. identify these points. It is interesting to consider the effect on the common Ising model corresponding to J1 = J2 in Eq. (4). This one-dimensional curve is illustrated by the black line in Figure 10. Notice that it is folded in half by the coarsegraining. Since the previously two-dimensional manifold is collapsed to a one-dimensional curve, the FIM matrix is singular for all parameter values upon coarsening. Thus the new model is structurally unidentifiable. The meaning of the parameters in the abstract model must be modified in order to construct an identifiable model. In this case, the information lost is the nature of the short-range interactions. Are they ferro-magnetic or anti-ferromagnetic? After coarsening, the answer to this question is lost. As shown in reference[21], the new model can be exactly represented by an effective interaction between spins one and three: ˜ 1 s3 . H = −Js (12) We quantify this effective interaction with the renormal˜ The origin of this interaction is unized parameter J. derstood to be mediated by the microscopic interactions described by J1 and J2 neither of which can be identified individually from the data. The generalized Ising model in Eq. (5) also collapses if we similarly only observe spins one and three, ignoring spins two and four. The two dimensional surface in Figure 6 then collapses to a one dimensional curve. The details of this collapse are illustrated in Figure 11 in which lines of a single color collapse to a single point. Notice that the manifold is not “folded” in the same way 8 FIG. 11: Identified points for generalized Ising model in Eq. (5). After coarsening, the two dimensional triangle topology condenses to the same line segment as that for the model in Eq. (4). Here, lines of the same color are collapsed to a single point. Unlike the collapse in Figure 10, the structure does not experience any folding, rather the area between two of the edges are collapsed to a line and the third edge collapses to a point. The black line corresponds to the model with J2 = 0, with J1 , i.e., the usual one-parameter nearest neighbor Ising model. This black line is the same as that in Figure 10. Although the whole manifold is not folded, this particular sub-manifold is folded in half under coarsening, just as it was in Figure 10. FIG. 12: Coarse-grained Enzyme-Substrate Model A more realistic experimental conditions for the enzymesubstrate model results in a manifold that has not completely collapsed as it remains a three dimensional volume. However, several of the boundaries of the manifold in Figure 7 has collapsed. The yellow and blue surfaces have collapsed to points and the purple surface has collapsed to a line. The resulting model is structurally identifiable, but not practically identifiable. The practical unidentifiability is closely related to the topological changes of the boundary structure. as that in Figure 10. Indeed, two edges of the triangle are simply brought together and the third edge is collapsed to a point. Considering the curve J2 = 0 (given by the black line), we see that this curve is folded in half, just as it was in Figure 10. The two abstract models of these two generalized Ising models are fundamentally different. Eq. (4) corresponds to a inhomogeneous magnet with short-range interactions, while Eq. (5) is a homogeneous magnet with longerrange interactions. These differences are captured in the different topological structures. However, upon coarsening, both models collapse to a one-dimensional curve. In fact, they collapse to the same model and are realizations of the same abstract model. This effective model is one in which observed spins interact “directly”. That “direct” interaction, is of course, mediated by different microscopic interaction, of a now unknown nature (and unknowable from the coarsened observations). This simple example demonstrates how manifold collapse can both explain universality and justify the use of simple, effective models. This example is best understood in analogy with similar arguments based on renormalization group analysis. The similarity of these analyses becomes a vehicle for generalizing these concepts to broader model classes. Finally, we turn our attention the enzyme-substrate model. To coarsen this model, we consider an alternative initial condition in which only [E] and [S] have nonzero initial condition and observe only the final product [P] (ignoring the time course of the other three variables). The corresponding model manifold is illustrated in Fig- ure 12. The model manifold for these observations is three dimensional; however, the pentahedron of Figure 7 has collapsed to a narrow volume bounded by two surfaces (red and green), each of which are digons, i.e., twosided polygons. To understand manifold collapse in Figure 12, Notice that if kcat = 0 in Eqs. (7), that no product can be produced. Consequently, the blue and yellow surfaces in Figure 7 are collapsed to a single point in Figure 12. The entire manifold has been compressed, so that the two remaining surfaces are very close to one another and are therefore practically unidentifiable. Thus, in principle it is possible to identify all of the parameters in the model using only observations of the product; however, in practice the near-collapse of the manifold makes it very difficult. The structural collapse of the boundaries in Figure 12 reflects the causal dependence among kf , kr , and kcat in the abstract model. The practical unidentifiability resulting from the coarsening is intimately tied to this relationship and is manifest as a structural change in the model’s topology. Inspecting Figure 7, we see that the blue and yellow surfaces are necessary to “pull apart” the red and green surfaces. If the choice of observations collapses the blue and yellow surface to a single point (as in Figure 12), it becomes difficult to statistically distinguish between the red and green models (as well as all the models between them). We discuss this phenomenon in more detail in section IV. 9 IV. HYPER-CORNERS DEFINE PHENOMENOLOGICAL CLASSES A. Dimensions GF Boundary structures are represented by Hasse Diagrams A The arrows connecting the top node to the nodes in the first row show that each of these surfaces is a boundary to the node above it. The arrows connecting the second and third rows similarly represent which N − 2 dimensional hyper-surfaces are boundaries to which N −1 dimensional hyper-surfaces. In this way, a Hasse diagram summarizes the topological relationships among all the boundaries of the model. Near the bottom of the graph are nodes of zero dimension (labeled by Greek letters) which are vertices of the manifold. It is common in the theory of abstract polytopes to include a single node in the Hasse diagram below the points of dimension 0 (i.e., dimension -1) corresponding to the empty set[36–38]. Examples of Hasse diagrams for the manifolds in sections II- III are shown in Figure 14. D b c d .... .... A Hasse diagram graphically illustrates the relationship among the model manifold, its faces, edges, corners, etc. The complete model is represented as a single manifold of dimension N (where N is the number of parameters), given by the top node of the graph. This manifold may be bounded by a collection of hyper-surfaces of dimension N − 1, i.e., the second row in the figure. Likewise, each of these hyper-surfaces may be bounded by other hyper-surfaces of dimension N −2, i.e., the third row in the figure. In this paper, we do not consider models that are unbounded in some directions. a C .... The models we have considered here have manifolds with an intrinsic hierarchical structure. They are bounded by (hyper-)surfaces of one less dimension, which are in turn bounded by other (hyper-)surfaces of even lower dimension. This structure is derived from the “rules” of the abstract model. It has been shown that this structure is common to many models[35]. This hierarchical structure is described mathematically as a graded partially ordered set, i.e., a graded poset. The grading of each element in the set is determined by its dimension (corners are zero-dimensional, edges are one-dimensional, etc.). The partial ordering is induced by the fact that some corners are contained within some edges but not others. In general models that share this basic construction will have many more than two or three parameters making them difficult to visualize in data space as we have done previously. However, the relationships among this hierarchy of hyper-surfaces can be represented as a hierarchical graph structure known as a Hasse diagram, as shown in Figure 13. .... B .... LF FIG. 13: Hasse Diagram. The relationship among boundaries, corners, hyper-corners, etc. may be summarized by a hierarchical graph structure known as a Hasse Diagram. The top node of the graph represents the full N -dimensional model (known as the greatest face and denoted by GF). The first row of nodes correspond to the surfaces of dimension N − 1 that bound this model. The next row represents the N − 2dimensional surfaces that bound those in the previous row, and so forth. The tips of the graph correspond to models of dimension zero (i.e. a single point). It is common in Hasse diagrams to have a single node at the bottom (corresponding to dimension -1) representing the empty set and known as the least face (denoted by LF). B. f -vector and Euler Characteristic A topologically important quantity that can be read directly from the Hasse diagram is the f -vector. The f -vector is a list of integers giving the total number of nodes on each row (i.e., of a particular dimension) of the Hasse diagram. The f -vectors for the Hasse diagrams in Figure 14 are line segment: (1,2,1), triangle: (1,3,3,1), square: (1,4,4,1), enzyme reaction: (1,5,8,5,1), coarsened enzyme reaction: (1,2,2,2,1). The Euler-characteristic is a topological invariant calculated as the alternating sum of terms in the f -vector χ= N −1 X (−1)i fi . (13) i=0 It is straightforward to check that for each of the models considered here, χ = 1 − (−1)N [36]. The significance of this result is that all of the manifolds we consider here are orientable and none have holes or handles (such as would a donut or a coffee mug). We anticipate that these are properties that will be common for many models, but it is possible to find other examples. For example, consider another coarse-grained version of Eq. (3) in which 10 FIG. 15: Collapsed Exponential Model. Left: If only the difference in exponentials is observed (as in Eq. (14)), then the square topology in Figure 3 collapses to a point along the line θ1 = θ2 . The manifold structure breaks down at the vertex γ, so this structure is not a manifold. It is two separate manifolds, each with the topology of a digon connected at their tips. Right: the Hasse diagram for this structure. write[36] N X (−1)i fi = 1 (15) i=0 N X FIG. 14: Examples of Hasse Diagrams. Top: From left to right the Hasse diagrams of a line segment, a triangle, and a square. In each case, edges are arbitrarily labeled by a letter and corners by two letters corresponding to the adjacent edges. Bottom left: The Hasse diagram of the pentahedron in Figure 7. Faces are labeled with the letter of the corresponding color in Figure 7 (R for red, etc.). Four of the five faces are triangles; the green face is a square. Bottom right: The Hasse diagram for Figure 12. In this case, the three dimensional volume is bounded by two digons. only the difference of exponentials is observed: ξi (θ1 , θ2 ) = e−θ1 ti − e−θ2 ti + zi . (14) In this case, the square of Figure 3 is pinched off to a point at the line θ1 = θ2 . The resulting structure is not a manifold since the manifold structure breaks down at θ1 = θ2 . Instead, it is two manifolds that are topologically digons that are glued together at one of their tips as illustrated in Figure 15. The f vector for this structure is (1,3,4,1) and has an Euler characteristic χ = −1. Because there is only one greatest face and least face, the first and last entries of the f -vector will generically be one, there are several equivalent variations of Eq. (13). For models satisfying χ = 1 − (−1)N , we can similarly (−1)i fi = 0. (16) i=−1 C. Hasse diagrams identify important parameter combinations Another use of the Hasse diagram is understanding the relationship between model parameters and the model’s phenomenology. Quite often, particularly for sloppy or practically unidentifiable models, the N independent parameter combinations of a model are not equally important for explaining the model’s observations, nor is it clear how variations in parameter values translate to model behavior. Indeed, for many observations, there is a clear hierarchy of importance in the model parameters that is revealed by an eigenvalue decomposition of the FIM. The eigenvectors of the FIM can then be interpreted as the linear combinations of parameters that are relatively important or unimportant for understanding the model behavior. Unfortunately, this interpretation is based on a local, linear analysis. In reality, the truly important parameters combinations are nonlinear combinations of the model’s bare parameters. Identifying and interpreting the appropriate nonlinear combination requires a global, topological analysis. To illustrate, we consider the enzyme-substrate model in Figure 12. Notice that the coarsened manifold in Figure 12 is a three dimensional volume. As such, the statistical model is structurally identifiable. However, the manifold is very 11 thin and as such it is practically unidentifiable. The practical unidentifiability is closely related to the collapse of the boundaries. Furthermore, there is a global anisotropy; manifold has a clear long axis. By considering the statistical model for observations of the product P, any information about the rates kf and kr of necessity must be inferred through the third parameter kcat . Furthermore, when only the substrate is stimulated, any information about this stimulation must first pass through the intermediate complex [ES]. It is precisely this informational dependence that is described by the boundary collapse as discussed in section III. Because the boundaries of the manifold collapse, many different points on the manifold are drawn very near one another leading to a hierarchy of importance in the parameters. Parameters that were originally easy to distinguished become practically unidentifiable. We now consider the functional form of the red and green surfaces in Figure 12. The green surface corresponds to the limit kr → 0, i.e., the approximation that the first reaction is not reversible. The red surface corresponds to the limit kf , kr → ∞ with Kd = kr /kf remaining finite,i.e., the approximation that the first reaction is in equilibrium. From the equilibrium approximation, one can derive the well-known Michaelis-Menten approximation: kcat E0 [S] d [P] = , dt Kd + [S] (17) where E0 = [E] + [ES] is the total amount of enzyme and Kd = kr /kf . The two edges that join the red and green surfaces can then be found as limiting approximations to Eq. (17). They are Kd → 0, which corresponds to the approximation that that the reaction is always saturated, i.e., a constant production rate: d [P] = kcat E0 . dt (18) Alternatively, the second limit corresponds to kcat , Kd → ∞ with keff = kcat /Kd remaining finite leading to the form d [P] = keff E0 [S], dt Full Model GF Michaelis-Menten R G Irreversible Linear RG P Saturated No Reaction a b Instantaneous LF FIG. 16: Model Hierarchy for coarsened EnzymeSubstrate Model. The nodes of the Hasse diagram for the coarsened enzyme-substrate model (as in Figure 12) correspond to a well-known hierarchy of models, including the well-known Michaelis-Menten rate-law. and the relationship between the model behavior and the model parameters becomes progressively clearer. Furthermore, the simpler models naturally group the parameters of the complex abstract model into the appropriate nonlinear combinations that are connected to the model behavior. We refer to these simplified models as emergent model classes and their behaviors as the dominant behavioral modes. The behavior of the full model can then be reinterpreted as a combination of these characteristic modes. For models of moderate complexity, constructing the Hasse diagram may reveal important insights regarding the informational relationships among model parameters and behaviors such as we have done above for the enzyme-substrate model. Such insights may guide experimental design, model reduction, and model interpretation. For more complex models, it may be impractical to explicitly construct the entire diagram. In these cases, much of the benefit can still be found by identifying a single path down the graph from the top node to an appropriate approximate model. D. (19) which corresponds to a linear approximation. The vertices bounding the two edges are limits kcat , keff → 0 or kcat, keff → ∞ corresponding to either no reaction or a reaction that that completes instantaneously. This hierarchy of models is a standard interpretation of the Michaelis-Menten dynamics in biochemistry and is naturally recovered by interpreting the nodes in the Hasse diagram as illustrated in Figure 16. Notice that a simplified model can be associated with each node in the Hasse diagram. As one moves to lower dimension, these models become progressively simpler The observation semi-group and diffeomorphism subgroups Observations that preserve the boundary structure of the model manifold are represented by the same Hasse diagram and are related by diffeomorphisms. The set of diffeomorphisms of a manifold form a group. Therefore, among the set of all possible observations there are subsets that are groups and characterized by a unique Hasse diagram. The entire set of all possible experimental conditions do not form a group, however. This is because some observations lead to manifold collapse which has no unique inverse operation. All possible observations therefore form a semi-group (a group-like structure but with some elements that do not have an inverse). This struc- 12 Square Triangle 2 Digons Line Segment 1 Line Segment 2 Point FIG. 17: Hasse Diagram for Observation semi-group The model defined in Eq. (3) corresponds to the diffeomorphism subgroup described by a square topology. The “triangle” subgroup is given by Eq. (11) and the “2 Digons” subgroup is given by Eq. (14). If only a single time point is observed, these structures collapses to line segments. The least face corresponds to the “point” topology. The Hasse diagram illustrates the ordering square ≺ triangle ≺ line segment 1 ≺ point. There is no relation between the triangle and digons subgroups or their collapsed line segments. Note that the ordering is not graded; the square, triangle, and digons are each two-dimensional structures. ture is reminiscent of the renormalization group which is also famously not a group, but a semi-group for similar reasons. We refer to this as the observation semi-group and the proper subgroups characterized by unique Hasse diagrams as diffeomorphism subgroups. The set-like structure of observations induces a partial ordering on the diffeomorphism subgroups. Let G1 and G2 represent two diffeomorphism subgroups of an abstract model. We say G1 ≺ G2 if there exist observations o1 ∈ G1 and o2 ∈ G2 such that o1 ⊂ o2 . Being a poset, the diffeomorphism subgroups can be represented by a Hasse diagram, as we demonstrate for the exponential model from Eq. (3) in Figure 17. At the top of the diagram is the group preserving the square topology as in Figures 3 and 4. Below this are the subgroups whose topologies are a triangle as in Figure 8 and Eq. (11) and two digons as in Figure 15. If the observations are further coarsened so that only one time point is observed, these topologies collapse to line segments. Finally, if nothing is observed we arrive at the least face, i.e., a single point. Unlike the Hasse diagrams of section IV A, the Hasse diagram for the diffeomorphism subgroups is not graded. In particular, note in Figure 17 that triangle ≺ square even though they are both two dimensional. Similar to the Hasse diagrams in section IV A, the diffeomorphism subgroups will always include a minimal element that corresponds to the empty set (i.e., no observations) whose topology is a single point. We speculate, that for most models there will also exist a unique “maximal topology” (i.e., greatest face). The square is the unique maximal topology for the exponential model, and the pentahedron in Figure 7 is the maximal topology for the enzymesubstrate model. V. A. TOPOLOGICAL EMBEDDING DEFINES STABILITY OF MODEL CLASSES Model classes are ground states of statistical mechanics models In this section, we consider the topology of hierarchical models. We introduce a concept called topological embedding, i.e., how topologies of small models are embedded within larger ones. We find that topological embeddings allows us to define the concept of stability for behavioral modes with respect to structural changes in the abstract model. We motivate this definition in the context of log-linear statistical mechanics models, such as cluster expansions of binary alloys. We therefore begin by discussing the topology for these models and its physical significance. Consider a simple cluster expansion on a twodimensional four by four square lattice with periodic boundary conditions. Sites can be occupied by one of two atom types, i.e., a binary system. The Hamiltonian for binary interactions up to fifth near-est neighbor takes the form H=− 5 X X Jk si sj , (20) k=1 d(i,j)=dk where the first sum indicates a sum over interactions and the second sum indicates a sum over sites such that the distance between sites i and j is equal to the k th nearest neighbor distance. The random variables si take on values ±1, indicating which atom type occupies the site, according to a Boltzmann distribution P (s) ∝ E −H where we have absorbed the temperature dependence into the definition of Jk . This model has 16 binary random variables and therefore can exhibit 216 = 65536 distinct configurations. Many of these states are symmetrically equivalent; only 432 configurations are crystallographically distinct. The topology of this model is summarized by the Hasse diagram in Fig. 18 (omitting the least face). Although this model corresponds to a five-dimensional manifold (and is thus difficult to visualize), from the Hasse diagram it can be seen that the manifold has six hypercorners corresponding to zero-dimensional limiting cases (six nodes on the bottom row). These six points form the boundaries for 15 lines (second row from the bottom). Continuing to work up the graph, these lines form the boundaries for 20 triangles, which form the boundaries for 15 tetrahedra, which form the boundaries for 6 first-order boundaries of the manifold. These first order boundaries are each 4 dimensional objects bounded by five tetrahedra. 13 ues, high-frequency configurations do not correspond to high energy, the anti-ferromagnet being the seminal example. For the anti-ferromagnet, the checkerboard configuration is a ground state (node 62). The topological structure of the model identifies the sequence of configurations least relevant and leads to a series of approximate effective models in which these configurations are removed. The superficial similarity to a renormalization group procedure alluded to here will be explored in more detail elsewhere. We now consider a similar model, a cluster expansion of a binary alloy on an FCC lattice and ask, what are the possible ground state configurations for models with different numbers of clusters? This model takes the same basic form as before: X H(s) = Πi (s)θi , (21) i FIG. 18: Hasse diagram of a square-lattice, fifthnearest neighbor model. The vertices of the model correspond to all of the ground state energy configurations for this model class. Paths from the greatest face (labeled 0) to the vertices (labeled 57 - 62) correspond to systematic coarsening of available configurations. For example, the path along nodes 0 → 1 → 7 → 22 → 42 → 57 systematically removes the high frequency configurations. As we have seen, the low dimensional elements of the Hasse diagram are models characterizing the behavioral models of the model which we now interpret. Moving from the greatest face to a first order boundary (i.e. any node from 1 to 6) corresponds to a limiting case in which Jk → ±∞, i.e., a zero-temperature limit. In these limits, many of the possible configurations are “frozen out” so that the models corresponding to the nodes 1 through 6 have between 21 and 65 structurally distinct configurations with nonzero probability (rather than the 432 in the complete model). Although this is a low-temperature limit, the remaining configurations are not limited to the ground states. Rather, the discarded configurations are those that are first to become irrelevant at low temperatures. Moving down the Hasse diagram results in similar limits. At each level, more and more configurations are removed. Each level removes the next group of configurations least relevant at low temperatures. The final result of this process is that only the ground states remain for models of dimension 0. Each vertex corresponds to a model with only a ground state configuration. These ground states are illustrated in Fig. 18. The process of systematically removing high-energy states from a model is reminiscent of a renormalization group procedure. This analogy is reinforced by the observation that the sequence of approximations corresponding to the path labeled 0 → 1 → 7 → 22 → 42 → 57 removes configurations in order of their Fourier frequencies, from highest to lowest. However, for many parameter val- where s is the configurations of the two atom types on the lattice and Πi (s) are the energy contributions of a cluster expansion. The parameters then are the contributions to the energy from nearest neighbor, next nearest neighbor interactions, etc., but can include also many body interactions. For a real alloy, one expects that the true energy involves contributions from all of these terms. However, including all order of the cluster expansion is both impractical and not theoretically enlightening. In practice, the sum is truncated after a finite number of clusters. How do the possible ground states depend on this truncation? Although contributions to the total energy will be dominated by a few large terms in the sum (e.g., binary interactions of nearby neighbors) while other terms are less important (many body interactions of distant neighbors). However, the question of which are the relevant parameters to include is more complicated than simply identifying which parameters are small. In particular, some configurations may be unstable to small perturbations in other parameters. Identifying an appropriate model involves identifying the appropriate parameter combinations that produce ground states that are stable with respect to the perturbation in the omitted parameters. B. Topological embedding identifies relevant and irrelevant parameters We now consider a sequence of models defined in Eq. (21) found by truncating the series at different numbers of parameters. For a binary alloy on an FCC lattice, the manifold for a two parameter model with both nearest and second nearest neighbor two-body interactions is a pentagon, illustrated in Figure 19. We now consider the effect of truncating this this model to a one parameter model. We do this by setting each of the two parameters to zero and varying the other parameter. These one parameter models are illustrated by the red and blue curves 14 FIG. 19: Two parameter FCC lattice model. This model is topologically a pentagon. Corners are indicated by white dots. Two sub-manifolds (red and blue lines) correspond to the models in which one of the two parameters is fixed to zero. The blue curve connects two ground states for the two parameter system, indicating that the ground states for this one parameter model are stable to small perturbations in the second parameter. The red curve, on the other hand, ends on an edge of the two parameter model, indicating that the corresponding ground state is unstable to small perturbations in the second parameter. The topological embedding of these models is summarized by the hierarchical graph in Figure 20. The cartoon inset summarizes the topological relationship among the three manifolds. FIG. 20: Topological embedding summarized by Hasse diagrams. The two parameter model visualized in Figure 19 is topologically a pentagon summarized by the Hasse diagram on the right. The two models of one parameter (red and blue curves in Figure 19) are line segments (Hasse diagrams on the left) that are embedded in the pentagon. Embedding relationships are indicated by dashed lines across Hasse diagrams. The ground states of the blue curve (θ2 = 0, above) are stable to small perturbations in θ2 and are also ground states of the two parameter model (above). Dashed lines with two arrows indicate that nodes are equivalent. One ground state of the red curve (θ1 = 0) is stable to small perturbations in θ1 and is likewise a ground state of the two parameter model. The second ground state (colored black) is unstable because it is a subset of an edge of the two parameter model, indicated by a dashed line with one arrow. This ground state will be unstable to small perturbations in θ1 . in Figure 19. The corners of the two parameter model are illustrated by white dots in Figure 19. These dots represent the emergent model classes and behavioral models of the two parameter model (in this case the distinct ground states of the alloy). Because the one parameter models are each included as special cases of the two parameter model, their topology is embedded within the topology of the two parameter model. We summarize the relationship between the topologies of two parameter model and each of the one parameter models by the dashed lines in Figure 20. For example, because each of the red and blue curves are subsets of the full two parameter model, we draw a dashed line from the greatest face of the two parameter graph to the greatest face of each of the one parameter diagrams. Furthermore, because both vertices of the blue curve correspond to corners of the full model, we connect them to the appropriate vertices of the twodimensional diagram with dashed lines with two arrows to indicate equivalence (Fig. 20, top). In contrast, only one vertex of the red curve is also a vertex of the two parameter model. The other vertex intersects an edge of the two-parameter model. We indicate that this vertex is a subset of an edge by a dashed line connecting the relevant nodes of the graph (Fig. 20, bottom). To summarize, the vertices of the red and blue curves in Figure 19 represent the ground states for the one parameter models. One of the ground states for the red curve is not a ground state for the two parameter model and using this simple model would incorrectly predict the 15 In this paper we have developed a mathematical language for exploring the informational relationships between models and observations. A cornerstone of this formalism is the distinction between an abstract model and a statistical model. The former refers to a collection of physical principles encoded in a parameterization, such as chemical reaction rates, and a set of rules for making quantifiable predictions, such as the law of mass action. Application of these physical principles to specific experimental conditions leads to precise, quantifiable predictions that we refer to as the statistical model. In other words, a statistical model is a realization of an abstract model for specific observations, so that there are many statistical models that share a common parameter space. The distinguishability of predictions for different parameter values induces a metric on the parameter space. Varying the observations changes the statistical model, which in turn changes the geometric properties of the parameter space, such as distance and curvature. However, if we consider the observations for which the parameterization remains structurally identifiable (at least in the local sense), then the resulting differential topology characterizes the abstract model. We refer to the subsequent topological analysis as Information Topology. We have seen that for many models, topological properties can be visualized as a hierarchical graph known as a Hasse diagram. A Hasse diagram naturally reveals the hierarchical relationship among the model’s parameters. We identify the low-dimensional nodes of the Hasse diagram as emergent model classes that describe the behavioral modes the system. The complete system behavior is understood as a combination of these modes. Approximate effective models are systematically constructed from nodes of lower dimension in the Hasse diagram. This procedure is made explicit by the manifold boundary approximation method[21]. For hierarchical models, we have shown how the topology of small models is embedded in the larger model. In this way, we characterize behavioral modes of the model as being either stable or unstable to variations in other parameter values. This distinction leads naturally to the classification of parameters as either relevant or irrelevant depending on whether or not they need to be tuned to realize a behavior. This classification is motivated by the similar classification originating in renormalization group analysis. The framework presented in this paper provides new tools for understanding the relationship between abstract and statistical models and their manifest behaviors. The problem of mathematical modeling in complex systems is an important one that spans many disciplines. We anticipate that the concept of an information topology will be useful for studying systems in statistical mechanics, biology, chemistry, engineering, climate, and economics among others. Application of the concepts in this paper may also be useful for problems related to experimental design, engineering and control, as well as providing a deeper understanding and explanation of the emergent physical principles that govern behavior in complex systems. The authors thank Lei Huang, Jim Sethna, and Chris Myers for suggesting Figure 1 and Kolten Barfuss and Alexander Shumway for helpful conversations. [1] E. Wigner: Wigner, EP op. cit (1995) 534 [2] P. W. Anderson, et al.: Science 177 (1972) 393 [3] B. B. Machta, R. Chachra, M. K. Transtrum, J. P. Sethna: Science 342 (2013) 604 [4] C. R. Rao: Sankhya: The Indian Journal of Statistics 9 (1949) 246 [5] E. Beale: Journal of the Royal Statistical Society. Series B (Methodological) (1960) 41 [6] D. M. Bates, D. G. Watts: Journal of the Royal Statistical Society. Series B (Methodological) (1980) 1 existence of a stable structure corresponding to this vertex. The reason for this is not that the missing parameter is large in an actual alloy system, but that that configuration is unstable to arbitrarily small perturbations in this parameter. This instability is manifest in the way the one parameter topology is embedded in that of the two parameter model. Since the vertex of one parameter model lies on an edge and not a vertex of the two parameter model, the second parameter must be tuned to realize this behavior. If a model class is unstable to the addition of a new parameter, we classify this parameter as relevant for modeling the behavior. Similarly, if a model class is stable to the introduction of a new parameter, we classify the parameter as irrelevant. Qualitatively, relevant parameters are those that must be tuned to realize a behavior. The terms stable/unstable and relevant/irrelevant are used in analogy with similar definitions in RG analysis. This present discussion has revolved around finding ground states for alloy models (i.e., phase transitions) in order to make the connection to these standard definitions more transparent. An RG fixed point with no unstable direction (i.e., a sink) corresponds to a bulk phase[22, 23] because the system behavior in stable to variations in the parameters. Near a fixed point, relevant parameters are those that need to be tuned to realize a phase transition or a critical point. The language of information topology allows the same notions of stability of system behavior to extend to other diverse systems. In this way, the question of what representation is appropriate for a particular physical system can be answered in a systematic way. VI. DISCUSSION 16 [7] S.-i. Amari: Differential-geometrical methods in statistics: Springer (1985) [8] S.-I. Amari, O. E. Barndorff-Nielsen, R. Kass, S. Lauritzen, C. Rao: Lecture Notes-Monograph Series (1987) i [9] R. E. Kass: Statistical Science (1989) 188 [10] M. K. Murray, J. W. Rice: Differential geometry and statistics, vol. 48: CRC Press (1993) [11] S.-i. Amari, H. Nagaoka: Methods of information geometry, vol. 191: American Mathematical Soc. (2007) [12] M. K. Transtrum, B. B. Machta, J. P. Sethna: Physical review letters 104 (2010) 060201 [13] M. K. Transtrum, B. B. Machta, J. P. Sethna: Physical Review E 83 (2011) 036701 [14] K. S. Brown, J. P. Sethna: Physical Review E 68 (2003) 021904 [15] K. S. Brown, C. C. Hill, G. A. Calero, C. R. Myers, K. H. Lee, J. P. Sethna, R. A. Cerione: Physical biology 1 (2004) 184 [16] S. L. Frederiksen, K. W. Jacobsen, K. S. Brown, J. P. Sethna: Physical review letters 93 (2004) 165501 [17] J. J. Waterfall, F. P. Casey, R. N. Gutenkunst, K. S. Brown, C. R. Myers, P. W. Brouwer, V. Elser, J. P. Sethna: Physical review letters 97 (2006) 150601 [18] R. N. Gutenkunst, J. J. Waterfall, F. P. Casey, K. S. Brown, C. R. Myers, J. P. Sethna: PLoS computational biology 3 (2007) e189 [19] F. P. Casey, D. Baird, Q. Feng, R. N. Gutenkunst, J. J. Waterfall, C. R. Myers, K. S. Brown, R. A. Cerione, J. P. Sethna: IET systems biology 1 (2007) 190 [20] B. C. Daniels, Y.-J. Chen, J. P. Sethna, R. N. Gutenkunst, C. R. Myers: Current opinion in biotechnology 19 (2008) 389 [21] M. K. Transtrum, P. Qiu: Physical Review Letters 113 (2014) 098701 [22] N. Goldenfeld (1992) [23] J. Zinn-Justin: Phase transitions and renormalization group: Oxford University Press (2007) [24] M. C. Eisenberg, S. L. Robertson, J. H. Tien: Journal of theoretical biology 324 (2013) 84 [25] T. J. Rothenberg: Econometrica: Journal of the Econometric Society (1971) 577 [26] C. Cobelli, J. J. Distefano 3rd: American Journal of Physiology-Regulatory, Integrative and Comparative Physiology 239 (1980) R7 [27] D. Faller, U. Klingmüller, J. Timmer: Simulation 79 (2003) 717 [28] K.-H. Cho, S.-Y. Shin, W. Kolch, O. Wolkenhauer: Simulation 79 (2003) 726 [29] E. Balsa-Canto, A. A. Alonso, J. R. Banga: IET systems biology 2 (2008) 163 [30] J. F. Apgar, J. E. Toettcher, D. Endy, F. M. White, B. Tidor: PLoS computational biology 4 (2008) e30 [31] J. F. Apgar, D. K. Witmer, F. M. White, B. Tidor: Molecular BioSystems 6 (2010) 1890 [32] K. Erguler, M. P. Stumpf: Molecular BioSystems 7 (2011) 1593 [33] R. Chachra, M. K. Transtrum, J. P. Sethna: Molecular BioSystems 7 (2011) 2522 [34] M. K. Transtrum, P. Qiu: BMC bioinformatics 13 (2012) 181 [35] M. K. Transtrum: arXiv preprint arXiv:1605.08705 (2016) [36] B. Grunbaum, V. Klee, M. A. Perles, G. C. Shephard: Convex polytopes: Springer (1967) [37] G. M. Ziegler: Lectures on polytopes, vol. 152: Springer Science & Business Media (1995) [38] A. Brondsted: An introduction to convex polytopes, vol. 90: Springer Science & Business Media (2012) Supplemental Information A. Visualization Methods Most examples throughout the text were chosen to consist of either two or three parameters, corresponding to manifolds of two or three dimensions, so that their topological structure could be more easily visualized. However, these manifolds are embedded in a data space of often much higher dimension. We therefore project this high-dimensional embedding space into a three dimensional subspace in order to generate the figures found in the main text. In order to generate low-dimensional projections, we first constructed a grid of the parameter space and evaluated the model prediction at each point. The corresponding grid of model predictions correspond to a grid of vectors in the high-dimensional embedding space. We then performed a principle component analysis of this grid of prediction vectors and projected the grid onto each of the principle components. We then created the visualization by truncating all but the first three principle components. For two-dimensional manifolds, we have colored the manifold according to the fourth principle component, effectively visualizing a four-dimensional embedding. For three-dimensional manifolds, i.e., the enzyme-substrate model, we have colored each boundary of the volume a solid color to help illustrate the topological structure. B. Embedding space for non least-squares models We have used the Fisher Information Matrix (FIM) as the Riemannian metric for measuring distances between models. When the model in question is a least-squares model, then there is a natural Euclidean metric in behavior space corresponding to the sum of squares defined by the χ2 cost function. This Euclidean metric induces a non-euclidean metric on the embedded model that is equivalent to the Fisher Information[4–13]. A similar Euclidean embedding space can be found for an arbitrary probabilistic model P (ξ, θ). We derive this metric for the case of discrete probability distributions, but the result also holds for probability densities. This embedding space p can be found by constructing the variable zi (θ) = 2 Pi (θ) where the index i labels each configuration of the random variable ξ. Assuming a Eu- 17 clidean metric on the vector z, gives ds2 = X i dzi2 = X dP 2 i i Pi  =  2 dP P2 , (22) where in the last term we have written the sum as an expectation value. Note that X ∂P dP = d log P = dθµ , P ∂θ µ µ from which it follows that X  ∂ log P ∂ log P  ds2 = dθµ dθν , ∂θ ∂θ µ ν µν so that the induced metric on the manifold is   ∂ log P ∂ log P gµν = , ∂θµ ∂θν (23) (24) (25) which is the Fisher Information Metric. P 2 Notice that normalization requires that = i zi P 4 i Pi2 = 4, so that the variables zi correspond to a hyper-sphere embedded in a Euclidean data space. The model manifold is then embedded in this hyper-sphere. We interpret this Euclidean, hyper-sphere embedding in the same way as the Euclidean embedding space for least squares models, i.e., as a data or behavior space. C. Topology and alternate metrics In the main text of the paper, we have used the Fisher Information Matrix (FIM) as the metric that defines relative distances between different statistical models that are realized from the same abstract model. Since an abstract model is characterized by its parameterization, we found that changing the observations lead to different metrics on the same parameter space. Although the FIM has many desirable statistical properties, it is not the unique measure of statistical distance between probability distributions. Other notable examples include the Hellinger distance, total variation distance, the Levy-Prokhorov metric, Bhattacharyya distance, earth mover’s distance (also known as the Wasserstein or Kantorovich metric) and the energy distance. Furthermore, there are many other distance measures that are applicable to specific types of models and not probability distributions generally, such as the H∞ norm in control theory applicable to dynamical systems. (While all of these metrics are valid measures of statistical distance, they are not all Riemannian metrics, i.e., they do not define an inner product. Indeed, one of the advantages of the FIM is that it corresponds to a Riemannian metric, thus allowing the use of differential geometry.) Changing metrics among the many possible choices is in many ways analogous to changing observations. The net effect is to change the meaning of distance for parameter values in the model. As such, the results of this paper can be applied to alternative metrics. Furthermore, there are many measures of statistical divergence that, while not properly metrics (they may not satisfy either symmetry or the triangle inequality), are often interpreted as a type of distance measure. A class of such divergences are the f-divergences, among which the Kullback-Leibler divergence is a well-known example. (Interestingly, the FIM corresponds to the f-divergence for infinitesimally separated distributions.) Other classes of divergences include the M-divergences and S-divergences. Specific examples include Renyi’s divergence and the Jensen-Shannon divergence. Although not properly metrics, statistical divergences do define a topological space. Consquently, the topological properties of abstract model can realized using a divergence rather than a proper metric.
10math.ST
Massive Multiple Input Massive Multiple Output for 5G Wireless Backhauling D.-T. Phan-Huy1, P. Ratajczak1, R. D'Errico2, J. Järveläinen3*, D. Kong4, K. Haneda3, B. Bulut4, A. Karttunen3, M. Beach4, E. Mellios4, M. Castañeda5, M. Hunukumbure6, T. Svensson7 1 Orange Labs, 2CEA-LETI, 3Aalto Univ.,*Premix Oy, 4Univ. of Bristol, 5Huawei, 6Samsung, 7Chalmers Univ. of Technology dinhthuy.phanhuyorange.com Abstract— In this paper, we propose a new technique for the future fifth generation (5G) cellular network wireless backhauling. We show that hundreds of bits per second per Hertz (bits/s/Hz) of spectral efficiency can be attained at a high carrier frequency (such as 26 GHz) between large antenna arrays deployed along structures (such as lamp posts) that are close and roughly parallel to each other. Hundreds of data streams are spatially multiplexed through a short range and line of sight “massive multiple input massive multiple output” (MMIMMO) propagation channel thanks to a new low complexity spatial multiplexing scheme, called “block discrete Fourier transform based spatial multiplexing with maximum ratio transmission” (BDFT-SM-MRT). Its performance in real and existing environments is assessed using accurate ray-tracing tools and antenna models. In the best simulated scenario, 1.6 kbits/s/Hz of spectral efficiency is attained, corresponding to 80% of Singular Value Decomposition performance, with a transmitter and a receiver that are 200 and 10,000 times less complex, respectively. spectral efficiencies of hundreds of bits/s/Hz. In this paper, for the first time, we evaluate MMIMMO deployments in real and existing environments, using ray-tracing tools that accurately model the scattering. Antenna radiation patterns are also accurately modeled and practical deployment considerations not exactly fulfilling (1) are also taken into account. Legend: L ULA D Transmit ULA with N elements Receive ULA with N elements Fig. 1. Communication between two ULAs in LOS. Transmit ULA Receive ULA Transmit ULA Receive ULA Keywords—5G, high carrier frequency, millimeter wave, Massive MIMO, short range, Line-Of-Sight MIMO I. INTRODUCTION Due to the availability of large spectrum at higher carrier frequencies, the spectrum bands corresponding to millimeter waves are good candidates for the self-backhauling of the future 5th generation (5G) of mobile networks [1]. Their coverage limitation could be overcome through a dense deployment. In this paper, we propose to boost the spectral efficiency of millimeter wave based backhaul links through a new type of deployment. In theory [2-5], two uniform linear arrays (ULAs) of 𝑁 antenna elements and of equal length and parallel to each other, communicating through a line of sight (LOS) multiple input multiple output (MIMO) propagation channel (as illustrated in Fig. 1), can multiplex 𝑁 data streams in the spatial domain, under the following conditions: (1) 𝐿2 = 𝑁; 𝜆𝐷 (2) 𝐷 ≫ 𝐿, where 𝜆 = 𝑐/𝑓 is the wavelength (𝑐 and 𝑓 being the speed of light and the carrier frequency, respectively), 𝐷 is the distance between the ULAs, 𝐿 is the ULAs’ length (as illustrated in Fig. 1.). According to [5], conditions (1) and (2) guarantee that the MIMO channel matrix has 𝑁 equal eigenvalues. Recently, [6] has shown that 𝑁 can reach values as high as several hundreds of antenna elements, if 𝜆 corresponds to 5G (candidate) high carrier frequencies and if 𝐷 and 𝐿 are chosen smartly. These new types of deployments, that we call “massive multiple input massive multiple output” (MMIMMO), could deliver gigantic a) DFT over the entire array b) DFT per block (two blocks example) Fig. 2. 16×16 MIMO system mapping 16 streams into 16 angles. In this paper, we also propose a new practical signal processing scheme for these new MMIMMO deployments. As applying singular value decomposition (SVD) to a MMIMMO system is too complex, we propose to re-use a practical low complexity spatial multiplexing (SM) scheme that combines discrete Fourier transform (DFT) and maximum ratio transmission (MRT) precoding, called DFT-SM-MRT [7]. Fig. 2-a) illustrates the use of DFT-SM alone (without MRT) with two ULAs parallel to each other and in LOS. In this case, data streams are mapped into angles. In DFT-SM-MRT, the role of MRT is to mitigate the effect of scattering and to deal with cases where the ULAs might not be perfectly parallel. However, DFT-SM-MRT [7] still suffers from residual interference, especially when condition (2) is not met. In this paper, we present a new low complexity scheme called block DFT-SMMRT (B-DFT-SM-MRT), with a similar complexity as the one of DFT-SM-MRT. As illustrated in Fig. 2, it applies the DFT per block. The main idea of this scheme is to approximately fulfill condition (2) on a per-block basis. The outline of the paper is as follows. Section II defines a set of practical MMIMMO links that could be deployed in existing environments, and their corresponding antenna and propagation models. Section III presents the novel B-DFT-SM- MRT scheme and recalls the definitions of the DFT-SM-MRT and SVD schemes. Section IV compares these schemes in terms of performance and complexity, for all links defined in Section II. Section V concludes this paper. A. MMIMMO links in the City Center of Bristol Legend: ULA The following notations are used. 𝐈 (𝑁) is the identity matrix of size 𝑁. 𝐌 DFT(𝑁) , 𝐌 IDFT(𝑁) ∈ ℂ𝑁×𝑁 are the Butler matrices of size 𝑁, for the DFT and the IDFT operations, respectively. If 𝐀 ∈ ℂ𝑁×𝑀 , 𝐀∗ is the conjugate of 𝐀 , 𝐀† is the transpose conjugate of 𝐀, rank(𝐀) is the rank of 𝐀, 𝐀𝑛,𝑚 is the element in the 𝑛-th row and 𝑚-th column, with 1 ≤ 𝑛 ≤ 𝑁 and 1 ≤ 𝑚 ≤ 𝑀. If 𝑥 ∈ ℂ, then |𝑥| is the module 𝑥. II. a) College Green Area (Google maps) MMIMMO LINKS IN EXISTING ENVIRONMENTS To assess the performance of MMIMMO links in real and existing environments, we have built environment-specific channel models. We consider 𝑓 = 26 ∙ 109 Hz, as it corresponds to a candidate carrier frequency for 5G in Europe. We consider a narrowband signal. Such signal can either be obtained with a narrowband single carrier waveform or a narrow sub-band of a wideband multi-carrier waveform. With this assumption, the propagation between the transmit array and the receive array can be considered as frequency flat and can be modeled with a complex channel matrix. Let 𝐇 ∈ ℂ𝑁×𝑁 be the MMIMMO propagation channel matrix. We model the propagation between the 𝑛-th transmit antenna element and the rays 𝑚-th receive antenna with a finite number of rays 𝑁𝑛,𝑚 that depends on 𝑛 and 𝑚 . Indeed, different pairs of receive and transmit antenna, which are very far apart in the arrays, may see different numbers of scatterers. The 𝑟-th ray (with 1 ≤ 𝑟 ≤ rays 𝑁𝑛,𝑚 ) has a path gain 𝛼𝑛,𝑚,𝑟 ∈ ℂ, a direction of arrival vector ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ 𝐃𝐨𝐀 𝑛,𝑚,𝑟 ∈ ℝ𝟑 and a direction of departure vector ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ 𝐃𝐨𝐃𝑛,𝑚,𝑟 ∈ ℝ𝟑 . We assume that all transmit and receive antenna elements 𝟑 have the same antenna gain function 𝛤 ∈ ℝℝ , 𝛤 being a function of the direction of arrival (or departure). With these notations, the channel coefficient 𝐇𝑛,𝑚 between the receive antenna n and the transmit antenna m is given by: rays 𝑁𝑛,𝑚 (3) ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ 𝐇𝑛,𝑚 = ∑ 𝛼𝑛,𝑚,𝑟 𝛤(𝐃𝐨𝐀 𝑛,𝑚,𝑟 )𝛤(𝐃𝐨𝐃𝑛,𝑚,𝑟 ). 𝑟=1 We have used two different ray-tracing tools to obtain the rays parameters 𝑁𝑛,𝑚 , 𝛼𝑛,𝑚,𝑟 , ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ 𝐀𝐨𝐀 𝑛,𝑚,𝑟 and ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ 𝐀𝐨𝐃𝑛,𝑚,𝑟 in two different environments: an outdoor and an indoor environment, described in the Sections II-A and II-B, respectively. Each tool is modelling a real and existing environment in which antenna elements can be positioned. The aforementioned parameters are then generated based on the chosen positions of the antenna ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ elements. 𝛤(𝐃𝐨𝐀 𝑛,𝑚,𝑟 ) and 𝛤(𝐃𝐨𝐃𝑛,𝑚,𝑟 ) are determined based on an accurate antenna model presented in the Section IIC. Finally, the method for the setting of the MMIMMO parameters (such as the number of antenna elements N) is given in Section II-D. c) Link N 1 b) Link N 0 d) Link N 2 Fig. 3. Modeled links for outdoor environment (in Bristol’s City Center). Fig. 3 a) illustrates the considered outdoor environment. The chosen outdoor environment is an existing road of the “College Green Area”, in the city center of Bristol, in the United Kingdom. The ULAs are assumed to be deployed on existing lamp-posts. Three different links between lamp-posts, named “Link N° 0”, “Link N° 1” and “Link N° 2” are considered and illustrated in Fig. 3 b), c) and d), respectively. The employed ray tracer identifies the radio wave scatterers using an accurate geometrical database of the physical environment [8], [9]. A similar scenario has been adopted in [10]. Point-source three dimensional (3D) ray-tracing is performed from each antenna element of the transmit array to each antenna element of the receive array assuming isotropic elements. The tool provides the necessary information to compute the parameters of equation (3) for each ray. B. MMIMMO links in the Helsinki Airport As an example of indoor environment, we chose to model the existing Helsinki airport check-in hall. Again, the used raytracing tool uses an accurate geometrical database of the physical environment, a so called point cloud model [11]. The point cloud model includes small objects (e.g. self-check-in machines) which scatter energy at high carrier frequencies. Our simulator is calibrated with experimental measurements made in the Helsinki airport check-in hall [12]. Legend: scatterer (larger circle means stronger) distance between ULAs C. Model of antennas The radiation patterns at 26 GHz of two different antennas are generated by simulation: a ‘basic antenna’ (a classical printed dipole on a ground plane) illustrated in Fig. 6-a) and a “directional antenna” illustrated in Fig. 6-b). The directional antenna consists of five units of the basic antenna, separated by 1.5 wavelengths. As a finite number of discrete spatial samples of these radiation patterns are generated by simulations, an interpolation between samples is necessary to obtain the exact ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ values of 𝛤(𝐃𝐨𝐀 𝑛,𝑚,𝑟 ) and 𝛤(𝐃𝐨𝐃𝑛,𝑚,𝑟 ) used in Equation (3). Fig. 4. Point cloud model of the Helsinki Airport Check-In Hall, illustrating the propagation between one point on the giant screen and one point on the canopy: the main LOS direction is indicated by the light green straight line, the scatterers identified by the tool are indicated by the yellow circles. Larger yellow circle means that the scatterer has a stronger impact. L = 25 cm a) Link N 3 between laptops in Helsinki Airport Check-In Hall Airport (view of the hall from above) Fig. 6. Antenna radiation pattern of an antenna element and ULAs. D. MMIMMO parameters For each MMIMMO link listed in Section II-A and Section II-B, we compute the ULAs parameters depending on the physical structures (lamp posts, signboards etc.) on which the ULAs are deployed. Link N 6 b) Links N 4, 5, 6 and 7 in Helsinki Airport Check-In Hall Fig. 5. Modeled links for indoor environment in Helsinki Airport Check-In Hall. As illustrated in Fig. 4, our simulator accurately identifies the locations and the reflection (or scattering) coefficients of the scatterers. The information on the scatterers allows us to derive the parameters of equation (3). Different MMIMMO links illustrated in Fig. 5 are considered: between nearby devices (“Link N° 3”); between signboards (“Link N° 4” and “Link N° 5”); between self-check-in-machines (“Link N° 6”) and finally between a signboard and a canopy (“Link N° 7”). Let 𝑁 U and 𝑑 be the number of data streams multiplexed in the spatial domain and the inter-antenna spacing, respectively. The number of antenna elements 𝑁 is set equal to 𝑁 U in the case of the DFT-SM-MRT scheme and the SVD scheme. As it will later be explained in Section III, 𝑁 potentially very slightly exceeds 𝑁 U in the case of B-DFT-SM-MRT. Although, from the ray-tracing tools, we know the exact value of 𝐷 , we compute the MMIMMO system parameters based on an ̂ (with an arbitrarily small chosen error in the approximation 𝐷 order of a decimeter), since we assume that in a real deployment situation, one can only obtain an imperfect measurement of 𝐷. We choose 𝑑 and 𝑁 U , where 𝑁 U = 𝑁 (for all cases except some configurations of B-DFT-SM-MRT), so that condition (1) is met as much as possible and with the following additional constraint: 𝑁 U must be a power of 2. Note that this constraint only applies to 𝑁 U and does not apply to 𝑁 when 𝑁 > 𝑁 U . This latter requirement ensures a low complexity implementation of the DFT. Two different methods to chose 𝑁 U are tested in this paper. In the first method (applied to the outdoor links), we arbitrarily set 𝑁 U = 64 = 26 . In the second method (applied to the indoor links), we determine the length 𝐿 (in meters) of the physical structure on which we deploy the ULA. We then compute the largest 𝑁 U that is deployable within 𝐿 and that is close to fulfilling condition (1), as follows: 𝑁 U = 2𝐾 and (4) 2 𝐿 )}. 𝑘∈ℕ 𝜆𝐷 In practice, one cannot position antennas with an infinite precision. We thus define 𝛿 as the spatial step for the positioning of antennas. 𝑑 is then determined as follows, for both methods: 𝐾 = arg {max (2𝑘 ≤ 𝛿 1 ⌊ √𝜆𝐷𝑁 U ⌋. 𝑁U 𝛿 Table I lists the parameters of the considered MMIMMO links. ̂ /(dND) Note that for some links, condition (2) is not met (i.e. 𝐷 is not much higher than 1). Compared to DFT-SM-MRT, BDFT-SM-MRT is therefore expected to improve these links. For the Link N°4, we allow the deployment of antennas 30 cm above the check-in machine height. 𝑑= TABLE I. MMIMMO PARAMETERS WITH 𝛿 = 0.1 𝑚𝑚 Link N° 3 4 5 0, 1 and 2 6 7 ̂ 𝐷 (m) 0.5 17.4 8.9 𝐿 (m) 0.30 1.55+0.30 3.7 25 NA 0.9 18.7 1.3 8.85 III. 𝑁U 8 16 64 128 256 𝑑 (mm) 26.8 112 45.8 𝑁 U𝑑 (m) 0.2144 1.792 2.9312 67.1 4.2944 9 28.7 1.152 7.3472 ̂ 𝐷 Fig. 7. Common and scheme specific parameters. To assess the maximum achievable performance of the MMIMMO system, we assume that the signal to noise ratio is very large, and that the system is only limited by the signal to interference ratio (SIR). The SIR of one data stream can be derived based on the MIMO equivalent channel matrix 𝐆. The SIR 𝐬𝐢𝐫𝑛 of each data stream 𝑛 is given by: 2 𝐬𝐢𝐫𝑛 = |𝐆𝑛,𝑛 | 2 U ∑𝑁 𝑝=1,𝑝≠𝑛|𝐆𝑛,𝑝 | The theoretical attainable spectral efficiency 𝐜𝑛 for the data stream number 𝑛 is given by: 𝐜𝑛 = log 2 (1 + 𝐬𝐢𝐫𝑛 ), 1 ≤ 𝑛 ≤ 𝑁 U . Practical modulations (such as 256 QAM or QPSK) and coding schemes have a bounded spectral efficiency. We therefore define the minimum and maximum spectral efficiencies, 𝑠 MIN and 𝑠 MAX , accordingly. We define the practical spectral efficiency 𝐜𝑛P as follows: P MAX ) MAX ) 𝐜𝑛 = min(𝐜𝑛 , 𝑠 if min(𝐜𝑛 , 𝑠 > 𝑠 MIN and 𝐜𝑛P = 0 otherwise. The resulting total spectral efficiency 𝑠 is therefore: D 𝑑𝑁 ~2 ~10 ~3 ~6 ~13 ~3 STUDIED SCHEMES This section describes the three following spatial multiplexing schemes: A) DFT-SM-MRT [7] (as the baseline method); B) B-DFT-SM-MRT (as the new proposed method); C) SVD spatial multiplexing (as an upper bound). To make a fair comparison, we impose the following common constraint: the number of streams 𝑁U and the inter-antenna spacing 𝑑 defined in Section II are common to all schemes. As illustrated in Fig. 7, only the following parameters can be schemespecific: the number of antenna elements 𝑁 , the spatial precoder and the spatial decoder. As a consequence, the propagation channel matrix 𝐇 ∈ ℂ𝑁×𝑁 and the equivalent channel matrix 𝐆 ∈ ℂ𝑁U×𝑁U (that includes precoding, propagation, and decoding) are also scheme-specific. , 1 ≤ 𝑛 ≤ 𝑁 U. 𝑁U (5) 𝑠 = ∑ 𝐜𝑛P . 𝑝=1 For each spatial multiplexing scheme, the spectral efficiency is determined using equation (5), this equation being fed with a scheme-specific expression of 𝐆. Next sub-sections provide the expressions of the schemespecific parameters 𝐇 , 𝐆 and 𝑁 . The same transmit power constraint is assumed for all transmitters. A. DFT-SM-MRT For DFT SM-MRT [7], the number of antenna elements is U 𝑁 = 𝑁 U . As illustrated in Fig. 8, 𝜌𝐇 † 𝐌 IDFT(𝑁 ) is the U precoder and 𝐌 DFT(𝑁 ) is the decoder, with 𝜌 being a schemespecific normalising factor to satisfy the power constraint. The equivalent MIMO channel 𝐆 is thus: U U 𝐆 = 𝜌𝐌 DFT(𝑁 ) 𝐇𝐇 † 𝐌 IDFT(𝑁 ) . (6) 𝐆 = 𝜌𝐑𝐇𝐇 † 𝐓, Fig. 8. DFT-SM-MRT spatial multiplexing scheme [7]. B. B-DFT-SM-MRT As illustrated in Fig. 9, compared to DFT-SM-MRT, BDFT-SM-MRT applies the DFT to 𝑁 S blocks of 𝑁 D data symbols separately, with 𝑁 D = 𝑁 U /𝑁 S . 𝑁 S is selected so that condition (2) is better fulfilled, at least on a per-block basis, i.e. ̂ /(𝑑𝑁 D ) > 1. We optionally append a cyclic prefix such that: 𝐷 (CP) [13] of 𝑁 CP symbols in the spatial domain (with 0 ≤ 𝑁 CP ≤ 𝑁 D), after each ‘per block’ DFT operation. As symbols are mapped onto antennas, this has a direct impact on the role of each antenna. The 𝑁 S blocks of 𝑁 D data symbols are mapped onto 𝑁 S blocks of 𝑁 D ‘data antennas’. This constitutes a set of 𝑁 U ‘useful antennas’. 𝑁 S blocks of 𝑁 CP symbols are mapped onto 𝑁 S blocks of 𝑁 CP ‘CP antennas’. Each block of 𝑁 CP ‘CP antennas’ is inserted between two successive blocks of 𝑁D ‘data antennas’. Each block of 𝑁 D data streams goes through an inverse DFT, which is equivalent to a multiplication D by 𝐌 IDFT(𝑁 ) . We set 𝑁 E = 𝑁 D + 𝑁 CP . This time, 𝑁 ≥ 𝑁 U antenna elements (instead of 𝑁 U ) are used at both the transmitter and receiver sides, with: 𝑁 = 𝑁 S (𝑁 D + 𝑁 CP ) = 𝑁 S 𝑁 E = 𝑁 U + 𝑁 S 𝑁 CP . (7) (8) where 𝜌 is a scheme-specific normalising factor to satisfy the power constraint. Note that when 𝑁 S = 1 and 𝑁 CP = 0 , BDFT-SM-MRT is identical to DFT-SM-MRT. C. SVD Fig. 10. SVD spatial multiplexing scheme. The number of antennas 𝑁 for this scheme is: 𝑁 = 𝑁 U . As U U illustrated in Fig. 10, 𝐔, 𝐕, 𝚫 ∈ ℂ𝑁 ×𝑁 are matrices obtained from the singular value decomposition of 𝐇𝐇 † , i.e., such that U 𝐇𝐇 † = 𝐔𝚫𝐕, with 𝚫 being diagonal, and 𝐕𝐕 † =𝐔𝐔 † = 𝐈 (𝑁 ) . Let 𝜌 be a scheme-specific normalising factor to satisfy the power constraint. 𝜌𝐇𝐕 † is the precoder and 𝐔 † is the decoder. With these notations, the equivalent MIMO channel 𝐆 is: 𝐆 = 𝜌𝚫. IV. (9) PERFORMANCE AND COMPLEXITY EVALUATION The performance analysis and the complexity analysis are performed for the MMIMMO links defined in Section II and the schemes described in Section III. Section IV. A lists the simulated scenarios. Section IV-B and Section IV-C describe the spectral efficiency and complexity evaluation methods, respectively. Finally, Section IV-D provides the results. A. Simulation scenarios Table II lists the simulated scenarios and their corresponding parameters. In this table, and throughout this paper, the notations * and ** indicate that B-DFT-SM-MRT without CP and B-DFT-SM-MRT with CP are used, respectively. The absence of these notations indicates that DFT-SM-MRT is used. Fig. 9. B-DFT-SM-MRT spatial ultiplexing scheme. , For all scenarios, the channel and antenna models described in Section II are used to generate H.  𝐀𝑘,𝑙 = 1 if 𝑙 = 𝑁 + 𝑘 and 1 ≤ 𝑘 ≤ 𝑁 or if 𝑙 = 𝑘 and 𝑁 CP + 1 ≤ 𝑘 ≤ 𝑁 CP + 𝑁 D ; 𝐀(𝑘, 𝑙) = 0 otherwise; The performance is also evaluated in a free space (FS) propagation scenario (i.e. a pure LOS scenario). Let 𝛿𝑛,𝑞 be the distance between the receive antenna element 𝑛 and the transmit antenna element 𝑞. For FS, 𝐇𝑛,𝑞 is given by: 𝐇𝑛,𝑞 = We define the matrices 𝐀, 𝐀′ ∈ ℂ𝑁 U U 𝐓 ∈ ℂ𝑁×𝑁 and 𝐑 ∈ ℂ𝑁 ×𝑁 as follows: E ×𝑁D D , 𝐁, 𝐁′ ∈ ℂ𝑁 D× CP  𝐁𝑘,𝑙 = 1 if 𝑙 = 𝑁 CP + 𝑘 and 1 ≤ 𝑘 ≤ 𝑁 D ; 𝐁(𝑘, 𝑙) = 0 otherwise;  𝐀′ = 𝐀𝐌 IDFT(𝑁 D) ( 𝜆 4π𝛿𝑛,𝑞 )𝑒 −𝑗2𝜋𝛿𝑛,𝑞/𝜆 . D and 𝐁′ = 𝐌 DFT(𝑁 ) 𝐁;  𝐓𝑘+(𝑛−1)𝑁E ,𝑙+(𝑛−1)𝑁D = 𝐀′𝑘,𝑙 , for 1 ≤ 𝑛 ≤ 𝑁 S , 1 ≤ 𝑘 ≤ 𝑁 E and 1 ≤ 𝑙 ≤ 𝑁 D; ′  𝐑 𝑘+(𝑛−1)𝑁D ,𝑙+(𝑛−1)𝑁E = 𝐁𝑘,𝑙 , for 1 ≤ 𝑛 ≤ 𝑁 S , 1 ≤ 𝑘 ≤ D E 𝑁 and 1 ≤ 𝑙 ≤ 𝑁 . With these definitions, the equivalent channel 𝐆 is given by: TABLE II. SIMULATED SCENARIOS N° 3 3* 4 4* Link N 𝑁𝑑 (m) 3 8 0.2144 4 16 1.792 𝑁S 𝑁D 1 2 1 2 8 4 16 8 𝑁 CP 0 0 ̂ 𝐷 D 𝑑𝑁 ~2 ~5 ~10 ~19 0 4.2944 64 1 4.2944 2 4.2944 6 7 128 1.152 144 1.296 256 7.3472 264 7.5768 1 4 1 2 1 2 1 2 1 16 16 1 8 64 16 64 32 64 32 64 32 128 8 8 256 32 32 0 0 0 0 0 0 1 0 1 ~3 ~12 ~6 ~12 ~6 ~12 ~6 ~12 ~1 ~13 ~13 ~3 ~20 ~20 B. Spectral efficiency evaluation methodology The spectral efficiency 𝑠 is computed using Equation (5) and the method given in Section III. We set 𝑠 =8 bits/s/Hz (corresponding to 256-QAM and a coding rate of 1) and 𝑠 MIN = 1 bit/s/Hz (corresponding to QPSK and a coding rate of 1/2). Note that, for SVD, the spectral efficiency is simply given by 𝑠 = 𝑁 U 𝑠 MAX . For each scheme, the two following metrics are computed:  the ratio 𝜙 SVD between the spectral efficiency of the considered scheme and the spectral efficiency of SVD; in Table IV. The larger these metrics, the better they are. Indeed, the transmitter (respectively the receiver) of the considered scheme, is 𝜇 TX (respectively 𝜇 RX ) less times complex than the one of SVD. TABLE III. SVD SCHEME COMPLEXITY SCALING LAWS (TX= TRANSMITTER, RX= RECEIVER) Computations Tx SVD 2.9312 Rx Tx DFT-SMMRT 5 𝐕, 𝐕 † 𝐱, Complexity scaling law 3 𝐇† 𝐕† 𝐱 3 𝐌 IDFT(𝑁U) 𝐱 2 𝑂 (𝑁 U log 2 (𝑁 U )). 𝐌 DFT(𝑁U) 𝐳 DFT Tx 𝐇 † 𝐓. 𝐱 𝑂 ((𝑁 U + 𝑁 S 𝑁 CP ) + 𝑁 U log 2 ( Rx 𝐑𝐳 BDFT 𝑂 (𝑁 U log 2 ( 2 B-DFT-SM-MRT We finally define 𝜇 𝑇𝑋 (and 𝜇 𝑅𝑋 , respectively) as the ratio of the complexity scaling law of the transmitter (the receiver respectively) of SVD, over the complexity scaling law of the transmitter (the receiver respectively) of the considered scheme. Using the expressions in Table III, we obtain the expressions of 𝜇 𝑇𝑋 and 𝜇 𝑅𝑋 , for the DFT-SM-MRT and the B-DFT-SM-MRT, 𝑁S 𝑁S )) )) 𝜇TX 𝜇RX log2 (𝑁U )+𝑁U log2 (𝑁U ) 𝑁U +2𝑁U 𝑁U +2𝑁U 2 2 (𝑁U +𝑁S 𝑁CP ) +𝑁U log2 ( 𝑁 U 𝑁U 𝑁U TABLE IV. EXPRESSIONS OF 𝜇TX AND 𝜇RX The closer to these metrics, the better the schemes are. We define 𝐱 ∈ ℂ𝑁 ×1 as the vector of transmitted symbols. U U U S CP SVD 𝐳 ∈ ℂ𝑁 ×1 , 𝐳 DFT ∈ ℂ𝑁 ×1 and 𝐳 BDFT ∈ ℂ𝑁 +𝑁 𝑁 are the vectors of symbols received at the receive antenna array for the SVD, the DFT-SM-MRT and the B-DFT-SM-MRT, respectively. Using these notations, we derive the complexities scaling laws for the transmitter (taking into account the spatial precoding only) and the receiver (taking into account the spatial decoding) and report them in Table III. Our analysis excludes the MRT block as it appears in all the compared schemes (SVD included). 2 𝑂 (𝑁 U log 2 (𝑁 U ) + 𝑁 U ) . 𝐇 † 𝐌 IDFT(𝑁U) 𝐱 Scheme DFT-SM-MRT We recall that the complexities of the DFT of size 𝑁, of the SVD of a matrix of size 𝑁 × 𝑁 and of the multiplication of two matrices of sizes 𝑁 × 𝑀 and 𝑀 × 𝑃, scale with 𝑂(𝑁log 2 (𝑁)), 𝑂(𝑁 3 ) and 𝑂(𝑁𝑀𝑃) , respectively. As a consequence, 𝑁 S DFTs of complexity that scales with 𝑂((𝑁 U /𝑁 S )log 2 (𝑁 U / 𝑁 S )) each, result in a total complexity that scales with 𝑂(𝑁 U log 2 (𝑁 U /𝑁 S )). 2 𝑂 (𝑁 U + 𝑁 U ) 𝐔, 𝐔† 𝐳 SVD  the ratio 𝜙 FS between the spectral efficiency of the considered scheme and the spectral efficiency of the same scheme in a FS environment. C. Complexity evaluation We assume a fully digital architecture and we base our complexity evaluation on [14]. 2 𝑂 (𝑁 U + 𝑁 U + 𝑁 U ) Rx B-DFT-SMMRT 5 5* 0 0* 1 1* 2 2* 6 6* 6** 7 7* 7** U3 +2𝑁 U2 2 𝑁U ) 𝑁S 𝑁U ) 𝑁S log2 ( 𝑁 U2 +𝑁U D. Simulation results Table V provides the simulation results for all scenarios listed in Section IV-A). DFT-SM-MRT and B-DFT-SM-MRT both attain spectral efficiencies of several hundreds of bits/s/Hz (that are close to the ones of SVD) with much less complex transmitters and receivers. B-DFT-SM-MRT outperforms DFT-SM-MRT with an even simpler receiver and a slightly more complex transmitter. For all MMIMMO links, except for Link N° 7, the performance is close to the FS performance. This confirms that in the chosen existing environments, the propagation is dominated by LOS and that simple spatial multiplexing schemes (such as DFT-SM-MRT or B-DFT-SMMRT) can be used. However, for Link N° 7, the performance is much lower than the FS one. The scatterers of scenario 7 are visible on Fig. 4. One can observe that a strong dominating scatterer is located on the metallic ceiling of the canopy. For this particular scenario, we replace the basic antennas by directional antennas (defined in section III-C) oriented along the main LOS direction. We obtain an improved performance that is reported in Table VI. In particular, for scenario 7*, around 1.6 kbits/s/Hz of spectral efficiency is attained, corresponding to 80% of SVD performance with a transmitter and a receiver that are 200 and 10000 less complex, respectively. The CP insertion slightly improves the performance in scenarios 6** and in scenario 7** (with directional antennas). An extensive study of the CP insertion is for further study. TABLE V. RESULTS († INDICATES DIRECTIONAL ANTENNAS ARE USED) N° SE (bits/s/Hz) 𝜙 FS (%) 𝜙 SVD (%) 𝜇 TX 𝜇 RX 0 0* 1 1B* 2B 2B* 3B 3B* 4C 4C* 5D 5D* 6D 6D* 6D** 7 7* 7** 246 258 296 342 194 277 47 52 81 83 349 431 290 318 429 113/1174† 281/1651† 266/1681† 65 62 75 81 64 75 100 100 63 65 91 97 97 99 88 9/94† 16/93† 15/90† 48 50 58 67 38 54 74 81 63 65 68 84 57 31 42 6/57† 14/81† 13/82† 60 61 60 61 60 61 693 832 693 832 693 832 NA NA V. NA NA 60 62 52 123 127 101 253 238 693 1040 2359 5504 5504 8224 13158 13158 CONCLUSION In this paper, we showed that there is an opportunity for future 5G networks operators to exploit the existing urban architecture to transport, on the wireless media, huge data rates with gigantic spectral efficiencies. A new precoding/decoding scheme is proposed, called “block discrete Fourier transform based spatial multiplexing with maximum ratio transmission”, B-DFT-SM-MRT, which has a low complexity compared to singular value decomposition. The performance of this scheme at 26 GHz is assessed in existing environments that are accurately modeled with ray-tracing tools. Antennas as well, are accurately modeled. In the best scenario, 1.6 kbits/s/Hz is attained, corresponding to 80% of SVD performance, with a transmitter and a receiver that are 200 and 10000 times less complex, respectively. Further studies will be conducted with measured MMIMMO channel data. ACKNOWLEDGMENTS This work has been partially funded by the 5G PPP project mmMAGIC [15] under grant ICT-671650. We warmly thank Mr Antonio Clemente and Mrs Marie-Hélène Hamon for their support on this activity. REFERENCES [1] [2] [3] [4] [5] [6] T. S. Rappaport et al., “Millimeter wave mobile communications for 5G cellular: It will work!, ” IEEE Access, vol. 1, pp. 335-349, 2013. E. Torkildson et al., “Millimeter-wave MIMO: Wireless links at optical speeds,” in Proc. of 44th ACCCC Allerton Conf., Sept. 2006. Z. Pi, and F. Khan, “A millimeter-wave massive MIMO system for next generation mobile broadband, ” in Proc. 2012 ASILOMAR, pp. 693-698. X: Hailin, O. Shan, N. Zaiping, Z. Feng, “Capacity analysis of high-rank line-of-sight MIMO channels, ” J. of Systems Engineering and Electronics, vol. 20, no. 4, pp. 706-710, Aug. 2009. F. Bohagen et al. , “Optimal design of uniform planar antenna arrays for strong line-of-sight MIMO channels, ” in Proc. IEEE SPAWC '06. P. Baracca, et al., “Final performance results and consolidated view on the most promising multi-node/multi-antenna transmission technologies, ” available at https://www.metis2020.com/wpcontent/uploads/deliverables/METIS_D3.3_v1.pdf. [7] [8] [9] [10] [11] [12] [13] [14] [15] D. T. Phan-Huy et al., “DFT based spatial multiplexing and maximum ratio transmission for mm-wave large MIMO, ” in Proc. 2014 IEEE WCNC, pp. 913-918. N. F. Abdullah et al., “Channel parameters and throughput predictions for mmWave and LTE-A networks in urban environments,” in Proc. 2015 IEEE 81st VTC, 2015 E. K. Tameh and A. R. Nix, “A 3-D integrated macro and microcellular propagation model, based on the use of photogrammetric terrain and building data,” in 47th IEEE VTC, vol. 3, pp. 1957-1961, 1997. R. Ford, S. Rangan, E. Mellios, D. Kong, and A. R. Nix, “Markov channel-based performance analysis for millimeter wave mobile networks,” in Proc. IEEE WCNC 2017. J. Järveläinen, Measurement-based millimeter-wave radio propagation simulations and modeling, Doctoral Dissertation, Aalto University, 2016. https://aaltodoc.aalto.fi/handle/123456789/21931. J. Vehmas et al., “Millimeter-wave channel characterization at Helsinki Airport in 15, 28, and 60 GHz bands,” in Proc. IEEE 84th VTC, Sep. 2016. B. Muquet et al., "Cyclic prefixing or zero padding for wireless multicarrier transmissions?," in IEEE Trans. on Comm., vol. 50, no. 12, pp. 2136-2148, Dec 2002. G. H. Golub, and C. F. Van Loan, (1996). "Matrix Computations" (3rd ed.). Hopkins, J. mm-Wave based Mobile Radio Access Network for 5G Integrated Communications (mmMAGIC) project, https://5g-mmmagic.eu.
7cs.IT
Output Observability of Systems Over Finite Alphabets with Linear Internal Dynamics Donglei Fan and Danielle C. Tarraf∗† arXiv:1607.03193v1 [math.OC] 11 Jul 2016 July 10, 2016 Abstract We consider a class of systems over finite alphabets with linear internal dynamics, finite-valued control inputs and finitely quantized outputs. We motivate the need for a new notion of observability and propose three new notions of output observability, thereby shifting our attention to the problem of state estimation for output prediction. We derive necessary and sufficient conditions for a system to be output observable, algorithmic procedures to verify these conditions, and a construction of finite memory output observers when certain conditions are met. We conclude with simple illustrative examples. Index Terms—Output observability, systems over finite alphabets, quantized outputs, finite memory observers. 1 Introduction We study observability for a class of systems over finite alphabets [1], namely systems with linear internal dynamics and finitely quantized outputs. The plant thus consists of a discrete-time linear time-invariant (LTI) system with a finite control input set and a saturating output quantizer that restricts the values of the sensor output signals to fixed, finite sets. In our past research on systems over finite alphabets, we introduced a notion of finite state ‘ρ/µ approximation’ [2]. The idea there is to construct a sequence of deterministic finite state machines that satisfy a set of properties, thereby constituting approximate models that can be used as the basis for certified-by-design control synthesis [3]: Specifically, a full state feedback control law is first designed for the approximate model to achieve a suitably defined auxiliary performance objective. This control law is then used, together with a copy of the approximate model serving as a finite memory observer of the plant, to certifiably close the loop around the system. This sequence of developments brings to the forefront the problem of state estimation for systems over finite alphabets. The results reported in this manuscript constitute a step towards addressing that problem for the specific class of systems considered, namely those with LTI internal dynamics. Recall that observability generally refers to the ability to determine the initial state of a system from a single observation of its input and output over some finite time interval. In particular, an LTI system is observable if and only if different initial states produce different outputs under zero input [4]. Similarly, a nonlinear system is locally observable at xo if there exists some neighborhood of xo in which different initial states produce different outputs from that of xo under every admissible input [5]. The problem of observability of hybrid systems, including switched linear systems [6–8] and quantizedoutput systems [9–11], has been studied in recent years. The results in [12] and [13] are also closely related to the problem of state estimation based on quantized sensor output information. However at this time, we are not aware of work on observability of discrete-time systems that involve both switching and output quantization, apart from our work in [14] in which we presented a subset of the results in the present manuscript. ∗ The authors were with the Department of Electrical and Computer Engineering at Johns Hopkins University, Baltimore, MD 21218, USA when this research was conducted ([email protected], [email protected]). D.C. Tarraf is a Visiting Scholar at the MIT Institute for Data, Systems and Society. † This research was supported by AFOSR grant FA9550-16-1-0132, NSF CAREER grant 0954601 and AFOSR Young Investigator grant FA9550-11-1-0118 while the authors were at Johns Hopkins University. The problem of observer design, particularly in a discrete-state setting, has also been studied recently. For instance, [15] proposed discrete state estimators to estimate the discrete variables in hybrid systems where the continuous variables are available for measurement, while [16] and [17] proposed finite-state and locally affine estimators, respectively, for systems whose control specifications are expressed in temporal logic. As we shall see in what follows, the traditional concept of observability does not generalize well to the class of systems of interest. Therefore, inspired by our work on ρ/µ approximations [1] [18], we propose to shift our attention from state estimation to state estimation for output prediction, emphasizing in particular deterministic finite state machine (DFM) observers. The main contributions of this manuscript are as follows: 1. We motivate the need for a new notion of observability for systems over finite alphabets. 2. Shifting our emphasis from state estimation to state estimation for the purpose of output prediction, we propose three new associated notions: Finite memory output observability, weak output observability and asymptotic output observability. 3. We characterize necessary and sufficient conditions for output observability in terms of the parameters of the system for a class of systems over finite alphabets with linear internal dynamics. 4. We propose an algorithm for verifying some of the the sufficient conditions. 5. We propose a constructive procedure for generating finite memory output observers when certain sufficient conditions are met. Organization: We introduce the class of systems of interest in Section 2. We motivate the need for a new notion of observability and propose three new notions of output observability in Section 3. We investigate these three notions, derive a set of necessary and sufficient conditions, an algorithmic procedure for verifying some of these conditions, and a finite memory observer construction in Sections 4 and 5. We present illustrative examples in Section 6 and conclude with directions for future work in Section 7. Notation: We use N to denote the non-negative integers, Z+ to denote the positive integers, R≥0 to denote the non-negative reals, and R+ to denote the positive reals. We use AN to denote the collection of infinite sequences over set A, that is AN = {f : N → A}. For a ∈ AN , we use at to denote its tth component. We use {at }t∈I to denote the subsequence over index set I ⊂ N. Given a function f : X → Y, we use f −1 (y) to denote the inverse image of y ∈ Y under f . For two positive integers a and b, we use a mod b to denote the remainder of the division of a by b. For v ∈ Rn , we use kvk to denote the Euclidean norm, kvk1 to denote the 1-norm, and kvk∞ to denote the infinity norm. We say v is bounded if there exists a b ∈ R≥0 such that kvk ≤ b. For a square matrix A, we use kAk to denote the induced 2-norm, kAk1 to denote the induced 1-norm, and kAk∞ to denote the induced infinity norm. We use ρ(A) to denote the spectral radius of A, and we say that A is Schur-stable if ρ(A) < 1. We say v is a generalized eigenvector of matrix A with corresponding eigenvalue λ if (A − λI)l v = 0 but (A − λI)l−1 v 6= 0 for some integer l ≥ 1. We use 0 to represent the zero matrix of appropriate dimensions. For w ∈ Cp , we use [w]i to denote its ith component and Re(w) to denote the (vector) real part of w. We use Br (v) and Br (v) to denote the open and closed balls, respectively, centered at v with radius r. For sets A, B in Rn , we use |A| denote the cardinality of A and d(A, B) = inf{kα − βk : α ∈ A, β ∈ B} to denote the distance between sets A and B. Given a finite ordered set S = {s1 , s2 , . . . , sl } where l ∈ Z+ , we use {sj }lj=1 to denote S. 2 Systems of Interest A system over finite alphabets is understood to be a set of pairs of signals, P ⊂ U N × Y N, (1) with |U| < ∞ and |Y| < ∞. Essentially, P is a discrete-time system whose input sequences and corresponding feasible output sequences are defined over finite input and output sets, U and Y, respectively. While this definition is quite broad, and we indeed studied these systems in a general setting in [1], in this manuscript we 2 are interested in instances where P has underlying dynamics evolving in a continuous state-space described by xt+1 = fP (xt , ut ), (2a) yt = gP (xt , ut ), (2b) where t ∈ N is the time index, xt ∈ Rn is the state, ut ∈ U ⊂ Rm is the input (|U| < ∞), yt ∈ Y ⊂ Rp is the output (|Y| < ∞), fP : Rn × U → Rn is the state transition function and gP : Rn × U → Y is the output function. Figure 1: System over finite alphabets with linear internal dynamics Following a motivating discussion and a set of proposed new definitions for system (2), we focus our study in the remainder of this manuscript on special cases where the continuous internal dynamics have the linear structure shown in Figure 1 and described by xt+1 = Axt + But , (3a) ỹt = Cxt + Dut , (3b) yt = Q(ỹt ). (3c) As before, t ∈ N is the time index, xt ∈ Rn is the state, ut ∈ U ⊂ Rm , |U| < ∞, is the input and yt ∈ Y ⊂ Rp , |Y| < ∞, is the quantized output. ỹt ∈ Rp is the output of the underlying physical system and matrices A ∈ Rn×n , B ∈ Rn×m , C ∈ Rp×n , D ∈ Rp×m are given. The saturating quantizer Q : Rp → Y is a piecewiseconstant function: That is, for any ỹ ∈ Rp , if Q is continuous at ỹ, then there is δ > 0 such that Q(z) = Q(ỹ) for all kz − ỹk < δ, z ∈ Rp [19]. In particular, when p = 1 and Q is additionally assumed to be right-continuous, it can be described by: Q((−∞, β1 )) = y1 , Q([βi , βi+1 )) = yi+1 for i ∈ {1, . . . , |Y| − 1}, |Y|−1 where {βi }i=1 3 3.1 (4) are the discontinuous points of Q, β|Y| = ∞ and Y = {y1 , . . . , y|Y| }. Output Observability Motivation for a New Notion of Observability A natural starting point in our study is to attempt to apply the definition of LTI system observability to systems described by (3). Unsurprisingly, we quickly discover that no system in the class under consideration, or even in the more general class of systems described by (2), is observable in the sense of being amenable to reconstructing its state from an observation of its input and output over some finite time horizon. Lemma 1. Consider a system P as in (2). The initial state of P cannot be uniquely determined by knowledge of ({ut }t∈I , {yt }t∈I ) over any finite time interval I ⊂ N. Proof. Let X0 be the set of all possible initial states of system (2). We have X0 = Rn , and hence X0 is uncountable. Now assume that we can uniquely determine any initial condition from the input ut and output yt over some time interval I = {0, . . . , T } for some T ∈ Z+ . Let O be the set of all such possible sequences, we have O ⊆ U T × Y T . Since |U| < ∞ and |Y| < ∞, U T × Y T is countable and so is O. Now by assumption, any initial condition in X0 can be uniquely determined by an element in O. Equivalently, there exists a map φ : O → X0 that is onto. This indicates that X0 is countable (pp. 20, [19]), leading to a contradiction.  3 Remark. Clearly, Lemma 1 holds for system (3) which is a special case of system (2). Moreover, it still holds when the initial state of the system is bounded. Specifically, if X0 = {x ∈ Rn : kxk ≤ b} for some b ∈ R+ , then X0 is still uncountable and the proof follows unchanged. Lemma 1 motivates the need to think of observability differently for the classes of systems under consideration. We propose to shift our focus from the question of “Can we estimate the state of the system?” (whose answer is clearly no!) to the question of “How well can we estimate the output of the system based on our best estimate of the state?”. Towards that end, we propose in what follows three new notions of output observability. 3.2 Proposed New Notions of Output Observability Figure 2: Interconnection of plant and candidate observer. Consider a system over finite alphabet P as defined in (2) and a discrete-time system Ŝ as shown in Figure 2 and described by: qt+1 = f (qt , ut , yt ), (5a) ŷt = g(qt , ut ), (5b) where t ∈ N, qt ∈ Q for some state set Q, ut ∈ U, yt ∈ Y and ŷt ∈ Y. Functions f : Q × U × Y → Q and g : Q × U → Y are given. We say that Ŝ is a candidate observer for P . Indeed, the setup shown in Figure 2 is reminiscent of the classical observer setup. The current state qt of Ŝ represents an estimate1 of the state of P based on observations of its past input and output signals over a (finite) time horizon. The output ŷt is an estimate of the output of P , generated by Ŝ based on its current state estimate and knowledge of the input: Note in this case that, as is typical in an observer setup, no direct feedthrough from yt is allowed in (5b). The error term et thus measures the difference between the real output yt and its estimate ŷt . We are now ready to introduce a quantity γ that characterizes the quality of a candidate observer Ŝ as judged by the quality of its estimates of the output, and to propose three associated new notions of output observability of systems over finite alphabets. Definition 1. Consider a system P as in (2) and a candidate observer Ŝ as in (5), interconnected as shown in Figure 2. We say γ ∈ R≥0 is an observation gain bound of the pair (P, Ŝ) if for any (u, y) ∈ P , sup T X kyt − ŷt k − γkut k < ∞. (6) T ≥0 t=0 Note that γ defined in (6) is in accordance with the concept of finite-gain L2 stability [20] of the interconnected system with input ut and output et shown in Figure 2. Definition 2. Consider a system P as in (2). The O-gain, γ ∗ , of P is defined as: n o γ∗ = inf γ is an observation gain bound of (P, Ŝ) . (7) Ŝ as in (5) 1 Note that this estimate does not need to live in the state-space of P : That is, Q 6= Rn in general. For instance, one could be interested in a set-valued estimate of the state as is the case in some of our complementary work [3, 18]. 4 Definition 3. Consider a system P as in (2): (a) P is finite memory output observable if there exists a candidate observer Ŝ as in (5) and a T ∈ Z+ such that for any (u, y) ∈ P , et = 0 for all t ≥ T when P and Ŝ are interconnected as shown in Figure 2. (b) P is weakly output observable if there exists a candidate observer Ŝ as in (5) such that γ = 0 is an observation gain bound of (P, Ŝ). (c) P is asymptotically output observable if the O-gain of P is γ ∗ = 0. The three proposed notions satisfy a hierarchy: Lemma 2. Consider a system P as in (2). We have : P is finite memory output observable ⇒ P is weakly output observable ⇒ P is asymptotically output observable. Proof. If P is finite memory output PT observable, there is a candidate observer Ŝ such that yt − ŷt = 0 for all t ≥ T , and therefore supT ≥0 t=0 kyt − ŷt k < ∞. Thus γ = 0 is an observation gain bound of (P, Ŝ) and P is weakly output observable. If P is weakly output observable, then γ ∗ is the infimum of a set of non-negative numbers containing 0, and hence γ ∗ = 0.  Remark. The converse statements in Lemma 2 are not necessarily true. Indeed, when Y is finite, we have γ = 0 if and only if for any (u, y) ∈ P , ŷt 6= yt at most finitely many times. In this case, for every choice of (u, y) ∈ P , ŷt = yt for all t ≥ T(u,y) for some T(u,y) ∈ Z+ , but there may not be a uniform bound on T(u,y) . Hence P may be weakly output observable but not finite memory output observable. Likewise, we may be able to find candidate observers Ŝ such that (P, Ŝ) has observation gain bounds arbitrarily close to 0 without being equal to it. Hence P may be asymptotically output observable but not weakly output observable. 4 Finite Memory Output Observability In this section, we propose (Section 4.1) and derive (Section 4.2) a set of conditions characterizing finite memory output observability, and we propose an algorithmic procedure (Section 4.3) for verifying some of these conditions. We begin with some relevant definitions and notation. Given a system over finite alphabets as in (3), we will use F (u, t) to denote the forced response of the underlying LTI system at time t under input u, A to denote the set of all the possible values of this forced response, and B to denote the set of all the discontinuous points of the quantizer. That is: F (u, t) = t−1 X CAt−1−τ Buτ + Dut , τ =0 4.1 A = {α ∈ Rp : α = F (u, t), u ∈ U N , t ∈ N}, (8) B = {β ∈ Rp : Q(ỹ) is discontinuous at ỹ = β}. (9) Main Results We are now ready to propose both necessary conditions and sufficient conditions for finite memory output observability of system (3). We begin with sufficient conditions. Theorem 1. Consider a system P as in (3). If CAl = 0 for some l ∈ Z+ , then P is finite memory output observable. Theorem 2. Consider a system P as in (3), assume that the initial state x0 is bounded. Let E be the collection of generalized eigenvectors of A whose corresponding eigenvalues have magnitudes greater than or equal to 1. If d(A, B) 6= 0, and E is in the kernel of C, then P is finite memory output observable. 5 Intuitively, if the hypothesis in Theorem 1 is satisfied, then the initial state has no impact on the quantized output for large enough time. We can therefore determine the output based on past input information, and the system is finite memory output observable. Theorem 2 states that if any forced response is at some distance away from the discontinuous points of the quantizer, then the influence of the initial state in the quantized output will eventually disappear, and the knowledge of the past input suffices to predict the output. The assumption that E is in the kernel of C simply means that the (possible) unstable modes of the underlying LTI system do not influence the quantized output. Remark. If the sufficient conditions in Theorem 1 or Theorem 2 are satisfied, then a finite state (or equivalently, finite memory) observer can be constructed to achieve error-free output prediction for large enough time large. We present such a construction (Finite Input Observer Construction) in Section 4.2 . We next propose necessary conditions for finite memory output observability. We begin with the case of stable internal dynamics. Theorem 3. Consider a system P as in (3), assume that ρ(A) < 1, 0 ∈ U, and 0 ∈ / B. If rank(CAl ) = p for all l ∈ Z+ , and A ∩ B = 6 ∅, then P is not finite memory output observable. Theorem 4. Consider a system P as in (3), assume that ρ(A) ≥ 1, 0 ∈ U, and 0 ∈ / B. Define V = {v ∈ Cn \ 0 : Av = λv, for some |λ| > 1}. If V is not in the kernel of C, and Q−1 (Q(0)) is bounded, then system (3) is not finite memory output observable. Intuitively, for Theorem 3, if some forced response is exactly at a discontinuous point of the quantizer, then a small perturbation of the initial state can cause a change in the quantized output at certain time instances, but not at others, and thus the system is not finite memory output observable. Similarly, if the hypotheses in Theorem 4 hold, then under zero input a small perturbation of the initial state around the origin can result in a difference in the quantized output at an arbitrarily large time instance, while this perturbation is not reflected in all previous time instances, therefore the system is not finite memory output observable. 4.2 Derivation of Main Results We first derive the sufficient conditions. We begin by proposing a construction for a candidate finite memory observer that will be used in several of the constructive proofs. Definition 4. (Finite Input Observer Construction) Given a system (3) and a design parameter T ∈ N. Consider a candidate observer associated with design parameter T , ŜT , described by qt+1 = φ(qt , ut ), ŷt = θ(qt , ut ), (10) q0 = qo , ST where qt ∈ qo ∪ ( i=1 U i ) is the state of Ŝ, ut ∈ U is the input of (3). We enforce that Ŝ (10) initialize at a ST ST ST fixed state: q0 = qo . Function φ : (qo ∪ ( i=1 U i )) × U → i=1 U i is described by: For any q ∈ qo ∪ ( i=1 U i ), any u ∈ U, B If q = qo , then φ(q, u) = u, ST −1 B If q ∈ i=1 U i , write q = (u1 , u2 . . . ui ), then φ(q, u) = (u, u1 , u2 . . . ui ), B If q ∈ U T , write q = (u1 , u2 . . . uT ), then φ(q, u) = (u, u1 , u2 . . . uT −1 ). ST ST The function θ : (qo ∪ ( i=1 U i )) × U → Y is defined as: For any q ∈ qo ∪ ( i=1 U i ), any u ∈ U, B If q ∈ U T , write q = (ū1 , ū2 , . . . , ūT ), then θ(q, u) = Q( T X CAτ −1 B ūτ + Du), (11) τ =1 B If q ∈ / U T , then let θ(q, u) = ỹ∅ for some ỹ∅ ∈ Y.  We are now ready to prove our first result: 6 Proof. (Theorem 1) Given system (3), recall the form of ỹt in terms of linear dynamics and note CAl = 0, Pt−1 we see that for all t ≥ l: ỹt = τ =t−l CAt−1−τ Buτ + Dut . Consider an observer Ŝ constructed according Pt−1 to Definition 4 with parameter T = l. Then ŷt = Q( τ =t−l CAt−1−τ Buτ + Dut ) = Q(ỹt ) = yt , ∀ t ≥ l. We conclude that system (3) is finite memory output observable.  We next establish several observations that will be instrumental in deriving the remaining results. Lemma 3. Consider system P as in (3), assume that ρ(A) < 1 and that the initial state x0 is bounded. There exists a b0 ∈ R+ such that kxt k ≤ b0 for all t ∈ N. Pt−1 Proof. The solution associated with initial condition x0 is given by xt = At x0 + τ =0 At−1−τ Buτ . For any Pt−1 Pt t ∈ N, weP have kxt k = kAt x0 + τ =0 At−1−τ Buτ k ≤ max{kx0 k, kBut k} τ =0 kAτ k. P∞ ∞ τ Since τ =0 kA k converges (pp. 299, [21]), we can find an upper bound b1 ∈ R+ such that τ =0 kAτ k ≤ b1 . Since ut ∈ U and U is finite, kBut k is also bounded. Let b2 = max{kx0 k, max{kBuk : u ∈ U}}, and then let b0 = b1 b2 , we have kxt k ≤ b0 for all t ∈ N.  Lemma 4. Consider system P as in (3), assume that ρ(A) < 1, C 6= 0 and that the initial state x0 is bounded. If d(A, B) 6= 0, then there exists a T ∈ Z+ such that for all t ≥ T : ỹt ∈ B d(A,B) (α), (12) 2 where α = Pt−1 τ =t−T CAt−1−τ Buτ + Dut and α ∈ A. Proof. By Lemma 3, kxt k ≤ b0 for all t ∈ N for some b0 ∈ R+ . Since limτ →∞ Aτ = 0 (pp. 298, [21]), recall the assumption that C 6= 0, we can choose T ∈ Z+ such that kAT k < d(A, B) . 2b0 kCk (13) Then kCAT xt k ≤ kCkkAT kkxt k < d(A, B)/2 for all t ∈ N. Recall that ỹt = CAT xt−T + Dut , we see (12) holds. Pt−1 τ =t−T CAt−1−τ Buτ +  Next, we observe that the quantized output yt can be determined by the knowledge of the forced response. Lemma 5. Consider system P as in (3), and sets A and B as in (8) and (9) respectively. If d(A, B) 6= 0, then for any α ∈ A, (14) y ∈ cl(B d(A,B) (α)) ⇒ Q(y) = Q(α). 2 Proof. First observe that Q is continuous at any point y ∈ cl(B d(A,B) (α)), otherwise d(A, B) ≤ d(A, B)/2, 2 which contradicts with d(A, B) > 0. Next, assume there is a y ∈ cl(B d(A,B) (α)) such that Q(y) 6= Q(α). 2 ∞ Define two sequences {wn }∞ n=1 , {vn }n=1 as follows: Let w1 = α, v1 = y. For any n ≥ 2, let z = (wn−1 + vn−1 )/2, if Q(z) 6= Q(wn−1 ), let wn = wn−1 , vn = z; otherwise, let wn = z, vn = vn−1 . By this definition, we see that Q(wn ) 6= Q(vn ) implies Q(wn+1 ) 6= Q(vn+1 ). Since Q(w1 ) 6= Q(v1 ), by induction, we have: Q(wn ) 6= Q(vn ) for all n ∈ Z+ . At the same time, it is clear that kwn − vn k = (1/2)n kw1 − v1 k. Note ∞ p that {wn }∞ n=1 , {vn }n=1 ⊂ cl(B d(A,B) (α)) and cl(B d(A,B) (α)) is a compact set in R , by renaming, there are 2 2 0 0 0 0 0 subsequences {wn } ⊂ {wn } and {vn } ⊂ {vn } such that Q(wn ) 6= Q(vn ), kwn − vn0 k ≤ (1/2)n kw1 − v1 k, for all n ∈ Z+ , and limn→∞ wn0 = w, limn→∞ vn0 = v for some w, v in cl(B d(A,B) (α)). Since kw − vk ≤ 2 kw − wn0 k + kwn0 − vn0 k + kvn0 − vk, we see that for any  > 0, kw − vk < , and consequently w = v. Since w ∈ cl(B d(A,B) (α)), Q is continuous at w. Recall Q is piecewise-constant, there is δ > 0 such that 2 Q(z) = Q(w) for all kz − wk < δ, z ∈ Rp . Since limn→∞ wn0 = w, there is N1 such that Q(wn0 ) = Q(w), for all n ≥ N1 . Similarly, there is N2 such that Q(vn0 ) = Q(v) = Q(w) for all n ≥ N2 . Let n = max{N1 , N2 }, then Q(wn0 ) = Q(w) = Q(vn0 ), which contradicts with Q(wn0 ) 6= Q(vn0 ) for all n ∈ Z+ . Therefore, assumption  is false, and we conclude that for any α ∈ A and any y ∈ cl(B d(A,B) (α)), Q(y) = Q(α). 2 7 Given a system (3), we first decompose the state xt into stable modes and unstable modes, and we make an observation on the stable modes. In particular, consider the Jordan canonical form of the matrix A, A = M JM −1 , (15) where matrix J is in partitioned diagonal form, and matrix M is a generalized modal matrix for A (pp. 205, [22]). Write M = [v1 v2 · · · vn ], where vi ∈ Cn for 1 ≤ i ≤ n, then each vi is a generalized eigenvector of A, and {vi }ni=1 form a basis of Rn . For each vi , use λi to denote the eigenvalue of A corresponding to vi . Next, we decompose the state vector xt using {vi }ni=1 . For all t ∈ N, write xt as a linear combination of {vi }ni=1 , n X xt = [αt ]i vi , (16) i=1 n where αt ∈ C is the coordinates of xt corresponding to the basis {vi }ni=1 . Here [αt ]i , 1 ≤ i ≤ n are the coordinates of xt with respect to the basis {vi }ni=1 , and [αt ]i with vi ∈ / E are the coordinates corresponding with the stable generalized eigenvectors. We make an observation on these stable modes in the following. P Lemma 6. Consider system (3), write xt as in (16), then i:vi ∈E / |[αt ]i | < b1 , ∀ t ∈ N for some b1 ∈ R+ . Proof. Let M be given as in (15), and note that M = [v1 v2 · · · vn ], recall (16), we have M −1 xt = αt . / E, Define αtU ∈ Cn as: If vi ∈ E, then [αtU ]i = [αt ]i ; otherwise [αtU ]i = 0. Similarly, define αtS ∈ Cn as: If vi ∈ then [αtS ]i = [αt ]i ; otherwise [αtS ]i = 0. We see that αt = αtU + αtS . Essentially, αtU (αtS ) are the coordinates corresponding with the unstable (stable) generalized eigenvectors. Similarly, we decompose the But term in system (3). For all t ∈ N, write But as a linear combination Pn of {vi }ni=1 , But = i=1 [βt ]i vi , where βt ∈ Cn is the coordinates of But corresponding to the basis {vi }ni=1 . Then M −1 But = βt . Define βtU ∈ Cn as: If vi ∈ E, then [βtU ]i = [βt ]i ; otherwise [βtU ]i = 0, and define / E, then [βtS ]i = [βt ]i ; otherwise [βtS ]i = 0. We also have βt = βtU + βtS . βtS ∈ Cn as: If vi ∈ Recall (3) and A = M JM −1 , we have M M −1 xt+1 = M JM −1 xt + M M −1 But . Recall M −1 xt = αt , and −1 M But = βt , we have αt+1 = Jαt + βt . Consequently U S αt+1 + αt+1 = (JαtU + βtU ) + (JαtS + βtS ). Consider the term JαtU , and write J = [w1 · · · wn ] where w1 , . . . , wn ∈ Cn , then JαtU = / E, we have [αtU ]i = 0 for all i such that vi ∈ X JαtU = [αtU ]i wi . (17) Pn U i=1 [αt ]i wi . Since (18) i:vi ∈E Recall the definition of λi for i = 1, . . . , n, and the form of J, we see that if λj 6= λi , then [wi ]j = 0, for all 1 ≤ i, j ≤ n. For any i such that vi ∈ E, and any j such that vj ∈ / E, we have |λj | < 1 and |λi | ≥ 1, therefore λj 6= λi , and consequently [wi ]j = 0. We see that for all j such that vj ∈ / E, [JαtU ]j = 0. Similarly, S S S S for all j such that the term JαtS , P vj ∈ E, S[Jαt ]j = 0. Recall (17), we see Sthat αt+1S = (JαSt +Sβt ). Consider S S we have Jαt = i:vi ∈E / [αt ]i wi . Define a square matrix J to be J = [w1 w2 · · · wn ], where  wi , if vi ∈ / E, wiS = 0, otherwise. P Pn S S S S S Note that J S is Schur-stable. Then we have JαtS = i:vi ∈E / [αt ]i wi = i=1 [αt ]i wi = J αt . And consequently, we have S αt+1 = J S αtS + βtS , (19) where J S is Schur-stable. Since kα0S k1 ≤ kM −1 k1 kx0 k1 , and x0 is bounded, we see that kα0S k1 is bounded. Similarly, note that U is a finite set in Rm , we see that kβtS k1 is uniformly bounded. Given system (19), since J S is Schur-stable, kα0S k1 is bounded, and kβtS k1 is P uniformly bounded, by the derivation of Lemma P S 3, kαtS k1 < b1 for some b1 ∈ R+ for all t ∈ N. Note that i:vi ∈E / |[αt ]i | = kαt k1 , we have i:vi ∈E / |[αt ]i | < b1 , b1 ∈ R+ , for all t ∈ N.  Next, we make an observation about the forced response of the underlying linear dynamics. 8 Lemma 7. Consider a system P as in (3), assume the hypotheses in Theorem 2 are satisfied. Then there exists a T ∈ Z+ such that for all t ≥ T : (20) ỹt ∈ B d(A,B) (α), 2 where α = Pt−1 τ =t−T t−1−τ CA Buτ + Dut and α ∈ A. Proof. Use {ei }ni=1 to denote the standard basis of Rn , andP recall the computation of powers of a Jordan t block (pp. 57, [4]), then for all t ≥ n, At vi = M J t ei = j:λj =λi λi p(j,i) (t) vj , where p(j,i) (t) is some polynomial in t that depends on the pair (j, i). Recall the particular form of Jit , the upper triangular t! elements of Jit has the form k!(t−k)! · λt−k , where 0 ≤ k ≤ ni − 1, and ni corresponds to the size of Ji . i t! n t−k ≤ κ|λi |t for some κ ∈ R+ : If |λi | ≥ 1 or |λi | = 0, let κ1 = 1; if Note that k!(t−k)! ≤ t , and that |λi | 1 > |λi | > 0, let κ2 = (max{1/|λj | : 0 < |λj | < 1, 1 ≤ j ≤ n})n ; take κ = max{κ1 , κ2 }. Combine these observations, we conclude that for any i ∈ {1, . . . , n}, and any t ≥ n, X λti p(j,i) (t) vj , (21) At v i = j:λj =λi where |λti p(j,i) (t)| ≤ κ · tn |λi |t , (22) for some κ ∈ R+ . For any T ≥ n, and any t ∈ N, recall (16), (21), we have X X CAT xt = [αt ]i λTi p(j,i) (T )Cvj i:vi ∈E + j:λj =λi X X [αt ]i i:vi ∈E / λTi p(j,i) (T )Cvj . (23) j:λj =λi If vi ∈ E and λj = λi , then vj ∈ E.PSince E is P in the kernel of C, for any i such that vi ∈ E, Cvj = 0 for all j such that λj = λi . Therefore i:vi ∈E [αt ]i j:λj =λi λTi p(j,i) (T )Cvj = 0. Continued from (23), we have P P T CAT xt = i:vi ∈E / [αt ]i j:λj =λi λi p(j,i) (T )Cvj . Recall (22), we have kCAT xt k ≤ X κnη · |[αt ]i | T n |λi |T , (24) i:vi ∈E / where η = max{kCvj k : 1 ≤ j ≤ n}. For / E, |λi | < 1. Let P ρ = max{|λi | : vi ∈ / E}, then P any i such that vi n∈ T n T 0 ≤ ρ < 1. Consequently,P kCAT xt k ≤ i:vi ∈E / κnη · |[αt ]i |T ρ ≤ κnη · T ρ i:vi ∈E / |[αt ]i |. By Lemma 6, there is b1 > 0 such that i:vi ∈E / |[αt ]i | < b1 . We have kCAT xt k ≤ b1 κnη · T n ρT , (25) for any T ≥ n, and any t ∈ N. Note that 0 ≤ ρ < 1, therefore limT →∞ T n ρT = 0. Choose T ∈ Z+ d(A,B) , we have kCAT xt k < d(A, B)/2, for all t ∈ N. Then for all t ≥ T , ỹt = such that T n ρT < 2b 1 κnη P t−1 T t−1−τ CA xt−T + τ =t−T CA Buτ + Dut ∈ B d(A,B) (α), and consequently (20) holds. 2  We are now ready to show Theorem 2. Proof. (Theorem 2) Case 1: A Hurwitz. First note that if C is the zero matrix, then yt = Q(Dut ). Since yt can be determined by the knowledge of ut , system (3) is (C1). Therefore in the following derivation, we only consider the case C 6= 0. Recall Lemma 4, let T be determined by (13) such that (12) holds. Let Ŝ be constructed according to Definition 4 with this parameter T . Since q0 = qo , we have qt = (ut−1 , ut−2 , . . . , ut−T ), ∀ t ≥ T. 9 (26) where {ut } is the input of system (3). PT Pt−1 For any t ≥ T , recall (10), (11), (26), we have ŷt = Q( τ =1 CAτ −1 But−τ +Dut ) = Q( τ =t−T CAt−τ −1 Buτ + Pt−1 t−1−τ Dut ) = Q(α), where α = Buτ + Dut . Recall Lemma 4, we have ỹt ∈ B d(A,B) (α) ⊂ τ =t−T CA 2 cl(B d(A,B) (α)). By Lemma 5, we have Q(ỹt ) = Q(α). We conclude that ŷt = Q(α) = Q(ỹt ) = yt for all 2 t ≥ T , and consequently system (3) is finite memory output observable. Case 2: A is not Hurwitz. By Lemma 7, there exists a T ∈ Z+ such that for all t ≥ T : ỹt ∈ B d(A,B) (α), 2 Pt−1 where α = τ =t−T CAt−1−τ Buτ + Dut and α ∈ A. The rest of this derivation follows the exact same lines of the derivation for the case where A is Hurwitz.  We now shift our focus to deriving the necessary conditions. Proof. (Theorem 3) The proof is by contradiction. Since A ∩ B 6= ∅, there exist t1 ∈ N and u1 such that t1 = min{t : F (u, t) ∈ A ∩ B} and F (u1 , t1 ) ∈ B. The existence of the minimum is guaranteed by the well-ordering principle of nonnegative integers (pp. 28, [23]). t1 being a minimum indicates that F (u1 , t) is not in B for any t < t1 . So we can define the following distance:  d({0}, B), if t1 = 0 d1 = (27) d({0} ∪ {F (u1 , t) : 0 ≤ t ≤ t1 − 1}, B), if t1 ≥ 1 The definition of t1 and 0 ∈ / B imply d1 > 0. Assume that system (3) is finite memory output observable, than there exists an observer Ŝ (5) and T such that for any x0 ∈ Rn , any u ∈ U N , ŷt = yt for all t ≥ T . Without loss of generality, we assume that T ≥ t1 (if T < t1 , just let T = t1 , then ŷt = yt for all t ≥ T still holds). Construct an input sequence u of system (3). Given u1 , use the truncated sequence of u1 : {u1t : 0 ≤ t ≤ t1 }, the input sequence u is described as follows:  0 ≤ t ≤ T − t1 − 1  0, u1t−(T −t1 ) , T − t1 ≤ t ≤ T ut = (28)  0, t>T Basically we insert the truncated sequence of {u1t : 0 ≤ t ≤ t1 } into a zero input. If distinct initial states x10 and x20 satisfy: kCAt xi0 k < d1 /2, i = 1, 2 (29) for t = 0, 1 · · · T − 1, then under input u (28), the corresponding outputs of the underlying LTI system, ỹt1 and ỹt2 , satisfy: ỹti ∈ Bd1 /2 (α), i = 1, 2, for some α ∈ {0} ∪ {F (u1 , t) : 0 ≤ t ≤ t1 − 1}, for t = 0, 1 · · · T − 1. Recall the definition of d1 and Lemma 5, we have Q(ỹt1 ) = Q(α) = Q(ỹt2 ). Consequently, we have yt1 = yt2 , t = 0, 1 · · · T − 1, where yti is the output of system (3) when the initial state is xi0 and the input is u (28). In addition, since Q is not continuous at F (u, t) = F (u1 , t1 ), for any δ > 0, there is z ∈ Rp such that Q(z +F (u, t)) 6= Q(F (u, t)), and kzk < δ. Since rank(CAT ) = p by assumption, write CAT = [v1 v2 · · · vn ], where v1 , . . . , vn ∈ Rp , then there is {i1 , i2 , . . . , ip } ⊂ {1, 2, . . . , n} such that [vi1 vi2 · · · vip ] is invertible. 1 Let V = [vi1 vi2 · · · vip ], and let KA = sup{kAt k : t = 0, 1, 2, · · · }. choose δ = 2kV −1dkkCkK > 0, A p −1 then there is z ∈ R such that Q(z + F (u, t)) 6= Q(F (u, t)), and kzk < δ. Let w = V z, and write w = [w1 w2 · · · wp ]T ∈ Rp , define x∗ = [x∗1 x∗2 · · · x∗n ]T ∈ Rn as: For all 1 ≤ j ≤ p, x∗ij = wj ; for all 1 ≤ l ≤ n and l ∈ / {i1 , i2 , . . . , ip }, x∗l = 0. Then we have CAT x∗ = V w, and kx∗ k = kwk. Consider two distinct initial conditions: x10 = 0, x20 = x∗ . Then for all t = 0, 1 · · · T − 1, kCAt x20 k ≤ 1 kCkKA kwk < kCkKA kV −1 k · 2kV −1dkkCkK = d1 /2. Therefore (29) holds, and consequently yt1 = yt2 , t = A 0, 1 · · · T − 1. At t = T , yT1 = Q(F (u, t)), and yT2 = Q(CAT x∗ + F (u, t)) = Q(z + F (u, t)) 6= Q(F (u, t)), therefore yT1 6= yT2 . Since system (3) is assumed to be finite memory output observable, let ŷt1 and ŷt2 be the output of the corresponding Ŝ when the input is u (28) and initial conditions are x10 , x20 respectively. Then at t = T , recall (5), we have ŷT1 = g(f (. . . f (f (q0 , u0 , y01 ), u1 , y11 ) . . . , uT −1 , yT1 −1 ), uT ), and ŷT2 = g(f (. . . f (f (q0 , u0 , y02 ), u1 , y12 ) . . . , uT −1 , yT2 −1 ), uT ) Recall that yt1 = yt2 , t = 0, 1 · · · T − 1, we have ŷT1 = ŷT2 . Since yT1 6= yT2 , there is i ∈ {1, 2} such that ŷTi 6= yTi . This is a contradiction with system (3) being finite memory output observable.  10 Proof. (Theorem 4) Since V is not in the kernel of C, there is v ∈ V such that Cv 6= 0. Without loss of generality, let kCvk1 = 1. Since v ∈ V, we have Av = λv for some |λ| > 1, λ ∈ C. Next, we define a set O as O = {α ∈ R+ |Re(γCv) ∈ Q−1 (Q(0)), ∀ |γ| ≤ α, γ ∈ C}. (30) Next, we show that O is non-empty and bounded. Write Cv = [v1 v2 . . . vn ]T , where vP 1 , . . . , vp ∈ C and p |v1 |P + · · · + |vp | = 1. For any γ ∈ C, we have |Re(γvi )| ≤ |γkvi |, therefore kRe(γCv)k1 = i=1 |Re(γvi )| ≤ p |γ| i=1 |vi | = |γ|. Since Q is a piecewise constant function, and 0 ∈ / B, there is r > 0 such that Br (0) ⊂ Q−1 (Q(0)), where Br (0) = {x ∈ Rp : kxk1 < r}. Therefore, for all γ with |γ| ≤ r/2, Re(γCv) ∈ Br (0). Consequently r/2 ∈ O, and O is nonempty. Next, we show that O is bounded. Since Q−1 (Q(0)) is bounded by assumption, let Q−1 (Q(0)) ⊂ Bσ (0) for some σ > 0. Since Cv = [v1 v2 . . . vn ]T 6= 0, let |vk | > 0 for some 1 ≤ k ≤ n. Write vk as vk = |vk |eiφ for some φ ∈ [0, 2π). Assume O is unbounded, then there exist α ∈ O with α > 2σ/|vk |. Let γ = (2σ/|vk |)ei(−φ) , then |γ| < α. By the definition of O (30), we have Re(γCv) ∈ Q−1 (Q(0)). Observe / Bσ (0), and that kRe(γCv)k1 ≥ |Re(γvk )| = |Re( |v2σk | ei(−φ) |vk |eiφ )| = |Re(2σ)| = 2σ. Therefore Re(γCv) ∈ consequently Re(γCv) ∈ / Q−1 (Q(0)), which draws a contradiction. Therefore O is bounded. Next, we define β = sup O. Since O is non-empty and bounded, we have 0 < β < ∞. Then for any  > 0, there is κ ∈ C such that Re(κCv) ∈ / Q−1 (Q(0)), and β ≤ |κ| < β + . (31) and we will apply this observation to prove Theorem 4 by contradiction. Assume system (3) is finite memory output observable, than there exists an observer Ŝ (5) and T ∈ Z+ such that yt = ŷt for all t ≥ T . Consider the input ut ≡ 0, for two initial states x10 , x20 ∈ Rn , we use yt1 , yt2 to denote the outputs of system (3) respectively. Choose x10 = 0, then yt1 = Q(0) for all t ∈ N. In (31), let  = t β(|λ| − 1), and choose x20 = Re( λκT v). Then for all 0 ≤ t ≤ T − 1, CAt x20 = Re( λκT CAt v) = Re( κλ Cv). Since λT |κλt /λT | < β, by (30), we see that CAt x20 ∈ Q−1 (Q(0)), and consequently yt2 = Q(0) for all 0 ≤ t ≤ T − 1. At t = T , CAT x20 = Re(κCv) ∈ / Q−1 (Q(0)), therefore yT2 6= Q(0). Now we see that yt1 = yt2 for 0 ≤ t ≤ T − 1, 2 1 and yT 6= yT . Similar to the proof of Theorem 3, we can show that ŷT1 = ŷT2 , and therefore either ŷT1 6= ỹT1  or ŷT2 6= yT2 or both, and we conclude that system (3) is not finite memory output observable. 4.3 Algorithmic Verification of the Conditions A natural question one might ask is how to determine d(A, B) for sets A and B defined in (8) and (9), respectively. In this section, we propose an algorithm to compute the distance between sets A and B and to determine whether their intersection is empty, for the case where matrix A of system (3) is Schur-stable (ρ(A) < 1). 11 Algorithm 1 Computes d(A, B), determines if A ∩ B = ∅ 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: Input: Matrix A, B, C, D, set U, quantizer Q Compute: h = max{kBuk : u ∈ U} PT Compute: s = supT ≥0 t=0 kAt k k ← 1. loop if k = 1 then Compute: C1 = {Du1 : u1 ∈ U} else Compute: Ck = {Du1 + CBu2 + CABu3 + · · · + CAk−2 Buk : u1 , . . . , uk ∈ U} end if Compute: dk = min{d(y, B) : y ∈ Ck } if dk > hskCkkAk−1 k then Return: d = dk − hskCkkAk−1 k Exit the loop else if Ck ∩ B 6= ∅ then Return: y ∗ ∈ Ck ∩ B Exit the loop end if k ← k + 1. end loop Lemma 8. Given system (3), assume ρ(A) < 1 and 0 ∈ U. Consider sets A and B defined in (8) and (9) respectively, the following holds: i. d(A, B) > 0 if and only if Algorithm 1 terminates and returns d, which satisfies d ≤ d(A, B). ii. A ∩ B = 6 ∅ if and only if Algorithm 1 terminates and returns y ∗ , which satisfies y ∗ ∈ A ∩ B. Proof. First we show item i). Assume d(A, B) > 0. Since ρ(A) < 1, limk→∞ kAk k = 0. Therefore there is N ∈ Z+ such that hskCkkAk−1 k < d(A, B) for all k ≥ N . Recall (8), we see that Ck ⊂ A for all k ∈ Z+ . Consequently, d(Ck , B) ≥ d(A, B). Since Ck is a finite set, we see that d(Ck , B) = min{d(y, B) : y ∈ Ck } = dk . Therefore, hskCkkAk−1 k < dk for all k ≥ N , and the set {k ∈ Z+ : dk > hskCkkAk−1 k} is nonempty. Let k ∗ = min{k ∈ Z+ : dk > hskCkkAk−1 k}, we see that Algorithm 1 terminates at k = k ∗ , and returns ∗ d = dk∗ − hskCkkAk −1 k. Next, we show the other direction of item i). Assume Algorithm 1 terminates at some k = k ∗ , and returns Pt−1 d. For any α ∈ A, recall (8), α = τ =0 CAt−1−τ Buτ + Dut , for some t ∈ N, and some u0 , u1 , . . . , ut ∈ Pt0 −1 t0 −1−τ U. Since 0 ∈ U, there are t0 ≥ k ∗ , and u00 , u01 , . . . , u0t0 ∈ U such that α = Bu0τ + τ =0 CA P t−1 t−1−τ 0 0 0 0 Buτ + Dut , where u0 , u1 , . . . , ut0 is either identical to u0 , u1 , . . . , ut , or consists of Dut0 = τ =0 CA u0 , u1 , . . . , ut and a sequence of zero input of appropriate length at the beginning. Since t0 ≥ k ∗ , we have Pt0 −k∗ Pt0 −1 Pt0 −k∗ 0 0 0 α = τ =0 CAt −1−τ Bu0τ + τ =t0 −k∗ +1 CAt −1−τ Bu0τ +Du0t0 . We can show that k τ =0 CAt −1−τ Bu0τ k ≤ 0 0 P P 0 0 ∗ t −1 t −1 hskCkkAk −1 k. Let c = τ =t0 −k∗ +1 CAt −1−τ Bu0τ + Du0t0 , we note that c = τ =t0 −k∗ +1 CAt −1−τ Bu0τ + ∗ Du0t0 ∈ Ck∗ . Then for any β ∈ B, recall dk∗ = d(Ck∗ , B) kα − βk ≥ kc − βk − kα − ck ≥ dk∗ − hskCkkAk −1 k. ∗ Since the choices of α ∈ A and β ∈ B are arbitrary, we see that d(A, B) ≥ dk∗ − hskCkkAk −1 k. Since Algo∗ rithm 1 terminates at k = k ∗ , we see that d = dk∗ − hskCkkAk −1 k > 0, and consequently d(A, B) ≥ d > 0. This completes the proof for item i). For the second item, assume A ∩ B = 6 ∅, and let α1 ∈ A ∩ B. Recall (8), we see that α1 ∈ Ck for some k ∈ Z+ . Therefore, the set {k ∈ Z+ : Ck ∩ B = 6 ∅} is nonempty. Let k ∗ = min{k ∈ Z+ : Ck ∩ B = 6 ∅}, we see ∗ that Algorithm 1 terminates at k = k , and returns y ∗ . For the backward implication, assume Algorithm 1 terminates at some k ∈ Z+ , and returns y ∗ . Recall (8), we see that Ck ⊂ A. Since y ∗ ∈ Ck ∩ B, we have y ∗ ∈ A ∩ B, and consequently A ∩ B = 6 ∅. This completes the proof of the second item.  12 5 Weak and Asymptotic Output Observability 5.1 Main Results Recall that the sufficient conditions for finite memory output observability stated in the previous section are automatically sufficient conditions for weak output observability (Lemma 2). We thus focus on necessary conditions in this section. We begin by introducing the concept of unobservable input-output segments, which will be instrumental in formulating a necessary condition for weak output observability. For any (u, y) ∈ U N × Y N and any T ∈ Z+ , we use ({ut }Tt=0 , {yt }Tt=0 ) to denote the segment of (u, y) from time 0 to time T . Definition 5. Given a system P (2) with |U| < ∞, 1 < |Y| < ∞, consider a family Ψ of input and output segments, (k,j) T(k,j) 2k (k,j) T(k,j) )}j=1 }∞ (32) , {yt }t=0 Ψ = {{({ut }t=0 k=1 . Ψ is said to be unobservable if it satisfies the following items: i. For any k ≥ 1, and any j ∈ {1, 2, . . . , 2k−1 }, T(k,2j−1) = T(k,2j) , ( ( (k,2j−1) ut (k,2j−1) yt = = (k,2j) ut , (k,2j) yt , (k,2j−1) (33a) 0 ≤ t ≤ T(k,2j−1) − 1, (33b) (k,2j) ut = ut , t = T(k,2j−1) . (k,2j−1) (k,2j) yt 6= yt , (33c) ii. For any k ≥ 2, and any j ∈ {1, 2, . . . , 2k−1 }, T(k,2j) > T(k−1,j) , ( (k,2j) ut (k,2j) yt = = (k−1,j) ut , (k−1,j) yt , (34a) 0 ≤ t ≤ T(k−1,j) . (34b) k iii. For any sequence {j(k)}∞ k=1 that satisfies j(k) ∈ {1, . . . , 2 } and j(k + 1) ∈ {2j(k) − 1, 2j(k)}, define N N (u, y) ∈ U × Y as ( (1,j(1)) ut = ut , 0 ≤ t ≤ T(1,j(1)) , (1,j(1)) yt = yt , ( (35) (k,j(k)) ut = ut , T(k−1,j(k−1)) < t ≤ T(k,j(k)) , k ≥ 2, (k,j(k)) yt = yt , then (u, y) satisfies (u, y) ∈ P. (36)  Figure 3: Illustration of Ψ. 13 We use Figure 3 to provide some intuition on Ψ. The tree structure represents the family Ψ of input and output segments of P . Each branch represents two pairs of input and output segments: When the branch bifurcates, it means that the two corresponding outputs are different at this time instant. This exact process is formulated in (33). Given an observer Ŝ1 of P , the output of Ŝ1 will be different from (at least) one of the branches at t = T(1,1) , as shown in the figure. Following this branch, the estimation error occurs at one step. Similarly, the output of Ŝ1 will be different from one of the sub-branches at t = T(2,1) , and the estimation error occurs at two steps. Repeating this argument, we see that the estimation error occurs infinitely often for Ŝ1 . For another observer Ŝ2 , the branches associated with the estimation errors may be different from the ones of Ŝ1 , as shown in Figure 3. Therefore, we propose this tree structure to guarantee that estimation error occurs infinitely often for any observer, and consequently the plant P is not weakly output observable. We formalize this result as follows. Theorem 5. Given a system P (2) with |U| < ∞, 1 < |Y| < ∞, if there is an unobservable family Ψ (32) that satisfies items i) through iii), then system P is not weakly output observable.  Essentially, item i) requires that two output differs at one step but are identical at all previous steps, item ii) connects the adjacent stages of Ψ, and item iii) requires that the branches of Ψ are feasible input and output signals of P . While the hypotheses in Theorem 5 seem abstract, one might be interesting in explicitly identifying instances of systems that satisfy these hypotheses. Thus for the specific class of systems (3), we will now present concrete instances of Theorem 5. For the purpose of exposition, we consider system (3) with p = 1 and assume the quantizer Q to be right-continuous. Theorem 6. Consider system (3) with p = 1, 0 ∈ U, and Q in the form of (4). Assume B ∩ R+ 6= ∅ and let β = argmin B ∩ R+ . If there exist an eigenvalue-eigenvector pair (λ, v) of A, a x∗ ∈ span{v}, and a u∗ ∈ U such that λ > 1, Cx∗ = β, and A2 x∗ + Bu∗ = 0, then system (3) is not weakly output observable. Remark. Recall Theorem 4, systems that satisfy the hypotheses in Theorem 6 are not finite memory output observable. Compared to the hypotheses in Theorem 4, the requirement of the existence of x∗ and u∗ in Theorem 6 is new. Interestingly, stronger results can be said about the systems that satisfy the hypotheses in Theorem 6: In fact, such systems are not even asymptotically observable. Corollary 1. Consider a system (3) that satisfies the hypotheses in Theorem 6, then system (3) is not asymptotically output observable. 5.2 Derivation of Main Results First, we make an observation regarding a system P (2) not being weakly output observable. Lemma 9. Given a system P (2) and recall the setup as in Figure 2, P is not weakly output observable if and only if for any observer Ŝ (5), there is (u, y) ∈ P such that yt 6= ŷt for infinitely many t ∈ N. Proof. By Definition 3, P is not weakly output observable if and only if for any observer Ŝ (5) γ = 0 is not an observation gain bound of (P, Ŝ). Equivalently, by Definition 6, for any observer Ŝ there is (u, y) ∈ P such that T X sup kyt − ŷt k = ∞. (37) T ≥0 t=0 Equation (37) implies yt 6= ŷt for infinitely many t ∈ N. Let δ = min{ky1 − y2 k : y1 6= y2 , y1 , y2 ∈ Y}, since |Y| < ∞, the minimum is well-defined and δ > 0. If yt 6= ŷt for infinitely many t ∈ N, then kyt − ŷt k > δ for infinitely many t ∈ N, which implies (37). This completes the proof.  Next, given an arbitrary observer Ŝ as in (5), we make an observation regarding its output ŷt when the segments of Ψ are applied to its input. Lemma 10. Given a system P (2) and Ψ (32), assume the hypotheses in Theorem 5 are satisfied. For any observer Ŝ (5), define a family Θ̂ of its output segments as: (k,j) T(k,j) 2k }t=0 }j=1 }∞ k=1 , Θ̂ = {{{ŷt 14 (38) (k,j) T(k,j) }t=0 where for all k ∈ Z+ , 1 ≤ j ≤ 2k , {ŷt (k,j) ut = ut yt = (k,j) (k,j) where ut , yt are satisfied: is the output of Ŝ when ut and yt in equation (5) satisfy , for t = 0, 1, . . . , T(k,j) , (k,j) yt , (39) for t = 0, 1, . . . , T(k,j) − 1, are given by Ψ. Then there is a sequence {j(k)}∞ k=1 such that for all k ∈ Z+ , the following j(k) ∈ {1, . . . , 2k }, (k,j(k)) ŷt (k,j(k)) ut 6= = (40a) (k,j(k)) yt , for all (k−1,j(k−1)) ut , 0 t∈ {T(i,j(i)) }ki=1 , (40b) ≤ t ≤ T(k−1,j(k−1)) , (40c) j(k) ∈ {2j(k − 1) − 1, 2j(k − 1)}, (40d) where (40c), (40d) are only required for k ≥ 2.  Proof. We use induction to show this Lemma. For k = 1, first make an observation of the output ŷt of the observer. By the dynamics of Ŝ (5), for any t ∈ Z+ , ŷt = g(f (. . . f (f (q0 , u0 , y0 ), u1 , y1 ) . . . , ut−1 , yt−1 ), ut ). (1,1) Recall (33), we have ut (1,2) = ut (1,1) t = T(1,1) in (41), and recall (39), we have (1,j ∗ ) yT(1,1) . (1,j ∗ ) ŷT(1,1) ∗ = (1,2) , for t = 0, 1, . . . , T(1,1) − 1. Let (1,1) (1,2) Recall (33c), yT(1,1) 6= yT(1,1) . Consequently, there (1,j(1)) (1,j(1)) then ŷt 6= yt , for t = T(1,j(1)) , therefore , for t = 0, 1, . . . , T(1,1) , and yt (1,1) ŷT(1,1) (41) = yt (1,2) ŷT(1,1) . ∗ Let j(1) = j , 6= is j ∈ {1, 2} such that (40) holds at k = 1. For k = 2, recall (34a), T(2,2) > T(1,1) , and T(2,4) > T(1,2) . Recall (33a), T(2,j) > T(1,1) for all j ∈ (2,2) {1, 2, 3, 4}. Recall (34b), ut (1,1) = ut (2,4) (1,2) , ut = ut (2,2) (1,1) (2,3) (2,4) (1,2) ut = ut , ut = ut = ut , t = 0, 1, . . . , T(1,1) . Similarly, (1,1) (2,3) (2,4) (1,2) yt , yt = yt = yt , t = 0, 1, . . . , T(1,1) . Recall (41), (2,1) ŷt (2,2) = ŷt (1,j(1)) (1,1) = ŷt (1,j(1)) (2,3) , ŷt (2,4) = ŷt (1,2) 6= yt (2,2j(1)−1) ŷt (1,j(1)) ŷt ,t = T(1,1) . Recall (34b), yt (2,2j(1)−1) 6= yt = = by (34b), (33b), (33c), = ŷt Since (40) holds at k = 1, ŷt (2,2j(1)) ŷt (2,1) = (2,2) yt = , t = 0, 1, . . . , T(1,1) . Recall (33b), (33c), ut (2,1) yt = , t = T(1,1) . (42) , for t = T(1,j(1)) = T(1,1) . Recall j(1) ∈ {1, 2}, by (42), (2,2j(1)−1) (2,2j(1)) = yt (1,j(1)) = yt , t = T(1,1) . Therefore, ŷt (2,2j(1)−1) (2,2j(1)−1) Next, recall (33), (41), we have ŷt (2,2j(1)) , ŷt (2,2j(1)) = ŷt (2,2j(1)) 6= yt , t = T(1,1) . (43) (2,2j(1)−1) (2,2j(1)) 6= yt , t = T(2,2j(1)) . Recall (33c), yt ∗ T(2,2j(1)−1) = T(2,2j(1)) . Consequently, there is j ∈ {2j(1) − 1, 2j(1)} ⊂ {1, 2, 3, 4} such that (2,j ∗ ) ŷt ∗ (2,j ∗ ) yt , ∗ (2,j ) ŷt 6= ,t = (2,j ∗ ) yt , t = T(2,j ∗ ) . Let j(2) = j , then (40a), (40d) hold. By (43), and 6= t = T(2,j ∗ ) , (40b) holds. By (33), (34b), we see (40c) holds. Therefore (40) holds at k = 2. (k+1,2j(k)−1) (k+1,2j(k)) Assume that (40) holds for some k ≥ 2. Recall (33b), (33c), (34b), ut = ut = (k,j(k)) (k+1,2j(k)−1) (k+1,2j(k)) (k,j(k)) ut , and yt = yt = yt , t = 0, 1, . . . , T(k,j(k)) . Recall (39), (41), we see that (k+1,2j(k)−1) ŷt (k+1,2j(k)) = ŷt (k,j(k)) = ŷt , t = 0, 1, . . . , T(k,j(k)) . Since (40b) holds for k, we see that ( (k+1,2j(k)−1) (k+1,2j(k)−1) ŷt 6= yt , ∀ t ∈ {T(i,j(i)) }ki=1 . (k+1,2j(k)) (k+1,2j(k)) ŷt 6= yt , (k+1,2j(k)−1) At t = T(k+1,2j(k)) , by (33), (41), ŷt (k+1,2j(k)) yt ,t (k+1,2j(k)) = ŷt (k+1,2j(k)−1) , t = T(k+1,2j(k)) . By (33a), (33c), yt ∗ (k+1,j ) ŷt ∗ (44) (k+1,j ∗ ) yt = T(k+1,2j(k)) . Therefore there is j ∈ {2j(k) − 1, 2j(k)} such that 6= at t = T(k+1,2j(k)) = T(k+1,j ∗ ) . Let j(k + 1) = j ∗ , and recall (44), we see that (40b) holds for k + 1. Since j(k + 1) = j ∗ ∈ {2j(k) − 1, 2j(k)}, and (40a) holds for k, we see that (40a), (40d) holds for k + 1. By (33), (34b), we see (40c) holds for k + 1. We see that (40) holds for k + 1. This completes the derivation of the  existence of {j(k)}∞ k=1 such that (40) holds for all k ∈ Z+ . 15 6= Based on the observation made in Lemma 10, given Ŝ we construct an input-output pair of P such that the estimation error occurs infinitely many often. Lemma 11. Given a system P (2) and Ψ (32), assume the hypotheses in Theorem 5 are satisfied. Given an N N observer Ŝ (5), let {j(k)}∞ k=1 be such that (40) holds, define an input-output pair (u, y) ∈ U × Y as ( (1,j(1)) ut = ut , 0 ≤ t ≤ T(1,j(1)) , (1,j(1)) yt = yt , ( (45) (k,j(k)) ut = ut , T(k−1,j(k−1)) < t ≤ T(k,j(k)) , k ≥ 2, (k,j(k)) yt = yt , then (u, y) is well-defined and (u, y) ∈ P .  Proof. First we show that (u, y) (45) is well-defined. Let L(k) = {T(k−1,j(k−1)) + 1, . . . , T(k,j(k)) } ⊂ Z+ for all k ≥ 2. We observe that {0, 1, . . . , T(1,j(1)) } ∪ ( ∞ [ L(k)) = N, (46a) k=2 L(k1 ) ∩ L(k2 ) = ∅, if k1 6= k2 . (46b) To see this, by (40d), (33a), (34a), T(k,j(k)) > T(k−1,j(k−1)) , (47) or equivalently T(k,j(k)) ≥ T(k−1,j(k−1)) + 1, for all k ≥ 2. Consequently, T(k,j(k)) ≥ T(1,j(1)) + (k − 1), for all k ≥ 2, and supk∈Z+ T(k,j(k)) = ∞. For any t ∈ N, if t > T(1,1) , let k(t) = min{k ∈ Z+ : T(k,j(k)) ≥ t}. Since {k ∈ Z+ : T(k,j(k)) ≥ t} is none-empty, k(t) is well-defined (pp. 28, [23]), and t ∈ L(k(t)). Therefore (46a) holds. For any k1 , k2 ≥ 2, and k1 6= k2 , without loss of generality, let k1 < k2 . Assume t∗ ∈ L(k1 ) ∩ L(k2 ), then t∗ > T(k2 −1,j(k2 −1)) , and t∗ ≤ T(k1 ,j(k1 )) . Since k2 − 1 ≥ k1 , by (47), T(k2 −1,j(k2 −1)) ≥ T(k1 ,j(k1 )) , but T(k2 −1,j(k2 −1)) < t∗ ≤ T(k1 ,j(k1 )) , which draws a contradiction. Therefore (46b) holds. Consequently, (u, y) (45) is well-defined. By (40a), (40d), and item iii) of Ψ (see (36)), (u, y) (45) satisfies (u, y) ∈ P .  Lastly, we apply the previous observations to show Theorem 5. Proof. (Theorem 5) For any observer Ŝ as in (5), consider (u, y) ∈ P defined as in (45). In the setup in (1,j(1)) Figure 2, let {ŷt }∞ , t=0 be the output of Ŝ corresponding with (u, y). Recall (45), we see that ut = ut (k,j(k)) 0 ≤ t ≤ T(1,j(1)) . Recall (40), we see that for any k ∈ Z+ , we have ut = ut , 0 ≤ t ≤ T(1,j(1)) . (k,j(k)) Similarly, we can show that for any k ≥ 2, ut = ut then for any k ∈ Z+ , we have ut = k ∈ Z+ , yt = (k,j(k)) yt , (k,j(k)) ut , , T(1,j(1)) + 1 ≤ t ≤ T(2,j(2)) . Repeat this argument, 0 ≤ t ≤ T(k,j(k)) . Similarly, we can show that for any 0 ≤ t ≤ T(k,j(k)) − 1. Recall the definition of Θ̂ (see (39)), and (41), we have (k,j(k)) ŷt = ŷt , t = T(k,j(k)) , (k,j(k)) (k,j(k)) (40b), ŷt 6= yt ,t (k,j(k)) for all k ∈ Z+ . Recall (45), yt = yt , t = T(k,j(k)) , for all k ∈ Z+ . Recall = T(k,j(k)) , for all k ∈ Z+ . Therefore, ŷt 6= yt , t = T(k,j(k)) , ∀ k ∈ Z+ . Recall (47), we see that ŷt 6= yt for infinitely many t ∈ N. By Lemma 9, P is not weakly output observable. (48)  We first construct a family Ψ of input-output segments of system (3), and then show that the constructed Ψ satisfies the hypotheses in Theorem 5. Within the scope of this derivation, we use “s” to denote the initial state x0 of system (3). Consider a system (3) that satisfies the hypotheses in Theorem 6 and let T ∈ Z+ and T ≥ 2, we define a quantity so as x∗ (49) so = T . λ 16 Next, define a family S of initial states of system (3) as k S = {{s(k,j) }2j=1 }∞ k=1 , (50) where s(1,1) = 0, s(1,2) = so , (51) and for all k ≥ 2, all j = 1, 2, . . . , 2k−1 , s(k,2j−1) = s(k−1,j) , s(k,2j) = s(k−1,j) + ( 1 k−1 ) so . λT (52) Then s(k,j) is defined for all k ∈ Z+ and j ∈ {1, . . . , 2k }. At the same time, define a family I of input segments of system (3) as (k,j) T(k,j) 2k }t=0 }j=1 }∞ k=1 , I = {{{ut (53) where for all k ∈ Z+ , all j = 1, 2, . . . , 2k , T(k,j) = k · T, (54) and (1,1) ut (1,2) = ut = 0, t = 0, 1, . . . , T, (55) k−2 and for all k ≥ 2, all j = 1, 2, . . . , 2 , ( (k,4j−1) (k−1,2j) (k,4j) = ut = ut , ut 0 ≤ t ≤ (k − 1)T, (k,4j−2) (k,4j−3) (k−1,2j−1) ut = ut = ut , ( (k,4j) (k,4j−1) ut = ut = u∗ , t = (k − 1)T + 1, (k,4j−2) (k,4j−3) ut = ut = 0, (k,4j−i) ut 0 ≤ i ≤ 3, = 0, (56) (k − 1)T + 2 ≤ t ≤ kT, (k,j) then ut is defined for all k ∈ Z+ , j ∈ {1, . . . , 2k }, and t ∈ {0, . . . , kT }. Given S and I defined in the preceding, define a family Θ of output segments of system (3) as: (k,j) T(k,j) 2k }t=0 }j=1 }∞ k=1 , Θ = {{{yt (k,j) T(k,j) }t=0 where for all k ∈ Z+ , 1 ≤ j ≤ 2k , {yt in equation (3) satisfy is the quantized output yt (3c) of system (3), when ut and xt (k,j) ut = ut (57) , for t = 0, 1, . . . , T(k,j) , xt = s(k,j) , for t = 0. (k,j) (58) (k,j) Essentially, yt is the quantized output of system (3) when ut is applied to its input, and its initial (k,j) state is s(k,j) . In the following, we also use xt to denote the state xt of system (3) corresponding with (58). Given I and Θ, define Ψ as (k,j) T(k,j) (k,j) T(k,j) 2k }t=0 , {yt }t=0 )}j=1 }∞ k=1 , Ψ = {{({ut (k,j) (k,j) (59) where ut , yt are given by I (53) and Θ (57) respectively. In the following, we will show that the Ψ defined as in (59) satisfies items i) to iii) in Theorem 5 and therefore the system is not weakly output observable. Toward this end, we start with making an observation about S. 17 Lemma 12. Given a system (3) that satisfies the hypotheses in Theorem 6 and an integer T ≥ 2, let q = λ−T . Then S defined in (50) is such that for any k ∈ Z+ and j ∈ {1, . . . , 2k }, (k,j) s(k,j) = (α1 (k,j) where αl (k,j) + α2 (k,j) · q + · · · + αk · q k−1 ) · so , (60) , l ∈ {1, . . . , k}, is defined as ( k−l+1 0, if 0 ≤ (j − 1) mod (2k−l+1 ) < 2 2 , (k,j) αl = k−l+1 1, if 2 2 ≤ (j − 1) mod (2k−l+1 ) < 2k−l+1 . (1,1) (61) (1,2) Proof. We use induction to show this result. For k = 1, by (61), α1 = 0, α1 = 1. Recall (51), we see that (60) hold for k = 1. (k,j) Next, assume (60) hold for some k ≥ 1, about αl (61), observe that for any l ∈ {1, . . . , k} (k,j) αl (k+1,2j−1) = αl (k+1,2j) = αl . (62) To see this, let (j − 1) mod 2k−l+1 = b, for some 0 ≤ b < 2k−l+1 . Then j − 1 = 2k−l+1 · a + b, for some unique a ∈ N (pp. 32, [23]). Therefore ((2j − 1) − 1) mod 2(k+1)−l+1 = 2b, and (2j − 1) mod 2(k+1)−l+1 = 2b + 1. (k,j) (k+1,2j−1) (k+1,2j) (k,j) If αl = 0, recall (61), αl = αl = 0. Similarly, we can show that if αl = 1, then (k+1,2j−1) (k+1,2j) αl = αl = 1. Therefore (62) holds. By (52), (62), observe that for all j = 1, 2, . . . , 2k , (k+1,2j−1) (k+1,2j) (k,j) (k,j) αk+1 = 0, and αk+1 = 1, we see that for any 1 ≤ j ≤ 2k s(k+1,2j−1) = (α1 + α2 · q + ··· + (k,j) (k+1,2j−1) (k,j) (k,j) (k,j) αk · q k−1 + αk+1 q k ) · so , s(k+1,2j) = (α1 + α2 · q + · · · + αk Therefore (60) hold for k + 1. By induction, (60) hold for all k ∈ Z+ . (k+1,2j−1) · q k−1 + αk+1 · q k ) · so .  We also make an observation about I (53) in the following. Lemma 13. Given a system (3) that satisfies the hypotheses in Theorem 6 and an integer T ≥ 2, I defined in (53) is such that for any k ≥ 2, j ∈ {1, 2, . . . , 2k }, (k,j) ut (k,j) ut (k,j) ut = 0, = = t = 0, 1, . . . , T, (k,j) α1 u∗ , t = (k−1,h(k,j)) ut−T , (63a) T + 1, (63b) t = T + 2, T + 3, . . . , kT. (63c) where function h(k, j) is defined as h(k, j) = (j − 1) mod 2k−1 + 1, ∀ k ∈ Z+ , j ∈ Z+ . (2,1) (2,2) (64) (2,3) Proof. We use induction to show (63) holds. For k = 2, recall ut = ut = 0 for 0 ≤ t ≤ 2T , ut = (2,4) (2,3) (2,4) (1,1) (1,2) ut = 0 for 0 ≤ t ≤ 2T and t 6= T +1, ut = ut = u∗ for t = T +1, and ut = ut = 0, for 0 ≤ t ≤ T . (2,4) (2,1) (2,2) (2,3) = 0, α1 = α1 = 1. By (64), h(2, 1) = 1, h(2, 2) = 2, h(2, 3) = 1, h(2, 4) = 2. We By (61), α1 = α1 see that (63) holds for k = 2. Assume (63) holds for some k ≥ 2. Recall (56), for all j ∈ {1, . . . , 2k } (k+1,2j−1) ut (k+1,2j−1) (k+1,2j) (k+1,2j) = ut (k,j) = ut , t = 0, 1, . . . , kT. (65) (k,j) By assumption, ut = ut = ut = 0, 0 ≤ t ≤ T , 1 ≤ j ≤ 2k , and (63a) holds for k + 1. At (k,j) (k+1,2j−1) (k+1,2j−1) (k+1,2j) (k,j) (k,j) = t = T + 1, by (65) and (63b), ut = ut = ut = α1 u∗ . Recall (62), α1 = α1 (k+1,2j) (k+1,2j−1) (k+1,2j−1) ∗ (k+1,2j) (k+1,2j) ∗ α1 . Therefore ut = α1 u , and ut = α1 u for t = T + 1. Consequently, (63b) holds for k + 1. Next, we show (63c) holds for k + 1. Recall (64), we can show that for all k ≥ 2, j ∈ {1, 2, . . . , 2k−1 }, h(k, 2j − 1) = 2h(k − 1, j) − 1, 18 h(k, 2j) = 2h(k − 1, j). (66) (k+1,2j−1) Since (63c) holds for k by assumption, recall (65), we have ut (k−1,h(k,j)) ut−T k+1 k 2 ≤ t ≤ kT, 1 ≤ j ≤ 2 . Recall (65), we have preceding and recall (66), we see that for j ∈ {1, . . . , 2 (k+1,j) ut (k,h(k+1,j)) = ut−T (k+1,2j) = ut (k,j) = ut (k−1,h(k,j)) = ut−T ,T+ (k,2h(k,j)) ut−T , T + 2 ≤ t ≤ kT . Combine the T + 2 ≤ t ≤ kT. (67) = }, , Recall (56), we see that for j ∈ {1, . . . , 2k+1 }, (k+1,j) ut (k,h(k+1,j)) = 0 = ut−T kT + 2 ≤ t ≤ (k + 1)T. , (68) (k,j) Recall (56), we observe that at t = (k − 1)T + 1, ut is determined by j mod 4. Also observe that for (k+1,j) (k,h(k+1,j)) k ≥ 2, 1 ≤ j ≤ 2k+1 , j mod 4 = h(k + 1, j) mod 4. Therefore, ukT +1 = u(k−1)T +1 . Consequently, (k+1,j) ut (k,h(k+1,j)) = ut−T , t = kT + 1. (69) By (67), (68), (69), we see that (63c) holds for k + 1, and (63) holds for all k ≥ 2.  Now we proceed to make observations about Ψ. Lemma 14. Given a system (3) that satisfies the hypotheses in Theorem 6, there is a T ∈ Z+ such that Ψ defined in (59) satisfies items i) and ii) in Theorem 5. Proof. We use induction to show this result. First let T ≥ 2. For k = 1, recall (54), T(1,1) = T(1,2) = T . (1,1) Recall (55), ut (1,2) = ut (1,1) = 0, 0 ≤ t ≤ T . By the definition of Θ (58) and s(1,1) = 0, yt = Q(0) (1,2) = Q(0) for for 0 ≤ t ≤ T . Recall s(1,2) = so ∈ span{v}, λ > 1, β = argmin{|b| : b ∈ B, b > 0}, yt (1,2) (1,1) (1,2) (1,1) (1,2) 0 ≤ t ≤ T − 1. At t = T , yt = Q(β) 6= Q(0). Therefore, yt = yt , 0 ≤ t ≤ T − 1, and yt 6= yt , t = T , and item i) is satisfied for k = 1. For k = 2, recall (54), for any 1 ≤ j ≤ 4, T(2,j) = 2T . Recall (51), (52), s(2,1) = 0, s(2,2) = λ−T so , s(2,3) = (2,1) so , s(2,4) = so + λ−T so . By (55), (56), ut (2,3) (2,2) = ut (2,3) = 0 for 0 ≤ t ≤ 2T , and ut (2,4) (2,4) = ut = 0 for (2,1) 0 ≤ t ≤ 2T and t 6= T + 1, ut = ut = u∗ for t = T + 1. Therefore yt = Q(0) for 0 ≤ t ≤ 2T , and (2,2) (2,2) t −T yt = Q(CA (λ so )) = Q(0) for 0 ≤ t ≤ 2T − 1. At t = 2T , yt = Q(β) 6= Q(0). Consequently, items i) and ii) are satisfied when k = 2, j = 1. For the case k = 2, j = 2, by the definition of Θ (58), we can show that  t = 0, 1, . . . , T − 1,   Q(0),  Q(β), t = T, (2,3) (70) yt = Q(λβ + Du∗ ), t = T + 1,    Q(0), t = T + 2, . . . , 2T. (2,4) For yt (2,4) , at t = T − 1, yt = Q(λ−1 (1 + λ−T )β). Choose T ∈ Z+ such that λT > λ . λ−1 (71) (2,4) λ Since λ > 1, such a choice of T always exist, for example let T > logλ ( λ−1 ). Then we have yt = Q(0), t −T −1 −T t = T − 1. For any 0 ≤ t ≤ T − 2, we see that 0 < CA (so + λ so ) < λ β(1 + λ ), and consequently (2,4) (2,4) yt = Q(0). At t = T , yt = Q((1 + λ−T )β). Recall Q (4), there is δ1 > 0 such that Q(y) = Q(β), ∀ y ∈ [β, β + δ1 ). Choose T ∈ Z+ such that 1 β < β + δ1 . (72) 1 − λ−T (2,4) Since λ > 1, (72) is satisfied for all T sufficiently large. Then yt = Q(β), t = T . At t = T + 1, (2,4) −T ∗ yt = Q((1 + λ )λβ + Du ). Similarly, recall (4), there is δ2 > 0 such that Q(y) = Q(λβ + Du∗ ), ∀ y ∈ [λβ + Du∗ , λβ + Du∗ + δ2 ). Choose T ∈ Z+ such that 1 λβ < λβ + δ2 . 1 − λ−T 19 (73) (2,4) (2,4) Then yt = Q(λβ + Du∗ ), t = T + 1. At t = T + 2, the system state xt = A2 x∗ + Bu∗ + λ2 so . By (2,4) (2,4) assumption A2 x∗ + Bu∗ = 0, we have xT +2 = λ2 so = A2 so . Recall ut = 0 for T + 2 ≤ t ≤ 2T , we can show that  Q(0), t = 0, 1, . . . , T − 1,     t = T,  Q(β), (2,4) Q(λβ + Du∗ ), t = T + 1, yt =   Q(0), t = T + 2, . . . , 2T − 1,    Q(β), t = 2T. (1,2) Recall (70), and the explicit form of yt , we see that items i) and ii) are satisfied when k = 2, j = 2. We conclude that Ψ (59) satisfies items i) and ii) in Theorem 5 when k = 2. Next, assume items i) and ii) are satisfied for some k ≥ 2, we will show that they are satisfied for k + 1. Recall (56), we see that (k+1,2j−1) (k+1,2j) ut = ut , 0 ≤ t ≤ (k + 1)T, (74) for all 1 ≤ j ≤ 2k . Note that (1 + q + · · · + q k ) < (k+1,2j−1) Cxt < λ−1 1−λ1−T β. Recall (71), λ−1 1−λ1−T (k+1,2j) yt = Q(0), 0 ≤ t ≤ T − 1. Therefore, (k+1,2j−1) yt (k+1,2j−1) At t = T , yT (k+1,2j) α1 1 1−q , and recall (60), (61), (63a), for all 0 ≤ t ≤ T − 1, (k+1,2j−1) (k+1,2j) = yt t = 0, 1, . . . , T − 1. , (k+1,2j) = Q(CAT s(k+1,2j−1) ), and yT = 0, then CAT s(k+1,2j−1) < 1 β. λT −1 = Q(0), 0 ≤ t ≤ T − 1. Similarly, < 1, and yt (75) (k+1,2j−1) = Q(CAT s(k+1,2j) ). Recall (60), if α1 = Choose T ∈ Z+ such that λT − 1 > 1. (k+1,2j−1) (76) (k+1,2j) (k+1,2j−1) (k+1,2j) Then yT = Q(0). Similarly, we can show that yT = Q(0). If α1 = α1 = 1, then β ≤ CAT s(k+1,2j−1) < β 1−λ1−T . Recall (72), we see that CAT s(k+1,2j−1) ∈ [β, β + δ1 ), and therefore (k+1,2j−1) (k+1,2j) yT = Q(β). Similarly, yT = Q(β). We summarize the preceding as (k+1,2j−1) yt (k+1,2j−1) At t = T + 1, recall (63b), uT +1 (k+1,2j) α1 (k,j) = α1 (k,j) . If α1 (k+1,2j) = yt (k+1,2j−1) ∗ = α1 , t = T. (k+1,2j) u , uT +1 (77) (k+1,2j) ∗ = α1 = 0, recall (60), then CAT +1 s(k+1,2j−1) < (k+1,2j−1) u . Recall (62), α1 λ β. λT −1 λT − 1 > λ. (k+1,2j−1) Then yT +1 (k+1,2j) = yT +1 (k,j) = Q(0). If α1 (78) (k+1,2j−1) = 1, and therefore uT +1 (k+1,2j−1) CAT +1 s(k+1,2j−1) + Du∗ < λβ 1−λ1−T + Du∗ . Recall (73), we see that yT +1 We conclude that (k+1,2j−1) (k+1,2j) yt = yt , t = T + 1. + (k+1,2j−1) xT +2 (k,h(k+1,2j−1)) Consider x2 ∗ + Bu ). Note that λ (k+1,2j−1) = A2 (α2 T +2 (k+1,2j) = Q(λβ + Du∗ ). (79) (k+1,2j−1) (k+1,2j−1) T +2 α1 (λ so = u∗ , then λβ + Du∗ ≤ = yT +1 At t = T + 2, for any 1 ≤ j ≤ 2k , recall (60), (63b), we see that xT +2 (k+1,2j−1) k−1 αk+1 q )so = Choose T ∈ Z+ such that ∗ (k+1,2j−1) = A2 (α2 2 ∗ + ··· + ∗ so + Bu = A x + Bu = 0, therefore (k+1,2j−1) k−1 + · · · + αk+1 q )so . (80) , recall (60), (63a), (k,h(k+1,2j−1)) x2 A 2 = (k,h(k+1,2j−1)) (α1 (k+1,2j−1) In the following, we show that xT +2 (k,h(k+1,2j−1)) k−1 + · · · + αk (k,h(k+1,2j−1)) = x2 20 q . (81) )so . Recall (61), (64), note that (j − 1) mod (2k−l+1 ) = h(k − l + 2, j) − 1, we see that ( k−l+1 0, if 0 ≤ h(k − l + 2, j) − 1 < 2 2 , (k,j) αl = k−l+1 1, if 2 2 ≤ h(k − l + 2, j) − 1 < 2k−l+1 , (82) for any k ∈ Z+ , j ∈ {1, . . . , 2k }, and l ∈ {1, . . . , k}. Compare (80) and (81), and recall (64), (66), we observe that for any 2 ≤ l ≤ k + 1, h((k + 1) − l + 2, (2j − 1)) = 2h(k − l + 2, j) − 1, h(k − l + 3, h(k + 1, 2j − 1)) = 2h(k − l + 2, h(k, j)) − 1, (83) h(k − l + 2, j) = h(k − l + 2, h(k, j)). (k+1,2j−1) Based on the above, we can show that for any 2 ≤ l ≤ k + 1, αl k (k+1,2j−1) xT +2 k+1 (81), for any 1 ≤ j ≤ 2 , Therefore, for any 1 ≤ j ≤ 2 = (k,h(k+1,2j−1)) x2 . (k+1,j) (k+1,j) . Recall (80), (k+1,2j) xT +2 (k,h(k+1,2j)) Similarly, we can show that = x2 (k,h(k+1,j)) = ut−T (k,h(k+1,j)) = x2 . (84) , T + 2 ≤ t ≤ (k + 1)T , or equivalently, (k+1,j) uT +t (k,h(k+1,j)) = ut , 2 ≤ t ≤ kT. (85) (k+1,j) By (84), (85), and the time-invariance of system (3), we see that for any 1 ≤ j ≤ 2k+1 , yt+T (k,h(k+1,j)) yt , . , xT +2 Recall (63c), ut (k,h(k+1,2j−1)) = αl−1 = k 2 ≤ t ≤ kT. Recall (66), for any 1 ≤ j ≤ 2 , ( (k+1,2j−1) (k,2h(k,j)−1) yt+T = yt , (k,2h(k,j)) (k+1,2j) , = yt yt+T 2 ≤ t ≤ kT. (86) By assumption, item i) is satisfied for k. Recal (33), note that 1 ≤ h(k, j) ≤ 2k−1 , we see that (k,2h(k,j)−1) (k,2h(k,j)) (k,2h(k,j)−1) (k,2h(k,j)) yt = yt , 2 ≤ t ≤ kT − 1; yt 6= yt , t = kT. Recall (86), we see that k for any 1 ≤ j ≤ 2 , (k+1,2j−1) (k+1,2j) yt = yt , T + 2 ≤ t ≤ (k + 1)T − 1, (87) (k+1,2j−1) (k+1,2j) yt 6= yt , t = (k + 1)T. Recall (54), (74), (75), (77), (79), (87), we see that item i) is satisfied for k + 1. (k+1,2j−1) (k,j) For item ii), recall (56), we see that ut = ut , 0 ≤ t ≤ kT , for any 1 ≤ j ≤ 2k . Recall (52), (k+1,2j−1) (k,j) s(k+1,2j−1) = s(k,j) . Therefore yt = yt , 0 ≤ t ≤ kT , for any 1 ≤ j ≤ 2k . Since item i) is satisfied (k+1,2j−1) (k+1,2j) for k + 1, yt = yt , 0 ≤ t ≤ kT , and therefore item ii) is satisfied for k + 1. Choose T ≥ 2 such that (71), (72), (73), (76), and (78) are satisfied, by induction, we conclude that Ψ (59) satisfies items i) and ii) in Theorem 5.  Next, we show that Ψ (59) satisfies item iii) in Theorem 5. Lemma 15. Given a system (3) that satisfies the hypotheses in Theorem 6, let T ≥ 2 be such that (71), (72), (73), (76), and (78) are satisfied. Then Ψ defined in (59) satisfies item iii) in Theorem 5. k Proof. Given a sequence {j(k)}∞ k=1 that satisfies j(k) ∈ {1, . . . , 2 } and j(k+1) ∈ {2j(k)−1, 2j(k)}, ∀ k ∈ Z+ , we observe that limk→∞ s(k,j(k)) exists. To see this, recall (60), (62), for any k ∈ Z+ , we can show that (k+1,j(k+1)) n s(k+1,j(k+1)) − s(k,j(k)) = αk+1 q k so . Consequently, {s(k,j(k)) }∞ k=1 is a Cauchy sequence in R . Since converges. Rn is complete, {s(k,j(k)) }∞ k=1 Given {j(k)}∞ k=1 , define an initial state s of system (3) as s = lim s(k,j(k)) . k→∞ 21 (88) Recall (60) and so ∈ span{v}, we can show that s ∈ span{v}. (89) Define an input sequence u as (1,j(1)) ut = ut (k,j(k)) ut = ut 0 ≤ t ≤ T, , (90) (k − 1)T < t ≤ kT, ∀ k ≥ 2. , ∞ In the following, let y = {yt }∞ t=0 be the output , {xt }t=0 be the state of system (3) when its initial state is x0 = s (88) and its input is u (90). For this y, we observe that for any k ∈ Z+ , (k,j(k)) yt = yt 0 ≤ t ≤ kT. , (91) We use induction to show this observation. (1,1) (1,2) For k = 1, by the derivation of Lemma 15, we have yt = Q(0), 0 ≤ t ≤ T , and yt = Q(0), (1,2) q . Recall (76) (89), (90), 0 ≤ t ≤ T − 1, yT = Q(β). If j(1) = 1, recall (60), (88), we see that Cs ≤ λβT 1−q (1,j(1)) we see that yt = Q(0) = yt for 0 ≤ t ≤ T . Similarly, if j(1) = 2, then Cs ≤ (1,j(1)) that yt = Q(0) = yt for 0 ≤ t ≤ T − 1. At t = (1,j(1)) , and therefore (91) holds (72), yT = Q(β) = yT β 1 . λT 1−q Recall (71), we see T , recall (60), we see that β ≤ CxT ≤ β 1−λ1−T . Recall for k = 1. Assume (91) holds for some k ≥ 1, since Ψ (59) satisfies items i) and ii) in Theorem 5, recall (33), (34b), (k,j(k)) (k+1,j(k+1)) we see that yt = yt = yt , 0 ≤ t ≤ kT. Consequently, to show (91) holds for k + 1, we only need to consider kT + 1 ≤ t ≤ (k + 1)T . (k+1,j(k+1)) We first make some observations about the quantities xkT and xkT . Recall (56), (63), (83), we k see that for all k ≥ 2, 1 ≤ j ≤ 2 , I (53) satisfies:  (k−(l−1),h(k−(l−2),j)) (k,j) α1 u∗ , t ∈ {lT + 1}k−1 l=1 , (92) ut = 0, otherwise. (k+1,j(k+1)) Next, we consider xkT . Recall (64) (82), we see that (k+1,j(k+1)) αl (k−l+2,h(k−l+3,j(k+1))) = α1 . (93) Pk−1 (k+1,j(k+1)) (k+1,j(k+1)) Recall (60), (61), (92), we can show that xkT = l=1 A(k−1−l)T αl (A2T so + AT −2 Bu∗ ) + (k+1,j(k+1)) (k+1,j(k+1)) AT αk so + αk+1 so . Note that A2T so + AT −2 Bu∗ = 0, we have (k+1,j(k+1)) xkT (k+1,j(k+1)) = AT αk (k+1,j(k+1)) so + αk+1 so . (94) Next, consider xkT , which is the system state corresponding with x0 = s (88) and u (90) at t = kT . (z,j(z)) Recall (33b), (34b), (90), we see that ut = ut , 0 ≤ t ≤ zT , for any z ∈ Z+ . Consequently, we see that (k+1,j(k+1)) xkT = AkT (s − s(k+1,j(k+1)) ) + xkT . (95) Recall (60), (88), we see that (k+1,j(k+1)) 0 ≤ CAxkT − CAxkT ≤ λ−T +1 β q . 1−q (96) We are now ready to show (91) holds for k + 1 when kT + 1 ≤ t ≤ (k + 1)T . (k+1,j(k+1)) (k+1,j(k+1)) ∗ (k+1,j(k+1)) At t = kT + 1, recall (92), (93), ukT +1 = ukT +1 = αk u . Recall (94), CxkT +1 + (k+1,j(k+1)) DukT +1 (k+1,j(k+1)) = αk Q(0). Recall (94), (96), CxkT +1 + DukT +1 ≤ (k+1,j(k+1)) αk = 1, (k+1,j(k+1)) (CAT +1 so +Du∗ )+CAαk+1 (k+1,j(k+1)) (k+1,j(k+1)) CxkT +1 +DukT +1 λ λT1−1 β. (k+1,j(k+1)) so . If αk Recall (78), ykT +1 = Q(0) = ∗ ∗ ∈ [λβ +Du , λβ +Du 22 (k+1,j(k+1)) = 0, we have ykT +1 +λβ λT1−1 ), (k+1,j(k+1)) ykT +1 . If and CxkT +1 +DukT +1 ∈ = (k+1,j(k+1)) [λβ + Du∗ , λβ + Du∗ + λβ λT1−1 ]. Recall (73), λβ λT1−1 < δ2 , and therefore ykT +1 = ykT +1 = (k+1,j(k+1)) ). We conclude that yt = yt , t = kT + 1. (k+1,j(k+1)) 2 (k+1,j(k+1)) (93), (94), we have xkT +2 = A αk+1 so . ∗ Q(λβ + Du (k+1,j(k+1)) By (92), Recall (92), we can show that yt = 1 . Recall (71), Q(0), kT + 2 ≤ t ≤ (k + 1)T − 1. Recall (90), (95), we can show that Cxt + Dut ≤ λ−1 β 1−q (k+1,j(k+1)) 1 λ−1 β 1−q < β, therefore yt = Q(0) = yt , kT + 2 ≤ t ≤ (k + 1)T − 1. (k+1,j(k+1)) At t = (k + 1)T , recall (92), we see that xkT +T (k+1,j(k+1)) so . Recall (95), we have (k+1,j(k+1)) αk+1 = 0, recall (76), we have = AT αk+1 (k+1,j(k+1)) (k+1,j(k+1)) q β. CAT αk+1 so ≤ Cx(k+1)T ≤ CAT αk+1 so + 1−q (k+1,j(k+1)) (k+1,j(k+1)) y(k+1)T = y(k+1)T = Q(0). If αk+1 = 1, recall (72), (k+1,j(k+1)) We conclude that yt = yt , t = (k + 1)T . If (k+1,j(k+1)) we have y(k+1)T = y(k+1)T = Q(β). So far, we have shown that (91) holds for k + 1. By induction, we conclude that (91) holds for all k ∈ Z+ . Finally, we show that the pair (u, y), which corresponds with the initial state s (88) and the input (90), (1,j(1)) satisfies (35). Recall (54), T(k,j(k)) = k · T, for all k ∈ Z+ . For k = 1, by (90), ut = ut ,0 ≤ t ≤ T. (1,j(1)) (k,j(k)) And by (91), yt = yt , 0 ≤ t ≤ T . For any k ≥ 2, by (90), ut = ut , (k − 1)T < t ≤ kT . By (91), (k,j(k)) (k,j(k)) yt = yt , 0 ≤ t ≤ kT , and consequently yt = yt , (k − 1)T < t ≤ kT . Therefore (u, y) satisfies (35). Note that (u, y) ∈ P (3), we conclude that Ψ (59) satisfies item iii) in Theorem 5.  We are now ready to show Theorem 6. Proof. (Theorem 6) Let T ≥ 2 be such that (71), (72), (73), (76), and (78) are satisfied, by Lemma 14 and Lemma 15, Ψ defined in (59) satisfies the hypotheses in Theorem 5, consequently system (3) is not weakly output observable. Next, we show that system (3) is not asymptotically output observable. For any observer Ŝ, there is (u, y), which corresponds with the initial state s (88) and the input u (90), such that for all k ∈ Z+ , ŷt 6= yt , t = kT. Let δ = min{ky1 − y2 k : y1 6= y2 , y1 , y2 ∈ Y}, and define γ = 2kuδ ∗ k > 0. For any N ∈ Z+ and N ≥ 2, PN T PN PkT PkT t=T +1 kyt − ŷt k − γkut k = k=2 ( t=(k−1)T +1 (kyt − ŷt k − γkut k)). Recall (90), (92), t=(k−1)T +1 kut k = P P kT kT ∗ ku k. Since ŷt 6= yt , t = kT , ( t=(k−1)T +1 kyt − ŷt k) ≥ kykT − ŷkT k ≥ δ. Therefore t=(k−1)T +1 (kyt − ŷt k − PN T γkut k) ≥ δ − 2kuδ ∗ k ku∗ k = 2δ . Consequently, t=T +1 kyt − ŷt k − γkut k ≥ (N − 1) 2δ , ∀ N ≥ 2. Therefore, PN T PT supN ≥2 t=T +1 kyt − ŷt k − γkut k = ∞. Since U, Y are finite sets, t=0 kyt − ŷt k − γkut k is finite, and PT consequently supT ≥0 t=0 kyt − ŷt k − γkut k = ∞. By definition, γ = 2kuδ ∗ k > 0 is not an observation gain bound of system (3). Recall Definition 1, we see that for any γ 0 ∈ R≥0 , if γ 0 < γ, then γ 0 is not an observation gain bound. Recall (7), we see that the O-gain γ ∗ of system (3) satisfies γ ∗ ≥ γ > 0. Recall Definition 3, system (3) is not asymptotically output observable.  6 Illustrative Examples We begin with an example that highlights a subtle distinction between the concept of finite memory output observability and observability of LTI systems in the traditional sense. In particular, in the traditional LTI setting, the effects of the initial state of a stable LTI system will die down eventually, and the question of observability is only interesting for unstable systems. This is not the case for our class of systems of interest, as a system with stable internal dynamics may retain a recollection of its initial state “forever” in the output. Example 1. Consider system (3) with parameters: A = 0.5, B = 1, C = 1, D = 1, U = {0, ±1}. The quantizer Q with p = 1 is described:   i, y ∈ [i − 0.5, i + 0.5) for i ∈ Z and |i| ≤ R bRc, y ≥ bRc + 0.5 Q(y) = (97)  −bRc, y < −bRc − 0.5 where R ∈ R+ is a parameter. Let R = 1, and (consequently) Y = {0, ±1}. 23 Given ut and yt for all 0 ≤ t ≤ T for some T ∈ Z+ , and an arbitrary uT +1 ∈ U, we claim that yT +1 cannot be uniquely determined. To see this claim, assume the contrary and let ut = 0 for 0 ≤ t ≤ T − 2, uT −1 = 1 and uT = uT +1 = 0. For two distinct initial states x10 = 0.1 and x20 = −0.1, we use yt1 and yt2 to denote the quantized outputs respectively. Then yt1 = yt2 = 0 for 0 ≤ t ≤ T − 2, and yt1 = yt2 = 1 for T − 1 ≤ t ≤ T . By assumption we can uniquely determine yT +1 , which contradicts with yT1 +1 = 1 and yT2 +1 = 0.  As shown in Example 1, the initial state of system (3) impacts the quantized output at arbitrarily large times, even though the underlying LTI system is stable. Consequently, the question of finite memory output observability remains relevant even when the internal dynamics are stable. The next two examples are instances of system (3) that are finite memory output observable. Nonetheless, the two underlying linear dynamics are (LTI) observable in one example, but not the other. This highlights the fact that there is not direct link between finite memory output observability and observability of the underlying LTI dynamics.     0.25 −0.05 2 Example 2. Consider a system (3) whose LTI parameters are: A = ,B = ,C = 0 0.2 1   0.5 0 , D = 1. Note that this is a minimal representation. U = {0, 1, −1} and the quantizer Q(·) is defined in (97) with R = 5. Next we show this system satisfies the hypotheses in Theorem 2. We assume that the initial state x(0) of the LTI system is bounded, particularly: kx0 k∞ < b for some b ∈ R+ . First we find the distance d(A, B) between the two sets   A and B defined in (8) and (9). Since A is (1/4)n (1/5)n − (1/4)n n diagonalizable, we have A = , and CAn B = 1/2((1/5)n + (1/4)n ), ∀n ∈ N. 0 (1/5)n Consequently wee can show that d(A, B) = 5/24. This means that the forced response of the underlying LTI system is at least 5/24 away from any discontinuous point of the quantizer. Based on the derivation of Theorem 2, we construct an observer for this system. Note that kxt k∞ ≤ 10 max{b, 2}, choose T = dlog4 72 7 7 max{b, 2}e + 1, and construct an observer Ŝ according to Definition 4 in Section 4.2. By the derivation of Theorem 2, we can show that the output ŷt of Ŝ satisfies ŷt = yt , ∀ t ≥ T .  Example 3. We present another second   order system (3) that is also observable. The parameters of the LTI   2 2 1 system in (3) are: A = B = C = 0 1 D = 1, U = {0, 1, −1}. The quantizer Q(·) is 0 0 1 defined in (97), and R = 5. Clearly CA = 0, so this system satisfies the condition in Theorem 1. Notice that the solution of ỹt is: ỹt = ut−1 + ut , ∀ t ≥ 2. It is thus straightforward to construct an observer that achieves γ = 0, described as follows: qt+1 = ut ŷt = Q(qt + ut ) where t ∈ N, qt ∈ Q and Q = U. q0 can be arbitrary, say 0.  As discussed in Section 3, the definition of finite memory output observability is stronger than that of weak output observability, and we provide a concrete example to show this point. In particular, our next example is an instance of system (3) that is weakly output observable but not finite memory output observable. Example 4. Given system (3) with parameters A = 0.5, B = C = 1, D = 0, the input set is U = {0, 1, −1}, and the initial state x0 satisfies |x0 | < 2. The quantizer Q is described by: Q((−∞, 0.5)) = 0, and Q([0.5, ∞)) = 1. By Theorem 3, the system in Example 4 is not finite memory output observable. However, we can design an observer Ŝ that achieves the observation gain bound γ = 0. This particular design keeps track of the last two steps of input as well as last three steps of nonzero input of system (3). Therefore this system is weakly output observable.  Lastly, we present a one-dimensional system (3) that is not asymptotically output observable. 24 Example 5. Consider a system (3) with parameters: A = 2, B = 1, C = 1, D = 0. The quantizer Q is described by: Q((−∞, 0.5)) = 0, Q([0.5, ∞)) = 1. The input set is U = {0, 2, −2}. Let x∗ = 0.5, u∗ = −2, and note that the discontinuous point of Q is β = 0.5, then Cx∗ = 1 · 0.5 = β, 2 ∗ A x + Bu∗ = −2 + 22 · 0.5 = 0, therefore the hypotheses in Theorem 6 are satisfied, and consequently this system is not asymptotically output observable.  7 Conclusions and Future work In this manuscript, we formulate the notion of observability of systems over finite alphabets in the sense of how well the output of the system could be estimated based on past input and output information. We characterize this proposed notion by deriving both necessary and sufficient conditions of observability in terms of system parameters. For system (3), such conditions involve both the dynamics of the underlying LTI system and the discontinuous points of the quantizer. Regarding future directions, we are interested in investigating the case when d(A, B) = 0 and A ∩ B = ∅. We also want to pursue a sufficient condition of weak output observability that is weaker than the proposed sufficient conditions of finite memory output observability. References [1] D. C. Tarraf, A. Megretski, and M. A. Dahleh, “A framework for robust stability of systems over finite alphabets,” IEEE Transactions on Automatic Control, vol. 53, no. 5, pp. 1133–1146, 2008. [2] D. C. Tarraf, “A control-oriented notion of finite state approximation,” IEEE Transactions on Automatic Control, vol. 57, no. 12, pp. 3197–3202, 2012. [3] D. C. Tarraf, “Finite approximations of switched homogeneous systems for controller synthesis,” IEEE Transactions on Automatic Control, vol. 59, no. 5, pp. 1140–1145, 2011. [4] J. P. Hespanha, Linear Systems Theory. Princeton University Press, 2009. [5] R. Hermann and A. J. Krener, “Nonlinear controllability and observability,” IEEE Transactions on Automatic Control, vol. 22, no. 5, pp. 728–740, 1977. [6] A. Balluchi, L. Benvenuti, M. D. Di Benedetto, and A. L. Sangiovanni-Vincentelli, “Observability for hybrid systems,” in Proceedings of the 42nd IEEE Conference on Decision and Control, (Maui, HI), pp. 1159–1164, 2003. [7] A. Tanwani, H. Shim, and D. Liberzon, “Observability for switched linear systems: Characterization and observer design,” IEEE Transactions on Automatic Control, vol. 58, no. 4, pp. 891–904, 2013. [8] G. Xie and L. Wang, “Necessary and sufficient conditions for controllability and observability of switched impulsive control systems,” IEEE Transactions on Automatic Control, vol. 49, no. 6, pp. 960–966, 2004. [9] D. F. Delchamps, “Extracting state information from a quantized output record,” Systems & Control Letters, vol. 13, pp. 365–372, 1989. [10] J. Sur and B. Paden, “Observers for linear systems with quantized outputs,” in Procedings of the American Control Conference, (Albuquerque, NM), pp. 3012–3016, 1997. [11] J. Raisch, “Controllability and observability of simple hybrid control systems-FDLTI plants with symbolic measurements and quantized control inputs,” in International Conference on Control’94, vol. 1, (Coventry, UK), pp. 595–600, 1994. [12] S. Yüksel and T. Başar, “Communication constraints for decentralized stabilizability with time-invariant policies,” IEEE Transactions on Automatic Control, vol. 52, no. 6, pp. 1060–1066, 2007. [13] S. Yüksel and T. Başar, “Minimum rate coding for lti systems over noiseless channels,” IEEE Transactions on Automatic Control, vol. 51, no. 12, pp. 1878–1887, 2006. 25 [14] D. Fan and D. C. Tarraf, “On finite memory observability of a class of systems over finite alphabets with linear dynamics,” in Proceedings of the 53rd IEEE Conference on Decision and Control, (Los Angeles, CA), pp. 3884–3891, 2014. [15] D. Delvecchio, R. M. Murray, and E. Klavins, “Discrete state estimators for systems on a lattice,” Automatica, vol. 42, no. 2, pp. 271–285, 2006. [16] R. Ehlers and U. Topcu, “Estimator-based reactive synthesis under incomplete information,” in Proceedings of the 18th International Conference on Hybrid Systems: Computation and Control, (Seattle, WA), pp. 249–258, 2015. [17] O. Mickelin, N. Ozay, and R. M. Murray, “Synthesis of correct-by-construction control protocols for hybrid systems using partial state information,” in Proceedings of the American Control Conference, 2014, (Portland, OR), pp. 2305–2311, 2014. [18] D. C. Tarraf, “An input-output construction of finite state ρ/µ approximations for control design,” IEEE Transactions on Automatic Control, Special Issue on Control of Cyber-Physical Systems, vol. 59, no. 12, pp. 3164–3177, 2014. [19] N. L. Carothers, Real Analysis. Cambridge University Press, 1999. [20] H. K. Khalil, Nonlinear Systems. Prentice Hall, 2002. [21] R. A. Horn and C. R. Johnson, Matrix Analysis. Cambridge University Press, 1990. [22] R. Bronson, Matrix Methods: An Introduction. Academic Press, 2014. [23] W. K. Nicholson, Introduction to Abstract Algebra. Wiley, 2012. 26
3cs.SY
On the Modeling and Performance Assessment of Random Access with SIC arXiv:1801.06357v1 [cs.IT] 19 Jan 2018 Alberto Mengali, Riccardo De Gaudenzi, Senior Member, IEEE, Čedomir Stefanović, Senior Member, IEEE Abstract—In this paper, we review the key figures of merit to assess the performance of advanced random access (RA) schemes exploiting physical layer coding, repetitions and collision resolution techniques. We then investigate RA modeling aspects and their impact on the figures of merit for the exemplary advanced RA schemes: Contention Resolution Diversity Slotted ALOHA (CRDSA), Irregular Repetition Slotted ALOHA (IRSA), Coded Slotted ALOHA (CSA) and Enhanced Spread-Spectrum ALOHA (E-SSA). We show that typical simplifications of the reception model when used to optimize RA schemes lead to inaccurate findings, both in terms of parameter optimization and figures of merit, such as the packet loss ratio (PLR) and throughput. We also derive a generic RA energy efficiency model able to compare the schemes in terms of the energy required to transmit a packet. The combination of achievable RA throughput at the target PLR and energy efficiency, for the same average user power investment per frame and occupied bandwidth, shows that E-SSA, which is an unslotted scheme, provides the best overall performance, while, in terms of the slotted schemes, CRDSA outperforms the more elaborated IRSA and CSA. This surprising results is due to the fact that the IRSA and CSA optimization has so far been performed using RA channel models that are not accurately reflecting the physical layer receiver behavior. We conclude by providing insights on how to include more accurate reception models in the IRSA and CSA design and optimization. Keywords: Multiaccess communication, Satellite communication, Packet radio, Radio communication, Digital communications. I. I NTRODUCTION AND M OTIVATION Recent years have witnessed a strong interest in Machineto Machine (M2M) communications, i.e., communications among devices without or with minimal human intervention. Examples of M2M services include security, tracking, payment, smart grid and remote devices’ maintenance and monitoring. M2M communication is a key enabler of the Internet of Things (IoT), where the central challenges are related to device energy efficiency and network scalability [1], [2]. Specifically, in relation to the latter, M2M scenarios often involve a large number of devices, where random subsets of A. Mengali is with University of Luxembourg, Interdisciplinary Centre for Security, Reliability and Trust, 4, rue Alphonse Weicker L-2721 Luxembourg; R. De Gaudenzi is with European Space Agency, Keplerlaan 1, 2200 AG Noordwijk, The Netherlands; Č. Stefanović is with the Department of Electronic Systems, Aalborg University (Copenhagen campus) Fredrikskaj 12, 2450 Copenhagen, Denmark. e-mail: {[email protected], [email protected],[email protected]}. The work of Č. Stefanović was supported in part by the European Research Council (ERC Consolidator Grant Nr. 648382 WILLOW) in the Horizon 2020 Program. The work from A. Mengali was in part supported by the National Research Fund, Luxembourg under AFR grant for Ph.D. project (Reference 10064089) on Reliable Communication Techniques for Future Generation Satellite Systems. devices become activated at a time and access the network in an uncoordinated manner. This has revamped the interest in research on Random Access (RA) schemes applicable to ground and space wireless systems. In the scenarios involving M2M communications with satellites, the set of M2M devices within a satellite coverage can be vast, which calls for new designs of RA schemes. It has been shown that the adoption of relatively simple Successive Interference Cancellation (SIC) techniques makes it possible to achieve huge RA throughput performance improvements. An extensive survey of this kind of RA schemes in the context of satellite communications can be found in [3]. In general, RA schemes with SIC application is not confined to satellite systems. We refer the interested reader for an overview of slotted ALOHA with SIC [4], which establishes analogies with codes-on-graphs, as well as to some recent results presented in [5], [6]. The performance assessment of RA schemes is usually performed using simplified models of the physical layer (PHY) reception, where de facto standards are the collision-channel model and the threshold-based model. Although these models enable elegant analytical treatment and optimization of RA schemes with SIC, as shown in [7], they often lead to unreliable performance assessment. This insight calls for the use of an accurate methodology for performance assessment, such that emerging RA schemes with SIC can be compared in a fair and realistic way, which is the main motivation of this paper. Specifically, in this paper, we assess the performance of the exemplary high-performing RA schemes with SIC, namely Contention Resolution Diversity Slotted ALOHA (CRDSA) [8], Irregular Repetition Slotted ALOHA (IRSA) [9], Coded Slotted ALOHA (CSA) [10] and Enhanced Spread-Spectrum ALOHA (E-SSA) [11], using the collision-channel model, the threshold-based model, and an accurate, semi-analytical (SEA) model of the PHY-layer receiver processing. We show that the simplified models are indeed inadequate to capture the particularities of PHY-layer processing. Instead, the use of the collision channel model provides rather inaccurate results, while the threshold-based model, even with a careful identification of the threshold value (that depends on the parameters of PHY layer), has only a limited applicability. Another distinguishing feature of the paper is that the presented performance assessment deals with both the arrivals with constant number of users and with Poisson arrivals. While the former model is standardly used in literature on RA schemes with SIC, the latter is more appropriate to model periodic reporting in M2M services. In this regard, we 2 show that the arrival model leaves its mark on the scheme performance. The rest of the paper is organized as follows. Sec. II provides a brief introduction to the RA schemes with SIC investigated in the paper. Sec. III describes the key RA parameters and figures of merit that will be used, Sec. IV describes specific RA modeling aspects that are relevant for the performance assessment. In Sec. V, RA performance results based on simplified reception models are compared to the ones obtained with a substantially more accurate physical layer modeling, including an overall comparison in terms of normalized throughput and energy efficiency. Finally, Sec. VI provides recommendations based on lessons learned to guide future research work. II. ALOHA PROTOCOLS WITH S UCCESSIVE I NTERFERENCE C ANCELLATION CRDSA, IRSA and CSA belong to the class of framed slotted ALOHA schemes [12], where the MAC-layer frame1 consists of a fixed number of slots. In CRDSA [8], each user transmits a fixed number of physical-layer replicas of its data packet in independently and randomly selected slots of the frame. Each replica contains in the header information about the location of all other related replicas2 . Hence, a successful decoding of a replica enables removal (i.e., cancellation) of all the other replicas of the packet from the slots in which they occur, which helps the demodulator to decode new packets (i.e., their replicas) from the affected slots. IRSA represents a generalization of CRDSA, characterized by a random number of transmitted replicas per user. The number of replicas is selected according to a probability mass function (pmf) that is optimized off line and common to all users. The basic idea of CSA is to transmit encoded segments of data packets, instead of transmitting their replicas. Specifically, a data packet that is about to be transmitted in a frame is divided into k packet segments. The k packet segments are then encoded via a segment-oriented binary linear block code that generates nh encoded segments, where the employed code is drawn randomly by the user from a finite set of codes. At the receiver side, successful decoding of any subset of k independent segments enables the recovery of the whole data packet, as well as removal of the rest of the segments via interference cancellation. IRSA may be seen as a special case of CSA where k = 1 and each block code is a repetition code. E-SSA is an unslotted (i.e., pure) ALOHA-based RA scheme in which packets are coded, modulated, spread and transmitted asynchronously at the same carrier frequency without any repetition and coordination. Collisions are resolved by means of SIC that exploits Direct-Sequence Spread-Spectrum (DS-SS) techniques to decorrelate the colliding packets. III. RA F IGURES OF M ERIT In order to provide a fair comparison, we assume that the occupied bandwidth per frame is the same for all RA 1 Later on referred for simplicity as frame. principle, this information can be agreed in advance through, e.g., a shared seed for a random number generator. 2 In schemes under consideration. We also assume that the average transmission power per packet replica over the frame P f is the same for all considered RA schemes. All the schemes under consideration use a common fixed-length frame duration τf . In CRDSA and IRSA, a frame is composed of Nslots slots, where each slot fits a packet transmission, and all users are slot-synchronized. A user sends Nrep packet replicas, Nrep ≤ Nslots , in randomly selected slots. For CRDSA, Nrep is fixed, while for IRSA Nrep can vary on the user basis and we denote by N rep the average number of replicas sent per user. In CSA, a user sends encoded segments in randomly chosen slices of the frame. The relation between slices in CSA and slots in CRDSA/IRSA can be easily established: as the size of the segment is k times shorter than the size of the packet (see Section II), this implies that there are kNslots slices in CSA. The number of transmitted encoded segments in CSA is nh , where nh can vary on user basis. Thus, in CSA, a user effectively transmits Nrep = nkh packets in the frame, and the average number of transmitted replicas is N rep = nkh . In E-SSA there are no slots, as the packet is occupying the whole frame duration, thus, Nslots = 1, and there is no frame synchronization, i.e., frame references are user specific. Further, there are no distinct repetitions of the physical layer packet as in CRDSA and IRSA, but the packet symbols are repeated through spreading, which is accounted for through a spreading factor SF > 1. Thus, Nrep = 1 and a user packet is sent during the whole duration of the user frame. We continue by the definition and justification of the key RA figures of merit adopted in the paper. In Appendix D of [13], it was shown that, assuming the packets are generated according to a Poisson distribution, the aggregate traffic (over all users and slots) mean data packet arrival rate per frame λftot can be computed as λftot = Nslot G Gp , (1) where G is the MAC load expressed in data bits/symbol in non-SS systems and bits/chip in SS systems, and where Gp is the processing gain, defined as the ratio between the chip rate Rc expressed in chips/s3 and the effective data bit rate Rb during transmission, given by Gp = 1 Rc = ∗ , Rb r log2 M (2) where r∗ = r/SF, r being the Forward Error Correction (FEC) code rate, SF is the spreading factor (if applicable) and M is the modulation cardinality. In (2), we assume that the spreading corresponds to repetition coding with rate 1/SF concatenated to the FEC. Recall that, in time slotted RA schemes, the frame duration is divided in Nslots over which packets are transmitted. Thus, the data packet bit rate averaged over the frame duration is simply given by Rb . (3) [Rb ]f = Nslots 3 In the following, we use the general term chip which is typical of spreadspectrum (SS) systems. Clearly, for non SS RA schemes, i.e., when SF = 1, the chip correspond to the symbol and the chip rate to the baud rate. 3 1) Occupied Bandwidth: Following (2) and (3), the RA scheme occupied bandwidth, i.e., the signaling rate is given by Rc = Rb Gp = [Rb ]f Gp Nslots . (4) Specializing (4) to the case of slotted non SS and unslotted SS RA schemes we get Rc = [Rb ]f Nslots . r∗ log2 M (5) From (5), it is evident that, if we want to transmit the same average bit rate over the RA frame having the same time duration and occupying the same bandwidth, we should ensure slots that the quantity r N log2 M for slotted non SS RA has the same SF for an unslotted SS scheme. For the case of value as r log 2M CRDSA, the preferred values are M = 4 and r = 1/3 [13], while for E-SSA M = 2 and r = 1/3 [11]. Thus, for a fair comparison between E-SSA and CRDSA, we should assume SF = Nslots /2. This finding shows that the number of slots are expanding the RA scheme occupied bandwidth similarly to the spreading in a SS scheme. A. MAC Normalized Load In general, the RA traffic is bursty and the instantaneous MAC load is thus a random variable (rv). Once the traffic model has been defined, the MAC load can be characterized by its average value. Following (1), the average normalized MAC load expressed in bits/symbol (or bits/chip in case of SS RA) is computed as G= λftot . Gp Nslot (6) C. MAC Normalized Throughput The normalized throughput T represents the spectral efficiency of the RA scheme at given average MAC load G and is expressed in the same unit as G. The normalized throughput is related to the PLR through the following simple equation [13] T (G) = G · [1 − PLR(G)] . (7) D. Energy Efficiency The energy efficiency of a RA scheme is of paramount importance, since the devices in M2M applications are often operated with battery or solar based energy supply. We define the energy efficiency ψe (bits/Joule) as the ratio between the average number of data bits [Nb ]f successfully transfered by a user in a frame and the energy Ef required to transmit them. Analytically, this can be expressed as [Nb ]f . Ef Ef = P f N rep τf . (9) The normalized throughput is then related to the average number of data bits successfully transmitted in a frame divided by the signaling rate and the frame duration. This can be expressed as λf (G) [Nb ]f . (10) T (G) = tot τf Rc Now, replacing(10) and (9) in (8), we obtain ψe = T (G)Rc N rep λftot P f = ψen · Rc , Pf (11) where we exploit the definition of the normalized energy efficiency ψen , which is the energy efficiency divided by Rc /P f , previously assumed constant for comparison fairness. This assumption makes the comparison between different schemes dependent on the normalized efficiency only. In practice, the RA scheme is typically operated at PLR < 10−2 to minimize retransmissions and to ensure stability. Thus, in deriving ψe we will consider the average MAC load G∗ corresponding to a PLR∗ = 10−3 . Following (7), it is clear that T (G∗ ) ≃ G∗ for the selected PLR∗ value. By taking all the previous approximations into account, exploiting (1) and (3), the normalized energy efficiency can be approximated as ψen ≈ 1 r log2 M = , N rep Nslot Gp N rep Nslot SF (12) where in the final formulation of ψen we simply exploited (2). IV. M ODELING A SPECTS B. Packet Loss The Packet Loss Ratio (PLR) is defined as the ratio between the number of incorrectly decoded packets and the total number of data packets sent at media access control level. The PLR depends on the MAC average load G. ψe = The energy required to transmit the [Nb ]f bits over the frame can be expressed as (8) A. Traffic Models The simplest traffic model is the one in which the load on the frame basis is constant, allowing for straightforward optimization of the RA scheme. A more accurate model is the one that assumes Poisson distribution of the load on the frame basis, which also implies, for slotted schemes, a Poisson distribution of the load at slot level (the proof is presented in Appendix A). This is in line with the recommendations of the 3rd Generation Partnership Project (3GPP) for asynchronously reporting M2M traffic [14]. In scenarios in which devices access the network in a highly synchronized manner, 3GPP suggests using a traffic model based on beta distribution. In the following, we will focus on the case of asynchronous arrivals, typical for massive M2M services, and compare the impacts of Poisson distributed load and constant load on the performance. An investigation about the impact of the RA scheme and physical layer parameters on the traffic probability distribution normalized to the Poisson distribution mean value has been reported in [15]. The conclusion is that the instantaneous number of interfering packets will fluctuate less, in proportion to its average, when λftot increases. Recalling (1), it is evident that for a given average load G, λftot is directly proportional to the number of slots in the frame (if applicable), the spreading factor (if applicable) and inversely proportional to the physical layer spectral efficiency (r log2 M ). As an example, a RA 4 scheme exploiting spread-spectrum with SF ≫ 1, experiences less interference fluctuation normalized to its average value than a non spread-spectrum RA scheme. Thus, as shown in Fig. 2 of [15], the demodulator should be designed to cope with a worst-case level of interference that is close to its average value and proportional to λftot . Instead, in a non spread-spectrum RA, the demodulator should cope with worstcase interference levels which are proportional to about 3λftot . B. Packets’ Power Unbalance Practical systems often face a random distribution of the received packets’ power. This is because path loss, antenna gain (for both transmitter and receiver) and channel propagation conditions are typically different for the different packets. Closed-loop power control should be avoided in satellite M2M systems to minimize the transmission time and the signaling overhead. Some systems, characterized by a two-way terminal communication capability, may implement a simpler open-loop power control to enhance the system throughput performance. For CRDSA and E-SSA this aspect has been investigated in [7], [13] and [11], [16], respectively. For both schemes, it has been found that packets power randomization following a uniform distribution in dB represents a close to optimum way to increase the RA throughput. The minimum incoming packet power level should be selected to make the packet decodable in the absence of collisions, while the maximum power level depends on the available transmitter power and system link budget. References [16], [17] show how this close-to-optimum received packets’ power distribution can be obtained with a simple open-loop power control algorithm. C. Modeling of Physical Layer Reception 1) Collision Model: A typical model of PHY-layer reception assumed in the literature on ALOHA-based schemes is the collision channel model, cf. [12]. According to this model, all packets involved in a collision are lost, and packets that do not experience collisions are always successfully decoded. In reality, this approximate model does not hold when: (i) received powers of the packets are not the same, (ii) powerful FEC code is used, (iii) when DS-SS is adopted. In the first case, the colliding packet that has the highest power may still have a Signal-to-Noise plus Interference Ratio (SNIR) sufficient to be decoded. This is often referred to as capture effect. In the second case, if a Turbo or Low Density Parity Check (LDPC) FEC with a low code rate (e.g., 1/3) and Binary or Quaternary Phase Shift Keying (BPSK/QPSK) modulation are used, the demodulator might still be able to resolve collisions of cardinality 2 at physical layer level4 . In the third case, all the packets involved in collisions whose cardinalities are up to the SF are inherently accepted by the system, i.e., the use of spreading enables multi-packet reception. 2) Threshold-based Model: Another frequently used model is the threshold-based reception model, which assumes that a received packet subject to collisions can be decoded with probability 1 if its SNIR is above a given threshold ρFEC , and 4 By cardinality, we denote the number users/replicas involved in a collision. decoded with probability 0 if the SNIR is below, cf. [18], [19]. The threshold-based reception model attempts to incorporate the aspects outlined above through a single parameter - the value of the threshold, which is unsuitable for the scenarios pertaining to satellite communications. Specifically, as elaborated [7], [11], [13], the decoding probability depends on the physical layer characteristics and does not exhibit an abrupt transition from 0 to 1 as function of SNIR, as the threshold-based model suggests. Moreover, as shown in the following section, the results obtained with a simple thresholdbased reception model heavily depend on the choice of the ρFEC value, and finding the right value of ρFEC that models appropriately the physical layer operation is not an easy task. In summary, the preferred approach to analyze the performance of RA schemes in satellite communications seems to be resorting to the accurate simulation of the physical layer, thus including the actual modulation and coding scheme. 3) Semi-Analytical Model: To speed-up simulations, semianalytical (SEA) models can be adopted [7], [11], [13]. The SEA approach is representing the iterative RA demodulator operation in the presence of a given packets traffic and power distribution. SEA models approximate the colliding packets as as an Additive White Gaussian (AWGN) process, which is on top of the thermal noise. Furthermore, the logarithmic packet-error performance of PHY layer (i.e., of the coding and modulation scheme) in presence of AWGN noise is fitted by a polynomial function. In the following, for the accurate PHY model we refer to the one described in [7] for CRDSA, IRSA and CSA and the one reported in Sect. III.A of [11] for E-SSA. Their accuracy has been validated through extensive comparison with the results of Monte Carlo simulations of the full PHY-layer processing. For E-SSA, as the SEA results are not as accurate as for the other RA schemes, we also provide results with the Monte Carlo physical layer simulation approach described in Sect. III.D of [11]. V. P ERFORMANCE C OMPARISON In this section, we assess the performance of CRDSA, IRSA, CSA and E-SSA schemes using the traffic and PHYlayer reception models described in the previous section. A. CRDSA 1) Constant vs Poisson Traffic: We first investigate the impact of Poisson distributed versus constant aggregate load for CRDSA with 2, 3, and 4 replicas, using the accurate semi-analytical PHY model and limiting the number of SIC iteration at the demodulator to Niter = 20. Results are shown in Fig. 1, where the difference between the two traffic models is clear from the PLR waterfall region. As expected, following Sec. IV-A, the throughput results for Poisson traffic model with the same average normalized load G are worse than for the constant traffic, due to the presence of load peaks which negatively affect the demodulator performance. For 3 replicas at PLR = 10−3 , the throughput loss corresponds to about 15 %. To provide realistic results, in the following we will use the model with Poisson traffic, which is also more conservative in terms of performance. 5 1 model results, the results for r = 1/2 show that a match is not achievable. This result can be explained by the fact that, for Es /N0 = 10 dB, a packet employing QPSK modulation and the 3GPP FEC code with r = 1/2 has a low but non-negligible probability of being correctly decoded when experiencing a collision of cardinality 2. This makes the collision channel slightly pessimistic and the threshold model with ρFEC = −2 dB too optimistic CRDSA 2 replicas, Poisson Traffic CRDSA 2 replicas, Constant Traffic CRDSA 3 replicas, Poisson Traffic CRDSA 3 replicas, Constant Traffic CRDSA 4 replicas, Poisson Traffic CRDSA 4 replicas, Constant Traffic 0.9 0.8 Throughput - T [bits/symbols] 0.7 0.6 0.5 0.4 0.3 0.2 1.4 CRDSA 2 repl, r=1/3, P.M. CRDSA 2 repl, r=1/3, C.M. CRDSA 2 repl, r=1/3, T.M. 0.1 1.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 CRDSA 3 repl, r=1/3, P.M. CRDSA 3 repl, r=1/3, C.M. CRDSA 3 repl, r=1/3, T.M. 1.5 Average MAC Load - G [bits/symbols] 1 Throughput - T [bits/symbols] (a) Throughput 100 10-1 FEC FEC = -2 dB = -2 dB = -2 dB 0.8 0.6 0.4 10-2 Packet Loss Ratio - PLR CRDSA 3 repl, r=1/2, P.M. CRDSA 3 repl, r=1/2, C.M. CRDSA 3 repl, r=1/2, T.M. FEC 0.2 10-3 0 0 0.1 0.2 0.3 0.4 0.5 10-4 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 (a) Throughput CRDSA 2 replicas, Poisson Traffic CRDSA 2 replicas, Constant Traffic CRDSA 3 replicas, Poisson Traffic CRDSA 3 replicas, Constant Traffic CRDSA 4 replicas, Poisson Traffic CRDSA 4 replicas, Constant Traffic 10-5 10-6 0.6 Average MAC Load - G [bits/symbols] 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 100 10-1 1.5 Average MAC Load - G [bits/symbols] (b) PLR Packet Loss Ratio - PLR Fig. 1. Comparison of simulated CRDSA throughput and PLR with Poisson and constant traffic as a function of the average load G for 2, 3 and 4 replicas; accurate PHY model, r = 1/3 FEC, QPSK modulation, Nslots = 128, Niter = 20, Es /N0 = 10 dB. 10-2 10-3 CRDSA 2 repl, r=1/3, P.M. CRDSA 2 repl, r=1/3, C.M. CRDSA 2 repl, r=1/3, T.M. FEC= -2 dB CRDSA 3 repl, r=1/3, P.M. CRDSA 3 repl, r=1/3, C.M. CRDSA 3 repl, r=1/3, T.M. FEC= -2 dB 10-4 10-5 2) Simple Reception Models vs Accurate PHY Model: We now investigate the difference between the accurate PHY model and the collision channel model/threshold-based model described in Sec. IV-C for the 3GPP turbo FEC with rates 1/3 and 1/2 [20]. It is worth mentioning that in the case of equi-powered packets, there is a finite number of possible SNIR values. The SNIR that each packet is subject to is in fact uniquely identified by the system Es /N0 and by the cardinality of the collision experienced by the packet. For example, when Es /N0 = 10 dB, the SNIR of a packet s = involved in a collision of cardinality 2 is SNIR2 = EsE+N 0 −0.41 dB, while the equivalent SNIR of a packet in a s = −3.22 dB. collision of cardinality 3 is SNIR3 = 2EsE+N 0 A simple reasoning reveals that, when Es /N0 = 10 dB, if ρFEC > −0.41 dB, the threshold-based model becomes equivalent to the collision channel model. Similarly, when −3.22 dB < ρFEC < −0.41 dB, the threshold-based reception model always resolves collisions of up to cardinality 2. The results comparing these simplified models with the accurate one for CRDSA with 2, 3 replicas and FEC rates 1/2 and 1/3 are presented in Fig. 2. To avoid excessive clutter in the legends, in this figure and in the following ones, we will use ‘P.M.’, ‘C.M.’ and ‘T.M.’ to represent the accurate PHY model, collision channel model and threshold-based reception model, respectively. While for r = 1/3, the threshold-based model seems to give a fairly accurate match with the accurate PHY CRDSA 3 repl, r=1/2, P.M. CRDSA 3 repl, r=1/2, C.M. CRDSA 3 repl, r=1/2, T.M. FEC= -2 dB 10-6 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 Average MAC Load - G [bits/symbols] (b) PLR Fig. 2. Comparison of simulated CRDSA throughput and PLR with Poisson traffic, as a function of the average load G for 2 and 3 replicas; collision model (C.M.), threshold-based (T.M.) model with ρFEC = −2 dB and accurate PHY model (P.M.), r = 1/3 and r = 1/2 FEC, QPSK modulation, Nslots = 128, Niter = 20, Es /N0 = 10 dB. To further highlight the dependency on the system parameters of the match between threshold-based and accurate PHY models, results comparing these two models for values of Es /N0 ∈ {4, 6, 10} dB are shown in Fig. 3 for CRDSA with 2 and 3 replicas using FEC rates 1/2 and 1/3. To reduce the number of lines in the plot, for each FEC rate, only the curve relative to the simplified model providing the closest match and the two most significant Es /N0 have been retained. It is important to note that the selected threshold value (ρFEC = −2 dB) always corresponds to resolution of cardinality-2 collisions for all the considered Es /N0 values, hence the omission of a specific Es /N0 value in the legend. For r = 1/3, results with Es /N0 = 10 dB are shown in Fig. 2 and almost equivalent to the ones with Es /N0 = 6 dB and are therefore not reported. We can observe that when Es /N0 = 4 dB, the difference between threshold-based and accurate PHY model is increasing. This is probably due to a 6 1.2 CRDSA 3 repl, P.M. CRDSA 3 repl, T.M. CRDSA 3 repl, T.M. 1 1 FEC FEC FEC FEC = 1 dB = 0 dB = -1 dB = -2 dB 0.8 0.6 0.4 0.2 CRDSA 2 repl, r=1/3, P.M., Es /N0 =4 dB CRDSA 2 repl, r=1/3, P.M., E /N =6 dB s 0.9 CRDSA 2 repl, r=1/3, T.M. FEC 0 = -2 dB CRDSA 3 repl, r=1/3, P.M., Es /N0 =4 dB 0.8 0 0 CRDSA 3 repl, r=1/3, P.M., Es /N0 =6 dB CRDSA 3 repl, r=1/3, T.M. 0.7 Throughput - T [bits/symbols] CRDSA 3 repl, T.M. CRDSA 3 repl, T.M. Throughput - T [bits/symbols] higher probability of error in the case of cardinality-2 collision that is not correctly represented by the threshold-based model. On the contrary, for r = 1/2, when Es /N0 is reduced from 10 dB to 6 dB (results for Es /N0 = 4 dB were almost equivalent to the ones with Es /N0 = 6 dB), every collision becomes unresolvable and, differently from Fig. 2, the accurate PHY model results closely follows the collision model ones. 0.1 0.2 0.3 0.4 0.5 CRDSA 3 repl, r=1/2, P.M., Es /N0 =6 dB 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 (a) Throughput CRDSA 3 repl, r=1/2, P.M., Es /N0 =10 dB 0.6 0.6 Average MAC Load - G [bits/symbols] = -2 dB FEC 100 CRDSA 3 repl, r=1/2, C.M. 0.5 10-1 0.4 0.3 0.1 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 Average MAC Load - G [bits/symbols] Packet Loss Ratio - PLR 10-2 0.2 10-3 10-4 (a) Throughput 100 CRDSA 3 repl, P.M. CRDSA 3 repl, T.M. FEC= 1 dB CRDSA 3 repl, T.M. FEC= 0 dB 10-5 CRDSA 3 repl, T.M. FEC= -1 dB CRDSA 3 repl, T.M. FEC= -2 dB 10-1 10-6 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 Average MAC Load - G [bits/symbols] (b) PLR Packet Loss Ratio - PLR 10-2 Fig. 4. Comparison of simulated CRDSA throughput and PLR with Poisson traffic, as a function of the average load G for 3 replicas; threshold-based model (T.M.) versus accurate PHY model (P.M.), r = 1/3 FEC, QPSK modulation, Nslots = 128, Niter = 20, Eb /N0 uniformly distributed between 2 and 9 dB. 10-3 CRDSA 2 repl, r=1/3, P.M., Es /N0 =4 dB CRDSA 2 repl, r=1/3, P.M., Es /N0 =6 dB CRDSA 2 repl, r=1/3, T.M. FEC= -2 dB CRDSA 3 repl, r=1/3, P.M., Es /N0 =4 dB 10-4 CRDSA 3 repl, r=1/3, P.M., Es /N0 =6 dB CRDSA 3 repl, r=1/3, T.M. FEC= -2 dB CRDSA 3 repl, r=1/2, P.M., Es /N0 =6 dB 10-5 CRDSA 3 repl, r=1/2, P.M., Es /N0 =10 dB CRDSA 3 repl, r=1/2, C.M. 10-6 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 Average MAC Load - G [bits/symbols] (b) PLR Fig. 3. Comparison of simulated CRDSA throughput and PLR with Poisson traffic, as a function of the average load G for 2 and 3 replicas; QPSK modulation, Nslots = 128, Niter = 20. Results with r = 1/3 FEC are shown for accurate PHY model (P.M.) with Es /N0 ∈ {4, 6} dB and compared against threshold-based model (T.M.) with ρFEC = −2 dB. Results with r = 1/2 FEC are shown for accurate PHY model with Es /N0 ∈ {6, 10} dB and compared against collision model (C.M.). The impact of non-equal, uniform in dB distribution of the received packets power on the threshold-based model with FEC rate r = 1/3 is shown in Fig. 4. As there is no analytical approach at hand to determine the right threshold value to be used, and in the power unbalanced case thresholds are not directly related to collision cardinalities, we resorted to the tedious trial and error approach to find the value of ρFEC that best matches the characteristics of the accurate PHY model. Obviously, while ρFEC = −2 dB still provides the closest results to ones obtained via the accurate PHY model, its accuracy is diminished, compared to the scenario with equal powers of received packets shown in Fig. 4. In conclusion, it can be stated that the performance results obtained with the collision channel model are very inaccurate in the considered scenarios. The threshold-based model can provide good prediction of CRDSA performance only if the correct threshold value is found for each specific scenario (e.g. FEC code rate 1/3, equal packet power level, Es /N0 ≥ 6 dB). In other words, the threshold-based model has to be used with caution. B. IRSA We now introduce results obtained through our simulator using the IRSA scheme originally proposed in [9], with the following pmfs of the number of replicas transmitted by user: 2 3 • the scheme with pmf Γ3 (x) = 0.5x + 0.28x + 8 5 0.22x [9], denoted by IRSA-1; 2 3 8 • the scheme with Γ4 (x) = 0.25x + 0.6x + 0.15x [9], denoted by IRSA-2; 3 8 • the scheme from with Γ5 (x) = 0.87x + 0.13x [21], denoted by IRSA-3. We will focus on the variant with FEC of r = 1/3, as it outperforms the variant with r = 1/2 [7]. 1) Constant vs Poisson Traffic: Similarly to CRDSA, the performance of IRSA for constant traffic model is better than for Poisson traffic model, for the same value of the average normalized load. Fig. 5 shows that, for Poisson traffic, the 5 We use the standard polynomial notation, in which the power of a term denotes the number of replicas and the coefficient of the same term the probability of transmitting that many replicas. 7 1.4 throughput at PLR = 10−3 is about 13 % worse than for constant traffic. In the following, we use a more realistic Poisson traffic model. IRSA-2, r=1/3, P.M. IRSA-2, r=1/3, C.M. IRSA-2, r=1/3, T.M. 1.2 IRSA-2, r=1/2, P.M. IRSA-2, r=1/2, C.M. IRSA-2, r=1/2, T.M. Throughput - T [bits/symbols] 1 100 10-1 Packet Loss Ratio - PLR 10 FEC FEC = -2 dB = -2 dB 0.8 0.6 -2 0.4 0.2 10-3 0 0 10-4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1 1.1 1.2 1.3 1.4 1.5 Average MAC Load - G [bits/symbols] IRSA-1, Poisson Traffic IRSA-1, Constant Traffic IRSA-2, Poisson Traffic IRSA-2, Constant Traffic IRSA-3, Poisson Traffic IRSA-3, Constant Traffic 10-5 10-6 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 (a) Throughput 100 1.5 10-1 Average MAC Load - G [bits/symbols] 10-2 Packet Loss Ratio - PLR Fig. 5. Comparison of simulated IRSA-1/2/3 throughput and PLR with Poisson and constant traffic, as a function of the average load G; accurate PHY model, r = 1/3 FEC, QPSK modulation, Nslots = 128, Niter = 20, Es /N0 = 10 dB. 10-3 10-4 2) Simple Reception Models vs Accurate PHY Model: As for CRDSA, we now investigate the difference between the accurate PHY model and the simplified models described in Sec. IV-C. The results for IRSA-2 with FEC code rate 1/2 and 1/3 are presented in Fig. 6; obviously, there is a trend similar to the results presented for CRDSA. For FEC r = 1/3 and Es /N0 = 10 dB, the collision model gives very pessimistic results, i.e., 260 % lower throughput than PHY model. Simulations of accurate PHY model with r = 1/3 and Es /N0 = 10 dB can be closely matched by the thresholdbased model with ρFEC = −2 dB, but such an approximation could not be achieved for r = 1/2. The results with IRSA-2 with FEC code rate 1/2 and 1/3 comparing accurate PHY and best-matching simplified model with various values of Es /N0 are presented in Fig. 7. Also in this case, we can see a dependency of the match between models on the value of Es /N0 . This is in-line with results obtained for CRDSA and confirms the caution that has to be taken when using simplified reception models. C. CSA We first validated the developed CSA simulator against the results reported in [10]. To do so, we recreated the same simulation conditions of the reference paper; namely constant traffic load (no Poisson) and the simple collision model. The results are not shown in this paper to limit the already significant number of figures, but we note that they closely match the ones reported in [10]6. The details of the CSA scheme simulated, like the used codebooks and the probability of each code being selected, are specified in Table II and Eq. (28) in [10]. 6 It was found that throughput results reported in [10] were actually computed based on the Segment Loss Rate rather than on the PLR, implying that the successfully decoded segments of unsuccessfully decoded packets contribute to the throughput. In contrast, results reported here assume that the throughput corresponds only to the packets fully reconstructed by the demodulator, which is a more realistic approach. IRSA-2, r=1/3, P.M. IRSA-2, r=1/3, C.M. IRSA-2, r=1/3, T.M. FEC = -2 dB IRSA-2, r=1/2, P.M. IRSA-2, r=1/2, C.M. IRSA-2, r=1/2, T.M. FEC = -2 dB 10-5 10-6 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Average MAC Load - G [bits/symbols] (b) PLR Fig. 6. Comparison of simulated IRSA-2 throughput and PLR with Poisson traffic, as a function of the average load G; collision model (C.M.), thresholdbased model (T.M.) with ρFEC = −2 dB and accurate PHY model (P.M.), r = 1/2 and r = 1/3 FEC, QPSK modulation, Nslots = 128, Niter = 20, Es /N0 = 10 dB. 1) Constant vs Poisson Traffic: Fig. 8 shows that for Poisson distributed traffic exploiting the PHY model, the throughput at PLR = 10−3 is about the same than with constant traffic for all three CSA configuration considered. Instead, for PLR ≥ 5 · 10−3 , similarly to the other schemes investigated Poisson traffic gives worst results. In the following, we use the more realistic Poisson traffic model. 2) Simple Reception Models vs Accurate PHY Model: As for CRDSA and IRSA, we now investigate the difference between the accurate PHY model and the simplified reception models described in Sec. IV-C, for the 3GPP turbo FEC with rate r = 1/2 [20] and QPSK modulation. The CSA results, presented in Fig. 9, are clearly pessimistic compared to the findings obtained by the accurate PHY model. To achieve meaningful PLR and throughput results, the need to use the accurate PHY model is evident. At a PLR = 10−3 and for CSA with block-code rate R = 1/3, the collision model gives about 12 % lower throughput estimate than the accurate PHY model. Instead, the threshold model with ρFEC = −2 dB gives a throughput estimate 410 % better than the PHY’s one. The results for CSA with block-code rates R ∈ {1/3, 1/2, 3/5}, comparing collision and accurate PHY model at different values of Es /N0 are presented in Fig. 10. It is clear that the results obtained by collision and threshold models that match the ones obtained by using the accurate PHY model can 8 1.4 0.9 IRSA-2, r=1/3, P.M., Es /N0 =4dB 0.8 s IRSA-2, r=1/3, T.M. FEC 0 1.2 = -2 dB CSA, R=1/2, P.M. CSA, R=1/2, C.M. CSA, R=1/2, T.M. IRSA-2, r=1/2, P.M., Es /N0 =6dB 0.7 IRSA-2, r=1/2, P.M., Es /N0 =10dB 1 IRSA-2, r=1/2, C.M. 0.6 Throughput - T [bits/symbols] Throughput - T [bits/symbols] CSA, R=1/3, P.M. CSA, R=1/3, C.M. CSA, R=1/3, T.M. IRSA-2, r=1/3, P.M., E /N =6dB 0.5 0.4 0.3 CSA, R=3/5, P.M. CSA, R=3/5, C.M. CSA, R=3/5, T.M. FEC FEC FEC = -2 dB = -2 dB = -2 dB 0.8 0.6 0.4 0.2 0.2 0.1 0 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 0 0.1 0.2 0.3 0.4 0.5 Average MAC Load - G [bits/symbols] 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1 1.1 1.2 1.3 1.4 1.5 Average MAC Load - G [bits/symbols] (a) Throughput (a) Throughput 100 100 10-1 10-1 Packet Loss Ratio - PLR Packet Loss Ratio - PLR 10-2 10-3 10-2 CSA, R=1/3, P.M. CSA, R=1/3, C.M. CSA, R=1/3, T.M. FEC= -2 dB CSA, R=1/2, P.M. CSA, R=1/2, C.M. CSA, R=1/2, T.M. FEC= -2 dB 10-4 IRSA-2, r=1/3, P.M., Es /N0 =4dB 10-3 IRSA-2, r=1/3, P.M., Es /N0 =6dB IRSA-2, r=1/3, T.M. FEC= -2 dB IRSA-2, r=1/2, P.M., Es /N0 =6dB 10-5 CSA, R=3/5, P.M. CSA, R=3/5, C.M. CSA, R=3/5, T.M. FEC = -2 dB IRSA-2, r=1/2, P.M., Es /N0 =10dB IRSA-2, r=1/2, C.M. 10-6 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 Average MAC Load - G [bits/symbols] 10-4 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Average MAC Load - G [bits/symbols] (b) PLR (b) PLR Fig. 7. Comparison of simulated IRSA-2 throughput and PLR with Poisson traffic as a function of the average load G; QPSK modulation, Nslots = 128, Niter = 20. Results with r = 1/3 FEC are shown for accurate PHY model (P.M) with Es /N0 ∈ {4, 6} dB and compared against threshold-based model (T.M) with ρFEC = −2 dB. Results with r = 1/2 FEC are shown for accurate PHY model with Es /N0 ∈ {6, 10} dB and compared against collision model (C.M). Fig. 9. Comparison of simulated CSA throughput and PLR with Poisson traffic, as a function of the average load G; collision model (C.M.), thresholdbased model (T.M.) with ρFEC = −2 dB and accurate PHY model (P.M.), r = 1/2 FEC, CSA block-code rate R ∈ {1/3, 1/2, 3/5}, QPSK modulation, Nslots = 128, Niter = 20, Es /N0 = 10 dB. 100 Packet Loss Ratio - PLR 10-1 10-2 10-3 10-4 CSA, R=1/3, Poisson Traffic CSA, R=1/3, Constant Traffic CSA, R=1/2, Poisson Traffic CSA, R=1/2, Constant Traffic CSA, R=3/5, Poisson Traffic CSA, R=3/5, Constant Traffic 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 Average MAC Load - G [bits/symbols] Fig. 8. Comparison of simulated CSA PLR with Poisson and constant traffic, as a function of the average load G; accurate PHY model, r = 1/2 FEC, CSA block-code rate R ∈ {1/3, 1/2, 3/5}, QPSK modulation, Nslots = 128, Niter = 20, Es /N0 = 10 dB. only be achieved at Es /N0 = 6 dB. D. E-SSA 1) Constant vs Poisson Traffic: Fig. 11 shows the simulated E-SSA throughput and PLR with Poisson and constant traffic as a function of the average load G with the accurate PHY model. It is apparent that, thanks to the large level of E-SSA traffic aggregation, there is a negligible difference between the Poisson and the constant traffic models. However, Fig. 11 also shows that at PLR = 10−4 there is a slight PLR performance improvement when using a constant traffic assumption. 2) Threshold-Based Reception Model vs Accurate PHY Model: Fig. 12 compares the simulated E-SSA throughput and PLR with Poisson traffic as a function of the average load G, threshold-based and accurate PHY models. All packets are assumed to be received at the same power and an AWGN channel with Es /N0 = 6 dB has been considered. For the threshold-based model, different threshold values ρFEC have been assumed. It is apparent that the results significantly depend on the selected value of ρFEC . The closest result is obtained for ρFEC = −6 dB and even better matching appears for ρFEC between −5 and −6 dB, which is quite different from CRDSA/IRSA best matching threshold. This is due to the multi-packet reception that is consequence of spreading. For completeness, the SEA results from [11] (Sect. III.A) are also compared to the more accurate PHY layer Monte Carlo simulations obtained following the approach outlined in Sect. III.D of [11]. Fig. 13 shows that, when the optimum randomization of the received packet power (uniform in dB) derived in [16] is introduced, the results obtained with the threshold-based model results are even less accurate. Not 9 0.8 1.4 CSA, R=1/3, P.M., E s /N0 =6 dB 0.7 CSA, R=1/3, C.M. CSA, R=1/2, P.M., E s /N0 =6 dB CSA, R=1/2, P.M., E s /N0 =10 dB Threshold-based model, 0.6 CSA, R=1/2, C.M. CSA, R=3/5, P.M., E s /N0 =6 dB Threshold-based model, 1.2 CSA, R=3/5, P.M., E s /N0 =10 dB 0.5 Threshold-based model, 1 Throughput - T [bits/symbol] Throughput - T [bits/symbols] CSA, R=1/3, P.M., E s /N0 =10 dB CSA, R=3/5, C.M. 0.4 0.3 FEC FEC FEC =-2.3 dB =-5 dB =-6 dB Simplified PHY model from [11], Sect. III.D SEA model from [11], Sect. III.A 0.8 0.6 0.4 0.2 0.2 0.1 0 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 0 0.5 Average MAC Load - G [bits/symbols] 1 1.5 Normalized Load - G [bits/symbol] (a) Throughput (a) Throughput 100 100 10-1 Packet Loss Ratio [PLR] Packet Loss Ratio - PLR 10-1 10-2 CSA, R=1/3, P.M., E s /N0 =6 dB CSA, R=1/3, P.M., E s /N0 =10 dB 10-2 10-3 CSA, R=1/3, C.M. CSA, R=1/2, P.M., E s /N0 =6 dB 10-3 CSA, R=1/2, P.M., E s /N0 =10 dB Threshold-based model, 10-4 CSA, R=1/2, C.M. CSA, R=3/5, P.M., E s /N0 =6 dB Threshold-based model, Threshold-based model, CSA, R=3/5, P.M., E s /N0 =10 dB 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 FEC FEC =-2.3 dB =-5 dB =-6 dB Simplified PHY model from [11], Sect. III.D SEA model from [11], Sect. III.A CSA, R=3/5, C.M. 10-4 FEC 1.5 Average MAC Load - G [bits/symbols] 0 0.2 0.4 0.6 0.8 Normalized Load - G [bits/symbol] 1 1.2 1.4 1.6 (b) PLR (b) PLR Fig. 10. Comparison of simulated CSA throughput and PLR with Poisson traffic, as a function of the average load G; collision model (C.M.) and accurate PHY model (P.M.), r = 1/2 FEC, CSA block-code rate R ∈ {1/3, 1/2, 3/5}, QPSK modulation, Nslots = 128, Niter = 20, Es /N0 = 6, 10 dB. Fig. 12. Comparison of simulated simplified physical model (PHY) and semi-analytical (SEA) E-SSA throughput and PLR with Poisson traffic, as a function of the average load G; threshold-based and accurate PHY models, r = 1/3 FEC, BPSK modulation, SF = 64, Niter = 10, Es /N0 = 6 dB. will provide a good match between the threshold-based and the accurate PHY models in the equi-powered packets’ case is laborious and does not apply to the case of randomized distribution of packets’ powers. 100 Constant traffic Poisson traffic 10-1 Packet Loss Ratio [PLR] 10-2 10-3 10 E. RA Schemes comparison -4 10-5 10-6 0 0.2 0.4 0.6 0.8 Normalized Load - G [bits/chip] 1 1.2 1.4 Fig. 11. Comparison of simulated E-SSA PLR with Poisson and constant traffic, as a function of the average load G; accurate PHY model (P.M.), r = 1/3 FEC, BPSK modulation, SF = 64, Niter = 10, Es /N0 = 6 dB. only the threshold-based model is showing a very optimistic maximum load for PLR = 10−3 , but also the PLR floor present in the PHY model is absent. The origin of the PLR floor with the randomized packets’ power is explained in [16]. This example shows that the threshold-based model can not be used in practice, since the threshold value approximating the real system behavior depends on many system parameters, including the packets power distribution. Summarizing, we have experimentally shown that finding a threshold value that Here we provide a fair comparison of the performance parameters of the schemes under investigation, following Sec. III methodology. The performance comparison exercise has been done for the most accurate model available i.e., the accurate PHY model for CRDSA, IRSA, CSA and the Monte Carlo simulation for E-SSA. To limit the number of cases to be simulated for each slotted RA scheme, we selected the best performing configuration in terms of code rate and number of replicas. For fairness, all schemes share the same 3GPP turbo FEC scheme previously introduced. Following Sec. III, the ESSA spreading factor is half of the number of slots per frame (i.e., SF = 64 while Nslots = 128). To keep the same average packet power per frame as for Sec. III-D, we used results from slotted RA schemes simulations with the same Es /N0 = 6 dB adopted for E-SSA. The corresponding simulation results are summarized in Table I. It appears that E-SSA is outperforming all other schemes both in terms of throughput and energy efficiency at target PLR = 10−3 . The runner-up scheme is CRDSA with 2 replicas and r = 1/3. But its throughput and 10 2.5 2 Simplified PHY model from [11], Sect. III.D Threshold-based model, =-6 dB FEC Throughput - T [bits/symbol] SEA model from [11], Sect. III.A 1.5 • 1 0.5 0 0 0.5 1 1.5 2 2.5 3 • Normalized Load - G [bits/chip] (a) Throughput 100 10-1 • Packet Loss Ratio [PLR] 10-2 • 10-3 10-4 Simplified PHY model from [11], Sect. III.D Threshold-based model, FEC=-6 dB 10-5 SEA model from [11], Sect. III.A 10-6 0 0.5 1 • 1.5 Normalized Load - G [bits/chip] 2 2.5 3 (b) PLR Fig. 13. Comparison of simulated simplified physical model (PHY) and semi-analytical (SEA) E-SSA throughput and PLR with Poisson traffic, as a function of the average load G, threshold-based model and accurate PHY model, r = 1/3 FEC, BPSK modulation, SF = 64, Niter = 10, with uniform distribution in dB in the range [2 - 9] dB. energy efficiency is respectively 29 and 100 % lower than ESSA. In terms of normalized throughput, CSA performs worse than CRDSA, while its energy efficiency is 50 % better than CRDSA. We believe that both IRSA and CSA normalized throughput performance are penalized by the fact that their design was optimized using the inaccurate collision model. VI. S UMMARY AND R ECOMMENDATIONS In this paper, we thoroughly reviewed different methodologies widely adopted in literature for assessing the RA performance with the following main findings: • Poisson traffic has an impact on CRDSA, IRSA and CSA schemes, i.e., there is up 10 % throughput reduction compared to a constant traffic model with the same (average) load in the examined scenarios. For E-SSA, as expected, the impact is instead negligible, due to the higher level of traffic aggregation at physical level. • The collision channel model provides very unreliable results when physical layer coding is used in CRDSA, IRSA and CSA schemes. This simple model is not usable for E-SSA. • The threshold-based model should be carefully optimized by finding a threshold value that matches accurate simulation results. The value of the threshold depends on the RA scheme, FEC coding rate and the distribution • (i.e., unbalance) of the received power of the packets. In this respect, the threshold-based reception model seems to come short of proper modeling of CRDSA, IRSA and CSA with some specific code rates and signal-to-noise ratios where the packets have the same power at the point of reception. The semi-analytical model reported in [7] provides accurate results for slotted RA schemes such as CRDSA, IRSA and CSA with a much faster processing time compared to Monte Carlo simulations including the physical layer. For E-SSA with given physical layer parameters, finding the matching threshold model value is very laborious and results will become inaccurate if the incoming packets have different power levels. The E-SSA semi-analytic model described in [11] provides fairly accurate results for both equi-powered and randomly distributed powers of incoming packets. In general, the optimal threshold value for the thresholdbased reception model has to be heuristically derived by trial and error method. This provides limited advantage compared to the existing semi-analytical models that include accurate model of the physical layer. The pmfs for IRSA and CSA that were optimized under the assumption of the collision channel model result in performance that is inferior to the performance of (simpler) CRDSA and E-SSA. We also derived a general formulation of the RA schemes energy efficiency. It was found that the best performing scheme is E-SSA, being 2 times more energy efficient than CRDSA and CSA, and 3.5 times more than IRSA. Further, E-SSA is also 29 % and 288 % more efficient in terms of normalized throughput than CRDSA and CSA, respectively. Finally, we turn to an open question of optimizing IRSA and CSA schemes under the accurate physical layer model of satellite networking. A potential and general way to do this is to use the analytical optimization tool presented in [9] and incorporate into it the probabilities of decoding a packet from a collision of a given cardinality, cf. Appendix A of [9]. These probabilities can be derived using the accurate physical layer simulator. Another potential approach, which may be suitable for scenarios that can be accurately modeled using the threshold-based reception, is to (i) derive the probability distribution function of SNIR of a packet involved in a collision of a given cardinality, (ii) calculate the probability of decoding the packet using the optimized value of the threshold, and (iii) plug-in these probabilities in the optimization tool presented in [9]. This approach was employed in [5], [18], for the Rayleigh block fading channel, showing that such optimization grants significant increase in the throughput performance when compared to the variants of the scheme optimized for the collision channel model. Investigation of the approach used in [5], [18] for the optimization of IRSA and CSA for satellite networking is in focus of our on-going work. 11 RA Scheme Gp Nslots N rep Normalized Throughput T [bits/symbol or bits/chip] Energy Efficiency ψen CRDSA r = 1/3 IRSA-2 r = 1/3 CSA r = 1/2, R = 1/2 E-SSA r = 1/3 3/2 3/2 1 3×64 128 128 128 1 2 3.5 2 1 0.81 0.77 0.19 1.15 2.60 ·10−3 1.49 ·10−3 3.9 ·10−3 5.21 ·10−3 TABLE I E STIMATED THROUGHPUT AND ENERGY EFFICIENCY USING THE PHY MODEL FOR THE VARIOUS RA SCHEMES FOR A TARGET PER= 10−3 ; Es /N0 = 6 D B. ACKNOWLEDGEMENT The authors would like to thank Prof. Petar Popovski for his helpful comments and insights during the preparation of this work and Dr. Enrico Paolini and Dr. Gianluigi Liva for their support in validating the CSA simulator. By expanding the binomial coefficient, we obtain ∞   ∞ X pi e−λ X [λ(1 − p)]l l i λl . p (1 − p)(l−i) e−λ = l! (1 − p)i i! (l − i)! i l=i l=i (17) Applying the change of variables m = l − i and q = 1 − p, we get ∞ ∞ pi e−λ X (λq)(m+i) pi e−λ X (λq)l = . q i i! (l − i)! q i i! m=0 m! A PPENDIX (18) l=i A. Slot and Frame Traffic-Distribution To be able to adequately model the collisions that take place in the slots of a frame, we first model the distribution of the number of colliding packets in every slot. We start from the case in which the number of users in the slot is fixed and then move to the case when this number is Poisson distributed. 1) Distribution of Collision Cardinality for a Fixed Number of Users: Suppose a frame composed of Nslots slots in which L users are transmitting packets with an average number of replicas per user equal to N rep . As stated in [9], [10], we can express the probability p of a generic user selecting a given slot for one of its replicas as N rep . p= Nslots (13) As every user chooses the slots independently, the number of packets colliding in the generic slot s (i.e., the collision cardinality of s) is a random variable denoted as I, which follows a binomial distribution with parameters L and p   L i I ∈ B(L, p) → P r{I = i} = p (1 − p)L−i . (14) i 2) Distribution of Collision Cardinality for a Poisson Number of Users: Consider now the same scenario, with the difference that the number of users active in the frame L is not fixed anymore, but follows a Poisson distribution, described by the following equation λl −λ e . (15) l! The distribution of I is now Binomial with a number of trials that is Poisson distributed and not fixed: ∞   X λl l i (16) P r{I = i} = p (1 − p)(l−i) e−λ . l! i L ∈ P(λ) → P r{L = l} = l=i P∞ z l z Recalling that l=0 l! = e , we can further simplify the previous expression as ∞ pi e−λ (λp)i e−(λp) pi e−λ X (λq)(m+i) i λq = (λq) e = . q i i! m=0 m! q i i! i! (19) We can see from equation (19) that the resulting distribution is also Poisson with mean value λ · p. R EFERENCES [1] J. Kim, J. Lee, J. Kim, and J. Yun, “M2M Service Platforms: Survey, Issues, and Enabling Technologies, IEEE Commun. Surveys Tutorials, Vol. 16, No. 1, pp. 61-76, 2014. [2] F. Boccardi, R. W. Heath Jr., A. Lozano, T. L. Marzetta, and P. Popovski, “Five Disruptive Technology Directions for 5G, IEEE Commun. Magazine, Vol. 52, No. 2, pp. 74-80, 2014. [3] R. De Gaudenzi, O. del Rio Herrero, G. Gallinaro, S. Cioni, D. P. Arapoglou, “Random access schemes for satellite ‘networks, from VSAT to M2M: a Survey”,Wiley International Journal of Satellite Communications and Networking, Vol. 36, Issue 1, Jan./Feb. 2018, pp. 66-107 [4] E. Paolini, C. Stefanovic, G. Liva, and P. Popovski, “Coded Random Access: How Coding Theory Helps to Build Random Access Protocols,” IEEE Commun. Mag., vol. 53, no. 6, pp. 144–150, Jun. 2015. [5] F. Clazzer, E. Paolini, I. Mambelli, C. Stefanovic,“Irregular Repetition Slotted ALOHA over the Rayleigh Block Fading Channel with Capture”, in Proc. of IEEE ICC 2017, Paris, France, May 2017. [6] C. Stefanovic, E. Paolini, G. Liva, “Asymptotic Performance Analysis of Coded Slotted ALOHA with Multi Packet Reception,” IEEE Commun. Letters, to appear. [7] A. Mengali, R. De Gaudenzi, and P.D. Arapoglou, “Enhancing the Physical Layer of Contention Resolution Diversity Slotted ALOHA”, IEEE Trans. on Comm, Vol 65, No. 10, October 2017, pp. 4295-4308. [8] E. Casini, R. De Gaudenzi, and O. del Rı́o Herrero, “Contention Resolution Diversity Slotted Aloha (CRDSA): an Enhanced Random Access Scheme for Satellite Access Packet Networks,” IEEE Trans. on Wireless Communications, Vol. 6, No. 4, pp. 1408-1419, April 2007. [9] G. Liva, “Graph-Based Analysis and Optimization of Contention Resolution Diversity Slotted ALOHA,” IEEE Trans. on Communications, Vol. 59, Issue 2, February 2011, pp. 477-487. 12 [10] E. Paolini, G. Liva and M. Chiani, “Coded Slotted ALOHA: A GraphBased Method for Uncoordinated Multiple Access”, IEEE Transactions on Information Theory, vol. 61, no. 12, December 2015, pp. 6815-6832. [11] O. del Rı́o Herrero and R. De Gaudenzi, “High Efficiency Satellite Multiple Access Scheme for Machine-to-Machine Communications”, IEEE Trans. on Aerospace and Electronic Systems, Vol. 48, No. 4, pp. 2961-2989, October 2012. [12] H. Okada, Y. Igarashi, and Y. Nakanishi, “Analysis and application of framed ALOHA channel in satellite packet switching networks - FADRA method,” Electronics and Communications in Japan, vol. 60, August 1977, pp. 60-72. [13] O. del Rı́o Herrero and R. De Gaudenzi, “Generalized Analytical Framework for the Performance Assessment of Slotted Random Access Protocols”, IEEE Trans. on Wireless Communications, Vol. 13, No. 2, pp. 809-821, February 2014. [14] 3rd Generation Partnership Project; Technical Specification Group Radio Access Network; Study on RAN Improvements for Machine-type Communications; (Release 11), 3GPP TR 37.868 V11.0.0 (2011-09). [15] O. del Rio Herrero, R. De Gaudenzi, J. L. Pijoan Vidal, “Design Guidelines for Advanced Random Access Protocols”, In the Proc. of the 30th AIAA International Communications Satellite Systems Conference (ICSSC 2012), September 24-27 2012, Ottawa, Canada. [16] F. Collard and R. De Gaudenzi, “On the Optimum Packet Power Distribution for Spread Aloha Packet Detectors with Iterative Successive Interference Cancellation”, IEEE Trans. Wireless Comm., Vol. 13, No. 12, pp. 6783-6794, December 2014. [17] A. Arcidiacono, D. Finocchiaro, F. Collard, S. Scalise, F. Lazaro Blasco, R. De Gaudenzi, S. Cioni, N. Alagha M. Andrenacci, “From S-MIM to F-SIM: Making Satellite Interactivity Affordable at Ku and Ka-band”, Invited paper for Wiley Int. Journal of Satellite Communications and Networking, Special issue on Ka-band Satellite Systems, 2015. [18] C. Stefanovic, M. Momoda, and P. Popovski, “Exploiting Capture Effect in Frameless ALOHA for Massive Wireless Random Access,” in Proc. of IEEE WCNC 2014, Istanbul, Turkey, Apr. 2014, pp. 1-6. [19] A. Zanella and M. Zorzi,“Theoretical Analysis of the Capture Probability in Wireless Systems with Multiple Packet Reception Capabilities,” IEEE Trans. Commun., vol. 60, no. 4, pp. 1058-1071, Apr. 2012. [20] 3GPP TS 25.212 v3.11.0, Multiplexing and channel coding (FDD); Release 1999, Sep. 2002. [21] M. Ivanov, Fredrik Brännström, A. Graell i Amat, P. Popovski, “Error Floor Analysis of Coded Slotted ALOHA over Packet Erasure Channels”, IEEE Commun. Letters, vol. 19, no. 3, pp. 419-422, March 2015. Riccardo De Gaudenzi (M’89-SM”97) received his Doctor Engineer degree (cum Laude) in electronic engineering from the University of Pisa, Italy in 1985 and the PhD from the Technical University PLACE of Delft, The Netherlands in 1999. From 1986 to PHOTO 1988 he was with the European Space Agency HERE (ESA), Stations and Communications Engineering Department, Darmstadt (Germany) where he was involved in satellite Telemetry, Tracking and Control (TT&C) ground systems design and testing. In 1988, he joined ESAs Research and Technology Centre (ESTEC), Noordwijk, The Netherlands where since 2017 he is the Head of the ESAs Radio Frequency Systems and Payload Office. The Office, is responsible for supporting the definition and development of advanced satellite system, subsystems and related technologies for telecommunications, navigation and Earth observation applications. In 2016 he has been nominated ESA Competence Domain Lead for End-to-end RF/Optical systems and products for navigation, communication and remote sensing. In 1996 he spent one year with Qualcomm Inc., San Diego USA, in the Globalstar LEO project system group under an ESA fellowship. His current interest is mainly related with advanced telecommunication and navigation systems and techniques. More specifically, efficient digital modulation and multiple access techniques for fixed and mobile satellite services, synchronization topics, adaptive interference mitigation techniques and communication systems simulation techniques. He actively contributed to the development and the demonstration of the ETSI S-UMTS Family A, S-MIM, DVB-S2, DVBS2X, DVB-RCS2 and DVB-SH standards. He has published more than 140 scientific papers and own more than 20 patents. He is co-recipient of the 2003 and 2008 Jack Neubauer Memorial Award Best Paper from the IEEE Vehicular Technology Society and of the IEEE Communication Society 2015 Satellite Communications Distinguished Service Award. PLACE PHOTO HERE PLACE PHOTO HERE Alberto Mengali was born in Pisa in 1987. He obtained his B.Sc (2012) and M.Sc (2014) in Telecommunication engineering at the University of Pisa. Since then he is pursuing a PhD at the University of Luxembourg on satellite communications with focus on link technologies for optical satellite feeder links. His research interests include Free Space Optics, Signal Processing, Satellite Systems and Random Access. Čedomir Stefanović (S’04-M’11-SM17) received his Dipl.-Ing., Mr.-Ing., and Ph.D. degrees in electrical engineering from the University of Novi Sad, Serbia. He is currently an associate professor at the Department of Electronic Systems, Aalborg University, Denmark. In 2014 he was awarded an individual postdoc grant by the Danish Council for Independent Research (Det Frie Forskningsrd). His research interests include communication theory, wireless and smart grid communications.
7cs.IT
A Relaxed Approach to Estimating Large Portfolios Mehmet Caner∗ Esra Ulasan † Laurent Callot ‡ A.Özlem Önder §¶ arXiv:1611.07347v2 [math.ST] 2 Jul 2017 July 4, 2017 Abstract This paper considers three aspects of the estimation of large portfolios, namely variance, gross exposure, and risk, when the number of assets, p, is larger than sample size, n. Using a novel technique called nodewise regression to estimate the inverse of a large covariance matrix of excess asset returns, we show that ratio of the estimated variance of a large portfolio to its population counterpart tends to one in probability. Building upon this result we show that the estimation error of the optimal portfolio variance decreases when the number of assets increases under the assumption that the inverse covariance matrix is sparse. We generalize this result to non-sparse inverse covariance matrices, showing that estimation error of the optimal portfolio variance converges in probability to zero, albeit at a slower rate than in the sparse case. We then establish that the gross exposure of a large portfolio is consistently estimated whether the true exposure is assumed to be growing or constant. Finally, our approach provides consistent estimates of the risk of large portfolios. Our main results are established under the assumption that excess asset returns are sub-Gaussian, and generalized under the weaker assumption of returns with bounded moments. Simulations verify and illustrate the theoretical results. Nodewise regression based estimator is compared to factor models and shrinkage based methods in an out-of-sample exercise, where we do well in terms of portfolio variance. Our method is complementary to existing factor based and shrinkage based models. Keywords: high-dimensionality, penalized regression, precision matrix, portfolio optimization JEL Classification: C13, C55, G11, G17 ∗ Department of Economics, The Ohio State University, email: [email protected] Department of Economics, Ege University, email: [email protected] ‡ Amazon Development Center, Berlin, email: [email protected]. § Department of Economics, Ege University, email: [email protected]. ¶ We thank conference/seminar participants at ESEM 2016,Geneva, Canadian Econometric Group at Western 2016, Midwest Econometric 2016 group, and NYU-Stern Statistics, SOFIE 2017. We thank Yingying Li for valuable comments. † 1 1 Introduction Three of the major problems related to large portfolio analysis are the estimation of variance, gross exposure, and the risk. One of the key issues pertaining to all three problems is the estimation of the inverse of the covariance matrix of excess asset returns. Inverting the sample covariance matrix becomes impossible when the number of assets, p, is larger than the sample size, n, since the sample covariance matrix of excess asset returns is singular. This paper analyze these three issues when p > n, using a new technique in statistics called nodewise regression to estimate the inverse covariance matrix. We show that ratio of the variance of the estimate of the large portfolio variance to its population counterpart tends to one in probability. Using that result, estimation error stemming from the difference of the large portfolio variance and its estimator also goes to zero in probability even in the case of non-sparsity. This is due to variance decreasing by the number of assets. Also, gross exposure of a large portfolio is estimated consistently even in the case of growing exposure. Our last result is consistent estimation of large portfolio risk. We impose a sparsity assumption on the inverse of covariance matrix. But there is no assumption on sparsity on the covariance matrix of asset returns. This still allows for all correlated assets such as Toeplitz type of covariance structure, hence it is a mild restriction. A weak sparsity assumption on the inverse, which allows many small coefficients on the inverse, is possible but will lengthen the proofs considerably, hence not attempted in this paper. Also, in simulations we have all nonsparse inverse of covariance, and non-sparse covariance DGPs that mimic S&P 500 returns, and we compare our model with factor model based and shrinkage based approaches. Out-of-sample empirical analysis show the low variance of our portfolio. To understand the recent literature: there are two major problems in setting up a large portfolio. The first problem is the non-invertibility of large sample covariance matrix, and the second one is how to incorporate a new method that provides a solution to first problem into the large portfolios. In statistical literature, in order to handle singularity of the sample covariance matrix, the vast majority of work impose sparsity conditions, that is, many off-diagonal components are either zero or close to zero; see e.g. Smoothly Clipped Absolute Deviation (SCAD) method in Fan and Li (2001), Adaptive Least Absolute Shrinkage and Selection Operator (Lasso) method in Zou (2006) and thresholding method in Bickel and Levina (2008), generalized thresholding in Rothman et al. (2009) and adaptive thresholding in Cai and Liu (2011). 1 Furthermore, Meinshausen and Bühlmann (2006) developed nodewise regression technique to handle inverses of large matrices. Recently, van de Geer et al. (2014) constructed asymptotically honest confidence intervals for low-dimensional components of a large-dimensional parameter vector 1 In particular, `1 penalized likelihood estimator has been considered by several authors, see e.g. Rothman et al. (2008), Friedman et al. (2008), Ravikumar et al. (2011), Cai et al. (2011), d’Aspremont et al. (2008), Javanmard and Montanari (2013), O.Banerjee et al. (2008) and Fan et al. (2009). There are also banding methods including re-parameterization of the covariance matrix and inverse through the Cholesky decomposition, see e.g. Wu and Pourahmadi (2003), Wong et al. (2003), Huang et al. (2006), Yuan and Lin (2007), Levina et al. (2008), Rothman et al. (2010). 2 using nodewise regression. Moreover, Caner and Kock (2014) examined the same issue for highdimensional models in the presence of conditional heteroscedasticity in the error terms in which they derived conservative lasso estimator. They also constructed an approximate inverse matrix with nodewise regression based on conservative lasso rather than plain lasso. Related to the issue of inversion of sample covariance matrix, is the study of large dimensional portfolios. Empirical evidence that is related to poor performance of the mean-variance portfolios due to insufficient sample size can be found in Michaud (1989), Green and Hollifield (1992), Brodie et al. (2009), Jagannathan and Ma (2003) and DeMiguel et al. (2009a). 2 There are several approaches for estimating large covariance matrix of a portfolio. The most convenient way is to use higher frequency of data, i.e. using daily returns instead of monthly returns, see e.g. Jagannathan and Ma (2003), Liu (2009). Other methods particularly focused on the sample covariance matrix of asset returns. For example, an effective shrinkage approach has been proposed by Ledoit and Wolf (2003, 2004), where they have used a convex combination of sample covariance matrix of excess asset returns with (Sharpe, 1963)’s Capital Asset Pricing Model (CAPM) based covariance matrix and identity matrix, respectively. Recently, Ledoit and Wolf (2012) proposed a nonlinear shrinkage approach of the sample eigenvalues for the case where p < n. Ledoit and Wolf (2015) extended this nonlinear shrinkage approach to the case p > n. Ledoit and Wolf (2004) and Ledoit and Wolf (2015) are only concerned about covariance estimations and no portfolio theories are studied. 3 Another approach is to impose factor structure to reduce high-dimensionality of the covariance matrices, see e.g. Fan et al. (2011), Fan et al. (2013). Fan et al. (2008) proposed the factor-based covariance matrix estimator depending on the observable factors and impose zero cross-correlations in the residual covariance matrix. Conditional sparsity is assumed in these papers. They also derived the rates of convergence of portfolio risk in large portfolios. Fan et al. (2015) proposed principal orthogonal complement thresholding (POET) estimator when the factors are unobservable. We see that Fan et al. (2008) and Fan et al. (2015) are very valuable in understanding the variance and exposure of large portfolios. Fan et al. (2016), Aı̈t-Sahalia and Xiu (2016) considered estimation of precision matrix via several norms when p > n in a factor model structure. There is no estimation of portfolio variance or gross exposure in these last two papers when p > n. In case of p > n, Li et al. (2017), and Ao et al. (2017) provide important and valuable findings in optimal global variance ratio via factor models, and portfolio selection via lasso in heteroskedastic asset returns. Our paper uses nodewise regression, and hence is different and complementary to theirs. Instead of dealing with large covariance matrices, some approaches directly address the portfolio weight vector, w which is the outcome in the portfolio optimization. Jagannathan and Ma (2003) showed that imposing a non-negativity (no short-sale) constraint on the portfolio weight vector turn 2 In a high-dimensional case, estimation accuracy can be affected adversely by distorted eigenstructure of covariance matrix as expressed by Daniels and Kass (2001). As noted by Markowitz (1990), this implies it will not be feasible to estimate an efficient portfolio when p > n. 3 From similar point of view, Kourtis et al. (2012) introduced a linear combination of shrinking the inverse of sample covariance matrix of excess asset returns with a target matrix in the case p < n. 3 out to be shrinkage-like effect on the covariance matrix estimation. On the contrary, DeMiguel et al. (2009b) indicated that even imposing short-sale constraints did not reduce the estimation error and hence, they suggested a naive portfolio diversification strategy based on equal proportion of wealth to each asset. 4 Directly analyzing weights has the problem of possibly feeding large estimation errors in the inverse of the covariance matrix to the weights. To get better weights, we need to estimate the inverse of covariance matrix of excess asset returns. Our method can do that when p > n. The rest of paper is organized as follows. Section 2 introduces the nodewise regression with `1 penalty, the approximate inverse of the empirical Gram matrix and its asymptotic properties. In Section 3 we show convergence rates in estimating the global minimum portfolio and meanvariance optimal portfolio by usage of nodewise regression. Section 4 relaxes the assumptions on data. In Section 5 we give a brief overview of the existing literature of the covariance matrix estimators and present simulation results. An empirical study is considered in Section 6. Finally, Section 7 concludes. All the proofs are given in the Appendix A and B. Throughout the paper kνk∞ k, νk1 , kνk2 denote the sup, l1 , and Euclidean norm of a generic vector ν, respectively. 2 The Lasso for Nodewise Regression In this section, we employ lasso nodewise regression to construct the approximate inverse Θ̂ of Σ̂ developed by Meinshausen and Bühlmann (2006) and van de Geer et al. (2014) along the lines of plain lasso of Tibshirani (1994). We employ the nodewise regression method since it allows for p > n, and builds an approximate inverse for a large covariance matrix by deleting irrelevant terms. 2.1 Method For each j = 1, . . . , p, lasso nodewise regression is defined as: γ̂j := argmin(k rj − r−j γ k22 /n + 2λj k γ k1 ), (2.1) γ∈Rp−1 with n × p design matrix of excess asset returns r = [r1 , . . . , rp ]. rj is (n × 1) vector and denotes the jth column in r and r−j denotes all columns of r except for the jth one. γ̂j is (p − 1) regression coefficient estimate, and specifically γ̂j = {γ̂jk ; k = 1, . . . , p, k 6= j} which we will be used in estimating the relaxed inverse of the covariance matrix. λj is a positive tuning parameter which determines the size of penalty on the parameters. As in van de Geer et al. (2014), γj := argminγ∈Rp−1 Ekrj − r−j γk22 . We denote by Sj := {j; γj 6= 0} which will be the main building 4 Brodie et al. (2009) reformulated the Markowitz’s risk minimization problem as a regression problem by adding `1 penalty to the constrained objective function to obtain sparse portfolios. DeMiguel et al. (2009a) proposed optimal portfolios with `1 and `2 constraints and allowing their strategy to nest different benchmarks such as Jagannathan and Ma (2003), Ledoit and Wolf (2003, 2004), DeMiguel et al. (2009b). Li (2015) formulated `1 norm and a combination of `1 and `2 norm constraints known as elastic-net (Zou and Hastie, 2005) on w. Fan et al. (2012) introduced `1 regularization to identify optimal large portfolio selection by imposing gross-exposure constraints. 4 block of the jth row of inverse covariance matrix of excess asset returns in the portfolio and its cardinality is given by sj := |Sj |. The idea is to use a reasonable approximation of an inverse of P P Σ̂ = n−1 nt=1 (rt − r̄)(rt − r̄)0 with r̄ = n−1 nt=1 rt . Let Θ̂ be such an inverse. Θ̂ is given by nodewise regression with `1 penalty on the design r. We run the lasso p times for each regression of rj on r−j , where the latter is the design submatrix without the jth column. To derive Θ̂, first define  1 −γ̂1,2 . . .  1 ... −γ̂2,1 Ĉ :=  .. ..  .. . .  . −γ̂p,1 −γ̂p,2 . . .  −γ̂1,p  −γ̂2,p  ..   .  1 and write T̂ 2 = diag(τ̂12 , . . . , τ̂p2 ) which is p × p diagonal matrix for all j = 1, . . . , p. Note that elements of T̂ 2 are: k rj − r−j γ̂j k22 + λj k γ̂j k1 . (2.2) τ̂j2 := n Then define the relaxed inverse Θ̂ as: Θ̂ := T̂ −2 Ĉ. (2.3) Θ̂ is considered a relaxed (approximate) inverse of Σ̂. While Σ̂ is self-adjoint, Θ̂ is not. Define the Ĉj jth row of Θ̂j as a 1 × p vector and analogously for Ĉj . Thus, Θ̂j = 2 . τ̂j The specific algorithm to compute Θ̂ is given below, and we only use p regressions. 1. Apply lasso estimator for the regression of rj on r−j as in (2.1) and get γ̂j vector with (p − 1) dimension given λj . 2. λj is chosen by modified BIC in the nodewise regressions via (5.1). 3. Repeat steps 1-2 j = 1, · · · , p times. 4. Take the transpose of γ̂j and let it be a (p − 1) dimensional matrix consisting of each column of γ̂j and multiply all elements with minus one. 5. Compute Ĉ matrix. 6. Estimate T̂ 2 matrix with γ̂j values by (2.2) and optimally chosen λj . T̂ 2 = diag(τ̂12 , . . . , τ̂p2 ) which is (p × p) diagonal matrix for all j = 1, . . . , p 7. Use (2.3) to get Θ̂. Next, we show why Θ̂ is an approximate inverse for Σ̂. The Karush-Kuhn-Tucker conditions for the nodewise lasso (2.1) imply that, τ̂j2 = (rj − r−j γ̂j )0 rj n 5 (2.4) Divide each side by τ̂j2 and using the definition Θ̂j shows that, rj0 rΘ̂0j (rj − r−j γ̂j )0 rj =1 = n τ̂j2 n (2.5) which shows that jth diagonal term of Θ̂Σ̂ exactly equals to one. Karush-Kuhn-Tucker conditions for the nodewise lasso (2.1) for the off-diagonal terms of Θ̂Σ̂ imply that, k r0−j rΘ̂0j k∞ λj ≤ 2 n τ̂j (2.6) Hence, we combine (2.5) and (2.6) results for diagonal and off-diagonal terms in Θ̂Σ̂ to have, k Σ̂Θ̂0j − ej k∞ ≤ λj τ̂j2 (2.7) where, ej is the jth unit column vector (p × 1). 2.2 Asymptotics In this section we provide assumptions and we will show that nodewise regression estimate of the inverse of variance covariance matrix is consistent. These results are all uniform over j = 1, · · · , p. To derive our theorems, we need the following assumptions. Assumption 1. The n × p matrix of excess asset returns r has iid sub-Gaussian rows. Assumption 2. The following condition holds max sj j p logp/n = o(1). Assumption 3. The smallest eigenvalue of Σ, Λmin is strictly positive and 1/Λmin = O(1). Moreover, maxj Σj,j = O(1). Also the minimal eigenvalue of Θ = Σ−1 is strictly positive. The assumptions above are Assumptions (B1)-(B3) of van de Geer et al. (2014). Assumption 1 can be relaxed to non i.i.d. non sub-Gaussian cases as shown in Caner and Kock (2014) and at subsection 4 we generalize our results to excess asset returns with bounded moments. Assumption p 2 allows us to have p > n. Note that when p > n, maxj sj = o( n/logp). In the simple case of p p = an, where a > 1 is constant, then maxj sj = o( n/log(an)) which is growing with n, but less than maximum number of possible nonzeros p − 1 in a row. If the problem is such that p < n, then it is possible that maxj sj = p − 1 (no sparsity in the inverse of the covariance matrix), so p in that case, Assumption 2 can be written as p logp/n = o(1). Note that our Assumption 2 has √ extra maxj sj factor compared to van de Geer et al. (2014). This is due to portfolio optimization problem. Assumption 2 is a mild sparsity condition on the inverse of the covariance matrix of excess asset 6 returns. This does not imply sparsity of covariance matrix of excess asset returns. For example, if the excess asset returns have an autoregressive structure of order one, the covariance matrix will be non-sparse but its inverse will be sparse. Another prominent example is if covariance matrix of |i−j| asset returns: Σ, has a block diagonal or a Toeplitz structure, Σi,j = ρ1 , −1 < ρ1 < 1, ρ1 being the correlation among assets. Then again the inverse in these cases will be sparse. Fan et al. (2008) assumed sparsity of residual covariance matrix of excess asset returns. A specific case of Fan et al. (2015) on the other hand, had the structure-formula as our Assumption 2 but sparsity is imposed on the residual covariance matrix rather than on its inverse. Assumption 3 allows population covariance matrix to be nonsingular. Strictly positive minimal eigenvalue means this is not a local to zero sequence. The following Lemma shows one of the main results of our paper, and can be deduced from proof of Theorem 2.4 of van de Geer et al. (2014). We provide a proof in our Appendix to be complete. It shows that nodewise regression estimate of the inverse of the covariance matrix can be uniformly (over j) consistently estimated. p Lemma 2.1. Under Assumptions 1-3 with λj = O( logp/n) uniformly in j ∈ 1, · · · , p, kΘ̂Σ̂ − Ip k∞ = Op ( p logp/n) = op (1). p Note that λj = O( logp/n) is a standard assumption in van de Geer et al. (2014), and can be found also in Bühlmann and van de Geer (2011). This rate is derived from concentration inequalities. This Lemma shows that we can estimate inverse matrix even when p > n. It is clear that from the previous lemma and our assumptions that we allow p = an, where 0 < a < ∞. Specifically, a can be much larger than one, allowing assets to dominate sample size in dimensions. Also, our assumptions allow p = exp(nb ), where 0 < b < 1. Note that in practice, relaxed inverse in finite samples may not be positive definite, but our asymptotic proofs are not affected by that as can be seen from Lemma 2.1 and Σ−1 being positive definite, and the proof of Lemma A.1. We can ensure positive definiteness of the constructed Θ̂ by eigenvalue cleaning as in Callot et al. (2016); Hautsch et al. (2012). 3 Nodewise Regression in Large Asset Based Portfolios Nodewise regression is a technique that helps us in getting an approximate estimate for the inverse of covariance matrix of excess asset returns when the number of assets (p) is larger than time period (n). One clear advantage of this technique that will be shown below is that, we can form weights, variance, and risk of large portfolios when p > n. Second advantage is that sparsity of covariance matrix is not assumed, even conditionally. However, as can be seen sparsity of inverse matrix is assumed, which can happen when excess returns are correlated with an autoregressive with lag one structure. This is a mild restriction. Then another issue is stability. For example from the formula below for global minimum variance portfolio, nodewise regression based estimate 7 of inverse of covariance matrix will be more stable when p is near n, with p < n and may provide a smaller variance than a very standard approach that uses inverse of sample covariance matrix in that case. Compared with factor model based approaches, we do not form a structure on returns but assume sparsity of inverse of the covariance matrix. But with both factor models and shrinkage based methods it will be difficult to compare theoretically since assumptions and problems may differ, so a second best response is simulation based evidence which we provide. 3.1 Optimal Portfolio Allocation and Risk Assessment Consider a given set of p risky assets with their excess returns at time t by rit , i = 1, . . . , p. We denote (p × 1) vector of excess returns as rt = (r1t , . . . , rpt )0 . We assume that excess returns are stationary and E [rt ] = µ, where µ = (µ1t . . . , µpt )0 . Full rank covariance matrix of excess returns is expressed as Σ ∈ Rp×p , where Σ = E [(rt − µ)(rt − µ)0 ]. A portfolio allocation is defined as composition of weights, w ∈ Rp . Specifically, w = (w1 , . . . , wp )0 represents the relative amount of invested wealth in each asset. 3.1.1 Global Minimum Variance Portfolio First, we start with unconstrained optimization. The aim is to minimize the variance without an expected return constraint. Denote the global minimum variance portfolio as wu wu = argmin(w0 Σw), such that w0 1p = 1. w Note that p.370 of Fan et al. (2015) showed that weights of the global minimum variance portfolio is: wu = Σ−1 1p . 10p Σ−1 1p (3.1) We also give the following estimate for the weights in global minimum variance portfolio ŵu = Θ̂1p 10p Θ̂1p . (3.2) Note that global minimum variance without constraint on the expected return is wu0 Σwu = (10p Σ−1 1p )−1 , (3.3) as shown in equation (11) of Fan et al. (2008). So denote the global minimum variance portfolio by ΦG = (10p Σ−1 1p )−1 , and its estimate by Φ̂G = (10p Θ̂1p )−1 . 8 (3.4) In other words, we estimate global minimum variance directly. This is also the approach used by Theorem 5 in Fan et al. (2008). A less straightforward estimate of the global minimum variance could have been using (3.2) directly in estimating left side of (3.3). This last way uses the estimates of weights and unnecessarily complicates the estimator. Next result shows estimation of global minimum variance using nodewise regression method for inverse of covariance matrix. This is one of the main results of this paper. √ Theorem 3.1. Under Assumptions 1-3, uniformly in j λj = O( logp/n), | p Φ̂G − 1| = Op (max sj logp/n) = op (1). j ΦG Remarks: 1. We allow p > n in global minimum variance portfolio. 2. As far as we know, the ratio of estimate of large portfolio variance to its population counterpart is new without any factor model structure, and standardizes the variance estimate. 3. In the factor model case, very recently, Li et al. (2017), provides this ratio converges to one in probability. Their paper makes important and valuable contributions in optimality of their ratio result. With high dimensional approaches like theirs and us we are learning more about the portfolio variance with very large number of assets. We provide the following Corollary that shows direct difference between two portfolio variances, which shows that error converges to zero in probability at a faster than p, which is due to rate of global minimum variance. So using Theorem 3.1 with (A.7) in Appendix we have the following Corollary. In Remark 2 below, we show that even in case of non-sparsity of population inverse covariance matrix, consistent estimation of the variance is possible, which is an important finding. p Corollary 3.1. Under Assumptions 1-3, uniformly in j λj = O( logp/n), p Op (maxj sj logp/n) 1 |Φ̂G − ΦG | = = op ( ). O(p) p Remarks: 1. Note that Theorem 5 of Fan et al. (2008) derived the result in Corollary 3.1 above using factor model based covariance inverse with no sparsity assumption on inverse of the covariance matrix. Their estimation error converges to zero in probability when n is much larger than p only. Since the assumptions of that paper is different from us, a direct comparison of these two papers in theory is not suitable. 9 2. A key issue is what happens when Assumption 2 is violated. Assume now maxj sj = p − 1, then the estimation error still converges in probability to zero, as long as logp/n → 0, which allows p > n p p Op (maxj sj logp/n) |Φ̂G − ΦG | = = Op ( logp/n) = op (1). O(p) 3.1.2 Markowitz Mean-Variance Framework Markowitz (1952) has defined the portfolio selection problem to find the optimal portfolio that has the least variance i.e. portfolio variance for a given expected return ρ1 . At time t, an investor determines the portfolio weights to minimize the mean-variance objective function: w = argmin(w0 Σw), w subject to w0 1p = 1 and w0 µ = ρ1 , where 1p = (1, . . . , 1)0 . For a given portfolio w, w0 µ and w0 Σw equal to the expected rate of return and variance, respectively. Full investment constraint (w0 1p = 1) requires that weights should sum up to 1. The target return constraint (w0 µ = ρ1 ) indicates a certain level of desired expected portfolio return. Throughout the paper, we assume short-selling is allowed and hence the value of weights could be negative in the portfolio. The well-known solution from the Lagrangian and the first order conditions from constrained quadratic optimization is (as equation (9) in Fan et al. (2008)): w∗ = D − ρ1 B −1 ρ1 A − B −1 Σ 1p + Σ µ, AD − B 2 AD − B 2 (3.5) where A = 10p Σ−1 1p , B = 10p Σ−1 µ and D = µ0 Σ−1 µ. Since Σ is positive-definite, A > 0 and D > 0. By virtue of Cauchy-Schwarz inequality, the system has a solution if AD − B 2 > 0. Now we derive our second result. This uses optimal weights w∗ to get the variance of the optimal portfolio. We form the following estimate of the optimal weight w∗ using (3.5): ŵ = D̂ − ρ1 B̂ Θ̂1p + ρ1  − B̂ ÂD̂ − B̂ 2 P where  = 10p Θ̂1p , B̂ = 10p Θ̂µ̂, D̂ = µ̂0 Θ̂µ̂, and µ̂ = n−1 nt=1 rt . ÂD̂ − B̂ 2 Aρ2 −2Bρ +D Θ̂µ̂, Âρ2 −2B̂ρ +D̂ 1 Now define ΨOP V = 1AD−B12 , and its estimate Ψ̂OP V = 1 . These will be used imÂD̂−B̂ 2 mediately below. Note that the variance of the optimal portfolio from the constrained optimization above is Aρ21 − 2Bρ1 + D 0 w∗ Σw∗ = = ΨOP V . (3.6) AD − B 2 The estimate for the above optimal portfolio variance is Âρ21 − 2B̂ρ1 + D̂ ÂD̂ − B̂ 2 10 = Ψ̂OP V . Note that we have not used an estimate of the optimal portfolio variance based on estimating w∗ first from (3.5) and the equation immediately below. This could have created a much complicated estimator. Instead, like Fan et al. (2008), we use optimal portfolio variance expression and estimate the closed form solution in (3.6). The following Theorem provides the rate for the error in estimating the optimal portfolio variance. p Theorem 3.2. Under Assumptions 1-3, and assuming uniformly in j, λj = O( logp/n) with, p−2 (AD − B 2 ) ≥ C1 > 0, where C1 is a positive constant, and p−1 (Aρ21 − 2Bρ1 + D) ≥ C1 , ρ1 being bounded, we get p Ψ̂OP V − 1 = Op (max sj logp/n) = op (1). j ΨOP V Remarks: 1. Our result shows that we allow for p > n in estimating optimal portfolio variance. The ratio of estimated optimal variance to population counterpart is new in large portfolio analysis, and we show that this ratio converges to one in probability. 2. We also restrict p−1 (Aρ21 − 2Bρ1 + D) ≥ C1 > 0, and p−2 (AD − B 2 ) ≥ C1 > 0. This is not a major restriction since by Lemma A.4 all terms A, B, D grow at rate p, so this excludes a pathological case that with a certain return and implies that optimal portfolio variance ΨOP V in (3.6) is positive. Corollary 3.2 considers the difference between the estimated and population variance, instead of its ratio as in Theorem 3.2. The proof is established using Theorem 3.2 and (A.34). In Remark 2 below, we show that even in case of non-sparsity of population inverse covariance matrix, consistent estimation of the variance is possible, which is an important finding. p Corollary 3.2. Under Assumptions 1-3, and assuming uniformly in j, λj = O( logp/n) with, p−2 (AD − B 2 ) ≥ C1 > 0, where C1 is a positive constant, and p−1 (Aρ21 − 2Bρ1 + D) ≥ C1 , ρ1 being bounded, we get p Op (maxj sj logp/n) 1 Ψ̂OP V − ΨOP V = = op ( ). O(p) p Remarks: 1. Corollary 3.2 shows that estimation error converges in probability to zero at a rate faster than 1/p, which shows that adding assets to portfolio helps. However this is mainly due to optimal variance declining at rate p. To our knowledge these are new results in the literature. 2. When Assumption 2 is violated, assuming instead maxj sj = p − 1, the estimation error still converges to zero in probability as long as logp/n → 0 even when p > n: Ψ̂OP V − ΨOP V p p Op (maxj sj logp/n) = = Op ( logp/n) = op (1). O(p) 11 3. In a factor model setting, Theorem 6 of Fan et al. (2008) shows the variance estimation error tends to zero in probability when n > p. 3.2 Estimating Gross Exposure In this subsection we estimate the gross exposure of portfolios based on the nodewise estimator of the inverse covariance matrix. We begin with Theorem 3.3 by showing that we can consistently estimate the weights of the global minimum variance portfolio in a high dimensional setting with p > n. Theorem 3.3. Under Assumptions 1,3 and the sparsity assumption (maxj sj )3/2 p with λj = O( logp/n) uniformly in j, we have kŵu − wu k1 = Op ((max sj )3/2 j p logp/n = o(1), p logp/n) = op (1). Remarks: 1. Note that we have a very mild sparsity assumption. Instead of Assumption 2, our sparsity √ Assumption here needs an extra sj due to approximation error for Θ̂ in `1 norm in our proof. Note that even though p > n, maxj sj has to be constrained so that this result in Theorem 3.3 holds true. Next we consider what if this constraint is relaxed. 2. One important case is non-sparse inverse covariance matrix. In other words, what if for all j = 1, · · · , p, sj = p−1? This is the case with all nonzero cells in inverse of covariance matrix. Then of course, p has to be less than n1/3 , meaning p(logp)1/3 = o(n1/3 ) so that we satisfy p p the assumption: (maxj sj )3/2 logp/n = (p − 1)3/2 logp/n = o(1). 3. We consider whether we have growing or finite gross exposure, in other words we need to analyze kwu k1 . By (A.60) and a simple eigenvalue inequality √ kwu k1 = O(max sj ), j which may grow with n. In this sense, by Theorem 3.3 consistent estimation of portfolio weights is possible even in the case of growing exposure. But if we further assume maxj sj = O(1), meaning if the number of nonzero elements in each row of inverse variance matrix is finite then we have kwu k1 = O(1). So finite gross exposure is possible with one extra assumption. With finite gross exposure Theorem 3.3 result is p kŵu − wu k1 = Op ( logp/n) = op (1). This means that with finite gross exposure we get a better approximation compared with rate in Theorem 3.3. 12 4. In Remark 3 above we find rate of approximation for weights in the case of constant exposure. Fan et al. (2015), by using factor models, estimates Σ by a sparse structure in rows and then estimates Σ−1 . Basically, applying Σ̂−1 to weight estimation, p.372 of Fan et al. (2015) has derived the same rate as Remark 3 above, as long as maximum number of non vanishing elements in each row in Σ is finite (i.e. case of parameter q = 0 in Assumption 4.2 of Fan et al. (2015)). We now turn to the estimator of the gross exposure of the portfolio, kw∗ k1 . The estimator is ŵ, where we use `1 norm as in Fan et al. (2015) among others. The next Theorem established consistency of the portfolio gross exposure estimator with p > n, it is one of our main results and a novel contribution to the literature. p Theorem 3.4. Under Assumptions, 1, 3 with (maxj sj )3/2 logp/n = o(1) and assuming uniformly p in j, λj = O( logp/n) with p−2 (AD − B 2 ) ≥ C1 > 0, where C1 is a positive constant, and ρ1 being bounded as well, we have kŵ − w∗ k1 = Op ((max sj )3/2 j p logp/n) = op (1). Remarks: 1. To see whether we allow for growing gross exposure or not we need to know the rate of kw∗ k1 . Note that ρ1 A − B D − ρ1 B Θ1p + Θµ. w∗ = 2 AD − B AD − B 2 See that |D − ρ1 B|kΘ1p k1 |ρ1 A − B|kΘµk1 √ + = O( maxj sj ). p 2 C1 p2 C1 √ √ With (A.60)-(A.63) we have kΘ1p k1 = O(p maxj sj ), kΘµk1 = O(p maxj sj ), and for the other terms in the numerator we use Lemma A.4 A = O(p), D = O(p), |B| = O(p), with ρ1 being bounded and also we use AD − B 2 ≥ p2 C1 for the denominator . This shows that we have growing gross exposure. p 2. With the Assumptions 1 and 3, with imposing now max1≤j≤p sj = O(1), logp/n = o(1), p p−2 (AD − B 2 ) ≥ C1 > 0, ρ1 being bounded and maxj λj = O( logp/n) leading to finite gross exposure, as can be seen from the proof of Theorem 3.4, and kw∗ k1 ≤ kŵ − w∗ k1 = Op ( p logp/n) = op (1). So the rate of approximating the optimal portfolio improves greatly. This result shows even for very large portfolios we can estimate the weights successfully controlling the error. 3. Here, we show that with all possible nonzero coefficients in rows of Σ−1 , and growing exposure, 13 (for all j = 1, · · · , p: sj = p − 1), the rate in Theorem 3.4 is: kŵ − w∗ k1 = Op (p3/2 p logp/n), p which means we need p3/2 logp/n = o(1). This result shows that plogp1/3 = o(n1/3 ), so p should be much less than n in this case. 3.3 Estimating Risk Error of a Large Portfolio In this subsection we are interested in estimating the risk error of a large portfolio. This error is defined as |ŵu0 (Σ̂ − Σ)ŵu | and |ŵ0 (Σ̂ − Σ)ŵ| for global minimum variance portfolio, and Markowitz portfolios respectively, where p > n. This is defined in section 3.2 of Fan et al. (2015) by using factor model based approach with constant exposure. Here, we want to consider what happens when we have growing exposure, and with relaxed inverse of covariance matrix without a factor structure for returns. However, we still make a sparsity assumption on inverse of covariance matrix, whereas Fan et al. (2015) does not, but has sparsity on residual error matrix. The following theorem provides risk error for a large portfolio with growing exposure in case of global minimum variance portfolio. We are still able to show that this error will converge in probability to zero, but is affected by maximum of number of nonzero elements across rows in the inverse of covariance matrix. Theorem 3.5. Under Assumptions 1,3 and the sparsity assumption (maxj sj )3/2 p with λj = O( logp/n) uniformly in j, we have |ŵu0 (Σ̂ − Σ)ŵu | = Op (max sj j p logp/n = o(1), p logp/n) = op (1). Remarks: 1. This is a new result, and shows the tradeoff between number of assets, sample size, and √ maxj sj . We allow for p > n, as well as growing exposure, kwu k1 = O(maxj sj ). 2. When we have constant exposure kwu k1 = O(1), then we have |ŵu0 (Σ̂ − Σ)ŵu | = Op ( p logp/n) = op (1), which is the same result as in Fan et al. (2015). Next we conduct the same analysis for the Markowitz based portfolio, in case of growing exposure. We are still able to show, even in the case of extreme positions in the portfolio, the risk estimation error converges to zero in probability. 14 p Theorem 3.6. Under Assumptions, 1, 3 with (maxj sj )3/2 logp/n = o(1) and assuming uniformly p in j, λj = O( logp/n) with p−2 (AD − B 2 ) ≥ C1 > 0, where C1 is a positive constant, and ρ1 being bounded as well, we have |ŵ0 (Σ̂ − Σ)ŵ| = Op (max sj j p logp/n) = op (1). Remark. This is a new result, and again shows that we cannot have large maxj sj . In the case of constant exposure we get the result also in Remark 2 of global minimum variance portfolio case above. 4 Asset Returns with Bounded Moments In this section we relax assumption of the sub-Gaussianity of the asset returns. We build our results on the work of Caner and Kock (2014). Assumptions 1-2 are modified and Assumption 3 is not changed. The new assumptions involve bounded moments and a more restrictive sparsity assumption, so there is a trade-off. Assumption 1*. The excess asset return vector ri is iid, but max1≤j≤p E|rij |l ≤ C, with l > 4. Assumption 2*. The sparsity condition is (max sj ) j p2/l = o(1). n1/2 Caner and Kock (2014) shows that, uniformly in j, λj = O(p2/l /n1/2 ) through their Lemma 2. In sub-Gaussian setting, the tuning parameter was of order (logp)1/2 /n1/2 , this shows the price of relaxing the sub-Gaussianity of the returns: we allow fewer assets in our portfolio. In the Appendix B we show which parts of the proofs in Theorems 3.1-3.6 are affected. Also see that our tuning parameter choice affects Assumption 2*, where compared to Assumption 2 we replace (logp)1/2 with p2/l . √ Theorem 4.1. Under Assumptions 1*,2*,3, assuming uniformly in j, λj = O(p2/l / n) Φ̂G − 1 = op (1). ΦG 15 2/l Theorem 4.2. Under Assumptions 1*, 2*, 3, and assuming uniformly in j, λj = O( p√n ) with p−2 (AD − B 2 ) ≥ C1 > 0, where C1 is a positive constant, , p−1 (Aρ21 − 2Bρ1 + D) ≥ C1 > 0, ρ1 is bounded, we get Ψ̂OP V − 1 = op (1). ΨOP V Note that counterparts of Corollaries 3.1-3.2 can be shown with ease as long as we have = o(1). So again a nonsparse result, without Assumption 2* is possible. Now we provide counterparts to Theorems 3.3-3.4, in terms of estimating gross exposure of the portfolios. p2/l /n1/2 2/l Theorem 4.3. Under Assumptions 1*,3 and the sparsity assumption (maxj sj )3/2 p√n = o(1), 2/l assuming uniformly in j, λj = O( p√n ) we have p2/l kŵu − wu k1 = Op ((max sj )3/2 √ ) = op (1). j n Note that we see here it is possible to have p > n in Theorem 3.3 as long as l is large, or maxj sj = O(1). Theorem 3.4 allows also p > n. 2/l Theorem 4.4. Under Assumptions, 1*, 3, with (maxj sj )3/2 p√n = o(1), and assuming uniformly 2/l in j, λj = O( p√n ) with p−2 (AD − B 2 ) ≥ C1 > 0 where C1 is a positive constant and ρ1 being bounded as well, we have p2/l kŵ − w∗ k1 = Op ((max sj )3/2 √ ) = op (1). j n We provide the counterparts of Theorems 3.5-3.6 of risk estimation errors, in the case of data with bounded moments. 2/l Theorem 4.5. Under Assumptions 1*,3 and the sparsity assumption (maxj sj )3/2 p√n = o(1), 2/l assuming uniformly in j, λj = O( p√n ) we have p2/l |ŵu0 (Σ̂ − Σ)ŵu | = Op ((max sj ) √ ) = op (1). j n 2/l Theorem 4.6. Under Assumptions, 1*, 3, with (maxj sj )3/2 p√n = o(1), and assuming uniformly 2/l in j, λj = O( p√n ) with p−2 (AD − B 2 ) ≥ C1 > 0 where C1 is a positive constant and ρ1 being 16 bounded as well, we have p2/l |ŵ0 (Σ̂ − Σ)ŵ| = Op ((max sj ) √ ) = op (1). j n √ The main difference between Theorems 3.1-3.6 and Theorems 4.1-4.6 is that we replace logp everywhere in approximations with p2/l , l > 4, as consequence of the rate of the tuning parameter in non-sub Gaussian returns being: maxj λj = O(p2/l /n1/2 ) 5 Simulations This section begins by discussing the implementation of the nodewise estimator, as well as alternative estimators. We then present the setup of this simulation study and follow by discussing the results. 5.1 Implementation of the nodewise estimator The nodewise regression approach is implemented using the coordinate descent algorithm implemented in the glmnet package (Friedman et al., 2010). The penalty parameter λj , j = 1, · · · , p is chosen by minimizing the Bayesian information criterion of Wang et al. (2009): BIC(λj ) = log(σ̂λ2j ) + |Ŝj (λj )| log(n) log(log(p)), n (5.1) where σ̂λ2j = krj −r−j γ̂j k22 /n is the residual variance for asset j and |Ŝj (λj )| represents the estimated number of nonzero cells in (p−1) vector of γ̂j in a given nodewise regression. Alternative information criterion were investigated, including those proposed by Caner et al. (2017), Zou et al. (2007) yielding only minor differences in the results. The entries of the covariance matrix are estimated equation by equation and a different penalty parameter is selected for each equation. 5.2 5.2.1 Alternative Covariance Matrix Estimation methods Ledoit-Wolf Shrinkage Ledoit and Wolf (2004) proposed an estimator for high-dimensional covariance matrices that is invertible and well-conditioned. Their estimator is a linear combination of the sample covariance matrix and an identity matrix, and they showed that their estimator is asymptotically optimal with respect to the quadratic loss function. The properties of this covariance matrix estimator, and of its inverse, when used to construct portfolios have not been investigated in the finance literature. 17 5.2.2 Multi-factor Estimator The Arbitrage Pricing Theory is derived by Ross (1976, 1977) and the multi-factor models are proposed by Chamberlain and Rothschild (1983). These studies have motivated the use of factor models for the estimation of excess return covariance matrices. The model takes the form rF = Bf + ε, (5.2) where rF is a matrix of dimensions p × n of excess return of the assets over the risk-free interest rate and f a K × n matrix of factors. B is a p × K matrix of unknown factor loadings and ε is the matrix of idiosyncratic error terms uncorrelated with f . This model yields an estimator for the covariance matrix of rF : ΣF AC = Bcov(f )B0 + Σn,0 , (5.3) where Σn,0 is the covariance matrix of errors ε. When the factors are observed, as in Fan et al. (2008), the matrix of loadings B can be estimated by least squares. In the case where the factors are unobserved, Fan et al. (2013, 2015) proposed the POET, to estimate ΣF AC . In our simulations we compare the nodewise regression approach to the POET estimator as in Fan et al. (2015), which we describe below. p Let λ̂1 ≥ . . . ≥ λ̂p to be ordered eigenvalues of the sample covariance matrix Σ̂ and ξˆj=1 to be its corresponding eigenvectors. The estimated covariance matrix Σ̂P OET is defined as: Σ̂P OET = K̂ X λ̂j ξˆj ξˆj0 + Ω̂, (5.4) j=1 P  p λ̂ ξˆ2 , k= K̂+1 k k,i P  Ω̂ij = p sij λ̂k ξˆk,i ξˆk,j , i = j, (5.5) i 6= j, k=K̂+1 where Ω̂ = (Ω̂ij )p×p and sij (·) : R → R is the soft-thresholding function sij = (z −τij )+ (Antoniadis and Fan, 2001; Rothman et al., 2009; Cai and Liu, 2011), and (.)+ represents the larger of zero and a scalar with z denoting the {ij} th cell in the standard residual sample covariance matrix of ε. The residual is defined as least squares estimator residual in the factor model. The entry dependent thresholding parameter is τij = ζ q r Ω̂ii Ω̂jj logp 1 +√ n p ! , (5.6) where ζ > 0 is a user-specified positive constant to maintain the finite sample positive definiteness of Ω̂. In our implementation we initialize at ζ = 0, and increase ζ by increments of 0.1 until Ω̂ is invertible and well conditioned. 18 The number of factors K̂ is chosen using the information criterion of Bai and Ng (2002)  1 K̂ = argmin tr  0≤k≤M p p X j=k+1  k(p + n) λ̂j ξˆj ξˆj0  + log pn  pn p+n  , (5.7) where M is a user-defined upper bound which we set to M = 7. 5.3 Simulation Setup In every simulation we use n = 252 observations, corresponding to one year of daily returns, and generate p assets, with p = 50, 100, ..., 300, 400, ..., 1000. For each value of p we perform 1000 replications. Computations are carried using R 3.3.3 (R Core Team, 2015), and are fully reproducible. 5.3.1 Data Generating Processes We consider four data generating processes (DGP), one based on a three factor model, two based on randomly generated covariance matrices, and one based on sparse random Cholesky factors. All of them have non-sparse inverse covariance matrix when we checked DGPs. So all of these designs violate our sparsity assumption. In this sense we also see how the non-sparsity of inverse matrix affects our results. The factor based DGP, noted Factor, is a replication of the data generating process of Fan et al. (2008). The process is based on 3 randomly generated factors and loadings with a Gaussian distribution and known moments. The same factors are used for every value of p considered, new loadings and standard deviations of the innovations are generated for each value of p. The innovations are iid Gaussian with Gamma distributed standard errors. The two random covariance matrix DGPs use the estimated moments (noted µ for the mean and 2 σ for the variance) of the excess returns from 466 stocks of the S&P 500 observed from March 17, 2011 to March 17, 2016 (1257 observations), using the 13 weeks (3 month) treasury bill to compute the risk free returns. The two first random covariance matrix DGPs use non-sparse covariance matrices with returns generated using either a Gaussian distribution or a Student t distribution with 9 degrees of freedom. The algorithm we use to generate means and covariance matrices for the returns is as follows: 1. Generate p means for the excess returns, µRCV , from N (µ, σ 2 ). 2. Generate p standard deviations σ1 , ..., σp for the errors by sampling from a Gamma distribution G(α, β) where α and β are estimated from the S&P data. 3. Generate off-diagonal elements for the covariance matrix by drawing from a Gaussian distribution while ensuring symmetry. 19 4. Ensure positive definiteness of the constructed covariance matrix by eigenvalue cleaning as in Callot et al. (2016); Hautsch et al. (2012). To implement this procedure, perform a spectral decomposition of the form Σ = V 0 AV where V is the matrix of eigenvectors and A the (diagonal) matrix of eigenvalues, replace the negative eigenvalues as well as those below 10−6 by the smallest eigenvalue larger than 10−6 yielding Ã, and construct Σ̃ = V 0 ÃV . 5. Generate the matrix of excess returns by drawing from N (µRCV , Σ̃) or by drawing from a multivariate t distribution with 9 degrees of freedom and covariance matrix Σ̃ to which the mean returns µRCV is then added. The final DGP uses sparse Cholesky factors to generate the covariance matrix, returns are then generated using a multivariate Gaussian distribution with mean µRCV as above. The Cholesky factors are generated by filling the off-diagonal entries of the matrix with either zeros (with probability 80%) or random numbers uniformly distributed between -0.1 and 0.1. The diagonal is filled with random numbers uniformly distributed between 0 and 1. 5.3.2 Portfolio Weights Estimation We consider the global minimum variance portfolio as well as the mean-variance portfolios introduced by Markowitz (1952). For the Markowitz portfolios we use a daily return target of 0.0378%, corresponding to a 10% return when cumulated over 252 days. Closed form solutions for the portfolio allocation vectors and its variance are given in section 3.1.2 for the Markowitz portfolio, and in section 3.1.1 for the global minimum variance portfolio. 5.3.3 Reported Measures Our results are reported in five figures with the number of assets p on the horizontal axis and the median over 1000 iterations of one of the five following statistics on the vertical axis. • Figure 1: is the absolute ratio of estimated to true variances minus one defined in Theorems 3.1 and 3.2. • Figure 2: the estimation error of estimated portfolio variance Φ̂G for the global minimum variance portfolio and Ψ̂OP V for the Markowitz portfolio in Corollary 3.1, Corollary 3.2. • Figure 3: the absolute risk error as defined in Theorems 3.5 and 3.6. • Figure 4: the absolute difference between portfolio weights based on the estimated and true covariance matrices defined in Theorems 3.3 and 3.4. • Figure 5: the estimated portfolio exposure kŵk1 . 20 5.4 Simulation Results Figure 1 shows that the ratio of the estimated to the true portfolio variances (minus one) is stable when the weights are based on the Nodewise estimator under the factor DGP and the sparse Cholesky factor. This variance ratio (minus one) is increasing under the two random covariance DGPs for all estimators but the increase is faster for the POET estimator. The Ledoit-Wolf estimator performs poorly under the Cholesky factor DGP. We note that our nodewise regression based portfolio variance ratio (minus one) approaches zero as expected in Cholesky factor DGP. In case of portfolio variance estimation errors, our nodewise regression based variance error converges to zero fast unlike other methods in Figure 2. POET estimator based variance error does not perform well under Gaussian data, and t distributed data. Ledoit-Wolf method does not do well under Cholesky factor based DGP. Figure 3 clearly shows the superior performance of our nodewise regression based estimator in terms of large portfolio risk. We see that POET estimator’s risk error converges to zero slower than the other methods except Cholesky factor based DGP. Figure 4 shows that the portfolio weights estimation error by computed using the POET estimator is lower than weights computed using alternative estimators under the Factor DGP. Under the other three DGPs the POET error is always higher than Nodewise errors, the Ledoit-Wolf based weights are the most accurate under the non-sparse DGPs though the difference with the Nodewise estimator decreases when the number of assets increases. The Ledoit-Wolf estimator performs poorly under the Sparse Cholesky factor DGP. Figure 5 shows that the Nodewise estimator yields portfolios with an exposure close to 1 under every DGP and for any number of assets. The exposure of portfolios based on the Ledoit-Wolf estimator is as high as 5 under the factor DGP and is only marginally higher than that of the Nodewise based portfolios under the other DGPs. The exposure of portfolios based on the POET estimator is consistently higher under the factor DGP as well as under the other DGPs though it decreases rapidly when the number of assets increases. Overall, we see good performance of our estimator, it is mostly robust to several DGP’s even though all DGP’s violate the sparsity Assumption 2. POET, on the other hand, as expected performs well with factor model based DGP, but not so well with others. Ledoit-Wolf based estimator does well in Gaussian and t based data, but not in factor model and sparse Cholesky factor based DGP. 6 6.1 Empirics Performance Measures In this section we perform an out-of-sample forecasting exercise. We focus on four metrics commonly used in finance. These metrics are the Sharpe ratio (SR from now on), portfolio turnover, and the average returns and variances of portfolios. We compare our approach against the POET estimator 21 Factor Factor Markowitz Global minimum variance 0.8 0.6 0.4 0.2 0.8 0.6 0.4 0.2 250 500 750 1000 250 500 750 Gaussian random covariance Gaussian random covariance Markowitz Global minimum variance 400 400 200 200 0 1000 0 value 250 500 750 1000 250 500 750 Student random covariance Student random covariance Markowitz Global minimum variance 200 150 100 50 0 1000 200 150 100 50 0 250 500 750 1000 250 500 750 Sparse Cholesky factors Sparse Cholesky factors Markowitz Global minimum variance 500 400 300 200 100 0 1000 900 600 300 0 250 500 750 1000 250 500 750 p Estimator NodeWise Ledoit−Wolf POET Figure 1: Portfolio Variance Ratio Minus One, Median Absolute Value 22 1000 Factor Factor Markowitz Global minimum variance 0.08 0.06 0.04 0.02 0.00 0.08 0.06 0.04 0.02 0.00 250 500 750 1000 250 Gaussian random covariance Markowitz 750 1000 Global minimum variance 5e−04 4e−04 3e−04 2e−04 1e−04 5e−04 4e−04 3e−04 2e−04 1e−04 250 value 500 Gaussian random covariance 500 750 1000 250 Student random covariance Markowitz 1000 Global minimum variance 6e−04 4e−04 4e−04 2e−04 2e−04 500 750 Student random covariance 6e−04 250 500 750 1000 250 500 750 Sparse Cholesky factors Sparse Cholesky factors Markowitz Global minimum variance 1000 0.003 0.002 0.001 0.000 0.003 0.002 0.001 0.000 250 500 750 1000 250 500 750 p Estimator NodeWise Ledoit−Wolf POET Figure 2: Portfolio Variance Estimation Error, Median Absolute Value 23 1000 Factor Factor Markowitz Global minimum variance 0.100 0.075 0.050 0.025 0.000 0.075 0.050 0.025 0.000 250 500 750 1000 250 Gaussian random covariance Markowitz 750 1000 Global minimum variance 0.00015 0.00010 0.00005 0.00000 0.00015 0.00010 0.00005 0.00000 250 value 500 Gaussian random covariance 500 750 1000 250 Student random covariance 500 750 1000 Student random covariance Markowitz Global minimum variance 0.00020 0.00015 0.00010 0.00005 0.00020 0.00015 0.00010 0.00005 250 500 750 1000 250 500 750 Sparse Cholesky factors Sparse Cholesky factors Markowitz Global minimum variance 1e−03 1e−03 5e−04 5e−04 0e+00 1000 0e+00 250 500 750 1000 250 500 p Estimator NodeWise Ledoit−Wolf POET Figure 3: Portfolio Risk Error, Median Absolute Value 24 750 1000 Factor Factor Markowitz Global minimum variance 4 4.0 3.5 3.0 2.5 2.0 1.5 3 2 250 500 750 1000 250 500 750 Gaussian random covariance Gaussian random covariance Markowitz Global minimum variance 1.2 1.0 0.8 0.6 0.4 1000 1.0 0.5 value 250 500 750 1000 250 Student random covariance 500 750 1000 Student random covariance Markowitz Global minimum variance 1.6 1.2 0.8 0.4 1.6 1.2 0.8 0.4 250 500 750 1000 250 500 750 Sparse Cholesky factors Sparse Cholesky factors Markowitz Global minimum variance 2.0 1.5 1.0 0.5 1000 2.0 1.5 1.0 0.5 0.0 250 500 750 1000 250 500 750 p Estimator NodeWise Ledoit−Wolf POET Figure 4: Portfolio Weights Estimation Error, Median Absolute Value 25 1000 Factor Factor Markowitz 5 4 3 2 1 Global minimum variance 5 4 3 2 1 250 500 750 1000 250 500 750 Gaussian random covariance Gaussian random covariance Markowitz Global minimum variance 1.3 1.2 1.1 1.0 1000 1.3 1.2 1.1 1.0 value 250 500 750 1000 250 Student random covariance 500 750 1000 Student random covariance Markowitz Global minimum variance 1.6 1.4 1.2 1.0 1.6 1.4 1.2 1.0 250 500 750 1000 250 500 750 Sparse Cholesky factors Sparse Cholesky factors Markowitz Global minimum variance 1000 1.15 1.10 1.05 1.00 1.15 1.10 1.05 1.00 250 500 750 1000 250 500 p Estimator NodeWise Ledoit−Wolf POET Figure 5: Portfolio Exposure, Median Absolute Value 26 750 1000 and Ledoit and Wolf (2004) based estimator. We consider portfolio formation with and without transaction costs. Note that variance of large portfolio is analyzed in this paper, hence it will be interesting to see how our method performs against POET and Ledoit and Wolf (2004) based estimator. The SR, portfolio turnover, average returns are not analyzed in our paper theoretically, they need an entirely different mathematical setup, and technique. We will analyze SR in a future project. We use a rolling horizon method for out-of-sample forecasting. The samples of length n are split into a training part, in-sample indexed (1 : nI ) and a testing, or out-of-sample, part indexed (nI + 1 : n). The rolling window method works as follows: the portfolio weights are calculated in-sample for the period in between (1 : nI ) and denoted as ŵnI , then this is multiplied by the return in nI + 1 period to have the forecast portfolio return for nI + 1 period: ŵn0 I rnI +1 . Then we roll the window by one period and form the portfolio weight for the period: (2 : nI + 1) which we denote ŵnI +1 . This is again multiplied by returns at nI + 2 period to get the forecast for nI + 2 0 period: ŵn0 I +1 rnI +2 . In this way, we go until (including) n − 1 period and get ŵn−1 rn . So, in the case of no transaction costs, out-of-sample average portfolio returns across all out of sample observations is: n−1 X 1 ŵ0 rt+1 , µ̂os = n − nI t=n t I and variance for out of sample is: 2 σ̂os = n−1 X 1 (ŵ0 rt+1 − µ̂os )2 . (n − nI ) − 1 t=n t I We analyze these two measures above, average return and the variance in our Tables. Next measure is SR: SR = µ̂os /σ̂os . For transaction cost based Sharpe ratio, let c be the proportional transaction cost. This is chosen to be 50 basis points in DeMiguel et al. (2009b). Excess portfolio return at time t with transaction cost is (see Ban et al. (2016)), Returnt = ŵt0 rt+1 − c(1 + ŵt0 rt+1 ) p X + |ŵt+1,j − ŵt,j |, j=1 + where ŵt,j = ŵt,j (1 + Rt+1,j )/(1 + Rt+1,p ) and Rt+1,j is the excess return added to risk free rate for jth asset, and Rt+1,p is the portfolio excess return plus risk free rate. For this definition, see Li (2015). The SR with transaction costs is: SRc = µ̂os,c /σ̂os,c , 27 where µ̂os,c = n−1 X 1 Returnt , n − nI t=n I and 2 σ̂os,c = n−1 X 1 (Returnt − µ̂os,c )2 . (n − nI ) − 1 t=n I The next measure that we analyze is portfolio turnover (PT): PT = p n−1 XX 1 + |ŵt+1,j − ŵt,j |. n − nI t=n I 6.2 j=1 Data We use daily and monthly empirical datasets of S&P500 index with major assets. We use two different periods each for daily and monthly data. We have also tried other possibilities and time periods, but our tables are representative and similar to other period results. 1. First Monthly Data-Table 1: Full Sample: January 2000 to March 2017 with n = 207 and p = 384. a) In-Sample period 1: January 2000-March 2011(nI = 135), Out-Of-Sample 1: April 2011March 2017 (n − nI = 72). b) In-Sample Period 2: January 2000-March 2014 (nI = 171), Out-Of-Sample 2: April 2014March 2017 (n − nI = 36). 2. Second Monthly Data-Table 2: Full Sample: January 2000 to December 2013 with n = 168 and p = 384. a) In-Sample period 1: January 2000-March 2007(nI = 96), Out-Of-Sample 1: January 2008December 2013 (n − nI = 72). b) In-Sample Period 2: January 2000-March 2007 (nI = 96), Out-Of-Sample 2: January 2008-December 2010 (n − nI = 36). 3. First Daily Data-Table 3: Full Sample: February 4 2013 to March 31 2017 with n = 1047 and p = 458. a) In-Sample period 1: February 4 2013-March 31 2016(nI = 795), Out-Of-Sample 1: April 1 2016-March 31 2017 (n − nI = 252). b) In-Sample Period 2: February 4 2013-September 30 2016 (nI = 921), Out-Of-Sample 2: October 3 2016-March 31 2017 (n − nI = 126). 4. Second Daily Data-Table 4: Full Sample: February 4 2013 to August 8 2015 with n = 640 and p = 458. 28 a) In-Sample period 1: February 4 2013-August 18 2014(nI = 388), Out-Of-Sample 1: August 19 2014-August 18 2015 (n − nI = 252). b) In-Sample Period 2: February 4 2013-February 18 2015 (nI = 514), Out-Of-Sample 2: February 19 2015-August 18 2015 (n − nI = 36). The idea of first period of monthly data is: we cover all available months that we can obtain starting 2000. With the second monthly sample, we evaluate portfolios in the context of a recession and of its aftermath. For daily data, we use available data for a large number of assets. The idea of the first daily data is to forecast last year or six months of daily data based on in-sample period. In the second daily data, the span of data is shorter than the first daily data period, and includes a period where out-of-sample daily data has negative returns. The portfolios are rebalanced on a daily and monthly basis. At each rebalancing point, the expected return vector and the covariance matrices are re-estimated. For instance, for a sixyear (n − nI = 72) rolling window forecast horizon, we estimate expected returns and covariance matrices and formulate global minimum and Markowitz portfolios 72 times. Portfolios are held for one month and rebalanced at the beginning of the next month. As a return constraint, we use monthly target of 0.7974% and daily target of 0.0378 % which are equivalent of 10% return for a year when compounded. 6.3 Results We report the global minimum and Markowitz portfolio empirical results with and without transaction costs (TC in tables) based on the POET, Nodewise and Ledoit-Wolf estimators. Table 1 reports monthly portfolio performances for the full evaluation period of January 2000 March 2017. According to the results, Nodewise based portfolios without transaction costs provide the highest Sharpe Ratio (SR) and the lowest portfolio variance in six-year (n − nI = 72) out-ofsample period. In Table 1, Ledoit-Wolf estimator has the highest variance levels for all cases. Also, Nodewise based portfolios are generally associated with higher portfolio turnover in Table 1. With transaction costs at Table 1, SR of POET is the best in the second part of Table that covers three year out-of-sample period (n − nI = 36), but the difference between Nodewise and POET is not that large. Table 2 represents the out-of-sample results of January 2008 - December 2013 and January 2008 - December 2010 forecast horizon periods. Nodewise estimator based portfolios yield better out-ofsample portfolio variances in portfolios with transaction costs than the other estimators generally. Without transaction costs, POET performs lower out-of-sample variance results. However, the difference between Nodewise and POET estimators at variances is not large. Ledoit-Wolf based portfolios have the highest variance levels for both global minimum and Markowitz portfolios but better SR. Table 3 indicates the first daily portfolio performances. Performance results of Nodewise estimator based portfolios are more striking in terms of SR for portfolios with transaction cost for 29 Global Minimum Portfolio Return Variance Sharpe Turnover In-Sample: Jan 2000-Mar 2011, Out-Of-Sample: Apr without TC POET 0.008701 0.0008940 0.2910 0.09777 Nodewise 0.008894 0.0008830 0.2993 0.13829 Ledoit-Wolf 0.009683 0.0014824 0.2515 0.04718 with TC POET Nodewise Ledoit-Wolf 0.008376 0.008362 0.009638 0.0008849 0.0008916 0.0014990 0.2816 0.2800 0.2489 - In-Sample: Jan 2000-Mar 2014, Out-Of-Sample: Apr without TC POET 0.006152 0.0006870 0.2347 0.05755 Nodewise 0.006221 0.0007406 0.2286 0.15019 Ledoit-Wolf 0.005703 0.0009777 0.1824 0.04663 with TC POET Nodewise Ledoit-Wolf 0.006180 0.005751 0.005745 0.0007022 0.0007574 0.0010032 0.2332 0.2090 0.1814 - Return Markowitz Portfolio Variance Sharpe Turnover 2011-Mar 2017, nI = 135, n − nI = 72 0.008008 0.008116 0.008725 0.0008958 0.0008825 0.0014975 0.2676 0.2732 0.2255 0.11961 0.15773 0.04808 0.007543 0.007457 0.008662 0.0008883 0.0008921 0.0015152 0.2531 0.2497 0.2225 - 2014-Mar 2017 nI = 171, n − nI = 36 0.005714 0.005771 0.005699 0.0007088 0.0007605 0.0009774 0.2146 0.2093 0.1823 0.0746 0.1624 0.0467 0.005626 0.005197 0.005741 0.0007271 0.0007799 0.0010029 0.2086 0.1861 0.1813 - Table 1: Monthly Portfolio Performance: First Monthly Results Global Minimum Portfolio Return Variance Sharpe Turnover Return Markowitz Portfolio Variance Sharpe Turnover In-Sample: Jan 2000-Dec 2007, Out-Of-Sample: Jan 2008-Dec 2013, nI = 96, n − nI = 72 without TC POET 6.971e-03 0.002257 0.1467184 0.48679 0.007094 0.002088 0.15523 0.49969 NodeWise 7.842e-03 0.002287 0.1639747 0.15139 0.007971 0.002252 0.16797 0.19371 Ledoit-Wolf 4.537e-02 0.056525 0.1908248 0.08746 0.044104 0.052465 0.19255 0.08715 with TC POET NodeWise Ledoit-Wolf 4.498e-03 7.038e-03 4.509e-02 0.002391 0.002315 0.056269 0.0919897 0.1462547 0.1900708 - In-Sample: Jan 2000-Dec 2007, Out-Of-Sample: Jan without TC POET 0.0015308 0.003489 0.025915 0.83965 NodeWise 0.0024552 0.003592 0.040963 0.16816 Ledoit-Wolf 0.0246339 0.014686 0.203272 0.09226 with TC POET NodeWise Ledoit-Wolf -0.0042556 0.0001145 0.0228039 0.003689 0.003609 0.014859 -0.070065 0.001907 0.187075 - 0.004579 0.006980 0.043816 0.002222 0.002281 0.052232 0.09715 0.14615 0.19172 2008-Dec 2010, nI = 96, n − nI = 36 0.0002891 0.0006144 0.0243036 0.002871 0.003023 0.014522 0.005396 0.011174 0.201679 0.84461 0.23004 0.09199 -0.0054897 -0.0020261 0.0224671 0.003055 0.003028 0.014692 -0.099320 -0.036821 0.185353 - Table 2: Monthly Portfolio Performance: Second Monthly Results 30 - Global Minimum Portfolio Return Variance Sharpe Turnover Return Markowitz Portfolio Variance Sharpe Turnover In-Sample: Feb 4 2013-Mar 31 2016, Out-Of-Sample: Apr 1 2016-Mar 31 2017, nI = 795, n − nI = 252 without TC POET -1.129e-03 3.651e-04 -0.059075 2.23978 -3.109e-04 7.379e-05 -0.036193 0.97720 Nodewise 3.442e-04 3.997e-05 0.054450 0.05740 3.397e-04 3.865e-05 0.054645 0.06796 Ledoit-Wolf 5.961e-04 3.367e-05 0.102729 0.32489 5.601e-04 3.620e-05 0.093094 0.33374 with TC POET Nodewise Ledoit-Wolf -1.100e-02 6.191e-05 -1.002e-03 In-Sample: Feb 4 2013without TC POET 0.0004726 Nodewise 0.0004418 Ledoit-Wolf 0.0007994 with TC POET Nodewise Ledoit-Wolf 0.0004352 0.0001691 -0.0004171 6.475e-03 4.008e-05 3.349e-05 -0.136666 0.009778 -0.173219 - -5.113e-03 5.586e-06 -1.078e-03 5.709e-04 3.887e-05 3.767e-05 -0.214004 0.000896 -0.175671 - Sep 30 2016, Out-Of-Sample: Oct 3 2016-Mar 31 2017, nI = 921, n − nI = 126 2.445e-05 2.435e-05 2.791e-05 0.09558 0.08954 0.15129 0.00951 0.05655 0.25490 4.747e-04 4.408e-04 7.745e-04 2.457e-05 2.388e-05 3.109e-05 0.09577 0.09021 0.13891 0.02194 0.06508 0.26595 2.458e-05 2.439e-05 2.671e-05 0.08778 0.03424 -0.08072 - 3.749e-04 1.269e-04 -4.903e-04 2.473e-05 2.397e-05 3.088e-05 0.07539 0.02592 -0.08824 - Table 3: Daily Portfolio Performance: First Daily Results one-year forecast horizon, n − nI = 252. For portfolios with transaction cost, POET and LedoitWolf based portfolios attain negative SR. Even for both global minimum variance and Markowitz portfolios without transaction cost, POET has negative Sharpe ratios. This deterioration is mainly due to high turnover rates. Contrary to the other estimators for six-month daily forecast horizon n−nI = 126, Ledoit-Wolf estimator has the highest SR for the portfolios without transaction costs. However, Ledoit-Wolf based portfolios deteriorate in terms of turnover rates. When portfolios with transaction costs are considered, Ledoit-Wolf estimator results in negative SR. In terms of variance, in case of transaction costs, Nodewise and POET have good variances. In Table 4 all estimators have negative SR with transaction costs. But POET has the best performance among three in terms of SR with transaction costs. Ledoit-Wolf estimator has the best variance in this second daily data. In summary, Nodewise estimator shows good out of sample variance properties compared to other methods. In terms of SR, the results are mixed. POET estimator, when there are transaction costs, does well in daily data, followed by Nodewise. Ledoit-Wolf estimator has large variance generally but good SR with monthly data in case of transaction costs. Nodewise estimator performs well with larger out-of-sample horizon forecasts in terms of SR. 7 Conclusion In this paper, we analyze three aspects of a large portfolio. Namely, we consider variance, gross exposure, and the risk. These cases are shown when the number of assets is larger than the time 31 Global Minimum Portfolio Return Variance Sharpe Turnover Return Markowitz Portfolio Variance Sharpe Turnover In-Sample: Feb 4 2013-Aug 18 2014, Out-Of-Sample: Aug 19 2014-Aug 18 2015, nI = 388, n − nI = 252 without TC POET 2.160e-04 5.432e-05 0.029310 0.04707 1.721e-04 5.314e-05 0.0236040 0.07448 NodeWise 2.059e-04 5.393e-05 0.028041 0.11554 1.950e-04 5.299e-05 0.0267847 0.12763 Ledoit-Wolf 6.439e-04 3.636e-05 0.106788 0.45766 6.531e-04 3.700e-05 0.1073679 0.46179 with TC POET NodeWise Ledoit-Wolf -1.273e-05 -3.613e-04 -1.650e-03 In-Sample: Feb 4 2013without TC POET -0.0001218 NodeWise -0.0001987 Ledoit-Wolf 0.0002105 with TC POET NodeWise Ledoit-Wolf -0.0001671 -0.0006546 -0.0019979 5.479e-05 5.419e-05 3.522e-05 -0.001720 -0.049077 -0.278010 - -1.927e-04 -4.323e-04 -1.661e-03 5.358e-05 5.321e-05 3.710e-05 -0.0263184 -0.0592633 -0.2727097 - Feb 18 2015, Out-Of-Sample: Feb 19 2015-Aug 18 2015, nI = 514, n − nI = 126 4.388e-05 4.346e-05 3.701e-05 -0.01839 -0.03013 0.03461 0.01142 0.09489 0.43991 -0.0001801 -0.0002007 0.0002350 4.232e-05 4.228e-05 3.844e-05 -0.02768 -0.03087 0.03790 0.03569 0.10744 0.44033 4.416e-05 4.371e-05 3.765e-05 -0.02515 -0.09900 -0.32563 - -0.0003457 -0.0007194 -0.0019757 4.277e-05 4.269e-05 4.038e-05 -0.05285 -0.11011 -0.31089 - Table 4: Daily Portfolio Performance: Second Daily Results series involved. We show that increasing number of assets in a portfolio decreases estimation error for the portfolio variance, unlike the previous literature, under a sparsity assumption on the population inverse covariance matrix. Even without this sparsity assumption, still consistent estimation of variance is possible which is an important finding. Furthermore, we show consistent estimation of the gross exposure of the portfolio. Risk of the large portfolio is also estimated. We generalize the results by relaxing sub-Gaussianity of the returns assumption. We compare our estimator to the factor model based and shrinkage estimators in simulations and an application. Appendix A. In this section we provide proofs. Here, we repeat the proof of Theorem 3.2.4 in van de Geer et al. (2014) with more clarifying steps for the reader. Proof of Lemma 2.1. First by (2.7) kΘ̂Σ̂ − Ip k∞ ≤ max j λj . τ̂j2 (A.1) p Then uniformly in j, λj = O( logp/n). Also see that by Theorem 3.2.4 of van de Geer et al. p (2014), by Assumption maxj sj logp/n = o(1), |τ̂j2 − τj2 | = op (1). Note we define Θ = Σ−1 . Then, since τj2 = (Θ−1 j,j ) in van de Geer et al. (2014), via Assumption −1 3 kΘj k2 ≤ Λmin = O(1) uniformly in j. This last result implies minj τj2 > 0. Then by Assumption 32 3, τj2 ≤ Σj,j = O(1) uniformly in j. We combine these last two components to have kΘ̂Σ̂ − Ip k∞ = Op ( p logp/n) = op (1). Q.E.D. Before going through the main steps, the following norm inequality is used in all of the proofs. Take a p × p generic matrix: M , and a generic p × 1 vector x. Note that Mj0 represents 1 × p, jth row vector in M , and Mj is p × 1 vector (i.e. transpose of Mj0 , or column version of Mj0 ) kM xk1 = |M10 x| + |M20 x| + · · · + |Mp0 x| ≤ kM1 k1 kxk∞ + kM2 k1 kxk∞ + · · · + kMp k1 kxk∞ p X = [ kMj k1 ]kxk∞ j=1 ≤ p max kMj k1 kxk∞ , j (A.2) where we use Holders inequality to get each inequality. The following Lemma A.1 is useful for the proof of Theorem 3.1. Before that, we need a result from Theorem 3.2.4 of van de Geer et al. (2014). This is an l1 bound on the estimation error between Θ̂j and Θj . Under Assumption 1-3, we have p (A.3) kΘ̂j − Θj k1 = Op (sj logp/n). We define  = 10p Θ̂1p , also note that A = 10p Θ1p , where the population quantity Θ = Σ−1 . Lemma A.1. Under Assumptions 1-3, uniformly in j ∈ {1, · · · , p}, 1 | − A| = op (1). p Proof of Lemma A.1. First, see that  − A = 10p Θ̂1p − 10p Θ1p = 10p (Θ̂ − Θ)1p (A.4) Now consider the the right side of (A.4) |10p (Θ̂ − Θ)1p | ≤ k(Θ̂ − Θ)1p k1 k1p k∞ ≤ pkΘ̂j − Θj k1 p = Op (p max sj logp/n) = op (p), j (A.5) where Holders inequality is used in the first inequality, and (A.2) is used for the second inequality and the last equality is obtained by imposing Assumption 2. Q.E.D. 33 Proof of Theorem 3.1. We consider | Ap − Âp | Â−1 − 1 = . A−1 | Âp | (A.6) First, use Assumption 3 to have, (where C0 = Eigmin(Σ−1 ) > 0, C0 is a positive constant, and it represents the minimal eigenvalue of Θ = Σ−1 ) A = 10p Σ−1 1p ≥ pC0 > 0, which shows by Assumption 3 A/p ≥ C0 > 0. (A.7) p By Lemma A.1 and its proof we have p−1 | − A| = Op (maxj sj logp/n) = op (1), where we use Assumption 2 in last equality. Then use this last equation for the numerator in (A.6) via Assumption 2 p Op (maxj sj logp/n) op (1) Â−1 −1 ≤ = = op (1), (A.8) −1 A op (1) + C0 (op (1) + C0 ) where the denominator is bounded away from zero by A/p being bounded away from zero as shown in (A.7). Also use Â/p = A/p + op (1) by Lemma A.1 to get the denominator’s rate and the result. Q.E.D. The result below is needed for the subsequent lemmata. First, let rt be the asset return for all p assets at time t, and rt is p × 1 vector, and µ is the p × 1 population return vector. This result can be obtained by using Lemma 2.14.16 of Bühlmann and van de Geer (2011) since our returns are deemed to be sub-Gaussian. kn−1 n X rt − µk∞ = Op ( p logp/n) = op (1). (A.9) t=1 Note that we use sample mean to predict population mean. Before the next Lemma, we define B̂ = 10p Θ̂µ̂, and B = 10p Θµ. Lemma A.2. Under Assumptions 1-3, uniformly in j ∈ {1, · · · , p} 1 |B̂ − B| = op (1). p Proof of Lemma A.2. We can decompose B̂ by simple addition and subtraction into B̂ − B = 10p (Θ̂ − Θ)(µ̂ − µ) + 10p (Θ̂ − Θ)µ + 10p Θ(µ̂ 34 − µ) (A.10) (A.11) (A.12) Now we analyze each of the terms above. Defining µ̂ = n−1 Pn t=1 rt , |10p (Θ̂ − Θ)(µ̂ − µ)| ≤ k(Θ̂ − Θ)1p k1 kµ̂ − µk∞ ≤ p[ max kΘ̂j − Θj k1 ]kµ̂ − µk∞ 1≤j≤p p p = pO(max sj logp/n)Op ( logp/n), j (A.13) where we use Holder’s inequality in the first inequality, and the norm inequality in (A.2) with M = Θ̂ − Θ, x = 1p in the second inequality above, and the rate is by (A.3) and (A.9). So we consider (A.11) above. Note that by Assumption 1, kµk∞ < C < ∞, where C is a positive constant. |10p (Θ̂ − Θ)µ| ≤ k(Θ̂ − Θ)1p k1 kµk∞ ≤ Cp[ max kΘ̂j − Θj k1 ] 1≤j≤p p = CpOp (max sj logp/n), j (A.14) where we use Holder’s inequality in the first inequality, and the norm inequality in (A.2) with M = Θ̂ − Θ, x = 1p in the second inequality above, and the rate is by (A.3). Before the next proof, we need an additional result. First, by the proof of Theorem 3.2.4 in van de Geer et al. (2014), or proof of Lemma 5.3 of van de Geer et al. (2014), we have kγj k1 = √ O( sj ). Note that Θj = Cj /τj2 . Also remember taking j = 1, C1 = (1, −γ1 ) (without losing any generality here). By our Assumption 2, minj τj2 > 0. So max kΘj k1 = O(max j j √ sj ). (A.15) Now consider (A.12). |10p Θ(µ̂ − µ)| ≤ kΘ1p k1 kµ̂ − µk∞ ≤ p[ max kΘj k1 ]kµ̂ − µk∞ 1≤j≤p p √ = pOp (max sj )Op ( logp/n), j (A.16) where we use Holder’s inequality in the first inequality, and the norm inequality in (A.2) with M = Θ, x = 1p in the second inequality above, and the rate is from (A.15) and (A.9). Combine (A.13)(A.14)(A.16) in (A.10)-(A.12), and note that the largest rate is coming from (A.14). So use p Assumption 2, maxj sj logp/n = o(1) to have p p−1 |B̂ − B| = Op (max sj logp/n) = op (1). (A.17) j .Q.E.D. Next, we show the uniform consistency of another term in the estimated optimal weights. Note that D = µ0 Θµ, and its estimator is D̂ = µ̂0 Θ̂µ̂. 35 Lemma A.3.Under Assumptions 1-3, uniformly in j ∈ {1, · · · , p} p−1 |D̂ − D| = op (1). Proof of Lemma A.3. By simple addition and subtraction D̂ − D = (µ̂ − µ)0 (Θ̂ − Θ)(µ̂ − µ) 0 + (µ̂ − µ) Θ(µ̂ − µ) (A.18) (A.19) 0 + 2(µ̂ − µ) Θµ (A.20) 0 + 2µ (Θ̂ − Θ)(µ̂ − µ) (A.21) 0 + µ (Θ̂ − Θ)µ. (A.22) We start with (A.18). |(µ̂ − µ)0 (Θ̂ − Θ)(µ̂ − µ)| ≤ k(Θ̂ − Θ)(µ̂ − µ)k1 kµ̂ − µk∞ ≤ p[kµ̂ − µk∞ ]2 [max kΘ̂j − Θj k1 ] j p = pOp (logp/n)Op (max sj logp/n) j = Op (p max sj (logp/n)3/2 ), j (A.23) where Holder’s inequality is used for the first inequality above, and the inequality (A.2), with M = Θ̂ − Θ and x = µ̂ − µ for the second inequality above, and for the rates we use (A.3), (A.9). We continue with (A.19). |(µ̂ − µ)0 (Θ)(µ̂ − µ)| ≤ k(Θ)(µ̂ − µ)k1 kµ̂ − µk∞ ≤ p[kµ̂ − µk∞ ]2 [max kΘj k1 ] j √ = pOp (logp/n)Op (max sj ) j √ = Op (p max sj (logp/n)), j (A.24) where Holder’s inequality is used for the first inequality above, and the inequality (A.2), with M = Θ and x = µ̂ − µ for the second inequality above, for the rates we use (A.9), (A.15). Then we consider (A.20), with using kµk∞ ≤ C, |(µ̂ − µ)0 (Θ)(µ)| ≤ k(Θ)(µ̂ − µ)k1 kµk∞ ≤ Cp[kµ̂ − µk∞ ][max kΘj k1 ] j p √ = pOp ( logp/n)Op (max sj ) j √ = Op (p max sj (logp/n)1/2 ), j (A.25) where Holder’s inequality is used for the first inequality above, and the inequality (A.2), with 36 M = Θ and x = µ̂ − µ for the second inequality above, for the rates we use (A.9), (A.15). Then we consider (A.21). |(µ)0 (Θ̂ − Θ)(µ̂ − µ)| ≤ k(Θ̂ − Θ)(µ)k1 kµ̂ − µk∞ ≤ pkµk∞ max kΘ̂j − Θj k1 kµ̂ − µk∞ j ≤ Cp[max kΘ̂j − Θj k1 ]k(µ̂ − µ)k∞ j p p = pOp (max sj logp/n)Op ( logp/n) j = Op (p max sj logp/n), j (A.26) where Holder’s inequality is used for the first inequality above, and the inequality (A.2), with M = Θ̂ − Θ and x = µ for the second inequality above, and for the third inequality above we use kµk∞ ≤ C, and for the rates we use (A.3), (A.9). Then we consider (A.22), |(µ)0 (Θ̂ − Θ)(µ)| ≤ k(Θ̂ − Θ)(µ)k1 kµk∞ ≤ p[kµk∞ ]2 max kΘ̂j − Θj k1 j ≤ Cp[max kΘ̂j − Θj k1 ] j p = pOp (max sj logp/n) j = Op (p max sj (logp/n)1/2 ), j (A.27) where Holder’s inequality is used for the first inequality above, and the inequality (A.2), with M = Θ̂ − Θ and x = µ for the second inequality above, and for the third inequality above we use kµk∞ ≤ C, and for the rate we use (A.3). Note that the last rate above in (A.27) derives our result, since it is the largest rate by Assumption 2. Combine (A.23)-(A.27) in (A.18)-(A.22) and the rate in (A.27) to have p p−1 |D̂ − D| = Op (max sj logp/n) = op (1). (A.28) j Q.E.D. The following lemma establishes orders for the terms in the optimal weight, A, B, D. This is useful to understand the implications of the assumptions in Theorems 1-2. Note that both A, D are positive by Assumption 3, and bounded away from zero. Lemma A.4.Under Assumptions 1,3 A = O(p). |B| = O(p). D = O(p). 37 Proof of Lemma A.4. We do the proof for term D = µ0 Θµ. The proof for A = 10p Θ1p , is the same. D = µ0 Θµ ≤ Eigmax(Θ)kµk22 = O(p), where we use the fact that each µj is a constant by Assumption 1, and the maximal eigenvalue of Θ = Σ−1 is finite by Assumption 3. For term B, the proof can be obtained by using CauchySchwartz inequality first and the using the same analysis for terms A and D.Q.E.D. Next we need the following technical lemma, that provides the limit and the rate for the denominator in optimal portfolio. p Lemma A.5.Under Assumptions 1-3, uniformly over j in λj = O( logp/n) p−2 |(ÂD̂ − B̂ 2 ) − (AD − B 2 )| = op (1). Proof of Lemma A.5. Note that by simple adding and subtracting ÂD̂ − B̂ 2 = [( − A) + A][(D̂ − D) + D] − [(B̂ − B) + B]2 . Then using this last expression and simplifying, A, D being both positive p−2 |(ÂD̂ − B̂ 2 ) − (AD − B 2 )| ≤ p−2 {| − A||D̂ − D| + | − A|D + A|D̂ − D| + (B̂ − B)2 + 2|B||B̂ − B|} p = Op (max sj logp/n) = op (1), j (A.29) p where we use (A.5)(A.17)(A.28), Lemma A.4, and Assumption 2: maxj sj logp/n = o(1).Q.E.D. Proof of Theorem 3.2. Now we define notation to help us in the proof here. First set x̂ = Âρ21 − 2B̂ρ1 + D̂. (A.30) x = Aρ21 − 2Bρ1 + D. (A.31) ŷ = ÂD̂ − B̂ 2 . (A.32) y = AD − B 2 . (A.33) Then we can write the estimate of the optimal portfolio variance as Ψ̂OP V = x̂ , ŷ ΨOP V = x . y and the optimal portfolio variance is To start the main part of the proof we need a rate for a limit fraction: y/x. Note that the 38 fraction is positive by Assumptions AD − B 2 ≥ p2 C1 > 0, Aρ21 − 2Bρ1 + D ≥ pC1 > 0. y x = = AD AD − B 2 ≤ 2 2 Aρ1 − 2Bρ1 + D Aρ1 − 2Bρ1 + D 2 O(p ) = O(p), O(p) (A.34) where we use B 2 > 0 and the assumption Aρ21 − 2Bρ1 + D ≥ C1 p > 0 and Lemma A.4. So we can setup the problem as, by adding and subtracting xy from the numerator, and y/x > 0 by assumption, and use (A.34) for the second equality below Ψ̂OP V − ΨOP V ΨOP V = x̂ x y − ŷ y x x̂ x − ŷ y x̂y − xy + xy − xŷ = p O(1) ŷy p−3 {(x̂ − x)y + x(y − ŷ)} O(1) = p−4 {ŷy} = pO(1) = x̂−x y x y−ŷ p p2 + p p2 ŷ y p2 p2 O(1). (A.35) We consider each term in the numerator in (A.35). Via Lemma A.1-A.3, and ρ1 being bounded, and (A.5)(A.17)(A.28) p−1 |x̂ − x| = p−1 |Âρ21 − 2B̂ρ1 + D̂ − (Aρ21 − 2Bρ1 + D)| ≤ p−1 {| − A|ρ21 + 2|B̂ − B|ρ1 + |D̂ − D|} p = Op (max sj logp/n) = op (1), j (A.36) where we use Assumption 2 in the rate above. Now analyze the following term in the numerator p−2 y = p−2 AD − B 2 ≤ p−2 AD = O(1), (A.37) where we use B 2 > 0 in the inequality, and Lemma A.4 for the rate result, which is the final equality above in (A.37). Next, consider the following in the numerator p−1 x = p−1 Aρ21 − 2Bρ1 + D ≤ p−1 (Aρ21 + 2|B|ρ1 + D) = O(1), (A.38) where we use A, D being positive, and Lemma A.4, with ρ1 being bounded. Then Lemma A.5 and (A.29) provides p p−2 |ŷ − y| = p−2 |ÂD̂ − B̂ 2 − (AD − B 2 )| = Op (max sj logp/n) = op (1). (A.39) j 39 So the numerator in (A.35) is, p |x̂ − x| y x |y − ŷ| + = Op (max sj logp/n) = op (1), 2 2 j p p p p (A.40) where we use (A.36)-(A.39) and x > 0, y > 0 by Assumption. We consider the denominator in (A.35) [(ŷ − y) + y] y p2 p2   y y = op (1) + 2 p p2 ≥ (op (1) + C1 )C1 > 0, ŷ y p2 p2 = (A.41) where we add and subtract y in the first equality, and Lemma A.5 in the second equality, and p−2 y = p−2 (AD − B 2 ) ≥ C1 > 0, and C1 is a positive constant by assumption. Next, combine (A.40)(A.41) in (A.35) with Assumption 2 to have p Op (maxj sj logp/n) op (1) Ψ̂OP V − ΨOP V = 2 = op (1). ≤ 2 ΨOP V C1 + op (1) C1 + op (1) Q.E.D. Proof of Theorem 3.3. We start with the definition of the global minimum variance portfolio weight vector estimate Θ̂1p ŵu = , 10p Θ̂1p where we can write ŵu − wu = Θ̂1p 10p Θ̂1p − Θ1p . 10p Θ1p Using the definition of  = 10p Θ̂1p , and A = 10p Θ1p , via adding and subtracting AΘ1p from the numerator below ŵu − wu = = p−2 [(AΘ̂1p ) − (ÂΘ1p )] p−2 (ÂA) p−2 [(AΘ̂1p ) − (AΘ1p ) + (AΘ1p ) − (ÂΘ1p )] p−2 (ÂA) . Using the above result kŵu − wu k1 ≤ A k(Θ̂−Θ)1p k1 p p + |A−Â| kΘ1p k1 p p |Â| A p p . (A.42) Then in (A.48) consider the numerator. By (A.59)(A.60) k(Θ̂ − Θ)1p k1 = Op (p max sj j 40 p logp/n). (A.43) √ kΘ1p k1 = O(p maxj sj ). (A.44) and via Lemma A.4, A = O(p), also by (A.5) p−1 | − A| = Op (max sj j p logp/n). (A.45) By (A.43)-(A.45) A k(Θ̂ − Θ)1p k1 |A − Â| kΘ1p k1 + p p p p p = O(1)Op (max sj logp/n) j p q + Op (max sj logp/n)O( max sj ) j j p = Op ((max sj )3/2 logp/n) = op (1), j (A.46) p where we use sparsity assumption (maxj sj )3/2 logp/n = o(1) in the last step. Then for the denominator in (A.42) from (A.6)-(A.8) we have, for C0 > 0, is a positive constant, |Â| A ≥ (op (1) + C0 )C0 . p p (A.47) Now combine (A.46)(A.47) in (A.42) to have the desired result. Q.E.D. Proof of Theorem 3.4. Denote w∗ = ∆1 Θ1p + ∆2 Θµ, where ∆1 = D − ρ1 B , AD − B 2 ρ1 A − B . AD − B 2 ˆ 1 Θ̂1p + ∆ ˆ 2 Θ̂µ̂, where ∆ ˆ 1, ∆ ˆ 2 represent estimators for ∆1 , ∆2 respectively. We Next, denote ŵ = ∆ ˆ 1, ∆ ˆ 2 by replacing A, B, D, in the formula for ∆1 , ∆2 with their estimators shown in above get ∆ Theorems. Next, by adding and subtracting ∆2 = ˆ 1 Θ̂1p + ∆ ˆ 2 Θ̂µ̂ − ∆1 Θ1p − ∆2 Θµ ŵ − w∗ = ∆ ˆ 1 − ∆1 ) + ∆1 ][(Θ̂ − Θ) + Θ]1p = [(∆ ˆ 2 − ∆2 ) + ∆2 ][(Θ̂ − Θ) + Θ][(µ̂ − µ) + µ] + [(∆ − ∆1 Θ1p − ∆2 Θµ ˆ 1 − ∆1 )(Θ̂ − Θ)1p + (∆ ˆ 1 − ∆1 )Θ1p = (∆ ˆ 2 − ∆2 )(Θ̂ − Θ)(µ̂ − µ) + ∆1 (Θ̂ − Θ)1p + (∆ ˆ 2 − ∆2 )Θ(µ̂ − µ) + (∆ ˆ 2 − ∆2 )(Θ̂ − Θ)µ + (∆ ˆ 2 − ∆2 )Θµ + ∆2 (Θ̂ − Θ)(µ̂ − µ) + (∆ + ∆2 Θ(µ̂ − µ) + ∆2 (Θ̂ − Θ)µ. 41 (A.48) ˆ 1 , ∆1 , ∆ ˆ 2 , ∆2 are all scalars, Using (A.48), and since ∆ ˆ 1 − ∆1 )|k(Θ̂ − Θ)1p k1 + |(∆ ˆ 1 − ∆1 )|kΘ1p k1 kŵ − w∗ k1 ≤ |(∆ ˆ 2 − ∆2 )|k(Θ̂ − Θ)(µ̂ − µ)k1 + |∆1 |k(Θ̂ − Θ)1p k1 + |(∆ ˆ 2 − ∆2 )|kΘ(µ̂ − µ)k1 + |(∆ ˆ 2 − ∆2 )|k(Θ̂ − Θ)µk1 + |(∆ ˆ 2 − ∆2 )|kΘµk1 + |∆2 |k(Θ̂ − Θ)(µ̂ − µ)k1 + |(∆ + |∆2 |kΘ(µ̂ − µ)k1 + |∆2 |k(Θ̂ − Θ)µk1 . (A.49) We consider each term above. But rather than analyzing them one by one, we analyze common elements and then determine the order of each term on the right side of (A.49). Using the definitions of ŷ, y in (A.32)(A.33) respectively, and adding and subtracting y(D − ρ1 B) respectively from the numerator, with ρ1 being bounded,y > 0 by assumption ˆ 1 − ∆1 | = p p|∆ = p ≤ y(D̂ − ρ1 B̂) − ŷ(D − ρ1 B) ŷy y(D̂ − ρ1 B̂) − y(D − ρ1 B) + y(D − ρ1 B) − ŷ(D − ρ1 B) ŷy y D̂−D p2 p + y ρ B̂−B p2 1 p ŷ y p2 p2 + y−ŷ D−ρ1 B p p2 . (A.50) Now we analyze each term in the numerator. By Lemma A.4 with y > 0 by assumption y AD − B 2 AD = ≤ 2 = O(1). 2 2 p p p (A.51) p y |B̂ − B| y |D̂ − D| + |ρ | = O (max s logp/n). 1 p j j p2 p p2 p (A.52) Next, by (A.17)(A.28) Then |y − ŷ| |D − ρ1 B| ≤ p2 p |ÂD̂ − B̂ 2 − (AD − B 2 )| p2 ! D + |ρ1 ||B| p  = Op (max sj j p logp/n), (A.53) where we use y, ŷ definitions in the inequality, and to get the rate Lemma A.4 with (A.29) is used. Combine now (A.52)(A.53) in the numerator in (A.50) to have p y |D̂ − D| y |B̂ − B| |y − ŷ| |D − ρ1 B| + 2 |ρ1 | + = Op (max sj logp/n). 2 2 j p p p p p p Then combine (A.41)(A.54) to have ˆ 1 − ∆1 | = Op (max sj p|∆ j 42 p logp/n), (A.54) which simply implies ˆ 1 − ∆1 | = Op ( |∆ maxj sj p logp/n). p (A.55) maxj sj p logp/n). p (A.56) Exactly following the same way we derive ˆ 2 − ∆2 | = Op ( |∆ Consider, by using AD − B 2 ≥ p2 C1 > 0 by assumption |∆1 | = ≤ D − ρ1 B D − ρ1 B ≤ AD − B 2 p 2 C1 D + ρ1 B = O(1/p), p 2 C1 (A.57) where we use Lemma A.4 to have D = O(p), |B| = O(p), and ρ1 being bounded. In the same way we obtain |∆2 | = O(1/p). (A.58) Next consider, k(Θ̂ − Θ)1p k1 ≤ p max kΘ̂j − Θj k1 j p = Op (p max sj logp/n), j (A.59) where we use (A.2) for the inequality, and (A.3) for the rate result in (A.59). Now we analyze kΘ1p k1 ≤ p max kΘj k1 = O(p j q max sj ), j (A.60) where the inequality is obtained by (A.2), and the rate is derived by (A.15). Next, we consider the following term: k(Θ̂ − Θ)(µ̂ − µ)k1 ≤ pk(µ̂ − µ)k∞ max kΘ̂j − Θj k1 j = Op (pmaxj sj logp/n), (A.61) where we use (A.2) for the first inequality, and the rate is derived from (A.3)(A.9). Then consider given kµk∞ ≤ C k(Θ̂ − Θ)µk1 ≤ Cp max kΘ̂j − Θj k1 j p = Op (p max sj logp/n), j where we use (A.2) for the first inequality, and the rate is derived from (A.3). Note that q kΘµk1 = Op (p max sj ), j where we use the same analysis in (A.60). 43 (A.62) (A.63) Next, kΘ(µ̂ − µ)k1 ≤ pkµ̂ − µk∞ max kΘj k1 j p √ = pOp ( logp/n)O(max sj ) j p q = Op (p max sj logp/n), (A.64) j where we use (A.2) for the first inequality and (A.9)(A.15) for rates. Use (A.55)-(A.64) in (A.49) to have kŵ − w∗ k1 = Op ((maxj sj )2 logp/n) + Op ((maxj sj )3/2 (logp/n)1/2 ) + Op (max sj (logp/n)1/2 ) + Op ((max sj )2 (logp/n)3/2 ) j j 3/2 + Op ((max sj ) j 3/2 + Op ((max sj ) j 1/2 + Op ((max sj ) j 3/2 = Op ((max sj ) j logp/n) + Op ((max sj )2 (logp/n)) j 1/2 (logp/n) ) + Op ((max sj )(logp/n)) j 1/2 (logp/n) ) + Op ((max sj )(logp/n)1/2 ) j 1/2 (logp/n) ) = op (1), (A.65) where we use the fact that (maxj sj )3/2 (logp/n)1/2 is the slowest rate of convergence on the right hand side terms. Then by (maxj sj )3/2 (logp/n)1/2 = o(1) we have the last result.Q.E.D Proof of Theorem 3.5. We consider |ŵu0 (Σ̂ − Σ)ŵu | ≤ kŵu k21 kΣ̂ − Σk∞ . (A.66) In (A.66) we analyze each right side term. First, kŵu k1 ≤ kŵu − wu k1 + kwu k1 . (A.67) Then from the definition of global minimum variance portfolio kwu k1 = kΘ1p k1 . 10p Θ1p (A.68) Apply (A.7)(A.60) in (A.68) to have O(p maxj kwu k1 ≤ pC0 √ sj ) √ = O(max sj ). (A.69) j Then use (A.69) and Theorem 3.3 in (A.67) to have p √ √ kŵu k1 = Op ((max sj )3/2 logp/n) + O(max sj ) = op (1) + O(max sj ), j j j (A.70) p where we use Assumption that (maxj sj )3/2 logp/n = o(1) in the second equality. p Then use p.1195 of van de Geer et al. (2014) to have kΣ̂ − Σk∞ = Op ( logp/n) and (A.70) in 44 (A.66) to have |ŵu0 (Σ̂ − Σ)ŵu | ≤ Op (max sj )Op ( j where we use Assumption that (maxj sj )3/2 Proof of Theorem 3.6. We consider p logp/n) = op (1), (A.71) p logp/n = o(1) in the second equality.Q.E.D. |ŵ0 (Σ̂ − Σ)ŵ| ≤ kŵk21 kΣ̂ − Σk∞ . (A.72) In (A.72) we analyze each right side term. First, kŵk1 ≤ kŵ − w∗ k1 + kw∗ k1 . (A.73) Then from the definition of Markowitz portfolio kw∗ k1 ≤ ≤ |D − ρ1 B| ρ1 A − B kΘ1p k1 + kΘµk1 AD − B 2 AD − B 2 |ρ1 ||A| + |B| |D| + |ρ1 ||B|| kΘ1p k1 + kΘµk1 . AD − B 2 AD − B 2 (A.74) On the right side of (A.74) above, we use the analysis in (A.60), (A.63) for kΘ1p k1 , kΘµk1 , and ρ1 is bounded, and by Lemma A.4 with assumption AD − B 2 ≥ C1 p2 > 0, to have kw∗ k1 ≤ O(p) O(p) √ √ √ O(p max sj ) + O(p max sj ) = O(max sj ). 2 2 j j j C1 p C1 p (A.75) The rest of proof follows exactly as in the proof of Theorem 3.5, given the result in Theorem 3.4 to be used in (A.73).Q.E.D. Appendix B. In this part of the Appendix, we analyze what happens when we relax sub-Gaussian returns assumption. Given Assumptions 1*,2*,3 going over proof of Lemma 2.1, with maxj λj = O(p2/l /n1/2 ), we get kΘ̂Σ̂ − Ip k∞ = Op (p2/l /n1/2 ) = op (1). Next, one of the most important inputs to proofs of Theorems 3.1-3.6 are (A.3). Lemma 2 of Caner and Kock (2014) show that max kΘ̂j − Θj k1 = Op ((max sj )p2/l /n1/2 ). j j Note that the result above is a subcase of Lemma 2 in Caner and Kock (2014) with no restrictions, h = 1 in their notation. After that we need to adjust (A.9) to reflect the new return structure. Following Lemma A.4 of Caner and Kock (2014) we have kµ̂ − µk∞ = Op (p2/l /n1/2 ) = op (1). The rest of the proofs for Theorems 3.1-3.6 follow from these equations in Appendix A. So the main √ difference with Theorems 3.1-3.6 will be that in approximation rates, we replace logp with p2/l . 45 References Aı̈t-Sahalia, Y. and D. Xiu (2016): “Using principal component analysis to estimate a high dimensional factor model with high frequency data,” Forthcoming, Journal of Econometrics. Antoniadis, A. and J. Fan (2001): “Regularization of Wavelet Approximations,” Journal of the American Statistical Association, 96, 939–967. Ao, M., Y. Li, and X. Zheng (2017): “Heteroskedasticity in Asset Returns and High Dimensional Portfolio Selection,” Working Paper, Xiamen University, WISE. Bai, J. and S. Ng (2002): “Determining the Number of Factors in Approximate Factor Models,” Econometrica, 70, 191–221. Ban, G. Y., N. El Karoui, and A. E. Lim (2016): “Machine learning and portfolio optimization,” Working paper, Department of Statistics, U. California Berkeley, submitted to Management Science. Bickel, P. J. and E. Levina (2008): “Covariance regularization by thresholding,” Annals of Statistics, 36, 2577–2604. Brodie, J., I. Daubechies, C. De Mol, D. Giannone, and I. Loris (2009): “Sparse and stable Markowitz portfolios,” Proceedings of the National Academy of Sciences, 106, 12267–12272. Bühlmann, P. and S. van de Geer (2011): Statistics for High-Dimensional Data: Methods, Theory and Applications, Springer Publishing Company, Incorporated, 1st ed. Cai, T. and W. Liu (2011): “Adaptive Thresholding for Sparse Covariance Matrix Estimation,” Journal of the American Statistical Association, 106, 672–684. Cai, T., W. Liu, and X. Lou (2011): “A Constrained L1 Minimization Approach to Sparse Precision Matrix Estimation,” Journal of the American Statistical Association, 106, 594–607. Callot, L. A. F., A. B. Kock, and M. C. Medeiros (2016): “Modeling and Forecasting Large Realized Covariance Matrices and Portfolio Choice,” Journal of Applied Econometrics, forthcoming. Caner, M., X. Han, and Y. Lee (2017): “Adaptive Elastic Net GMM Estimation with Many Invalid Moment Conditions: Simultaneous Model and Moment Selection,” Journal of Business and Economic Statistics, forthcoming. Caner, M. and A. Kock (2014): “Asymptotically Honest Confidence Regions for High Dimensional Parameters by the Desparsified Conservative Lasso,” Creates research papers, School of Economics and Management, University of Aarhus. Chamberlain, G. and M. Rothschild (1983): “Arbitrage, Factor Structure, and Mean-Variance Analysis on Large Asset Markets,” Econometrica, 51, 1281–1304. 46 Daniels, M. and R. Kass (2001): “Shrinkage Estimator for Covariance Matrices,” Biometrics, 57, 1173–1184. d’Aspremont, A., O. Banerjee, and L. El Ghaoui (2008): “First-Order Methods for Sparse Covariance Selection,” SIAM. Journal of Matrix Analysis and Applications, 30. DeMiguel, V., L. Garlappi, F. J. Nogales, and R. Uppal (2009a): “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms,” Management Science, 55, 798–812. DeMiguel, V., L. Garlappi, and R. Uppal (2009b): “Optimal Versus Naive Diversification: How Inefficient is the 1/N Portfolio Strategy?” Review of Financial Studies, 22, 1915–1953. Fan, J., Y. Fan, and J. Lv (2008): “High dimensional covariance matrix estimation using a factor model,” Journal of Econometrics, 147, 186–197. Fan, J., Y. Feng, and Y. Wu (2009): “Network exploration via the adaptive LASSO and SCAD penalties,” The Annals of Applied Statistics, 3, 521–541. Fan, J., A. Furger, and D. Xiu (2016): “Incorporating global industrial classification standard into portfolio allocation: A simple factor-based large covariance matrix estimator with high frequency data,” Journal of Business and Economic Statistics, 34, 489–503. Fan, J. and R. Li (2001): “Variable Selection via Nonconcave Penalized Likelihood and its Oracle Properties,” Journal of the American Statistical Association, 96, 1348–1360. Fan, J., Y. Liao, and M. Mincheva (2011): “High-dimensional covariance matrix estimation in approximate factor models,” Annals of Statistics, 39, 3320–3356. ——— (2013): “Large covariance estimation by thresholding principal orthogonal complements,” Journal of the Royal Statistical Society: Series B (Statistical Methodology), 75, 603–680. Fan, J., Y. Liao, and X. Shi (2015): “Risks of large portfolios,” Journal of Econometrics, 186, 367 – 387. Fan, J., J. Zhang, and K. Yu (2012): “Vast Portfolio Selection With Gross-Exposure Constraints,” Journal of the American Statistical Association, 107, 592–606. Friedman, J., T. Hastie, and R. Tibshirani (2008): “Sparse inverse covariance estimation with the graphical lasso,” Biostatistics, 9, 432–441. ——— (2010): “Regularization Paths for Generalized Linear Models via Coordinate Descent,” Journal of Statistical Software, 33, 1–22. Green, R. C. and B. Hollifield (1992): “When Will Mean-Variance Efficient Portfolios be Well Diversified?” Journal of Finance, 47, 1785–1809. Hautsch, N., L. M. Kyj, and R. C. Oomen (2012): “A blocking and regularization approach to high-dimensional realized covariance estimation,” Journal of Applied Econometrics, 27, 625–645. 47 Huang, J. Z., N. Liu, M. Pourahmadi, and L. Liu (2006): “Covariance matrix selection and estimation via penalised normal likelihood,” Biometrika, 93, 85–98. Jagannathan, R. and T. Ma (2003): “Risk Reduction in Large Portfolios: Why Imposing the Wrong Constraints Helps,” Journal of Finance, 58, 1651–1684. Javanmard, A. and A. Montanari (2013): “Hypothesis Testing in High-Dimensional Regression under the Gaussian Random Design Model: Asymptotic Theory,” CoRR, abs/1301.4240. Kourtis, A., G. Dotsis, and R. N. Markellos (2012): “Parameter uncertainty in portfolio selection: Shrinking the inverse covariance matrix,” Journal of Banking and Finance, 36, 2522– 2531. Ledoit, O. and M. Wolf (2003): “Improved estimation of the covariance matrix of stock returns with an application to portfolio selection,” Journal of Empirical Finance, 10, 603–621. ——— (2004): “A well-conditioned estimator for large-dimensional covariance matrices,” Journal of Multivariate Analysis, 88, 365–411. ——— (2012): “Nonlinear shrinkage estimation of large-dimensional covariance matrices,” Annals of Statistics, 40, 1024–1060. ——— (2015): “Spectrum estimation: A unified framework for covariance matrix estimation and PCA in large dimensions,” Journal of Multivariate Analysis, 139, 360–384. Levina, E., A. Rothman, and J. Zhu (2008): “Sparse estimation of large covariance matrices via a nested Lasso penalty,” The Annals of Applied Statistics, 2, 245–263. Li, J. (2015): “Sparse and Stable Portfolio Selection With Parameter Uncertainty,” Journal of Business and Economic Statistics, 33, 381–392. Li, Y., Y. Ding, and X. Zheng (2017): “High Dimensional Minimum Variance Portfolio under Factor Model,” Working Paper, Hong Kong University of Science and Technology. Liu, Q. (2009): “On portfolio optimization: How and when do we benefit from high-frequency data?” Journal of Applied Econometrics, 24, 560–582. Markowitz, H. (1952): “Portfolio Selection,” Journal of Finance, 7, 77–91. ——— (1990): Mean-Variance Analysis in Portfolio Choice and Capital Markets, Basic Blackwell, Incorporated, 1st ed. Meinshausen, N. and P. Bühlmann (2006): “High-dimensional graphs and variable selection with the Lasso,” Annals of Statistics, 34, 1436–1462. Michaud, R. O. (1989): “The Markowitz Optimization Enigma: Is Optimized Optimal,” Financial Analysts Journal. 48 O.Banerjee, L. El Ghaoui, and A. d’Aspremont (2008): “Model Selection Through Sparse Maximum Likelihood Estimation for Multivariate Gaussian or Binary Data,” Journal of Machine Learning Research, 9, 485–516. R Core Team (2015): R: A Language and Environment for Statistical Computing, R Foundation for Statistical Computing, Vienna, Austria. Ravikumar, P., M. J. Wainwright, G. Raskutti, and B. Yu (2011): “High-dimensional covariance estimation by minimizing L1 -penalized log-determinant divergence,” Electronic Journal of Statistics, 5, 935–980. Ross, S. A. (1976): “The arbitrage theory of capital asset pricing,” Journal of Economic Theory, 13, 341–360. ——— (1977): “The Capital Asset Pricing Model (CAPM), Short-Sale Restrictions and Related Issues,” Journal of Finance, 32, 177–83. Rothman, A. J., P. J. Bickel, E. Levina, and J. Zhu (2008): “Sparse permutation invariant covariance estimation,” Electronic Journal of Statistics, 2, 494–515. Rothman, A. J., E. Levina, and J. Zhu (2009): “Generalized Thresholding of Large Covariance Matrices,” Journal of the American Statistical Association, 104, 177–186. ——— (2010): “A new approach to Cholesky-based covariance regularization in high dimensions,” Biometrika, 97, 539–550. Sharpe, W. (1963): “A Simplified Model for Portfolio Analysis,” Management Science, 9, 277–293. Tibshirani, R. (1994): “Regression Shrinkage and Selection Via the Lasso,” Journal of the Royal Statistical Society, Series B, 58, 267–288. van de Geer, S., P. Bhlmann, Y. Ritov, and R. Dezeure (2014): “On asymptotically optimal confidence regions and tests for high-dimensional models,” Annals of Statistics, 42, 1166–1202. Wang, H., B. Li, and C. Leng (2009): “Shrinkage tuning parameter selection with a diverging number of parameters,” Journal of the Royal Statistical Society: Series B, 71, 671–683. Wong, F., C. K. Carter, and R. Kohn (2003): “Efficient estimation of covariance selection models,” Biometrika, 90, 809–830. Wu, W. B. and M. Pourahmadi (2003): “Nonparametric estimation of large covariance matrices of longitudinal data,” Biometrika, 90, 831–844. Yuan, M. and Y. Lin (2007): “Model selection and estimation in the Gaussian graphical model,” Biometrika, 94, 19–35. Zou, H. (2006): “The Adaptive Lasso and Its Oracle Properties,” Journal of the American Statistical Association, 101, 1418–1429. 49 Zou, H. and T. Hastie (2005): “Regularization and variable selection via the Elastic Net,” Journal of the Royal Statistical Society, Series B, 67, 301–320. Zou, H., T. Hastie, R. Tibshirani, et al. (2007): “On the degrees of freedom of the lasso,” Annals of Statistics, 35, 2173–2192. 50
10math.ST
Under consideration for publication in Theory and Practice of Logic Programming 1 arXiv:cs/0601072v1 [cs.PL] 16 Jan 2006 Fast Frequent Querying with Lazy Control Flow Compilation Remko Tronçon∗, Gerda Janssens, Bart Demoen, Henk Vandecasteele K.U.Leuven – Department of Computer Science (e-mail: {remko,gerda,bmd,henkv}@cs.kuleuven.be) submitted 15 April 2005 ; revised 13 October 2005; accepted 13 January 2006 Abstract Control flow compilation is a hybrid between classical WAM compilation and meta-call, limited to the compilation of non-recursive clause bodies. This approach is used successfully for the execution of dynamically generated queries in an inductive logic programming setting (ILP). Control flow compilation reduces compilation times up to an order of magnitude, without slowing down execution. A lazy variant of control flow compilation is also presented. By compiling code by need, it removes the overhead of compiling unreached code (a frequent phenomenon in practical ILP settings), and thus reduces the size of the compiled code. Both dynamic compilation approaches have been implemented and were combined with query packs, an efficient ILP execution mechanism. It turns out that locality of data and code is important for performance. The experiments reported in the paper show that lazy control flow compilation is superior in both artificial and real life settings. KEYWORDS: Logic Programming, Inductive Logic Programming, Warren Abstract Machine, Compilation 1 Introduction In the context of inductive logic programming (ILP), a large number of queries is generated dynamically, and then run on a large set of examples. From the data mining point of view, such a query is a hypothesis, and by running the query on the examples one can check how well the hypothesis covers these examples. From an implementor’s point of view, every example is a Prolog program, and the queries are just Prolog queries that have to be executed against this large number of programs. Previously, only 2 options were considered: either the queries are meta-called, or the queries are first compiled to more efficient WAM bytecode after which this code is executed. The second option was identified to be the best in the ILP setting (Blockeel et al. 2002). Moreover, query packs (Blockeel et al. 2002) were developed as a specialized execution mechanism for executing large sets of queries, improving execution time up to a factor 100. Adapting meta-call to handle these query packs ∗ Remko Tronçon is supported by the Institute for the Promotion of Innovation by Science and Technology in Flanders (I.W.T.). 2 R. Tronçon et al. is difficult and inefficient, and therefore compilation is needed (Blockeel et al. 2002; Demoen et al. 1999). However, experiments indicate that even though compilation improves the total execution time of queries, the compilation time often dominates the total time of an ILP run. This raises the question of what can be done to decrease the compilation time, or, in other words, how we can simplify the compilation step. Control flow compilation realizes this by only compiling the control flow of a query (which deals for example with the selection of branches in a disjunction), and by using special meta-call like WAM instructions for calling predicates, thus omitting the need to do the complex step of setting up arguments to calls. In this paper we propose control flow compilation as a novel fast compilation scheme for queries. This compilation scheme does not affect query execution performance, and moreover can be performed in a lazy (or ‘just-in-time’) fashion. The contributions of this paper are: • Control Flow Compilation, which is a hybrid approach between meta-calling and classical compilation. This scheme incorporates the best of both worlds: it has the fast execution times of compiled code, without needing the expensive compilation step (which is a dominating factor in practical ILP settings). • Lazy control flow compilation, which is a Just-In-Time (JIT) version of the control flow compilation scheme. Unreachable parts of the code are not compiled; this reduces both the compilation time and the code size. • An evaluation of integrating (lazy) control flow compilation in a practical ILP system. A fast light-weight compiler for (lazy) control flow compilation was implemented in the hipP system, a Prolog system with specific support for ILP (such as query packs). The topic of this paper was already introduced in (Tronçon et al. 2003; Tronçon et al. 2004), discussing an experimental implementation and some preliminary results on this and related techniques. The organization of the paper is as follows: in Section 2, we briefly sketch the ILP context, the setting that motivated our work. In Section 3, control flow compilation is introduced and evaluated on both artificial and real life benchmarks. A lazy variant of this scheme is introduced in Section 4. Both approaches are then adapted to a practical ILP setting, by extending them to the query packs execution mechanism in Section 5. This extension is again evaluated on real life ILP benchmarks. Section 6 discusses memory management issues of the approaches described in this paper. Finally, conclusions and future work are given in Section 7. We assume the reader is familiar with the WAM (Warren 1983; Ait-Kaci 1990). 2 Context: Dynamically Generated Queries in ILP We start by sketching the role of dynamically generated queries and their execution in the ILP setting. The goal of ILP is to find a theory that best explains a large set of data (or examples). In the ILP setting at hand, each example is a logic program, Theory and Practice of Logic Programming 3 and the theory is represented as a set of logical queries. The ILP algorithm finds good queries by using generate-and-test. In the first step, it uses its own specific approach to generate queries, which are then evaluated in the second step. Based on the failure or success of these queries, only the ones with the ‘best’ results are kept and are extended (by adding literals). Which queries are best depends on the ILP algorithm: for example, in the case of classification, the information gain can be used as a criterion, whereas in the case of regression, the reduction of variance is often used. The extended queries are in turn tested on a set of examples, and this process continues until a satisfactory query (or set of queries) describing the examples has been found. We will focus on the efficiency of the second step. At each iteration of the algorithm, a set of queries is executed against a large set of logic programs (the examples). Since these queries are the result of adding different literals at the end of another query, the queries in this set have a lot of common prefixes. To avoid repeating the common parts by executing each query separately, the set of queries can be transformed into a special kind of disjunction: a query pack (Blockeel et al. 2002). For example, the set of queries ?- a, b, c, d. ?- a, b, c, e. ?- a, b, f, g. is transformed into the query ?- a, b, ( (c,(d;e)) ; f,g ). by applying left factoring on the initial set of queries. However, because only the success of a query on an example is relevant to the ILP algorithm, the normal Prolog disjunction might still cause too much backtracking. So, for efficiency reasons the ’;’/2 is given a different procedural behavior in query packs: it cuts away branches from the disjunction as soon as they succeed. For this paper, it is sufficient to know that the semantics of query packs is very close to the one of normal disjunctions. Since each query pack is run on a large set of examples, a query pack is first compiled, and the compiled code is executed on the examples. This compiled code makes use of special WAM instructions for the query pack execution mechanism. More details can be found in (Blockeel et al. 2002). Our paper proposes a new compilation approach for dynamically generated queries. It is independent of the actual query optimization schemes used. Moreover, it is useful for other Prolog engines as well, and is independent of the engine-specific support for ILP. After discussing how to use the approach to compile queries in general, we will apply it to the specific case of query pack compilation. 3 Control Flow Compilation 3.1 Technology To execute a dynamically generated query, we can either meta-call it, or we can transform it into a non-recursive clause (by taking the query as the body and adding a head, e.g. query/0), and run the compiled clause. Executing this compiled version of the query instead of meta-calling it results in considerable speedups. 4 R. Tronçon et al. Moreover, in order to benefit from an efficient execution mechanism such as query packs, queries have to be compiled into the special WAM instructions. However, compilation of a query can be a costly task; in the ILP setting, compilation of a query can take as much time as its execution on all examples. This motivated the preliminary study of alternatives for compile & run in (Tronçon et al. 2003). The most interesting alternative turned out to be control flow compilation, which is a hybrid between meta-calling and compiling a query. In this section, we introduce control flow compilation for queries whose bodies consist of conjunctions and disjunctions, and explain this approach in terms of the familiar WAM instructions. The experiments confirm the potential of control flow compilation. This scheme will be extended to control flow compilation for ILP query packs in Section 5. The essential difference between classical compilation and control flow compilation is the sequence of instructions generated for setting up and calling a goal. Instead of generating the usual WAM put and call instructions, control flow compilation generates one new cf call instruction, whose argument points to a heap data structure (the goal) that is meta-called. Hence, control flow code only contains the control flow instructions (try, retry, . . . ) and cf call (and cf deallex1) instructions. For example, control flow compiling the query query :- a(X,Y), ( b(Y,Z) ; c(Y,Z), d(Z,U); e(a,Y) ). results in the code in the left part of Figure 1. Note that, because queries are dynamically generated by the ILP system, the query itself is a term on the heap, and we use &a(X,Y) to represent the pointer to its subterm a(X,Y). On the right of Figure 1 is the classical compiled code for the same query2 . Before calling each goal, the compiled code first sets up the arguments to the goal, whereas the control flow compiled code uses a reference to the subterm of the query to indicate the goal that is called. The most important aspect is that the control flow code saves emulator cycles, because it contains no instructions related to the arguments of the goals that are called. Moreover, the absence of these kinds of instructions has other positive consequences: (1) it makes the expensive (non-linear) argument register allocation step unnecessary, saving compilation time, and (2) it makes it easy to incrementally add new code to existing parts of code. The latter is very interesting because it makes introducing laziness in the compilation process possible, as explained in Section 4. Contrary to compiled code, control flow code cannot exist on its own, since it contains external references to terms on the heap. Therefore, an implementation must take the following garbage collection issues into consideration: (1) the terms of the query have to be kept alive as long as the control flow compiled code can 1 2 cf deallex is the instruction obtained by merging deallocate and cf execute. The instruction set used in this example is based on the XSB implementation: the suffixes tvar and pval correspond to the WAM temporary and permanent variables respectively. Theory and Practice of Logic Programming 5 query :- a(X,Y), ( b(Y,Z) ; c(Y,Z), d(Z,U); e(a,Y) ). Control flow code allocate 2 Compiled code allocate 4 bldtvar A1 putpvar Y2 A2 call a/2 trymeorelse L1 putpval Y2 A1 bldtvar A2 deallex b/2 retrymeorelse L2 putpval Y2 A1 putpvar Y3 A2 call c/2 putpval Y3 A1 bldtvar A2 deallex d/2 trustmeorelsefail putpval Y2 A2 put atom A1 a deallex e/2 cf call &a(X,Y) trymeorelse L1 L1: cf deallex &b(Y,Z) retrymeorelse L2 cf call &c(Y,Z) L2: cf deallex &d(Z,U) trustmeorelsefail cf deallex &e(a,Y) Fig. 1. Control flow compiled code vs. classical compiled code. Compiled code No Inlining ... call a/2 putpval Y2 A1 putpval Y3 A2 b smaller A1 A2 ... ... cf call &a(X,Y) cf call &(X<Y) ... Control Flow code Built-ins Special Built-ins ... cf call &a(X,Y) putarg &X A1 putarg &Y A2 b smaller A1 A2 ... ... cf call &a(X,Y) cf smaller &X &Y ... Fig. 2. Built-in inlining for (a(X,Y), X < Y) be executed; (2) when these terms are moved to another place in memory, the references in the code must be adapted as well. Moreover, executing general clauses requires that new variables be created prior to executing the body, whereas this is not necessary for queries: because queries will never be called recursively, the variables already existing on the heap can be used. To speed up execution, the classical compilation scheme typically inlines smaller predicates (such as tests) using dedicated instructions implemented in the system. This is illustrated by the first column of Figure 2: the WAM compiler initializes the argument registers, and instead of calling a (WAM-compiled) ’<’/2 predicate, it 6 R. Tronçon et al. emits a built-in instruction to do the test. Since control flow compilation also emits WAM bytecode, the same built-ins can be used for control flow compiled code as for classical compiled code. These built-in instructions typically use argument registers for their arguments, so the compiler just needs to emit extra instructions to move data structures on the heap into the correct argument registers. These are illustrated in the third column of Figure 2, where the putarg instructions move references to data structures on the heap into the relevant argument registers for the built-in instruction. Alternatively, the extra emulator cycles needed for filling the argument registers can be skipped by defining special versions of each built-in that, instead of argument registers, have references to the heap as their parameters, such as cf smaller in Figure 2. 3.2 Evaluation For evaluating our approach, we added support for control flow code to the hipP system (hipP 2004), an efficient WAM based Prolog system written in C, and descendant of ilProlog. A separate control flow compiler for queries was implemented in this system. This compiler was written in Prolog, as is the case for the existing classical compiler. For the built-in predicates that are frequently used in ILP applications (e.g. ’<’/2, ’>’/2, ’=’/2, ’\=’/2, . . . ), we implemented special control flow instructions (such as cf smaller from Figure 2), and these built-ins are inlined by the control flow compiler. The heap garbage collector of hipP was modified to support control flow compiled code. More details about the memory management will be discussed in Section 6. All experiments were run on a Pentium III 1.1 GHz with 2 GB main memory running Linux, with a minimum of applications running. Two kinds of experiments are discussed: the benchmarks in Table 1 show the potential gain in an artificial setting, whereas the results in Table 2 are obtained from a real world application. For each artificial experiment, a query was generated with the following parameters: • G: the number of goals in a branch, • B: the branching factor in a disjunction, • D: the nesting depth of disjunctions. For example, for the values G = 2, B = 3 and D = 1, the following query is generated: ?- a(A,B,C), a(C,D,E), ( a(E,F,G), a(G,H,I) ; a(E,J,K), a(K,L,M) ; a(E,N,O), a(O,P,Q) ). For G = 1, B = 2 and D = 2, the generated query has nested disjunctions: ?- a(A,B,C), ( a(C,D,E), ( a(E,F,G) ; a(E,H,I) ) ; a(C,J,K), ( a(K,L,M) ; a(K,N,O) ) ). The definition of a/3 was taken to be a( , , ) to minimize the time spent outside 7 Theory and Practice of Logic Programming a b c d e f Ga Bb Query Dc Td 5 5 4 3905 10 5 4 7810 5 10 4 55555 10 10 4 111110 5 5 6 19531 Experiment Time Comp.e Exec.f Meta-call Compile & Run Control Flow Meta-call Compile & Run Control Flow Meta-call Compile & Run Control Flow Meta-call Compile & Run Control Flow Meta-call Compile & Run Control Flow 288.0 30.8 668.0 62.6 6368.0 457.4 13876.0 847.8 11596.0 758.0 2.14 0.384 0.198 4.196 0.734 0.36 33.676 5.64 3.15 64.94 10.812 5.718 59.198 9.93 5.402 Number of goals in a branch Branching factor of each disjunction Nesting depth of disjunctions Pn=D n B ) Total number of goals (= G n=0 Compilation time of the query (in ms.) Execution time of the query (in ms.) Table 1. Experiments for artificial disjunctions. of the query execution. For each generated query, the average compile and run time of the query was measured over a significant number of runs. We report on the following three alternatives: • Control Flow: The query is compiled using the control flow approach before it is executed. • Compile & Run: The query is compiled using the classical WAM compilation before it is executed. • Meta-call: the query is meta-called (no compilation at all). The control flow compilation is clearly better than compile & run: the compilation times are improved by one order of magnitude, while the execution times are also improved. The compilation in the control flow approach is much faster because it does not need to perform expensive tasks such as assigning variables to environment slots. The better execution times are explained by the fact that only one emulation cycle per call is needed as no arguments have to be put in registers. Doubling the G parameter more or less doubles the timings. For larger queries, namely for G = 10, B = 10, D = 4, and for G = 5, B = 5, D = 6, control flow compilation becomes up to a factor 16 faster than compile & run. If the query is executed a sufficient number of times, meta-call is outperformed by control flow compilation (e.g. for G = 5, B = 5, D = 4, this number is 15). Since 8 R. Tronçon et al. Queriesa Runsb Mutagenesis 2021 69.51 Bongard 9335 244.77 48399 103.07 Dataset Carcinogenesis a b c d Experiment Meta-call Compile & Run Control Flow Meta-call Compile & Run Control Flow Meta-call Compile & Run Control Flow Comp.c Exec.d Total 1.30 0.21 4.98 0.91 17.50 2.24 1.43 1.06 1.02 24.70 21.34 21.18 108.81 65.30 59.51 1.43 2.36 1.23 24.70 26.32 22.09 108.81 82.80 61.75 Total number of different queries executed Average number of examples on which a query is run Total compilation time of all queries (in seconds) Total execution time of all queries (in seconds) Table 2. Experiments for conjunctions from a real world application. in ILP, each query is run on thousands of examples, these results are very promising. The real world experiment consists in running the Tilde algorithm (Blockeel and De Raedt 1998) from the ILP system ACE/hipP (ACE 2000) on three well-known datasets from the ILP community: Mutagenesis (Srinivasan et al. 1996), Bongard (De Raedt and Van Laer 1995) and Carcinogenesis (Srinivasan et al. 1999). During the execution of Tilde, queries are subsequently generated, and every query needs to be run on a subset of the examples. These queries consist only of conjunctions, and every query is executed separately on the examples. Table 2 compares the compilation time and execution time for all queries in the control flow compilation approach with the corresponding times of the compile & run and the meta-call approach. For each dataset, the total number of queries and the average number of runs per query is also given. In the Tilde runs, control flow compilation gains a factor 5 to 8 over usual compilation. For all datasets, control flow compiled code also outperforms both the classical compiled code and the meta-called queries. Meta-call is slower than control flow compiled code because of the extra emulator cycles spent in testing the incoming goal upon each call. Additionally, specialized variants of cf call are used for calling goals with arities smaller than 4 (which are the most frequent in practical ILP applications). We conclude that control flow compilation is the fastest approach for executing the queries on these datasets. The main reason for this is that the share of query compilation in the total execution time of the ILP algorithm is reduced significantly. Moreover, control flow compiled code contains less instructions, and as such saves emulator cycles as well. The results are more pronounced for the artificial benchmarks than for the Tilde ones for several reasons. The artificial queries are longer than the typical Tilde Theory and Practice of Logic Programming 9 queries; making the artificial queries shorter makes the timings unreliable. During the artificial benchmarks, the time spent in the called goals is very small (only proceed), whereas in the Tilde experiments much more time is spent in the predicates, and as such the effect of control flow on the exec timing decreases. 3.3 Conclusion The main goal of control flow compilation was to reduce high compilation times, without slowing down execution itself. Our experiments prove that control flow compilation achieves this goal: compilation times are reduced by an order of magnitude, while the execution becomes even slightly faster. Moreover, the new compilation scheme is flexible, and allows for extensions such as lazy compilation, as will be discussed in Section 4. 4 Lazy Control Flow Compilation 4.1 Technology In practical ILP applications, it is observed that large parts of the queries generated by the query generation process are never executed. Hence, unnecessary time is spent in compiling this unreachable code. With a lazy compilation scheme which only compiles code when it is actually reached, this redundancy can be removed. Control flow compilation is particularly suited for this dynamic kind of code, since existing compiled code can be extended without needing to alter the latter because of e.g. argument register allocation (as is the case with classical compilation). In this section, we will extend the control flow compilation scheme to yield a lazy variant. In (Aycock 2003), lazy compilation is identified as a kind of just-in-time (JIT) compilation or dynamic compilation, which is characterized as translation which occurs after a program begins execution. Our lazy variant implicitly calls the control flow compiler when execution reaches a part of the query that is not yet compiled. We restrict the discussion in this section to queries with conjunctions and disjunctions; the extension to query packs is presented in Section 5. As with normal control flow compilation, the query is represented by a term on the heap. We introduce a new WAM instruction lazy compile, whose argument is a pointer to the term on the heap that needs compiling when execution reaches this instruction. Consider the query q :- a(X,Y), b(Y,Z). The initial lazy compiled version of q is allocate 2 lazy_compile &(a(X,Y),b(Y,Z)) The lazy compile instruction points to a conjunction: its execution replaces itself by the compiled code for the first conjunct, namely a cf call, and adds for the second conjunct another lazy compile instruction, resulting in: allocate 2 10 R. Tronçon et al. cf_call &a(X,Y) lazy_compile &b(Y,Z) The execution continues with the newly generated cf call instruction as is expected. After the next execution of lazy compile, the compiled code is equal to code generated without laziness: allocate 2 cf_call &a(X,Y) cf_deallex &b(Y,Z) Note that lazy compilation overwrites the lazy compile instruction with a cf instruction, and that once we have executed the query for the first time completely, the resulting code is the same as the code produced by non-lazy control flow compilation. Now, consider the lazy compilation of the query from Figure 1: q :- a(X,Y), ( b(Y,Z) ; c(Y,Z), d(Z,U); e(a,Y) ). Initially, the code is allocate 2 lazy_compile &(a(X,Y),(b(Y,Z);c(Y,Z),d(Z,U);e(a,Y))) The lazy compile changes the code to: allocate 2 cf_call &a(X,Y) lazy_compile &(b(Y,Z);c(Y,Z),d(Z,U);e(a,Y)) Now, lazy compile will compile a disjunction. Where normal (control flow) compilation would generate a trymeorelse instruction, we generate a lazy variant for it. The lazy trymeorelse instruction has as its argument the second part of the disjunction, which will be compiled upon failure of the first branch. The instruction is immediately followed by the code of the first branch, which is initially again a lazy compile: allocate 2 cf_call &a(X,Y) lazy_trymeorelse &(c(Y,Z),d(Z,U);e(a,Y)) lazy_compile &b(Y,Z) Execution continues with the lazy trymeorelse: a special choice point is created such that on backtracking the remaining branches of the disjunction will be compiled in a lazy way. To achieve this, the failure continuation of the choice point is set to a new lazy disj compile instruction, which behaves similarly to lazy compile. Then, execution continues with the first branch: allocate 2 cf_call &a(X,Y) lazy_trymeorelse &(c(Y,Z),d(Z,U);e(a,Y)) cf_deallex &b(Y,Z) Upon backtracking to the special choice point created in lazy trymeorelse, the lazy disj compile instruction resumes compilation, and replaces the corresponding lazy trymeorelse by a trymeorelse instruction with the address of the code to be generated as argument: Theory and Practice of Logic Programming 11 allocate 2 cf_call &a(X,Y) trymeorelse L1 cf_deallex &b(Y,Z) L1: lazy_retrymeorelse &(e(a,Y)) lazy_compile &(c(Y,Z),d(Z,U)) Here, lazy retrymeorelse – the lazy variant of retrymeorelse – behaves similar to lazy trymeorelse, but instead of creating a special choice point, it alters the existing choice point. It is immediately followed by the code of the next part of the disjunction, which after execution looks as follows: allocate 2 cf_call &a(X,Y) trymeorelse L1 cf_deallex &b(Y,Z) L1: lazy_retrymeorelse cf_call &c(Y,Z) cf_deallex &d(Z,U) &(e(a,Y)) Upon backtracking, lazy retrymorelse is overwritten, and a trustmeorelse is generated for the last branch of the disjunction, followed by a lazy compile for this branch: allocate 2 cf_call &a(X,Y) trymeorelse L1 cf_deallex &b(Y,Z) L1: retrymeorelse L2 cf_call &c(Y,Z) cf_deallex &d(Z,U) L2: trustmeorelsefail lazy_compile &e(a,Y) After the execution of the last branch, we end up with the full control flow code. The lazy compilation as we described proceeds from goal to goal: when the JIT compiler is called, it compiles exactly 1 goal, and then resumes execution. Other granularities have been implemented and evaluated as well (see Table 3): • Per conjunction: All the goals in a conjunction are compiled at once. This avoids frequent switching between the compiler and the execution by compiling bigger chunks. • Per disjunction: All the branches of a disjunction are compiled up to the point where a new disjunction occurs. This approach is reasonable from an ILP viewpoint: the branches of a disjunction represent different queries, and since the success of each query is recorded, all branches will be tried (and thus compiled) eventually. Besides the overhead of switching between compilation and execution, these approaches might also generate different code depending on the execution itself. When a goal inside a disjunction fails, the next branch of the conjunction is executed, and newly compiled code is inserted at the end of the existing code. When in a later 12 R. Tronçon et al. stage the same goal succeeds, the rest of the branch is compiled and added to the end of the code, and a jump to the new code is generated. These jumps cost extra emulator cycles and decrease locality of the code. Lazy compilation per goal can in the worst case have as many jumps as there are goals in the disjunctions. Compiling per conjunction can have as many jumps as there are disjunctions. If a disjunction is completely compiled in one step, each branch of the disjunction ends in a jump to the next disjunction. Just as for control flow compilation, special control flow instructions for built-in predicates can be used in the lazy variant as well. Care must be taken though: typically, specialized built-ins are emitted depending on the type of arguments (e.g. specialized built-ins for unifying arguments with integers); however, as compilation is now interleaved with execution, arguments of a goal might have been bound after starting the execution of the query, which could make the emitted built-in overly specialized, thus generating code that becomes erroneous after backtracking or when run on another example. The compiler therefore shouldn’t emit specialized built-ins depending on the instantiation and/or type of the arguments, or it should keep track of the state of the goal arguments in the original query. In our implementation, we chose for the former approach. Finally, note that this lazy control flow compilation can be used to exploit the incremental nature of a query generation process such as the one from ILP. Suppose that queries are constructed with an open end, and that the compiler generates a lazy compile instruction for such open ends; these open ends can be instantiated by a later query generation phase, such that when execution reaches the lazy compile instruction, the new part of the query will be compiled and added to the existing code. This avoids the need to recompile the complete query, when only a small part of it changed. However, as experiments will show, control flow compilation times are relatively very low, such that the incremental compilation approach would not yield any significant speedups in total query evaluation time with respect to the use of (lazy) control flow compilation. 4.2 Evaluation In the first experiment, we will measure the overhead of the new lazy compilation scheme. The artificial queries from Table 3 have no unreachable parts, and as such provide a worst case for lazy compilation overhead. In practical applications, we expect the queries to have unreachable parts, and so the total overhead of the lazy compilation scheme will be compensated by the smaller compilation time. The experiments of Table 3 use only the first two benchmarks from Table 1. The other benchmarks of Table 1 yield similar results. Timings (in milliseconds) are given for the different settings of lazy compilation. The timings report the time needed for one execution of the query, thus including the time of its lazy compilation. These timings are then compared with the time of performing non-lazy control flow Theory and Practice of Logic Programming Ga a b c d Query Bb Dc 5 5 4 10 5 4 Experiment Per Goal Per Conjunction Per Disjunction No Laziness Per Goal Per Conjunction Per Disjunction No Laziness 13 Time Totald 55 34 32 28 111 60 59 59 Number of goals in a branch Branching factor of each disjunction Nesting depth of disjunctions Total Compilation + Execution time of the query (in ms.) Table 3. Lazy compilation for several kinds of disjunctions. compilation of the query and executing it once3 . Lazy compilation per goal clearly has a substantial overhead, whereas the other settings have a small overhead. We also measured the execution times for the three lazy alternatives once they are compiled: they were all equal, and are therefore not included in the table. The main message here is that the introduction of laziness in the control flow compilation does not degrade performance much, and that it opens perspectives for query packs compilation: (1) lazy compilation is fast; (2) in real life benchmarks, some branches will never be compiled due to failure of goals, whereas in our artificial setting all goals in the queries succeed. 5 Lazy Control Flow Compilation for Query Packs 5.1 Technology So far, we restricted our (lazy) control flow compilation approach to queries containing conjunctions and ‘ordinary’ disjunctions. However, the main motivation for this work was optimizing the execution of query packs (Blockeel et al. 2002). These query packs represent a set of (similar) queries which are to be executed, laid out in a disjunction. The semantics of this query pack disjunction is implemented by dedicated WAM instructions (Blockeel et al. 2002), as explained in Section 2. These instructions replace the instructions generated for encoding ordinary disjunctions. As experiments in Section 4 pointed out, the choice of the actual lazy compilation variant does not matter with respect to the overhead introduced (except for lazy compilation per goal). We therefore chose to implement only the variant which compiles one complete disjunction at a time, as this made integration with the 3 Note that these timings are slightly higher than the sum of Comp. and Exec. in Table 1. This is due to the fact that both experiments are run in different circumstances with different locality. 14 R. Tronçon et al. Dataset a b c d Unuseda Mutagenesis 17% Bongard 51% Carcinogenesis 32% HIV 74% Total Total Total Total Experiment Compile & Run Control Flow Lazy Control Flow Compile & Run Control Flow Lazy Control Flow Compile & Run Control Flow Lazy Control Flow Compile & Run Control Flow Lazy Control Flow Comp.b Exec.c Totald 0.52 0.07 1.91 0.28 7.39 0.81 209.47 27.13 - 0.11 0.10 1.17 1.15 4.63 3.81 191.68 178.53 - 0.63 0.17 0.14 3.08 1.43 1.37 12.02 4.62 4.34 401.15 205.66 186.22 % of the query code that is never executed compilation time of all queries (in seconds) execution time of all queries (in seconds) query evaluation time (= Comp. + Exec.) Table 4. Experiments for query packs from a real world application. existing query pack data structures easier. As explained in Section 4, this means that each branch of a disjunction ends in a jump. In the implementation of the query packs execution, this was already the case, so there are no extra emulator cycles in JIT compiled code compared to the other compilation schemes. The memory management aspects of the implementation will be discussed in Section 6. 5.2 Evaluation We evaluate (lazy) control flow compilation for query packs by running Tilde, but by letting it generate query packs instead of conjunctions (as was the case for Table 2). The experiments are performed on the ILP datasets from Table 2. Additionally, the query pack execution mechanism allows us to do experiments on larger datasets, such as the HIV dataset (DTP). The timings in Table 4 are in seconds: for compile & run and control flow, we give the sum of the total compilation time and the total execution time; for lazy control flow compilation, no distinction can be made, and so the total time for compilation and execution is given. Additionally, we give for each dataset the share of query goals that are never reached by the query execution. Comparing the timings for the query packs with the timings for the sets of queries in Table 2 we see that the query packs are considerably faster. First, we compare control flow compilation with compile & run. For query packs, control flow compilation is also up to an order of magnitude faster than traditional compilation, even though the hipP system already has a compiler that is optimized for dealing with large disjunctions (Vandecasteele et al. 2000) (in particular for the classification of variables in query packs). The execution times show the same Theory and Practice of Logic Programming 15 characteristics as in the experiments with the conjunctions in Table 2: control flow has a faster execution than classical compilation. For the ILP application, the total time must be considered: the total time of control flow is up to a factor 3 faster than compile & run. Note that this factor is higher for the query packs than for the conjunctions. The timings show that, for our benchmarks, the compilation time in compile & run is systematically larger than the execution time for all the examples such that the impact of improving the compilation has a larger effect on the total times. Table 3 shows that lazy compilation has some overhead, but we hoped that it would be compensated by avoiding the compilation of failing parts in the query packs. This is indeed the case for all datasets. As expected, the time gained by not compiling unused parts of queries corresponds roughly with the measured amount of unreached goals. The timings indicate that lazy control flow compilation is the best approach for query packs. 6 Memory Management Considerations Experiments pointed out that the layout of the code and data in memory can have a big impact on the execution time of the queries. Because the execution of the control flow compiled code needs to fetch the data for its calls from the heap, the compiled code should be as close as possible to the data it consumes to have good locality of data. We achieve this by allocating control flow compiled code on the heap, and extending the heap garbage collector to support this new data structure. Because of the dynamic nature of lazy compiled code, control flow blocks can be scattered across the heap during execution; the heap garbage collector moves these blocks closer to each other during collection, which improves locality. Since queries have a volatile nature, the heap collector will also often remove dead code blocks, which typically belong to old queries. Finally, the code itself contains pointers to terms on the heap, which are handled by the heap garbage collector as well. Finally, the locality of the query goals themselves also has an impact on execution time. During the query generation phase, other data is allocated on the heap, which can lead to a situation where the goal terms of the query (which will be used during execution of the control flow compiled code) are scattered across the heap. In all our experiments, the (possibly scattered) term representing the complete query was copied before compiling it. This ensured that all the terms used in the compiled code are allocated together on the heap. The impact of leaving out the copying step is illustrated in Table 5. These are the results of running Tilde on the same datasets as in Table 4. Without copying the goals, the execution time of control flow compiled code becomes slower than code executed using the classical approach. Although copying the query before compilation costs some time, it improves the locality during the compilation step itself. The effect on the benchmarks is that it sometimes introduces a slight overhead in some of the smaller benchmarks, but this 16 R. Tronçon et al. Dataset Experiment Mutagenesis Compile & Run Control Flow (No Control Flow Compile & Run Control Flow (No Control Flow Compile & Run Control Flow (No Control Flow Compile & Run Control Flow (No Control Flow Bongard Carcinogenesis HIV a b c Comp.a Exec.b Totalc 0.52 0.08 0.07 1.91 0.33 0.28 7.39 0.70 0.81 209.47 27.81 27.13 0.11 0.10 0.10 1.17 1.19 1.15 4.63 4.11 3.81 191.68 193.90 178.53 0.63 0.18 0.17 3.08 1.52 1.43 12.02 4.81 4.62 401.15 221.71 205.66 Copy) Copy) Copy) Copy) Total compilation time of all queries, including the time to copy the query (in seconds) Total execution time of all queries (in seconds) Total query evaluation time (= Comp. + Exec.) Table 5. Impact of locality on execution times is compensated by the gain in execution time. Control flow compilation with copy turns out to be the best approach. 7 Conclusions This paper presents a new method for faster compilation and execution of dynamically generated queries: control flow compilation is up to an order of magnitude faster than classical compilation, without affecting the execution time. The benefits of control flow compilation versus classical compilation are clear and are confirmed in the context of real world applications from the ILP community. Moreover, the lazy variant provides additional speedup in the total time by not compiling unreached parts of the query. Traditionally, Prolog implementations have implemented a form of JIT, where compilation to WAM code or machine code happens at consult time. Yap (Damas and Santos Costa 2003) goes one step further and compiles a predicate to abstract machine code at the first call to that predicate. BinProlog (Tarau 1992) and hipP switch back and forth between a compiled and an interpreted form of dynamic predicates, based on the relative frequency of modification and execution of the predicate. The granularity of these JIT compilation forms is always a predicate, while control flow compiled code can have a finer grained granularity up to a literal. However, control flow compilation cannot be used for compiling recursive predicates. Yap (Damas and Santos Costa 2003), which is used by the Aleph ILP system (Srinivasan 2001), has recently introduced other implementation techniques for speeding up the evaluation of many queries against many examples. In particular tabling and dynamic indexing can speed up the query execution phase considerably. Our control flow Theory and Practice of Logic Programming 17 compilation schema is orthogonal to these techniques and can be combined with them. Especially when tabling is used, it is important to spend little time on compiling the queries, as tabling avoids repeated execution of the same goal (or prefix of a query). So, we expect that control flow compilation is beneficial in combination with tabling. Within the ILP setting, the applications of (lazy) control flow compilation can be extended further. Firstly, we plan to adapt it to extensions of query packs reported in (Tronçon et al. 2003). We expect control flow compilation to yield the same speedups for these execution mechanisms as for query packs. However, the impact of laziness needs to be investigated. In (Ramon and Struyf 2004), a technique for efficient theta-subsumption is proposed which uses query pack execution. It has to be investigated whether lazy control flow compilation reduces the compilation time enough in the particular setting that executes the query pack only once, or that a pure meta-call based approach for the query packs performs better. Acknowledgements We would like to thank the anonymous referees for their comments and suggestions. References ACE. 2000. The ACE data mining system. http://www.cs.kuleuven.be/˜dtai/ACE/. Ait-Kaci, H. 1990. The WAM: a (real) tutorial. Tech. Rep. 5, DEC Paris Research Report. http://www.isg.sfu.ca/~hak/documents/wam.html. Aycock, J. 2003. A brief history of just-in-time. ACM Computing Surveys 35, 2, 97–113. Blockeel, H. and De Raedt, L. 1998. Top-down induction of first order logical decision trees. Artificial Intelligence 101, 1-2 (June), 285–297. Blockeel, H., Dehaspe, L., Demoen, B., Janssens, G., Ramon, J., and Vandecasteele, H. 2002. Improving the efficiency of Inductive Logic Programming through the use of query packs. Journal of Artificial Intelligence Research 16, 135–166. http://www.cs.kuleuven.be/cgi-bin-dtai/publ info.pl?id=36467 . Damas, L. and Santos Costa, V. 2003. YAP User’s manual. http://yap.sourceforge.net. De Raedt, L. and Van Laer, W. 1995. Inductive constraint logic. In Proceedings of the Sixth International Workshop on Algorithmic Learning Theory, K. P. Jantke, T. Shinohara, and T. Zeugmann, Eds. Lecture Notes in Artificial Intelligence, vol. 997. Springer-Verlag, 80–94. Demoen, B., Janssens, G., and Vandecasteele, H. 1999. Executing query flocks for ILP. In Proceedings of the Eleventh Benelux Workshop on Logic Programming, S. Etalle, Ed. Maastricht, The Netherlands, 1–14. 14 pages. DTP. The developmental therapeutics program. U.S. Departement of Health and Human Services NIH, National Cancer Institute NCI. http://dtp.nci.nih.gov. hipP. 2004. A high performance prolog system. http://www.cs.kuleuven.be/˜dtai/hipp/. Ramon, J. and Struyf, J. 2004. Efficient theta-subsumption of sets of patterns. In Proceedings of the 13th Belgian-Dutch Conference on Machine Learning. 95–102. Srinivasan, A. 2001. The Aleph manual. http://web.comlab.ox.ac.uk/oucl/research/ areas/machlearn/Aleph/. 18 R. Tronçon et al. Srinivasan, A., King, R., and Bristol, D. 1999. An assessment of ILP-assisted models for toxicology and the PTE-3 experiment. In Proceedings of the Ninth International Workshop on Inductive Logic Programming. Lecture Notes in Artificial Intelligence, vol. 1634. Springer-Verlag, 291–302. Srinivasan, A., Muggleton, S., Sternberg, M., and King, R. 1996. Theories for mutagenicity: A study in first-order and feature-based induction. Artificial Intelligence 85, 1,2, 277–299. Tarau, P. 1992. Program Transformations and WAM-support for the Compilation of Definite Metaprograms. In Russian Conference on Logic Programming, A. Voronkov, Ed. Number 592 in Lecture Notes in Artificial Intelligence. Springer-Verlag, Berlin, Heidelberg, 462–473. Tronçon, R., Janssens, G., and Demoen, B. 2003. Alternatives for compile & run in the WAM. In Proceedings of CICLOPS 2003: Colloquium on Implementation of Constraint and LOgic Programming Systems. University of Porto, 45–58. Technical Report DCC-2003-05, DCC - FC & LIACC, University of Porto, December 2003. http://www.cs.kuleuven.be/cgi-bin-dtai/publ info.pl?id=41065. Tronçon, R., Janssens, G., and Vandecasteele, H. 2004. Fast query evaluation with (lazy) control flow compilation. In Logic Programming, 20th International Conference, ICLP 2004, Proceedings. Lecture Notes in Artificial Intelligence, vol. 3132. Springer Verlag, 240–253. http://www.cs.kuleuven.be/cgi-bin-dtai/publ info.pl?id=41198. Tronçon, R., Vandecasteele, H., Struyf, J., Demoen, B., and Janssens, G. 2003. Query optimization: Combining query packs and the once-tranformation. In Inductive Logic Programming, 13th International Conference, ILP 2003, Szeged, Hungary, Short Presentations. 105–115. http://www.cs.kuleuven.be/cgi-bin-dtai/publ info.pl?id=40938. Vandecasteele, H., Demoen, B., and Janssens, G. 2000. Compiling large disjunctions. In First International Conference on Computational Logic : Workshop on Parallelism and Implementation Technology for (Constraint) Logic Programming Languages, I. de Castro Dutra, E. Pontelli, and V. S. Costa, Eds. Imperial College, 103–121. http://www.cs.kuleuven.be/cgi-bin-dtai/publ info.pl?id=32065. Warren, D. H. D. 1983. An abstract Prolog instruction set. Tech. Rep. 309, SRI.
6cs.PL
arXiv:1701.06134v1 [cs.DS] 22 Jan 2017 On Practical Accuracy of Edit Distance Approximation Algorithms Hiroyuki Hanada ∗† [email protected] Mineichi Kudo ∗ [email protected] Atsuyoshi Nakamura ∗ [email protected] Abstract The edit distance is a basic string similarity measure used in many applications such as text mining, signal processing, bioinformatics, and so on. However, the computational cost can be a problem when we repeat many distance calculations as seen in real-life searching situations. A promising solution to cope with the problem is to approximate the edit distance by another distance with a lower computational cost. There are, indeed, many distances have been proposed for approximating the edit distance. However, their approximation accuracies are evaluated only theoretically: many of them are evaluated only with big-oh (asymptotic) notations, and without experimental analysis. Therefore, it is beneficial to know their actual performance in real applications. In this study we compared existing six approximation distances in two approaches: (i) we refined their theoretical approximation accuracy by calculating up to the constant coefficients, and (ii) we conducted some experiments, in one artificial and two real-life data sets, to reveal under which situations they perform best. As a result we obtained the following results: [Batu 2006] is the best theoretically and [Andoni 2010] experimentally. Theoretical considerations show that [Batu 2006] is the best if the string length n is large enough (n ≥ 300). [Andoni 2010] is experimentally the best for most data sets and theoretically the second best. [Bar-Yossef 2004], [Charikar 2006] and [Sokolov 2007], despite their middle-level theoretical performance, are ∗ Graduate School of Information Science and Technology, Hokkaido University. Kita 14, Nishi 9, Kita-ku, Sapporo, Hokkaido, 060-0814, Japan. (The affiliations of all authors at which the research is conducted, and current affiliation of Mineichi Kudo and Atsuyoshi Nakamura) † Department of Computer Science, Nagoya Institute of Technology. Gokiso-cho, Showa-ku, Nagoya, Aichi, Japan. (Current affiliation of Hiroyuki Hanada) 1 experimentally as good as [Andoni 2010] for pairs of strings with large alphabet size. Keywords: Edit Distance, Function Approximation, Distortion, q-gram 1 Introduction The edit distance between two strings x and y, denoted by de (x, y) in this paper, is defined by the minimum number of character-wise edit operations (insertions, deletions or substitutions) to identify x and y (Section 2.1). The distance has been intensively researched because it naturally fits for many real-life situations: error detection in documents, noise analysis in signal processing, mutation-tolerant database searching in genomes and proteins, and so on [1, 2]. A weak point of the edit distance is its quadratic computation cost O(n2 ), where n is the string length to be compared. Many efforts, therefore, have been devoted to reduce the cost. They are separated by whether approximations of the distance are conducted or not. Unless some approximation is made, it is hard to reduce the worst-case computational cost from O(n2 ). Some methods without approximation [3, 4] achieve the worst-case computational time O(nk), where k is the maximum edit distance to be considered. This means O(n) if k is a constant; but O(n2 ) in the worst case because k can be n. Only approximation methods can achieve a linear or quasi-linear time such as O(n1+ε ) or O(n(log n)m ). Then the next question with some approximation algorithms is whether they have sufficiently good approximation accuracy or not. To answer the question, we will do in this paper the following studies: Theoretical evaluations: We consider the distortion (Section 2.2.1) as a typical measure of approximation accuracy. Many approximation algorithms (four out of six in this paper) conducted only big-oh (asymptotic) analyses in the distortion, for example, O(n log n) rather than 100n log n. However, in reallife situations, non-asymptotic distortions are desired. So we refine the analyses so as to reveal the constant factors. Experimental evaluations: Most existing methods (all of six in this paper) have not received any experimental evaluation on the approximation accuracy. So we examine their experimental accuracy in three datasets (one artificial and two real). 2 2 Preparation 2.1 Definitions for strings Throughout the paper, by Σ we denote the alphabet (the set of characters). Let Σn be the set of all strings of length n. For a string x, we denote by |x| the length of x, by x[i] the ith character of x, and by x[i.. j] the substring of x consisting of its ith to jth characters. A q-gram is a substring of length q. The edit distance [1] de (x, y) for two strings x, y is defined by the minimum number of edit operations: inserting, deleting or substituting one character in x to make x be identical to y. 2.2 Distortion 2.2.1 Definition We use the distortion, also known as the approximation factor, as a measure of approximation accuracy of a function defined as follows: Definition 1 [5][6] Given a set S , a non-negative function f (z) and a non-negative approximation function f˜(z), the distortion of f˜(z) to f (z) is defined by the smallest K ∈ [1, +∞) such that ∃K ′ ∈ (0, +∞), ∀z ∈ S : f (z) ≤ K ′ f˜(z) ≤ K f (z). The concept is illustrated in Fig. 1. Note that, in this paper, S is given as a set of pairs of strings {z = (x, y)} since we consider f (z) = de (x, y) and f˜(z) = d˜e (x, y), where d˜e (x, y) is a string distance approximating de (x, y). The value of K shows the ratio of the upper bound (K/K ′ ) f (z) to the lower bound (1/K ′ ) f (z). A smaller value of distortion K (≥ 1), therefore, means better approximation. Especially, K = 1 means that f (z) and f˜(z) are proportional to each other. 2.2.2 Asymptotic/non-asymptotic distortion analysis The distortion is an intuitive measure for showing how close the value of the approximation distance d˜e (x, y) is to the original distance de (x, y). However, we have to pay attention to what the distortion actually means in several conditions (Fig. 2). First we notice that the value of distortion, in general, becomes larger as the string length n increases, assuming |x| = |y| = n (Fig. 2, (a) and (b)). Taking this tendency into account, many of existing papers evaluate the distortions by big-oh notations, that is, how slowly the value K increases as n increases. 3 ~ f(z) ~ f(z) = (K/K’)f(z) ( : a sample in S) ~ f(z) = (1/K’)f(z) f(z) 0 Figure 1: The concept of distortion K over a set S ~ de ~ de ~ de de 0 (a) n is small de 0 0 (b) n is large θ (c) de (x, y) ≥ θ Figure 2: Several situations in distortion evaluation We should also notice another tendency that the distortion is often affected strongly by string pairs with a small value of de (Fig. 2(b)(c)). To ignore such an exceptional situation, some of the existing methods are evaluated only in the range of de ≥ θ with a threshold θ (Fig. 2(c)). 3 Outline of existing approximation methods We chose six approximation algorithms to be compared from the two viewpoints: coverage of almost all state-of-the-art algorithms and implementation easiness. We explain those algorithms in four groups according to their characteristics. q-gram-based algorithms (two of: [7]=[Bar-Yossef 2004], [8]=[Sokolov 2007]) 4 de These two algorithms approximate the edit distance by counting occurrences of q-grams in given two strings, and then take the difference between them. Ulam-metric-based algorithms (two of: [6]=[Charikar 2006], [9]=[Andoni 2009]) These two algorithms are originally developed for the Ulam metric, which is the edit distance in the set of strings whose characters are all distinct [6]. It can be shown that the Ulam metric is applicable for the edit distance between general strings with some simple operations (Section 5.1). The distance computation of the two algorithms exploits the property that every string does not contain the same character twice or more. For example, in [Charikar 2006], the distance is defined as the sum of |1/(x−1 [b] − x−1 [a]) − 1/(y−1 [b] − y−1 [a])| for all pairs (a, b) ∈ Σ × Σ, where x−1 [a] denotes the position of a found in the string x (omitted if a is not in x). Restricted alignment algorithms (one of: [10]=[Andoni 2010]) The edit distance can be regarded as a character-wise alignment between two strings [1]. [Andoni 2010] uses q-gram-wise alignment instead and assures certain approximation accuracy even if a pruning in the calculation is conducted1 . Shrinking algorithms (one of: [11]=[Batu 2006]) Batu’s algorithm converts given strings into shorter ones by merging some characters into one such as “abcbbabc” → “XYX” with the rule “abc” → “X” and “bb” → “Y”. Then it computes the edit distance of the converted strings as the approximated distance. 4 Refined theoretical distortions 4.1 Outline We re-analyzed the six algorithms to obtain their distortions with constant factors. The results are shown in Table 1. Before analyzing the table in detail in Section 4.3, in Section 4.2 we explain how the constant factors are extracted from big-oh notations, and how the accuracy evaluations with inequalities are converted to distortions with a threshold θ. 1 The algorithm of [Andoni 2010] needs O(n2 ) time if no pruning is made, which is equal to that of the edit distance. 5 Table 1: Refined distortions. Here, d˜e is the approximated distance of de ; the strings are limited to length n; a threshold θ is employed to limit de ≥ θ in some algorithms. In logarithms, the bases are 2 for lg and e for ln, respectively. Algorithm Original distortion Original inequality Refined distortion    de ≤ k ⇒ d˜e ≤ 4kq, † 13 2/3 [Bar-Yossef 2004] [7] n   2θ1/3 de ≥ 13(kn) 23 ⇒ d˜e ≥ 8kq   n 1 o 2 1 ‡ [Batu 2006] [11] min n 3 +o(1) , (de ) 2 +o(1) 4(2c − 1) lg((2c − 3)k) + 1 + (c−1) c [Charikar 2006] [6] O(n log n)†† [Sokolov 2007] [8] 6 [Andoni 2009] [9] [Andoni 2010] [10] O(n)†† 12 lg n‡‡    de ≤ k ⇒ d˜e ≤   de > k ⇒ d˜e ≥ 2k(n+2) , n 2k−8 n 48n(1 + ln n)/ max{1, θ}    +∞ (θ ≤ 5),    nθ+2 (θ > 5) θ−5 3400n 12 lg n‡‡ Note: † q denotes the q-gram. In the algorithm, q is set to n2/3 /(2k1/3 ). ‡ c = max{(lg lg n)/(lg lg lg n), 2}. †† In [Charikar 2006] and [Andoni 2009], the distortions are derived for the Ulam metric as O(log n) and O(1), respectively. We multiplied them by O(n) (more precisely, 2n) so as to be applicable to general strings (Section 5.1). ‡‡ The distortion is shown in the original paper ([10], pp. 16 in the full version). ~ de ~ de u(de) ~ de = αde l(de) 0 θ ~ de = βde de 0 (a) l(de ) ≤ d˜e ≤ u(de ) θ de (b) Distortion for de ≥ θ Figure 3: Conversion of lower and upper bounds to a distortion 4.2 Derivation of distortions For each algorithm whose distortion is given in a big-oh notation ([Batu 2006], [Charikar 2006], [Andoni 2009] and [Andoni 2010]), we examined every step in the algorithm. The detailed derivations are given in Appendix A. For each algorithm whose accuracy is bounded by inequalities ([Bar-Yossef 2004] and [Sokolov 2007]), we calculated its distortion by the following procedure. Detailed distortion calculations for the two algorithms are shown in Appendix B. Let d˜e be bounded by two functions of de as l(de ) ≤ d˜e ≤ u(de ) for de ≥ θ (Fig. 3(a)). Then the distortion K of d˜e for de ≥ θ is upper-bounded by Kθ = u(θ)/l(θ) under the monotonicity of slopes u(de )/de and l(de )/de . Indeed, if u(de )/de and l(de )/de are monotonically decreasing and increasing in de ≥ θ, respectively, then K = (supde ≥θ u(de )/de )/(inf de ≥θ l(de )/de ) ≤ (u(θ)/θ)/(l(θ)/θ) = u(θ)/l(θ) = Kθ . Therefore we can obtain the distortion when the monotonicity of them are confirmed. 4.3 Comparison of calculated distortions Now we examine the refined distortions shown in Table 1. We note that all these algorithms can be now compared in a unified expression. First we classify these algorithms in the complexity order. Note that we can assume that θ takes an order between O(1) and O(n) since the edit distance takes a value between 0 and n. Assuming θ = O(1) as an ordinary case, they are ordered 7 as: • Sub-logarithmic (O((log log n)2 )): [Batu 2006] • Logarithmic (O(log n)): [Andoni 2010] • Sublinear (O(nα(<1) )): [Bar-Yossef 2004] • Linear (O(n)): [Sokolov 2007], [Andoni 2009] • Super-linear (O(n log n)): [Charikar 2006] Therefore, [Batu 2006] is the best for θ = O(1) then [Andoni 2010] follows. For θ = O(n), [Charikar 2006] also has the same logarithmic order. Thus [Charikar 2006] and [Andoni 2010] are comparable for θ = O(n). Next let us compare the distortions in more detail. Since the refined distortions reveal the constants, we can compare algorithms for every specific value of n. We show the result in Fig. 4. In the figure we set θ = n (maximum θ) for [Bar-Yossef 2004], [Charikar 2006] and [Sokolov 2007] to evaluate optimistic distortion values. It is observed as expected that [Batu 2006] outperforms the others if n is large enough. However, when n is not so large, say, n ≤ 300, [Bar-Yossef 2004] is the best. Such a range of effective n is not obtained until our analyses made clear the constant factors. Focusing on the absolute value of distortion, it ranges from 10 to 100 for 100 ≤ n ≤ 10000. We might need to investigate whether such large values are acceptable in real-life applications, keeping in mind that they are evaluated in the worst case. 5 Experimental comparison 5.1 Procedure Next we compared them experimentally to know their practical usefulness. For each data set that will be explained in detail later, we make ready a set S of 10,000 pairs of strings S = {(x1 , y1 ), (x2 , y2 ), . . ., (x10000 , y10000 )}. We computed the distortion for S for the six approximation distances. We used one artificial and two real-life data sets as follows: Random (n ∈ {100, 300, 1000}, |Σ| ∈ {4, 20}, e ∈ {4, 30}): First we choose x from Σn at random with equal probability and initialize y by x. Then we modify y until the total operation cost becomes e: (a) replace a randomly chosen character in y with a randomly chosen character from Σ (probability: 2/3, cost: 1) or (b) delete a randomly chosen character in y 8 1e+12 [Bar-Yossef 2004] [Charikar 2006] [Batu 2006] [Sokolov 2007] [Andoni 2009] [Andoni 2010] 1e+10 Distortion Kθ 1e+08 1e+06 10000 100 1 1 10 100 1000 10000 100000 1e+06 String length n Figure 4: Distortions of six approximation methods. Note: θ = n for [Bar-Yossef 2004], [Charikar 2006] and [Sokolov 2007]. 9 and then insert a randomly chosen character at a randomly chosen position (probability: 1/3, cost: 2), where all random choices of characters and positions are conducted with equal probability. Note that de (x, y) equals e in most cases but can be less than e. DDBJ (n ∈ {100, 300, 1000}): DDBJ (DNA Data Bank of Japan) is a DNA nucleobase sequence database service [12]. We used “ddbjhum1” data (|Σ| = 15; 4 of them occupy 99.95%). To unify the string length in each data set, we constructed the data set as follows: For n = 100, we gathered strings of length 100 to 299 in ddbjhum1 and truncated the 101st character or after. Similarity, for n = 300 and n = 1000, we collected strings of length 300 to 999 for n = 300 and 1000 to 2999 for n = 1000, respectively. UniProt (n ∈ {100, 300, 1000}): UniProt (Universal Protein Resource) is an amino acid sequence (i.e. protein) database service [13]. We used “UniProtKB-SwissProt” data (|Σ| = 25; 20 of them occupy 99.99%). We conducted the data set constructions in the same manner as in DDBJ. For the algorithms assuming the Ulam metric ([Charikar 2006] and [Andoni 2009], Section 3), where all characters in a string are expected to be distinct, we “expanded” the alphabet from Σ to Σt for each string pair x, y so that (x[1..t], . . . , x[n− t+1..n]) are distinct and so do (y[1..t], . . . , y[n−t+1..n]) with as small t as possible. It can be shown that the distortion with this expansion is at most 2t times that under the Ulam metric [6]. When algorithms have parameters ([Bar-Yossef 2004], [Batu 2006], [Sokolov 2007] and [Andoni 2010]), we chose the smallest distortions over some candidates of parameters as follows: • q ∈ {2, 4, 6} for q-grams ([Bar-Yossef 2004] and [Sokolov 2007]2 ). • c ∈ {2, 4} and j = 1 for [Batu 2006] (see Appendix A for details). As a result, the theoretical distortion of [Batu 2006] is (2c − 1) · [4c + {8(2c − 3)k}c−1 ]/c = 12[1 + ⌈lg |Σ|⌉] = 72 with c = 2 and |Σ| = 20, a constant against n. It needs O(n2 ) time. • Tree node pruning (the trade-off between the computational time and the accuracy) is not conducted on [Andoni 2010] (the highest accuracy). It needs Ω(n2 ) time. 2 Following the description in the papers [Bar-Yossef 2004] and [Sokolov 2007], B and q1 corresponds to q, respectively. In [Sokolov 2007], parameter q2 is also set to q. 10 Table 2: Best algorithm according to the alphabet size |Σ|, the string length n and the number of edits (an upper bound of the edit distance) e. Edit distance e=4 n = 100 |Σ| = 4 n = 300 n = 1000 n = 100 Andoni 2010 |Σ| = 20 n = 300 n = 1000 Charikar 2006 Sokolov 2007 e = 30 Sokolov 2007 Charikar 2006 Bar-Yossef 2004 Andoni 2010 e~n (real-life) 5.2 Results We show the experimental results in Fig. 5, Fig. 6 and Table 2. From Fig. 5 we see that actual values of distortion are far less than their theoretical values, often 10 times or more (one scale mark in Fig. 5). This is mainly because theoretical distortions are obtained in the worst case but real data are not the case. We also see from Fig. 5 that the behavior (the outline of curves) obeys well the theoretical prediction, especially in [Batu 2006] and [Andoni 2010], whose asymptotic distortions are O(1) and O(log n) under the condition of this experiment, respectively. Then we list the best algorithms depending on |Σ|, n and e in Table 2 and the detailed comparison in Fig. 6. We assumed “e ∼ n” in the two real-life data sets (DDBJ and UniProt) in Table 2, since they contain strings coming from many organic components and thus most string pairs have large (nearly n) edit distance. We can see that [Andoni 2010], theoretically the second best, is almost always the best: it is the best for the two real-life data sets (DDBJ and UniProt) and nearly the best even for Random data set. On the other hand, theoretically the best algorithm [Batu 2006] did not yield the smallest distortion for any data set. Rather, as seen in Table 2, [Bar-Yossef 2004], [Charikar 2006] or [Sokolov 2007] becomes the best for Random data sets. Indeed, from Fig. 6, the conditions under which these algorithms achieved the smallest or near distortion are |Σ| = 20 for [BarYossef 2004] and [Sokolov 2007], and e = 4, 30 for [Charikar 2006]. The possible explanation of their good achievements is as follows: 11 (a) [Bar-Yossef 2004] (b) [Batu 2006] (c) [Charikar 2006] (d) [Sokolov 2007] (e) [Andoni 2009] (f) [Andoni 2010] Figure 5: Experimental distortions of six algorithms. Gray lines denote |Σ| = 20 data sets including UniProt. The theoretical value of [Batu 2006] is different from that in Table 1 (constant against n; see Section 5.1). 12 (a) Random, |Σ| = 4, e = 4 (b) Random, |Σ| = 20, e = 4 (c) Random, |Σ| = 4, e = 30 (d) Random, |Σ| = 20, e = 30 (e) DDBJ (|Σ| ∼ 4, e ∼ n) (f) UniProt (|Σ| ∼ 20, e ∼ n) Figure 6: Distortions of six data sets. Distortions larger than 30 are omitted from the charts. 13 • [Bar-Yossef 2004] and [Sokolov 2007] showed better results for relatively large |Σ|. This is because they are q-gram-based algorithms. When |Σ| is large, q-grams over Σ appearing in a string become more distinct even if the value of q is small. This means that the effect of appearance order3 disappears and thus q-gram distance becomes close to the edit distance. • [Charikar 2006] showed better results for |Σ| = 20 or (|Σ| = 4 and e = 30). This is because the distortion due to the alphabet expansion (Section 5.1) can be small. When |Σ| is large or e is not so small compared with n, the expansion length t to satisfy the Ulam condition can be small, especially in Random data set because uniform randomness works well. We have analyzed only the distortion so far. However, there is a trade-off between the distortion and the computational cost. The computational costs of the six algorithms ranges from O(n) ([Bar-Yossef 2004], [Charikar 2006] and [Sokolov 2007]) to O(n1+ε ) ([Batu 2006], [Andoni 2009] and [Andoni 2010]). In addition, in the latter three algorithms, we can control the trade-off by changing the value of ε. Since we carried out the experiment with ε ∼ 1 (i.e. the least distortion at the expense of large time complexity O(n2 ) same as the edit distance), it might be better to take into account the time complexity for choosing an algorithm in practical problems. 6 Conclusion We have compared six approximation algorithms of the edit distance in distortion, a measure of approximation accuracy, from the practical point of views: theoretical distortions without big-oh (asymptotic) notations, and experimental distortions in artificial and real-life data. By the theoretical comparison, we have revealed the conditions on the string length n for which these algorithms work best. The asymptotically best algorithm, [Batu 2006], was practically the best for n ≥ 300, while [Bar-Yossef 2004] was the best for smaller n. In the experimental comparison, however, [Batu 2006] did not yield the best distortion for any data set, while [Andoni 2010] was the best or nearly best for most of real data sets, and [Bar-Yossef 2004], [Charikar 2006] and [Sokolov 2007] were the best or nearly best for large |Σ|. Since they are faster than [Batu 2006] and [Andoni 2010], it is worth changing the algorithm depending on the problems at hand. 3 A counter example is x = “abcdefgh” and y = “efghabcd”: the difference of appearance order makes the edit distance be large (de (x, y) = 8 = n) while 2-gram distance [8] is small (2). 14 The contribution of the paper is that this analysis revealed the ranges of n where each approximation algorithm works better than the others with the absolute value of distortion, and that the experimental results revealed a large gap between theoretical and practical values of distortion in the algorithms. In the future work, in addition to the discussion on the computational cost, we will narrow the gap between theoretical and experimental distortions by controling de and θ in more detail (Section 4.3 and 5.2). We are also planning to apply them for real-life applications like biological sequence analyses, signal processing, or logging data analyses to confirm the accuracy and the computational time are practical enough. Appendix A Details of the distortion refinement without the big-oh notation Let log∗b x, called the iterated logarithm [14], be the minimum i ≥ 0 such that def log (logb (. . . logb x)) ≤ 1. If x ≤ 1 then log∗b x = 0. log∗b x grows very slowly | b {z } i ‘log’s compared to x, e.g. lg∗ x = 3 if x ∈ (4, 16] and lg∗ x = 4 if x ∈ (16, 65536]. A.1 [Batu 2006] In Batu’s algorithm [11], we first divide a string x into blocks of length c to 2c − 1 and compute the edit distance block-wise (i.e. treating a block as a character). As a result, the computational cost becomes O((n/c)2 ) after one division. The algorithm has two parameters c ≥ 2, j ≥ 1.4 j describes the number of the alphabet reductions (a string conversion process that only determines the boundaries of blocks). Note that we need to increase c in accord with n by c = ω(1) to assure o(n2 )-time computation. The authors of the paper take c = (lg lg n)/ lg lg lg n (the end of Section 5 of [11]). In Section 4 we took c = max{lg lg c/(lg lg lg c), 2} instead. In Section 5 we fixed c = 2 for the theoretical distortion since we took only c = 2, 4 for the experiment. 4 There is another parameter ℓ, but we fixed ℓ = 1 since it is enough for the single use of the distance ([11], pp. 799). 15 The distortion K is given by K = (2c − 1) · O((3c2 log c)c /c + log∗ kc) (1) (Theorem 4.1 in [11], pp. 797) = (2c − 1) · [4c(log∗ kc + O(1)) + O((3c2 log c)c )]/c (Lemma 4.5 in [11], pp. 797) = (2c − 1) · [4c j + O((3c2 log c)c )]/c. (2) (Lemma 4.5 in [11], pp. 797) where k = ⌈lg |Σ|⌉ is the number of bits to describe a character. The remained bigoh notation O((3c2 log c)c ) is evaluated as follows: O((3c2 log c)c ) is obtained from 2k j where ki = (c − 1) · (⌈lg((2c − 3)ki−1 )⌉ + 2), k0 = k (pp. 796 in [11]). A.1.1 The case of j = 1 If j = 1, used in Section 5, then k1 = (c − 1) · (⌈lg((2c − 3)ki−1 )⌉ + 2) ≤ (c − 1) · (lg((2c − 3)k) + 3) and thus the distortion becomes K ≤ (2c − 1) · [4c + {8(2c − 3)k}c−1 ]/c. (3) A.1.2 The case j is large enough Then we consider the case j is large enough for the small distortion. In this case k j becomes the fixed point of ki = (c − 1) · (⌈lg((2c − 3)ki−1 )⌉ + 2). We can easily confirm that k j ≤ 4(c − 1)2 since it is larger than (c − 1) · (⌈lg((2c − 3)k)⌉ + 2) for any c ≥ 2.5 In addition, j is large enough with lg((2c − 3)k) + 1 if k ≥ k j since the number of binary digits of ki in the recurrence is reduced by at least one except for the final recurrence. As a result, from the expression (2), an upper bound of the distortion becomes K = (2c − 1) · [4c j + O((3c2 log c)c )]/c ! (c − 1)2 . ≤ 4(2c − 1) lg((2c − 3)k) + 1 + c 5 We found an upper bound kˆj = 4(c − 1)2 as follows: since k is asymptotically larger than (c − 1) · (⌈lg((2c − 3)k)⌉ + 2) in k, kˆj must satisfy kˆj ≥ (c − 1) · (⌈lg((2c − 3)kˆj )⌉ + 2). As a result, k j = ω(c) is required. Thus we first take k = γ(c − 1)2 and then supplied the constant γ to satisfy the inequality. 16 A.2 [Charikar 2006] The distortion of Charikar’s method [6] is evaluated as O(log n) for Ulam metric. First we show its value without big-oh notation. The approximation function k f (P) − f (Q)k, where P and Q are strings satisfying the Ulam condition, is evaluated as follows in [6]: de (P, Q) θ (if P , Q; in Lemma 2.2, pp.211 in [6]) k f (P) − f (Q)k ≤ 3(1 + ln n) ≤ 3(1 + ln n) k f (P) − f (Q)k ≥ de (P, Q)/8 (in Lemma 2.3, pp.212 in [6]) de (P,Q) Thus we get de (P, Q)/8 ≤ k f (P) − f (Q)k ≤ 3(1 + ln n) max{1,θ} , where θ is replaced with max{1, θ} since the expression above does not consider the case de (P, Q) = 0. n) This concludes the distortion of k f (P) − f (Q)k for the Ulam metric is 24(1+ln max{1,θ} . In addition, in the manner in Section 5.1, the distortion for any strings is 48n(1+ln n) 24(1+ln n) max{1,θ} · 2n = max{1,θ} since t is at most n. A.3 [Andoni 2009] The distortion for [Andoni 2009] [9] is concluded as O(1) for the Ulam metric. We have removed the big-oh notation as follows: The approximation function dNEG,∞,1 (φ(P), φ(Q)), where P and Q are strings satisfying the Ulam condition, is evaluated as follows in [9]: dNEG,∞,1 (φ(P), φ(Q)) ≥ de (P, Q)/50 (Proof of Theorem 1.1, pp.870) dNEG,∞,1 (φ(P), φ(Q)) ≤ 17de (P, Q) (Proof of Theorem 1.1, pp.871) de (P, Q) ≤ de (P, Q) ≤ 2de (P, Q) (Section 1.5, pp.868) As a result, the distortion for Ulam metric is calculated as 50 · 17 · 2 = 1700. In addition, in the manner in Section 5.1, the distortion for any strings is 1700 · 2n = 3400n since t is at most n. 17 B B.1 Details of the distortion calculation from inequalities [Bar-Yossef 2004] The upper and the lower bounds of [7]=[Bar-Yossef 2004] are given by    de ≤ k ⇒ d˜e ≤ 4kq,   de ≥ 13(kn) 23 ⇒ d˜e ≥ 8kq. (with q = n2/3 /(2k1/3 )) As a result we obtain 4 de ≤ d˜e ≤ 2(de n)2/3 . 13 As shown in Section 4.2, since u(de )/de = 2(n2 /de )1/3 and l(de )/de = 4/13 are monotonically decreasing and increasing, respectively, the distortion for de ≥ θ is 4 Kθ = u(θ)/l(θ) = 2(θn)2/3 /( 13 θ) = (13n2/3 )/(2θ1/3 ). B.2 [Sokolov 2007] The upper and the lower bounds of [8]=[Sokolov 2007] are given by de (x, y) ≤ k ⇒ d˜e (x, y) ≤ (2k(n + 2))/n, de (x, y) > k ⇒ d˜e (x, y) ≥ 2(k − 4)/n. (4) Note that the distortion should be treated as +∞ if θ ≤ 5 since d˜e (x, y) can be zero if de (x, y) is less than 5, that is, k is less than 4, from (4). Otherwise we obtain 2(de − 5)/n ≤ d˜e ≤ (2de (n + 2))/n. As shown in Section 4.2, since u(de )/de = (2de (n + 2))/(nde ) and l(de )/de = 2(de − 5)/(nde ) are monotonically decreasing and increasing, respectively, the distortion for de ≥ θ is Kθ = u(θ)/l(θ) = [(2θ(n + 2))/n]/[2(θ − 5)/n] = (θ(n + 2))/(θ − 5). References [1] D. Gusfield. Algorithms on Strings, Trees and Sequences: Computer Science and Computational Biology. Cambridge University Press, 1997. [2] G. Navarro. A guided tour to approximate string matching. ACM Computing Surveys, 33(1):31–88, 2001. [3] G. M. Landau and U. Vishkin. Fast parallel and serial approximate string matching. Journal of Algorithms, 10(2):157–169, 1989. 18 [4] E. Myers. A sublinear algorithm for approximate keyword searching. Algorithmica, 12(4-5):345–374, 1994. [5] J. Matoušek. Lectures on Discrete Geometry. Springer-Verlag, 2002. [6] M. Charikar and R. Krauthgamer. Embedding the Ulam metric into l1 . Theory of Computing, 2(11):207–224, 2006. [7] Z. Bar-Yossef, T. S. Jayram, R. Krauthgamer, and R. Kumar. Approximating edit distance efficiently. In Proceedings of the 45th Annual IEEE Symposium on Foundations of Computer Science, pages 550–559, 2004. [8] A. M. Sokolov. Vector representations for efficient comparison and search for similar strings. Cybernetics and Systems Analysis, 43(4):484–498, 2007. [9] A. Andoni, P. Indyk, and R. Krauthgamer. Overcoming the l1 nonembeddability barrier: Algorithms for product metrics. In Proceedings of the 20th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 865–874, 2009. [10] A. Andoni, R. Krauthgamer, and K. Onak. Polylogarithmic approximation for edit distance and the asymmetric query complexity. In Proceedings of the 51st IEEE Annual Symposium on Foundations of Computer Science, pages 377– 386, 2010. Full version available at http://arxiv.org/abs/1005.4033. [11] T. Batu, F. Ergun, and C. Sahinalp. Oblivious string embeddings and edit distance approximations. In Proceedings of the 17th Annual ACM-SIAM Symposium on Discrete Algorithm, pages 792–801, 2006. [12] Hideaki Sugawara, Kazuho Ikeo, Satoshi Fukuchi, Takashi Gojobori, and Yoshio Tateno. DDBJ dealing with mass data produced by the second generation sequencer. Nucleic Acids Research, 37:Database issue D16–D18, 2009. http://www.ddbj.nig.ac.jp/index-e.html. [13] UniProt Consortium. The universal protein resource (uniprot). Nucleic Acids Research, 37:D169–D174, 2009. http://www.pir.uniprot.org/. [14] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms. The MIT Press, 2nd edition, 2001. 19
8cs.DS
Checking C++ Programs for Dimensional Consistency Ingo Josopait Astrophysikalisches Institut Potsdam, 14482 Potsdam, Germany I will present my implementation ’n-units’ of physical units into C++ programs. It allows the compiler to check for dimensional consistency. arXiv:cs/0512026v1 [cs.PL] 7 Dec 2005 I. INTRODUCTION Computer simulations and other scientific programs often deal with physical quantities that have dimensional meanings, like length scales or time scales. The internal representation of such quantities is done by floating point numbers. The actual numbers have no direct meaning by themselves. Their meanings rely on the definition of the measuring units (for example, the length ’5 meters’ could equally well be written as ’500 centimeters’ or ’16.4 feet’). The addition, subtraction or comparison of two numbers of different dimensions, like time scales and length scales, is physically not meaningful and can be regarded as an error. This follows from the principle of dimensional invariance, i.e. from the demand that the meaning of a formula should not depend on the choice of the system of measuring units. Dimensional inconsistencies are a frequent source of errors in programs and much debugging time is usually spent to check a program for dimensional consistency. However, the checking for dimensional consistency can be done automatically [1, 5]. Implementations of units into programming languages like python [3] and C++ [2, 6] exist. I will present another implementation of units into the programming language C++. The source code is available at http://starburst.sourceforge.net/n-units/. The emphasis lies on computational speed. As in [2] and [6], a check for dimensional consistency is done at compile time. The main differences to these existing implementations are: • Checking for dimensional consistency is designed to be deactivated for production runs, which results in better runtime performance (and reduced compile time). • Template definitions are simplified and the set of base units can easily be extended. • A function is provided that takes quantities to a fractional power. II. DIMENSIONS, UNITS AND QUANTITIES Let me first give 3 definitions: a. quantity A quantity is a property of some kind that can be quantified (e.g. the height of an object or its velocity). b. dimension A dimension specifies the type of a quantity (e.g. a length scale or a time scale). Only quantities of the same dimension can be compared. c. unit A unit is a quantity that has been defined in order to measure other quantities and to be able to express them in terms of numbers. Quantities can then be expressed as multiples of units. More than one unit can be defined per dimension. For example, cm, m and feet are all units that represent length scales. There are typically at least 3 independent dimensions used in a computer simulation: • length scale • mass scale • time scale This set can be extended. The Système International d’unités (SI) is based on 7 base units. But also other dimensions like currencies, the amount of information (in bits or bytes), or the cosmological scale factor can be used. More complex units (like energies or velocities) are derived from the base units. 2 III. CHECKING FOR DIMENSIONAL CONSISTENCY A dimension is uniquely defined by the exponents of the base units. For example, velocities (cm1 s−1 ) are composed of a length scale of exponent 1 and a time scale of exponent -1. This can formally be expressed by vectors: If we represent length scales by the vector (1,0,0), mass scales by (0,1,0) and time scales by (0,0,1), velocities would be represented by the vector (1,0,-1). For practical purposes it is sufficient to use a single integer number to represent the dimensional class. This has two advantages: • Template definitions are simplified. • Additional base units can be easily defined. Quantities are represented by the following template class: template <int n, class T=double> struct units { T data; static units<n, T> construct(const T& a) { // somewhat hidden constructor for explicit use units<n, T> r; r.data = a; return r; } ... }; The template parameter n specifies the dimension of the quantity, and T specifies the underlying floating point type. A. Base Units The base units are defined in the following way (as a convention, all units end with an underscore): Length scale: const units<1> m_ = units<1>::construct(1); Mass scale: const units<10> g_ = units<10>::construct(1E-3); Time scale: const units<100> s_ = units<100>::construct(1); ... This would define that the actual floating point representation follows the SI system (numbers are given in meters, kilograms and seconds) and that the dimensions of length scale, mass scale and time scale are represented by the template parameters 1, 10 and 100, respectively. Note that with the above definition the compiler cannot distinguish between, for instance, cm10 and g. Since such large exponents of units are rare, however, it is unlikely that this will be of practical importance. B. Basic Operations The following operations between quantities are allowed: • Addition and subtraction are allowed between quantities of the same dimension. • Multiplication of two quantities of types units<m> and units<n> returns a quantity of type units<m + n>. • Dividing a quantity of type units<m> by a quantity of type units<n> returns a quantity of type units<m − n>. • Relational operators (==, <, >) are allowed between quantities of the same dimension. In the framework of C++ templates, this can be written as: 3 template <int n, class T=double> struct units { ... template template template template <class B> units<n, typename addtype<T,B>::type> operator + <class B> units<n, typename subtype<T,B>::type> operator <int nb, class B> units<n+nb, typename multype<T,B>::type> <int nb, class B> units<n-nb, typename divtype<T,B>::type> (const units<n, B>& b) const; (const units<n, B>& b) const; operator * (const units<nb, B>& b) const; operator / (const units<nb,B>& b) const; ... }; The classes addtype, subtype, multype and divtype are used to correctly determine the return type of the underlying floating point number (so that, for instance, operations involving a float and a double always return a double). The dimensionless type units<0> is never used. Specializations of the above operators ensure that a bare floating point number (such as double or float) is returned instead. C. Fractional Powers Taking fractional powers of quantities can be defined in the following way: • Taking the square root of a quantity of type units<n> returns a quantity of type units<n/2>. • More generally, taking a quantity of type units<n> to the fractional power units<n qp >. p q returns a quantity of type For this purpose, the following template functions are provided: template <int n, class T> units<n/2, T> sqrt(const units<n, T>& a); template <int pa, int pb, int n, class T> units<(pa*n)/pb, T> pow(const units<n, T>& a); The expression ap/q can then be written as pow<p,q>(a), where p and q are constant integers. Apart from the possibility to check for dimensional correctness, another advantage of using the above pow<> template function is that the exponent pq is known to the compiler. The template function pow<> can therefore attempt to use the standard functions sqrt(double) (which takes the square root) and cbrt(double) (which takes the cubic root) in order to avoid the considerably slower function double pow(double, double). D. Data Types The dimension has to be specified for every quantity in the program. The typeof extension of the gcc compiler is very useful for this. typeof(x) returns the type of the object x. A velocity variable, for instance, can be defined by typeof(cm_/s_) v = 5*m_/s_; Because the units are defined to be constant, typeof expressions that involve only one unit should be written as a product to remove the constness. A length h should therefore be defined as: typeof(1*cm_) h = 2*km_; Unfortunately, the typeof keyword is not part of the ISO C++ standard. However, it is possible to emulate the typeof extension [4] with the help of the sizeof keyword (which is part of the ISO C++ specification), at the cost of having to register every type (and dimension) to which typeof is applied. To emulate typeof, disable the HAVE_TYPEOF option in the header file. The following small sample program illustrates the use of units in a program. It calculates the time a slice of bread needs to fall from a table (of height 1 meter) to the floor. #include <iostream> #include "units.h" using namespace std; 4 int main() { typeof(1*cm_) height = 1*m_; typeof(cm_/s_/s_) g = 9.81*m_/s_/s_; typeof(1*s_) t = sqrt(2*height/g); cout << "free fall time=" << t/s_ << " seconds" << endl; } Any violation of dimensional consistency would trigger a compiler error. IV. DISABLED CHECKING Dimensional checking can be disabled by the preprocessor option UNITCHECK in the header file. For performance reasons it is advisable to disable it for production runs and to enable it only to check newly written code. If UNITCHECK is disabled, the definitions of the base units (see section III A) are replaced by constant floating point numbers: const double m_ = 1; const double g_ = 1E-3; const double s_ = 1; ... The use of units will then have no negative influence on the runtime performance. I would like to stress that even though the compile-time check of units in this implementation relies on the use of template classes, units that are not checked for dimensional consistency can still be used in virtually any programming language, simply by defining the corresponding units as constant floating point numbers. V. DERIVING ADDITIONAL UNITS Once the set of base units is defined, other units can be derived from it, like for example: const const const const typeof(1*m_) cm_ = m_/100; typeof(1*g_) kg_ = 1000*g_; typeof(kg_*m_*m_/s_/s_) J_ = kg_*m_*m_/s_/s_; typeof(m_/s_) c_ = 2.99792458e8 * m_ / s_; // // // // centimeter kilogram Joule speed of light Given these definitions, units can be used directly in a program. One does not need to know the set of underlying measuring units that is used to represent quantities. Even the combination of different units is possible. For example, the following expression is perfectly valid: typeof(1*cm_) height = 1*m_ + 75*cm_; The compiler will correctly add these two length scales. Since the system of base units is known at compile time, the compiler can optimize this expression and perform the calculation during the compilation. VI. CHOOSING THE BASE TYPE Sometimes the programmer wants to use a specific base type other than double, like float or complex<>. This can be accomplished either by explicitly using cm_f (float), cm_d (double) or cm_ld (long double) instead of cm_ (which defaults to double) or by using the tof(..), tod(..), told(..) or to<> functions. For instance, typeof(cm_f/s_f) v; and typeof(tof(cm_/s_)) v; both define the velocity v to be of type float. 5 VII. OUTPUT Since UNITCHECK should be deactivated for production runs, the compiler has no information about the dimensions of quantities. Therefore, the programmer has to take care of meaningful output of quantities. This can be done by dividing the quantity by the desired unit, for example: void foo(typeof(m_/s_) v) { cout << "v = " << v/(mile_/hour_) << " mph" << endl; } VIII. CONCLUSIONS I have presented an implementation of physical units into C++ programs. The code is checked for dimensional consistency at compile time. The main advantages of this are: • The programmer can use units directly in the code, without the need to know the system of base units. • Implementing complex formulae is simplified, because the programmer can be more relaxed about the dimensional correctness. • Dimensional correctness is guaranteed by the provided header files. [1] Eric Allen, David Chase, Victor Luchangco, Jan-Willem Maessen, and Jr. Guy L. Steele. Object-oriented units of measurement. In OOPSLA ’04: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 384–403, New York, NY, USA, 2004. ACM Press. [2] W. Brown. Applied template metaprogramming in siunits: the library of unit-based computation. In Proceedings of the Second Workshop on C++ Template Programming, October 2001. [3] Pierre Denis. Unum, numbers with units in python. available at http://home.tiscali.be/be052320/Unum.html. [4] Bill Gibbons. A portable typeof operator, 2000. http://www.accu-usa.org/2000-05-Main.html. [5] Andrew J. Kennedy. Relational parametricity and units of measure. In POPL ’97: Proceedings of the 24th ACM SIGPLANSIGACT symposium on Principles of programming languages, pages 442–455, New York, NY, USA, 1997. ACM Press. [6] Kasper Peeters. dimnum, c++ library for storage and conversion of dimensionful values. available at http://www.damtp.cam.ac.uk/user/kp229/dimnum/.
6cs.PL
Diabetic Retinopathy Detection via Deep Convolutional Networks for Discriminative Localization and Visual Explanation arXiv:1703.10757v2 [cs.CV] 3 Apr 2017 Zhiguang Wang, Jianbo Yang ∗ GE Global Research San Ramon, CA {zhiguang.wang, jianbo.yang}@ge.com Abstract current solution requires a well-trained clinician to manually evaluate digital color fundus photographs of retina, and DR is identified by locating the lesions associated with vascular abnormalities due to diabetes. Though this current solution is effective, it is time-consuming and highly relies on the expertise of well-training practitioners. To solve this issue, in the past few years considerable efforts have been put on developing an automated solution for DR detection. Most of previous automated solutions consists of two parts: feature extraction and detection/prediction algorithm [13, 15, 16, 20]. Feature extraction is the main focus as standard machine learning algorithms can be directly used as the detection/prediction algorithm. This type of approaches are effective to some extent but also suffer from several shortcomings. First, as reviewed in Section 2, the extracted features are all hand-crafted features. Thus, these features highly depend on the parameters of the used feature extraction tools and they are sensitive to the quality of fundus photography, like object view, exposedness, artifacts, noise, out-of-focus, etc. Second, feature extraction is a solo task rather than embedded into the whole DR detection framework. The above-mentioned features extraction methods can be considered as the universal image feature extraction methods that are applicable to most computer vision tasks, and they are not dedicated to the specific task, e.g., DR detection task considered in this paper. It is worth noting that color fundus photography is more challenging than the standard scene or object images that most image feature extraction methods were developed based on, since the key signals are often tiny in fundus photography and they often look indiscriminating from noise and artifacts. Thus, these two challenges make it highly desirable to develop a systematical feature representation approach to effectively characterize the nature of features particularly related to the DR detection task. Recently, the convolutional neural networks (CNN) has achieved tremendous success in computer vision area. It can model high-level abstractions in data relative to specific prediction task [4, 5, 8, 9, 21]. In CNN, a multiple layers We proposed a deep learning method for interpretable diabetic retinopathy (DR) detection. The visualinterpretable feature of the proposed method is achieved by adding the regression activation map (RAM) after the global averaging pooling layer of the convolutional networks (CNN). With RAM, the proposed model can localize the discriminative regions of an retina image to show the specific region of interest in terms of its severity level. We believe this advantage of the proposed deep learning model is highly desired for DR detection because in practice, users are not only interested with high prediction performance, but also keen to understand the insights of DR detection and why the adopted learning model works. In the experiments conducted on a large scale of retina image dataset, we show that the proposed CNN model can achieve high performance on DR detection compared with the state-ofthe-art while achieving the merits of providing the RAM to highlight the salient regions of the input image. 1. Introduction Diabetes is an widespread disease in the world, and up to 2014 around 422 million people worldwide have this disease1 . Diabetic retinopathy (DR) is an eye disease caused by the long-standing diabetes. Basically, DR affects blood vessels in the light-sensitive tissue (i.e. retina). It becomes the leading cause of vision impairment and blindness for working-age adults in the world today[15], and around half of Americans with diabetes have this disease to some extent. A widely-known challenge for DR is that it has no early warning sign, even for diabetic macular edema. Thus, it is highly desired that DR can be detected in time. Unfortunately, in practice the current DR detection solution is nearly infeasible to meet this requirement. Specifically, the ∗ The authors contribute equally to this work. 1 http://www.who.int/mediacentre/factsheets/fs312/en/ 1 network is built up for automating feature design. Specifically, each layer in deep architecture performs a non-linear transformation on the outputs of the previous layer, so that the data are represented by a hierarchy of features from lowlevel to high-level. The key attribute of the CNN is conducting different processing units (e.g. convolution, pooling, sigmoid/hyperbolic tangent squashing, rectifier and normalization ) alternatively. Such a variety of processing units can yield an effective nonlinear representation of local salience of the signals. Then, the deep architecture allows multiple layers of these processing units to be stacked, so that this deep learning model can characterize the salience of signals in different scales. Also, in CNN, feature extraction and prediction algorithm are unified as a single model. Thus, the extracted features own more discriminative power, since the entire CNN model is trained under the supervision of output labels. Briefly speaking, the features extracted by the CNN are task dependent and non-handcrafted. In this paper, we also adopt CNN as the key predictive algorithm, but aim to develop a more efficient CNN architecture that is particularly useful for large-scale dataset. Specifically, the CNN we built has no fully connected layer and only have convolutional and pooling layers. This setting significantly reduces the number of parameters (fullyconnected layers often bring more parameters than convolutional layers in the conventional CNN) and provides better conditions for interpretability of neural network as presented below. We show in experiments that with less parameters and no fully-connected layers the proposed CNN architecture can achieve the comparative prediction performance. The key advantage of the proposed network structure is that it can provide a regression activation maps (RAM) of input image to show the contribution score of each pixel of input image for DR detection task. This RAM output, to some extent, somehow mitigates the well-known uninterpretable shortcoming of CNN as a black box method. We believe that this RAM output make the proposed solution more self-explained and can motivate the practitioners to trace the cause of the disease for every patient. approaches are not as effective as the recent deep learning approaches, such as [2, 10, 14, 18]. All these deep learning approaches adopted the standard architecture like AlexNet and GoogLeNet to build their CNN, and based on the experimental results these deep learning approaches significantly outperform the traditional two-step approaches. Moreover, the recent DR detection competition held in Kaggle [1]2 witnessed that all top solutions adopted CNN as the key algorithm. However, all these CNN approaches require complex neural network structures, and it is hard for practitioners to understand the insight of CNN and clearly explain that which region of the color fundus photography is the main cause of the disease. Understanding the insights of CNN has always been a pain point, though CNN yields excellent predictive performance. It is well-known that deriving theoretical results is quite challenging due to the nonliner and non-convex nature of CNN. To mitigate this issue, considerable efforts have been put on visualizing the CNN. A deconvolutional networks approach was proposed to visualize activated pattern in each hidden unit [22]. This method is limited as it is hard to summarize all hidden units’s patterns into one pattern, and also only the hidden neurons in the hidden layers are analyzed though the networks considered also contain the fully-connected layers. The work [3, 12, 23] and the reference therein include the objection location task besides the conventional object classification problem, so their CNN can predict the label of an image and also identify the region of the object related to the class label. Though this type of CNNs can predict the location of the object of interest, it still cannot reveal the insight of CNN. Recently, [6, 11] have presented the methods to invert the representation of images in each layer of the CNN. However, these approaches can only indicate what information is preserved in each layer of the CNN. The most work most related to our method is [24] in which class activation map is proposed to characterize the weighted activation maps after global average pooling or global maximum pooling layer. This idea has recently been generalized to time series analysis to localize the significant regions in the raw data [19]. In this paper, we extend the method [24] from a classification to a regression setting and shed light on DR detection problem. 2. Related Work The two-step (i.e., feature extraction and prediction) automated DR detection approaches dominated the field of DR detection for many years. Given color fundus photography, this type of approaches often extracted visual features from the images on the parts of blood vessels, fovea and optic disc [13, 20]. The generic feature extraction methods developed in computer vision area were widely used here, e.g, hough transform, gabor filters and intensity variations. With the extracted features, an object detection or object registration algorithm like support vector machines and k-NN were used to identify and localize exudates and hemorrhages [15, 16]. As mentioned before, this type of 3. Regression Activation Maps (RAM) Inspired by [24], we present in this section the idea of generating the RAM of an input image to localize the discriminative region towards the regression outcomes. It is known that the convolutional units of each layers of CNN act as visual concept detectors to identify low-level concepts like textures or materials, to high-level concepts 2 https://www.kaggle.com/c/diabetic-retinopathy-detection 2 Table 1. Two proposed convolutional network structures: Net-5 and Net-4. Net-5 layer 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Input Conv Conv MaxPool Conv Conv Conv MaxPool Conv Conv Conv MaxPool Conv Conv Conv MaxPool Conv Conv GlobalPool Dense Unit Filter Stride 32 32 5 3 3 5 3 3 3 3 3 3 3 3 3 3 3 3 3 2 64 64 64 128 128 128 256 256 256 512 512 2 2 2 2 2 Net-4 Size Filter Stride 448 224 224 111 56 56 56 27 27 27 27 13 13 13 13 6 6 6 4 4 3 4 4 4 3 4 4 4 3 4 4 4 3 4 2 Size 448 224 225 112 56 57 56 27 28 27 28 13 14 13 14 6 6 N/a 2 2 2 2 2 N/a 1 like objects or scenes. Deeper into the network, the units become increasingly discriminative. However, the fullyconnected layers will make it difficult to identify the importance of different units for identifying the output labels (regression values, in our networks). Instead, using GAP and the linear output unit, we can directly visualize the region of interest (ROI) that are most discriminative for a given regression value. As we use regression for the purpose of classification, each single RAM obtained for each single image explicitly depict the ROI on different clinical level. PK the GAP layer ŷ = k=1 tk wk is the value of the neuron in the output layer, where ŷ is the predicted label and wk is the weight of neuron k for the output of the global averaging pooling layer. Given the network structure in Table 1, the regression activation maps (RAM) is defined as below: The network architectures of our convolutional nets are shown in Table 1. Since we consider regression problem the output layer has one neuron outputting a real value. The key difference between our neural network and conventional neural networks like AlexNet [7] and GoogLeNet [17] lie in that our network uses global averaging pooling (GAP) layer to connect the last convolutional layer and the output layer, instead of using fully-connected layers. The idea of GAP layer is that each neuron in GAP obtains the spatial average of the feature maps from the last convolutional layer so that the value of each neuron in GAP reflects its contribution to the final prediction. Specifically, supposing the last convolutional layer contains K feature maps {gk (i, j)|∀i, j}, k = 1, ..., K and (i, j) is the spatial coordinate locating an entry in the feature map k. In the GAP layer, each feature map gk (i, j) in the last convolutional P layer is mapped into a scaler tk by the function tk = i,j gk (i, j). Then, the weighted sum of the output of Thus, RAM is essentially a weighted sum of the feature maps in the last convolutional layer. The weights herein are the connections between the outputs of the global averaging pooling layer and the neuron in the output layer. Therefore, the final prediction can also expressed as: G(i, j) = K X gk (i, j)wk k=1 ŷ = K X k=1 wk X i,j gk (i, j) = X G(i, j) i,j Intuitively, RAM contains the immediate information for prediction (feature maps in the last convolutional layer and weights before the final regression output), and also maintain the correspondence between last convolutional feature map and input images. Therefore, RAM can localize the discriminative region towards the regression outcomes. The illustration of the adopted neural network structure and RAM are show in Figure 1. 3 Figure 1. Illustration of adopted neural network structure (a) and regression activation mapping (b). Figure 2. Sample images of color retina images dataset. 4. Experiments vs. right. The samples images are shown in Fig 2. Also, the dataset doesn’t have the equal distributions among the 5 scales. As one can expect, normal data with label “0” is the biggest class in the whole dataset, while “proliferative DR” data is the smallest class. Fig 3 shows counts of images for different scales in the training dataset. 4.1. Datasets The color retina images are downloaded from the Kaggle website3 . The training dataset contains 35126 high resolution images under a variety of imaging conditions. These retina images were obtained from a group of subjects, and for each subject two images were obtained for left and right eyes, respectively. The labels were provided by clinicians who rated the presence of diabetic retinopathy in each image by a scale of “0, 1, 2, 3, 4”, which represent “no DR”, “mild”, “moderate”, “severe”, “proliferative DR” respectively. As mentioned in the description of the dataset, the images in the dataset come from different models and types of camera, which can affect the visual appearance of left 4.2. Benchmark method We consider the publicly-available method [2] as the benchmark method, which was ranked as the second place in the Kaggle competition. This method crops away all background and resize the images to squares of 128, 256 and 512 pixels. The interested readers may refer to [2] for more detailed settings of the baseline method. We summarize the main features of the baseline methods as follow: Resampling First, sample all classes such that all classes 3 https://www.kaggle.com/c/diabetic-retinopathy-detection/data 4 Table 2. Performance statistics of the benchmark and our approaches on test dataset. Baseline Ours Kappa score (Public Leaderboard) Kappa score (Private Leaderboard) 0.8542 0.8448 0.85034 0.8412 Parameter # (net-5) Training time (second/epoch) 12.4M 422.1 9.7M 367.3 Parameter # (net-4) Training time (second/epoch) 12.5M 451.7 9.8M 398.2 No Yes RAM 4.3. Experimental Settings 30000 We trained our convolutional neural network in Table 1 on a single Tesla-P100 GPU. For nonlinearity, we use leaky (0.01) rectifier units following each convolutional layer. The networks are trained with Nesterov momentum with fixed schedule over 250 epochs. For the nets on 256 and 128 pixel images, we stop training after 200 epochs. L2 weight decay with factor 0.0005 are applied to all layers. As we treat the problem as a regression problem, the loss function is mean squared error.The convolutional networks have untied biases. Batch size is fixed at 32 for all networks. 4 . Following the evaluation setting [1], the quadratic weighted Kappa score is adopted as the performance metric of prediction. Specifically, the predicted regression values are discretized at the thresholds (0.5, 1.5, 2.5, 3.5) to obtain integer levels for computing the Kappa scores and making submissions. All the features mentioned in Section 4.2 were also adopted in our model training. Counts in training data 25000 20000 15000 10000 5000 0 0 1 2 Scales 3 4 Figure 3. Counts of images for different scales in the training dataset. 4.4. Performance of Kappa Score are represented equally on average. Then, gradually reduce the over sampling of rare classes. Following [2], we split 35126 images into training and validation datasets in a ratio of 9 to 1 for local evaluation purpose, and we also submit our prediction results on the test dataset to Kaggle to obtain the Kappa score. Table 2 summarizes the performance of both benchmark and our approach on the test dataset. By simply replacing the fullyconnected layer with the global average pooling layer, our networks achieved very competitive Kappa score compared with the benchmark while reducing the parameter size by about 21.8% and speed-up the training by 11.8%-13.1%. As mentioned in Section 4.2, feature blending strategy was used. Thus, the final Kappa score is an average of six per patient blends for the two convolutional network architectures and three different sets of trained weights. Considering that the key signals in the retina images like Micro-aneurysms are very small with respect to the retina, we also evaluate the performance of the our model with respect to different size of input images. On the validation set, our networks achieve the Kappa scores of around 0.70 Initialization and pretraining Orthogonal initialization is used to initialize weights and biases. First, train smaller networks on 128 pixel images. Then, use the trained weights to (partially) initialize medium networks for training on 256 pixel images. Finally, use the trained weights of medium networks to (partially) initialize large network for training on 512 pixel images. Data augmentation The common image transformation like translation, stretching, rotation, flipping and color augmentation are used for data augmentation. Feature blending Use the last pooling layer of the convolutional networks as extracted features, and then blend all these extracted features from 50 networks outputs (with different augmentation). Then, a fully-connected neural network is used on the blended features as the final predictor. 4 Codes are available at https://github.com/cauchyturing/kaggle 5 diabetic RAM. (a) (b) (c) (d) Figure 4. The example RAM generated from the (a). 128 pixel image and (b). 256 pixel image. Note that the RAM output by the neural network is of size 56X56, and they are the up-sampled by Lanczos interpolation functions as shown in plots (a) and (b). The ensembled RAM averaged from both resolutions are shown in (c).(d) is the original image. for 256 pixel images, 0.80 for 512 pixel images and 0.81 for 768 pixel images on both Net-5 and Net-4 settings without feature blending. This observation suggests that the larger input images the better prediction performance but there is no much gain when the image size is greater than 512. Taking computation cost into consideration, we limit the input image size to be not greater than 512. the fusion of multiple RAMs generated from the different scales of input images. The fusion of the RAMs (a) and (b), i.e., the average of the values in RAM matrices, is plotted in Figure 4(c). By referring to the original image shown in Figure 4(d), we argue that Figure 4(c) can better capture the ROI of original image. We also found the similar phonomania from other examples. So we conclude that the fusion of different RAMs from various resolutions is simple and effective to depict the comprehensive ROI, so the fused RAM is only reported in the following analysis. 4.5. Discriminative Localization by RAM 4.5.1 Network settings for RAM To generate RAM, we used Net-5 with the 128 and 256 pixel images as the input. We also removed several convolutional layers of Net-5 for each input size to increase the resolution of RAM, since the localization ability of RAM can be significantly improved when the last convolutional layer before GAP had a higher spatial resolution [24]. Specifically, we made the following modifications: For Net-5 on the 128 pixel images, we removed the layers after Conv-11 and all the strides excepts the Maxpool-8, which resulting in a mapping resolution of 54 × 54. For Net-5 on the 256 pixel images, we removed the layers after Conv-15 and last two max pooling layer, which resulted in a mapping resolution of 56 × 56. Each of these networks were then fine-tuned 5 on the training data. 4.5.2 4.5.3 Analysis on RAM For the mild-conditioned patients, RAM learned to discover the narrowing of the retinal arteries associated with reduced retinal blood flow (Figure 5(d)), where the vessel shows dark red. The dysfunction of the neurons of the inner retina, followed in later stages (moderate) by changes in the function of the outer retina are captured in Figure 5(c), as such dysfunction protects the retina from many substances in the blood (including toxins and immune cells), leading to the leaking of blood constituents into the retinal neuropile. When the patients belong to the next stage (severe), as the basement membrane of the retinal blood vessels thickens, capillaries degenerate and lose cells leading to loss of blood flow and progressive ischemia and microscopic aneurysms which appear as balloon-like structures jutting out from the capillary walls. RAM, as shown in Figure 5(b), learned to converge its focus on the border where the balloon-like structures occurs. As the disease progresses to the proliferative stage, the lack of oxygen in the retina causes fragile, new, blood vessels to grow along the retina and in the clear, gel-like vitreous humour that fills the inside of the eye. In Figure 5(a), RAM shows the model put its attention on the grey dots scattering around, which undoubtedly Fusion of multiple RAMs Figure 4(a) and (b) show the RAMs from the input images of size 128 and 256 pixels respectively and their corresponding Kappa scores 5.06 and 4.63. We noticed that these RAMs reflect different ROIs that may both have contributions to the final Kappa score prediction. Thus, we consider 5 Train from the scratch has the similar performance but a little bit slower. 6 Label: 3 (Severe) Label: 2 (moderate) Label: 1 (mild) Label: 0 (no DR) Score:6.01, 4.91 Score:2.51, 3.18 Score:1.55, 2.43 Score:1.01, 0.91 Score:0, 0 (a) (b) (c) Label: 4 (proliferative DR) (d) (e) Figure 5. Ground truth and the corresponding RAMs. The two scores are from the 128 and 256 pixel images, respectively. Label: 2 (moderate) Label: 4 (proliferative DR) Label: 3 (severe) Score:1.90, 1.92 Score:1.14, 1.37 Score:0.73, 0.88 (a) (b) (c) Label: 1 (mild) Score:0.03, 0 (d) Figure 6. Examples of the conservative diagnostic by the neural networks on different severity levels. 7 demonstrate the proliferative stage. We also note that if the patient has no DR and the score predicted by the model is smaller than 0.5, then the RAM uniformly shows the dotlike focus near the pupil (5(e)). We also observed that the proposed model may have the conservative diagnostics behavior, which means that the predicted regression value is often smaller than the ground truth. The examples of this case are plotted in Figure 6. One plausible reason is that the training dataset has considerably large number of normal images as shown in Figure 3 so the learned model might be biased to the “0” class. Other reasons could be due to image quality and the sensitivity on the ambiguous features between different levels. Specifically, in Figure 6(a), though our model ignores the proliferate on the top left corner, it can capture the leaking of blood in the region of retinal neuropile. To identify leaking of blood in retinal neuropile may even be challenging for the clinicians. In (b) and (c), the original images contain very limited information about the balloon-like jitter and the blood leaking due to partial exposedness, so the RAM are scattered on the dard red vessels which are caused by the reduced retinal blood flow. Based on the above analysis, RAM provides the reasonable transparency on our deep learning model to see why and how it makes the decision. The visual explanation of RAM may assist the clinicians to quickly identify the pathogenesis of disease. [4] [5] [6] [7] [8] [9] [10] [11] 5. Conclusions [12] Practically, clinicians can identify DR by the presence of lesions associated with the vascular abnormalities caused by the disease. While this approach is effective, its resource demands are high. In this work, we provided a deep learning model that includes regression activation maps layer (RAM). The RAM layer can provide the robust interpretability of the proposed detection model by monitoring the pathogenesis so that the proposed model can be taken as an assistant for clinicians. With this feature, the proposed model can still yield the competitive performance of DR detection, compared with the state-of-the-art methods. In future, we would consider to extend the proposed method to other medical application problems. [13] [14] [15] References [1] Diabetic Retinopathy Detection — Kaggle: https://www.kaggle.com/c/diabetic-retinopathydetection, 2015. [16] [2] M. Antony and S. Brggemann. Kaggle Diabetic Retinopathy Detection: Team o O solution, 2015. [17] [3] L. Bazzani, A. Bergamo, D. Anguelov, and L. Torresani. Self-taught object alization with deep networks. 8 In 2016 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1–9, 2016. Y. Bengio. Learning deep architectures for AI. Found. Trends Mach. Learn., 2(1):1–127, Jan. 2009. L. Deng. A tutorial survey of architectures, algorithms, and applications for deep learning. APSIPA Transactions on Signal and Information Processing, 2014. A. Dosovitskiy and T.Brox. Inverting visual representations with convolutional networks. In CVPR, 2016. A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Computation, 1(4):541–551, Winter 1989. Y. LeCun, L. Bottou, G. Orr, and K. Muller. Efficient backprop. Neural Networks: Tricks of the trade, pages 9 – 50, 1998. G. Lim, M. L. Lee, W. Hsu, and T. Y. Wong. Transformed representations for convolutional neural networks in diabetic retinopathy screening. In AAAI Workshop on Modern Artificial Intelligence for Health Analytics (MAIHA), AAAI, 2014. A. Mahendran and A. Vedaldi. Understanding deep image representations by inverting them. In CVPR, 2015. M. Oquab, L. Bottou, I. Laptev, and J. Sivic. Learning and transferring mid-level image representations using convolutional neural networks. In CVPR, 2014. A. Pinz, S. Bernogger, P. Datlinger, and A. Kruger. Mapping the human retina. IEEE Transactions on Medical Imaging, 17(4):606–619, Aug 1998. H. Pratta, F. Coenenb, D. M. Broadbentc, S. P. Hardinga, and Y. Zheng. Convolutional neural networks for diabetic retinopathy. In International Conference On Medical Imaging Understanding and Analysis (MIUA), 2016. N. Silberman, K. Ahrlich, R. Fergus, and L. Subramanian. Case for automated detection of diabetic retinopathy. In AAAI Spring Symposium: Artificial Intelligence for Development. AAAI, 2010. A. Sopharak, B. Uyyanonvara, and S. Barman. Automatic exudate detection from non-dilated diabetic retinopathy retinal images using fuzzy c-means clustering. Sensors, 9(3):2148–2161, 2009. C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In CVPR, 2015. [18] S. Wang, Y. Yin, G. Cao, B. Wei, Y. Zheng, and G. Yang. Hierarchical retinal blood vessel segmentation based on feature and ensemble learning. Neurocomputing, 149:708–717, 2015. [19] Z. Wang, W. Yan, and T. Oates. Time series classification from scratch with deep neural networks: A strong baseline. arXiv preprint arXiv:1611.06455, 2016. [20] D. Wu, M. Zhang, J.-C. Liu, and W. Bauman. On the adaptive detection of blood vessels in retinal images. IEEE Transactions on Biomedical Engineering, 53(2):341–343, Feb 2006. [21] J. B. Yang, M. N. Nguyen, P. P. San, X. L. Li, and S. Krishnaswamy. Deep convolutional neural networks on multichannel time series for human activity recognition. In IJCAI, 2015. [22] M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. In ECCV, 2014. [23] B. Zhou, A. Khosla, À. Lapedriza, A. Oliva, and A. Torralba. Object detectors emerge in deep scene cnns. In ICLR, 2015. [24] B. Zhou, A. Khosla, À. Lapedriza, A. Oliva, and A. Torralba. Learning deep features for discriminative localization. In CVPR, 2016. 9
9cs.NE
Decremental Single-Source Shortest Paths on Undirected Graphs in Near-Linear Total Update Time∗ Monika Henzinger† Sebastian Krinninger† Danupon Nanongkai‡ arXiv:1512.08148v1 [cs.DS] 26 Dec 2015 Abstract In the decremental single-source shortest paths (SSSP) problem we want to maintain the distances between a given source node s and every other node in an n-node m-edge graph G undergoing edge deletions. While its static counterpart can be easily solved in near-linear time, this decremental problem is much more challenging even in the undirected unweighted case. In this case, the classic O(mn) total update time of Even and Shiloach [JACM 1981] has been the fastest known algorithm for three decades. At the cost of a (1 + )-approximation factor, the running time was recently improved to O(n2+o(1) ) by Bernstein and Roditty [SODA 2011]. In this paper, we bring the running time down to near-linear: We give a (1 + )-approximation algorithm with O(m1+o(1) ) total update time, thus obtaining near-linear time. Moreover, we obtain O(m1+o(1) log W ) time for the weighted case, where the edge weights are integers from 1 to W . The only prior work on weighted graphs in o(mn log W ) time is the O(mn0.9+o(1) )-time algorithm by Henzinger, Krinninger, and Nanongkai [STOC 2014, ICALP 2015] which works for the general weighted directed case. In contrast to the previous results which rely on maintaining a sparse emulator, our algorithm relies on maintaining a so-called sparse (h, )-hop set introduced by Cohen [JACM 2000] in the PRAM literature. An (h, )-hop set of a graph G = (V, E) is a set F of weighted edges such that the distance between any pair of nodes in G can be (1 + )-approximated by their h-hop distance (given by a path containing at most h edges) on G0 = (V, E ∪ F ). Our algorithm can maintain an (no(1) , )-hop set of near-linear size in near-linear time under edge deletions. It is the first of its kind to the best of our knowledge. To maintain approximate distances using this hop set, we extend the monotone Even-Shiloach tree of Henzinger, Krinninger, and Nanongkai [FOCS 2013] and combine it with the bounded-hop SSSP technique of Bernstein [FOCS 2009, STOC 2013] and Mądry [STOC 2010]. These two new tools might be of independent interest. ∗ A preliminary version of this paper was presented at the 55th IEEE Symposium on Foundations of Computer Science (FOCS 2014). † University of Vienna, Faculty of Computer Science, Austria. Supported by the Austrian Science Fund (FWF): P23499-N23 and the University of Vienna (IK I049-N). The research leading to these results has received funding from the European Research Council under the European Union’s Seventh Framework Programme (FP/2007-2013) / ERC Grant Agreement no. 340506 and from the European Union’s Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 317532. ‡ KTH Royal Institute of Technology. Work partially done while at ICERM, Brown University, USA, and Nanyang Technological University, Singapore 637371, and while supported in part by the following research grants: Nanyang Technological University grant M58110000, Singapore Ministry of Education (MOE) Academic Research Fund (AcRF) Tier 2 grant MOE2010-T2-2-082, and Singapore MOE AcRF Tier 1 grant MOE2012-T1-001-094. 1 Contents 1 Introduction 3 2 Preliminaries 5 3 Technical Overview 6 4 From Approximate SSSP to Approximate Balls 15 4.1 Relation to Exact Balls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.2 Properties of Approximate Balls . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 From Approximate Balls to Approximate SSSP 5.1 Algorithm Description . . . . . . . . . . . . . . . . 5.2 Running Time Analysis . . . . . . . . . . . . . . . 5.3 Definitions of Values for Approximation Guarantee 5.4 Analysis of Approximation Guarantee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 22 23 23 27 6 Putting Everything Together 34 6.1 Approximate SSSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 6.2 Approximate APSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 7 Conclusion 42 References 43 2 1 Introduction Dynamic graph algorithms refer to data structures on graphs that support update and query operations. They are classified according to the type of update operations they allow: decremental algorithms allow only edge deletions, incremental algorithms allow only edge insertions, and fully dynamic algorithms allow both insertions and deletions. In this paper, we consider decremental algorithms for the single-source shortest paths (SSSP) problem on undirected graphs. The unweighted case of this problem allows the following operations. • Delete(u, v): delete the edge (u, v) from the graph, and • Distance(x): return the distance distG (s, x) between node s and node x in the current graph G. The weighted case allows an additional operation Increase(u, v, ∆) which increases the weight of the edge (u, v) by ∆. We allow positive integer edge weights in the range from 1 to W , for some parameter W . For any α ≥ 1, we say that an algorithm is an α-approximation algorithm if, for any distance query Distance(x), it returns a distance estimate δ(s, x) such that distG (s, x) ≤ δ(s, x) ≤ α distG (s, x). There are two time complexity measures associated with this problem: query time denoting the time needed to answer each distance query, and total update time denoting the time needed to process all edge deletions. The running time will be in terms of n, the number of nodes in the graph, and m, the number of edges before the first deletion. For the weighted case, we additionally have W , the maximum edge weight. We use Õ-notation to hide O(polylog n) terms. In this paper, we focus on algorithms with small (O(1) or O(poly log n)) query time, and the main goal is to minimize the total update time, which will simply be referred to as time when the context is clear. Related Work. The static version of SSSP can be easily solved in Õ(m) time using, e.g., Dijkstra’s algorithm. Moreover, due to the deep result of Thorup [Tho99], it can even be solved in linear (O(m)) time in undirected graphs with positive integer edge weights. This implies that in our setting we can naively solve decremental SSSP in O(m2 ) time by running the static algorithm after every deletion. The first non-trivial decremental algorithm is due to Even and Shiloach [ES81] from 1981 and takes O(mn) time in unweighted undirected graphs. This algorithm will be referred to as ES-tree throughout this paper. It has many applications such as for decremental strongly-connected components [Rod13] and multicommodity flow problems [Mad10]; yet, the ES-tree has resisted many attempts of improving it for decades. Roditty and Zwick [RZ11] explained this phenomenon by providing evidence that the ES-tree is optimal for maintaining exact distances even on unweighted undirected graphs, unless there is a major breakthrough for Boolean matrix multiplication and many other long-standing problems [VWW10]. After the preliminary version of this work appeared, Henzinger et al. [HKN+ 15] showed that O(mn) is essentially the best possible total update time for maintaining exact distances under the assumption that there is no “truly subcubic” algorithm for a problem called online Boolean matrix-vector multiplication. It is thus natural to shift the focus to approximation algorithms. The first improvement for unweighted undirected graphs was due to Bernstein √ and Roditty [BR11] who presented a (1 + )-approximation algorithm with O(n2+O(1/ log n) ) 3 expected total update time.1 This time bound is only slightly larger than quadratic and beats the O(mn) time of the ES-tree unless the input graph is very sparse. For the more general cases, Henzinger and King [HK95] observed that the ES-tree can be easily adapted to directed graphs. King [Kin99] later extended the ES-tree to an O(mnW )-time algorithm for weighted directed graphs. A rounding technique used in recent algorithms of Bernstein [Ber09, Ber13] and Mądry [Mad10], as well as earlier papers on approximate shortest paths [Coh98, Zwi02], gives a (1 + )-approximate Õ(mn log W )-time algorithm for weighted directed graphs. Very recently, we obtained a (1 + )-approximation algorithm with total update time O(mn0.9+o(1) ) for decremental approximate SSSP in weighted directed graphs [HKN14b, c HKN15] if W ≤ 2log n for some constant c. This gives the first o(mn) time algorithm for the directed case, as well as other important problems such as single-source reachability and strongly-connected components [RZ08, Lac13, Rod13]. Also very recently, Abboud and Vassilevska Williams [AVW14] showed that “deamortizing” our algorithms in [HKN14b] might not be possible: a combinatorial algorithm with worst case update time and query time of O(n2−δ ) (for some δ > 0) per deletion implies a faster combinatorial algorithm for Boolean matrix multiplication and, for the more general problem of maintaining the number of reachable nodes from a source under deletions (which our algorithms in [HKN14b] can do) a worst case update and query time of O(m1−δ ) (for some δ > 0) will falsify the strong exponential time hypothesis. Our Results. Given the significance of the decremental SSSP problem, it is important to understand its time complexity. In this paper, we obtain a near-linear time algorithm for decremental√(1 + )-approximate SSSP in weighted undirected graphs. Its total update time is O(m1+O( log log n/ log n) log W ) and maintains an estimate of the distance between the source node and every other node, guaranteeing constant worst-case query time. The algorithm is randomized and assumes an oblivious adversery who fixes the sequence of updates in advance; it is correct with high probability and the bound on its total update time holds in expectation. In the unweighted case, our algorithm significantly improves our previous algorithm in [HKN14a] as discussed above. There was no previous algorithm designed specifically for weighted undirected graphs, and the previous best running time for this case comes from our O(mn0.9+o(1) ) time for weighted directed graphs [HKN14b, HKN15]. As a consequence of our techniques we also obtain an algorithm for the all-pairs shortest paths (APSP) problem. For every integer k ≥ 2 and every 0 <  ≤ 1, we obtain a decremental ((2 + )k − 1)-approximate APSP algorithm with query time O(k k ) and total 5/4 1/4 update time O(m1+1/k+O(log ((log n)/)/ log n) log2 W ). We remark that for k = 2 and 1/ = O(polylog n) our result gives a (3 + )-approximation with constant query time and total update time O(m1+1/2+o(1) log W ). For very sparse graphs with m = Θ(n), this is √ almost optimal in the sense that it almost matches the static running time [TZ05] of O(m n), providing stretch of 3 +  instead of 3 as in the static setting. Our result on approximate APSP has to be compared with the following prior work. For weighted directed graphs Bernstein [Ber13] gave a decremental (1 + )-approximate APSP algorithm with constant query time and total update time Õ(mn log W ). For unweighted undirected graphs there are 1 To enhance readability we assume that  is a constant when citing related work, thus omiting the dependence on  in the running times. 4 two previous results that improve upon this update time at the cost of larger approximation error. First, for any fixed integer k ≥ 2, Bernstein and Roditty gave a decremental (2k −1+)approximate APSP algorithm with constant query time and total update time Õ(mn1/k ). Second, for any integer k ≥ 2, Abraham, Chechik, and Talwar [ACT14] gave a decremental 2O(ρk) -approximate APSP algorithm for unweighted undirected graphs with query time O(kρ) and total update time Õ(mn1/k ), where ρ = (1 + d(log n1−1/k )/ log (m/n1−1/k )e). 2 Preliminaries In this paper we want to maintain approximate shortest paths in an undirected graph G = (V, E) with positive integer edge weights in the range from 1 to W , for some parameter W . The graph undergoes a sequence of updates, which might be edge deletions or edge weight increases. This is called the decremental setting. We denote by V the set of nodes of G and by E the set of edges of G before the first edge deletion. We set n = |V | and m = |E|. For every weigthed undirected graph G = (V, E), we denote the weight of an edge (u, v) in G by wG (u, v). The distance distG (u, v) between a node u and a node v in G is the weight of the shortest path, i.e., the minimum-weight path, between u and v in G. If there is no path between u and v in G, we set distG (x, y) = ∞. For every set of nodes U ⊆ V we denote by E[U ] the set of edges incident to the nodes of U , i.e., E[U ] = {(u, v) ∈ E | u ∈ U }.2 Furthermore, for every set of nodes U ⊆ V , we denote by G|U the subgraph of G induced by the nodes in U , i.e., G|U contains all edges (u, v) such that (u, v) is contained in E and u and v are both contained in U , or short: G|U = (U, E ∩ U 2 ). Similarly, for every set of edges F ⊆ V 2 and every set of nodes U ⊆ V we denote by F |U the subset of F induced by U . We say that a distance estimate δ(u, v) is an (α, β)-approximation of the true distance distG (u, v) if distG (u, v) ≤ δ(u, v) ≤ α distG (u, v) + β, i.e., δ(u, v) never underestimates the true distance and overestimates it with a multiplicative error of at most α and an additive error of at most β. If there is no additive error, we simply say α-approximation instead of (α, 0)-approximation. In our algorithms we will use graphs that do not only undergo edge deletions and edge weight increases, but also edge insertions. For such a graph H, we denote by E(H) the number of edges ever contained in H, i.e., the number of edges contained in H before any deletion or insertion plus the number of inserted edges. We denote by W(H) the number of edge weight increases in H. Similarly, for a set of edges F , we denote by E(F ) the number of edges ever contained in F and by W(F ) the number of edge weight increases in F . The central data structure in decremental algorithms for exact and approximate shortest paths is the Even-Shiloach tree (short: ES-tree). This data structure maintains a shortest paths tree from a root node up to a given depth D. Lemma 2.1 ([ES81, HK95, Kin99]). There is a data structure called ES-tree that, given a weighted directed graph G undergoing deletions and edge weight increases, a root node s, and a depth parameter D, maintains, for every node v a value δ(v, s) such that δ(v, s) = distG (v, s) if distG (v, s) ≤ D and δ(v, s) = ∞ if distG (v, s) > D. It has constant query time and a total update time of O(mD). 2 Since G is an undirected graph, this definition is equivalent to E[U ] = {(u, v) ∈ E | u ∈ U or v ∈ U }. 5 Recent approaches for solving approximate decremental SSSP and APSP use special graphs called emulators. An (α, β)-emulator H of a graph G is a graph containing the nodes of G such that distG (u, v) ≤ distH (u, v) ≤ α distG (u, v) + β for all nodes u and v.3 Maintaining exact distances on H provides an (α, β)-approximation of distances in G. As good emulators are sparser than the original graph this is usually more efficient than maintaining exact distances on G. However, the edges of H also have to be maintained while G undergoes updates. For unweighted, undirected graphs undergoing edge deletions, the emulator of Thorup and Zwick (based on the second spanner construction in [TZ06]), which provides a relatively good approximation, can be maintained quite efficiently [BR11]. However the definition of this emulator requires the occasional insertion of edges into the emulator. Thus, it is not possible to run a purely decremental algorithm on top of it. There have been approaches to design algorithms that mimic the behavior of the classic ES-tree when run on an emulator that undergoes insertions. The first approach by Bernstein and Roditty [BR11] extends the ES-tree to a fully dynamic algorithm and analyzes the additional work incurred by the insertions. The second approach was introduced by us in [HKN13] and is called monotone ES-tree. It basically ignores insertions of edges into H and never decreases the distance estimate it maintains. However, this algorithm does not provide an (α, β)-approximation on any (α, β)-approximate emulator as it needs to exploit the structure of the emulator. In [HKN13] we gave an analysis of the monotone ES-tree when run on a specific (1 + , 2)-emulator and in the current paper we use a different analysis for our new algorithms. If we want to use the monotone ES-tree to maintain (α, β)-approximate distances up to depth D we will set the maximum level in the monotone ES-tree to L = αD + β. The running time of the monotone ES-tree as analyzed in [HKN13] is as follows. Lemma 2.2. For every L ≥ 1, the total update time of a monotone ES-tree up to maximum level L on a graph H undergoing edge deletions, edge insertions, and edge weight increases is O(E(H) · L + W(H)). Our algorithms will heavily use randomization. It is well-known, and exploited by many other algorithms for dynamic (approximate) shortest paths and reachability, that by sampling a set of nodes with a sufficiently large probability we can guarantee that certain sets of nodes contain at least one of the sampled nodes whp. To the best of our knowledge, the first use of this technique in graph algorithms goes back to Ullman and Yannakakis [UY91]. Lemma 2.3. Let T be a set of size t and let S1 , S2 , . . . , Sl be subsets of T of size at least s. Let U be a subset of T that was obtained by choosing each element of T independently with probability p = (a ln lt)/s, where a is a constant. Then, for every 1 ≤ i ≤ l, the set Si contains a node of U with high probability (whp), i.e. probability at least 1 − 1/ta , and the size of U is O((t log (lt))/s) in expectation. 3 Technical Overview In the following we explain the main ideas of this paper, which lead to an algorithm for maintaining a hop set of a graph undergoing edge deletions. 3 For the related notion of a spanner we additionally have to require that H is a subgraph of G. 6 General Idea. With the well-known algorithm of Even and Shiloach we can maintain a shortest paths tree from a source node up to a given depth D under edge deletions in time O(mD). In unweighted graphs, all simple paths have length at most n and therefore we can set D = n to maintain a full shortest paths tree. In weighted graphs with positive integer edge weights from 1 to W , all simple paths have length at most nW and therefore we can set D = nW to maintain a full shortest paths tree. Using an established rounding technique [Coh98, Zwi02, Ber09, Mad10, Ber13, Nan14], one can use this algorithm to maintain (1 + )approximate single-source shortest paths up to h hops in time O(mh log (nW )/). With this algorithm we can set h = n to maintain a full-length approximate shortest paths tree, even in weighted graphs. This algorithm would be very efficient if the graph had a small hop diameter, i.e., if for any pair of nodes there is a shortest path with a small number of edges. Our idea is to artificially construct such a graph. To this end we will use a so-called hop set. An (h, )- hop set F of a graph G = (V, E) is a set of weighted edges F ⊆ V 2 such that in the graph H = (V, E ∪ F ) there exists, for every pair of nodes u and v, a path from u to v of weight at most (1 + ) distG (u, v) and with at most h edges. If we run the approximate SSSP algorithm on H, we obtain a running time of O((m + |F |)h log (nW )/). In our algorithm we will obtain an (O(no(1) ), )-hop set of size O(m1+o(1) ) and thus the running time will be O(m1+o(1) log (nW )/). It is however not enough to simply construct the hop set at the beginning. We also need a dynamic algorithm for maintaining the hop set under edge deletions in G. We will present an algorithm that performs this task also in almost linear time over all deletions. Roughly speaking, we achieve the following. Given a graph G = (V, E) undergoing edge deletions, we can maintain a restricted hop set F such that, for all pairs of nodes u and v if the shortest path from u to v in G has h ≥ n1/q hops, in the shortcut graph H = (V, E ∪ F ) there is a path from u to v of weight at most (1 + ) distG (u, v) and with at most dh/n1/q e log n hops. Our high-level idea for maintaining an (unrestricted) (no(1) , ) hop set is the following hierarchical approach. We start with H0 = G to maintain a hop set F1 of G, which reduces the number of hops by a factor of log n/n1/q at the cost of a multiplicative error of 1 + . Given F1 , we use the shortcut graph H1 = (V, E ∪ F1 ) to maintain a hop set F2 of G that reduces the number of hops by another factor of log n/n1/q introducing another error of 1 + . By repeating this process q times we arrive at a hop set that guarantees, for all pairs of nodes u and v, a path of weight at most (1 + )q distG (u, v) and with at most (log n)q n1/q hops. Figure 1 visualizes this hierarchical approach. The notion of hop set was first introduced by Cohen [Coh00] in the PRAM literature and is conceptually related to the notion of emulator. It is also related to the notion of shortest-paths diameter used in distributed computing (e.g., [KKM+ 12, Nan14]). To the best of our knowledge, the only place that this hop set concept was used before in the dynamic algorithm literature (without the name being mentioned) is Bernstein’s fully dynamic (2 + )approximation algorithm for all-pairs shortest paths [Ber09]. There, an (no(1) , )-hop set is essentially recomputed from scratch after every edge update, and a shortest-paths data structure is maintained on top of this hop set. Static Hop Set. We first assume that G = (V, E) is an unweighted undirected graph and for simplicity we also assume that  is a constant. We explain how to obtain a hop set of G using a randomized construction of Thorup and Zwick [TZ06] based on the notion of balls of 7 log2 n hops (1 + )2 n2/q log n hops log n hops log n hops (1 + )n1/q (1 + )n1/q (1 + )n1/q n1/q n1/q n1/q u v n2/q Figure 1: Illustration of the hierarchical approach for maintaining the hop set reduction. √ Here q = Θ( log n) and u and v are nodes that are at distance n2/q from each other. In the first layer we find a hop set that shortcuts all subpaths of weight n1/q by paths of weight at most (1 + )n1/q and with at most log n hops. In the second layer, we use the shortcuts of the first layer to find a hop set that shortcuts the path from u to v of weight n2/q by a path of weight at most (1 + )2 n2/q and with at most log2 n hops. nodes. We describe this construction and the hop-set analysis in the following. Let 2 ≤ p ≤ log n be a parameter and consider a sequence of sets of nodes A0 , A1 , . . . , Ap obtained as follows. We set A0 = V and Ap = ∅ and for 1 ≤ i ≤ p − 1 we obtain the set Ai by picking each node of V independently with probability 1/ni/p . The expected size of Ai is n1−i/p . For every node u we define the priority of u as the maximum i such that u ∈ Ai . For a node u of priority i we define Ball(u) = {v ∈ V | distG (u, v) < distG (u, Ai+1 )} (1) where distG (u, Ai+1 ) = minv∈Ai+1 distG (u, v). Note that distG (u, Ap ) = ∞ and thus if u ∈ Ap−1 , then Ball(u) = V . For each node u of priority i the size of Ball(u) is n(i+1)/p in expectation by the following argument: Order the nodes in non-decreasing distance from u. Each of these nodes belongs to Ai+1 with probability 1/n(i+1)/p and therefore, in expectation, we need to see n(i+1)/p nodes until one of them is contained in Ai+1 . It follows that the expected size of all balls of priority i is at most n1+1/p (the expected size of Ai times the expected size of Ball(u) for each node u of priority i) and the expected size of all balls, i.e., P 1+1/p . u∈V |Ball(u)|, is at most pn Let F be the set of edges F = {(u, v) ∈ V 2 | v ∈ Ball(u)} and give each edge (u, v) ∈ F the weight wF (u, v) = distG (u, v). By the argument above, the expected size of F is at most pn1+1/p . An argument of Thorup and Zwick [TZ06] shows that the weighted graph H = (V, F ) has the following property for every pair of nodes u and v and any 0 <  ≤ 1 8 such that 1/ is integer:4  distG (u, v) ≤ distH (u, v) ≤ (1 + ) distG (u, v) + 2 2 + 2  p−2 . Note that the choice of  gives a trade-off in the error between the multiplicative part (1 + ) and the additive part 2(2 + 2/)p−2 . In the literature, such a graph H is known as an emulator of G with multiplicative error (1 + ) and additive error 2(2 + 2/)p−2 .5 Roughly speaking, the strategy in their proof is as follows. Let u0 be the node following u on the shortest path from u to v in G. If the edge (u, u0 ) is also contained in H, then we can shorten the distance to v by 1 without introducing any approximation error (recall that we assume that G is unweighted). Otherwise, one can show that there is a path π 0 with at most p edges in H from u to a node v 0 closer to v than u such that the ratio between the weight of π 0 and the distance from u to v 0 is at most (1 + ), and, if v 0 = v, then the weight of π 0 is at most 2(2 + 2/)p−2 . The proof needs the following property of the balls: for every node u of priority i and every node v either v ∈ Ball(u) or there is some node v 0 of priority j > i such that u ∈ Ball(v 0 ). We illustrate the proof strategy in Figure 2. Observe that the same strategy can be used to show the following: Given any integer ∆ ≤ n, let u0 be the node that is at distance ∆ from u on the shortest path from u to v in G. If the edge (u, u0 ) is contained in H, then we can shorten the distance to v by ∆ without introducing any approximation error. Otherwise, one can show that there is a path π 0 with at most p edges in H from u to a node v 0 closer to v than u such that the ratio between the weight of π 0 and the distance from u to v 0 is at most (1 + ), and, if v 0 = v, then the weight of π 0 is at most 2(2 + 2/)p−2 · ∆. Every time we repeat this argument the distance to v is shortened by at least ∆. Therefore there is a path from u to v in H with at most pddistG (u, v)/∆e edges that has weight at most (1 + ) distG (u, v) + 2(2 + 2/)p−2 · ∆. One can show that this statement would also be true if we had removed all edges from F of weight more than (1 + 2/)(2 + 2/)p−2 , which is the maximum weight of the edge to v 0 in the proof strategy above outlined in Figure 2. We will need this fact in the dynamic algorithm as it allows us to limit the√depth of the balls. By a suitable choice of p = Θ( log n) (as a function of n and ) we can guarantee that 2(2 + 2/)p−2 ≤ n1/p and n1/p = no(1) . Now define q = p and ∆k = nk/q for each 0 ≤ k ≤ q − 2. Then we have, for every 0 ≤ k ≤ q − 2 and all pairs of nodes u and v 2 p−2 · ∆k distG (u, v) ≤ distH (u, v) ≤ (1 + ) distG (u, v) + 2 2 +  ≤ (1 + ) distG (u, v) + n1/p · ∆k   = (1 + ) distG (u, v) + ∆k+1 . Thus, if ∆k+1 ≤ distG (u, v) ≤ ∆k+2 , then there is a path from u to v in H of weight at most (1 + ) distG (u, v) + ∆k+1 ≤ (1 + ) distG (u, v) +  distG (u, v) = (1 + 2) distG (u, v) 4 The requirement that 1/ must be integer is not needed in the paper of Thorup and Zwick; we have added it here to simplify the exposition. 5 In their paper, Thorup and Zwick [TZ06] actually define a graph H 0 whose set of edges is the union of the shortest paths trees from every node u to all nodes in its ball. This graph has the same approximation error and the same size as H; since H 0 is a subgraph of G it is called a spanner of G. 9 increasing priority u2 u1 u0 v0 v1 v2 v decreasing distance to v Figure 2: Illustration of the hop reduction for p = 3 priorities. The dotted line is the shortest path π from u0 to v in G. The thick, blue edges are the edges of F used to shorten the distance to v. The dashed, blue edges are not contained in F and imply the existence of edges to nodes of increasing priority. Starting from u0 , a node of priority 0, we let v0 be the node on π such that distG (u0 , v0 ) = r0 := 1, i.e., the neighbor of u0 on π. If the edge (u0 , v0 ) is not contained in F , then F contains an edge (u0 , u1 ) to a node u1 of priority at least 1 such that distG (u0 , u1 ) ≤ r0 . Let v1 be the node on π such that distG (u1 , v1 ) = r1 := 1 + 2/. If the edge (u1 , v1 ) is not contained in F , then F contains an edge (u1 , u2 ) to a node u2 of priority at least 2 such that distG (u1 , u2 ) ≤ r1 . Let v2 be the node on π such that distG (u2 , v2 ) = r2 := (1 + 2/)(2 + 2/). Since 2 is the highest priority, u2 contains the edge (u2 , v2 ). Note that the weight of these three edges from F is at most r0 + r1 + r2 and distG (u0 , v2 ) ≥ r2 − (r0 + r1 ). Since r2 = (1 + 2/)(r0 + r1 ), the ratio between these two quantities is (1 + ). 10 and with at most pddistG (u, v)/∆k e ≤ (p+1)∆k+2 /∆k = (p+1)n2/q = no(1) edges. It follows that F is a (2, no(1) ) hop set of size O(pn1+1/p ) = O(n1+o(1) ). By running the algorithm with 0 = /2 we obtain an (, no(1) ) hop set of size O(n1+o(1) ). Efficient Construction. So far we have ignored the running time for computing the balls and thus constructing F , even in the static setting. Thorup and Zwick [TZ06] have remarked that a naive algorithm for computing the balls takes time O(mn). We can reduce this running time by sampling edges instead of nodes. We modify the process for obtaining the sequence of sets A0 , A1 , . . . , Ap as follows. We set A0 = V and Ap = ∅ and for 1 ≤ i ≤ p − 1 we obtain the set Ai by picking each edge of E independently with probability 1/mi/p and adding both endpoints of each sampled edge to Ai . The priority of a node u is the maximum i such that u ∈ Ai . We define, for every node u of priority i, Ball(u) just like in Equation (1), but using the new definition of Ai . Note that the expected size of Ai is O(m1−i/p ) for every 1 ≤ i ≤ p − 1. The balls can now be computed as follows. First, we use the following process to compute distG (u, Ai ) = minv∈Ai distG (u, v) for every node u and every 1 ≤ i ≤ p − 1. Using Dijkstra’s algorithm on a graph where we add an artificial source node si that is connected to every node in Ai by an edge of weight 0, this takes time O(p(m + n log n)). Second, we compute for every node u of priority i a shortest paths tree up to depth distG (u, Ai+1 ) − 1 to obtain all nodes contained in Ball(u). Using an implementation of Dijkstra’s algorithm that only puts nodes into its queue upon their first visit this takes time O(|E[Ball(u)]| log n) where E[Ball(u)] = {(u, v) ∈ E | u ∈ Ball(u) or v ∈ Ball(u)} is the set of edges incident to Ball(u). By the sampling of edges we have, using the same ordering argument as before, that the expected size of Ball(u) is m(i+1)/p . For 0 ≤ i ≤ p − 1 the expected size of Ai is O(m1−i/p ) 1+1/p log n) for all nodes of priority i. and thus these Dijkstra √ computations take time O(m By choosing p = Θ( log n) as described above we have m1/p = O(mo(1) ) and thus the balls can be computed in time O(m1+o(1) ). We define F as the set of edges F = {(u, v) ∈ V 2 | v ∈ Ball(u)} and give each edge (u, v) ∈ F the weight wF (u, v) = distG (u, v). The distance-preserving and hop-reducing properties of F still hold as stated above and its expected size is O(pm1+1/p ). Note that F is not a sparsification of G anymore (as the bound on its size is even more than m). For our purposes the sparsification aspect is not relevant, we only need the hop reduction. Thus in the static setting, we can compute an (, mo(1) )-hop set (which is also an (, no(1) )-hop set) of expected size O(m1+o(1) ) in expected time O(m1+o(1) ). Maintaining Balls Under Edge Deletions. As the graph G undergoes deletions the hop set has to be updated as well. We can achieve this by maintaining the balls w.r.t. a fixed sequence of randomly chosen sets A0 , A1 , . . . , Ap , where A0 = V and Ap = ∅ and for 1 ≤ i ≤ p − 1 we obtain Ai by picking each edge of E independently with probability c ln n/mi/p , for some large enough constant c, and adding both endpoints of each sampled edge to Ai . Note that now, for every 1 ≤ i ≤ p − 1, the expected size of Ai is O(m1−i/p log n) and the size of E[Ball(u)] for every node u of priority i is at most m(i+1)/p with high probability (whp) at any time. This holds because by deleting edges there can only be a polynomial number of different graphs in the whole sequence of updates. Unfortunately, we do not know how to maintain the balls efficiently. However we can maintain for all nodes u 11 the approximate ball Ball(u, D) = {v ∈ V | log distG (u, v) < blog distG (u, Ai+1 )c and distG (u, v) ≤ D} (where u has priority i) in time O(pm1+1/p D log D). Note that Ball(u, D) differs from the definition of Ball(u) in the following ways. First, we use the inequality log distG (u, v) < blog distG (u, Ai+1 )c instead of the inequality distG (u, v) < distG (u, Ai+1 ). This alone increases the additive error of the hops set from 2(2 + 2/)p−2 to 4(3 + 4/)p−2 , which can easily be compensated. Second, we limit the balls to a certain depth D. By using a small value of D we will only obtain a restricted hop set that provides sufficient hop reduction for nodes that are relatively close to each other. We will show later that this is enough for our purposes. Despite of these modifications we clearly have Ball(u, D) ⊆ Ball(u) and therefore all size bounds still apply. In the first part of the algorithm for maintaining the balls we maintain distG (u, Ai ) every 1 ≤ i ≤ p − 1 and every node u. We do this by adding an artifical source node si that has an edge of weight 0 to every node in Ai and maintain an ES-tree up to depth D from si . This step takes time O(pmD). Now, for every node u of priority i we maintain Ball(u, D) as follows. We maintain an ES-tree up to depth   min 2blog distG (u,Ai+1 )c − 1, D and every time 2blog distG (u,Ai+1 )c increases, we restart the ES-tree. Naively, we incur a cost of O(mD) for each instance of the ES-tree. However we can easily implement the ES-tree in a way that it never looks at edges that are not contained in E[Ball(u)].6 Thus, the cost of each instance of the ES-tree is O(|Ball(u)|D). Remember that Ball(u, D) ⊆ Ball(u) and that by the random sampling of edges the size of E[Ball(u)] is at most m(i+1)/p whp. As 2blog distG (u,Ai+1 )c can increase at most log D times until it exceeds D, we initialize at most log D ES-trees for the node u. Therefore the total time needes for maintaining Ball(u, D) is O(m(i+1)/p D log D). As there are at most Õ(m1−i/p ) nodes of priority i in expectation, the total time needed for maintaining all approximate balls is Õ(pm1+1/p D log D) in expectation. Decremental Approximate SSSP. Let us first sketch an algorithm for maintaining shortest paths from a source of O(m1+1/2+o(1) ) for which we √ node s with a running time √ use q = 2 layers and p = Θ( log n) priorities. We set ∆ = n, D = 2(3 + 4/)p−2 ∆, and p such that 2(3 + 4/)p−2 ≤ n1/p and n1/p = O(no(1) ). We maintain single-source shortest paths up to depth D from s using the ES-tree, which takes time O(mD) = O(mn1/2+o(1) ). To maintain approximate shortest paths to nodes that are at distance more than D from s we use the following approach. We maintain Ball(u, D) for every node u, as sketched above, which takes time Õ(pm1+1/p D log D) = O(m1+1/2+o(1) ) in expectation. At any time, we set the hop set F to be the set of edges F = {(u, v) ∈ V 2 | ∃v ∈ Ball(u, D)} and give each edge (u, v) ∈ F the weight wF (u, v) = distG (u, v). By our arguments above, the weighted graph H = (V, F ) has the following property: for every pair of nodes u and v such that 6 If we prefer to use the ES-tree as a “black box” we can, in a preprocessing step, find the initial set Ball(u, D) and only build an ES-tree for this ball. All other nodes will never be contained in Ball(u, D) anymore as long as the value of 2blog distG (u,Ai+1 )c remains unchanged and therefore we can remove them. This can be done in time O(|E[Ball(u, D)]| log n) by using an implementation of Dijkstra’s algorithm that only puts nodes into its queue upon their first visit. 12 distG (u, v) ≥ D ≥ ∆ there is a path π in H of weight at most (1 + 2) distG (u, v) and with at most p distG (u, v)/∆ edges. To maintain approximate shortest paths for nodes at distance more than D from s we will now use the hop reduction in combination with the following rounding technique. We set ϕ = ∆/p and let H 0 be the graph resulting from rounding up every edge weight in H to the next multiple of ϕ. By using H 0 instead of H we incur an error of ϕ for every edge on the approximate shortest path path π. Thus in H 0 , π has weight at most (1 + 2) distG (u, v) + (p distG (u, v)/∆) · ϕ = (1 + 2) distG (u, v) +  distG (u, v) ≤ (1 + 3) distG (u, v) . The efficiency now comes from the observation that we can run the algorithm on the graph H 00 where every edge weight in H 0 is scaled down by a factor of 1/ϕ. The graph H 00 has integer weights and the weights of all paths in H 0 and H 00 differ exactly by the factor 1/ϕ. Thus, instead of maintaining a shortest paths tree up to depth n in H we only need to √ maintain a shortest paths tree in H 00 up to depth n/ϕ = p n/. In this way we obtain a (1 + 3)-approximation for all nodes such that distG (u, v) ≥ D. However, we cannot simply use the ES-tree on H 00 because as edges are deleted from G, nodes might join the approximate balls and therefore edges might be inserted into F and thus into H 00 . This means that a dynamic shortest paths algorithm running on H 00 would not find itself in a purely decremental setting. However the insertions have a “nice” structure. We can deal with them by using a previously developed technique, called monotone ES-tree. The main idea of the monotone ES-tree is to ignore the level decreases suggested by inserting edges. The hop-set proof still goes through, even though we are not arguing about the current distance in H 00 anymore, but the level of a node u in the monotone ES-tree. Maintaining the monotone ES-tree for distances up to D in H 00 takes time O(|E(H)|D) where E(H 00 ) is the set of edges ever contained in H 00 (including those that are inserted over time) and D = O(n1/2+1/p ) as explained above. Each insertion of an edge into F corresponds to a node joining Ball(u, D) for some node u. For a fixed node u of priority i there are at most log D possibilities for nodes to join Ball(u, D) (namely each time blog distG (u, Ai+1 c increases) and every time at most m(i+1)/p nodes will join whp. It follows that |E(H)| is O(m1+o(1) ) whp and the running time of this step is O(m1+1/2+o(1) ) in expectation. is just slightly more complicated. Here we use p = √The almost linear-time algorithm √ Θ( log n) priorites and q = p layers and set ∆k = nk/q for each 0 ≤ k ≤ q − 2. In the algorithm we will maintain, for each 0 ≤ k ≤ q − 2 a hop set Fk such that for every pair of nodes u and v with ∆k+1 ≤ distG (u, v) ≤ ∆k+2 there is a path from u to v in Hk = (V, Fk ) of weight at most (1 + 2) distG (u, v) and with at most p distG (u, v)/∆k ≤ pn2/q hops. To achieve this we use the following hierarchical approach. Given the hop set Fk we can maintain approximate shortest paths up to depth ∆k+2 in time O(m1+o(1) ) and given a data structure for maintaining approximate shortest paths up to depth ∆k we can maintain approximate balls und thus the hop set Fk+1 in time O(m1+o(1) ). The hierarchy “starts” with using the ES-tree as an algorithm for maintaining an (exact) shortest paths tree up to depth n2/q . Thus, running efficient monotone ES-trees on top of the hop sets and maintaining the hop sets (using efficient monotone ES-trees) go hand in hand. There are two obstacles in implementing this hierarchical approach when we want to maintain the approximate balls in each layer. First, in our algorithm for maintaining the 13 approximate balls we have used the ES-tree as an exact decremental SSSP algorithm. In the multilayer approach we have to replace the ES-tree with the monotone ES-tree which only provides approximate distance estimates. This will lead to approximation errors that increase with the number of layers. Second, by the arguments above the number of edges in Fk is O(m1+1/p ) for each 0 ≤ k ≤ q − 2. In the algorithm for maintaining the approximate balls for the next layer, this bound however is not good enough because we run a separate instance of the monotone ES-tree for each node u. We deal with this issue by running the monotone ES-tree in the subgraph of G induced by the nodes initially contained in Ball(u). For a node u of priority i this subgraph contains mi = m(i+1)/p edges whp and we can recursively run our algorithm on this smaller graph. By this process we incur a factor of m1/p in the running time each time each time we increase the depth of the recursion. This √ results in a total update time of Õ(m1+q/p ) which is Õ(m1+1/q ) = O(m1+o(1) ) since q = p. Extension to Weighted Graphs. The hop set construction described above was only for unweighted graphs. However, the main property that we needed was distG (u, v) ≤ n for any pair of nodes u and v. Using the rounding technique mentioned above, we can construct for each 0 ≤ i ≤ blog nW c a graph Gi such that for all pairs of nodes u and v with 2i ≤ distG (u, v) ≤ 2i+1 we have distGi (u, v) ≤ 4n/ for some small γ and the shortest path in Gi can be turned into a (1 + )-approximate shortest path in G by scaling up the edge weights. We now run O(log (nW )) instances of our algorithm, one for each graph Gi , and maintain the hop set and approximate SSSP for each of them. We only need to refine the analysis of the hop-set property in the following way. Remember that in the analysis we considered the shortest path π from u to v and defined the node u0 that is at distance ∆ from u on π. If the hop set contained the edge (u, u0 ) we could reduce the distance to v by ∆. In weighted graphs (even after the scaling), we cannot guarantee there is a node at distance ∆ from u on π. Therefore we define u0 as the furthest node that is at distance at most ∆ from u on π. Futhermore we define u00 as the neighbor of u0 on π, i.e., u00 is at distance at least ∆ from u. Now if the hop set contains the edge (u, u0 ) we first use the edge (u, u0 ) from the hop set, and then the edge (u0 , u00 ) from the original graph to reduce the distance to v by at least ∆ with only 2 hops. Note that for unweighted graphs it was sufficient to only use the edges of the hop set. For weighted graphs we really have to add the edges of the hop set to the original graph in our algorithm. Outline. As sketched above, our algorithm uses the following hierarchical approach: Given a decremental approximate SSSP algorithm for distances up to Di with total update time O(m1+o(1) ), we can maintain approximate balls for distances up to Di with total time O(m1+o(1) ) as well. And given a decremental algorithm for maintaining approximate balls for distances up to Di with total update time O(m1+o(1) ) we can use the approximate balls to define a hop set which allows us to maintain approximate shortest paths for distances up to Di+1 = no(1) Di with total update time O(m1+o(1) ). This scheme is repeated until Di is large enough to cover the full distance range. We have formulated the two parts of this scheme as reductions. In Section 4 we give a decremental algorithm for maintaining approximate balls that internally uses a decremental approximate SSSP algorithm. In Section 5 we give a decremental approximate SSSP algorithm that internally uses a decremental algorithm for maintaining approximate balls. In Section 6 14 we explain the hierarchical approach for putting these two parts together and obtain the decremental (1 + )-approximate SSSP algorithm with a total update time of O(m1+o(1) ) for the full distance range. In addition to this result, the algorithm for maintaining approximate balls, together with a suitable query algorithm, gives us a decremental approximate APSP algorithm. This algorithm is also given in Section 6. 4 From Approximate SSSP to Approximate Balls In the following we show how to maintain the approximate balls of every node if we already have an algorithm for maintaining approximate shortest paths. In our reduction we will use the algorithm for maintaining approximate shortest paths as a “black box”, requiring only very few properties. Formally, we prove the following statement in this section. Proposition 4.1. Assume there is a decremental approximate SSSP algorithm ApproxSSSP with the following properties, using fixed values α ≥ 1, β ≥ 0, and D ≥ 1: Given a weighted graph G = (V, E) undergoing edge deletions and edge weight increases and a fixed source node s ∈ V , ApproxSSSP maintains for every node v ∈ V a distance estimate δ(s, v) such that: A1 δ(s, v) ≥ distG (s, v) A2 If distG (s, v) ≤ D, then δ(s, v) ≤ α distG (s, v) + β. . A3 After every update in G, ApproxSSSP returns, for every node v such that δ(s, v) has changed, v together with the new value of δ(s, v). We denote the total update time of ApproxSSSP by T (m, n). Then there is a decremental algorithm ApproxBalls for maintaining approximate balls with the following properties: Given a weighted graph G = (V, E) undergoing edge deletions and edge weight increases and parameters 2 ≤ k ≤ log n and 0 <  ≤ 1, it assigns to every node u ∈ V a number from 0 to k − 1, called the priority of u, and maintains for every node u ∈ V a set of nodes B(u) and a distance estimate δ(u, v) for every node v ∈ B(u) such that: B1 For every node u and every node v ∈ B(u) we have distG (u, v) ≤ δ(u, v) ≤ α distG (u, v)+ β. B2 Let s(·, ·) be a non-decreasing function such that, for all x ≥ 1, and l ≥ 1, s(x, l) ≥ a(a + 1)l−1 distG (u, v) + ((a + 1)l − 1)b/a , where a = (1 + )α and b = (1 + )β + 1. Then for every node u of priority i and every node v such that s(distG (u, v), p − 1 − i) ≤ D, either (1) v ∈ B(u) or (2) there is some node v 0 of priority j > i such that u ∈ B(v 0 ) and distG (u, v 0 ) ≤ s(distG (u, v), j − i). B3 If, for every node u, B(u) denotes the set of nodes ever contained in B(u), then P 1+1/k log D/) in expectation. u∈V |Bu | = Õ(m 15 B4 The update time of ApproxBalls is   t(m, n, k, ) = Õ m1+1/k log D/ + X m1−i/k · T (mi , ni ) log D/ + T (m, n) , 0≤i≤k−1 where, for each 0 ≤ i ≤ k − 1, mi = m(i+1)/k and ni = min(mi , n). B5 After every update in G, ApproxBalls returns all pairs of nodes u and v such that v joins B(u), v leaves B(u), or δ̂(u, v) changes. Our algorithm for maintaining the approximate balls B(u) for every node u ∈ V is as follows: 1. At the initialization we set F0 = E and Fk = ∅ and for 1 ≤ i ≤ k − 1, a set of edges Fi is obtained from sampling each edge of E independently with probability (c ln n)/mi/k (for a large enough constant c). For every 0 ≤ i ≤ k − 1 we set Ai = {v ∈ V | ∃(v, w) ∈ Fi } and for every node v ∈ V , we set the priority of u to be the maximum i such that v ∈ Ai . 2. For each 1 ≤ i ≤ k − 1 we run an instance of ApproxSSSP with depth D from an artificial source node si that has an edge of weight 0 to every node in Ai . We denote the distance estimate provided by ApproxSSSP δ(u, Ai ) and set δ(u, Ak ) = ∞ for every node u ∈ V . 3. For every 0 ≤ i ≤ k − 1 and every node u ∈ V of priority i, we maintain the value r(u) = min (1 + )blog1+ (δ(u,Ai+1 )−1)c − β ,D α ! . and at the initialization and each time r(u) increases we do the following: (a) Compute the set of nodes R(u) = {v ∈ V | distG (u, v) ≤ r(u)}. (b) Run an instance of ApproxSSSP with depth D from u in G|R(u), the subgraph of G induced by R(u). Let δ(u, v) denote the estimate of the distance between u and v in G|R(u) maintained by ApproxSSSP. (c) Maintain B(u) = {v ∈ V | δ(u, v) ≤ αD + β}: every time δ(u, v) changes for some node v we check whether v is still contained in B(u). Note that ApproxBalls has Property B5, i.e., it returns changes in the approximate balls and the distance estimates, which is possible because ApproxSSSP has Property A3. 4.1 Relation to Exact Balls In the following we compare the approximate balls maintained by our algorithm to the exact balls, as used by Thorup and Zwick [TZ06]. We show how the main properties of exact balls translate to approximate balls. We use the following definition of the (exact) ball of a node u of priority i: Ball(u) = {v ∈ V | distG (u, v) < distG (u, Ai+1 )} . 16 The balls have the following simple property: If v ∈ / Ball(u), then there is a node v 0 of priority j > i such that distG (u, v 0 ) ≤ distG (u, v). We show that a relaxed version of this statement also holds for the approximate balls. Lemma 4.2. Let u be a node of priority i and let v be a node such that distG (u, v) ≤ D. If v∈ / B(u), then there is a node v 0 of priority j > i such that distG (u, v 0 ) ≤ a distG (u, v) + b, where a = (1 + )α and b = (1 + )β + 1. Proof. We show the following: If distG (u, Ai+1 ) ≥ a distG (u, v), then v ∈ B(u). The claim then follows from contraposition: If v ∈ / B(u), then distG (u, Ai+1 ) < a distG (u, v) + b and thus there exists some node v 0 ∈ Ai+1 that has priority j ≥ i + 1 such that distG (u, v 0 ) < a distG (u, v) + b. Assume that distG (u, Ai+1 ) ≥ a distG (u, v) + b. Remember that we have set r(u) = min (1 + )blog1+ (δ(u,Ai+1 )−1)c − β ,D α ! . Since δ(u, Ai+1 ) ≥ distG (u, Ai+1 ) by Property A1 we have δ(u, Ai+1 ) ≥ distG (u, Ai+1 ) ≥ a distG (u, v) + b = (1 + )(α distG (u, v) + β) + 1 which is equivalent to distG (u, v) ≤ δ(u,Ai+1 )−1 1+ α −β . Since (1 + )blog1+ (δ(u,Ai+1 )−1)c ≥ (1 + )log1+ (δ(u,Ai+1 )−1)−1 = (δ(u, Ai+1 ) − 1)/(1 + ) it follows that (1 + )blog1+ (δ(u,Ai+1 )−1)c − β distG (u, v) ≤ α Since we have assumed that distG (u, v) ≤ D we get distG (u, v) ≤ r(u) which implies that distG|R(u) (u, v) ≤ r(u) ≤ D as well. Thus, by Property A2, it follows that δ(u, v) ≤ α distG|R(u) +β ≤ αD + β and v ∈ B(u) as desired. We now show that the approximate balls are contained in the exact balls. The exact balls are useful in our analysis because we can easily bound their size. Lemma 4.3. At any time B(u) ⊆ Ball(u) for every node u. Proof. Let R(u) = {v ∈ V | distG (u, v) ≤ r(u)} denote the set of nodes in distance at most r(u) from u at the last time r(u) has increased. Note that B(u) is a set of nodes of the graph G|R(u) and therefore B(u) ⊆ R(u). It remains to show that R(u) ⊆ Ball(u). If i = k − 1, then the claim is trivially true because Ball(u) contains all nodes that are connected to u in G. In the case 0 ≤ i < k − 1 remember that r(u) = min (1 + )blog1+ (δ(u,Ai+1 )−1)c − β ,D α 17 ! . If distG (u, Ai+1 ) > r(u), we trivially have distG (u, v) ≤ r(u) < distG (u, Ai+1 ). If on the other hand distG (u, Ai+1 ) ≤ r(u), then in particular distG (u, Ai+1 ) ≤ D and by Property A2 we have δ(u, Ai+1 ) ≤ α distG (u, Ai+1 ) + β. It follows that (1 + )blog1+ (δ(u,Ai+1 )−1)c − β α (1 + )log1+ (δ(u,Ai+1 )−1) − β δ(u, Ai+1 ) − 1 − β 1 ≤ ≤ ≤ distG (u, Ai+1 ) − . α α α distG (u, v) ≤ r(u) ≤ This is implies that distG (u, v) < distG (u, Ai+1 ) because the distances are integer and 1/α > 0. In both cases we get distG (u, v) < distG (u, Ai+1 ) and as this is the defining property of Ball(u) we have v ∈ Ball(u). Lemma 4.4. At any time the size of Ball(u) is O(m(i+1)/k ) whp for every node u of priority i. Proof. Note that the claim is trivially true for i = k − 1. Therefore assume i < k − 1 in the following. For every edge e = (v, w) ∈ E we define distG (u, e) = min(distG (u, v), distG (v, w)). Let F ⊆ E be the set consisting of the m(i+1)/k edges that are closest to u according to this definition of distG (u, e) for each edge e, where ties are broken in an arbitrary but fixed order. (Note that if less than m(i+1)/k edges are connected to u, then the claim is true anyway). Let U be the set of nodes U = {v ∈ V | ∃(v, w) ∈ F }. By the random sampling (Lemma 2.3), F contains an edge (v, w) of Fi+1 with high probability. Assume without loss of generality that distG (u, v) ≤ distG (v, w), i.e., distG (u, e) = distG (u, v). Let v 0 ∈ Ball(u) and let e0 = (v 0 , w0 ) be some edge incident to v 0 . Since the node v is contained in Ai+1 we have distG (u, e0 ) ≤ distG (u, v 0 ) < distG (u, Ai+1 ) ≤ distG (u, v) = distG (u, e) . Therefore we have e0 ∈ F and thus v 0 ∈ U . It follows that Ball(u) ⊆ U . Observe that |U | ≤ 2|F | and thus |Ball(u)| ≤ |U | ≤ 2|F | = 2m(i+1)/k whp. 4.2 Properties of Approximate Balls We now show that the approximate balls and the corresponding distance estimate have the Properties B1–B4. We first show that the distance estimates for nodes in the approximate balls have the desired approximation guarante, although they have been computed in subgraphs of G. Lemma 4.5 (Property B1). For every pair of nodes u and v such that v ∈ Ball(u) we have distG (u, v) ≤ δ(u, v) ≤ α distG (u, v) + β. Proof. By Property A1 we have δ(u, v) ≥ distG|R(u) (u, v) and since G|R(u) is a subgraph of G we have distG|R(u) (u, v) ≥ distG (u, v). Therefore the inequality δ(u, v) ≥ distG (u, v) follows. Since v ∈ Ball(u) we have δ(u, v) ≤ αD + β. If distG (u, v) ≥ D, then trivially δ(u, v) ≤ αD + β ≤ α distG (u, v) + β. If distG (u, v) ≥ D, then there is a path k from u to v in G of weight at most D. This path was also contained in previous versions of G, possibly with smaller weight, and in particular at the time the algorithm has computed R(u), the set of 18 nodes that are in distance at most D from u in G, for the last time. It follows that k is also contained in G|R(u) and thus distG|R(u) (u, v) = distG (u, v) ≤ D. By Property A2 we then have δ(u, v) ≤ α distG|R(u) +β = α distG +β. We show now that the approximate balls have a certain structural property that either allows us shortcut the path between two nodes or helps us in finding a nearby node of higher priority. Lemma 4.6 (Property B2). Let s(·, ·) be a non-decreasing function such that, for all x ≥ 1, and l ≥ 1, s(x, l) ≥ a(a + 1)l−1 distG (u, v) + ((a + 1)l − 1)b/a , where a = (1 + )α and b = (1 + )β + 1. Then for every node u of priority i and every node v such that s(distG (u, v), p − 1 − i) ≤ D, either (1) v ∈ B(u) or (2) there is some node v 0 of priority j > i such that u ∈ B(v 0 ) and distG (u, v 0 ) ≤ s(distG (u, v), j − i). Proof. We first define the following series: let f (1) = a distG (u, v) + b and for all l ≥ 1 let f (l + 1) = f (l) + af (l) + b. It is easy to verify that for all l ≥ 1 we have f (l) = a2 (a + 1)l−1 distG (u, v) + ((a + 1)l − 1)b ≤ s(distG (u, v), l) . a Note that since s(·, ·) is non-decreasing we have, for all 1 ≤ l ≤ k − 1 − i, f (l) ≤ s(distG (u, v), l) ≤ s(distG (u, v), p − 1 − i) ≤ D. If v ∈ B(u), then we are done. Otherwise, by Lemma 4.2, there is some node v1 of priority p1 ≥ i + 1 such that distG (v1 , u) ≤ a distG (u, v) + b = f (1) ≤ D . Thus, if u ∈ B(v1 ), then we are done. Otherwise, by Lemma 4.2, there is some node v2 of priority p2 ≥ p1 + 1 ≥ i + 2 such that distG (v2 , v1 ) ≤ a distG (v1 , u) + b ≤ af (1) + b . By the triangle inequality we have distG (v2 , u) ≤ distG (v2 , v1 ) + distG (v1 , u) ≤ af (1) + b + f (1) = f (2) ≤ D . We now repeat this argument to obtain nodes v1 , v2 , . . . vl of priorities p1 , p2 , . . . , pl such that distG (vl , u) ≤ f (l) ≤ D and pl ≥ i + l until the inequality distG (vl , Apl +1 ) ≥ a distG (vl , u) + b is fulfilled. This happens eventually since Ak = ∅ and thus distG (u, Ak ) = ∞. Next, we bound the size of the system of approximate balls we maintain. Here we use the fact that we can easily bound the size of the exact ball Ball(u) for every node u and that by our definitions we ensure that the approximate balls are subsets of the exact balls. Lemma 4.7 (Size of Approximate Balls (Property B3)). If, for every node u, B(u) denotes the set of nodes ever contained in B(u), then Õ(m1+1/k logD /) in expectation. 19 P u∈V |Bu | = Proof. We first bound Bu , the number of nodes ever contained in the approximate ball B(u), of some node u of priority i. Remember that nodes are joining B(u) only when r(u) increases and that ! (1 + )blog1+ (δ(u,Ai+1 )−1)c − β r(u) = min ,D . α Thus, r(u) can only increase if blog1+ (δ(u, Ai+1 ) − 1)c increases and the left term in the minimum is at most D. Since 1 +  ≥ 1 and β ≥ 0 it follows that r(u) increases only O(log1+ D) = O(log D/) times. As B(u) ⊆ Ball(u) by Lemma 4.3, after every increase of r(u) only nodes contained in Ball(u) can join B(u). By Lemma 4.4 the size of Ball(u) is O(m(i+1)/k ) whp. Thus, the number of nodes ever contained in B(u) is |B(u)| = O(m(i+1)/k log D/) whp. As the number of nodes of priority i is Õ(m/mi/k ) in expectation, the number of nodes P ever contained in the approximate balls is u∈V |B(u)|Õ(m1+1/k log D/) in expectation. Finally, we analyze the running time of our algorithm for maintaining the approximate balls. Since we use the data structure ApproxSSSP as a black box, the running time of our algorithm depends on the running time of ApproxSSSP. Lemma 4.8 (Running Time (Property B4)). The total time needed for maintaining the sets B(u) for all nodes u ∈ V is   Õ m1+1/k log D/ + X T (mi , ni ) log D/ + T (m, n) , 0≤i≤k−1 where, for each 0 ≤ i ≤ k − 1, mi = m(i+1)/k and ni = min(mi , n). Proof. The initialization in Step 1 of the algorithm, where we determine the sets A0 , . . . , Ap takes time O(pm). In Step 2, we run for each 1 ≤ i ≤ k −1 an instance of ApproxSSSP with depth D. This takes time kT (m, n). Step 3, where we maintain for every node u of priority i the approximate ball and corresponding distance estimates can be analyzed as follows. Remember that every time r(u) increases we first compute R(u), the set of nodes that are in distance at most r(u) from u. Using a suitable implementation of Dijkstra’s algorithm, this takes time O(|E[R(u)]| log n), where E[R(u)] is the set of edges incident to R(u). By Lemma 4.3 we have R(u) ⊆ Ball(u) and by Lemma 4.4 we have |Ball(u)| = O(m(i+1)/k ) whp. Thus, computing R(u) takes time Õ(m(i+1)/k ) whp. We then maintain an instance of ApproxSSSP up to depth D on G|R(u), the subgraph of G induced by R(u). Note that G|R(u) has mi = m(i+1)/k edges and ni = min(mi , n) nodes and therefore this takes time T (mi , ni ). As r(u) increases O(log D/) times and the number of nodes of priority i is Õ(m/mi/k ) in expectation, maintaining B(u) for all nodes u of priority i (and the corresponding distance estimates) takes time m Õ log D/ · (m(i+1)/k + T (mi , ni ) = i/k m 0≤i≤k−1 X     Õ m1+1/k log D/ + X 0≤i≤k−1 Since k ≤ log n, the claimed running time follows. 20 m1−i/k · T (mi , ni ) log D/ . 5 From Approximate Balls to Approximate SSSP In the following we show how to maintain an approximate shortest paths tree if we already have an algorithm for maintaining approximate balls. Our main tool in this reduction is a hop set that we define from the approximate balls. We will add the “shortcut” edges of the hop set to the graph and scale down the edge weights, maintaining the approximate shortest paths with a monotone ES-tree. Formally, we prove the following statement in this section. Proposition 5.1. Assume there is a decremental algorithm ApproxBalls for maintaining approximate balls with the following properties, using fixed values a ≥ α ≥ 1, b ≥ β ≥ 0, and D̂ ≥ 1. Given a weighted graph G = (V, E) undergoing edge deletions and edge weight increases and a parameters 2 ≤ k ≤ log n, it assigns to every node u ∈ V a number from 0 to k − 1, called the priority of u, and maintains for every node u ∈ V a set of nodes B(u) and, for every node v ∈ B(u), a distance estimate δ̂(u, v) such that: B1 For every node u and every node v ∈ B(u) we have distG (u, v) ≤ δ̂(u, v) ≤ α distG (u, v)+ β. B2 There is a function s(·, ·) such that, for all x ≥ 1, s(x, 1) = ax + b for some a ≥ α and b ≥ β and, for all l ≥ 1, s(x, l + 1) ≤ a(α + 1 + )(αs(x, l) + β) + β + b.  guaranteeing the following: For every node u of priority i and every node v such that s(distG (u, v), p − 1 − i) ≤ D̂, either (1) v ∈ B(u) or (2) there exist some node v 0 ∈ V of priority j > i such that u ∈ B(v 0 ) and distG (u, v 0 ) ≤ s(distG (u, v 0 ), j − i). B3 After every update in G, ApproxBalls returns all pairs of nodes u and v such that v joins B(u), v leaves B(u), or δ̂(u, v) changes. For every node u, let B(u) denote the set of nodes ever contained in B(u) and let t(m, n, k) denote the total update time of ApproxBalls. Then there is an approximate SSSP data structure ApproxSSSP with the following properties: Given a weighted graph G undergoing edge deletions and edge weight increases, a fixed source node s, and parameters p, ∆, D, and  such that √ log n 2≤p≤ r  , 3 log 4a ∆ ≥ b, n1/p ∆ ≤ D̂, D ≥ ∆ and 0 <  ≤ 1, it maintains a distance estimate δ(s, v) for every node v ∈ V such that: A1 δ(s, v) ≥ distG (s, v) A2 If distG (s, v) ≤ D, then δ(s, v) ≤ (α + ) distG (s, v) + n1/p ∆ A3 The total update time of ApproxSSSP is T (m, n, ∆, D, ) = Õ((αD/∆ + n1/p ) X u∈V 21 (m + |B(u)|)/ + t(m, n, p)) . A4 After every update in G, ApproxSSSP returns, for every node v such that δ(s, v) has changed, v together with the new value of δ(s, v). We assume without loss of generality that the distance estimate maintained by ApproxBalls is non-decreasing. If ApproxBalls ever reports a decrease we can ignore it because Property B1 will still hold as distances in G are non-decreasing under edge deletions and edge weight increases. 5.1 Algorithm Description The algorithm ApproxSSSP maintains the set of edges F = {(u, v) ∈ V 2 | v ∈ B(u)} such that each edge (u, v) ∈ F has weight wF (u, v) = δ(u, v). We update F every time in ApproxBalls a node joins or leaves an approximate ball or if the distance estimate δ(u, v) increases for some pair of nodes u and v. By Property B3 this information is returned by ApproxBalls after every update in G. Thus the set of edges F undergoes insertions, deletions, and weight increases. In the following we will define a shortcut graph H 00 with scaled-down edge weights and our algorithm ApproxSSSP will simply run a monotone ES-tree [HKN13] from s in H 00 . Note that the monotone ES-tree trivially has properties A1 and A4. We denote the weight of an edge (u, v) in G by wG (u, v) and define H as a graph that has the same nodes as G and contains all edges of G and F that have weight at most D + n1/p ∆. We set the weight of every edge (u, v) in G to wH = min(wG (u, v), wF (u, v)). We set ϕ= ∆ p+1 and define H 0 as the graph that has the same nodes and edges as H and in which every edge (u, v) has weight   wH (u, v) ϕ, wH 0 (u, v) = ϕ i.e., we round every edge weight to the next multiple of ϕ. Furthermore, we define H 00 as the graph that has the same nodes and edges as H 0 and in which every edge (u, v) has weight wH 0 (u, v) wH (u, v) wH 00 (u, v) = = , ϕ ϕ   i.e., we scale down every edge weight by a factor of 1/ϕ. We maintain a monotone ES-tree with maximum level L = (α + 2)D/ϕ + (p + 1)n1/p from s and denote the level of a node v in this tree by `(v). For every node v our algorithm returns the distance estimate δ(s, v) = `(v) · ϕ. Note that the graph H 00 has integer edge weights and, as F might undergo insertions, deletions, and edge weight increases, the same type of updates might occur in H 00 . Furthermore, observe that the rounding guarantees that wH (u, v) ≤ wH 0 (u, v) ≤ wH (u, v) + ϕ for every edge (u, v) of H 0 . 22 5.2 Running Time Analysis We first provide the running time analysis. We run the algorithm in a graph in which we scale down the edge weights by a factor of ϕ. This makes the algorithm efficient. Lemma 5.2 (Running Time (Property A3)). The expected total update time of a monotone ES-tree with maximum level L = (α + 2)D/ϕ + (p + 1)n1/p on H 00 is Õ  αD/∆ + n1/p  ! m+ X ! |B(u)| / . u∈V Proof. By Lemma 2.2 the total time needed for maintaining the monotone ES-tree with maximum level L on H 00 is O(E(H 00 ) · L + W(H 00 )) where E(H 00 ) is the number of edges ever contained in H 00 and W(H 00 ) is the number of updates (i.e., edge deletions, edge weight increases, and edge insertions) on H 00 . Remember that ϕ = ∆/(p + 1). Since  ≤ 1 and p ≤ log n we have L = Õ(αD/(∆) + 1/p n ). We now bound E(H 00 ) and W(H 00 ). Note that at any time H 00 has the same edges as H and each edge of H either is also an edge in G, which contains m edges, or is an edge from F . As F is defined via the approximate balls (i.e., (u, v) ∈ F if and only v ∈ B(u)), the number P of edges ever contained in F is at most u∈v |B(u)|, the total number of nodes ever contained P in the approximate balls. It follows that E(H 00 ) = Õ(m + u∈v |B(u)|) in expectation. Note that every edge contained in H 00 can be inserted and deleted at most once and its weight can increase at most (D + n1/p ∆)/ϕ times as we have limited the maximum edge weight in H to D + n1/p ∆. Note that (D + n1/p ∆)/ϕ = (D + n1/p ∆)(p + 1)/(∆) = Õ((D/∆ + n1/p )/). Therefore we have W(H 00 ) ≤ 2E(H 00 ) + E(H 00 ) · (D + n1/p ∆)/ϕ = Õ((m + X |B(u)|) · (D/∆ + n1/p )/) . u∈v We conclude that E(H 00 ) · L + W(H 00 ) = Õ((αD/∆ + n1/p )(m + X |B(u)|)/) u∈v and thus the claimed running time follows. 5.3 Definitions of Values for Approximation Guarantee Before we analyze the approximation guarantee we define the following values. We set r0 = ∆ and for every 0 ≤ i ≤ p − 1 we set si = ari + b , wi = αsi + β , and P (α + 1 + ) 0≤j≤i−1 wj + β (if i ≥ 1) . ri =  23 Finally, we set γp−1 = β and, for every 0 ≤ i ≤ p − 2, X γi = γi+1 + (α + 1 + )wi = (α + 1 + ) wj + β . i≤j≤p−2 We also set γ = γ0 + 2∆ . Lemma 5.3. For all 0 ≤ i ≤ p − 1, ri = γ0 − γi + β Proof. First, observe that for all 0 ≤ i ≤ p − 1 we have X γi = (α + 1 + ) wj + β . i≤j≤p−2 Thus, for all 0 ≤ i ≤ p − 1, we get γ0 −γi +β = (α+1+) X X wj −(α+1+) i≤j≤p−2 0≤j≤p−2 X wj +β = (α+1+) wj +β = ri . 0≤j≤i−1 Lemma 5.4. (4a3 /)p = n1/p Proof. Remember that we have √ log n p≤ r  . 3 log 4a We only need to simplify both expressions as follows: q 4a3  log n1/p = 21/p·log n ≥ 2 √ log n √ 4a3  !p p·log  =2 4a  log n q  3 ≤2 log r  4a3  ·log n  ·log log  =2  4a3  4a3  √  √ r log n· =2 Lemma 5.5. For all 0 ≤ i ≤ p − 1 we have ri ≤ 3 · 4i−1 a3i ∆ + (9 · 4i−1 − 2)a3i−1 b i and X 0≤j≤i wj ≤ 4i a3i+2 ∆ + (3 · 4i − 1)a3i+1 b . i 24 · log n log  4a3   . Proof. Remember that  ≤ 1 ≤ α ≤ a. Now observe that for all 1 ≤ i ≤ p − 1 we have ri = (α + 1 + ) P 0≤j≤i−1 wj +β  ≤ (a + 1 + ) P 0≤j≤i−1 wj  +b ≤ 3a P 0≤j≤i−1 wj +b  and for all 0 ≤ i ≤ p − 1 we have wi = αsi + β ≤ asi + b = a(ari + b) + b = a2 ri + ab + b ≤ a2 ri + 2ab . We now prove the inequalities induction on i. We begin with the base case i = 0 where r0 = ∆ and X wj = w0 ≤ a2 r0 + 2ab = a2 ∆ + 2ab = 0≤j≤0 40 a3·0+2 ∆ + (3 · 40 − 1)a3·0+1 b . 0 In the induction step we assume that i ≥ 1: ri ≤ 3a P 0≤j≤i−1 wj +b  3a(4i−1 a3(i−1)+2 ∆ + (3 · 4i−1 − 1)a3(i−1)+1 b) + b i i−1 3i i−1 3 · 4 a ∆ + (9 · 4 − 2)a3i−1 b = i ≤ X wj = 0≤j≤i X wj + wi 0≤j≤i−1 ≤ X wj + a2 ri + 2ab 0≤j≤i−1 ≤ ≤ ≤ ≤ = = 4i−1 a3(i−1)+2 ∆ + (3 · 4i−1 − 1)a3(i−1)+1 b + a2 ri + 2ab i−1 4i−1 a3(i−1)+2 ∆ + (3 · 4i−1 − 1)a3(i−1)+1 b 3 · 4i−1 a3i+2 ∆ + (9 · 4i−1 − 2)a3i+1 b + + 2ab i−1 i 4i−1 a3(i−1)+2 ∆ + (3 · 4i−1 − 1)a3(i−1)+1 b + 3 · 4i−1 a3i+2 ∆ + (9 · 4i−1 − 2)a3i+1 b + 2ab i i−1 3i+2 i−1 3i+1 i−1 4 a ∆ + (3 · 4 − 1)a b + 3 · 4 a3i+2 ∆ + (9 · 4i−1 − 2)a3i+1 b + 2a3i+1 b i i−1 3i+2 i−1 (1 + 3) · 4 a ∆ + (3 · 4 − 1 + 9 · 4i−1 − 2 + 2)a3i+1 b i i 3i+2 i 3i+1 4a ∆ + (3 · 4 − 1)a b . i  Lemma 5.6. aγ + b ≤ n1/p ∆. Proof. Remember that we have  ≤ 1 ≤ α ≤ a and β ≤ b ≤ ∆. By Lemma 5.5 we have X 0≤j≤p−2 wj ≤ 4p−2 a3(p−2)+2 ∆ + (3 · 4p−2 − 1)a3(p−2)+1 b 4p−2 a3p−2 ∆ + 3 · 4p−2 a3p−2 ∆ ≤ p−2 p−1 25 We now get: aγ + b aγ0 + 2a∆ + β =   P a(α + 1 + ) 0≤j≤p−2 wj + αβ + 2a∆ + β =  P a(a + 1 + ) 0≤j≤p−2 wj + a∆ + 2a∆ + ∆ ≤  P 3a2 0≤j≤p−2 wj + 4a∆ ≤  3 · 4p−2 a3p ∆ + 9 · 4p−2 a3p ∆ + 4a∆ ≤ p p−2 3p 3 · 4 a ∆ + 9 · 4p−2 a3p ∆ + 4p−2 a3p ∆ ≤ p p−2 3p (3 + 9 + 1) · 4 a ∆ = p p 3p 4 a ∆ ≤ p = (4a3 /)p ∆ ≤ n1/p ∆ . The last inequality follows from Lemma 5.4. Lemma 5.7. arp−1 + b ≤ n1/p ∆. Proof. By the definitions of rp−1 and γ0 we have rp−1 = γ0 /. Since γ0 ≤ γ and aγ + b ≤ n1/p ∆ by Lemma 5.6, we have arp−1 + b = a γ0 aγ0 + b aγ + b +b≤ ≤ ≤ n1/p ∆ .    Lemma 5.8. For all 0 ≤ i < j ≤ p − 1, s(ri , j − i) ≤ s(rj−1 , 1) Proof. Fix some 0 ≤ i ≤ p − 2. The proof is by induction on j. In the base case j = i + 1 the claim holds trivially. Consider now the induction step where we assume that the inequality holds for j ≥ i + 1 and have to show that it also holds for j + 1. First, observe that rj = (α + 1 + ) P 0≤j 0 ≤j−1 wj 0  +β ≥ (α + 1 + )wj−1 + β (α + 1 + )(αsj−1 + β) + β =   and thus s(rj , 1) = arj +b ≥ a(α + 1 + )(αsj−1 + β) + β a(α + 1 + )(αs(rj−1 , 1) + β) + β +b = +b   By the Property B2 we have s(ri , j − 1) ≤ a(α + 1 + )(αs(ri , j − i − 1) + β) + β +b  and by the induction hypothesis we have s(ri , j − i − 1) ≤ s(rj , j − 1). Therefore it follows that a(α + 1 + )(αs(rj , j − 1) + β) + β s(ri , j − 1) ≤ + b ≤ s(rj , 1) .  26 5.4 Analysis of Approximation Guarantee We now analyze the approximation error of a monotone ES-tree maintained on H 00 . This approximation error consists of two parts. The first part is an approximation error that comes from the fact that the monotone ES-tree only considers paths from s with a relatively small number of edges and therefore has to use edges from the hop set F . The second part is the approximation error we get from rounding the edge weights. We first give a formula for the approximation error that depends on the priority of the nodes and their distance to the root of the monotone ES-tree. Before we give the proof we review a few properties of the monotone ES-tree (see [HKN13] for the full algorithm). Similar to the classic ES-tree, the monotone ES-tree with root s maintains a level `(v) for every node v. The monotone ES-tree is initialized by computing a shortest paths tree up to depth L from s in H 00 and thus, initially, `(v) = distH 00 (s, v). A single deletion or edge weight increase in G might result in a sequence of deletions, weight increases and insertions in F , and thus H 00 . The monotone ES-tree first processes the insertions and then the deletions and edge weight increases. It handles deletions and edge weights increases in the same way as the classic ES-tree. The procedure for handling the insertion of an edge (u, v) is trivial: it only stores the new edge and in particular does not change `(u) or `(v). Once the level `(u) of a node u exceeds the maximum level L, we set `(u) = ∞. For completeness we list the pseudocode of the monotone ES-tree in Algorithm 1. For the analysis of the monotone ES-tree we will use the following notions. We say that an edge (u, v) is stretched if `(u) > `(v) + wH 00 (u, v). We say that a node u is stretched if it is incident to an edge (u, v) that is stretched. Note that for a node u that is not stretched we have `(u) ≤ `(v) + wH 00 (u, v) for every edge (u, v) contained in H 00 . In our proof we will use the following properties of the monotone ES-tree. Observation 5.9 ([HKN13]). The following holds for the monotone ES-tree: (1) The level of a node never decreases. (2) An edge can only become stretched when it is inserted. (3) As long as a node x is stretched, its level does not change. (4) For every tree edge (u, v) (where v is the parent of u), `(u) ≥ `(v) + w(u, v). A second prerequisite from [HKN13] tells us when we may apply a variant of the triangle inequality to argue about the levels of nodes. Lemma 5.10 ([HKN13]). Let (u, v) be an edge of H 00 such that `(v) + wH 00 (u, v) ≤ L. If (u, v) is not stretched and after the previous update in G the level of u was less than ∞, then for the current level of u we have `(u) ≤ `(v) + wH 00 (u, v). Note that condition (2) simply captures the property of the monotone ES-tree that once the level of a node exceeds L it is set to ∞ and will never be decreased anymore. At the initialization (i.e., before the first update in H 00 ), conditions (1) and (2) are fulfilled automatically. 27 Algorithm 1: Monotone ES-tree // Internal data structures: // N (u): for every node u a heap N (u) whose intended use is to store for every neighbor v of u in the current graph the value of `(v) + wH 00 (u, v) // Q: global heap whose intended use is to store nodes whose levels might need to be updated 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Procedure Initialize() Compute shortest paths tree from s in H 00 up to depth L foreach u ∈ V do Set `(u) = distH 00 (s, u) for every edge (u, v) in H 00 do insert v into heap N (u) of u with key `(v) + wH 00 (u, v) Procedure Delete(u, v) Increase(u, v, ∞) Procedure Increase(u, v, w(u, v)) // Increase weight of edge (u, v) to w(u, v) Insert u and v into heap Q with keys `(u) and `(v) respectively Update key of v in heap N (u) to `(v) + w(u, v) and key of u in heap N (v) to `(u) + w(u, v) UpdateLevels() Procedure Insert(u, v, w(u, v)) // Increase edge (u, v) of weight w(u, v) Insert v into heap N (u) with key `(v) + w(u, v) and u into heap N (v) with key `(u) + wH 00 (u, v) Procedure UpdateLevels() while heap Q is not empty do Take node u with minimum key `(u) from heap Q and remove it from Q `0 (u) ← minv (`(v) + wH 00 (u, v)) // minv (`(v) + wH 00 (u, v)) can be retrieved from the heap N (u). arg minv (`(v) + wH 00 (u, v)) is u’s parent in the ES-tree. 0 if ` (u) > `(u) then `(u) ← `0 (u) if `0 (u) > L then `(u) ← ∞ foreach neighbor v of u do update key of u in heap N (v) to `(u) + wH 00 (u, v) insert v into heap Q with key `(v) if Q does not already contain v 28 To count the additive error from rounding the edge weights, we define, for every node u and every 0 ≤ i ≤ p − 1, the function h(u, i) as follows: h(u, i) =  0 if u = s (p + 1) l max(distG (u,s)−ri ,0) ∆ m +p+1−i otherwise . The intuition is that h(u, i) bounds the number of hops from u to s, i.e., the number of edges required to go from u to s while at the same time providing the desired approximation guarantee. The approximation guarantee can now formally be stated as follows Lemma 5.11 (Approximation Guarantee). For every node u of priority i with distG (u, s) ≤ P D + 0≤i0 ≤i−1 si0 we have δ(s, u) ≤ (α + ) distG (u, s) + γi + h(u, i) · ϕ . Once we have proved this lemma, the desired bound on the aproximation error (Property A2) follows easily because h(u, i) · ϕ ≤  distG (u, v) + 2∆ (as we show below) and thus δ(s, u) ≤ (α + ) distG (u, s) + γi + h(u, i) · ϕ ≤ (α + ) distG (u, s) + γ0 + h(u, i) · ϕ ≤ (α + ) distG (u, s) + γ0 +  distG (u, v) + 2∆ = (α + 2) distG (u, s) + γ . Lemma 5.12. For every node u and every 0 ≤ i ≤ p − 1, h(u, i) · ϕ ≤  distG (u, s) + 2∆ Proof.  max(distG (u, s) − ri , 0) distG (u, s) (p + 1) + p + 1 − i ϕ ≤ (p + 1) +p+1 ϕ ∆ ∆     distG (u, s) ≤ (p + 1) +1 +p+1 ϕ ∆   (p + 1) distG (u, s) = + 2(p + 1) ϕ ∆   (p + 1) distG (u, s) ∆ = + 2(p + 1) · ∆ p+1 =  distG (u, s) + 2∆ .        Proof of Lemma 5.11. The proof is by double induction first on the number of updates in G P and second on h(u, i). Let u be a node of priority i such that distG (u, s) ≤ D + 0≤i0 ≤i−1 si0 . Remember that δ(u, s) = `(u) · ϕ, where `(u) is the level of u in the monotone ES-tree of s. We know that after the last previous in G the distance estimate gave an approximation of the true distance in G. Since distances in G are non-decreasing it must have been the case that the level of u was less than ∞ after the previous. 29 If u = s, the claim is trivially true because `(s) = 0. Assume that u 6= s. If u is stretched in the monotone ES-tree, then the level of u has not changed since the previous deletion in G and thus the claim is true by induction. If u is not stretched, then `(u) ≤ `(v) + wH 00 (u, v) for every edge (u, v) in H 00 . Define the nodes v and x as follows. If distG (u, s) ≤ ri , then v = s. If distG (u, s) > ri , then consider a shortest path π from u to s in G and let v be the furthest node from u on π such that distG (u, v) ≤ ri (which implies distG (v, s) ≥ distG (u, s) − ri ). Furthermore let x be the neighbor of v on the shortest path π that is closer to s than v. Note that distG (u, x) ≥ ri (and thus distG (x, s) ≤ distG (u, s) − ri ) and in particular G contains the edge (v, x). Note that (v, x) is also contained in H (and thus in P H 0 and H 00 ) because for distG (u, s) ≤ D + 0≤i0 ≤i−1 si0 to hold it has to be the case that P P P wG (v, x) ≤ D + 0≤i0 ≤i−1 si0 . Note that 0≤i0 ≤i−1 si0 ≤ 0≤i0 ≤i−1 wi0 ≤ rp−1 ≤ n1/p ∆ by Lemma 5.7. Thus, wG (v, x) ≤ D + n1/p ∆, which by the definition of H means that the edge (v, x) is contained in H. Note that s(distG (u, v), p − 1 − i) ≤ s(ri , p − 1 − i) since the function s(·, ·) is nondecreasing. By Lemma 5.8 we have s(ri , p − 1 − i) ≤ s(rp−2 , 1) and by the definition of s(·, 1) and Lemma 5.7 we have s(rp−2 , 1) = arp−2 + b ≤ arp−1 + b ≤ n1/p ∆ ≤ D̂. Thus, by Property B2 we know that either v ∈ B(u) or there is a node v 0 of priority j 0 > i such that distG (u, v 0 ) ≤ s(distG (u, v), j − i). Note that in the first case the set of edges F contains the edge (u, v) and in the second case it contains the edge (u, v 0 ). Case 1: v ∈ B(u) If v ∈ B(u), then F contains an edge (u, v) such that wF (u, v) = δ̂(u, v) ≤ α distG (u, v) + β (2) Since distG (u, v) ≤ ri we have wF (u, v) ≤ αri + β ≤ αrp−1 + β ≤ n1/p ∆, where the last inequality holds by Lemma 5.7. Thus, (u, v) is contained in H and thus also in H 0 and H 00 . If distG (u, s) ≤ ri , then we have v = s. First observe that by the definition of H 00 we have wH 00 (u, s) = wH 0 (u, s)/ϕ. Furthermore the rounding of the edge weights in H 0 guarantees that wH 0 (u, s) ≤ wH (u, s) + ϕ. We therefore get wF (u, s) + ϕ ϕ α distG (u, s) + β + ϕ ≤ ϕ wH 00 (u, s) ≤  α D+ ≤ P 0≤i0 ≤i−1 si0  +β+ϕ ϕ P αD + (α + 1 + ) 0≤i0 ≤p−2 wi0 + β + ϕ ≤ ϕ αD + γ0 + ϕ = ϕ ∆ αD + γ0 + p+1 = ϕ αD + γ0 + 2∆ ≤ ϕ αD + γ αD + n1/p ∆ (α + 2)D = ≤ ≤ + (p + 1)n1/p = L . ϕ ϕ ϕ 30 Here we have used the inequality γ ≤ n1/p ∆ from Lemma 5.6. Since the maximum level in the monotone ES-tree is L and u is not stretched, it follows from Lemma 5.10 that `(u) ≤ `(s) + wH 00 (u, s) = wH 00 (u, s). Together with the observation that h(u, i) ≥ 1 since u 6= s and β ≤ γ0 we therefore get δ(s, u) = `(u) · ϕ ≤ wH 00 (u, s) · ϕ ≤ α distG (u, s) + β + ϕ ≤ α distG (u, s) + β + h(u, i) · ϕ ≤ (α + ) distG (u, s) + γ0 + h(u, i) · ϕ . Consider now the case distG (u, s) > ri . Let j denote the priority of x. We first prove the following inequality, which will allow us among other things to use the induction hypothesis on x. Claim 5.13. If distG (u, s) > ri , then h(x, j) + 2 ≤ h(u, i). Proof. Remember that i ≤ p − 1. The assumption distG (u, s) > ri implies that distG (x, s) ≤ distG (u, s) − ri . If distG (x, s) < rj , we have h(x, j) + 2 ≤ p + 1 − j + 2 ≤ p + 1 + 2 ≤ p + 1 + p + 1 − i   distG (u, s) − ri ≤ (p + 1) + p + 1 − i = h(u, i) . ∆ Here we use the inequality d(distG (u, s) − rj )/∆e ≥ 1 which follows from the assumption distG (u, s) > ri . If distG (x, s) ≥ rj , then, using rj ≥ r0 ≥ ∆, we get distG (x, s) − rj +p+1−j+2 ∆   distG (x, s) − ∆ ≤ (p + 1) +p+1+2 ∆   distG (x, s) = (p + 1) −1 +p+1+2 ∆    distG (x, s) = (p + 1) −1 +p+1+2 ∆   distG (x, s) = (p + 1) +2 ∆   distG (x, s) ≤ (p + 1) +p+1−i ∆   distG (u, s) − ri ≤ (p + 1) +p+1−i ∆   max(distG (u, s) − ri , 0) ≤ (p + 1) + p + 1 − i = h(u, i) . ∆   h(x, j) + 2 = (p + 1) Here the last inequality follows from the trivial observation distG (u, s)−ri ≤ max(distG (u, s)− ri , 0). Having proved this claim, we go on with the proof of the lemma. We will now show that `(x) + wH 00 (v, x) + wH 00 (u, v) ≤ (α + ) distG (u, s) + γi + h(u, i) · ϕ ϕ 31 (3) as follows. If distG (u, s) > ri , then we have distG (u, x) ≥ ri by the choice of x. Remember that the edge (v, x) lies on a shortest path from u to s in G. It is therefore contained in G since before the first deletion and thus will never be stretched. We also may apply the induction hypothesis on x since distG (x, s) = distG (u, s) − distG (u, x) ≤ distG (u, s) − ri ≤ D + X si0 − ri ≤ D 0≤i0 ≤i−1 due to P 0≤i0 ≤i−1 si0 ≤ ri by the definition of ri . Therefore we get (`(x) + wH 00 (v, x) + wH 00 (u, v)) · ϕ ≤ δ(s, x) + wH 00 (v, x) · ϕ + wH 00 (u, v) · ϕ (definition of δ(s, x)) = δ(s, x) + wH 0 (v, x) + wH 0 (u, v) (definition of H 0 ) ≤ δ(s, x) + wH (v, x) + ϕ + wH (u, v) + ϕ (property of wH 0 ) ≤ δ(s, x) + wG (v, x) + ϕ + wF (u, v) + ϕ ((v, x) ∈ E and (u, v) ∈ F ) ≤ (α + ) distG (x, s) + γj + h(x, j) · ϕ + wG (v, x) + ϕ + wF (u, v) + ϕ (induction hypothesis) = (α + ) distG (x, s) + γj + wF (u, v) + wG (v, x) + (h(x, j) + 2) · ϕ (rearranging terms) ≤ (α + ) distG (x, s) + γj + wF (u, v) + wG (v, x) + h(u, i) · ϕ (Claim 5.13) ≤ (α + ) distG (x, s) + γ0 + wF (u, v) + wG (v, x) + h(u, i) · ϕ (γj ≤ γ0 ) ≤ (α + ) distG (x, s) + γ0 + α distG (u, v) + β + wG (v, x) + h(u, i) · ϕ (by Inequality (2)) = (α + ) distG (x, s) + γ0 + α distG (u, v) + β + distG (v, x) + h(u, i) · ϕ ((v, x) on shortest path) ≤ (α + ) distG (x, s) + γ0 + α distG (u, v) + β + α distG (v, x) + h(u, i) · ϕ (α ≥ 1) = (α + ) distG (x, s) + α(distG (u, v) + distG (v, x)) + β + γ0 + h(u, i) · ϕ (rearranging terms) = (α + ) distG (x, s) + α distG (u, x) + β + γ0 + h(u, i) · ϕ (v on shortest path) = (α + ) distG (x, s) + α distG (u, x) + β + γ0 − γi + γi + h(u, i) · ϕ (rearranging terms) = (α + ) distG (x, s) + α distG (u, x) + ri + γi + h(u, i) · ϕ (by Lemma 5.3) ≤ (α + ) distG (x, s) + α distG (u, x) +  distG (u, x) + γi + h(u, i) · ϕ (distG (u, x) ≥ ri ) = (α + )(distG (u, x) + distG (x, s)) + γi + h(u, i) · ϕ (rearranging terms) = (α + ) distG (u, s) + γi + h(u, i) · ϕ (x on shortest path) . By Lemma 5.12 we have h(u, i) · ϕ ≤  distG (u, s) + 2∆ and thus Inequality (3) implies that `(x) + wH 00 (v, x) + wH 00 (u, v) ≤ (α + 2) distG (u, s) + γi + 2∆ ϕ  (α + 2) D + ≤ P 0≤i0 ≤i−1 si0  + γi + 2∆ ϕ (α + 2)D + (α + 1 + ) ≤ P 0≤i0 ≤i−1 wi0 ϕ (α + 2)D + γi + 2∆ ϕ (α + 2)D + γ = ϕ ≤ 32  + γi + 2∆ ≤ (α + 2)D + (p + 1)n1/p = L . ϕ As the maximum level in the monotone ES-tree is L and the edge (v, x) is not stretched, it follows from Lemma 5.10 that `(v) ≤ `(x) + wH 00 (v, x) and since u is not stretched, we have `(u) ≤ `(v) + wH 00 (u, v) ≤ `(x) + wH 00 (v, x) + wH 00 (u, v) . and thus δ(s, u) = `(u) · ϕ ≤ (`(x) + wH 00 (v, x) + wH 00 (u, v)) · ϕ ≤ (α + ) distG (u, s) + γi + h(u, i) · ϕ Case 2: v ∈ / B(u) By Property B2 we know that there is some node v 0 of priority j 0 > i such that u ∈ B(v 0 ) and distG (u, v 0 ) ≤ s(distG (u, v), j 0 − i). By Lemma 5.8 we therefore have distG (u, v 0 ) ≤ s(ri , j 0 − i) ≤ s(rj 0 −1 , j 0 − 1) = sj 0 −1 . From the definition of F and Property B1 it now follows that F contains the edge (u, v 0 ) of weight distG (u, v 0 ) ≤ wF (u, v 0 ) = δ̂(u, v 0 ) ≤ α distG (u, v 0 ) + β ≤ αsj 0 −1 + β = wj 0 −1 Since j 0 ≤ p − 1 we have wj 0 −1 ≤ wp−2 ≤ rp−1 . As rp−1 ≤ n1/p ∆, by Lemma 5.7, we conclude that the edge (u, v 0 ) is contained H and thus also in H 0 and H 00 . We first prove the following inequality, which will allow us among other things to use the induction hypothesis on x. Claim 5.14. h(v 0 , j 0 ) + 1 ≤ h(u, i) Proof. Remember that j 0 ≥ i + 1. If distG (v 0 , s) < rj 0 , we get h(v 0 , j 0 ) + 1 ≤ p + 1 − j 0 + 1 ≤ p + 1 − i ≤ h(u, i) . If distG (v 0 , s) ≥ rj 0 , then we use the inequality ri + sj 0 −1 ≤ rj 0 (which easily follows from the definition of rj 0 ) and get distG (v 0 , s) − rj 0 h(v , j ) + 1 = (p + 1) + p + 1 − j0 + 1 ∆   distG (v 0 , s) − rj 0 ≤ (p + 1) +p+1−i−1+1 ∆   distG (u, s) + distG (v 0 , u) − rj 0 ≤ (p + 1) +p+1−i ∆   distG (u, s) + sj 0 −1 − rj 0 ≤ (p + 1) +p+1−i ∆   distG (u, s) − ri ≤ (p + 1) +p−i ∆   max(distG (u, s) − ri , 0) ≤ (p + 1) + p + 1 − i = h(u, i) . ∆ 0 0   33 Having proved this claim, we go on with the proof of the lemma. Note that we may apply the induction hypothesis on v 0 because by the triangle inequality we have distG (v 0 , s) ≤ distG (u, s) + distG (v 0 , u) ≤ D + si0 + distG (v 0 , u) X 0≤i0 ≤i−1 X ≤D+ si0 + sj 0 −1 ≤ D + 0≤i0 ≤i−1 X si0 . 0≤i0 ≤j 0 −1 We will now show that `(v 0 ) + wH 00 (u, v 0 ) ≤ (α + ) distG (u, s) + γi + h(u, i) · ϕ ϕ (4) as follows: (`(v 0 ) + wH 00 (u, v 0 )) · ϕ (u not stretched) 0 0 = δ(v , s) + wH 00 (u, v ) · ϕ (definition of δ(v 0 , s)) = δ(v 0 , s) + wH 0 (u, v 0 ) (definition of H 00 ) ≤ δ(v 0 , s) + wH (u, v 0 ) + ϕ (property of wH 0 (u, v 0 )) ≤ δ(v 0 , s) + wF (u, v 0 ) + ϕ 0 (definition of H) 0 0 0 ≤ (α + ) distG (v , s) + γj 0 + h(v , j ) · ϕ + wF (u, v ) + ϕ 0 0 0 0 0 0 = (α + ) distG (v , s) + γj 0 + wF (u, v ) + (h(v , j ) + 1) · ϕ ≤ (α + ) distG (v , s) + γj 0 + wF (u, v ) + h(u, i) · ϕ 0 (induction hypothesis) (rearranging terms) (Claim 5.14) 0 ≤ (α + )(distG (v , u) + distG (u, s)) + γj 0 + wF (u, v ) + h(u, i) · ϕ (triangle inequality) ≤ (α + )(wF (u, v 0 ) + distG (u, s)) + γj 0 + wF (u, v 0 ) + h(u, i) · ϕ 0 (by Inequality 23) = (α + ) distG (u, s) + γj 0 + (α +  + 1)wF (u, v ) + h(u, i) · ϕ (rearranging terms) ≤ (α + ) distG (u, s) + γj 0 + (α +  + 1)wj 0 −1 + h(u, i) · ϕ (by Inequality 23) = (α + ) distG (u, s) + γj 0 −1 + h(u, i) · ϕ (definition of γj 0 −1 ) ≤ (α + ) distG (u, s) + γi + h(u, i) · ϕ (γi ≥ γj 0 −1 as j 0 ≥ i + 1) . By Lemma 5.12 we have h(u, i) · ϕ ≤  distG (u, s) + 2∆ and thus Inequality (4) implies that `(v 0 ) + wH 00 (u, v 0 ) ≤ (α + 2) distG (u, s) + γi + 2∆ (α + 2)D ≤ + (p + 1)n1/p = L . ϕ ϕ As the maximum level in the monotone ES-tree is L and u is not stretched, it follows from Lemma 5.10 that `(u) ≤ `(v 0 ) + wH 00 (u, v 0 ) and thus δ(s, u) = `(u) · ϕ ≤ (`(v 0 ) + wH 00 (u, v 0 )) · ϕ ≤ (α + ) distG (u, s) + γi + h(u, i) · ϕ . 6 Putting Everything Together In the following we combine our results of Section 4 and Section 5 to obtain decremental algorithms for approximate SSSP and approximate APSP. 34 6.1 Approximate SSSP We first show how to obtain an algorithm for approximate SSSP. First, we obtain an algorithm that provides approximate distance for all nodes that are in distance at most R from the source, where R is some range parameter. We use a hierarchical approach to obtain this algorithm: Given an algorithm for maintaining approximate shortest paths, we obtain an algorithm for maintaining approximate balls, which in turn gives us an algorithm for maintaining approximate shortest paths for a larger range of distances than the initial algorithm. This scheme is repeated several times and can be “started” with the (exact) ES-tree. Lemma 6.1. For every R ≥ n and every 0 <  ≤ 1, there is a decremental approximate SSSP algorithm that, given a fixed source node s, maintains, for every node v, a distance estimate δ(s, v) such that δ(s, v) ≥ distG (s, v) and if distG (s, v) ≤ R, then δ(s, v) ≤ (1 + ) distG (s, v). It has a total update time of Õ(m1+3(log log R)/q R2/q ), where v u u u u r q = u t     log n     3  8·4 log n √ log  and, after every update in G, returns, for every node v such that δ(s, v) has changed, v together with the new value of δ(s, v). Proof. In the proof we will use the following values. We set a = 4,     p= r √ log log n  8a3 log n        √ and q = b pc. Furthermore we set 0 = /2(q − 2) and for every 0 ≤ k ≤ q − 2 we set αk = 1 + 2k0 ≤ 1 + , ∆k = Rk/p , and Dk = R(k+2)/p . The heart of our proof is the following claim which gives us decremental approximate SSSP algorithms for larger and larger depths, until finally the full range R is covered. Claim 6.2. For every 0 ≤ k ≤ q − 2, there is a decremental approximate SSSP algorithm ApproxSSSPk with the following properties: A1 δ(s, v) ≥ distG (s, v) A2 If distG (s, v) ≤ Dk , then δ(s, v) ≤ αk distG (s, v). A3 The total update time of ApproxSSSPk is Tk (m) = Õ(2k m1+k/p R2/q (log R)k /0 ) . A4 After every update in G, ApproxSSSPk returns, for every node v such that δ(s, v) has changed, v together with the new value of δ(s, v). 35 Proof. We prove the claim by induction on k. In the base case k = 0 we use the (exact) ES-tree, which for distances up to D ≤ D0 has a total update time of O(mD0 ) = O(mR2/q ) and thus has all claimed properties We now consider the induction step. We apply Proposition 4.1 to obtain a decremental algorithm ApproxBallsk (with parameters k̂ = p and ˆ = 1) that maintains for every node u ∈ V a set of nodes Bk (u) and a distance estimate δ̂k (u, v) for every node v ∈ B(u) such that: B1 For every node u and every node v ∈ Bk (u) we have distG (u, v) ≤ δ̂k (u, v) ≤ αk−1 distG (u, v). B2 Let s(x, l) = a(a + 1)l x. For every node u of priority i ≤ k − 1 and every node v such that s(distG (u, v), p − 1 − i) ≤ Dk either v ∈ B(u) or there is some node v 0 of priority j > i such that distG (u, v 0 ) ≤ s(distG (u, v), j − i). B3 In expectation, u∈V |Bk (u)| = Õ(m1+1/k log Dk ), where Bk (u) denotes the set of nodes ever contained in Bk (u). P B4 The update time of ApproxBallsk is   tk (m) = Õ m1+1/p log Dk + X m1−i/p · Tk−1 (m(i+1)/p ) log Dk + T (m) . 0≤i≤p−1 Note that Dk ≤ R and thus log Dk ≤ log R and remember that by the induction hypothesis we have Tk−1 (m) = Õ(2k−1 m1+(k−1)/p R2/q (log R)k−1 /0 ) . We now analyze m1−i/p ·Tk−1 (m(i+1)/p ) for each 0 ≤ i ≤ p−1. The algorithm ApproxSSSPk−1 is run on a graph with mi = m(i+1)/p edges and ni = n nodes. Using the parameter pi = p, 1+1/pi 1+1/p it has a total update time of Õ(mi ) = Õ(mi ). Furthermore, we have 1−i/p+((i+1)/p)·(1+(k−1)/p) = 1+1/p+((i+1)/p)((k−1)/p) ≤ 1+1/p+(k−1)/p = 1+k/p Thus, m1−i/p · Tk−1 (m(i+1)/p ) = Õ(2k−1 m1+k/p R2/q (log R)k−1 /k ) and since k ≥ 1 it follows that tk (m) = Õ(2k m1+k/p R2/q (log R)k /0 ) . We now want to argue that we may apply Proposition 5.1 to obtain an approximate decremental SSSP algorithm ApproxSSSP0k (with parameters p, ∆k Dk , and 0 ). We first show that √ log n p≤ r  , 3 log 4a First note that q ≤ log n and thus 0 = (2(q − 2) ≥ /(2q) ≥ /(2 log n). It follows that √ log n r log  4a3  √  ≥ r log log n  8a3 log n      r ≥   36 √ log log n  8·43 log n        = p . Note also that for all x ≥ 1 and l ≥ 1 we have sk (x, l + 1) = (a + 1)sk (x, l) ≥ 2ask (x, l) ≥ a(αk−1 + 1 + 0 )αk−1 s(x, l)/0 . We therefore may apply Proposition 5.1 to obtain an approximate decremental SSSP algorithm ApproxSSSP0k (with parameters p, Dk , and 0 ) that maintains, for every node v ∈ V , a distance estimate δ 0 (s, v) such that: A1’ δ 0 (s, v) ≥ distG (s, v) A2’ If distG (s, v) ≤ Dk , then δ 0 (s, v) ≤ (αk + 0 ) distG (s, v) + 0 n1/p ∆k A3’ The total update time of ApproxSSSP0k is Tk0 (m) = Õ((αk Dk /∆k + n1/p ) X (m + |B(u)|)/0 + tk (m, n, p, n1/p ∆)) . u∈V A4’ After every update in G, ApproxSSSP0k returns, for every node v such that δ(s, v) has changed, v together with the new value of δ(s, v). Its total update time is Tk (m) = Õ((αk Dk /∆k + n1/p ) X (m + |Bk (u)|)/0 + tk (m, n, n1/p ∆k )) u∈V Note that αk ≤ 1 +  ≤ 2 and Dk /∆k = R2/q . Since q ≤ p and R ≥ n we have n1/p ≤ P R2/q . We also have u∈V |Bk (u)| = Õ(m1+1/p log R). Therefore the total update time of ApproxSSSP0k is Tk0 (m) = Õ(m1+1/p R2/q log R/0 + 2k m1+k/p R2/q (log R)k /0 ) Since k ≥ 1 it follows that Tk (m) = Õ(2k m1+k/p R2/q (log R)k /0 ) . Let ApproxSSSPk denote the algorithm that internally runs both ApproxSSSP0k and ApproxSSSPk−1 and additionally maintains, for every node v, the value δk (s, v) = min(δk0 (s, v), δk−1 (s, v)). Since both ApproxSSSP0k and ApproxSSSPk−1 return, after each update in G, every node v for which δ(s, v) has changed, and the minimum can be computed in constant time, ApproxSSSPk has the same asymptotic total update time as ApproxSSSP0k . It remains to show that δk (s, v) fulfills the desired approximation guarantee for every node v. Since both δk0 (s, v) ≥ distG (s, v) and δk−1 (s, v) ≥ distG (s, v) also δk (s, v) ≥ distG (s, v). Furthermore, we know that if distG (s, v) ≤ Dk , then δk0 (s, v) ≤ n1/p ∆k . Let v be a node such that distG (s, v) ≤ Dk . If distG (s, v) ≤ Dk−1 , then δk (s, v) ≤ δk−1 (s, v) ≤ αk−1 distG (s, v) ≤ αk distG (u, v). If distG (s, v) ≥ Dk−1 , then δk (s, v) ≤ δk0 (s, v) ≤ (αk−1 + 0 ) distG (s, v) + 0 n1/p ∆k ≤ (αk−1 + 0 ) distG (s, v) + 0 Dk−1 ≤ (αk−1 + 20 ) distG (s, v) = αk distG (s, v) . This finishes the proof of the claim. 37 The lemma now follows from the claim by observing that ApproxSSSPq−2 is the desired decremental approximate SSSP algorithm. The correctness simply follows from Dq−2 = R. The total update time is Tq−2 (m) = Õ(2q−2 m1+(q−2)/p R2/q (log R)q−2 /0 ) . √ √ Remember that q = b pc and thus (q − 2)/p ≤ q/p ≤ 1/ p ≤ 1/q. By the definition of p we have (2/0 )p ≤ n1/p and thus (2/0 )q ≤ (2/0 )p ≤ n1/p ≤ n1/q and furthermore (log R)q ≤ (log R)p = (2p )log log R ≤ (n1/p )log log R = n(log log R)/p ≤ n(log log R)/q . It follows that the total update time is Tq−2 (m) = Õ(m1+3(log log R)/q R2/q ) . We can turn the algorithm above into an algorithm for the full distance range by using the rounding technique once more. Theorem 6.3. For every 0 <  ≤ 1, there is a decremental approximate SSSP algorithm that, given a fixed source node s, maintains, for every node v, a distance estimate δ(s, v) such that distG (s, v) ≤ δ(s, v) ≤ (1 + ) distG (s, v). It has constant query time and a total update time of 5/4 1/4 O(m1+O(log ((log n)/)/ log n) log W ) . If 1/ = O(polylog n), then the total update time is O(m1+o(1) log W ). Proof. For every 0 ≤ i ≤ blog(nW )c we define ϕi = 2i . n Let G0i be the graph that has the same nodes and edges as G and in which every edge weight is rounded to the next multiple of ϕi , i.e., every edge (u, v) in G0i has weight wG (u, v) w (u, v) = · ϕi ϕi   G0i where wG (u, v) is the weight of (u, v) in G. This rounding guarantees that wG (u, v) ≤ wGi (u, v) ≤ wG (u, v) + ϕi for every edge (u, v) of G. Furthermore we define G00i to be the graph that has the same nodes and edges as G0i and in which every edge weight is scaled down by a factor of 1/ϕi , i.e., every edge (u, v) in G00i has weight wG00i (u, v) = wG0i (u, v) ϕi  = w(u, v) . ϕi  The algorithm is as follows: For every 0 ≤ i ≤ blog(nW )c we use the algorithm of Lemma 6.1 on the graph G00i with R = 4n/ to maintain a distance estimate δi (s, v) for every node v that satisfies • δi (s, v) ≥ distG00i (s, v) and 38 • if distG00i (s, v) ≤ R, then δi (s, v) ≤ (1 + ) distG00i (s, v). We let our algorithm return the distance estimate δ(s, v) = min 0≤i≤blog nW c ϕi δi (s, v) . We now show that there is some 0 ≤ i ≤ blog(nW )c such that ϕi δi (s, v) ≤ (1 + 3) distG (s, v). As δ(s, v) is the minimum of all the distance estimates, this implies that δ(s, v) ≤ (1 + 3) distG (s, v). In particular, we know that there is some 0 ≤ i ≤ blog(nW )c such that 2i ≤ distG (s, v) ≤ 2i+1 since W is the maximum edge weight and all paths consist of at most n edges. Consider a shortest path π from v to s in G whose weight is equal to distG (s, v). Let wG (π) and wG0i (π) denote the weight of the path π in G and G0i , respectively. Since π consists of at most n edges we have wG0i (π) ≤ w(π) + nϕi . Therefore we get distG0i (s, v) ≤ wG0i (π) ≤ w(π) + nϕi = distG (s, v) + 2i ≤ distG (s, v) +  distG (s, v) = (1 + ) distG (s, v) . Now observe the following: distG00i (s, v) = distG0i (s, v) ϕi ≤ (1 + ) distG (s, v) 2 distG (s, v) 2 distG (s, v)n ≤ = ϕi ϕi 2i 2 · 2i+1 n 4n ≤ = = R. 2i  Since distG00i (s, v) ≤ R we get δi (s, v) ≤ (1 + ) distG00i (s, v) by Lemma 6.1. Thus, we get ϕi δi (s, v) ≤ ϕi ((1+) distG00i (s, v)) = (1+) distG0i (s, v) ≤ (1+)2 distG (s, v) ≤ (1+3) distG (s, v) as desired. We now analyze the running time of this algorithm. By Lemma 6.1, for every 0 ≤ i ≤ blog (nW )c, maintaining δi (s, v) on G00i for every node s takes time Õ(m1+3(log log R)/q R2/q ), where v  u  u √  u  log n u  q = u r     t 3 log 8·4 log n By our choice of R = 4n/, the total update time for maintaining all these blog (nW )c distance estimates is Õ(m1+5(log log (4n/))/q log W/), where v u u u u r q = u t   √   log n   3    8·4 log n log  To obtain a (1+) approximation (instead of a (1+3)-approximation, we simply run the whole algorithm with 0 = /3. This results in a total update time of Õ(m1+5(log log (12n/))/q log W/), 39 where v u u u u r q = u t     log n      24·43 log n √ log  Now observe that 1/ ≤ n1/q and that  5 log log  12n    n   log log = O q log  log n  1/4  (log n)1/4 Since Õ(1) = O(polylog n) = O(nO(log O(m1+O(log   5/4 5/4 ((log n) )   5/4  log n    log = O   (log n)1/4  . the total update time therefore is ((log n)/)/ log1/4 n) log W ) . 5/4 1/4 If 1/ = O(polylog n), then the total update time is O(m1+log log n/ log n log W ), which is O(m1+o(1) log W ) since limx→∞ (log5/4 log n/ log1/4 n) = 0. The query time of the algorithm described above is O(log(nW )) as it has to compute δ(s, v) = min0≤i≤blog nW c δi (s, v) · ϕi when asked for the approximate distance from v to s. We can reduce the query time to O(1) by using a min-heap for every node v that stores δi (s, v) for all 0 ≤ i ≤ blog(nW )c. This allows us to query for δ(s, v) in constant time. 6.2 Approximate APSP We now show how to use our techniques to obtain a decremental approximate APSP algorithm. This is conceptually simple now. We simply use the approximate SSSP algorithm from Theorem 6.3 and plug it into the algorithm for maintaining approximate balls from Proposition 4.1. By using an adequate query procedure we can use the distance estimates maintained for the approximate balls to return the approximate distances between any two nodes. Theorem 6.4. There is a decremental approximate APSP algorithm that upon a query for the approximate between any pair of nodes u and v returns a distance estimate δ(u, v) such that distG (u, v) ≤ δ(u, v) ≤ ((2 + )k − 1) distG (u, v). It has a query time of O(k k ) and a total update time of 5/4 1/4 O(m1+1/k+O(log ((log n)/)/ log n) log2 W ) If 1/ = O(polylog n), then the total update time is O(m1+o(1) log2 W ). Proof. We use the approximate SSSP algorithm of Theorem 6.3 that provides a (1 + )approximation and has a total update time of T (m, n) = O(m1+O(log 5/4 ((log n)/)/ log1/4 n) log W ) and if 1/ = O(polylog n), then the total update time is T (m, n) = O(m1+o(1) log W ). By Proposition 4.1 we can maintain approximate balls with a total update time of  t(m, n, k, ) = Õ m1+1/k log D/ +  X 0≤i≤k−1 40 m1−i/k · T (mi , ni ) log D/ + T (m, n) , where, for each 0 ≤ i ≤ k − 1, mi = m(i+1)/k and ni = min(mi , n). Using similar argu5/4 1/4 ments as above we get that t(m, n, k, ) = O(m1+1/k+O(log ((log n)/)/ log n) log2 W ) and O(m1+o(1) log2 W ) if 1/ = O(polylog n). Additionally we maintain, for every node v ∈ V , the node ci (v) which is a node with minimum δ(u, v) among all nodes u of priority j such that v ∈ B(u). This can be done as follows. For every node v we maintain a heap containing all nodes u of priority i such that v ∈ B(u) using the key δ(u, v). Every time v joins or leaves B(u) we insert or remove u from the heap of v. Every time δ(u, v) changes, we update the key of u in the heap of v. After each insert, remove, or update in the heap of some node v, we find the minimal element ci (v) of the heap. As each heap operation takes logarithmic time, the total update time of the algorithm of Proposition 4.1 only increases by a logarithmic factor. Procedure 2: Query(u, v) 11 if v ∈ B(u) then δ 0 (u, v) ← δ(u, v) else Set i to the priority of u foreach j = i + 1 to k − 1 do if cj (u) exists then v 00 ← cj (u) δ 0 (v 00 , v) ← Query(v 00 , v) δj0 (u, v) ← δ(v, v 00 ) + δ 0 (v 00 , v) else δj0 (u, v) ← ∞ 12 δ 0 (u, v) ← mini+1≤j≤k−1 δj0 (u, v) 1 2 3 4 5 6 7 8 9 10 13 return δ 0 (u, v) To answer a query for the approximate distance between a pair of nodes u and v we use Procedure 2. This procedure first tests whether v ∈ B(u) and if yes returns δ(u, v). Otherwise it does the following for every j ≥ i + 1, where i is the priority of u: It first computes the node cj (u), which among the nodes v 0 of priority j with u ∈ B(v 0 ) is the one with the minimum value of δ(v 0 , u). Then it recursively queries for the approximate distance δ 0 (cj (u), v) from cj (u) to v and sets the distance estimate via cj (u) to δj0 (u, v) = δ(v, cj (u)) + δ 0 (cj (u), v). Finally, it returns the minimum of all distance estimates δj0 (u, v). Note that in each instance there are O(k) recursive calls and with each recursive call the priority of u increases by at least one. Thus the running time of the query procedure is O(k k ). Claim 6.5. For every pair of nodes u and v the distance estimate δ 0 (u, v) computed by Procedure 2 satisfies δ 0 (u, v) ≤ (((1 + )2 + 1)k−i − 1) distG (u, v), where i is the priority of u. Proof. The proof is by induction on the priority i of u. Let δ 0 (u, v) denote the distance estimate returned by Procedure 2. If i = k − 1, then we know that v ∈ B(u) and thus δ 0 (u, v) = δ(u, v) ≤ (1 + ) distG (u, v). If i < k − 1 we distinguish between the two cases v ∈ B(u) and v ∈ / B(u). If v ∈ B(u), then δ 0 (u, v) = δ(u, v) ≤ (1 + ) distG (u, v). If 41 v∈ / B(u), then by Proposition 4.1 there is a node v 0 of priority j > i such that u ∈ B(v 0 ) and distG (u, v 0 ) ≤ (1 + )2 ((1 + )2 + 1)j−i−1 distG (u, v). We will now argue that δj0 (u, v) ≤ 2((1 + )3 + 1)k−1−i − 1) distG (u, v), which implies the same upper bound for δ 0 (u, v). Set v 00 ← cj (u). Since both v 00 and v 0 have priority j and u ∈ B(v 0 ) as well as v ∈ B(v 00 ) we have δ(u, v 00 ) ≤ δ(u, v 0 ) by the definition of v 00 . Since δ(u, v 0 ) ≤ (1 + ) distG (u, v 0 ), we have δ(u, v 00 ) ≤ (1 + ) distG (u, v 0 ) ≤ (1 + )3 ((1 + )2 + 1)j−i−1 distG (u, v) ≤ (1 + )3 ((1 + )3 + 1)j−i−1 distG (u, v) . To simplify the presentation in the following we set a = (1 + )3 and thus have δ(u, v 00 ) ≤ a(a + 1)j−i−1 distG (u, v). By the triangle inequality we have distG (v 00 , v) ≤ distG (v 00 , u) + distG (u, v) ≤ δ(v 00 , u) + distG (u, v) ≤ (a(a + 1)j−i−1 + 1) distG (u, v) and by the induction hypothesis we have δ 0 (v 00 , v) ≤ (2(a + 1)k−1−j − 1) distG (v 00 , v) ≤ (2(a + 1)k−1−j − 1)(a(a + 1)j−i−1 + 1) distG (u, v) . Since j ≥ i + 1 we get δj0 (u, v) = δ(u, v 00 ) + δ 0 (v 00 , v)   ≤ a(a + 1)j−i−1 + (2(a + 1)k−1−j − 1)(a(a + 1)j−i−1 + 1) distG (u, v)   = 2(a + 1)k−1−j (a(a + 1)j−i−1 + 1) − 1 distG (u, v)   = 2a(a + 1)k−1−(i+1) + 2(a + 1)k−1−j ) − 1 distG (u, v)   ≤ 2a(a + 1)k−1−(i+1) + 2(a + 1)k−1−(i+1) ) − 1 distG (u, v)   = 2(a + 1)k−1−(i+1) (a + 1) − 1 distG (u, v) = (2(a + 1)k−1−i − 1) distG (u, v) . Note that 2 ≤ ((1+)3 +1) and therefore we have δ 0 (u, v) ≤ (((1+)3 +1)k−i −1) distG (u, v). Furthermore, (1 + )3 ≤ 1 + 7 and in the worst case i = 0. Thus, by running the whole algorithm with 0 = /7, we can guarantee that δ 0 (u, v) ≤ ((2 + )k − 1) distG (u, v). 7 Conclusion In this paper, we show that single-source shortest paths in undirected graphs can be maintained under edge deletions with near-linear total update time and constant query time. The main approach is to maintain an (no(1) , )-hop set of near-linear size in near-linear time. We leave two major open problems. The first problem is whether the same total update time can be achieved for directed graphs. This problem is very challenging because such a hop set is not known even in the static setting. Moreover, improving the current Õ(mn0.9+o(1) ) total 42 update time by [HKN14b, HKN15] for the decremental reachability problem is already very interesting. The second major open problem is to derandomize our algorithm. The major task here is to deterministically maintain the priorities and corresponding balls of the nodes, which is the key to maintaining the hop set. A related question is whether the algorithm of Roditty and Zwick [RZ12] for decrementally maintaining the original distance oracle of Thorup and Zwick (and the corresponding spanners and emulators) can be derandomized. (Note however that the distance oracle of Thorup and Zwick can be constructed deterministically in the static setting [RTZ05].) Acknowledgement The authors would like to thank the anonymous reviewers of FOCS 2014 for their valuable feedback. References [ACT14] Ittai Abraham, Shiri Chechik, and Kunal Talwar. “Fully Dynamic All-Pairs Shortest Paths: Breaking the O(n) Barrier”. In: International Workshop on Approximation Algorithms for Combinatorial Optimization Problems (APPROX). 2014, pp. 1–16 (cit. on p. 5). [AVW14] Amir Abboud and Virginia Vassilevska Williams. “Popular conjectures imply strong lower bounds for dynamic problems”. In: Symposium on Foundations of Computer Science (FOCS). 2014, pp. 434–443 (cit. on p. 4). [Ber09] Aaron Bernstein. “Fully Dynamic (2 + ) Approximate All-Pairs Shortest Paths with Fast Query and Close to Linear Update Time”. In: Symposium on Foundations of Computer Science (FOCS). 2009, pp. 693–702 (cit. on pp. 1, 4, 7). [Ber13] Aaron Bernstein. “Maintaining Shortest Paths Under Deletions in Weighted Directed Graphs”. In: Symposium on Theory of Computing (STOC). 2013, pp. 725–734 (cit. on pp. 4, 7). [BR11] Aaron Bernstein and Liam Roditty. “Improved Dynamic Algorithms for Maintaining Approximate Shortest Paths Under Deletions”. In: Symposium on Discrete Algorithms (SODA). 2011, pp. 1355–1365 (cit. on pp. 1, 3, 6). [Coh00] Edith Cohen. “Polylog-Time and Near-Linear Work Approximation Scheme for Undirected Shortest Paths”. In: Journal of the ACM 47.1 (2000). Announced at STOC’94, pp. 132–166 (cit. on pp. 1, 7). [Coh98] Edith Cohen. “Fast Algorithms for Constructing t-Spanners and Paths with Stretch t”. In: SIAM Journal on Computing 28.1 (1998). Announced at FOCS’93, pp. 210–236 (cit. on pp. 4, 7). [ES81] Shimon Even and Yossi Shiloach. “An On-Line Edge-Deletion Problem”. In: Journal of the ACM 28.1 (1981), pp. 1–4 (cit. on pp. 1, 3, 5). 43 [HK95] Monika Henzinger and Valerie King. “Fully Dynamic Biconnectivity and Transitive Closure”. In: Symposium on Foundations of Computer Science (FOCS). 1995, pp. 664–672 (cit. on pp. 4, 5). [HKN13] Monika Henzinger, Sebastian Krinninger, and Danupon Nanongkai. “Dynamic Approximate All-Pairs Shortest Paths: Breaking the O(mn) Barrier and Derandomization”. In: Symposium on Foundations of Computer Science (FOCS). 2013, pp. 538–547 (cit. on pp. 1, 6, 22, 27). [HKN14a] Monika Henzinger, Sebastian Krinninger, and Danupon Nanongkai. “A SubquadraticTime Algorithm for Dynamic Single-Source Shortest Paths”. In: Symposium on Discrete Algorithms (SODA). 2014, pp. 1053–1072 (cit. on p. 4). [HKN14b] Monika Henzinger, Sebastian Krinninger, and Danupon Nanongkai. “SublinearTime Decremental Algorithms for Single-Source Reachability and Shortest Paths on Directed Graphs”. In: Symposium on Theory of Computing (STOC). 2014, pp. 674–683 (cit. on pp. 1, 4, 43). [HKN15] Monika Henzinger, Sebastian Krinninger, and Danupon Nanongkai. “Improved Algorithms for Decremental Single-Source Reachability on Directed Graphs”. In: International Colloquium on Automata, Languages and Programming (ICALP). 2015, pp. 725–736 (cit. on pp. 4, 43). [HKN+ 15] Monika Henzinger, Sebastian Krinninger, Danupon Nanongkai, and Thatchaphol Saranurak. “Unifying and Strengthening Hardness for Dynamic Problems via the Online Matrix-Vector Multiplication Conjecture”. In: Symposium on Theory of Computing (STOC). 2015, pp. 21–30 (cit. on p. 3). [Kin99] Valerie King. “Fully Dynamic Algorithms for Maintaining All-Pairs Shortest Paths and Transitive Closure in Digraphs”. In: Symposium on Foundations of Computer Science (FOCS). 1999, pp. 81–91 (cit. on pp. 4, 5). [KKM+ 12] Maleq Khan, Fabian Kuhn, Dahlia Malkhi, Gopal Pandurangan, and Kunal Talwar. “Efficient distributed approximation algorithms via probabilistic tree embeddings”. In: Distributed Computing 25.3 (2012). Announced at PODC’08, pp. 189–205 (cit. on p. 7). [Lac13] Jakub Łącki. “Improved Deterministic Algorithms for Decremental Reachability and Strongly Connected Components”. In: ACM Transactions on Algorithms 9.3 (2013). Announced at SODA’11, p. 27 (cit. on p. 4). [Mad10] Aleksander Mądry. “Faster Approximation Schemes for Fractional Multicommodity Flow Problems via Dynamic Graph Algorithms”. In: Symposium on Theory of Computing (STOC). 2010, pp. 121–130 (cit. on pp. 1, 3, 4, 7). [Nan14] Danupon Nanongkai. “Distributed Approximation Algorithms for Weighted Shortest Paths”. In: Symposium on Theory of Computing (STOC). 2014, pp. 565– 573 (cit. on p. 7). [Rod13] Liam Roditty. “Decremental maintenance of strongly connected components”. In: Symposium on Discrete Algorithms (SODA). 2013, pp. 1143–1150 (cit. on pp. 3, 4). 44 [RTZ05] Liam Roditty, Mikkel Thorup, and Uri Zwick. “Deterministic Constructions of Approximate Distance Oracles and Spanners”. In: International Colloquium on Automata, Languages and Programming (ICALP). 2005, pp. 261–272 (cit. on p. 43). [RZ08] Liam Roditty and Uri Zwick. “Improved Dynamic Reachability Algorithms for Directed Graphs”. In: SIAM Journal on Computing 37.5 (2008). Announced at FOCS’02, pp. 1455–1471 (cit. on p. 4). [RZ11] Liam Roditty and Uri Zwick. “On Dynamic Shortest Paths Problems”. In: Algorithmica 61.2 (2011). Announced at ESA’04, pp. 389–401 (cit. on p. 3). [RZ12] Liam Roditty and Uri Zwick. “Dynamic Approximate All-Pairs Shortest Paths in Undirected Graphs”. In: SIAM Journal on Computing 41.3 (2012). Announced at FOCS’04, pp. 670–683 (cit. on p. 43). [Tho99] Mikkel Thorup. “Undirected Single-Source Shortest Paths with Positive Integer Weights in Linear Time”. In: Journal of the ACM 46.3 (1999). Announced at FOCS’97, pp. 362–394 (cit. on p. 3). [TZ05] Mikkel Thorup and Uri Zwick. “Approximate Distance Oracles”. In: Journal of the ACM 52.1 (2005). Announced at STOC’01, pp. 74–92 (cit. on p. 4). [TZ06] Mikkel Thorup and Uri Zwick. “Spanners and emulators with sublinear distance errors”. In: Symposium on Discrete Algorithms (SODA). 2006, pp. 802–809 (cit. on pp. 6–9, 11, 16). [UY91] Jeffrey D. Ullman and Mihalis Yannakakis. “High-Probability Parallel TransitiveClosure Algorithms”. In: SIAM Journal on Computing 20.1 (1991). Announced at SPAA’90, pp. 100–125 (cit. on p. 6). [VWW10] Virginia Vassilevska Williams and Ryan Williams. “Subcubic Equivalences between Path, Matrix and Triangle Problems”. In: Symposium on Foundations of Computer Science (FOCS). 2010, pp. 645–654 (cit. on p. 3). [Zwi02] Uri Zwick. “All Pairs Shortest Paths using Bridging Sets and Rectangular Matrix Multiplication”. In: Journal of the ACM 49.3 (2002). Announced at FOCS’98, pp. 289–317 (cit. on pp. 4, 7). 45
8cs.DS
Model Selection Confidence Sets by Likelihood Ratio Testing Chao Zheng1 , Davide Ferrari2 and Yuhong Yang3 arXiv:1709.04342v1 [stat.ME] 13 Sep 2017 1 Lancaster University, 2 University of Melbourne and 3 University of Minnesota Abstract: The traditional activity of model selection aims at discovering a single model superior to other candidate models. In the presence of pronounced noise, however, multiple models are often found to explain the same data equally well. To resolve this model selection ambiguity, we introduce the general approach of model selection confidence sets (MSCSs) based on likelihood ratio testing. A MSCS is defined as a list of models statistically indistinguishable from the true model at a user-specified level of confidence, which extends the familiar notion of confidence intervals to the model-selection framework. Our approach guarantees asymptotically correct coverage probability of the true model when both sample size and model dimension increase. We derive conditions under which the MSCS contains all the relevant information about the true model structure. In addition, we propose natural statistics based on the MSCS to measure importance of variables in a principled way that accounts for the overall model uncertainty. When the space of feasible models is large, MSCS is implemented by an adaptive stochastic search algorithm which samples MSCS models with high probability. The MSCS methodology is illustrated through numerical experiments on synthetic data and real data examples. Key words: Adaptive sampling; Likelihood ratio test; Model selection confidence set; Optimal detectability condition 1 1 Introduction Likelihood inference is a centerpiece of statistical theory and plays an important role in many research fields. Numerous methods relying on likelihood objective functions have been developed in the literature of model selection, ranging from classic information criteria to more recent sparsity-inducing penalization methods; see McQuarrie and Tsai (1998), Claeskens and Hjort (2008) and Buhlmann and van de Geer (2011) for book-length expositions. In the presence of noise in data, however, it is typically difficult to declare a single model significantly superior to all possible competitors, due to the prevailing effect of the model selection uncertainty. In this situation, multiple or even a large number of models may be equally supported by data, so that any selection procedure is likely to pick at random a single model from a large set of more or less equivalent models. Clearly, this implies tossing away valuable information; for example, in regression analysis, alternative combinations of predictors may be discarded, whilst such combinations may contain scientifically valid explanations of the phenomenon under examination. Motivated by the above issues, there has been a growing interest in developing statistical measures of model selection uncertainty. The approach followed in this paper proposes to construct a model selection confidence set (MSCS), defined as a set of models indistinguishable from the true model at a user-defined confidence level. Simply put, the MSCS extends the familiar frequentist notion of confidence intervals to the model-selection framework. Ferrari and Yang (2015) first introduced confidence sets for variable selection in the context of linear models by F-testing. They achieve the exact coverage probability for the globally optimal model from the model space. Thus, this is the first work introducing confidence sets in the frequantist sense for variable selection. Moreover, in their framework the number of 2 predictors can grow with the sample size, so that the number of potentially useful models is allowed to be large. Different from the MSCS of Ferrari and Yang (2015), Hansen, Lunde and Nason (2011) studied another methodology called model confidence sets. Their approach builds on classic step-down procedures for multiple hypothesis testing (Lehmann and Romano, 2005; Romano and Wold, 2005) but starts from a pre-specified user-defined set of models, which has limited sizes. Step-wise equivalence testing was carried out under a user-defined loss function, followed by an elimination rule to drop the worst performing models. Previously, Shimodaira (1998) constructed confidence sets containing models with AIC values near the smallest among the candidate models. We refer to the Section 6 of Ferrari and Yang (2015) for a detailed discussion. In this paper, we introduce a general methodology to construct model selection confidence sets via likelihood inference. We begin by considering a full model with p variables to form a reference model or full model, where p is required to be less than n. This preliminary step can be achieved by any over-consistent model screening method, which selects the relevant variables plus a few other variables. We then test candidate sub-models against the full model, by a likelihood ratio test (LRT) at the significance level 0 < α < 1. The MSCS is formed by all the candidate models that survive the LRT screening. This way of construction guarantees that the globally optimal model is included in the MSCS with probability at least 1 − α as the sample size increases (under appropriate regularity conditions). From a theoretical viewpoint, we investigate the condition for the MSCS to contain all the relevant information about the model structure when both p and n diverge. Since in practice the MSCS cannot be computed by exhaustive search unless p is very small, when the model 3 space is moderate or large, we propose a stochastic algorithm (MSCS-AS) which samples MSCS models with high probability. The proposed MSCS methodology can be used for various tasks in support of the model selection activity. First, given a model selected from some rule, one can immediately use the MSCS to check if such a model is too parsimonious in terms of missing important variables. Second, the frequency of variables in the MSCS can be used to rank their usefulness in a principled way that accounts for the model selection uncertainty. Third, the MSCS and the associated importance measures may be used to narrow down the list of candidate models by considering the most important variables. The rest of the paper is organized as follows. In Section 2, we describe the main MSCS methodology and study the condition needed to learn the true underlying model structure. In the same section, we propose a measure of importance for the individual variables. In Section 3, we give an adaptive sampling algorithm that implements the MSCS methodology. In Section 4, we study the finite sample properties of MSCS by Monte Carlo simulations for various models. In Section 5, we illustrate the MSCS procedure using the European E.coli outbreak data and the Australian breast cancer family study data. In Section 6, we conclude and give final remarks. Technical proofs are deferred to the Appendix. 2 Model selection confidence sets Consider independent observations, Y1 , . . . , Yn , from a family of models indexed by the parameter θ = (θ1 , . . . , θp )T ∈ Θ, with corresponding log-likelihood function `n (y, θ). Each parameter element θj ∈ θ describes a possibly relevant part of the overall model structure. We suppose that only a subset of θ is useful for describing the data, while the others are 4 regarded as unnecessary. A generic model index γ is defined as a subset of indexes in {1, . . . , p} and we write the correspondent parameter space as Θγ . Denote θγ ∈ Θγ as a parameter with the model γ, and let pγ = card(γ) denotes the cardinality (number of elements) of γ. The true parameter vector and the true model is denoted by θ ∗ and γ ∗ , repectively, while the full model with p parameters is denoted by γf . The space of feasible candidate models is Γ which contains the true model γ ∗ . The cardinality of Γ may be as large as 2p ; however it also may be restricted in some special problems. In the rest of the paper, we assume p < n, but p is allowed to slowly grow with n, reflecting the notion that with more observations available, the statistician is tempted to introduce additional variables into the model. For simplicity, we omit the sub-index n when it is clear from the context. In what follows, we use “.” to denote that the left hand side is bounded by the right hand side up to some positive constant independent of n. We write a & b if b . a. 2.1 Construction by likelihood ratio testing A MSCS is constructed from the known models space, Γ, and a criterion to assess models in Γ empirically. To screen out implausible models in the context of maximum likelihood estimation, it is natural to use the likelihood ratio test. Given a candidate model γ, we consider testing the null hypothesis H0 : θ ∗ ∈ Θγ against the alternative hypothesis H1 : θ∗ ∈ / Θγ . Then model γ is rejected if n o Λγ ≡ 2 `n (θbγf ) − `n (θbγ ) ≥ q(α; p − pγ ), 5 (2.1) where: θbγ and θbγf denote, respectively, the MLEs for the candidate and full models; `n (·) is the log-likelihood function; q(α; d) is the upper α-quantile for the central chi-squared distribution with d degree of freedom. The (1 − α)100%–MSCS is defined by the set of all models surviving the LRT screening: bα ≡ {γ ∈ Γ : Λγ ≤ q(α; p − pγ )} . Γ (2.2) The LRT procedure is applied to all models γ ∈ Γ: If a model is rejected, then we have evidence that it is too parsimonious in the sense that it is likely to miss at least one important bα . variable. By default, the full model γf is included in Γ When p is fixed, and γ ∗ is a proper subset of γ, the limiting null distribution of the LRT statistics Λγ is a central chi-square distribution, which follows directly from Wilks theorem (e.g., see van der Vaart (2000)). By construction, this implies that the true model is in the MSCS with probability approximately 1 − α in large samples. Specifically, if the true model is not the full model (γ ∗ 6= γf ), we have: bα ) = 1 − α. lim P (γ ∗ ∈ Γ n→∞ (2.3) bα ) = 1. If γ ∗ = γf , then P (γ ∗ ∈ Γ When p increases with n, similar Wilks-type results are given by Portnoy (1988), Murphy (1993), Fan and Peng (2004) and Fan and Zhou (2016) for exponential family models, Cox regression, penalized likelihood and goodness of spurious fit for GLMs. These results yield asymptotic coverage probability as in (2.3). Spokoiny (2012, 2013) establish Wilkstype behaviours for rather general families of models, which quantify and explicitly describe 6 the error term in the approximation of the likelihood ratio statistics under mild regularity conditions on the parametric family. We remark that although the MSCS includes γ ∗ with at least probability 1 − α, one cannot simply conclude that a variable is important just because it appears in some of the bα . Actually, unimportant variables tend to appear with a respectable frequency models in Γ in the MSCS models since larger models containing the true model plus other irrelevant variables is likely to survive the LRT screening. 2.2 Asymptotic detectability In this section, we study the conditions under which the variables in the true model appear with large frequency in MSCS. The results presented in this section extend the analysis given by Ferrari and Yang (2015) for linear models. bα ) is said to asymptotically detect Definition 1 (Asymptotic detectability). The MSCS (Γ all the true variables, if all the variables in the true model γ ∗ are included in each of the bα , with probability going to 1. models in Γ The concept of detectability is closely related to the power of the LRT. In the fixed p scenario when a candidate model γ misses at least one important variable, under appropriate regularity conditions ensuring asymptotic normality of the MLE, the Λγ converges in distribution to a non-central chi-square random variable with degree of freedom dγ = p − pγ . Let θγ∗ denote the parameter value in the model γ that minimizes the KullbackLeibler divergence from the true density (hence providing the best approximation to the true density). Then the non-centrality parameter of the asymptotic chi-square distribution is δγ = (θγ∗ − θ ∗ )T F (θ ∗ )(θγ∗ − θ ∗ ), where the F (θ) = −E [∂ 2 `n (θ)/∂θ 2 ] is the Fisher infor7 mation matrix. In the normal regression case as in Ferrari and Yang (2015), the asymptotic distribution is exact. Clearly, when applying LRT to a model γ, a large value of δγ makes it easier to reject γ. In the following theorem, we show that the limiting non-central chi-square alternative distribution is still valid under certain conditions for an exponential model where Y1 , . . . , Yn are i.i.d. observations from the pdf   f (y; θ) = exp θ T y − A(θ) . (2.4) with respect to a sigma-finite dominating measure. For this model, the true model γ ∗ is defined as the indexes of non-zero component of θ. Appropriate generalizations of the following result may be derived for other models but they are not pursued in this paper. Theorem 1. Assume conditions (A1)–(A3) given in the Appendix. Let γ be a model missing at least one variable in the true model γ ∗ and dγ → ∞ as n grows. Moverover, assume p kθ ∗ − θγ∗ k & p/n and p = o(n2/3 ). Then for model (2.4) we have Λγ − (dγ + δγ ) D p → N1 (0, 1), as n → ∞. 2dγ + 4δγ (2.5) Denote Xδ,d as a chi-square random variable with degree of freedom d and non-centrality p parameter δ. Recall that (Xδ,d − d − δ)/ 2(d + 2δ) converges to a standard normal distribution N1 (0, 1), when d → ∞. This means that in view of (2.5), Λγ is approximately non-central chi-square variable with degree of freedom dγ and non-centrality parameter δγ . The non-centrality parameter δγ may be interpreted a the discrepancy measure due to missing important variables in the true model. From this viewpoint, the relative magnitude 8 of δγ provides us with some insight on how informative is the data in relation to the feasibility of the model selection task. Let Kn (s) = s log(p/s). With p → ∞, it is typically the case that the true model dimension is bounded away significantly from p. In the rest of the paper, we assume that dγ increases to ∞ (however slowly) uniformly for the candidate models. The following result gives explicit sufficient conditions involving δγ for detectability in the general parametric setting, which includes model (2.4) described in Theorem 2.2. Theorem 2. Let Γu denote the set of models missing at least one of the true variables. Suppose that it holds that for all γ ∈ Γu , we have  |P (Λγ ≤ q(α; k)) − P Xδγ ,k ≤ q(α; k) | ≤ c1 exp [−c2 Kn (k)] , (2.6) where c1 and c2 are positive constants. A sufficient condition for asymptotic detectability is min γ∈Γu δγ > B, Kn (dγ ) (2.7) for some large enough positive constant B. The additional assumption above requires an exponential probability bound for the chisquare approximation of LRT statistics with model misspecification. We refer to Theorem 3.10 and Proposition B.1 in Spokoiny (2013), for the chi-square approximation, where a similar bound can be achieved for certain i.i.d and regression models. Moreover, consider  normal linear regression as in Ferrari and Yang (2015), RSSγ − RSSγf /dγ , the numerator of their F -test, follows an exactly non-central chi-square distribution where the assumption is trivially satisfied. 9 2.3 Sharpness of the sufficient condition for detectability The above detectability condition theorem is a general extension of Theorem 2.3 in Ferrari and Yang (2015), where in the context of normal linear regression, a sufficient condition n o p for detectbility is given as minγ∈Γu δγ / ξn + Kn (dγ ) is greater than some large enough constant, where ξn → ∞ is any arbitrarily slowly growing sequence. It turns out the condition is in fact not sufficient and a error occurred in their derivation. A correct sufficient condition is that minγ∈Γu δγ /Kn (dγ ) is larger than some constant, which matches (2.7) in this paper. In this subsection, we show the new sufficient condition cannot be generally improved. Due to space limitation and the need to correct Theorem 2.3 of Ferrari and Yang (2015), we focus on the normal regression case here. A generalization to other models, e.g. GLMs, can be done similarly with additional technical developments. Clearly the detectability condition relates to the size of the coefficients. For the following results, we assume the sparse Riesz condition (SRC) (Zhang, 2010) holds and consider 0 < α < 1/2. Let r∗ ≤ p/2 be a positive integer as the number of non-zero coefficients in the true model. Write fβ (X) = XT β = Pp j=1 βj Xj and let B = {β : kβk0 = r∗ and kfβ k2n ≤ cKn (r∗ )} for some small constant c > 0, where k·k0 denotes the `0 -norm, and kfβ k2n = Pn i=1 fβ2 (Xi ) with Xi being the covariate vector for the i-th observation. It represents all linear regression models γ with only r∗ non-zero coefficients. Theorem 3. Let D denote the event that all the variables in γ∗ are included in each of the models in the MSCS. Then when c is small enough, we must have lim sup inf Pβ (D) < 1. n→∞ β∈B 10 From the theorem, for the true models of dimension r∗ with kfβ k2n ≤ cKn (r∗ ), detection of the true terms is impossible in a proper minimax sense. Note that, for instance, for the model γ that contains all the wrong variables and none of the true variables, it results in dγ = r∗ and the noncentrality parameter is of order Kn (dγ ). This matches the lower bound requirement (2.7) in Theorem 2 in order. So from this aspect, the sufficient condition (2.7) for detectability cannot be generally weakened in order. 2.4 Inclusion importance Under the detectability conditions in Theorem 2, the MSCS includes all the relevant information concerning the model selection variability. Thus, a natural measure for ranking the importance of each parameter element θk ∈ θ is its relative frequency over all the MSCS models. This suggests the following definition. Definition 2 (Inclusion Importance). The inclusion importance (II) for any θk ∈ θ is defined as IIk = X bα ). I(k ∈ γ)/card(Γ (2.8) bα γ∈Γ When θk appears in all MSCS models, its importance is IIk = 1, meaning that θk is most likely part of the true model. As already mentioned, however, we note that a variable cannot be declared relevant just because it has a non-zero importance index. Actually, unimportant variable of θ tend to appear in the MSCS with frequency near 1/2. The reason is that when a small model is bα , also larger models containing the same variables plus some others tend to included in Γ be included via the LRT by construction. The following theorem describes an asymptotic behavior for the inclusion importance. 11 Theorem 4. If the asymptotic detectability conditions in Theorem 2 are satisfied, we have: (i) limn→∞ P (IIk = 1) = 1, for all k ∈ γ ∗ ;  (ii) limn→∞ P 1 IIk > + ∆ 2  ≤ α(1 + 2∆) 1 , for all k ∈ / γ ∗ , where 0 < ∆ < . 4∆ 2 If we have sufficient information to learn all the the relevant variables of the true model, we expect that their importance to be close to 1, while the unimportant variables are not likely exceeding by much the value 0.5. The upper bound in Theorem 4 can be used as a guidance to control the error probability of over selection. For example, one can set the error probability  = α(1 + 2∆)/(4∆) to be some small number and then find the corresponding ∆ so as to use II for an understanding if a variable is really important. For example, if the significance level is α = 0.05, setting ∆ = 1/6 implies  ≤ 0.1. 2.5 The multivariate normal location model In this section we consider the special case of the multivariate normal distribution with unknown location. Let Y follows the p-variate normal distribution Np (µ, Ip ). Then the pdf with form (2.4) can be obtained by setting the parameter vector as θ = µ and the cumulant generating function is A(θ) = θ T θ/2 + p log(2π)/2. Assume the true parameter θ ∗ is sparse with pγ ∗ = o(p) . The model space Γ is then with cardinality 2p . For a misspecified model γ ∈ Γu , the corresponding non-centrality parameter is δγ = n P j∈γ ∗ and j ∈γ / θj∗2 . A large value of δγ enables us to detect inadequacy of such models. For example, the asymptotic detectability conditions in (2.7) states that as long as the minimum p signal is large enough, min{|θi |, i ∈ γ ∗ } > B p/n for a large enough positive constant B, then all the models in MSCS are expected to contain all the nonzero parameters with 12 probability going to 1 as n → ∞. Otherwise if the size of some non-zero parameters in θ ∗ is too small, then the LRT has not enough power to screen some wrong models out. 3 Implementation by adaptive sampling Testing all the models in Γ is computationally challenging unless p is small, since the cardinality of the model space may grow exponentially in p. Thus, in order to find models in the MSCS it seems natural to turn to sampling methods. Let U = (u1 , . . . , up )T ∼ p(u; ω) be a random binary vector representing a model sampled from Γ (uj = 1 if the jth variable is included in the model), and p(·; ω) is a user-defined pmf indexed by ω. Our main objective is to choose a value of the parameter ω that maximizes the probability to sample MSCS models bα ) = P (U ∈ Γ X bα ). p(u; ω)I(u ∈ Γ (3.1) u∈Γ bα just by sampling from some arbitrary pmf p(·; ω), Note one is unlikely to find models in Γ unless α is sufficiently small. Thus, given a target significance level α = α∗ (e.g. 0.05) we propose to start from some small initial confidence level, say α(0) , and then construct a sequence of significance levels, 0 < α(0) ≤ α(1) ≤ · · · ≤ α∗ , corresponding to sampling distributions p(·; ω (0) ), p(·; ω (1) ), . . . , p(·; ω (∗) ) increasingly concentrated on the target subspace b α∗ . Γ At each step t ≥ 0 of our algorithm, the parameter ω of the sampling distribution is (t) retrieved by the following weighted likelihood approach. We generate B models {ub , b = 13 b (t−1) ) and then compute 1, . . . , B} from p(·; ω b (t) = argmax ω ω B X (t) (t) bα(t−1) )p(u ; ω). I(ub ∈ Γ b (3.2) b=1 b (t) ) closest to the best subset of previously sampled models in terms This finds the pmf p(·; ω of their resemblance to MSCS models. As t increases and α(t) gradually gets closer to α∗ , bα . b (t) ) tends to assign larger probability to models in Γ p(·; ω (t−1) Since this procedure is useful only when the indicator I(ub (t−1) ciently large fraction of sampled models, u1 (t−1) , . . . , uB bα(t−1) ) = 1 for a suffi∈Γ , we propose to increase adaptively (t) the significance level as α(t) = min{p-valb(1−ζ)Bc , α∗ }, 0 < ζ < 1, where p-valb(1−ζ)Bc is the empirical (1 − ζ)-quantile computed from the distribution of p-values. This ensures that the (t) bα(t) } is not too rare and occurs with probability of approximately ζ. The proevent {γb ∈ Γ posed approach is closely related to cross-entropy (CE) sampling. See Rubinstein and Kroese (2004) for a book-length exposition on this topic and Costa, Jones and Kroese (2007) for convergence analysis. In our practical implementation, we use p(u; ω) = Qp j=1 u ωj j (1 − ωj )1−uj , which gives a closed-form solution to (3.2) and leads to a fast algorithm; all our numerical experiments showed reliable results with relatively fast convergence. Other choices for p(u; ω) may enhance the performance of the algorithm, but they are not pursued here. The following steps outline the stochastic procedure for MSCS construction. First, note that Step 4 carries out smoothing at each iteration; if ξ = 1, the algorithm avoids smoothing. In our simulations, we found that ξ < 1 performs better than the nonsmooth update with ξ = 1 since it prevents occurrences of too many zeros and ones in situations where p is moderate or large. Smoothing avoids local optima where some model variables do not have the chance to be selected, while others are always selected. In our 14 Algorithm 1 : MSCS construction by adaptive sampling (MSCS-AS) b (0) (parameter vector for pmf p(u, ω)). 0. Initialize t = 0 (iteration counter) and ω (t) (t) b (t−1) ), and compute the sorted 1. Set t ← t + 1. Generate S (t) = {u1 , . . . , uB } from p(·; ω (t) (t) p-values, p-val(1) ≤ · · · ≤ p-val(B) , by the LRT defined in (2.1). (t) 2. Update α(t) = min{p-valb(1−ζ)Bc , α∗ }. 3. Use models sampled in Step 1, maximize the weighted likelihood as in(3.2) by computing: PB (t) (t) (t) b b=1 I{p-val(b) > α , θj ∈ ub } (t) , j = 1, . . . , p, cj = PB (t) (t) } I{p-val > α b=1 (b) where {θj ∈ u} denotes the event that the variable θj appears in model u. (t) (t) (t−1) ωj 4. Update ω bj ← ξcj + (1 − ξ)b for some constant 0 < ξ < 1. 5. Repeat Steps 1–4 until α(t−d) = · · · = α(t) = α∗ , for some d (e.g. d = 10). The final b (T ) ), where T denotes the last MSCS is obtained by drawing B (T ) models from p(u; ω iteration. experience, the MSCS-AS algorithm is robust to the choice of ξ, with ξ = 0.2 performing well across all our numerical examples. b (0) , and the number Second, the MSCS-AS algorithm requires setting the initial weights ω of models sampled at each iteration B. We found that the procedure is quite robust to the choices of such parameters. When no prior information on inclusion importance is available, b (0) can be set as ω b (0) = (0.5, · · · , 0.5). The performance of the the initial probabilities ω method, however, can be improved by assigning larger weights to variables that are known to contain more information about the true model. The number of models B generated in each iteration should be decided based on affordable computational resources. However, if B is too small this will affect the accuracy of the weighted likelihood criterion (3.2). In all our numerical examples we set B = 300. Finally, the constant ζ prevents overly small p-values in the first few iterations; thus, 15 it ensures a balanced growth of α(t) and guides the sampling process towards the MSCS models. The parameter ζ governs the trade-off between exploration and exploitation of the model space Γ and it should be also fixed based on the available computational resources. In our simulations, ζ = 0.25 is found to work well and is compatible with choices of analogous parameters often found in the CE literature. 4 Monte Carlo experiments 4.1 MSCS construction by exhaustive search In this subsection, we study the finite sample properties of MSCSs constructed by exhaustive search on the model space Γ. We generate samples from the following four models: Model 1: p-variate normal with unknown location, Y = (Y1 , . . . , Yp )T ∼ Np (θ, I). Model 2: p-variate normal Y = (Y1 , . . . , Yp )T ∼ Np (0, Σ), with unknown covariance matrix Σ. Additionally we assume that (Y1 , · · · , Yp ) can be partitioned into independent subvectors (Σi,j = 0 if Yi and Yj belong to different subvectors). Model 3: Logistic regression: Y |x ∼ Bernoulli(π(x)), Logit(π(x)) = −xT θ, θ ∈ Rp . Model 4: Poisson regression: Y |x ∼ Poisson(λ(x)), log(λ(x)) = −xT θ, θ ∈ Rp . In Models 3 and 4, the vectors of covariates are sampled from multivariate normal distribution Np (0, I) at each Monte Carlo run. For all the above models we consider the following two scenarios describing the relative size of parameters. Setting 1 (constant parameter size): The first p/2 parameters have the same size and the others are equal to 0. Specifically, θj = ψ, j = 1, ..., p/2, and θj = 0, 16 j = p/2 + 1, ..., p, where the parameters size ψ is set to be 1 for Models 1 and 3 and 0.2 for Models 4, respectively. For Model 2, (Y1 , · · · , Yp ) is partitioned into p/2 + 1 groups as {Y1 , · · · , Yp/2 }, {Yp/2+1 }, · · · , {Yp }. We set Σi,j = 1 if i = j; Σi,j = 0.5, 1 ≤ i < j ≤ p/2, and Σi,j = 0 otherwise. Setting 2 (decreasing parameter size): The first p/2 coefficients have decreasing size and the others are equal to 0. Specifically, θj = ψ/j, j = 1, ..., p/2, and θj = 0, j = p/2 + 1, ..., p, where ψ is set as 1, 2 and 0.4 for Models 1, 3 and 4, respectively. For Model 2, (Y1 , · · · , Yp ) is partitioned into p/2 + 1 groups as {Y1 , · · · , Yp/2 }, {Yp/2+1 }, · · · , {Yp }. We set Σi,j = 1 if i = j; Σi,j = 0.5/|i − j| if 1 ≤ i < j ≤ p/2, and Σi,j = 0 otherwise. The above settings are designed to achieve a small signal relative to the noise, so that the resulting data are affected by model-selection uncertainty. The model space consists of 2p models for Models 1, 3 and 4. For Model 2, the model space is equivalent to all the possible partitions of the set {1, 2, · · · , p} and its cardinality can be given by the Bell number Bp . In the following simulations, we use p = 6, 8 corresponding to B6 = 203 and B8 = 4140. Tables 1 and 2 show Monte Carlo estimates for the coverage probability and cardinality of MSCS corresponding to different sample sizes, n, number of predictors, p, at the 90, 95 and 99% confidence levels. As one expects, the cardinality of the MSCS grows as α decreases, while it increases rapidly with p, especially when the sample size n is relatively small. This reflects the situation where the data contain too much noise and the subsequent model selection variability is pronounced. The cardinality of the MSCS drops quickly as n increases. In most cases, the true coverage probability is quite close to the nominal confidence level. 17 Setting 1 n= 100 Setting 2 250 α p= 8 12 8 100 Model 1 12 250 8 12 8 12 Coverage (%) 0.10 0.05 0.01 91.2 94.4 98.4 90.0 95.8 99.8 89.8 94.4 99.2 90.2 96.2 98.4 91.2 94.8 99.4 89.4 95.4 98.8 91.0 95.0 99.0 88.6 94.4 99.4 Cardinality 0.10 0.05 0.01 14.5 15.3 15.8 58.1 61.0 63.5 14.4 15.2 15.9 58.3 61.2 63.4 22.7 27.2 37.1 241.3 319.0 497.8 15.5 16.8 19.4 101.3 126.5 184.6 6 8 6 8 p= 6 8 6 Model 2 8 Coverage (%) 0.10 0.05 0.01 89.2 94.6 98.4 88.4 94.8 97.8 89.2 94.2 98.8 91.0 94.4 99.4 89.0 94.4 98.4 87.6 93.2 99.0 88.4 94.4 98.6 88.8 94.4 99.2 Cardinality 0.10 0.05 0.01 13.5 14.3 15.6 47.1 50.7 57.9 13.5 14.2 14.8 47.0 47.3 46.9 13.8 15.1 18.8 57.1 72.7 126.6 13.4 14.2 14.8 46.4 49.2 51.5 Table 1: Monte Carlo estimates of MSCS coverage probability and cardinality by exhaustive search for Model 1 and Model 2 under varying confidence level 1 − α, sample size n, and number of variables p. Results based on 500 MC runs. And will be improved in general as the sample szies increases. We note that the true coverage probability tends to be more off from the nominal level when the size of the true parameters is decreasing (Setting 2). Clearly, in such settings model selection is more challenging, which leads to a increased cardinality of the MSCS but maintains the same coverage probability. 4.2 MSCS construction by stochastic search In this subsection, we study the performance of the MSCS-AS algorithm described in Section 3. We generate data from Models 3 and 4 (Poisson and Logistic regression models) using a T setting similar to that in Fan and Lv (2011). For both models, we set θ = θ1T , 0, 0, . . . , 0 , 18 Setting 1 n= p= Setting 2 100 8 250 12 8 100 12 α 250 8 12 8 12 Model 3 Coverage(%) 0.10 0.05 0.01 86.6 92.4 97.6 80.0 89.6 97.4 86.6 94.6 99.2 87.0 91.2 99.0 86.6 93.0 96.6 83.6 91.8 97.6 87.4 93.3 98.6 89.2 94.6 98.6 Cardinality 0.10 0.05 0.01 17.5 20.8 32.4 97.3 147.8 257.0 14.3 15.2 15.9 56.8 60.9 67.0 35.4 43.6 62.0 459.5 612.6 941.4 18.2 21.5 29.2 195.3 252.4 383.6 Model 4 Coverage(%) 0.10 0.05 0.01 89.0 95.6 99.4 90.6 94.2 99.4 90.4 95.2 99.0 89.8 94.6 99.0 90.6 95.2 99.8 89.2 94.2 99.4 89.0 94.6 98.6 90.4 95.0 99.0 Cardinality 0.10 0.05 0.01 85.2 109.6 157.9 871.6 1217.8 1987.0 24.6 32.4 54.8 148.7 210.3 402.1 75.6 94.1 124.9 1269.3 1633.6 2177.4 47.9 51.0 71.3 597.8 796.7 1167.7 Table 2: Monte Carlo estimates of MSCS coverage probability and cardinality by exhaustive search for Logistic regression (Model 3) and Poisson regression (Model 4) under varying confidence level 1 − α, sample size n, and number of variables p. Results based on 500 MC runs. where θ1 = (2.5, −1.9, 2.8, −2.2, 3)T in Model 3 and θ1 = (1.25, −0.95, 0.9, −1.1, 0.6)T in Model 4. The vector of covariates are sampled from a multivariate normal distribution Np (0, Σ) at each Monte Carlo run, where Σ has elements Σi,j = 0.5|i−j| , i, j = 1, 2, . . . , p. For illustration of capability to handle large p, we show the results for (n, p) equal to (200, 100) b (0) = (0.5, · · · , 0.5), and (1000, 500). The initial weights for the MSCS-AS algorithm are ω corresponding to lack of prior information about predictors’ importance. The remaining tuning parameters are set as ζ = 0.25, α∗ = 0.05, and ξ = 0.2. Figure 1 shows the trajectories for the importance weights {ωj }pj=1 during the first 50 iterations of the algorithm at the 95% confidence level. In all the considered cases, the 19 0 10 20 30 Iteration 40 0.0 0.5 ^j ω 0.5 ^1 − ω ^5 ω ^ ^p ω6 − ω 0.0 ^j ω 1.0 Poisson regression (p = 100) 1.0 Binomial regression (p = 100) 50 0 40 50 1.0 0.5 0.0 ^j ω 0.5 0.0 ^j ω 20 30 Iteration Poisson regression (p = 500) 1.0 Binomial regression (p = 500) 10 0 10 20 30 Iteration 40 50 0 10 20 30 Iteration 40 50 Figure 1: Sampling weights in p(·; ω) for 50 iterations of the MSCS-AS algorithm at the 95% confidence level. The vertical dashed line corresponds to iteration t such that α(t) = α∗ . Left and right panels correspond to Binomial and Poisson regression models described in Section 4. Settings for the algorithm: B = 300, ζ = 0.25, α∗ = 0.05, and ξ = 0.2. trajectories corresponding to terms with non-zero coefficients are clearly distinguished from the others after a few iterations. The inclusion importance for the relevant terms increases to around 1, while the others only have importance weights near 0.5. The graphs show that the MSCS-AS algorithm samples with probability progressively concentrating on the true model terms, while unimportant terms are sampled quite randomly. This behaviour mimics bα , thus enabling us to detect MSCS models at a much the structure of the true MSCS, Γ cheaper computational cost than exhaustive search on Γ. As suggested in Section 3 (Step 5 of the algorithm), we stop updating the importance weights shortly after the sequence of significance levels α(0) , α(1) , . . . reaches the target sig20 nificance level α∗ . However, after α(t) reaches α∗ , the weights of the irrelevant predictors eventually converge to 0 or 1 according to Kolmogorov’s zero-one law, thus one should stop before that happens. For example, stopping shortly after α(t) = α∗ = 0.05 – say around 15 iterations – already enables us to detect useful predictors from the rest. To illustrate that the MSCS-AS algorithm generates MSCS models with large probability, b (15) ), where ω b (15) is the importance we stop at iteration 15 and sample 106 models using p(·; ω weight at the 15th iteration. For the binomial regression model with p = 100 predictors, 80.5% of the models generated are included in MSCS. For the Poisson regression model with p = 100 predictors, 76.6% of the total models generated are in the MSCS. In comparison, if we generate 106 models using the uninformative weights ω (T ) = (0.5, · · · , 0.5), the proportion of MSCS models is basically 0, due to the largeness of the model space. 5 Real data examples Example 1: European Escherichia coli(E.coli) O104:H4 outbreak data. In this example, we apply the MSCS methodology to the E.coli data as described in Edwards, Pope and Holt (2016). E.coli O104:H4 is a particularly aggressive pathogen and caused a serious outbreak in northern Germany in 2011 (Rasko et al., 2011). Both during and after the outbreak, scientists have examined the genome of E.coli to find genetic causes for the severity of the outbreak. The data set used here consists of 56 outbreak isolates. For each isolate, 10 genes (or hypothetical genes) in the O104:H4 pangenome (a full collection of genes in a species of bacteria) that have been identified as might have been associated with the outbreak are considered. The main goal of our analysis is to select a model which can explain the most meaningful interaction effects between those genes. 21 The presence of genes in E.coli is denoted by binary variables taking values 1 when the correspondent gene is present and 0 otherwise. Let Y = (Y1 , . . . , Y10 ) be a random variable with 10 binary variables each denoting the activity of a particular gene. The pmf of Y is modelled by the Ising Model, ! X P (Y = y; θ) = exp θj,k yj yk + ψ(θ) , (5.1) 1≤j≤k≤10 where θ = (θj,k )1≤j≤k≤10 is the parameter of interest with p = 55 and ψ(θ) is the normalizing constant. The variable θj,j is regarded as the main effect for gene j, whilst θj,k is interpreted as an interaction effect between genes j and k. Here, we wish to choose θj,k 6= 0 if genes j and k have interaction (in the same group) and θj,k = 0 otherwise. In our analysis, we assume θj,j 6= 0 for 1 ≤ j ≤ 10, meaning that the main effects are always included. The total number of possible models in Γ is B10 = 115975, corresponding to the 10-th Bell number, which counts the number of different ways to partition a set containing 10 elements. ECPA_06065 ECPA_00233 ECPA_04619 II value 1.0 ECPA_04633 ECPA_01141 0.8 ECPA_03614 0.6 0.4 ECPA_05245 0.2 ECPA_00051 ECPA_00904 1 4 00 90 PA _ EC 1 PA _ 00 90 5 00 05 EC PA _ EC 4 PA _ 05 24 1 03 61 PA _ EC 3 01 14 EC PA _ EC 9 04 63 EC PA _ 04 61 EC 3 00 23 PA _ 06 06 PA _ EC PA _ EC 5 ECPA_00901 Figure 2: Inclusion Importance (II) for θj,k in model (5.1). The II values are calculated from the 95%-MSCS. 22 Here we use the exhaustive search to construct the MSCS for θ. The MSCSs at the 90, 95 and 99% confidence levels contain 7, 12 and 38 models, respectively; these numbers are small compared to the model space size, meaning that most of the models in Γ are rejected by the LRT procedure and there is not too much model selection uncertainty here. The jk-th element of the matrix in Figure 2 represents the inclusion importance (II) for the variable θj,k . Note that certain gene pairs have high II values; for example, pairwise interactions among genes 1141, 3614, 5245, 0051, 0904, 0901 are close to 1 in terms of II values, suggesting that such genes form a synergetic network associated with the outbreak occurrence. Other genes, such as 6065, 0233, 4619, 4633, show inclusion importance for interaction effects close or smaller than 0.5, which suggests that the corresponding interactions are small or irrelevant. Example 2: Australian breast cancer family study data. In the second example, we apply the MSCS methodology to the ABCFS genotype data, consisting of 356 observations (284 breast cancer patients and 72 controls). Cases are obtained from the Australian Breast Cancer Family Study (ABCFS) (Dite et al., 2003), while controls are from the Australian Mammographic Density Twins and Sisters Study by Odefrey et al. (2010). Patients are genotyped using a Human610-Quad beadchip array. The response is the binary disease status (presence/absence of breast cancer), while the predictors are 50 SNPs, measured at different loci encoding a candidate susceptibility pathway (probe IDs are listed in Figure 3). To model the binary disease status, we use a logistic regression model. MSCS models are sampled using the MSCS-AS algorithm described in Section 3 with tuning parameters α∗ = 0.05, ζ = 0.25, B = 300 and B (T ) = 106 . Figure 3 (top) shows the models selected by forward step-wise AIC and BIC (F-AIC and F-BIC), and penalized likelihood methods under Lasso (Tibshirani, 1996), SCAD (Fan 23 0.0 0.2 0.4 0.6 0.8 Inclusion Importance 1.0 rs10082248_A rs12470143_T rs4952220_C rs2268796_A rs2754530_T rs1966151_G rs1908406_C rs1845557_C rs1238574_C rs3775777_G rs4149535_G rs3775770_T rs1881668_G rs8192207_T rs11749784_G rs439205_A rs988328_C rs985192_A rs985694_T rs2347872_T rs926777_A rs2982684_A rs2144025_T rs7743290_G rs722208_G rs13216134_G rs13203975_A rs2207232_C rs3020411_G rs3020418_A rs2982712_C rs6932864_A rs3778080_C rs3778082_A rs3020375_C rs3778099_C rs1390358_C rs1112005_T rs7832071_T rs1041983_T rs1801280_C rs1799929_T rs1799930_A rs1208_G rs4646247_A rs2257157_G rs1902586_A rs296365_C rs12611137_T rs2544785_T Lasso SCAD MCP F−AIC F−BIC ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 24 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Figure 3: Analysis of the ABCFS case-control genotype data. Top: model selection by penalized likelihood methods with Lasso, SCAD and MCP penalties and step-wise forward AIC and forward BIC. Colored cells denote selected variables. Bottom: Estimate of II by MSCS-AS algorithm(red points) and the 95% bootstrap confidence intervals. The number of bootstrap replicates is 50. Settings for the MSCS-AS algorithm parameters: B = 300, B (T ) = 106 , α∗ = 0.05, ζ = 0.25, ξ = 0.2. . and Li, 2001) and MCP (Zhang, 2010) penalties where tuning parameters are all chosen by five-fold cross-validation. Figure 3 (bottom) shows Inclusion Importance, II values, for each SNP. The vertical bars represent the 95% bootstrap confidence intervals for II values. First note that SNPs with high II values show considerable overlap with those selected by the other methods. Particularly, most of the SNPs reported as important by more than one model selection method have large II values. Predictors with II values that are not significantly larger than 0.5 may not necessarily be important, and need to be consider more carefully. The p-values of the F-test for the AIC, BIC, Lasso, SCAD and MCP models are 0.96, 0.09, 0.88, 0.86 and 0.80. respectively. Therefore, while the BIC model is included in the MSCS at the 95% and 99% levels, it is not accepted at the 90% confidence level. This sugggests that F-BIC model any misses some important SNP predictors and is not as reliable as other models. Moreover, note that there are only 5 SNPs (rs0082248_A, rs12470143_T, rs2754530_T, rs8192207_T, rs2257157_G) that have relatively large II values and confidence interval significantly above 0.5. Many predictors chosen by some of the methods have II confidence intervals covering 0.5. This suggests that the sample is not sufficiently informative to declare such terms relevant so they should be further studied with particular care. To confirm this, we investigate the marginal significance of all the selected SNPs in each of those models. At the 0.05 level, we have 8 (Lasso, SCAD and MCP ) to 12 (AIC) significant coefficients, while the 5 SNPs with II interval not including 0.5 are significant in all cases. Finally, we show the instability of common model selection methods for this dataset. We consider the selected models as in Figure 3 (top). For each model we obtain the fitted values {Ybi }ni=1 , which are equal to {b p}ni=1 , the estimated probability in the logistic regression. 25 Size AHD Lasso SCAD MCP F-AIC F-BIC 21 14.74 16 11.132 15 10.44 15 11.58 5 5.59 Table 3: The number of SNPs in the original selected model and the average Hamming distance between the 500 bootstrapped models and the original selected model. Next, parametric bootstrap is used to generate bootstrap replicates {Xi , Yi∗ }ni=1 , and all the methods are applied again to corresponding bootstrap samples. We repeat this step for S = 500 times and compute the average hamming distances (AHD) of the S bootstrapped Lasso, SCAD, MCP, F-AIC and F-BIC models to the the respective models obtained from the original sample, see Table 3. The AHD is large compared the size of the models, which means for each bootstrapped sample, those model selection methods will choose quite different predictors. 6 Conclusion and final remarks The MSCS methodology in this paper introduces new tools supporting the activity of model selection in the context of likelihood-based inference. Since the MSCS is asymptotically guaranteed to contain the true model at a pre-specified confidence level, it represents a natural extension of the familiar notion of confidence intervals to the model selection framework. Furthermore, Theorem 4 suggests that important variables tend to appear in the MSCS models with large probability as n → ∞, while unimportant terms appear randomly with frequency not significantly larger than 0.5. By looking at the variables appearing frequently in the MSCS one can also choose a single central model representing the entire MSCS by taking predictors with inclusion importance significantly larger than 0.5. In the future, developing a theoretical understanding of the optimal way to combine MSCS models would be 26 very valuable as it can potentially lead to improved model combining and model selection strategies. The main focus of the current MSCS approach is based on maximum likelihood estimation. We have shown that in exponential family models this requires p = o(n2/3 ) and correct model specification for the MSCS to be meaningful. In the future, however, higherdimensional problems may be pursued, by replacing the LRT statistics with other tools to construct the MSCS, e.g., using penalized likelihood methods. Computational methods to tackle the case where the model space and MSCS is large is also of great interest. Appendix: Proofs Notice that quantities such as p, θ, γ and Θ may depend on n, hence array asymptotics are considered in this section. Proof of Theorem 2.2. Since within the considered exponential family affine mappings are preserved, without loss of generality we assume E(Yi ) = A0 (θ ∗ ) = 0 and cov(Yi ) = A00 (θ ∗ ) = Ip . Denote Vθ = Yθ − E(Yθ ), where Yθ ∼ f (y; θ). First, we need to assume following regularity conditions for the exponential family model f (; θ): (A1) EYij6 < ∞, (A2) sup (j = 1, . . . , p); E(aT Vθ )3 . p n/p, and sup E(aT Vθ )3 = O(1); kak=1 kak=1 kθ−θ ∗ k2 .p/n (A3) sup E(aT Vθ )4 = O(1). kak=1 kθ−θ ∗ k2 .p/n Suppose we have γ which is a model not containing all the elements in γ ∗ . Let Y = 27 Pn i=1 Yi /n and Yγ = Pn i=1 Yi,γ /n, where Yi,γ denote the vector with elements equal to Yi for indexes in γ and zero otherwise. Let G = θ ∗ − θγ∗ satisfying kGk & p p/n and assume p = o(n2/3 ), where θγ∗ is the pγ ∗ -variate vector with components equal to θ ∗ at γ ∩ γ ∗ and equal to zero otherwise. . To proceed, we give following auxiliary lemmas . Lemma 1. Suppose conditions (A2) and (A3) hold. Then, for the MLEs, θbγ , we have: p  kθbγ − θγ∗ k = Op pγ /n , and kθbγ − θγ∗ − Yγ k = Op (pγ /n) . Lemma 1 combines Theorems 2.1 and 3.1 in Portnoy (1988). The existence of MLE for p θγ in a L-2 neighbourhood of order pγ /n is still valid by simply changing the true model θ ∗ with the partial model θγ∗ . Lemma 2. Assume (A2) and (A3) hold, for model γ, A(θγ∗ ) − A(θ ∗ ) = kθγ∗ − θ ∗ k2 /2 + o(kθγ∗ − θ ∗ k2 ). Proof. Note that from (A3), by Taylor expansion we have: A(θγ∗ ) − A(θn∗ ) = 3 1 ∗ 1  kθγ − θ ∗ k2 + E (θγ∗ − θn∗ )T Vθ∗ + O(kθγ∗ − θn∗ k4 ). 2 6  3 Applying (A2) gives E (θγ∗ − θ ∗ )T Vθ∗ . kθγ∗ − θ ∗ k3 , which completes the proof. Lemma 3. Suppose conditions (A1), (A2)and (A3) hold, when p − pγ → ∞ we have  n kYk2 − kYγ k2 + 2nGT Y − (p − pγ ) D p → N1 (0, 1), 2(p − pγ + 2δn ) where δn = nkGk2 . 28 (6.1) Pk Proof. Define Tk = i=1 Pk Yi , Tk,γ = Yi,γ and Sk = kTk k2 − kTk,γ k2 + 2kGT Tk − i=1 k(p − pγ ). It is easy to see that E(Sn ) = 0 and var(Sn ) = 2n2 (p − pγ + 2nkGk2 ). Let Dk = Sk − Sk−1 , thus T Dk = 2YkT Tk−1 + kYk k2 − 2Yk,γ Tγ,k−1 − kYk,γ k2 + 2GT Tk−1 + 2kGT Yk − (p − pγ ). Next, define σk2 = EDk2 and s2k = Pk i=1 σi2 . Note that Yk and Tk−1 are independent. A simple calculation shows that: s2n = n X σk2 . n2 p + n3 kGk2 , (6.2) k=1 Next, let Fk = F(Y1 , . . . , Yk ) denote the σ-field generated by Y1 , . . . , Yk . Then {Sk } are martingales on {Fk }, and {Dk } are the martingale differences. From Chow and Teicher p  D (1978), by Martingale Central Limit Theorem , we have Sn / n p − pγ + δγ → N1 (0, 1) if n X E|Dk |3 /s3n → 0, and Pn k=1 E|E(Dk2 |Fk−1 ) − σk2 |/s2n → 0. (6.3) k=1 Since E(Yij6 ) < ∞, by Proposition A.3 in Portnoy (1988), we have E(YkT Tk−1 )6 . k 3 p3 and therefore Pn k=1 E|Dk |3 . n5/2 p3/2 + n2 p5/2 + n4 kGk3 , Together with Equation (6.2) implies Pn k=1 E|Dk |3 /s3n → 0. Next, note that n X n  2 o1/2 E E(Dk2 |Fk−1 ) − σk2 (6.4) . n3/2 p3/2 + n2 p1/2 + n3/2 kGk2 (6.5) E|E(Dk2 |Fk−1 ) − σk2 | ≤ k=1 29 Thus, we have Pn k=1 E|E(Dk2 |Fi−1 ) − σk2 |/s2n → 0. Now we are able to prove the main results. Proof of Theorem 2.2. Under the alternatives, we have h i Λγ = 2n(θbγf − θbγ )T Y − 2n A(θbγf ) − A(θbγ ) h h i i ∗ ∗ ∗ ∗ T b b b b = 2n (θγf − θ ) − (θγ − θγ ) Y − 2n A(θγf ) − A(θγ ) − A(θγ ) + A(θγ )   −2n (θγ∗ − θ ∗ )T Y − A(θγ∗ ) + A(θ ∗ ) . (6.6)  The first two terms of the LRT statistic in (6.6) are approximately n kYk2 − kYγ k2 + Op (p2 /n). Additionally, Lemma 2 implies that the third term in (6.6) is approximately equals to −2n(θγ∗ − θ ∗ )Y + nkθγ∗ − θ ∗ k2 . Hence, applying Lemma 3 completes the proof. Proof of Theorem 2. We show that if the sufficient condition in Theorem 2 is satisfied, we have ! P [ {Λγ ≤ q(α; dγ )} → 0, as n → ∞. γ∈Γu An union bound of the above probability is: ! P [ {Λγ ≤ q(α; dγ )} ≤ γ∈Γu p−1 X X  P Λγ ≤ q(α; k) (6.7) k=1 dγ =k γ∈Γu ≤ p−1 X exp [Kn (k)] max P (Λγ ≤ q(α; k)) . k=1 dγ =k γ∈Γu (6.8) Note that we assume the exponential bound as in (2.6) . Thus, combining Lemma 8.1 in 30 Birgé (2001) and Theorem A in Inglot (2010) gives the following probability upper bound:  max P (Λγ (dγ , δγ ) ≤ q(α; k)) ≤ max P Xδγ ,k ≤ q(α, k) + c1 exp [−c2 Kn (k)] dγ =k γ∈Γu dγ =k γ∈Γu 2  p δγ + 2 log(α) − 2 −k log(α)   ≤ exp − min  dγ =k 2(k + 2δγ )   γ∈Γu +c1 exp [−c2 Kn (k)] where c1 , c2 are positive constants. When min dγ =k γ∈Γu (6.9) δγ > B for some large enough positive Kn (k) constant B, the first term in the last upper bound (6.9) will be small than exp[−(c3 −1)Kn (k)] for some c3 > 1. Therefore, we have ! P [ {Λγ ≤ q(α; dγ )} γ∈Γu . p−1 X exp[− min(c2 , c3 − 1)Kn (k)] → 0. (6.10) k=1 b be the largest model that are nested in all the models in Proof of Theorem 3 Let γ MSCS. It may be the intercept only model. Note that with probability at least 1 − α the   bα ≥ 1 − α. Therefore true model γ ∗ is included in the MSCS, i.e., P γ ∗ ∈ Γ    bα + sup Pβ DC sup Pβ (b γ 6= γ ∗ ) ≤ sup Pβ γ ∗ ∈ /Γ β∈B β∈B (6.11) β∈B ≤ α + 1 − inf Pβ (D) . β∈B (6.12) It follows that if inf β∈B Pβ (D) → 1 for any subsequence of {nj } ⊂ {1, 2, · · · }, we must have supβ∈B Pβ (b γ 6= γ ∗ ) ≤ α0 for some α < α0 < 1/2 when nj is large enough in the subsequence. 31 Hence if we can actually show supβ∈B Pβ (b γ 6= γ ∗ ) ≥ 1/2 for a small enough c > 0 in the definition of B, the theorem is proved. Note that this now becomes a traditional minimax framework where Fano’s inequality can be applied. Without loss of generality, we assume σ 2 = 1 for the error variance. Consider a packing set Nn in B = {β : kβk0 = r∗ and kfβ k2n ≤ cKn (r∗ )} with packing distance n p being a small fraction of cKn (r∗ ) under the kkn norm. Let β be randomly chosen from the uniform distribution on Nn . Using similar arguments as in the proof of Theorem 11 in Wang, et al. (2014), under the SRC, by choosing the constant c small enough, the mutual information I(β; {Xi , Yi }ni=1 ) between the random β and the observations is upper bounded by δ = cKn (r∗ )/2, and the local packing n -entropy log |Nn | is lower bounded by 2δ + 2 log 2. Apply Fano’s inequality (see, e.g., Yang and Barron, 1999) to this linear regression model gives: sup Pβ (b γ 6= γ ∗ ) ≥ 1 − β∈B I(β; {Xi , Yi }ni=1 ) + log 2 1 ≥ , log |Nn | 2 (6.13) this completes the proof. Proof of Theorem 4 (i) Let γ be a model missing at least one variable in γ ∗ . From bα ) → 0, as n → ∞. Hence, for all θj in θ ∗ , limn→∞ P (IIj = 1) = 1. Theorem 2, P (γ ∈ Γ This completes the first part of the theorem. e = {γ1 , γ2 , · · · , γN } be the set of models larger than γ ∗ . The construction of (ii) Let Γ bα ) ≥ 1−α for any 1 ≤ i ≤ N . Let Xi be the random variable MSCS implies limn→∞ P (γi ∈ Γ bα and 0 otherwise. Note that when k ∈ taking value 1 when γi ∈ Γ / γ ∗ , there are N/2 models e which contain θk . Without loss of generality, let γ1 , γ2 , · · · , γN/2 be models containing in Γ k. Let Y1 = PN/2 i=1 Xi , denoting the number of models in {γ1 , γ2 , · · · , γN/2 } that are included 32 bα . Similarly, let Y2 = PN in Γ i=N/2+1 Xi . Then Y1 ≤ N/2 and E(Y2 ) ≥ N (1 − α)/2. The IIk defined in Section 2.4 equals to Y1 /(Y1 + Y2 ) with probability going to 1 as n → ∞. Note that for any 0 < ∆ ≤ 1/2 we have  P 1 Y1 ≥ +∆ Y1 + Y2 2   ≤P  =P N/2 1 ≥ +∆ N/2 + Y2 2  2∆N N/2 − Y2 ≥ 1 + 2∆  (N/2 − E(Y2 ))(1 + 2∆) 2N ∆ α(1 + 2∆) ≤ , 4∆ ≤ where the second inequality follows from Markov’s inequality, which completes the proof. References Birgé, L. (2001). In State of the Art in Probability and Statistics. IMS Lecture Notes. 37, 113–133. Bühlmann, P. and van de Geer, S. (2011). Statistics for High-Dimensional Data: Methods, Theory and Applications. Springer, New York. Chow, Y. S. and Teicher, H. (1978). Probability Theory: Independence, Interchangeability, Martingales. Springer, New York. Claeskens, G. and Hjort, N. L. (2008). Model Selection and Model Averaging. Cambridge University Press, Cambridge. Costa, A., Jones, O. D. and Kroese, D. (2007). Convergence properties of the cross-entropy method for discrete optimization. Oper. Res. Lett. 35, 573–580. 33 Dite, G. S., et al. (2003). Familial risks, early-onset breast cancer, and brca1 and brca2 germline mutations. J. Natl. Cancer Inst. 95, 448–457. Edwards, D., Pope, B. J. and Holt, K. E. (2016). Reddog tutorial. GitHub techinical report, Web: https://github.com/katholt/RedDog/blob/master/docs/RedDogTutorial.pdf. Fan, J. and Li, R. (2001). Variable selection via nonconcave penalized likelihood and its oracle properties. J. Amer. Statist. Assoc. 96, 1348–1360. Fan, J. and Lv, J. (2011). Nonconcave penalized likelihood with np-dimensionality. IEEE Trans. Inform. Theory. 57, 5467–5484. Fan, J. and Peng, H. (2004). Nonconcave penalized likelihood with a diverging number of parameters. Ann. Statist. 32, 928–961. Fan, J. and Zhou, W.-X. (2015). Guarding from spurious discoveries in high dimension. J. Mach. Learn. Res. 17, 1–34. Ferrari, D. and Yang, Y. (2015). Confidence sets for model selection by F -testing. Statist. Sinica. 25, 1637-1658. Hansen, P. R., Lunde, A. and Nason. J. M. (2011). The model confidence set. Econometrica. 79, 453–497. Heritier, S. and Ronchetti, E. (1994). Robust bounded-influence tests in general parametric models. J. Amer. Statist. Assoc. 89, 897–904. Inglot, T. (2010). Inequalities for quantiles of the chi-square distribution. Probab. Math. Statist. 30, 339–351. 34 Lehmann, E. L. and Romano, J. P. (2005). Testing Statistical Hypotheses. 3rd edition. Springer, New York. Mcquarrie, A. D. and Tsai, C.-L. (1998). Regression and Time Series Model Selection. World Scientific, Singapore. Murphy, S. A. (1993). Testing for a time dependent coefficient in cox regression model. Scand. J. Stat. 20, 35–50. Odefrey, F. et al. (2010). Common genetic variants associated with breast cancer and mammographic density measures that predict disease. Cancer Res. 70, 1449–1458. Portnoy, S. (1988). Asymptotic behavior of likelihood methods for exponential families when the number of parameters tends to infinity. Ann. Statist. 16, 356–366. Rasko, D. et al. (2011). Origins of the e. coli strain causing an outbreak of hemolytic-uremic syndrome in germany. N. Engl. J. Med. 365, 709–717. Romano, J. P. and Wolf, M. (2005). Exact and approximate stepdown methods for multiple hypothesis testing. J. Amer. Statist. Assoc. 100, 94–108. Rubinstein, R. Y. and Kroses, D. P. (2004). The Cross-Entropy Method: A Unified Approach to Combinatorial Optimization, Monte-Carlo Simulation and Machine Learning. Springer-Verlag, New York. Shimodaira, H. (1998). An application of multiple comparison techniques to model selection. Ann. Inst. Statist. Math. 50, 1–13. Spokoiny, V. (2012). Parametric estimation. finite sample theory. Ann. Statist. 40, 2877–2909. 35 Spokoiny, V. (2013). Bernstein-von mises theorem for growing parameter dimension. Available at arXiv:1302.3430. Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. J. R. Stat. Soc. Ser. B Stat. Methodol. 58, 267–288. Van der Vaart, A. W. (2000). Asymptotic Statistics. Cambridge University Press, Cambridge. Wang, Z., Paterlini, S., Gao, F. and Yang, Y. (2014). Adaptive minimax regression estimation over sparse lq -hulls. J. Mach. Learn. Res. 15, 1675–1711. Yang, Y. and Barron, A. (1999). Information-theoretic determination of minimax rates of convergence. Ann. Statist. 27, 1564–1599. Zhang, C.-H. (2010). Nearly unbiased variable selection under minimax concave penalty. Ann. Statist. 38, 894–942. 36
10math.ST
A Systematic Aspect-Oriented Refactoring and Testing Strategy, and its Application to JHotDraw Arie van Deursen1,2 , Marius Marin2 , and Leon Moonen2,1 arXiv:cs/0503015v1 [cs.SE] 5 Mar 2005 1 2 Centrum voor Wiskunde en Informatica (CWI), The Netherlands Software Evolution Research Lab, Delft Univ. of Technology, The Netherlands [email protected], [email protected], and [email protected] Abstract. Aspect oriented programming aims at achieving better modularization for a system’s crosscutting concerns in order to improve its key quality attributes, such as evolvability and reusability. Consequently, the adoption of aspect-oriented techniques in existing (legacy) software systems is of interest to remediate software aging. The refactoring of existing systems to employ aspectorientation will be considerably eased by a systematic approach that will ensure a safe and consistent migration. In this paper, we propose a refactoring and testing strategy that supports such an approach and consider issues of behavior conservation and (incremental) integration of the aspect-oriented solution with the original system. The strategy is applied to the JH OT D RAW open source project and illustrated on a group of selected concerns. Finally, we abstract from the case study and present a number of generic refactorings which contribute to an incremental aspect-oriented refactoring process and associate particular types of crosscutting concerns to the model and features of the employed aspect language. The contributions of this paper are both in the area of supporting migration towards aspect-oriented solutions and supporting the development of aspect languages that are better suited for such migrations. 1 Introduction Aspect-oriented software development is a programming paradigm that addresses crosscutting concerns: behavior of a software system that is hard to decompose and isolate in existing paradigms (as object orientation) and requires its implementation to be spread across many different modules. Aspect-oriented software development aims to overcome these limitations by capturing such crosscutting behavior in a new modularization unit, the aspect, and offers (compile time) code generation facilities to weave aspect code into the rest of the system. Claimed benefits include improved evolvability and reusability of (parts of) the software system [12, 23]. Addressing the aforementioned modularization limitations and the resulting code scattering and tangling does not only pay off in the development of new applications but it will also have major benefits in existing software systems where these, and associated, problems have become known as software aging [33] or software entropy [24–26]. The adoption of aspect-orientation in existing software requires refactoring: code transformations that improve the internal structure of a system while preserving its external behavior. Existing work on aspect-introducing-refactorings has mainly focused on presenting aspect-oriented solutions to typical crosscutting problems, especially in the context of design patterns, and showing that this results in a better separation of concerns [19, 23, 31, 32]. Also tool support for aspect extensions of refactorings, such as method extraction, has been investigated [13]. We argue, however, that widespread adoption of aspect-oriented techniques in existing software systems is still hindered by a number of open issues: – Lack of a systematic approach to refactor legacy code to employ aspect-oriented solutions; – Proper understanding of the testing challenges that rise from behavior preserving migration towards a new or extended language, such as the development of an aspect-oriented fault model and the definition of an explicit test adequacy criterion; – Suitability of aspect languages. Analysis of crosscutting concerns that were identified in various object-oriented systems in earlier work ([29]) suggested that we might encounter difficulties when trying to refactor those concerns into aspects: the mechanisms offered by particular aspect languages, or the joint point model behind the language were not always sufficient to capture all types of concerns that were encountered; – Availability of aspect-oriented and non-aspect-oriented implementations of the same software system which can be used to show the evolution benefits of proposed solutions; and, more generally, – An overall assessment of the benefits of aspect-oriented software development. These issues are the principal motivation for the work described in this paper. To address them, we propose a language and system independent refactoring and testing strategy to adopt aspect-oriented solutions in legacy code. The strategy consists of a number of systematic steps that guide the transformation, ensure conservation of observable behavior and help one deal with the intricacies of aspect-oriented migrations. We demonstrate suitability of the proposed strategy in a case study in which we migrate JH OT D RAW, a (relatively) large and well-designed open source Java application, to AJ HOT D RAW, a corresponding aspect-oriented version which is based on A SPECT J, an aspect language extending Java with crosscutting functionality. Based on the difficulties that were encountered during our refactorings, we reflect on the suitability of particular (features of) aspect languages for this type of work (i.e. evolution of legacy systems as opposed to greenfield development). This provides designers of aspect languages with valuable insights into situations that require model or feature extensions to address these concerns. The remainder of the paper is structured as follows: In the next section we propose an aspect-oriented refactoring and testing strategy together with its accompanying fault model and test adequacy criterion. This is followed by a section that presents general considerations about the case study. Next, a number of selected crosscutting concerns are discussed on an individual basis, depicting the context in which they occur, the original and refactored implementation together with the benefits and drawbacks. In 2 Section 5, a number of generic refactorings are abstracted from the case study and associations are made between types of crosscutting functionality and the aspect language model and features. We conclude with a general discussion followed by an overview of related work, summary of our contributions and present some directions for future work. 2 The B ETTAR Refactoring Strategy The refactoring strategy we propose is called B ETTAR: its objective is to obtain Better Evolvability Through Tested Aspect Refactorings. We distinguish the following steps: Identification of Crosscutting Concerns: Search for candidate aspects using “aspect mining” techniques such as fan-in analysis or clone detection [6, 29, 36]. Assess the scattering and tangling implications of the current non-aspect-oriented solution to the crosscutting concerns identified. Aspect Design: Identify how the concern could be implemented as an aspect. Assess the pros and cons and compare these with the existing solution. Refactoring Design: Devise a sequence of (small) steps, refactoring the object solution to the aspect solution. This may involve various traditional object-oriented refactorings, in order to unplug the crosscutting concern from code implementing other concerns, in addition to refactorings moving functionality to aspects. Conduct trade-off analysis to determine whether the aspect benefits outweigh the refactoring costs. Test Suite Design: Conduct a baseline test on the existing implementation, and analyze the test adequacy of the current test suite with respect to the risks introduced by the aspect-oriented solution as well as by the refactoring process itself. If necessary, create or extend the test suite – see the next section for further details on this step. Execute and Test: Carry out the refactorings, and verify that the behavior of the system is unaltered by means of the test suite. In Section 4 we will apply these steps to various cross cutting concerns as occurring in the open source JH OT D RAW system. As the interplay between refactoring and testing, in particular in an aspect-oriented setting, has received very little attention in the literature so far, we start by elaborating the testing steps. 2.1 Ensuring Behavior Preservation while Refactoring to Aspects Refactoring is the process of changing a software system in such a way that it improves the code’s internal structure, without altering its external behavior [14]. In order to ensure the latter constraint, most literature on refactoring assumes the presence of a test suite that verifies the correct functional behavior of the system to be refactored. As long as this test suite is executed before and after each refactoring, we can assume that we will be warned as soon as one of our refactorings affects the correct behavior of the system. 3 In practice, however, the creation of such a test suite is challenged by a number of issues. These hold in the general (pure object-oriented) situation, as well as in a setting where the refactoring includes the introduction of aspects. These issues are: – To test effectively, testing should be based on a fault model. Such a fault model guides our search for test cases that give the highest probability of finding typical faults [4]. The adoption of aspects opens opportunities for different types of faults, calling for an explicit aspect-oriented fault model. – Systematic testing makes use of an explicit test adequacy criterion (see, e.g., [4]), usually expressed as a coverage percentage to be achieved in some coverage model. Refactoring changes the internal structure of the code. Since test adequacy is expressed in terms of code structures covered, a refactoring may very well affect coverage negatively — a phenomenon referred to as the antiextensionality axiom by Weyuker [38]. – In addition to new faults introduced by using aspects, the mechanics of actually carrying out a refactoring may lead to a new fault. For example, when we moved part of a method from a class to an aspect, we did not copy-paste all statements. At other times, refactorings affect the public interface of classes, for example when moving a public method. This implies that the test suite needs to be adapted as well, causing an extra risk of letting errors pass [11]. This calls for a testing approach that is dedicated to refactorings involving the introduction of aspects. In this section, we provide such an approach. In order to do so, we first propose an aspect-oriented fault model, as well as aspect-oriented test adequacy criteria. Note that such a model and criteria can never be complete: we believe, however, that our proposals represent an important first step. The specific faults that can be made while refactoring depend on the actual refactoring applied. Therefore, we will not provide a general fault model for refactorings, but will indicate typical faults and testing implications when discussing some of the individual refactorings that we have used. We will then also indicate whether the refactoring may require changes to existing test cases. The test strategy presented below is applicable to any development project making use of aspects, and as such is independent of our case study on JH OT D RAW. In the later sections we will discuss how we actually applied the proposed fault model and adequacy criteria when while refactoring JH OT D RAW to AJ HOT D RAW. 2.2 An Aspect-Oriented Fault Model A fault model identifies relationships and components of the system under test that are most likely to have faults [4]. We distinguish faults for inter-type declarations, pointcuts, and advice. Inter-type declarations are most error-prone (and most powerful) when used to create polymorphic functions. Therefore, our fault model for introductions is based on Binder’s existing fault models for polymorphism and inheritance [4, p.501]. Our model distinguishes the following faults that are specifically related to polymorphism in introductions and inter-type declarations: 4 – Wrong method name in introduction, leading to a missing or unanticipated method override. – Wrong class name in a member-introduction, leading to a method body in the wrong place in the class hierarchy. – Inconsistent parent declaration, resulting in a (sub)class that violates Liskov’s and Wing’s behavioral notion of subtyping [27] and/or Meyer’s design-by-contract rules for inheritance (such as require no more, ensure no less) [30]. – Inconsistent overridden method introduction, also resulting in a violation of behavioral subtyping. – Omitted parent interface resulting in a method that was intended to implement an interface method, but which now stands on its own. Faults in pointcuts will have the effect that advice code is activated at the wrong program execution points. Such faults include: – Wrong primitive pointcut, using, for example, a call instead of an execution construct. – Errors in the conditional logic combining the individual pointcut conditions. – Wrong type, method, field, or constructor pattern in pointcut. In particular, the use of * as a pattern wildcard or in string matching easily leads to too many join points. Furthermore, if the underlying classes are modified or extended, the wildcard may become erroneous without the compiler being able to notice this. Faults in advice will result in the wrong action at a certain point of execution. Such faults include: – Wrong advice specification (using before instead of after, using after with the wrong argument, etc.). – Wrong or missing proceed in around advice. – Wrong or missing advice precedence. – Advice code causing a method to break its class invariant or to fail to meet its postcondition. The fault model above states that aspect weaving should not conflict with class invariants or method pre- and postconditions. The safe route to follow is that class resulting from weaving is a proper subtype of the original class. Put in terms of design by contract, the class invariant of the resulting class cannot be weaker, its method preconditions cannot be stronger, and the postconditions cannot be weaker. Typical examples are “harmless” aspects which add logging or tracing. In this situation, existing code using the class need not be aware that new functionality has been woven into it. In other words, the test suite for the original classes should pass on the classes extended by introduction or advice as well, and doing so will help to find faults originating from improper extensions. An alternative route is that the aspect actually modifies the contract in a way that conflicts with the inheritance rules from design-by-contract. This may include changes in method pre- or postconditions, and may thus require weaving in additional code at all affected call sites. A typical example is an aspect that adds security checks: this may lead to additional exceptions which at some point should be handled in the original 5 application. Faults in this approach will not be restricted to the newly woven class, but may be at any call site in the application. This setting is much harder to test and immediate reuse of the test suite will not be possible. Similar distinctions are made by Clifton and Leavens [7], who discuss the relation between behavioral subtyping and aspect weaving, and distinguish observers from assistants. Rinard et al [34] classifies interactions between woven code and the original code, recognizing augmentation, narrowing, replacement, and combinations between them. The key concern of these authors is modular reasoning: in our setting it is modular testing, and reuse of test suites to woven classes. 2.3 Aspect-Oriented Test Adequacy A test adequacy criterion prescribes the elements of the implementation under test that need to be exercised by a test suite. The coverage achieved by a test suite is the percentage of elements actually exercised. In this section we formulate adequacy criteria for aspects targeting the faults presented in the previous section. Due to the mixed nature of an aspect definition, which can address both static and dynamic crosscutting using pointcuts, intertype declarations, and advice, it is not so easy to obtain a single criterion that allows us to make meaningful statements of the form “we have tested 75% of this aspect”. Instead, we will define different criteria for the various elements in an aspect definition. Introducing a new method m in a class C is akin to directly adding the method to C. Therefore, normal coverage goals such as statement or branch coverage apply. However, as we have seen in the fault model, the most powerful and dangerous introductions are those where polymorphic methods are added. Therefore, adequacy criteria explicitly based on exercising all possible polymorphic bindings are in place as well. Rountev et al [35] include an up to date overview of criteria for polymorphic bindings. They distinguish the all-receiver-classes criterion which requires exercising all possible classes of the receiver object at a call site, and the all-target-methods criterion which requires exercising all possible bindings between a call site and the methods that may be invoked by that site. The intertype declaration of a new supertype or interface for a given class changes the inheritance hierarchy it belongs to. This, again, calls for adequacy criteria taking polymorphic calls into account. Observe that these adequacy criteria take into account all call sites within the rest of the application. Thus, polymorphic coverage goals are not just a percentage of the aspect definition itself, but a percentage of how well affected call sites are covered. To deal with adequacy for pointcuts, we will say that a test case T exercises a pointcut P if T activates advice at a join point captured by P . An adequate test suite for a pointcut should maximize our chance of finding errors in the pointcut. We distinguish primitive pointcuts and compound pointcuts built from conditional operators. Primitive pointcut operators (such as call, cflow, and so on) can capture a multitude of join points. Which of these should we ensure we execute in order to maximize our chance of finding errors in the pointcut? In most cases we cannot answer this question, so an arbitrary join point will do. For signature or type matching involving 6 wild cards, we can arrive at the equivalent of traditional boundary testing by ensuring we have one case where the asterisk matches the empty string, and one where its match is non-empty. When matching types in a hierarchy, for example in a call(* Class+.*) expression, the class named is a boundary. Using the one × one criterion [4] insisting on one point on the boundary, and one just outside it, we would obtain one test case for Class, and one for each immediate superclass (interface) above it in the hierarchy. Tests for pointcut expressions composed from multiple conditions should exercise every relevant condition combination. In traditional testing, the most rigorous approach is to test each true/false combination, leading to 2N test cases for an expression with N conditions. Alternatively, the Each-Condition/All-Conditions criterion can be used which leads to N + 1 test cases by insisting on one test case for each condition making that condition true and all others false, in addition to one making all conditions true (for and logic, replacing true and false for or logic) [4]. Pointcut logic, however, is different from normal Boolean logic, for example in that certain operators (such as target) are primarily meaningful in combinations with others. Moreover, there are typical idioms for using pointcuts, such as a sequence of a general pointcut (such as all public calls) conjuncted with several exceptions (each using the negation operator) for classes or methods that are to be excluded from the pointcut. Test adequacy for advice itself can again be based on branch or statement coverage. It is most natural to compare advice with a method that is called at relevant join points. Thus, to achieve branch coverage for the advice, we do not need to exercise all branches at every join point: it suffices to find one join point at which we exercise all branches. Furthermore, it is natural to insist that each join point at which the advice is activated is exercised. Typically, a test suite achieving statement coverage for the full unwoven application will get a far way in covering all join points. One may be tempted to think that covering all captured join points also achieves adequate pointcut coverage. This, however, is not the case, since the pointcut may be defined as a complex expression, parts of which are used to prevent firing at a particular join point. Last but not least, there may be (abstract) reusable aspects whose pointcuts do not refer to particular (named) classes or methods they should be woven into. To test such aspects, a stub application needs to be created, to which the aspect can be applied. When creating these stubs, the test adequacy issues presented above can be used as a guideline, ensuring for example that it is indeed possible to exercise all conditions in the pointcut. As far as we can see, reusable aspects themselves provide no further test adequacy constraints. 2.4 The B ETTAR Testing Strategy The test strategy combining the fault model and various adequacy criteria consists of three steps: Responsibility-Based Testing (Black Box): Create or identify a functional test suite for the concern at hand. Focus on answering the question whether the implementation of the concern does what it is supposed to do. 7 Risk-Based Testing (Grey Box): Use the fault model to refine the test suite so that faults due to the refactoring process as well as the (aspect-oriented) target solution are most likely to be captured. Source-Based Test Adequacy Validation (White Box): Inspect the coverage of the test suite developed so far (either by running it on instrumented code or by manual analysis), and verify that relevant test adequacy criteria are indeed met. If not, return to the previous steps to create additional responsibility- or risk-based test cases until the adequacy criteria are fullfilled. If the refactorings do not affect the external interfaces of the classes under test, the test suite can be applied to both the original and the refactored system. This has the advantage that one can be certain that each new test also successfully passes on the old implementation. If refactoring does require making adaptations to the test suite, the following approaches are possible: – Refactor the test suite so that it exercises more global functionality instead of invoking the modified methods directly, making it more robust to future implementation changes but potentially making it harder to achieve the desired coverage; – Apply an additional refactoring to the application offering for example an additional interface abstracting away from implementation differences between the original and target solution; – As a last resort, we could give up on our attempt to apply the test suite to the original system, and apply new tests to the new system only, thereby losing them as safeguard against behavior modification during refactoring. In our case study we were never forced to do this, and could always refactor the test suite to permit testing of both versions. 3 AJ HOT D RAW: An Open Source Aspect-Oriented Showcase To experiment with the feasibility of adopting aspect-oriented solutions in existing software and demonstrate the strategy proposed earlier, we have created AJ HOT D RAW: an aspect-oriented refactoring of JH OT D RAW,3 a relatively large and well-designed open source Java application. In order to allow other researchers to benefit from our work and to enable comparative software evolution research on a real-life aspect-oriented system, we decided to release AJ HOT D RAW as an open source project.4 The next sections give a description of the case study and motivate the choice for both the application and the refactoring language. 3.1 The JH OT D RAW Drawing Framework JH OT D RAW is a (GUI-based) framework for drawing technical and structured 2D graphics. The application was originally developed as an exercise to show a good use of 3 4 jhotdraw.org, version 5.4b1 ajhotdraw.sourceforge.net Note for the reviewer: we are currently in the process of cleaning up our refactored code, upgrading it to JHotDraw 6.0, and moving it to the sourceforge server (see the release plan on sourceforge). Our internal version is available upon request. 8 object oriented design patterns in a Java implementation. The fact that JH OT D RAW is considered a well-designed application makes it an ideal candidate for aspect-oriented migration as it is unlikely that evolvability improvements can be made otherwise. The version of JH OT D RAW analyzed consists of approximately 40,000 lines of code, 300 classes, and 2800 methods. The JH OT D RAW editor comprises drawing tools, a set of user defined (geometrical, image, text, etc.) figures, drawing views, and a collection of (tool and menu-associated) commands. A number of additionally supported features include (re-)storing drawings (from/)to storage devices, undo/redo activities for commands, and animation functions. 3.2 Evolving a JH OT D RAW Test Suite The version of JH OT D RAW under study was shipped without a test suite. At the time of writing, the most recent version (v6.0beta1) has a number of empty test classes, automatically generated using a Java doclet. The intent is to fill them with test cases, but so far these have not been made available.5 To safeguard our refactorings, we have developed our own functional test cases on a by need basis. Since we were, initially, not familiar with the JH OT D RAW code, the development of these test cases served as our program comprehension strategy ([10]): We formulated hypotheses on JH OT D RAW’s implementation, expressed them as test cases, and then attempted to refute them by running these test cases. The test suite that was developed passes on the original, pure object oriented version of JH OT D RAW, as well as on AJ HOT D RAW, the refactored, aspect-oriented version. Our test suite is based on the JUnit framework [3]. Moreover, where needed, we make use of Java 1.4 assertions to ensure that the alterations did not break invariants or pre- and postconditions. Since we did wanted to minimize the number of changes to the JH OT D RAW code, we injected these assertions by means of aspects. For ensuring invariants, the aspect contains an inter-type declaration giving relevant classes a boolean invariant method, as well as a pointcut ensuring this method is indeed checked before and after each public method. Observe that the assertion aspects are independent of our test suite, and can be woven into the production version of JH OT D RAW as well in order to simplify debugging. 3.3 AJ HOT D RAW Organization AJ HOT D RAW is organized into two parts: (1) the main project is the A SPECT J implementation of the system, where the identified crosscutting concerns are refactored to aspects; (2) the test subproject (JHDTest) comprises all the test cases aimed at ensuring equivalence between the the original Java solution and the refactored A SPECT J one. The aspects are put in separate packages, one per concern. Changes to the original files are restricted just to removing concerns that have been migrated to aspects. 5 We have agreed with the JH OT D RAW maintainers that our test suite will be integrated in their project. 9 The tests suite can be compiled with and executed on the archived binary files (jar) of any of the two solutions. Building and executing the test suite is automated using A NT.6 4 Refactoring of Selected Concerns from JH OT D RAW Previously, we have employed fan-in analysis for the identification of crosscutting concerns in JH OT D RAW [29]. This resulted in 10 types of concerns that were candidates for refactoring into an aspect. In this section we discuss three of these concerns (persistence, contract enforcement, and undo) in considerable detail, covering the B ETTAR steps aspect design, refactoring design, and test suite design. A transparent, gradual process of refactoring is important for building confidence in the aspect-oriented solution. Therefore, our refactorings aim at maintaining the conceptual integrity and stay close to the original design. An additional advantage of this approach is that this preserves the understandability of the refactored system for the original maintainers. 4.1 Refactoring The Persistence Concern Aspect Design Drawings in JH OT D RAW are collections of figures that can optionally be stored and recovered (write/read operations) by the application. The concern denoting this functionality, persistence, is defined by the Storable interface that declares two methods, write(StorableOutput) and read(StorableInput). The entire hierarchy of storable elements in a drawing comprises 94 interfaces and classes, of which 40 belong to the Figure class hierarchy. Because the persistence concern is already distinguished in the original design, refactoring it to an aspect is fairly straightforward. The aspect can use introductions in order to have the persistent elements of a drawing (e.g., figures) implement the Storable interface. If not all variables comprising the state of the class are accessible through public getters and setters, the aspect will need access to private members as well. The A SPECT J way to achieve this is by declaring the aspect privileged. The implementation of the Storable interface also implies an interesting enforcement constraint: “Objects that implement this interface and that are resurrected by StorableInput have to provide a default constructor with no arguments.” This constraint cannot be enforced by A SPECT J. A similar situation occurs when refactoring bean objects (see the “Bean Aspect” example in [2]) that must define no-argument constructors. A concern related to persistence is serialization, which in JH OT D RAW is also implemented for the Figure hierarchy. According to Java API specification, classes requiring special handling during de-serialization, such as a number of figures in JH OT D RAW, must implement a special private method (readObject(ObjectInputStream)). A SPECT J does not support introduction of private members into target classes. The visibility of the inter-type declarations relates to the aspect and not to the target class. Although 6 ant.apache.org 10 already acknowledged as a shortcoming (see [2]) the language interpretation of visibility prevents a consistent refactoring of similar kinds (persistence and serialization) of crosscutting concerns. A summary of the various issues is provided in Figure 1. Refactoring Design The refactoring itself is fairly straightforward, and just consists of moving read and write method implementations to the persistence aspect. The complete refactoring of the persistence concern can generally be described as Extract Interface Implementation as discussed by [22]. Old situation Aspect solution Objects requiring persistence implement the Storable interface. Implementation of Storable interface moved to aspect by means of introductions. Code size Remains the same Benefits All persistence related code in one aspect; classes oblivious of whether they can be made persistent. Risks Encapsulation broken since persistence aspect requires privileged access. A SPECT J issues Zero-argument constructor cannot be enforced; Private methods cannot be introduced. Fig. 1. Refactoring of the Persistence Concern Test Suite Design Testing the persistence aspect is relatively simple. We nevertheless discuss it in some detail, since the way of testing can be reused for other more complicated concerns that we will discuss next. When refactoring persistence to an aspect we run a number of risks: The first is that in our aspect, we accidentally introduce a read or write method body for a given figure in the wrong class. The second is that we make an error when copy-pasting the body of a method to an aspect. Last but not least, our removal of the persistence code from, e.g., figures may be incomplete. In order to test persistence we proceed as follows: First, we create a top level StorableTest class, which has a test method that (1) creates a Storable (typically a figure), (2) writes it to a stream, (3) reads it back into a different object, and (4) checks the equivalence between the two. Next, the creation of the actual figure is deferred to subclasses of the StorableTest class using a virtual factory method. Thus, the test hierarchy mimics the hierarchy of classes to be stored. Finally, our equivalence checking method should be based on structure, not on object identity. Such a method is not included in the JH OT D RAW implementation. We injected this method into the class hierarchy using an aspect. Observe that a collection of static equivalence methods included in, for example the test class, would not work, since the equivalence method must be polymorphic – which can be achieved by means of introductions in an aspect but not by means of static methods. This strategy implements Binder’s Polymorphic Server Test test design pattern [4]. It can be used to verify that subclasses conform with superclass behavior, and that we are 11 setting up a correct polymorphic hierarchy. It requires exercising each superclass test case to every possible subclass. In other words, we can reuse the write-read-compare test case for every subclass of Storable. 4.2 Contract Enforcement in Commands Aspect Design JH OT D RAW makes use of the Command design pattern in order to separate the user interface from the underlying model, and in order to support such features as undoing and redoing user commands. Each command has to realize the Command interface, for which a default implementation is provided in the AbstractCommand class. The key method is execute, which takes care of actually carrying out the command (such as pasting text, inserting an image, etc.). Each execute method should start with a consistency check verifying that the underlying “view” exists. Therefore, each concrete implementation of execute starts with a call to the execute implementation in the superclass, which is always the one from the AbstractCommand. This is illustrated in Figure 2. public class AbstractCommand implements Command { ... public void execute() { if (view() == null) { throw new JHotDrawRuntimeException( "execute should NOT be getting called when view() == null"); } } } public class PasteCommand extends AbtractCommand { ... public void execute() { super.execute(); ... } } Fig. 2. Contract Enforcement using a super method idiom. This is a typical example of what is called “contract enforcement” in the A SPECT J manual [2]. We implemented it using a pointcut capturing all execute methods, putting the check itself in the advice. Observe that mimicking the implementation where the check is in a super method is not possible in A SPECT J: super methods cannot be accessed when advising a method. The resulting solution is shown in Figure 3. The only surprise in this figure may be the within clause in the pointcut. It turns out that anonymous subclasses of AbstractCommand do not implement the consistency check. Such classes are used for simple commands such as printing, saving, and exiting the application. Since A SPECT J does not provide a direct way to exclude anonymous classes in a pointcut, we used the within operator to exclude executions occurring in the context of the top level object creating the full user interface. One can also argue that the anonymous classes should include the check (in which case the exclusion can be omitted from the pointcut), but at present we focus on keeping the behavior as it was, not on modifying it. 12 pointcut commandExecute(AbstractCommand aCommand) : this(aCommand) && execution(void AbstractCommand.execute()) && !within(*..DrawApplication.*); before(AbstractCommand aCommand) : commandExecute(aCommand) { if (aCommand.view() == null) { throw new JHotDrawRuntimeException("..."); } } Fig. 3. Enforcing the consistency check using before advice. The main benefit of the aspect approach is that consistency checks cannot be forgotten. This is illustrated by the anonymous classes, but also by one non-anoymous command,7 which does not extend the AbstractCommand default implementation. Consequently, it cannot reuse the consistency check using a supercall. Inspection of the execute implementation, however, clearly shows that the code exits with a null pointer exception in case the check fails. This suggests that the aspect that we are looking for should implement the check not only for the AbstractCommand class, but for all implementations of the Command interface. Again, our current implementation does not yet do this, but only injects the implementation in subclasses of AbstractCommand. A summary of the main issues in the Contract Enforcement refactoring is provided in Figure 4. Old situation Each concrete execute invokes its super execute in order to conduct certain consistency checks. Aspect solution The consistency check is implemented as advice, which is invoked before each call to execute, as captured in a simple pointcut. Code size 17 explicit consistency calls replaced by one pointcut; consistency check itself moved from class to advice. Benefits Reliability: it becomes impossible to forget the consistency check. Omitted checks can be fixed automatically thanks to the refactoring. Risks Check required that omissions are not on purpose. A SPECT J issues No direct support to capture anonymous classes; Cannot refer to super methods in method advice. Fig. 4. Refactoring Contract Enforcement for Commands. Refactoring Design The restructuring can generally be described as an Advise Method Overrides refactoring, as presented in Section 5. Test Suite Design Simple as the pointcut in Figure 3 may be, it nevertheless illustrates some of the issues involved in testing refactorings that make use of pointcuts. 7 Namely, the UndoableCommand. 13 First of all, adequate testing of the consistency check in the original (non-aspect) JH OT D RAW version would typically correspond to branch coverage. This yields two test cases for the top level execute method (one in which the consistency check passes, and one in which it fails) in addition to one dedicated test for the execute implementation in each subclass. Since the super call can be resolved statically, even polymorphic adequacy models will not add test cases to this. It is interesting to observe that such a test suite would not capture the subtleties involved in designing the aspect from Figure 3. For example, the test suite does not exercise anonymous classes, nor execute methods occurring outside the scope of AbstractCommand. The aspect-specific test adequacy criteria as discussed in Section 2.1, however, do suggest creating the relevant additional test cases. Inspection of the pointcut leads to the following tests: – Since AbstractCommand occurs in a type match, we would like to test classes just off this boundary as well, leading to a test case checking what happens for the Command interface itself. – Since the pointcut is a conditional expression, we also want to investigate what happens if one of the conditions fails. This means that we want to verify that the within clause does fire for anonymous classes. Actually creating these test cases may, however, not be as easy as it seems. Testability is affected by controllability and observability, which are poor for anonymous classes and join point execution. In order to verify (observe) that our pointcut from Figure 3 does indeed capture anonymous classes correctly, we created special advice used for testing purposes only, which keeps track where a certain pointcut expression has fired. To do this, we first refactored the aspect so that the individual conditions are in separate pointcuts, as shown in Figure 5. The production aspect uses these pointcuts to perform the consistency check at the right places. The testing aspect uses exactly the same pointcut definitions to weave in code that keeps track of where (i.e. at which joinpoints) those pointcuts have fired. This set of joinpoints is then used to verify intended behavior. abstract aspect ContractEnforcementPointcut { pointcut commandExecute(AbstractCommand aCommand) : this(aCommand) && inExecuteMethod() && ! inAbstractClass() pointcut inAbstractClass() : within(*..DrawApplication.*); pointcut inExecuteMethod() { execution(void AbstractCommand.execute()); } } Fig. 5. Separate pointcuts for each condition to improve aspect testability. 14 Concerning controllability, the instances of the anonymous classes are hard to access. They are normally activated via a mouse event, which must be mimicked in order to trigger the command’s execute method. We avoided the need for generating mouse events by using an aspect: we intercept the constructors for anonymous command classes, and collect them in a set: after the full application has been built we can apply the execute method to each command. 4.3 Refactoring the Undo Concern Background and Current Approach Support for “undo” is a newly added feature in the analyzed version of JH OT D RAW. As can be imagined, it is a concern that crosscuts across many different classes. More than 30 elements of the JH OT D RAW framework, comprising commands, tools and handles, have associated undo constructs to revert the changes spawned by their underlying activities. The discussion here will focus on the commands group, as it is the largest in terms of defined undo activities. Some participants in JH OT D RAW’s undo implementation are shown in Figure 6: – Each command is associated with one undo activity, whose method undo can be invoked to revert the command. – The undo activity is implemented in a nested class of the command, which is instantiated using a factory method called createUndoActivity. – The primary abstraction in the undo activity is the list of affected figures: when the command’s execute method is invoked, the relevant state of the affected figures is stored in the undo activity. – Undo activities are maintained on a stack by the undo manager. DrawingEditor UndoManager * <interface> Command execute() createUndoActivity() undoActivity AbstractCommand ConcreteCommand <interface> Undoable undo() * affectedFigures UndoableAdapter has nested class ConcreteUndoable Fig. 6. Participants in JH OT D RAW’s undo implementation. 15 Figure public class PasteCommand extends FigureTransferCommand { public void execute() { ... FigureSelection selection = (FigureSelection)Clipboard.getClipboard().getContents(); if (selection != null) { setUndoActivity(createUndoActivity()); ... //core command logic and other undo setup FigureEnumeration fe = insertFigures(...); getUndoActivity().setAffectedFigures(fe); ... } } } Fig. 7. The original PasteCommand class. Aspect Design The aspect solution to undo we propose consists of associating an undodedicated aspect to each undo-able command. The aspect implements the entire undo functionality for the given command, while the associated class remains oblivious to its secondary concern. By convention, for enforcing the relation with the command class, each aspect will consistently be named by appending “UndoActivity” to the name of the command class. In a successive step, the command’s nested UndoActivity class moves to the aspect. The factory methods for the undo activities (createUndoActivity()) also move to the aspect, from where they are introduced back into the associated command classes using inter-type declarations. The statements in the execute method that are responsible for setting up the undo activity, are taken out of the execute method, and woven into it by means of advice. In some cases the corresponding pointcut simply needs to capture all execute method calls; in other cases the pointcut is more complex, depending on the way the undo code is mixed with the regular code. As an example, consider the paste command, whose execute method consists of retrieving the selected figures from the clipboard, inserting them into the current view, and clearing the clipboard. All this is done in a single method, using local variables and if-then-else statements to deal with such situations as an empty clipboard. The undo aspect will require the same conditional logic, and access to the same data in the same order. The following aspect solutions are possible: – If all getters are side effect free, an approach is to setup the undo activity in a simple before advice. In JH OT D RAW, however, this is not the case, for example because of figure enumerators that have an internal state. – The alternative route is to intercept relevant getters, keep track of the data locally in the advice as well, and inject advice after all data has been collected. This is the approach we follow, but some of the pointcuts are somewhat artificial. Figure 8 illustrates such a pointcut in the undo aspect for the PasteCommand, which is also shown in figure 7. The execute callClipboardgetContents() pointcut captures the call that sets the reference to be checked by both the command’s core logic and the undo functionality in the aspect. – The last possibility is to refactor the long execute method into smaller steps using non-private methods. The extra method calls can be intercepted allowing smooth extension with setting up the undo activity, at the cost of creating a larger interface and breaking encapsulation. 16 public aspect PasteCommandUndoActivity { //store the Clipboard’s contents - common condition FigureSelection selection; pointcut execute_callClipboardgetContents() : call(Object Clipboard.getContents()) && withincode(void PasteCommand.execute()); after() returning(Object select) : execute_callClipboardgetContents() { selection = (FigureSelection)select; } ... pointcut executePasteCommand(PasteCommand cmd) : this(cmd) && execution(void PasteCommand.execute()); } // Execute undo setup void after(PasteCommand cmd) : executePasteCommand(cmd) { // the same condition as in the advised method if(selection != null) { cmd.setUndoActivity(cmd.createUndoActivity()); ... cmd.getUndoActivity().setAffectedFigures(...); } } Fig. 8. The undo aspect for PasteCommand. The resulting system differs in two ways from the original design. First, the original design uses static nested classes to enforce a syntactical relation between the undo activity and its enclosing command class. Since the A SPECT J mechanisms do not allow introduction of nested classes, the post-refactoring association will only be an indirect one, based on naming conventions. This is a weaker connection than the one provided by the original solution. A second difference is that the visibility of certain methods has been altered, since A SPECT J cannot be used to introduce, for example, the required factory method as protected. Refactoring Design The complexity of the refactoring is determined by the complexity of unplugging undo from the commands themselves. We distinguish different levels of unpluggability: 1. The nested undo activity class of the command, and all its uses can be safely removed from the command. The fairly simple ChangeAttributeCommand class is an example in this category. 2. The command’s core logic makes use of some of the data stored in the undo activity. This is typically done for the list of affected figures. Since there is no real need for this, we could easily refactor the core logic so that it does not refer to the undo activity anymore. 3. The nested undo activity not only deals with undo, but also contains core logic needed for the proper execution of the command. An example is the InsertImageCommand: its undo activity contains a method called insertImage which actually inserts the image (instead of undoing it). We consider this a design violation. Our solution consists of applying traditional refactorings before starting with the aspect refactoring, so that the command does not depend on the undo activity anymore. 17 4. The nested undo activity is not only used for this particular command, but also for similar commands. This is the case for the PasteCommand. Our aspect refactoring will rename the undo activity, and hence requires a simple change to these commands. We anticipate that any non-trivial aspect refactoring will require similar objectoriented refactorings, before the crosscutting concern can be taken out of the available system. A more detailed discussion of the undo concern refactoring, accompanied by code snippets, is presented in [28]. Old situation Each command’s execute sets up a corresponding undo activity, which is implemented through a nested class. Aspect solution One aspect per command, which contains the undo activity implementation, and introduces the association into the command. Execute method intercepted to setup the proper undo activity state. Code size Remains the same. Benefits Strong tangling between commands and their undo activity eliminated; commands are easier to understand. Risks Undo activity may require sophisticated pointcuts to intercept all relevant state modifications of the command; Refactoring of commands needed in order to unplug undo support from them. A SPECT J issues No support for introducing nested classes. Visibility affected since protected methods cannot be introduced. Modular reasoning affected by keeping track of data set in the advised method. Fig. 9. Refactoring Undo. Test Suite Design In testing undo, we essentially combine the testing approaches of the persistence and contract enforcement concerns discussed previously. First of all, we create a reusable test suite at the Command level. This test can be used for any command subclass, and ensures that each subclass complies with then intended semantics. This test set takes care of: – Setting up an appropriate JH OT D RAW application in which a concrete command can be created. The actual command created is deferred to subclasses of the test class. – Bringing the application in a setting in which the execute can be carried out (for example, many commands require that some figures in the drawing are selected), and actually invoking it. – Comparing the effects of the command execution with the intended behavior — this step is specific to the actual command and deferred to subclasses. It usually consists of comparing the modified selected figures with a set of figures actually constructed in the test case. – Invoking the undo method on the command’s undo-activity, and comparing that the effects are indeed canceled. Again, this comparison typically involves the set of affected figures. 18 Thus, the test case follows the template method design pattern, and defers the details of certain steps to its subclasses. To test the various pointcuts, the approach described for contract enforcement was adopted, weaving in special advice that allowed us to observe which pointcut actually fires. 5 Contributing to the Catalog of Refactorings Several authors have proposed catalogs of aspect-oriented refactorings [22, 31, 32], in the spirit of Fowler’s catalog of object-oriented refactorings [14]. We were able to reuse several of these existing refactorings, such as Monteiro’s Encapsulate Implements with Declare Parents, and Move Method from Class to Inter-type, or Laddad’s Extract Method Calls refactoring which encapsulates calls to a method from multiple places into an aspect. In this section we add our contribution to these existing catalogs, casting some of the experiences we obtained from building AJ HOT D RAW into generally reusable refactorings. An open question is at what level of abstraction such refactorings should be defined. Is introducing some design pattern considered a refactoring? It is, but Fowler’s book has explicit refactorings described for just a few design patterns, not all. The reason for this is, most likely, that the mechanics for introducing such a design pattern can hardly be described in a reusable way, and for that reason the refactoring description would not add much useful information to the pattern description. In this respect an interesting approach is taken by Kerievsky [21], who explicitly addresses refactorings to patterns. He focuses on a subset of the design patterns, namely those for which common coding tricks are known that do not yet provide the benefits of using the full pattern, such as in his Replace Hard-Coded Notifications with Observer refactoring. A similar distinction holds for aspect refactorings. Introducing refactorings for each of the prototypical concerns listed in, for example, the A SPECT J programming guide [2] may not be particularly useful. But in some cases, the “old”, non-aspect solution can be reasonably well described (for example an Observer implementation following the guidelines from [15]), and it does make sense to describe how such an implementation can be refactored into an aspect solution (such as the one from [19]). If we look at the refactorings from Monteiro, these can be categorized as fairly technical, elementary refactorings, such as introducing an inter-type declaration [31]. The refactorings from Laddad [22] are more of a mixed style, some being elementary, others being closer to typical concerns from the A SPECT J manual. Below we try to provide some building blocks for creating refactoring descriptions that give concrete advice how certain concerns can be turned into aspects. Move Role to Aspect Though not discussed in the previous section, several of our refactorings involve the creation of an aspect-oriented implementation of a design pattern. As an example, JH OT D RAW contains several instantiations of the Observer pattern, which we essentially implemented according to the approach proposed by Hannemann and Kiczales [19]. 19 The participants in this pattern can be an observer or a subject. The existing JH OTD RAW implementation does have a separate interface for the observer role, but not for the subject role. We propose to refactor this and introduce a subject interface via an aspect in order to: (a) make the two different roles explicit, and (b) remove the observer pattern details from the primary concerns. Note that in some cases, one class can be involved in multiple design patterns adopting different roles for them. For example, a composite figure is a subject as well as an observer, listening to changes in its subfigures while being listened to by, for example, drawings. The total number of methods implemented by such multi-role classes can be substantial, making them hard to understand; a problem addressed by moving the roles to aspects. Thus, Move Role to Aspect creates an interface for a particular role in a design pattern, and superimposes this role on an existing class by means of an aspect. Move Observer to Aspect A more high level refactoring is to move an observer implementation into an aspect. This is a compound refactoring, involving three elementary steps: first, the Move Role to Aspect refactoring is applied twice, once for the subject and once for the observer role. Subsequently, the calls made in subjects to notify the observers of changes are captured into a pointcut and extracted into advice. Override Method with Advice for Overlapping Roles Just like one class can fullfil multiple roles from one or more different design patterns, one method can implement features related to multiple roles. This is common in Java Swing design and also occurs in one of our JH OT D RAW refactorings. This refactoring dealt with the CommandMenu, which acts as both view and controller for the interactive drawing editor of the application. The method exhibiting the overlapping roles, checkEnabled(), enables/disables menu items according to the status (executable/non-executable) of the command to be activated when the item is selected. Although the method belongs to the interface of the view component, allowing to set the view’s elements status, its implementation relies on controller decisions. The proposed refactoring places the method’s definition into the interface for the role to which it belongs, in this case, the view role, making it accessible to the developer of the GUI. Furthermore, the controller aspect uses an around advice to override the default behavior of the method and to make it context(command)-aware. Advise Method Overrides This refactoring aims at removing duplication arising from statements that are common to (the start or end of) all method overrides of a given (superclass) method. Such statements are replaced by advice to any refinement of the superclass method. Examples in JH OT D RAW include the contract enforcement we discussed previously (the check at the beginning of each execute method), as well as a call to the checkDamage method that is contained at the end of each execute method. 6 Discussion What did we learn from refactoring JH OT D RAW to aspects and validating behavior conservation by means of testing? 20 First of all, we once again learned that testing is actually needed for such refactorings. In several cases, we detected errors in our pointcuts, introductions, and copy-paste activities thanks to our test suite. Although all of us will agree with this need for testing, it is alarming, to say the least, that neither the popular textbooks on aspect-oriented programming (such as [23, 2, 16]) nor the existing work on aspect-oriented refactoring [22, 32] provides any advice on how to approach aspect-oriented testing in a systematic way. Second, our fault model as well as our adequacy criteria illustrate how easy it is to make errors during aspect-oriented programs, and how much needs to be done in order to have a reasonable chance of finding these errors using tests. Moreover, both the observability (did this pointcut fire?) and the controllability (which inputs will cause a pointcut to be exercised?) of aspect-oriented programs typically are problematic. Admittedly, at several points in time we were tempted to omit the testing since it seemed too complicated to create a test suite capable of achieving the required coverage. Testing tool support may very well help here: but this requires an adequacy model first, which is what we proposed in the paper. Concerning the refactorings themselves, our experiments illustrate that being oblvious to future extensions is not as easy as it may seem. For example, the undo concern was added only in version 5.4 of JH OT D RAW. Could this have been implemented as a separate aspect without modifying JH OT D RAW version 5.3? Our refactoring shows the direction this would take. But for some commands, such as the paste command, artificial pointcuts are needed, which are very brittle if the underlying primary logic in the command changes. For most cases, assessing the benefits of an aspect-oriented refactoring turned out to be a fairly subjective process that is hard to quantify. The aspect design step looks for such solutions that would enhance the system’s evolvability; that is, to achieve a better modularization for the, otherwise, scattered and tangled parts of a concern, and to provide an implementation that better reflects the concern-based reasoning over the system. It is not always apparent, however, in the context of a (relatively) large system as the analyzed case study, that the new, aspect solution surpasses the legacy one. Although we argue to have improved the separation of concerns, for some more complex refactorings, e.g, undo, the downfalls of the aspect-oriented implementation make it difficult to asses the improvements for the overall system, or even the gains in modular reasoning over the refactored crosscutting concern. Difficulties could also occur for less demanding refactorings as for example, contract enforcement, depending on the uniformity of the places where the contract needs to be enforced. Last but not least, it is striking that almost every refactoring we experimented with raised one or more issues concerning A SPECT J (such as visibility modifiers, nested classes, or anymous classes). Some of these limitations are quite technical in nature, and are likely to be resolved in future versions of A SPECT J. Also, other aspect-oriented frameworks, such as AspectWerkz 28 , may offer solutions to some of the issues. Other limitations are more fundamental (such as the constraint that a class should offer a zero-argument constructor or the inability to access super methods), and call for a more rigorous reconsideration of existing aspect-oriented models. 8 aspectwerkz.codehaus.org 21 7 Related Work An important part of research into the area of refactoring to aspect-orientation has analyzed aspect solutions to a number of (sometimes complex) concerns that typically crosscut the primary decomposition of a system [22, 19, 23]. The association between the concern and its aspect solution is an important indication of how a specific language model is intended to address types of crosscuttings. However, the specific implications of applying the refactorings in the context of a large system, where deviations from the examples used to describe the refactorings are very likely, are not considered. In this paper we showed some of the difficulties that arise when these solutions are applied to concerns in a large system. A number of authors investigated the possibility of building catalogs of aspect refactorings. Monteiro and Fernandes [32] proposed a set of code transformations from Java to A SPECT J specific modularization units, describing steps in a feature extraction process. The approach has followed the format used by Fowler [14] to describe objectoriented refactorings, and was further significantly extended [31]. The study emphasized the mechanics associated to code transformations as opposed to the relation with typical crosscutting concerns [22, 2, 19]. A similar list is also proposed by Iwamoto and Zhao [20], but the authors do not provide details about any of the specific refactorings. The attention tends to focus on potential conflicts between the aspect refactorings and the traditional, object-oriented ones. This issue is also addressed by Hanenberg et al [17], as well as Hannemann et al, who discuss the possibility of a refactoring approach based on a developer-tool dialog [18]. Specific techniques, like program slicing, are employed by Ettinger and Verbaere [13] to extract tangled code into method and further into advice, as an extension of the object-oriented refactoring to aspects. Closely related to the work described in this paper, Coady et al investigate the benefits of aspect-oriented solutions for evolving operating system code and for better managing its variability [8, 5]. To that end they describe, for example, how the prefetching concern can be separated from the page handling code in the FreeBSD kernel code [9]. Although their work aims at assessing the benefits of aspect-oriented software development, in contrast to the work presented in this paper, it has not led to a publicly available aspect-oriented and non-aspect-oriented version of the same software system which can be used for comparative experimental software evolution research by other researchers. However, none of this refactoring work mentions a testing strategy that accompanies the migration process. The attention given to testing in the context of aspect-orientation is limited and not with concerns to refactoring. Few published test adequacy criteria for aspect-oriented programming have been formulated: the only work we are aware of is by Alexander et al, who propose a candidate model and raise a number of research questions [1]. Ubayashi and Tamai [37] use model checking to verify object crosscutting properties in aspect-oriented programs. As a first attempt to define an approach for testing aspect-oriented programs, Zhao [39] proposes a data-flow-based unit testing. The tests are oriented towards aspect and class modules that can potentially be targeted by multiple aspects. Based on the modules’ accessibility three levels of testing are considered, i.e., intra-module, inter-module, and intra-aspect or intra-class. 22 8 Concluding Remarks Refactoring to aspect-orientation aims at improving the evolvability and reusability of a system. Important issues to be considered in this context are (1) the adequacy of the aspect solutions discussed by a number of authors when applied to a large application, (2) the assessment of the support for and improvements brought by refactoring to aspects, and (3) the challenges of behavior conservation when migrating to aspect-supported implementations. This paper addresses these problems by proposing a refactoring and testing strategy to guide the migration process, and successively by applying it to an open source Java system. The testing strategy aimed at ensuring migration consistency, introduces an aspect-oriented fault model and adequacy criteria. Further, aspect and refactoring designs are analyzed for selected concerns in the system under investigation, which also include new, complex examples of crosscuttings. The analysis consists of a proposed aspect solution, associated validating tests, and a trade-off review of the pre- and postrefactoring implementations. The difficulties in assessing overall improvements due to refactoring are turned into considerations about the suitability of the language features and model for better supporting the types of identified crosscutting concerns. We believe that the development of aspect languages could benefit from catalogs that associate types of crosscutting concerns to language mechanisms, and we provide further input for such catalogs. The paper’s main contributions are (1) an aspect-oriented fault model and adequacy criteria; (2) a refactoring strategy that emphasizes testing and the use of aspect-oriented solutions; (3) a detailed discussion of aspect refactorings and their testing implications, as carried out on an existing system; and (4) the initiation of an open source project that can be used to experiment with aspect-oriented testing and refactoring, and that can be used to compare an object with an aspect solution. The work described in this paper can be extended in various ways. First, we will continue to experiment with AJ HOT D RAW and other case studies, in order to further extend the fault model, adequacy criteria, and refactoring catalogs. Second we will use the proposed models and the experience gained from these case studies to come up with automated tool support for both testing and refactoring of aspect-oriented programs. Last but not least, we will analyze the risks and benefits of the various aspect solutions, and reflect on ways in which some of the limitations of the current solutions can be resolved. In order to put our work in a broader perspective, we would like to refer to Bray et al who state: “assessment of aspect-oriented software development in general is still arguably in its early days” [5]. We argue that one of the prerequisites for such an assessment is the availability of an aspect-oriented and non-aspect oriented version of the same software system. Our work aims to create such versions for a publicly available open source software system and thereby enables experimental comparative software evolution research to asses the benefits of aspect-orientation. Acknowledgments We would like to thank Magiel Bruntink (CWI), Hylke van Dijk (TU Delft), Marco Lormans (TU Delft), and Tom Tourwé (CWI), for reading earlier drafts of this paper. 23 Partial support was received from SENTERNovem, (Delft University of Technology, project MOOSE, ITEA 01002, and CWI, project IDEALS, hosted by the Embedded Systems Institute). References 1. R. Alexander, J.M. Bieman, and A. A. Andrews. Towards the systematic testing of aspectoriented programs. Technical Report CS-4-105, Colorado State University, 2004. 2. The AspectJ Team. The AspectJ Programming Guide. Palo Alto Research Center, 2003. Version 1.2. 3. K. Beck and E. Gamma. Test infected: Programmers love writing tests. Java Report, 3(7):51– 56, 1998. www.junit.org. 4. R. V. Binder. Testing Object-Oriented Systems: Models, Patterns, and Tools. AddisonWesley, 2000. 5. S. Bray, M. Yuen, Y. Coady, and M. E. Fiuczynski. Managing variability in systems: Oh what a tangled OS we weave. In D. Beuche, K. Czarnecki, M. Mezini, C. Schwanninger, and M. Voelter, editors, Managing Variabilities Consistently in Design and Code (MVCDC OOPSLA04), 2004. 6. M. Bruntink, A. van Deursen, R. van Engelen, and T. Tourwé. An evaluation of clone detection techniques for identifying cross-cutting concerns. In Proc. of Int. Conf. on Software Maintenance (ICSM 2004). IEEE CS, 2004. 7. C. Clifton and G. Leavens. Obliviousness, modular reasoning, and the behavioral subtyping analogy. In Workshop on Software-Engineering Properties of Languages for Aspect Technologies (SPLAT’03), 2003. http://www.daimi.au.dk/˜eernst/splat03/. 8. Y. Coady and G. Kiczales. Back to the future: A retroactive study of aspect evolution in operating system code. In Mehmet Akşit, editor, Proc. of 2nd Int. Conf. on Aspect-Oriented Software Development (AOSD), pages 50–59. ACM Press, March 2003. 9. Y. Coady, G. Kiczales, M. Feeley, and G. Smolyn. Using AspectC to improve the modularity of path-specific customization in operating system code. In Proc. of 8th European Softw. Eng. Conf. (ESEC/FSE), pages 88–98. ACM Press, 2001. 10. A. van Deursen. Program comprehension risks and benefits in extreme programming. In E. Burd, P. Aiken, and R. Koschke, editors, Proc. 8th Working Conf. on Reverse Engineering (WCRE 2001), pages 176–185. IEEE CS Press, 2001. 11. A. van Deursen and L. Moonen. The video store revisited - thoughts on refactoring and testing. In M. Marchesi and G. Succi, editors, Proc. of 3nd Int. Conf. on Extreme Programming and Flexible Processes in Software Engineering (XP2002), pages 71–76. University of Cagliari, May 2002. 12. T. Elrad, M. Aksit, G. Kiczales, K. Lieberherr, and H. Ossher. Discussing aspects of AOP. Communcations of the ACM, 44(10):33–38, 2001. 13. R. Ettinger and M. Verbaere. Untangling: A slice extraction refactoring. In Proc. of 3rd Int. Conf. on Aspect-Oriented Software Development. ACM Press, 2004. 14. M. Fowler. Refactoring: Improving the Design of Existing Code. Addison Wesley, 1999. 15. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1994. 16. J. D. Gradecki and N. Lesiecki. Mastering AspectJ - Aspect Oriented Programmingin Java. Wiley Publishing, Inc., 2003. 17. S. Hanenberg, C. Oberschulte, and R. Unland. Refactoring of aspect-oriented software. In Proc. of Net.ObjectDays Conference, pages 19–35. Springer-Verlag, 2003. 24 18. J. Hannemann, T. Fritz, and G. C. Murphy. Refactoring to aspects: an interactive approach. In Proc. of 2003 OOPSLA Workshop on Eclipse technology eXchange, pages 74–78. ACM Press, 2003. 19. J. Hannemann and G. Kiczales. Design pattern implementation in Java and AspectJ. In Proc. of 17th Annual ACM conf. on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 161–173. ACM Press, 2002. 20. M. Iwamoto and J. Zhao. Refactoring aspect-oriented programs. In Proc. of 4th AOSD Modeling With UML Workshop, UML’2003, San Francisco, California, USA, 2003. 21. J. Kerievsky. Refactoring to Patterns. Addison-Wesley, 2004. 22. R. Laddad. Aspect-oriented refactoring. www.theserverside.com, December 2003. 23. R. Laddad. AspectJ in Action - Practical Aspect Oriented Programming. Manning, 2003. 24. M. M. Lehman. On understanding laws, evolution and conservation in the large program life cycle. Journal of Systems and Software, 1(3):213–221, 1980. 25. M. M. Lehman. Programs, life cycles and laws of software evolution. Proceedings of the IEEE, 68(9):1060–1076, September 1980. Special Issue on Software Engineering. 26. M. M. Lehman, D. E. Perry, and J. F. Ramil. Implications of evolution metrics on software maintenance. In T. M. Koshgoftaar and K. Bennett, editors, Proc. of Int. Conf. on Softw. Maintenance (ICSM 1998), pages 208–217. IEEE CS Press, 1998. 27. B. Liskov and J. M. Wing. A behavioral notion of subtyping. ACM Trans. Program. Lang. Syst., 16(6):1811–1841, 1994. 28. M. Marin. Refactoring JHotDraw’s Undo concern to AspectJ. In Proc. of First Workshop on Aspect Reverse Engineering (WARE). Delft University of Technology, 2004. 29. M. Marin, A. van Deursen, and L. Moonen. Identifying aspects using fan-in analysis. In Proc. of 11th Working Conf. on Reverse Engineering (WCRE2004). IEEE CS, 2004. 30. B. Meyer. Object-Oriented Software Construction. Prentice-Hall, 2nd edition, 1997. 31. M.P. Monteiro. Catalogue of refactorings for AspectJ. Technical Report UM-DI-GECSD200401, Universidade do Minho, 2004. 32. M.P. Monteiro and J.M. Fernandes. Object-to-aspect refactorings for feature extraction. In Proc. of 3rd Int. Conf. on Aspect-Oriented Software Development. ACM Press, 2004. Industry paper. 33. D. L. Parnas. Software aging. In Proc. of 16th Int. Conf. on Softw. Eng. (ICSE), pages 279–287. IEEE CS Press, 1994. 34. M. C. Rinard, A. Salcianu, and S. Bugrara. A classification system and analysis for aspectoriented programs. In Proc. of 12th ACM SIGSOFT Int. Symp. on Foundations of Software Engineering (FSE), pages 147–158. ACM Press, 2004. 35. A. Rountev, A. Milanova, and B. G. Ryder. Fragment class analysis for testing of polymorphism in Java software. IEEE Trans. Softw. Eng., 30(6):372–387, 2004. 36. P. Tonella and M. Ceccato. Migrating interface implementation to aspect oriented programming. In Proc. of Int. Conf. on Softw. Maintenance (ICSM 2004). IEEE CS Press, 2004. 37. N. Ubayashi and T. Tamai. Aspect-oriented programming with model checking. In Proc. of 1st Int. Conf. on Aspect-oriented software development (AOSD), pages 148–154. ACM Press, 2002. 38. E. Weyuker. The evaluation of program-based software test data adequacy criteria. Communications of the ACM, 31(6):668–675, June 1988. 39. J. Zhao. Data-flow-based unit testing of aspect-oriented programs. In Proc. of the 27th Annual IEEE Int. Computer Software and Applications Conference (COMPSAC), pages 188– 197. IEEE CS, 2003. 25
6cs.PL
GENERALIZED HILBERT COEFFICIENTS AND NORTHCOTT’S INEQUALITY arXiv:1312.0651v1 [math.AC] 2 Dec 2013 YU XIE A BSTRACT. Let R be a Cohen-Macaulay local ring of dimension d with infinite residue field. Let I − be an R-ideal that has analytic spread ℓ(I) = d, Gd condition and the Artin-Nagata property ANd−2 . n+1 n We provide a formula relating the length λ(I /JI ) to the difference PI (n) − HI (n), where J is a general minimal reduction of I, PI (n) and HI (n) are the generalized Hilbert-Samuel polynomial and the generalized Hilbert-Samuel function in the sense of C. Polini and Y. Xie. We then use it to establish formulas to compute the higher generalized Hilbert coefficients of I. As an application, we extend Northcott’s inequality to non m-primary ideals. When equality holds in the generalized Northcott’s inequality, the ideal I enjoys nice properties. Indeed, in this case, we prove that the reduction number of I is at most one and the associated graded ring of I is Cohen-Macaulay. We also recover results of G. Colomé-Nin, C. Polini, B. Ulrich and Y. Xie on the positivity of the generalized first Hilbert coefficient j1 (I). Our work extends that of S. Huckaba, C. Huneke and A. Ooishi to ideals that are not necessarily m-primary. 1. I NTRODUCTION Multiplicities and Hilbert functions play important role in commutative algebra and algebraic geometry. It is well-known that multiplicities are widely used to study intersection theory and singularity theory. Besides that, multiplicities and Hilbert functions reflect various algebraic and geometric properties of an ideal I in a Noetherian local ring R. In particular, they provide useful information on the arithmetical properties, like the depth, of the associated graded ring G, where G n n+1 ) is an algebraic construction whose projective scheme represents the (G = grI (R) := ⊕∞ n=0 I /I exceptional fiber of the blowup of a variety along a subvariety. The classical multiplicities and Hilbert functions (i.e., the Hilbert multiplicity and the Hilbert function) are only defined for ideals that are primary to the maximal ideal m of R. In order to study properties associated to non m-primary ideals, one has to define generalized multiplicities and generalized Hilbert functions. One of the generalizations of multiplicities of ideals is called the j-multiplicity. It was introduced by R. Achilles and M. Manaresi in 1993 to study improper intersections of two varieties [1]. In 1999, H. Flenner, L. O’ Carroll and W. Vogel defined the generalized Hilbert function using the 0th local cohomolodgy functor [6, Definition 6.1.5]. In 2003, C. Ciupercă introduced the generalized Hilbert coefficients via a different approach – the bigraded ring grm (G) [3]. Recently, C. Polini and Y. Xie re-conciliated both approaches and defined the concepts of the generalized Hilbert polynomial and the generalized Hilbert coefficients following the approach of H. Flenner, L. O’ Carroll and W. Vogel [20]. One of the fundamental properties AMS 2010 Mathematics Subject Classification. Primary 13D40; Secondary 13A30, 13H15, 13C14, 13C15. Key words and phrases. generalized Hilbert coefficients, associated graded rings, depth, Cohen-Macaulay, Northcott’s inequality. 1 2 Y. XIE proved by C. Polini and Y. Xie illustrates the behavior of the generalized Hilbert function under a hyperplane section [20]. Indeed, they proved that the first d − 1 generalized Hilbert coefficients j0 (I), . . . , jd−2 (I), where d = dim R, are preserved under a general hyperplane section. This nice property allows us to study the generalized Hilbert coefficients by reducing to the lower dimensional case. The generalized Hilbert coefficients are important invariants of the ideal I. It is well-known that the normalized leading coefficient j0 (I) (i.e., the j-multiplicity of I) can be computed using general elements (by [1, Theorem 3.8] and [26, Corollary 2.5]). This number was used to prove the refined Bezout’s theorem [6], to detect integral dependence of non m-primary ideals (extension of the fundamental theorem of Rees) [5], and to study the depth of the associated graded ring of an arbitrary ideal (see [19] and [16]). The next normalized coefficient j1 (I) is called the generalized first Hilbert coefficient of I. In the m-primary case, j1 (I) = e1 (I) is called the Chern number by W. V. Vasconcelos for its tracking position in distinguishing Noetherian filtrations with the same Hilbert multiplicity [24]. The coefficient e1 (Q), where Q is a parameter ideal, was used to characterize the Cohen-Macaulay property for large classes of rings [9]. Moreover, G. Colomé-Nin, C. Polini, B. Ulrich and Y. Xie use j1 (I), where I is an arbitrary ideal, to bound the number of steps in a process of normalization of ideals [4]. Therefore it is very important to establish properties such as positivity for the higher generalized Hilbert coefficients. In the case of m-primary ideals, there are a number of formulas to compute the Hilbert coefficients (see for instance, [11] and [10]). In 1987, C. Huneke provided a formula relating the length λ(I n+1 /JI n ) to the difference PI (n) − HI (n), where I is an m-primary ideal in a 2-dimensional Cohen-Macaulay local ring, J is a minimal reduction of I, PI (n) and HI (n) are respectively the usual Hilbert-Samuel polynomial and the usual Hilbert-Samuel function of I [11]. This formula was extended later by S. Huckaba to Cohen-Macaulay local rings of arbitrary dimension d [10]. S. Huckaba then established some formulas to compute the usual Hilbert coefficients of I, and proved conditions in terms of e1 (I) for the associated graded ring to be almost Cohen-Macaulay [10]. If I is an m-primary ideal in a Cohen-Macaulay local ring, the positivity of e1 (I) can be observed from the well-known Northcott’s inequality e1 (I) ≥ e0 (I) − λ(R/I) = λ(I/J), where J is a minimal reduction of I. By this inequality, one has that e1 (I) = 0 if and only if I is a complete intersection. Furthermore, the ideal I enjoys nice properties when equality holds in the above inequality. Indeed, it was shown that e1 (I) = λ(I/J) if and only if the reduction number of I is at most 1, and in this case, the associated graded ring G is Cohen-Macaulay (see [11] and [18]). This paper generalizes the above results to ideals that are not necessarily m-primary. In Section 2, we fix the notation and recall some basic concepts and facts that will be used throughout the paper. For an ideal I in a Noetherian local ring that has maximal analytic spread ℓ(I) = d = dim R and Gd condition, we establish a formula to compute e1 (I), where I is an 1-dimensional reduction of I (see Section 2 for the definition of I). We then give a condition in terms of e1 (I) for the associated GENERALIZED HILBERT COEFFICIENTS AND NORTHCOTT’S INEQUALITY 3 graded ring of I to be almost Cohen-Macaulay. This result generalizes [10, Theorem 3.1]. In Section 3, we provide a generalized version of [10, Theorem 2.4] relating the length λ(I n+1 /JI n ) to the difference PI (n) − HI (n), where I is an ideal in a d-dimensional Cohen-Macaulay local ring that − satisfies ℓ(I) = d, Gd condition and ANd−2 , J is a general minimal reduction of I, PI (n) and HI (n) are respectively the generalized Hilbert-Samuel polynomial and the generalized Hilbert-Samuel function of I. As an application, we establish some formulas to compute the higher generalized Hilbert coefficients. In the last section, we apply our formula to prove a generalized version of Northcott’s inequality, and recover the work of G. Colomé-Nin, C. Polini, B. Ulrich and Y. Xie on the positivity of the generalized first Hilbert coefficient j1 (I). At the same time, we prove that, if equality holds in the generalized Northcott’s inequality, the reduction number of I is at most one and the associated graded ring of I is Cohen-Macaulay, which generalizes the classical results of [11] and [18]. 2. F ORMULAS FOR e1 (I). In this paper, we always assume that (R, m, k) is a Noetherian local ring of dimension d with maximal ideal m and infinite residue field k (we can enlarge the residue field to be infinite by replacing R by R(z) = R[z]mR[z] , where z is a variable over R). Let I be an R-ideal. We recall the n n+1 be the concept of the generalized Hilbert-Samuel function of I. Let G = grI (R) = ⊕∞ n=0 I /I associated graded ring of I. As the homogeneous components of G may not have finite length, one considers the G-submodule of elements supported on m: W := {ξ ∈ G | ∃t > 0 such that ξ · mt = 0 n n+1 ). Since W is a finite graded module over gr (R) ⊗ R/mt for some 0} = Hm0 (G) = ⊕∞ R I n=0 Hm (I /I n i i+1 t ≥ 0, its Hilbert-Samuel function HW (n) := ∑i=0 λ(Γm (I /I )) is well defined. The generalized Hilbert-Samuel function of I is defined to be: HI (n) := HW (n) for every n ≥ 0. The definition of generalized Hilbert-Samuel function was introduced by H. Flenner, L. O’ Carroll and W. Vogel in 1999 [6, Definition 6.1.5], and studied later by C. Polini and Y. Xie [19] as well as G. Colomé Nin, C. Polini, B. Ulrich and Y. Xie [4]. Since dimG W ≤ dim R = d, HI (n) is eventually a polynomial of degree at most d   d n+d −i i PI (n) = ∑ (−1) ji (I) . d −i i=0 C. Polini and Y. Xie [19] defined PI (n) to be the generalized Hilbert-Samuel polynomial of I and ji (I), 0 ≤ i ≤ d, the generalized Hilbert coefficients of I. The normalized leading coefficient j0 (I) is called the j-multiplicity of I (see [1], [17], or [19]). Recall that the Krull dimension of the special fiber ring G/mG is called the analytic spread of I and is denoted by ℓ(I). In general, dimG W ≤ ℓ(I) ≤ d and equalities hold if and only if ℓ(I) = d. Therefore j0 (I) 6= 0 if and only if ℓ(I) = d [17]. If I is m-primary, each homogeneous component of G has finite length, thus W = G and the generalized Hilbert-Samuel function coincides with the usual Hilbert-Samuel function; in particular, the generalized Hilbert coefficients ji (I), 0 ≤ i ≤ d, coincide with the usual Hilbert coefficients ei (I). 4 Y. XIE The definition of generalized Hilbert coefficients is different from the one given by C. Ciupercă where he used the bigraded ring grm (G) [3]. Polini and Xie re-conciliated both approaches and proved that the generalized Hilbert coefficients j0 (I), . . . , jd−2 (I) are preserved under a general hyperplane section [19]. In this paper, we are going to use the tool of general elements to study the generalized HilbertSamuel function. We now recall this notion. Let I = (a1 , . . . , at ) and write xi = ∑tj=1 λi j a j for 1 ≤ i ≤ s and (λi j ) ∈ Rst . The elements x1 , . . . , xs form a sequence of general elements in I (equivalently x1 , . . . , xs are general in I) if there exists a Zariski dense open subset U of kst such that the image (λi j ) ∈ U . When s = 1, x = x1 is said to be general in I. Recall an ideal J ⊆ I is called a reduction of I if JI r = I r+1 for some non negative integer r. The least such r is denoted by rJ (I). A reduction is minimal if it is minimal with respect to inclusion. The reduction number r(I) of I is defined as min{rJ (I) | J is a mimimal reduction of I}. Since R has infinite residue field, the minimal number of generators µ(J) of any minimal reduction J of I equals the analytic spread ℓ(I). Furthermore, general ℓ(I) elements in I form a minimal reduction J whose rJ (I) coincides with the reduction number r(I) (see [22, 2.2] or [13, 8.6.6]). One says that J is a general minimal reduction of I if it is generated by ℓ(I) general elements in I. The ideal I is said to satisfy Gs+1 condition if for every p ∈ V (I) with ht p = i ≤ s, the ideal Ip is generated by i elements, i.e., Ip = (x1 , . . . , xi )p for some x1 , . . . , xi in I. From now on, we will assume I has ℓ(I) = d and Gd condition. Let J = (x1 , . . . , xd ), where x1 , . . . , xd are general elements in I, i.e., J is a general minimal reduction of I. Set Ji = (x1 , . . . , xi ), 0 ≤ i ≤ d − 1, R = R/Jd−1 : I ∞ , where Jd−1 : I ∞ = {a ∈ R | ∃t > 0 such that a · It ⊆ Jd−1 }, and use to denote images in the quotient ring R. Then R is an 1-dimensional Cohen-Macaulay local ring and I is m-primary. Hence the generalized Hilbert-Samuel function HI (n) and the generalized HilbertSamuel polynomial PI (n) are the usual Hilbert-Samuel function and the usual Hilbert-Samuel polynomial of I, respectively. Note HR (I) and hence PI (n) do not depend on choices of general elements x1 , . . . , xd−1 in I (see [20]), and PI (n) = e0 (I)(n + 1) − e1 (I), where e0 (I) = λ(R/(xd )) = j0 (I). If R is Cohen-Macaulay and I is m-primary, then e1 (I) = e1 (I) (see for instance [21, Proposition 1.2]). But they are in general not the same. We will show later in Theorem 2.3 that e1 (I) (like e1 (I), see [10, Theorem 3.1]) characterizes the depth of the associated graded ring G. For depth(G), we mean the depth of the local ring GM , where M := m/I ⊕ I/I 2 ⊕ I 2 /I 3 ⊕ . . . denotes the maximal homogeneous ideal of G. Since depth(G) ≤ dim G = dim R = d, G is said to be Cohen-Macaulay if depth(G) = d and almost CohenMacaulay if depth(G) = d − 1. The condition depth(G) ≥ d − 1 is a useful one, especially when one considers questions about the behavior of I n . It reduces greatly the computation of the generalized Hilbert coefficients (see Corollary 3.4 in Section 3). Theorem 2.3 is achieved from a formula computing e1 (I) (see Lemma 2.2 in the following). n+1 n Since we do not have the finite length on R/I, to compare the length λ(I n+1 /JI n ) with λ(I /JI ), where J is a general minimal reduction of I, we need the following lemma. GENERALIZED HILBERT COEFFICIENTS AND NORTHCOTT’S INEQUALITY 5 Lemma 2.1. Let D ⊆ B ⊆ A and D ⊆ C ⊆ A be finite modules over R such that A/B and C/D have finite lengths (while the lengths of B/D and A/C are not necessarily finite). Then λ(A/B) + λ(B ∩C/D) = λ(C/D) + λ(A/B +C). Proof. By the exact sequences π 0→B ∩C/D→B/D →1 B +C/C→0, i 1 0→B +C/C → A/C→A/B +C→0, π 0→C/D→A/D →2 A/C→0, i 2 0→B/D → A/D→A/B→0, we have the following long exact sequences πe 0→B ∩C/D→Hm0 (B/D)→Hm0 (B +C/C)→0→Hm1 (B/D) →1 Hm1 (B +C/C)→0, ∆ ie 1 0→Hm0 (B +C/C)→Hm0 (A/C)→A/B +C →1 Hm1 (B +C/C) → Hm1 (A/C)→0, πe 0→C/D→Hm0 (A/D)→Hm0 (A/C)→0→Hm1 (A/D) →2 Hm1 (A/C)→0, ∆ ie 2 Hm1 (A/D)→0, 0→Hm0 (B/D)→Hm0 (A/D)→A/B →2 Hm1 (B/D) → and the commutative diagram 0 → Im(∆2 ) → Hm1 (B/D) ↓id 0 → Ker(ie1 ◦ πe1 ) → Hm1 (B/D) ie 2 → ie1 ◦πe1 → Hm1 (A/D) → 0 ↓πe2 Hm1 (A/C) → 0 with exact rows and isomorphic vertical maps id and πe2 , hence Im(∆2 ) ∼ = Ker(ie1 ◦ πe1 ). Since Ker(ie1 ◦ πe1 ) ∼ = Ker(ie1 ) = Im(∆1 ), we have Im(∆2 ) ∼ = Im(∆1 ). Now λ(A/B) + λ(B ∩C/D) = λ(Im(∆2 )) + λ(Hm0 (A/D)) − λ(Hm0 (B/D)) + λ(B ∩C/D) = λ(Im(∆1 )) + λ(Hm0 (A/D)) − λ(Hm0 (B/D)) + λ(B ∩C/D) = λ(A/B +C) + λ(Hm0 (B +C/C)) − λ(Hm0 (A/C)) + λ(Hm0 (A/D)) − λ(Hm0 (B/D)) + λ(B ∩C/D) = λ(A/B +C) + λ(Hm0 (B/D)) − λ(B ∩C/D) + λ(C/D) − λ(Hm0 (B/D)) + λ(B ∩C/D) = λ(C/D) + λ(A/B +C). Applying Lemma 2.1, we obtain the following proposition. Proposition 2.2. Let I be an R-ideal with ℓ(I) = d and Gd condition. For general elements x1 , . . . , xd in I, set J = (x1 , . . . xd ), Jd−1 = (x1 , . . . , xd−1 ), and R = R/Jd−1 : I ∞ as above. Then for every n ≥ 0, one has (a) λ(I n+1 /JI n ) − λ[(Jd−1 : I ∞ ) ∩ I n+1 /(Jd−1 : I ∞ ) ∩ JI n ] = ∆[PI (n) − HI (n)]. n+1 /JI n ) − λ[(J ∞ n+1 /(J ∞ n (b) ∑∞ d−1 : I ) ∩ I d−1 : I ) ∩ JI ]] = e1 (I). n=0 [λ(I 6 Y. XIE Proof. (a) For every n ≥ 0, we have I n+1 + Jd−1 : I ∞ ←֓ I n+1 ↑ ↑ n ∞ JI + Jd−1 : I ←֓ JI n with I n+1 + Jd−1 : I ∞ /JI n + Jd−1 : I ∞ and I n+1 /JI n all having finite lengths. By Lemma 2.1, λ(I n+1 /JI n ) = λ(I n+1 + Jd−1 : I ∞ /JI n + Jd−1 : I ∞ ) + λ([JI n + Jd−1 : I ∞ ] ∩ I n+1 /JI n ). Since [JI n + Jd−1 : I ∞ ] ∩ I n+1 /JI n ∼ = (Jd−1 : I ∞ ) ∩ I n+1 /(Jd−1 : I ∞ ) ∩ JI n , we have λ(I n+1 /JI n ) − λ[(Jd−1 : I ∞ ) ∩ I n+1 /(Jd−1 : I ∞ ) ∩ JI n ] = λ(I n+1 n /JI ) = ∆[PI (n) − HI (n)], where the latter equality follows from [10, Theorem 2.4]. Now (b) follows by (a) and [10, Corollary 2.10]. We now recall some residual intersection properties. Let Ji = (x1 , . . . , xi ), where x1 , . . . , xi are elements in I. Define Ji : I = {a ∈ R | a · I ⊆ Ji }. One says that Ji : I is an i-residual intersection of I if Ip = (x1 , . . . , xi )p for every p ∈ Spec(R) with dim Rp ≤ i − 1. An i-residual intersection Ji : I is called a geometric i-residual intersection of I if, in addition, Ip = (x1 , . . . , xi )p for every p ∈ V (I) with dim Rp ≤ i. It was shown that if I satisfies Gs condition, then for general elements x1 , . . . , xs in I and each 0 ≤ i < s, the ideal Ji : I is a geometric i-residual intersection of I, and Js : I is an s-residual intersection of I (see [23] or [19, Lemma 3.1]). Assume R is Cohen-Macaulay. The ideal I is s-weakly residually (S2 ) (respectively, has the weak Artin-Nagata property ANs−) if for every 0 ≤ i ≤ s and every geometric i-residual intersection Ji : I of I the quotient ring R/Ji : I satisfies Serre’s condition (S2 ) (respectively, is Cohen-Macaulay). The notion of residual intersections was introduced by Artin and Nagata [2] as a generalization of the concept of linkage to the case where the two “linked” ideals do not necessarily have the same height. The issue on the Cohen-Macaulayness of residual intersections has been addressed in a series of results (for instance, [12], [8], [14] and [23]), which require either depth conditions on all of the Koszul homology modules of I such as the “strong Cohen-Macaulayness” or weaker “sliding depth condition”, or depth conditions on sufficiently many powers of I. The following theorem generalizes [10, Theorem 3.1] to ideals that are not necessarily m-primary. Notice if R is Cohen-Macaulay and I is m-primary, then e1 (I) = e1 (I) ([21, Proposition 1.2]), and I automatically satisfies ℓ(I) = d, Gd condition, (d − 2)-weakly residually (S2 ) as well as the weak − Artin-Nagata property ANd−2 . Theorem 2.3. Assume R is Cohen-Macaulay. Let I be an R-ideal which satisfies ℓ(I) = d, Gd condition and (d − 2)-weakly residually (S2 ). Then for a general minimal reduction J = (x1 , . . . , xd ) of I, the following two statements are equivalent: n+1 /JI n ) = e (I). (a) ∑∞ 1 n=0 λ(I (b) For every n ≥ 0, Jd−1 ∩ I n+1 = Jd−1 I n , where Jd−1 = (x1 , . . . , xd−1 ) defined as before. − , then (a) or (b) is equivalent to that depth(G) ≥ d − 1. Furthermore, if I satisfies ANd−2 GENERALIZED HILBERT COEFFICIENTS AND NORTHCOTT’S INEQUALITY 7 Proof. First if d = 1, then R = R/0 : I ∞ = R/0 : I is an 1-dimensional Cohen-Macaulay local ring and I is m-primary. By (0 : I) ∩ I = 0 and [10, Theorem 3.1], one has ∞ e1 (I) = ∑ λ(I n+1 n /JI ) = n=0 ∞ ∑ λ(I n+1/JI n ). n=0 Assume d ≥ 2. Since I satisfies ℓ(I) = d and Gd condition, one has that Ji : I is a geometrically i-residual intersection of I, where Ji = (x1 , . . . , xi ), 0 ≤ i ≤ d −1 [19]. Furthermore, since I is (d −2)weakly residually (S2 ), for each 0 ≤ i ≤ d − 1, one has that R/Ji : I has no embedded associated prime ideals and thus Ji : I = Ji : xi+1 . Note that depth(R/Ji : xi+1 ) = depth(R/Ji : I) ≥ 2. We will show depth(R/Ji ) ≥ 1 by induction on i. The case i = 0 (i.e., J0 = (0)) is clear. Assume 1 ≤ i ≤ d − 1 and depth(R/Ji−1 ) ≥ 1, then by the exact sequence 0 → R/Ji−1 : xi → R/Ji−1 → R/Ji → 0, one has that depth(R/Ji ) ≥ Min{depth(R/Ji−1 : xi ) − 1, depth(R/Ji−1 )} ≥ 1. We claim that (Jd−1 : I) ∩ I = Jd−1 . Indeed, since Jd−1 ⊆ (Jd−1 : I) ∩ I, we just need to show that (x1 , . . . , xd−1 )p = (Jd−1 : I)p ∩ Ip for every p ∈ Ass(R/Jd−1 ), which follows by the fact that for every p ∈ Ass(R/Jd−1 ), since height p ≤ d − 1, then either Ip = Rp or Ip = (Jd−1 )p . Now for n ≥ 0, (Jd−1 : I) ∩ I n+1 = Jd−1 ∩ I n+1 and (Jd−1 : I) ∩ JI n = Jd−1 ∩ JI n . Therefore if (b) is true, then for n ≥ 0, λ[(Jd−1 : I) ∩ I n+1 /(Jd−1 : I) ∩ JI n] = λ[Jd−1 ∩ I n+1 /Jd−1 ∩ JI n ] = λ[Jd−1 I n /Jd−1 ∩ JI n ] = 0. And (a) follows by Proposition 2.2 (b) and the fact that R/Jd−1 : I is Cohen-Macaulay and thus Jd−1 : I ∞ = Jd−1 : I. Assume (a). By Proposition 2.2 (b), for every n ≥ 0, λ[(Jd−1 : I) ∩ I n+1 /(Jd−1 : I) ∩ JI n ] = 0. Hence Jd−1 ∩ I n+1 = (Jd−1 : I) ∩ I n+1 = (Jd−1 : I) ∩ JI n = Jd−1 ∩ JI n . We use induction on n to prove that for every n ≥ 0, Jd−1 ∩ I n+1 = Jd−1 I n . This is clear if n = 0. Assume n ≥ 1 and Jd−1 ∩ I n = Jd−1 I n−1 . Then (b) follows by the following equalities: Jd−1 ∩ I n+1 = Jd−1 ∩ JI n = Jd−1 ∩ (Jd−1 I n + xd I n ) = Jd−1 I n + Jd−1 ∩ xd I n = Jd−1 I n + xd [(Jd−1 : xd ) ∩ I n ] = Jd−1 I n + xd [Jd−1 ∩ I n ] = Jd−1 I n + xd Jd−1 I n−1 = Jd−1 I n . − , we will show that (b) is equivalent to that depth(G) ≥ d − 1. Finally assume I satisfies ANd−2 Set δ(I) = d − g, where ht I = g. We use the induction on δ. If δ = 0, the assertion follows because 8 Y. XIE (b) is equivalent to that x∗1 , . . . , x∗d−1 form a regular sequence on G (see [25, Proposition 2.6]), and the latter is equivalent to that depth(G) ≥ d − 1. Thus we may assume δ(I) ≥ 1 and the theorem holds for smaller values of δ(I). In particular, d ≥ g + 1. Since x∗1 , . . . , x∗g form a regular sequence on G, we may factor out x1 , . . . , xg to assume g = 0. Now d = δ(I) ≥ 1. Set S = R/0 : I. Then S is − . Note dim S = dim R = d, grade (IS) ≥ 1, IS still satisfies Cohen-Macaulay since I satisfies ANd−2 − Gd condition, ANd−2 , ℓ(IS) = ℓ(I) = d (see for instance [19]). Since I ∩ (0 : I) = 0, there is a graded exact sequence (1) 0 → 0 : I → G → grIS (S) → 0. Since depth(0 : I) ≥ d, one has that depth(G) ≥ d − 1 ⇔ depth(grIS (S)) ≥ d − 1. We claim that (b) is equivalent to Jd−1 S ∩ I n+1 S = Jd−1 I n S for every n ≥ 0. Indeed, if (b) holds, then clearly Jd−1 S ∩ I n+1 S = Jd−1 I n S for every n ≥ 0. On the other hand, if Jd−1 S ∩ I n+1 S = Jd−1 I n S for every n ≥ 0, then Jd−1 ∩ I n+1 ⊆ Jd−1 I n + (0 : I) ∩ I n+1 = Jd−1 I n , again by I ∩ 0 : I = 0. We are done by induction hypothesis since δ(IS) = d − grade (IS) < d = δ(I). 3. F ORMULAS FOR ji (I), 1 ≤ i ≤ d. In this section we will provide a formula relating the length λ(I n+1 /JI n ) to the difference PI (n) − − , J is a general minimal reduction HI (n), where I is an ideal with ℓ(I) = d, Gd condition and ANd−2 of I, PI (n) and HI (n) are the generalized Hilbert-Samuel polynomial and the generalized HilbertSamuel function of I. This formula generalizes [10, Theorem 2.4] Theorem 3.1. Assume R is Cohen-Macaulay. Let I be an R-ideal with ℓ(I) = d, Gd condition and − . Then for a general minimal reduction J = (x1 , . . . , xd ) of I, one has that for all n ≥ 0, ANd−2 λ(I n+1 /JI n ) + ωn (J, I) = ∆d [PI (n) − HI (n)], where ω0 (J, I) = λ(R/Jd−1 : I + I) − λ[Hm0 (R/I)], and for n ≥ 1, 0 1 en−1 en−1 ed−2 )] ωn (J, I) = ∆d−1 [λ(K )] + ∆d−2 [λ(K )] + . . . + ∆[λ(K n−1 + ∆d−2 [λ(e L0n ) − λ(L0n ) + λ(Nn0 )] + ∆d−3 [λ(e L1n ) − λ(L1n ) + λ(Nn1 )] + . . . + ∆0 [λ(e Lnd−2 ) − λ(Lnd−2 ) + λ(Nnd−2 )] − λ[(J1 : I) ∩ I n+1 /(J1 : I) ∩ JI n ] − λ[(J2 : I) ∩ I n+1 + (J1 : I)/(J2 : I) ∩ JI n + (J1 : I)] d−1 n − . . . − λ[(Jd−1 : I) ∩ I n+1 + (Jd−2 : I)/(Jd−1 : I) ∩ JI n + (Jd−2 : I)]   n d −1 −(−1) β, n := 0 if n ≥ d, and for 0 ≤ i ≤ d − 2, i en−1 K = I n+1 : x1 /Ji : I + I n , GENERALIZED HILBERT COEFFICIENTS AND NORTHCOTT’S INEQUALITY 9 ein = Ji+1 ∩ I n /[Ji ∩ I n + Ji+1 ∩ I n+1 + xi+1 I n−1 ], L Lin = ((Ji : I)∩I n +I n+1 ) :(Ji+1 :I)∩I n m∞ /[(Ji : I)∩I n +(Ji+1 : I)∩I n+1 +xi+1 (((Ji : I)∩I n−1 +I n ) :I n−1 m∞ )], Nni = ((Ji+1 : I) ∩ I n + I n+1 ) :I n m∞ /[(Ji+1 : I) ∩ I n + ((Ji : I) ∩ I n + I n+1 ) :I n m∞ ], β = λ(Hm0 (R/I)) − λ(Hm0 (R/0 : I + I)). Proof. Recall for each 0 ≤ i ≤ d − 1, Ji : I is a geometric i-residual intersection of I, where Ji = (x1 , . . . , xi ). Set Ri = R/Ji : I and Gi = grIRi (Ri ). Then [G0 ]0 = R/(0 : I + I) and [G0 ]n = [G]n for every n ≥ 1. Hence ∆[HI (0)] = λ(Hm0 (R/I)) = λ(Hm0 (R/0 : I + I)) + [λ(Hm0 (R/I)) − λ(Hm0 (R/0 : I + I))] = ∆[HIR0 (0)] + β, with β defined above, and ∆[HI (n)] = ∆[HIR0 (n)] for n ≥ 1. Therefore we have that for n ≥ 0,   n d −1 d d (2) ∆ [HI (n)] = ∆ [HIR0 (n)] + (−1) β, n  with the binomial coefficient d−1 = 0 if n > d − 1. n We use induction on d to prove the theorem. First assume d = 1. If n = 0, one has λ(I/J) + ω0 (J, I) = λ(IR0 /JR0 ) + λ(R/0 : I + I) − λ[Hm0 (R/I)] = ∆[PIR0 (0) − HIR0 (0)] + λ(R/0 : I + I) − λ[Hm0 (R/I)] = ∆[PIR0 (0)] − λ(R/0 : I + I) + λ(R/0 : I + I) − λ[Hm0 (R/I)] = ∆[PI (0) − HI (0)], where the second equality follows from [10, Theorem 2.4] since R0 is an 1-dimensional CohenMacaulay local ring and IR0 is mR0 -primary, and the third equality follows from ∆[PIR0 (n)] = ∆[PI (n)] = j0 (I) for every n ≥ 0. If n ≥ 1, since ωn (J, I) = 0, one has λ(I n+1 /JI n ) + ωn (J, I) = λ(I n+1 R0 /JI n R0 ) = ∆[PIR0 (n) − HIR0 (n)] = ∆[PI (n) − HI (n)]. Now assume d ≥ 2 and the assertion holds for d − 1. By the proof of Proposition 2.2, λ(I n+1 /JI n ) − λ[(Jd−1 : I) ∩ I n+1 /(Jd−1 : I) ∩ JI n ] = λ(I n+1 Rd−1 /JI n Rd−1 ) = ∆[PIRd−1 (n) − HIRd−1 (n)] = ∆d [PI (n)] − ∆[HIRd−1 (n)], by the fact that ∆[PIRd−1 (n)] = ∆d [PI (n)] = j0 (I). If n = 0, one has λ[(Jd−1 : I) ∩ I/(Jd−1 : I) ∩ J] = λ(Jd−1 /Jd−1 ) = 0, 10 Y. XIE and therefore λ(I/J) + ω0 (J, I) = ∆d [PI (0)] − ∆[HIRd−1 (0)] + λ(R/Jd−1 : I + I) − λ[Hm0 (R/I)] = ∆d [PI (0)] − λ(R/Jd−1 : I + I) + λ(R/Jd−1 : I + I) − λ[Hm0 (R/I)] = ∆d [PI (0)] − λ[Hm0 (R/I)] = ∆d [PI (0) − HI (0)]. Let n ≥ 1. We have the following exact sequences for every n ≥ 1: x∗ 1 0 Hm0 ([G0 ]n ) → Hm0 ([G0 ]n )/x∗1 Hm0 ([G0 ]n−1 ) → 0, 0 → Kn−1 → Hm0 ([G0 ]n−1 ) → 0 → L0n → Hm0 ([G0 ]n )/x∗1 Hm0 ([G0 ]n−1 ) → Hm0 ([G1 ]n ) → Nn0 → 0, where 0 = [((0 : I) ∩ I n + I n+1 ) :I n−1 x1 ] ∩ [((0 : I) ∩ I n−1 + I n ) :I n−1 m∞ ]/((0 : I) ∩ I n−1 + I n ), Kn−1 L0n = ((0 : I) ∩ I n + I n+1 ) :(J1 :I)∩I n m∞ /[(0 : I) ∩ I n + (J1 : I) ∩ I n+1 + x1 (((0 : I) ∩ I n−1 + I n ) :I n−1 m∞ )], Nn0 = ((J1 : I) ∩ I n + I n+1 ) :I n m∞ /[(J1 : I) ∩ I n + ((0 : I) ∩ I n + I n+1 ) :I n m∞ ]. Note ((0 : I) ∩ I n + I n+1 ) :I n−1 x1 /((0 : I) ∩ I n−1 + I n ) has finite length because G is Cohen-Macaulay on the punctured spectrum by [15, Theorem 3.1]. Hence 0 Kn−1 = ((0 : I) ∩ I n + I n+1 ) :I n−1 x1 /((0 : I) ∩ I n−1 + I n ). Therefore ∆d [HIR0 (n)] = ∆d−2 [λ[Hm0 ([G0 ]n )] − λ[Hm0 ([G0 ]n−1 )]] 0 = ∆d−2 [λ[Hm0 ([G0 ]n )/x∗1 Hm0 ([G0 ]n−1 )] − λ(Kn−1 )] 0 = ∆d−2 [λ[Hm0 ([G1 ]n )]] + ∆d−2 [λ(L0n )] − ∆d−2 [λ(Nn0 )] − ∆d−2 [λ(Kn−1 )] 0 )]. = ∆d−1 [HIR1 (n)] + ∆d−2 [λ(L0n ) − λ(Nn0 ) − λ(Kn−1 By Lemma 2.1, the induction hypothesis, and the above equality, λ(I n+1 /JI n ) = λ(I n+1 R0 /JI n R0 ) = λ(I n+1 R1 /JI n R1 ) + λ[(J1 : I) ∩ I n+1 /(J1 : I) ∩ JI n ] = ∆d−1 [PIR1 (n) − HIR1 (n)] − ωn (JR1 , IR1 ) + λ[(J1 : I) ∩ I n+1 /(J1 : I) ∩ JI n ] 0 )] = ∆d [PIR0 (n)] − ∆d [HIR0 (n)] + ∆d−2 [λ(L0n ) − λ(Nn0) − λ(Kn−1 −ωn (JR1 , IR1 ) + λ[(J1 : I) ∩ I n+1 /(J1 : I) ∩ JI n ] = ∆d [PIR0 (n) − HIR0 (n)] 0 −[ωn (JR1 , IR1 ) + ∆d−2 [λ(Kn−1 )] + ∆d−2 [−λ(L0n ) + λ(Nn0)] − λ[(J1 : I) ∩ I n+1 /(J1 : I) ∩ JI n ]]. We claim that for every n ≥ 1, 0 0 en−1 λ(Kn−1 ) = ∆[λ(K )] + λ(e L0n ), GENERALIZED HILBERT COEFFICIENTS AND NORTHCOTT’S INEQUALITY 11 where 0 en−1 λ(K ) = λ(I n+1 : x1 /0 : I + I n ), e0n ) = λ[(x1 ) ∩ I n /(x1 ) ∩ I n+1 + x1 I n−1 ], λ(L since (0 : I) ∩ I n = 0 for n ≥ 1. This follows by the following equalities: 0 λ(Kn−1 ) = λ[I n+1 :I n−1 x1 /(0 : I) ∩ I n−1 + I n ] = λ[(I n+1 :I n−1 x1 ) + 0 : I/I n + 0 : I] = λ[I n+1 : x1 /I n + 0 : I] − λ[I n+1 : x1 /(I n+1 :I n−1 x1 ) + 0 : I] 0 en−1 = ∆[λ(K )] + λ[I n : x1 /0 : I + I n−1 ] − λ[(I n+1 : x1 ) + I n−1 /0 : I + I n−1 ] 0 en−1 = ∆[λ(K )] + λ[I n : x1 /(I n+1 : x1 ) + I n−1 ] 0 en−1 = ∆[λ(K )] + λ[(x1 ) ∩ I n /(x1 ) ∩ I n+1 + x1 I n−1 ] Now 0 en−1 = ∆[λ(K )] + λ(e L0n ). 0 )] + ∆d−2 [−λ(L0n ) + λ(Nn0 )] − λ[(J1 : I) ∩ I n+1 /(J1 : I) ∩ JI n ] ωn (JR1 , IR1 ) + ∆d−2 [λ(Kn−1 0 en−1 = ωn (JR1 , IR1 ) + ∆d−1 [λ(K )] + ∆d−2 [λ(e L0n ) − λ(L0n ) + λ(Nn0 )] − λ[(J1 : I) ∩ I n+1 /(J1 : I) ∩ JI n ] = ωn (JR0 , IR0 ). Therefore by equation (2), we have λ(I n+1 /JI n ) == ∆d [PIR0 (n) − HIR0 (n)] − ωn (JR0 , IR0 ).   d 0 0 n d−1 = ∆ [PI (n) − HI (n)] − [ωn (JR , IR ) − (−1) β] = ∆d [PI (n) − HI (n)] − ωn (J, I). n The following Lemma is inspired by [10, Proposition 2.9]. Lemma 3.2. Let I be an R-ideal. Then  ∞  n ∑ i − 1 ∆d [PI (n) − HI (n)] = ji(I) for 1 ≤ i ≤ d. n=i−1 By Theorem 3.1 and the above lemma, we obtain formulas to compute the generalized Hilbert coefficients. Corollary 3.3. Assume R is Cohen-Macaulay. Let I be an R-ideal with ℓ(I) = d, Gd condition and − . Then for a general minimal reduction J = (x1 , . . . , xd ) of I, one has ANd−2  ∞  n ∑ i − 1 [λ(I n+1/JI n) + ωn(J, I)] = ji(I) for 1 ≤ i ≤ d. n=i−1 In particular, if d = 1, ∞ j1 (I) = ∑ λ(I n+1 /JI n) + λ(R/0 : I + I) − λ[Hm0 (R/I)], n=0 12 Y. XIE and if d ≥ 2, ∞ j1 (I) = ∑ λ(I n+1/JI n ) + λ(R/Jd−1 : I + I) − λ[Hm0 (R/0 : I + I)] n=0 d−2 + ∆ ∞ + [λ(L00 ) − λ(N00)] + . . . + ∆[λ(L0d−3 ) − λ(N0d−3 )] ∑ [λ(eLnd−2 ) − λ(Lnd−2) + λ(Nnd−2)] n=1 ∞ − ∑ λ((J1 : I) ∩ I n+1/(J1 : I) ∩ JI n) − . . . n=1 ∞ − ∑ λ[(Jd−1 : I) ∩ I n+1 + Jd−2 : I/(Jd−1 : I) ∩ JI n + Jd−2 : I]. n=1 Proof. If d = 1, by Theorem 3.1, one has ω0 (J, I) = λ(R/0 : I + I) − λ[Hm0 (R/I)] and ωn (J, I) = 0 for n ≥ 1. Hence ∞ j1 (I) = ∑ [λ(I n+1 /JI n) + ωn(J, I)] = n=0 ∞ ∑ λ(I n+1 /JI n) + λ(R/0 : I + I) − λ[Hm0 (R/I)]. n=0 Assume d ≥ 2. Then ∞ j1 (I) = ∑ [λ(I n+1 /JI n) + ωn(J, I)] n=0 ∞ = ∑ λ(I n+1/JI n) + λ(R/Jd−1 : I + I) − λ[Hm0 (R/I)] n=0 d−2 + ∆ ∞ + [λ(L00 ) − λ(N00 )] + . . . + ∆[λ(L0d−3 ) − λ(N0d−3 )] ∑ [λ(eLnd−2 ) − λ(Lnd−2) + λ(Nnd−2)] n=1 ∞ − ∑ λ((J1 : I) ∩ I n+1/(J1 : I) ∩ JI n) − . . . n=1 ∞ − ∑ λ[(Jd−1 : I) ∩ I n+1 + Jd−2 : I/(Jd−1 : I) ∩ JI n + Jd−2 : I] n=1 − β  d−1 ∑ (−1) n=0 n   d−1  + β, n d−1 which is equal to the desired result since ∑n=0 (−1)n d−1 n = 0 and β = λ(Hm0 (R/I)) − λ(Hm0 (R/0 : I + I)). Corollary 3.4. Assume R is Cohen-Macaulay. Let I be an R-ideal with ℓ(I) = d, Gd condition − . If depth(G) ≥ d − 1 and depth(G/Hm0 (G)) = d, then for a general minimal reduction and ANd−2 J = (x1 , . . . , xd ) of I, one has ∞ j1 (I) = ∑ λ(I n+1/JI n ) + λ(R/Jd−1 : I + I) − λ[Hm0 (R/H + I)], n=0 GENERALIZED HILBERT COEFFICIENTS AND NORTHCOTT’S INEQUALITY 13 where H = 0 if d = 1, or H = 0 : I if d ≥ 2. 4. G ENERALIZED N ORTHCOTT ’ S INEQUALITY As an application of Corollary 3.3, we obtain the following generalized Northcott’s inequality. Theorem 4.1. Assume R is Cohen-Macaulay. Let I be an R-ideal with ℓ(I) = d, Gd condition and weakly (d − 2)-residually (S2 ). Then for a general minimal reduction J = (x1 , . . . , xd ) of I, one has the following generalized Northcott’s inequality: j1 (I) ≥ λ(I/J) + λ[R/Jd−1 : I + (Jd−2 : I + I) : m∞ ]. Proof. Set S = R/Jd−2 : I, where Jd−2 = (x1 , . . . , xd−2 ). Then j1 (I) = j1 (IS), IS satisfies ℓ(IS) = 2 = dim S, G2 condition and AN0− (see [20] and [19]). By Corollary 3.3, we have j1 (I) = j1 (IS) = ∞ ∞ n=0 n=1 ∑ λ(I n+1 S/JI nS) − ∑ λ[(xd−1 S : IS) ∩ I n+1S/(xd−1 S : IS) ∩ JI nS] + λ(S/xd−1 S : IS + IS) − λ(Hm0 (S/IS)) ∞  + ∑ λ[(xd−1 S) ∩ I n S/(xd−1 S) ∩ I n+1 S + xd−1 I n−1 S] n=1 n+1 − λ[I ∞ +   S :(xd−1 S:IS)∩I n S m∞ /(xd−1 S : IS) ∩ I n+1 S + xd−1 (I n S :I n−1 S m∞ )] ∑ λ ((xd−1 S : IS) ∩ I nS + I n+1S) :I S m∞/(xd−1 S : IS) ∩ I nS + I n+1S :I S m∞ n=1 n ≥ λ(I/J) + λ[R/Jd−1 : I + (Jd−2 : I + I) : m∞ ]. n  This follows by the following inequalities. First ∞ ∞ ∑ λ(I n+1 S/JI nS) − ∑ λ[(xd−1 S : IS) ∩ I n+1S/(xd−1 S : IS) ∩ JI nS] n=1 n=0 ∞  = λ(IS/JS) + ∑ λ(I n+1 S/JI n S) − λ[(xd−1 S : IS) ∩ I n+1 S/(xd−1 S : IS) ∩ JI n S] ∞ n=1  = λ(I/J) + ∑ λ[I n+1 S/JI n S + (xd−1 S : IS) ∩ I n+1 S] n=1 ≥ λ(I/J), where the second equality follows by Lemma 2.1 and λ(IS/JS) = λ(I/(Jd−1 : I) ∩ I + J) = λ(I/J). Next, because depth(S/xd−1 S) ≥ 1 (see [23]), for every p ∈ Ass(S/xd−1 S), one has that p is not maximal and ISp = (xd−1 )Sp . Hence (xd−1 S : IS)∩ (JS : m∞ )p = xd−1 Sp for every p ∈ Ass(S/xd−1 S), which yields that (xd−1 S : IS) ∩ (JS : m∞ ) = xd−1 S. Therefore (xd−1 S : IS + JS) ∩ (JS : m∞ ) = JS + (xd−1 S : IS) ∩ (JS : m∞ ) = JS. 14 Y. XIE Since λ(I/J) < ∞ and (xd−1 S : IS) ∩ IS = (xd−1 )S, by Lemma 2.1, one has λ(S/xd−1 S : IS + IS) − λ(Hm0 (S/IS)) = λ(S/xd−1 S : IS + JS) − λ(Hm0 (S/JS)) = λ(S/xd−1 S : IS + JS : m∞ ) − λ[(xd−1 S : IS + JS) ∩ (JS : m∞ )/JS] = λ(S/xd−1 S : IS + JS : m∞ ) = λ(R/Jd−1 : I + (Jd−2 : I + I) : m∞ ). Finally for n ≥ 1, λ[(xd−1 S) ∩ I n S/(xd−1 S) ∩ I n+1 S + xd−1 I n−1 S] −λ[I n+1 S :(xd−1 S:IS)∩I n S m∞ /(xd−1 S : IS) ∩ I n+1 S + xd−1 (I n S :I n−1 S m∞ )] = λ[(xd−1 S) ∩ I n S/(xd−1 S) ∩ I n+1 S + xd−1 I n−1 S] −λ[I n+1 S :(xd−1 S)∩I n S m∞ /(xd−1 S) ∩ I n+1 S + xd−1 (I n S :I n−1 S m∞ )] ≥ 0, since there is a map I n+1 S :(xd−1 S)∩I n S m∞ → (xd−1 S) ∩ I n S/(xd−1 S) ∩ I n+1 S + xd−1 I n−1 S with kernel [I n+1 S :(xd−1 S)∩I n S m∞ ] ∩ [(xd−1 S) ∩ I n+1 S + xd−1 I n−1 S] = (xd−1 S) ∩ I n+1 S + [I n+1 S :(xd−1 S)∩I n S m∞ ] ∩ xd−1 I n−1 S = (xd−1 S) ∩ I n+1 S + [xd−1 I n S :(xd−1 S)∩I n S m∞ ] ∩ xd−1 I n−1 S = (xd−1 S) ∩ I n+1 S + xd−1 (I n S :I n−1 S m∞ ), where the second equality holds because λ(I n+1 S/xd−1 I n S) < ∞. The following theorem shows that the ideal I enjoys nice properties when equality holds in the above inequality. It generalizes the classical result of [11] and [18]. − Theorem 4.2. Assume R is Cohen-Macaulay. let I be an R-ideal with ℓ(I) = d, Gd condition, ANd−2 and depth(R/I) ≥ min{1, dim R/I}. Then for a general minimal reduction J = (x1 , . . . , xd ) of I, one has that j1 (I) = λ(I/J) + λ[R/Jd−1 : I + (Jd−2 : I + I) : m∞ ] if and only if r(I) ≤ 1. In this case, the associated graded ring G is Cohen-Macaulay. Proof. By the proof of Theorem 4.1, if j1 (I) = λ(I/J) + λ[R/Jd−1 : I + (Jd−2 : I + I) : m∞ ] then for every n ≥ 1, the length λ[I n+1 S/JI n S + (xd−1 S : IS) ∩ I n+1 S] = 0. Hence I 2 ⊆ JI + (Jd−1 : I) ∩ I 2 = JI since (Jd−1 : I) ∩ I 2 = Jd−1 I by [19, Lemma 3.2]. Now the desired result follows from [15, Theorem 3.1]. GENERALIZED HILBERT COEFFICIENTS AND NORTHCOTT’S INEQUALITY 15 Corollary 4.3. Assume R is Cohen-Macaulay. let I be an R-ideal with ℓ(I) = d, Gd condition and weakly (d − 2) residually (S2 ). Then for a general minimal reduction J = (x1 , . . . , xd ) of I, one has (a) j1 (I) ≥ 0. (b) j1 (I) = λ[R/Jd−1 : I + (Jd−2 : I + I) : m∞ ] implies that I = J is a minimal reduction. (c) Assume R is excellent. Then j1 (I) = λ(I/J) implies that I is m-primary. (d) Assume R is excellent. Then j1 (I) = 0 if and only if I is a complete intersection. Proof. (a) and (b) are clear. Assume (c). Then λ[R/Jd−1 : I + (Jd−2 : I + I) : m∞ ] = 0, which implies Jd−1 : I + (Jd−2 : I + I) : m∞ = R. Since ℓ(I) = d, one has Jd−1 : I 6= R. Hence (Jd−2 : I + I) : m∞ = R, i.e., ht(Jd−2 : I + I) = d. Since R is excellent by [4], ht(Jd−2 : I + I) = max{ht I, d − 1} = d, which yields ht I = d, i.e., I is m-primary. The assertion (d) follows by (b) and (c). We remark that (a) and (d) recover the work on the positivity of j1 (I) by G. Colomé-Nin, C. Polini, B. Ulrich and Y. Xie [4]. We will finish the paper by an example from [4] which shows that if residual properties do not satisfy then the generalized Northcott’s inequality fails to hold. Example 4.4. Let R = kJx, yK/(x3 − x2 y) and J = (xyt ) for any t ≥ 0. Notice that R is an onedimensional Cohen-Macaulay local ring and ℓ(J) = 1. However, J does not satisfy G1 . By Macaulay2 [7], one sees that j0 (J) = t + 1, j1 (J) = 2 − t, which is strictly less than 0 if t > 2. R EFERENCES [1] R. Achilles and M. Manaresi, Multiplicity for ideals of maximal analytic spread and intersection theory, J. Math. Kyoto Univ. 33-4 (1993) 1029-1046. [2] M. Artin and M. Nagata, Residual intersections in Cohen–Macaulay rings, J. Math. Kyoto Univ. 12 (1972), 307–323. [3] C. Ciupercă, A numerical characterization of the S2 -ification of a Rees algebra, J. Pure and Applied Algebra 178 (2003), 25-48. [4] G. Colome Nin, C. Polini, B. Ulrich and Y. Xie, Generalized Hilbert coefficients and normalization of ideals, in progress. [5] H. Flenner and M. Manaresi, A numerical characterization of reduction ideals, Math. Z. 238 (2001), 205-214. [6] H. Flenner, L. O’Carroll and W. Vogel, Joins and intersections, Monographs in Mathematics, Springer-Verlag, Berlin, 1999. [7] D. R. Grayson and M. E. Stillman, Macaulay2, a software system for research in algebraic geometry, Available at http://www.math.uiuc.edu/Macaulay2. [8] J. Herzog, W.V. Vasconcelos and R.H. Villarreal, Ideals with sliding depth, Nagoya Math. J. 99 (1985), 159–172. [9] L. Ghezzi, S. Goto, J. Hong, K. Ozeki, T. T. Phuong and W. V. Vasconcelos, Cohen-Macaulayness versus the vanishing of the first Hilbert coefficient of parameter ideals, J. London Math. Soc. 81 (2010), 679-695. [10] S. Huckaba, A d-dimensional extension of a lemma of Huneke’s and formulas for the Hilbert coefficients, Proceedings of the American Mathematical Society 124 (1996), 1393-1401. [11] C. Huneke, Hilbert functions and symbolic powers, Michigan Math. J. 34 (1987), 293-318. [12] C. Huneke, Strongly Cohen-Macaulay schemes and residual intersections, Trans. Amer. Math. Soc. 277 (1983), 739-763. [13] C. Huneke and I. Swanson, Integral closure of ideals, rings, and modules, London Mathematical Society Lecture Note Series 336, Cambridge University Press, Cambridge, 2006. [14] C. Huneke, B. Ulrich, Residue intersections, J. Reine Angew. Math, 390 (1988), 1-20. [15] M. Johnson and B. Ulrich, Artin–Nagata properties and Cohen–Macaulay associated graded rings, Compositio Math. 103 (1996), 7–29. 16 Y. XIE [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] P. Mantero and Y. Xie, Generalized stretched ideals and Sally’s conjecture, Submitted. K. Nishida and B. Ulrich, Computing j-multiplicities, J. Pure Appl. Algebra 214 (2010), 2101–2110. A. Ooishi, ∆-genera and sectional genera of commutative rings, Hiroshima Math. J. 17 (1987), 361–372. C. Polini and Y. Xie, j-multiplicity and depth of associated graded modules, J. Algebra. 372 (2012), 35-55. C. Polini and Y. Xie, Generalized Hilbert functions, to appear in Comm. Algebra. M. E. Rossi and G. Valla, Hilbert functions of filtered modules, Lecture Notes of the Unione Matematica Italiana 9, Springer-Verlag, Berlin, UMI, Bologna, 2010. N. V. Trung, Constructive characterization of the reduction numbers, Compositio Math. 137 (2003), 99–113. B. Ulrich, Artin-Nagata properties and reductions of ideals, Contemp. Math. 159 (1994), 373–400. W.V. Vasconcelos, The Chern coefficients of local rings, Michigan Math. J. 57 (2008), 725–743. P. Valabrega and G. Valla, Form rings and regular sequences, Nagoya Math. J. 72 (1978), 91–101. Y. Xie, Formulas for the multiplicity of graded algebras, Trans. Amer. Math. Soc. 364 (2012), 4085-4106 D EPARTMENT OF M ATHEMATICS AND S TATISTICS , P ENN S TATE A LTOONA , A LTOONA , P ENNSYLVANIA 16601 E-mail address: [email protected]
0math.AC
1 Stationary time-vertex signal processing arXiv:1611.00255v2 [cs.LG] 23 May 2017 Andreas Loukas∗ and Nathanaël Perraudin∗ École Polytechnique Fédérale Lausanne, Switzerland Abstract—The goal of this paper is to improve learning for multivariate processes whose structure is dependent on some known graph topology; especially when the number of available samples is much smaller than the number of variables. Typically, the graph information is incorporated into the learning process via a smoothness assumption postulating that the values supported on well-connected vertices exhibit small variations. We argue that smoothness is not enough. To capture the behavior of complex interconnected systems, such as transportation and biological networks, it is important to train expressive models, being able to reproduce a wide range of graph and temporal behaviors. Motivated by this need, this paper puts forth a novel definition of time-vertex wide-sense stationarity, or joint stationarity for short. We believe that the proposed definition is natural, at it intimately relates to existing definitions of stationarity in the time and vertex domains. We use joint stationarity to regularize learning and to reduce computational complexity in both estimation and recovery tasks. In particular, we show that for any jointly stationary process: (a) one can learn the covariance structure from O(1) samples, and (b) can solve MMSE recovery problems, such as interpolation, denoising, forecasting, in complexity that is linear to the edges and timesteps. Experiments with three datasets suggest that joint stationarity can yield significant accuracy improvements in the reconstruction effort of under-sampled problems, even when the graph is only approximately known or the process is only close to stationary. Index Terms—stationarity, multivariate time-vertex processes, harmonic analysis, graph signal processing, PSD estimation. I. I NTRODUCTION NE of the main challenges when working with multivariate processes is to learn their statistical structure from few realizations of the process (samples). Concretely, suppose that we wish to estimate the first two moments of a process X ∈ RN ×T , where N is the number of variables and T the number of timesteps. If no restricting assumptions are made (other than the first four moments are finite) then the number of samples needed to attain statistical significance is up to a logarithmic factor proportional to O(N T ), the degrees of freedom [1]. Assuming that the process is time wide-sense stationarity (TWSS) is very helpful as it reduces the degrees of freedom of the system –and thus the sample requirement– by a factor of T . Even a linear dependency on N however is often problematic in practice, when the number of variables is large and the ability to obtain multiple samples limited. The goal of this paper is to improve learning for the specific cases when the multivariate process is supported on the vertex set and is statistically dependent on the edge set of some known graph topology. Whether examining epidemic spreading [2], how traffic evolves in the roads of a city [3], or neuronal activation patterns present in the brain [4], many of O ∗ A. Loukas and N. Perraudin contributed equally to this work. the high-dimensional processes one encounters are inherently constrained by some underlying network. This realization has been the driving force behind recent efforts to re-invent classical models by taking into account the graph structure, with advances in many problems, such as denoising [5] and semi-supervised learning [6], [7]. Yet, state-of-the-art models for processes (evolving) on graphs often fail to produce useful results when applied to real datasets. One of the main reasons for this shortcoming is that they model only a limited set of (smooth) spatio-temporal behaviors. The well-used graph Tikhonov and total variation priors for instance assume that the signal varies slowly or in a piece-wise constant manner over edges, without specifying any precise relations [8], [9]. Similarly, assuming that the graph Laplacian encodes the conditional correlations of variables, as is done with Gaussian Markov Random Fields [10], works well when the graph is not available, but becomes a rigid model when the graph is given [11]. To capture the behavior of complex networked systems, such as transportation and biological networks, it is important to train expressive models, being able to reproduce a wide range of graph and temporal behaviors. Motivated by this need, this paper considers the statistical modeling of processes evolving on graphs. Our results are inspired by the recent introduction of a joint temporal and graph Fourier transform (JFT), a generalization of GFT appropriate for time-varying graph signals [12], [13], and the recent generalization of stationarity for graphs [14], [15], [16]. Our main contribution is a novel definition of time-vertex widesense stationarity, or joint stationarity for short. We believe that the proposed definition is natural, at it elegantly relates to existing definitions of stationarity in the time and vertex domains. We show that joint stationarity carries along important properties classically associated with stationarity: joint wide-sense stationary (JWSS) processes can be generated by filtering noise, and a joint Fourier transform diagonalizes their covariance. Furthermore, our definition is intimately linked with the familiar definitions for stationarity of multivariate time and graph processes. We use the hypothesis of joint stationarity to regularize learning and to reduce computational complexity in both estimation and recovery tasks. Within our framework, one learns the covariance structure of a JWSS process from O(1) samples and recovery (such as interpolation, denoising, forecasting) comes with a computational complexity that is close to linear on the number of edges and timesteps. In addition, we find that assuming joint stationarity aids in recovery even when only an approximation of the graph is known, or the process is only approximately jointly stationary. We therefore propose our model as good candidate for graph-related problems featuring 2 a large number of variables with only a limited number of learning samples. To test the utility of joint stationarity, we apply our methods on three diverse datasets: (a) a meteorological dataset depicting the hourly temperature of 32 weather stations over one month in Molene, France, (b) a traffic dataset depicting high resolution daily vehicle flow of 4 weekdays in the highways of Sacramento, and (c) simulated SIRS-type epidemics over Europe. Our experiments confirm that in the few samples regime, assuming joint stationarity yields an improvement in recovery performance as compared to time- or vertex-based methods, even when the graph is only approximately known and the data violate the strict conditions of our definition. A. Related work II. P RELIMINARIES We consider signals supported on the vertices V = {v1 , v2 , . . . , vN } of a weighted undirected graph G = (V, E, WG ), with E the set of edges of cardinality E = |E| and WG the weighted adjacency matrix. Suppose that signal xt is sampled at T successive regular intervals of unit length. The time-vertex signal X = [x1 , x2 , . . . , xT ] ∈ RN ×T is then the matrix having graph signal xt as its t-th column. Throughout this paper, we denote as x = vec(X) (without subscript) the vectorized representation of the matrix X. Harmonic time-vertex analysis. The frequency representation of a time-vertex signal X is given by the Joint Fourier Transform [13] (or JFT for short) ∆ There exists an extensive literature on multivariate stationary processes, developing the original work of Wiener et al. [17], [18]. The reader may find interesting Bloomberg’s book [19] focusing on the spectral relations. We focus on two main approaches that relate to our work, graphical models and signal processing on graphs. Graphical models. In the context of graphical models, multivariate stationarity has been used jointly with a graph in the work of [20], [21]. Though relevant, we note that there is a key difference of these models with our approach: we assume that the graph is given, whereas in graphical models the graph structure (or more precisely the precision matrix) is the learned from the data. Knowing the graph allows us to search for more involved relations between the variables. As such, we are not restricted to the case that the conditional dependencies are given by the graph (and therefore that they are sparse), but allow non-adjacent variables to be conditionally dependent, modeling a wider set of behaviors. We also note that our approach is eventually more scalable. We refer to [11] for elements of connections between graphical models and graph signal processing. Graph signal processing. The idea of studying the stationarity of a random vector with respect to a graph was first introduced by Girault et al. [15], [22] and then by Perraudin et al. [14]. While these contributions have different starting points, they both propose the same definition, i.e., the one we generalize in this contribution. Other recent contributions relating to stationarity on graphs are [16], [23]. Despite the relevance of these works, it is important to stress that this paper is the first to consider processes that are varying both in the vertex and time domains. In addition, the analysis presented here (particularly that of Section IV-C) is novel and can also be employed for the previously studied case of graph stationary processes [15], [22], [16]. We also note that the task of prediction using the two first statistical moments for time-evolving signal on graphs was also considered in [24], [25]. Nonetheless, there are a number of differences with these works, with the most important being that we define joint stationarity, and that we are not restricted to the causal case. It should be noted that some results of this paper appeared in a conference paper [26]. X̂ = JFT{X} = GFT{DFT{X}} = UG∗ X(UT∗ )| , (1) with UG and UT being, respectively, the unitary Graph Fourier Transform (GFT) and Discrete Fourier Transform (DFT) matrices. The notation UG∗ denotes the transposed complex conjugate of UG , UT| the transpose of UT , and (UT∗ )| the complex conjugate of UT . In vector form, we have that ∆ x̂ = JFT{x} = UJ∗ x, where UJ = UT ⊗ UG and operator (⊗) denotes the Kronecker product. As is often the case, we choose UG to be the eigenvector matrix of the combinatorial1 graph Laplacian matrix LG = diag(WG 1N ) − WG , where 1N is the all-ones vector of size N , and diag(WG 1N ) is the diagonal degree matrix. On the other hand, matrix UT is the eigenvector matrix of the Laplacian matrix LT of a cyclic graph and UT∗ [t, τ ] = e−jωτ t √ , T with ωτ = 2π(τ − 1) , T (2) for t, τ = 1, 2, . . . , T . Note that X̂[n, τ ] is the Fourier coefficient associated with the joint frequency [λn , ωτ ], where λn denotes the n-th graph eigenvalue and ωτ the τ -th angular frequency. For an in-depth discussion of JFT and its properties, we refer the reader to [13], [27]. Joint time-vertex filtering. Filtering a time-vertex signal x with a joint filter h(LG , LT ) corresponds to element-wise multiplication in the joint frequency domain [λ, ω] by a function h : [0λmax ] × [−1, 1] 7→ R [28], [29], [13], [27]. When a joint filter h(LG , LT ) is applied to x, the output is h(LG , LT ) x = UJ h(ΛG , Ω) UJ∗ x, (3) where ΛG ∈ RN ×N and Ω ∈ RT ×T are diagonal matrices with ΛG [n, n] = λn and Ω[τ, τ ] = ωτ , whereas h(ΛG , Ω) is a diagonal N T × N T matrix defined as   h(λ1 , ω1 ) · · · h(λ1 , ωT )   .. .. .. h(ΛG , Ω) = diag  . . . h(λN , ω1 ) · · · h(λN , ωT ) 1 Though we use the combinatorial Laplacian in our presentation, our results are applicable to any positive semi-definite matrix definition of a graph Laplacian or to the recently introduced shift operator [9]. 3 and the diag(A) operator creates a matrix with diagonal elements the vectorized form of A. For convenience, we will often abuse notation and write h(θn,τ ) to refer to h(λn , ωτ ). Furthermore, we say that a joint filter is separable, if its joint frequency response h can be written as the product of a frequency response h1 defined solely in the vertex domain and one h2 in the time domain, i.e., h(θ) = h1 (ω) · h2 (λ). III. J OINT T IME -V ERTEX S TATIONARITY Let X ∈ RN ×T be a discrete multivariate stochastic process (with finite number of time-steps T ) that is indexed by the vertex vi of graph G and time t. We refer to such processes as time-vertex processes, or joint processes for short. Our objective is to provide a definition of stationarity that captures statistical invariance of the first two moments of a joint process x = vec(X) ∼ D(x̄, Σ), i.e., the mean x̄ = E[x] and the covariance Σ under distribution D. Crucially, the definition should do so in a manner that is faithful to the graph and temporal structure. Typically, wide-sense stationarity is thought of as an invariance of the two first moments of a process with respect to translation. For the first moment things are straightforward: stationarity implies a constant mean E[x] = c1, independently of the domain of interest. The second moment however is more complicated as it depends on the exact form translation takes in the particular domain. Unfortunately, for graphs translation is a non-trivial operation and three alternative translation operators exist: the generalized translation [30], the graph shift [9], and the isometric graph translation [22]. Due to this challenge, there are currently three alternative definitions of stationarity appropriate for graphs [14], [15], [16], one for each definition of translation. The ambiguity associated with translation on graphs urges us to seek an alternative starting point for our definition. Fortunately, there exists an interpretation which holds promise: up to its constant mean, a wide-sense stationary process corresponds to a white process filtered linearly on the underlying space. This “filtering interpretation” of stationarity is well known classically2 and is equivalent to asserting that the second moment can be expressed as Σ = h(LT ), where h(LT ) is a linear filter. Thankfully, not only filtering is elegantly and uniquely defined for graphs [30], but also stating that a process is graph wide-sense stationary iff E[x] = c1N and Σ = h(LG ) is a graph filter, is generally consistent3 with current definitions [14], [15], [16]. This motivates us to also express the definition of stationarity for joint processes in terms of joint filtering. Definition 1 (Joint stationarity). A joint process x = vec(X) is called Jointly Wide-Sense Stationary (JWSS), if and only if (a) The first moment of the process is constant E[x] = c1N T . 2 As the correlation between two instants t and t depends only on the 1 2 difference between these two instants E[x[t1 ]x[t2 ]] − E[x[t1 ]] E[x[t2 ]] = γ[t1 − t2 ], the covariance matrix has to be circulant, a property that is shared by linear filters. 3 The only exception: for graphs with repeated eigenvalues, the conditions E[x] = c1 and Σ = h(LG ) are sufficient but not necessary for Girault’s graph stationarity definition [15]. (b) The covariance matrix of the process is a graph filter Σ = h(LG , LT ), where h(·, ·) is a non-negative real function referred to as joint power spectral density (JPSD). Let us examine Definition 1 in detail. First moment condition. As in the classical case, the first moment of a JWSS process has to be constant over the time and the vertex sets, i.e., X̄[i, t] = c for every i = 1, 2, . . . , N and t = 1, 2, . . . , T . For alternative choices of the graph Laplacian with a null-space not spanned by the constant vector, the first moment condition should be modified to requiring that the expected value of a JWSS process is in the null space of the matrix LT ⊕ LG (see Remark 1 [16] for a similar observation on graph processes). Second moment condition. According to the definition, the covariance matrix of a JWSS process takes the form of a joint filter h(LG , LT ), and is therefore diagonalizable by the JFT matrix UJ . It may also be intesting to notice that the matrix h(LG , LT ) can be expressed as follows   H1,1 H1,2 · · · H1,T  H2,1 H2,2 H2,T    Σ = h(ΛG , Ω) =  .  . (4) .. ..  ..  . . HT,1 where Ht1 ,t2 = H1,2 ··· HT,T T 1 X hω (LG ) ejωτ (t1 −t2 ) T τ =1 τ (5) and hωτ (LG ) is the graph filter hωτ = h(λ, ωτ ). Being a covariance matrix, h(LG , LT ) must necessarily be positivesemidefinite; thus h(·, ·) is real (the eigenvalues of every hermitian matrix are real) and non-negative. Also equivalently, that every zero mean JWSS process x = vec(X) can be generated by joint filtering x = h(LG , LT )1/2 ε a white process ε with zero mean and identity covariance. The following theorem exploits these facts to provide an interpretation of JWSS processes in the joint frequency domain. Theorem 1 (Frequency interpretation). A joint process X over a connected graph G is Jointly Wide-Sense Stationary (JWSS) if and only if: (a) The joint spectral modes are in expectation zero h i E X̂[n, τ ] = 0 if λn 6= 0 and ωτ 6= 0. (b) The joint graph spectral modes are uncorrelated h i E X̂[n1 , τ1 ]X̂[n2 , τ2 ] = 0, whenever n1 6= n2 or τ1 6= τ2 . (c) There exists a non-negative function h(·, ·), referred to as joint power spectral density (JPSD), such that h i h i2 E X̂[n, τ ]2 − E X̂[n, τ ] = h(λn , ωτ ), for every n = 1, 2, . . . , N and τ = 1, 2, . . . , T . (For clarity, this and other proofs of the paper have been moved to the appendix.) 4 There are two, slightly technical, points that should be clarified here. First, for real processes X, which are the focus of this paper, the function h forming the joint filter should be symmetric w.r.t. ω, meaning that h(λ, ω) = h(λ, −ω). This property can be easily derived from the definition of the Fourier transform. Second, whenever the graph Laplacian features repeated eigenvalues, the degrees of freedom of h decrease, as necessarily h(λ1 , ω) = h(λ2 , ω) when λ1 = λ2 . This restriction is motivated by two observations: (a) For an eigenspace with multiplicity greater than one, there exists an infinite number of possible eigenvectors corresponding to the different rotations in the space and the JPSD is in general illdefined. The condition h(λ1 , ω) = h(λ2 , ω) when λ1 = λ2 deals with this ambiguity, as it ensures that the JPSD is the same independently of the choice of eigenvectors. (b) If one were to pick a ring graph and only one time step (T = 1), this condition ensures that joint stationarity is equivalent to classic stationarity in the periodic discrete case. We refer to [14, Section III B] for a detailed discussion. We briefly present two additional properties of JWSS processes that will be useful in the rest of the paper. Property 1 (White noise). White centered i.i.d. noise w ∈ RN T ∼ D(0N T , IN T ) is JWSS with constant JPSD for any graph. The proof follows easily by noting that the covariance of w is diagonalized by the joint Fourier basis of any graph Σw = I = UJ IUJ∗ . This last equation tells us that the JPSD is constant, which implies that similar to the classical case, white noise contains all joint frequencies. A second interesting property of JWSS processes is that stationarity is preserved through a filtering operation. structure, as Σt1 ,t2 = Σδ,1 = Γδ , where δ = t1 − t2 + 1. Hence the covariance matrix can be written as   Γ1 Γ2 · · · ΓT  ΓT Γ1 ΓT −1    Σx =  . , .. . ..  ..  . Γ2 Γ3 ··· Γ1 implying that correlations only depend on δ and not on any time localization. This property is shared by multivariate time wide sense stationary processes. Definition 2 (Multivariate time stationarity). A joint process X is Time Wide-Sense Stationary (MTWSS), if and only if the following two properties hold (a) The expected value is constant as E[xt ] = c1 for all t. (b) For all t1 , t2 the second moment satisfies Σt1 ,t2 = Σδ,1 = Γδ , where δ = t1 − t2 + 1. Similarly to the univariate case, the Time Power Spectral Density (TPSD) is defined so as to encode the statistics of the process in the spectral domain: Γ̂τ = T X Γδ e−jωτ δ (6) δ=1 We can also obtain the TPSD of a JWSS process by constructing a graph filter from h while fixing ω. Setting hωτ (λ) = h(λ, ωτ ), the TPSD of a JWSS process is Γ̂τ = hωτ (LG ). A. Relations to classical definitions 2) JWSS ⊂ VWSS. It follows from Definition that, for a JWSS process, each block of Σ has to be a linear graph filter, i.e., Σt1 ,t2 = γt1 ,t2 (LG ). Hence, the covariance matrix can be written as   γ1,1 (LG ) γ1,2 (LG ) · · · γ1,T (LG )  γ2,1 (LG ) γ2,2 (LG )    Σ= . .. . . . .   . . . γT,1 (LG ) · · · γT,T (LG ) We next provide an in depth examination of the relations between joint stationarity, the classical definition of time stationarity and that of vertex stationarity. If no assumptions are made about the process, the covariance is simply   Σ1,1 Σ1,2 · · · Σ1,T  Σ2,1 Σ2,2    Σ= . . . .. ..   ..  . The concept of stationarity has been generalized to graph signals [14], [15], [16]. For no repeated eigenvalues, all the above state that a random signal is stationary on a graph if its expected value is constant on the vertex set, and the covariance matrix is jointly diagonalizable with the Laplacian, i.e., Σxt = h(LG ). This notion of stationarity does not apply to time evolving processes as it does not characterize the correlation between different time-steps. As a result, we present here a generalization of this framework to timeseries on a graph. Property 2. When a joint filter f (LG , LT ) is applied to a JWSS process X with JPSD h, the result Y remains JWSS with mean cf (0, 0)1N T and JPSD f 2 (λ, ω) h(λ, ω). ΣT,1 ··· ΣT,T When assuming that a process is JWSS, we in fact enforce that the statistical relation of variables at a given time-step Σt1 ,t1 and those across different timesteps Σt1 ,t2 should depend on the graph, as well as the time difference t1 − t2 . The properties of the covariance matrix of a JWSS process can be decomposed into time and vertex dependencies. 1) JWSS ⊂ TWSS. Similar to time stationary processes, the covariance Σ of a JWSS process has a block circulant Definition 3 (Multivariate vertex stationarity). A joint process X = [x1 , x2 , . . . , xT ] is called Multivariate Vertex WideSense Stationary (MVWSS), if and only if the following two properties hold independently: (a) The expected value is of the signal is constant E[xt ] = ct 1 for all t. (b) For all t1 and t2 , we have Σt1 ,t2 , there exist a kernel γt1 ,t2 such that Σt1 ,t2 = γt1 ,t2 (LG ). 5 3) JWSS = TWSS ∩ VWSS. As shown next, the two definitions taken together are equivalent to that of joint stationarity. Theorem 2. A joint process X is JWSS if and only if it is both MTWSS and MVWSS. In other words, the set of processes that are JWSS are exactly those that are statistically invariant in the temporal and vertex domains. has zero mean and identity covariance. Then, the complex random variable ε̂ is the JFT coefficient of ε corresponding to h frequencies i λ and ω. The bias follows by noting that E ε̂(k) ε̂∗(k) = 1, for every k. The variance is computed similarly by exploiting the fact that different terms in the sum are independent  as they correspond to distinct realizations and setting γ = E |ε̂|4 . For the standard case of a Gaussian joint process, we provide an exact characterization of the distribution. IV. J OINT P OWER S PECTRAL D ENSITY ESTIMATION The joint stationarity assumption can be very effective in overcoming the challenges associated with dimensionality. The main reason is that, for JWSS processes, the estimation variance is decoupled from the problem size. Concretely, suppose that we want to estimate the covariance matrix Σ of a joint process x = vec(X) from K samples x(1) , x(2) , . . . , x(K) . As we show in the following, if the process is JWSS such that Σ = h(LG , LT ), estimation is possible from K = O(1) samples! This is a sharp decrease from the classical and MTWSS settings, for which K ≈ N T and K ≈ N samples are necessary4 , respectively. This section presents two JPSD estimators requiring constant number of samples. The first provides unbiased estimates at complexity that is O(N 3 T log(T )). The second estimator, decreases further the estimation variance at a cost of a bounded bias, and can be approximated at complexity linear to ET . Corollary 1. For every Gaussian JWSS process, the sample JPSD estimate follows a Gamma distribution with shape K/2 and scale 2h(θ)/K. The estimation error variance is equal to h i Var ḣ(θ) = 2 h2 (θ)/K. Proof. We continue in the context of the proof of Theorem 3. For a Gaussian distribution, ε̂ is centered and scaled Gaussian and thus ε̂2 is a chi-squared random variable with 1 degree of freedom. Our estimate is therefore a scaled sum of i.i.d. chisquared variables and corresponds to a Gamma distribution. The corollary then follows directly. A. Sample JPSD estimator Observe that the variance depends linearly on the fourth other moment of |ε̂| (see proof of Theorem 3) and is inversely proportional to the number of samples, but it is independent of N and T . In the following, we show how to achieve an even smaller variance by exploiting the properties of h(θ). In addition, we reduce the estimation accuracy by avoiding to perform an eigenvalue decomposition. We define the “sample JPSD estimator” for every graph frequency λn and temporal frequency ωτ as the estimate B. Convolutional JPSD estimator 2 K X JFT{X(k) }[n, τ ] ∆ . ḣ(λn , ωτ ) = K (7) k=1 In case the process does not have zero mean, it should be ∗ centered P by subtracting the constant signal c 1N 1T , where c = k,i,t X(k) [i, t]. For simplicity, suppose that the process is correctly centered. As the following theorem claims, the sample JPSD estimator is unbiased and its variance decreases linearly with the number of samples K. Theorem 3. For every distribution with bounded second and fourth order moments, the sample JPSD estimator ḣ(θ) h i (a) is unbiased, i.e., E ḣ(θ) = h(θ), and h i γ−1 , (b) has variance Var ḣ(θ) = h2 (θ) K where constant γ depends only on the distribution of x. Proof. For any θ = [λ, ω], the sample estimate is ḣ(θ) = h(θ) K X ε̂(k) ε̂∗(k) k=1 K , (8) with ε̂(k) being independent realizations of ε̂, a zero mean complex random variable with unit variance. To see this, write x = h(LG , LT )1/2 ε, where the random vector ε 4 The number of samples needed for obtaining a good sample covariance matrix of an n-dimensional process is O(n log n) [1], [31]. When the number of available signals K is very small (even 1), we need an additional assumption on the correlations to obtain reasonable estimates. To this end, we next present a parametric JPSD estimator that allows us to trade off variance for bias. Before delving into JWSS processes, it is helpful to consider the purely temporal case. For a TWSS process it is customary to assume that the autocorrelation function has support L that is a few times smaller than T . Then, cutting the signal into TL smaller parts and computing the average estimate, reduces the variance (by a factor of TL ), without sacrificing frequency resolution. This basic idea stems from two established methods used to estimate the PSD of a temporal signal, namely Bartlett’s and Welch’s methods [32], [33]. The act of averaging across different windows is in fact equivalent to a convolution in the spectral domain. Convolving the TPSD with a window, results in attenuation of the correlation for large delays, enforcing localization in the time domain. Motivated by the observation that convolution with a window in the graph frequency domain also encourages localization in the vertex domain when the operation can be approximated by a polynomial with bounded order [30, Theorem 1 and Corollary 2], Perraudin and Vandergeynst proposed to reduce the estimation variance by convolving the sample GPSD [14]. In the following, we extend this idea to the joint domain. Concretely, Let g(θ) be a 2D window defined in the 6 joined frequency domain. We define our convolutional JPSD estimator as ∆ ḧ(θ) = N,T 1 X g(θ − θn,τ )2 ḣ(θn,τ ), cg (θ) n=1 (9) τ =1 ∆ where, cg (θ) = n,τ g(θ − θn,τ )2 is a normalization factor that depends on the θ = (λ, ω) frequency pair (since the graph eigenvalues are generally irregularly spaced). Moreover, ḣ(θn,τ ) is the sample estimate defined in (7). Further implementation specifics, including a discussion on the choice of the 2D window g, are given in Section IV-C. The convolutional JPSD estimator is a generalization of known PSD estimators for TWSS and GWSS processes. Denote by φ the dirac function. We have that: (a) For g(θ) = φ(λ)·gT (ω), we recover the classical TPSD estimator, applied independently for each λ. (b) For g(θ) = gG (λ) · φ(ω), we recover the GPSD estimator from [14] applied independently for each ω. To provide a meaningful bias analysis, we introduce a Lipschitz continuity assumption on the JPSD, matching the intuition that localized phenomena tend to have a smooth representation in the frequency domain. P Theorem 4. The convolutional JPSD estimator ḧ(θ) (a) has bias h i E ḧ(θ) − h(θ) ≤ T,N X  g(θ − θn,τ )2 kθ − θn,τ k2 , cg (θ)n=1,τ =1 where  is the Lipschitz constant of h(θ), and (b) when the entries of X̂ are independent random variables, its variance is h i X g(θ − θ )4 h i n,τ Var ḧ(θ) = Var ḣ(θ ) , n,τ cg (θ)2 n,τ h i where Var ḣ(θn,τ ) is the variance of the sample JPSD estimator at θn,τ . Proof. The derivations of the bias and variance are given in Lemmas 1 and 2, respectively. |S| in total) and zero otherwise. The independence condition required by the variance clause of the theorem is satisfied since x̂ is Gaussian (as a rotation x̂ = UJ∗ x of a Gaussian vector) with diagonal covariance. The above result suggests that, by selecting our window (bandwidth) we can trade off bias for variance. The trade-off is particularly beneficial as long as (a) the JPSD is smooth, and (b) the graph eigenevalues are clustered, such that |S|  B. We also note that a special case of our results (T = 1) is novel also for the purely graph setting [14]. C. Fast implementation Having defined the convolutional JPSD estimator, we turn to its computation. A straightforward implementation requires: O(N 3 ) operations for computing the eigenbasis of our graph, O(N 2 × KT ) for performing KT independent GFT, O(T log(T ) × KN ) for KN independent FFT, and O(N 2 T 2 ) for the convolution. This section describes how to approximate a convolutional estimate using a number of operations that is linear to ET . Before describing the exact algorithm, we note two helpful properties of the estimator. First, we can compute ḧ(θ) by obtaining estimates for each X(k) independently and then averaging over k: XX 1 g(θ − θn,τ )2 |JFT{X(k) }[n, τ ]|2 ḣ(θn,τ ) = K cg (θ) n,τ k As we will see in the following, the terms inside the outer sum can be approximated efficiently, avoiding the need for an expensive JFT. In addition, when the convolution window is separable, i.e., g(θ) = gG (λ) · gT (ω), as is assumed here, the joint convolution can be performed independently (and at any order) in the time and vertex domains ! X gT (ω − ωτ )2 X gG (λ − λn )2 ḧ(θ) = ḣ(θn,τ ) , cgT (ω) cgG (λ) τ n where cg (θ) = cgT (ω) · cgG (λ). Exploiting this property, we treat the implementation of the two convolutions separately and the presented algorithms can be combined in any order. with set S = {θn,τ | kθn,τ − θk2 ≤ B/2} and h2S = P h(θn,τ )2 . θn,τ ∈S |S| Fast time convolution. This is the textbook case of TPSD estimation, that is solved by the Welch’s method [33]. The method entails splitting each timeseries into equally sized overlapping segments, and averaging over segments the squared amplitude of the Fourier coefficients. The procedure is equivalent to an averaging (over time) of the squared coefficients of a Short Time Fourier Transform (STFT), with half overlapping windows wT defined such that DFT{wT (t)} = gT (ω) [34], [35]. Let L be the support of the autocorrelation, or equivalently the number of frequency bands. We suggest using the iterated sine window  (  2 sin 0.5π cos (πt/L) if t ∈ [−L/2, L/2] ∆ wT (t) = 0 otherwise, Proof. The results follow from Theorem 4 and Corollary 1 by noting that when a disc window is used: (a) cg (θ) = |S|, and (b) g(θ − θn,τ )2 = 1 for all n, τ in the window (there are as it turns the STFT into a tight operator. In order to get an estimate of ḧ at unknown frequencies, we interpolate between the L known points using splines [36]. Let us consider as an example the case of a Gaussian JWSS process and a disc window with bandwidth B, i.e., gB (θ) = 1 if kθk2 ≤ B2 and 0, otherwise. Though not necessarily localized in the graph domain, we choose here a disc window because it leads to simple and intuitive estimates. Corollary 2. For every -Lipschitz Gaussian JWSS process and disc window gB (θ), the convolutional estimate has h i h i B 2 h2S E ḧ(θ) − h(θ) ≤ and Var ḧ(θ) = , (10) 2 K|S| 7 Fast graph convolution. Inspired by the technique of [14], we perform the graph convolution using an approximated graph filtering operation [37] that scales linearly to the number of graph edges E. In particular, N X gG (λ − λn )2 kgG (LG − λIN ) xτ k22 ḣ(θn,τ ) = . cgG (λ) cgG (λ) n=1 (11) We suggest using the Gaussian window 2 2 ∆ gG (λn − λ) = e−(λn − λ) /σ , f (y) = W y + b. The minimum mean-squared linear estimate is then known to be ẋ = Σxy Σ−1 y (y − ȳ) + x̄. (14) Above, Σy = AΣA∗ + Σw and Σxy = ΣA∗ . Obtaining ẋ therefore entails solving a linear system in matrix Σy , that -naively approached- has O(N 2 T 2 ) complexity. In addition, especially in the noise-less case, the condition number of Σy can be infinite, rendering direct inversion unfeasible. (12) with σ 2 = 2(F + 1)λmax /F 2 . As we did before, we only compute the above for F = O(1) different values of λ and approximate the rest using splines. As the eigenvalues are not known, we need a stable way to estimate cgG (λ). We obtain an unbiased estimate by filtering Q = O(1) random Gaussian signals on the graph ε ∈ RN ∼ N (0, IN ), such that # " Q X 2 cgG (λ) = E kgG (LG − λIN )ε(q) k2 , (13) q=1 PN with variance equal to 2 n=1 g 4 (λn − λ)/Q. We omit the analysis, as it is similar to that in Theorem 3. According to our numerical evaluation, the approximation error introduced by the latter estimator and spectral filtering is almost negligible for smooth JPSD. Complexity. The computational cost of the above methods is: (a) O(T KF × E + QF × E) = O((T K + Q)EF ) for the fast graph convolutions. Here, the T K and Q convolutions are performed in order to estimate the quantities at (11) and (13) for F different values of λ. (b) O(N K × T log(L)) for the fast time convolution, corresponding to N K STFT. Thus, in total the complexity of the fast convolutional JPSD estimator is O(T KF E + QEF + N KT log(L)). Furthermore, when Q, F, K are constants, the complexity simplifies to O(T E + N T log(L)). We remark that, though asymptotically superior, the fast implementation can be significantly slower when the number of variables is small. Our experiments demonstrate that it should be preferred for N larger than a few thousands (see Figure 2). V. R ECOVERY OF JWSS P ROCESSES This section considers the MMSE problem of recovering a hidden JWSS process x = vec(X) from linear measurements y corrupted by a zero-mean JWSS process w:   min E kf (y) − xk22 f :RN →RN (P0) subject to y = Ax + w We remark that (a) for A binary diagonal and w = 0, (P0) is an interpolation problem, (b) for A diagonal with Aii = 1 if i ≤ N t and zero otherwise and w = 0 it corresponds to forecasting, and (c) for A = I and w white noise (P0) is a denoising problem. Since the solution of (P0) is in general distribution dependent, we additionally postulate that the function f is linear on y, i.e., there exists a matrix W and a vector b such that We next discuss how to deal with these issues: Decreasing the complexity. Thankfully, even if Σy is not always sparse, we can approximate its multiplication by a vector very efficiently as (a) A usually is very sparse, and (b) per our assumption Σ and Σw are joint filters and therefore they can be implemented at complexity that is (up to logarithmic factors) linear to the number of edges E and timesteps T [12], [29], [27]. Therefore, if we employ an iterative method such as the (preconditioned) conjugate gradient to compute the solution, the complexity of each iteration will be almost linear on the problem size. Singular or badly conditioned Σy . In this case, we choose the solution with the minimal residual ẋ = Σxy Σ+ y (y − ȳ) + x̄. (15) Instead of solving the normal equations ẋ = Σxy (Σ2y )−1 Σy (y − ȳ) + x̄, which has the effect of significantly increasing the condition number of our matrix, we suggest to employ the minimal residual conjugate gradient method for symmetric matrices [38]. The latter, though it is guaranteed to converge in at most N T iterations, has often much faster convergence. For badly conditioned covariance matrices, an alternative solution is to rewrite the problem as a regularized least squares problem min kAz − yk22 + khw (LG , LT ) z∈RN 1/2 hx (LG , LT )− /2 (z − x̄)k22 1 (16) and solve it using a fast iterative shrinkage-thresholding algorithm (FISTA) scheme [39], [40], [41]. This problem was shown to converge to the correct solution when w is white noise [14]. There is a good reason for transforming the problem in this way: the FISTA convergence is a linear function of 2 kA∗ Ak2 , i.e., the Lipschitz constant of the gradient of kAz − yk22 , but not the condition number of hw (LG , LT ) and hx (LG , LT ) [42]. As such, it convergences faster when the conditioning of Σy is very poor and A is well behaved. Similarly, in the noise-less case one solves min z∈RN /2 kh− (LG , LT ) (z − x̄) k22 x 1 (17) subject to Az = y, using a Douglas-Rachford scheme [43]. A special case. When matrix A is a joint filter and therefore A = a(LG , LT ), the solution can be obtained by a single 8 128 128 128 128 0.09 0.3 0.07 F 0.2 8 0.2 8 8 0.1 2 8 32 32 2 0.05 2 2 8 L 32 2 2 8 L (a) estimation error 4 8 0.06 0.1 2 2 6 0.08 32 F 32 F 32 F 0.3 32 2 8 L (b) bias 32 L (c) variance (d) execution time (sec) Fig. 1: Influence of the parameters (window size L and number of graph filters F ) on the (a) estimation error, (b) bias, (c) normalized std. dev., and (d) execution time. For improved visibility, the scale of (c) has been changed. application of a Wiener-type filter f (LG , LT ) with (18) The most common case when this happens is when solving a denoising problem, since A = I corresponds to the trivial joint filter with a(λ, ω) = 1, for all λ and ω. Wiener filters were classically proposed in [44]. The first generalizations to graph signals appear in [45] and [22, pp 100] and were studied in more detail in [14]. VI. E XPERIMENTS A. Joint Power Spectral Density Estimation The first step in our evaluation is to analyze the efficiency of JPSD estimation. Our objective is dual. First, we aim to study the role of the different method parameters into the estimation accuracy and computational complexity, essentially providing practical guidelines for their usage. In addition, we wish to illustrate the usefulness of the joint stationarity assumption in learning from few samples, even when the graph is only approximately known. Variance-bias-complexity tradeoffs. To validate the analysis of Section IV-C for the computational and accuracy tradeoffs inherent to our JPSD estimation method, we performed numerical experiments with random geometric graphs (N = 256 vertices and average degree slightly above 7) and JWSS processes (T = 128 timesteps). For simplicity, we focus on the standard setting of a Gaussian process with smooth and separable JPSD that is exponentially decreasing with frequency: 2 h(θ) = e−λ/λmax e−5 ω . In our experience, similar JPSD are commonly found in data with smooth spatio-temporal structure, such as for instance in meteorological datasets. We remark that the presented results were found consistent with those obtained for non-separable JPSD. In this section, we examine the relation between the real JPSD H = h(ΛG , Ω) and the convolutional estimate Ḧ = ḧ(ΛG , Ω). We use the following metrics: error Ẽ h i Ḧ − H bias i Ẽ Ḧ − H h F kHkF Ẽ h variance h i i Ḧ − Ẽ Ḧ F kHkF F kHkF , where Ẽ[·] is the sample average from 20 independent experiments. computation time (sec) hx (λ, ω) a(λ, ω) . f (λ, ω) = 2 a (λ, ω)hx (λ, ω) + hw (λ, ω) 250 normal, F=25 normal, F=50 fast, F=25 fast, F=50 200 150 100 50 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 vertices Fig. 2: Scalability of the convolutional JPSD estimator. The fast implementation should be favored when the graph is composed of more than a few thousands vertices. The approximation error inherent in the fast implementation was negligible in our experiments. We remind the reader that there are two parameters influencing the performance of the convolutional JPSD estimator: the window size L corresponding to our assumption for the support length of the autocorellation in time, and the number of graph filters F used to capture power density in the graph spectral dimension. Figures 1 (a-d) report four key metrics for an exhaustive search of L, F combinations. We observe that large values of F and L generally reduce the estimation error (Figure 1a) because they result in reduced bias (Figure 1b). Nevertheless, setting the parameters to their maximum values is not suggested as the variance is increased (Figure 1c). In Figure 1d we see that, utilizing a large number of filters and number of windows (i.e., large F and small L), increases the average execution time. Figure 2 delves further into the issue of scalability. In particular, we examine the min/median/max execution time of the convolutional JPSD estimator for increasing problem sizes when run in a desktop computer. Though the setting is identical to the previous experiments, here the number of vertices is varied from 1000 to 9000. We compare two implementations. The first, which naively performs the convolution in the spectral domain, uses the eigenvalue decomposition and therefore scales quadratically with the number of vertices. Due to its optimized code and simplicity, this should be the method of choice when N is small. For larger problems, we suggest using the fast implementation. As shown in the figure, this implementation scales linearly with N (here E = O(N )) when the number of filters F and timesteps T are held constant. How to choose L and F ? Having no computational constrains, one should choose the parameter combination that covariance error 9 10 sample covariance MTWSS JWSS, noiseless graph JWSS, noisy graph (10 dB) 1 10 0 B. Recovery Performance on Three Datasets 10 -1 10 0 10 1 samples 10 2 10 3 (a) N = 10, T = 10 covariance error outperforms purely time-based methods when less than N T samples are available. 10 1 10 0 10 -1 10 0 10 1 10 2 10 3 samples (b) N = 100, T = 10 Fig. 3: Even an approximate knowledge of the graph enables us to make good estimates of the covariance (and PSD) from very few samples. The joint stationarity prior becomes especially meaningful when the number of variables (N, T ) increases. minimized the Akaike information criterion (AIC) score ¨ where `¨ is the distribution dependent AIC = 2F L − 2 ln(`), estimated likelihood `¨ = P(x|Σ̈), and Σ̈ is the estimated covariance based on the convolutional JPSD estimator with parameters L and F [46]. This procedure is often unfeasible as it is based on computing each model’s log-likelihood and thus entails estimating one JPSD for each parameterization in consideration (as well as knowing the distribution type). We have found experimentally that setting F = min(N, 50) provides a good trade-off between computational complexity and error. On the other hand, we suggest setting L equal to an upper bound of the autocorrelation support. Learning from few samples and a noisy graph. Figure 3 illustrates the benefit of a joint stationarity prior as compared to (a) a sample covariance estimator which makes no assumptions about the data, and (b) the multivariate TWSS process estimator with optimal bandwidth [17]. As expected, an accurate estimation is challenging when the number of samples is much smaller than the number of problem variables (N T ), returning errors above one for the sample estimator. Introducing stationarity priors regularizes the estimation resulting in more stable estimates. What is perhaps surprising is that, even when the graph (and UG ) are known only approximately, estimating the second order moment of the distribution using the joint stationarity assumption is beneficial. To portray this phenomenon, we also plot the estimation error when using a noisy graph (we corrupted the weighted adjacency matrix by Gaussian noise, with SNR = 10 dB). Undoubtedly, introducing noise to the graph edges negatively affects estimation by introducing bias. Still, even with noise the proposed method significantly We apply our methods on three diverse datasets featuring multivariate processes evolving over graphs: (a) a weather dataset depicting the temperature of 32 weather stations over one month, (b) a traffic dataset depicting high resolution daily vehicle flow of 4 weekdays, and (c) SIRS-type epidemics in Europe. Our experiments aim to show that joint stationarity is a useful model, even in datasets which may violate the strict conditions of our definition, and that -especially when few samples are available- it can yield a significant improvement in recovery performance, as compared to time- or vertex-based methods, on real datasets. Experimental setup. We split the K samples of each dataset into a training set of size pt K and a test set of size (1−pt )K, respectively. After estimating the JPSD from the training set, we attempt to recover the values of pd N T variables randomly discarded from the test set. In each case, we report the RMSE for the recovered signal normalized by the `2 -norm of the original signal. We compare our joint method to the state-of-the-art wiener filters assuming univariate time/vertex stationarity [14]. Univariate stationarity methods solve the statistical recovery problem under the assumption that signals at stationary in the time/vertex domains, but considering different vertices/timesteps as independent. These methods are known to outperform non-model based methods, such as Tikhonov regularization (ridge regression) and total-variation regularization (lasso) over the time or graph dimensions [8], [9]. We also compare to the more involved multivariate TWSS model where the values at different vertices are correlated and the covariance is block Circulant of size N T × N T . The latter is only shown for the weather dataset as the large number of variables present in the other datasets (e.g., ≈ 108 parameters for the traffic dataset) prohibited computation. Molene dataset. The French national meteorological service has published in open access a dataset5 with hourly weather observations collected during the Month of January 2014 in the region of Brest (France). The graph was built from the coordinates of the weather stations by connecting all the neighbors in a given radius with a weight function WG [i1 , i2 ] = exp(−k d(i1 , i2 )2 ), where d(i1 , i2 ) is the euclidean distance between the stations i1 and i2 . Parameter k was adjusted to as obtain an average degree around 5 (k however is not a sensitive parameter). We split the data in K = 15 consecutive periods of T = 48 hours each. As sole pre-processing, we removed the mean (over time and stations) of the temperature. Since N T is here relatively small, we used the sample JPSD estimator. We first test the influence of training set size pt , while discarding pd = 30% of the test variables. As seen in Figure 4a, the multivariate TWSS approach provides good recovery estimates when the when the number of samples 5 Access to the raw data is possible directly from https://donneespubliques. meteofrance.fr/donnees libres/Hackathon/RADOMEH.tar.gz 10 error 10 10 0 JWSS TWSS VWSS MTWSS -1 10 -2 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 percentage of data used for training 0.9 1 (a) Influence of the training set size (pt = 30%) 1 JWSS TWSS VWSS MTWSS error 0.8 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 percentage of missing entries 0.7 0.8 0.9 1 (b) Influence of the percentage of missing values (pd = 20%) Fig. 4: Experiments with weather data. The joint approach becomes especially meaningful when the available data are few. 0.6 JWSS TWSS VWSS error 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 percentage of missing entries 0.8 0.9 1 (a) 1 out of 4 days used for training (pd = 25%) 0.2 JWSS TWSS VWSS error 0.15 0.1 0.05 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 percentage of missing entries 0.8 0.9 1 (b) 3 out of 4 days used for training (pd = 75%) Fig. 5: Experiments on Sacramento highway flow. By exploiting both graph and temporal dimensions, the joint approach closely captures the subtle variations in traffic throughout each weekday. is large, approaching that of joint stationarity, but suffers for small training sets (though not shown in the figure, the mean error was 9.8 when only pt = 10% of the data was used for training). Due to their stricter modeling assumptions, disjoint stationarity methods returned relevant estimates when trained from very few samples, but exhibited larger bias. Figure 4b reports the achieved errors for recovery problems with progressively larger percentage 5% ≤ pd ≤ 95% of discarded entries for a training percentage of pt = 20%. We can observe that the error trends are consistent across all cases. Traffic dataset. The California department of transportation publishes high-resolution traffic flow measurements (number of vehicles per unit interval) from stations deployed in the highways of Sacramento6 . We focused at 727 stations over four weekdays in the period 01-06 April 2016. Starting from the road connectivity network obtained by the OpenStreetMap.org, we constructed one timeseries for each highway segment by setting the flow over it to be a weighted average of all nearby stations, while abiding to traffic direction. This resulted in a graph of N = 710 vertices, and a total of T = 24 × 12 measurements per day for K = 4 days. We used the convolutional JPSD estimator with parameters L = T /2 and F = 75, which were experimentally found to give good performance in the training set. Figures 5a and 5b depict the mean recovery errors when the training sets where 1 and 3 days respectively. The strong temporal correlations present in highway traffic were useful in recovering missing values. Considering both the temporal and spatial dimension of the problem, resulted in very accurate estimates, with less that 0.04 error when pd =50% of the data were removed and the PSD was estimated from one day. SIRS epidemic. Our third dataset depicts the spread of an infectious disease over N = 200 major cities of Europe, as predicted by the Succeptible-Infected-Recovered-Susceptible (SIRS) model, one of the standard models used to study epidemics. Our intention is to examine the predictive power of the considered methods when dealing with different realizations of a non-linear and probabilistic process over a graph (the data are fictitious). We parameterized SIRS as follows: length of infection period: 2 days, length of immunity period: 10 days, probability of contagion across neighboring cities per day: 0.005, total period: T = 180 days. We generated a total of K = 10 infections, all having the same starting point. We also used the sample JPSD estimator. As shown in Figures 6a and 6b, the attained results were consistent with the weather and traffic datasets. We remark that our simulations were done using the GSPBOX [47], the UNLocBoX [48], and the LTFAT [49]. The code reproducing our experiments is available at https://lts2. epfl.ch/stationary-time-vertex-signal-processing/. VII. C ONCLUSION This paper proposed a novel definition of wide-sense stationarity appropriate for multivariate processes supported on the vertices of a graph. We showed that JWSS processes possess a number of familiar properties: they can be generated by filtering noise, and a joint Fourier transform diagonalizes their covariance. Furthermore, our model connects to time and vertex wide sense stationarity for multivariate processes. Our model presents two key benefits. First, the estimation and recovery of JWSS processes is very efficient, both in terms of sample and computational complexity. In particular, the JPSD of a JWSS process can be estimated from very few (constant) number of samples at a complexity that is roughly 6 The data correspond to the 3rd district of California and can be downloaded from http://pems.dot.ca.gov/ 11 error 10 10 Thus taken together, (b) and (c) state that Σ = UJ DUJ∗ = UJ h(ΛG , ΛT )UJ∗ = h(LG , LT ), which is the second moment condition of a JWSS process. 0 JWSS TWSS VWSS -1 10 -2 0.1 0.2 0.3 0.4 0.5 0.6 0.7 percentage of data used for training 0.8 0.9 1 (a) Influence of the training set size (pt = 30%) error 0.6 JWSS TWSS VWSS 0.4 Proof of Theorem 2. For the first movement, it is straightforward to see that E[X[n, t]] = c if and only if both E[X[n, t]] = ct and E[X[n, t]] = cn ∀n, t. For the second moment, the covariance matrix of a JWSS process is by definition the linear operator associated to a joint filter Σ = h(LG , LT ). Using (5), Σt1 ,t2 can be written as Σt1 ,t2 = UG γδ (Λ)UG∗ = γδ (LG ), where δ = t1 − t2 + 1 and 0.2 0 (19) γδ (λ) = 0 0.1 0.2 0.3 0.4 0.5 0.6 percentage of missing entries 0.7 0.8 0.9 1 (b) Influence of the percentage of missing entries (pd = 90%) Fig. 6: Experiments with the SIRS epidemic model. linear to the number of graph edges and timesteps. After the PSD has been estimated, the linear MMSE recovery problems of interpolation, denoising, and forecasting can be solved in the same asymptotic complexity. Second, joint stationarity is a volatile model, able to capture non-trivial statistical relations in the temporal and vertex domains. Our experiments suggested that we can model real spatio-temporal processes as jointly stationary without significant loss. Specifically, the JWSS prior was found more expressive than (univariate) TWSS and VWSS priors, and improved upon the multivariate time stationarity prior when the dimensionality was large but the samples few. ACKNOWLEDGMENT This work has been supported by the Swiss National Science Foundation research project Towards Signal Processing on Graphs (grant number: 2000 21/154350/1). T 1 X h(λ, ωτ )ejωτ δ . T τ =1 (20) Hence the process satisfies the (b) statement of Definition 2 (TWSS) and 3 (VWSS). Conversely if a process is TWSS and VWSS, we have Σt1 ,t2 = γt1 ,t2 (LG ) = γδ (LG ) with δ = t1 − t2 + 1. As a result, using (5), its covariance matrix can be written as a joint filter h(LG , LT ), where h(λn , ωτ ) = T X γδ (λn )ejωτ δ , (21) δ=1 and hence satisfies also the property of the second moment of JWSS processes. Proof of Property 2. The output of a filter f (LJ ) can be written in vector form as y = f (LJ ). If the input signal x is JWSS, we can confirm that the first moment of the filter output is f (LJ )x = f (LJ )x̄ = f (0, 0)E[x], which remain constant as E[x] is constant by hypothesis. The computation of the second moment gives  ∗ Σy = E f (LJ )x (f (LJ )x) − E[h(LJ )x] E[(f (LJ )x)∗ ] = f (LJ )E[xx∗ ] f (LJ ) − f (LJ )x̄x̄∗ f (LJ )∗ = f (LJ )Σx f (LJ )∗  = UJ f 2 (θ) hX (θ) UJ∗ , A PPENDIX which satisfies the second moment condition of JWSS process. Proof of Theorem 1. By construction of the JFT basis, X̂[0, 0] captures the DC-offset of a signal, and condition (a) is equivalent to stating that E[x] = c1N T . Moreover, if thei h graph is connected and (a) holds, at least one of E X̂[n1 , τ1 ] h i and E X̂[n2 , τ2 ] must be zero when n1 6= n2 or τ1 6= τ2 and h i E X̂[n1 , τ1 ]X̂[n2 , τ2 ] h i h i h i = E X̂[n1 , τ1 ]X̂[n2 , τ2 ] − E X̂[n1 , τ1 ] E X̂[n2 , τ2 ] Lemma 1. If function h(θ) is -Lipschitz, then the bias is bounded by A. Deferred proofs = (UJ∗ ΣUJ )[(τ1 − 1)N + n1 , (τ2 − 1)N + n2 ]. Therefore, condition (b) is equivalent to stating that Σ = UJ DUJ∗ for some diagonal matrix D. In addition, (c) asserts that D[(τ −1)N +n, (τ −1)N +n] = h(λn , ωτ ) for every n, τ . h i E ḧ(θ) − h(θ) ≤ T,N X  g(θ − θn,τ )2 kθ − θn,τ k2 . cg (θ)n=1,τ =1 Proof. Since h(θ) is  Lipschitz, we have |h(θ) − h(θn,τ )| ≤  kθ − θn,τ k2 . Hence, we write NT h i X h(θn,τ ) E ḧ(θ) − h(θ) = g(θ − θn,τ )2 − h(θ) cg (θ) n,τ =1 ≤ |A h(θ)| + NT X  g(θ − θn,τ )2 kθ − θn,τ k2 cg (θ) n,τ =1 12 where by definition A = claim follows. PN,T n,τ =1 g 2 (θ−θn,τ ) cg (θ) − 1 = 0, and the Lemma 2. If X is a JWSS process such that the entries of X̂ are independent random variables, the convolutional JPSD estimate at θ has variance h i h i X g(θ − θ )4 n,τ Var ḣ(θ ) , (22) Var ḧ(θ) = n,τ cg (θ)2 n,τ h i where Var ḣ(θn,τ ) is the variance of the sample JPSD estimator at θn,τ . Proof. Set )2 h(θ  αn,τ = g(θ − θn,τ  n,τ )/cg (θ) and Ê(k) = + mat ε̂(k) = mat h(ΛG , Ω) x̂(k) , where + denotes the pseudo-inverse and mat(·) is the matricization operator. The centered random variable h i X g(θ − θ )2 n,τ ḧ(θ) − E ḧ(θ) = (ḣ(θn,τ ) − h(θn,τ )) c (θ) g n,τ ! X X Ê(k) [n, τ ]Ê(k) [n, τ ]∗ X = αn,τ −1 = αn,τ zn,τ K n,τ n,τ k is a weighted sum of centered, identically distributed random variables zn,τ . Moreover, when the elements of Ê(k) are independent, so are the variables zn,τ . It follows that, h i X  2  2 Var ḧ(θ) = αn,τ Var zn,τ n,τ = X g(θ − θn,τ )4 n,τ cg (θ)2 h i Var ḣ(θn,τ ) , which matches our claim. R EFERENCES [1] M. Rudelson, “Random vectors in the isotropic position,” Journal of Functional Analysis, vol. 164, no. 1, pp. 60–72, 1999. [2] M. J. Keeling and K. T. Eames, “Networks and epidemic models,” Journal of the Royal Society Interface, vol. 2, no. 4, pp. 295–307, 2005. [3] P. Mohan, V. N. Padmanabhan, and R. Ramjee, “Nericell: rich monitoring of road and traffic conditions using mobile smartphones,” in Proceedings of the 6th ACM conference on Embedded network sensor systems. ACM, 2008, pp. 323–336. [4] W. Huang, L. Goldsberry, N. F. Wymbs, S. T. Grafton, D. S. Bassett, and A. Ribeiro, “Graph frequency analysis of brain signals,” arXiv preprint arXiv:1512.00037, 2015. [5] F. Zhang and E. R. Hancock, “Graph spectral image smoothing using the heat kernel,” Pattern Recognition, vol. 41, no. 11, pp. 3328–3342, 2008. [6] A. J. Smola and R. Kondor, “Kernels and regularization on graphs,” in Learning theory and kernel machines. Springer, 2003, pp. 144–158. [7] M. Belkin and P. Niyogi, “Semi-supervised learning on riemannian manifolds,” Machine learning, vol. 56, no. 1-3, pp. 209–239, 2004. [8] D. I. Shuman, S. K. Narang, P. Frossard, A. Ortega, and P. Vandergheynst, “The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains,” Signal Processing Magazine, IEEE, vol. 30, no. 3, pp. 83–98, 2013. [9] A. Sandryhaila and J. M. Moura, “Discrete signal processing on graphs,” IEEE transactions on signal processing, vol. 61, pp. 1644–1656, 2013. [10] A. Gadde and A. Ortega, “A probabilistic interpretation of sampling theory of graph signals,” arXiv preprint arXiv:1503.06629, 2015. [11] C. Zhang, D. Florêncio, and P. A. Chou, “Graph signal processing– a probabilistic framework,” Microsoft Res., Redmond, WA, USA, Tech. Rep. MSR-TR-2015-31, 2015. [12] E. Isufi, A. Loukas, A. Simonetto, and G. Leus, “Autoregressive moving average graph filtering,” IEEE Transactions on Signal Processing, vol. 65, no. 2, pp. 274–288, 2017. [13] A. Loukas and D. Foucard, “Frequency analysis of temporal graph signals,” arXiv preprint arXiv:1602.04434, 2016. [14] N. Perraudin and P. Vandergheynst, “Stationary signal processing on graphs,” IEEE Transactions on Signal Processing, vol. 65, no. 13, pp. 3462 – 3477, 2017. [15] B. Girault, “Stationary graph signals using an isometric graph translation,” in Signal Processing Conference (EUSIPCO), 2015 23rd European. IEEE, 2015, pp. 1516–1520. [16] A. G. Marques, S. Segarra, G. Leus, and A. Ribeiro, “Stationary graph processes and spectral estimation,” arXiv preprint arXiv:1603.04667, 2016. [17] N. Wiener and P. Masani, “The prediction theory of multivariate stochastic processes,” Acta Mathematica, vol. 98, no. 1, pp. 111–150, 1957. [18] ——, “The prediction theory of multivariate stochastic processes, ii,” Acta Mathematica, vol. 99, no. 1, pp. 93–137, 1958. [19] P. Bloomfield, Fourier analysis of time series: an introduction. John Wiley & Sons, 2004. [20] F. R. Bach and M. I. Jordan, “Learning graphical models for stationary time series,” IEEE transactions on signal processing, vol. 52, no. 8, pp. 2189–2199, 2004. [21] R. Dahlhaus and M. Eichler, “Causality and graphical models in time series analysis,” Oxford Statistical Science Series, pp. 115–137, 2003. [22] B. Girault, “Signal processing on graphs-contributions to an emerging field,” Ph.D. dissertation, Ecole normale supérieure de lyon, 2015. [23] S. P. Chepuri and G. Leus, “Subsampling for graph power spectrum estimation,” arXiv preprint arXiv:1603.03697, 2016. [24] A. Loukas and N. Perraudin, “Predicting the evolution of stationary graph signals,” arXiv preprint arXiv:1607.03313, 2016. [25] J. Mei and J. M. Moura, “Signal processing on graphs: Causal modeling of unstructured data,” arXiv preprint arXiv:1503.00173, 2015. [26] N. Perraudin, A. Loukas, F. Grassi, and P. Vandergheynst, “Towards stationary time-vertex signal processing,” IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2017. [27] F. Grassi, A. Loukas, N. Perraudin, and B. Ricaud, “A time-vertex signal processing framework,” ArXiv e-prints, 2016. [28] A. Loukas, A. Simonetto, and G. Leus, “Distributed autoregressive moving average graph filters,” IEEE Signal Processing Letters, vol. 22, no. 11, pp. 1931–1935, 2015. [29] E. Isufi, A. Loukas, A. Simonetto, and G. Leus, “Separable autoregressive moving average graph-temporal filters,” in Signal Processing Conference (EUSIPCO), 2016 24th European. IEEE, 2016, pp. 200– 204. [30] D. I. Shuman, B. Ricaud, and P. Vandergheynst, “Vertex-frequency analysis on graphs,” Applied and Computational Harmonic Analysis, vol. 40, no. 2, pp. 260–291, 2016. [31] R. Vershynin, “How close is the sample covariance matrix to the actual covariance matrix?” Journal of Theoretical Probability, vol. 25, no. 3, pp. 655–686, 2012. [32] M. S. Bartlett, “Periodogram analysis and continuous spectra,” Biometrika, pp. 1–16, 1950. [33] P. Welch, “The use of fast fourier transform for the estimation of power spectra: a method based on time averaging over short, modified periodograms,” IEEE Transactions on audio and electroacoustics, pp. 70–73, 1967. [34] K. Gröchenig, Foundations of time-frequency analysis. Springer Science & Business Media, 2013. [35] H. G. Feichtinger and T. Strohmer, Gabor analysis and algorithms: Theory and applications. Springer Science & Business Media, 2012. [36] C. De Boor, C. De Boor, E.-U. Mathématicien, C. De Boor, and C. De Boor, A practical guide to splines. Springer-Verlag New York, 1978, vol. 27. [37] A. Susnjara, N. Perraudin, D. Kressner, and P. Vandergheynst, “Accelerated filtering on graphs using lanczos method,” arXiv preprint arXiv:1509.04537, 2015. [38] O. Axelsson, “Conjugate gradient type methods for unsymmetric and inconsistent systems of linear equations,” Linear algebra and its applications, vol. 29, pp. 1–16, 1980. [39] P. L. Combettes and V. R. Wajs, “Signal recovery by proximal forwardbackward splitting,” Multiscale Modeling & Simulation, vol. 4, no. 4, pp. 1168–1200, 2005. [40] P. L. Combettes and J.-C. Pesquet, “Proximal splitting methods in signal processing,” in Fixed-point algorithms for inverse problems in science and engineering. Springer, 2011, pp. 185–212. [41] N. Komodakis and J.-C. Pesquet, “Playing with duality: An overview of recent primal? dual approaches for solving large-scale optimization problems,” IEEE Signal Processing Magazine, vol. 32, no. 6, pp. 31–54, 2015. 13 [42] A. Beck and M. Teboulle, “A fast iterative shrinkage-thresholding algorithm for linear inverse problems,” SIAM journal on imaging sciences, vol. 2, no. 1, pp. 183–202, 2009. [43] P. L. Combettes and J.-C. Pesquet, “A douglas–rachford splitting approach to nonsmooth convex variational signal recovery,” IEEE Journal of Selected Topics in Signal Processing, vol. 1, no. 4, pp. 564–574, 2007. [44] N. Wiener, Extrapolation, interpolation, and smoothing of stationary time series. MIT press Cambridge, MA, 1949, vol. 2. [45] B. Girault, P. Goncalves, E. Fleury, and A. S. Mor, “Semi-supervised learning for graph to signal mapping: A graph signal wiener filter interpretation,” in Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on. IEEE, 2014, pp. 1115–1119. [46] H. Akaike, “A new look at the statistical model identification,” IEEE transactions on automatic control, vol. 19, no. 6, pp. 716–723, 1974. [47] N. Perraudin, J. Paratte, D. Shuman, V. Kalofolias, P. Vandergheynst, and D. K. Hammond, “GSPBOX: A toolbox for signal processing on graphs,” ArXiv e-prints, Aug. 2014. [48] N. Perraudin, D. Shuman, G. Puy, and P. Vandergheynst, “UNLocBoX A matlab convex optimization toolbox using proximal splitting methods,” ArXiv e-prints, Feb. 2014. [49] Z. Prusa, P. L. Sondergaard, N. Holighaus, C. Wiesmeyr, and P. Balazs, “The Large Time-Frequency Analysis Toolbox 2.0,” in Sound, Music, and Motion, ser. Lecture Notes in Computer Science. Springer International Publishing, 2014, pp. 419–442.
8cs.DS
1 Supervised Q-walk for Learning Vector Representation of Nodes in Networks arXiv:1710.00978v1 [cs.SI] 3 Oct 2017 Naimish Agarwal, IIIT-Allahabad ([email protected]) G.C. Nandi, IIIT-Allahabad ([email protected]) Abstract—Automatic feature learning algorithms are at the forefront of modern day machine learning research. We present a novel algorithm, supervised Q-walk, which applies Q-learning to generate random walks on graphs such that the walks prove to be useful for learning node features suitable for tackling with the node classification problem. We present another novel algorithm, k-hops neighborhood based confidence values learner, which learns confidence values of labels for unlabelled nodes in the network without first learning the node embedding. These confidence values aid in learning an apt reward function for Q-learning. We demonstrate the efficacy of supervised Q-walk approach over existing state-of-the-art random walk based node embedding learners in solving the single / multi-label multi-class node classification problem using several real world datasets. Summarising, our approach represents a novel state-of-the-art technique to learn features, for nodes in networks, tailor-made for dealing with the node classification problem. Index Terms—Node Embedding, Feature Learning, Deep Learning, Node Classification, Random Walks I. I NTRODUCTION Consider a social network of users where users have professions like scientist, manager, student, etc. Each user can be connected to sets of users from different professions. The problem is to predict the profession of users whose profession information is missing based upon their context in the network. Such a problem belongs to the class of problems called node classification problem. In node classification problem, the task is to predict the labels of those nodes in networks whose label information is missing. A node can have one or more labels associated with it, e.g. if the nodes are people, then the labels can be student, artist, dancer, etc. This problem seems to be solvable using supervised machine learning techniques. The downside is that we do not know the required set of features which need to be feeded into the machine learning system for performing node classification. In our work, we have developed a technique for learning features of nodes in networks, i.e. node embeddings. Our technique provides a supervised adaptation to node2vec [9] - a semi-supervised learning algorithm to learn continuous valued features of nodes in networks. Our algorithm is based on a simple intuition. We want that the nodes which have same labels should have very similar embeddings. Therefore, we would like to perform random walks on the nodes in the networks such that if the nodes on the random walk are u1 , u2 , u3 , ..., uwl where wl is the walk length, then ui is very similar to ui−1 where i = 2, 3, 4, ..., wl . To achieve the above intuition, we have laid out a two step approach to perform the random walks: 1) We associate confidence values with all node-label pairs. The confidence values just give us a hint about the tentative labels for nodes. 2) We first associate a reward function with every edge in the network. These reward functions are used by the Q-learning algorithm in learning the Q-values for each node-edge pair. These Q-values then guide the random walks in a way such that in the ideal scenario if the random walk is u1 , u2 , u3 , ..., uwl , then the actual labels associated with the nodes are l, l, l, ..., l. The generated random walks are treated as sentences in a document. We then apply Skip-gram [18] with Negative Sampling [19] to learn the node embeddings. These node embeddings are then used to train a classifier for checking the goodness of the learnt embeddings. The related work is discussed in section §II.The details of the approach are given in section §III. The experimental details are mentioned in section §IV. The conclusion and future work are mentioned in section §V and section §VI respectively. II. R ELATED W ORK Graph Analytics field is pacing up due to the growth of large datasets in social network analysis [16][2][15], communication networks [14][13], etc. The area of node classification [6] has been approached earlier from different perspectives like factorization based approaches, random walk based approaches, etc. Factorization based techniques represent the edges in networks as matrices. These matrices are factorized to obtain the embeddings. The matrix representation and its factorization are done using various techniques [24][3][1][8][20]. These methods may suffer from scalability issues for large graph datasets and sparse matrix representations need special attention. Random walk based approaches perform random walks on networks to obtain the embeddings. Two popular techniques are DeepWalk [22] and node2vec [9]. node2vec [9] is a semisupervised algorithmic framework which showcases strategies to perform random walks such that nodes which are homophilic and/or structurally equivalent end up getting similar embeddings. The random walks are guided by a heuristic which involves computing distance of the next possible nodes from the previous node given the current node. DeepWalk can be considered as a special case of node2vec with p = 1 and q = 1 where p, q are hyperparameters in node2vec 2 which decide the tradeoff between depth-first and breadth-first sampling. Our approach falls under random walk based approaches. We compare our approach against node2vec in section §IV. Instead of using some hand-crafted random walk based approach, we decided to learn how to do random walks using reinforcement learning. We perform random walks such that nodes which have same labels but are not necessarily structurally equivalent, end up getting embeddings close to one another in the embedding space. The random walks are guided by the Q-values of the node-action pairs. III. L EARNING V ECTOR R EPRESENTATION OF N ODES In section III-A, we define the problem formally. In section III-B, we propose a k-hops neighborhood based confidence values learner which learns the confidence values of labels for unlabelled nodes in the network. Using the learnt confidence values, we devise a reward function, which aids Q-walk, described in section III-C, to do random walks. The generated random walks are then fed into word2vec, which is briefly described in section III-D, to get the vector representation of nodes. A. Problem Definition Consider G = (V, E) where G can be any (un)directed, (un)weighted simple graph. We ignore self-loops and parallel edges. V is the set of vertices and E is the set of edges. V = Vlabelled ∪ Vunlabelled and Vlabelled ∩ Vunlabelled = φ where Vlabelled is the set of labelled vertices, Vunlabelled is the set of unlabelled vertices and φ denotes empty set. Let |Vlabelled | . vl = |V | We want to learn a mapping f : V −→ Rd such that for any u, v ∈ V if u and v have same labels, then ||f (u) − f (v)||2 distance is minimum. We use the same objective function and assumtions - conditional independence and symmetry in feature space, as used in node2vec [9]. X Of = max log P r(NS (u)|f (u)) (1) f u∈V In (1), we are maximizing over the log-probability of observing a network neighborhood NS (u) obtained by the sampling strategy S, which, in our case, is described in section III-C, starting at node u. In [9], the authors have derived that X X Of ∝ f (ni ).f (u) (2) u∈V ni ∈NS (u) The use of (1) is justified in our case since we want to minimize ||f (u) − f (v)||2 which is equivalent to maximizing f (u).f (v). B. K-hops neighborhood based confidence values learner This algorithm is motivated by homophily [17] in networks. Entitites of similar kind tend to stay together, e.g. friends who share same interest, people in the same profession, etc. We use this heuristic to find the confidence values of labels for unlabelled nodes in the graph. It is imperative to compute the confidence values, since in their absence, the agent, as used in section III-C, would get confused in chosing the appropriate direction of the random walk. N (u, k) = {x | x ∈ V and x is k-hops away from u} (3) In (3), N (u, k) is the k-hops neighborhood for u ∈ V . For directed G, k-hops are based on the outgoing edges from u. L = {li | li is a label for i = 1, 2, ..., |L|} (4) In (4), L is the set of all labels in G and |L| is the cardinality of L. Lactual (u) = {l | u is labelled l where l ∈ L} (5) In (5), Lactual (u) is the set of labels associated with u ∈ Vlabelled . t = 0, 1, 2, ..., T (6) In (6), t is the iteration counter for computing the confidence values and T is the maximum number of such iterations.   1 C0 (u, l) = 0   0 u ∈ Vlabelled and l ∈ Lactual (u) u ∈ Vlabelled and l ∈ / Lactual (u) u ∈ Vunlabelled ∀l ∈ L (7) In (7), C0 (u, l) is the initial confidence value associated with u ∈ V computed ∀l ∈ L. Ct (u, l) =   Ct−1 (u, l)    |N (u,k)| X Ct−1 (xi ,l)     i |N (u,k)| u ∈ Vlabelled (8) u ∈ Vunlabelled In (8), Ct (u, l) is the confidence value of u ∈ V for label l ∈ L at iteration t and xi ∈ N (u, k). CT (u, l) is the confidence with which we can state that u ∈ V has label l ∈ L. We denote k in k-hops neighborhood as kHN . C. Supervised Q-walk To generate random walks, we look at the graph as a Markov Decision Process (MDP) [4], where each node u ∈ V is a state, outgoing edges from u are the actions possible at u. The probability of reaching the neighbor u0 by taking the action (u, u0 ) is 1. Imagine an agent at u which has to decide the next node u0 . To aid the agent in taking the right decision, we perform Q-learning [27]. So, the agent decides u0 based upon the Q-value Q(u, (u, u0 )). Hence, the generated random walks are called Q-walks. The Q-walks are supervised because the reward function (9) depends on the confidence values, learnt in a supervised way, as per section III-B. |L| X R(u, a, u0 ) = − |CT (u0 , li ) − CT (u, li )| i=1 (9) 3 In (9), R(u, a, u0 ) is the reward obtained when the agent moves from u to u0 along the edge a where u, u0 ∈ V , a = (u, u0 ) ∈ E and li ∈ L. The closer the reward is to 0, the more similar u0 is to u. j = 0, 1, 2, ..., J (10) In (10), j is the iteration counter in Q-learning and J is the maximum number of such iterations. Q0 (u, a) = 0 ∀u ∈ V and a ∈ E (11) In (11), Q0 (u, a) is the initial Q-value for the node-action pair (u, a). αj = αj−1 1+j (12) 0 Qj (u, a) = Qj−1 (u, a) + αj (R(u, a, u )+ γ max Qj−1 (u0 , a0 ) − Qj−1 (u, a)) 0 a (13) Figure 1. Mean F1 scores of supervised Q-walk against the baseline node2vec for different settings of the discount factor γ with fixed pQ = 0.8, kHN = 1, r = 24, wl = 100, d = 256, ws = 20, e = 100, vl = 0.8, α0 = 1, J = 100, T = 3, kN N = 3. In (12) and (13), αj is the learning rate for epoch j, α0 is user-defined, and γ is the discount factor. In (12), we are updating the learning rate α at each iteration such that its value decreases with number of iterations and the difference between Qj (u, a) and Qj−1 (u, a) diminishes over time, in other words, Q-values converge. rn ∼ Uniform(0, 1) a= (14)  arg max QJ (u0 , a0 ) rn ≤ pQ (u, random(u0 )) ∈ E rn > pQ a0 (15) The agent needs to decide the action when it is at u. It first samples a random number as per (14), then it decides upon the action as per (15). In (15), pQ is the exploitation probability and u0 ∈ N (u, 1). We generate r random walks of length wl each ∀u ∈ V . D. word2vec The generated random walks can be considered as sentences in a text document. As per (1), we have to maximize the probability of the context nodes given the node u ∈ V . To achieve this, we use Skip-gram [18] with Negative Sampling [19]. We denote the context window size as ws and number of epochs as e. IV. E XPERIMENTS A. Datasets We provide a brief overview of the datasets which were used to perform the experiments. 1) Yeast: Yeast [7] dataset is a protein-protein interaction network of budding yeast. It has 2361 nodes, 7182 edges and 13 classes. It is an undirected and unweighted network. It offers a single-label multi-class classification problem. Figure 2. Mean F1 scores of supervised Q-walk against baseline node2vec for different settings of the exploitation probability pQ with fixed kHN = 1, r = 24, wl = 100, d = 256, ws = 20, e = 100, vl = 0.8, α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9. 2) BlogCatalog: BlogCatalog [25] dataset is a social network of bloggers. The labels associated with the bloggers refer to their interests which are obtained from the metadata information as available on BlogCatalog site. It consists of 10312 nodes, 333983 edges and 39 classes. It is an undirected and unweighted network. It offers a multi-label multi-class classification problem. 3) Flickr: Flickr [25] dataset is a contact network of users on Flickr site. The labels associated with the users refer to their groups. It consists of 80513 nodes, 5899882 edges and 195 classes. It is an undirected and unweighted network. It offers a multi-label multi-class classification problem. 4 Table I M EAN F1 SCORES OF SUPERVISED Q- WALK AND NODE 2 VEC ON DIFFERENT DATASETS WITH FIXED pQ = 0.8, kHN = 1, r = 24, wl = 100, d = 256, ws = 20, e = 100, vl = 0.8, α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9, p = 0.25, q = 0.5. Supervised Q-walk node2vec % improvement Macro-F1 Micro-F1 Macro-F1 Micro-F1 Macro-F1 Micro-F1 Yeast 0.2896 0.3797 0.2409 0.3212 20.21% 18.21% BlogCatalog 0.4051 0.5420 0.1984 0.3062 104.18% 77.01% Flickr 0.4340 0.5505 0.2087 0.2853 107.95% 92.95% Figure 3. Mean F1 scores of supervised Q-walk against baseline node2vec for different settings of the word2vec epochs e with fixed kHN = 1, r = 24, wl = 100, d = 256, ws = 20, vl = 0.8, α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9, pQ = 0.8. Figure 5. Mean F1 scores of supervised Q-walk against baseline node2vec for different settings of kHN , used for learning confidence values as per section III-B with fixed r = 24, wl = 100, d = 256, α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9, pQ = 0.8, e = 100, ws = 20, vl = 0.8. Figure 4. Mean F1 scores of supervised Q-walk against baseline node2vec for different settings of the ratio of labelled nodes vl , used for learning confidence values as per section III-B with fixed kHN = 1, r = 24, wl = 100, d = 256, α0 = 1, J = 100, T = 3, kN N = 3, ws = 20, γ = 0.9, pQ = 0.8, e = 100. Figure 6. Mean F1 scores of supervised Q-walk against baseline node2vec for different settings of node features representation dimensions d with fixed r = 24, wl = 100,α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9, pQ = 0.8, e = 100, vl = 0.8, kHN = 1, ws = 20. 5 Figure 7. Mean F1 scores of supervised Q-walk against baseline node2vec for different settings of number of walks per node r with fixed wl = 100,α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9, pQ = 0.8, e = 100, vl = 0.8, kHN = 1, d = 256, ws = 20. Figure 8. Mean F1 scores of supervised Q-walk against baseline node2vec for different settings of walk length wl with fixed r = 24, α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9, pQ = 0.8, e = 100, vl = 0.8, kHN = 1, d = 256, ws = 20. Figure 9. Mean F1 scores of supervised Q-walk against baseline node2vec for different settings of window size ws with fixed r = 24, α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9, pQ = 0.8, e = 100, vl = 0.8, kHN = 1, d = 256, wl = 24. Figure 10. Mean F1 scores of node2vec against supervised Q-walk for different values of p and q with fixed pQ = 0.8, kHN = 1, r = 24, wl = 100, d = 256, ws = 20, e = 100, vl = 0.8, α0 = 1, J = 100, T = 3, kN N = 3, γ = 0.9, ws = 20. C. Results B. Performance Evaluation We evaluate the performance by first computing the vector representation of nodes in the network using both node2vec and supervised Q-walk for specific hyperparameter settings. Then, we compute the mean of the macro and micro F1 scores obtained by performing 5 fold cross validation using k-nearest neighbors (k-NN) [10] classifier. We use k-NN for a couple of reasons. First, we are interested in showcasing that our learnt embeddings are similar for nodes with same labels, and such similarity can be measured by finding euclidean distance between the node embeddings of the concerned nodes, and this is in accordance with section III-A. Second, it is a nonlinear classifier, therefore, the learnt embeddings need not be linearly separable for getting better classification performance. We denote k in k-NN as kN N . It can be observed in figure 1 that values of γ around 0.9 provide higher performance than other values of γ on the Yeast dataset. For γ = 0, the F1 scores are better than a number of other γ values which signifies the aptness of the reward function (9), since (13) is then modified to Qj (u, a) = (1 − αj )Qj−1 (u, a) + αj R(u, a, u0 ), which does not include Qj−1 (u0 , a0 ). For γ = 0, on BlogCatalog dataset, supervised Q-walk approach achieves mean Macro-F1 score of 0.4198 and mean Micro-F1 score of 0.5528 which are higher than the F1 scores for γ = 0.9 as shown in table I. In figure 2, we can observe the tradeoff involved between exploration and exploitation. pQ = 0 means that we do not make use of the learnt Q-values and have instead resorted to randomly explore the network, thereby, leading to poor performance. pQ = 1 means that we always make the greedy choice by opting for the action which yields maximum Q- 6 value. This is complete exploitation policy which again leads to poor performance. pQ = 0.8 rightly balances the tradeoff between exploration and exploitation, thereby, leading to higher F1 scores compared with other values of pQ . In figure 3, we can observe that supervised Q-walk takes small number of epochs to give high F1 scores. In the case of Yeast dataset, e = 100 was sufficient. There exists randomness in the curves which can be attributed to different weight initializations in word2vec in different runs of the experiment. The F1 scores stop improving after e = 100. It signifies that the model is trained and starts overfitting for e > 100. In figure 4, we can observe that supervised Q-walk approach performs better than node2vec given we use around and above 50% labelled nodes for learning the confidence values as per section III-B. For lower values of vl , the performance is poor because the k-hops neighborhood based confidence values learner did not get enough labelled nodes for properly learning the confidence values. For higher values of vl , we can see that the performance improves. In a real world setting, it may not be necessary that we get vl = 0.9 to train upon, instead, for all other experiments we choose vl = 0.8 since 80% − 20% split of training and test data is generally used in machine learning. It can be observed in figure 5 that kHN = 1 is sufficient for learning good confidence values, in other words, the confidence values can be determined by just looking at the immediate neighbors of any node u ∈ V . It can be observed in figure 6 that d ∈ [25 , 28 ] give high F1 scores. Supervised Q-walk approach gives better F1 scores than node2vec for different settings of dimensions. It can be observed in figure 7 that supervised Q-walk approach gives high F1 scores for r = 18 while node2vec gives high F1 scores for r = 24 and low for r = 18. So, our approach takes lesser number of walks per node to give a better performance than node2vec. It can be observed in figure 8 and figure 9 that supervised Q-walk approach gives better F1 scores than node2vec. Values of wl around 75 and values of ws around 20 are good enough for our approach on the Yeast dataset. It can be observed in figure 10 that supervised Q-walk approach performs better than node2vec hyperparameterised by different combinations of p and q which control the degree of Depth First Sampling (DFS) and Breadth First Sampling (BFS). The mean F1 scores are calculated for specific hyperparameter settings which leaves room for improvement by fine tuning the hyperparameters through cross validation with grid search or random search [5] over the hyperparameter space. D. Technologies Deployed All the experiments were carried out on a server housing 48 core Intel Xeon @ 2.5 GHz processor, 252 GB RAM with Ubuntu 16.04. The experiments were coded in Python 3.6, using 3rd party libraries - NetworkX [11], Numpy [26], Matplotlib [12], Scikit-learn [21] and Gensim [23]. V. C ONCLUSION We have presented a novel supervised Q-walk approach to generate random walks guided by Q-values and assisted by k- hops neighborhood based confidence values learner. We have shown experimentally that the node embeddings learnt from our approach are similar for the nodes with the same labels. We have also shown that our approach outperforms node2vec in the node classification task. VI. F UTURE W ORK Supervised Q-walk works better in the cases where the assumption of homophily in networks holds true. In other networks, nodes which are structurally equivalent may have the same labels e.g. networks of bio-chemical compounds. Our work can be extended by composing another reward function R(u, a, u0 ) = R1 (u, a, u0 ) + βR2 (u, a, u0 ) where R1 encourages homophily in networks, R2 encourages structural equivalence of nodes and β is a hyperparameter which decides the tradeoff between homophily and structural equivalence. VII. ACKNOWLEDGEMENTS We acknowledge the valuable insights provided by Dr Robert West, Assistant Professor, Data Science Lab, School of Computer and Communication Sciences, EPFL, Switzerland. His lab had also provided us with the compute infrastructure for carrying out all the experiments. R EFERENCES [1] Amr Ahmed, Nino Shervashidze, Shravan Narayanamurthy, Vanja Josifovski, and Alexander J. Smola. Distributed large-scale natural graph factorization. In Proceedings of the 22Nd International Conference on World Wide Web, WWW ’13, pages 37–48, New York, NY, USA, 2013. ACM. [2] Lars Backstrom, Dan Huttenlocher, Jon Kleinberg, and Xiangyang Lan. Group formation in large social networks: Membership, growth, and evolution. In Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’06, pages 44–54, New York, NY, USA, 2006. ACM. [3] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. In Advances in Neural Information Processing Systems 14, pages 585–591. MIT Press, 2001. [4] Richard Bellman. A Markovian Decision Process. Indiana Univ. Math. J., 6:679–684, 1957. [5] James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. J. Mach. Learn. Res., 13:281–305, February 2012. [6] Smriti Bhagat, Graham Cormode, and S. Muthukrishnan. Node classification in social networks. CoRR, abs/1101.3291, 2011. [7] 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, 31:2443–2450, 2003. [8] Shaosheng Cao, Wei Lu, and Qiongkai Xu. Grarep: Learning graph representations with global structural information. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, CIKM ’15, pages 891–900, New York, NY, USA, 2015. ACM. [9] Aditya Grover and Jure Leskovec. Node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pages 855–864, New York, NY, USA, 2016. ACM. [10] Gongde Guo, Hui Wang, David Bell, Yaxin Bi, and Kieran Greer. KNN Model-Based Approach in Classification, pages 986–996. Springer Berlin Heidelberg, Berlin, Heidelberg, 2003. [11] Aric A. Hagberg, Daniel A. Schult, and Pieter J. Swart. Exploring network structure, dynamics, and function using NetworkX. In Proceedings of the 7th Python in Science Conference (SciPy2008), pages 11–15, Pasadena, CA USA, August 2008. [12] J. D. Hunter. Matplotlib: A 2d graphics environment. Computing In Science & Engineering, 9(3):90–95, 2007. 7 [13] Jure Leskovec, Daniel Huttenlocher, and Jon Kleinberg. Signed networks in social media. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, CHI ’10, pages 1361–1370, New York, NY, USA, 2010. ACM. [14] Jure Leskovec, Jon Kleinberg, and Christos Faloutsos. Graph evolution: Densification and shrinking diameters. ACM Trans. Knowl. Discov. Data, 1(1), March 2007. [15] Jure Leskovec, Kevin J. Lang, Anirban Dasgupta, and Michael W. Mahoney. Community structure in large networks: Natural cluster sizes and the absence of large well-defined clusters. CoRR, abs/0810.1355, 2008. [16] Jure Leskovec and Julian J. Mcauley. Learning to discover social circles in ego networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 539–547. Curran Associates, Inc., 2012. [17] Miller McPherson, Lynn Smith-Lovin, and James M Cook. Birds of a feather: Homophily in social networks. Annual Review of Sociology, 27(1):415–444, 2001. [18] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. CoRR, abs/1301.3781, 2013. [19] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 3111–3119. Curran Associates, Inc., 2013. [20] Mingdong Ou, Peng Cui, Jian Pei, Ziwei Zhang, and Wenwu Zhu. Asymmetric transitivity preserving graph embedding. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pages 1105–1114, New York, NY, USA, 2016. ACM. [21] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. [22] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’14, pages 701–710, New York, NY, USA, 2014. ACM. [23] Radim Řehůřek and Petr Sojka. Software Framework for Topic Modelling with Large Corpora. In Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks, pages 45–50, Valletta, Malta, May 2010. ELRA. http://is.muni.cz/publication/884893/en. [24] Sam T. Roweis and Lawrence K. Saul. Nonlinear dimensionality reduction by locally linear embedding. SCIENCE, 290:2323–2326, 2000. [25] Lei Tang and Huan Liu. Relational learning via latent social dimensions. In Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’09, pages 817–826, New York, NY, USA, 2009. ACM. [26] Stefan van der Walt, S. Chris Colbert, and Gael Varoquaux. The numpy array: A structure for efficient numerical computation. Computing in Science and Engg., 13(2):22–30, March 2011. [27] Christopher J.C.H. Watkins and Peter Dayan. Technical note: Q-learning. Machine Learning, 8(3):279–292, 1992.
2cs.AI
A DSL for Mapping Abstract Syntax Models to Concrete Syntax Models in ModelCC arXiv:1301.4858v1 [cs.PL] 21 Jan 2013 Luis Quesada, Fernando Berzal, and Juan-Carlos Cubero Department of Computer Science and Artificial Intelligence, CITIC, University of Granada, Granada 18071, Spain [email protected], [email protected], [email protected] ModelCC is a model-based parser generator that decouples language design from language processing. ModelCC provides two different mechanisms to specify the mapping from an abstract syntax model to a concrete syntax model: metadata annotations defined on top of the abstract syntax model specification and a domain-specific language for defining ASM-CSM mappings. Using a domain-specific language to specify the mapping from abstract to concrete syntax models allows the definition of multiple concrete syntax models for the same abstract syntax model. In this paper, we describe the ModelCC domain-specific language for abstract syntax model to concrete syntax model mappings and we showcase its capabilities by providing a meta-definition of that domain-specific language. I. INTRODUCTION Model-based language specification techniques [4] decouple language design from language processing and automatically generate the corresponding language grammar, thus making the language design process less arduous. ModelCC [5, 6] is a model-based parser generator that allows the specification of the abstract syntax elements.a language as a set of classes, which represent language elements, and relationships between those classes or language elements. ModelCC allows mapping the abstract syntax model to concrete syntax models by imposing constraints over language elements and th(i.e. sort of a s using either metadata annotations or a domain specific language for the specification of language constraints (i.e. sort of a metalanguage). In this paper, we propose the ModelCC domainspecific language for abstract syntax model to concrete syntax model mappings (from now on referred as the ModelCC DSL for ASM-CSM mappings) and present its specification in a model-based way using ModelCC. This domain-specific language ultimately allows modelbased parser generators to decouple abstract syntax models from concrete syntax models. Section II introduces model-based language specification and the ModelCC model-based parser generator. Section III describes ModelCC the ModelCC domainspecific language for ASM-CSM mappings. Finally, Section IV presents our conclusions and future work. II. MODEL-BASED LANGUAGE SPECIFICATION Most existing language specification techniques [1] require the language designer to provide a textual specification of the language grammar. The proper specification of such a grammar is a nontrivial process that depends on the lexical and syntax analysis techniques to be used, since each kind of technique requires the grammar to comply with a specific set of constraints. Each analysis technique is characterized by its expression power and this expression power determines whether a given analysis technique is suitable for a particular language. The most significant constraints on formal language specification originate from the need to consider context-sensitivity, the need to perform an efficient analysis, and some techniques’ inability to resolve conflicts caused by grammar ambiguities. In practice, when we want to build a complex data structure from an input codified using a specific syntax, the implementation of the mandatory language processor requires the software engineer to build a grammar-based language specification for the input data and also to implement the conversion from the parse tree returned by the parser to the desired data structure, which is an instance of the data model that describes the input data. Whenever the language specification has to be modified, the language designer has to manually propagate changes throughout the entire language processor tool chain, from the specification of the grammar defining the formal language (and its adaptation to specific parsing tools) to the corresponding data model. These updates are time-consuming, tedious, and error-prone. By making such changes labor-intensive, the traditional language processing approach hampers the maintainability and evolution of the language used to represent the data [3]. Moreover, it is not uncommon for different applications to use the same language. For example, the compiler, different code generators, and other tools within an IDE, such as the editor or the debugger, typically need to grapple with the full syntax of a programming language. Unfortunately, their maintenance typically requires keeping several copies of the same language specification in sync. The idea behind model-based language specification is that, starting from a single abstract syntax model (ASM) that represents the core concepts in a language, language designers can develop one or several concrete syntax mod- 2 Context-Free Grammar e.g. BNF Attribute Grammar Conceptual Model instance of input Textual Representation instance of output Parser Concrete Syntax Model Abstract Syntax Tree Abstract Syntax Model Figure 1: Traditional language processing. Context-Free Grammar e.g. BNF Conceptual Model instance of input Textual Representation Concrete Syntax Model instance of output Parser Abstract Syntax Graph Abstract Syntax Model structures. Hence the use of the ‘abstract syntax graph’ term in Figure 2. When the ASM represents a tree-like structure, a model-based parser generator is equivalent to a traditional grammar-based parser generator in terms of expression power. When the ASM represents nontree structures, reference resolution techniques can be employed to make model-based parser generators more powerful than grammar-based ones. ModelCC [5, 6] is a parser generator that supports a model-based approach to the design of language processing systems. Its starting ASM is created by defining classes that represent language elements and establishing relationships among those elements. Once the ASM is established, constraints can be imposed over language elements and their relationships as annotations in order to produce the desired ASM-CSM mappings. The ASM is built on top of basic language elements, which can be viewed as the tokens in the model-driven specification of a language. ModelCC provides the necessary mechanisms to combine those basic elements into more complex language constructs, which correspond to the use of concatenation, selection, and repetition in the syntax-driven specification of languages. Figure 2: Model-based language processing. III. MODELCC DOMAIN-SPECIFIC LANGUAGE FOR ASM-CSM MAPPINGS els (CSMs). These CSMs can suit the specific needs of the desired textual or graphical representation. The ASMCSM mappings can be performed, for instance, by annotating the abstract syntax model with the constraints needed to transform the elements in the abstract syntax into their concrete representation. This way, the ASM representing the language can be modified as needed without having to worry about the language processor and the peculiarities of the chosen parsing technique, since the corresponding language processor will be automatically updated. In this case, the language designer does not have to manually propagate changes throughout the language processor tool chain. Also, when different applications use the same language, there is no need to keep or maintain duplicate language models. Finally, as the ASM is not bound to a particular parsing technique, evaluating alternative and/or complementary parsing techniques is possible without having to propagate their constraints into the language model. Therefore, by using an ASM, model-based language specification completely decouples language specification from language processing, which can be performed using whichever parsing techniques are suitable for the formal language implicitly defined by the abstract model and its concrete mapping. A diagram summarizing the traditional language design process is shown in Figure 1, whereas the corresponding diagram for the model-based approach is shown in Figure 2. It should be noted that ASMs may represent non-tree In ModelCC, the constraints imposed over ASMs to define a particular ASM-CSM mapping can be declared as metadata annotations on the model itself. Now supported by all the major programming platforms, metadata annotations are often used in reflective programming and code generation [2]. Table I summarizes the set of constraints supported by ModelCC for establishing ASM-CSM mappings between ASMs and their concrete representation in textual CSMs. However, in order to allow the developer to specify several ASM-CSM mappings, ModelCC also allows the specification of separate sets of constraints by using the ModelCC DSL for ASM-CSM mappings. Using the ModelCC DSL for ASM-CSM mappings instead of metadata annotations to specify ASM-CSM mappings allows the specification of several ASM-CSM mappings for the same ASM by means of separate constraint specification files. This ultimately allows for the proper model-based decoupling of language specification and language processing. In this section, we describe the ModelCC DSL for ASM-CSM mappings. We provide the ModelCC implementation of that DSL as an ASM complemented with metadata annotations. As an example of the usage of this language, we also provide the ModelCC implementation of the DSL for ASM-CSM mappings as an ASM complemented with constraint specification files written in the DSL for ASM-CSM mappings itself. Subsection III.A outlines the ModelCC DSL for ASMCSM mappings features. Subsection III.B provides the 3 Constraints on... Patterns Delimiters Cardinality Evaluation order References Annotation @Pattern @Value @Prefix @Suffix @Separator @Optional @Minimum @Maximum @Associativity @Composition @Priority @ID @Reference Function Pattern definition of basic language elements. Field where the matched input will be stored. Element prefix(es). Element suffix(es). Element separator(s). Optional elements. Minimum element multiplicity. Maximum element multiplicity. Element associativity (e.g. left-to-right). Eager or lazy policy for nested composites. Element precedence. Identifier of a language element. Reference to a language element. Table I: Summary of the basic metadata annotations supported by ModelCC. definition of the ModelCC DSL for ASM-CSM mappings as an ASM complemented with metadata annotations. Subsection III.C provides the definition of the ModelCC DSL for ASM-CSM mappings as an ASM complemented with several equivalent constraint specification files. It should be noted that all the features of the ModelCC DSL for ASM-CSM mappings make of ModelCC a complete model-based language workbench. B. ModelCC Definition of the DSL for ASM-CSM mappings A. Language Features The ModelCC DSL for ASM-CSM mappings supports the following features: • The definition of constraints on patterns, delimiters, evaluation order, and references between language elements. • The property-like specification of constraints for language elements and language element members. • The grammar-like specification of the concrete syntax of language elements by means of a regularexpression-like language. While the semantics of property-like constraint definitions is equivalent to that of metadata annotation constraint definitions, grammar-like constraint specification allows for a more intuitive specification of ASM-CSM mappings. Grammar-like constraint definitions may be more intuitive to traditional language designers who are familiar with syntax-driven language specification tools. Such constraint definitions can be redundant with the ASM as, for example, they can also include multiplicity constraints. ModelCC checks and reports if any syntax implicit in grammar-like constraint definitions conflicts with the language ASM. Finally, ModelCC checks, reports, and ignores any constraints on language elements on language element members that do not exist. The ASM of the ModelCC DSL for ASM-CSM mappings is designed first, and then it is mapped to a CSM by imposing constraints by means of metadata annotations on the model classes. The resulting model can be processed by ModelCC to generate the corresponding parser. The ModelCC language model (depicted as an UML class diagram) in Figure 3 presents the ModelCC DSL for ASM-CSM mappings. This Figure highlights two of the reasons why a DSL for ASM-CSM mappings is needed: • When metadata annotations are used to define ASM-CSM mappings on top of the ASM, the concrete syntax is interleaved in the abstract syntax model in a way that burdens it, similar to language processing being coupled with language specification in traditional syntax-driven language specification techniques • Also, there is no intuitive way to allow the specification of multiple ASM-CSM mappings using metadata annotations. C. Separating the ASM from the CSM Once an initial implementation of the ModelCC DSL for ASM-CSM mappings provides a bootstrap, we provide implementations of the ModelCC DSL for ASM-CSM 4 CSM - con strain ts : Con strain tDefin ition [] 0..* -con strain ts Con str ain tDefi n ition - target : Elemen t - @Prefix("[") @Suffix("]") con strain tID : Iden tifier - @Prefix(":") con strain t : Con strain tSpecification @Pattern ("[a-zA-Z][a-zA-Z0-9_]*") Iden tifi er -con strain tID - @Value n ame : Strin g 0..1 -n ame -target Elem en t - @Separator(".") n ame : Iden tifier[] -elemen t Patter n Specifi cation - pattern : Pattern Elem en tSpecifi cation - elemen t : Elemen t @Suffix("\*") Clausur eSpecifi cation - con strain t : Con strain tSpecification -pattern @Suffix("\+") PositiveClausur eSpecifi cation - con strain t : Con strain tSpecification Patter n - @Value regEx : Strin g @Pattern (RegExMatch er) @Prefix("\"") @Suffix("\"") @Suffix("\?") Option alSpecifi cation - con strain t : Con strain tSpecification @Prefix("\(") @Suffix("\)") Par en th esizedSpecifi cation - con strain t : Con strain tSpecification Liter alSpecifi cation - literal : Literal -literal - -con strain t 0..1 ConstraintSpecification : Literal -con strain t In teger - @Value value : in t -con strain t -con strain t Boolean - @Value value : boolean -con strain t Alter n ativeSpecifi cation - @Separator("\|") con strain ts : Con strain tSpecification [] @Priority(precedes=Altern ativeSpecification ) Sequen ceSpecifi cation - con strain ts : Con strain tSpecification [] @Priority(precedes={Altern ativeSpecification ,Sequen ceSpecification }) Pr eceden ceSpecifi cation - @Separator("\<") con strain ts : Con strain tSpecification [] -con strain ts -con strain ts -con strain ts Figure 3: Definition of the ModelCC DSL for ASM-CSM mappings in ModelCC. 5 CSM - con strain ts : Con strain tDefin ition [] -target -elemen t 0..* -con strain ts Con str ain tDefi n ition - target : Elemen t - con strain tID : Iden tifier - con strain t : Con strain tSpecification Elem en t - n ame : Iden tifier[] - Iden tifi er 0..1 - n ame : Strin g -con strain tID -n ame -con strain t 0..1 ConstraintSpecification : -con strain t PositiveClausur eSpecifi cation - con strain t : Con strain tSpecification Elem en tSpecifi cation - elemen t : Elemen t Patter n Specifi cation - pattern : Pattern -pattern Patter n - regEx : Strin g -con strain t Clausur eSpecifi cation - con strain t : Con strain tSpecification -con strain t Option alSpecifi cation - con strain t : Con strain tSpecification -con strain t Liter alSpecifi cation - literal : Literal Par en th esizedSpecifi cation - con strain t : Con strain tSpecification -con strain ts Literal -literal Alter n ativeSpecifi cation - con strain ts : Con strain tSpecification [] -con strain ts In teger - value : in t Boolean - value : boolean Sequen ceSpecifi cation - con strain ts : Con strain tSpecification [] Pr eceden ceSpecifi cation - con strain ts : Con strain tSpecification [] -con strain ts Figure 4: Definition of the abstract syntax model of the ModelCC DSL for ASM-CSM mappings in ModelCC. mappings that consist of an ASM and separate constraint definitions using that language. The ModelCC language model (depicted as an UML class diagram) in Figure 4 presents the ASM of the ModelCC DSL for ASM-CSM mappings. Starting from this ASM, we provide three different ASM-CSM mappings for the language, all of them written in the ModelCC DSL for ASM-CSM mappings itself. By complementing the ASM with any of the three following ASM-CSM mappings or any other equivalent one, we will obtain the same language as in the previous Section. • Property-like specification Figure 5 presents a property-like ASM-CSM mapping written in the ModelCC DSL for ASM-CSM mappings. The property-like specification of ASM-CSM mappings mimics the specification of constraints on ASMs using metadata annotations. It can be observed that the constraints are specified as proper- ties of language elements. • Grammar-like specification Figure 6 presents a grammar-like ASM-CSM mapping written in the ModelCC DSL for ASM-CSM mappings. Some of the advantages of grammar-like mappings can be observed in the specification of the ConstraintDefinition language element constraints. A single constraint specification can include prefix constraints, suffix constraints, and language element member order constraints. Also, the specification of the ConstraintDefinition language element constraints includes two multiplicity constraints (optionality, represented by the regex-like “?” operator) that are redundant with the ASM. ModelCC will check these multiplicity constraints for consistency with the ASM, and will report any conflict in parser generation time. Another illustrative case of grammar-like mappings 6 ConstraintDefinition.constraintID[prefix] "\[" ConstraintDefinition.constraintID[suffix] "\]" ConstraintDefinition.constraint[prefix]: ":" Element.name[separator]: "." Identifier.name: "[a-zA-Z][a-zA-Z0-9_]*" ClausureSpecification[suffix]: "\*" OptionalSpecification[suffix]: "\?" PositiveClauseSpecification[prefix]: "\+" ParenthesizedSpecification[prefix]: "\(" ParenthesizedSpecification[suffix]: "\)" SequenceSpecification[precedes]: AlternationSpecification PrecedenceSpecification ConstraintSpecification: SequenceSpecification < PrecedenceSpecification AlternationSpecification.constraints[separator]: "\|" PrecedenceSpecification[precedes]: AlternationSpecification PrecedenceSpecification.constraints[separator]: "\<" Boolean.value: "true|false" Integer.value: "[0-9]+" Figure 5: Property-like specification of the mapping from the abstract syntax model to the concrete syntax model of ModelCC DSL for ASM-CSM mappings, written in the ModelCC DSL for ASM-CSM mappings itself. ConstraintDefinition: target ("[" constraintID "]")? (":" constraint)? Element: name ("." name)* Identifier.name: "[a-zA-Z][a-zA-Z0-9_]*" ClausureSpecification: constraint "\*" OptionalSpecification: constraint "\?" PositiveClauseSpecification: constraint "\+" ParenthesizedSpecification: "\(" constraint "\)" ConstraintSpecification: SequenceSpecification < PrecedenceSpecification < AlternationSpecification AlternationSpecification: constraints ("\|" constraints)* PrecedenceSpecification: constraints ("\<" constraints)* Boolean.value: "true|false" Integer.value: "[0-9]+" Figure 6: Grammar-like specification of the mapping from the abstract syntax model to the concrete syntax model of ModelCC DSL for ASM-CSM mappings, written in the ModelCC DSL for ASM-CSM mappings itself. ConstraintDefinition: "[" constraintID "]" ConstraintDefinition: ":" constraint Element.name[separator]: "." Identifier.name: "[a-zA-Z][a-zA-Z0-9_]*" ClausureSpecification: constraint "\*" OptionalSpecification: constraint "\?" PositiveClauseSpecification: constraint "\+" ParenthesizedSpecification: "\(" constraint "\)" ConstraintSpecification: SequenceSpecification < PrecedenceSpecification < AlternationSpecification AlternationSpecification.constraints[separator]: "\|" PrecedenceSpecification.constraints[separator]: "\<" Boolean.value: "true|false" Integer.value: "[0-9]+" Figure 7: Mixed specification of the mapping from the abstract syntax model to the concrete syntax model of ModelCC DSL for ASM-CSM mappings, written in the ModelCC DSL for ASM-CSM mappings itself. 7 can be observed in the specification of the Element language element constraints. Although its member name is defined as a list in the ASM, the grammar-like constraint specification uses a classical explicit-list specification to specify the separator for list members. • Mixed specification Figure 7 presents another example of an ASM-CSM mapping written in the ModelCC DSL for ASM-CSM mappings. In this case, some constraints are specified grammar-like and some constraints are specified property-like. In this case, separators in lists are specified using property-like constraint definitions, which may seem more intuitive to some language designers. It should be noted that constraint definitions differ from grammar rules in that several of them can be specified for separate members of the same language element, as can be observed in the ConstraintDefinition language element. Finally, it should be noted that ASMs that are complemented with metadata annotations can be complemented with files written in the ModelCC DSL for ASMCSM mappings. Such files could redefine constraints that are specified in the original annotated ASM. Therefore, metadata annotation constraints would represent default values that would apply, unless otherwise specified, to all the ASM-CSM mappings of a language. IV. CONCLUSIONS AND FUTURE WORK ModelCC is a model-based parser generator that allows using metadata annotations or a domain-specific language to specify abstract syntax model to concrete syntax model mappings. In this paper, we have proposed and described the ModelCC domain-specific language for abstract syntax model to concrete syntax model mappings (ModelCC DSL for ASM-CSM mappings). The ModelCC DSL for ASM-CSM mappings allows the specification of separate abstract syntax model to concrete syntax model mappings and, therefore, effectively decouples abstract syntax models from concrete syntax models. As an example, we have specified the ModelCC DSL for ASM-CSM mappings as an ASM and several equivalent ASM-CSM mappings written in the ModelCC DSL for ASM-CSM mappings language itself. In the future, we plan to apply model-based language specification techniques to problems such as data integration and natural language processing. We also plan to incorporate different reference resolution techniques to ModelCC. References [1] Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools. Addison Wesley, 2nd edition, 2006. [2] Martin Fowler. Using metadata. IEEE Software, 19(6):13– 17, November 2002. [3] Lennart C. L. Kats, Eelco Visser, and Guido Wachsmuth. Pure and declarative syntax definition: Paradise lost and regained. In Proceedings of the ACM International Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’10), pages 918–932, 2010. [4] Anneke Kleppe. Towards the generation of a text-based IDE from a language metamodel. volume 4530 of Lecture Notes in Computer Science, pages 114–129, 2007. [5] Luis Quesada. A model-driven parser generator with reference resolution support. In Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering, pages 394–397, 2012. [6] Luis Quesada, Fernando Berzal, and Juan-Carlos Cubero. A language specification tool for model-based parsing. In Proceedings of the 12th International Conference on Intelligent Data Engineering and Automated Learning. Lecture Notes in Computer Science, volume 6936, pages 50–57, 2011.
6cs.PL
arXiv:1610.08115v1 [cs.AI] 25 Oct 2016 Under consideration for publication in Theory and Practice of Logic Programming 1 A Physician Advisory System for Chronic Heart Failure Management Based on Knowledge Patterns Zhuo Chen, Kyle Marple, Elmer Salazar, Gopal Gupta, Lakshman Tamil University of Texas at Dallas, Texas, U.S.A. (e-mail: {zxc130130,kbm072000,ees101020,gupta,laxman}@utdallas.edu) submitted 1 January 2003; revised 1 January 2003; accepted 1 January 2003 Abstract Management of chronic diseases such as heart failure, diabetes, and chronic obstructive pulmonary disease (COPD) is a major problem in health care. A standard approach that the medical community has devised to manage widely prevalent chronic diseases such as chronic heart failure (CHF) is to have a committee of experts develop guidelines that all physicians should follow. These guidelines typically consist of a series of complex rules that make recommendations based on a patient’s information. Due to their complexity, often the guidelines are either ignored or not complied with at all, which can result in poor medical practices. It is not even clear whether it is humanly possible to follow these guidelines due to their length and complexity. In the case of CHF management, the guidelines run nearly 80 pages. In this paper we describe a physicianadvisory system for CHF management that codes the entire set of clinical practice guidelines for CHF using answer set programming. Our approach is based on developing reasoning templates (that we call knowledge patterns) and using these patterns to systemically code the clinical guidelines for CHF as ASP rules. Use of the knowledge patterns greatly facilitates the development of our system. Given a patient’s medical information, our system generates a recommendation for treatment just as a human physician would, using the guidelines. Our system will work even in the presence of incomplete information. Our work makes two contributions: (i) it shows that highly complex guidelines can be successfully coded as ASP rules, and (ii) it develops a series of knowledge patterns that facilitate the coding of knowledge expressed in a natural language and that can be used for other application domains. This paper is under consideration for acceptance in TPLP. KEYWORDS: chronic disease management, chronic heart failure, knowledge pattern, answer set programming, clinical practice guideline, knowledge representation, automated reasoning 1 Introduction Chronic diseases are health conditions that can neither be prevented nor be cured but can only be managed. They have been the major consumer of health-care funds throughout the world. In America alone there are more than 133 million people—which is more than 40% of the U.S. population—who suffer from one or more chronic diseases (Wu and Green 2000). In the U.S. they account for 81% of hospital admissions, 91% of prescriptions filled and 76% of all physician visits (Anderson 2004). Though the list of chronic conditions is long, the top five conditions are: heart disease, cancers, stroke, chronic obstructive pulmonary disease (COPD) and diabetes. In 2010, 68% of the healthcare spending—more than trillion dollars—went towards the treatment of chronic diseases (Centers for Disease Control and Prevention 2016). The successful management of chronic diseases has two components: (i) self-management by the patients, and (ii) man- 2 Zhuo Chen, Kyle Marple, Elmer Salazar, Gopal Gupta, Lakshman Tamil agement by physicians while adhering to strict guidelines. The failure of either component will lead to the failure of the whole enterprise for the management of chronic diseases. We selected Chronic Heart Failure (CHF) as our first chronic disease to build tools to manage. Chronic Heart Failure is the inability of the heart to pump properly; consequently, not enough oxygen-rich blood can be supplied to all parts of the body. This causes congestion of blood in the lungs, abdomen, legs, etc., causing uneasiness while carrying out any kind of physical activity. Half of the people diagnosed with CHF die within five years. In U.S. alone there are 5.7 million people currently living with CHF (Go et al. 2013). This disease affects all age groups including children. The cost of this disease to the economy is enormous. The statistics show that there are 11 million physician visits and 875,000 hospitalizations per year due to CHF. 25% of patient with CHF are readmitted to a hospital or visit an emergency room within thirty days of treatment. This causes hospitals to lose money, as new regulations require them to bear the cost of readmission if it occurs within a period of thirty days. Our work on chronic disease management started several years ago with the building of a telemedicine-based chronic disease management system designed to facilitate the self-management of chronic diseases by patients (Monteiro et al. 2011; Monteiro 2015). Our chronic care platform was put to test to see whether it can successfully prevent patients from going to an emergency room or being readmitted to a hospital within 30 days of discharge after the original CHF episode. This was done in collaboration with Texas Health Resources (THR), one of the largest hospital chains in the southwestern United States. Statistically, 25% of discharged patients would be readmitted within 30 days. In our clinical study, 12 patients discharged from Texas Methodist Hospital in Cleburne, Texas after CHF episodes were chosen as subjects. (Note that though the number of patients used in the trial is not statistically significant to make any generalization but does prove the viability of our system). These patients were provided with our chronic care platform and peripheral devices such as a weighing scale, blood pressure meter, gluco-meter and pulse oximeter (these devices measure the vitals directly and are connected to our telemedicine device via Bluetooth). After some training by case nurses, the patients measured their vital signs periodically using these Bluetooth-enabled devices and answered questionnaires about their health. Using our platform, their vital sign data was automatically uploaded to a server where it was available for processing and viewing. Working remotely, the case nurse was able to manage the patients and prevent all of them from begin readmitted within 30 days (Baldwin et al. 2013). The telemedicine platform that we initially developed, and that we have licensed to a commercial company, only facilitated the transfer of information from patients residing remotely to the doctors and nurses providing care. In this paper, we focus on the second component of CHF management, namely, a Physician Advisory System. This system assists physicians in adhering to the guidelines for managing CHF. The CHF management guidelines are published by the American College of Cardiology Foundation (ACCF) and the American Heart Association (AHA). The most recent version is the 2013 ACCF/AHA Guideline for the Management of Heart Failure (Yancy et al. 2013). These guidelines were created by a committee of physicians based on thorough review of clinical evidence on heart failure management. They represent a consensus among the physicians on the appropriate treatment and management of heart failure (Jacobs et al. 2013). Though evidence-based guidelines should be the basis for all disease management (Faxon et al. 2004), physicians’ adherence to guidelines is very poor (Cabana et al. 1999). The major reasons for the failure of guideline implementation are lack of awareness, lack of familiarity, lack of motivation and external barriers. For 78% of clinical practice guidelines, more than 10% of the physicians are not aware of Theory and Practice of Logic Programming 3 their existence. Even when the guidelines are readily accessible, the physicians are not familiar enough with the guidelines to apply them correctly. In all the physician surveys conducted, the lack of familiarity was more common than the lack of awareness (Cabana et al. 1999). One of the reasons for the lack of familiarity is that the guidelines can be quite complex, as in the case of CHF management. For example, more than 100 variables have been associated with mortality and re-hospitalization related to heart failure. In the 2013 ACCF/AHA Guideline for the Management of Heart Failure, the variables range from simple information like age and sex to sophisticated data like the patterns in electrocardiogram and history of CHF-related symptoms and diseases. The rules for treatment recommendation in the guideline look like the following: “Aldosterone receptor antagonists are recommended to reduce morbidity and mortality following an acute MI in patients who have LVEF of 40% or less who develop symptoms of HF or who have a history of diabetes mellitus, unless contraindicated.” “In patients with a current or recent history of fluid retention, beta blockers should not be prescribed without diuretics.” With more than 60 rules like the ones above, giving correct recommendations becomes an error-prone task for even the most experienced physicians (Group 2006). To overcome the difficulties that physicians face in implementing the guidelines, we have developed a Physician Advisory System that automates the 2013 ACCF/AHA Guideline for the Management of Heart Failure. Our physician advisory system is able to give recommendations like a real human physician who is following the guidelines strictly, even under the condition of incomplete information about the patient. Our physician-advisory system for chronic heart failure management relies on answer set programming (Gelfond and Lifschitz 1988; Brewka et al. 2011) for coding the guidelines. The guideline rules are fairly complex and require the use of negation as failure, non-monotonic reasoning and reasoning with incomplete information. A fairly common situation in medicine is that a drug can only be recommended if its use is not contraindicated (i.e., the use of the drug will not have an adverse impact on that patient). Contraindication is naturally modeled via negation as failure. The ability of answer set programming to model defaults, exceptions, weak exceptions, preferences, etc., makes it ideally suited for coding these guidelines. Traditional techniques such as logic programming (Prolog) and production systems (OPS5), or traditional expert system styled approaches will result in a far more complex system due to the inability of these systems to model negation as failure effectively (Baral 2003). For example, in Prolog, negation as failure is unsound for non-grounded goals, and if care is not taken, then use of negation as failure in Prolog programs can often lead to non-termination. Thus, coding our system in these formalisms would be a much more difficult and complex task. In contrast, the CHF guidelines can be coded in ASP very naturally (it took about 2 months to develop the first version of the system). With the help of a telemedicine platform (Baldwin et al. 2013) and electronic medical records (EMR) integrated with our ASP-based system, significant automation can be achieved. Besides boosting the physicians’ compliance with the guidelines, the system can enable patients with CHF to manage their conditions with minimal supervision by doctors. The rest of this paper presents our ASP-based physician-advisory system as well as the knowledge patterns we have developed. We assume that the reader is familiar with ASP (Brewka et al. 2011). 4 Zhuo Chen, Kyle Marple, Elmer Salazar, Gopal Gupta, Lakshman Tamil 2 Automating Chronic Heart Failure Management The 2013 ACCF/AHA Guideline for the Management of Heart Failure is intended to assist healthcare providers in clinical decision making by describing a range of generally acceptable approaches for the management of chronic heart failure. The guideline is based on four progressive stages of heart failure. Stage A includes patients at risk of heart failure who are asymptomatic and do not have structural heart disease. Stage B describes asymptomatic patients with structural heart diseases; it includes New York Heart Association (NYHA) class I, in which ordinary physical activity does not cause symptoms of heart failure. Stage C describes patients with structural heart disease who have prior or current symptoms of heart failure; it includes NYHA class I, II (slight limitation of physical activity), III (marked limitation of physical activity) and IV (unable to carry on any physical activity without symptoms of heart failure, or symptoms of heart failure at rest). Stage D describes patients with refractory heart failure who require specialized interventions; it includes NYHA class IV. Interventions at each stage are aimed at reducing risk factors (stage A), treating structural heart disease (stage B) and reducing morbidity and mortality (stages C and D) (Yancy et al. 2013). The input to the system is a patient’s information, including demographics, history, daily symptoms, risks and measurements, as well as ACCF/AHA stage and NYHA class. When queried for a treatment recommendation, our system is able to give recommendations according to the guideline just as a physician would. Our system is designed for running on top of the s(ASP) system, a goal-directed, predicate ASP system that can be thought of as Prolog extended with negation based on the stable model semantics (Marple et al. 2016). Because of the goal-directed nature of the system, only the particular treatments applicable to the patient are reported by the system. With minor changes, our system will also work with traditional SAT-based implementations such as CLASP (Gebser et al. 2012; Gebser et al. 2014). However, these systems will compute the entire model, so if there are multiple treatments for a given condition, they will all be included in the answer set (these differences between goal-directed and SAT-based solvers are explained in (Marple & Gupta 2012)). To implement the CHF guidelines in ASP, we first extensively studied the guidelines to extract reasoning templates. These templates can be thought of as general knowledge patterns. These patterns were next deployed to code the CHF guideline rules. Our research makes two major contributions: 1. We develop a system that completely automates the entire set of guidelines for CHF management developed by the American College of Cardiology Foundation and American Heart Association. The system takes its input from (i) a patient’s electronic health record that includes demographic information, test results, etc., and (ii) a telemedicine system that provides data about vital signs (heart rate, blood pressure, weight, etc.). It then uses this information to recommend a treatment. The s(ASP) system also supports abduction, thus our system can also be used for abductive reasoning: a physician can, for example, figure out the symptoms that a particular patient must have in order for a given treatment to work. 2. We develop a set of general knowledge patterns that were used to realize our automated physician-advisory system and that can be helpful in translating rules expressed in a natural language into ASP for any application domain. Theory and Practice of Logic Programming 5 Table 1. Input of the Physician-Advisory System for CHF Management Demographics Gender; age; race Measurements Weight; creatinine; potassium; sinus rhythm; left bundle branch block; non-left bundle branch block; QRS duration; ejection fraction NYHA class; ACCF/AHA stage; Diseases and Symptoms Sleep apnea, acute coronary syndrome; myocardial infarction; obesity; diabetes; stroke; fluid retention; angioedema; ischemic attack; thromboembolism; elevated plasma natriuretic peptide level; asymptomatic ischemic cardiomyopathy; lipid disorders; hypertension; atrial fibrillation; myocardial ischemia; coronary artery disease; dilated cardiomyopathy; acute profound hemodynamic compromise; threatened end organ dysfunction; ischemic heart disease;angina; structural cardiac abnormalities; atrioventricular block; volume overload Miscellany Expectation of survival;pregnancy; history of cardiovascular hospitalization; history of standard neurohumoral antagonist therapy; risk of cardioembolic stroke; eligibility of significant ventricular pacing; eligibility of mechanical circulatory support; dependence of continuous parenteral inotropic; ischemic etiology of HF; requirement of ventricular pacing 3 A Physician-Advisory System for CHF Management 3.1 System Description A large number of software systems have been designed to address CHF. However, none of them are designed to automatically advise physicians based on the ACCF/AHA guidelines. Chronic disease management systems designed thus far fall into seven categories (Jantos and Holmes 2006): accessibility, care management, point-of-care functions, decision support, patient self-management, population management, and reporting. The automation of these functionalities is certainly helpful in assisting health care providers with managing patients with chronic conditions, however, none of them cover what we have realized: a physician advisory system that automates the application of clinical practice guidelines. As mentioned earlier, our physician advisory system for CHF management codes all the knowledge in the 2013 ACCF/AHA Guideline for the Management of Heart Failure (Yancy et al. 2013) as an answer set program. Our system is able to recommend treatments just like a human physician who is strictly following these guidelines. Additionally, our system is able to recommend treatments even when a patient’s information is incomplete. The input to our system is the patient’s information which includes demographics, history, daily symptoms, known risk factors, measurements as well as ACCF/AHA stage and NYHA class (Yancy et al. 2013). The inputs to our system are summarized in Table 1. A physician uses our system by posing a query to it. Our system then processes the query by essentially simulating the thinking process of a CHF specialist (represented by the ACCF/AHA guideline). The physician-advisory system for CHF management has two major components, the rules database and the fact table. The rules database covers all the knowledge in 2013 ACCF/AHA Guideline for the Management of Heart Failure (Yancy et al. 2013). The fact table contains the relevant information of the patient with heart failure. The fact table is derived from a patient’s electronic health record and from a telemedicine system used to measure vital signs. The patient 6 Zhuo Chen, Kyle Marple, Elmer Salazar, Gopal Gupta, Lakshman Tamil Table 2. Output of the Physician-Advisory System for CHF Management Pharmaceutical Treatments ACE inhibitors; ARBs; Beta blockers; statin; diuretics; aldosterone receptor antagonists; hydralazine and isosorbide dinitrate; digoxin; anticoagulations; Omege-3 fatty acids; inotropes; Management Objectives Systolic blood pressure control; diastolic blood pressure control; obesity control; diabetes control; tobacco avoidance; cardiotoxic agents avoidance; atrial fibrillation control; water restriction; sodium restriction; Device/Surgery Therapies Implantable cardioverter-defibrillator; cardiac resynchronization therapy; mechanical circulatory support; coronary revascularization information consists mainly of: 5 pieces of demographics information, 8 measurements and 25 types of HF-related diseases and symptoms. Treatment recommendations returned by the system may include: 11 pharmaceutical treatments, 9 management objectives, and 4 device/surgery therapies. Table 2 displays the outputs produced by our system. There are some sixty odd rules in the 2013 ACCF/AHA Guideline for the Management of Heart Failure. All of these rules are coded in ASP to run on the s(ASP) system (Marple et al. 2016). For example, take one rule from ACCF/AHA Stage B (Yancy et al. 2013): “In all patients with a recent or remote history of MI or ACS and reduced EF, evidence-based beta blockers should be used to reduce mortality.” In s(ASP), this rule will be coded as shown below. Note that Prolog conventions are followed (variables begin with an upper case letter). recommendation(beta_blockers, class_1):- accf_stage(b), history_of_mi_or_acs, measurement(lvef, Data), reduced_ef(Data), not contraindication(beta_blockers). Due to using ASP as the modeling formalism, our system is able to handle complex scenarios. To illustrate this, consider a situation in which we have a patient who has heart failure with reduced ejection fraction (HFrEF) and is in ACCF/AHA stage C. According to the guideline (Yancy et al. 2013) our system would recommend the use of beta blockers. However, if we add the information that the patient has a history of fluid retention, then our system would try to add diuretics due to the following rule: “In patients with a current or recent history of fluid retention, beta blockers should not be prescribed without diuretics” (Yancy et al. 2013). However, if diuretics are contraindicated for any reason, then our system will not recommend beta blockers either. Our software system has been tested in-house and outputs found to be consistent with our interpretation of the rules. More extensive testing and a clinical trial are planned in the near future in collaboration with medical doctors who are CHF specialists. Our system can also perform abductive reasoning thanks to the s(ASP) system’s support for abduction (Marple et al. 2016). Abductive reasoning is a form of logical inference where one attempts to augment a theory with sufficient information to explain an observation (the augmentations come from a set of predicates that are declared as abducibles). To illustrate, consider the following two rules in the ACCF/AHA guideline (Yancy et al. 2013): Theory and Practice of Logic Programming 7 {accf stage(c), hf with reduced ef, history(standard neurohormonal antagonist therapy), nyha class(3), nyha class 3 to 4, race(african american), recommendation(hydralazine and isosorbide dinitrate,class 1), not contraindication(hydralazine and isosorbide dinitrate)} Fig. 1. Result of abductive reasoning in physician-advisory system for CHF management • Combination of hydralazine & isosorbide dinitrate is recommended to reduce morbidity & mortality for patients self-described as African Americans with NYHA class III-IV HFrEF receiving optimal therapy with ACE inhibitors & and beta blockers, unless contraindicated. • Combination of hydralazine & isosorbide dinitrate should not be used for the treatment of HFrEF in patients who have no prior use of standard neurohormonal antagonist therapy. Suppose we have an African American patient who is suffering from NYHA class III HFrEF, but that is all we know about the patient. Since a hydralazine and isosorbide dinitrate combination is highly effective in reducing the mortality of African Americans with HFrEF, the physician might pose the following query: ?-recommendation((hydralazine and isosorbide dinitrate), class 1) to the s(ASP) system. The system would return the results shown in figure 1. Note that the system abduced two things: (i) a “history of standard neurohormonal antagonist therapy”, and (ii) the absence of “contraindication of hydralazine and isosorbide dinitrate”. This means in order for us to recommend hydralazine and isosorbide dinitrate to the patient, they must have received standard neurohormonal antagonist therapy before. Otherwise, hydralazine and isosorbide dinitrate would be contraindicated. 3.2 Knowledge patterns in the guidelines for the management of heart failure The ACCF/AHA guidelines are written in English and are quite complex. Our task was to code these guidelines in ASP. To simplify our task, we developed reasoning templates that we call knowledge patterns. These knowledge patterns are quite general and serve as solid building blocks for systematically translating the specifications written in English to ASP. While developing these knowledge patterns and coding them in ASP, certain facts had to be noted: (i) Multiple rules can lead to the recommendation of a treatment; (ii) Multiple rules can lead to contraindication of a treatment; (iii) A treatment cannot be recommended if at least one contraindication for that treatment is present; and, (iv) A given treatment recommendation can impact the recommendation and/or contraindication of other treatments. Next, we present the most salient knowledge patterns that we have developed. Many of these patterns are straightforward, however, some of them, such as the concomitant choice rule, are intricate. We present these patterns at a high level and ignore non-essential details. 1. Aggressive Reasoning: The aggressive reasoning pattern can be stated as “take an action (e.g., recommend treatment) if there is a reason; no evidence of danger means there is no danger in taking that action”. The aggressive reasoning pattern is coded as follows: recommendation(Choice) :- preconditions(Choice), not contraindication(Choice). contraindication(Choice) :- dangers(Choice). The code above makes use of negation as failure. If the contraindication of a choice cannot 8 Zhuo Chen, Kyle Marple, Elmer Salazar, Gopal Gupta, Lakshman Tamil be proved, and the conditions for making the choice hold, then that choice is recommended. An example of this knowledge pattern can be found in (Yancy et al. 2013): “Digoxin can be beneficial in patients with HFrEF, unless contraindicated, to decrease hospitalizations for HF.” It is realized in our system as shown below. recommendation(digoxin, class_2a) :- not contraindication(digoxin), accf_stage(c), hf_with_reduced_ef. contraindication(digoxin) :- evidence(atrioventricular_block). 2. Conservative Reasoning: This reasoning pattern is stated as “A reason for a recommendation is not enough; evidence that the recommendation is not harmful must be available”. The conservative reasoning pattern is coded as follows: recommendation(Choice) :- preconditions(Choice), not contraindication(Choice). contraindication(Choice) :- not -dangers(Choice). This coding pattern requires evidence of the absence of danger. Without such evidence, the choice would be considered contraindicated. Note that the “-” operator indicates classical negation. An example of this knowledge pattern can be found in (Yancy et al. 2013): “In patients with structural cardiac abnormalities, including LV hypertrophy, in the absence of a history of MI or ACS, blood pressure should be controlled in accordance with clinical practice guidelines for hypertension to prevent symptomatic HF.” It is realized in our system as shown below. recommendation(blood_pressure_control, class_1):accf_stage(b), diagnosis(structural_cardiac_abnormalities), not contraindication(blood_pressure_control). contraindication(blood_pressure_control):- not -history(mi). contraindication(blood_pressure_control):- not -history(acs). 3. Anti-recommendation: The anti-recommendation pattern is stated as “a choice can be prohibited if evidence of danger can be found”. The coding pattern for the anti-recommendation is coded as follows: contraindication(choice) :- dangers(Choice). The code above specifies the conditions under which a choice will be ruled out (i.e., contraindicated). Note that for a choice to be made, both aggressive reasoning and conservative reasoning require that the contraindication of the choice be false. An example of this knowledge pattern can be found in (Yancy et al. 2013): “Anticoagulation is not recommended in patients with chronic HFrEF without AF, a prior thromboembolic event, or a cardioembolic source.” It is realized in our system as shown below. contraindication(anticoagulation) :- not cardioembolic_source, not diagnosis(af), not history(thromboembolism), hf_with_reduced_ef. 4. Preference: The preference pattern is stated as “use the second-line choice when the first-line choice is not available”. The preference pattern is coded as follows: Theory and Practice of Logic Programming 9 recommendation(First_choice) :- conditions_for_both_choices, not contraindication(First_choice). recommendation(Second_choice) :- conditions_for_both_choices, contraindication(First_choice), not contraindication(Second_choice). This code chooses the treatment recommendation in the second choice only when the conditions are satisfied, the first choice is contraindicated, and there is no evidence preventing the use of second choice. An example of this knowledge pattern can be found in (Yancy et al. 2013): “ARBs are recommended in patients with HFrEF with current or prior symptoms who are ACE inhibitor intolerant, unless contraindicated, to reduce morbidity and mortality.” It is realized in our system as shown below. recommendation(ace_inhibitors, class_1) :not contraindication(ace_inhibitors), accf_stage(c), hf_with_reduced_ef. recommendation(arbs, class_1) :- contraindication(ace_inhibitors), not contraindication(arbs), not taboo_choice(arbs), accf_stage(c), hf_with_reduced_ef. 5. Concomitant Choice: The concomitant choice pattern is stated as “if a choice is made, some other choices are automatically in effect unless they are prohibited.” The concomitant pattern is coded as shown below. recommendation(Trigger_choice) :- preconditions(Trigger_choice), not contraindication(Trigger_choice), not skip_concomitant_choice(Trigger_choice). skip_concomitant_choice(Trigger_choice) :not recommendation(Concomitant_choice), not contraindication(Concomitant_choice). recommendation(Concomitant_choice) :recommendation(Trigger_choice), not contraindication(Concomitant_choice). The above code makes sure that a concomitant choice appears in all stable models containing the trigger choice, provided the concomitant choice is not prohibited. The trigger choice is always recommended along with the concomitant choice unless the concomitant choice is contraindicated. An example of this knowledge pattern can be found in (Yancy et al. 2013): “Diuretics should generally be combined with an ACE inhibitor, beta blocker, and aldosterone antagonist. Few patients with HF will be able to maintain target weight without the use of diuretics.” It is realized in our system as shown below. To save space, we list only the code for ACE inhibitors. recommendation(ace_inhibitors, class_1) :- accf_stage(c), not skip_concomitant_choice(ace_inhibitors), not contraindication(ace_inhibitors), hf_with_reduced_ef. skip_concomitant_treatment(ace_inhibitors) :hf_with_reduced_ef, not recommendation(diuretics, class_1), not contraindication(diuretics). 10 Zhuo Chen, Kyle Marple, Elmer Salazar, Gopal Gupta, Lakshman Tamil recommendation(diuretics, class_1) :hf_with_reduced_ef, not contraindication(diuretics), recommendation(ace_inhibitors, class_1). 6. Indispensable Choice: The indispensable choice pattern is stated as “if a choice is made, some other choices must also be made; if those choices can’t be made, then the first choice is revoked”. Note that choosing Trigger choice forces Indispensable choice. The indispensable choice pattern is coded as shown below: recommendation(Trigger_choice) :- preconditions(Trigger_choice), not contraindication(Trigger_choice) not absent_indispensable_choice(Trigger_choice). absent_indispensable_choice(Trigger_choice) :not recommendation(Indispensable_choice). recommendation(Indispensable_choice) :- recommendation(Trigger_choice), not contraindication(Indispensable_choice). The above code makes sure that the trigger choice will always appear with the indispensable choice. If for some reason the indispensable choice cannot be made, then the trigger choice cannot be made either. An example of this knowledge pattern can be found in (Yancy et al. 2013): “In patients with a current or recent history of fluid retention, beta blockers should not be prescribed without diuretics”. It is realized in our system as shown below. recommendation(beta_blockers, class_1) :not skip_concomitant_choice(beta_blockers), not absent_indispensable_choice(beta_blockers), not contraindication(beta_blockers), accf_stage(c), hf_with_reduced_ef. absent_indispensable_choice(beta_blockers) :not recommendation(diuretics, class_1), hf_with_reduced_ef, accf_stage(c), current_or_recent_history_of_fluid_retention. recommendation(diuretics, class_1) :recommendation(beta_blockers, class_1), not contraindication(diuretics), accf_stage(c), hf_with_reduced_ef, current_or_recent_history_of_fluid_retention. 7. Incompatible Choice: The incompatibility pattern is stated as “some choices cannot be in effect at the same time”. The incompatible choice pattern is coded as shown below: taboo_choice(Choice_1) :recommendation(Choice_2), ..., recommendation(Choice_n). taboo_choice(Choice_2) :recommendation(Choice_1), recommendation(Choice_3), .... recommendation(Choice_n). ... recommendation(Choice_1) :conditions_for_choice_1, not contraindication(Choice_1), not taboo_choice(Choice_1). recommendation(Choice_2) :conditions_for_choice_2, not contraindication(Choice_2), not taboo_choice(Choice_2). ... Theory and Practice of Logic Programming taboo_choice(Choice_n) :recommendation(Choice_1), recommendation(Choice_2), .... recommendation(Choice_n-1). 11 recommendation(Choice_n) :conditions_for_choice_n, not contraindication(Choice_n), not taboo_choice(Choice_n). The above code makes sure that incompatible choices will not be made together. Note that we did not use a simple constraint to implement this pattern. A constraint would kill all stable models if each of the choices in question can be made. Our implementation, on the other hand, will produce partial answer sets supporting the query, thanks to the goal-driven mechanism of s(ASP) (Marple et al. 2016). An example of this knowledge pattern can be found in (Yancy et al. 2013): “Routine combined use of an ACE inhibitor, ARB, and aldosterone antagonist is potentially harmful for patients with HFrEF.” It is realized in our system as shown below. taboo_choice(ace_inhibitors) :- hf_with_reduced_ef, recommendation(arbs, class_1), recommendation(aldosterone_antagonist, class_1). taboo_choice(arbs) :- hf_with_reduced_ef, recommendation(ace_inhibitors, class_1), recommendation(aldosterone_antagonist, class_1). taboo_choice(aldosterone_antagonist) :- hf_with_reduced_ef, recommendation(arbs, class_1), recommendation(ace_inhibitors, class_1). recommendation(ace_inhibitors, class_1) :- accf_stage(c), hf_with_reduced_ef, not skip_concomitant_choice(ace_inhibitors), not taboo_choice(ace_inhibitors), not contraindication(ace_inhibitors). recommendation(arbs, class_1) :- contraindication(ace_inhibitors), not contraindication(arbs), not taboo_choice(arbs), accf_stage(c), hf_with_reduced_ef. recommendation(aldosterone_antagonist, class_1) :conditions_for_aldosterone_antagonist_class_1, not skip_concomitant_choice(aldosterone_antagonist), not contraindication(aldosterone_antagonist), not taboo_choice(aldosterone_antagonist). 4 Results and discussion Our system has been tested in-house and has shown accurate results that are compatible with what a physician following the guidelines would conclude. A clinical trial is planned. To illustrate how our system works, consider a female heart failure patient who is in ACCF/AHA stage C, belongs to NYHA class 3 and has been diagnosed as myocardial ischemia, atrial fibrillation, coronary artery disease. She also suffers from sleep apnea, fluid retention and hypertension. Her left ventricular ejection fraction (LVEF) is 35%. There is evidence that she has ischemic etiology of heart failure. Her electrocardiogram (ECG) has sinus rhythm and a left bundle branch block (LBBB) pattern with a QRS duration of 180ms.The blood test says her creatinine is 1.8 mg/dL and potassium is 4.9 mEg/L. She has a history of stroke. It has been 40 days since the acute myocardial infarction happened to her. Her doctor assessed that her expectation of survival is about 3 years. 12 Zhuo Chen, Kyle Marple, Elmer Salazar, Gopal Gupta, Lakshman Tamil %doctor’s assessments accf_stage(c). nyha_class(3). expectation_of_survival(3). %demographics of the patient gender(female). age(78). %measurements from the lab hf_with_reduced_ef. measurement(creatinine, 1.8). measurement(potassium, 4.9). measurement(lvef, 0.35). measurement(lbbb, 180). measurement(sinus_rhythm). %history of the patient diagnosis(myocardial_ischemia). diagnosis(atrial_fibrillation). diagnosis(coronary_artery_disease). diagnosis(hypertension). evidence(ischemic_etiology_of_hf). evidence(sleep_apnea). evidence(fluid_retention). history(mi, recent). history(stroke). history(cardiovascular_hospitalization). post_mi(40). Fig. 2. Representation of a patient’s information in physician-advisory system for CHF management The patient’s information derived from her electronic health record is coded as the facts shown in Figure 2. There are multiple treatments for this patient. Figure 3 shows some of the treatment recommendations our system infers once we give the query recommendation(Treatment, Class). Each treatment recommendation (represented as a partial answer set) contains all of the predicates that must hold in order for the query to be successful. For instance, consider the recommendation of ace inhibitors as a treatment option (answer #2). Ace inhibitors are recommended because the patient is in ACCF/AHA Stage C, per the doctor’s assessment, and has heart failure with reduced ejection fraction condition. Proof of contraindication for ace inhibitors is absent as the patient does not have a history of angioedema (not history(angiodema)) and is not pregnant (not pregnancy). The system also gives us the concomitant treatments for ace inhibitors, namely, beta blockers and diuretics. It is worth mentioning that we used the aggressive reasoning pattern (see section 3.2) when coding the rules of ace inhibitors. Had we adopted the conservative reasoning pattern, ace inhibitors would not have been recommended unless we explicitly asserted -history(angioedema) and -pregnancy in the patient’s information (a definitive proof of the latter can be derived from patient’s age (78)). Given that there may be multiple treatment options for a particular patient, the choice of a particular treatment will depend on the physician’s preference. Rules that capture a physician’s or a nurse’s preference can also be coded as answer set programs in our system. While our testing indicates that the system works well and the results produced are consistent with what a physician may recommend, if they were to exactly follow the guidelines, a clinical trial is needed to truly validate our system, and is indeed planned. As mentioned earlier, our system can be used for abductive reasoning as well. Running the system in the abductive mode can allow a physician to try out what-if scenarios and to make sure that all the pre-conditions required for treatment are met. Theory and Practice of Logic Programming 13 { accf stage(c), recommendation(sodium restriction,class 2a), not contraindication(sodium restriction) } Treatment = sodium restriction, Class = class 2a { accf stage(c), hf with reduced ef, recommendation(ace inhibitors,class 1), recommendation(beta blockers,class 1), recommendation(diuretics,class 1), not contraindication(ace inhibitors), not contraindication(beta blockers), not contraindication(diuretics), not history(angioedema), not history(angioedema,recent), not history(angioedema,remote), not pregnancy } Treatment = ace inhibitors, Class = class 1 Fig. 3. Output of the physician-advisory system for CHF management 5 Conclusion and future work In this paper we report on our work on developing a ASP-based physician advisory system for managing CHF using a telemedicine platform. The system automates the rules laid out in the 2013 ACCF/AHA Guide for the Management of Heart Failure. It is able to take a patient’s data as input and produce treatment recommendations that strictly adhere to the guidelines. It can also be used by a physician to abduce symptoms and other conditions that must be met by a given treatment recommendation. Our approach to developing the system was based on identifying knowledge patterns and using them as building blocks for constructing the ASP code. There are many ways to further extend our work that we plan to pursue in the future: • Extending the system for comorbidities: We would like our system to handle comorbidities of heart failure (Jantos and Holmes 2006). A typical CHF patients suffers from other chronic ailments as well, i.e., CHF generally never occurs by itself. • Performing clinical trials: our system has been tested in-house, however, we plan to compare the recommendations given by our system to the prescriptions by human cardiologists in a formal clinical trial to validate the effectiveness of our system. • Integrating with EMRs and a Telemedicine Platform: Future work would include integrating our system with our telemedicine platform so that the input comes directly from the electronic medical record while vital signs are directly obtained from the patient through our telemedicine hardware and software (Monteiro et al. 2011; Monteiro 2015). A userfriendly GUI will also be designed to make the system more usable. • Adding justification to recommendations given by our system: Although the rationale behind a recommendation is shown in the partial answer set, it is hard to decipher it. We plan to augment s(ASP) (Marple et al. 2016) so that reasonably detailed justifications for a query are printed in a human-readable form. • Formal Analysis: Conducting research to formally establish the correctness of our system. Acknowledgment: Thanks to Dr. Michael Skinner for discussion. This research is supported by NSF (Grant No. 1423419) and the Texas Medical Research Collaborative. References A NDERSON , G. 2004. Chronic conditions: making the case for ongoing care. Johns Hopkins University. 14 Zhuo Chen, Kyle Marple, Elmer Salazar, Gopal Gupta, Lakshman Tamil BALDWIN , K. M., B LACK , D. L., AND H AMMOND , S. L. 2013. Hospital-based post-discharge community case management - podium presentation. In ANCC Pathway to Excellence Conference. BARAL , C, 2003. Knowledge Representation, Reasoning and Declarative Problem Solving. Cambridge University Press. B REWKA , G., E ITER , T., AND T RUSZCZYNSKI , M. 2011. Answer set programming at a glance. Commun. ACM 54, 12, 92–103. C ABANA , M. D., R AND , C. S., P OWE , N. R., AND ET AL . 1999. Why don’t physicians follow clinical practice guidelines?: A framework for improvement. JAMA 282, 15, 1458–1465. C ENTERS FOR D ISEASE C ONTROL AND P REVENTION. 2016. Chronic disease overview page. http://www.cdc.gov/chronicdisease/overview/index.htm. FAXON , D. P., ET AL . 2004. Improving quality of care through disease management principles and recommendations from the american heart associations expert panel on disease management. Stroke 35, 6, 1527–1530. G EBSER , M., K AUFMANN , B., AND S CHAUB , T. 2012. Conflict-driven answer set solving: From theory to practice. In Artif. Intell. 187, 52-89. G EBSER , M., K AMINSKI, K AUFMANN , B., AND S CHAUB , T. 2014. Clingo = ASP + Control: Preliminary Report. In Proc. ICLP 2014 Proc. G ELFOND , M. AND L IFSCHITZ , V. 1988. The stable model semantics for logic programming. Proc. ICLP 1988. MIT Press, 1070–1080. G O , A. S., M OZAFFARIAN , D., B ENJAMIN , E. J., ET AL . 2013. Heart disease and stroke statistics 2013 update: a report from the american heart association. Tech. rep. G ROUP, T. M. N. 2006. Enhancing the use of clinical guidelines: a social norms perspective. Journal of the American College of Surgeons 202, 5, 826–836. JACOBS , A. K., K USHNER , F. G., AND ET AL . 2013. ACCF/AHA clinical practice guideline methodology summit report: A report of the american college of cardiology foundation/american heart association task force on practice guidelines. Journal of the American College of Cardiology 61, 2, 213–265. JANTOS , L. D. AND H OLMES , M. L. 2006. IT Tools for Chronic Disease Management: How Do They Measure Up? California HealthCare Foundation (chfc.org; retrieved Jan. 2016). M ARPLE , K. AND G UPTA , G. Goal-directed execution of answer set programs. Proc. PPDP 2012: 35-44 M ARPLE , K., S ALAZAR , E., AND G UPTA , G. 2016. s(ASP). https://sourceforge.net/projects/sasp-system/ . M ONTEIRO , S. 2015. An intelligent telemedicine platform with cognitive support for chronic care management. Ph.D. thesis, Quality of Life Technology Lab, UT Dallas. M ONTEIRO , S., G UPTA , G., N OURANI , M., AND TAMIL , L. 2011. Hygeiatel: An intelligent telemedicine system with cognitive support. In Proceedings of the First ACM Workshop on Mobile Systems, Applications, and Services for Healthcare. mHealthSys ’11. ACM, New York, NY, USA, 9:1–2. W U , S. Y. AND G REEN , A. 2000. Projection of chronic illness prevalence and cost inflation. Santa Monica, CA: RAND Health, 2000. YANCY, C. W., J ESSUP, M., B OZKURT, B., AND ET AL . 2013. 2013 ACCF/AHA guideline for the management of heartfailure: A report of the american college of cardiology foundation/american heart association task force on practice guidelines. Journal of the American College of Cardiology 62, 16, e147.
6cs.PL
Convolutional Drift Networks for Video Classification Dillon Graham§ , Seyed Hamed Fatemi Langroudi§,Christopher Kanan† and Dhireesha Kudithipudi§ arXiv:1711.01201v1 [cs.CV] 3 Nov 2017 § NanoComputing Research Lab, † kLab Rochester Institute of Technology Rochester, New York 14623 Abstract—Analyzing spatio-temporal data like video is a challenging task that requires processing visual and temporal information effectively. Convolutional Neural Networks have shown promise as baseline fixed feature extractors through transfer learning, a technique that helps minimize the training cost on visual information. Temporal information is often handled using hand-crafted features or Recurrent Neural Networks, but this can be overly specific or prohibitively complex. Building a fully trainable system that can efficiently analyze spatio-temporal data without hand-crafted features or complex training is an open challenge. We present a new neural network architecture to address this challenge, the Convolutional Drift Network (CDN). Our CDN architecture combines the visual feature extraction power of deep Convolutional Neural Networks with the intrinsically efficient temporal processing provided by Reservoir Computing. In this introductory paper on the CDN, we provide a very simple baseline implementation tested on two egocentric (first-person) video activity datasets. We achieve video-level activity classification results on-par with state-of-the art methods. Notably, performance on this complex spatio-temporal task was produced by only training a single feed-forward layer in the CDN. Index Terms—Deep Learning, Reservoir Computing, Video Activity Classification I. I NTRODUCTION Deep neural networks have significantly advanced the state-of-the-art in computer vision [1], natural language processing [2], speech recognition [3], and robotics [4]. These networks are very effective at extracting highlevel, complex abstractions of input data through a hierarchical learning process. Deep Convolutional Neural Networks (CNNs) achieve superior performance in visual object recognition tasks, and they have largely replaced hand-crafted features as the standard approach in this area. While deep learning is advantageous for large amounts of spatial data, it also has limitations. Using these networks for temporal data (e.g. video analysis) introduces several new challenges, typically addressed using Recurrent Neural Networks (RNNs). Modern RNN models like Long Short-Term Memory (LSTM) are an effective way to handle temporal data, but they also tend to be difficult and expensive to train. In video analysis, LSTMs are often paired with CNNs, but this is likely to increase network and training complexity for most tasks. A simpler method for analyzing spatio-temporal data is desirable, and video analysis tasks are complex enough to reasonably test new methods. Video is now a ubiquitous source of spatio-temporal data, and interest in video analysis has risen due to the increasing presence of video data on the internet. Despite the rise of video data availability, video analysis remains a relatively under-examined area compared to image analysis. Many approaches still focus on hand-crafted features akin to those historically used in computer vision. Works applying deep learning to this domain with CNNs and hierarchical layers of LSTMs have shown results [5], but combining a CNN with hierarchical layers of LSTMs necessitates training a very large number of parameters, tuning many different hyper-parameters, and performing backpropagation through time. These requirements can be prohibitive, especially in real-world applications with size, weight, area, and power constraints (e.g. robotics, remote sensing, autonomous vehicles). Visual information in video can be processed on a per-frame basis using CNNs, but training a randomly initialized deep network capable of operating on high resolution image data requires large amounts of labeled data. Without sufficient training data, these networks are prone to overfitting. Unfortunately, many datasets do not contain enough labeled training samples for networks to converge effectively. In computer vision, this problem has been partially resolved using transfer learning to improve performance and decrease training time. This is usually achieved by initializing a new network with layers and trained weights drawn from a publicly available high-performance CNN model. In most cases, these source networks were built to achieve state-of-the-art results for ImageNet, a dataset that contains 1000 different object categories over approximately one million labeled images. When trained on this kind of large natural image dataset, early convolutional layers in a CNN produce features with a surprising level of generality (i.e., features remain useful for most images) [6], [7]. This feature generality is the primary characteristic which makes transfer learning with pre-trained CNNs so effective. Less work has been done in applying this kind of transfer learning to video datasets, and the best way to do this is still an open question. RNNs can be used for processing temporal information in video, but successes are limited to LSTM and its variants. RNNs are often are either inherently complex, or have other limitations (e.g., capacity in Hopfield networks). Reservoir Computing (RC) offers some under-examined alternative RNN models, which are simple to construct and require minimal training. RC models are based on a neuroscientific model of corticostriatal processing loops [8], and they have been studied in many different applications [9], [10] as an unconventional RNN. Two well known RC models are the Liquid State Machine (LSM) [11] and the Echo State Network (ESN) [12]. In this paper, we propose a novel neural network architecture, the Convolutional Drift Network (CDN). CDNs produce per-frame appearance features from video using a deep CNN, and those features are pushed into a randomly initialized ESN reservoir. Since the ESN reservoir topology and weights are static after initialization, features produced by the CNN are the driving force in this network. Essentially, once a feature is produced and pushed into the ESN, it is left to propagate naturally, or ‘drift’ through the fading memory representation produced by the Echo State property of ESNs. We evaluate our model on two video classification datasets. We also investigate how far we can simplify CDN training while still achieving competitive performance on this non-trivial classification task. Minimizing training complexity and resources is a step toward the eventual implementation of similar architectures on hardware for field-deployable systems. The specific contributions of this research are: 1) We introduce a new neural network architecture for spatio-temporal tasks, the Convolutional Drift Network (CDN). 2) We bridge the gap between deep CNNs and ESNs. 3) We demonstrate that CDNs are competitive at video classification tasks with state-of-the-art methods, using only a single trained neural network layer. II. R ELATED W ORKS A. Video Activity Classification Video activity classification requires identifying appearance features present in video frames, often called feature descriptors. Feature descriptors are used to find correlated frames in a sequence. This has been accomplished with several methods, for example: creating bag-of-words histograms of CNN features [13] and using LSTMs to process sequential CNN features [5]. LSTMs outperform simpler temporal pooling techniques [5]. However, training an LSTM requires using the backpropagation-through-time algorithm, which is expensive, both in time and energy. For video classification problems, this often requires multiple days, even when GPUs are used. Video frames are not always strongly representative of a target activity. Correctly selecting frames indicative of a particular activity is a non-trivial task [5]. Most techniques use pooling methods to aggregate all information about a video. Piergiovanni et al. [14] noted that pooling across an entire video produces classification mistakes for videos containing multiple events, and the authors proposed temporal attention filters as a potential remedy. Their approach focused attention temporally on the portion of a video that relates to specific activity. Egocentric videos are becoming increasingly pervasive (e.g., lifeloggers, police body cameras, and robotic platforms [15]). Video activity classification is generally more challenging in egocentric videos, which are recorded from a first-person perspective using a wearable device. Research in this emerging domain mostly focuses on learning after a video is acquired. However, ondevice learning may be useful for applications where online learning or near real-time learning is desirable. RNNs that use backpropagation to train (e.g., LSTM) are heavily memory bound and are compute intensive. They are likely to be unsuitable for deployment on embedded/wearable devices with strict constraints on energy and compute resources. Traditional techniques used in video activity detection represent feature descriptors using Histogram of Oriented Gradients or Histogram of Optical Flows and then combine these features using Bag of Visual Words or Fisher Vector encodings [13], [16]. Recently, neural network based video activity classification methods have been explored using 2D DCNNs or 3D DCNNs [17]. Other methods use a composite network created by combining a pre-trained or untrained DCNN with other neural network elements to extract spatio-temporal information. In these composite networks DCNN layers are combined with layers containing recurrent neural networks, usually LSTM layers [16], [18]. During exploration of composite neural networks, many authors also chose to explore replacing or combining RNN elements with more traditional pooling techniques. This is a common type of solution that uses both neural networks and traditional hand-crafted feature techniques. For instance, Ryoo et al. proposed a new technique for feature pooling over time with first person video activity detection. This technique is intended to identify general features representative of each video, based on time-series analysis of frames [13]. Ng et al. consider temporal pooling techniques such as average pooling and max pooling applied to appearance features sampled from each video frame [5] while also examining composite pre-trained DCNN and LSTM networks. Finally, Wang et al. combined handcrafted feature descriptors and DCNN appearance features to implement a pooling technique intended to improve video activity detection [19]. Most of the video activity detection techniques mentioned above employ hand-crafted features or LSTMs. Hand-crafted features must be designed for a task by a subject matter expert. LSTM training can be complex, and time consuming. Neither methods are well suited to applications where a general and efficiently trainable system is desired. III. BACKGROUND A. Transfer Learning with Deep CNNs Architectures like ResNet [1] are now commonly used as pre-trained CNN models for many image analysis tasks. There are several types of transfer learning. In most cases, CNN networks trained on the ImageNet Large Scale Visual Recognition [20] dataset are used. These source networks are useful for extracting appearance features from a given dataset, with better results than training with no pre-training. Since these source models contain stable weights learned during their original training, they offer a starting point to expedite training on a new dataset. Alternatively, pre-trained CNNs can be used to provide off-the-shelf CNN features [6] as static appearance feature extractors. Typically, a CNN source network is truncated at some layer, depending on the level of feature specificity desired. B. Reservoir Computing Among RC models, ESNs are closest to contemporary neural networks which use conventional floating point values to represent weights. The reservoir in an ESN is a recurrent network, constructed by randomly generating synaptic weights and topology. Recurrent connections in the reservoir create a fading memory of an input, which can be used to represent sequences. Weights within the reservoir stay fixed after initialization (i.e. they are not trainable). The fixed nature of reservoir weights greatly simplifies the training process, avoiding costly error propagation through time. C. Echo State Networks The ESN is the primary RC model of interest in this paper. A basic ESN operates in a very similar manner to other neural networks, with an input feature vector u(n) ∈ RNu , and an output vector y(n) ∈ RNy . The goal is to train a network to produce an output y(n) that best approximates some desired signal, ytarget (n) ∈ RNy . As with any RNN model, time must be considered, and n = 1, . . . , T represents discrete time steps over data with T sequential elements (e.g. video with 60 frames → T = 60). Activity within the reservoir is modeled with x(n) ∈ RNx , calculating some activation function at time n, and an update function x̃(n). These functions are usually a hyperbolic tangent activation function as shown in Eqns. 1, 2. x̃(n) = tanh(Win [1; u(n)] + Wx x(n − 1)) (1) x(n) = (1 − α)x(n − 1) + αx̃(n) (2) where, α ∈ (0, 1] is a leaking rate coefficient, tanh(·) is computed element-wise, and [·; ·] is vector concatenation. In an ESN, three weight matrices define connections between the input layer, reservoir layer, and output layer. The input weights Win ∈ RNx ×(1+Nu ) connect u(n) to the reservoir. Output weights Wout ∈ RNy ×(1+Nu +Nx ) connect the reservoir to the output y(n). Recurrent connections in the reservoir are represented by Wx ∈ RNx ×Nx . Some ESN variants use additional weights (e.g. weighted feedback connections), but a basic ESN can be constructed with these three matrices. Weights are all randomly initialized, but with additional constraints placed on Wx to control properties like connection sparsity, and non-zero weight distribution. Since all weights except Wout are left fixed during learning, network outputs are essentially feed-forward and linear. Learning is accomplished by simply optimizing y(n) to match ytarget (n) by iteratively adjusting Wout with traditional methods like ridge regression. When performing sequence classification, the common approach is to set Ny = k, where k is the number of classes (i.e. y(n) ∈ Rk ). In this configuration each y(n) output value y1 , . . . , yk corresponds to a single class. Finding the maximum activation for an input sequence u(n) provides the class label prediction, as shown in Eqns. 3 and 4. ! 1 X yk (n) (3) class(u(n)) = arg max |τ | n∈τ k = arg max((Σy)k ) (4) k where, yk (n) is the kth dimension of y(n) and Σy is y(n) time-averaged over τ . This value can easily be computed by multiplying Wout with x(n) activations time-averaged in a similar manner, as shown in Eqns. 5 and 6. 1 X Σy = Wout [1; u(n); x(n)] (5) |τ | n∈τ = Wout Σx (6) where, Σx is [1; u(n); x(n)] time-averaged over τ . This method computes Σy through only one multiplication with Wout . The value τ can represent an entire sequence length, or some interval within the sequence. Different τ values can also be used for variable length sequences. Two hyper-parameters provide a large contribution to the performance of an ESN: the number of neurons Nx , and the spectral radius ρ(Wx ). The Nx value tends to have the greatest performance impact, and it is generally thought that bigger reservoirs are better for challenging tasks. Spectral radius ρ(Wx ) helps determine how long an input impacts reservoir activations. A greater ρ value is usually appropriate for tasks requiring a longer memory of input values. IV. C ONVOLUTIONAL D RIFT N EURAL N ETWORK In this paper we propose a neural network architecture that requires minimal training to achieve competitive performance on spatio-temporal tasks (e.g. video classification). We demonstrate our architecture concept by designing an example network to perform video-level activity classification on egocentric videos. Our experimental networks are designed to perform this task specifically, but the concept is general enough that it should be readily adaptable for similar tasks. At a conceptual level, our proposed architecture contains: a CNN appearance feature extractor, an ESN temporal feature extractor, temporal information aggregation, and a predictor. In this initial investigation, we are primarily motivated to find task performance while minimizing training time and resources. This section describes an example network for video-level activity classification, with a focus on minimal training and hyper-parameter tuning. In the example network, CNN feature extractors are frozen to prevent training, and ESN reservoir weights are inherently fixed. This leaves the classification layer as the only place learning can occur. Essentially, we are attempting to achieve competitive performance on a difficult spatiotemporal task by training only a single neural network layer. An overview of our proposed example network is shown in Fig. 1. A. CNN Feature Extractors Features produced by a CNN trained on natural images tend to be generalizable [7], so they can often be applied to new tasks with little or no additional training. Most publicly available pre-trained CNNs are high-performing models, trained on a large natural image dataset (e.g. ImageNet). Transfer learning allows us to leverage the power of these models for video analysis when using them as feature extractors. Feature extractors were constructed using the typical transfer learning approach, where part of an existing pre-trained CNN model is used. We identify a layer in the source CNN to use as a feature extraction point. All layers beyond that point are then removed, leaving behind a feature extractor network. Feature extractors are applied to video data by considering each video as a collection of frame images. At the frame level, feature extraction abstracts raw, highdimensional visual information as a per-frame feature (v) vector, un , shown in Eq. 7. u(v) n = (u1 , u2 , . . . , um ) (7) where, n is the frame sequence position, m is the output dimension of a DCNN feature extractor, and v is a unique video identifier. At the video level, features are represented as the set of (v) all un frame feature vectors used for prediction, U(v) , shown in Eq. 8. (v) U(v) = {u1 , . . . , u(v) τ } (8) where τ is the number of frames evaluated in video v. B. ESN, Temporal Averaging, & Prediction Temporal features are extracted with an ESN that has been slightly modified from the base model to simplify computation. Since our experimental tasks require classification, temporal information is aggregated using a simple feature-wise temporal averaging of reservoir activations over all frames in a video. Finally, classification is performed on the fused representation using a single SoftMax classifier layer which predicts video activity labels. Our ESN implementation differs from the basic model described in Sec. III-C in a few key areas. During preliminary testing, we found that a rectified linear unit (ReLu) activation for reservoir neurons actually outperformed the hyperbolic tangent. ReLu activations are also very simple to calculate. This motivated us to use ReLu neurons in the reservoir, a non-traditional approach for ESNs. ReLu activation also greatly simplifies our ESN activation and update functions, as shown in Eqn. 9 and Eqn. 10. ESN response x(n) is computed for each frame in a video sample. ( 0 Win [1; u(n)] + Wx x(n − 1) ( 0 , x(n) = (1 − α)x(n − 1) + αx̃(n) , x̃(n) = , n<0 (9) , n≥0 n<0 n≥0 (10) There are several potential methods for collecting and interpreting reservoir neuron responses [8]. Response aggregation techniques using concatenation or pooling are common choices to fuse temporal information for prediction. Given the classification task in our experiments, we use the simple time-averaging technique shown in Eqn. 6, to compute Σy. Time-averaged reservoir responses for each video sample are classified by a single SoftMax classification layer. This layer is trained using standard neural network optimization methods to adjust ESN output weights Wout , Fig. 1. High level overview of the CDN architecture. Each frame n = 1, . . . , τ from video v are passed through the CNN feature extractor to (v) (v) (v) produce u(n) = un . All ESN responses U(v) are collected (i.e. U(v) = {u1 , . . . , uτ } = x(n) for n = 1, . . . , τ ). Temporal averaging (v) is performed on U . Finally the averaged responses are passed into the SoftMax layer for video activity class prediction y(v). minimizing the categorical cross-entropy loss between y(n) and ytarget (n). V. E XPERIMENTS A. Datasets Experiments were performed with two first-person video datasets: the DogCentric activity dataset [21] and the UECPark dataset [22]. Both datasets were recorded using wearable cameras. DogCentric contains 208 videos recorded by cameras attached to the backs of dogs while they performed 10 different classes of activity (e.g. playing with a ball, sniffing an object). Fig. 2 provides an example of frames extracted from DogCentric. The motion displayed throughout the video is often erratic and unpredictable, and therefore it made for a difficult video activity challenge. Videos in DogCentric do not have a fixed length. While an ESN with time-averaged outputs can be used to process variable sequence length data, we instead chose use a fixed sequence length of 160 frames for simplicity. Shorter videos received zero padding, and longer videos were truncated to provide a consistent 160 frames. This sequence length was determined by a simple inspection of DogCentric to find the mean frame count and distribution, then choosing a value that was likely to capture features for the majority of videos. UECPark is a dataset sourced from a single 25 minute long first-person video. It is recorded by a head- Fig. 2. Example Frames and Activity Classes from the Dogcentric Dataset. Figure and dataset by Iwashita et al. [21]. mounted camera worn by a human subject performing sports-related activities in a park (e.g. jogging, twisting, resting). The UEC-Park video was separated into 2 second segments, producing 766 unique equal length video sequences. There are 29 total activity classes, with segments labeled by the most dominant activity present. Since UEC-Park has fixed-length segments, no sequence padding or truncation was used. B. CNN Feature Extractor Implementation We considered two CNN models as feature extractor networks in this study, VGG-16 and ResNet-50. The VGG-16 feature extractor was created by truncating the source network after the first fully connected layer in the final block. Truncation of the ResNet-50 network was applied after the final average pooling layer. The size of feature vectors produced by each are 4096 and 2048, respectively. The ResNet-50 extractor output for each frame is multi-dimensional, so it is flattened to produce one-dimensional feature vector. C. ESN Implementation ReLu reservoir activations simplify ESN computation along with hyper-parameter tweaking to further reduce complexity. The leakage term in the reservoir is not applied (i.e. α = 1). Without leakage, activation and update equations are equivalent(i.e. x̃(n) ≡ x(n)). We also do not scale the spectral radius ρ, allowing it to remain at the initialization value equal to the maximal absolute eigenvalue of Wx . In practice, both of these parameters are usually tuned for performance, but in this initial baseline exploration we chose to keep the values fixed for simplicity. Fig. 3. Mean test accuracy on the DogCentric dataset. Networks trained over 1600 epochs with 600, 1200, and 2400 reservoir neurons (ReLu activations). Performance averaged over 100 random data split replications. D. Classification Activities in each dataset were classified using the SoftMax layer with a number of neurons equal to the number of classes present (i.e. Ny = k). In the DogCentric dataset, this made Ny = 10, and in UECPark Ny = 29. Training was executed using Adam optimization [23], as we found it converged in far fewer epochs than gradient descent during preliminary testing. E. Experimental Setup & Evaluation Experiments were performed using half of the videos per activity class placed in the training set, and half in the testing set. On uneven splits, the extra video was placed in the testing set. Random training/testing splits were repeated 100 times with a stratified random shuffle. In each experiment several network configurations are selected, and trained over 1600 epochs for all train/test splits. Performance was evaluated by averaging test set classification accuracy results for a given network configuration over all data splits. Fig. 4. Mean test accuracy on the DogCentric dataset. Networks trained over 1600 epochs with 600, 1200, and 2400 reservoir neurons (ReLu activations). Performance averaged over 100 random data split replications. Y-axis zoomed for readability. neurons achieved the best overall accuracy numerically at 77.2%, but all results were close enough to be considered approximately equivalent. F. Experiments on DogCentric G. Experiments on UEC-Park Six different network configurations were evaluated on the DogCentric dataset by testing both the VGG16 and ResNet-50 feature extractors, and varying the number of reservoir neurons at 600, 1200, and 2400. Fig. 3 shows a summary comparison of performance, with details provided in Tbl. I. We observed that the feature extractor network model consistently shows an impact on performance, with the ResNet-50 feature extractor outperforming VGG-16 in every test. Reservoir neuron count showed less of an impact on achieving the best accuracy. Testing with different reservoir sizes produced consistently similar scores when using the same feature extractor. However, networks with more reservoir neurons did tend to attain this level of accuracy in fewer training epochs, as shown in Fig. 4. The ResNet-50 configuration with 600 reservoir Three different network configurations were evaluated on the UEC-Park dataset. ResNet-50 was shown to be a superior feature extractor across all configurations in both preliminary testing and the DogCentric experiments, so it was used on UEC-Park. Networks with 600, 1200, TABLE I E XPERIMENT RESULTS ON THE D OG C ENTRIC DATASET. Best Mean Test Accuracy: DogCentric Reservoir Neurons 600 1200 2400 ResNet-50 VGG-16 77.2 % 76.9 % 77.1 % 75.1 % 75.4 % 75.8 % DogCentric Experiment: 100 train/test splits, 1600 epochs TABLE III C OMPARISON OF STATE - OF - THE - ART ACCURACY RESULTS ON THE D OG C ENTRIC DATASET. 10 ACTIVITIES , CLASSIFICATION ACCURACY OVER 100 DATA SPLITS . Approach HCF Fig. 5. Mean test accuracy on the UEC-Park dataset. Networks trained over 1600 epochs with 600, 1200, and 2400 reservoir neurons (ReLU activations). Accuracy averaged over 100 random data split replications. No HCF Accuracy HOG+HOF+LBP+Cub.+Opt.Fl. [21] ITF [14], [24] ITF+CNN [14], [25] POT [13] POT+ITF [13] TDD [14], [26] TDD+Temp. Fil. [14] TDD+Temp. Fil.+LSTM [14] VGG+Max Pooling [14] VGG+Mean Pooling [14] VGG+Sum Pooling [14] VGG+Temp. Fil.-Learned [14] VGG+Temp. Fil.-Learned+LSTM [14] CDN (VGG-16) CDN (ResNet-50) 60.5% 67.7% 69.2% 73.0% 74.5% 76.6% 79.6% 81.4% ≈ 57.2% 59.9% 59.9% ≈ 65.0% ≈ 65.0% 75.8 % 77.2 % (Bold: Our approach) (≈: est. from graph) Fig. 6. Mean test accuracy on the UEC-Park dataset. Networks trained over 1600 epochs with 600, 1200, and 2400 reservoir neurons (ReLU activations). Accuracy averaged over 100 random data split replications. Y-axis zoomed for readability. and 2400 reservoir neurons were tested. Fig. 5 shows a summary comparison of performance, with details provided in Tbl. II. As in the DogCentric experiments, configurations with different reservoir neuron counts produced very similar performance results. In Fig. 6, the mean accuracy plot demonstrates that again, more neurons seem to contribute to quicker convergence toward the best accuracy value observed. H. Comparison to State-of-the-Art We compare our activity classification results with others from literature. Our interest was to develop an end- TABLE II E XPERIMENT RESULTS ON THE UEC-PARK DATASET. Best Mean Test Accuracy: UEC-Park Reservoir Neurons 600 1200 2400 ResNet-50 78.5 % 78.6 % 78.7 % UEC-Park Experiment: 100 train/test splits, 1600 epochs to-end trainable neural network for video level classification, which precluded the use of hand-crafted features (HCF). In the literature for egocentric video, this type of network is fairly uncommon (i.e. HCFs are usually used), and few examples suitable for direct comparison were available. Instead, we provide all results found on the two datasets, separately labeling methods that use HCF, and those that don’t. 1) DogCentric Comparison: Tbl. III provides comparative results on the DogCentric dataset. The two best performance results in literature were both obtained using HCFs, and both with a TDD + Temporal Filters approach [14]. The top performer used an LSTM attention mechanism to achieve 81.4%. The other model does not use LSTM attention, achieving 79.6% accuracy. Our best result of 77.2% with a ResNet-50 CDN did not exceed these two results, but it did perform better than all other HCF-based methods. Among non-HCF methods, our ResNet-50 CDN model did achieve the best performance of 77.2%. Other models in this category were developed by Piergiovanni et al., and they all use a VGG feature extractor along with various pooling or temporal filtering techniques. One of these models offers the most direct comparison to our approach, since it is somewhat similar (i.e. it uses a CNN and an RNN). That model contains a VGG feature extractor, learned temporal filters, LSTM attention mechanism, and a SoftMax classifier. In a direct comparison of VGG-based methods, our VGG-16 CDN achieved an accuracy score ≈ 10.8% higher. Given the model similarities for non-temporal elements, this result provides some insight into the relative contribution of an ESN for the video-level activity classification task. TABLE IV C OMPARISON OF STATE - OF - THE - ART ACCURACY RESULTS ON THE UEC-PARK DATASET. 29 ACTIVITIES , CLASSIFICATION ACCURACY OVER 100 DATA SPLITS . Approach HCF No HCF Accuracy STIP+IFV [13], [27] Cubiod+IFV [13], [28] ITF+CNN [25] IFV+Pooling [13] BoW+Pooling [13] Inria ITF+IFV [13], [29] POT [13] POT+ITF [13] 69.1% 72.3% 75.7% 76.4% 76.5% 76.6% 79.4% 79.5% CDN (ResNet-50) 78.7% (Bold: Our approach) 2) UEC-Park Dataset Comparison: In literature, all results found on the UEC-Park dataset were produced using HCFs, so non-HCF methods were not available for direct comparison. As shown in Tbl. IV, our ResNet-50 CDN model obtained a 78.7% accuracy. Our approach performed slightly worse than the two HCF methods using POT [13], with a difference of 0.8%. VI. C ONCLUSIONS We introduced a new method for combining CNNs and ESNs into a neural network architecture capable of performing complex spatio-temporal tasks with very little training or tuning. Our method was demonstrated to effectively process frame-level CNN features into video-level predictions on two different egocentric video datasets, producing accuracy results comparable to all state-of-the art approaches. Unlike most previous work on this video analysis task, we use no hand-crafted features, and our architecture is trainable end-to-end when desired. This result motivates us to explore this architecture further in future work by building on our baseline model. R EFERENCES [1] K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” CVPR, 2016. [2] Y. Xia, D. He, T. Qin, L. Wang, N. Yu, T.-Y. Liu, and W.-Y. Ma, “Dual Learning for Machine Translation,” NIPS, 2016. [3] D. Amodei, R. Anubhai, E. Battenberg, C. Carl, J. Casper, B. Catanzaro, J. Chen, M. Chrzanowski, A. Coates, G. Diamos, E. Elsen, J. Engel, L. Fan, C. Fougner, T. Han, A. Hannun, B. Jun, P. LeGresley, L. Lin, S. Narang, A. Ng, S. Ozair, R. Prenger, J. Raiman, S. Satheesh, D. Seetapun, S. Sengupta, Y. Wang, Z. Wang, C. Wang, B. Xiao, D. Yogatama, J. Zhan, and Z. Zhu, “Deep-speech 2: End-to-end speech recognition in English and Mandarin,” Jmlr W&Cp, vol. 48, p. 28, 2015. [4] I. Lenz, H. Lee, and A. Saxena, “Deep learning for detecting robotic grasps,” Int. J. Rob. Res., vol. 34, no. 4-5, pp. 705–724, 2015. [5] J. Y. H. Ng, M. Hausknecht, S. Vijayanarasimhan, O. Vinyals, R. Monga, and G. Toderici, “Beyond short snippets: Deep networks for video classification,” in CVPR, 2015, pp. 4694–4702. [6] A. S. Razavian, H. Azizpour, J. Sullivan, and S. Carlsson, “CNN features off-the-shelf: An astounding baseline for recognition,” CVPR, pp. 512–519, 2014. [7] J. Yosinski, J. Clune, Y. Bengio, and H. Lipson, “How transferable are features in deep neural networks?” NIPS, 2014. [8] M. Lukoševičius, “A practical guide to applying echo state networks,” Neural Networks: Tricks of the Trade, Reloaded, pp. 659–686, 2012. [9] D. Verstraeten, B. Schrauwen, and D. Stroobandt, “Reservoirbased techniques for speech recognition,” Neural Networks, pp. 1050–1053, 2006. [10] D. Kudithipudi, Q. Saleh, C. Merkel, J. Thesing, and B. Wysocki, “Design and Analysis of a Neuromemristive Reservoir Computing Architecture for Biosignal Processing.” Front. Neurosci., vol. 9, no. February, p. 502, 2015. [11] W. Maass, “Liquid State Machines: Motivation, Theory, and Applications,” Comput. Context Comput. Log. Real World, pp. 275–296, 2010. [12] H. Jaeger and H. Haas, “Harnessing nonlinearity: Predicting chaotic systems and saving energy in wireless communication,” Science, vol. 304, no. 78, pp. 78–80, 2004. [13] M. S. Ryoo, B. Rothrock, and L. Matthies, “Pooled motion features for first-person videos,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 896–904. [14] A. Piergiovanni, C. Fan, and M. S. Ryoo, “Temporal attention filters for human activity recognition in videos,” ArxiV, 2016. [Online]. Available: http://arxiv.org/abs/1605.08140 [15] A. G. del Molino, C. Tan, J.-H. Lim, and A.-H. Tan, “Summarization of egocentric videos: A comprehensive survey,” IEEE Transactions on Human-Machine Systems, vol. 47, no. 1, pp. 65– 76, 2017. [16] S. Herath, M. Harandi, and F. Porikli, “Going Deeper into Action Recognition: A Survey,” no. 2008, pp. 1–34, 2016. [17] D. Tran, L. Bourdev, R. Fergus, L. Torresani, and M. Paluri, “Learning spatiotemporal features with 3D convolutional networks,” in CVPR, vol. 11-18-Dece, 2016, pp. 4489–4497. [18] M. Baccouche, F. Mamalet, and C. Wolf, “Sequential deep learning for human action recognition,” Proc. Int. Conf. Hum. Behav. Underst., pp. 29–39, 2011. [19] L. Wang, Y. Qiao, and X. Tang, “Action recognition with trajectory-pooled deep-convolutional descriptors,” in CVPR, vol. 07-12-June, 2015, pp. 4305–4314. [20] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei, “ImageNet Large Scale Visual Recognition Challenge,” IJCV, vol. 115, no. 3, pp. 211–252, 2015. [21] Y. Iwashita, A. Takamine, R. Kurazume, and M. S. Ryoo, “Firstperson animal activity recognition from egocentric videos,” ICPR, no. i, pp. 4310–4315, 2014. [22] K. M. Kitani, T. Okabe, Y. Sato, and A. Sugimoto, “Fast unsupervised ego-action learning for first-person sports videos,” CVPR, pp. 3241–3248, 2011. [23] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014. [24] H. Wang and C. Schmid, “Action recognition with improved trajectories,” in ICCV, 2013, pp. 3551–3558. [25] M. Jain, J. van Gemert, C. G. Snoek et al., “University of amsterdam at thumos challenge 2014,” ECCV THUMOS Challenge, vol. 2014, 2014. [26] L. Wang, Y. Qiao, and X. Tang, “Action recognition with trajectory-pooled deep-convolutional descriptors,” in CVPR, 2015, pp. 4305–4314. [27] I. Laptev, “On space-time interest points,” IJCV, vol. 64, no. 2-3, pp. 107–123, 2005. [28] P. Dollár, V. Rabaud, G. Cottrell, and S. Belongie, “Behavior recognition via sparse spatio-temporal features,” in Visual Surveillance and Performance Evaluation of Tracking and Surveillance, 2005. 2nd Joint IEEE International Workshop on. IEEE, 2005, pp. 65–72. [29] H. Wang and C. Schmid, “Action recognition with improved trajectories,” in ICCV, 2013, pp. 3551–3558.
9cs.NE
Reify Your Collection Queries for Modularity and Speed! arXiv:1210.6284v1 [cs.PL] 23 Oct 2012 Extended Version Paolo G. Giarrusso Klaus Ostermann Michael Eichberg Philipps University Marburg Philipps University Marburg Software Technology Group, Technische Universität Darmstadt Ralf Mitschke Tillmann Rendel Christian Kästner Software Technology Group, Technische Universität Darmstadt Philipps University Marburg Carnegie Mellon University ABSTRACT Modularity and efficiency are often contradicting requirements, such that programers have to trade one for the other. We analyze this dilemma in the context of programs operating on collections. Performance-critical code using collections need often to be hand-optimized, leading to nonmodular, brittle, and redundant code. In principle, this dilemma could be avoided by automatic collection-specific optimizations, such as fusion of collection traversals, usage of indexing, or reordering of filters. Unfortunately, it is not obvious how to encode such optimizations in terms of ordinary collection APIs, because the program operating on the collections is not reified and hence cannot be analyzed. We propose SQuOpt, the Scala Query Optimizer—a deep embedding of the Scala collections API that allows such analyses and optimizations to be defined and executed within Scala, without relying on external tools or compiler extensions. SQuOpt provides the same “look and feel” (syntax and static typing guarantees) as the standard collections API. We evaluate SQuOpt by re-implementing several code analyses of the Findbugs tool using SQuOpt, show average speedups of 12x with a maximum of 12800x and hence demonstrate that SQuOpt can reconcile modularity and efficiency in real-world applications. Keywords Deep embedding, query languages, optimization, modularity 1. INTRODUCTION In-memory collections of data often need efficient processing. For on-disk data, efficient processing is already pro- This is the author’s version of our paper submission, with the addition of two appendixes at the end (with their references) but otherwise essentially unchanged. vided by database management systems (DBMS), thanks to their query optimizers which support many optimizations specific to the domain of collections; moving in-memory data to DBMSs however does not typically improve performance [39], and query optimizers cannot be reused separately since DBMS are typically monolithic with deeply integrated optimizers. A few collection-specific optimizations, such as shortcut fusion [12] are supported by compilers for purely functional languages such as Haskell, but the implementation techniques do not generalize to many other optimizations such as support for indexes. In general, collection-specific optimizations are not supported by the general-purpose optimizers used by typical (JIT) compilers. Therefore, when collection-related optimizations are needed, programmers perform them by hand. Some optimizations are not hard to apply manually, but in many cases become applicable only after manual inlining [32]. But manual inlining modifies source code by combining distinct functions together, while often distinct functions should remain distinct because they deal with different concerns, or because one of the them is reused in other contexts. In both cases, manual inlining reduces modularity. For these reasons, currently developers need to choose between modularity and performance, as also highlighted by Kiczales et al. [21]. Instead, we envision that they should rely on an automatic optimizer performing inlining and collection-specific optimizations. Then they would achieve both performance and modularity. One way to implement such an optimizer would be to extend the compiler of the language with a collection-specific optimizer, or to add some kind of external preprocessor to the language. However, such solutions would be rather brittle (for instance, they lack composability with other language extensions) and they would preclude optimization opportunities that arise only at runtime. For this reason, our approach is implemented as an embedded domain-specific language, that is, as a regular library. We call this library SQuOpt, the Scala QUery OPTimizer. SQuOpt consists of a domain-specific language (DSL) for queries on collections based on the Scala collections API. This DSL is implemented as an embedded DSL (EDSL) for Scala. An expression in this EDSL produces at run time an expression tree in the host language: a data structure which represents the query to execute, similar to an abstract syntax tree (AST). Thanks to the extensibility of Scala, expressions in this language look almost identical to expressions with the same meaning in Scala. Again at run time, SQuOpt optimizes and compiles these expression trees for more efficient execution. Doing optimization at run time, instead of compile-time, obviates the need for control-flow analyses to determine which code will be actually executed [3], as we will see later. We have choosen Scala [30] to implement our library for two reasons: i) Scala is a good meta-language for embedded DSLs, because it is syntactically flexible and has a powerful type system, and ii) Scala has a sophisticated collections library with an attractive syntax (for-comprehensions) to specify queries. To evaluate SQuOpt, we study queries of the Findbugs tool [20]. We rewrote a set of queries to use the Scala collections API and show that modularization incurs significant performance overhead. Subsequently, we consider versions of the same queries using SQuOpt. We demonstrate that the automatic optimization can reconcile modularity and performance in many cases. Adding advanced optimizations such as indexing can even improve the performance of the analyses beyond the original non-modular analyses. Overall, our main contributions are the following: • We illustrate the tradeoff between modularity and performance when manipulating collections, caused by the lack of domain-specific optimizations (Sec. 2). Conversely, we illustrate how domain-specific optimizations lead to more readable and more modular code (Sec. 3). • We present the design and implementation of SQuOpt, an embedded DSL for queries on collections in Scala (Sec. 4). • We evaluate SQuOpt to show that it supports writing queries that are at the same time modular and fast. We do so by re-implementing several code analyses of the Findbugs tool. The resulting code is more modular and/or more efficient, in some cases by orders of magnitude. In these case studies, we measured average speedups of 12x with a maximum of 12800x (Sec. 5). 2. MOTIVATION In this section, we show how the absense of collectionspecific optimizations forces programmers to trade modularity against performance, which motivates our design of SQuOpt to resolve this conflict. As our running example through the paper, we consider representing and querying a simple in-memory bibliography. A book has, in our schema, a title, a publisher and a list of authors. Each author, in turn, has a first and last name. We represent authors and books as instances of the Scala classes Author and Book shown in Fig. 1. The class declarations list the type of each field: Titles, publishers, and first and last names are all stored in fields of type String. The list of authors is stored in a field of type Seq[Author], that is, a sequence of authors. The code fragment also defines a collection of books named books. As a common idiom to query such collections, Scala provides for-comprehensions. For instance, the forcomprehension in Fig. 2 finds all books published by Pearson package schema case class Author(firstName: String, lastName: String) case class Book(title: String, publisher: String, authors: Seq[Author]) val books: Set[Book] = Set( new Book("Compilers: Principles, Techniques and Tools", "Pearson Education", Seq(new Author("Alfred V.", "Aho"), new Author("Monica S.", "Lam"), new Author("Ravi", "Sethi"), new Author("Jeffrey D.", "Ullman")) /* other books ... */) Figure 1: Definition of the schema and of some content. case class BookData(title: String, authorName: String, coauthors: Int) val records = for { book ← books if book.publisher == "Pearson Education" author ← book.authors } yield new BookData(book.title, author.firstName + " " + author.lastName, book.authors.size - 1) Figure 2: Fig. 1. Our example query on the schema in Education and yields, for each of those books, and for each of its authors, a record containing the book title, the full name of that author and the number of additional coauthors. The statement book ← books functions like a loop header: The remainder of the for-comprehension is executed once per book in the collection. Consequently, the statement author ← book.authors starts a nested loop. The return value of the for-comprehension is a collection of all yielded records. Note that if a book has multiple authors, this forcomprehensions will return multiple records relative to this book, one for each author. We can further process this collection with another forcomprehension, possibly in a different module. For example, the function in Fig. 3 filters book titles containing the word ”Principles”, and drops the number of coauthors from the result. In Scala, the implementation of for-comprehensions is not fixed. Instead, the compiler desugares a for-comprehension to a series of API calls, and different collection classes can implement this API differently. Later, we will use this flexibility to provide an optimizing implementation of forcomprehensions, but in this section, we focus on the behavior of the standard Scala collections, which implement for-comprehensions as loops that create intermediate collections. 2.1 Optimizing by hand The naive implementation in Fig. 2 and Fig. 3 is modular but inefficient: 1. To execute this code, we first build the original collection and only later we perform further processing to def titleFilter(records: Set[BookData], keyword: String) = for { record ← records if record.title.contains(keyword) } yield (record.title, record.authorName) val res = titleFilter(records, "Principles") Figure 3: Another query, which processes the results of the query in Fig. 2. build the new result; creating the intermediate collection is costly. 2. The same book can appear in records more than once if the book has more than one author, but all of these duplicates have the same title. Nevertheless, we test each duplicate title separately whether it contains the searched keyword. If books have 4 authors on average, this means a slowdown of a factor of 4 for the filtering step. The existing Scala collections API offers some generic concepts for optimization, such as non-strict variants of the query operators (called ‘views’ in Scala), but they can only be used for a limited set of optimizations, as we discuss in the section on related work. In general, one can only resolve these inefficiencies by manually optimizing the query; however, we will observe that the resulting code is less modular. To address the first problem above, we can manually inline titleFilter and records; we obtain two nested forcomprehensions. Furthermore, we can unnest the inner one [7]. To address the second problem above, we hoist the filtering step, that is, we change the order of the processing steps in the query to first look for keyword within book.title and then iterate over the set of authors. This does not change the overall semantics of the query because the filter only accesses the title but does not depend on the author. In the end, we obtain the code in Fig. 4. The resulting query processes the title of each book only once. Since filtering in Scala is done lazily, the resulting query avoids building an intermediate collection. This second optimization is only possible after inlining and thereby reducing the modularity of the code, because it mixes together processing steps from titleFilter and from the definition of records. To make titleFilterHandOpt more reusable, we could turn the publisher name into a parameter. However, the new versions of titleFilter cannot be reused as-is if some details of the inlined code change; for instance, we might need to filter publishers differently or not at all. On the other hand, if we express queries modularly, we might lose some opportunities for optimization. The design of the Scala collections API forces us to manually optimize our code by repeated inlining and subsequent application of query optimization rules, which leads to a loss of modularity. 3. AUTOMATIC OPTIMIZATION WITH SQUOPT The goal of SQuOpt is to let programmers write queries modularly and on a high-level of abstraction and deal with def titleFilterHandOpt(books: Set[Book], publisher: String, keyword: String) = for { book ← books if book.publisher == publisher && book.title.contains(keyword) author ← book.authors } yield (book.title, author.firstName + " " + author.lastName) val res = titleFilterHandOpt(books, "Pearson Education", "Principles") Figure 4: Composition of queries in Fig. 2 and Fig. 3, after inlining, query unnesting and hoisting. import squopt._ import schema.squopt._ val recordsQuery = for { book ← books.asSquopt if book.publisher ==# "Pearson Education" author ← book.authors } yield new BookData(book.title, author.firstName + " " + author.lastName, book.authors.size - 1) // ... val records = recordsQuery.eval Figure 5: SQuOpt version of Fig. 2; recordQuery contains a reification of the query, records its result. optimization by a dedicated domain-specific optimizer. In our concrete example, programmers should be able to write queries similar to Fig. 2 and Fig. 3, but get the efficiency of Fig. 4. SQuOpt achieves this by overloading the implementation of for-comprehensions as well as the implementation of operations such as string concatenation with + and field access book.author in order to reify the query as an expression tree, optimize this expression tree, and then execute the optimized query. Programmers explicitly trigger SQuOpt by adapting their queries. 3.1 Adapting a Query With SQuOpt, the first part of the running example becomes what is shown in Fig. 5. To use SQuOpt instead of native Scala queries, we first assume that the query is already purely functional. We argue that purely functional queries are more declarative. A main reason for using side effects is to improve performance, but SQuOpt voids this reason by automatically removing performance overhead by optimization. At the same time, the lack of side effects makes more optimizations possible. Once the query is purely functional, a programmer needs to (a) import the SQuOpt library, (b) import some wrapper code specific to the types the collection operates on, in this case Book and Author (more about that later), (c) convert explicitly the native Scala collections involved to collections of our framework by a call to asSquopt, (d) rename a few operators such as == to ==# (this is necessary due to some Scala limitations), and (e) add a separate step where the query is evaluated (possibly after optimization). All these changes are lightweight and mostly of a syntactic nature. def titleFilterQuery(records: Exp[Set[BookData]], keyword: Exp[String]) = for { record ← records if record.title.contains(keyword) } yield (record.title, record.authorName) val resQuery = titleFilterQuery(recordsQuery, "Principles") val res = resQuery.optimize.eval Figure 6: SQuOpt version of Fig. 3 Fig. 6 shows how the second part of our running example can be adapted to SQuOpt. The type annotations in the function reveal some details of our implementation: Expressions that are reified have type Exp[T] instead of T. As the code shows, resQuery is optimized before compilation. This call will perform the optimizations we did by hand and will return a query equivalent to Fig. 4, after verifying their safety conditions. For instance, after inlining the filter if book.title.contains(keyword) does not reference author, hence it is safe to hoist it. Note that checking this safety condition would not be possible without a reification of the predicate. For instance, it would not be sufficient to only reify the calls to the collection API, because the predicate is represented as a boolean function parameter. In general, our automatic optimizer inspects the whole reification of the query implementation to check that optimizations do not introduce changes in the overall result of the query and are therefore safe. 3.2 Indexing SQuOpt also supports the transparent usage of indexes. Indexes can further improve the efficiency of queries, sometimes by orders of magnitude. In our running example, the query scans all books to look for the ones having the right publisher. To speed up this query, we can preprocess books to build an index, that is, a dictionary mapping, from each publisher to a collection of all the books it published. This index can then be used to answer the original query directly without scanning all the books again. We construct a query representing the desired dictionary, and inform the optimizer that it should use this index where appropriate: val idxByPublisher = books.asSquopt.indexBy(_.publisher) Optimization.addIndex(idxByPublisher) The indexBy collection method accepts a function which maps a collection element to a key; coll.indexBy(key) returns a dictionary mapping each key to the collection of all elements of coll having that key. Missing keys are mapped to an empty collection.1 Optimization.addIndex simply pre-evaluates the index and updates a dictionary mapping the index to its pre-evaluated result. A call to optimize on a query will then take this index into account and rewrite the query to perform index lookup instead of scanning, if possible. For instance, the code in Fig. 5 would be rewritten by the optimizer to an output similar to the following query: val indexedQuery = 1 For readers familiar with the Scala collection API, we remark that the only difference with the standard groupBy method is the handling of missing keys. for { book ← idxByPublisher("Pearson Education") author ← book.authors } yield new BookData(book.title, author.firstName + " " + author.lastName, book.authors.size - 1) Since dictionaries in Scala are functions, in the above code, dictionary lookup on idxByPublisher is represented simply as function application. The above code iterates over books having the desired publisher, instead of scanning the whole library, and performs the remaining computational steps from the original query. Although the index usage in the listing above is notated as idxByPublisher("Pearson Education"), only the cached result of evaluating the index is used when the query is executed, not the reified index definition. This optimization could also be performed manually, of course, but the queries are on a higher abstraction level and more maintainable if indexing is defined separately and applied automatically. Manual application of indexing is a cross-cutting concern because adding or removing an index affects potentially many queries. SQuOpt does not free the developer from the task of assessing which index will ‘pay off’ (we have not considered automatic index creation), but at least it becomes simple to add or remove an index, since the application of the indexes is modularized in the optimizer. 4. IMPLEMENTATION After describing how to use SQuOpt we explain how SQuOpt represents queries internally and optimizes them. Here we give only a brief overview of our implementation technique; it is described in more detail in Appendix B. 4.1 Expression Trees In order to analyze and optimize collection queries at runtime, SQuOpt reifies their syntactic structure as expression trees. The expression tree reflects the syntax of the query after desugaring, that is, after for-comprehensions have been replaced by API calls. For instance, recordsQuery from Fig. 5 points to the following expression tree (with some boilerplate omitted for clarity): new FlatMap( new Filter( new Const(books), v2 ⇒ new Eq(new Book_publisher(v2), new Const("Pearson Education"))), v3 ⇒ new MapNode( new Book_authors(v3), v4 ⇒ new BookData( new Book_title(v3), new StringConcat( new StringConcat( new Author_firstName(v4), new Const(" ")), new Author_lastName(v4)), new Plus(new Size(new Book_authors(v3)), new Negate(new Const(1)))))) The structure of the for-comprehension is encoded with the FlatMap, Filter and MapNode instances. These classes correspond to the API methods that for-comprehensions get desugared to. SQuOpt arranges for the implementation of flatMap to construct a FlatMap instance, etc. The instances of the other classes encode the rest of the structure of the collection query, that is, which methods are called on which arguments. On the one hand, SQuOpt defines classes such as Const or Eq that are generic and applicable to all queries. On the other hand, classes such as Book_publisher cannot be predefined, because they are specific to the user-defined types used in a query. SQuOpt provides a small code generator, which creates a case class for each method and field of a user-defined type. Functions in the query are represented by functions that create expression trees; representing functions in this way is frequently called higher-order abstract syntax [34]. We can see that the reification of this code corresponds closely to an abstract syntax tree for the code which is executed; however, many calls to specific methods, like map, are represented by special nodes, like MapNode, rather than as method calls. For the optimizer it becomes easier to match and transform those nodes than with a generic abstract syntax tree. Nodes for collection operations are carefully defined by hand to provide them highly generic type signatures and make them reusable for all collection types. In Scala, collection operations are highly polymorphic; for instance, map has a single implementation working on all collection types, like List, Set, and we similarly want to represent all usages of map through instances of a single node type, namely MapNode. Having separate nodes ListMapNode, SetMapNode and so on would be inconvenient, for instance when writing the optimizer. However, map on a List[Int] will produce another List, while on a Set it will produce another Set, and so on for each specific collection type (in first approximation); moreover, this is guaranteed statically by the type of map. Yet, thanks to advanced typesystem features, map is defined only once avoiding redundancy, but has a type polymorphic enough to guarantee statically that the correct return value is produced. Since our tree representation is strongly typed, we need to have a similar level of polymorphism in MapNode. We achieved this by extending the techniques described by Odersky and Moors [29], but cannot provide details in this context. We get these expression trees by using Scala implicit conversions in a particular style, which we adopted from Rompf and Odersky [36]. Implicit conversions allow to add, for each method A.foo(B), an overload of Exp[A].foo(Exp[B]). Where a value of type Exp[T] is expected, a value of type T can be used thanks to other implicit conversions, which wrap it in a Const node. The initial call of asSquopt triggers the application of the implicit conversions by converting the collection to the leaf of an expression tree. It is also possible to call methods that do not return expression trees; however, such method calls would then only be represented by an opaque MethodCall node in the expression tree, which means that the code of the method cannot be considered in optimizations. Crucially, these expression trees are generated at runtime. For instance, the first Const contains a reference to the actual collection of books to which books refers. If a query uses another query, such as records in Fig. 6, then the subquery is effectively inlined. The same holds for method calls inside queries: If these methods return an expression tree (such as the titleFilterQuery method in Fig. 6), then these expression trees are inlined into the composite query. Since the reification happens at runtime, it is not necessary to predict the targets of dynamically bound method calls: A new (and possibly different) expression tree is created each time a block of code containing queries is executed. Hence, we can say that expression trees represent the com- putation which is going to be executed after inlining; control flow or virtual calls in the original code typically disappear— especially if they manipulate the query as a whole. This is typical of deeply embedded DSLs, where code instead of performing computations produces a representation of the computation to perform [5, 3]. This inlining can duplicate computations; for instance, after executing this code: val num: Exp[Int] = 10 val square = num * num val sum = square + square evaluating sum will evaluate square twice. For this reason Elliott et al. [5] recommend to implement commonsubexpression elimination, as we do. 4.2 Optimizations Our optimizer currently supports several algebraic optimizations. Any query and in fact every reified expression can be optimized by calling the optimize function on it. The ability to optimize reified expressions that are not queries is useful; for instance, optimizing a function that produces a query is similar to a “prepared statement” in relational databases. The optimizations we implemented are mostly standard in compilers [26] or databases: • Query unnesting merges a nested query into the containing one [7, 16], replacing for instance for {val1 ← (for {val2 ← coll} yield f(val2))} yield g(val1) with for {val2 ← coll; val1 = f(val1)} yield g(val1) • Bulk operation fusion fuses higher-order operators on collections. • Filter hoisting tries to apply filters as early as possible; in database query optimization, it is known as selection pushdown . For filter hoisting, it is important that the full query is reified, because otherwise the dependencies of the filter condition cannot be determined. • We reduce during optimization tuple/case class accesses: For instance, (a, b)._1 is simplified to a. This is important because the produced expression does not depend on b; removing this false dependency can allow, for instance, a filter containing this expression to be hoisted to a context where b is not bound. • Indexing tries to apply one or more of the available indexes to speed up the query. • Constant subexpression elimination (CSE) avoids that the same computation is performed multiple times; we use techniques similar to Rompf and Odersky [36]. • Smaller optimizations include constant folding, reassociation of associative operators and removal of identity maps (coll.map(x ⇒ x), typically generated by the translation of for-comprehensions). Each optimization is applied recursively bottom-up until it does not trigger anymore; different optimizations are composed in a fixed pipeline. Optimizations are only guaranteed to be semanticspreserving if queries obey the restrictions we mentioned: for instance, queries should not involve side-effects such as assignments or I/O, and all collections used in queries should implement the specifications stated in the collections API. Obviously the choice of optimizations involves many tradeoffs; for that reason we believe that it is all the more important that the optimizer is not hard-wired into the compiler but implemented as a library, with potentially many different implementations. To make changes to the optimizer more practical, we designed our query representation so that optimizations are easy to express; restricting to pure queries also helps. For instance, filter fusion can be implemented simply as: 2 val mergeFilters = ExpTransformer { case Sym(Filter(Sym(Filter(collection, pred2)), pred1)) ⇒ collection.filter(x ⇒ pred2(x) && pred1(x)) } The above code matches on reified expression of form collection.filter(pred2).filter(pred1) and rewrites it. A more complex optimization like filter hoisting requires only 20 lines of code. We have implemented a prototype of the optimizer with the mentioned optimizations. Many additional algebraic optimizations can be added in future work by us or others; a candidate would be loop hoisting, which moves out of loops arbitrary computations not depending on the loop variable (and not just filters). With some changes to the optimizer’s architecture, it would also be possible to perform cost-based and dynamic optimizations. 4.3 Query execution Calling the eval method on a query will convert it to executable bytecode; this bytecode will be loaded and invoked by using Java reflection. We produce a thunk that, when evaluated, will execute the generated code. In our prototype we produce bytecode by converting expression trees to Scala code and invoking on the result the Scala compiler, scalac. Invoking scalac is typically quite slow, but it is merely an engineering problem to produce bytecode in a faster way; we currently use caching to limit this concern. Our expression trees contain native Scala values wrapped in Const nodes, and in many cases one cannot produce Scala program text evaluating to the same value. To allow executing such expression trees we need to implement cross-stage persistence (CSP): the generated code will be a function, accepting the actual values as arguments [36]. This allows sharing the compiled code for expressions which differ only in the embedded values. More in detail, our compilation algorithm is as follows. (a) We implement CSP by replacing embedded Scala values by references to the function arguments; so for instance List(1, 2, 3).map(x ⇒ x + 1) becomes the function (s1: List[Int], s2: Int) ⇒ s1.map(x ⇒ x + s2). (b) We look up the produced expression tree, together with the types of the constants we just removed, in a cache mapping to the generated classes. If the lookup fails 2 Sym nodes are part of the boilerplate we omitted earlier. we update the cache with the result of the next steps. (c) We apply CSE on the expression. (d) We convert the tree to code, compile it and load the generated code. Preventing errors in generated code Compiler errors in generated code are typically a concern; with SQuOpt, however, they can only arise due to implementation bugs in SQuOpt (for instance in pretty-printing, which cannot be checked statically), so they do not concern users. Since our query language and tree representation are statically typed, type-incorrect queries will be rejected statically. For instance, consider again idxByPublisher, described previously: val idxByPublisher = books.asSquopt.indexBy(_.publisher) Since Book.publisher returns a String, idxByPublisher has type Exp[Map[String, Book]]. Looking up a key of the wrong type, for instance by writing idxByPublisher(book) where book: Book, will make scalac emit a static type error. 5. EVALUATION The key goals of SQuOpt are to reconcile modularity and efficiency. To evaluate this claim, we perform a rigorous performance evaluation of queries with and without SQuOpt. We also analyze modularization potential of these queries and evaluate how modularization affects performance (with and without SQuOpt). We show that modularization introduces a significant slowdown. The overhead of using SQuOpt is usually moderate, and optimizations can compensate this overhead, remove the modularization slowdown and improve performance of some queries by orders of magnitude, especially when indexes are used. 5.1 Study Setup Throughout the paper, we have already shown several compact queries for which our optimizations increase performance significantly compared to a naive execution. Since some optimizations change the complexity class of the query (e.g. by using an index), so the speedups grow with the size of the data. However, to get a more realistic evaluation of SQuOpt, we decided to perform an experiment with existing real-world queries. As we are interested in both performance and modularization, we have a specification and three different implementations of each query that we need to compare: (0) Query specification: We selected a set of existing real-world queries specified and implemented independently from our work and prior to it. We used only the specification of these queries. (1) Modularized Scala implementation: We reimplemented each query as an expression on Scala collections—our baseline implementation. For modularity, we separated reusable domain abstractions into subqueries. We confirmed the abstractions with a domain expert and will later illustrate them to emphasize their general nature. (2) Hand-optimized Scala implementation: Next, we asked a domain expert to performed manual optimizations on the modularized queries. The expert should perform optimizations, such as inlining and filter hoisting, where he could find performance improvements. 0 Reference Implementation/ Specification (3) SQuOpt implementation: Finally, we rewrote the modularized Scala queries from (1) as SQuOpt queries. The rewrites are of purely syntactic nature to use our library (as described in Sec. 3.1) and preserve the modularity of the queries. 3- SQuOpt without optimizer Legend: (3o ) SQuOpt with optimizer: Next, we execute the SQuOpt queries after optimization. (3x ) SQuOpt with optimizer and indexes: Finally, we execute the queries after providing a set of indexes that the optimizer can consider. In all cases, we measure query execution time for the generated code, excluding compilation: we consider this appropriate because the results of compilations are cached aggressively and can be reused when the underlying data is changed, as the data is not part of the compiled code. We use additional indexes in (3x ), but not in the handoptimized Scala implementation (2). We argue that indexes are less likely to be applied manually, because index application is a crosscutting concern and makes the whole query implementation more complicated and less abstract. Still, we offer measurement (3o ) to compare the speedup without additional indexes. This gives us a total of five settings to measure and compare (1, 2, 3− , 3o , and 3x ). Between them, we want to observe the following interesting performance ratios (speedups or slowdowns): (M) Modularization overhead (the relative performance difference between the modularized and the handoptimized Scala implementation: 1/2). (S) SQuOpt overhead (the overhead of executing unoptimized SQuOpt queries: 1/3− ; smaller is better). (H) Hand-optimization challenge (the performance overhead of our optimizer against hand-optimizations of a domain expert: 2/3o ; bigger is better). This overhead is partly due to the SQuOpt overhead (S) and partly to optimizations which have not been automated or have not been effective enough. This comparison excludes the effects of indexing, since this is an optimization we did not perform by hand; we also report (H’) = 2/3x , which includes indexing. (O) Optimization potential (the speedup by optimizing modularized queries: 1/3o ; bigger is better). 2 Hand-opt. Scala Implementation M T S Since SQuOpt supports executing queries with and without optimizations and indexes, we measured actually three different execution modes of the SQuOpt implementation: (3− ) SQuOpt without optimizer: First, we execute the SQuOpt queries without performing optimization first, which should show the SQuOpt overhead compared to the modular Scala implementation (1). However, common-subexpression elimination is still used here, since it is part of the compilation pipeline. This is appropriate to counter the effects of excessive inlining due to using a deep embedding, as explained in Sec. 4.1. 1 Modularized Scala Implementation H O 3o SQuOpt with optimizer derived from X 3x SQuOpt with optimizer and indexes comparison Figure 7: Measurement Setup: Overview Abstraction All fields in all class files All methods in all class files All method bodies in all class files All instructions in all method bodies and their bytecode index Sliding window (size n) over all instructions (and their index) Used 4 3 3 5 3 Table 1: Description of abstractions removed during hand-optimization and number of queries where the abstraction is used (and optimized away). (X) Index influence (the speedup gained by using indexes: 3o /3x ) (bigger is better). (T) Total optimization potential with indexes (1/3x ; bigger is better), which is equal to (O) × (X). In Figure 7, we provide an overview of the setup. We made our raw data available and our results reproducible [40].3 5.2 Experimental Units As experimental units, we sampled a set of queries on code structures from Findbugs 2.0 [20]. Findbugs is a popular bug-finding tool for Java Bytecode available as open source. To detect bug patterns, Findbugs performs queries that traverse a structural in-memory representation of a code base (extracted from bytecode). We selected queries from Findbugs because they represent typical non-trivial queries on in-memory collections. We sampled queries in two batches. First, we manually selected 8 queries (from approx. 400 queries in Findbugs), chosen mainly to evaluate the potential speedups of indexing (queries that primarily looked for declarations of classes, methods, or fields with specific properties, queries that inspect the type hierarchy, and queries that required analyzing methods implementation). Subsequently, we randomly selected a batch of 11 additional queries. The batch excluded queries that rely on control-/dataflow analyses (i.e., analyzing the effect of bytecode instructions on the stack), due to limitations of the bytecode tookit we use. In total, we have 19 queries as listed in Table 2 (the randomly selected queries are marked with R ). We implemented each query three times (see implementations (1)–(3) in Sec. 5.1) following the specifications given in the Findbugs documentation (0). Instead of using a hierarchy of visitors as the original implementations of the queries 3 Data available at: http://www.informatik. uni-marburg.de/~pgiarrusso/SQuOpt Performance (ms) Id 1 2 3 4 5 6 7 8 9R 10R 11R 12R 13R 14R 15R 16R 17R 18R 19R Description Covariant compareTo() defined Explicit garbage collection call Protected field in final class Explicit runFinalizersOnExit() call clone() defined in non-Cloneable class Covariant equals() defined Public finalizer defined Dubious catching of IllegalMonitorStateException Uninit. field read during construction of super Mutable static field declared public Refactor anon. inner class to static Inefficient use of toArray(Object[]) Primitive boxed and unboxed for coercion Double precision conversion from 32 bit Privileged method used outside doPrivileged Mutable public static field should be final Serializable class is member of non-ser. class Swing methods used outside Swing thread Finalizer only calls super class finalize Performance ratios 1 2 3− 3o 3x M (1/2) H (2/3o ) T (1/3x ) 1.1 496 11 509 29 29 29 82 896 9527 8804 3714 3905 3887 505 13 12 577 55 1.3 258 1.1 262 14 15 12 72 367 9511 8767 1905 1672 1796 302 6.2 0.77 53 13 0.85 1176 11 1150 55 23 28 110 3017 9115 8718 4046 5044 5289 1319 12 0.94 1163 73 0.26 1150 1.2 1123 46 9.7 8.0 28 960 9350 8700 3414 3224 3010 337 7.0 1.8 45 11 0.26 52 1.2 10.0 0.47 0.20 0.03 0.01 960 9350 8700 3414 3224 3010 337 7.0 1.8 45 0.10 0.9 1.9 10.0 1.9 2.1 1.9 2.3 1.1 2.4 1.0 1.0 2.0 2.3 2.2 1.7 2.0 16 11 4.4 5.0 0.2 1.0 0.2 0.3 1.6 1.5 2.6 0.4 1.0 1.0 0.6 0.5 0.6 0.9 0.9 0.4 1.2 1.1 4.4 9.5 9.8 51 61 147 1070 12800 0.9 1.0 1.0 1.1 1.2 1.3 1.5 1.8 6.9 13 541 Implementations and speedups are as defined in Sec. 5.1. Queries marked with R were selected by random sampling. Table 2: Performance results. Geometric means of performance ratios M (1/2) S (1/3− ) H (2/3o ) H’ (2/3x ) O (1/3o ) X (3o /3x ) T (1/3x ) 2.4x 1.2x 0.8x 5.1x 1.9x 6.3x 12x Table 3: Average performance ratios. for { classFile ← classFiles.asSquopt method ← classFile.methods if method.isAbstract && method.name ==# "equals" && method.descriptor.returnType ==# BooleanType parameterTypes ← Let(method.descriptor.parameterTypes) if parameterTypes.length ==# 1 && parameterTypes(0) ==# classFile.thisClass } yield (classFile, method) Figure 8: Find covariant equals methods. in Findbugs, we wrote the queries as for-comprehensions in Scala on an in-memory representation created by the Scala toolkit BAT.4 BAT in particular provides comprehensive support for writing queries against Java bytecode in an idiomatic way. We exemplify an analysis in Fig. 8: It detects all co-variant equals methods in a project by iterating over all class files (line 2) and all methods, searching for methods named “equals” that return a boolean value and define a single parameter of the type of the current class. Abstractions In the reference implementations (1), we identified several reusable abstractions as shown in Table 1. The reference implementations of all queries except 17R use exactly one of these abstractions, which encapsulate the 4 http://github.com/Delors/BAT main loops of the queries. Indexes For executing (3x ) (SQuOpt with indexes), we have constructed three indexes to speed up navigation over the queried data of queries 1–8: Indexes for method name, exception handlers, and instruction types. We illustrate the implementation of the method-name index in Fig. 9: it produces a collection of all methods and then indexes them using indexBy; its argument extracts from an entry the key, that is the method name. We selected which indexes to implement using guidance from SQuOpt itself; during optimizations, SQuOpt reports which indexes it could have applied to the given query. Among those, we tried to select indexes giving a reasonable compromise between construction cost and optimization speedup. We first measured the construction cost of these indexes: Index Elapsed time (ms) Method name Exception handlers Instruction type 97.99±2.94 179.29±3.21 4166.49±202.85 For our test data, index construction takes less than 200 ms for the first two indexes, which is moderate compared to the time for loading the bytecode in the BAT representation (4755.32 ± 141.66). Building the instruction index took around 4 seconds, which we consider acceptable since this index maps each type of instruction (e.g. INSTANCEOF) to a collection of all bytecode instructions of that type. val methodNameIdx: Exp[Map[String, Seq[(ClassFile, Method)]]] = (for { classFile ← classFiles.asSquopt method ← classFile.methods } yield (classFile, method)).indexBy(entry ⇒ entry._2.name) Figure 9: A simple index definition 5.3 Measurement Setup To measure performance, we executed the queries on the preinstalled JDK class library (rt.jar), containing 58M of uncompressed Java bytecode. We also performed a preliminary evaluation by running queries on the much smaller ScalaTest library, getting comparable results that we hence do not discuss. Experiments were run on a 8-core Intel Core i72600, 3.40 GHz, with 8 GB of RAM, running Scientific Linux release 6.2. The benchmark code itself is single-threaded, so it uses only one core; however the JVM used also other cores to offload garbage collection. We used the preinstalled OpenJDK Java version 1.7.0 05-icedtea and Scala 2.10.0M7. We measure steady-state performance as recommended by Georges et al. [11]. We invoke the JVM p = 15 times; at the beginning of each JVM invocation, all the bytecode to analyze is loaded in memory and converted into BAT’s representation. In each JVM invocation, we iterate each benchmark until the variations of results becomes low enough. We measure the variations of results through the coefficient of variation (CoV; standard deviation divided by the mean). Thus, we iterate each benchmark until the CoV in the last k = 10 iterations drops under the threshold θ = 0.1, or until we complete q = 50 iterations. We report the arithmetic mean of these measurements (and also report the usually low standard deviation on our web page). 5.4 Results Correctness We machine-checked that all results of all variants of a query agree. Modularization overhead We first observe that performance suffers significantly when using the abstractions we described in Table 1. These abstractions, while natural in the domain and in the setting of a declarative language, are not idiomatic in Java or Scala because, without optimization, they will obviously lead to bad performance. They are still useful abstractions from the point of view of modularity, though—as indicated by Table 1—and as such it would be desirable if one could use them without paying the performance penalty. Scala implementations vs. Findbugs Before actually comparing between the different Scala and SQuOpt implementations, we first ensured that the implementations are comparable to the original Findbugs implementation. A direct comparison between the Findbugs reference implementation and any of our implementations is not possible in a rigorous and fair manner. Findbugs bug detectors are not fully modularized, therefore we cannot reasonably isolate the implementation of the selected queries from support code. Furthermore, the architecture of the implementation has many differences that affect performance: among others, FindBugs also uses multithreading. Moreover, while in our case each query loops over all classes, in FindBugs a single visitor considers each class and invokes all visitors (implemented as listeners) on it. We measured startup performance [11], that is the performance of running the queries only once, to minimize the effect of compiler optimizations. We setup our SQuOptbased analyses to only perform optimization and run the optimized query. To setup FindBugs, we manually disabled all unrelated bug detectors; we also made the modified Findbugs source code available. The result is that the performance of the Scala implementations of the queries (3− ) has performance of the same order of magnitude as the original Findbugs queries – in our tests, the SQuOpt implementation was about twice as fast. However, since the comparison cannot be made fair, we refrained from a more detailed investigation. SQuOpt overhead and optimization potential We present the results of our benchmarks in Table 2. Column names refer to a few of the definitions described above; for readability, we do not present all the ratios previously introduced for each query, but report the raw data. In Table 3, we report the geometric mean [8] of each ratio, computed with the same weight for each query. We see that, in its current implementation, SQuOpt can cause a overhead S (1/3− ) up to 3.4x. On average SQuOpt queries are 1.2x faster. These differences are due to minor implementation details of certain collection operators. For query 18R , instead, we have that the the basic SQuOptimplementation is 12.9x faster and are investigating the reason; we suspect this might be related to the use of pattern matching in the original query. As expected, not all queries benefit from optimizations; out of 19 queries, optimization affords for 15 of them significant speedups ranging from a 1.2x factor to a 12800x factor; 10 queries are faster by a factor of at least 5. Only queries 10R , 11R and 12R fail to recover any modularization overhead. We have analyzed the behavior of a few queries after optimization, to understand why their performance has (or has not) improved. Optimization makes query 17R slower; we believe this is because optimization replaces filtering by lazy filtering, which is usually faster, but not here. Among queries where indexing succeeds, query 2 has the least speedup. After optimization, it uses the instructiontype index to find all occurrences of invocation opcodes (INVOKESTATIC and INVOKEVIRTUAL); after this step the query looks, among those invocations, for the ones targeting runFinalizersOnExit. Since invocation opcodes are quite frequent, the used index is not very specific, hence it allows for little speedup (9.5x). However no other index applies to this query; moreover, our framework does not maintain any selectivity statistics on indexes to predict these effects. Query 19R benefits from indexing without any specific tuning on our part, because it looks for implementations of finalize with some characteristic, hence the highly selective method-name index applies. After optimization, query 8 becomes simply an index lookup on the index for exception handlers, looking for handlers of IllegalMonitorStateException; it is thus not surprising that its speedup is thus extremely high (12800x). This speedup relies on an index which is specific for this kind of query, and building this index is slower than executing the unoptimized query. On the other hand, building this index is entirely appropriate in a situation where similar queries are common enough. Similar considerations apply to usage of indexing in general, similarly to what happens in databases. Optimization overhead The current implementation of the optimizer is not yet optimized for speed (of the optimization algorithm). For instance, expression trees are traversed and rebuilt completely once for each transformation. However, the optimization overhead is usually not excessive and is 54.8 ± 85.5 ms, varying between 3.5 ms and 381.7 ms (mostly depending on the query size). Limitations Although many speedups are encouraging, our optimizer is currently a proof-of-concept and we experienced some limitations: • In a few cases hand-optimized queries are still faster than what the optimizer can produce. We believe these problems could be addressed by adding further optimizations. • Our implementation of indexing is currently limited to immutable collections. For mutable collections, indexes must be maintained incrementally. Since indexes are defined as special queries in SQuOpt, incremental index maintenance becomes an instance of incremental maintenance of query results, that is, of incremental view maintenance. We plan to support incremental view maintenance as part of future work; however, indexing in the current form is already useful, as illustrated by our experimental results. Summary We demonstrated on our real-world queries that relying on declarative abstractions in collection queries often causes a significant slowdown. As we have seen, using SQuOpt without optimization, or when no optimizations are possible, usually provides performance comparable to using standard Scala; however, SQuOpt optimizations can in most cases remove the slowdown due to declarative abstractions. Furthermore, relying on indexing allows to achieve even greater speedups while still using a declarative programming style. Some implementation limitations restrict the effectiveness of our optimizer, but since this is a preliminary implementation, we believe our evaluation shows the great potential of optimizing queries to in-memory collections. 6. RELATED WORK This paper builds on prior work on language-integrated queries, query optimization, techniques for DSL embedding, and other works on code querying. Language-Integrated Queries Microsoft’s LanguageIntegrated Query technology (Linq) [23, 1] is similar to our work in that it also reifies queries on collections to enable analysis and optimization. Such queries can be executed against a variety of backends (such as SQL databases or in-memory objects), and adding new back-ends is supported. Its implementation uses expression trees, a compilersupported implicit conversion between expressions and their reification as a syntax tree. There are various major differences, though. First, the support for expression trees is hard-coded into the compiler. This means that the techniques are not applicable in languages that do not explicitly support expression trees. More importantly, the way expression trees are created in Linq is generic and fixed. For instance, it is not possible to create different tree nodes for method calls that are relevant to an analysis (such as the map method) than for method calls that are irrelevant for the analysis (such as the toString method). For this reason, expression trees in Linq cannot be customized to the task at hand and contain too much low-level information. It is well-known that this makes it quite hard to implement programs operating on expression trees [4]. Linq queries can also not easily be decomposed and modularized. For instance, consider the task of refactoring the filter in the query from x in y where x.z == 1 select x into a function. Defining this function as bool comp(int v) { return v == 1; } would destroy the possibility of analyzing the filter for optimization, since the resulting expression tree would only contain a reference to an opaque function. The function could be declared as returning an expression tree instead, but then this function could not be used in the original query anymore, since the compiler expects an expression of type bool and not an expression tree of type bool. It could only be integrated if the expression tree of the original query is created by hand, without using the built-in support for expression trees. Although queries against in-memory collections could theoretically also be optimized in Linq, the standard implementation, Linq2Objects, performs no optimizations. A few optimized embedded DSLs allow executing queries or computations on distributed clusters. DryadLINQ [44], based on Linq, optimizes queries for distributed execution. It inherits Linq’s limitations and thus does not support decomposing queries in different modules. Modularizing queries is supported instead by FlumeJava [3], another library (in Java) for distributed query execution. However, FlumeJava cannot express many optimizations because its representation of expressions is more limited; also, its query language is more cumbersome. Both problems are rooted in Java’s limited support for embedded DSLs. Other embedded DSLs support parallel platforms such as GPUs or many-core CPUs, such as Delite [37]. Willis et al. [42, 43] add first-class queries to Java through a source-to-source translator and implement a few selected optimizations, including join order optimization and incremental maintenance of query results. They investigate how well their techniques apply to Java programs, and they suggest that programmers use manual optimizations to avoid expensive constructs like nested loops. While the goal of these works is similar to ours, their implementation as an external source-to-source-translator makes the adoption, extensibility, and composability of their technique difficult. There have been many approaches for a closer integration of SQL queries into programs, such as HaskellDB [22] (which also inspired Linq), or Ferry [17] (which moves part of a program execution to a database). In Scala, there are also APIs which integrate SQL queries more closely (e.g., type-checking of queries), such as ScalaQuery5 and Scala Integrated Query6 . Based on Ferry, ScalaQL [10] extends Scala with a compiler-plugin to integrate a query language on top of a relational database. The work by Spiewak and Zhao [38] is unrelated to [10] but also called ScalaQL. It is similar to our approach in that it also proposes to reify queries based on for-comprehensions, but it is not clear from 5 6 http://scalaquery.org/ http://code.google.com/p/scala-integrated-query/ the paper how the reification works7 . Query Optimization Query optimization on relational data is a long-standing issue in the database community, but there are also many works on query optimization on objects [7, 14]. Compared to these works, we have only implemented a few simple query optimizations, so there is potential for further improvement of our work by incorporating more advanced optimizations. Scala and DSL Embedding Technically, our implementation of SQuOpt is a deep embedding of a part of the Scala collections API [29]. Deep embeddings were pionereed by Leijen and Meijer [22] and Elliott et al. [5]. The technical details of the embedding are not the main topic of this paper; we are using some of the Scala techniques presented by Rompf and Odersky [36] for using implicits and for adding infix operators to a type. Similar to Rompf and Odersky [36], we also use the Scala compiler on-the-fly. A plausible alternative backend for SQuOpt would have been to use Delite [37], a framework for building highly efficient DSLs in Scala. We regard the Scala collections API [29] as a shallowly embedded query DSL. Query operators immediately perform collection operations when called, so that it is not possible to optimize queries before execution. In addition to these eager query operators, the Scala collections API also provides views to create lazy collections. Views are somewhat similar to SQuOpt in that they reify query operators as data structures and interpret them later. However, views are not used for automatic query optimization, but for explicitly changing the evaluation order of collection processing. Unfortunately, views are not suited as a basis for the implementation of SQuOpt because they only reify the outermost pipeline of collection operators, whereas nested collection operators as well as other Scala code in queries, such as filter predicates or map and flatMap arguments, are only shallowly embedded. Deep embedding of the whole query is necessary for many optimizations, as discussed in Sec. 3. Code Querying In our evaluation we explore the usage of SQuOpt to express queries on code and re-implement a subset of the Findbugs [20] analyses. There are various other specialized code query languages such as CodeQuest [18] or D-CUBED [41]. Since these are special-purpose query languages that are not embedded into a host language, they are not directly comparable to our approach. 7. FUTURE WORK As part of future work we plan to add support for incremental view maintenance [13] to SQuOpt. This would allow, for instance, to update incrementally both indexes and query results. To make our DSL more convenient to use, it would be useful to use the virtualized pattern matcher of Scala 2.10, when it will be more robust, to add support for pattern matching in our virtualized queries. Moreover, it would be useful to verify statically that our transformations are type-safe. The optimizer rewrites an expression tree of type Exp[T] to another of the same type, but checking this at compile-time is hard because of limitations in the Scala type-checker and its support for GADTs. This is an interesting venue for future work because solving 7 We contacted the authors; they were not willing to provide more details or the sources of their approach. this problem conveniently would make developing transformations safer and thus easier. 8. CONCLUSIONS We have illustrated the tradeoff between performance and modularity for queries on in-memory collections. We have shown that it is possible to design a deep embedding of a version of the collections API which reifies queries and can optimize them at runtime. Writing queries using this framework is, except minor syntactic details, the same as writing queries using the collection library, hence the adoption barrier to using our optimizer is low. Our evaluation shows that using abstractions in queries introduces a significant performance overhead with native Scala code, while SQuOpt, in most cases, makes the overhead much more tolerable or removes it completely. Since our optimizer is a proof-of-concept with many areas where it can be further improved, a more elaborate version of the optimizer is likely to improve the performance even more, especially in those cases where it cannot yet beat the handoptimized queries. Acknowledgements The authors would like to thank Sebastian Erdweg for the helpful discussions on this project, Katharina Haselhorst for help with the implementation of the code generator, and the anonymous reviewers for their helpful comments on an earlier draft. This work is supported in part by the European Research Council, grant #203099 “ScalPL”. References [1] G. M. Bierman, E. Meijer, and M. Torgersen. Lost in translation: formalizing proposed extensions to C#. In Proc. Int’l Conf. Object-Oriented Programming, Systems, Languages and Applications, OOPSLA ’07, pages 479–498. ACM, 2007. [2] J. Carette, O. Kiselyov, and C.-c. Shan. Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. Journal of Functional Programming, 19:509–543, 2009. [3] C. Chambers, A. Raniwala, F. Perry, S. Adams, R. R. Henry, R. Bradshaw, and N. Weizenbaum. FlumeJava: easy, efficient data-parallel pipelines. In Proc. Conf. Programming Language Design and Implementation, PLDI ’10, pages 363–375. ACM, 2010. [4] O. Eini. The pain of implementing LINQ providers. Commun. ACM, 54(8):55–61, 2011. [5] C. Elliott, S. Finne, and O. de Moor. Compiling embedded languages. Journal of Functional Programming, 13(2):455–481, 2003. [6] B. Emir, M. Odersky, and J. Williams. Matching objects with patterns. In E. Ernst, editor, Proc. European Conf. Object-Oriented Programming (ECOOP), volume 4609 of Lecture Notes in Computer Science, pages 273– 298. Springer Berlin / Heidelberg, 2007. [7] L. Fegaras and D. Maier. Optimizing object queries using an effective calculus. ACM Trans. Database Systems (TODS), 25:457–516, 2000. [8] P. J. Fleming and J. J. Wallace. How not to lie with statistics: the correct way to summarize benchmark results. Commun. ACM, 29(3):218–221, Mar. 1986. ISSN 0001-0782. doi: 10.1145/5666.5673. URL http://doi.acm.org/10.1145/5666.5673. [9] B. Flyvbjerg. Five misunderstandings about case-study research. Qualitative Inquiry, 12(2):219–245, 2006. [10] M. Garcia, A. Izmaylova, and S. Schupp. Extending Scala with database query capability. Journal of Object Technology, 9(4):45–68, 2010. [11] A. Georges, D. Buytaert, and L. Eeckhout. Statistically rigorous Java performance evaluation. In Proc. Int’l Conf. Object-Oriented Programming, Systems, Languages and Applications, OOPSLA ’07, pages 57–76. ACM, 2007. [12] A. Gill, J. Launchbury, and S. L. Peyton Jones. A short cut to deforestation. In Proc. Int’l Conf. Functional Programming languages and Computer Architecture, FPCA ’93, pages 223–232. ACM, 1993. [13] D. Gluche, T. Grust, C. Mainberger, and M. Scholl. Incremental updates for materialized OQL views. In F. Bry, R. Ramakrishnan, and K. Ramamohanarao, editors, Deductive and Object-Oriented Databases, volume 1341 of Lecture Notes in Computer Science, pages 52– 66. Springer Berlin / Heidelberg, 1997. [14] T. Grust. Comprehending queries. PhD thesis, University of Konstanz, 1999. [15] T. Grust and M. H. Scholl. Translating OQL into monoid comprehensions: Stuck with nested loops? Technical Report 3a/1996, University of Konstanz, Department of Mathematics and Computer Science, Database Research Group, September 1996. [16] T. Grust and M. H. Scholl. How to comprehend queries functionally. Journal of Intelligent Information Systems, 12:191–218, 1999. [17] T. Grust, M. Mayr, J. Rittinger, and T. Schreiber. FERRY: database-supported program execution. In Proc. Int’l SIGMOD Conf. on Management of Data, SIGMOD ’09. ACM, 2009. [18] E. Hajiyev, M. Verbaere, and O. de Moor. CodeQuest: Scalable source code queries with Datalog. In D. Thomas, editor, Proc. European Conf. ObjectOriented Programming (ECOOP), volume 4067 of Lecture Notes in Computer Science, pages 2–27. Springer Berlin / Heidelberg, 2006. [22] D. Leijen and E. Meijer. Domain specific embedded compilers. In Proc. Conf. Domain-specific Languages, DSL ’99, pages 109–122. ACM, 1999. [23] E. Meijer, B. Beckman, and G. Bierman. LINQ: reconciling objects, relations and XML in the .NET framework. In Proc. Int’l SIGMOD Conf. on Management of Data, SIGMOD ’06, pages 706–706. ACM, 2006. [24] A. Moors. phism, 2010. Type constructor polymorURL http://adriaanm.github. com/research/2010/10/06/new-in-scala-2. 8-type-constructor-inference/. Last accessed on 2012-04-11. [25] A. Moors, T. Rompf, P. Haller, and M. Odersky. Scalavirtualized. In Proc. Workshop on Partial Evaluation and Semantics-Based Program Manipulation, PEPM ’12, pages 117–120. ACM, 2012. [26] S. S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997. ISBN 1-55860320-4. [27] M. Odersky. Pimp my library, 2006. URL http://www. artima.com/weblogs/viewpost.jsp?thread=179766. Last accessed on 10 April 2012. [28] M. Odersky. The Scala language specification version 2.9, 2011. [29] M. Odersky and A. Moors. Fighting bit rot with types (experience report: Scala collections). In IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, volume 4, pages 427–451, 2009. [30] M. Odersky, L. Spoon, and B. Venners. Programming in Scala. Artima Inc, 2 edition, 2011. [31] B. C. Oliveira, A. Moors, and M. Odersky. Type classes as objects and implicits. In Proc. Int’l Conf. ObjectOriented Programming, Systems, Languages and Applications, OOPSLA ’10, pages 341–360. ACM, 2010. [32] S. Peyton Jones and S. Marlow. Secrets of the Glasgow Haskell Compiler inliner. Journal of Functional Programming, 12(4-5):393–434, 2002. [33] F. Pfenning. Partial polymorphic type inference and higher-order unification. In Proc. ACM Conf. on LISP and Functional Programming, LFP ’88, pages 153–163. ACM, 1988. [19] C. Hofer, K. Ostermann, T. Rendel, and A. Moors. Polymorphic embedding of DSLs. In Proc. Int’l Conf. Generative Programming and Component Engineering, GPCE’08. ACM, 2008. [34] F. Pfenning and C. Elliot. Higher-order abstract syntax. In Proc. Conf. Programming Language Design and Implementation, PLDI ’88, pages 199–208. ACM, 1988. [20] D. Hovemeyer and W. Pugh. Finding bugs is easy. SIGPLAN Notices, 39(12):92–106, 2004. [35] B. C. Pierce. Types and Programming Languages. The MIT Press, 1st edition, 2002. [21] G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-oriented programming. In Proc. European Conf. Object-Oriented Programming (ECOOP), volume 1241 of LNCS, pages 220–242. Springer-Verlag, 1997. [36] T. Rompf and M. Odersky. Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs. In Proc. Int’l Conf. Generative Programming and Component Engineering, GPCE ’10, pages 127–136. ACM, 2010. [37] T. Rompf, A. K. Sujeeth, H. Lee, K. J. Brown, H. Chafi, M. Odersky, and K. Olukotun. Building-blocks for performance oriented DSLs. In O. Danvy and C.-c. Shan, editors, Proc. Conf. Domain-specific Languages, volume 66 of Electronic Proceedings in Theoretical Computer Science, pages 93–117. Open Publishing Association, 2011. doi: 10.4204/EPTCS.66.5. should remain mostly unchanged. In our case, we want to preserve Scala’s for-comprehension 8 syntax and its notation for anonymous functions. • Again to support users adopting SQuOpt, a generic SQuOpt query should not only share the syntax of the ordinary collections API; it should also be well-typed if and only if the corresponding ordinary query is welltyped. This is particularly challenging in the Scala collections library due to its deep integration with advanced type-system features, such as higher-kinded generics and implicit objects [29]. For instance, calling map on a List will return a List, and calling map on a Set will return a Set. Hence the object-language representation and the transformations thereof should be as “typed” as possible. This precludes, among others, a first-order representation of object-language variables as strings. [38] D. Spiewak and T. Zhao. ScalaQL: Language-integrated database queries for Scala. In Proc. Conf. Software Language Engineering (SLE), 2009. [39] M. Stonebraker, S. Madden, D. J. Abadi, S. Harizopoulos, N. Hachem, and P. Helland. The end of an architectural era: (it’s time for a complete rewrite). In Proc. Int’l Conf. Very Large Data Bases, VLDB ’07, pages 1150–1160. VLDB Endowment, 2007. [40] J. Vitek and T. Kalibera. Repeatability, reproducibility, and rigor in systems research. In Proc. Int’l Conf. Embedded Software, EMSOFT ’11, pages 33–38, New York, NY, USA, 2011. ACM. • SQuOpt should be interoperable with ordinary Scala code and Scala collections. For instance, it should be possible to call normal non-reified functions within a SQuOpt query, or mix native Scala queries and SQuOpt queries. [41] P. Wȩgrzynowicz and K. Stencel. The good, the bad, and the ugly: three ways to use a semantic code query system. In Proc. Int’l Conf. Object-Oriented Programming, Systems, Languages and Applications, OOPSLA ’09, pages 821–822. ACM, 2009. • The performance of SQuOpt queries should be reasonable even without optimizations. A non-optimized SQuOpt query should not be dramatically slower than a native Scala query. Furthermore, it should be possible to create new queries at run time and execute them without excessive overhead. This goal limits the options of applicable interpretation or compilation techniques. [42] D. Willis, D. Pearce, and J. Noble. Efficient object querying for Java. In D. Thomas, editor, Proc. European Conf. Object-Oriented Programming (ECOOP), volume 4067 of Lecture Notes in Computer Science, pages 28–49. Springer Berlin / Heidelberg, 2006. [43] D. Willis, D. J. Pearce, and J. Noble. Caching and incrementalisation in the Java Query Language. In Proc. Int’l Conf. Object-Oriented Programming, Systems, Languages and Applications, OOPSLA ’08, pages 1–18. ACM Press, 2008. [44] Y. Yu, M. Isard, D. Fetterly, M. Budiu, U. Erlingsson, P. K. Gunda, and J. Currey. DryadLINQ: a system for general-purpose distributed data-parallel computing using a high-level language. In Proceedings of the 8th USENIX conference on Operating systems design and implementation, OSDI’08, pages 1–14. USENIX Association, 2008. APPENDIX In the next appendixes, we discuss how we implement the interface for writing queries. This discussion is also a case study on how well Scala supports our task. A. COLLECTIONS AS A CASE STUDY As discussed in the introduction, to support optimizations we require a deep embedding of the collections DSL. While the basic idea of deep embedding is well known, it is not obvious how to realize deep embedding when considering the following additional goals: • To support users adopting SQuOpt, a generic SQuOpt query should share the “look and feel” of the ordinary collections API: In particular, query syntax We think that these challenges characterize deep embedding of queries on collections as a critical case study [9] for DSL embedding. That is, it is so challenging that embedding techniques successfully used in this case are likely to be successful on a broad range of other DSLs. From the case study, we report the successes and failures of achieving these goals in SQuOpt. B. IMPLEMENTATION: EXPRESSING THE INTERFACE IN SCALA To optimize a query as described in the previous section, SQuOpt needs to reify, optimize and execute queries. Our implementation assigns responsibility for these steps to three main components: A generic library for reification and execution of general Scala expressions, a more specialized library for reification and execution of query operators, and a dedicated query optimizer. Queries need then to be executed through either compilation (already discussed in Sec. 4.3) or interpretation (to discuss in Sec. B.5). We describe the implementation in more detail in the rest of this section. The full implementation is also available online9 . A core idea of SQuOpt is to reify Scala code as a data structure in memory. A programmer could directly create instances of that data structure, but we also provide a more convenient interface based on advanced Scala features such as implicit conversions and type inference. That interface 8 9 Also known as for expressions [30, Ch. 23]. http://www.informatik.uni-marburg.de/~pgiarrusso/ SQuOpt allows to automatically reify code with a minimum of programmer annotations, as shown in the examples in Sec. 3. Since this is a case study on Scala’s support for deep embedding of DSLs, we also describe in this section how Scala supports our task. In particular, we report on techniques we used and issues we faced. B.1 Representing expression trees In the previous section, we have seen that expressions that would have type T in a native Scala query are reified and have type Exp[T] in SQuOpt. The generic type Exp[T] is the base for our reification of Scala expression as expression trees, that is, as data structures in memory. We provide a subclass of Exp[T] for every different form of expression we want to reify. For example, in Fig. 2 the expression author.firstName + " " + author.lastName must be reified even though it is not collection-related, for otherwise the optimizer could not see whether author is used. Knowing this is needed for instance to remove variables which are bound but not used. Hence, this expression is reified as StringConcat(StringConcat(AuthorFirstName(author), Const(" ")), AuthorLastName(author)). This example uses the constructors of the following subclasses of Exp[T] to create the expression tree. case class Const[T](t: T) extends Exp[T] case class StringConcat(str1: Exp[String], str2: Exp[String]) extends Exp[String] case class AuthorFirstName(t: Exp[Author]) extends Exp[String] case class AuthorLastName(t: Exp[Author]) extends Exp[String] Expression nodes additionally implement support code for tree traversals to support optimizations, which we omit here. This representation of expression trees is well-suited for a representation of the structure of expressions in memory and also for pattern matching (which is automatically supported for case classes in Scala), but inconvenient for query writers. In fact, in Fig. 6 and 5, we have seen that SQuOpt provides a much more convenient front-end: The programmer writes almost the usual code for type T and SQuOpt converts it automatically to Exp[T]. B.2 Lifting first-order expressions We call the process of converting from T to Exp[T] lifting. Here we describe how we lift first-order expressions – Scala expressions that do not contain anonymous function definitions. To this end, consider again the fragment author.firstName + " " + author.lastName, now in the context of the SQuOpt-enabled query in Fig. 5. It looks like a normal Scala expression, even syntactically unchanged from Fig. 2. However, evaluating that code in the context of Fig. 5 does not concatenate any strings, but creates an expression tree instead. Although the code looks like the same expression, it has a different type, Exp[String] instead of String. This difference in the type is caused by the context: The variable author is now bound in a SQuOpt-enabled query and therefore has type Exp[Author] instead of Author. We can still access the firstName field of author, because expression trees of type Exp[T] provide the same interface as values of type T, except that all operations return expressions trees instead of values. To understand how an expression tree of type Exp[T] can have the same interface as a value of type T, we consider two expression trees str1 and str2 of type Exp[String]. The implementation of lifting differs depending on the kind of expression we want to lift. Method calls and operators In our example, the operator + should be available on Exp[String], but not on Exp[Boolean], because + is available on String but not on Boolean. Furthermore, we want str1 + str2 to have type Exp[String] and to evaluate not to a string concatenation but to a call of StringConcat, that is, to an expression tree which represents str1 + str2. This is a somewhat unusual requirement, because usually, the interface of a generic type does not depend on the type parameters. To provide such operators and to encode expression trees, we use implicit conversions in a similar style as Rompf and Odersky [36]. Scala allows to make expressions of a type T implicitly convertible to a different type U. To this end, one must declare an implicit conversion function having type T ⇒ U. Calls to such functions will be inserted by the compiler when required to fix a type mismatch between an expression of type T and a context expecting a value of type U. In addition, a method call e.m(args) can trigger the conversion of e to a type where the method m is present10 . Similarly, an operator usage, as in str1 + str2, can also trigger an implicit conversion: an expression using an operator, like str1 + str2, is desugared to the method call str1.+(str2), which can trigger an implicit conversion from str1 to a type providing the + method. Therefore from now on we do not distinguish between operators and methods. To provide the method + on Exp[String], we define an implicit conversion from Exp[String] to a new type providing a + method which creates the appropriate expression node. implicit def expToStringOps(t: Exp[String]) = new StringOps(t) class StringOps(t: Exp[String]) { def +(that: Exp[String]): Exp[String] = StringConcat(t, that) } This is an example of the well-known Scala enrich-my-library pattern 11 [27]. With these declarations in scope, the Scala compiler rewrites str1 + str2 to expToStringOps(str1).+(str2), which evaluates to StringConcat(str1, str2) as desired. Note that the implicit conversion function expToStringOps is not applicable to Exp[Boolean] because it explicitly specifies the receiver of the +-call to have type Exp[String]. In other words, expressions like str1 + str2 are now lifted on the level of expression trees in a type-safe way. For brevity, we refer to the defined operator as Exp[String].+. Literal values However, a string concatenation might also include constants, as in str1 + "foo" or "bar" + str1. To lift str1 + "foo", we introduce a lifting for constants which wraps them in a Const node: implicit def pure[T](t: T): Exp[T] = Const(t) The compiler will now rewrite expToStringOps(str1) + pure("foo"). 10 to Similarly, str1 + "foo" For the exact rules, see Odersky et al. [30, Ch. 21] and Odersky [28]. 11 Also known as pimp-my-library pattern. author. firstName + " " + author.lastName is rewritten to (expToStringOps(author.firstName) + pure(" ")) + author.lastName. Note how the implicit conversions cooperate successfully to lift the expression. Analogously, it would be convenient if the similar expression "bar" + str1 would be rewritten to expToStringOps(pure("bar")) + str1, but this is not the case, because implicit coercions are not chained automatically in Scala. Instead, we have to manually chain existing implicit conversions into a new one: implicit def toStringOps(t: String) = expToStringOps(pure(t)) so that "bar" + str1 is rewritten to toStringOps("bar") + str1. User-defined methods Calls of user-defined methods like author.firstName are lifted the same way as calls to built-in methods such as string concatenation shown earlier. For the running example, the following definitions are necessary to lift the methods from Author to Exp[Author]. package schema.squopt implicit def expToAuthorOps(t: Exp[Author]) = new AuthorOps(t) implicit def toAuthorOps(t: Author) = expToAuthorOps(pure(t)) class AuthorOps(t: Exp[Author]) { def firstName: Exp[String] = AuthorFirstName(t) def lastName: Exp[String] = AuthorLastName(t) } Author is not part of SQuOpt or the standard Scala library but an application-specific class, hence it is not possible to pre-define the necessary lifting code as part of SQuOpt. Instead, the application programmer needs to provide this code to connect SQuOpt to his application. To support the application programmer with this tedious task, we provide a code generator which discovers the interface of a class through reflection on its compiled version and generates the boilerplate code such as the one above for Author. It also generates the application-specific expression tree types such as AuthorFirstName as shown in Sec. B.1. In general, query writers need to generate and import the boilerplate lifting code for all application-specific types they want to use in a SQuOpt query. If desired, we can exclude some methods to restrict the language supported in our deeply embedded programs. For instance SQuOpt requires the user to write side-effect-free queries, hence we do not lift methods which perform side effects. Using similar techniques, we can also lift existing functions and implicit conversions. Tuples and other generic constructors The techniques presented above for the lifting of method calls rely on overloading the name of the method with a signature that involves Exp. Implicit resolution (for method calls) will then choose our lifted version of the function or method to satisfy the typing requirements of the context or arguments of the call. Unfortunately, this technique does not work for tuple constructors, which, in Scala, are not resolved like ordinary calls. Instead, support for tuple types is hard-wired into the language, and tuples are always created by the predefined tuple constructors. For example, the expression (str1, str2) will always call Scala’s built-in Tuple2 constructor and correspondingly have type (Exp[String], Exp[String]). We would prefer that it calls a lifting function and produces an expression tree of type Exp[(String, String)] instead. Even though we cannot intercept the call to Tuple2, we can add an implicit conversion to be called after the tuple is constructed. implicit def tuple2ToTuple2Exp[A1, A2] (tuple: (Exp[A1], Exp[A2])): LiftTuple2[A1, A2] = LiftTuple2[A1, A2](tuple._1, tuple._2) case class LiftTuple2[A1, A2](t1: Exp[A1], t2: Exp[A2]) extends Exp[(A1, A2)] We generate such conversions for different arities with a code generator. These conversions will be used only when the context requires an expression tree. Note that this technique is only applicable because tuples are generic and support arbitrary components, including expression trees. In fact, we use the same technique also for other generic constructors to avoid problems associated with shadowing of constructor functions. For example, an implicit conversion is used to lift Seq[Exp[T]] to Exp[Seq[T]]: code like Seq(str1, str2) first constructs a sequence of expression trees and then wraps the result with an expression node that describes a sequence. Subtyping So far, we have seen that for each first-order method m operating on instances of T, we can create a corresponding method which operates on Exp[T]. If the method accepts parameters having types A1, ... , An and has return type R, the corresponding lifted method will accept parameters having types Exp[A1], ... , Exp[An] and return type Exp[R]. However, Exp[T] also needs to support all methods that T inherits from its super-type S. To ensure this, we declare the type constructor Exp to be covariant in its type parameter, so that Exp[T] correctly inherits the liftings from Exp[S]. This works even with the enrich-mylibrary pattern because implicit resolution respects subtyping in an appropriate way. Limitations of Lifting Lifting methods of Any or AnyRef (Scala types at the root of the inheritance hierarchy) is not possible with this technique: Exp[T] inherits such methods and makes them directly available, hence the compiler will not insert an implicit conversion. Therefore, it is not possible to lift expressions such as x == y; rather, we have to rely on developer discipline to use ==# and !=# instead of == and !=. An expression like "foo" + "bar" + str1 is converted to toStringOps("foo" + "bar") + str1; hence, part of the expression is evaluated before being reified. This is harmless here since we want "foo" + "bar" to be evaluated at compile-time, that is constant-folded, but in other cases it is preferable to prevent the constant folding. We will see later examples where queries on collections are evaluated before reification, defeating the purpose of our framework, and how we work around those. B.3 Lifting higher-order expressions We have shown how to lift first-order expressions; however, the interface of collections also uses higher-order methods, that is, methods that accept functions as parameters, and we need to lift them as well to reify the complete collection DSEL. For instance, the map method applies a function to each element of a collection. In this subsection, we describe how we reify such expressions of function type. Higher-order abstract syntax To represent functions, we have to represent the bound variables in the function bodies. For example, a reification of str ⇒ str + "!" needs to reify the variable str of type String in the body of the anonymous function. This reification should retain the information where str is bound. We achieve this by representing bound variables using higher-order abstract syntax (HOAS) [34], that is, we represent them by variables bound at the meta level. To continue the example, the above function is reified as (str: Exp[String]) ⇒ str + "!". Note how the type of str in the body of this version is Exp[String], because str is a reified variable now. Correspondingly, the expression str + "!" is lifted as described in the previous subsection. With all operations in the function body automatically lifted, the only remaining syntactic difference between normal and lifted functions is the type annotation for the function’s parameter. Fortunately, Scala’s local type inference can usually deduce the argument type from the context, for example, from the signature of the map operation being called. Type inference plays a dual role here: First, it allows the query writer to leave out the annotation, and second, it triggers lifting in the function body by requesting a lifted function instead of a normal function. This is how in Fig. 5, a single call to asSquopt triggers lifting of the overall query. Note that reified functions have type Exp[A] ⇒ Exp[B] instead of the more regular Exp[A ⇒ B]. We chose the former over the latter to support Scala’s syntax for anonymous functions and for-comprehensions which is hard-coded to produce or consume instances of the pre-defined A ⇒ B type. We have to reflect this irregularity in the lifting of methods and functions by treating the types of higher-order arguments accordingly. User-defined methods, revised We can now extend the lifting of signatures for methods or functions from the previous subsection to the general case, that is, the case of higher-order functions. We lift a method or function with signature def m[A1, ..., An](a1: T1, ..., an: Tn): R to a method or function with the following signature. def m[A1, ..., An](a1: LiftJT1K, ..., an: LiftJTnK): LiftJRK As before, the definition of the lifted method or function will return an expression node representing the call. If the original was a function, the lifted version is also defined as a function. If the original was a method on type T, then the lifted version is enriched onto T. The type transformation Lift converts the argument and return types of the method or function to be lifted. For most types, Lift just wraps the type in the Exp type constructor, but function types are treated specially: Lift recursively descends into function types to convert their arguments separately. Overall, Lift behaves as follows. LiftJ(A1, ... , An) ⇒ R]K = (LiftJA1K, ... , LiftJAnK ⇒ LiftJRK LiftJAK = Exp[A] We can use this extended definition of method lifting to implement map lifting for Lists, that is, a method with signature Exp[List[T]].map(Exp[T] ⇒ Exp[U]): implicit def expToListOps[T](coll: Exp[List[T]]) = new ListOps(coll) implicit def toListOps[T](coll: List[T]) = expToListOps(coll) class ListOps(coll: Exp[List[T]]) { val records = books. withFilter(book ⇒ book.publisher == "Pearson Education"). flatMap(book ⇒ book.authors. map(author ⇒ BookData(book.title, author.firstName + " " + author.lastName, book.authors.size - 1))) Figure 10: Desugaring of code in Fig. 2. def map[U](f: Exp[T] ⇒ Exp[U]) = ListMapNode(coll, Fun(f)) } case class ListMapNode[T, U](coll: Exp[List[T]], mapping: Exp[T ⇒ U]) extends Exp[List[U]] Note how map’s parameter f has type Exp[T] ⇒ Exp[U] as necessary to enable Scala’s syntax for anonymous functions and automatic lifting of the function body. This implementation would work for queries on lists, but does not support other collection types or queries where the collection type changes. We show in Sec. B.4 how SQuOpt integrates with such advanced features of the Scala Collection DSEL. B.4 Lifting collections In this subsection, we first explain how forcomprehensions are desugared to calls to library functions, allowing an external library to give them a different meaning. We summarize afterwards needed information about the subset of the Scala collection DSEL that we reify. Then we present how we perform this reification. We finally present the reification of the running example (Fig. 5). For-comprehensions As we have seen, an idiomatic encoding in Scala of queries on collections are forcomprehensions. Although Scala is an impure functional language and supports side-effectful for-comprehensions, only pure queries are supported in our framework, because this enables or simplifies many domain-specific analyses. Hence we will restrict our attention to pure queries. The Scala compiler desugars for-comprehensions into calls to three collection methods, map, flatMap and withFilter, which we explain shortly; the query in Fig. 2 is desugared to the code in Fig. 10. The compiler performs type inference and type checking on a for-comprehension only after desugaring it; this affords some freedom for the types of map, flatMap and withFilter methods. The Scala Collection DSEL A Scala collection containing elements of type T implements the trait Traversable[T]. On an expression coll of type Traversable[T] one can invoke methods declared (in first approximation) as follows: def map[U](f: T ⇒ U): Traversable[U] def flatMap[U](f: T ⇒ Traversable[U]): Traversable[U] def withFilter[U](p: T ⇒ Boolean): Traversable[T]. For a Scala collection coll, the expression coll.map(f) applies f to each element of coll, collects the results in a new collection and returns it; coll.flatMap(f) applies f to each element of coll, concatenates the results in a new collection and returns it; coll.withFilter(p) produces a collection containing the elements of coll which satisfy the predicate p. However, Scala supports many different collection types, and this complicates the actual types of these methods. Each collection can further implement sub- traits like Seq[T] <: Traversable[T] (for sequences), Set[T] <: Traversable[T] (for sets) and Map[K, V] <: Traversable[(K, V)] (for dictionaries); for each such trait, different implementations are provided. One consequence of this syntactic desugaring is that a single for-comprehension can operate over different collection types. The type of the result depends essentially on the type of the root collection, that is books in the example above. The example above can hence be altered to produce a sequence rather than a set by simply converting the root collection to another type: val recordsSeq = for { book ← books.toSeq if book.publisher == "Pearson Education" author ← book.authors } yield BookData(book.title, author.firstName + " " + author.lastName, book.authors.size - 1) Precise static typing The Scala collections DSEL achieves precise static typing while avoiding code duplication [29]. Precise static typing is necessary because the return type of a query operation can depend on subtle details of the base collection and query arguments. To return the most specific static type, the Scala collection DSL defines a type-level relation between the source collection type, the element type for the transformed collection, and the type for the resulting collection. The relation is encoded through the concept pattern [31], i.e., through a type-class-style trait CanBuildFrom[From, Elem, To], and elements of the relation are expressed as implicit instances. For example, a finite map can be treated as a set of pairs so that mapping a function from pairs to pairs over it produces another finite map. This behavior is encoded in an instance of type CanBuildFrom[Map[K, V], (K1, V1), Map[K1, V1]. The Map[K, V] is the type of the base collection, (K1, V1) is the return type of the function, and Map[K1, V1] is the return type of the map operation. It is also possible to map some other function over the finite map, but the result will be a general collection instead of a finite map. This behavior is described by an instance of type CanBuildFrom[Traversable[T], U, Traversable[U]. Note that this instance is also applicable to finite maps, because Map is a subclass of Traversable. Together, these two instances describe how to compute the return type of mapping over a finite map. Code reuse Even though these two use cases for mapping over a finite map have different return types, they are implemented as a single method that uses its implicit CanBuildFrom parameter to compute both the static type and the dynamic representation of its result. So the Scala Collections DSEL provides precise typing without code duplication. In our deep embedding, we want to preserve this property. CanBuildFrom is used in the implementation of map, flatMap and withFilter. To further increase reuse, the implementations are provided in a helper trait TraversableLike[T, Repr], with the following signatures: def map[U](f: T ⇒ U) (implicit cbf: CanBuildFrom[Repr, U, That]): That def flatMap[U](f: T ⇒ Traversable[U]) (implicit cbf: CanBuildFrom[Repr, U, That]): That def withFilter[U](p: T ⇒ Boolean): Repr. The Repr type parameter represents the specific type of the receiver of the method call. class TraversableLikeOps[T, Repr <: Traversable[T] with TraversableLike[T, Repr]](t: Exp[Repr]) { val t: Exp[Repr] def withFilter(f: Exp[T] ⇒ Exp[Boolean]): Exp[Repr] = Filter(this.t, FuncExp(f)) def map[U, That <: TraversableLike[U, That]] (f: Exp[T] ⇒ Exp[U]) (implicit c: CanBuildFrom[Repr, U, That]): Exp[That] = MapNode(this.t, FuncExp(f)) //... other methods ... } //definitions of MapNode, Filter omitted. Figure 11: Lifting TraversableLike The lifting The basic idea is to use the enrichmy-library pattern to lift collection methods from TraversableLike[T, Repr] to TraversableLikeOps[T, Repr]: implicit def expToTraversableLikeOps[T, Repr] (v: Exp[TraversableLike[T, Repr]]) = new TraversableLikeOps[T, Repr](v) However, given the design of the collection library, every instance of TraversableLike[T, Repr] is also an instance of both Traversable[T] and Repr; to take advantage of this during interpretation and optimization, we need to restrict the type of expToTraversableLikeOps, getting the following conversion:12 implicit def expToTraversableLikeOps [T, Repr <: Traversable[T] with TraversableLike[T, Repr]] (v: Exp[Repr]) = new TraversableLikeOps[T, Repr](v) The query operations are TraversableLikeOps[T, Repr]; a defined in class few examples are shown in Fig. 11.13 Note how the lifted query operations use CanBuildFrom to compute the same static return type as the corresponding non-lifted query operation would compute. This reuse of type-level machinery allows SQuOpt to provide the same interface as the Scala Collections DSEL. Code reuse, revisited We already saw how we could reify List[T].map through a specific expression node, ListMapNode. However, this approach would require generating many variants for different collections with slightly different types; writing an optimizer able to handle all such variations would be unfeasible because of the amount of code duplication required. Instead, by reusing Scala type-level machinery, we obtain a reification which is statically typed and at the same time avoids code duplication in both our lifting and our optimizer, and in general in all possible consumers of our reification, making them feasible to write. B.5 Interpretation After optimization, SQuOpt needs to interpret the optimized expression trees to perform the query. Therefore, 12 Due to type inference bugs, the actual implicit conversion needs to be slightly more complex, to mention T directly in the argument type. We reported the bug at https:// issues.scala-lang.org/browse/SI-5298. 13 Similar liftings are introduced for traits similar to TraversableLike, like SeqLike, SetLike, MapLike, and so on. the trait Exp[T] declares an def interpret(): T method, and each expression node overrides it appropriately to implement a mostly standard typed, tagless [2], environmentbased interpreter. The interpreter computes a value of type T from an expression tree of type Exp[T]. This design allows query writers to extend the interpreter to handle application-specific operations. In fact, the lifting generator described in Sec. B.3 automatically generates appropriate definitions of interpret for the lifted operations. For example, the interpretation of string concatenation is simply string concatenation, as shown in the following fragment of the interpreter. Note that type-safety of the interpreter is checked automatically by the Scala compiler when it compiles the fragments. case class StringConcat(str1: Exp[String], str2: Exp[String]) extends Exp[String] { def interpret() = str1.interpret() + str2.interpret() } The subset of Scala we reify roughly corresponds to a typed lambda calculus with subtyping and type constructors. It does not include constructs for looping or recursion, so it should be strongly normalizing as long as application programmers do not add expression nodes with nonterminating interpretations. However, query writers can use the host language to create a reified expression of infinite size. This should not be an issue if SQuOpt is used as a drop-in replacement for the Scala Collection DSEL. During optimization, nodes of the expression tree might get duplicated, and the interpreter could, in principle, observe this sharing and treat the expression tree as a DAG, to avoid recomputing results. Currently, we do not exploit this, unlike during compilation. B.6 Optimization Our optimizer is structured as a pipeline of different transformations on a single intermediate representation, constituted by our expression trees. Each phase of the pipeline, and the pipeline as a whole, produce a new expression having the same type as the original one. Most of our transformations express simple rewrite rules with or without side conditions, which are applied on expression trees from the bottom up and are implemented using Scala’s support for pattern matching [6]. Some optimizations, like filter hoisting (which we applied manually to produce the code in Fig. 4), are essentially domain-specific and can improve complexity of a query. To enable such optimizations to trigger, however, one needs often to perform inlining-like transformations and to simplify the result. Inlining-related transformation can for instance produce code like (x, y)._1, which we simplify to x, reducing abstraction overhead but also (more importantly) making syntactically clear that the result does not depend on y, hence might be computed before y is even bound. This simplification extends to user-defined product types; with definitions in Fig. 1 code like BookData(book.title, ... ).title is simplified to book.title. We have implemented thus optimizations of three classes: • general-purpose simplifications, like inlining, compiletime beta-reduction, constant folding and reassociation on primitive types, and other simplifications14 ; 14 Beta-reduction and simplification are run in a fixpoint loop [32]. Termination is guaranteed because our language does not admit general recursion. • domain-specific simplifications, whose main goal is still to enable more important optimizations; • domain-specific optimizations which can change the complexity class of a query, such as filter hoisting, hash-join transformation or indexing. Among domain-specific simplifications, we implement a few described in the context of the monoid comprehension calculus [15, 14], such as query unnesting and fusion of bulk operators. Query unnesting allows to unnest a for comprehension nested inside another, and produce a single for-comprehension. Furthermore, we can fuse different collection operations together: collection operators like map, flatMap and withFilter can be expressed as folds producing new collections which can be combined. Scala forcomprehension are however more general than monoid comprehensions15 , hence to ensure safety of some optimizations we need some additional side conditions16 . Manipulating functions To be able to inspect a HOAS function body funBody: Exp[S] ⇒ Exp[T], like str ⇒ str + "!", we convert it to first-order abstract syntax (FOAS), that is to an expression tree of type Exp[T]. To this end, we introduce a representation of variables and a generator of fresh ones; since variable names are auto-generated, they are internally represented simply as integers instead of strings for efficiency. To convert funBody from HOAS to FOAS we apply it to a fresh variable v of type TypedVar[S], obtaining a first-order representation of the function body, having type Exp[T], and containing occurrences of v. This transformation is hidden into the constructor Fun, which converts Exp[S] ⇒ Exp[T], a representation of an expression with one free variable, to Exp[S ⇒ T], a representation of a function. case class App[S, T](f: Exp[S ⇒ T], t: Exp[S]) extends Exp[T] def Fun[-S, +T](f: Exp[S] ⇒ Exp[T]): Exp[S ⇒ T] = { val v = Fun.gensym[S]() FOASFun(funBody(v), v) } case class FOASFun[S, T](val foasBody: Exp[T], v: TypedVar[S]) extends Exp[S ⇒ T] implicit def app[S, T](f: Exp[S ⇒ T]): Exp[S] ⇒ Exp[T] = arg ⇒ App(f, arg) Conversely, function applications are represented using the constructor App; an implicit conversion allows App to be inserted implicitly. Whenever f can be applied to arg and f is an expression tree, the compiler will convert f(arg) to app(f)(arg), that is App(f, arg). In our example, Fun(str ⇒ str + "!") produces FOASFun(StringConcat(TypedVar[String](1), Const("!")), TypedVar[String](1)). Since we auto-generate variable names, it is easiest to implement represent variable occurrences using the Barendregt convention, where bound variables must always be globally unique; we must be careful to perform renaming after betareduction to restore this invariant [35, Ch. 6]. 15 For instance, a for-comprehension producing a list cannot iterate over a set. For instance, consider a for-comprehension producing a set and nested inside another producing a list. This comprehension does not correspond to a valid monoid comprehension (see previous footnote), and query unnesting does not apply here: if we unnested the inner comprehension into the outer one, we would not perform duplicate elimination on the inner comprehension, affecting the overall result. 16 We can now easily implement substitution and betareduction and through that, as shown before, enable other optimizations to trigger more easily and speedup queries. In this section we discuss the degree to which SQuOpt fulfilled our original design goals, and the conclusions for host and domain-specific language design. judged the syntactic overhead for the programmer to be too high to use those techniques – in our implementation we rely on encapsulation and on dynamic checks at query construction time to achieve similar guarantees. The choice of interpreting expressions turned out to be a significant performance limitation. It could likely be addressed by using Delite and lightweight modular staging instead, but we wanted to experiment with how far we can get within the language in a well-typed setting. C.1 C.3 C. DISCUSSION What worked well Several features of Scala contributed greatly to the success we achieved. With implicit conversions, the lifting can be made mostly transparent. The advanced type system features were quite helpful to make the expression tree representation typed. The fact that for-comprehensions are desugared before type inference and type checking was also a prerequisite for automatic lifting. The syntactic expressiveness and uniformity of Scala, in particular the fact that custom types can have the same look-and-feel as primitive types, were also vital to lift expressions on primitive types. C.2 Limitations Despite these positive experiences and our experimental success, our embedding has a few significant limitations. The first limitation is that we only lift a subset of Scala, and some interesting features are missing. We do not support statements in nested blocks in our queries, but this could be implemented reusing techniques from Delite [37]. More importantly for queries, pattern matching cannot be supported by deep embedding similar to ours. In contrast to for-comprehension syntax, pattern matching is desugared only after type checking [6], which prevents us from lifting pattern matching notation. More specifically, because an extractor [6] cannot return the representation of a result value (say Exp[Boolean]) to later evaluate; it must produce its final result at pattern matching time. There is initial work on “virtualized pattern matching”17 , and we hope to use this feature in future work. We also experienced problems with operators that cannot be overloaded, such as == or if-else and with lifting methods in scala.Any, which forced us to provide alternative syntax for these features in queries. The Scala-virtualized project [25] aims to address these limitations; unfortunately, it advertises no change on the other problems we found, which we subsequently detail. It would also be desirable if we could enforce the absence of side effects in queries, but since Scala, like most practical programming languages except Haskell, does not track side effects in the type system this does not seem to be possible. Finally, compared to lightweight modular staging [36] (the foundation of Delite) and to polymorphic embedding [19], we have less static checking for some programming errors when writing queries; the recommended way to use Delite is to write a DSEL program in one trait, in terms of the DSEL interface only, and combine it with the implementation in another trait. In polymorphic embedding, the DSEL program is a function of the specific implementation (in this case, semantics). Either approach ensures that the DSL program is parametric in the implementation, and hence cannot refer to details of a specific implementation. However, we 17 http://stackoverflow.com/questions/8533826/ what-is-scalas-experimental-virtual-pattern-matcher What did not work so well: Scala type inference When implementing our library, we often struggled against limitations and bugs in the Scala compiler, especially regarding type inference and its interaction with implicit resolution, and we were often constrained by its limitations. Not only Scala’s type inference is not complete, but we learned that its behavior is only specified by the behavior of the current implementation: in many cases where there is a clear desirable solution, type inference fails or finds an incorrect substitution which leads to a type error. Hence we cannot distinguish, in the discussion, the Scala language from its implementation. We regard many of Scala’s type inference problems as bugs, and reported them as such when no previous bug report existed, as noted in the rest of this section. Some of them are long-standing issues, others of them were accepted, for other ones we received no feedback yet at the time of this writing, and another one was already closed as WONTFIX, indicating that a fix would be possible but have excessive complexity for the time being.18 . Overloading The code in Fig. 5 uses the lifted BookData constructor. Two definitions of BookData are available, with signatures BookData(String, String, Int) and BookData(Exp[String], Exp[String], Exp[Int]), and it seems like the Scala compiler should be able to choose which one to apply using overload resolution. This however is not supported simply because the two functions are defined in different scopes19 , hence importing BookData(Exp[String], Exp[String], Exp[Int]) shadows locally the original definition. Type inference vs implicit resolution The interaction between type inference and implicit resolution is a hard problem, and Scalac has also many bugs, but the current situation requires further research; for instance, there is not even a specification for the behavior of type inference20 . As a consequence, to the best of our knowledge some properties of type inference have not been formally established. For instance, a reasonable user expectation is that removing a call to an implicit conversion does not alter the program, if it is the only implicit conversion with the correct type in scope, or if it is more specific than the others [30, Ch. 21]. This is not always correct, because removing the implicit conversion reduces the information available for the type inference algorithm; we observed multiple cases21 where type inference becomes unable to figure out enough information about the type to trigger implicit conversion. We also consider significant that Scala 2.8 required making 18 https://issues.scala-lang.org/browse/SI-2551 https://issues.scala-lang.org/browse/SI-2551 20 https://issues.scala-lang.org/browse/SI-5298? focusedCommentId=55971#comment-55971, reported by us. 21 https://issues.scala-lang.org/browse/SI-5592, re19 ported by us. both type inference and implicit resolution more powerful, specifically in order to support the collection library [24, 30, Sec 21.7]; further extensions would be possible and desirable. For instance, if type inference were extended with higherorder unification22 [33], it would better support a part of our DSL interface (not discussed in this paper) by removing the need for type annotations. Nested pattern matches for GADTs in Scala Writing a typed decomposition for Exp requires pattern-matching support for generalized algebraic datatypes (GADTs). We found that support for GADTs in Scala is currently insufficient. Emir et al. [6] define the concept of typecasing, essentially a form of pattern-matching limited to non-nested patterns, and demonstrate that Scala supports typecasing on GADTs in Scala by demonstrating a typed evaluator; however, typecasing is rather verbose for deep patterns, since one has to nest multiple pattern-matching expressions. When using normal pattern matches, instead, the support for GADT seems much weaker.23 Hence one has to choose between support for GADT and the convenience of nested pattern matching. A third alternative is to ignore or disable compiler warnings, but we did not consider this option. Implicit conversions do not chain While implicit conversions by default do not chain, it is sometimes convenient to allow chaining selectively. For instance, let us assume a context such that a: Exp[A], b: Exp[B] and c: Exp[C]. In this context, let us consider again how we lift tuples. We have seen that the expression (a, b) has type (Exp[A], Exp[B]) but can be converted to Exp[(A, B)] through an implicit conversion. Let us now consider nested tuples, like ((a, b), c): it has type ((Exp[A], Exp[B]), Exp[C]), hence the previous conversion cannot be applied to this expression. Odersky et al. [30, Ch. 21] describe a pattern which can address this goal. Using this pattern, to lift pairs, we must write an implicit conversion from pairs of elements which can be implicitly converted to expressions. Instead of requiring (Exp[A], Exp[B]), the implicit conversion should require (A, B) with the condition that A can be converted to Exp[A’] and B to Exp[B’]. This conversion solves the problem if applied explicitly, but the compiler refuses to apply it implicitly, again because of type inference issues24 . Because of this type inference limitations, we failed to provide support for reifying code like ((a, b), c)25 . Error messages for implicit conversions The enrichmy-library pattern has the declared goal to allow to extend existing libraries transparently. However, implementation details shine however through when a user program using this feature contains a type error. When invoking a method would require an implicit conversion which is not applicable, the compiler often just reports that the method is not available. The recommended approach to debugging such errors is to manually add the missing implicit conversion and inves22 https://issues.scala-lang.org/browse/SI-2712 Due to bug https://issues.scala-lang.org/browse/ SI-5298?focusedCommentId=56840#comment-56840, re- 23 ported by us. 24 https://issues.scala-lang.org/browse/SI-5651, reported by us. 25 One could of course write a specific implicit conversions for this case; however, (a, (b, c)) requires already a different implicit conversion, and there are infinite ways to nest pairs, let alone tuples of bounded arity. tigating the type error [30, Ch. 21.8], but this destroys the transparency of the approach when creating or modifying code. We believe this could be solved in principle by research on error reporting: the compiler could automatically insert all implicit conversions enabling the method calls and report corresponding errors, even if at some performance cost. C.4 Lessons for language embedders Various domains, such as the one considered in our case study, allow powerful domain-specific optimizations. Such optimizations often are hard to express in a compositional way, hence they cannot be performed while building the query but must be expressed as global optimizations passes. For those domains, deep embedding is key to allow significant optimizations. On the other hand, deep embedding requires to implement an interpreter or a compiler. On the one hand, interpretation overhead is significant in Scala, even when using HOAS to take advantage of the metalevel implementation of argument access. Instead of interpreting a program, one can compile a DSEL program to Scala and load it, as done by Rompf et al. [37]; while we are using this approach, the disadvantage is the compilation delay, especially for Scala whose compilation process is complex and time-consuming. Possible alternatives include generating bytecode directly or combining interpretation and compilations similarly to tiered JIT compilers, where only code which is executed often is compiled. We plan to investigate such alternatives in future work.
6cs.PL
Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Applications Laure Philipsa , Joeri De Kostera , Wolfgang De Meutera , and Coen De Roovera a Vrije Universiteit Brussel, Brussels, Belgium Abstract Web programmers are often faced with several challenges in the development process of modern, rich internet applications. Technologies for the different tiers of the application have to be selected: a serverside language, a combination of JavaScript, HTML and CSS for the client, and a database technology. Meeting the expectations of contemporary web applications requires even more effort from the developer: many state of the art libraries must be mastered and glued together. This leads to an impedance mismatch problem between the different technologies and it is up to the programmer to align them manually. Multi-tier or tierless programming is a web programming paradigm that provides one language for the different tiers of the web application, allowing the programmer to focus on the actual program logic instead of the accidental complexity that comes from combining several technologies. While current multi-tier approaches therefore relieve the burden of having to combine different technologies into one application, the distribution of the code is explicitly tied into the program. Certain distribution decisions have an impact on crosscutting concerns such as information security or offline availability. Moreover, adapting the programs such that the application complies better with these concerns often leads to code tangling, rendering the program more difficult to understand and maintain. We introduce an approach to multi-tier programming where the multi-tier code is decoupled from the tier specification. The developer implements the web application in terms of slices and an external specification that assigns the slices to tiers. A recommender system completes the picture for those slices that do not have a fixed placement and proposes slice refinements as well. This recommender system tries to optimise the tier specification with respect to one or more crosscutting concerns. This is in contrast with current cutting edge solutions that hide distribution decisions from the programmer. In this paper we show that slices, together with a recommender system, enable the developer to experiment with different placements of slices, until the distribution of the code satisfies the programmer’s needs. We present a search-based recommender system that maximises the offline availability of a web application and a concrete implementation of these concepts in the tier-splitting tool Stip.js. ACM CCS 2012 Software and its engineering → Client-server architectures; Distributed programming languages; Source code generation; Keywords web programming, multi-tier programming, rich internet applications, JavaScript The Art, Science, and Engineering of Programming Submitted April 7, 2017 Published December 6, 2017 doi 10.22152/programming-journal.org/2018/2/3 © L. Philips, J. De Koster, W. De Meuter and C. De Roover This work is licensed under a “CC BY 4.0” license. In The Art, Science, and Engineering of Programming, vol. 2, no. 2, 2018, article 3; 29 pages. Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps 1 Introduction Application developers target the web platform more and more: not only is it supported on a plethora of devices, it is also an ideal stage for rich, interactive and collaborative applications. Such rich internet applications have a thick client that is more than just a static user interface. The client integrates results from external services, e.g., a Twitter feed, and updates its UI reactively. Moreover, not every click results in a roundtrip to the server and data can be stored locally, thus making (parts of) the application offline available as well. Incorporating these characteristics requires the developer to master a multitude of technologies. In a typical web application the developer has to select a technology stack for every tier: the client, server and database tier. For example, Java or Php for the server, a query language for the database and a mingling of JavaScript, HTML and CSS for the client. Additionally, for the client tier, developers often resort to an extensive set of libraries for reactively updating the UI or doing complex rendering of data. Manually aligning each of these different technologies frequently requires complex glue code that does not contribute to the essential complexity of the application. All of this additional accidental complexity lowers the maintainability of the resulting application. Multi-tier or tierless programming effectively deals with these problems by enabling the development of multi-tier applications as a single artefact. Typical for this approach is that the same language can be used to develop all three tiers. This enables a desktop-like style of development, because the accidental complexity resulting from the communication between the different tiers is hidden from the programmer. Multitier programming was introduced over a decade ago and has since proven successful in solving several problems related to the web domain. In this paper we distinguish three approaches to multi-tier programming: librarybased, language-based and transformation-based. Library-based approaches take a general-purpose language and provide an extensive set of libraries or packages that each handle a certain task related to the web domain. Google Web Toolkit (GWT) [6] is a multi-tier library for Java, and Meteor [16] for JavaScript. While the library-based approach abstracts the domain-specific concepts into libraries, the language-based approach provides these concepts at the language level itself. A major advantage is that common tasks in the web domain that normally lead to complex code can now be abstracted away in new language features. Examples include the Hop [15], Links [3], Ur/Web [2] and [4] multi-tier languages. Transformation-based approaches also start from a general-purpose language, and the programmer can add developer hints via annotations. These developer hints influence the transformation process that translated multi-tier to distributed code, and are related to the placement of code, remote communication, etc. The Volta tool [8] takes programs in the Common Intermediate Language (CIL) of the .NET platform as input. JavaScript has long become the standard for client-side browser development. Since the introduction of Node.js, the language can be used for server-side development as well. In previous work [12, 13] we acknowledged this observation by introducing a transformation-based approach to multi-tier programming in JavaScript. Program- 3:2 L. Philips, J. De Koster, W. De Meuter and C. De Roover mers can develop their applications as a single JavaScript artefact with tier-specific annotations that indicate what code needs to run on the client or server. An automatic tier splitter then calculates the two slices for the server and client tier and performs a code transformation to insert the necessary distributed logic. By targeting JavaScript our tool can easily integrate with existing JavaScript libraries and tools (i.e., no typed interface or complex wrappers have to be provided). Moreover, with this work we focus on a low-effort migration of existing JavaScript code where developers only have to add a few annotations in order to make their code tier-full. Up till now, multi-tier programming approaches have focussed on the elimination of the impedance mismatch between the different tiers in a multi-tier application. In order to do so, every approach has support for some tier-specific annotations in the source code that dictate what parts of the code have to run on each of the different tiers. For this paper, our hypothesis is that this explicit division of the source code into those tiers limits the configurability and flexibility of the resulting application. More specifically, we argue that different crosscutting concerns such as performance, offline availability, security, etc. require different configurations of the same application. For example, depending on the application, a developer might not know upfront what parts of the code need to run on the client, what parts on the server and what parts need to be replicated in order to maximise offline availability. General-purpose data replication specifically, is a concern that has not yet been considered in the context of multi-tier programming. In this paper we present an approach where applications are developed as a single artefact consisting of different slices. Each slice represents part of the application that is written in a tier-agnostic way. These slices serve as different building blocks for configuring an application. Such a configuration is specified in a placement specification where each of the slices are assigned to a specific tier. This assignment can be done manually or by means of a recommender system that automatically tries to calculate the optimal configuration in order to optimise a given metric for a certain crosscutting concern. The assignment of different slices to different specific tiers in order to optimise this metric is a task that is often neither deterministic nor exact. For this reason our recommender system employs an evolutionary algorithm in order to calculate this assignment. After assigning each slice to a tier the recommender system reports back to the programmer about the computed assignment of slices to specific tiers. On top of that, our recommender system will also suggest slice refinements that can potentially positively impact the result. The application developer can then split up or merge particular slices and insert or change specific annotations according to the suggested refinements. After this step, a next iteration of the recommender system can be started. We argue that the combination of slices and the recommender system enables developers to focus first on the essential complexity of their applications. Crosscutting concerns can then later be tackled by changing the assignment of different sliced to specific tiers or by adding annotations in the code based on the suggestions of the recommender system. This division of an application in tier-agnostic slices along with the recommender system are the main contributions of this work. In this paper we introduce slice-based 3:3 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps web programming, we first discuss our previous work on multi-tier programming. We deliberate about possible approaches for the recommender system and give a concrete example of one that tries to optimise the offline availability of a web application. We give an evaluation by comparing different versions of the same application, that starts from a minimum of slices and incorporates the feedback from the system. We measure how this has an impact on the offline availability, together with the granularity of the slices. We implement the same application in a library-based and language-based multi-tier approach as well, and compare the runtime and code characteristics of the three versions. 2 Slice-based web development 2.1 Motivating example Throughout this paper we use a small example of a rich internet application, called Uni-corn. The idea is that PhD students can use this app to manage their “uni-versity” career, by keeping track of tasks, meetings, teaching schedule, etc. Through a built-in calendar view and charts page the student can monitor his or her progress. This application has four main services: viewing the calendar, viewing progress via the charts, viewing/adding/updating meetings and tasks. To keep it simple we focus on a single server - single client application, meaning that there is no synchronisation between different clients. The main focus of our motivating example is that the application has a high offline availability; meaning that the four services can still be used when no connection is at hand. For instance, entered data should not be lost when the connection drops, and ideally the newly added input should already be rendered. This way the programmer is not hampered by the lost connection and can keep using the application in the same way as before. The application uses JavaScript libraries for representing and parsing dates, drawing the charts and rendering a calendar view. It is a single-page application, thus every view is already rendered when loading the application and no roundtrips to the server are made when switching between different views. This also means that the user interface is updated reactively: any update on the data is immediately visible without a page refresh. We published a full tutorial on how to write this application in our approach.¹ 2.2 Slice-based web development with pre-determined tiers In previous work [13] we introduced a tier-splitting process for JavaScript that uses state of the art program analysis and program transformation technology. This section gives a brief overview of the contributions of that work. The approach can be 1 http://lphilips.github.io/uni-corn.html (accessed November 2017) 3:4 L. Philips, J. De Koster, W. De Meuter and C. De Roover categorised as a transformation-based approach: a general-purpose language, namely JavaScript, is augmented with a number of light-weight developer hints to guide the splitting process. These developer hints are placed as annotations inside comment blocks. This means that any tool or library that works for JavaScript code is oblivious of these annotations and can still be used in conjunction with our approach. This means that developers can use and benefit from the entire JavaScript ecosystem. In order for a developer to transform his tierless code into tierfull code different code blocks have to be annotated with either @client and @server annotations. The tier-splitting process will then automatically detect inter-tier communication and transform the source code into two program slices, one for the server and one for the client. Annotations for remote communication, data sharing and failure handling are supported as well, an overview can found in Appendix A. Our approach employs a state of the art program analysis tool for JavaScript in order to automatically infer where inter-tier communication needs to be inserted. This means that some of these annotations, related to inter-tier communication (e.g., @remoteCall and @remoteProcedure), can be omitted from the source code. This means that for those calls, a local call is indistinguishable from a remote call in the source code. Whether it is transformed is then solely determined by the placement of the caller and the callee. When our static analysis loses precision and cannot determine whether a call should be remote or not this is reported and a manual annotation is required. Based on the AST of the multi-tier code, we build the corresponding Program Dependence Graph (PDG) representation of the program. It is a directed graph of which the nodes correspond to statements in the program and the edges represent control and data dependencies between the nodes. PDG’s are often used for program slicing [19], a technique used for program comprehension and debugging. Informally, a program slice is an executable subset of a program that has a direct or indirect effect on values computed at a certain location, or criterion. We extended the PDG and program slicing algorithm with the notion of tiers, depicted by Distributed Component (i.e. client and server) nodes in the graph. Dependencies between nodes that belong to another distributed component are remote dependencies: e.g., a remote data or call reference. Figure 1 gives an example of a PDG for the code given in Listing 1. Our adapted slicing algorithm takes a distributed component as a slicing criterion and returns the subset of the code that is needed to execute that component, without including nodes that belong to another distributed component. Please note that not every node must belong to a distributed component, we call these shared nodes, because they end up in the program slices of those distributed components that use them. After the program slicing step we end up with two program slices: one for the client tier and one for the server tier. The program transformation step now transforms these selected nodes to their distributed variants by injecting distributed communication into the multi-tier code. This means that local calls must become remote procedure calls and that local functions that are called by another tier must become remote functions. The program transformation step calls on the information of the PDG to decide whether such transformations must take place. 3:5 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps Listing 1 A chat application in Stip.js 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 /* @server */ { /* @replicated */ var messages = []; } /* @client */ { var name = "user" + (Math.floor(Math.random() * 9901) + 100); var msg = ""; function chat() { messages.push({name: name, message: msg}); msg = ""; } } /* @ui */ {{#each messages}} p {{name + " says: " + message}} input[value={{name}}] input[value={{msg}}][placeholder=Message] button[@click=chat]#send Send In our prototype implementation of this tier-splitting process, called Stip.js ,² the output of the transformation is JavaScript code for both client and server side. We implemented our own communication library to perform remote procedure calls, together with a layer for replicated data on top of it. Listing 1 demonstrates the multi-tier code for a chat application. We make use of replicated data (line 4) and the built-in HTML templating system Redstone to create our reactive user interface. Inside the HTML code we can access JavaScript variables and functions by wrapping JavaScript expressions in double curly braces. Listing 2 and 3 illustrates how code for the data replication and reactive UI updates are inserted in the output of the tier-splitting process. Listing 2 Listing 3 Resulting client side Resulting server side code for Listing 1 1 var server = new ServerData(app, 3000); 2 var messages = server.makeReplicatedObject(' ,→ messages', []); 3 server.expose({}); code for Listing 1 1 var client = new ClientData('http://localhost:3000'); 2 var name = 'user' + (Math.floor(Math.random() * 9901) + ,→ 100); 3 var msg = ''; 4 var messages = client.makeReplicatedObject('messages', ,→ []); 5 REDSTONE.updateVariable('name', name); 6 REDSTONE.updateVariable('msg', msg); 7 function chat() { 8 messages.push({name: name, message: msg}); 9 REDSTONE.updateVariable('messages', messages); } In the work presented in this section code blocks are coupled to tier-specific placement annotations (@client and @server). However, in this paper we advocate that placement should be decoupled from the source code into a separate configuration step. Our approach facilitates this decoupling because it relies on static analysis to determine at compile time what calls are between different tiers. Nothing in the 2 https://bit.ly/stipjs (accessed November 2017) 3:6 L. Philips, J. De Koster, W. De Meuter and C. De Roover e0 DC server DC client s1 messages s2 s3 e1 name msg chat remote data dependency control dependency e c1 entry node c call node distributed component s statement node s4 Figure 1 Pogram Dependence Graph for Listing 1 source code distinguishes local from remote calls and only at compile time our transformation tool decides what calls should be transformed into their asynchronous counterparts. Furthermore, we show that this decoupling of placement annotations and tier-agnostic slices improves the flexibility of the resulting application. Different crosscutting concerns such as performance, offline availability, security, etc. that require different configurations can be easily accommodated. On top of that we present a recommender system that tries to calculate the optimal configuration and suggests refinements based on the results of that configuration. 2.3 Untangling tier placement from web slices A number of cross-cutting concerns cannot be expressed by means of a simple annotation in the source code. For example, when a developer wants to improve the offline availability of his or her application, this can have an impact in various locations the code base. For example, a developer might choose to replicate a collection, but this will also have an impact on all the code that is using that collection. Meanwhile, the offline availability is improved but the overall security of the application might be lowered. There is no way to visualise or measure how well a certain configuration of the application handles these various concerns. Generally speaking, handling crosscutting concerns leads to code scattering and tangling between the tiers. Maintaining the application becomes harder as well: because of code duplication the code on the client and server tier handling this concern should both be maintained. For this paper, instead of taking @client and @server slices as building units if the web application, we decouple the slices from their tier specification. Slices are a unit of code that have a unique name and can be mapped to a tier in an external specification. Two new location-based annotations are thus added: @slice to define a new slice and @config to map slices to a certain tier. Listing 4 Example of slices and configuration 1 /* @config data : server, browser: client 2 @slice data */ 3 { 4 /* @replicated */ 5 var tasks = []; 3:7 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps slice data slice sorting Figure 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 slice browser slice statistics remote data dependency remote call dependency Dependencies between the slices /* @replicated */ function Task(name, priority) { this.name = name; this.priority = priority; this.status = -1; } } /* @slice sorting */ { function sortTasks () {} } /* @slice statistics */ { function getTaskStats () {} } /* @slice browser */ { function displayTasks () { sortTasks(); tasks.forEach(function (task) { /* display the task */ }) } function displayTasksStats() { var stats = getTasksStats(); /* Generate and display graph */ } } Listing 4 shows how we could implement the part of the Uni-corn application that keeps track of the tasks of the student. We omitted the bodies of the functions for brevity. We define four slices (on line 2, 12, 16 and 20) and give them each a name: data, sorting, statistics and browser. Each slice has its own block statement that consists of the code belonging to that slice. In this example the data slice is responsible of declaring the replicated data, the sorting slice defines a function to sort the tasks based on each task’s priority. The statistics slice has a function that calculates how many tasks are finished, in progress or have yet to be started. The browser slice has a function to display the tasks and the task statistics, after making sure the tasks are sorted. Because our approach is based on a program analysis a dependence graph can be constructed that enables a visualisation of the dependencies between different slices, see Figure 2. It is actually a PDG as introduced in Section 2.2 where the Distributed Component nodes (thus the slices) are collapsed. Whenever a call or data dependency crosses the boundaries of a slice, it becomes a remote dependency regardless of the location of slices. As can be seen on the graph, the browser slice has only outgoing dependencies. The data slice on the other hand is a supportive slice: it has only incoming dependencies. The configuration of the slices (Listing 4, line 1) gives a fixed placement for the browser and data slice. The placement of the browser slice is fixed and must be on the client tier because it updates the user interface in the browser. The placement of 3:8 L. Philips, J. De Koster, W. De Meuter and C. De Roover the data slice is also fixed and must be on the server tier because we want our server to manage a centralised set of tasks. The slices that have no fixed placement in the configuration (in this case statistics and sorting) are not bound to a particular tier and their placement can vary depending on the output of our recommender system. Placing the slices on a certain tier is the task of the recommender system. This component is responsible for taking a crosscutting concern into account when assigning slices to tiers. For example, one system can try to maximise the offline availability of an application while another can try to optimise the memory usage. The result of the recommender system is an allocation of every slice to a tier. However, how well our recommender system can decide on a placement heavily depends on the amount of slices and their granularity. For this reason the recommender system has an additional step in which it reports back to the developer about potential refinements of the source code. Given a placement for every slice, considerations for slice refinements are given to the developer. By following these considerations, the developer can potentially improve how well a cross-cutting concern is handled within his application. In the following sections we discuss the tier assignment and slice refinement process. 2.4 Search-based tier assignment to user-defined slices The recommender system must be applied to allocate the unplaced slices to a tier, given one or more crosscutting concerns. As an input it takes the configuration of fixed slices and the multi-tier program and as output it gives a mapping where every slice is assigned to a tier. The system can resort to several techniques to calculate the most ideal placement: a dependence-driven analysis, code instrumentation, etc. Because with each additional slice the amount of possible configurations increase exponentially it is impossible to consider every potential configuration. Therefore we opted for a genetic search algorithm in order to reach, or at least approximate, the optimal placement to satisfy a crosscutting concern. Genetic search algorithms have their origin in natural selection: starting from a population of individuals, called a generation, from which the fittest candidates are selected to form a new generation by performing mutations and combinations (crossovers). This process repeats until a certain end condition is satisfied or a certain number of generations have been computed. The only required input for a genetic search algorithm is a starting population, a fitness function and method for generating offspring (mutations) from an existing population. The only part of that input that is specific to a certain cross-cutting concern is the fitness function. The following section gives a brief overview of each component of the search algorithm and gives an example fitness function for optimising offline availability of an application. However, this fitness function can be altered to focus on other concern(s). Currently, the search we apply is single-objective: this means that during the search we optimise only one objective. We leave the case where multiple objectives are optimised at the same time and trade-offs between possible conflicting objectives as future work. 3:9 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps Generation The individuals of the population are a mapping of unplaced slices to a tier, in this case client, server or both. Every iteration of the genetic search produces a new generation of a fixed size, originating from the previous generation. The initial seed for the search algorithm is a mapping where every unplaced slice is assigned to a random tier. Because every unplaced slice has three options, we have a search space of order 3n , with n the number of unplaced slices. In the selection process we discuss how we reduce this search space. Fitness function Because a single-objective search is conducted, we have a single fitness value that the algorithm tries to maximise. For this example, our aim is to get an high offline availability, thus our fitness function calculates a real number in the [0,1] range that represents how offline available the current configuration is. Before we define the fitness function, we need to able to define how offline a certain slice, placed on a given tier, is. OFFLINE %(sl ice) = l ocal C al ls(slice) cal ls(sl ice) For this we calculate the number of local calls performed in the slice, which are calls to functions defined in the slice itself or to slices placed on the same tier. This is divided by the total number of calls performed in that slice, this number thus includes calls to functions defined in slices placed on other tiers. We do not claim that this is an ideal function for measuring offline availability of a certain slice. However, our experimental results have shown that this function gives a good enough approximation. Our fitness function regards every slice and calculates a weighted mean of every OF F L I N E % score for every slice. This way slices that perform a large amount of calls have more influence on the final offline availability score of the configuration. #slices pr X og r am OFFLINE %(pr o g r am) = OF F LI N E %(slicei ) ∗ calls(slicei ) i=1 #slices pr X og r am calls(slicei ) i=1 Note that the calculation of this fitness function is partly based on results from our static analysis tool. Whether a call is local or remote is part of the PDG generated by the analysis. Our current implementation uses the JIPDA abstract interpretation [11] framework. Designing such a fitness function thus requires expert knowledge of our framework and we envision that a number of these are developed upfront for each cross-cutting concern that can be considered. Note that, both the chosen fitness function as well as the strength of the analysis have an impact on the result of executing the algorithm. For example, the current tool we employ for static analysis of the JavaScript code does not fully take into account remote calls from within a program loop. When the client performs a remote call to the server in a loop, this call will be represented in our PDG as only one remote call dependency. A recommender system that tries to minimise inter-tier communication would currently be unable to differentiate between a remote call inside and outside of such a loop. 3:10 L. Philips, J. De Koster, W. De Meuter and C. De Roover Selection Process The creation of a new generation is achieved by performing selections and mutations on the current generation. A mutation consists of randomly picking a slice from the placement mapping and assigning it to a random tier. A selection undertakes a tournament selection, which randomly picks a number of mappings from the current generation and returns the one wth the best fitness value. However, not every generated mapping is a valid one. Consider, for example, a slice that defines a function that is called by a (fixed) server slice and a (fixed) client slice. The slice itself performs no calls to functions defined in another slice. If we place this slice on the client tier, we get a higher offline availability, because the client tier now gains local calls instead of making remote calls. However, the server slice that called the function as well now has to perform a remote call to a slice on the client slice. At runtime, this means that the server instance must pick one or more connected clients to call this function and wait for the result. Because it is not clear whether the local call should be a broadcast to all clients or to a specific client, this is not a valid placement of the slices. If the client performs the call on all clients, what should happen with possible return values from the clients, or in case of a specific client, which client is selected? Please note that the broadcast and reply annotations from Table 6 can be used for server-to-client calls. If the call in the server slice is annotated with one of these annotations the program would be valid. These invalid placements could have a higher fitness score than valid placements, and this is why the selection process is responsible of not selecting these configurations as a base for the next generation. End condition We run the genetic search until either a mapping has been found that produces a fitness equal to 1 or when a certain threshold of generations has been reached. In the latter case, the fittest individual of the latest generation is returned. Because a genetic search is non-deterministic, the result of different runs of the algorithm can yield different placements of the slices. The more generations are considered, the better the final placement will address the concern. 2.5 Recommending slice refinements after assignment After a placement configuration is calculated by the genetic search algorithm an additional step is taken. The result of this step is advice that the programmer can consider to integrate such that the resulting web application can score better on the concern that is under consideration. Our recommendation system currently only supports suggestions for improving offline availability. However, in the future other recommendation functions can be considered. For offline availability, in the recommendation phase, we consider all slices and every data or function declaration made within those slices. Data declarations can either be tied to a tier or be replicated. Generally speaking, replicating data has a positive effect on the offline availability of a web application as it makes sure that the client has a local copy of the data. Therefore, we look for data declarations that are not indicated to be replicated (by means of an annotation), but that are often used 3:11 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps in functions that are called remotely by another tier. For example, we declare data on the server side and define a number of accessors for retrieving and manipulating that data. If these functions are heavily called by the client tier, it might be a better solution to replicate that data such that the client has to communicate less with the server. To detect this, we use the dependencies present in the PDG. We look at every declaration and follow its data dependencies to statements in the same tier. If these statements reside in a function that has more remote calls than local calls, we give the programmer the advice to replicate the data. Function declarations might be a good candidate to move to another tier, or to a new slice, if it is called more by another tier than the one it is defined in. We define more here as the percentage difference between the number of local calls and the number of remote calls to that function is bigger than a certain threshold. To calculate the number of (remote) calls we also use the dependencies in the PDG. If we observe functions that fulfil this requirement, we advice the programmer to move it to a new slice. This way, the recommender system can figure out on which tier(s) the function definition should end up. Listing 6 shows an advice report for the code given in Listing 5. The code is (part) of an implementation of the Uni-corn application where we define two fixed slices: data and browser placed on server and client tier respectively. The server slice declares data collections, as JavaScript arrays, and functions to retrieve and manipulate these collections. The client slice is responsible for the user interface: it defines a set of functions that are called from the HTML part of the application. The client code uses these server-defined functions heavily to retrieve and update the collection’s according to the user’s input. As a consequence, a lot of remote communication transpires and when no connection is within reach, the application becomes impractical and useless for the user. A solution would be to replicate the data, such that the client has a local copy available as well. The helper functions need to be available on the client side as well, so they should be moved to an (unplaced) new slice. The recommender system makes sure that the new slice is put on client and server side, thus reducing the remote communication. This scenario is what the report suggests as well, as can be seen from the output of the recommender system (Listing 6). Listing 5 1 2 3 4 5 6 7 8 9 10 11 12 Listing 6 Advice report for Listing 5 Two fixed slices /* @config data:server, browser: client @slice data */ { var meetings = []; var tasks = []; function getMeetings() {} function getTasks() {} function addMeeting(name, date) {} function addTask(name, priority) {} } /* @slice browser */ { /* Display tasks, meetings and event listeners */ } $ node main.js examples/uni-corn.js Application level of offline availability: 10\,% Consider making following declarations replicated - var meetings - var tasks Consider moving following functions to new slice: - getMeetings - getTasks - addMeeting - addTask In certain cases it would be beneficial to detect these declarations and move them automatically to a new slice. However, if these declarations are defined in a tier with a 3:12 L. Philips, J. De Koster, W. De Meuter and C. De Roover fixed placement, it might be done on purpose by the programmer. If the recommender system automatically makes declarations replicated by adding an annotation on top of it, we might break some validation or security checks that are performed on the functions that manipulate the data. Because the client can never be trusted, the programmer’s intention could be that the data must remain on the server side and is only accessible through these functions. For this reason we only give advice and don’t perform transformations on the fixed slices. 3 Evaluation Our evaluation aims to show that a genetic search algorithm can recommend a good placement strategy for slice-based web development and that our recommender system can further improve upon this by recommending refinements to existing slices. We currently only support offline availability as a cross-cutting concern, but our approach is applicable for other concerns as well. In order to validate our approach we seek to answer the following research questions: RQ1 Can the recommender system identify a location assignment of the slices and recommendations that lead to a web application with a high(er) offline availability? RQ2 Does the slice granularity have an impact on the effectiveness of the recommender system? RQ3 How does our approach compare to other multi-tier approaches with respect to the offline availability of the resulting web applications? We answer these questions based on an evaluation of several implementations of the Uni-corn application as presented in Section 2.1. The application represents several characteristics of a modern, rich internet application: it is a single page app where updates on the data are automatically reflected in the user interface as well, without the need to refresh the page. Moreover, the user is able to update, add and remove tasks or meetings in an offline setting as well. On top of this, the application uses a number of JavaScript libraries. Because offline availability is one of the defining characteristics of today’s web applications, we use this concern as our main goal for the recommender system. This means that in each of the following evaluations we measure and try to maximise the offline availability of the Uni-corn application. The code used for the evaluation is publicly available.³ 3.1 Recommender system for offline availability To evaluate the strength of our recommender system for enabling offline availability we have implemented several versions of the Uni-corn application. We start from a 3 https://github.com/lphilips/multitier-approaches (accessed November 2017) 3:13 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps Table 1 Versions of Uni-corn app ver. 1 2 3 4 5 6 # slices 2 4 4 5 5 6 # fixed slices 2 2 2 2 2 2 @placement 3 5 5 6 6 7 @communication 5 1 5 1 5 0 @sharing 0 6 0 6 0 6 1 [2] + shared data, 1 + 2 slices slice 2 [4] + 1 slice 3 [4] + shared + 1 slice data, 1 slice 4 [5] 5 [5] + 1 slice + shared data, 1 slice 6 [6] Figure 3 Relations between the different versions of Uni-corn app first version that contains only two slices with a fixed placement: one on the client tier, the other on the server tier. In each step we follow all of the recommendation for refinements suggested by our recommendation system. This means we either follow the advice to add data sharing annotations to certain declarations or move certain functions to new slices. We keep doing this until we end up with a version that receives a fitness value of 100 % (In our example, a fitness of 100 % is achievable with the correct placement strategy. However, this is not necessarily true for all applications). In total we have six versions, Figure 3 shows how these versions evolve and Table 1 lists several properties of the code, such as the number of annotations categorised according to Table 6. Every version of the application has at least two slices that are tied to a certain tier and thus have a fixed placement. In the final version these slices contain the smallest subset of the source code that is bound to either the server or client tier. The recommender system is in charge of coming up with a placement of the remaining unplaced slices. For this evaluation we run the genetic search 100 times for each version and analyse the outcomes. Table 2 summarises for each version the minimum, maximum and median number of slices placed on every tier (denoted as minC, maxC and medC respectively for the client tier; minS, maxS and medS for the server tier; minB, maxB and medB for both tiers). It also lists the fitness value for every version, which is the same for the 100 runs, because the search always selects the highest number, but the configuration of the slices can differ between runs. We also specify the number of data declarations that could be replicated (data adv.) according to the recommender system and the number of functions that could be moved to a new slice (slice adv.). 3:14 L. Philips, J. De Koster, W. De Meuter and C. De Roover Table 2 Results of 100 runs of the recommender system ver. 1 2 3 4 5 6 gen. 300 300 300 300 300 1 medC 1 2 1 2 2 2 minC 1 1 1 1 1 1 maxC 1 2 2 2 3 3 medS 1 1 1 1 1 1 minS 1 1 1 1 1 1 maxS 1 1 1 1 1 1 medB 0 1 2 2 2 3 minB 0 1 1 2 1 2 maxB 0 2 2 3 3 4 offline % 10,52 % 66,67 % 68,42 % 85,71 % 68,42 % 100 % data adv 6 0 5 0 5 0 slice adv 13 6 5 3 5 0 The genetic search has the following configuration: the probability for crossover and mutation are both equal to 0.6 ; the maximum number of generations is 300; the size of each generation is 30 individuals. The fitness function and other characteristics of the genetic search are the same as described in Section 2.4. We use a genetic search library for JavaScript.⁴ From Table 2 we can see that following up on the advice has a positive impact on the offline fitness score of the application. Version 6 has a fitness value of 100 %, because more slices have been added and data has been replicated. The versions that have a higher fitness score also place more slices on both client and server tier. Table 1 indicates that adding annotations for replicated data reduces the number of communication annotations that must be used. From this evaluation we can answer the first research question (RQ1). We have successfully used the recommender system to evolve the initial web application to one where the offline availability according to the recommender system’s report is higher than that of the initial application. Integrating the recommender system’s advice leads to an increase of the fitness score. The distribution plan computed by the recommender system that focuses on offline availability clearly prefers to put slices on the client tier or duplicates them between client and server. The different runs of the genetic search on the same version lead to distribution plans that might differ in the number of slices that are put on the client tier or on both. 3.2 Slice granularity Because the recommender system decides on a distribution plan based on the unplaced slices, its effectiveness depends on the programmer to make a program with enough slices. In the ideal case, the fixed slices only contain code that is restricted to one of the tiers and all remaining code is put inside unplaced slices. Table 2 shows that the version of the Uni-corn application with only two slices has a low offline availability score and receives a considerable amount of feedback. For this reason we implemented an extension of our tier splitter that automatically follows up on the advice. For example, if the recommender system indicates that a declaration should be shared, we adapt the original AST of the program such that it now has an @replicated annotation. If the recommendation indicates that a function should be moved to a new slice, we remove the function from its original 4 https://subprotocol.com/system/genetic-js.html (accessed November 2017) 3:15 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps Table 3 Results of automatically integrating the advice ver. 1 2 3 4 5 6 max. for OFFLINE % found after 1 run 1 run 1 run 1 run 1 run 0 runs original nr. of slices 2 4 4 5 5 6 nr. slices in end configuration 15 10 9 8 10 6 slice, add a new slice to the program with no fixed tier and add the function as only expression in that slice. We ran the same experiments as before for the six versions of the Uni-corn app, but in between runs we automatically incorporate the suggestions made by the recommender system, the results are given in Table 3. The results make clear that integrating the advice automatically produces the desired raise in offline availability immediately. In the first version, where only two slices were initially present, 13 new slices were introduced, each defining a function that was advised to be moved to a new slice (as can be seen in table 3). Following the advice concerning replicated data does not result in a new slice, but merely adapts the original code. We can conclude from this table that automatically integrating the advice into the code results in a higher offline availability. This answers the second research question: slice granularity has an impact on the effectiveness of the recommender system. More slices leaves more room for the recommender system to optimise the distribution plan, while few and big slices may lead to inferior results. However, the automatic integration adds a lot of new slices or annotations to the code, thus making it harder for the developer to map the transformed code back to the multi-tier input. As mentioned before, we do not perform these changes automatically but rather give them to the developer as feedback. The reason is that code that was originally in a fixed slice should not always be moved automatically, because the moved portions could contain code that cannot be shared with or moved to another tier. 3.3 Evaluation comparison of the three multi-tier approaches In order to compare the three approaches to multi-tier programming we implemented the Uni-corn application using specific frameworks representative for each approach. For transformation-based multi-tier programming we have our own implementation in Stip.js (we use the final version in Table 1). For library-based approach and languagebased approach we implemented the Uni-corn application in the Meteor framework and the Hop.js language respectively. We chose these two platforms specifically, because they both use JavaScript as a host language and are both actively maintained. Because all three platforms have support for JavaScript and all the utilised libraries, we can reuse the program logic for every implementation. For that reason we can implement the Uni-corn application with three different technologies, without drastically having to change the used libraries or program logic. We implemented the 3:16 L. Philips, J. De Koster, W. De Meuter and C. De Roover Table 4 Meteor Hop.js Stip.js Code characteristics of the three multi-tier Uni-corn applications SLOC SLOC client SLOC server SLOC ui 590 579 468 300 239 115 27 360 30 263 192 SLOC undecided 0 0 131 annotations/ library calls 19 28 13 three versions with the libraries or language constructs that are available, without writing our own extensions or packages. The code of the three versions is compared by means of number of source lines of code (SLOC) and the number of tier-switching or tier-specific annotations or calls to libraries. This gives us an insight how much effort is required from the programmer to enable remote communication, data sharing or getting offline availability. The runtime characteristics are used to measure the actual offline availability of the resulting applications by looking at the actual remote communication performed between server and client, the amount of data transferred, etc. Code characteristics For every implementation we count the total SLOC for server, client and UI code as well. For the Stip.js version we have code that belongs to slices that are not assigned to a tier, so we count that code as undecided. As can be seen, the three versions fall into the same category for the total number of SLOC. However, the Hop.js variation focuses more on the server part, while the two other implementations have a small server setup. Please note that for the Stip.js version this is not the only code for the server tier: parts of the undecided code could be server-side code as well. We also enumerated the number of annotations: these are the tier-switching operators ˜and $ for Hop.js and any annotation from Table 6 for Stip.js. For the library-based version there are no annotations present, because all the tier information is hidden away in the usage of the framework’s libraries. For that reason we counted the number of calls to libraries for data sharing, reactive updates, and so on. The Hop.js version has significantly more annotations to escape from the server to client tier and vice versa. Runtime characteristics We evaluate the three multi-tier variants of the Uni-corn app through several scenarios. Because the app offers four services to the user, we first evaluate these services individually in an online and offline setting. This means that we view, add and update meetings and tasks and view the schedule and charts. We measure the number of requests that are made, the number of failed requests and kilobytes transferred. Then we look how many steps of the scenario succeeded: i.e., the application produces the correct results. For example, adding a new meeting should first of all not produce an error and the entered data should not be lost, even in an offline setting. Moreover, the meeting should be added to the list of meetings and the user should be able to retrieve the details of the meeting to alter it later on. The results of evaluating the different services this way can be found in Appendix B. We did the same for three scenarios, given in Table 8 in Appendix B, that combine more of the services, e.g., adding a task and viewing the progress charts later on. 3:17 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps Table 5 Results for the three scenarios from Table 8 number of requests failed requests Meteor Hop.js Stip.js 6 10 16 2 4 0 Meteor Hop.js Stip.js 6 ? 24 2 ? 0 Meteor Hop.js Stip.js 6 10 8 0 7 0 failed requests total requests Scenario 1 33,3 % 40 % 0% Scenario 2 33,3 % ?% 0% Scenario 3 0% 70 % 0% successful steps total steps kb transferred number of steps 4,63 46,2 2,959 7 7 7 100 % 71,4 % 100 % 4,83 ? 3,769 7 7 7 100 % ?% 100 % 1,185 10 1,043 6 6 6 100 % 0% 100 % To measure these characteristics we used Chrome Developer Tools on Google Chrome browser, version 56. To inspect network traffic for the Meteor version we used Meteor Devtools,⁵ because Meteor uses its own communication protocol that can’t be inspected via Chrome Developer Tools. As can be seen from Table 5, both Meteor and Stip.js perform the different steps correctly, even in an offline setting. This means that no errors were shown to the user, no data loss occurred, and the user was actually unaware of the lost connection. The reason is that Meteor has replicated Collections that buffer every change on the client side to send to the server when the connection is restored. A significant change between the different approaches can be seen in the number of requests performed: the Stip.js version performs more requests in the first two scenarios. This is because the run-time library for remote communication and data sharing⁶ works on a fine-grained level when changes to a replicated are made: every property change on a replicated object is sent to the server. For example, two changes are communicated when adding an element to a replicated array: one for the index on which the object is added and one for the length that has changed. The library we use is smart enough to keep track of the connection with the server through a heart-beat system, such that communication is automatically buffered when no connection is present and thus produces no failed requests. Another consequence of having replicated data available on the client is that fewer kilobytes need to be transferred. One scenario in the Hop.js version could not be performed (indicated by a question mark), because the Hop.js compiler cannot integrate the JavaScript library that renders the calendar. We notified the authors of this issue, but the problem persists at the time of writing. In the Hop.js version the HTML content is rendered on the server side, this resulting in larger data size transferred. At the time of writing, Hop.js has no support for data replication or reactive UI updates, so updates and retrieving the data in an 5 https://github.com/bakery/meteor-devtools (accessed November 2017) 6 https://github.com/lphilips/asyncCall-with-shared-data (accessed November 2017) 3:18 L. Philips, J. De Koster, W. De Meuter and C. De Roover offline setting do not work. Both the Meteor and and Stip.js versions only have to communicate the changes made to the replicated objects and the user interface is updated automatically. This table shows that certain multi-tier approaches excel at optimising certain crosscutting concerns. However, focusing on other crosscutting concerns often force the developer to extend the framework or language by hand. The Meteor framework scores highly on offline availability for the reason that its built-in Collections are replicated to every client. The Hop.js language has no support yet for data replication and offline availability, thus leading to more communication to the server that fails when no connection is at one’s disposal. Both the runtime and code characteristics of the three versions of the Uni-corn application gives us an answer to the third research question. For this application the code characteristics are comparable, although Stip.js requires less lines of code and annotations. On the other hand, Stip.js is not tailored towards runtime optimisation, resulting in more actual web requests that are performed. On the other hand, because the resulting application focuses on offline availability, less data is transferred with each request. The language-based multi-tier approach is not tailored towards offline availability, resulting in all data in the shared collections to be transferred each time. Threats to validity For the motivating example, this evaluation shows that the recommender system can successfully help the developer to achieve full offline availability. However, we were also able to manually achieve full offline availability for the motivating example. Whether or not our recommender system is better at finding placement strategies than a manual approach, or whether our recommender system can help developers find an optimal strategy faster would require an extensive user study for much larger applications. Additionally, the evaluation currently only covers offline availability as a single-objective optimisation. To show that the approach is also applicable to other single- and multi-objective optimisations would require additional exploration. Finally, the evaluation compares the approach with two other tierless programming platforms. A complete comparison that covers a wider range of platforms would strengthen our comparison with the related work. 4 Related Work Current techniques that infer a distributed placement mostly focus on minimising the communication cost between the distributed tiers of the application. When implemented on top of a new language, the placement analysis is often guided by primitive operations: e.g., all gui_... operations must be allocated on the client tier. From there on the location analysis propagates throughout the program and assigns each operation/declaration to a set of possible tier locations. We give an overview of approaches that can be used for web applications, but most of them handle distributed applications in general. 3:19 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps 4.1 Multi-tier Approaches We classify multi-tier approaches in three main categories: language-based, librarybased and transformation-based approaches. Library-based and transformation-based approaches target a general-purpose language instead, thus facilitating the reuse of existing developer tools. We now discuss multi-tier approaches that support a location analysis to assign expressions to a tier. The multi-tier language Opa [4] supports annotations to indicate where functions or data should be located. In addition, Opa’s slicer takes the type information and makes a call graph to decide which function/values end up on what tier. By default values appear on both tiers whenever possible, but are constrained by security concerns or the behaviour they execute. DOM-related operations end up on the client whereas database operations are always placed on the server tier. It is not clear how the slicer makes the decision and what the goal of the placement algorithm is. In contrast with Opa, our approach is extensible such that the programmer can try out different location strategies. These location decisions are deeply embedded in Opa’s slicer and the programmer must first test the slicer’s result before adding more specific annotations to influence the decisions made by the slicer. Distributed Orc [17] is a distributed extension of the Orc programming language. The language introduces location transparency by not abstracting away distributed concerns, but by explicitly making local and remote semantics uniform. As a consequence, asynchronous calls and failure handling are consistent throughout the whole program, even for local operations. Its location analysis uses the locations of data and decides when data is used whether it is by using a copy of that data, migrating the execution to another location or another manner. It is ongoing research at this point and the authors state that it remains an open question whether there is a profit in communication costs when using these optimisers. At the moment the programmer cannot give an initial or partial distribution specification and it is not clear which analysis would drive the distribution decisions. The placement inferencer for a client-server calculus presented in [9, 10] is guided by the fixed placement of primitive operators. The location analysis allocates every operation to a set of locations and propagates these assignments through the program. This technique does not require the programmer to give an initial seed to the placement decision algorithm, as many others, amongst which Stip.js, do require. However, this approach is not applicable to general-purpose languages. For example, primitive operators to update the DOM could easily be renamed or this could be achieved by means of an external library. It is a difficult task to automatically infer this and an initial seed is thus necessary when targeting general-purpose languages. 4.2 Location Transparency Location transparency abstracts away the place of execution of certain parts of a distributed program. Several languages and frameworks therefore hide the semantics of remote communication between these parts and support a uniform way of communication. Location transparency has been criticised [18], mainly because concerns such 3:20 L. Philips, J. De Koster, W. De Meuter and C. De Roover as latency, memory access, partial failures, concurrency, etc. should not be abstracted away from the programmer. The reason is that remote calls have a fundamentally different semantics to local calls, and thus fundamentally different failure handling code must be provided by the programmer as well. Many distributed languages support mobility of distributed components, thus decoupling the components in space by communicating in an asynchronous way. Actors are an example of such decoupled components [7]. Erlang [1] is an example of a programming language that supports location transparent actors. Every actor has a unique address and can be accessed through an actor reference. There is no differentiation between local or remote actor references, and all inter-actor communication is done via asynchronous message passing. Modular design is a field of software engineering that is present in many programming languages and architectures. Remote-OSGi (or R-OSGi) [14] uses centralised module management as a starting point for distributed Java applications. Modules are the units of distribution that implement a service-oriented architecture. Local and remote service invocation is indistinguishable, and communication failures are handled as local module events. Our approach offers location transparency, because the execution location of parts of the program is decoupled from the code itself. Just as other approaches we support a uniform way of communication, opting for local communication. It is the burden of the transformation tool to transform local to remote communication. However, issues such as failure handling are not completely abstracted away from the programmer, but are added by means of annotations. These annotations work for communication that stays local and the communication that is transformed to remote calls. 4.3 Automatic Partitioning Code partitioning is a process that computes a mapping from code partitions to the nodes of a distributed system. This process can take several factors into account, such as the hardware characteristics of certain nodes, profiling information, etc. Coing [5] is an automatic partitioning system for distributed applications that consist out of components. The partitioning depends on a graph representation of the remote communication based on scenario-based profiling. The profiling step gathers information while the user runs the application but an automated testing tool can be used as well. All communication that crosses the boundaries of the components is instrumented, together with the amount of transferred data. A graph slicing algorithm is then applied to split the application and come up with the most optimal placement of components. While the programmer can tweak the results, overriding the distribution decisions seems not possible. Coign resembles the approach taken by Stip.js, but we use a static analysis instead of scenario-based profiling. The recommender system of Stip.js could use the profiling and instrumentation step of Coign, possibly leading to a more accurate report. Secure program partitioning [20] is a splitting process that protects confidentiality of data in a distributed application. The splitter takes an annotated program and a set of trust declarations and produces programs that satisfy all security policies. This 3:21 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps automated partitioning enables the programmer to write a program independent of its distributed setting, but with strong guarantees about the flow information. The partitioning has been extended with data and code replication [21], to increase the flexibility of the splitter but keeping the same guarantees meanwhile. The emphasis of the work is on security and respecting user-defined security contracts. In contrast to our approach, expressing contracts for other crosscutting concerns is not supported. 5 Discussion and Future Work Our approach employs a non-deterministic search algorithm in order to prune the search space for potential placement configurations. However, for applications with a small number of slices a deterministic approach could be used. In our example, the non-deterministic strategy was able to successfully get to an ideal placement with a fitness of 1. However, additional experiments are required to further strengthen our claim that a genetic search algorithm is a good fit for finding placement strategies. Also, additional experiments need to be conducted to validate whether this approach does not land in local optima when exploring the search space. We also currently have not experimented with different versions of the fitness function. We currently have only explored offline availability as a cross-cutting concern. However, we believe that our framework can easily be extended to other cross-cutting concerns such as memory usage, security, communication cost, etc. By adding the appropriate fitness function and extending the recommender in order to incorporate advice that is specific to that cross-cutting concern. Our fitness function for offline availability now employs the results of our static analysis in order to evaluate different configurations. However, for other fitness functions, this can be changed to also include a runtime analysis or other information into account. 6 Conclusion In most tierless programming languages or frameworks today communication between different tiers is marked with an explicit boundary between source code fragments. This means that developers are required to think upfront about the placement of the different components of their application. Moreover, several non-functional, cross-cutting concerns such as offline availability and security are impacted by this placement strategy. This means that changing the placement of certain code fragments in order to improve on some of these concerns over time becomes impractical. All of these concerns have to be taken into account in the initial design of the application. This leads to applications that are hard to maintain. The main contribution of this paper is slice-based web development as a tier-agnostic development strategy. The placement of different slices onto the different tiers can be done separately. We show that such a configuration can be used to tackle several cross-cutting concerns without the need to significantly change the original source 3:22 L. Philips, J. De Koster, W. De Meuter and C. De Roover code. Moreover, we show that a recommender system can be built to automatically suggest a placement strategy to optimise for certain concerns. Our recommender suggest a specific placement of the different slices onto the different tiers and gives advice for slice refinements. Such advice could be to add annotations in the code, move certain parts of the code to a new slice, etc. Additionally, we provide a preliminary evaluation of our approach by applying it to our motivating example (the uni-corn app) for one specific cross-cutting concern, namely offline availability. We start from an implementation with the minimal number of slices, one for the client and one for the server and gradually incorporate the feedback from our recommender system. The results of our evaluation show that our recommender system can successfully help developers optimise for offline availability. We also assessed the slice granularity and what impact this has on the results. To evaluate our approach compared to the state of the art in tierless programming, the uni-corn application is also implemented in a library-based and language-based approach. We scrutinised the runtime and code characteristics of the three implementations and how they handle the offline availability concern. We conclude that the slices in combination with a recommender system allow the programmer to focus on the application logic and takes the burden away of distributing the code by hand. The effectiveness of the recommender system is conditional on the slice granularity, and we showed that applying automatic transformations to fix this can be beneficial. 3:23 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps References [1] Joe Armstrong. Programming Erlang: Software for a Concurrent World. Pragmatic Bookshelf, 2007. isbn: 978-1-934-35600-5. [2] Adam Chlipala. “Ur/Web: A Simple Model for Programming the Web”. In: Proceedings of the 42Nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL ’15. Mumbai, India: ACM, 2015, pages 153–165. isbn: 978-1-450-33300-9. doi: 10.1145/2676726.2677004. [3] Ezra Cooper, Sam Lindley, Philip Wadler, and Jeremy Yallop. “Links: Web Programming Without Tiers”. In: Proceedings of the 5th International Conference on Formal Methods for Components and Objects. FMCO’06. Amsterdam, The Netherlands: Springer-Verlag, 2007, pages 266–296. isbn: 978-3-540-74791-8. doi: 10.1007/978-3-540-74792-5_12. [4] Ida Swarczewskaja Henri Binsztok Adam Koprowski. Opa: up and running. O’Reilly Media, 2013, page 164. isbn: 978-1-449-32885-6. [5] Galen C. Hunt and Michael L. Scott. “The Coign Automatic Distributed Partitioning System”. In: Proceedings of the Third Symposium on Operating Systems Design and Implementation. OSDI ’99. New Orleans, Louisiana, USA: USENIX Association, 1999, pages 187–200. isbn: 1-880446-39-1. [6] Federico Kereki. Essential GWT: Building for the Web with Google Web Toolkit 2. Addison-Wesley Professional, 2010. isbn: 978-0-321-70514-3. [7] Woo Young Kim and Gul Agha. “Efficient support of location transparency in concurrent object-oriented programming languages”. In: Supercomputing, 1995. Proceedings of the IEEE/ACM SC95 Conference. IEEE. 1995, pages 39–39. doi: 10.1109/SUPERC.1995.241389. [8] Dragos Manolescu, Brian Beckman, and Benjamin Livshits. “Volta: Developing Distributed Applications by Recompiling”. In: IEEE Software 25.5 (Sept. 2008), pages 53–59. issn: 0740-7459. doi: 10.1109/MS.2008.131. [9] Matthias Neubauer and Peter Thiemann. “From Sequential Programs to Multitier Applications by Program Transformation”. In: Proceedings of the 32Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL ’05. Long Beach, California, USA: ACM, 2005, pages 221–232. isbn: 1-581138-30-X. doi: 10.1145/1040305.1040324. [10] Matthias Neubauer and Peter Thiemann. “Placement Inference for a ClientServer Calculus”. In: Automata, Languages and Programming: 35th International Colloquium, ICALP 2008, Reykjavik, Iceland, July 7-11, 2008, Proceedings, Part II. Edited by Luca Aceto, Ivan Damgård, Leslie Ann Goldberg, Magnús M. Halldórsson, Anna Ingólfsdóttir, and Igor Walukiewicz. Berlin, Heidelberg: Springer Berlin Heidelberg, 2008, pages 75–86. isbn: 978-3-540-70583-3. doi: 10.1007/978-3-540-70583-3_7. 3:24 L. Philips, J. De Koster, W. De Meuter and C. De Roover [11] Jens Nicolay, Carlos Noguera, Coen De Roover, and Wolfgang De Meuter. “Detecting function purity in JavaScript”. In: Source Code Analysis and Manipulation (SCAM), 2015 IEEE 15th International Working Conference on. IEEE. 2015, pages 101–110. doi: 10.1109/SCAM.2015.7335406. [12] Laure Philips, Wolfgang De Meuter, and Coen De Roover. “Tierless Programming in JavaScript”. In: Proceedings of the 37th International Conference on Software Engineering - Volume 2. ICSE ’15. Florence, Italy: IEEE Press, 2015, pages 831–832. doi: 10.1109/ICSE.2015.270. [13] Laure Philips, Coen De Roover, Tom Van Cutsem, and Wolfgang De Meuter. “Towards Tierless Web Development Without Tierless Languages”. In: Proceedings of the 2014 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software. Onward! 2014. Portland, Oregon, USA: ACM, 2014, pages 69–81. isbn: 978-1-450-33210-1. doi: 10.1145/2661136.2661146. [14] Jan S. Rellermeyer, Gustavo Alonso, and Timothy Roscoe. “R-OSGi: Distributed Applications Through Software Modularization”. In: Middleware 2007: ACM/IFIP/USENIX 8th International Middleware Conference, Newport Beach, CA, USA, November 26-30, 2007. Proceedings. Edited by Renato Cerqueira and Roy H. Campbell. Berlin, Heidelberg: Springer Berlin Heidelberg, 2007, pages 1–20. isbn: 978-3-540-76778-7. doi: 10.1007/978-3-540-76778-7_1. [15] Manuel Serrano and Vincent Prunet. “A Glimpse of Hopjs”. In: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming. ICFP 2016. Nara, Japan: ACM, 2016, pages 180–192. isbn: 978-1-450-34219-3. doi: 10.1145/2951913.2951916. [16] Isaac Strack. Getting started with Meteor.js JavaScript framework. Packt Publishing, 2012, page 130. isbn: 978-1-782-16083-0. [17] John A. Thywissen, Arthur Michener Peters, and William R. Cook. “Implicitly Distributing Pervasively Concurrent Programs: Extended Abstract”. In: First Workshop on Programming Models and Languages for Distributed Computing. PMLDC ’16. Rome, Italy: ACM, 2016, 1:1–1:4. isbn: 978-1-450-34775-4. doi: 10.1145/2957319.2957370. [18] Jim Waldo, Geoff Wyant, Ann Wollrath, and Sam Kendalll. A Note on Distributed Computing. Technical report. IEEE Micro, 1994. [19] Mark Weiser. “Program Slicing”. In: Proceedings of the 5th International Conference on Software Engineering. ICSE ’81. San Diego, California, USA: IEEE Press, 1981, pages 439–449. isbn: 0-897911-46-6. doi: 10.1109/TSE.1984.5010248. [20] Steve Zdancewic, Lantian Zheng, Nathaniel Nystrom, and Andrew C. Myers. “Secure Program Partitioning”. In: ACM Transactions on Computer Systems 20.3 (Aug. 2002), pages 283–328. issn: 0734-2071. doi: 10.1145/566340.566343. 3:25 Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps [21] Lantian Zheng, Stephen Chong, Andrew C. Myers, and Steve Zdancewic. “Using Replication and Partitioning to Build Secure Distributed Systems”. In: Proceedings of the 2003 IEEE Symposium on Security and Privacy. SP ’03. Washington, DC, USA: IEEE Computer Society, 2003, pages 236–250. isbn: 0-769519-40-7. doi: 10.1109/SECPRI.2003.1199340. 3:26 L. Philips, J. De Koster, W. De Meuter and C. De Roover A Tier-specific annotations present in previous work Table 6 Supported annotations. The bottom row designates what type of statements the annotations can be placed on. location-based @client @server @ui block level B communication @remoteCall @localCall @blocking @reply @remoteProcedure call or function level replication @local @copy @replicated @observable failure handling @defineHandler @useHandler declaration level tier or call level Scenario-based evaluation Table 7 Runtime results for the individual services of the Uni-corn app. number of requests meteor hop.js Stip.js 2 5 5 meteor hop.js Stip.js 2 3 0 meteor hop.js Stip.js 2 5 6 meteor hop.js Stip.js 2 3 0 meteor hop.js Stip.js 0 ? 0 meteor hop.js Stip.js 0 ? 0 meteor hop.js Stip.js 2 3 0 meteor hop.js Stip.js 0 3 0 failed requests failed requests total requests kb transferred Tasks: view, add, update 0 0% 1,083 0 0% 20,8 0 0% 0,96 Tasks offline: view, add, update 0 0% 0,32 3 100 % 0 0 0% 0 Meetings: view, add, update 0 0% 1,185 0 0% 10 0 0% 1,41 Meetings offline: view, add, update 0 0% 0,498 3 100 % 0 0 0% 0 Schedule: view 0 0% 0 ? ?% ? 0 0% 0 Schedule offline: view 0 0% 0 ? ?% ? 0 0% 0 Charts: view 0 0% 1,083 0 0% 744 0 0% 0 Charts offline: view 0 0% 0 3 100 % 0 0 0% 0 3:27 number of steps successful steps total steps 3 3 3 100 % 100 % 100 % 3 3 3 100 % 33 % 100 % 3 3 3 100 % 100 % 100 % 3 3 3 100 % 33 % 100 % 1 ? 1 100 % ?% 100 % 1 ? 1 100 % ?% 100 % 1 1 1 100 % 100 % 100 % 1 1 1 100 % 0% 100 % Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Apps Table 8 step 1 2 3 4 5 6 7 8 9 Individual steps of three scenarios for evaluating the Uni-corn application Scenario 1 View all tasks Add a new task Update the newly added task Go offline Add a new task Update the newly added task View the charts section Go online View all tasks Scenario 2 View all meetings Add a new meeting Update the newly added meeting Go offline Add a new meeting Update the newly added meeting View the calendar section Go online View all meetings 3:28 Scenario 3 Go offline View all tasks Add a new task View all meetings Add a new meeting View the charts section Go online View the charts section L. Philips, J. De Koster, W. De Meuter and C. De Roover About the authors Laure Philips is a PhD student at the Software Languages Lab, Vrije Universiteit Brussel in Belgium. Currently her main research area is web programming and more concretely tierless or multitier web programming. The first fruits of this research is Stip.js, a tier-splitting tool for tierless JavaScript code. Contact her at [email protected] Joeri De Koster is Assistant Professor at the Software Languages Lab of the Vrije Universiteit Brussel in Belgium. He obtained the degree of Master of Science in Applied Sciences and Engineering: Computer Science in 2009 from the VUB and the degree of Doctor of Philosophy in Sciences: Computer Science in 2015 from the same institute. His current research interest lie in the design and implementation of programming languages for concurrent programming, big data processing, reactive programming and web development. Contact him at [email protected] Wolfgang De Meuter is a professor at the Software Languages Lab, Vrije Universiteit Brussel in Belgium. Contact him at wdmeuter@ vub.be Coen De Roover is a professor in Software Engineering at the Software Languages Lab of the Vrije Universiteit Brussel in Belgium. His research in program analysis and transformation techniques focuses on their design for modern programming paradigms (e.g., event-driven, actor-based, . . . ) as well as on their application to problems in software quality (e.g., bug detection, program renovation, change recommendation, . . . ). Contact him at [email protected] 3:29
6cs.PL
False Discovery Rate Control via Debiased Lasso Adel Javanmard∗ and Hamid Javadi† arXiv:1803.04464v1 [stat.ME] 12 Mar 2018 March 14, 2018 Abstract We consider the problem of variable selection in high-dimensional statistical models where the goal is to report a set of variables, out of many predictors X1 , . . . , Xp , that are relevant to a response of interest. For linear high-dimensional model, where the number of parameters exceeds the number of samples (p > n), we propose a procedure for variables selection and prove that it controls the directional false discovery rate (FDR) below a pre-assigned significance level q ∈ [0, 1]. We further analyze the statistical power of our framework and show that for designs with subgaussian rows and a common precision matrix Ω ∈ Rp×p , if the minimum nonzero parameter θmin satisfies s   √ 2p nθmin − σ 2(max Ωii ) log → ∞, qs0 i∈[p] then this procedure achieves asymptotic power one. √Our framework is built upon the debiasing approach and assumes the standard condition s0 = o( n/(log p)2 ), where s0 indicates the number of true positives among the p features. Notably, this framework achieves exact directional FDR control without any assumption on the amplitude of unknown regression parameters, and does not require any knowledge of the distribution of covariates or the noise level. We test our method in synthetic and real data experiments to asses its performance and to corroborate our theoretical results. 1 Introduction Living in the era of data deluge, modern datasets are often very fine-grained, including information on a large number of potential explanatory variables. For a given response of interest, we know a priori that a large portion of these variables are irrelevant and would like to select a set of predictors that influence the response. For example, in genome-wide association studies (GWAS), we collect single nucleotide polymorphism (SNP) information across a large number of loci and then aim at finding loci that are related to the trait, while being resilient to false associations. The focus of this paper is on high-dimensional regression models where the number of parameters exceeds the sample size. Such models are over-parameterized and hence are prone to overfitting. Moreover, high-dimensionality brings noise accumulation and spurious correlations between response ∗ Data Sciences and Operations Department, Marshall School of Business, University of Southern California, Email: [email protected] † Department of Electrical Engineering, Stanford University. Email: [email protected] 1 and unrelated features, which may lead to wrong statistical inference and false predictions. Model selection is therefore a crucial task in analyzing high-dimensional models. For a successful model selection, we need to assure that most of the selected predictors are indeed relevant. This not only leads to noise reduction and enhances predictions but also offers reproducibility. To be concrete in using the term “reproducibility”, we characterize it for statistical inference problem by using the false discovery rate (FDR) criterion, which is the expected fraction of discoveries that are false positives. The notion of FDR has been proposed by the groundbreaking work [BH95] and nowadays is the criterion of choice for statistical inference in large scale hypothesis testing problem. In their work, Benjamini and Hochberg developed a procedure to control FDR under a pre-assigned significance level. It has been shown theoretically that BH procedure controls FDR in some special cases such as independence or positive dependence of tests [BH95, BY01]. Since initially proposed, there have been various modifications of BH [BY01, SRC+ 15, FHG12, Wu08, XCML11] and its applications in different domains [RYB03, GLN02]. Importantly, BH procedure (and its modifications) assumes that p-values are given as input for all the hypothesis tests. The p-values are often calculated using classical formula obtained by using largesample theory which are theoretically justified only for the classical setting of fixed dimensionality p and diverging sample size n [VdV00]. However, for high-dimensional models obtaining valid pvalues is highly nontrivial. This is in part due to the fact that fitting high-dimensional model often requires the use of nonlinear and non-explicit estimation procedures and characterizing the distribution of such estimators is extremely challenging. In the past couple years, there has been a surge of interest in constructing frequentist p-values and confidence intervals for high-dimensional models. A common approach is the fundamental idea of debiasing which was proposed in a series of work [JM14b, ZZ14, JM14a, VdGBRD14]. In this approach, starting from a regularized estimator one first constructs a debiased estimator and then makes inference based on the asymptotic normality of low-dimensional functionals of the debiased estimator. This approach also provides asymptotically valid p-values for hypotheses testing each of the parameters in the model. However, these p-values are correlated and the BH procedure is not guaranteed to control FDR in this case. The modification of BH for general dependency, that scales the significance level by 1/(log p) factor [BY01], also turns out to be overly conservative and leads to a low statistical power. In this paper, we built upon the debiasing approach and propose a procedure to control FDR for high-dimensional model. Indeed, we prove that it controls a stronger criterion, namely directional FDR. We call our procedure FCD (for “FDR Control via Debiasing”) and analyze its statistical power. To address the problem of FDR control in regression model, [BC15] originally proposed the ingenious idea of knockoff filter. In a nutshell, the idea is to construct a set of “knockoff” variables that are irrelevant to response (conditional on the original covariates) but whose structure mirrors that of the original covariates. The knockoff variables then behave as the controls for original covariates. This way, they bypass the need of constructing p-values and directly select a model with the desired FDR. The focus of [BC15] was on linear regression model with n > 2p. Later, [CFJL18] extended the idea of knockoff filter to high-dimensional nonlinear models, but assumes that the joint distribution of covariates is known. Very recently, [FDLL17, BCS18] studies robustness of model free knockoff to errors in estimating the joint distribution of covariates. One advantage that our FCD framework offers over knockoff method is that other than controlling directional FDR, it also provides p-values for the model coefficients. 2 1.1 Problem Formulation Suppose we have recorded n i.i.d observational units (y1 , x1 ), . . . , (yn , xn ), with yi ∈ R representing response variables and xi ∈ Rp indicating the vector of explanatory variables on each sample, also referred to as features. We assume the classical linear regression model where the observations obey the following relation: yi = hθ0 , xi i + wi , (1) Here, θ0 ∈ Rp is the unknown vector of coefficients and noise wi is independent of xi . The symbol h·, ·i denotes the standard inner product. We assume that the noise variables wi are independent with E(wi ) = 0 , E(wi2 ) = σ 2 , E(|wi |2+a ) ≤ Cσ 2+a , (2) for some constants C > 0, a > 2. Let y = (y1 , . . . , yn )T and let X ∈ Rn×p denote the feature matrix T that have xT 1 , . . . , xn as rows. Then writing the linear regression model in matrix form, we obtain y = Xθ0 + w , (3) We let S ⊆ {1, . . . , p} denote the set of truly relevant feature variables among the many that have been recored. This set corresponds to the support to θ0 , i.e., S ≡ supp(θ0 ) = {1 ≤ i ≤ p : θ0,i 6= 0} . (4) We let s0 = |S| be the size of support or in other words the number of true positives. In this paper, we propose a framework to select a set Sb of the feature variables, while controlling the directional false discovery rate (FDR) for the selected variables. This criterion is intimately rated to type S errors (S stands for sign). Type S error (a.k.a type III error) occurs when we say, with confidence, that a comparison goes one way while it goes the other way [GT00]. For example, we claim that θ1 > θ2 , with confidence, while in fact θ1 < θ2 . In other words, we mistakenly make a claim on the sign (direction) of θ1 − θ2 . Gelman et. al. [GT00] argue that type S error is a more relevant notion in many applications. Tukey also conveys a similar message in [Tuk91] by arguing that the effects of A and B, for any A and B, are always different (in some decimal precision) and hence instead of questioning whether there is any difference in two effects, the valid question should be about the direction in which effect of A differs from that of B. Motivated by this, we formally define directional FDR, denoted by FDRdir . For a selected set Sb d j ∈ {−1, +1} of the sign of θ0,j , we define of the features along with estimates sign FDRdir = E[FDPdir ] , FDPdir = dj = |{j ∈ Sb : sign 6 sign(θ0,j )}| , b 1) max(|S|, (5) where we adopt the convention sign(0) = 0. In words, FDRdir is the expected fraction of false discoveries among the selected ones, where a false discovery is measured with respect to type S and d j = +1, while θ0,j = 0 (type I error) or θ0,j < 0 (type S error), it is type I errors. For example if sign considered as a false discovery. 3 Recall that the classical FDR is defined as   |{j ∈ Sb : θ0,j 6= 0}| , FDR = E b 1) max(|S|, (6) that defines the false discoveries only with respect to type I error. Therefore, a comparison of definitions (5) and (6) reveals that FDRdir ≥ FDR , (7) b As a result, proving that a framework controls FDRdir automatically implies for any selected set S. that it also controls FDR. Likewise, we define the statistical power of a selected set Sb as  d j = sign(θ0,j )}|  |{j ∈ Sb : sign Power = E , max(|S|, 1) (8) i.e., for a true discovery not only the corresponding variable should be in fact non-zero but we should also declare its sign correctly. The directional FDR has been also studied by [BC16] and it is shown that the knockoff filter also controls this metric as well as the FDR. 1.2 Our Contributions and Outline of the Paper Here, we provide a vignette of our contributions: Controlling directional FDR In Section 2, we propose a method for selecting relevant variables using the debiasing approach. We use the acronym FCD to call this method (standing for “FDR Control via Debiasing”). In Section 3, we show that for design matrices with subgaussian rows, √ under the standard condition s0 = o( n/(log p)2 ) and proper conditions on the population precision matrix, the FCD framework controls directional FDR. (See Theorem 3.1 for a formal statement). Characterizing the statistical power In Section 4, we characterize the statistical power of the FCD method. In particular, we show that if the minimum nonzero coefficient, θmin satisfies s   √ 2p nθmin − σ 2(max Ωii ) log → ∞, qs0 i∈[p] then FCD achieves asymptotic power one. Recently, [FDLL17] has studied the power of model p free knockoff filter and showed that it achieves asymptotic power one provided that θmin n/(log p) → ∞ and assuming a lower b ≥ cs0 , for bound on the size of the model selected by the knockoffs procedure. Namely, if |S| −1 some constant c ∈ (2(qs0 ) , 1). This condition, p however, is hard to verify and a sufficient given condition is that the size of {j : |θ0j |  s0 (log p)/n} is at least cs0 , for some constant c ∈ (2(qs0 )−1 , 1). This condition on the amplitude of nonzero coefficients is much stronger that the one we need for FCD to achieve power one. 4 Numerical validation We validate our approach on both synthetic and real data in Sections 5 and 6 and compare its performance with the model free knockoff. As the simulations suggest, FCD method compares favorably to the model free knockoff in a wide range of setups. We also compare the statistical power of FCD with the theoretical characterization and show that they are in good agreement. 1.3 Further Related Work There exists a copious theoretical literature developed on high-dimensional regression and the Lasso. Most existing studies have focused on prediction error [GR04], model selection properties [MB06, ZY06, Wai09, CP09], estimation consistency [CT05, BRT09]. For exact support recovery, it was known early on that, even in the classical setting of fixed p and diverging n, support of Lasso will be different from S (support of true signal) unless the columns of X, with index in S, are roughly orthogonal to the ones with index outside S [KF00]. This assumption is formalized under the socalled ‘irrepresentability condition’. In a seminal work, Zhao and Yu [ZY06] show that this condition also allows exact support recovery in the high-dimensional setting (p  n). Independently, [MB06] studied model selection problem for random Gaussian designs, with applications to learning Gaussian graphical models. These papers consider the setting of s0 = O(nc ), for some c < 1. Further, under √ a normalization of design such that its columns have norm at mostp n, they require the minimum nonzero amplitude of the signal θmin = mini∈S θ0,i to satisfy θmin > c s0 /n. Later, [Wai09] improved these results for the case of random Gaussian designs and showed that for a broad p range of covariance matrices, the Lasso can recover the support of a signal for which θmin > cσ (log p)/n. The model selection problem was also studied under the weaker, generalized irrepresentability condition, for the Gauss-Lasso estimator [JM13]. As an alternative to irrepresentability condition, [Lou08] proves the exact model selection under b ij = O(1/s0 ). This assumption is however stronger an incoherence assumption, namely maxi6=j Σ than irrepresentability condition [vdGB09]. As discussed in the introduction, related to the model selection is the problem of hypothesis testing for high-dimensional regression. In [ZZ11, Büh12], authors consider null hypotheses of form p H0,i : θ0,i = 0 and propose methods that achieve a given power 1 − β, if |θ0,i | > cβ σ s0 (log p)/n. Later, [JM14b] proposed a method for random Gaussian designs, with known covariance, under the setting s/p → ε and n/p → δ, for constants ε, δ ∈ (0, 1). The proposed method achieves a given power √ 1 − β, conditional on that |θ0,i | > cβ σ/ n. The debiasing approach [ZZ14, JM14a, VdGBRD14] also √ has been proposed to test H0,i in the high-dimensional setting, with s0 = o( n/(log p)). In [JM14a], it is shownp that the debiasing based framework for testing H0,i achieves a given power 1 − β, if θmin > cβ σ (log p)/n. Applicability of the debiasing approach is extended to the setting of s0 = o(n/(log p)2 ), for random Gaussian designs, using a ‘leave-one-out’ technique [JM18]. 1.4 Notations Here, we provide a summary of notations used throughout this paper. We use [p] = {1, . . . , p} to refer to the first p integers. For a vector v, we denote its coordinates by vi and let vS be the restriction of v to indices in set S. Further, the term support of a vector indicates the nonzero coordinates of that vector, i.e., supp(v) = {i ∈ [p] : vi 6= 0}. We use I to denote the identity matrix and for clarity we might also make its dimension explicit as in Id×d . For a matrix A, we denote its maximum and minimum singular values by σmax (A) and σmin (A), respectively. For a random vector x, we denote 5 √ −z 2 /2 / 2π to refer to the Gaussian density and its subgaussian norm by kxk . We use φ(z) = e ψ 2 Rz Φ(z) = −∞ φ(t)dt to denote the Gaussian cumulative distribution. For two functions f (n) and g(n), with g(n) ≥ 0, we write f (n) = o(g(n)) if g(n) grows much faster than f (n), i.e., f /g → 0. We also write f (n) = O(g(n)), if there exists a positive constant C such that for all sufficiently large values of n, |f (n)| ≤ C|g(n)|. 2 FCD Procedure: False Discovery Control via Debiasing In order to describe FCD framework, we first give an overview of debasing approach. To this end, we focus on the Lasso estimator [Tib96], given by   b X; λ) ≡ arg min 1 ky − Xθk2 + λkθk1 θ(y, (9) 2 θ∈Rp 2n In case the optimization has more than one optimizer we select one of them arbitrarily. We will often drop the arguments y, X, as they are clear from the context. Despite the great properties of Lasso in terms of point estimation and prediction, it is biased due to the `1 penalty term. Indeed, bias is unavoidable in high-dimensional setting (n < p) as one needs to produce a point estimate, in p dimension, from the observed data in lower dimension, n. Furthermore, characterizing the exact distribution of regularized estimator is in general not tractable. To deal with these challenges, the debasing approach aims at first removing the bias of Lasso and producing an estimator that is amenable to distributional characterization. 2.1 Debiasing Lasso A debiased estimator θbd takes the general simple form of 1 b . θbd = θb + M X T (y − X θ) (10) n Here, M is a ‘decorrelating’ matrix. There are various proposals for constructing M ; see e.g. [ZZ14, JM14a, VdGBRD14]. In this paper we use the construction introduced by [JM14a]. Here, we assume that the noise w is Gaussian and then discuss the non-Gaussian case in Section 2.2. To set the stage to describe construction of M , note that by plugging in for y = Xθ0 + w, we have √ d √ b + √1 M X T w , b − I)(θ0 − θ) n(θb − θ0 ) = n(M Σ (11) n b ≡ (X T X)/n is the empirical covariance of the feature vectors. The first term is the bias where Σ b − I|∞ , with | · | denoting the entrywise `∞ norm. The second term is the and is controlled by |M Σ b T . The decorrelating matrix M is unbiased Gaussian noise whose covariance works out at M ΣM constructed via a convex optimization that aims at reducing bias and variance of the coordinates of θbd at the same time. Construct M = (m1 , m2 , . . . , mp )T ∈ Rp×p by letting mi ∈ Rp be a solution to the following convex program minimize subject to b , mT Σm b − ei k∞ ≤ µ , kΣm 6 (12) with ei ∈ Rp being the i’th standard unit vector. If any of the above problems is not feasible, we let M = Ip×p . Note that M is constructed solely based on X. The choice of running parameter µ will be discussed in the sequel. The following proposition proved in [JM14a] shows that the error of the debiased estimator θbd can be decomposed as the sum of two ‘bias’ and ‘noise’ terms. Proposition 2.1. Consider the linear model (3), with gaussian noise, w ∼ N(0, σ 2 In×n ), and let θbd p be the debiased estimator given by Eq. (10), with µ = a (log p)/n. Then, we have the following decomposition: √ d √ b b T ), ∆ = n(M Σ b − I)(θ0 − θ). n(θb − θ0 ) = Z + ∆, Z|X ∼ N(0, σ 2 M ΣM (13) Consider random design matrices with i.i.d rows and let Σ = E(x1 xT 1 ) be the population level covariance. Suppose that σmin (Σ) ≥ cmin > 0 and σmax (Σ) < cmax , for some constants cmin , cmax and maxi∈[p] Σii ≤ 1. Further, assume that XΣ−1/2 has independent subgaussian rows with p kΣ−1/2 x1 kψ2 = κ. Then, choosing λ = cσ (log p)/n, there exists constant C = C(a, κ), such that for n ≥ Cs0 log(p/s0 ), we have     16ac0 σ s0 log p √ ≤ 4e−c1 n + 4p−c2 , P k∆k∞ ≥ (14) cmin n where c1 and c2 are constants depending on κ, a, c0 , cmin , cmax . The next lemma controls the variance of the noise coordinates Zi in terms of the diagonal entries of the precision matrix. Lemma 2.2 ( [JM14a]). Let Ω ≡ Σ−1 be the precision matrix. Under the assumption of Proposition 2.1, we have b T − Ω|∞ = 0 , lim sup |M ΣM (15) n→∞ almost surely. 2.2 Extension to Non-Gaussian Noise √ In the decomposition (2.1), we have Z = M X T W/ n and given that W ∼ N(0, Σ), we have Z|X ∼ b T ). In [JM14a], it is shown that by a slight modification of optimization (12), Z admits N(0, σ 2 M ΣM the same conditional distribution even for non-Gaussian noise. For the reader’s convenience and to be self-contained we briefly explain it here. Note that for any fixed i ∈ [p], we have n 1 X Zi = √ ξj , n with ξj ≡ mT i x j wj . T b i )1/2 σ(m Σm i j=1 Pn 2 Conditional on X, the terms ξj are zero mean and independent. Moreover, j=1 E(ξj |X) = n. Therefore, if the Lindeberg’s condition holds, that is to say for every ε > 0, almost surely n √ 1X E(ξj2 I(|ξj | > ε n)|X) = 0 , n→∞ n lim j=1 7 P √ d then nj=1 ξj / n|X −→N(0, 1). The construction of M can slightly be modified to ensure the Lindeberg’s condition, namely optimization problem (12) should be modified as follows: minimize subject to b , mT Σm b − e i k∞ ≤ µ , kΣm kXmk∞ ≤ nβ (16) for arbitrary fixed 0 < β < 1/2 − a−1 , where we recall the parameter a from Eq. (2). The following lemma, from [JM14a] shows that by this modification, the marginals of Zj are asymptotically normal. Lemma 2.3 ([JM14a], Theorem 4.1). Under conditions (2) on the noise term, and using optimizad tion (12) to construct M , we have that Zi |X −→ N(0, 1). The above result can be easily generalized to fixed-dimensional marginals of Z, by using the fact that a vector has a multivariate normal distribution if every linear combination of its coordinates is normally distributed. With this overview of debiasing approach we are ready to explain the FCD procedure. 2.3 2.3.1 FCD Procedure Construction of Test Statistics In order to construct the test statistics, we first need to propose a consistent estimate of noise variance, σ 2 . There are already several proposals for this in the literature. See e.g., [FL01, FL08, SBvdG10, Zha10, SZ12, BC13, FGH12, RTF16]. To be concrete, we use the scaled Lasso [SZ12] given by   1 σ 2 b {θ, σ b} ≡ arg min ky − Xθk2 + + λ̄kθk1 (17) θ∈Rp ,σ>0 2σn 2 We state the following lemma, proved in [JM14a], that shows σ b is a consistent estimate of σ. Lemma 2.4. Let σ b be the scaled Lasso estimate of the noise level, defined by (17), with λ̄ = p b satisfies the following relation: 10 (2 log p)/n. Then σ   σ b lim sup P − 1 ≥ ε = 0. n→∞ θ ∈Rp ,kθ k ≤s σ 0 0 0 0 b T . For i ∈ [p], we define test statistic Ti as follows: Define Λ = M ΣM √ bd nθ Ti ≡ √ i . σ b Λii For a given threshold level t ≥ P 0, we reject H0,i if |Ti | ≥ t and we return sign of Ti as the estimate of sign of θ0,i . We also let R(t) = pi=1 I(|Ti | ≥ t) be the total set of rejections at threshold t. Next we discuss how to choose a data dependent threshold t to ensure that directional FDR and FDP are controlled at a pre-assigned level q ∈ [0, 1]. 8 2.3.2 A Data Dependent Threshold for the Test Statistics • Step 1: For the pre-assigned level q ∈ [0, 1], define tp = (2 log p − 2 log log p)1/2 and calculate   2p(1 − Φ(t)) ≤q . (18) t0 = inf 0 ≤ t ≤ tp : R(t) ∨ 1 √ If (18) does not exist then set t0 = 2 log p. • Step 2: For i ∈ [p], reject H0,i if |Ti | ≥ t0 . d i = sign(Ti ) as the estimate of sign(θ0,i ). • Step 3: We return sign 3 Theoretical Results Suppose that the design matrix X has i.i.d rows with Σ = E(x1 xT 1 ) being the population covari−1 b T , where M is the ance. Let Ω ≡ Σ be the precision matrix and recall the definition Λ ≡ M ΣM decorrelating matrix used in construction of the debiased estimator. We also define the normalized matrices Ω0 and Λ0 as Ωij Ω0ij = p , Ωii Ωjj Λij Λ0ij = p . Λii Λjj For a given constant γ > 0, define o n Γ(γ, c0 ) ≡ (i, j) : 1 ≤ i, j ≤ p, |Ω0ij | ≥ c(log p)−2−γ , (19) (20) for some constant c > 0. The following theorem states a guarantee on the directional false discovery rate of the FCD procedure introduced in the previous section. Theorem 3.1. Consider random design matrices with i.i.d rows and let Σ = E(x1 xT 1 ) be the population level covariance. Suppose that σmin (Σ) ≥ cmin > 0 and σmax (Σ) < cmax , for some constants cmin , cmax and maxi∈[p] Σii ≤ 1. Further, assume that XΣ−1/2 has independent subgaussian rows with kΣ−1/2 x1 kψ2 = κ. Further, assume that: √ (i) s0 = o( n/(log p)2 ). (ii) There exist positive constants c0 , γ, such that Γ(γ, c0 ) = o(p1+ρ ), for some constant ρ ∈ [0, 1). (iii) We have |{(i, j) : |Ω0ij | > (1 − ρ)/(1 + ρ)}| = O(p). Then, for FCD procedure we get lim sup FDRdir ≤ q. (21) (n,p)→∞ Further, for any ε > 0, lim (n,p)→∞   P FDPdir ≤ q + ε = 1 . 9 (22) Remark 3.2. While directional FDR is the expected directional false discovery proportion (FDPdir ), it is idealized for a variable selection procedure to control FDPdir in any given realization. In general, controlling FDRdir does not control the variations of FDPdir . As noted by [Owe05], the variance of FDP can be large if the test statistics are correlated, which is the case here. Let us emphasize that by Eq. (22), our FCD controls FDPdir , with high probability. Examples. Here, we provide several examples of the precision matrices that satisfy conditions (ii)-(iii) of Theorem 3.1 to demonstrate its applicability. Example 1: Our first example is the circulant covariance matrices, where Σij = η |i−j| , for some constant η ∈ (0, 1). It is simple to see that the inverse of such matrices have at most three nonzero coordinates per row. Therefore, the conditions will be satisfied by choosing ρ = 1, and c > 0, γ < ∞, arbitrary. Example 2: Suppose that Σ is block diagonal with size of blocks to bounded (as p → ∞). Then, the precision matrix will also have a block diagonal structure with blocks of bounded size. It is easy to check conditions, with choosing ρ = 1 and c > 0, γ < ∞, arbitrary. Example 3: Consider the equi-correlated features, where Σ = (1 − r)I + r11T , for some constant r ∈ (0, 1), where 1 ∈ Rp denotes the all-one vector. Then, we have Ω = (a − b)I + b11T , with a= (p − 2)r + 1 , (p − 2)r − (p − 1)r2 + 1 b= −r . (p − 2)r − (p − 1)r2 + 1 (23) Note that |b| = O(1/p). Therefore, the conditions hold for arbitrary constants c > 0, 0 < ρ < 1. (1) (2) Finally, consider two matrices Ω(1) and Ω(2) , with same diagonal entries Ωii = Ωii , for i ∈ [p], (1) (2) such that Ω(1) dominates Ω(2) on off-diagonal entries, i.e., Ωij ≥ Ωij , for i 6= j ∈ [p]. Then it is easy to see that if Ω(1) satisfies Conditions (i)-(ii), so does Ω(2) . 4 Power Analysis Recall that S0 ≡ supp(θ0 ) is the set of indices of the truly significant features. Let Sb denote the set of significant parameters returned by our FCD procedure, namely Sb = {1 ≤ j ≤ p : |Tj | ≥ t0 } . (24) The power of a selected model Sb is defined as  d j = sign(θ0,j )}|  |{j ∈ Sb : sign b . Power(S) = E max(|S|, 1) (25) We are now ready to characterize the statistical power of the FCD procedure for the linear model (3). 10 Theorem 4.1. Consider a sequence of random design matrices X ∈ Rn×p , with dimension n → ∞, p×p . Suppose that σ p = p(n) → ∞ and Σ = E(x1 xT min (Σ) ≥ cmin > 0 and σmax (Σ) < cmax , 1) ∈ R for some constants cmin , cmax and maxi∈[p] Σii ≤ 1. Further, assume that XΣ−1/2 has independent √ −1/2 x k 2 subgaussian rows with kΣ 1 ψ2 = κ. Suppose that s0 = o( n/(log p) ) and for i ∈ S = supp(θ0 ), √ p we have |θ0,i | > (σ/ n) 2Ωii log(p/s0 ). Then, the following holds true: b Power(S) ≥1 n→∞ 1 − β(θ0 , n)   √ n|θ0,i | 1 X qs0 , 1 − β(θ0 , n) = F , √ s0 p σ Ωii i∈S lim inf (26) (27) where, for α ∈ [0, 1] and u ∈ R+ , the function F (α, u) is defined as follows: F (α, u) ≡ 1 − Φ(Φ−1 (1 − α ) − u) . 2 (28) We refer to Section 7.2 for the proof of Theorem 4.1. Corollary 4.2. It is easy to see that for any fixed α ∈ [0, 1], function u 7→ F (α, u) is monotone increasing. Therefore, as a result of Theorem 4.1, we have lim inf n→∞  F b Power(S)  ≥ 1. √ nθmin qs0 , √ p σ Ωii Corollary 4.3. Under the assumptions of Theorem 4.1, if b → 1, as n → ∞. ∞, then Power(S) √ nθmin −σ (29) q 2 maxi∈[p] (Ωii ) log(2p/(qs0 )) → Proof of Corollary 4.3 is given in Appendix A.4. 5 Numerical Experiments We consider linear model (3) where the design matrix X is generated by drawing its rows independently from N(0, Σ). The covariance Σ ∈ Rp×p has a circulant structure with Σij = η |i−j| , for some constant η ∈ (0, 1). We then normalize the columns of X to have unit norm. We generate the vector of coefficients θ0 ∈ Rp by choosing a subset of indices S ⊆ [p] at random, of size s0 and setting θ0,i from {±A} uniformly at random and θ0,i = 0, for i ∈ / S0 . The noise term W is drawn from N(0, In×n ). We perform three sets of simulations to compare the performance of FCD procedure with model free knockoff and to examine the effects of sparsity level, signal magnitude, and feature correlation. We also compare the empirical power of FCD with the analytical lower bound provided in Corollary 4.2. In all simulations, we set the target level FDR to q = 0.1. For FCD procedure, we use the implementation of the debiased method provided by http://web. stanford.edu/montanar/sslasso/, to construct the debiased estimator. For model free knockoff, we use the implantation provided by http://web.stanford.edu/group/candes/knockoffs/. 11 18 90 16 80 14 70 statistical power FDRdir 100 Knockoff (FDP) FCD (FDP) Nominal Level 20 12 10 8 6 60 50 40 30 4 20 2 10 0 1 2 3 4 5 0 0 6 Amplitude (A) Knockoff (Power) FCD (Power) Analytical Lower Bound 1 2 3 4 5 6 Amplitude (A) Figure 1: Testing FCD and model free knockoff methods with varying the coefficients amplitude A. Here, n = 2000, p = 3000, k = 100, η = 0.1. The target level is q = 10%. FDRdir and power are computed by averaging over 100 realizations of noise and coefficient vectors. Effect of Signal Amplitude: We choose n = 2000, p = 3000, k = 100, η = 0.1 and vary the signal amplitude in the set A ∈ {0.5, 1, 1.5, . . . , 5.5, 6}. For the FCD procedure and the model free knockoff, we compute the directional FDR and power by averaging across 100 realizations of noise and the generation of coefficient vector θ0 . The results are plotted in Figure 1. As we observe, both methods control FDRdir under the target level q = 0.1. As expected, the power of both procedures increases as the signal amplitude increases, with FCD procedure having larger power than the knockoff method over the entire range of signal amplitudes. The FCD procedure turn out to be more powerful than knockoff procedure. We also plot the analytical lower bound on the power of FCD procedure, given in Corollary 4.2. As we see the lower bound is quite close to the actual empirical power of FCD procedure in the setup tested. Effect of feature correlation: We test the effect of feature correlations on the performance of FCD procedure, comparing it with the model free knockoff. We set n = 700, p = 1000, k = 50, A = 4.5. Recall that the rows of the design matrix X are generated from a N(0, Σ) distribution, with Σij = η |i−j| , and then the columns of X are normalized to have unit norm. We vary the parameter η in the set {0.1, 0.15, 0.2, . . . , 0.75, 0.8}. For each value of η, we compute FDRdir and power for both methods, by averaging over 100 realizations of noise and design matrix X. The results are displayed in Figure 2. As observed, both methods control FDRdir over the range of correlations tested. From the power plot, we see that the power of both methods decay as the features correlations increase. This is expected because when the features are highly correlated it is harder to distinguish between them and report the truly significant ones. Indeed, for large values of η, both methods select a few variables. This way, FDRdir is still controlled but the power is low. The proposed FCD procedure has higher power than model free knockoff for η ≤ 0.65. Effect of Sparsity: Here, we set n = 2000, p = 3000, A = 4.5, η = 0.1 and vary the sparsity 12 100 Knockoff (FDP) FCD (FDP) Nominal Level 20 18 80 statistical power 16 14 FDRdir Knockoff (Power) FCD (Power) 90 12 10 8 6 70 60 50 40 30 4 20 2 10 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 0 0.8 Feature Correlation (η) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Feature Correlation (η) Figure 2: Testing FCD and model free knockoff methods with varying the feature correlation parameter η. Here, n = 700, p = 1000, k = 50, A = 4.5. The target level is q = 10%. FDRdir and power are computed by averaging over 100 realizations of noise and design matrices. level of the coefficients in the set k ∈ {10, 15, 20, . . . , 130}. For both methods, the power and FDR are computed by averaging over 100 trials of noise and the generation of coefficient vector θ0 . Both methods control FDRdir over the entire range, with FCD achieving lower FDRdir for small values of k. In terms of power, both methods have close power, and the FCD has higher power for small k. 6 Real Data Experiments In this section we evaluate the proposed method to find the mutations in the Human Immunodeficiency Virus Type 1 associated with drug resistance1 . This dataset is presented and analyzed in [RTW+ 06] and is obtained by analyzing HIV-1 subtype B sequences from persons with histories of antiretroviral treatment. The dataset contains the mutations in the protease and reverse transcriptase (RT) positions of the HIV-1 subtype B sequences which correspond to resistance to Protease Inhibitors (PI), to nucleoside reverse transcriptase inhibitors (NRTIs) and to non-nucleoside RT inhibitors (NNRTIs). In order to deal with missing measurements and preprocessing the dataset we mostly follow the steps taken in [BC15]. The design matrix X ∈ {0, 1}n×p is formed by letting Xij = 1 if the i’th sample contains the j’th mutation and Xij = 0 otherwise. Further, for a specific drug, the i’th entry of the response vector yi denotes the logarithm of the increase in the resistance to that drug in the i’th patient. We let q = 0.2 and we apply the FCD procedure described in subsection 2.3 to detect the mutations in the HIV-1 associated with resistance to each drug. In order to evaluate the performance of our method, we compare it with the knockoff filter procedure [BC15] with the test statistics based on lasso. We have used two different methods for generating the knockoff variables; in knockoff1, the knockoff variables are generated by solving a semi-definite program (SDP) and in knockoff2, equi1 The dataset is available online at https://hivdb.stanford.edu/pages/published_analysis/genophenoPNAS2006. 13 18 90 16 80 14 70 statistical power FDRdir 100 Knockoff (FDP) FCD (FDP) Nominal Level 20 12 10 8 6 60 50 40 30 4 20 2 10 0 0 20 40 60 80 100 120 0 0 140 Knockoff (Power) FCD (Power) 20 Sparsity Level (k) 40 60 80 100 120 140 Sparsity Level (k) Figure 3: Testing FCD and model free knockoff methods with varying the sparsity level k. Here, n = 2000, p = 3000, A = 4.5, η = 0.1. The target level is q = 10%. FDRdir and power are computed by averaging over 100 realizations of noise and coefficient vectors. correlated knockoff variables are created without solving an SDP at a lower computational cost2 . Since this is a real data experiment, there is no ground truth. However, we use the methodology in [BC15] to assess our results. In order to do this, we evaluate the reproducibility of the outcomes of these procedures by comparing them with treatment-selected mutation (TSM) panels provided in [RFZ+ 05]. These panels contain mutations that are observed more frequently in virus samples from patients that have been treated by each drug in compare with the patients who have never been treated with that drug. Since these panels are created independently from the dataset that we use, they can provide a good measure for validating the reproducibility of the results obtained by each procedure. A summary of the results can be seen in Figures 4, 5, 6. It can be seen that the FCD method achieves the target FDR level of q = 0.2 and the obtained power in half of the cases (8 out of 16 drugs) is larger than the power achieved by the knockoff filter. Overall, the achieved power is comparable with the power of the knockoff filter method. 7 Proof of Main Theorems 7.1 Proof of Theorem 3.1 Define G(t) = 2(1 − Φ(t)), with Φ(t) denoting the standard Gaussian cumulative distribution. We start by two lemmas about the properties of G(t). Lemma 7.1. For all t ≥ 0, we have 2 2 φ(t) < G(t) < φ(t) , t + 1/t t 2 (30) More information regarding the procedure are available at https://web.stanford.edu/groupcandes/knockoffs/ software/knockoff/index.html. 14 #HIV-1 protease positions selections Resistance to APV 25 Resistance to ATV 30 FDP=0.18, Power=0.53 In TSM list Not in TSM list 20 Resistance to IDV 20 FDP=0.26, Power=0.59 25 FDP=0.20, Power=0.47 FDP=0.11, Power=0.50 FDP=0.16, Power=0.47 FDP=0.04, Power=0.65 15 20 FDP=0.06, Power=0.44 15 FDP=0.00, Power=0.32 FDP=0.06, Power=0.50 15 10 10 10 5 5 0 5 Knockoff1 Knockoff2 FCD 0 Knockoff1 (q=0.20, Dataset size: n=767, p=201) Resistance to LPV 30 Knockoff2 0 Knockoff1 Knockoff2 Resistance to RTV 35 FDP=0.17, Power=0.71 25 FDP=0.17, Power=0.56 FDP=0.09, Power=0.59 FDP=0.31, Power=0.59 FDP=0.09, Power=0.62 25 20 FDP=0.16, Power=0.47 FDP=0.35, Power=0.65 30 25 FCD (q=0.20, Dataset size: n=825, p=206) Resistance to NFV 30 FDP=0.33, Power=0.53 20 FCD (q=0.20, Dataset size: n=328, p=147) FDP=0.19, Power=0.50 20 15 15 10 10 5 5 0 0 15 Knockoff1 Knockoff2 FCD 10 5 Knockoff1 (q=0.20, Dataset size: n=515, p=184) Knockoff2 FCD (q=0.20, Dataset size: n=842, p=207) 0 Knockoff1 Knockoff2 FCD (q=0.20, Data size: n=793, p=205) Resistance to SQV 25 FDP=0.14, Power=0.53 20 15 FDP=0.20, Power=0.35 FDP=0.07, Power=0.38 10 5 0 Knockoff1 Knockoff2 FCD (q=0.20, Dataset size: n=824, p=206) Figure 4: Summary of the results of applying the knockoff filter and FCD for detecting the mutation positions in HIV-1 associated with resistance to type-PI drugs using the dataset in [RTW+ 06]. In these experiments we have used q = 0.2. In the plots, blue bars show the number of detected positions by different methods that appear in the TSM panels. On top of each bar the proportion of detected mutations that appear in the TSM panel (an estimate for FDP) and the proportion of mutations in the TSM panel that are detected by different methods (an estimate for power) are stated. 15 Resistance to x3TC 10 Resistance to ABC 30 Resistance to AZT 30 FDP=0.20, Power=0.33 9 In TSM list Not in TSM list FDP=0.52, Power=0.54 FDP=0.37, Power=0.71 25 25 #HIV-1 RT positions selections 8 FDP=0.00, Power=0.29 7 20 20 6 FDP=0.16, Power=0.67 FDP=0.18, Power=0.58 FDP=0.19, Power=0.54 5 FDP=0.00, Power=0.21 15 15 10 10 5 5 FDP=0.27, Power=0.46 4 3 2 1 0 Knockoff1 Knockoff2 FCD 0 Knockoff1 Knockoff2 (q=0.20, Dataset size: n=623, p=283) Resistance to D4T Resistance to DDI 20 25 0 FCD (q=0.20, Dataset size: n=629, p=283) Knockoff1 Knockoff2 FCD (q=0.20, Dataset size: n=626, p=283) Resistance to TDF 18 FDP=0.20, Power=0.67 FDP=0.18, Power=0.58 FDP=0.22, Power=0.58 18 FDP=0.18, Power=0.75 16 20 16 14 14 12 12 FDP=0.50, Power=0.25 15 10 10 8 8 10 6 6 FDP=0.00, Power=0.21 FDP=0.17, Power=0.21 4 4 5 2 2 0 Knockoff1 Knockoff2 FCD 0 No Discovery Knockoff1 (q=0.20, Dataset size: n=625, p=281) Knockoff2 0 FCD No Discovery Knockoff1 (q=0.20, Dataset size: n=628, p=283) Knockoff2 FCD (q=0.20, Dataset size: n=351, p=215) Figure 5: Same as Figure 4 for type-NRTI drugs. Resistance to DLV 14 Resistance to EFV 25 FDP=0.36, Power=0.60 Resistance to NVP 20 FDP=0.55, Power=0.60 In TSM list Not in TSM list FDP=0.53, Power=0.60 FDP=0.23, Power=0.67 FDP=0.48, Power=0.80 18 12 20 16 FDP=0.20, Power=0.53 10 14 #HIV-1 RT positions selections FDP=0.29, Power=0.80 15 12 8 10 FDP=0.18, Power=0.60 6 10 8 FDP=0.14, Power=0.40 6 4 5 4 2 2 0 Knockoff1 Knockoff2 FCD (q=0.20, Dataset size: n=730, p=305) 0 Knockoff1 Knockoff2 FCD 0 Knockoff1 (q=0.20, Dataset size: n=732, p=312) Figure 6: Same as Figure 4 for type-NNRTI drugs. 16 Knockoff2 (q=0.20, Dataset size: n=744, p=313) FCD 2 /2 where φ(t) = e−t √ / 2π is the standard Gaussian density. Lemma 7.1 is the standard trial bound on the Gaussian distribution and its proof is omitted. Lemma 7.2. For all t > 0, ε < min(1, 1/t) and δ < min(1, 1/t2 ), the following holds true: G((1 − δ)t − ε) ≤ 1 + 8(ε + εt + δ + δt2 ) . G(t) (31) Proof of Lemma 7.2 is given in Appendix A.1. Using Proposition (2.1), we have √ nθ0,i σ e ∆i + Zi + √ Ti = √ σ b σ b Λii σ b Λii (32) ei ∼ N(0, Λ0 ). Note that since Ω = Σ−1 , we have Σii Ωii ≥ 1. Hence, maxi∈[p] Σii ≤ 1, we where Z have mini∈[p] Ωii ≥ 1. Further, by invoking Lemma 2.2, |Λ − Ω|∞ = op (1), and hence Λii are also bounded from below by an arbitrary fixed constant 0 < c < 1, for large enough n. In addition, since Λ0 − Ω0 ∞ = op (1), for (i, j) ∈ Γ(γ)c we have |Λ0ij | < C(log p)−2−γ , (33) for some constant C > 0. Further, by Condition (iii) in the theorem statement, we have n 1 − ρo (i, j) : |Ω0ij | > = O(p) . 1+ρ (34) Define S≥0 ≡ {i ∈ [p] : θ0,i ≥ 0} and S≤0 ≡ {i ∈ [p] : θ0,i ≤ 0}. √ We first consider the case that t0 , given by (18), does not exist. In this case, t0 = 2 log p and for any ε > 0 we have  X  d i 6= sign(θ0,i ) ≥ 1 P I sign i ! ≤P X !  p I Ti ≥ 2 log p ≥ 1 + P  i∈S≤0 X !  p I Ti ≤ − 2 log p ≥ 1 .  i∈S≥0 (35) We can bound the first term on the right hand side above as ! !   X σ X  p p ∆ i ei + √ I P I Ti ≥ 2 log p ≥ 1 ≤ P Z ≥ 2 log p ≥ 1 σ b σ b Λ ii i∈S≤0 i∈S≤0 !  X  p k∆k σ b ∞ ei ≥ ≤P I Z 2 log p − √ ≥1 σ σ c i∈S≤0   p  √ ≤ p max P Zei ≥ (1 − ε) 2 log p − ε + P k∆k∞ ≥ σε c i∈[p]   σ b +P −1 ≥ε σ  p  √ p  ≤ G (1 − ε) 2 log p − ε + P k∆k∞ ≥ σε c 2  σ b −1 ≥ε . +P σ 17 which goes to zero as n, p → ∞, due to Proposition 2.1 along with Condition (i), that s0 = √ o( n/(log p)2 ), and using Lemma 2.4. Similarly and by symmetry, the second term goes to zero as n, p → ∞ and the claim follows. We next focus on the event that t0 , given by (18) exists. By definition of t0 in this case, we have pG(t0 ) = q. R(t0 ) ∨ 1 (Indeed, it is clear that the left-hand side is at most q. Equality holds since t0 is the minimum t, with such property.) Define Q(t) ≡ G(t)/2 for all t ∈ R. Let P i∈S≥0 Ap ≡ sup {I (Ti ≤ −t) − Q(t)} + P i∈S≤0 {I (Ti ≥ t) − Q(t)} (36) pG(t) 0≤t≤tp Then, P FDPdir (t0 ) = I(Ti ≤ −t0 ) + i∈S≥0 P i∈S≤0 I(Ti ≥ t0 ) R(t0 ) ∨ 1 pG(t0 )Ap + s0 Q(t0 ) + 2(p − s0 )Q(t0 ) pG(t0 )(1 + Ap ) ≤ ≤ ≤ q(1 + Ap ). R(t0 ) R(t0 ) (37) Hence, we need to prove that Ap → 0, in probability. Note that ( P Ap ≤ sup i∈S≤0 {I (Ti ≥ t) − Q(t)} pG(t) 0≤t≤tp P ≤ sup i∈S≤0 {I (Ti ≥ t) − Q(t)} pG(t) 0≤t≤tp P + i∈S≥0 {I (Ti ≤ −t) − Q(t)} pG(t) P + sup ) i∈S≥0 0≤t≤tp {I (Ti ≤ −t) − Q(t)} pG(t) . (38) Note that by symmetry it is sufficient to prove that the first term in (38) goes to zero in probability. Consider a discretization 0 ≤ √ τ1 < τ2 < . . . < τb = tp such that τj − τj−1 = vp , for 1 ≤ j ≤ b − 1 and τb − τb−1 ≤ vp , where vp = 1/ log p. Hence, b ∼ tp /vp . For any t ∈ [τj−1 , τj ], we have P P P Q(τj ) i∈S≤0 I(Ti ≥ τj ) i∈S≤0 I(Ti ≥ t) i∈S≤0 I(Ti ≥ τj−1 ) Q(τj−1 ) · ≤ ≤ · pQ(τj ) Q(τj−1 ) pQ(t) pQ(τj−1 ) Q(τj ) Hence, it suffices to show that P max 0≤j≤b i∈S≤0 {I(Ti ≥ τj ) − Q(τj )} pQ(τj ) →0 (39) in probability. In the following lemma, we provide sufficient conditions to obtain Eq. (39). Lemma 7.3. Suppose that for any δ > 0, the followings hold:  P  i∈S≤0 I(Ti ≥ t) sup P − 1 ≥ δ = o(1) pQ(t) 0≤t≤tp 18 (40) and Z  P tp P 0 i∈S≤0 I(Ti ≥ t) pQ(t)  − 1 ≥ δ dt = o(vp ) (41) where tp = (2 log p − 2 log log p)1/2 and vp = (log p)−1/2 , then (39) hold true. We refer to Appendix A.2 for the proof of Lemma 7.3. By virtue of Lemma 7.3 we only need to prove Eqs. (40) and (41). We start by analyzing the following expression P  P 2 i,j∈S≤0 {P(Ti ≥ t, Tj ≥ t) − P(Ti ≥ t)P(Tj ≥ t)} i∈S≤0 {I(Ti ≥ t) − P(Ti ≥ t)} ≤ E pQ(t) p20 Q(t)2 1 X P(Ti ≥ t, Tj ≥ t) −1 ≤ 2 Q(t)2 p0 i,j∈S≤0 ≤ 1 X P(Tei ≥ t, Tej ≥ t) − 1, Q(t)2 p20 (42) i,j∈[p] with p0 = |S≤0 | and ∆i σe Tei ≡ Z . i+ √ σ b σ b Λii (43) The last inequality of (42) holds because θ0,i ≤ 0 for i ∈ S≤0 and therefore Ti ≤ Tei (Recall definition of Ti , given by Eq. (32).) Further, because S c = {i ∈ [p] : θ0,i = 0} ⊆ S≤0 , we have p0 ≥ p − s0 . √ Since s0 = o( n/(log p)2 ) by Condition (i), we have p0 = Ω(p). We partition the set {(i, j) : i.j ∈ [p]} into two disjoint sets, namely Γ(γ, c0 ) (highly correlated test statistics) and Γ(γ, c0 )c (weakly correlated test statistics). (Recall the definition of set Γ(γ, c0 ) given by (20).) We analyze the contribution of each set separately. 7.1.1 Highly correlated test statistics (Γ(γ, c0 ))   1 e e We first consider the set Γ(γ, c0 ). Note that (Zi , Zj ) ∼ N 0, 0 Λij Λ0ij 1  . Using (32), we have ! ∆ ∆ σ b σ b j i P Tei ≥ t, Tej ≥ t ≤ P Zei > t − √ , Zej > t − p σ σ σ Λii σ Λjj   ei > (1 − ε1 )t − ε2 , Zej > (1 − ε1 )t − ε2 ≤P Z    √ σ b + P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 σ ( ) ((1 − ε1 )t − ε2 )2 −2 ≤ C ((1 − ε1 )t − ε2 + 1) exp − 1 + Λ0ij    √ σ b − 1 ≥ ε1 , + P k∆k∞ ≥ σε2 c + P σ   19 (44) (45) where the last inequality follows from [Liu13, Lemma 6.2]. o n Let Ψ(ρ) ≡ (i, j) : i, j ∈ [p], |Λ0ij | > (1 − ρ)/(1 + ρ) . Note that by (34) and Lemma 2.2, |Ψ(ρ)| = O(p). We can write 1 p20 X (i,j)∈Γ(γ,c0 ) P(Tei ≥ t, Tej ≥ t) 1 ≤ 2 2 Q(t) p0  X (i,j)∈Ψ(ρ) + P(Tei ≥ t, Tej ≥ t) Q(t)2 X (i,j)∈Γ(γ,c0 )\Ψ(ρ)  P(Tei ≥ t, Tej ≥ t) . Q(t)2 (46) We treat the terms on the right hand side separately. For the first term, since Λ0ij ≤ 1, by using (45), we have (   X P(Tei ≥ t, Tej ≥ t) 1 |Ψ(ρ)| −2 2 ≤ C ((1 − ε )t − ε ) exp − ((1 − ε )t − ε ) /2 1 2 1 2 Q(t)2 p20 p20 Q(t)2 (i,j)∈Ψ(ρ)  )  √ σ b + P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 σ (  G((1 − ε1 )t − ε2 ) 2 −1 exp(((1 − ε1 )t − ε2 )2 /2) ≤ Cp G(t)    )  √ 1 σ b P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 + , Q(t)2 σ where in the second inequality we used the fact that |Ψ(ρ)| = O(p) and that p0 = Ω(p). Take √ ε2 = s0 (log p)/ n. By using Lemmas 2.1, 2.4, and 7.2, we get 1 p20  2 P(Tei ≥ t, Tej ≥ t) ≤ Cp−1 1 + ε21 + ε22 + ε22 t2 + ε21 t4 et /2 2 Q(t) (i,j)∈Ψ(ρ)     √ p−1 σ b +C P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 Q(t)2 σ  2 2 2 ≤ Cp−1 (1 + ε21 + ε22 )et /2 + et /2 ε22 t2 + et /2 ε21 t4     σ b 1 −c1 n −c2 , + e +p +P − 1 ≥ ε1 Q(t)2 σ X (47) for some constant C > 0. To bound the second term on the right-hand side of Eq. (46), note that for (i, j) ∈ Γ(γ, c0 ) \ Ψ(ρ), 20 we have Λ0ij ≤ (1 − ρ)/(1 + ρ). Thus, using (45) 1 p20 (   P(Tei ≥ t, Tej ≥ t) |Γ(γ, c0 )| −2 2 C ((1 − ε )t − ε ) exp −(1 + ρ) ((1 − ε )t − ε ) /2 ≤ 1 2 1 2 Q(t)2 p20 Q(t)2 (i,j)∈Γ(γ,c0 )\Ψ(ρ)  )  √ σ b + P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 σ (    G((1 − ε1 )t − ε2 ) 2 0 ρ−1 ≤cp exp (1 − ρ) ((1 − ε1 )t − ε2 )2 /2 G(t)    )  √ σ b 1 P k∆k∞ ≥ σε2 c + P , + − 1 ≥ ε1 Q(t)2 σ X for any arbitrary constant c0 > 0. Hence, using Lemmas 2.1, 2.4, and 7.2, we get 1 p20  (1−ρ)t2 /2 P(Tei ≥ t, Tej ≥ t) 0 ρ−1 2 2 2 2 2 4 ≤ c p 1 + ε + ε + ε t + ε t e 1 2 2 1 Q(t)2 (i,j)∈Γ(γ,c0 )\Ψ(ρ)    ρ−1  √ σ b 0 p +c P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 Q(t)2 σ  2 2 2 ≤ c0 pρ−1 (1 + ε21 + ε22 )e(1−ρ)t /2 + e(1−ρ)t /2 ε22 t2 + e(1−ρ)t /2 ε21 t4     1 σ b −c1 n −c2 + e +p − 1 ≥ ε1 (48) +P Q(t)2 σ X uniformly for 0 ≤ t ≤ tp . and for any arbitrary constant c0 > 0. 21 7.1.2 Weakly correlated test statistics (Γ(γ, c0 )c ) We next consider Γ(γ, c0 )c ∩ S≤0 . Using [Liu13, Lemma 6.1] (for d = 2 in its statement) and Eq. (44), we have P(Tei ≥ t, Tej ≥ t) sup −1 Q(t)2 0≤t≤tp ! ∆ 1 ∆ σ b σ b ej > t − p j ei > t − √ i , Z ≤ sup −1 P Z 2 σ σ σ Λii σ Λjj 0≤t≤tp Q(t)   1 ei > (1 − ε1 )t − ε2 , Z ej > (1 − ε1 )t − ε2 ) − 1 ≤ sup P Z 2 0≤t≤tp Q(t)     √ 1 σ b + P k∆k ≥ σε c + P − 1 ≥ ε 2 1 ∞ Q(tp )2 σ    2 ei > (1 − ε1 )t − ε2 , Z ej > (1 − ε1 )t − ε2 ) P Z Q((1 − ε1 )t − ε2 ) −1 ≤ sup sup Q(t) Q((1 − ε1 )t − ε2 )2 0≤t≤tp 0≤t≤tp  + sup 0≤t≤tp Q((1 − ε1 )t − ε2 ) Q(t) 2 1 −1 + Q(tp )2   √ P k∆k∞ ≥ σε2 c + P  σ b − 1 ≥ ε1 σ  ≤ (1 + ε21 + ε22 + ε21 t4p + ε22 t2p )C(log p)−1−γ1 + C ε21 + ε22 + ε21 t4p + ε22 t2p +    1 σ b −c1 n −c2 e +p +P − 1 ≥ ε1 + , Q(tp )2 σ  (49) for some constant C > 0, where γ1 = min(γ, 1/2). In the last inequality above, we applied Lemma 7.1 (Note that Q(t) ≡ G(t)/2 by definition). Therefore, by employing bound (49) for all (i, j) ∈ Γ(γ, c0 )c , we get P(Tei ≥ t, Tej ≥ t) −1 Q(t)2 (i,j)∈Γ(γ,c0 )c   ≤ C ε21 + ε22 + ε21 t4p + ε22 t2p 1 + (log p)−1−γ1 + C(log p)−1−γ1    1 |Γ(γ, c0 )c | σ b −c1 n −c2 + e + p − 1 ≥ ε + − 1, + P 1 Q(tp )2 σ p20 1 p20 X (50) uniformly for 0 ≤ t ≤ tp , and for some positive constants C, c1 , c2 . Note that this inequality is obtained by applying . Combining (42), (46) with bounds (47), (48) and (50), we obtain that  P 2 i∈S≤0 {I(Ti ≥ t) − P(Ti ≥ t)} E pQ(t)   2 2 2 2 ≤ C ε1 + ε2 + ε21 t4p + ε22 t2p 1 + (log p)−1−γ1 + p−1 et /2 + pρ−1 e(1−ρ)t /2    σ b 1 −c1 n −c2 e +p +P − 1 ≥ ε1 + Q(tp )2 σ p2 2 2 + c0 pρ−1 e(1−ρ)t /2 + Cp−1 et /2 + C(log p)−1−γ1 + 2 − 1 , (51) p0 22 uniformly for 0 ≤ t ≤ tp , some positive constants C, c1 , c2 and for any constant c0 > 0. We are now ready to prove the conditions of Lemma 7.3, namely Eqs. (40) and (41). Fix arbitrary constant δ > 0. By Chebyshev’s inequality, we write  P  i∈S≤0 I(Ti ≥ t) P −1 ≥δ pQ(t)  P 2 1 i∈S≤0 {I(Ti ≥ t) − P(Ti ≥ t)} ≤ 2E δ pQ(t)    1 2 2 ≤ 2 C ε21 + ε22 + ε21 t4p + ε22 t2p 1 + (log p)−1−γ1 + p−1 et /2 + pρ−1 e(1−ρ)t /2 δ    1 σ b −c1 n −c2 + e + p + P − 1 ≥ ε 1 Q(tp )2 σ  p2 0 ρ−1 (1−ρ)t2 /2 −1 t2 /2 −1−γ1 +cp e + Cp e + C(log p) + 2 −1 , (52) p0 where the second step follows from (51), uniformly for 0 ≤ t ≤ tp and for some constant C > 0 and an arbitrarily small constant c0 > 0. Hence, by substituting for tp = (2 log p − 2 log log p)1/2 , we obtain  P sup P 0≤t≤tp i∈S≤0 I(Ti ≥ t) pQ(t)  −1 ≥δ    1 ≤ 2 4C ε21 + ε22 + ε21 (log p)2 + ε22 log p 1 + (log p)−1−γ1 + (log p)−1 + (log p)−(1−ρ) δ    σ b 2 −c1 n −c2 +p e +p +P − 1 ≥ ε1 σ  p2 −1 −(1−ρ) 0 −1−γ1 + C (log p) + c (log p) + C(log p) + 2 −1 . (53) p0 p √ Recall that ε2 = s0 (log p)/ n. We take ε1 = s0 (log p)/n. By [JM14a, Lemma 3.3], we have that for this choice of ε1 , P {|b σ /σ − 1| ≥ ε1 } → 0 and hence Eq.(40) holds. Likewise, (41) holds because continuing from (52) and by applying reverse Fatou Lemma, we can 23 write  Z tp  P i∈S≤0 I(Ti ≥ t) P − 1 ≥ δ dt ≤ pG(t) 0 Z tp h   2 2 C ε21 + ε22 + ε21 t4p + ε22 t2p 1 + (log p)−1−γ1 + p−1 et /2 + pρ−1 e(1−ρ)t /2 0    i σ b 2 2 −c1 n −c2 2 t2p e +p +P + tp e − 1 ≥ ε1 + c0 pρ−1 e(1−ρ)t /2 + Cp−1 et /2 + C(log p)−1−γ1 dt σ    2 2 ≤ C ε21 tp + ε22 tp + ε21 t5p + ε22 t3p 1 + (log p)−1−γ1 + p−1 et /2 + pρ−1 e(1−ρ)t /2    σ b 2 2 3 t2p −c1 n −c2 + tp e e +p +P − 1 ≥ ε1 + c0 pρ−1 tp e(1−ρ)tp /2 + Cp−1 tp etp /2 + Ctp (log p)−1−γ1 σ    ≤ 2C ε21 (log p)5/2 + ε22 (log p)3/2 1 + (log p)−1−γ1 + (log p)−1 + (log p)−(1−ρ)    σ b −c1 n −c2 2 −1/2 + c(log p)−(1/2−ρ) + C(log p)−1/2 + C(log p)−1/2−γ1 e +p +P − 1 ≥ ε1 + p (log p) σ = o((log p)−1/2 ) = o(vp ) . (54) In theplast step we used the probabilistic bound on |b σ /σ − 1|, given in [SZ12, Theorem 2.1], with  √ 2 ε1 = s0 (log p)/n, and used the assumption s0 = o n/(log p) . This shows that Eq. (41) holds and hence completes the proof. 7.2 Proof of Theorem 4.1 The threshold t0 retuned by the FCD procedure is data-dependent. To analyze the power, we first upper bound t0 by a data-independent threshold t∗ . Lemma 7.4. Under the assumptions of Theorem 4.1, we have   qs0 −1 t0 ≤ t∗ , t∗ = Φ 1− (1 − o(1)) . 2p Proof of Lemma 7.4 is given in Appendix A.3. Since t0 ≤ t∗ by Lemma 7.4, if we replace t0 by t∗ , we obtain a lower bound on the power. For fixed arbitrarily small constants c0 , δ, ε, define n o G = G(δ, c0 , ε) = max |Λii − Ωii | ≤ c0 , |b σ /σ − 1| ≤ δ, k∆k∞ ≤ ε . Define S+ ≡ {i ∈ [p] : θ0,i > 0} and S− ≡ {i ∈ [p] : θ0,i < 0}. Therefore, S = S+ ∪ S− . We have 24  d j = sign(θ0,j )}|  |{j ∈ Sb : sign Power = E max(|S|, 1) 1 X 1 X = P(Ti ≤ −t∗ ) P(Ti ≥ t∗ ) + s0 s0 + i∈S+ = 1 s0 = 1 s0 i∈S0 √   X  √nθbd 1 X  nθbid i √ P ≥ t∗ + P √ ≤ −t∗ s0 σ b Λii σ b Λii i∈S+ i∈S−     √ √ X nθ0,i + ∆i nθ0,i + ∆i 1 X σe σe √ √ ≥ t∗ + ≤ −t∗ P Zi + P Zi + σ b s0 σ b σ b Λii σ b Λii i∈S i∈S (55) − + √ √ Define ηi ≡ ( nθ0,i + ∆i )/(σ Λii ). On event G, we have √ √ nθ0,i − ε nθ0,i + ε − + ηi ≥ ηi ≡ √ , ηi ≤ ηi ≡ √ . σ Ωii + c0 σ Ωii − c0 Using Equation (55), we have h  h  1 X σ b i 1 X −b σ i Power ≥ P Zi + ηi ≥ t∗ · I(G) + P Zi + η i ≤ t∗ · I(G) − P(G c ) s0 σ s0 σ i∈S+ i∈S− h i  i  X 1 X h 1 P Zi + ηi− ≥ (1 + δ)t∗ · I(G) + P Zi + ηi+ ≤ −(1 + δ)t∗ · I(G) − P(G c ) ≥ s0 s0 i∈S+ i∈S−   1 X 1 X = P Zi + ηi− ≥ (1 + δ)t∗ P(G) + P Zi + ηi+ ≤ −(1 + δ)t∗ P(G) − P(G c ) . s0 s0 i∈S+ i∈S− √ Recall that s0 = o( n/(log p)2 ) as per Condition (i), and by using Proposition 2.1 and lemmas 2.2 √ p and 2.4, event G holds with high probability and indeed it is easy to see that for θmin > (σ/ n) 2 log(p/s0 ), we have P(G c ) lim sup = 0. n→∞ 1 − β(θ0 , n) Therefore, Power ≥ n→∞ 1 − β(θ0 , n) X   X  1 − + lim inf P Zi + ηi ≥ (1 + δ)t∗ + P Zi + ηi ≤ −(1 + δ)t∗ . n→∞ s0 (1 − β(θ0 , n)) lim inf i∈S+ i∈S− 25 (56) Since the above bound holds for all ε, δ, c0 > 0, we get Power 1 − β(θ0 , n)  X   X  √ √ nθ0,i nθ0,i 1 P Zi + √ ≥ t∗ + ≤ −t∗ ≥ lim inf P Zi + √ n→∞ s0 (1 − β(θ0 , n)) σ Ωii σ Ωii i∈S− i∈S+  o  √ nX n|θ0,i | 1 = lim inf 1 − Φ t∗ − √ n→∞ s0 (1 − β(θ0 , n)) σ Ωii i∈S   √ n1 X n|θ0,i | o 1 qs0 = lim inf = 1. F , √ n→∞ (1 − β(θ0 , n)) s0 p σ Ωii i∈S lim inf n→∞ (57) The last step holds by using the definition of function F (·, ·), given by Equation (28), and the fact that Zi |X ∼ N(0, 1). Acknowledgements A.J. was partially supported by a Google Faculty Research Award. A.J. would also like to acknowledge the financial support of the Office of the Provost at the University of Southern California through the Zumberge Fund Individual Grant Program. 26 A A.1 Proof of Technical Lemmas Proof of Lemma 7.2 For t ≥ 0, we write G ((1 − δ)t − ε) =1+ G(t) Rt (1−δ)t−ε φ(x)dx G(t) ≤1+ (ε + δt)φ((1 − δ)t − ε) , G(t) (58) where we used that φ(t) is a decreasing function. We next separate the cases of t ∈ (0, 1) and t ≥ 1. For 0 < t < 1, we use the following bound p φ(t) ≤ ( 4 + t2 − t)φ(t) ≤ G(t) , (59) where the last step is due to Birnbaum [B+ 42]. Moreover, for all t ≥ 0, n o 1 φ((1 − δ)t − ε) = exp t(δt + ε) − ((1 − δ)t + ε)2 φ(t) 2 n o ≤ exp t(δt + ε) ≤ e2 , (60) because by our assumption δ 2 t ≤ 1 and εt ≤ 1. By employing Eqs. (59) and (60) into Eq. (58), we obtain G ((1 − δ)t − ε) ≤ 1 + e2 (ε + δt) ≤ 1 + e2 (ε + δ) . G(t) (61) For t ≥ 1, using Lemma 7.1, we have that G(t) ≥ φ(t)/t and hence by using Eq. (60) into Eq. (58), we get G ((1 − δ)t − ε) ≤ 1 + e2 t(ε + δt) . G(t) The result follows by combining the bound (61) and (62). A.2 Proof of Lemma 7.3 We write P   X   P b i∈S≤0 {I(Ti ≥ τj ) − Q(τj )} i∈S≤0 {I(Ti ≥ τj ) − Q(τj )} P max ≥δ ≤ P ≥δ 0≤j≤b pQ(τj ) pQ(τj ) j=1   P   P Z b X 1 tp i∈S≤0 {I(Ti ≥ τj ) − Q(τj )} i∈S≤0 I(Ti ≥ t) ≤ P − 1 ≥ δ dt + P ≥δ vp 0 pQ(t) pQ(τj ) j=b−1 Therefore, it suffices to show that  Z tp  P i∈S≤0 I(Ti ≥ t) P − 1 ≥ δ dt = o(vp ) , pQ(t) 0 and  P sup P i∈S≤0 0≤t≤tp I(Ti ≥ t) pQ(t) which are the conditions of the lemma. 27  − 1 ≥ δ dt = o(1) , (62) A.3 Proof of Lemma 7.4 p p We first show that t∗ < 2 log(p/s0 ). Assuming otherwise, we have G(t∗ ) < G( 2 log(p/s0 )) because G(t) is decreasing. By definition of t∗ , and Lemma 7.1 this results in r p s0 qs0 2 e− log(p/s0 ) p = p , (1 − o(1)) = G(t∗ ) < G( 2 log(p/s0 )) ≤ p π 2 log(p/s0 ) p π log(p/s0 ) which is a contradiction. p √ Now, given that t∗ < 2 log(p/s0 ) < 2 log p, if the claim is not true, by definition of t0 , we should have 2p(1 − Φ(t∗ )) > q. R(t∗ ) ∨ 1 (63) We next show that R(t∗ ) ≥ s0 (1 − o(1)). Define n o G = G(δ, c0 , ε) = max |Λii − Ωii | ≤ c0 , |b σ /σ − 1| ≤ δ, k∆k∞ ≤ ε b ∗ ) = {i ∈ [p] : |Ti | > t∗ }. Using Proposition (2.1), for fixed i ∈ S, we have Define S(t b ∗ )) = P(|Ti | ≤ t∗ ) P(i ∈ / S(t   √ nθ0,i σ ∆i √ + Zi + √ ≤ t∗ , =P σ b σ b Λii σ b Λii √ √ with Zi ∼ N(0, 1). Define ηi ≡ ( nθ0,i + ∆i )/(σ Λii ). On event G, we have √ n|θ0,i | − ε |ηi | ≥ ηi,∗ ≡ √ σ Ωii + c0 (64) Continuing from Equation (64), we have      σ b σ b b P(i ∈ / S(t∗ )) = P |Zi + ηi | ≤ t∗ ≤ P |Zi + ηi,∗ | ≤ t∗ · I(G) + P(G c ) σ σ    σ b ≤ P ηi,∗ − t∗ ≤ |Zi | · I(G) + P(G c ) . σ p √ p Given that θ0,i > (σ/ n) 2Ωii log(p/s0 ) and t∗ < 2 log(p/s0 ), we can choose δ, c0 , ε and ε0 small enough such that on event G = G(δ, c0 , ε), ηi,∗ − σ b t∗ ≥ t∗ , σ and therefore    σ b ηi,∗ − t∗ ≤ |Zi | · I(G) + P(G c ) σ ≤ P ((t∗ ≤ |Zi |) · I(G)) + P(G c ) b ∗ )) ≤ P P(i ∈ / S(t ≤ G(t∗ ) + P(G c )   qs0 ≤ + P(G c ) p 28 (65) √ Since P(G c ) → 0 and s0 = o( n/(log p)2 ), we can choose a deterministic sequence Ln → ∞, arbitrarily slow, as n → ∞, such that Ln P(G c ) → 0 and Ln (s0 /p) → 0. Letting An ≡ (qs0 /p) + P(G c ), we have Ln An → 0. By applying Markov inequality we obtain 1 b ∗ )c |) E(|S0 ∩ S(t s0 Ln An s0 An 1 ≤ = , s0 Ln An Ln b ∗ )c | ≥ s0 Ln An ) ≤ P(|S ∩ S(t (66) b ∗ )c | ≤ s0 Ln An , where the last inequality follows from (65). Therefore, with high probability, |S0 ∩ S(t which implies that b ∗ )| ≥ |S| − |S ∩ S(t b ∗ )c | ≥ s0 (1 − Ln An ) , R(t∗ ) = |S(t (67) as claimed. Now using Equation (67) in Equation (63), we arrive at 1 − Φ(t∗ ) > Therefore, for t∗ , given by −1 t∗ = Φ  qs0 (1 − Ln An ) . 2p qs0 1− (1 − 2Ln An ) 2p  , we reach a contradiction which proves our claim t0 ≤ t∗ is correct. The proof is complete by noting that Ln An = o(1) by choice of sequence Ln . A.4 Proof of Corollary 4.3 Define qs0 αn = , p √ un ≡ nθmin √ . σ Ωii Using Corollary 4.2, it suffices to show that F (αn , un ) = 1−Φ(Φ−1 (1−αn /2)−un ) → 1. Equivalently, we show that Φ−1 (1 − αn /2) − un → −∞. By Lemma 7.1, we have p p p 2φ( 2 log(2/αn )) G( 2 log(2/αn )) < p < 2φ( 2 log(2/αn )) = αn . (68) 2 log(2/αn ) Since G is a decreasing function, by applying G−1 on both sides, we get p Φ−1 (1 − α/2) = G−1 (αn ) ≤ 2 log(2/αn ) Using the above bound, we have un − Φ−1 (1 − αn /2) > un − p 2 log(2/αn ) (69) By the assumption on θmin , we have that the left-hand side of (69) goes to ∞, which completes the proof. 29 References [B+ 42] Z. W. Birnbaum et al. An inequality for mill’s ratio. The Annals of Mathematical Statistics, 13(2):245–246, 1942. 27 [BC13] A. Belloni and V. Chernozhukov. Least Squares after Model Selection in HighDimensional Sparse Models. Bernoulli, 19(2):521–547, 2013. 8 [BC15] R. F. Barber and E. J. Candès. Controlling the false discovery rate via knockoffs. The Annals of Statistics, 43(5):2055–2085, 2015. 2, 13, 14 [BC16] R. F. Barber and E. J. Candes. A knockoff filter for high-dimensional selective inference. arXiv:1602.03574, 2016. 4 [BCS18] R. F. Barber, E. J. Candès, and R. J. Samworth. Robust inference with knockoffs. arXiv preprint arXiv:1801.03896, 2018. 2 [BH95] Y. Benjamini and Y. Hochberg. Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society. Series B (Methodological), pages 289–300, 1995. 2 [BRT09] P. J. Bickel, Y. Ritov, and A. B. Tsybakov. Simultaneous analysis of Lasso and Dantzig selector. Amer. J. of Mathematics, 37:1705–1732, 2009. 5 [Büh12] P. Bühlmann. Statistical significance in high-dimensional linear models. arXiv:1202.1377, 2012. 5 [BY01] Y. Benjamini and D. Yekutieli. The control of the false discovery rate in multiple testing under dependency. Annals of statistics, pages 1165–1188, 2001. 2 [CFJL18] E. Candes, Y. Fan, L. Janson, and J. Lv. Panning for gold: Model-x knockoffs for high dimensional controlled variable selection. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2018. 2 [CP09] E. Candès and Y. Plan. Near-ideal model selection by `1 minimization. The Annals of Statistics, 37(5A):2145–2177, 2009. 5 [CT05] E. J. Candés and T. Tao. Decoding by linear programming. IEEE Trans. on Inform. Theory, 51:4203–4215, 2005. 5 [FDLL17] Y. Fan, E. Demirkaya, G. Li, and J. Lv. Rank: large-scale inference with graphical nonlinear knockoffs. arXiv preprint arXiv:1709.00092, 2017. 2, 4 [FGH12] J. Fan, S. Guo, and N. Hao. Variance estimation using refitted cross-validation in ultrahigh dimensional regression. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 74(1):1467–9868, 2012. 8 [FHG12] J. Fan, X. Han, and W. Gu. Control of the false discovery rate under arbitrary covariance dependence (with discussion). Journal of American Statistical Association, 107:1019–1045, 2012. 2 30 [FL01] J. Fan and R. Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American Statistical Association, 96(456):1348–1360, 2001. 8 [FL08] J. Fan and J. Lv. Sure independence screening for ultrahigh dimensional feature space. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 70(5):849–911, 2008. 8 [GLN02] C. R. Genovese, N. A. Lazar, and T. Nichols. Thresholding of statistical maps in functional neuroimaging using the false discovery rate. Neuroimage, 15(4):870–878, 2002. 2 [GR04] E. Greenshtein and Y. Ritov. Persistence in high-dimensional predictor selection and the virtue of over-parametrization. Bernoulli, 10:971–988, 2004. 5 [GT00] A. Gelman and F. Tuerlinckx. Type s error rates for classical and bayesian single and multiple comparison procedures. Computational Statistics, 15(3):373–390, 2000. 3 [JM13] A. Javanmard and A. Montanari. Model selection for high-dimensional regression under the generalized irrepresentability condition. In Advances in neural information processing systems, pages 3012–3020, 2013. 5 [JM14a] A. Javanmard and A. Montanari. Confidence intervals and hypothesis testing for highdimensional regression. The Journal of Machine Learning Research, 15(1):2869–2909, 2014. 2, 5, 6, 7, 8, 23 [JM14b] A. Javanmard and A. Montanari. Hypothesis Testing in High-Dimensional Regression under the Gaussian Random Design Model: Asymptotic Theory. IEEE Trans. on Inform. Theory, 60(10):6522–6554, 2014. 2, 5 [JM18] A. Javanmard and A. Montanari. De-biasing the lasso: Optimal sample size for gaussian designs. To appear in Annals of Statistics, 2018. 5 [KF00] K. Knight and W. Fu. Asymptotics for lasso-type estimators. Annals of Statistics, pages 1356–1378, 2000. 5 [Liu13] W. Liu. Gaussian graphical model estimation with false discovery rate control. The Annals of Statistics, pages 2948–2978, 2013. 20, 22 [Lou08] K. Lounici. Sup-norm convergence rate and sign concentration property of lasso and dantzig estimators. Electronic Journal of statistics, 2:90–102, 2008. 5 [MB06] N. Meinshausen and P. Bühlmann. High-dimensional graphs and variable selection with the lasso. Ann. Statist., 34:1436–1462, 2006. 5 [Owe05] A. B. Owen. Variance of the number of false discoveries. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(3):411–426, 2005. 10 31 [RFZ+ 05] S.-Y. Rhee, W. J. Fessel, A. R. Zolopa, L. Hurley, T. Liu, J. Taylor, D. P. Nguyen, S. Slome, D. Klein, M. Horberg, et al. Hiv-1 protease and reverse-transcriptase mutations: correlations with antiretroviral therapy in subtype b isolates and implications for drug-resistance surveillance. The Journal of infectious diseases, 192(3):456–465, 2005. 14 [RTF16] S. Reid, R. Tibshirani, and J. Friedman. A study of error variance estimation in lasso regression. Statistica Sinica, pages 35–67, 2016. 8 [RTW+ 06] S.-Y. Rhee, J. Taylor, G. Wadhera, A. Ben-Hur, D. L. Brutlag, and R. W. Shafer. Genotypic predictors of human immunodeficiency virus type 1 drug resistance. Proceedings of the National Academy of Sciences, 103(46):17355–17360, 2006. 13, 15 [RYB03] A. Reiner, D. Yekutieli, and Y. Benjamini. Identifying differentially expressed genes using false discovery rate controlling procedures. Bioinformatics, 19(3):368–375, 2003. 2 [SBvdG10] N. Städler, P. Bühlmann, and S. van de Geer. `1 -penalization for Mixture Regression Models (with discussion). Test, 19:209–285, 2010. 8 [SRC+ 15] W. Sun, B. Reich, T. Cai, M. Guindani, and A. Schwartzman. False discovery control in large-scale spatial multiple testing. Journal of the Royal Statistical Society, Series B, 77:59–83, 2015. 2 [SZ12] T. Sun and C.-H. Zhang. Scaled sparse linear regression. Biometrika, 99(4):879–898, 2012. 8, 24 [Tib96] R. Tibshirani. Regression shrinkage and selection with the Lasso. J. Royal. Statist. Soc B, 58:267–288, 1996. 6 [Tuk91] J. W. Tukey. The philosophy of multiple comparisons. Statistical science, pages 100– 116, 1991. 3 [vdGB09] S. van de Geer and P. Bühlmann. On the conditions used to prove oracle results for the lasso. Electron. J. Statist., 3:1360–1392, 2009. 5 [VdGBRD14] S. Van de Geer, P. Bühlmann, Y. Ritov, and R. Dezeure. On asymptotically optimal confidence regions and tests for high-dimensional models. The Annals of Statistics, 42(3):1166–1202, 2014. 2, 5, 6 [VdV00] A. W. Van der Vaart. Asymptotic statistics, volume 3. Cambridge university press, 2000. 2 [Wai09] M. Wainwright. Sharp thresholds for high-dimensional and noisy sparsity recovery using `1 -constrained quadratic programming. IEEE Trans. on Inform. Theory, 55:2183– 2202, 2009. 5 [Wu08] W. B. Wu. On false discovery control under dependence. Ann. Statist., 36:364–380, 2008. 2 32 [XCML11] J. Xie, T. T. Cai, J. Maris, and H. Li. Optimal false discovery rate control for dependent data. Statistics and Its Interface, 4(4):417–430, 2011. 2 [Zha10] C.-H. Zhang. Nearly unbiased variable selection under minimax concave penalty. The Annals of Statistics, 38(2):894–942, 2010. 8 [ZY06] P. Zhao and B. Yu. On model selection consistency of Lasso. The Journal of Machine Learning Research, 7:2541–2563, 2006. 5 [ZZ11] C.-H. Zhang and S. Zhang. Confidence Intervals for Low-Dimensional Parameters in High-Dimensional Linear Models. arXiv:1110.2563, 2011. 5 [ZZ14] C.-H. Zhang and S. S. Zhang. Confidence intervals for low dimensional parameters in high dimensional linear models. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 76(1):217–242, 2014. 2, 5, 6 33
10math.ST
An improved watermarking scheme for Internet applications Christophe Guyeux∗ and Jacques M. Bahi∗ ∗ University arXiv:1708.05970v1 [cs.MM] 20 Aug 2017 of Franche-Comté Computer Science Laboratory LIFC, Besançon, France Email: {christophe.guyeux, jacques.bahi}@univ-fcomte.fr Abstract—In this paper, a data hiding scheme ready for Internet applications is proposed. An existing scheme based on chaotic iterations is improved, to respond to some major Internet security concerns, such as digital rights management, communication over hidden channels, and social search engines. By using Reed Solomon error correcting codes and wavelets domain, we show that this data hiding scheme can be improved to solve issues and requirements raised by these Internet fields. Index Terms—Information hiding; Internet security; Wavelets; Error correcting codes; Social search engines; Digital rights management. I. I NTRODUCTION Information hiding has recently become a major digital technology, especially with the increasing importance and widespread distribution of digital media through the Internet. It encompasses steganography[11] and digital watermarking. The aim of watermarking is to slightly alter some digital documents, like pictures or movies, for a large panel of reasons, such as: copyright protection, control utilization, data description, integrity checking, or content authentication. Various qualities are required for a watermarking method, depending on the aims to reach: discretion, robustness against attacks [3], etc. Many watermarking schemes have been proposed in recent years, which can be classified into two categories: spatial domain [14] and frequency domain watermarking [8], [9]. In spatial domain watermarking, a great number of bits can be embedded without inducing too clearly visible artifacts, while frequency domain watermarking has been shown to be quite robust against JPEG compression, filtering, noise pollution and so on. More recently, chaotic methods have been proposed to encrypt the watermark, or embed it into the carrier image, to improve security. Information hiding is now an integral part of Internet technologies. In the field of social search engines, for example, contents like pictures or movies are tagged with descriptive labels by contributors, and search results are determined by these descriptions. These collaborative taggings, used for example in Flickr [2] and Delicious [1] websites, contribute to the development of a Semantic Web, in which every Web page contains machine-readable metadata that describe its content. Information hiding technologies can be used for embedding these metadata. The advantage of its use is the possibility to realize social search without websites and databases: descriptions are directly embedded into media, whatever their formats. Robustness is required in this situation, as descriptions should resist to modifications like resizing, compression, and format conversion. The Internet security field is also concerned by watermarking technologies. Steganography and cryptography are supposed to be used by terrorists to communicate through the Internet. Furthermore, in the areas of defense or in industrial espionage, many information leaks using steganographic techniques have been discovered. Lastly, watermarking is often cited as a possible solution to digital rights managements issues, to counteract piracy of digital work in an Internet based entertainment world [12]. In this paper, the desire is to improve the robustness of the watermarking scheme proposed in [4], to respond to Internet security concerns recalled above. The robustness of the watermarking scheme through geometric attacks is improved by using Reed Solomon correcting codes, whereas the capacity to withstand JPEG compression and noise pollution attacks is enlarged by embedding the watermark into the wavelets domain. Due to its improved robustness, this scheme is suitable for tagging multimedia contents in a social web search context. Additionally, the proposed scheme possesses various properties of chaos and is secure (see [4]), so it is suitable when desiring to establish a hidden communication channel through the Internet, or for digital rights management. Lastly, watermark encryption and authentication are possible, which enlarge the variety of use in Internet security applications. The rest of this paper is organized as follows. Firstly, some basic definitions concerning chaotic iterations and topological chaos are given in Section II. The data hiding scheme used in this paper is recalled in the same section. In Section III, the way to use Reed Solomon error correcting codes to improve robustness against geometric attacks is given. Then it is explained in Section IV how to improve robustness against frequency domain attacks by using wavelets coefficients into our scheme. The paper ends with a conclusion section where the contribution is summed up and the planned future work is discussed. II. BASIC RECALLS This section is devoted to the recall of the data hiding scheme, which will be improved in Sections III and IV. To do so, basic notations and terminologies in the fields of chaotic iterations and topological chaos are introduced. A. Chaotic iterations and Devaney’s chaos n th 1) Chaotic iterations: In the sequel S denotes the n term of a sequence S, Vi denotes the ith component of a vector V , and f k = f ◦ ... ◦ f is for the k th composition of a function f . Finally, the following notation is used: J1; N K = {1, 2, . . . , N }. Let us consider a system of a finite number M of cells, so that each cell has a boolean state. Then a sequence of length M of boolean states of the cells corresponds to a particular state of the system. A sequence which elements belong in J1; MK is called a strategy. The set of all strategies is denoted by S. Definition 1 Let S ∈ S. The shift function is defined by σ : (S n )n∈N ∈ S −→ (S n+1 )n∈N ∈ S and the initial function i is the map which associates to a sequence, its first term: i : (S n )n∈N ∈ S −→ S 0 ∈ J1; MK. Definition 2 The set B denoting {0, 1}, let f : BM −→ BM be a function and S ∈ S be a strategy. Then, the so-called chaotic iterations are defined [13] by x0 ∈ BM and ∀n ∈ N∗ , ∀i ∈ J1; MK,  n−1 xi if S n 6= i, n  (1) xi = n−1 f (x ) S n if S n = i. In other words, at the nth iteration, only the S n −th cell is “iterated”. 2) Devaney’s chaotic dynamical systems: Consider a metric space (X , d) and a continuous function f : X −→ X . f is said to be topologically transitive if, for any pair of open sets U, V ⊂ X , there exists k > 0 such that f k (U )∩V 6= ∅. (X , f ) is said to be regular if the set of periodic points is dense in X . f has sensitive dependence on initial conditions if there exists δ > 0 such that, for any x ∈ X and any neighborhood V of x, there exists y ∈ V and n > 0 such that |f n (x) − f n (y)| > δ. δ is called the constant of sensitivity of f . Quoting Devaney in [10], a function f : X −→ X is said to be “chaotic” on X if (X , f ) is regular, topologically transitive, and has sensitive dependence on initial conditions. When f is chaotic, then the system (X , f ) is highly unpredictable because of regularity and sensitive dependence on initial conditions. Moreover, it cannot be simplified (broken down or decomposed into two subsystems which do not interact) because of topological transitivity. These chaotic dynamical systems then present behaviors very similar to physical noise sources. In [5], a rigorous theoretical framework has been introduced for the study of chaotic iterations. It has been proven that chaotic iterations (CIs) presented above satisfy topological chaos properties, which leads to improve the security of data hiding schemes based on CIs. B. Definition of a chaos-based data hiding scheme 1) Most and least significant coefficients: Let us define the notions of most and least significant coefficients of an image. Definition 1 For a given image, most significant coefficients (in short MSCs), are coefficients that allow the description of the relevant part of the image, i.e., its richest part (in terms of embedding information), through a sequence of bits. For example, in a spatial description of a grayscale image, a definition of MSCs can be the sequence constituted by the first four bits of each pixel (see Figure 1). In a discrete cosine frequency domain description, each 8 × 8 block of the carrier image is mapped onto a list of 64 coefficients. The energy of the image is mostly contained in a determined part of themselves, which can constitute a possible sequence of MSCs. Definition 2 By least significant coefficients (LSCs), we mean a translation of some insignificant parts of a medium in a sequence of bits (insignificant can be understand as: “which can be altered without sensitive damages”). These LSCs can be, for example, the last three bits of the gray level of each pixel (see Figure 1). Discrete cosine, Fourier, and wavelet transforms can be used also to generate LSCs and MSCs. Moreover, these definitions can be extended to other types of media. (a) Lena. (b) MSCs of Lena. (c) LSCs of Lena (×17). Figure 1. Example of most and least significant coefficients of Lena. LSCs are used during the embedding stage. Indeed, some of the least significant coefficients of the carrier image will be chaotically chosen and switched, or replaced by the bits of the watermark. The MSCs are only useful in case of authentication; mixture and embedding stages depend on them. Hence, a coefficient should not be defined at the same time as a MSC and a LSC: the last can be altered while the first is needed to extract the watermark. 2) Stages of the scheme: Our data hiding scheme consists of two stages: (1) mixture of the watermark and (2) its embedding. a) Watermark mixture: Firstly, for safety reasons, the watermark can be mixed before its embedding into the image. A common way to achieve this stage is to use the bitwise exclusive or (XOR), for example between the watermark and a pseudo-random binary sequence provided by the generator defined in [6]. In this paper, we introduce a new mixture scheme based on chaotic iterations. Its chaotic strategy will be highly sensitive to the MSCs, in the case of an authenticated watermarking. b) Watermark embedding: Some LSCs will be switched, or substituted by the bits of the possibly mixed watermark. To choose the sequence of LSCs to be altered, a number of integers, less than or equal to the number M of LSCs corresponding to a chaotic sequence U , is generated from the chaotic strategy used in the mixture stage. Thus, the U k th least significant coefficient of the carrier image is either switched, or substituted by the k th bit of the possibly mixed watermark. In case of authentication, such a procedure leads to a choice of the LSCs which are highly dependent on the MSCs [5]. On the one hand, when the switch is chosen, the watermarked image is obtained from the original image whose LSBs L = BM are replaced by the result of some chaotic iterations. Here, the iterate function is the vectorial boolean negation, Figure 2. The chaos-based data hiding decision tree. M M f0 : (x1 , ..., xM ) ∈ B 7−→ (x1 , ..., xM ) ∈ B , (2) III. I MPROVING ROBUSTNESS AGAINST GEOMETRIC the initial state is L, and the strategy is equal to U . In this case, the whole embedding stage satisfies topological chaos properties (see [5]), but the original medium is needed to extract the watermark. On the other hand, when the selected LSCs are substituted by the watermark, its extraction can be done without the original cover (blind watermarking). In this case, the selection of LSBs still remains chaotic because of the use of a chaotic map, but the whole process does not satisfy topological chaos [5]. The use of chaotic iterations is reduced to the mixture of the watermark. See the following sections for more detail. ATTACKS If the watermarked image is attacked, then the MSCs will change. Consequently, in case of authentication and due to the high sensitivity of the embedding sequence, the LSCs designed to receive the watermark will be completely different. Hence, the result of the recovery will have no similarity with the original watermark. In this section, we are interested in improving our scheme to make its use relevant in a social web search context. The idea is to embed the tag of a given image into its pixel values. As neither the cover image nor the tag should be required during a search, the LSBs will be replaced (not switched), by the tags. Authentication is not required, as man-in-themiddle attacks are not supposed to occur. However tags are vulnerable to involuntary attacks such as rotation or resizing, so we need to improve robustness against geometric attacks. To do so, the embedding domain will be the spatial domain. This choice leads to a large given payload, so a lot of tags can be embedded into the cover image. Additionally, we will use Reed-Solomon error correcting codes, to reinforce the capacity to extract the watermark from a tagged image, even though it has been altered. As an illustrative example, we will show how to embed the description of the well-known Lena into its own image. Let us remark that the same procedure can be applied to create a hidden channel for communicating through a given web page, for example, by inserting messages in the background image of this website. In this situation, it is recommended to add the encryption stage to improve the security of the hidden channel. In this illustrative example, the following text extracted from Wikipedia’s description of Lena will be inserted into its own image: The chaos-based data hiding scheme is summed up in Figure 2. Lena (Soderberg), a standard test image originally cropped from the November c) Extraction: The chaotic strategy can be regenerated even in the case of an authenticated watermarking, because the MSCs have not been changed during the embedding stage. Thus, the few altered LSCs can be found, the mixed watermark can be rebuilt, and the original watermark can be obtained. In case of a switch, the result of the previous chaotic iterations on the watermarked image should be the original cover. The probability of being watermarked decreases when the number of differences increase. 1972 issue of Playboy magazine. The cover image will be the Figure 1(a), which is a 256×256 grayscale image. The text to embed is converted into 756 binary digits by using the ASCII table: each of the 109 characters are coded with 7 digits, thus obtaining the following bits flow (called a system): 100110011001011101110110000101000000101000101001111011 111100100110010111100101100010110010111100101100111... 20000 binary digits are computed from a logistic map, with parameters µ = 3.999999, x0 = 0.65, and those binary digits are grouped ten by ten (10 = dlog2 (756)e) to obtain an integer sequence S lesser than or equal to 756. So, chaotic iterations are applied to the above system, with chaotic strategy S and the vectorial boolean negation, to obtain the following encrypted message: (a) Watermarked Lena. 001000111110001110001101110111111000011011010011000101 001011110000110110011010010001110101101100010110101... In this example, there is no authentication step, but ReedSolomon error correction codes are used to increase the robustness. Here, two layers of Reed–Solomon coding, respectively (32,24)-RS and (24,16)-RS codes, are separated by a 3-way convolutional interleaver operation, to obtain a scheme similar to the Cross-Interleaved Reed Solomon Coding (CIRC) of the compact disc. The message to embed is the result of this coding operation: a 2112 binary stream, starting by: 010110100101100000100001000111000010011100111111010001 110111100000010110001101010111011000010011001001110... These 2112 bits will be embedded into Lena, an image constituted by 256 × 256 × 8 = 524288 bits (8 bits per pixel). To do so, we will consider the two least significant bits of each pixel as LSCs: a few of them will be replaced by the bits of the watermark. To select these bits to replace, the strategy S of the encryption stage is used again, to generate a sequence of triplets (xn , y n , z n )n∈N in such a way that xn , y n ∈ J0; 255KN , and z n ∈ {1; 2}N . This generation is realized as follows:  0  x = 11, y 0 = 23,  0 z = 1, and  n+1  x y n+1  n+1 z = 2xn + S 3n + n = 2y n + S 3n+1 + n = 2z n + S 3n+2 + n (mod 255), (mod 255), (mod 2). So the nth bit of the encrypted and encoded binary message is inserted into the z n least significant bit of the pixel in position (xn , y n ) of Lena, to obtain the watermarked Lena in Figure 3(a). In Figure 3(b) the differences are shown between the original Lena and the watermarked Lena. This image illustrates the fact that LSCs to be replaced are chaotically chosen and uniformly distributed [5]. In [4], our scheme has been defined without RS codes and its robustness has been evaluated. It is established that the (b) Differences with Lena. (c) Attacked Lena. Figure 3. Watermarked Lenas (scale reduced). watermark can resist rotation, cropping, JPEG compression, and gaussian noise attacks. However, the extracted watermark is slightly different from the original one and this difference increases with the number of attacks. These errors, which are undesirable in a social web search context, can be corrected by the use of RS codes. To illustrate, the watermarked Lena is zeroed: a square of 40×40 pixels is removed from the image, as in Figure 3(c). So the message is extracted from the watermarked and attacked Lena: the strategy S is regenerated from a logistic map with the same parameters as above. Then the sequences xn , y n and z n can be regenerated too, and the embedded bits can thus be extracted. These bits are decoded in the reverse process: (24,16)-RS decoding, 3-way de-interlacing, and (32,24)-RS decoding codes. Lastly, the resulting bits sequence is decrypted, bits are grouped 7 by 7, and converted into characters with the ASCII table, to obtain the following message: Lena (Soderberg), a standard test image originally cropped from the November 1972 issue of Playboy magazine. IV. I MPROVING ROBUSTNESS AGAINST FREQUENCY DOMAIN ATTACKS In this section, the way to use our scheme in frequency DWT domain is explained. Due to its robustness against frequency attacks such as JPEG compression, this scheme can be used to insert a copyright into a media (digital rights management context). A. Stages and detail The carrier image and watermark are the same as in Section III, but Lena is now constituted by 512 × 512 pixels. The embedding domain is the discrete wavelets domain (DWT). In this paper, the Daubechies family of wavelets is chosen: Lena is converted into its Daubechies-1 DWT coefficients, which are altered by chaotic iterations. The watermark is encrypted by chaotic iterations before its embedding, with the same procedure as above. Each example below depends on a decomposition level and a coefficient matrix (Figure 4): LL means approximation coefficient, when HH, LH, HL denote respectively diagonal, vertical and horizontal detail coefficients. For example, the DWT coefficient HH2 is the matrix equal to the diagonal detail coefficient of the second level of decomposition of Lena. Table I RMS VALUES FOR A HH2 EMBEDDING HH2 embedding µ Encryption Embedding U 0 Iterations Authentication RMS 1.131 1.129 0.796 1.122 3.99987 - 0.64 - 19950 - MSB = [5,6,7] Coefficient S0 LSB RMS HH1 - 2 - [1] 253.65 0.653 0.983 vectorial boolean negation and chaotic strategy is defined as in Equation 3, with U 0 = 1 and M = 2562 . Figure 4. Wavelets coefficients. To embed the encrypted watermark, LSCs are obtained from the coefficients defined above. The system to iterate is the boolean vector of size 2562 , constituted by these M LSCs of Lena. Iterate function is the vectorial boolean negation, and chaotic strategy U is defined as follows:  0 U = S0 (3) n+1 U = S n+1 + 2 × U n + n (mod M). (a) Original Lena. (b) Watermarked Lena. Figure 5. Data hiding in DWT domain where S denotes the strategy used in the encryption stage (see [4]). Thus, bits of the LSCs are switched, not replaced: the whole embedding process satisfies Devaney’s chaos property [5]. However, for this reason, the watermark cannot be extracted: contrary to Section III, we are not in a steganographic framework, but in a pure non-blind watermarking scheme used for digital rights management. To know if a given image I 0 is the watermarked version of another image I: 0 • the whole process is applied to I , with the same parameters (LSCs, watermark, etc.), to obtain I 00 , 00 • I is compared to the original I. To q evaluate the differences, the RMS value defined by PM 1 00 2 x̄ = i=1 (I − I )i is computed. The probability that M the image has been watermarked increases when the RMS decreases. Indeed, each bit of the LSCs of I 00 has been switched an even number of times (the RMS is nonzero because of computational errors). In this situation, PSNR = 53.45 dB. Pixel values have been modified by at most of one level of gray. The mean value of differences is equal to 0.294, when RMS = 0.542. The alteration can thus be considered as indistinguishable. 2) Extraction: The system to iterate is constituted by the second least significant bit of each integral value of HH2, the approximation coefficient of the first decomposition level of the watermarked Lena. The iterate function is the vectorial boolean negation and the chaotic strategy is computed as above. Thus, the result is compared to the coefficient HH2 of the original Lena. The RMS is equal to 0.129. As a comparison, Table I gives the RMS values resulting on a bad extraction (wrong parameters, etc.) Symbol ‘-’ means that the value of the considered parameter is unchanged. We show that the least RMS is obtained for an extraction with the same parameters as the embedding. Let us notice that if the extraction is attempted to the original Lena, RMS is twice greater than 0.127. B. First example: coefficient HH2 C. Second example: coefficient LL1 1) Embedding: In this first experiment, the watermark is inserted into the diagonal coefficient HH2 (a real matrix of size 128 × 128). LSCs are the second least significant bit of each integral value of HH2. To do the insertion, chaotic iterations are made. The system to iterate is the boolean vector of size 1282 , constituted by the LSCs of Lena. Iterate function is the 1) Embedding: In this paragraph, the watermark is inserted into the approximation coefficient LL1 of Lena (a real matrix of size 256 × 256) and LSCs are the second least significant bit of each integral value of LL1. To realize the embedding, chaotic iterations are realized as before. The system to iterate is the boolean vector, of size Table II RMS VALUES FOR A LL1 EMBEDDING LL1 embedding µ Encryption Embedding U 0 Iterations Authentication RMS 0.669 0.670 0.443 0.667 3.99987 - 0.64 - 19950 - MSB = [5,6,7] Coefficient S0 LSB RMS HH1 - 2 - [1] 223.737 0.135 0.548 2562 , constituted by the LSCs of Lena. Iterate function is the vectorial boolean negation, chaotic strategy is defined as in Equation 3 with U 0 = 1, and M = 2562 . In this situation, PSNR = 60.06 dB. Pixel values have been modified by at most two levels of gray. The mean value of differences is 0.063, when the RMS is equal to 0.245. For all of these reasons, the alteration can be considered again as indistinguishable. 2) Extraction: The system to iterate is constituted by the second least significant bit of each integral value of LL1. Iterate function is the vectorial boolean negation and chaotic strategy is computed as above. Thus, the result is compared to the coefficient LL1 of the original Lena. In our example, we obtain RMS = 0.127. As a comparison, Table II gives the RMS values resulting in a bad extraction (wrong parameters, etc.) Symbol ‘-’ means that the value of the considered parameter is unchanged. We show that the least RMS is obtained for an extraction with the same parameters as the embedding. Let us remark that if the extraction is tried on the original Lena, then RMS is twice greater than 0.127. V. D ISCUSSION AND FUTURE WORK In this paper, the robustness of the data hiding scheme proposed in [4] is improved to achieve properties required in Internet applications of data hiding techniques. This scheme depends on a general description of the carrier medium to watermark, in terms of the significance of some coefficients we called MSCs and LSCs. The encryption of the watermark and the selection of coefficients to alter are based on chaotic iterations, which generate topological chaos in the sense of Devaney [5]. Thus, the proposed scheme has a sufficient level of security for Internet applications, such as digital rights management or social web search. We have proposed in this paper to enlarge the relevance of our scheme in these contexts by using Reed-Solomon error correcting codes and wavelets domain. The first improvement is relevant in a social web search domain, in which the tags of an image must be recovered exactly, even though the image has faced geometric operations. The use of wavelets domain is linked more to digital rights management. This domain is known to present good results against frequency attacks, which can occur when someone tries to remove some DRM. It can be noticed that these two improvements can be realized together. The schemes have been evaluated through attacks and results have been experimentally obtained. Choices that have been made in this first study are simple: spatial and Daubechies domains for the embedding, negation function as iteration function, etc. The aim was not to find the best watermarking method generated by our general scheme, but to explain how to improve robustness for Internet applications. In future work, other choices of iteration functions and chaotic strategies will be explored and compared in order to increase authentication and robustness to attacks. In addition, new frequency domain representations will be used to select the MSCs and LSCs. Properties induced by topological chaos, such as entropy, will be explored and their role in Internet applications will be explained. R EFERENCES [1] Delicious social bookmarking, http://delicious.com/. [2] The flickr collection, http://www.flickr.org/. [3] A. Adelsbach, S. Katzenbeisser, and A.-R. Sadeghi. A computational model for watermark robustness. In Camenisch et al. [7], pages 145– 160. [4] J. Bahi and C. Guyeux. A new chaos-based watermarking algorithm. In SECRYPT 2010, International conference on security and cryptography, pages ***–***, Athens, Greece, 2010. To appear. [5] J. Bahi and C. Guyeux. Topological chaos and chaotic iterations, application to hash functions. In WCCI’10, IEEE World Congress on Computational Intelligence, pages ***–***, Barcelona, Spain, July 2010. To appear. [6] J. Bahi, C. Guyeux, and Q. Wang. A novel pseudo-random generator based on discrete chaotic iterations. In Internet 2009, pages 71–76, Cannes, France, August 2009. [7] Jan Camenisch, Christian S. Collberg, Neil F. Johnson, and Phil Sallee, editors. IH 2006: Information Hiding, 8th International Workshop, volume 4437 of Lecture Notes in Computer Science, Alexandria, VA, USA, July 2007. Springer. [8] J. Cong, Y. Jiang, Z. Qu, and Z. Zhang. A wavelet packets watermarking algorithm based on chaos encryption. Lecture Notes in Computer Science, 3980:921–928, 2006. [9] Z. Dawei, C. Guanrong, and L. Wenbo. A chaos-based robust waveletdomain watermarking algorithm. Chaos, Solitons and Fractals, 22:47– 54, 2004. [10] R. L. Devaney. An Introduction to Chaotic Dynamical Systems, 2nd Edition. Westview Pr., March 2003. [11] A. D. Ker. Batch steganography and pooled steganalysis. In Camenisch et al. [7], pages 265–281. [12] Y. Nakashima, R. Tachibana, and N. Babaguchi. Watermarked movie soundtrack finds the position of the camcorder in a theater. IEEE Transactions on Multimedia, 2009. Accepted for future publication Multimedia. [13] F. Robert. Discrete Iterations: A Metric Study, volume 6 of Springer Series in Computational Mathematics. 1986. [14] X. Wu, Z.-H. Guan, and Z. Wu. A chaos based robust spatial domain watermarking algorithm. Lecture Notes in Computer Science, 4492:113– 119, 2007.
7cs.IT
Interval peak-to-peak observers for continuous- and discrete-time systems with persistent inputs and delays Corentin Briat and Mustafa Khammash arXiv:1511.07888v5 [math.OC] 29 Jul 2016 Department of Biosystems Science and Engineering, ETH–Zürich, Switzerland. Abstract While the design of optimal peak-to-peak controllers/observers for linear systems is known to be a difficult problem, this problem becomes interestingly much easier in the context of interval observers because of the positive nature of the error dynamics. Indeed, by exploiting several recent results on positive systems, we propose a novel and non-conservative approach formulated in terms of tractable finite-dimensional linear programs for designing a class of interval observers achieving minimum peak-topeak gain. The optimal observer is notably shown to be uniform over the set of all possible mappings between observation errors and their weighted versions, which parallels a recent result on the stabilization of linear positive systems. Results pertaining on the interval observation of time-delay and discrete-time systems are then obtained as a direct application of the proposed method, emphasizing then its versatility. Several examples on the interval observation of linear and nonlinear systems are finally given for illustration. Key words: Interval observers, positive systems; peak-to-peak gain; delay systems 1 Introduction Interval observers [1, 2] are an interesting class of observers that can be used to estimate upper- and lowerbounds on the state value of a given system at any given time. The rationale for using such observers lies in the fact that when the observed system is subject to disturbances or uncertainties, estimation errors are often unavoidable, unless decoupling is possible. When this happens, then it becomes unclear in which region the state currently lies. This problem is elegantly resolved, among others, by the use of interval observers that will estimate an upper- and a lower-bound on the current statevalue, thereby explicitly defining an interval where the state lies within. In this respect, interval observers are highly relevant in the context of observation of systems for which only a poor model is available, like in fields such as ecology, epidemiology or biology; see e.g. [3]. Interval observers have been already considered for systems with inputs [4], linear systems [5–7], uncertain systems [8], time-varying systems [9], delay systems [10–12], nonlinear systems [13, 14], LPV systems [15, 16], discrete-time Email addresses: [email protected], [email protected] (Corentin Briat), [email protected] (Mustafa Khammash). URLs: http://www.briat.info (Corentin Briat), https://www.bsse.ethz.ch/ctsb (Mustafa Khammash). Preprint submitted to Automatica systems [17], for stabilization [11, 18], etc. The underlying idea is to design an observer in a way that makes the observation errors nonnegative over time, which is equivalent to having error dynamics represented by a positive system [19]. This positivity property is very important to consider because of the interesting properties of positive systems. It is indeed now well-known that their stability [20] and their L1 -/L∞ -gain can be established using finite-dimensional linear programs [21, 22]. We hence consider here a simple class of interval observers and propose a methodology for designing them so that the L∞ -gain of the operator mapping the persistent input errors (disturbances) to the observed output – a weighted version of the observation errors – is minimum; see e.g. [23, 24]. By doing so, we simply attempt to minimize the influence of the disturbances on the width of the interval in a peak-to-peak sense. It is also important to stress that, in this context, considering bounded and persistent disturbances (i.e. in L∞ ) seems more relevant than considering vanishing ones, as in the L1 and in the L2 frameworks, as the disturbances may depend on persistent exogenous signals or on the state of the process. The general control/observation/filtering problems are reputed to be difficult in this framework; see e.g. [23–27]. The approach proposed in this paper is different than the one that could have been based on the so-called ∗- 1 August 2016 2 norm [28] which is known to be a loose characterization of the peak-to-peak gain as minimizing the ∗-norm does not necessarily result in a small peak-to-peak norm; see e.g. [29]. The approach is also different from the one considered in the context of set-valued observers [30] that aims at estimating the set of all possible states based on the knowledge of the output of the system and a model of the exogenous signals. These observers are known to be difficult to implement in real-time due to a high computational burden. 2.1 Preliminaries The L∞ -norm and the L∞ -gain of linear systems Definition 1 ( [32]) The space of essentially bounded functions w : R≥0 → Rp is denoted by L∞ (R≥0 , Rp ) and the associated norm is defined as ||w||L∞ := ess sup ||w(t)||∞ t≥0 where || · ||∞ is the standard vector ∞-norm. In what follows, we will use the shorthand L∞ for simplicity. O The approach considered in this paper is instead based on positive systems theory and leads to both constructive and nonconservative design conditions that take the form of tractable finite-dimensional linear programs, thereby circumventing the inherent difficulties of the design of general optimal peak-to-peak observers. Interestingly, the optimal interval observer is uniform over all the possible values for the matrix parameter that maps the observation errors to the performance outputs. This essentially means that changing the performance specifications (i.e. the performance output) will not require the re-design of the optimal interval-observer. Note, however, that the performance level, i.e. the actual L∞ -gain, is not uniform and will actually vary when the performance output is changed. This property is dual to the one obtained in [31] that states that the optimal statefeedback controller that minimizes the L1 -gain of the closed-loop system is uniform over the set of all the possible values for the input matrices driving the disturbance into the system. Finally, it seems important to mention that even though the class of problems we consider in this paper may seem restrictive, it is demonstrated that the proposed approach extends, among others, to more complex observers, to systems with delays and to discrete-time systems in a very natural way. Definition 2 ( [32]) Let us consider an asymptotically stable LTI system G mapping p inputs to q outputs. Then its L∞ -gain (or L1 -norm) is defined as ||G||L∞ −L∞ = sup ||Gw||L∞ . O ||w||L∞ =1 2.2 Linear positive systems Let us start with fundamental definitions: Definition 3 A matrix A ∈ Rn×n is said to be Metzler if all its off-diagonal entries are nonnegative. O Proposition 4 ( [19]) Let us consider the following system ẋ(t) = Ax(t) + Ew(t), x(0) = x0 (1) z(t) = Cz x(t) + Fz w(t). where x, x0 ∈ Rn , w ∈ Rp , and z ∈ Rq are the state of the system, the initial condition, the input and the output. The following statements are equivalent: Outline. Section 2 introduces the considered norms for signals and systems, as well as tools for computing them whenever the considered systems are positive. The problem of designing L∞ -to-L∞ interval-observers for continuous-time systems with persistent disturbances is solved in Section 3. Examples are discussed in Section 4. (a) The system is positive, i.e. for all x0 ≥ 0 and w(t) ≥ 0, we have that x(t) ≥ 0 and z(t) ≥ 0. (b) The matrix A is Metzler and the matrices E, Cz and Fz are nonnegative matrices. M We now state two fundamental stability results regarding the stability of linear positive systems: Notations. The set of positive and nonnegative real numbers are denoted by R>0 and R≥0 , respectively, and they naturally extend to vectors and matrices as Rn×m ≥0 , n×m R>0 where the inequality signs are entry-wise. The ndimensional vector of ones is denoted by 1n . For two vectors a, b ∈ Rn , a < (≤)b means that b − a ∈ Rn>0 (Rn≥0 ). The sequence {ei }ni=1 is used to represent the natural basis of Rn . Theorem 5 ( [19]) Let us consider a Metzler matrix A ∈ Rn×n . Then, the following statements are equivalent: (a) A is Hurwitz stable. (b) There exists a λ ∈ Rn>0 such that λT A < 0. (c) There exists a µ ∈ Rn>0 such that Aµ < 0. 2 M Theorem 6 ( [21, 22]) Let A ∈ Rn×n be a Metzler maq×n q×p trix and E ∈ Rn×p ≥0 , C ∈ R≥0 and F ∈ R≥0 be nonnegative matrices. Let γ > 0, then the following statements are equivalent: Remark 7 It is important to stress here that the choice of a common observer gain L in (4) seems to be restrictive at first sight. This is quite surprisingly not the case as it will be shown later that the same optimal gain will simultaneously minimize the L∞ -gain of both the transfers δ − 7→ ζ − and δ + 7→ ζ + , even when M − 6= M + . In this regard, the values of the matrices M − and M + do not matter at all when designing the optimal gain L. This will be discussed in more details in Section 3.2. (a) The linear system (1) is asymptotically stable and ||w 7→ z||L∞ −L∞ < γ. (b) A is Hurwitz stable and (−Cz A−1 E + Fz )1p < γ1q . (c) There exists a λ ∈ Rn>0 such that the conditions Aλ + E1p < 0 Cz λ + Fz 1p − γ1q < 0 hold. 3 With all these elements in mind, we can state the considered observation problem: (2) M Problem 8 Find an interval observer of the form (4) such that A class of L∞ -to-L∞ interval-observers (3) (a) The linear systems in (5) are positive, i.e. A − LC is Metzler and E − LF is nonnegative; (b) The linear systems in (5) are asymptotically stable; i.e. A − LC is Hurwitz stable; (c) The L∞ -gains of the transfers δ • 7→ ζ • , • ∈ {−, +}, are minimal. where x, x0 ∈ Rn , w ∈ Rp , y ∈ Rr are the state of the system, the initial condition, the persistent disturbance input and the measured output. Note that this system is not necessarily positive. We are interested in finding an interval-observer of the form Remark 9 More complex observer structures can also be considered in order to reduce the conservatism of the approach. For instance, high-order observers such as the ones proposed in [33] may be considered. Alternatively, a relaxed version of the proposed one which takes the form 3.1 Preliminaries Let us consider now the following system ẋ(t) = Ax(t) + Ew(t), x(0) = x0 y(t) = Cx(t) + F w(t) ẋ• (t) = Ax• (t) + Ew• (t) + Lm• (t) m• (t) = y(t) − Cx• (t) − F w• (t) x̃˙ + (t) = [A − LC]x̃+ (t) + Ly(t) (4) +[E − LF ]+ w+ (t) − [E − LF ]− w− (t), x• (0) = x•0 x̃˙ − (t) = [A − LC]x̃− (t) + Ly(t) where • ∈ {−, +}. Above, the observer with the superscript “+” is meant to estimate an upper-bound on the state value whereas the observer with the superscript “” is meant to estimate a lower-bound; i.e. we would like to have x− (t) ≤ x(t) ≤ x+ (t) for all t ≥ 0 provided that + − + x− ∈ L∞ (R≥0 , Rp ) 0 ≤ x0 ≤ x0 . The signals w , w are the lower- and the upper-bound on the disturbance w(t), i.e. w− (t) ≤ w(t) ≤ w+ (t) for all t ≥ 0. We then accordingly define the errors e+ (t) := x+ (t) − x(t) and e− (t) := x(t) − x− (t) that are described by the models ė• (t) = (A − LC)e• (t) + (E − LF )δ • (t) ζ • (t) = M • e• (6) +[E − LF ]+ w− (t) − [E − LF ]− w+ (t) where [E − LF ]+ = max{0, E − LF } and [E − LF ]− = [E − LF ]+ − [E − LF ] can also be considered. The advantage of the above one lies in the fact that the nonnegativity of the matrix E − LF is not required anymore. However, when an interval observer of the form (4) exists, it may be preferable to use it since it captures more information about the system. This will be illustrated in the examples treated in Section 4. (5) Remark 10 As it may be sometimes difficult to find a matrix L that makes the matrix A − LC both Metzler and Hurwitz stable, the determination of a nonsingular matrix P and a matrix L such that the matrix P (A−LC)P −1 is Metzler and Hurwitz stable is often considered. Suitable pairs (P, L) can be computed using various methods; see e.g. [34]. where • ∈ {−, +} and where δ + (t) := w+ (t) − w(t) ∈ Rp≥0 , δ − (t) := w(t) − w− (t) ∈ Rp≥0 are the input errors. The matrices M − , M + ∈ Rq×n ≥0 are the nonzero matrices driving the observation errors e• to the observed outputs ζ • , that we assume to be chosen a priori. 3 3.2 However, Theorem 6 cannot be simply considered for all the Σi ’s independently as each subsystem Σi would require its own Lyapunov function; i.e. the use of different λ’s. A simple solution is to enforce the λ’s to be all the same, which is equivalent to searching for a common Lyapunov function for all the subsystems and is known to be a conservative procedure in general. This is luckily not the case here as proved in the next two results: The uniformity of L∞ -to-L∞ interval observers For the sake of generality, let us consider now the following slightly more general system: ( Σ: ˙ ξ(t) = (A − LC)ξ(t) + (E − LF )ω(t) (7) χ(t) = M ξ(t) + N ω(t) Lemma 12 Let W ∈ Rn×n be a Metzler and Hurwitz stable matrix and let u, vi ∈ Rn≥0 , i = 1, . . . , q, be nonnegative vectors. Then, the following statements are equivalent where ξ ∈ Rn , ω ∈ Rp≥0 , χ ∈ Rq and L ∈ Rn×r . The matrices are defined such that their dimension corresponds to those of the signals. The only assumption is that both M and N are nonnegative and that M is nonzero. We now address the question stated in Problem 8 where the matrix N is now considered and (x, δ • , ζ • ) are replaced by (ξ, ω, χ). (a) The matrices W + uviT are Hurwitz stable for all i = 1, . . . , q. (b) There exists a ψ ∈ Rn>0 such that (W + uviT )ψ < 0 holds for all i = 1, . . . , q. Formally speaking, we are interested in solving the problem γ ∗ = inf ||ω 7→ χ||L∞ −L∞ (8) Proof : This result is dual to the one obtained in [31] and its proof, based on Farkas’ Lemma, is omitted for brevity. ♦ L∈L where ( L := L∈R n×r A − LC Metzler and Hurwitz, ) Lemma 13 Let γ ∈ R>0 and L ∈ L. Then, the following statements are equivalent: E − LF ≥ 0 (9) and in computing the matrix L∗ that achieves this infimum. To this aim, let us define γ ∗ := γ ∗ (Σ(M, N )) and L∗ := L∗ (Σ(M, N )). The main rationale for the notation Σ(M, N ) stems from the property of uniformity of the optimal L∞ -to-L∞ interval observers stated in the result below: (a) ||Σ(M, N )||L∞ −L∞ < γ. (b) The matrices " eTi M eTi N − γ # , i = 1, . . . , q (12) are Metzler and Hurwitz stable. (c) ||Σ(eTi M, eTi N )||L∞ −L∞ < γ, i = 1, . . . , q. Lemma 11 Assume that the system (7) is MISO; i.e. q = 1. Then, the membership relation L∗ (Σ(1Tn , 1Tp )) ∈ L∗ (Σ(M, N )) A − LC (E − LF )1p Proof : The proof follows the same lines as the proof of Lemma 6 in [31], it is therefore only sketched. The equivalence between (b) and (c) follows from Theorem 5. The implication (a)⇒(b) is straightforward whereas the reverse implication follows from an application of Lemma 12. ♦ (10) 1×p holds for all (M, N ) ∈ R1×n ≥0 × R≥0 where L∗ (Σ(M, N )) := {L ∈ L : ||Σ(M, N )||L∞ −L∞ = γ ∗ } . (11) 3.3 Proof : The proof uses the same arguments as for proving Lemma 4 in [31] and is omitted for brevity. ♦ Design of L∞ -to-L∞ interval observers By combining the results stated in Theorem 6, Lemma 11 and Lemma 13, we can state the main result of the paper: The above result says that, for a MISO system of the form (7), there exists a value for L that simultaneously minimizes the L∞ -gain of the system Σ(M, N ) 1×p for all matrices (M, N ) ∈ R1×n ≥0 × R≥0 . This value can be, moreover, calculated by considering the system Σ(1Tn , 1Tp ) and Theorem 6. The issue here is that this result only holds for MISO systems but can be generalized using the fact that the L∞ -gain of Σ can be expressed as maxi=1,...,q {||Σi ||L∞ −L∞ }, where Σi maps ω to χi . Theorem 14 The following statements are equivalent: (a) There exists an optimal L∞ -to-L∞ intervalobserver of the form (4) for the system (3). (b) We have that L∗ (Σ(1Tn , 1Tp )) ∈ L∗ (Σ(M, N )) 4 (13) q×p for all (M, N ) ∈ Rq×n ≥0 × R≥0 . Moreover, the op∗ timal gain is given by L (Σ(1Tn , 1Tp )) = (X ∗ )−1 U ∗ where the pair (X ∗ , U ∗ ) is the optimal solution of the linear program inf X,U,α,γ γ Remark 16 As shown in [22], it is also possible to incorporate explicit bounds on the entries of L in a nonconservative way. To this aim, let us define the matrices Lmin , Lmax ∈ Rn×r verifying Lmin ≤ Lmax , componentwise. Assume now that we would like to design a gain L satisfying Lmin ≤ L ≤ Lmax , then it is necessary and sufficient to adjoin to the optimization problem of Theorem 14 the linear constraint XLmin ≤ U ≤ XLmax . Interestingly, when the (i, j)-th entries of Lmin and Lmax are identical, then the (i, j)’s entry of L will be set to this specific value. This may be used to impose a structural constraint on the matrix L, i.e. some entries set to 0. (14) where U ∈ Rn×r , α ∈ R, X ∈ Rn×n diagonal, X1n > 0, (15) XA − U C + αIn ≥ 0, XE − U F ≥ 0 Remark 17 In the case where the relaxed observer (6) is considered, then an optimal gain L∗ can be computed by substituting XE − U F by the identity matrix I in Theorem 14. and " 1n #T " # XA − U C (XE − U F )1p 1Tn 1 q−γ <0 (16) 3.4 Proof : The proof is dual to the proof of Theorem 1 in [31]. We can see first that, from Lemma 13, the condition (13) is satisfied if and only if L∗ (Σ(1Tn , 1Tp )) ∈ L∗ (Σ(eTi M, eTi N )) Rq×n ≥0 Extensions of the results We provide here some interesting extensions of the main result. (17) 3.4.1 q×p × R≥0 . holds for all i = 1, . . . , q and all (M, N ) ∈ By virtue of Lemma 11, this condition readily holds. Therefore, all we need to do is to compute the optimal gain L∗ (Σ(1Tn , 1Tp )). To see that this is performed by the linear program stated in the result, first note that the conditions XA − U C + αIn ≥ 0 and XE − U F ≥ 0 are equivalent to saying that the matrix A − LC is Metzler and that the matrix E − LC is nonnegative whenever considering the change of variables U = XL. Using the same change of variables, the condition (16) is equivalent to saying that Continuous-time systems with delay The results can also be straightforwardly extended to systems with delays [22, 35, 36] since it is known that a linear positive system with delay is stable if and only if the system with zero-delay is stable. By exploiting this connection with nondelayed systems, we can apply the obtained results to time-delay systems of the form: ẋ(t) = Ax(t) + Ah x(t − h) + Ew(t) y(t) = Cx(t) + Ch x(t − h) + F w(t) (19) x(s) = ϕ(s), s ∈ [−h, 0] " #T " #" # 1n X 0 A − LC (E − LF )1 1 0 1 1T q−γ < 0. where h ≥ 0 is the constant delay and ϕ ∈ C([−h, 0], Rn ) is the initial condition. We then propose the following extension to the interval observer (4): (18) which is, in turn, equivalent to saying that the L∞ of the system Σ(1Tn , 1Tp ) is smaller than γ > 0. Therefore, the optimal-gain L∗ (Σ(1Tn , 1Tp )) can be computed by solving the linear program stated in the result. The proof is complete. ♦ ẋ• (t) = Ax• (t) + Ah x• (t − h) + Ew• (t) + Lm• (t) m• (t) = y(t) − Cx• (t) − Ch x• (t − h) − F w• (t) x• (0) = x•0 (20) where • ∈ {−, +}. The observed outputs ζ • are defined as in the delay-free case; i.e. ζ • = M • e• . This leads us to the following result: Remark 15 It is important to stress here that the minimal γ ∗ > 0 that is computed using the linear program in Theorem 14 is not uniform over the set of M − , M + matrices. In this regard, if we are interested in the actual L∞ -gain for given matrices M − , M + , one has to first compute the optimal gain L∗ using Theorem 14 and then compute the actual-gain for the error model using Theorem 6. This will be illustrated in the example in Section 4.1. Proposition 18 The following statements are equivalent: (a) There exists an optimal L∞ -to-L∞ intervalobserver of the form (20) for the system (19). 5 (b) We have that L∗ (Σ(1Tn , 1Tp )) ∈ L∗ (Σ(M, N )) continuous-time and discrete-time stability conditions for general linear systems are structurally quite different, the stability conditions are interdependent in the case of positive systems because of the fact that a nonnegative matrix Z is Schur stable iff the Metzler matrix Z − I is Hurwitz stable 1 . From a direct inspection of the results of Theorem 6 and its discrete-time analogue (see [39]), we can immediately see that the `∞ -gain of a positive LTI discrete-time system (Ad , Ed , Cd , Fd ) is equal to the L∞ -gain of the positive LTI continuoustime system (Ad − I, Ed , Cd , Fd ), thereby allowing us to state the following result: (21) q×p for all (M, N ) ∈ Rq×n ≥0 × R≥0 . Moreover, the optimal gain is given by L∗ (Σ(1Tn , 1Tp )) = (X ∗ )−1 U ∗ where the pair (X ∗ , U ∗ ) is the optimal solution of the linear program inf X,U,α,γ γ (22) where U ∈ Rn×r , α ∈ R, X ∈ Rn×n diagonal, X1n > 0, XA − U C + αIn ≥ 0, XE − U F ≥ 0, XAh − U Ch ≥ 0 and " 1n #T " 1 Ψ (XE − U F )1p 1Tn q−γ Proposition 19 The following statements are equivalent: (a) There exists an optimal `∞ -to-`∞ interval-observer of the form (26) for the system (25). (b) We have that # <0 (23) L∗ (Σ(1Tn , 1Tp )) ∈ L∗ (Σ(M, N )) where Ψ = X(A + Ah ) − U (C + Ch ). q×p for all (M, N ) ∈ Rq×n ≥0 × R≥0 . Moreover, the op∗ timal gain is given by L = (X ∗ )−1 U ∗ where the pair (X ∗ , U ∗ ) is the optimal solution of the linear program inf γ (28) Proof : This result is a consequence of Theorem 14 and the results on the L∞ -gain of linear positive systems with delays; see e.g. [37, 38]. ♦ X,U,γ Note that the above result can be straightforwardly adapted to the cases of multiple constant delays, timevarying delays and distributed delays [37]. This is omitted for brevity. n×r where U ∈ R , X ∈ Rn×n diagonal, X1n > 0, XAd − U Cd ≥ 0, XEd − U Fd ≥ 0 and " 3.4.2 Discrete-time systems sup 1n #T " X(Ad − I) − U C (XE − U F )1p 1Tn 1 ||Gw||`∞ < 0. By combining the results in Proposition 18 and Proposition 19, we can readily obtain a condition for the design of an optimal interval observer for discrete-time systems with delays. (24) ||w||`∞ =1 where ||w||`∞ := supk∈N ||w(k)||∞ . We will also work here with the following discrete-time counterpart of (3) x(k + 1) = Ad x(k) + Ed w(k), x(0) = x0 q−γ # (29) Similarly to as in the continuous-time case, we can define the `∞ -gain of an LTI discrete-time system G as ||G||`∞ −`∞ := (27) 4 4.1 (25) Examples Stable linear systems y(k) = Cd x(k) + Fd w(k) Caseh 1. iLet us consider the system (1) with matrices C = 0 1 , F = 1, for which we will consider the following intervalobserver: x• (k + 1) = Ad x• (k) + Ed w• (k) + Lm• (k) m• (k) = y(k) − Cd x• (k) − Fd w• (k) A= (26) x• (0) = x•0 1 " # −2 1 3 −5 and E = " # 1 . (30) 2 This follows from the facts that Z ≥ 0 is Schur stable iff there exists a vector λ > 0 such that λT (Z − I) < 0. This is, in turn, equivalent to the Hurwitz stability of the Metzler matrix Z − I. where • ∈ {−, +}. The observed outputs ζ • are defined as in the continuous-time case; i.e. ζ • = M • e• . While 6 Using Theorem 14, we find the optimal observer gain L∗ = [1 2]T . Note, however, that the computed minimum value for γ ∗ is the one corresponding to the matrices M + = M − = 1Tn . Choosing then M + = M − = In and computing the actual L∞ -gain (using Theorem 6) with the previously computed observer matrix gain L∗ gives an L∞ -gain that is nearly 0, which is consistent with the fact that E −L∗ F = 0 (perfect decoupling). UsT ing the initial conditions x0 = [−1 2]T , x− 0 = [−5 −5] , + T x0 = [5 5] , the persistent input w(t) = sin(t) and the bounds w− (t) = −1 and w+ (t) = 1, yield the trajectories depicted in Fig. 1 where we can see that the trajectories of the observers converge from above and below to the actual state trajectory of the system. 5 x1 (t) x!;+ 1 (t) x ~!;+ 1 (t) 0 -5 0 1 2 3 4 5 6 5 x2 (t) 7 8 x!;+ 2 (t) 9 10 x ~!;+ 2 (t) 0 -5 0 1 2 3 4 5 6 7 8 9 10 Time Case 2. Changing now the matrix A to " A= −2 −1 Fig. 2. Trajectories of the system (31) and its optimal L∞ -to-L∞ interval observer (4) and (6). # (31) 3 −5 Comparison with the observer (6). We now compare the results obtained with the observer (4) to the results obtained with the relaxed observer (6). Using Theorem 14 and Remark 17, we get that L∗ = [1 10]T in Case 1 and L∗ = [−1 10]T in Case 2 and Case 3. It is readily found that A − L∗ C is the same for all three cases and, therefore, that γ ∗ = 0.501. We can see in Fig.1 that the observer (4) performs much better than the relaxed observer (6) as it allows for decoupling through the consideration of the input matrix E − LF . In Fig. 2, we can also see that the interval observer (4) gives better results than the relaxed observer (6) since the maximal error is lower, even though the theoretical attenuation level γ is higher. A main issue with the relaxed observer is that the disturbance vector is artificially augmented from dimension p to n ≥ p. In this regard, the computed optimal gain of the relaxed observer (6) is clearly suboptimal for the original problem. The advantage of the relaxed observer is shown in Fig. 3 where interval observation is performed on the system treated in Case 3 for which no interval observer of the form (4) exists. and solving for the observer gain yields the value L∗ = [−1 2]T . Solving for the minimal γ with M − = M + = I in Theorem 6 yields the value γ ∗ = 1.4304, showing that decoupling is no longer possible if positivity is to be preserved. Using the same scenario as for the previous system yields the trajectories depicted in Fig. 2 where we can see that, in spite of the observation error, the optimal design of the observers allow for an accurate estimation of the interval. 5 x1 (t) x!;+ 1 (t) x ~!;+ 1 (t) 0 -5 0 1 2 3 4 5 6 5 x2 (t) 7 8 x!;+ 2 (t) 9 10 x ~!;+ 2 (t) 4.2 0 Let us consider now the following 3-stage population model [1] given by -5 0 1 2 3 4 5 6 7 8 9 A nonlinear system 10 Time a(t)x3 (t) b + x3 (t) ẋ2 (t) = α1 x1 (t) − β2 x2 (t) Fig. 1. Trajectories of the system (30) and its optimal L∞ -to-L∞ interval observers (4) and (6). ẋ1 (t) = −β1 x1 (t) + (32) ẋ3 (t) = α2 x2 (t) − β3 x3 (t) Case 3. Finally, if we consider the matrix A in (31) and the matrix E = [1 −6]T , then the optimization problem in Theorem 14 fails, meaning that an interval observer of the form (4) does not exist for this system. This comes from the fact that E − LF ≥ 0, L = [`1 `2 ]T , if and only if `2 ≤ −6 and that a necessary condition for the matrix A − LC be Hurwitz stable is `2 > −5. where α1 , α2 , β1 , β2 , β3 and b are positive parameters. The function a(t) is assumed to be continuous and to satisfy a(t) ∈ [a− , a+ ], for some 0 < a− < a+ . These system may have either one or two equilibrium points depending on the values of the parameters. The 0-equilibrium 7 5 x1 (t) sufficiently small |`1 | and |`2 |. We show now that for any `3 such that the matrix A − LC is Hurwitz stable, negative values for `1 and `2 will increase the norm of the system. Let us define LC =: `3 vv T + uv T where u = [`1 `2 0]T and v = [0 0 1]T . Then, we have that A − LC = A − `3 vv T − uv T and using the ShermanMorrison formula, we get that ! Ã−1 uv T Ã−1 −1 −1 −(A−LC) E = − à + E ≥ −Ã−1 E 1 − v T Ã−1 u x ~!;+ 1 (t) 0 -5 0 1 2 3 4 5 6 7 8 5 x2 (t) 9 10 x ~!;+ 2 (t) where à = A − `3 vv T . This inequality follows from the facts that the numerator of the fraction above is nonpositive (recall that Ã−1 ≤ and that `1 , `2 ≤ 0), that its denominator is positive for some sufficiently small |`1 | and |`2 | and that E is nonnegative. This implies that when |`1 | and |`2 | increase, then the gain increases as well. Therefore we need to set `1 = `2 = 0, which leads to the expression:   1 α1 α1 α2 −1 max{−(A−LC) E} = . max 1, , β1 β2 β2 (β3 + `3 ) (36) We can see that by choosing a sufficiently large `3 , then we can act on the last entry and make it smaller than the max of the others. Simple calculations then yield the result. ♦ 0 -5 0 1 2 3 4 5 6 7 8 9 10 Time Fig. 3. Trajectories of the system (31) with E = [0 and its optimal L∞ -to-L∞ interval observer (6). − 6]T point always exists whereas the positive one exists only for some values of the parameters. Let us assume that we measure x3 (t), i.e. y(t) = x3 (t). We then consider the interval observer (4) with      T 0 −β1 0 0 1            A=  α1 −β2 0  , E = 0 and C = 0 . 1 0 α2 −β3 0 (33) Note that A is Metzler and Hurwitz stable. Define, moreover, the signals w(t) = a(t)h(x3 (t)), w− (t) = a− h(x3 (t)), w+ (t) = a+ h(x3 (t)) and h(x3 ) = x3 /(x3 + b). Note that these signals are not persistent when the 0-equilibrium is asymptotically stable. We then have the following result: This example is interesting numerically speaking as it illustrates some difficulties arising when no minimum exists and we have an infimum instead, resulting then in very large gain values. Indeed, remember that the gain of the observer is computed for M = 1Tn and, therefore, the L∞ -gain for the current system consists of the sum of the possible bounds in (36), which has no minimum because of the presence of `3 at the denominator of one of these values. In order to overcome this situation, we can consider bounds on the observer gain as stated in Remark 16. So, the idea is to compute an observer gain that will minimize the L∞ -gain of the transfer of the disturbance to the observed outputs while satisfying the constraint −513 ≤ L ≤ 513 . Using the parameters β1 = 2, β2 = 2, β3 = 3, α1 = 3 and α2 = 4, we find that the optimal gain is given by L∗ = [0 0 5]T and that γ ∗ = α1 /(β1 β2 ) = 3/4. A simulation is then performed with the parameters b = 1, a(t) = (a− +a+ )/2+(a+ −a− ) sin(0.1t)/2, a− = 1, a+ = 2, and the initial conditions x0 = [0.1 0 0]T , + T T x− 0 = [0.01 0 0] , x0 = [0.6 0.8 1.1] . The results are depicted in Fig. 4 where we can see that the interval observer is able to provide a fairly good estimation for the trajectories of the system. Proposition 20 Let M + = M − = In , then the minimal L∞ -gain achieved by an interval observer of the form (4) for the system (7)-(33) is given by  max 1 α1 , β1 β1 β2  (34) and is achieved with any optimal gain L of the form L = h iT 0 0 `3 where `3 is such that   α1 `3 > α2 max 1, − β3 . β2 (35) Proof : We show first that `1 = `2 = 0. To this aim, let us note that when `1 = `2 = 0 and `3 > 0, then the matrix A − LC is Hurwitz stable. Moreover, for the matrix A − LC to be Metzler, we need that both `1 and `2 be nonpositive. We also note that when `3 is given, then the matrix A − LC remains stable for some 5 Conclusion Linear programming conditions have been obtained for the design of a class of optimal L∞ -to-L∞ interval observers for continuous-time systems, discrete-time sys- 8 International Journal of Robust and Nonlinear Control, vol. 26(4), pp. 834–852, 2016. x1 (t) x−,+ 1 (t) 0.4 [9] R. E. H. Thabet, T. Raı̈ssi, C. Combastel, D. Efimov, and A. Zolghadri, “An effective method to interval observer design for time-varying systems,” Automatica, vol. 50(10), pp. 2677– 2684, 2014. 0.2 0 0 10 20 30 40 50 60 70 80 90 100 x2 (t) x−,+ 2 (t) 0.6 0.4 [10] P. Li and J. Lam, “Positive state-bounding observer for positive interval continuous-time systems with time delay,” International Journal of Robust and Nonlinear Control, vol. 22, pp. 1244–1257, 2012. 0.2 0 0 10 20 30 40 1 0.5 0 0 50 60 70 80 90 100 x3 (t) x−,+ 3 (t) 10 20 30 40 50 Time [11] A. Polyakov, D. Efimov, W. Perruquetti, and J.-P. Richard, “Output stabilization of time-varying input delay systems using interval observation technique,” Automatica, vol. 49, pp. 3402–3410, 2013. 60 70 80 90 100 [12] D. Efimov, W. Perruquetti, and J.-P. Richard, “On reducedorder interval observers for time-delay systems,” in 12th European Control Conference, Zürich, Switzerland, 2013, pp. 2116–2121. Fig. 4. Trajectories of the population model (32) and its optimal L∞ -to-L∞ interval observer. [13] T. Raı̈ssi, G. Videau, and A. Zolghadri, “Interval observer design for consistency checks of nonlinear continuous-time systems,” Automatica, vol. 46, pp. 518–527, 2010. tems and systems with delays. It is shown that the optimal observer is uniform over the set of matrices mapping the estimation errors to the observed outputs. The approach is versatile and should be applicable to more complex systems such as uncertain systems [40]. However, the consideration of more general observers, such as those considered in [33], that can be applied to a wider class of systems seems to be more difficult. It is also unclear, for the moment, how to non-conservatively extend the current approach to the design observer-based controllers. A final interesting question is whether the consideration of higher-order observers would improve the performance of the observers. These questions are left for future research. [14] D. Efimov, T. Raı̈ssi, S. Chebotarev, and A. Zolghadri, “Interval state observer for nonlinear time varying systems,” Automatica, vol. 49, pp. 200–205, 2013. [15] D. Efimov, T. Raı̈ssi, and A. Zolghadri, “Control of nonlinear and LPV systems: Interval observer-based framework,” IEEE Transactions on Automatic Control, vol. 58(3), pp. 773–778, 2013. [16] S. Chebotarev, D. Efimov, T. Raı̈ssi, and A. Zolghadri, “Interval observers for continuous-time LPV systems with L1 /L2 performance,” Automatica, vol. 58, pp. 82–89, 2015. [17] F. Mazenc, T. N. Dinh, and S.-I. Niculescu, “Robust interval observers and stabilization design for discrete-time systems with input and output,” Automatica, vol. 49, pp. 3490–3497, 2013. References [18] D. Efimov, T. Raı̈ssi, W. Perruquetti, and A. Zolghadri, “Design of interval observers for estimation and stabilization of discrete-time LPV systems (in press),” IMA Journal of Mathematical Control & Information, 2015. [1] J. L. Gouzé, A. Rapaport, and M. Z. Hadj-Sadok, “Interval observers for uncertain biological systems,” Ecological modelling, vol. 133, pp. 45–56, 2000. [19] L. Farina and S. Rinaldi, Positive Linear Systems: Theory and Applications. John Wiley & Sons, 2000. [2] A. Rapaport and J. L. Gouzé, “Parallelotopic and practical observers for non-linear uncertain systems,” International Journal of Control, vol. 76(3), pp. 237–251, 2003. [20] W. M. Haddad and V. Chellaboina, “Stability and dissipativity theory for nonnegative dynamic systems: a unified analysis framework for biological and physiological systems,” Nonlinear Analysis: Real World Applications, vol. 6, pp. 35–65, 2005. [3] J. D. Murray, Mathematical Biology Part I. An Introduction. 3rd Edition. Springer-Verlag Berlin Heidelberg, 2002. [4] F. Mazenc and O. Bernard, “Interval observers for linear time-invariant systems with disturbances,” Automatica, vol. 47, pp. 140–147, 2011. [21] C. Briat, “Robust stability analysis of uncertain linear positive systems via integral linear constraints - L1 - and L∞ -gains characterizations,” in 50th IEEE Conference on Decision and Control, Orlando, Florida, USA, 2011, pp. 3122–3129. [5] M. Ait Rami, F. Tadeo, and U. Helmke, “Positive observers for linear positive systems, and their implications,” International Journal of Control, vol. 84(4), pp. 716–725, 2011. [22] ——, “Robust stability and stabilization of uncertain linear positive systems via integral linear constraints - L1 - and L∞ gains characterizations,” International Journal of Robust and Nonlinear Control, vol. 23(17), pp. 1932–1954, 2013. [6] F. Mazenc, M. Kieffer, and E. Walter, “Interval observers for continuous-time linear systems,” in American Control Conference, Montréal, Canada, 2012, pp. 1–6. [23] P. Voulgaris, “On optimal `∞ to `∞ filtering,” Automatica, vol. 31(3), pp. 489–495, 1995. [7] F. Cacace, A. Germani, and C. Manes, “A new approach to design interval observers for linear systems,” IEEE Transactions on Automatic control, vol. 60(6), pp. 1665–1670, 2015. [24] F. Blanchini and M. Sznaier, “Rational L1 suboptimal compensators for continuous-time systems,” IEEE Transactions on Automatic Control, vol. 39(7), pp. 1487–1492, 1994. [8] M. Bolajraf and M. Ait Rami, “A robust estimation approach for uncertain systems with perturbed measurements,” 9 [25] M. Vidyasagar, “Optimal rejection of persistent bounded disturbances,” IEEE Transactions on Automatic Control, vol. 31(6), pp. 527–534, 1986. [26] M. A. Dahleh and J. Boyd Pearson Jr., “l1 -optimal compensators of continuous-time systems,” IEEE Transactions on Automatic Control, vol. 32(10), pp. 889–895, 1987. [27] M. A. Dahleh and I. J. D. Bobillo, Control of uncertain systems - A linear programming approach. Prentice-Hall, 1995. [28] K. Nagpal, J. Abedor, and K. Poolla, “An LMI approach to peak-to-peak gain minimization: filtering and control,” in American Control Conference, Baltimore, Maryland, USA, 1994, pp. 742–746. [29] S. R. Venkatesh and M. A. Dahleh, “Does star norm capture `1 norm?” in American Control Conference, Seattle, Washington, 1995, pp. 944–945. [30] J. Shamma and K.-Y. Tu, “Set-valued observers and optimal disturbance rejection,” IEEE Transactions on Automatic Control, vol. 44(2), pp. 253–264, 1999. [31] Y. Ebihara, D. Peaucelle, and D. Arzelier, “Optimal L1 controller synthesis for positive systems and its robustness properties,” in American Control Conference, Montreal, Canada, 2012, pp. 5992–5997. [32] C. A. Desoer and M. Vidyasagar, Feedback Systems : InputOutput Properties. Academic Press, New York, 1975. [33] F. Blanchini and M. Sznaier, “A convex optimization approach to synthesizing bounded complexity `∞ filters,” IEEE Transactions on Automatic Control, vol. 57(1), pp. 219–224, 2012. [34] T. Raı̈ssi, D. Efimov, and A. Zolghadri, “Interval state estimation for a class of nonlinear systems,” IEEE Transactions on Automatic Control, vol. 57, pp. 260–265, 2012. [35] W. M. Haddad and V. Chellaboina, “Stability theory for nonnegative and compartmental dynamical systems with time delay,” Systems & Control Letters, vol. 51(5), pp. 355– 361, 2004. [36] C. Briat, Linear Parameter-Varying and Time-Delay Systems – Analysis, Observation, Filtering & Control, ser. Advances on Delays and Dynamics. Heidelberg, Germany: Springer-Verlag, 2015, vol. 3. [37] J. Shen and J. Lam, “L∞ -gain analysis for positive systems with distributed delays,” Automatica, vol. 50, pp. 175–179, 2014. [38] ——, “`∞ /L∞ -gain analysis for positive linear systems with unbounded time-varying delays,” IEEE Transactions on Automatic Control, vol. 60(3), pp. 857–862, 2015. [39] M. Naghnaeian and P. G. Voulgaris, “Performance optimization over positive l∞ cones,” in American Control Conference, Portland, USA, 2014, pp. 5645–5650. [40] M. Colombino and R. S. Smith, “A convex characterization of robust stability for positive and positively dominated linear systems,” IEEE Transactions on Automatic Control, vol. 61(7), pp. 1965–1971, 2016. 10
3cs.SY
A simple and efficient SNN and its performance & robustness evaluation method to enable hardware implementation Anmol Biswasº, Sidharth Prasad+, Sandip Lashkare, and Udayan Ganguly Department of Electrical Engineering Indian Institute of Technology, Bombay Mumbai, India [email protected], [email protected], [email protected], [email protected] Abstract— Spiking Neural Networks (SNN) are more closely related to brain-like computation and inspire hardware implementation. This is enabled by small networks that give high performance on standard classification problems. In literature, typical SNNs are deep and complex in terms of network structure, weight update rules and learning algorithms. This makes it difficult to translate them into hardware. In this paper, we first develop a simple 2-layered network in software which compares with the state of the art on four different standard data-sets within SNNs and has improved efficiency. For example, it uses lower number of neurons (𝟑 ×), synapses (3.5×) and epochs for training (30×) for the Fisher Iris classification problem. The efficient network is based on effective population coding and synapse-neuron co-design. Second, we develop a computationally efficient (15000×) and accurate (correlation of 0.98) method to evaluate the performance of the network without standard recognition tests. Third, we show that the method produces a robustness metric that can be used to evaluate noise tolerance. Keywords—Spiking Neural Networks, supervised hebbian learning, cross-bar arrays, two-layer networks I. INTRODUCTION Artificial neural network (ANN) algorithms (e.g. deep learning) are capable of recognizing complex patterns (e.g. voice, image etc.) but run on von-Neumann hardware in servers. Hence, the high power (~MWatt) requirements of the servers pale in comparison with that of the brain (~100 Watts) [1]. Hence a dedicated hardware implementation inspired by the brain architecture is highly desirable. Spiking Neural Networks (SNN) are being extensively researched to solve classification and machine-learning problems and produce neuromorphic hardware. Hardware implementable algorithms need three features. Firstly, some learning rules may be mathematically complex for simple hardware implementation. Hence simpler alternatives are selected. For example, some spiking neural networks make use of back-propagation type algorithms for supervised learning and classification ([2] [3] [4] [5] [6]). This requires a centralized computation of local weight changes for global error reduction by back-propagation for learning – which + ° First authors with equal contributions leads to inefficiencies. In addition, artificial algorithmic constraints on the behavior of the neurons, like restricting them to generate limited number of spikes (like only one or two) in the training interval, and complex networks by splitting each synapse into multiple synapses with different time delays [2] [3] [4] increase the complexity of implementation. In comparison, a biomimetic, simple and local Spike Time Dependent Plasticity (STDP) - like Supervised Hebbian Learning [7] [8] [9] is used for local weight change computation in our work. Thus, STDP based networks can be translated into hardware more efficiently. Secondly, certain algorithms cannot be simply translated to a cross-bar architecture. For example, the ReSuMe approach [8] is based on STDP rules, but requires a special class of neurons called “teacher neurons”. This requires 3 inputs to every synapse (pre-neuron, post-neuron & teacher neuron) which is difficult to implement in a cross-point architecture where 2 inputs (a row and column driver) normally serve every synapse. Thirdly, the networks must be small as hardware level simulations are computationally expensive. For example, various networks [4] used for Fisher Iris data set use ~100 neurons and ~500 synapses. The computational time for training our two-layered network using transient simulation is a circuit simulator – SPICE, is roughly 2 hours, which is large, despite the simplicity [10]*. After training, performance evaluation requires more computation. Thus, to avoid complexity and computational cost for hardware simulation, a simple and small network with high performance on standard classification problems is needed. In addition, a more efficient strategy to evaluate the performance of the SNN is attractive. In this paper, we firstly develop a small and efficient network which matches state-of-the art performance on two classification problems and performs well on another two and identify the related design principles. Second, we develop a highly efficient method of evaluating the network performance after learning. Finally, we evaluate the noise tolerance by stochastic simulations enabled by efficient performance evaluation. II. APPROACH A. Network Our proposed network is small and simple. It consists of only two layers - one input layer and one output layer, with no hidden layers, as illustrated in Fig. 1. In a classification problem (say malignant vs. benign cancer), a database (say Wisconsin Cancer dataset) has 𝑆 input features (e.g. patient heat-rate or temperature etc.), where each feature has a range of values (say heartrate is 70-100 pulses/min). First, a population coding scheme ([11] [12] [13]) consisting of normalization and transformation steps is used to input the data as corresponding current levels into the input layer as described later. The input layer is fully connected to the output layer through excitatory synapses i.e. each input neuron is connected to all output neurons and vice versa. The output neurons are interconnected among themselves in pairs through inhibitory lateral synapses to implement the Winner takes all rule [14]. Thus, only one neuron spikes which indicates that the network has identified the input to be of the same class as associated with that output neuron. During learning, in the training phase, negative bias currents to the output layer are used for supervision to discourage the neuron associated with the wrong class from firing. Fig. 1. The network structure with two layers. The raw features are first normalized between 0 and 1 and then undergo transformations, before being input to the first layer. The first layer spikes propagate to the output layer via the excitatory synapses. Negative bias current is used for supervision while lateral inhibitory synapses implement the ‘Winner takes all’ rule. Each output neuron corresponds to a particular sample class. 𝑤𝑖,𝑗 is the weight of the respective synapse. B. Normalization The raw feature values are mapped on a scale of 0 to 1, given by the following equation. 𝑧𝑖 − min(𝑧) 𝑥𝑖 = (1) max(𝑧) − min(𝑧) where 𝑧 is the raw feature value and 𝑥 is the normalized feature value. C. Transformations To implement learning in a two-layer network with current based inputs, we had to consider ways to make the input neurons respond to mid and low level/intensity values of the samples’ features. Directly encoding the intensity of the feature values with input currents is insufficient as it makes the network blind to mid-level and low-level feature values. We consider two types of feature transformations – (i) Gaussian transformations and (ii) linear transformations for mapping the normalized feature values to the constant current values that is input to input neurons. 𝐹 input features undergoing 𝑇 transformations will require 𝐹 × 𝑇 input neurons. a) Gaussian transformations The interval [0,1] of 𝑥 (i.e. the feature value after normalization) is divided into 𝑇 − 1 sections, with a Gaussian Radial Basis Functions (RBF) centered at each section boundary. Thus, we have a total of 𝑇 Gaussians that generate the current to be fed to the input neurons. The RBF is given by: 𝑥 − 𝜇𝑗 (2) 𝐼𝑗 (𝑥) = 𝐼𝑚𝑎𝑥 ∙ 𝑒𝑥𝑝 ( ) 2𝜎 2 where 𝐼𝑚𝑎𝑥 is a maximum input current value. The methodology to select 𝐼𝑚𝑎𝑥 is discussed later. Each of these RBFs act as level-sensitive sensors, as they pick up the signal only if it lies in a certain range where its response in non-zero, as illustrated in Fig. 2 Fig. 2. The Gaussian Transformations with a total of 9 sensors (The other transformations are not shown for clarity). Each transformation produces a large output if the input lies in a certain range and thus acts as a rangespecific sensor. b) Linear function transformations 1. High value sensor causes spiking when the value of the feature is high. (3) 𝐼1 (𝑥) = 𝐼𝑚𝑎𝑥 ∙ 𝑥 2. Low value sensor causes spiking when the value of the feature is low. (4) 𝐼2 (𝑥) = 𝐼𝑚𝑎𝑥 ∙ (1 − 𝑥) 3. Intermediate Value sensor causes spiking when the value of the feature lies close to the middle. (5) 𝐼3 (𝑥) = 𝐼𝑚𝑎𝑥 ∙ (1 − 2 ∙ |𝑥 − 0.5|) 4. Extreme Value sensor causes spiking when the value of the feature lies away from the middle. (6) 𝐼4 (𝑥) = 𝐼𝑚𝑎𝑥 ∙ 2 ∙ |𝑥 − 0.5| F. Learning Rule The time difference between the pre-neuron spike and the post-neuron spike, ∆𝑡 is defined by (𝑡𝑝𝑜𝑠𝑡 − 𝑡𝑝𝑟𝑒 ) as shown in Fig. 4 (a). In STDP, the weight change (Δ𝑤) is a function of Δ𝑡 between pre- vs. post-neuron spike as shown in Fig. 4 (b). However, in realistic RRAM device (Fig. 4 (c)), RRAM conductance (equivalent to weight, 𝑤) first increases linearly with increasing number of pulses (akin to ideal STDP) and then saturates. Hence, we use a learning rule (Eq. 3-4) used which falls under the category of Supervised Hebbian Learning (SHL) [7]. Here, weight saturates as it gets closer to their maximum or minimum values akin to realistic RRAM devices. Fig. 3. The four linear transformations: a) High value sensor b) Low value sensor c) Intermediate value sensor d) Extreme value sensor D. Neurons We use the Leaky Integrate and Fire (LIF) model to model the neurons in the network [15]. It is a simple ResistorCapacitor circuit that fires a spike when the potential reaches the threshold value ( 𝑉𝑡 ) and immediately after spiking, the potential is reset to the Resting Potential (𝐸𝑙 ). The rate of firing is thus, a function of the applied current. Eq. 7 describes the dynamics of the LIF neuron. 𝑑𝑉 1 = (−𝑔(𝑉 − 𝐸𝑙 ) + 𝐼) 𝑑𝑡 𝐶 𝑤 µ −∆𝑡 ) ∙ 𝑒𝑥𝑝 ( ) , ∆𝑡 > 0 𝑤𝑚𝑎𝑥 𝜏𝑢𝑝 𝑤 µ ∆𝑡 ∆𝑤 = 𝐴𝑑𝑜𝑤𝑛 ∙ ( ) ∙ 𝑒𝑥𝑝 ( ) , ∆𝑡 < 0 𝑤𝑚𝑎𝑥 𝜏𝑑𝑜𝑤𝑛 ∆𝑤 = 𝐴𝑢𝑝 ∙ (1 − (9) (10) (7) where 𝑉 is the membrane potential, 𝐶 is the capacitance, 𝑔 is the conductance, 𝐸𝑙 is the resting potential and 𝐼 is the input current to the neuron. Values used: = 300𝑝𝐹 , 𝐸𝑙 = −70𝑚𝑉 , 𝑔 = 30𝑛𝑆 and 𝑉𝑡 = 20𝑚𝑉. E. Synapses A synapse connects a pair of neurons i.e. input to output neuron. It converts a voltage spike from pre-neuron to a current response in the post-neuron whenever the pre-neuron fires a spike. The form of the current pulse is given by the following equation. 𝐼(𝑡) = 𝑤 ∙ 𝐼0 ∙ (exp (− 𝑡 − 𝑡𝑠 𝑡 − 𝑡𝑠 ) − exp (− )) 𝜏𝑚 𝜏𝑠 (8) where, 𝑤 is the weight of the synapse, 𝑡𝑠 is the time instant when the pre-neuron fires a spike, 𝜏𝑠 and 𝜏𝑚 are time constants with 𝜏𝑚 > 𝜏𝑠 and 𝐼0 is a constant current to scale the synaptic current pulse to the required levels for the LIF neurons [16]. We use two kinds of synapses in the network- (i) excitatory and (ii) inhibitory. They both have similar behavior, except that the weights associated with the excitatory synapses are positive (i.e. 𝑤 > 0 , they promote post-neuron spiking by pushing current towards it) while those associated with the inhibitory synapses are negative (i.e. 𝑤 < 0 , they inhibit post-neuron spiking by pulling out current from it). Values used: 𝐼0 = 10𝑝𝐴 , 𝜏𝑚 = 10𝑚𝑠 and 𝜏𝑠 = 2.5𝑚𝑠 for excitatory synapses. 𝐼0 = 0.1𝑛𝐴, 𝜏𝑚 = 50𝑚𝑠. Fig. 4. STDP rule a) Showing the two possible cases, causal and anti-causal spiking b) Standard STDP rule c) Experimental plot of Resistance vs no. pulses showing weight saturation d) weights saturation in our model as multiple writes are performed showing the same observation as in (c) Also, 𝐴𝑢𝑝 is positive (for potentiation, there should be an increase in weight) while 𝐴𝑑𝑜𝑤𝑛 in negative (for depression, there should be a decrease in weight) and µ should be positive and greater than 1 to enable control over the rate of saturation. [17] Values used: Different values of 𝐴𝑢𝑝 , 𝐴𝑑𝑜𝑤𝑛 (in the range: 1 to 10 and -1 to -20 respectively) and 𝑤𝑚𝑎𝑥 were experimented with (values of 𝑤𝑚𝑎𝑥 were kept between 300 to 1000 for good results), 𝜏𝑢𝑝 = 10𝑚𝑠 and 𝜏𝑑𝑜𝑤𝑛 = 20𝑚𝑠 were used. G. Weight range and Initialization The parameter 𝑤𝑚𝑎𝑥 is the value of maximum weight that the excitatory synapses could take while the minimum value is zero. We found that, when using more transformations, the optimum range of 𝑤𝑚𝑎𝑥 values is lower than when using fewer transformations. Alternatively, we can also increase the Threshold Potential in case of larger number of input neurons. Generally speaking, we found that keeping the initial mean value between one-third and half of 𝑤𝑚𝑎𝑥 gave good results. The third parameter is the initial weight distribution i.e. mean of the initially assigned random weights. We found that the quality of learning (measured by the classification accuracy) depended heavily on the initial conditions. This happened because, for the network to learn, it should be able to spike and so if the initial weights are too low, the network cannot learn at all H. Training and testing A small subset of all the samples was taken for training the network (details for each dataset is presented later). Each of these training samples was shown repeatedly to the network for a fixed duration of 100 𝑚𝑠. All training samples are serially shown to the network in an epoch. To test performance after learning, the bias currents are set to zero and the entire dataset is shown to the network. Within the testing time interval allotted to each sample, the recognition is counted as successful only when the correct neuron (corresponding to the class to which the sample actually belongs) fires and the others do NOT fire [14]. III. PERFORMANCE AND MECHANISM A. Benchmarking Performance of different datasets We extensively tested our SNN algorithm on four standard classification problems – the Fisher Iris [18], Wisconsin Breast Cancer [19], wine dataset [20] and heart-statlog dataset [21]. For each problem, we evaluate the effect of different transformations in the networks on their performance. We also benchmark our algorithm with other neural network based methods from literature, in terms of network size, number of training iterations required and the classification accuracy achieved. Note that the classification accuracy is stated as a 10 experiment average to account for stochasticity in selection of training samples. a) Fisher Iris classification dataset The Fisher Iris dataset consists of 150 samples and each sample possesses 4 features. The samples belong to three different classes, 50 to each class. Two of these classes are not linearly separable [18]. 15 randomly chosen samples from each class, i.e. a total of 45 samples were taken for training and the learned weights are tested on the entire dataset of 150 samples. TABLE I. summarizes the results. We observe that the network with 4 linear sensors achieves the best classification accuracy, amongst the other combinations, which is at par with the ones from literature. However, this network also achieves significant reduction in (a) number of neurons ( 19 in this network cf. 63 or more elsewhere i.e. > 3 × improvement) and (b) synapses 16 ∙ 3 = 48 in our network cf. 4 ∙ 10 + 10 ∙ 10 + 10 ∙ 3 = 170 or more elsewhere, i. e > 3.5 × improvement) (c) number of training iterations (15 in our network cf. 450 or more elsewhere i.e. 30 ×). This can have major advantages in terms of power/energy and area required for operation in a hardware version. Since the timescales of training heavily depend on the size of the network, this network learns relatively quickly which can largely be attributed to its small size, for there are no hidden layers. In addition, the networks with other sensor combinations also achieve accuracies greater than 90 % as illustrated in TABLE I. Literature Implementation Input N1 Hidden N2 Output N3 Spike Prop [4] MATLAB BP [4] Meta Neuron [4] Quick Prop [4] 50 50 4 50 10 10 10 x 10 10 3 Linear Sensors 4 Linear Sensors 3 RBFs 5 RBFs 7 RBFs 12 16 12 20 28 3 3 3 3 Our work 3 3 3 3 3 Improvement 0 0 0 0 0 3x Total Synapses Training Iterations Accuracy 530 530 170 530 1000 3750 1500 450 96.2 % 95.8 % 97.33 % 97.33 % 36 48 36 60 84 3.5 x 15 15 15 15 15 30 x 94.7% 96.5% 94% 95.3% 91.6% Same TABLE I. Performance benchmark for the Fisher Iris classification dataset. Our work achieves significant reduction in the number of neurons, synapses and training iterations while performing at par with the state of the art. Note that the classification accuracy is stated as a ten-point average. b) Wisconsin Cancer classification dataset The Wisconsin Cancer dataset [19] consists of 699 samples with 9 features. The samples belong to two classes – benign and malignant. 20 samples each from benign and malignant classes were taken and used for training. The learned weights were tested on the entire dataset of 699 samples. Our network achieved an accuracy of 96.5% which is at par with that reported by [6]. Literature Implementation Input N1 Hidden N2 Yan Xu et.al.[6] 46 8 3 Linear Sensors 4 Linear Sensors 3 RBFs 5 RBFs 7 RBFs 27 36 27 36 45 0 0 0 0 0 2x Improvement Output N3 2 Our work 2 2 2 2 2 Total Synapses Training Iterations Accuracy 384 209 95.32% 54 72 54 72 90 7x 15 15 15 15 15 14 x 96% 96.4% 96.5% 96.3% 96.1% Same TABLE II. Performance benchmark for the Wisconsin Breast Cancer classification problem. The network with 3 RBF sensors performs the best and achieves 2 × reduction in the number of neurons, 7 × reduction in the number of synapses and requires 14 × less training iterations as compared to [6]. c) Other datasets We also tested our algorithm on two other datasets, whose results we will be briefly mentioning. First is the wine dataset [20] containing 178 samples belonging to three classes. Each sample possessing 13 features. A classification accuracy of 92% was achieved on this dataset by performing same experiment as in Fisher Iris classification. Second is the heartstatlog dataset [21] for predicting heart disease, consisting of 270 samples belonging to two classes. Each sample possessing 13 features (drawn from a larger set of 75 features). A classification accuracy of 79% was achieved after training a network with 7 RBF transforms in the first layer with 20 samples/class and higher threshold potentials for the second layer. B. Neuron vs. synapse interplay & co-design Next, we present the interplay of neuron design (based on spiking threshold) and synaptic maximum current ( 𝐼𝑚𝑎𝑥 ) to show that the optimal transformations of the initial data set (i.e. population coding) leads to maximum performance. First, the LIF neuron possesses a current threshold (due to their leaky nature), i.e. only those feature values which translate to constant currents which lie above this threshold will be able to cause spiking in the input layer neurons. To obtain the value of the threshold current, we substitute 𝑉 with 𝑉𝑡 and 𝐼 with 𝐼𝑚𝑖𝑛 in Equation 7 and equate the LHS to zero, to obtain: 𝑑𝑉 1 = (−𝑔(𝑉𝑡 − 𝐸𝑙 ) + 𝐼𝑡ℎ ) = 0 𝑑𝑡 𝐶 𝐼𝑡ℎ = 𝑔(𝑉𝑡 − 𝐸𝑙 ) (11) 𝐼𝑡ℎ = 30 𝑛𝑆 ∙ (20 − (−70))𝑚𝑉 = 2.7 𝑛𝐴 𝐼𝑡ℎ 2.7 𝑛𝐴 = 0.675 𝐼𝑚𝑎𝑥 4 𝑛𝐴 Next, we try to find the reason for such sharp sensitivity of the classification accuracy on the above ratio by exploring its effect on the linear sensors described earlier. Since any feature value less than 0.675 (on the normalized scale) would not excite any response in the input layer, this has a threshold effect on the sensors, as illustrated in Fig. 5. This behavior thus plays a vital 𝐼 role in sensor design, as now, for the choice of 𝑡ℎ = 0.675, = 𝐼𝑚𝑎𝑥 the first three transformations turn out to be perfectly mutually exhaustive (as they leave a negligible gap on the x-axis) and exclusive (they do not overlap), as illustrated in Fig. 7(e). The former is essential as all the sensors combined should be able to pick data lying at all parts of the input spectrum whereas the latter ensures that the sensors are not intermixed and hence redundant. As 𝐼𝑡ℎ / 𝐼𝑚𝑎𝑥 increases beyond 0.7, the unattended gap ∆𝑥 increases leading to data-loss and hence a decline in performance, as can be seen Fig. 6. Similarly, when 𝐼𝑡ℎ / 𝐼𝑚𝑎𝑥 goes below 0.6 , the sensors start to overlap leading to intermixing and an eventual drop in performance. This analysis also explains the ineffectiveness of using just the raw normalized data (which is equivalent to using only the first transformation) as it only “senses” the high data values which results in a complete “loss” of the low and middle parts of the spectrum as is clearly seen in Fig. 7(a). In addition, it explains why the fourth transformation is largely redundant and not very necessary as it covers a part of the range already covered by transformations one and two together. Fig. 5. The input output behaviour for a LIF neuron for different values of constant input currents. When the input current value is below the threshold (c), no spike is issued and the membrane potentials settles to constant steady value. d) Figure illustrating the non-linearity in the spiking behavior of the LIF neuron. For 𝐼𝑎𝑝𝑝 < 𝐼𝑡ℎ , the neuron does not spike. This implies that it does not put any current down the line and completely blocks the incoming signal from propogating further. For the values for the constants used in the previous section, 𝐼𝑡ℎ comes out to be 2.7 𝑛𝐴 . Once 𝐼𝑡ℎ is fixed, we then sweep 𝐼𝑡ℎ / 𝐼𝑚𝑎𝑥 (the threshold value in the normalized relative scale ) from 0.2 to 0.9 by varying 𝐼𝑚𝑎𝑥 . The classification accuracy is found to be the maximum when the ratio is in the range 0.6~0.7 as shown in Fig. 6. We thus set the value of 𝐼𝑚𝑎𝑥 to be 4 𝑛𝐴 for which, the ratio comes out to be in the above range. Fig. 6. The varation of classification accuracy with the ratio 𝐼𝑡ℎ / 𝐼𝑚𝑎𝑥 . The peak is observed for the range of values for which the sensors are mutuallye exclusive and mutually exhaustive. This serves as a design curve for setting the value of 𝐼𝑚𝑎𝑥 for best performance. a) Methodology Let us take the case when our network has 𝑀 input neurons and 𝑁 output neurons. Each of the 𝑁 output neurons corresponds to one particular class. For each sample, let 𝐼1 , 𝐼2 , … , 𝐼𝑀 be the 𝑀 current values being fed to the 𝑀 input layer neurons. Let us consider the 𝑗𝑡ℎ output neuron, corresponding to the 𝑗𝑡ℎ class. This neuron is connected to each of the 𝑀 input neurons. Let 𝑤𝑖,𝑗 be the weight acquired after learning, by the synapse connecting the 𝑖 𝑡ℎ input neuron to the 𝑗𝑡ℎ output neuron. Therefore, for this particular sample, the aggregate total current received by the 𝑗𝑡ℎ output neuron can be approximated as: 𝑀 𝐼𝑡𝑜𝑡𝑎𝑙,𝑗 ≡ ∑ 𝑤𝑖,𝑗 ∙ 𝐼𝑖 ∙ 𝑢(𝐼𝑖 − 𝐼𝑡ℎ ) (12) 𝑖=1 Fig. 7. The four linear transformations after applying the threshold filter. (e) shows the effective portions of the sensors in (a), (b) and (c), which mutually and exhaustively cover almost the entire input range (negligible gaps in between), leaving the sensor in (d) redundant. Thus, the first three transformations are necessary and sufficient for good performance. Excluding any of them makes the performance drop significantly, as they help cover the entire spectrum of input values, whereas the presence of the fourth transform has a very minor effect on performance, as can be seen from TABLES I & II. Fig. 6 serves as a design curve to set the value of 𝐼𝑚𝑎𝑥 for best performance. Thus, the efficient network is based on important population coding and synapseneuron co-design. IV. FAST RECOGNITION EVALUATION AND ROBUSTNESS A. Current Space Analysis Assessment of the extent of learning in SNNs is usually done using the standard recognition tests which involves simulating the actual neuronal dynamics. However, this methodology has several drawbacks. First, it is computationally intensive. For instance, performing one round of testing for all the 699 samples in the Wisconsin Breast Cancer classification problem takes about 150𝑠 in MATLAB. A faster evaluation is hence attractive. Second, it only gives a single output, namely the classification accuracy, which does not indicate robustness of learning. In this section, we develop simple and efficient method to evaluate the performance of the network without standard recognition tests. Finally, we also develop a learning robust-ness metric for noise tolerant recognition performance. where 𝑢 is the unit step function to account for the threshold behavior of the LIF neurons, as explained in the previous section. Current values lower than 𝐼𝑡ℎ do not cause even a single spike in the first layer neurons and thus do not contribute to the current between the first and the second layers. Thus, the SNN creates an inherent mapping of the sample points into a 𝑁 dimensional space, with the magnitude along each dimension being equal to the current supplied to the corresponding neuron. For instance, if 𝑁 equals 2 , the coordinates for the sample in the current space will be given by 𝑰 = 𝐼𝑡𝑜𝑡𝑎𝑙,1 𝑥̂ + 𝐼𝑡𝑜𝑡𝑎𝑙,2 𝑦̂ (13) We next describe two performance metrics which can be derived from this space, in the following sections. b) Merit Figure We argue that if the classification were to proceed correctly, the samples actually belonging to class 𝑗 should feed a large current to the 𝑗𝑡ℎ neuron and little current to the other output neurons. It is only then that the probability of the 𝑗𝑡ℎ neuron to spike and for the others not to spike during the observed testing interval is enhanced. On the other hand, if the sample happens to feed similar amounts of currents to two or more output neurons, then each of them are equally likely to spike and the sample is likely to be misclassified. This can then be extended for each of the output neurons. For the case when 𝑁 equals two and if the above sample happens to belong to the first class (say), the following inequality should be satisfied for correct classification to occur. 𝐼𝑡𝑜𝑡𝑎𝑙,1 > 𝐼𝑡𝑜𝑡𝑎𝑙,2 In other words, since the sample belongs to the first class, it should feed a larger current to the first neuron than to the second neuron. Thus, each sample should ideally fall into a particular subspace corresponding to its class so that the above inequality is satisfied. Hence, we define the merit figure as the proportion of the samples, in percentage, which lie in the correct subspace. of the axes, as that would mean pushing a high current to the correct neuron and negligible current to the other neurons. # 𝑜𝑓 𝑠𝑎𝑚𝑝𝑙𝑒𝑠 𝑖𝑛 𝑐𝑜𝑟𝑟𝑒𝑐𝑡 𝑠𝑢𝑏𝑠𝑝𝑎𝑐𝑒 𝑀𝑒𝑟𝑖𝑡 𝐹𝑖𝑔𝑢𝑟𝑒 ≡ ( ) ∙ 100 (14) 𝑇𝑜𝑡𝑎𝑙 # 𝑜𝑓 𝑠𝑎𝑚𝑝𝑙𝑒𝑠 Fig. 8 (a) shows that 𝑑𝑏𝑙𝑢𝑒 is negative as the blue mean lies in the wrong subspace while 𝑑𝑟𝑒𝑑 is positive but very close to zero. Fig. 8 (b) illustrates the scenario after one training epoch. The merit figure improves significantly while 𝑑𝑏𝑙𝑢𝑒 flips signs. A key observation here is that although 93% percent of samples move to their correct subspaces with only one epoch of training, the subsequent training epochs make the learning more robust as the two means move further into their subspaces as can be seen in Fig. 8 (c). 𝑑𝑏𝑙𝑢𝑒 increases further suggesting a more thorough learning taking place, thereby making the system more robust. The analysis thus illustrates that if the system is ideal, one training epoch is sufficient to achieve high classification accuracies. However, if the system is non-ideal and prone to minor variations in the weights, the training should be repeated for more epochs to make the system more faulttolerant. The robustness metric gives a quantitative measure of such a tolerance. Thus, between one and fourteen training epochs, the merit figure improves only slightly ( 93 % → 96 %) while the robustness metric improves significantly (7.5 → 17.92). To evaluate the impact of the robustness, we add increasing noise to study its effect of performance. We refer to the systems in Fig. 8 (b) and (c) as system A and system B respectively. Further, we introduce a zero mean Gaussian noise ( 𝜎 = 300) in the learnt weights of the two systems with different extents of training to verify our claims. The physical origin of this noise could be variations in memristor behavior over time [22]. Fig. 8 (d) and (e) show the original means as well as the ten scattered means for system A and system B respectively. c) Illustration for classification problem the Wisconsin Breast Cancer We use the nine RBF sensors for the analysis of the Wisconsin Cancer dataset in this section. The samples from this dataset belong to two classes – benign and malignant. Thus, 𝑁 = 2 here and the current space is of dimension two. Fig. 8 illustrates such a space with the 45° line partitioning the entire space into two subspaces. The benign samples are shown as red crosses (with their mean as a big red dot) while the malignant samples are shown as blue circle (with their mean as a big blue dot). Fig. 8 (a) shows the current space prior to any training, with the weights equal to their initialized value. The samples are randomly interwoven around the 45° line and are virtually indistinguishable. Fig. 8 (b) illustrates the scenario after one training epoch. The merit figure improves significantly. We continue the training till 14 epochs, after which we perform a round of testing. The classification accuracy is found to be within 1% of the merit figure obtained from our analysis. Thus, the merit figure shows a high correlation with the actual classification accuracy (to be discussed further). A concise visualization of performance improvement during learning is achieved. d) Robustness Metric Although the merit figure serves as an accurate indicator for network performance when the system is ideal, it does not assess the robustness against noise introduced in the weights. After all, the synaptic weights are modelled as RRAMs which are prone to minor variations. We observe that ideally, the samples should lie well within their respective sub-spaces as then, even if they move around a little, they would not flip over to the wrong subspace. However, if they lie close to the boundary, they are likely to end up in the wrong subspace leading to a drop in performance. We thus define the robustness metric as (15) 𝑅𝑜𝑏𝑢𝑠𝑡𝑛𝑒𝑠𝑠 𝑀𝑒𝑡𝑟𝑖𝑐 ≡ min(𝒅) ∙ 100 where 𝒅 is the normalized distance of the means of samples belonging from each class, from their corresponding sub-space boundary, where the normalization is done with the maximum possible separation that the means could have. Thus, the closer this metric is to hundred, the farther the samples are from the boundary and hence the more robust the system is against minor variations in the weights. However, if this metric is close to zero or even negative, it implies that the samples are either very close to the boundary or even in the wrong side of it, implying that the system is very sensitive to variations in weights. In the ideal scenario, we would like the means to lie at the extremes e) Correlation, Efficiency and Noise Tolerance Measure First, based on large number of recognition events, we observe that the merit figure and the classification accuracy have a high correlation coefficient of 0.98, thereby empirically justifying that the merit figure is indeed a good approximate of the actual classification accuracy, as seen in Fig. 9(a). A significant reduction (15000 ×) in its computation time is achieved viz. the standard recognition test, as shown in Fig. 9 (b). For instance, the computation of the merit figure for all samples of the Wisconsin Breast Cancer data-set takes a mere 0.01s in MATLAB as it essentially is the equivalent of DC analysis as opposed to transients in standard recognition which would take 150 s. Next, we use the merit figure to gauge the performance degradations of the two systems with increasing noise variance. For this, we sweep 𝜎 from 10 to 300 and at each step, and report a 1000 point average for the merit figure, to account for the stochasticity in the noise. We observe that the system after fourteen training epochs (system B) is indeed more faulttolerant, as can be clearly seen in Fig. 9 (b). For any value of 𝜎, system B reports a higher merit figure than system A. Fig. 8. The Wisconsin Cancer data samples in the current space along with their means illustrating the evolution of the merit figure and the Separation Metric (𝑑). (a) The initial configuration prior to training with a low merit figure and negative value for 𝑑𝑏𝑙𝑢𝑒 (b) After one training epoch, the merit figure rises while the two means fall into their respective sub-spaces (c) After 14 training epochs, the merit figure has a minor increment while 𝑑𝑏𝑙𝑢𝑒 increases further. The classification accuracy at this stage closely resembles the merit figure. (d) and (e) The scattered means for system A and system B respectively after adding a zero mean 300 variance noise to the learnt weights. metric. Note that the merit figure is reported as a 1000 point average to account for the stochasticity in the noise. The vertical lines show the variance of the merit figures for each value of 𝜎. At a threshold of 90% accuracy, the noise tolerance is 𝜎 =50 for case A compared to 𝜎 =100 for case B (2x change – which is proportional to the robustness metric change of 2.5×). In comparison, the initial performance only shows a 3% difference (i.e. very weak dependence). V. CONCLUSION Fig. 9. (a) A high correlation coefficient of 0.98 is observed between classification accuracy and merit figure for the 20 random data points, 10 each from systems A and B (b) A comparison of computational times of the two testing methodologies (c) Performance degradation with noise introduced in the learned weights of the two systems with different extents of training. System B performs better, as predicted by the robusteness Towards the goal of developing a simple SNN for classification tasks by STDP based SNN, which can be implemented on cross-bar array devices- we demonstrate some key enablers. First, we have achieved significant reduction in complexity of network structure (>3.5× reduction in neurons & synapse, and 30 × reduction in epochs) without compromising on performance. The efficient network is based on effective population coding and synapse-neuron co-design. Second, an efficient and detailed method to evaluate SNN performance is proposed and validated. The output currents space provides a detailed visualization of the time-evolution of learning in SNNs. The method provides a 15000 × computational efficiency as well as excellent accuracy (correlation of 0.98 to conventional testing). It also accelerates stochastic simulations. Third, a robust-ness metric is developed. For comparable performance (3% difference), robustness metric shows a 2.5× difference which is similar in order of magnitude to the difference in noise tolerance (2×). Thus, we show that the learning is more robust (that is, noise tolerance performance improves) with epochs. VI. REFERENCES G. J. Siegel, B. W. Agranoff, and R. W. Albers, Eds., Basic Neurochemistry: Molecular, Cellular and Medical Aspects. Philadelphia, PA: Lippincott-Raven, 1999. [2] Y. Xu, X. Zeng, L. Han and J. Yang, "A supervised multi-spike learning algorithm based on gradient descent for spiking neural networks," Neural Networks, pp. 99-113, 2013. [3] S. Ghosh-Dastidar and H. Adeli, "A new supervised learning algorithm for multiple spiking neural networks with application in epilepsy and seizure detection," Neural Networks, p. 1419–1431, 2009. [4] J. Xin and M. Embrechts, "Supervised learning with spiking neural networks," in IJCNN, 2001. [5] I. Sporea and A. Grüning, "Supervised Learning in Multilayer Spiking Neural Networks," Neural Compuation, pp. 473-509, 2012. [6] Y. Xu, X. Zeng and S. Zhong, "A New Supervised Learning Algorithm for Spiking Neurons," Neural Computation, p. 1472–1511, 2013. [7] A. Kasinski and P. Ponulak, "Comparison of Supervised Learning Methods for Spike Time Coding in Spiking Neural Networks," Int. J. Appl. Math. Comput. Sci., pp. 101-113, 2006. [8] P. Ponulak, "ReSuMe - New Supervised Learning Method," Poznan, 2005. [9] B. Ruf and M. Schmitt, "Learning Temporally Encoded Patterns in Networks," Neural Processing Letters, pp. 9-18, 1997. [10] A. Shukla, V. Kumar, U. Ganguly - A Softwareequivalent Hardware approach to Spiking Neural Network based Real-time Learning using RRAM array demonstration in SPICE* - submitted for IJCNN 2017 [11] S.M. Bohte, J.N. Kok, and H. La Poutre (2002) - Error Backpropagation in Temporally Encoded Networks of Spiking Neurons [12] M.N. Shadlen and W.T. Newsome - The variable discharge of cortical neurons: implications for [13] [1] [14] [15] [16] [17] [18] [19] [20] [21] [22] connectivity, computation and information coding, Neuronsci, 18(1998) 3870-389 K.C. Zhang, I.Ginzburg, B.LI McNaughton Interpreting Neuronal Population Activity by Reconstruction: Unified Framework With Application to Hippocampal Place Cells, J. Neurophysiol. 79: 1017–1044, 1998 A. Gupta and L. N. Long, "Character Recognition using Spiking Neural," in IEEE Neural Networks Conference, Orlando, FL, 2007. Christof Koch, Idan Segev, (1999) - Methods in neuronal modeling; from ions to networks (2nd ed.). Cambridge, Massachusetts: MIT Press. p. 687. ISBN 0-262-11231-0 R. Gütig and S. Haim, "The tempotron: a neuron that learns spike timing-based decisions," Nature Neuroscience, pp. 420-428, 2006. Guetig R., Aharonov R., Rotter S. and Sompolinsky H (2003) - Learning input correlations through nonlinear temporally asymmetric Hebbian plasticity Newman, D.J., Hettich, S., Blake, C.L., & Merz, C.J. (1998). UCI repository of machine learning databases. Irvine, CA: Department of Information and Computer Science, University of California. Available: http://www.ics.uci.edu/mlearn/MLRepository.html. O. L. Mangasarian, W. N. Street and W. H. Wolberg, "Breast Cancer Diagnosis and Prognosis via Linear Programming," AAAI Technical Report SS-94-01, 1994. Forina, M. et al, PARVUS - An Extendible Package for Data Exploration, Classification and Correlation. Institute of Pharmaceutical and Food Analysis and Technologies, Via Brigata Salerno, 16147 Genoa, Italy Heart-statlog data - source: V.A. Medical Center, Long Beach and Cleveland Clinic Foundation: Robert Detrano Boubacar Traoré, Philippe Blaise, Elisa Vianello, Helen Grampeix, Simon Jeannot, Luca Perniola, Barbara De Salvo, and Yoshio Nishi - On the Origin of Low-Resistance State Retention Failure in HfO2Based RRAM and Impact of Doping/Alloying - IEEE TRANSACTIONS ON ELECTRON DEVICES, 2015
9cs.NE
C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Classical Planning in Deep Latent Space: Bridging the Subsymbolic-Symbolic Boundary Masataro Asai Alex Fukunaga GUICHO 2.71828 α GMAIL . COM arXiv:1705.00154v3 [cs.AI] 3 Dec 2017 Graduate School of Arts and Sciences, University of Tokyo Abstract Current domain-independent, classical planners require symbolic models of the problem domain and instance as input, resulting in a knowledge acquisition bottleneck. Meanwhile, although deep learning has achieved significant success in many fields, the knowledge is encoded in a subsymbolic representation which is incompatible with symbolic systems such as planners. We propose LatPlan, an unsupervised architecture combining deep learning and classical planning. Given only an unlabeled set of image pairs showing a subset of transitions allowed in the environment (training inputs), and a pair of images representing the initial and the goal states (planning inputs), LatPlan finds a plan to the goal state in a symbolic latent space and returns a visualized plan execution. The contribution of this paper is twofold: (1) State Autoencoder, which finds a propositional state representation of the environment using a Variational Autoencoder. It generates a discrete latent vector from the images, based on which a PDDL model can be constructed and then solved by an off-the-shelf planner. (2) Action Autoencoder / Discriminator, a neural architecture which jointly finds the action symbols and the implicit action models (preconditions/effects), and provides a successor function for the implicit graph search. We evaluate LatPlan using image-based versions of 3 planning domains: 8-puzzle, Towers of Hanoi and LightsOut. Note This is an extended manuscript of the paper accepted in AAAI-18. The contents of AAAI-18 submission itself is significantly extended from what has been published in Arxiv, KEPS-17, NeSy-17 or Cognitum-17 workshops. Over half of the paper describing (2) is new. Additionally, this manuscript contains the contents in the supplemental material of AAAI-18 submission. These implementation/experimental details are moved to the Appendix. Note to the ML / deep learning researchers This article combines the Machine Learning systems and the classical, logic-based symbolic systems. Some readers may not be familiar with NNs and related fields like you are, thus we include very basic description of the architectures and the training methods. 1. Introduction Recent advances in domain-independent planning have greatly enhanced their capabilities. However, planning problems need to be provided to the planner in a structured, symbolic representation such as PDDL [McDermott, 2000], and in general, such symbolic models need to be provided by a human, either directly in a modeling language such as PDDL, or via a compiler which transforms some other symbolic problem representation into PDDL. This results in the knowledge-acquisition 1 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Initial state image ? Goal state image Original Mandrill image Figure 1: An image-based 8-puzzle. bottleneck, where the modeling step is sometimes the bottleneck in the problem-solving cycle. In addition, the requirement for symbolic input poses a significant obstacle to applying planning in new, unforeseen situations where no human is available to create such a model or a generator, e.g., autonomous spacecraft exploration. In particular this first requires generating symbols from raw sensor input, i.e., the symbol grounding problem [Steels, 2008]. Recently, significant advances have been made in neural network (NN) deep learning approaches for perceptually-based cognitive tasks including image classification [Deng et al., 2009], object recognition [Ren et al., 2015], speech recognition [Deng et al., 2013], machine translation as well as NN-based problem-solving systems [Mnih et al., 2015; Graves et al., 2016]. However, the current state-of-the-art, pure NN-based systems do not yet provide guarantees provided by symbolic planning systems, such as deterministic completeness and solution optimality. Using a NN-based perceptual system to automatically provide input models for domain-independent planners could greatly expand the applicability of planning technology and offer the benefits of both paradigms. We consider the problem of robustly, automatically bridging the gap between such subsymbolic representations and the symbolic representations required by domain-independent planners. Fig. 1 (left) shows a scrambled, 3x3 tiled version of the photograph on the right, i.e., an imagebased instance of the 8-puzzle. Even for humans, this photograph-based task is arguably more difficult to solve than the standard 8-puzzle because of the distracting visual aspects. We seek a domain-independent system which, given only a set of unlabeled images showing the valid moves for this image-based puzzle, finds an optimal solution to the puzzle. Although the 8-puzzle is trivial for symbolic planners, solving this image-based problem with a domain-independent system which (1) has no prior assumptions/knowledge (e.g., “sliding objects”, “tile arrangement”), and (2) must acquire all knowledge from the images, is nontrivial. Such a system should not make assumptions about the image (e.g., “a grid-like structure”). The only assumption allowed about the nature of the task is that it can be modeled as a classical planning problem (deterministic and fully observable). We propose Latent-space Planner (LatPlan), an architecture which completely automatically generates a symbolic problem representation from the subsymbolic input, which can be used as the input for a classical planner. LatPlan consists of 3 components: (1) a NN-based State Autoencoder (SAE), which provides a bidirectional mapping between the raw images of the environment and its propositional representation, (2) an action model acquisition (AMA) system which grounds the action symbols and learns the action model, and (3) a symbolic planner. Given only a set of unlabeled 2 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) images of the environment, and in an unsupervised manner, we train the SAE and AMA to generate its symbolic representation. Then, given a planning problem instance as a pair of initial and goal images such as Fig. 1, LatPlan uses the SAE to map the problem to a symbolic planning instance, invokes a planner, then visualizes the plan execution. We evaluate LatPlan using image-based versions of the 8-puzzle, LightsOut, and Towers of Hanoi domains. 2. Background 2.1 Classical Planning Classical Planning is achieving a significant advance in the recent years due to the success of heuristic search. The input problem to a Classical Planning solver (a planner) is a 5-tuple Π = hP, O, I, G, Ai where P defines a set of first-order predicates, O is a set of symbols called objects, I is the initial state, G is a set of goal conditions, and A is a set of actions which defines the state transitions in the search space. A state is an assignment of boolean values to the set of propositional variables, while a condition is a partial assignment that assigns values only to a subset of propositions. Each proposition is an instantiation of a predicate with objects. Lifted action schema a ∈ A is a 5-tuple hparams, pre, e+ , e− , ci where each element means the set of parameters, preconditions, add-effects, delete-effects and the cost, respectively. Parameter substitution using objects in O instantiates ground actions. When c is not specified, it is usually assumed c = 1. These inputs are described in a PDDL modeling language [Bacchus, 2000] and its extensions. Fig. 2 shows one possible representation of a state in 3x3 sliding tile puzzle (8-puzzle) in the First Order Logic formula, and the representation of the same state using PDDL. Empty(x0 , y0 ) ∧At(x1 , y0 , panel6 ) ∧U p(y0 , y1 ) ∧Down(y1 , y0 ) ∧Right(x0 , x1 ) (empty (at (up (down (right (left x0 x1 y0 y1 x0 x1 y0) y0 panel6) y1) y0) x1) x0)... 6 8 7 3 2 5 1 4 ∧Lef t(x1 , x0 ) . . . Figure 2: One possible state representation of a 3x3 sliding tile puzzle (8-puzzle) in the first order logic formula and its corresponding PDDL notation. It contains predicate symbols empty, up, down, left, right, at as well as object symbols such as xi , yi , panelj for i ∈ {0..3} and j ∈ {1..8}. The task of a planning problem is to find a path from the initial state I to some goal state s∗ ⊇ G, using the state transition rules in A. A state s can be transformed into a new state t by applying a ground action a when s ⊇ pre, and then t = (s \ e− ) ∪ e+ [Bacchus, 2000]. This transition can also be viewed as applying a state transition function a to s, which can be written as t = a(s). State-of-the-Art planners solve this problem as a path finding problem on a implicit graph defined by the state transition rules. They usually employ forward state space heuristic search, such as A∗ (for finding the shortest path) or Greedy Best-First Search (for finding a suboptimal path more 3 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) ;; Translates to a PDDL model below: When (:action slide-up ... Empty(x, yold ) ∧ :precondition at(x, ynew , p) ∧ (and (empty ?x ?y-old) up(ynew , yold ) ; (at ?x ?y-new ?p) ...) then :effects ¬Empty(x, yold )∧ (and (not (empty ?x ?y-old)) Empty(x, ynew )∧ (empty ?x ?y-new) ¬at(x, ynew , p) ∧ (not (at ?x ?y-new ?p)) at(x, yold , p) (at ?x ?y-old ?p))) 6 8 7 3 2 5 1 4 Figure 3: One possible action representation of sliding up a tile in 3x3 sliding tile puzzle in (left) the first order logic formula and (middle) its corresponding PDDL notation. In addition to Fig. 2, it further contains an action symbol slide-up. Types of symbols Object symbols Predicate symbols Propositions Action symbols Problem symbols Domain symbols panel7, x0 , y0 . . . (empty ?x ?y) (up ?y0 ?y1 ) empty5 = (empty x2 y1 ) (6th application) (slide-up panel7 x0 y1 ) eight-puzzle-instance1504, etc. eight-puzzle, hanoi Table 1: 6 types of symbols in a PDDL definition. quickly). Thanks to the variety of successful domain-independent heuristic functions [Helmert and Domshlak, 2009; Sievers et al., 2012; Helmert et al., 2007; Bonet, 2013; Hoffmann and Nebel, 2001; Helmert, 2004; Richter et al., 2008], current state-of-the-art planners can scale to larger problems which requires to find a plan consisting of more than 1000 steps [Asai and Fukunaga, 2015]. 2.2 Knowledge Acquisition Bottleneck While ideally, symbolic models like Fig. 2 should be learned/generated by the machine itself, in practice, they must be hand-coded by a human, resulting in the so-called Knowledge Acquisition Bottleneck [Cullen and Bryman, 1988], which refers to the excessive cost of human involvement in converting real-world problems into inputs for symbolic AI systems. In order to fully automatically acquire symbolic models for Classical Planning, Symbol Grounding and Action Model Acquisition (AMA) are necessary. Symbol Grounding is an unsupervised process of establishing a mapping from huge, noisy, continuous, unstructured inputs to a set of compact, discrete, identifiable (structured) entities, i.e., symbols. For example, PDDL has six kinds of symbols: Objects, predicates, propositions, actions, problems and domains (Table 1). Each type of symbol requires its own mechanism for grounding. For example, the large body of work in the image processing community on recognizing objects (e.g. faces) and their attributes (male, female) in images, or scenes in videos (e.g. cooking) can be viewed as corresponding to grounding the object, predicate and action symbols, respectively. 4 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) In contrast, an Action Model is a symbolic/subsymbolic data structure representing the causality in the transitions of the world, which, in PDDL, consists of preconditions and effects (Fig. 2). In this paper, we focus on propositional and action symbols, as well as AMA, leaving first-order symbols (predicates, objects) as future work. 2.3 Action Model Acquisition (AMA) Methods Existing methods require symbolic or near-symbolic, structured inputs. ARMS [Yang et al., 2007], LOCM [Cresswell et al., 2013], and Mourão et al. (2012) assume the action, object, predicate symbols. Framer [Lindsay et al., 2017] parses natural language texts and emits PDDL, but requires a clear grammatical structure and word consistency. Konidaris et al. generated PDDL from semi-MDP (2014). They convert a probabilistic model into a propositional model, i.e., they do not generate a model from unstructured inputs. In fact, options (≈ actions) in their semi-MDP have names assigned by a human (move/interact), and state variables are identifiable entities (x/y distances toward objects, light level, state of a switch) i.e. already symbolic. Previous work in Learning from Observation, which could take images (unstructured input), typically assume domain-dependent hand-coded symbol extractors, such as ellipse detectors for tic-tac-toe board data which immediately obtains propositions [Barbu et al., 2010]. Kaiser (2012) similarly assumes grids and pieces to obtain the relational structures in the board image. 2.4 Autoencoders and Latent Representations An Autoencoder (AE) is a type of feed-forward neural network that learns an identity function whose output matches the input [Hinton and Salakhutdinov, 2006]. Its intermediate layer (typically smaller than the input) has a compressed, latent representation of the input. AEs are trained by backpropagation (BP) to minimize the reconstruction loss, the distance between the input and the output according to a distance function such as Euclidean distance. NNs, including AEs, typically have continuous activations and integrating them with propositional reasoners is not straightforward. 3. LatPlan: System Architecture This section describes the high-level architecture of LatPlan (Fig. 4). LatPlan takes two inputs. The first input is the transition input T r, a set of pairs of raw data. Each pair tri = (prei , suci ) ∈ T r represents a transition of the environment before and after some action is executed. The second input is the planning input (i, g), a pair of raw data, which corresponds to the initial and the goal state of the environment. The output of LatPlan is a data sequence representing the plan execution that reaches g from i. While we present an image-based implementation (“data” = raw images), the architecture itself does not make such assumptions and could be applied to the other data formats e.g. audio/text. LatPlan works in 3 phases. In Phase 1, a State Autoencoder (SAE) learns a bidirectional mapping between raw data (e.g., images) and propositional states from a set of unlabeled, random snapshots of the environment. The Encode function maps images to propositional states, and Decode function maps the propositional states back to images. After training the SAE from {prei , suci . . .}, we apply Encode to each tri ∈ T r and obtain (Encode(prei ), Encode(suci )) = (si , ti ) = tri ∈ T r, the symbolic representations (latent space vectors) of the transitions. 5 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Input 1 (Transition input): Images pairs representing the valid actions, used for training SAE and AMA. State AutoEncoder (SAE) SAE Encode Input 2: (planning input) Initial state & goal state image Encode Subsymbolic SAE Decode Symbolic Action Model Intermediate states Acquisition (AMA) Action Model Initial State Domainindependent Planner Goal State Plan Plan Simulator Action1 Action2 Action3 Solution Plan as images Figure 4: Classical planning in latent space: We use the learned State Autoencoder (Sec. 4) to convert pairs of images (pre, suc) first to symbolic transitions, from which the AMA component generates an action model. We also encode the initial and goal state images into symbolic initial/goal states. A classical planner finds the symbolic solution plan. Finally, intermediate states in the plan are decoded back to a human-comprehensible image sequence. 6 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) In Phase 2, an AMA method identifies the action symbols from T r and learns an action model, both in an unsupervised manner. We propose two approaches: AMA1 directly generates a PDDL and AMA2 produces a successor function (implicit model). Both methods have advantages and drawbacks. AMA1 is a trivial AMA method designed to show the feasibility of SAE-generated propositional symbols. It does not learn/generalize from examples, instead requiring all valid state transitions. However, since AMA1 directly produces a PDDL model, it serves as a demonstration that in principle, the approach is compatible with existing planners. AMA2 is a novel NN architecture which jointly learns action symbols and action models from a small subset of transitions in an unsupervised manner. Unlike existing methods, AMA2 does not require action symbols. Since it does not produce PDDL, it needs a search algorithm (such as A*) for AMA2 , or semi-declarative symbolic planners [Frances et al., 2017], instead of PDDL-based solvers. In Phase 3, a planning problem instance is generated from the planning input (i, g). These are converted to symbolic states by the SAE, and the symbolic planner solves the problem. For example, an 8-puzzle problem instance consists of an image of the start (scrambled) configuration of the puzzle (i), and an image of the solved state (g). Since the intermediate states comprising the plan are SAE-generated latent bit vectors, the “meaning” of each state (and thus the plan) is not necessarily clear to a human observer. However, in the final step, we obtain a step-by-step visualization of the plan execution (e.g. Fig. 6) by Decode’ing the latent bit vectors for each intermediate state. In this paper, we evaluate LatPlan as a high-level planner using puzzle domains such as the 8puzzle. Mapping a high-level action to low-level actuation sequences via a motion planner is beyond the scope of this paper. 4. SAE as a Gumbel-Softmax VAE First, note that a direct 1-to-1 mapping from images to propositions can be trivially obtained from the array of discretized pixel values or an image hash function. However, such a trivial SAE lacks the crucial properties of generalization – ability to describe unseen world states with the same symbols – robustness – two similar images that represent “the same world state” should map to the same representation – and bijection – ability to map symbolic states to real-world images. We need a bidirectional mapping where the symbolic representation captures the “essence” of the image, not merely the literal, raw pixel vector. The first technical contribution of this paper is the proposal of a SAE which is implemented as a Variational Autoencoder [Kingma et al., 2014] with a Gumbel-Softmax (GS) activation [Jang et al., 2017] (Fig. 5). A Variational Autoencoder (VAE) [Kingma and Welling, 2013] is a type of AE that forces the latent layer (the most compressed layer in the AE) to follow a certain distribution (e.g., Gaussian). Since the random distribution is not differentiable (BP is not applicable), VAEs use reparametrization tricks, which decompose the target distribution into a differentiable and a purely random distribution (the latter does not require the gradient). For example, the Gaussian N (σ, µ) is decomposed to µ+σN (1, 0), where µ, σ are learned. In addition to the reconstruction loss, VAE should also minimize the variational loss (the difference between the learned and the target distributions) measured by, e.g., KL divergence. Gumbel-Softmax (GS) is a recently proposed reparametrization trick [Jang et al., 2017] for categorical distribution. It continuously approximates Gumbel-Max [Maddison et al., 2014], a method 7 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) (Example with N=25) The latent layer converges to the categorical distrib. The output converges to the input Figure 5: Step 1: Train the State Autoencoder by minimizing the sum of the reconstruction loss and the variational loss of Gumbel-Softmax. As the training continues, the output of the network converges to the input images. Also, as the Gumbel-Softmax temperature τ decreases during training, the latent values approach either 0 or 1. for drawing categorical samples. Assume the output z is a one-hot vector, e.g. if the domain is D = {a, b, c}, h0, 1, 0i represents “b”. The input is a class probability vector π, e.g. h.1, .1, .8i. Gumbel-Max draws samples from D following π: zi ≡ [i = arg maxj (gj + log πj ) ? 1 : 0] where gj are i.i.d samples drawn from Gumbel(0, 1) [Gumbel and Lieblein, 1954]. Gumbel-Softmax approximates argmax with softmax to make it differentiable: zi = Softmax((gi + log πi )/τ ). “Temperature” τ controls the magnitude of approximation, which is annealed to 0 by a certain schedule. The output of GS converges to a discrete one-hot vector when τ ≈ 0. Our key observation is that these categorical variables can be used directly as propositional symbols by a symbolic reasoning system, i.e., this gives a solution to the propositional symbol grounding in our architecture. In the SAE, we use GS in the latent layer. Its input is connected to the encoder network. The output is an (N, M ) matrix where N is the number of categorical variables and M is the number of categories. We specify M = 2, effectively obtaining N propositional state variables. It is possible to specify different M for each variable and represent the world using multi-valued representation as in SAS+ [Bäckström and Nebel, 1995], but we use M = 2 for all variables for simplicity. This does not affect the expressiveness because bitstrings of sufficient length can represent arbitrary integers. The trained SAE provides a bidirectional mapping between the raw inputs (subsymbolic representation) and their symbolic representations: • b = Encode(r) maps an image r to a boolean vector b. • r̃ = Decode(b) maps a boolean vector b to an image r̃. Encode(r) maps raw input r to a symbolic representation by feeding the raw input to the encoder network, extract the activation in the GS layer, and take the first row in the N × 2 matrix, resulting in a binary vector of length N . Similarly, Decode(b) maps a binary vector b back to an image by concatenating b and its complement b̄ to obtain a N × 2 matrix and feeding it to the decoder. These are lossy compression/decompression functions, so in general, r̃ = Decode(Encode(r)) may have an acceptable amount of errors from r for visualization. 8 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) It is not sufficient to simply use traditional activation functions such as sigmoid or softmax and round the continuous activation values in the latent layer to obtain discrete 0/1 values. In order to map the propositional states back to images, we need a decoding network trained for 0/1 values. A rounding-based scheme would be unable to restore the images because the decoder is not trained with inputs near 0/1 values. Also, embedding the rounding operation as a layer of the network is infeasible because rounding is non-differentiable, precluding BP-based training of the network. SAE implementation can easily and largely benefit from the progress in the image processing community. We implemented SAE as a denoising autoencoder [Vincent et al., 2008] to add noise robustness, with some techniques which improve the accuracy (see Appendix Sec. A). 5. AMA1 : Oracular PDDL Generator In AMA1 , our first AMA method, the output is a PDDL definition for a grounded unit-cost STRIPS planning problem. AMA1 is a trivial, oracular strategy which generates a model based on all transitions, i.e., T r contains image pairs representing all transitions that are possible in this domain, and T r contains all corresponding symbolic transitions. The images are generated by an external, domain-specific image generator. It is important to note that while T r for AMA1 contains all transitions, the SAE is trained using only a subset of state images. Although ideally an AMA component should induce a complete action model from a limited set of transitions, AMA1 is intended to demonstrate the overall feasibility of SAE-produced propositions and the overall LatPlan architecture. AMA1 compiles T r directly into a PDDL model as follows. Each transition tri ∈ T r directly maps to an action ai . Each bit bj (1 ≤ j ≤ N ) in boolean vectors si and ti is mapped to propositions (bj -true) and (bj -false) when the encoded value is 1 and 0 (resp.). si is directly used as the preconditions of action ai . The add/delete effects of action i are computed by taking the bitwise difference between si and ti . For example, when bj changes from 1 to 0, the effect compiles to (and (bj -false) (not (bj -true))). The initial and the goal states are similarly created by applying the SAE to the initial and goal images. The PDDL instance output by AMA1 can be solved by an off-the-shelf planner. We use a modified version of Fast Downward [Helmert, 2006] (see Appendix Sec. F.1). LatPlan inherits all of the search-related properties of the planner which is used. For example, if the planner is complete and optimal, LatPlan will find an optimal plan for the given problem (if one exists), with respect to the portion of the state-space graph captured by the Action Model. 5.1 Evaluating AMA1 on Various Puzzles We evaluated LatPlan with AMA1 on several puzzle domains. Resulting plans are shown in Fig. 6-7. See Appendix Sec. E for further details of the network, training and inputs. MNIST 8-puzzle is an image-based version of the 8-puzzle, where tiles contain hand-written digits (0-9) from the MNIST database [LeCun et al., 1998]. Valid moves in this domain swap the “0” tile with a neighboring tile, i.e., the “0” serves as the “blank” tile in the classic 8-puzzle. The Scrambled Photograph 8-puzzle (Mandrill, Spider) cuts and scrambles real photographs, similar to the puzzles sold in stores). These differ from the MNIST 8-puzzle in that “tiles” are not cleanly separated by black regions (we re-emphasize that LatPlan has no built-in notion of square or movable region). In Towers of Hanoi (ToH), we generated the 4 disks instances. 4-disk ToH resulted in a 15-step optimal plan. LightsOut is a video game where a grid of lights is in some on/off configu9 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) ration (+: On), and pressing a light toggles its state as well as the states of its neighbors. The goal is all lights Off. Unlike previous puzzles, a single operator can flip 5/16 locations at once and removes some “objects” (lights). This demonstrates that LatPlan is not limited to domains with highly local effects and static objects. Twisted LightsOut distorts the original LightsOut game image by a swirl effect, showing that LatPlan is not limited to handling rectangular “objects”/regions. 5.2 Robustness to Noisy Input Fig. 8 demonstrates the robustness of the system vs. input noise. We corrupted the initial/goal state inputs by adding Gaussian or salt/pepper noise. The system is robust enough to successfully solve the problem because of the Denoising AE [Vincent et al., 2008]. 6. AMA2 : Action Symbol Grounding LatPlan + AMA1 shows that (1) the SAE can robustly learn image ↔ propositional vector mappings from examples, and that (2) if all valid image-image transitions (i.e., the entire state space) is given, LatPlan can correctly generate optimal plans. However, AMA1 is clearly not practical due to the requirement that it uses the entire state space as input, and lacks the ability to learn/generalize an action model from a small subset of valid action transitions (image pairs). Next, we propose AMA2 , a novel neural architecture which jointly grounds the action symbols and acquires the action model from the subset of examples, in an unsupervised manner. Acquiring a descriptive action model (e.g., PDDL) from a set of unlabeled propositional state transitions consists of three steps. (Step 1) Identify the “types” of transitions, where each “type” is an identifiable, action symbol. For example, a hand-coded “slide-up-8-at-1-2” in 8-puzzle is an example of action symbols, but note that an AMA system should ground anonymous symbols without human-provided labels. While they are not lifted/parameterized, they still provide abstraction. For example, the same “slide-up-8-at-1-2” action, which slides the tile 8 at position (x, y) = (1, 2) upward, applies to many states (each state being a permutation of tiles 1-7). (Step 2) Identify the preconditions and the effects of each action and store the information in an action model. (Step 3) Represent the model in a modeling language (e.g., PDDL) as in Fig. 2. Addressing this entire process is a daunting task. Existing AMA methods typically handle only Steps 2 and 3, skipping Step 1. Without step 1, however, an agent lacks the ability to learn in an unknown environment where it does not know what is even possible. Note that even if the agent has the full knowledge of its low-level actuator capabilities, it does not know its own high-level capabilities e.g. sliding a tile. Note that AMA1 handles only Step 3, as providing all valid transitions is equivalent to skipping Step 1/2. On the other hand, search on a state space graph in an unknown environment is feasible even if Step 3 is missing. PDDL provides two elements, a successor function and its description. While ideally both are available, the description is not the essential requirement. The description may increase the explainability of the system in a language such as PDDL, but such explainability may be lost anyway when the propositional symbols are identified by SAE, as the meanings of such propositions are unclear to humans (Sec. 3). The description is also useful for constructing the heuristic functions, but the recent success of simulator-based planning [Frances et al., 2017] shows that, in some application, efficient search is possible without action descriptions. The new method, AMA2 , thus focuses on Steps 1 and 2. It grounds the action symbols (Step 1) and finds a successor function that can be used for forward state space search (Step 2), but maintains 10 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) 0-tile corresponds to the blank tile in the standard 8-puzzle Right-eye tile corresponds to the blank tile in the standard 8-puzzle Original Mandrill image: Right-eye tile corresponds to the blank tile in the standard 8-puzzle Original Spider image: Figure 6: Output of LatPlan + AMA1 solving the MNIST/Mandrill/Spider 8-puzzle instance with the longest (31 steps) optimal plan (Reinefeld 1993). This shows that LatPlan finds an optimal solution given a correct model by AMA1 and an admissible search algorithm. LatPlan has no notion of “slide” or “tiles”, making MNIST, Mandrill and Spider entirely distinct domains. SAEs are trained from scratch without knowledge transfer. 11 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Figure 7: (1) Output of solving ToH with 4 disks. (2-3) Output of solving 4x4 LightsOut and Twisted LightsOut. The blurs in the goal states are simply the noise that was normalized and enhanced by the plotting library. MNIST+N(0,0.3) Mandrill+sp(0.06) L.Out+N(0,0.3) Twisted+sp(0.06) Figure 8: SAE robustness vs noise: Corrupted initial state image r and its reconstruction Decode(Encode(r)). Images are corrupted by Gaussian noise of σ up to 0.3 and by salt/pepper noise up to p = 0.06. LatPlan successfully solved the problems. The SAE maps the noisy image to the correct symbolic vector, finds a plan, then maps the plan back to the denoised images. 12 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) One-hot action label ((N,M)=(1,128) Gumbel-Softmax) ~ a Train NN to Minimize |t - t| symbolic t bitvector (36bit) s Input ~ concat t Output Obtain two functions: ・action(t, s) = a ~ ・apply(a, s) = t Figure 9: Action Autoencoder. its implicit representation. AMA2 comprises two networks: an Action Autoencoder (AAE) and an Action Discriminator (AD). The AAE jointly learns the action symbols and the action effects, and provides the ability to enumerate the candidates of the successors of a given state. The AD learns which transitions are valid, i.e. preconditions. Using the enumeration & filtering approach, the AAE and the AD provides a successor function that returns a list of valid successors of the current state. Both networks are trained unsupervised, and operate in the symbolic latent space, i.e. both the input and output are SAE-generated bitvectors. This keeps the network small and easy to train. 6.1 Action Autoencoder Consider a simple, linear search space with no branches. In this case, grounding the action symbol is not necessary and the AMA task reduces to predicting the next state t from the current state s. A NN a0 could be trained for a successor function a(s) = t, minimizing the loss |t − a0 (s)|. This applies to much of the work on scene prediction from videos such as [Srivastava et al., 2015]. However, when the current state has multiple successors, as in planning problems, such a network cannot be applied. One might consider training a separate NN for each action, but (1) it is unknown how many types of transitions are available, (2) the number of transitions depends on the current state, and (3) it does not know which transition belongs to which action. Although a single NN could learn a multi-modal distribution, it lacks the ability to enumerate the successors, a crucial requirement for a search algorithm. To solve this, we propose an Action Autoencoder (AAE, Fig. 9). The key idea of AAE is to reformulate the transitions as apply(a, s) = t, which lifts the action symbol and makes it trainable, and to realize that s is the background information of the state transition function. The AAE has s, t as inputs and reconstructs t as t̃ whose error |t − t̃| is minimized. The main difference from a typical AE is: (1) The latent layer is a Gumbel-Softmax one-hot vector indicating the action label a. (2) Every layer is concatenated with s. The latter conditions the entire network by s, which makes the 128 action labels (7bit) represent only the conditional information (difference) necessary to “reconstruct t given s”, unlike typical AEs which encode the entire information of the input. As a result, the AAE learns the bidirectional mapping between t and a, both conditioned by s: • Action(t, s) = a returns the action label from t. • Apply(a, s) = t̃ applies a to s and returns a successor t̃. 13 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) The number of labels serves as the upper bound on the number of action symbols learned by the network. Too few labels make AAE reconstruction loss fail to converge to zero. After training, some labels may not be mapped to by any of the example transitions. In the later phases of LatPlan, these unused labels are ignored. Since we obtain a limited number of action labels, we can enumerate the candidates of the successor states of the given current state in constant time. Without AAE, all 2N states would be enumerated as the potential successors, which is clearly impractical. 6.2 Action Discriminator An AAE identifies the number of actions and learns the effects of actions, but does not address the applicability (preconditions) of actions. Preconditions are necessary to avoid invalid moves (e.g. swapping 3 tiles at once) or invalid states (e.g. having duplicated tiles), as shown in Fig. 10. Thus we need an Action Discriminator (AD, Fig. 11) which learns the 0/1 mapping for each transition indicating whether it is valid, i.e., the “preconditions”. This is a standard binary classification function which takes s, t as inputs and returns a probability that (s, t) is valid. One technical problem in training the AD is that explicit invalid transitions are unavailable. This is not just a matter of insufficient data, but rather a fundamental constraint in an image-based system operating in the physical environment: Invalid transitions which violate the laws of physics (e.g. teleportation) are never observed (because they never happens). We then might consider “imagining/generating” the negative examples, as humans do in a thought experiment, but it is also impossible due to the lack of specification of what is invalid. To overcome this issue, we use the PU-Learning framework [Elkan and Noto, 2008], which can learn a positive/negative classifier from the positive and mixed examples that may contain both positive and negative examples. We used T r as the positive examples (they are all valid). The mixed, i.e. possibly invalid, examples are generated by applying each action a (except unused ones) on each before-state s in T r, and removing the known positive examples from the generated pairs (s, t̃). 6.3 PU-learning The implementation of PU-learning is quite simple, following [Elkan and Noto, 2008]. Given a positive (p) and a mixed (m) dataset, p and m are first arbitrarily divided into a training set (p1 and m1 ) and validation set (p2 and m2 ), as usual. Then, a binary classifier for p1 (true) and m1 (false) is trained. As a result, we obtain a positive/mixed classifier d1 (x) which is a function which returns a probability that a data x belongs to p1 . After the training has finished, the positive examples in the validation set (p2 ) are classified, and the probability of p2 belonging to p1 are averaged to obtain a scalar c = average(d1 (p2 )). As the final step, the true positive/negative classifier d2 (x), which is a function which returns a probability that a data x is positive, is defined as d2 (x) = c · d1 (x). 6.4 State Discriminator As a performance improvement, we also trained a State Discriminator (SD) which is a binary classifier for a single state s and detects the invalid states, e.g. states with duplicated tiles in 8puzzles. Again, we use PU-learning. Positive examples are the before/after states in T r (all valid). Mixed examples are generated from the random bit vectors ρ (may be invalid): Many of the images Decode’ed from ρ are blurry and do not represent autoencodable, meaningful real-world images. 14 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Before-state s Figure 10: The successors of a state s (bottom-right), generated by applying all 98 actions identified by the AAE. A valid successor is marked by the red border. 15 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Action Discriminator Input Sigmoid [0, 1] ⊂ R t(36bit) s(36bit) Figure 11: Action Discriminator. Figure 12: (top, left) Random bit vector ρ, (bottom, left) Decode(ρ), (top, middle) Encode(Decode(ρ)) = ρ2 , (bottom, middle) Decode(ρ2 ), (top, right) Encode(Decode(ρ2 )) = ρ3 , (bottom, right) Decode(ρ3 ). As more autoencoding is performed, images become less blurry, although they are still invalid (two 1-tiles). However, when they are repeatedly encoded/decoded (Fig. 12), they converge to the clear, autoencodable invalid states because of the denoising AE [Vincent et al., 2008], and we used the results as the mixed examples. If Decode(ρ) results in a blurry image, this “blur” is recognized as a noise and reduced in each autoencoding step, finally resulting in a clean, reconstructable invalid image. We use the SD to prune some mixed action examples for the AD training so that they contain only the valid successors. This improves the AD accuracy significantly. 6.5 Additional Pruning Methods Additionally, we have two more pruning methods: The first one ensures that the SAE successfully reconstructs the successor state t, i.e. t and Encode(Decode(t)) are identical. The second one ensures that the AAE reconstructs t, i.e. t and Apply(Action(t, s), s) are identical. Successors which failed to be reconstructed are removed from the consideration. 16 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) 6.6 Planning in LatPlan using AMA2 In the case of AMA2 , we can not use an off-the-shelf PDDL-based planner because the action model is embedded in the AAE, AD, and SD neural networks. However, they allow us to implement a successor function which can be used in any symbolic, forward state space search algorithm such as A∗ [Hart et al., 1968]. The AAE generates the (potentially invalid) successors and the AD and SD filter the invalid states: Succ(s) = {t = apply(a, s) | a ∈ {0 . . . 127} \ unused, ∧ AD(s, t) ≥ 0.5 ∧ SD(t) ≥ 0.5 ∧ Encode(Decode(s)) ≡ s ∧ Apply(Action(t, s), s) ≡ t} We implemented A* in which states are latent-space (propositional) vectors, and the above Succ function is used to generate successors of states. A simple goal-count heuristic is used. As the goal-count heuristics is inadmissible, the results could be suboptimal. However, the purpose of implementing this planner is to see the feasibility of the action model. 6.7 Evaluation We evaluate the feasibility of the action symbols and the action models learned by AAE and AD. We tested 8-puzzle (mnist, mandrill, spider), LightsOut (+ Twisted). We generated 100 instances for each domain and for each noise type (std, gaussian noise, salt/pepper noise) by 7-step (benchmark A)or 14-step (benchmark B) self-avoiding random walks from the goal state, and evaluated the planner with the 180 sec. time limit. We verified the resulting image plans with domain-specific validators. Table 2 shows that the LatPlan achieves a high success rate. The failures are due to timeouts (the successor function requires many calls to the feedforward neural nets, resulting in a very slow node generation). We next examine the accuracy of the AD and SD (Table 2). We measured the type-1/2 errors for the valid and invalid transitions (AD) and states (SD). Low errors show that our networks successfully learned the action models. 7. Related Work Compared to the work by Konidaris et al. (2014), the inputs to LatPlan are unstructured (42x42=1764dimensional arrays for 8-puzzle); each pixel does not carry a meaning and the boundary between “identifiable entities” is unknown. Also, AMA2 automatically grounds action symbols, while they rely on human-assigned symbols (move, interact). Furthermore, they do not explicitly deal with robustness to noisy input, while we implemented SAE as a denoising AE. However, effects/preconditions in AMA2 is implicit in the network, and their approach could be utilized to extract PDDL from AAE/AD (future work). There is a large body of work using NNs to directly solve combinatorial tasks, starting with the well-known TSP solver [Hopfield and Tank, 1985]. Neurosolver represents a search state as a node in NN and solved ToH [Bieszczad and Kuchar, 2015]. However, they assume a symbolic input. 17 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) domain MNIST Mandrill Spider L. Out Twisted std 72 100 94 100 96 A:step=7 G s/p 64 64 100 100 99 98 99 100 65 98 B:step=14 std G s/p 6 4 3 9 14 14 29 36 38 59 60 51 75 68 72 SD error (%) type1 type2 0.09 <0.01 <0.01 <0.01 <0.01 <0.01 <0.01 N/A <0.01 N/A type1 1.55 1.10 1.22 0.03 0.02 AD error (in %) type2 2/SD 14.9 6.15 16.6 2.93 17.7 4.97 1.64 1.64 1.82 1.82 2/V 6.20 2.94 4.91 1.64 1.82 Table 2: AMA2 results: (left) Number of solved instances out of 100 within 3 min. time limit. The 2nd/3rd columns show the results when the input is corrupted by G(aussian) or s(alt)/p(epper) noise. In benchmark A (created with 7-step random walks), LatPlan solved the majority of instances even under the input noise. In the harder instances (benchmark B: 14-steps), many instances were still solved. (right) Misclassification by SD and AD in %, measured as: (SD type-1) Generate all valid states and count the states misclassified as invalid. (type-2) Generate reconstructable states, remove the valid states (w/ validator), sample 30k states, and count the states misclassified as valid. N/A means all reconstructable states were valid. (AD type-1) Generate all valid transitions and count the number of misclassification. (type-2) For 1000 randomly selected valid states, generate all successors, remove the valid transitions (w/ validator), then count the transitions misclassified as valid. (2/SD, 2/V) Same as Type-2, but ignore the transitions whose successors are invalid according to SD or the validator. Relatively large AD errors explain the increased number of failures in MNIST 8-puzzles. 18 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Previous work combining symbolic search and NNs embedded NNs inside a search to provide the search control knowledge, e.g., domain-specific heuristic functions for the sliding-tile puzzle and Rubik’s Cube [Arfaee et al., 2011], classical planning [Satzger and Kramer, 2013], or the game of Go [Silver et al., 2016]. Deep Reinforcement Learning (DRL) has solved complex problems, including video games where it communicates to a simulator through images [Mnih et al., 2015, DQN]. In contrast, LatPlan only requires a set of unlabeled image pairs (transitions), and does not require a reward function for unit-action-cost planning, nor expert solution traces (AlphaGo), nor a simulator (DQN), nor predetermined action symbols (“hands”, control levers/buttons). Extending LatPlan to symbolic POMDP planning is an interesting avenue for future work. A significant difference between LatPlan and learning from observation (LfO) in the robotics literature [Argall et al., 2009] is that LatPlan is trained based on individual transitions while LfO work is largely based on the longer sequence of transitions (e.g. videos) and should identify the start/end of actions (action segmentation). Action segmentation would not be an issue in an implementation of autonomous LatPlan-based agent because it has the full control over its low-level actuators and initiates/terminates its own action for the data collection. 8. Discussion and Conclusion We proposed LatPlan, an integrated architecture for learning and planning which, given only a set of unlabeled images and no prior knowledge, generates a classical planning problem, solves it with a symbolic planner, and presents the plan as a human-comprehensible sequence of images. We demonstrated its feasibility using image-based versions of planning/state-space-search problems (8puzzle, Towers of Hanoi, Lights Out). Our key technical contributions are (1) SAE, which leverages the Gumbel-Softmax to learn a bidirectional mapping between raw images and propositional symbols compatible to symbolic planners. On 8-puzzle, the “gist” of 42x42 training images are robustly compressed into propositions, capturing the essence of the images. (2) AMA2 , which jointly grounds action symbols and learns the preconditions/effects. It identifies which transitions are “same” wrto the state changes and when they are allowed. The only key assumptions about the input domain we make are that (1) it is fully observable and deterministic and (2) NNs can learn from the available data. Thus, we have shown that different domains can all be solved by the same system, without modifying any code or the NN architecture. In other words, LatPlan is a domain-independent, image-based classical planner. To our knowledge, this is the first system which completely automatically constructs a logical representation directly usable by a symbolic planner from a set of unlabeled images for a diverse set of problems. We demonstrated the feasibility of leveraging deep learning in order to enable symbolic planning using classical search algorithms such as A*, when only image pairs representing action start/end states are available, and there is no simulator, no expert solution traces, and no reward function. Although much work is required to determine the applicability and scalability of this approach, we believe this is an important first step in bridging the gap between symbolic and subsymbolic reasoning and opens many avenues for future research. 19 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Appendix A. State AutoEncoder All of the SAE networks used in the evaluation have the same network topology for each domain, except the input layer which should fit the size of the input images. They are implemented with TensorFlow and Keras libraries in under 5k lines of code. We used a trivial, custom-made random grid search for automated tuning. All layers except Gumbel-Softmax in the network are the very basic ones introduced in a standard tutorial. The network uses a convolutional network in the encoder, and fc layers in the decoder (Fig. 13). The latent layer has 36 bits. Input layer has the same dimension as the image size. The network was trained using the Adam optimizer [Kingma and Ba, 2014]. Learning rate (lr) starts at 0.001, and is decreased to 0.0001 at the half of the entire epoch. In 8-puzzle domains, we used 150 epochs and batch-size 4000. In LightsOut domains, we used 100 epochs and batch-size 2000, due to the larger size of the image. In Hanoi, we used a channel size of 12 instead of 16 for convolutions, dropout 0.6, and batch-size 500. Training takes about 15 minutes on a single NVIDIA GTX-1070. Input(input), GaussianNoise(0.4), conv(3,3,16), tanh, bn, dropout(0.4), conv(3,3,16), tanh, bn, dropout(0.4), fc(72), reshape(36x2), GumbelSoftmax, fc(1000), relu, bn, dropout(0.4), fc(1000), relu, bn, dropout(0.4), fc(input), sigmoid. Figure 13: SAE implementation. Here, fc = fully connected layer, conv = convolutional layer, relu = Rectified Linear Unit, bn = Batch Normalization, and tensors are reshaped accordingly. In all experiments, the annealing schedule of Gumbel-Softmax is τ ← max(0.7, τ0 exp(−rt)) where t is the current training epoch, τ0 is the initial temperature and r is an annealing ratio. We chose τ0 , r so that τ = 5.0 when the training starts and τ = 0.7 when the training finishes. The above schedule is similar to the original schedule in Jang et al. (2017). A.1 State Augmentation As mentioned in the paper, the number of bits should be larger than the minimum encoding length log2 |S| of the entire state space S. 36 bits in the latent layer sufficiently covers the total number of states in any of the problems that are used in the experiments. However, excessive latent space capacity (number of bits) is also harmful. Due to the nature of Gumbel-Softmax, which uses Gumbel random distribution, excessive number of bits results in meaningless bits that does not affect the decoder output. These bits act like purely random variables and cause multiple symbolic states to represent the same image. This causes an undesirable behavior in the latent space, since it could make the search graph disconnected. One way to obtain a connected search graph under this condition is what we call state augmentation, which encodes the same image several times and simply sample the bitvectors for an image. This technique is used in the Towers of Hanoi (ToH) AMA1 experiments, as ToH has the small search space. 20 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) In general, there is a tradeoff: The larger the latent space capacity, the easier it is to train the SAE, but the latent space becomes more stochastic. Thus, it is desirable to reduce the latent capacity with further engineering, while trying to connect the search graph with sampling. Appendix B. Action AutoEncoder Input(36), concatenate(s), fc(400), relu, bn, dropbout(0.4), concatenate(s), fc(400), relu, bn, dropbout(0.4), concatenate(s), fc(128), reshape(1x128), GumbelSoftmax, concatenate(s), fc(400), relu, bn, dropbout(0.4), concatenate(s), fc(400), relu, bn, dropbout(0.4), fc(36), sigmoid Figure 14: AAE implementation. Here, fc = fully connected layer, bn = Batch Normalization, and tensors are reshaped accordingly. AAE consists of the layers as shown in Fig. 14. The input takes the successor state t (36bit) and concatenate(s) concatenate the input with the before-state s (36bit). The output of the network is t̃, a 36bit reconstruction of t. The network was trained with lr:0.001, Adam, batch size 2000, 1000 epochs, to minimize the reconstruction loss |t − t̃| in terms of binary cross-entropy. Training takes about 5 min. In all experiments, the annealing schedule of Gumbel-Softmax is τ ← max(0.1, τ0 exp(−rt)). We chose τ0 , r so that τ = 5.0 and τ = 0.1 when the training finishes. Appendix C. Action Discriminator (AD) The Action Discriminator uses PU-learning framework [Elkan and Noto, 2008] to learn a positive/negative binary classifier from a positive/mixed dataset. We first concatenate s and t, resulting in a set of 72 bit binary vectors. We prepare a vector whose length is the same as the number of data, and assign 1 to the positive data, and 0 to the mixed data. p and m are concatenated, shuffled, and divided into training set (90%) and the validation set (10%). To classify p1 and m1 , we trained several networks shown in Fig. 15 and chose the one which achieved the best accuracy. The network is trained using Adam, lr:0.001, 3000 epochs with early stopping, batch size 1000, using binary cross-entropy loss. Each training takes 2-10 minutes depending on the domain. Appendix D. State Discriminator The State Discriminator also uses the PU-learning framework [Elkan and Noto, 2008]. The dataset is prepared as described in the paper, and divided into training and validation set (90% and 10%). We use the following single layer perceptron: [Input(36), bn, fc(50), relu, dropout(0.8), fc(1), sigmoid]. 21 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Input(72), [bn, fc(300), relu, dropout(X)] ×Y , fc(1), sigmoid. Figure 15: AD implementation. It has metaparameters X, Y , where X ∈ {0.5, 0.8}, Y ∈ {1, 2}, resulting in 4 configurations in total. Depending on the value of Y , it becomes a singlelayer or a two-layer perceptron. The network is trained using Adam, lr:0.0001, 3000 epochs with early stopping, batch size 1000, using binary cross-entropy loss. Appendix E. Domain Details E.1 MNIST 8-puzzle This is an image-based version of the 8-puzzle, where tiles contain hand-written digits (0-9) from the MNIST database [LeCun et al., 1998]. Each digit is shrunk to 14x14 pixels, so each state of the puzzle is a 42x42 image. Valid moves in this domain swap the “0” tile with a neighboring tile, i.e., the “0” serves as the “blank” tile in the classic 8-puzzle. The entire state space consists of 362880 states (9!) and 967680 actions. From any specific goal state, the reachable number of states is 181440 (9!/2). Note that the same image is used for each digit in all states, e.g., the tile for the “1” digit is the same image in all states. We provide 20000 random transition images as T r. This contains 2x20000 images including the duplicates. SAE learns from these 40000 images. Next, SAE generates latent vectors of 2x20000 images, then use them as the input to AAE, AD and SD. In all cases training:validation ratio 9:1 is maintained (i.e. only 36000 images and 18000 transitions are used for training). E.2 Mandrill, Spider 8-Puzzle These are 8-puzzles generated by cutting and scrambling real photographs (similar to sliding tile puzzle toys sold in stores). We used the “Mandrill” and “Spider” images, two of the standard benchmark in the image processing literature. The image was first converted to greyscale and then histogram-normalization and contrast enhancement was applied. The same number of transitions as in the MNIST-8puzzle experiments are used. E.3 LightsOut A video game where a grid of lights is in some on/off configuration (+: On), and pressing a light toggles its state (On/Off) as well as the state of all of its neighbors. The goal is all lights Off. (cf. https://en.wikipedia.org/wiki/Lights_Out_(game)) Unlike the 8-puzzle where each move affects only two adjacent tiles, a single operator in 4x4 LightsOut can simultaneously flip 5/16 locations. Also, unlike 8-puzzle and ToH, the LightsOut game allows some “objects” (lights) to disappear. This demonstrates that LatPlan is not limited to domains with highly local effects and static objects. The image dimension is 36x36 and the size of each button (+ button) is 9x9. 4x4 LightsOut has 216 = 65536 states and 16 × 216 = 1048576 transitions. Similar to the 8-puzzle instances, we used 22 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) 20000 transitions. Training:validation ratio 9:1 is maintained (i.e. only 36000 images and 18000 transitions are used for training). E.4 Twisted LightsOut The images have the same structure as LightsOut, but we additionally applied a swirl effect available in scikit-image package. The effect is applied to the center, with strength=3, linear interpolation, and radius equal to 0.75 times the dimension of the image. The image dimension is 36x36. Before the swirl effect is applied, the size of each button (+ button) was 9x9. E.5 Towers of Hanoi Disks of various sizes must be moved from one peg to another, with the constraint that a larger disk can never be placed on top of a smaller disk. Each input image has a dimension of 16 × 60 (resp.), where each disk is presented as a 4px line segment. Due to the smaller state space (3d states for d disks: 81 states, 240 transitions for 4 disks) compared to the other domains tested in this paper, we used 90% of states as the training examples in AMA1 experiments, and verified on the 10% validation set that the network is generalizing. We also applied the state augmentation technique described in Sec. A, as the detrimental effect of excessive number of bits in the latent space becomes more obvious in this domain. Appendix F. Planner details F.1 Planner in AMA1 experiments In the AMA1 experiments (Sec. 5.1), we found that the invariant detection routines in the Fast Downward PDDL to SAS translator (translate.py) became a bottleneck. This is because the PDDL represent individual transitions as ground actions, whose number is very large. In order to run the experiments in Sec. 5.1 , we wrote a trivial, replacement PDDL to SAS converter without the invariant detection. Still, each experiment may require more than 7GB memory and 4 hours on a Xeon E6-2676 CPU. Most of the runtime was spent on the preprocessing, and the search takes only a few seconds. F.2 Planner in AMA2 experiments In the AMA2 experiments (Sec. 6.7), we implemented a trivial A* planner in python. Although this implementation could be hugely inefficient compared to the traditional native-complied solvers, the performance is not our concern. In fact, the most time-consuming step is the generation and the filtering of the successor states using AAE, AD etc., and the low-level implementation detail is not the bottleneck. The goal-count heuristics is based on the bitwise difference between the latent representation of the goal image and the current state. 23 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) Appendix G. Statement on Reproducibility To facilitate reproducibility of the experiments, the entire source code of the system and the pretrained network weights will be made public on Github (https://github.com/guicho271828/ latplan). References [Arfaee et al., 2011] Shahab Jabbari Arfaee, Sandra Zilles, and Robert C. Holte. Learning Heuristic Functions for Large State Spaces. Artificial Intelligence, 175(16-17):2075–2098, 2011. [Argall et al., 2009] Brenna Argall, Sonia Chernova, Manuela M. Veloso, and Brett Browning. A Survey of Robot Learning from Demonstration. Robotics and Autonomous Systems, 57(5):469–483, 2009. [Asai and Fukunaga, 2015] Masataro Asai and Alex Fukunaga. Solving Large-Scale Planning Problems by Decomposition and Macro Generation. In ICAPS, Jerusalem, Israel, June 2015. [Bacchus, 2000] Fahiem Bacchus. Subset of PDDL for the AIPS2000 Planning Competition. In IPC, 2000. [Bäckström and Nebel, 1995] Christer Bäckström and Bernhard Nebel. Complexity Results for SAS+ Planning. Computational Intelligence, 11(4):625–655, 1995. [Barbu et al., 2010] Andrei Barbu, Siddharth Narayanaswamy, and Jeffrey Mark Siskind. Learning PhysicallyInstantiated Game Play through Visual Observation. In ICRA, pages 1879–1886, 2010. [Bieszczad and Kuchar, 2015] Andrzej Bieszczad and Skyler Kuchar. Neurosolver Learning to Solve Towers of Hanoi Puzzles. In IJCCI, volume 3, pages 28–38. IEEE, 2015. [Bonet, 2013] Blai Bonet. An Admissible Heuristic for SAS+ Planning Obtained from the State Equation. In IJCAI, 2013. [Cresswell et al., 2013] Stephen Cresswell, Thomas Leo McCluskey, and Margaret Mary West. Acquiring planning domain models using LOCM. Knowledge Eng. Review, 28(2):195–213, 2013. [Cullen and Bryman, 1988] J Cullen and A Bryman. The knowledge acquisition bottleneck: Time for reassessment? Expert Systems, 5(3), August 1988. [Deng et al., 2009] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A LargeScale Hierarchical Image Database. In CVPR, pages 248–255. IEEE, 2009. [Deng et al., 2013] Li Deng, Geoffrey Hinton, and Brian Kingsbury. New Types of Deep Neural Network Learning for Speech Recognition and Related Applications: An Overview. In ICASSP, pages 8599–8603. IEEE, 2013. [Elkan and Noto, 2008] Charles Elkan and Keith Noto. Learning Classifiers from Only Positive and Unlabeled Data. In Proceedings of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 213–220. ACM, 2008. [Frances et al., 2017] Guillem Frances, Miquel Ramırez, Nir Lipovetzky, and Hector Geffner. Purely Declarative Action Representations are Overrated: Classical Planning with Simulators. In IJCAI, pages 4294–4301, 2017. [Graves et al., 2016] Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwińska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al. Hybrid Computing using a Neural Network with Dynamic External Memory. Nature, 538(7626):471–476, 2016. [Gumbel and Lieblein, 1954] Emil Julius Gumbel and Julius Lieblein. Statistical theory of extreme values and some practical applications: a series of lectures. 1954. 24 C LASSICAL P LANNING IN D EEP L ATENT S PACE (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) [Hart et al., 1968] Peter E. Hart, Nils J. Nilsson, and Bertram Raphael. A Formal Basis for the Heuristic Determination of Minimum Cost Paths. Systems Science and Cybernetics, IEEE Transactions on, 4(2):100–107, 1968. [Helmert and Domshlak, 2009] Malte Helmert and Carmel Domshlak. Landmarks, Critical Paths and Abstractions: What’s the Difference Anyway? In ICAPS, 2009. [Helmert et al., 2007] Malte Helmert, Patrik Haslum, and Jörg Hoffmann. Flexible Abstraction Heuristics for Optimal Sequential Planning. In ICAPS, pages 176–183, 2007. [Helmert, 2004] Malte Helmert. A Planning Heuristic Based on Causal Graph Analysis. In ICAPS, pages 161– 170, 2004. [Helmert, 2006] Malte Helmert. The Fast Downward Planning System. J. Artif. Intell. Res.(JAIR), 26:191–246, 2006. [Hinton and Salakhutdinov, 2006] Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the Dimensionality of Data with Neural Networks. Science, 313(5786):504–507, 2006. [Hoffmann and Nebel, 2001] Jörg Hoffmann and Bernhard Nebel. The FF Planning System: Fast Plan Generation through Heuristic Search. J. Artif. Intell. Res.(JAIR), 14:253–302, 2001. [Hopfield and Tank, 1985] John J Hopfield and David W Tank. ”Neural” Computation of Decisions in Optimization Problems. Biological Cybernetics, 52(3):141–152, 1985. [Jang et al., 2017] Eric Jang, Shixiang Gu, and Ben Poole. Categorical Reparameterization with Gumbel-Softmax. In ICLR, 2017. [Kaiser, 2012] Lukasz Kaiser. Learning Games from Videos Guided by Descriptive Complexity. In AAAI, 2012. [Kingma and Ba, 2014] Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. arXiv preprint arXiv:1412.6980, 2014. [Kingma and Welling, 2013] Diederik P Kingma and Max Welling. Auto-Encoding Variational Bayes. In ICLR, 2013. [Kingma et al., 2014] Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. SemiSupervised Learning with Deep Generative Models. In NIPS, pages 3581–3589, 2014. [Konidaris et al., 2014] George Konidaris, Leslie Pack Kaelbling, and Tomás Lozano-Pérez. Constructing Symbolic Representations for High-Level Planning. In AAAI, pages 1932–1938, 2014. [LeCun et al., 1998] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-Based Learning Applied to Document Recognition. Proc. of the IEEE, 86(11):2278–2324, 1998. [Lindsay et al., 2017] Alan Lindsay, Jonathon Read, Joao F Ferreira, Thomas Hayton, Julie Porteous, and Peter J Gregory. Framer: Planning Models from Natural Language Action Descriptions. In ICAPS, 2017. [Maddison et al., 2014] Chris J Maddison, Daniel Tarlow, and Tom Minka. A* sampling. In NIPS, pages 3086– 3094, 2014. [McDermott, 2000] Drew V. McDermott. The 1998 AI Planning Systems Competition. AI Magazine, 21(2):35– 55, 2000. [Mnih et al., 2015] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-Level Control through Deep Reinforcement Learning. Nature, 518(7540):529–533, 2015. [Mourão et al., 2012] Kira Mourão, Luke S. Zettlemoyer, Ronald P. A. Petrick, and Mark Steedman. Learning STRIPS Operators from Noisy and Incomplete Observations. In UAI, pages 614–623, 2012. 25 A SAI & F UKUNAGA (ACCEPTED IN AAAI-18, E XTENDED M ANUSCRIPT ) [Ren et al., 2015] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards Real-time Object Detection with Region Proposal Networks. In NIPS, pages 91–99, 2015. [Richter et al., 2008] Silvia Richter, Malte Helmert, and Matthias Westphal. Landmarks Revisited. In AAAI, 2008. [Satzger and Kramer, 2013] Benjamin Satzger and Oliver Kramer. Goal Distance Estimation for Automated Planning using Neural Networks and Support Vector Machines. Natural Computing, 12(1):87–100, 2013. [Sievers et al., 2012] Silvan Sievers, Manuela Ortlieb, and Malte Helmert. Efficient Implementation of Pattern Database Heuristics for Classical Planning. In SOCS, 2012. [Silver et al., 2016] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the Game of Go with Deep Neural Networks and Tree Search. Nature, 529(7587):484–489, 2016. [Srivastava et al., 2015] Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised Learning of Video Representations using LSTMs. In ICML, pages 843–852, 2015. [Steels, 2008] Luc Steels. The Symbol Grounding Problem has been Solved. So What’s Next? In Manuel de Vega, Arthur Glenberg, and Arthur Graesser, editors, Symbols and Embodiment. Oxford University Press, 2008. [Vincent et al., 2008] Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and Composing Robust Features with Denoising Autoencoders. In ICML, pages 1096–1103. ACM, 2008. [Yang et al., 2007] Qiang Yang, Kangheng Wu, and Yunfei Jiang. Learning Action Models from Plan Examples using Weighted MAX-SAT. Artificial Intelligence, 171(2-3):107–143, 2007. 26
2cs.AI
Applying Sorting Networks to Synthesize Optimized Sorting Libraries? Michael Codish1 , Luı́s Cruz-Filipe2 , Markus Nebel2 , and Peter Schneider-Kamp2 arXiv:1505.01962v2 [cs.DS] 16 Oct 2015 1 2 Department of Computer Science, Ben-Gurion University of the Negev, Israel Dept. Mathematics and Computer Science, Univ. of Southern Denmark,Denmark Abstract. This paper presents an application of the theory of sorting networks to facilitate the synthesis of optimized general-purpose sorting libraries. Standard sorting libraries are often based on combinations of the classic Quicksort algorithm with insertion sort applied as base case for small, fixed, numbers of inputs. Unrolling the code for the base case by ignoring loop conditions eliminates branching, resulting in code equivalent to a sorting network. This enables further program transformations based on sorting network optimizations, and eventually the synthesis of code from sorting networks. We show that, if considering the number of comparisons and swaps, the theory predicts no real advantage of this approach. However, significant speed-ups are obtained when taking advantage of instruction level parallelism and non-branching conditional assignment instructions, both of which are common in modern CPU architectures. We provide empirical evidence that using code synthesized from efficient sorting networks as the base case for Quicksort libraries results in significant real-world speed-ups. 1 Introduction General-purpose sorting algorithms are based on comparing, and possibly exchanging, pairs of inputs. If the order of these comparisons is predetermined by the number of inputs to sort and does not depend on their concrete values, then the algorithm is said to be data-oblivious. Such algorithms are well suited for e.g. parallel sorting or secure multi-party computations. Sorting functions in state-of-the-art programming language libraries (such as the GNU C Library) are typically based on a variant of Quicksort, where the base cases of the recursion apply insertion sort: once the subsequence to sort considered by Quicksort falls under a certain length M , it is sorted using insertion sort. The reasons for using such base cases is that, both theoretically and empirically, insertion sort is faster than Quicksort for sorting small numbers of elements. Typical values of M are 4 (e.g. in the GNU C library) or 8. Generalizing this construction, we can take any sorting algorithm based on the divide-and-conquer approach (e.g. Quicksort, merge sort), and use another ? Supported by the Israel Science Foundation, grant 182/13 and by the Danish Council for Independent Research, Natural Sciences. sorting method once the number of elements to sort in one partition does not exceed a pre-defined limit M . The guiding idea here is that, by supplying optimized code for sorting up to M inputs, the overall performance of the sorting algorithm can be improved. One obvious way to supply optimized code for sorting up to M inputs is to provide a unique optimized implementaton of sorting m elements, for each m ≤ M . This approach leads directly to the following problem: For a given fixed number M , how can we obtain an efficient way to sort M elements on a modern CPU? Similar questions have been asked since the 1950s, though obviously with a different notion of what constitutes a modern CPU. Sorting networks are a classical model of comparison-based sorting that provides a framework for addressing such questions. In a sorting network, n inputs are fed into n channels, connected pairwise by comparators. Each comparator compares the two inputs from its two channels, and outputs them sorted back to the same two channels. Consecutive comparators can be viewed as a “parallel layer” if no two touch the same channel. Sorting networks are data-oblivious algorithms, as the sequence of comparisons performed is independent of the actual input. For this reason, they are typically viewed as hardware-oriented algorithms, where data-obliviousness is a requirement and a fixed number of inputs is given. In this paper, we examine how the theory of sorting networks can improve the performance of general-purpose software sorting algorithms. We show that replacing the insertion sort base case of a Quicksort implementation as found in standard C libraries by optimized code synthesized from logical descriptions of sorting networks leads to significant improvements in execution times. The idea of using sorting networks to guide the synthesis of optimized code for base cases of sorting algorithms may seem rather obvious, and, indeed, has been pursued earlier. A straightforward attempt, described in [10], has not resulted in significant improvements, though. In this paper we show that this is not unexpected, providing theoretical and empirical insight into the reasons for these rather discouraging results. In a nutshell, we provide an average case analysis of the complexity w.r.t. measures such as number of comparisons and number of swaps. From the complexity point of view, code synthesized from sorting networks can be expected to perform slightly worse than unrolled insertion sort. Fortunately, for small numbers (asymptotic) complexity arguments are not always a good predictor of real-world performance. The approach taken in [7] matches the advantages of sorting networks with the vectorization instruction sets available in some modern CPU architectures. The authors obtain significant speedups by implementing parallel comparators as vector operations, but they require a complex heuristic algorithm to generate sequences of bit shuffling code that needs to be executed between comparators. Their approach is also not fully general, as they target a particular architecture. In this paper, we combine the best of both these attempts by providing a straightforward implementation of sorting networks that still takes advantage of the features of modern CPU architectures, while keeping generality. We obtain speedups comparable to [7], but our requirements to the instruction set are sat- isfied by virtually all modern CPUs, including those without vector operations. The success of our approach is based on two observations. – Sorting networks are data-oblivious and the order of comparisons is fully determined at compile time, i.e., they are free of any control-flow branching. Comparators can also be implemented without branching, and on modern CPU architectures even efficiently so. – Sorting networks are inherently parallel, i.e., comparators at the same level can be performed in parallel. Conveniently, this maps directly to implicit instruction level parallelism (ILP) common in modern CPU architectures. This feature allows parallel execution of several instructions on a single thread of a single core, as long as they are working on disjoint sets of registers. Avoiding branching and exploiting ILP are tasks also performed through program transformations by the optimization stages of modern C compilers, e.g., by unrolling loops and reordering instructions to minimize data-dependence between neighbouring instructions. They are though both restricted by the datadependencies of the algorithms being compiled and, consequently, of only limited use for data-dependent sorting algorithms, like insertion sort. Throughout this paper, for empirical evaluations we run all code on an Intel Core i7, measuring runtime in CPU cycles using the time stamp counter register using the RDTSC instruction. As a compiler for all benchmarks, we used LLVM 6.1.0 with clang-602.0.49 as frontend on Max OS X 10.10.2. We also tried GCC 4.8.2 on Ubuntu with Linux kernel 3.13.0-36, yielding comparable results. The remainder of the paper is organized as follows. Section 2 provides background information and formal definitions for both sorting algorithms and hardware features. In Section 3, we theoretically compare Quicksort and the best known sorting networks w.r.t. numbers of comparisons and swaps. We aggressively unroll insertion sort until we obtain a sorting network in Section 4, and in Section 5 we show how to implement individual comparators efficiently. We empirically evaluate our contribution as a base case of Quicksort in Section 6, before concluding and giving an outlook on future work in Section 7. 2 2.1 Background Quicksort with Insertion Sort for Base Case For decades, Quicksort has been used in practice, due to its efficiency in the average case. Since its first publication by Hoare [8], several modifications were suggested to improve it further. Examples are the clever choice of the pivot, or the use of a different sorting algorithm, e.g., insertion sort, for small subproblem sizes. Most such suggestions have in common that the empirically observed efficiency can be explained on theoretical grounds by analyzing the expected number of comparisons, swaps, and partitioning stages (see [13] for details). Figure 1 presents a comparison of the common spectrum of data-dependent sorting algorithms for small numbers of inputs, depicting the number of inputs 1600 Quicksort (C library, with compare function) selection sort (Sedgewick) Quicksort (Sedgewick) shell sort (Sedgewick) insertion sort (Sedgewick) 1400 1200 + × ∗   + + + × + 1000 + + 800 + 600 + × ∗ ∗ × + 400 + 200 + ∗ ×   2 0 + ∗ ×   + ∗ ×   ∗ ×   4 ∗  ×  6 ∗ ×     8   × ∗   10 × × ∗ ∗     × ∗   12 ∗   14 Fig. 1. Comparison of different sorting algorithms for small numbers of inputs. (x-axis) together with the number of cycles required to sort them (y-axis), averaged over 100 million random executions. The upper curve in the figure is obtained from the standard Quicksort implementation in the C library (which is at some disadvantage, as it requires a general compare function as an argument). The remaining curves are derived from applying standard sorting algorithms, as detailed by Sedgewick [14]; the code was taken directly from the book’s web page, http://algs4.cs.princeton.edu/home/. Insertion sort is the clear winner. 2.2 Sorting Networks A comparator network on n channels is a finite sequence C = c1 , . . . , ck of comparators, where each comparator c` is a pair (i` , j` ) with 1 ≤ i` < j` ≤ n. The size of C is the number k of comparators it contains. Given an input x ∈ Dn , where D is any totally ordered domain, the output of C on x is the sequence C(x) = xn , where x` is defined inductively as follows: x0 = x, and x` is obtained from x`−1 by swapping the elements in positions i` and j` , in case xi` < xj` . C is a sorting network if C(x) is sorted for all C ∈ Dn . It is well known (see e.g. [9]) that this property is independent of the concrete domain D. Comparators may act in parallel. A comparator network C has depth d if C is the concatenation of L1 , . . . , Ld , where each Li is a layer : a comparator network with the property that no two of its comparators act on a common channel. Figure 2 depicts a sorting network on 5 channels in the graphical notation we will use throughout this paper. Comparators are depicted as vertical lines, and layers are separated by a dashed line. The numbers illustrate how the input 10101 ∈ {0, 1}5 propagates through the network. This network has 6 layers and 9 comparators. There are two main notions of optimality of sorting networks in common use: size optimality, where one minimizes the number of comparators used in the network; and depth optimality, where one minimizes the number of execution steps, taking into account that some comparators can be executed in parallel. 1 0 0 0 0 0 0 0 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 Fig. 2. A sorting network on 5 channels operating on the input 10101. Given n inputs, finding the minimal size sn and depth tn of a sorting network is an extremely hard problem that has seen significant progress in recent years. The table below details the best currently known bounds. The values for n ≤ 8 are already listed in [9]; the values of t9 and t10 were proven exact by Parberry [11], those of t11 –t16 by Bundala and Závodný [1], and t17 was recently computed by Ehlers and Müller [5] using results from [3,4]. Finally, the values of s9 and s10 were first given in [2]. n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 sn 0 1 3 5 9 12 16 19 25 29 35 39 45 51 56 60 73 33 37 41 45 49 53 58 tn 0 1 3 3 5 5 6 6 7 8 7 8 9 9 9 9 10 Oblivious versions of classic sorting algorithms can also be implemented as sorting networks, as described in [9]. Figure 3 (a) shows an oblivious version of insertion-sort. The vertical dashed lines highlight the 4 iterations of “insertion” required to sort 5 elements. Figure 3 (b) shows the same network, with comparators arranged in parallel layers. Bubble-sort can also be implemented as a sorting network as illustrated in Figure 3 (c), where the vertical dashed lines illustrate the 4 iterations of the classic bubble-sort algorithm. When ordered according to layers, this network becomes identical to the one in Figure 3 (b). (a) (b) (c) Fig. 3. Sorting networks for insertion sort (a) and bubble-sort (c) on 5 inputs, dashed lines separating iterations. When parallelized, both networks become the same (b). 2.3 Modern CPU Architectures Modern CPU architectures allow multiple instructions to be performed in parallel on a single thread. This ability is called instruction-level parallelism (ILP), and is built on three modern micro-architectural techniques1 : – superscalar instruction pipelines, i.e., pipelines with the ability to hold and execute multiple instructions at the same time – dynamic out-of-order execution, i.e., dynamic reordering of instructions respecting data dependencies – redundant execution units, i.e., multiple Arithmetic Logic Units per core Together, these features allow execution of instructions in an order that minimizes data dependencies, so that multiple redundant execution units can be used at the same time. This is often termed implicit ILP, in contrast to the explicit ILP found in vector operations. Example 1. Consider the C expression (x+y)*(z+u). Assume the variables x, y, z, and u are loaded in registers eax, ebx, ecx, and edx. Then the evaluation of the above expression is compiled to three machine instructions: ADD eax,ebx; ADD ecx,edx; MUL eax,ecx, with the result in ecx. Here, the first two instructions are data-independent and can be executed in parallel, while the last one depends on the results of those, and is executed in another CPU cycle. Conditional branching instructions are the most expensive instructions on pipelined CPUs, as they require flushing and refilling the pipeline. In order to minimize their cost, modern CPU architectures employ dynamic branch prediction. By keeping the pipeline filled with the instructions of the predicted branch, the cost of branching is severely alleviated. Unfortunately, branch prediction cannot be perfect, and when the wrong branch is predicted, the pipeline needs to be flushed and refilled – an operation taking many CPU cycles. In order to avoid branching instructions for “small” decisions, e.g., deciding whether to assign a value or not, modern CPU architectures also feature conditional instructions. Depending on flags set by e.g. a comparison, either an assignment of a value of a register will be performed, or the instruction will be ignored. In both cases, the pipeline is filled with the subsequent instructions, and the cost of the operation is smaller than a possible branch prediction failure. Example 2. Consider the C statement if (x == 42) x = 23; with variable x loaded in eax. Without conditional move instructions, this is compiled to code with a conditional branching instruction, i.e. CMP eax,42; JNZ after; MOV eax, 23, where after is the address of the instruction following the MOV instruction. Alternatively, using conditional instructions, we obtain CMP eax, 42; CMOVZ eax, 23. This code not only saves one machine code instruction, but most importantly avoids the huge performance impact of a mispredicted branch. 1 For details on these features of modern microarchitectures see e.g. [6,15]. Table 1. Average number of comparisons and swaps when executing optimal sorting networks with at most M = 14 inputs. n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 comparisons 0 1 3 5 9 12 16 19 25 29 35 39 45 51 swaps 3 0.0 0.5 1.5 2.7 4.8 6.6 8.6 10.6 13.0 11.1 19.4 22.4 20.0 26.5 Quicksort with Sorting Networks for Base Case The general theme of this paper is to derive, from sorting networks, optimized code to sort small numbers of inputs, and then to apply this code as the base case in a Quicksort algorithm. In this section, we compare precise average case results for the number of comparisons and swaps performed by a classic Quicksort algorithm and by a modification that uses sorting networks on subproblems of size at most 14. We choose 14 for this analysis, as it is the largest value n for which we could conveniently measure the number of comparisons and swaps for all n! permutations. We used the best-known (w.r.t. size) sorting networks (optimal for up to 10 inputs) in order to obtain the most favorable comparison numbers for sorting networks. To this end, we assume the algorithm to act on random permutations of size n, each being the input with equal probability. Let Cn (resp. Sn ) denote the expected number of comparisons (resp. swaps) performed by classic Quicksort on (random) inputs of size n. Let furthermore Ĉn and Ŝn denote the corresponding quantities for Quicksort using sorting networks for inputs smaller than 15. It is standard to set up recurrence relations for those quantities which typically obey a pattern such as: ( P a · n + b + n1 1≤j≤n Tj−1 (a, b) + Tn−j (a, b) if n > M , Tn (a, b) = g(n) otherwise. Here, a and b have to be chosen properly to reflect the parameter’s (comparisons, swaps) behavior, M determines the maximum subproblem size for which a different algorithm (insertion sort, sorting networks) is used, and g accounts for the costs of that algorithm. In order to analyze classic Quicksort as proposed by Hoare, we have to choose a = 1, b = −1 (resp. a = 61 , b = 23 ) for comparisons (resp. swaps), together with M = 0 and g(0) = 0. For the analysis of our proposed modification using sorting networks for subproblems of small sizes, we set M = 14 together with the values for g as given in Table 1. Using standard algebraic manipulations, it is possible to solve this recurrence explicitly to obtain a formula for Tn (a, b) in terms of n, M , a and b. Defining tn = a · n + b and ∇tn = tn − tn−1 , one finds (see [12] for details) that, for n > M , Tn (a, b) = 2(n + 1) X M +2≤k≤n n+1 ∇tk + (tM +1 + TM +1 (a, b)) − tn . k+1 M +2 Computing the closed form expressions for choices of tn , we finally get Cn = 2n ln(n + 1) − 2.84557n + o(n) Ĉn = 2n ln(n + 1) − 2.44869n + o(n) ∇tk M +2≤k≤n k+1 P for the different 1 n ln(n + 1) + 0.359072n + o(n) 3 1 Ŝn = n ln(n + 1) + 0.524887n + o(n) 3 Sn = We see that, when increasing n, both parameters get worse by our modification of classic Quicksort. Even for small n and optimal size sorting networks, there is no advantage w.r.t. the numbers of comparisons or swaps. In conclusion, we cannot hope to get a faster sorting algorithm simply by switching to sorting networks for small subproblems – at least not on grounds of our theoretical investigations. And, by transitivity, replacing insertion sort by sorting networks in the base case should result in an even worse behavior w.r.t. both parameters. 4 Unrolling the Base Case In this section, we show how to unroll an implementation of insertion sort, step by step, until we finally obtain code equivalent to a sorting network. We take the basic insertion sort code from Sedgewick [14], and, for illustration, assume that the fixed number of inputs is n = 5. We experimented also with optimized variants (e.g. making use of sentinels to avoid the j>0 check), but did not find any of them to be faster for small inputs given a modern C compiler. # define SWAP (x , y ) { int tmp = a [ x ]; a [ x ] = a [ y ]; a [ y ] = tmp ;} static inline void sort5 ( int *a , int n ) { n =5 for ( int i = 1; i < n ; i ++) for ( int j = i ; j > 0 && a [ j ] < a [j -1]; j - -) SWAP (j -1 , j ) } Applying partial evaluation and (outer) loop unrolling results in: static inline void sort5_unrolled ( int * a ) for ( int j = 1; j > 0 && a [ j ] < a [j -1]; SWAP (j -1 , j ) for ( int j = 2; j > 0 && a [ j ] < a [j -1]; SWAP (j -1 , j ) for ( int j = 3; j > 0 && a [ j ] < a [j -1]; SWAP (j -1 , j ) for ( int j = 4; j > 0 && a [ j ] < a [j -1]; SWAP (j -1 , j ) } { j - -) j - -) j - -) j - -) The condition in the inner loop is data-dependent, hence no sound and complete program transformation can be applied to unroll them. To address this, we move the data-dependent part of the loop condition to the statement in the body of the loop, while always iterating the variable j down to 1. static inline void sort5_oblivious ( int * a ) { for ( int j = 1; j > 0; j - -) if ( a [ j ] < a [j -1]) SWAP (j -1 , j ) for ( int j = 2; j > 0; j - -) if ( a [ j ] < a [j -1]) SWAP (j -1 , j ) for ( int j = 3; j > 0; j - -) if ( a [ j ] < a [j -1]) SWAP (j -1 , j ) for ( int j = 4; j > 0; j - -) if ( a [ j ] < a [j -1]) SWAP (j -1 , j ) } Now we can now apply (inner) loop unrolling and obtain: static inline void if ( a [1] < a [0]) if ( a [2] < a [1]) if ( a [1] < a [0]) if ( a [3] < a [2]) if ( a [2] < a [1]) if ( a [1] < a [0]) if ( a [4] < a [3]) if ( a [3] < a [2]) if ( a [2] < a [1]) if ( a [1] < a [0]) } so rt 5 _o b li vo u s_ un r ol l ed ( int * a ) { SWAP (0 , 1) SWAP (1 , 2) SWAP (0 , 1) SWAP (2 , 3) SWAP (1 , 2) SWAP (0 , 1) SWAP (3 , 4) SWAP (2 , 3) SWAP (1 , 2) SWAP (0 , 1) All the statements in the body of sort5 oblivous unrolled are now conditional swaps. For readability, we move the condition into the macro. COMPs on the same line indicate that they originate from the same iteration of insertion sort: # define COMP (x , y ) { if ( a [ y ] < a [ x ]) SWAP (x , y ) } static inline void sort5_fig3a ( int * a ) { COMP (0 , 1) COMP (1 , 2) COMP (0 , 1) COMP (2 , 3) COMP (1 , 2) COMP (0 , 1) COMP (3 , 4) COMP (2 , 3) COMP (1 , 2) COMP (0 , 1) } This sequence is equivalent to the sorting network in Figure 3 (a). Thus, we can apply the reordering of comparators that resulted in Figure 3 (b) to obtain the following implementation, where we reduce the number of layers to 7 (here, COMPs on the same line indicate a layer in the sorting network): static inline COMP (0 , 1) COMP (1 , 2) COMP (0 , 1) COMP (1 , 2) COMP (0 , 1) COMP (1 , 2) COMP (0 , 1) } void sort5_fig3b ( int * a ) { COMP (2 , 3) COMP (3 , 4) COMP (2 , 3) 700 + × ∗   insertion sort unrolled insertion sort insertion sorting network compressed insertion sorting network optimal sorting network 600 500 ∗ ∗  + ∗ 400 300 200 100 0 ∗ × +   2 × + ∗   × + ∗   4 × + ∗   × ∗ +   6 × ∗   + + ∗  ×  8 + ∗  ×  ∗ +  ×  10 ∗ +  ×  +  ×  12  + ×   × 14 Fig. 4. Comparison of insertion sort with (unrolled) comparator based code for small numbers of inputs. Figure 4 presents a comparison of a standard insertion sort (code from [14]) with the several optimized versions, depicting the number of inputs (x-axis) together with the number of cycles required to sort them (y-axis), averaged over 100 million random executions. The curve labeled “insertion sort” portrays the same data as the corresponding curve in Figure 1. The curve labeled “unrolled insertion sort” corresponds to the unrolled version of insertion sort (in the style of function sort5 unrolled). The other three curves correspond to code derived from different types of sorting networks: the “insertion sorting network” from Figure 3 (a) and function sort5 fig3a; the “compressed insertion sorting network” from Figure 3 (b) and function sort5 fig3b; and the “optimal sorting network”, corresponding to the use of a best (smallest) known sorting network. From the figure, it is clear that standard sorting network optimizations such as reordering of independent comparators [9] give a slight performance boost. But there is another clear message: even going beyond standard program transformations by breaking data-dependence and obtaining a sequence of conditional swaps (i.e., a sorting network), we do not manage to make any significant improvements of the performance of sorting implementations for small numbers of inputs. Furthermore, even when using size-optimal sorting networks, we obtain no real benefit over compiler-optimized insertion sort. This is in line with the theoretical results on average case complexity discussed in the previous section. 5 Implementing Sorting Networks Efficiently The results in the previous two sections explained the rather discouraging results obtained by a naive attempt to use sorting networks as the base case of a divide-and-conquer sorting algorithm: they are simply not faster than e.g. insertion sort – at least when implemented naively. In this section we show how to exploit two main properties of sorting networks, together with features of mod- ern CPU architectures, and obtain speed-ups of a factor higher than 3 compared to unrolled insertion sort. We first observe that, as sorting networks are data-oblivious, the order of comparisons is fully determined at compile time, i.e., their implementation is free of any control-flow branching. Unfortunately, the naive implementation of each comparator involves branching to decide whether to perform a swap. The path taken depends entirely on the specific inputs to be sorted, and as such branch prediction necessarily does not perform very well. Luckily, we can also implement comparators without branching. To this end, we use a conditional assignment (defined by the macro COND below), which can be compiled to the conditonal move (CMOV) instruction available on modern CPU architectures. This approach proved to be very fruitful. For illustration, from the optimal-size sorting network for 5 inputs portrayed in Figure 2, we synthesize the following C function sort5 best, where each row in the code corresponds to a layer in the sorting network: # define COND (c ,x , y ) { x = ( c ) ? y : x ; } # define COMP (x , y ) { int ax = a [ x ]; COND ( a [ y ] < ax , a [ x ] , a [ y ]) ; \ COND ( a [ y ] < ax , a [ y ] , ax ) ; } static inline COMP (0 , 1) COMP (2 , 4) COMP (2 , 3) COMP (0 , 3) COMP (0 , 2) COMP (1 , 2) } void sort5_best ( int * a ) { COMP (3 , 4) COMP (1 , 4) COMP (1 , 3) The comparator macro that compares and conditionally swaps the values at indices x and y works as follows: 1. Keep a copy of the value at index x. 2. Compare (once) the value at index y with the stored value from x. 3. If the value was greater, copy the value at index y to index x. Otherwise, do nothing. 4. If the value was greater, write the old copied value from x to index y. Otherwise, do nothing. Correctness follows directly by case analysis. If the value at index y was not greater than the value at index x, the two conditional assignments do not change anything, and all we did was an unnecessary copy of the valued at index x. If the value at index y was greater than the value at index y, we essentially perform a classic swap using ax as the temporary variable. Given a sufficient optimization level (-O2 and above), the above code is compiled by the LLVM (or GNU) C compiler to use two conditional move (CMOV) instructions, resulting in a totally branching free code for sort5 best. As can be expected, the other two instructions are a move (MOV) and a compare (CMP) instruction. In other words, each comparator is implemented by exactly four non-branching machine code instructions. Alternatively, we could implement the comparator applying the folklore idea of swapping values using XORs to eliminate one conditional assignment:2 # define COND (c ,x , y ) { x = ( c ) ? y : x ; } # define COMP (x , y ) { int ax = a [ x ]; COND ( a [ y ] < ax , a [ x ] , a [ y ]) ; \ a [ y ] ^= ax ^ a [ x ]; } This alternative comparator performs a conditional swap as follows: 1. Keep a copy of the value at index x. 2. If the value at index y is greater than the value at index x, copy the value at index y to index x. 3. Bitwise XOR the value at index y with the copied old and the new value at index x. Step 3 works because, if the condition holds, then ax and the value at index x cancel out, leaving the value at y unchanged, while otherwise the value at y and ax cancel out, effectively assigning the original value from index x to index y. We also implemented this variant, and observed that it compiles down to five instructions (MOV, CMP, CMOV, and two XORs). We benchmarked the two variants and observed that they are indistinguishable in practice, with differences well within the margin of measurement error. Thus, we decided to continue with this second version, as the XOR instructions are more “basic” and can therefore be expected to behave better w.r.t. e.g. instruction level parallelism. A third approach would be to define branching-free minimum and maximum operations,3 and use them to assign the minimum to the upper channel and the maximum to the lower channel of the comparator. We tested this approach, but found that it did not compile to branching-free code. Even if it did, the number of instructions involved would be rather large, eliminating any chance of competing with the two previous variants. The reader might wonder whether a different SWAP macro could similarly speed up the working of standard insertion sort. The answer is a clear no, as the standard swapping operation is implemented by only three operations. Tricks like using XORs only increase the number of instructions to execute, while not reducing branching in the code. We implemented and benchmarked several alternative SWAP macros, finding only detrimental effects on measured performance. Figure 5 compares three sorting algorithms for small numbers of inputs: (1) the unrolled insertion sort (also plotted in Figure 4); (2) code derived from a standard insertion sorting network (also plotted in Figure 4); (3) the same insertion sorting network but with a non-branching version of the COMP macro. We compare the number of branches encountered and mispredicted (averaged 2 3 See https://graphics.stanford.edu/~{}seander/bithacks.html# SwappingValuesXOR See https://graphics.stanford.edu/~{}seander/bithacks.html# IntegerMinOrMax 140 unrolled insertion sort #branches insertion sorting network #branches non-branching insertion sorting network #branches unrolled insertion sort #mispredicts insertion sorting network #mispredicts non-branching insertion sorting network #mispredicts 120 100 + × ∗   ◦ 80 × × × × × 60 × × 40 20 × ∗ +  ◦  × ∗ + ◦   2 0 × + ∗   ◦ 4 × + ∗   ◦ × + ∗   ◦ + + + + × + + ∗   ◦ ∗ ∗ ∗   ◦ 8   ◦   ◦ 10 6 + + ∗   ◦ ∗   ◦ 12 ∗  ∗    ◦ ◦ 14 Fig. 5. Comparing the number of branches, encountered and mispredicted, in optimized sorting algorithms for small numbers of inputs. over 100 million random executions). From the figure it is clear that the number of branches encountered (and mispredicted) is larger for both unrolled insertion sort and a naive implementation of sorting networks. In contrast, the branchingfree implementation exhibits a nearly constant level of branches encountered and mispredicted. These branches actually originate from the surrounding test code (filling an array with random numbers, computing random numbers, and checking that the result is actually sorted). Our second observation is that sorting networks are inherently parallel, i.e., comparators at the same level can be performed simultaneously. This parallelism can be mapped directly to instruction level parallelism (ILP). The ability to make use of ILP has further performance potential. In order to demonstrate this potential, we constructed artificial test cases with varying levels of data dependency. Given a natural number m, we construct a comparator network of size 1000 consisting of subsequences of m parallel comparators. We would expect that, as m grows, we would see more use of ILP. 5000 4500 + 4000 3500 3000 + 2500 2000 + + + + + + 3 4 5 6 7 8 1500 1000 0 1 2 9 Fig. 6. ILP on comparator networks of length 1000 with differing levels of parallelism. 700 600 500 unrolled insertion sort insertion sorting network compressed insertion sorting network optimal sorting network non-branching insertion sorting network non-branching compressed insertion sorting network non-branching optimal sorting network + × ∗   ◦ • × × 400 × 300 200 100 0 × + ∗ ◦ •   2 + × ∗  • ◦  + × ∗  ◦ •  4 + × ∗  ◦  • + × ∗  ◦  • 6 + × ∗   ◦ • × ∗ +   ◦ • 8 ∗ × +   ◦ • ∗ × × ∗ +   ◦ • 10 ∗ +   ◦ • ∗ ∗ +   ◦ • 12 +  +    ◦ ◦ • • 14 Fig. 7. Comparison of sorting networks for small numbers of inputs: non-branching sorting networks are fastest. In Figure 6, the values for m are represented on the x-axis, while the y-axis (as usual) indicates the averaged number of CPU cycles. Indeed, we see significant performance gains when going from m = 1 to m = 2 and m = 3. From this value onwards, performance stays unchanged. This is the result of each comparator being compiled to 5 assembler instructions when using optimization level -O3. Then we obtain slightly under 2 CPU cycles per comparator. Combining the gains from ILP with the absence of branching, we obtain large speed-ups for small inputs when comparing to both insertion sort and naive implementations of sorting networks. In Figure 7, we show the magnitude of the improvements obtained. Once again we plot the number of inputs on the x-axis against the number of cycles required to sort then on the y-axis, averaged over 100 million random executions. We consider the unrolled insertion sort, the three sorting networks from Figure 4 (insertion sorting network, compressed insertion sorting network, and optimal sorting network), and these same three sorting networks using non-branching comparators (non-branching insertion sorting network, non-branching compressed insertion sorting network, and non-branching optimal sorting network). The figure shows that using the best known (optimal) sorting networks in their non-branching forms results in a speed-up by a factor of more than 3. 6 Quicksort with Sorting Network Base Case We now demonstrate that optimizing the code in the base case of a Quicksort algorithm translates to real-world savings when applying the sorting function. To this end, we use as base cases (1) the (empirically) best variant of insertion sort unrolled by applying program transformations to the algorithm from [14], and (2) the fastest non-branching code derived from optimal (size) sorting networks. 170,000 + × unrolled insertion sort non-branching optimal sorting network 160,000 150,000 + × + + × + × 140,000 + + + × × 130,000 + + + × × + × + + × × × × 120,000 × 110,000 2 4 6 8 10 12 14 Fig. 8. Quicksort: comparing insertion sort at the base case with non-branching optimal sorting networks at the base case. Plotting base case size (x axis) and number of cycles (averaged over one million random runs). In Figure 8 we depict the results of sorting lists of 10,000 elements. The y-axis measures the number of cycles (averaged over one million random runs), and the x-axis specifies the limit at which Quicksort reverts to a base case. For example, the value 8 indicates that the algorithm uses a base case whenever it is required to sort a sequence of length at most 8 elements. The value 2 corresponds to the case where the base case has no impact. To quantify the impact of the choice of base case, we compare to the case for value 2 (on the x-axis). For insertion sort we see a 2–12% reduction in runtime depending on the limit, and for non-branching sorting networks we achieve instead 7–23% reduction in runtime. 7 Conclusion In this paper, we showed, both theoretically and empirically, that using code derived naively from sorting networks is not advantageous to sort small numbers of inputs, compared to the use of standard data-dependent sorting algorithms like insertion sort. Furthermore, we showed that program transformations are of only limited utility for improving insertion sort on small numbers of inputs. By contrast, we showed how to synthesize simple yet efficient implementations of sorting networks, and gave insight into the microarchitectural features that enable this implementation. We demonstrated that we do obtain significant speed-ups compared to naive implementations such as [10]. A further empirical comparison between our implementation and the one described in [7] (not detailed in this paper) shows similar performance and scaling behavior. However, our approach allows the exploitation of instruction-level parallelism without the need for a complex instruction set-specific algorithm, as required by [7]. We also provided further evidence that efficient sorting networks are useful as a base case in divide-and-conquer sorting algorithms such as, e.g., Quicksort. Our results also show that using different sorting networks has measurable impact on the efficiency of the synthesized C code. While previous research on finding optimal sorting networks has focused on optimal depth or optimal size, in the future we plan to identify criteria that will lead to optimal performance in this context. What are the parameters that determine real-world efficiency of the synthesized code, and how can we find sorting networks that optimize these parameters? We also plan to explore other target architectures, such as GPUs, and to benchmark our approach as base case for other sorting algorithms, such as merge sort. References 1. D. Bundala and J. Závodný. Optimal sorting networks. In A.-H. Dediu, C. Martı́nVide, J.L. Sierra-Rodrı́guez, and B. Truthe, editors, LATA 2014, volume 8370 of LNCS, pages 236–247. Springer, 2014. 2. M. Codish, L. Cruz-Filipe, M. Frank, and P. Schneider-Kamp. Twenty-five comparators is optimal when sorting nine inputs (and twenty-nine for ten). In ICTAI 2014, pages 186–193. IEEE, December 2014. 3. M. Codish, L. Cruz-Filipe, and P. Schneider-Kamp. The quest for optimal sorting networks: Efficient generation of two-layer prefixes. In F. Winkler, V. Negru, T. Ida, T. Jebelan, D. Petcu, S.M. Watt, and D. Zaharie, editors, SYNASC 2014, pages 359–366. IEEE, 2015. 4. M. Codish, L. Cruz-Filipe, and P. Schneider-Kamp. Sorting networks: the end game. In A.-H. Dediu, E. Formenti, C. Martı́n-Vide, and B. Truthe, editors, LATA 2015, volume 8977 of LNCS, pages 664–675. Springer, 2015. 5. T. Ehlers and M. Müller. New bounds on optimal sorting networks. In A. Beckmann, V. Mitrana, and M.I. Soskova, editors, CiE 2015, volume 9136 of LNCS, pages 167–176. Springer, 2015. 6. J.A. Fisher, P. Faraboschi, and C. Young. Embedded Computing: A VLIW Approach to Architecture, Compilers, and Tools. Morgan Kaufman, 2005. 7. T. Furtak, J.N. Amaral, and R. Niewiadomski. Using SIMD registers and instructions to enable instruction-level parallelism in sorting algorithms. In SPAA ’07, pages 348–357. ACM, 2007. 8. C.A.R. Hoare. Quicksort. Comput. J., 5(1):10–15, 1962. 9. D.E. Knuth. The Art of Computer Programming, Volume III: Sorting and Searching. Addison-Wesley, 1973. 10. B. Lopez and N. Cruz-Cortes. On the usage of sorting networks to big data. In H.R. Arabnia, M.Q. Yang, G. Jandieri, J.J. Park, A.M.G. Solo, and F.G. Tinetti, editors, Advances in Big Data Analytics: The 2014 WorldComp International Conference Proceedings. Mercury Learning and Information, 2014. 11. I. Parberry. A computer-assisted optimal depth lower bound for nine-input sorting networks. Mathematical Systems Theory, 24(2):101–116, 1991. 12. R. Sedgewick. The analysis of quicksort programs. Acta Inf., 7:327–355, 1977. 13. R. Sedgewick and P. Flajolet. An introduction to the analysis of algorithms. Addison-Wesley-Longman, 1996. 14. R. Sedgewick and K. Wayne. Algorithms. Addison-Wesley, 2011. 4th Edition. 15. J. Silc, B. Robic, and T. Ungerer. Processor Architecture: From Dataflow to Superscalar and Beyond. Springer, 1999.
8cs.DS
Stability and Convergence Trade-off of Iterative Optimization Algorithms Yuansi Chen [email protected] arXiv:1804.01619v1 [stat.ML] 4 Apr 2018 Department of Statistics University of California Berkeley, CA 94720-1776, USA Chi Jin [email protected] Department of Electrical Engineering and Computer Sciences University of California Berkeley, CA 94720-1776, USA Bin Yu [email protected] Department of Statistics & Department of Electrical Engineering and Computer Sciences University of California Berkeley, CA 94720-1776, USA Abstract The overall performance or expected excess risk of an iterative machine learning algorithm can be decomposed into training error and generalization error. While the former is controlled by its convergence analysis, the latter can be tightly handled by algorithmic stability (Bousquet and Elisseeff, 2002). The machine learning community has a rich history investigating convergence and stability separately. However, the question about the trade-off between these two quantities remains open. In this paper, we show that for any iterative algorithm at any iteration, the overall performance is lower bounded by the minimax statistical error over an appropriately chosen loss function class. This implies an important trade-off between convergence and stability of the algorithm – a faster converging algorithm has to be less stable, and vice versa. As a direct consequence of this fundamental tradeoff, new convergence lower bounds can be derived for classes of algorithms constrained with different stability bounds. In particular, when the loss function is convex (or strongly convex) and smooth, we discuss the stability upper bounds of gradient descent (GD) and stochastic gradient descent and their variants with decreasing step sizes. For Nesterov’s accelerated gradient descent (NAG) and heavy ball method (HB), we provide stability upper bounds for the quadratic loss function. Applying existing stability upper bounds for the gradient methods in our trade-off framework, we obtain lower bounds matching the well-established convergence upper bounds up to constants for these algorithms and conjecture similar lower bounds for NAG and HB. Finally, we numerically demonstrate the tightness of our stability bounds in terms of exponents in the rate and also illustrate via a simulated logistic regression problem that our stability bounds reflect the generalization errors better than the simple uniform convergence bounds for GD and NAG. Keywords: Algorithmic stability, generalization, optimization, lower bound Yuansi Chen, Chi Jin and Bin Yu 1. Introduction For different supervised learning algorithms ranging from classical linear regression, logistic regression, boosting, to modern large-scale deep networks, the overall performance or expected excess risk can always be decomposed into two parts: the empirical error (or the training error) and the generalization error (characterizing the discrepancy between the test error and the training error). A central theme in machine learning is to find an appropriate balance between empirical error and generalization error, because improperly emphasizing one over the other typically results in either overfitting or underfitting. Specifically, in the context of supervised learning models trained by iterative optimization algorithms, the empirical error at each iteration is commonly controlled by convergence rate analysis, and the generalization error can be handled by algorithmic stability analysis (Devroye and Wagner, 1979; Bousquet and Elisseeff, 2002). Convergence rate of an algorithm portrays how fast the optimization error decreases as the number of iterations grows. Recent years have witnessed a rapid advance on convergence rates analysis of specific optimization methods for a particular class of loss functions that they are optimizing over. In fact, such analysis has been carried out for many gradient methods, including gradient descent (GD), Nesterov accelerated gradient descent (NAG), stochastic gradient descent (SGD), stochastic gradient Langevin dynamics (SGLD) for convex, strongly convex, or even nonconvex functions (see e.g. Boyd and Vandenberghe (2004); Bubeck et al. (2015); Nesterov (2013); Jin et al. (2017); Raginsky et al. (2017)). However, until the optimization error and generalization error of these algorithms are analyzed together, it is not clear whether the fastest converging optimization algorithm is the best for learning. On the other hand, algorithmic stability (Devroye and Wagner, 1979; Bousquet and Elisseeff, 2002) in learning problems has been introduced as an alternative way to control generalization error instead of uniform convergence results such as classical VC-theory (Vapnik et al., 1994) and Rademacher complexity (Bartlett and Mendelson, 2003). The stability concept has an intuitive appeal: an algorithm is stable if it is robust to small perturbations in the composition of the learning data set. Recently it has been shown that algorithmic stability is well suited for controlling generalization error of stochastic gradient methods (Hardt et al., 2016), as well as stochastic gradient Langevin dynamics algorithm (Mou et al., 2017). While most previous papers study convergence rate and the algorithmic stability of an optimization algorithm separately, a natural question arises: What is the relationship or trade-off between the convergence rate and the algorithmic stability of an iterative algorithm? Is it possible to design an algorithm that converges the fastest and at the same time most stable? If not, is there any fundamental limit on the trade-off between the two quantities so that a fast algorithm has to be unstable? This paper shows that there is a fundamental limit on the trade-off. That is, for any iterative algorithms, at any time step, the sum of optimization error and stability is lower bounded by the minimax statistical error over a given loss function class. Therefore, a fast converging algorithm can not be too stable, and a stable algorithm can not converge too fast. This framework therefore provides a new criterion for comparing optimization algorithms by considering jointly convergence rate and algorithm stability. As a consequence, our 2 Stability and Convergence Trade-off of Iterative Optimization Algorithms framework can be immediately applied to provide a new class of convergence lower bounds for algorithms with different stability rates. In particular, we focus on two settings where the loss functions are either convex smooth or strongly convex smooth. In the first setting, we discuss the stability upper bounds of gradient descent (GD), stochastic gradient descent (SGD) and their variants with decreasing step sizes. New stability upper bounds are provided for Nesterov’s accelerated gradient descent (NAG) and the heavy ball method (HB) under quadratic loss, and we conjecture these upper bounds still hold for the general convex smooth losses. Applying the stability upper bounds for GD and SGD in our trade-off framework, we obtain the convergence lower bounds for them that match the known convergence upper bounds up to constants. Considering jointly convergence rate and algorithm stability for NAG and GD, the trade-off shows that NAG must be less stable than GD even though it converges faster than GD. In the second setting where the loss functions are strongly convex and smooth, we also provide stability upper bound and deduce the convergence lower bound results for GD and NAG via our trade-off framework. Finally, simulations are conducted to show that the stability bounds established have the correct rates as a function of n and iteration T . These bounds are demonstrated to be particularly useful in large scale learning settings for understanding the overall performance of an algorithm than the classical uniform convergence bounds because the stability bounds capture better generalization errors at early iterations of these algorithms. 1.1 Related work Algorithmic stability The first quantitative results that focus on generalization error via algorithmic stability date back to (Rogers and Wagner, 1978; Devroye and Wagner, 1979). This line of research was further developed by Bousquet and Elisseeff (2002) to provide guarantees for general supervised learning algorithms and insights for the practice of regularized algorithms. It remains unclear, however, what is the algorithmic stability of general iterative optimization algorithms. Recently, to show the effectiveness of commonly used optimization algorithms in many large-scale learning problems, algorithmic stability has been established for stochastic gradient methods (Hardt et al., 2016), stochastic gradient Langevin dynamics (Mou et al., 2017), as well as for any algorithm in situations where global minima are approximately achieved (Charles and Papailiopoulos, 2017). Lower bounds on convergence rate Given the importance of efficient optimization methods, many papers have been devoted to understanding the fundamental computational limits of convex optimization. Those lower bounds typically focus on a specific class of algorithms. A classical line of research has been focused on first-order algorithms where only first-order information (i.e. gradients) can be queried through oracle model; see the book (Boyd and Vandenberghe, 2004), the monograph (Bubeck et al., 2015) and references therein for further details. For convex functions, the first lower bound argument given in (Nemirovsky et al., 1982) applies to first-order algorithms whose current iterate lies in the linear span of previous gradients. It has been later extended to any deterministic, then stochastic first-order algorithm (Agarwal and Bottou, 2015; Woodworth and Srebro, 2016). 3 Yuansi Chen, Chi Jin and Bin Yu 1.2 Organization of the paper The rest of the paper is organized as follows: In Section 2, we set up the necessary backgrounds on the classical excess risk decomposition and introduce the optimization error (or computational bias) and generalization error trade-off. In Section 3, we provide the main theorem on the trade-off between convergence rate (as an upper bound on optimization error) and algorithmic stability (as an upper bound on generalization error). In Section 4, we establish uniform stability bounds for several gradient methods and show that our main theorem applies to these algorithms to obtain their convergence lower bounds. In Section 5, we first provide simulation results validating the correct rates as a function of sample size n and iteration number T of the stability bounds we established, and then illustrate via a simulated logistic regression problem that our stability bounds reflect the generalization errors better than the simple uniform convergence bounds for GD and NAG. 2. Preliminaries In this section, we set up the necessary backgrounds on excess risk decomposition and convex optimization. Using classical excess risk decomposition, we introduce the expected optimization error and generalization error trade-off which are crucial to state our main result in the next section. 2.1 Excess risk decomposition Throughout this paper, we consider the standard setting of supervised learning. Suppose that we are given n samples S = (z1 , ..., zn ), each lying in some space Z and drawn i.i.d. according to a distribution P ∈ P. The standard decision-theoretic approach is to estimate a parameter θ ∈ Rd by minimizing a loss function of the form l(θ; z), which measures the fit between the model indexed by the parameter θ ∈ Ω ⊂ Rd and the sample z ∈ Z. Given the collection S of n samples and a loss function l, the principle of empirical risk minimization is based on the objective function n RS (θ) ≡ 1X l (θ; zi ) . n i=1 This empirical risk above serves as a sample-average proxy for the population risk R(θ) ≡ Ez∼P [l (θ; z)] . We denote by θ̂ an estimator computed from sample S. The statistical question is how to bound the excess risk, measured in terms of the difference between the population risk and the minimal risk over the entire parameter space Ω, δR(θ̂) ≡ R(θ̂) − inf R(θ). θ∈Ω In most of our analysis, θ̂ is the output of an optimization algorithm at a particular iteration T based on sample S. We further denote θ̃ an empirical risk minimizer. Note that θ̂ and θ̃ are in general not the same estimator. 4 Stability and Convergence Trade-off of Iterative Optimization Algorithms For simplicity, we assume that there exists some θ0 ∈ Ω such that R(θ0 ) = inf θ∈Ω R(θ).1 Controlling the excess risk of the estimator θ̂ is usually done by decomposing it into three terms as follows: δR(θ̂) = R(θ̂) − RS (θ̂) + RS (θ̂) − RS (θ0 ) + RS (θ0 ) − R(θ0 ) . | {z } | {z } | {z } T1 T2 Term T1 is the generalization error of the model θ̂. Term T2 between the model θ̂ and the population risk minimizer θ0 . error of θ0 . Taking expectation on the previous decomposition and obtain first a decomposition of the expected excess risk and T3 is the empirical risk difference Term T3 is the generalization noticing that ES [T3 ] = 0, we then an upper bound: ES [δR(θ̂)] = ES [R(θ̂) − RS (θ̂)] + ES [RS (θ̂) − RS (θ0 )] + 0 = ES [R(θ̂) − RS (θ̂)] + ES [RS (θ̂) − RS (θ̃)] + ES [RS (θ̃) − RS (θ0 )] | {z } | {z } | {z } Egen Eopt ≤0 ≤ ES [R(θ̂) − RS (θ̂)] + ES [RS (θ̂) − RS (θ̃)] . | {z } | {z } Egen Eopt The last inequality follows from the fact that θ̃ is the empirical risk minimizer. Hence, the expected excess risk is upper bounded by the sum of expected generalization error and the expected optimization error or computational bias ES [RS (θ̂) − RS (θ̃)]. We formally define these two quantities indexed by the estimator θ̂, loss function l, data distribution P and sample size n to be h i Egen (θ̂, l, P, n) ≡ ES∼P n R(θ̂) − RS (θ̂) , and h i Eopt (θ̂, l, P, n) ≡ ES∼P n RS (θ̂) − RS (θ̃) . Making the optimization error appear in the decomposition is useful for analyzing optimization algorithms in an iterative manner. As noted in Bousquet and Bottou (2008), introducing optimization error allows to analyze algorithms doing approximate optimization. However, our framework is different to that introduced by Bousquet and Bottou (2008). We control the generalization error via iteration-dependent algorithmic stability instead of directly invoking uniform convergence results. As we are going to show, for most iterative optimization algorithms, upper bounding the generalization error by a simple uniform convergence is often loose and algorithmic stability can serve as a tighter bound. 2.2 Algorithmic Stability Many forms of algorithmic stability have been introduced to characterize generalization error (Bousquet and Elisseeff, 2002; Kutin and Niyogi, 2002). For the purpose of this paper, we are only interested in the uniform stability notion introduced by Bousquet and Elisseeff (2002). 1. If the infimum is not achieved within Ω (for example Ω is an open set), we can choose some θ0 where this equality holds up to some arbitrarily small error. 5 Yuansi Chen, Chi Jin and Bin Yu Definition 1 An algorithm, which outputs a model θ̂S for sample S, is -uniform stable if for all k ∈ {1, ..., n}, for all data sample pair S = (z1 , ..., zk , ..., zn ) and S 0 = (z1 , ..., zk0 , ..., zn ), each zi or zk0 is i.i.d sampled from P , we have sup l(θ̂S ; z) − l(θ̂S 0 ; z) ≤ . (1) z∈Z As we did for the generalization error, we use Estab (θ̂, l, P, n) to denote the uniform stability of an algorithm θ̂. A stable algorithm has the property that removing one element in its learning data set does not change much of its outcome. Such a data perturbation scheme is closely related to Jackknife in statistics (Efron, 1982). One can further show that uniform stability implies expected generalization (Bousquet and Elisseeff, 2002) . For completeness, we reformulate this property in the following lemma. Lemma 2 An algorithm, which outputs a model θ̂S for sample S, is -uniformly stable, then its expected generalization error is bounded as follows, h i ES R(θ̂S ) − RS (θ̂S ) ≤ . Lemma 2 implies that Egen (θ̂, l, P, n) ≤ Estab (θ̂, l, P, n). The proof provided by Bousquet and Elisseeff (2002) relies on a symmetrization argument and makes use of the i.i.d assumptions of samples in S. Combining the expected excess risk decomposition in previous section, we conclude that the sum of uniform stability and expected optimization error (or computational bias) constitutes an upper bound for the expected excess risk, ES∼P n [δR(θ̂S )] ≤ Estab (θ̂, l, P, n) + Eopt (θ̂, l, P, n). (2) Note that the result is stated for a fixed loss function l and a fixed data distribution P . Equation (2) is a key inequality for our analysis. Not only it provides a way to upper bound the expected excess risk without uniform convergence results, but also it makes the connection between the statistical excess risk and the optimization convergence rate (or computational bias). This can also be seen as reminiscent of the bias-variance trade-off of an algorithm in a computational sense since stability serves as a computational variability term and optimization error as a computational bias term. 2.3 Convex optimization settings Throughout the paper, we focus on two types of loss functions: The first type of loss function l(·, z) is α-strongly convex and β-smooth for every z; The second type of loss function l(·, z) is convex and β-smooth for every z. We also make use of the L-Lipschitz condition. We provide their definitions here. More technical details about convex optimization and relevant results are deferred to Appendix B. Definition 3 A function f is L-Lipschitz if for all u, v ∈ Ω, we have |f (u) − f (v)| ≤ L ku − vk2 . 6 Stability and Convergence Trade-off of Iterative Optimization Algorithms Definition 4 A function continuously differentiable f is β-smooth if for all u, v ∈ Ω, we have k∇f (u) − ∇f (v)k2 ≤ β ku − vk2 . Definition 5 A function f is convex if for all u, v ∈ Ω, we have f (u) ≥ f (v) + h∇f (v), u − vi . Definition 6 A function f is α-strongly convex if for all u, v ∈ Ω, we have f (u) ≥ f (v) + h∇f (v), u − vi + α ku − vk22 . 2 3. Trade-off between stability and convergence rate In this section, we introduce the trade-off between stability and convergence rate via excess risk decomposition under two settings of loss functions mentioned in the previous section: the convex smooth setting and the strongly convex smooth setting. We show that for any iterative algorithm, at any time step, the sum of optimization error and stability is lower bounded by the minimax statistical error over a given loss function class. Thus algorithms sharing the same stability upper bound can be grouped to obtain convergence rate lower bounds. This provides a new class of convergence lower bounds for algorithms with different stability bounds. We are interested in distribution independent stability and convergence where we take supremum of these two quantities over distributions and losses. For a fixed iteration algorithm that outputs θ̂ at iteration T , we define its uniform stability and optimization error as follows, θ̂ Estab (T, n, L) ≡ l∈L,P ∈P θ̂ Eopt (T, n, L) ≡ l∈L,P ∈P sup sup Estab (θ̂T , l, P, n), Eopt (θ̂T , P, n). Note that in this paper, the supremum is taken over the class of all loss functions L under either of the two settings considered (convex smooth and strongly convex smooth settings). 3.1 Trade-off in the convex smooth setting Before we state the main theorem, we first define the loss function class of interest in this section. We define the class of all convex smooth loss functions as follows, Lc = {l : Z × Ω → R|l is convex, β-smooth, |Ω| = R} . In the convex smooth setting, we have the following lower bound on the sum of stability and convergence rate. Theorem 7 Suppose an iterative algorithm outputs θ̂T at iteration T on an empirical loss built upon a loss l ∈ Lc and an i.i.d. sample S of size n, and it has uniform stability 7 Yuansi Chen, Chi Jin and Bin Yu Estab (T, n, Lc ) and optimization error Eopt (T, n, Lc ), then there exists a universal constant C1 > 0 such that, θ̂ θ̂ Estab (T, n, Lc ) + Eopt (T, n, Lc ) ≥ inf sup ES∼P n [δR(θ̃)] ≥ θ̃ P ∈P R2 β √ C1 n The first inequality of Theorem 7 is a simple outcome of the empirical risk decomposition in Equation (2). This first inequality is not tied to the convex smooth setting and can generalize to a wide class of optimization algorithms. The second inequality is based on an adaptation of the classical Le Cam (1986)’s method for minimax estimation lower bound to θ̂ (T, n, L ) precisely, we can the convex smooth loss function class. Further, if we know Estab c obtain an immediate corollary that provide convergence lower bound for stable optimization algorithms. Corollary 8 Under conditions in Theorem 7, if an algorithms has uniform stability θ̂ (T, n, Lc ) ≤ Estab s(T ) , n with s a divergent function of T , i.e. s(T ) → ∞, as T → ∞, then there exists a universal constant C2 > 0, a sample size n0 and an iteration number T0 ≥ 1, such that for T ≥ T0 , its convergence rate is lower bounded as follows, θ̂ Eopt (T, n0 , Lc ) ≥ R4 β 2 . C2 s(T ) Even though Theorem 7 is valid for any pair of (T, n), Corollary 8 requires to choose a specific sample size n0 in construction. However, under the assumption that the optimization θ̂ (T, n, L ) is not a algorithm has convergence rate independent of the sample size (i.e. Eopt c function of n), we can obtain via Corollary 8 a convergence lower bound that is comparable to the lower bounds in the convex optimization literature. We remark that this assumption is satisfied for commonly-used optimization algorithms such as GD and NAG. Theorem 7 and Corollary 8 provide the trade-off between stability and optimization convergence rate. All iterative optimization methods that are algorithmic uniform stable can not converge too fast. This motivates the idea of grouping optimization methods with their algorithmic stability. Optimization methods that share the same algorithmic stability would have the same optimization lower bound. The proof of Theorem 7 is provided in Appendix A.1 and that of Corollary 8 in Appendix A.2. 3.2 Trade-off in the strongly convex smooth setting Similar to the convex smooth setting, we define the class of all strongly convex smooth loss functions as follows, Lsc = {l : Z × Ω → R|l is α-strongly convex, β-smooth, |Ω| = R} . In the strongly convex smooth setting, we have the following lower bound on the sum of stability and convergence rate. 8 Stability and Convergence Trade-off of Iterative Optimization Algorithms Theorem 9 Suppose an iterative algorithm outputs θ̂T at iteration T on an empirical loss built upon a loss l ∈ Lsc and an i.i.d. sample S of size n, and it has uniformly stabilθ̂ (T, n, L ) and has optimization error E θ̂ (T, n, L ), then there exists a universal ity Estab sc sc opt constant C3 such that θ̂ θ̂ Estab (T, n, Lsc ) + Eopt (T, n, Lsc ) ≥ inf sup ES∼P n [δR(θ̃)] ≥ θ̃ P ∈P R2 β . C3 n The trade-off in the strongly convex smooth setting is similar to that of convex smooth setting, except that the minimax estimation rate is of order O( n1 ) instead of O( √1n ). Theorem 9 provides the trade-off between stability and optimization convergence rate in the strongly convex setting. Note that a similar corollary like Corollary 8. The proof of Theorem 9 is provided in Appendix A.3. 4. Stability of first order optimization algorithms and implications for convergence lower bounds This section is devoted to establishing stability bounds of popular first order optimization algorithms and showing that our main theorem can be applied to these algorithms to obtain their convergence lower bounds. In particular, Subsection 4.1 establishes uniform stability for first order iterative methods in the convex smooth setting and Subsection 4.2 discusses the consequence after applying Theorem 7 to various optimization algorithms. Subsection 4.3 provides uniform stability for first order iterative algorithms in the strongly convex smooth setting and Subsection 4.4 discusses the consequence after applying Theorem 9 to GD and NAG. The goal of proving uniform stability for iteration T is to bound the difference l(θ̂S,T ; z) − l(θ̂S 0 ,T ; z) for the sample S = (z1 , . . . , zk , . . . , zn ) and the perturbed one S 0 = (z1 , . . . , zk0 , . . . , zn ), uniformly for every z ∈ Z. z1 , . . . , zk , . . . , zn and zk0 are drawn i.i.d from a distribution P . Here θ̂S,T denotes the output model of our optimization algorithm at iteration T based on sample S. The optimization algorithm is applied on a pair of data samples S, S 0 to get two sequences of successive models θ̂S,0 , θ̂S,0 , . . . , θ̂S,T and θ̂S 0 ,0 , θ̂S 0 ,1 , . . . , θ̂S 0 ,T . For simplicity, we use θ̂t to denote θ̂S,t and θ̂t0 for θ̂S 0 ,t . We first bound the model estimate difference θ̂t − θ̂t0 then use the L-Lipschitz condition of l to prove stability. Recall that the empirical loss function for data sample S = (z1 , . . . , zn ) is RS (θ) ≡ n n j=1 j=1 2 , 1X 1X l(θ; zj ) = fj (θ). n n where we have replaced l(θ; zj ) with fj (θ) to improve readability. On the other hand, the empirical loss function for the perturbed sample S 0 = (z1 , . . . , zk0 , . . . , zn ) is     n n X X 1 1 1 1 RS 0 (θ) =  l(θ; zj ) + l(θ; zk0 ) =  fi (θ) + fk0 (θ). n n n n i=1,i6=k i=1,i6=k 9 Yuansi Chen, Chi Jin and Bin Yu Remark that the two empirical loss functions only differ on one term that is proportional to the inverse of sample size n. 4.1 Stability in the convex smooth setting We establish uniform stability for gradient descent, stochastic gradient descent, Nesterov accelerated gradient method and heavy ball method with fixed momentum parameter when the loss function is convex smooth. 4.1.1 Gradient descent (GD) The gradient descent algorithm is an iterative method for optimization, which uses the full gradient at each iteration (See book by Boyd and Vandenberghe (2004)). Given a convex smooth objective F , GD starts at some initial point θ0 ∈ Ω, and iterates with the following recursion θt+1 = θt − η∇F (θt ), t = 1, 2, · · · , where η is the step-size. Typically, one would choose fixed η ≤ β1 to ensure convergence (Boyd and Vandenberghe, 2004). In the empirical risk minimization setting, the objective F of the optimization is either RS or RS 0 . Theorem 10 Given a data distribution P , under the assumption that l(·, z) is a convex, L-Lipschitz and β-smooth function for every z ∈ Z, the gradient method with constant stepsize η ≤ β1 on the empirical risk RS with sample size n, which outputs θ̂T at iteration T , has the following uniform stability bound for all T ≥ 1, GD Estab (θ̂T , l, P, n) ≤ 2ηL2 T . n (3) We remark that this stability bound does not depend on the exact form of the loss function l and the exact form of the data distribution P . The proof of this theorem is provided in Appendix B.1. The key step of our proof is that in such a set-up, the error caused by the difference in empirical loss functions accumulates linearly as the iteration increases. We also show in Appendix B.1 that this stability upper bound can be achieved by a linear loss function. 4.1.2 Nesterov accelerated gradient methods (NAG) The Nesterov’s accelerated gradient method attains the optimal convergence rate O(1/T 2 ) in the smooth non-strongly convex setting under the deterministic first order oracle (Nesterov, 1983). Given a convex smooth objective F , starting at some initial point θ0 = w0 ∈ Ω, NAG uses the following updates, θt+1 = wt − η∇F (wt ) , wt+1 = (1 − γt ) θt+1 + γt θt , 10 Stability and Convergence Trade-off of Iterative Optimization Algorithms where η ≤ 1 β is the step-size. The parameter γt is defined by the following recursion q 1 + 1 + 4λ2t−1 1 − λt , λ0 = 0, λt = , and γt = 2 λt+1 satisfying −1 < γt ≤ 0. We only provide a uniform stability bound for NAG when the empirical risk function is quadratic. We conjecture that the same stability bound holds for general convex smooth functions. Theorem 11 Given a data distribution P , under the assumption that l(·, z) is a L-Lipschitz, β-smooth convex quadratic loss function defined on a bounded domain for every z ∈ Z, Nesterov accelerated gradient method with fixed step-size η ≤ β1 , which outputs θ̂T at iteration T , has the following uniform stability bound for all T ≥ 1, NAG (θ̂T , l, P, n) ≤ Estab 4ηL2 T 2 . n (4) The proof of the theorem is provided in Appendix B.2. We also show in Appendix that this stability upper bound is achieved by a linear loss function. Note that unlike the full gradient method and stochastic gradient descent, the stability bound of Nesterov accelerate gradient method depends quadratically on the iteration T . Even though NAG can still have small stability when early stopping is used, its stability grows faster than that of GD at the same iteration. 4.1.3 The heavy ball method with a fixed momentum The heavy ball method (HB), like NAG, is also a multi-step extension of the gradient descent method (Polyak, 1964). Fixed step-size and fixed momentum parameter heavy ball method has the following updates. For t ≥ 1, θt+1 = θt − η∇F (θt ) + γ (θt − θt−1 ) ,   with fixed γ ∈ [0, 1), η ∈ 0, 2(1−γ) . As for the NAG, we provide only a uniform stabilβ ity bound for the heavy ball method when the empirical risk function is quadratic. We conjecture that the same stability bound holds for general convex smooth functions. Theorem 12 Given a data distribution P , under the assumption that l(·, z) is a L-Lipschitz, β-smooth convex quadratic loss function  on a bounded domain for every z, the heavy  defined (1−γ) and a fixed momentum parameter γ ∈ [0, 1), ball method with a fixed step-size η ∈ 0, β which outputs θ̂T at iteration T , has the following uniform stability bound for all T ≥ 1, HB, fixed Estab (θ̂T , l, P, n) ≤ 4ηL2 T . √ (1 − γ)n (5) The proof of this theorem is provided in Appendix B.3. This theorem shows that the Heavy ball method with a fixed step-size and a fixed momentum parameter also uses multi-step gradients, it is more stable than NAG with a stability bound of order O(T /n). This demonstrates that the multi-step setup does not necessarily lead to a similar or worse stability bound than that of NAG. 11 Yuansi Chen, Chi Jin and Bin Yu 4.1.4 Other methods with known stability In this subsection, we restate the stability bounds of some other gradient methods in this subsection for completeness. The stability bounds stated in this subsection are not new, but they serve as basis of our discussion for their convergence lower bounds implied by Theorem 7 in Subsection 4.2. Stochastic gradient descent (SGD) with fixed or varying step-size The stochastic gradient descent is a randomized iterative algorithm for optimization. Instead of using the full gradient information, it randomly chooses one data sample and updates the parameter estimate according to the gradient on that sample. It starts at some initial point θ0 ∈ Ω, and iterates with the following recursion with i chosen from the set {1, ..., n} uniformly at random: θt+1 = θt − η∇fi (θt ), t = 1, 2, . . . Hardt et al. (2016) adapted the definition of uniform stability to randomized algorithms 2 and showed that the fixed step-size η ≤ β1 stochastic gradient descent has a 2ηLn T -uniform stability bound in the convex, L-Lipschitz and β-smooth setting. According to Theorem 3.8 in Hardt et al. (2016), we have SGD, fixed (θ̂T , l, P, n) ≤ Estab 2ηL2 T n (6) for any convex L-Lipschitz and β-smooth loss function l. This is a restatement of the result of Hardt et al. (2016) in our notation. Hardt et al. (2016) further considers stochastic gradient descent with decreasing stepsizes ηt = t−α and shows that stochastic gradient descent with decreasing step-sizes has 2ηL2 T 1−α -uniform stability in the same setting. n Stochastic gradient Langevin dynamics (SGLD) Stochastic gradient Langevin dynamics (SGLD) is a popular variant of stochastic gradient descent, where properly scaled isotropic Gaussian noise is added to an unbiased estimate of the gradient at each iteration (Gelfand and Mitter, 1991). Stochastic gradient Langevin dynamics with temperature parameter τ and step-size ηt , starts at some initial point θ0 ∈ Rn , and iterates with the following recursion with i chosen from the set {1, ..., n} uniformly at random, and w ∼ N (0, Id ), r θt+1 = θt − ηt ∇fi (θt ) + 2ηt w. τ SGLD plays an important role in sampling and optimization. It isqproposed as a stochastic discrete version of the Langevin Equation dθt = −∇f (θt )dt + τ2 dBt , where Bt is the Brownian motion. Recent work by Raginsky et al. (2017) has shown its effective in nonconvex learning with optimization and generalization guarantees. When SGLD is applied to optimization, a decreasing step with ηt = O(η0 /t) should be used to ensure convergence to local minima. We study this particular step-size setting of SGLD. It has been shown by Mou et al. (2017) that SGLD has the following uniform 12 Stability and Convergence Trade-off of Iterative Optimization Algorithms stability for L-Lipschitz convex loss function, v    u T X u L O  k0 + Ltτ ηt  , n t=k0 +1  where k0 = min t|ηk τ L2 < 1 . Plugging in the O(η0 /t) step-size, we have that SGLD has a uniform stability bound SGLD Estab (θ̂T , l, P, n) ≤ O( L2 (τ η0 )1/2 T 1/4 ), n (7) at iteration T ≥ 1, for any convex L-Lipschitz and β-smooth loss function l. This is an adaptation of the result of Mou et al. (2017) in our notation. 4.2 Consequences for the convergence lower bound in convex smooth setting In this section, we apply Theorem 7 and Corollary 8 to obtain convergence lower bounds for a variety of first order optimization algorithms mentioned above. Furthermore, we compare the convergence lower bound we obtain with the known convergence upper bound for each of the optimization methods mentioned in the previous section. The known convergence upper bounds mentioned in this section can be found in the optimization textbooks (See Boyd and Vandenberghe (2004) or Bubeck et al. (2015)). We also discuss how our lower bounds compare to those obtained from classical oracle model of complexity by Nemirovsky et al. (1982). Note that the assumptions in Theorem 7 are slightly different to what we use when we establish stability bounds in the previous section: the former assume bounded domain R while the latter assume L-Lipschitz. To make these two assumptions compatible, in this subsection, we assume that the domain R = |Ω| is fixed and for all z ∈ Z, there exists θ∗ ∈ Ω such that ∇l(·, z) = 0. Then we have the loss is L-Lipschitz with L ≤ Rβ. This is because for any θ ∈ Ω, k∇l (θ, z)k2 = k∇l (θ, z) − ∇l(θ∗ , z)k2 ≤ β kθ − θ∗ k2 ≤ Rβ. In Table 1, we summarize all the uniform stability results and the corresponding convergence lower bound under convex smooth setting. While exact constants are provided in the main text, we only show the dependency on iteration number T and sample size n in the table. 4.2.1 Gradient descent According to Equation (3) in Theorem 10, the fixed-step-size full gradient method has 2η(Rβ)2 T -uniform n stability. Applying Corollary 8, knowing that its convergence does not depend on n, we obtain that its convergence rate is lower bounded by GD Eopt (T, Lc ) ≥ 13 R2 . 2C2 ηT (8) Yuansi Chen, Chi Jin and Bin Yu Method GD, η = 1/β NAG* HB*, fixed momentum SGD, η = 1/β SGD, η = O (T −α ) SGLD, η = O T −1  Uniform stability   T O  n2  T O n T O n T O n   1−α T O n ! T 1/4 O n Convergence upper bound (known)   1 O T  1 O 2 T  1 O T   1 O +C T  1 O T 1−α − Convergence lower bound (ours)   1 O T  1 O 2 T  1 O T   1 O T   1 O T 1−α   1 O T 1/4 Table 1: Uniform stability and convergence lower bound under convex smooth setting. *Stability results for NAG and HB are only proved for quadratic loss and so the convergence lower bound in the same row is conjectured. C is some universal constant, meaning that SGD with constant step-size does not converge to optimum. We are not aware of the convergence rate upper bound of SGLD. It is known (see e.g. Bubeck et al. (2015)) that for f convex an β-smooth on Rn , the full gradient method with step-size η ≤ β1 satisfies f (θT ) − f (θ∗ ) ≤ 2kθ0 − θ∗ k2 . ηT The convergence rate lower bound obtained via our stability trade-off thus matches the known upper bound up to constant factors. 4.2.2 Stochastic gradient descent According to Hardt et al. (2016), the fixed step-size stochastic gradient descent also has 2η(Rβ)2 T -uniform n stability. Applying Corollary 8, we obtain a convergence rate lower bound of order O(1/T ). However, it is known that fixed-step-size stochastic gradient descent can not converge arbitrarily small error at the rate O(1/T ) (Delyon and Juditsky, 1993). The best rate of convergence to minimize a smooth non-strongly convex function with noisy 1 gradients is of order O(T − 2 ) (Nemirovski et al., 2009). Therefore, in the case of fixed stepsize SGD, the convergence lower bound we provide is valid but loose. The fixed step-size SGD is a stable algorithm but is not a convergent algorithm. 1 On the other hand, it is shown in the same work (Nemirovski et al., 2009) that O(T − 2 ) convergence rate is achieved by stochastic gradient descent with decreasing step-size of order 1 O(T − 2 ). Using our stability argument, we provide insights why the stochastic gradient descent with decreasing step-size is not converging too fast. It has also been shown by Hardt 14 Stability and Convergence Trade-off of Iterative Optimization Algorithms 1 −2 et al. √ (2016) that stochastic gradient descent with decreasing step-size of order O(T ) has O( T /n) uniform stability. Applying Corollary 8, we conclude that when this decreasing step-size is used, gradient descent can not converge as fast as O(T −1 ). Similar arguments can be used to explain the conjecture by Moulines and Bach (2011) on the optimal convergence rates for stochastic gradient descent of O(T −α ) step-size. It is shown in Moulines and Bach (2011) that, for α ∈ (2/3, 1), the convergence rate of stochastic gradient descent for the convex β-smooth case is upper bounded by O(T α−1 ). It is shown by Hardt et al. (2016) that stochastic gradient descent of O(T −α ) step-size has O(T 1−α /n) uniform stability in this set-up. Applying Corollary 8, we provide a proof of this conjecture, confirming the optimality of this convergence rate upper bound. 4.2.3 Nesterov accelerated gradient descent According to Theorem 11, the Nesterov accelerated gradient descent with fixed step-size 2 2 T has 4η(Rβ) -uniform stability for quadratic loss functions. Under the conjecture that the n same stability holds for convex smooth loss functions, according to Corollary 8, we could obtain that its convergence rate is lower bounded by NAG Eopt (T, Lc ) ≥ R2 . 4C2 ηT 2 (9) This is compatible with its convergence rate upper bound provided in Nesterov (1983). For f convex and β-smooth function, Nesterov accelerated gradient method with step-size η ≤ β1 satisfies f (θT ) − f (θ∗ ) ≤ 2kθ1 − θ∗ k2 . ηT 2 We can compare our stability based lower bounds to classical ways of getting complexity lower bound using the classical first-order oracle of complexity (Nemirovsky et al., 1982; Nesterov, 2013). The classical oracle model based lower bound provides O(1/T 2 ) lower bound for all first order optimization methods that falls into the following black-box framework. It assumes that the optimization methods takes initialization θ1 = 0 and at iteration t, θt is in the linear span of all previous gradients. Whereas our results show that all optimization methods with order O(T 2 /n) uniform stability in the smooth non-strongly convex setting would have convergence rate lower bounded by O(1/T 2 ). The two lower bounds have similar form, but apply under different scenarios. One remarkable property of our result is that it does not depend on how exactly the algorithm is initialized. 4.2.4 Heavy ball method with fixed step-size   According to Theorem 12, heavy ball method with fixed step-size η ∈ 0, (1−γ) and fixed β momentum parameter γ ∈ [0, 1) has 4ηL2 T . √ (1 − γ)n uniform stability for quadratic loss functions. Under the conjecture that the same stability holds for convex smooth loss functions, applying Corollary 8, we obtain that its convergence 15 Yuansi Chen, Chi Jin and Bin Yu rate is lower bounded by O(1/T ). First, this lower bound matches the convergence rate upper bound proved in Ghadimi et al. (2015). Second, unlike Nesterov accelerated gradient descent, even though multiple steps of gradients are used, heavy ball method with fixed step-size is not able to achieve the optimal convergence rate O(1/T 2 ). Another viewpoint on this result is that the smart choice of weighting coefficients in NAG is necessary to its optimal convergence guarantee. 4.2.5 Stochastic gradient Langevin dynamics (SGLD) According to Mou et al. (2017), stochastic gradient Langevin dynamics with temperature τ and decreasing step-size O(1/T ), when used for convex optimization, has L2 (κη0 )1/2 T 1/4 O( ) n uniform-stability. Applying Corollary 8, we conclude that its convergence rate is lower bounded by O(1/T 1/4 ). While the additional noise added in SGLD might be helpful for certain non-convex optimization settings in escaping local minima as stated in Mou et al. (2017), SGLD has a slower worst-case convergence than the GD or SGD based on our stability argument. 4.3 Stability in the strongly convex smooth setting In this subsection, we establish uniform stability for gradient descent, Nesterov accelerated gradient method in the strongly convex smooth setting. In the strongly convex smooth setting, the loss function l(·, z) is α strongly-convex, β-smooth for every z ∈ Z. 4.3.1 Gradient descent (GD) The gradient descent method in the strongly convex setting has exactly the same updates as before, given a strongly convex smooth objective F , for t ≥ 0, θt+1 = θt − η∇F (θt ), where η ≤ 1/β is the step-size. While the algorithm stays the same, the strongly convex property of the loss function allows the algorithm to have a better stability. Theorem 13 Given a data distribution P , under the assumption that l(·, z) is α-strongly convex, β-smooth and L-Lipschitz for every z ∈ Z, the full gradient method with constant step-size η ≤ β1 , which outputs θ̂T at iteration T ≥ 1, has uniform stability 4L2 GD, strongly convex Estab (θ̂T , l, P, n) ≤ αn   ! ηβ T 1− 1− . 1+κ The proof of this theorem is provided in Appendix C.1. 16 (10) Stability and Convergence Trade-off of Iterative Optimization Algorithms 4.3.2 Stochastic gradient descent (SGD) with fixed step-size The stochastic gradient descent in the strongly convex setting has the exactly same updates as before. It starts at some initial point θ0 ∈ Ω, and iterates with the following recursion with i chosen from the set {1, ..., n} uniformly at random, θt+1 = θt − η∇fi (θt ). The stability of SGD under strongly convex setting has been first discussed in Hardt et al. (2016). According to Theorem 3.10 in Hardt et al. (2016), the stability of SGD under strongly convex setting is upper bounded by SGD, fixed, strongly convex Estab (θ̂T , l, P, n) ≤  2L2  1 − (1 − ηα/2)T αn (11) at iteration T ≥ 1, for any α-strongly convex, L-Lipschitz and β-smooth loss function l. 4.3.3 Nesterov accelerated gradient descent (NAG) Unlike in the convex smooth setting, Nesterovs accelerated gradient descent can take fixed momentum parameter in the strongly convex smooth setting. θt+1 = wt − η∇F (wt )   √ √ κ−1 κ−1 wt+1 = 1 + √ θt+1 − √ θt , κ+1 κ+1 where η ≤ β1 is the step-size, κ = β/α. We prove its uniform stability for α strongly-convex, β-smooth for quadratic loss function. Theorem 14 Given a data distribution P , under the assumption that l(·, z) is α-strongly convex, β-smooth and L-Lipschitz for every z ∈ Z, Nesterov accelerated gradient descent method described above, which outputs θ̂T at iteration T ≥ 1, has uniform stability  T ! 2 1 4L NAG, strongly convex 1− 1− √ . (12) Estab (θ̂T , l, P, n) ≤ αn κ The proof of this theorem is provided in Appendix C.2. 4.4 Consequences for the convergence lower bound in the strongly convex setting In this subsection, we obtain convergence lower bound for GD and NAG in the α-strongly convex β-smooth setting via Theorem 9. In Table 2, we summarize all the uniform stability results and the corresponding convergence lower bounds under strongly convex smooth setting. While exact constants are provided in the main text, we only show the dependency on iteration number T and sample size n in the table. 17 Yuansi Chen, Chi Jin and Bin Yu Method GD NAG* SGD Uniform stability    1 −O(T /κ) O 1−e   n √  1 −O(T / κ) O 1−e n   1 −O(T /κ) O 1−e n Convergence upper bound (known) Convergence lower bound (ours) e−O(T /κ) e−O(T /κ) − C √ e−O(T / √ κ) e−O(T / e−O(T /κ) + C κ) −C e−O(T /κ) − C Table 2: Uniform stability and convergence lower bound under strongly convex setting. *Stability results for NAG are only proved for quadratic loss and so the convergence lower bound in the same row is conjectured. C is some universal constant, meaning that SGD with constant step-size does not converge to optimum and our convergence lower bound has an undesirable offset in this setting. 4.4.1 Gradient descent According to Theorem 13, gradient descent with fixed step-size η in the strongly convex smooth setting has 4 (Rβ)2 αn   ! ηβ T 1− 1− 1+κ uniform stability. We apply Theorem 9 to obtain a lower bound on the convergence of GD for strongly convex smooth functions. GD Eopt (T, Lsc ) βR2 4 (Rβ)2 4 (Rβ)2 − + ≥ C3 n αn αn 2   ηβ T 1− . 1+κ (13) 2 4(Rβ) If the leading constants βR match, we could directly obtain a lower bound C3 and α −O(T /(1+κ)) on its convergence of order e as we expect. Unfortunately, due to our proof of the empirical risk minimization lower bound, a couple factors of constants are lost. Thus directly applying the stability bound makes it impossible to match the leading constants. We always have 4 (Rβ)2 βR2 ≥ . αn C3 n Therefore, our trade-off result only gives convergence lower bound of GD with an offset of 4(Rβ)2 βR2 as stated in Equation (13). C3 n − αn Remark that a similar lower bound can be obtained for stochastic gradient descent using exactly the same argument for GD. 18 Stability and Convergence Trade-off of Iterative Optimization Algorithms 4.4.2 Nesterov accelerated gradient descent According to Theorem 14, Nesterov accelerated gradient descent with fixed step-size η in the strongly convex smooth setting has  !  4L2 1 T 1− 1− √ αn κ uniform stability for quadratic loss function. Since the construction of the minimax lower bound in Theorem 9 is based on quadratic loss functions, applying Theorem 9 by restricting to √ quadratic loss functions, we obtain an expected convergence lower bound of order e−O(T / κ) with an offset, NAG Eopt (T, Lsc ) βR2 4 (Rβ)2 4 (Rβ)2 ≥ − + C3 n αn αn  1 1− √ κ T . (14) 5. Simulations Experiments In this section, we first show via simulation results of a simple logistic regression applied on breast-cancer-wisconsin dataset that the stability bounds established in this paper have the right scaling on the iteration number T . Second, we illustrate via a logistic regression problem that the stability bound characterize better the generalization error than simple uniform convergence bound at least for the first iterations of GD and NAG. 5.1 Algorithmic Stability Rate Scaling We evaluate our stability bounds for all gradient methods mentioned on logistic regression with the binary classification datasets breast-cancer-wisconsin (Wolberg and Mangasarian, 1990). This dataset has sample size n = 699 and dimension d = 10. The problem of logistic regression is formulated as follows. Given a set of i.i.d. samples {(Xi , Yi )}ni=1 , with Xi ∈ Rd and Yi ∈ {0, 1}, we want to estimate the parameter θ which characterizes the conditional distribution of Y1 given X1 : > P(Yi = 1|Xi ; θ) = r(θ, Xi ) = eθ Xi . 1 + eθ> Xi Let Y = (Y1 , . . . , Yn )> ∈ {0, 1}n and X be the n × d matrix with Xi as ith -row. The log-likelihood function we optimize over is as follows, ! n   X 1 > θ> Xi −Y Xθ + log 1 + e f (θ) = . (15) n i=1 It can be shown that this objective has the Lipschitz constant L equal to 1 and the smoothness parameter β equal to 1/4 when the covariate matrix X is normalized to have its maximum eigenvalue equal to 1. When there is no regularization, each loss function fi is not strongly convex µ = 0. In all of our experiments we set constant step-size η = 0.1. To construct samples that differ only on one data point, we first fix a sample S with 19 Yuansi Chen, Chi Jin and Bin Yu estimated algorithmic stability 10−1 10−2 10−3 Nesterov Heavy Ball 0.8 Full Gradient Full Gradient decrease 0.5 Full Gradient decrease 0.3 Stochastic Gradient Stochastic Gradient decrease 0.5 10−4 10−5 10−6 10−7 0 10 101 102 steps 103 104 Figure 1: Estimated algorithmic stability of various gradient methods mentioned with independent 50 runs. The estimated uniform stabilities of full gradient method, stochastic gradient method and heavy ball method with fixed step-size all have slope 1 in log-log plot, while Nesterov accelerated gradient method has slope 2. Methods with decreasing step-size have a slope smaller than 1. size 500 from dataset, then construct a perturbed sample S 0 by changing one data point in S and finally run our optimization algorithm to compute and plot the model difference kθt − θt0 k2 . The norm difference kθt − θt0 k2 constitute an estimate for the uniform stability up to constants independent of T and n. Finally, the perturbation on the sample is repeated 50 times. Figure 1 shows the estimated uniform stability, averaged over 50 independent repeats, for all gradient methods methods, Nesterov accelerated gradient, heavy ball method with fixed momentum (γ = 0.8), full gradient method with fixed step-size, full gradient method with decreasing step-size T −α (α = 0.5, 0.3), stochastic gradient method with fixed stepsize and stochastic gradient method with decreasing step-size T −α (α = 0.5). We observe that the estimated uniform stabilities of full gradient method, stochastic gradient method and heavy ball method with fixed step-size all have slope 1 in log-log plot, while Nesterov accelerated gradient method has slope 2. As expected, methods with decreasing step-size have a slope smaller than 1. Even though the stability bounds of NAG and HB are only established for quadratic loss, the estimated stability in the simulation makes us conjecture that the stability bounds of NAG and HB still hold in the general convex smooth setting. 5.2 Algorithmic stability vs simple uniform convergence bounds The goal of this simulation is to show that algorithmic stability characterize the generalization error better than the simple uniform convergence bounds, which can not easily take into account of the growth of the function space for iterative algorithms. For d-dimensional 20 101 101 100 100 10−1 10−1 risk risk Stability and Convergence Trade-off of Iterative Optimization Algorithms 10−2 10−3 10 −5 100 10−3 optimization error (GD) test error (GD) 10−4 102 steps 103 optimization error (NAG) test error (NAG) 10−4 stability (GD) simple uniform convergence bound 101 10−2 10 104 (a) Exp 1. Gradient Descent −5 100 stability (NAG) simple uniform convergence bound 101 102 steps 103 104 (b) Exp 1. Nesterov Accelerated Gradient Figure 2: Algorithmic stability vs simple uniform convergence bound in the first experiment, d = 20, n = 2000. For both GD and NAG, the optimization error plot aligns with the test error plot, indicating that optimization error dominates in the risk decomposition. Whether using stability or simple uniform convergence bound to characterize generalization error is not important. estimation problem, psimple  uniform convergence bound would give an generalization error bound of order O d/n . The exact constant in the uniform convergence bound depends on the function space and is hard to characterize for iterative algorithms. We think that more refined uniform convergence bound via Rademacher complexity (Bartlett and Mendelson, 2003) might be possible, but we are not aware of such results for general iterative algorithms. In this section, p  we show via simulations that the simple uniform convergence bound of order O d/n is less precise than the stability in characterizing generalization error. More precisely, we can see that when the dimension d and the number of samples n are large and iteration T is small r d s(T )  , n n where s(T )/n is the stability bound for GD or NAG. We show in the next two experiments that this comparison is valid and the stability bound is more relevant in large scale problems. In the both experiments, we fix the true parameter θ∗ = (1, . . . , 1)> and we random draw n i.i.d. samples (Xi , Yi ) according to the following data generation process. Each row of X is drawn from a standard d-dimensional normal distribution, and then X is renormalized to have row norm 1. Each label Yi , give Xi = x, is drawn from a Bernoulli distribution with parameter r(θ∗ , x). We use both the gradient descent and Nesterov accelerated gradient to optimize the empirical log-likelihood objective in Equation (15). We estimate the stability using its definition in Equation (1) by varying different z from holdout data set. In first experiment, we set d = 20, n = 2000. Figure 2 shows that both the simple uniform convergence bound and estimated stability bound are small compared to optimization error. In this setting, driving optimization error to zero is more important for reducing the test error, as shown in thick red color. We can still observe that the scalings of the estimated 21 Yuansi Chen, Chi Jin and Bin Yu 100 100 10−1 10−1 risk 101 risk 101 10−2 10−2 optimization error (GD) 10−3 optimization error (NAG) 10−3 test error (GD) test error (NAG) stability (GD) simple uniform convergence bound 10 −4 100 101 102 steps 103 stability (NAG) simple uniform convergence bound 10 104 (a) Exp 2. Gradient Descent −4 100 101 102 steps 103 104 (b) Exp 2. Nesterov Accelerated Gradient Figure 3: Algorithmic stability vs simple uniform convergence bound in the second experiment, d = 200, n = 2000. As the test error deviates from the optimization error, the generalization error accounts for a large portion of the test error. Because the simple uniform convergence bound does not depend on the iteration number, it can’t explain the overfitting phenomenon especially for NAG. 100 100 10−1 10−1 risk 101 risk 101 10−2 10−2 10−3 10−3 test error (GD) test error (NAG) optimization + stab (GD) simple uniform convergence bound 10 −4 100 101 102 steps 103 optimization + stab (NAG) simple uniform convergence bound 10 104 (a) Exp 2. Gradient Descent −4 100 101 102 steps 103 104 (b) Exp 2. Nesterov Accelerated Gradient Figure 4: Stability + optimization error in the second experiment, d = 200, n = 2000. Stability + optimization error shown in dashed line aligns well with the test error curve. stability bound for GD and NAG are different. Our theoretical stability bound follows the estimated stability bound with the same slope, but without the saturation at the end of iterates. In the second experiment, we set d = 200, n = 2000. Figure 3 shows that the generalization error accounts for a large portion of the test error. Especially, we observe in Figure 3b that the test error of NAG deviates from its training error. Simple uniform convergence bound does not explain the overfitting phenomenon here. The algorithmic stability combined with the training error suggests that early-stopping should be used for NAG in this setting as shown in Figure 4. 22 Stability and Convergence Trade-off of Iterative Optimization Algorithms 6. Discussions In this section, we discuss how our stability bound for optimization could served as an early stopping criteria. We also discuss other iterative algorithms such as boosting that could fit into this stability and optimization trade-off framework. 6.1 Stability based early stopping criteria Minimizing empirical risk is often computationally expensive in large scale learning problems. As it has been pointed out in Bousquet and Bottou (2008), optimization algorithms do not need to carry out this minimization with great accuracy since the empirical risk is already an approximation to the expected risk. For example, we can stop an iterative optimization algorithm long before its convergence to reduce computational cost. How early we should stop without deteriorating too much the expected risk becomes the main question we ask in large scale learning problems. The expected excess risk decomposition has been the main theoretical guideline for this kind of early-stopping criteria. Even though in this reasoning we are studying upper bounds of generalization and optimization errors, it is often accepted that these upper bounds give a realistic idea of the actual convergence rates (Vapnik et al., 1994; Bousquet and Elisseeff, 2002; Bartlett et al., 2006; Bousquet and Bottou, 2008). We would like to stop our optimization algorithm as far as it reaches an optimization error close to its generalization error. However, the uniform convergence bounds are often too pessimistic about the size of the space to search over. Instead, we use our stability based generalization bound as an estimate of the generalization error. Formally, we would choose iteration T such that Estab (T, n) ≈ Eopt (T ). As an example, our stability based generalization bound for fixed-step-size full gradient 2 method in the smooth non-strongly convex setting is 2ηLn T . The first remarkable point is that this generalization error bound is dimension-free. Because it is often hard to access accurate estimates for the uniform convergence bounds based generalization error, it might be advantageous to acquire a theoretical early-stopping criterion via our stability bounds. For the full gradient method trained model, as long as the Lipschitz constant L and smoothness constantqβ can be estimated accurately, we are able to give an early stopping criterion such as T ≈ η2 Ln2 R2 , given the estimate of R is accurate. 6.2 Other iterative optimization algorithms such as boosting Boosting is one of the most successful and practical iterative optimization methods. Unlike gradient method which iterates over parameters, boosting starts with a sensible estimator or classifier, the learner, and seeks its improvements iteratively on the function space. The bias-variance trade-off of L2 boosting discussed in Bühlmann and Yu (2003) shares similar behaviors as the trade-off we discussed in Equation (2). It would be interesting to characterize the stability of boosting algorithms with various kinds of weaker learners and derive precise trade-off results as we did for gradient methods. 23 Yuansi Chen, Chi Jin and Bin Yu Acknowledgments This research is supported in part by ONR Grant N00014-16-2664 , NSF Grants DMS1613002 and IIS 1741340, and the Center for Science of Information (CSoI), a US NSF Science and Technology Center, under grant agreement CCF-0939370. We would like to thank Raaz Dwivedi and Rebecca Barter for fruitful discussions on this topic. References Alekh Agarwal and Leon Bottou. A lower bound for the optimization of finite sums. In International Conference on Machine Learning, pages 78–86, 2015. Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. The Journal of Machine Learning Research, 3:463–482, 2003. Peter L Bartlett, Michael I Jordan, and Jon D McAuliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138–156, 2006. Olivier Bousquet and Léon Bottou. The tradeoffs of large scale learning. In Advances in neural information processing systems, pages 161–168, 2008. Olivier Bousquet and André Elisseeff. Stability and generalization. The Journal of Machine Learning Research, 2:499–526, 2002. Stephen Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004. Sébastien Bubeck et al. Convex optimization: Algorithms and complexity. Foundations and Trends in Machine Learning, 8(3-4):231–357, 2015. Peter Bühlmann and Bin Yu. Boosting with the l 2 loss: regression and classification. Journal of the American Statistical Association, 98(462):324–339, 2003. Zachary Charles and Dimitris Papailiopoulos. Stability and generalization of learning algorithms that converge to global optima. arXiv preprint arXiv:1710.08402, 2017. Bernard Delyon and Anatoli Juditsky. Accelerated stochastic approximation. SIAM Journal on Optimization, 3(4):868–881, 1993. Luc P Devroye and Terry J Wagner. Distribution-free performance bounds for potential function rules. Information Theory, IEEE Transactions on, 25(5):601–604, 1979. Bradley Efron. The jackknife, the bootstrap, and other resampling plans, volume 38. Siam, 1982. Saul B Gelfand and Sanjoy K Mitter. Recursive stochastic algorithms for global optimization in Rd . SIAM Journal on Control and Optimization, 29(5):999–1018, 1991. 24 Stability and Convergence Trade-off of Iterative Optimization Algorithms Euhanna Ghadimi, Hamid Reza Feyzmahdavian, and Mikael Johansson. Global convergence of the heavy-ball method for convex optimization. In Control Conference (ECC), 2015 European, pages 310–315. IEEE, 2015. Moritz Hardt, Ben Recht, and Yoram Singer. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning, pages 1225–1234, 2016. Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. In International Conference on Machine Learning, 2017. Samuel Kutin and Partha Niyogi. Almost-everywhere algorithmic stability and generalization error. In Proceedings of the Eighteenth conference on Uncertainty in artificial intelligence, pages 275–282. Morgan Kaufmann Publishers Inc., 2002. Lucien Le Cam. Asymptotic methods in statistical decision theory. 1986. John C Mason and David C Handscomb. Chebyshev polynomials. CRC Press, 2002. Wenlong Mou, Liwei Wang, Xiyu Zhai, and Kai Zheng. Generalization bounds of sgld for non-convex learning: Two theoretical viewpoints. arXiv preprint arXiv:1707.05947, 2017. Eric Moulines and Francis R Bach. Non-asymptotic analysis of stochastic approximation algorithms for machine learning. In Advances in Neural Information Processing Systems, pages 451–459, 2011. Arkadi Nemirovski, Anatoli Juditsky, Guanghui Lan, and Alexander Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009. A-S Nemirovsky, D-B Yudin, and E-R Dawson. Problem complexity and method efficiency in optimization. 1982. Yurii Nesterov. A method of solving a convex programming problem with convergence rate O(1/k 2 ). In Soviet Mathematics Doklady, volume 27, pages 372–376, 1983. Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013. Boris T Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964. Maxim Raginsky, Alexander Rakhlin, and Matus Telgarsky. Non-convex learning via stochastic gradient langevin dynamics: a nonasymptotic analysis. In Conference on Learning Theory, pages 1674–1703, 2017. William H Rogers and Terry J Wagner. A finite sample distribution-free performance bound for local discrimination rules. The Annals of Statistics, pages 506–514, 1978. Pafnuti Lvovitch Tchebychev. Théorie des mécanismes connus sous le nom de parallélogrammes. Imprimerie de l’Académie impériale des sciences, 1853. 25 Yuansi Chen, Chi Jin and Bin Yu Vladimir Vapnik, Esther Levin, and Yann Le Cun. Measuring the vc-dimension of a learning machine. Neural Computation, 6(5):851–876, 1994. William H Wolberg and Olvi L Mangasarian. Multisurface method of pattern separation for medical diagnosis applied to breast cytology. Proceedings of the national academy of sciences, 87(23):9193–9196, 1990. Blake E Woodworth and Nati Srebro. Tight complexity bounds for optimizing composite objectives. In Advances in neural information processing systems, pages 3639–3647, 2016. 26 Stability and Convergence Trade-off of Iterative Optimization Algorithms Appendix A Proof of Main Results A.1 Proof of Theorem 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.2 Proof of Corollary 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.3 Proof of Theorem 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 27 29 30 B Stability Bounds for Convex Smooth Functions B.1 Gradient Descent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.2 Nesterov’s Accelerated Gradient Descent . . . . . . . . . . . . . . . . . . . . B.3 Heavy Ball Method with Fixed Momentum . . . . . . . . . . . . . . . . . . 31 32 33 38 C Stability Bounds for Strongly Convex Smooth Functions C.1 Gradient Descent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.2 Nesterov’s Accelerated Gradient Descent . . . . . . . . . . . . . . . . . . . . 41 41 42 Appendix A. Proof of Main Results A.1 Proof of Theorem 7 Using Equation (2), Theorem 7 directly follows from the well-known statistical lower bound for empirical risk estimation with adaptation to convex smooth loss functions. For completeness, we restate this lower bound and provide the proof below. Lemma 15 For any fixed sample size n, there exists a universal constant C1 > 0 and β-smooth convex loss function l defined on Z × Ω, with R = |Ω|, such that h i R2 β √ . inf sup ES δR(θ̂) ≥ C1 n θ̂ P ∈P Proof of Lemma 15 The main idea to prove this lemma is to formulate the excess risk minimization problem as binary hypothesis testing problem and then apply Le Cam’s method for lower bound. For any fixed sample size n, define domain Z be {−1, 1} and two probability distributions P1 and P2 satisfying the following two properties, 1 1 +√ , 2 24n 1 1 P1 (Z = 1) = P2 (Z = −1) = − √ . 2 24n P1 (Z = −1) = P2 (Z = 1) = We define P1n to be the joint distribution where Z1 , . . . , Zn are independent samples from P1 , and we defin P2 accordingly. 27 Yuansi Chen, Chi Jin and Bin Yu Let θ1∗ ∈ Ω with all other coordinates zero but the first coordinate equals to −δ, and ∈ Ω with all other coordinates zero but the first coordinate equals to δ, with 0 < δ ≤ r. δ and r are a constants to be determined later. Let θ[1] be the first coordinate of θ and let Φ(r) be the parameter such that   ∀v ∈ {1, 2} , |θ[1] − θv∗ [1]| ≥ r ⇒ EZ∼Pv δR(θ0 ) ≥ Φ(r). θ2∗ The exact form of Φ(r) will be determined after we define the loss function l. We have h i   inf max EPv δR(θ̂) ≥ Φ(r) · inf max Pvn θ̂[1] − θv∗ [1] ≥ r . (16) θ̂∈Ω v∈{1,2} θ̂∈Ω v∈{1,2} Le Cam’s method reduce this estimation problem to binary hypothesis testing problem, then we have   n n ∗ inf max Pv θ̂(Zv )[1] − θv [1] ≥ r ≥ inf max Pvn (Ψ(Zvn ) 6= v) , Ψ v∈{1,2} θ̂∈Ω v∈{1,2} where the infimum ranges over all testing functions Ψ : Z n → {1, 2}. We have for any Ψ : Z n → {1, 2} that the probability of error is 1 1 max Pvn (Ψ(Zvn ) 6= v) = P1n (Ψ (Z1n ) 6= 1) + P2n (Ψ (Z2n ) 6= 2) 2 2 v∈{1,2} A standard result of Le Cam (1986) gives the exact expression of the minimal possible error in the above hypothesis test. We have inf {P1n (Ψ (Z1n ) 6= 1) + P2n (Ψ (Z2n ) 6= 2)} = 1 − kP1n − P2n kTV , Ψ where k·kTV denotes the total variation distance. Using Pinsker’s inequality, we have kP1n − P2n k2TV ≤ 2KL (P1n ||P2n ) n = KL (P1 ||P2 ) 2 1+ 1 (i) n = · √ log 2 1− 6n √1 6n √1 6n (ii) n 3 · 2 6n 1 = 4 ≤ . Equality (i) uses the KL divergence formula between   two Bernoulli distributions. Inequality 2 for δ ∈ 0, 1 . Thus, we show that any test Ψ mistakes (ii) uses the inequality δ log 1+δ ≤ 3δ 1−δ 2 one of the probability distribution for the other with probability at least 14 . 1 inf max Pvn (Ψ(Zvn ) 6= v) ≥ . Ψ v∈{1,2} 4 28 Stability and Convergence Trade-off of Iterative Optimization Algorithms It remains to design a β-smooth convex loss function l and determine the exact form of Φ. Without loss of generality, we can assume that Ω is center around 0. We define the loss function l(θ; z) to be ( β (θ[1] + r)2 for |θ[1] + r| ≤ 2r 2 l(θ; −1) = βr otherwise, 4 |θ[1] + r| ( 2 β for |θ[1] − r| ≤ 2r 2 (θ[1] − r) l(θ; 1) = βr otherwise. 4 |θ[1] − r| It is easy to verify that the loss function is convex and β-smooth for each z. Then     1 1 1 1 EZ∼P1 l (θ; Z) = l(θ; −1) + l(θ; 1). +√ −√ 2 2 24n 24n The function EZ∼P1 l (θ; Z) is differentiable along the  first coordinate. Its ∗derivative is r nondecreasing on the interval −r, − 2 . Thus the minimizer θ1 [1] falls into  and vanishes  the interval −r, − 2r . For θ0 ∈ Ω such that |θ0 [1] − θ1∗ [1]| ≥ r, using the derivative of EZ∼P1 l (θ; Z), we have   EZ∼P1 δR(θ0 ) ≥ min {EZ∼P1 [δR(0)] , EZ∼P1 [δR(θ1,left )]} where θ1,left is zero everywhere but − 3r 2 on the first coordinate. Then   βr2 , EZ∼P1 δR(θ0 ) ≥ √ 96n and the same holds for P2 . Plugging Φ(r) = 2 √βr 96n into Equation (16), we can conclude that h i βr2 1 βr2 inf max EPv δR(θ̂) ≥ √ · ≥ √ . 96n 4 16 6n θ̂∈Ω v∈{1,2} We remark that we can take r as large as R 2. Thus we conclude that h i inf max EPv δR(θ̂) ≥ θ̂∈Ω v∈{1,2} R2 β √ . 256 6n A.2 Proof of Corollary 8 Applying Theorem 7, for any sample size n and T , we have s(T ) R2 β √ . + Eoptimization (T, n) ≥ n C1 n As we only consider optimization method designed for any convex problems, Eoptimization is independent of the sample size n. This result is valid for any sample size n. We can take n such that the following quadratic function 1 R2 β s(T ) √ − Q( √ ) = , n n C1 n 29 Yuansi Chen, Chi Jin and Bin Yu is maximized to obtain the best lower bound. Completing the square, we have  Q(n) = −s(T ) 1 R2 β √ − n 2C1 s(T ) 2 + R4 β 2 . 4C12 s(T ) √ would be the best choice of n, but we have to ensure that n is an integer. Since s(T ) is divergent function of T , there exists T0 ≥ 1, such that for T ≥ T0 , we can always find integer n satisfying 2C1 s(T ) R2 β 4C1 s(T ) √ 4C1 s(T ) ≤ n≤ . 2 3R β R2 β Plugging n, we conclude that there exists universal constant C2 , and a convex function such that for T ≥ T0 , Eoptimization (T, n) ≥ R4 β 2 . C2 s(T ) A.3 Proof of Theorem 9 We prove the statistical lower bound for empirical risk estimation in the strongly convex case via similar techniques used in the proof of Lemma 15. Le Cam’s argument for reducing an estimation problem to binary hypothesis testing problem is still valid. All we do is to define a α-strongly convex β-smooth loss function l and find the corresponding Φ(r). We define the loss function l(θ; z) to be β (θ[1] + r)2 , 2 β l(θ; 1) = (θ[1] − r)2 . 2 l(θ; −1) = l is quadratic, so it is α-strongly convex and β smooth for each z. Then     1 1 1 1 EZ∼P1 l(θ; Z) = +√ l(θ; −1) + −√ l(θ; 1) 2 2 24n 24n   β 2 2 2 = θ[1] + √ θ[1]r + r 2 6n  2   β r r2 β 2 θ[1] + √ r − . = + 2 2 6n 6n The minimizer θ1∗ has the first coordinate equals to − √r6n . And the minimum is For θ0 ∈ Ω such that |θ0 [1] − θ1∗ [1]| ≥ r, we have EZ∼P1 l(θ0 ; Z) ≥ 30 βr2 . 2 β 2  r2 − r2 6n  . Stability and Convergence Trade-off of Iterative Optimization Algorithms Thus, we have   βr2 EZ∼P1 δR(θ0 ) ≥ 12n The same lower bound holds for P2 . Plugging Φ(r) = conclude that βr2 12n into Equation (16), we can h i βr2 1 βr2 inf max EPv δR(θ̂) ≥ · ≥ . 12n 4 48n θ̂∈Ω v∈{1,2} We remark that we can take r as large as R 2. Thus we conclude that h i R2 β . inf max EPv δR(θ̂) ≥ 192n θ̂∈Ω v∈{1,2} Appendix B. Stability Bounds for Convex Smooth Functions In this section, we prove stability bounds of optimization algorithms (GD, NAG and heavy ball methtod) for convex smooth functions. Before we proceed to the main proof, we state several well known lemmas about convex optimization which can be found in Boyd and Vandenberghe (2004); Bubeck et al. (2015). The β-smoothness of a function directly implies the following two lemmas. These two lemmas characterize how well the gradient approximation works for β-smooth functions in terms of both upper and lower bounds. Lemma 16 Let f be a β-smooth function on Ω. Then for all u, v ∈ Ω, we have f (u) ≤ f (v) + ∇f (v)> (u − v) + β ku − vk22 2 Lemma 17 Let f be a convex and β-smooth function on Ω. Then for any u, v ∈ Ω, we have f (u) ≥ f (v) + ∇f (v)> (u − v) − 1 k∇f (u) − ∇f (v)k22 2β An immediate corollary could be obtained by applying from the Lemma 16 to (u, v) and then (v, u). This corollary directly implies the constracting property of the gradient decent method, which is the key component for providing its algorithmic uniform stability. Corollary 18 Let f be a β-smooth function on Ω. Then for any u, v ∈ Ω, one has (∇f (u) − ∇f (v))> (u − v) ≥ 31 1 k∇f (u) − ∇f (v)k22 β Yuansi Chen, Chi Jin and Bin Yu B.1 Gradient Descent Recall that in order to prove the uniform stability, we need to bound the loss difference for any fixed sample z at each iteration t ≥ 1 l(θt , z) − l(θt0 , z) . This quantity is related to the norm difference kθt − θt0 k2 under the L-Lipschitz condition. Using the update rule of full gradient method, we obtain an recursive relation on kθt − θt0 k2 . For η ≤ β1 and t ≥ 1, we have θt − θt0 2 0 0 = θt−1 − η∇RS (θt−1 ) − θt−1 + η∇RS 0 (θt−1 ) n (i) 2 n 1X 1X 0 0 ∇fi (θt−1 ) + η ∇fi (θt−1 ) ≤ θt−1 − θt−1 −η n n (ii) ≤ (iii) ≤ 0 θt−1 − θt−1 −η 0 θt−1 − θt−1 2 1 n + i=1 n X ∇fi (θt−1 ) + η i=1 1 n i=1 n X i=1 0 ∇fi (θt−1 ) + η 0 0 ∇fk (θt−1 ) − ∇fk0 (θt−1 ) n + 2ηL n 2 2 2ηL n (17) The inequality (i) uses triangular inequality. The inequality (ii) follows from the L-Lipschitz condition on the perturbed gradient terms. The last inequality (iii) is obtain via the contracting property of gradient descent proved in Lemma 17 and its Corollary 18. Using the recursive relation, after summing Equation (17) from 1 to T , we prove that 2 the fixed-step-size full gradient method at iteration T is 2ηLn T -uniform stable, for η ≤ β1 . That is, for every z ∈ Z, l(θT ; z) − l(θT0 ; z) ≤ 2ηL2 T . n We remark that the stability of fixed-step-size full gradient method is linear as a function of iteration T . More generally, for gradient descent with varying step-sizes, using the same arguments, we can prove that the stability is upper bounded by the cumulative sum of all previous step-sizes at T . Next, we show that this stability upper bound can be achieved by a linear function. We design the loss function l(θ; z) such that it is either Lθ or −Lθ depending on z. We define the two empirical loss functions on S and S 0 , n RS (θ) = 1X Lθ = Lθ, n j=1 1 1 RS 0 (θ) = − Lθ + n n n X j=1,j6=k 32 Lθ = n−2 Lθ. n 2 Stability and Convergence Trade-off of Iterative Optimization Algorithms The two empirical loss functions differ exactly by 2 n Lθ. We have for iteration T , θT = T ηL + θ0 , n−2 θT0 = T ηL + θ0 n Then for this linear loss, for any z ∈ Z, l(θT ; z) − l(θT0 ; z) = 2ηL2 T . n The stability upper bound is thus tight. B.2 Nesterov’s Accelerated Gradient Descent Recall that the Nesterov’s accelerated gradient method has the following updates for t ≥ 1: θt+1 = (1 − γt−1 ) θt + γt−1 θt−1 − η∇RS ((1 − γt−1 ) θt + γt−1 θt−1 ), where η ≤ 1 β (18) is the step-size. γt is defined by the following recursion 1+ λ0 = 0, λt = q 1 + 4λ2t−1 2 , and γt = 1 − λt , λt+1 satisfying −1 < γt ≤ 0. For the updates on the perturbed samples S 0 , we have 0 0 0 θt+1 = (1 − γt−1 ) θt0 + γt−1 θt−1 − η∇RS 0 ((1 − γt−1 ) θt0 + γt−1 θt−1 ). (19) Denote ∆θt = θt − θt0 . Taking the difference of Equation (18) and (19), we have ∆θt+1 = (1 − γt−1 ) ∆θt + γt−1 ∆θt−1 − η∇2 RS (θmid,t ) ((1 − γt−1 ) ∆θt + γt−1 ∆θt−1 ) + et . (20) where the error term satisfies 0 0 et = η∇RS 0 ((1 − γt−1 ) θt0 + γt−1 θt−1 ) − η∇RS ((1 − γt−1 ) θt0 + γt−1 θt−1 ), 0 . Note that and θmid,t is on the path from (1 − γt−1 ) θt + γt−1 θt−1 to (1 − γt−1 ) θt0 + γt−1 θt−1 we have used the mean value theorem to group two gradient terms. Because ∇RS 0 and ∇RS only differ in one term, using the L-Lipschitz gradient property, we obtain an upper bound on the error term ket k2 ≤ 2ηL . n In the case of quadratic objective, we can denote A = η∇2 RS (θmid,t ). 33 Yuansi Chen, Chi Jin and Bin Yu Using the convex and β-smooth property, we have 0  A  Id . Then we can rewrite Equation 20 as follows, ∆θt+1 = (Id − A) [(1 − γt−1 ) ∆θt + γt−1 ∆θt−1 ] + et . Writing this equation in matrix form, we have        ∆θt+1 (1 − γt−1 ) (Id − A) γt−1 (Id − A) ∆θt e = + t . (21) ∆θt Id 0 ∆θt−1 0   (1 − γt−1 ) (Id − A) γt−1 (Id − A) Denote Gt = . Then we have an explicit expression of Id 0 ∆θt+1 by applying the update equation (21) recursively, for t ≥ 1,   Y   X t t−1 ∆θt+1 ∆θ1 = Gi + ∆θt ∆θ0 i=1 t Y i=0 s=t−i+1  Gs  et−i . 0 (22) Qt We have used i=1 Gi to denote the matrix product Gt Gt−1 . . . G1 . The goal isQto bound the norm of ∆θt+1 . We need the following lemma on the spectral norm of ti=1 Gi to conclude.   (1 − γt )B γt B , where B ∈ Rd×d is a symmetric positive Lemma 19 Suppose Mt = 1 0 semi-definite matrix 0  B  Id and −1 < γt < 1. Then for all t ≥ 1, ||| t Y i=1 Mi |||2 ≤ 2(t + 1). Assuming Lemma 19 as given at the moment, we now complete the proof. According to Equation (22), applying Lemma 19 to Gt , we can bound the norm of ∆θt+1 , t−1 2ηL X 2ηL + 2(i + 1) k∆θt+1 k2 ≤ 2(t + 1) n n i=0  2ηL 2 = t + 3t + 1 n 4ηL ≤ (t + 1)2 . n 2ηL We have used the fact that k∆θ0 k2 = 0, k∆θ1 k2 ≤ 2ηL n and ket k2 ≤ n in the first inequality. Together with the L-Lipschitz condition, we obtain that the Nesterov accelerated gradient method at iteration T is 4ηL2 T 2 n uniform stable. Now we turn back to prove Lemma 19. 34 Stability and Convergence Trade-off of Iterative Optimization Algorithms Proof of Lemma 19 Since B is symmetric positive-semidefinite, we can diagonalize B. There exists a common orthogonal matrix Q and diagonal matrices D such that B = Q−1 DQ. We have 0  D  Id . As a consequence, Mi could also be decomposed as follows, Mi =  −1    Q 0 (1 − γi−1 ) D γi−1 D Q 0 . 0 Q−1 Id 0 0 Q Then we obtain for its product t Y  Mi = i=1 Q−1 0 0 Q−1  "Y t  i=1 (1 − γi−1 ) D γi−1 D Id 0 #   Q 0 . 0 Q   (1 − γi−1 ) D γi−1 D is a block diagonal matrix. To bound the We observe that i=1 Id 0    Qt (1 − γi−1 ) D γi−1 D , it is sufficient to bound the 2 × 2 matrix spectral norm of i=1 Id 0 of the following form  Qt t Y Hi , i=1 where   (1 − γi−1 )h γi−1 h , Hi = 1 0 with 0 ≤ h ≤ 1. To bound its spectral norm, we claim the following lemma.   (1 − γi−1 )h γi−1 h Lemma 20 Suppose Hi = , where 0 ≤ h ≤ 1 and −1 < γi−1 < 1. 1 0 Then ||| t Y i=1 Hi |||2 ≤ 2(t + 1). Assuming Lemma 20 as given at the moment, the Lemma 19 can be completed. ||| t Y i=1 # t  Y (1 − γi−1 ) D γi−1 D Gi |||2 ≤ ||| |||2 ≤ 2(t + 1). Id 0 " i=1 Now we turn back to prove Lemma 20. 35 Yuansi Chen, Chi Jin and Bin Yu Proof of Lemma 20   a0 be a vector with i=1 Hi is a 2 × 2 matrix. Let b0 Qt Note that norm 1. We define   Y   t at a = Hi 0 . bt b0 i=1   at . We i=1 Hi , it is sufficient to bound the norm of bt Qt To bound the spectral norm of going to show by recursion that max (|at | , |bt |) ≤ 2(t + 1). For t = 0, t = 1, the statement is easy to verify. Suppose that the statement is true until t. We have the following recursion, at+1 = h ((1 − γt )at + γt bt ) bt+1 = at . We remark that at+1 as a function of (γ0 , . . . , γt ) is a multivariate polynomial with degree one. Hence its maximum or minimum value is attained at the extreme values of the variables. Formally, |at+1 | ≤ max (γi )0≤i≤t ∈{−1,1}t+1 |at+1 (γ0 , . . . , γt )| This is a combinatorial optimization problem. But we observe that there are only four relevant cases. • If γt = 1, then we have at+1 = hbt bt+1 = at . Applying the assumption of the recursion, we obtain the desired bound for at+1 and bt+1 . • If γ1 = 1, then we have a1 = hb0 b1 = a0 .     a1 a1 is a vector with norm less than 1. Consider the problem with as initialb1 b1 ization, we obtain the desired bound for at+1 and bt+1 . • If there exists i ∈ {2, . . . , t − 1} such that γi = 1, then   0 h Hi = , 1 0 36 Stability and Convergence Trade-off of Iterative Optimization Algorithms and  Hi+1 Hi Hi−1  (1 − γi+1 + γi+1 (1 − γi−1 )) h γi+1 γi−1 h =h , 1 0 Since −1 ≤ γi+1 γi−1 ≤ 1, this problem is again reduced to the problem where only t − 2 matrices are multiplied together: from Ht to Hi+2 , then Hi+1 Hi Hi−1 , then from Hi−2 to H1 . We apply the assumption of the recursion and obtain the desired bound for at+1 . • Otherwise, all γ0 , ..., γt should take value −1. Then   2h −h Hi = . 1 0  11  Q Ht Ht12 Let = ti=1 Hi , then we have the following recursion for its entries Ht21 Ht22 11 Hi+1 = 2hHi11 − hHi21 , 21 Hi+1 = Hi11 , 12 Hi+1 = 2hHi12 − hHi22 , 22 Hi+1 = Hi12 . We note that Hi11 satisfies the following second-order recursion 11 11 Hi+1 = 2hHi11 − hHi−1 , with H011 = 1 and H011 = 2h. We observe that Hi11 is exactly the Chebyshev polynomial Tchebychev (1853); Mason and Handscomb (2002) of second kind with parameter Ui (h). It is known that for Chebyshev polynomial of second kind, Ui (cos(θ)) = sin((i + 1)θ) , sin(θ) |Ui (cos(θ))| = z i+1 − z −i−1 z − z −1 and if z = eiθ , = z −2i i X z 2j j=0 ≤ i + 1. Thus 11 Ht+1 ≤ t + 2. Similarly, we show that all entries are less than t + 2. As a consequence, max(|at+1 | , |bt+1 |) ≤ 2(t + 2). This discussion of four relevant cases concludes the recursion part, and thus the proof of Lemma 20. 37 Yuansi Chen, Chi Jin and Bin Yu B.3 Heavy Ball Method with Fixed Momentum The proof of the fixed momentum heavy ball method proceeds similarly to that of the Nesterov accelerated gradient descent. Fixed momentum heavy ball method has the following updates. θt+1 = θt − η∇RS 0 (θt ) + γ (θt − θt−1 ) , (23)   with fixed momentum γ ∈ [0, 1), and fixed step-size η ∈ 0, (1−γ) . For the updates on the β perturbed samples S 0 , we have  0 0 θt+1 = θt0 − η∇RS 0 (θt0 ) + γ θt0 − θt−1 . (24) Denote ∆θt = θt − θt0 . Taking the difference of Equation (23) and (24), we have ∆θt+1 = (1 + γ)∆θt − γ∆θt−1 − η∇2 RS (θmid,t )(∆θt ) + et , (25) where the error term satisfies et = η∇RS 0 (θt0 ) − η∇RS (θt0 ), and θmid,t is on the path from θt to θt0 . Here we have used the mean value theorem to group the two gradient terms and to make appear the Hessian terms. Using the L-Lipschitz property, we obtain an upper bound on the error term, ket k2 ≤ 2ηL . n In the case of quadratic objective, we can denote A = η∇2 RS (θmid,t ). Using the convex and β-smooth property, we have 0  A  ηβId . We can rewrite Equation (25) in matrix form,        ∆θt+1 (1 + γ) I − A −γI ∆θt e = + t (26) ∆θt I 0 ∆θt−1 0   (1 + γ)Id − A −γId Denote G = . Then we could obtain an explicit expression for the Id 0 difference term as follows,   Y   X   t t−1 t Y ∆θt+1 ∆θ1 e = Gi + Gs t−i . (27) ∆θt ∆θ0 0 i=1 i=0 s=t−i+1 As Qt in the proof of NAG in Appendix B.2, we are going to bound the spectral norm of of the matrices A, it is sufficient to consider i=1 Gi to conclude. Using diagonalization   1 + γ − a −γ products of the 2 × 2 matrices H = , with 0 ≤ a ≤ ηβ. The following 1 0 Qt lemma characterizes the spectral norm of i=1 H. 38 Stability and Convergence Trade-off of Iterative Optimization Algorithms  Lemma 21 Suppose H =  1 + γ − a −γ , where 0 < γ < 1 and 0 ≤ a ≤ 1 − γ. Then 1 0 ||| t Y i=1 H|||2 ≤ 2 √ . 1− γ Assuming Lemma 21 as given at the moment, we have ||| t Y i=1 Gi |||2 ≤ 2 √ . 1− γ We can complete the proof of Theorem 12. t−1 k∆θt+1 k2 ≤ 2ηL X 2ηL 2 2 + √ √ 1− γ n 1− γ n i=0 4ηL = (t + 1) . √ (1 − γ)n 2ηL We have used the fact that k∆θ0 k2 = 0, k∆θ1 k2 ≤ 2ηL n and ket k2 ≤ n in the first inequality. Together with the L-Lipschitz condition, we obtain that the heavy ball method with fixed momentum at iteration T is 4ηL2 T √ (1 − γ)n uniform stable. Now we turn back to prove Lemma 21.   Qt at bt . We are going to show by recursion that Proof of Lemma 21 Let i=1 H = ct dt max(|at |, |bt |, |ct |, |dt |) ≤ 1 √ . 1− γ For t = 0, 1, the statement is easy to verify. Suppose that the statement is true until t. We have by recursion formular at+1 = ((1 + γ − a)at − γct ) ct+1 = at bt+1 = ((1 + γ − a)bt − γdt ) dt+1 = bt with initialization a1 = 1 + γ − a, c1 = 1, b1 = −γ, d1 = 0. We remark that ai satisfies the following second-order recursion, for i ≥ 1, ai+1 = (1 + γ − a)ai − γai−1 , 39 Yuansi Chen, Chi Jin and Bin Yu where a0 = 1, a1 = 1 + γ − a. We can also add a−1 = 0. The characteristic equation is x2 − (1 + γ − a) x + γ = 0. The two roots are x1,2 = 1+γ−a± q (1 + γ − a)2 − 4γ 2 . We note that |x1,2 | ≤ 1. . We distinguish two cases based on the two roots. • The two roots are distinct. By distinct roots theorem for second order homogeneous system, we have + l2 xt+1 at = l1 xt+1 2 , 1 where l1 and l2 are constants to be determined by the initial condition. Solving the initial condtion, we have 1 l1 = q (1 + γ − a)2 − 4γ 1 l2 = − q . 2 (1 + γ − a) − 4γ Hence, we can bound at as follows, |at | ≤ q ≤ ≤ ≤ 1 2 (1 + γ − a) − 4γ t X i=0 t X |x1 − x2 | t X i xt−i 1 x2 i=0 |x2 |i √ γi i=0 1 √ . 1− γ √ We have used that |x2 | ≤ γ. When the two roots have imaginary part, it is clear √ that |x2 | = γ. On the other hand, when the two roots are real, since |x1 x2 | = γ, √ |x2 | ≤ |x1 |, we also have |x2 | ≤ γ. 40 Stability and Convergence Trade-off of Iterative Optimization Algorithms √ • The two roots are equal. 1 + γ − a = 2 γ. √ x1,2 = γ < 1 By single root theorem for second order homogeneous system, We have t X√ t √ γ ≤ at = (1 + t) γ t ≤ i=0 1 √ . 1− γ Overall, we have proved a bound for at , |at | ≤ 1 √ . 1− γ We can bound bt , ct and dt similarly because they have similar recursion formular. max(|at | , |bt | , |ct | , |dt |) ≤ 1 √ . 1− γ Using the relationship between spectral norm and Frobenius norm, we have ||| t Y i=1 H|||2 ≤ 2 √ . 1− γ Appendix C. Stability Bounds for Strongly Convex Smooth Functions C.1 Gradient Descent Recall that in order to prove the uniform stability, we need bound the loss difference for any fixed sample z at each iteration t ≥ 1 l(θt , z) − l(θt0 , z) . This quantity is related to the norm difference kθt − θt0 k2 under the L-Lipschitz condition. Under α-strongly-convex case, we bound kθt − θt0 k2 slightly different than that in the convex smooth case. Using the update rule of full gradient method, we obtain an recursive relation on 2 kθt − θt0 k2 . For η ≤ α+β and t ≥ 1, we have θt − θt0 2 0 0 = θt−1 − η∇RS (θt−1 ) − θt−1 + η∇RS 0 (θt−1 ) 2 (i) η 0 0 ∇fk (θt−1 ) − ∇fk0 (θt−1 ) 2 n (ii) 2ηL 0 0 ≤ θt−1 − θt−1 − η∇RS (θt−1 ) + η∇RS (θt−1 ) 2+ n  1/2 (iii) 2αβη 2ηL 0 ≤ 1− θt−1 − θt−1 + 2 α+β n   (iv) αβη 2ηL 0 θt−1 − θt−1 (28) ≤ 1− + 2 α+β n (29) 0 0 ≤ θt−1 − θt−1 − η∇RS (θt−1 ) + η∇RS (θt−1 ) 41 2 + Yuansi Chen, Chi Jin and Bin Yu The inequality (i) uses triangular inequality. The inequality (ii) follows from the L-Lipschitz condition on the perturbed gradient terms. The inequality (iii) is obtain via the following claim, for f α-strongly convex and β-smooth, we have (∇f (x) − ∇f (y))> (x − y) ≥ αβ 1 kx − yk22 + k∇f (x) − ∇f (y)k22 . α+β α+β (30) This claim can be easily obtain by plugging f (x) − α2 kxk22 , which is a convex function into Corollary 18. The inequality (iv) uses the fact (1 − x)1/2 ≤ 1 − x1/2 , for 0 ≤ x ≤ 1. Using the recursive relation, after summing Equation (28) from 1 to T , we have i ! T −1  X 2ηL αβη θt − θt0 2 ≤ 1− n α+β i=0   ! 4L ηβ T = 1− 1− . αn 1+κ Applying the L-Lipschitz condition, we have for every z ∈ Z,  !  ηβ T 4L2 0 1− 1− . l(θT ; z) − l(θT ; z) ≤ αn 1+κ C.2 Nesterov’s Accelerated Gradient Descent According to the discussion of Equation 21, in the case of quadratic loss, the Nesterov accelerated gradient descent difference term is as follows        ∆θt+1 ∆θt (1 + γ) (Id − A) −γ (Id − A) e = + t , ∆θt Id 0 ∆θt−1 0 where √ κ−1 γ=√ , κ+1 αηId ≤ A ≤ βηId and ket k2 ≤ 2ηL n .   (1 + γ) (Id − A) −γ (Id − A) Denote G = . Then we could obtain an explicit expresId 0 sion for the difference term as follows,   Y   X   t t−1 t Y ∆θt+1 ∆θ1 et−i = Gi + Gs . (31) ∆θt ∆θ0 0 i=1 i=0 s=t−i+1 Q As in the proof of NAG in Appendix B.2, we are going to bound the spectral norm of ti=1 Gi to conclude. Following the proof idea used in Appendix B.2 and Appendix B.3, using diagonalization of thematrices A, it is sufficient to consider products of the 2 × 2 matrices  (1 + γ)h −γh H= , with 1 − βη ≤ h ≤ 1 − αη. The following lemma characterizes the 1 0 Qt spectral norm of i=1 H. 42 Stability and Convergence Trade-off of Iterative Optimization Algorithms √ √κ−1 κ+1   (1 + γ)h −γh Lemma 22 Suppose H = , where γ = 1 0 Then ||| t Y i=1 and 1 − βη ≤ h ≤ 1 − αη. H|||2 ≤ 2(1 + t) (γ(1 − αη))t/2 . Assuming Lemma 22 as given at the moment, we have ||| t Y i=1 Gi |||2 ≤ 2(1 + t) (γ(1 − αη))t/2 . We can complete the proof of Theorem 14. 2ηL k∆θt+1 k2 ≤ n = 4ηL n 2(1 + t) (γ(1 − αη))t/2 + t X i=0 t−1 X i=0 ! 2(1 + i) (γ(1 − αη))i/2 ! (1 + i) (γ(1 − αη))i/2 We have used the fact that k∆θ0 k2 = 0, k∆θ1 k2 ≤ inequality. Let p = (γ(1 − αη))1/2 and S= t X 2ηL n and ket k2 ≤ (1 + i)pi . i=0 Then (1 − p)S = t X i=0 pi − (t + 1)pt+1 ≤ 1 − pt+1 . 1−p We also have upper and lower bounds on p, √ 2 √ √ κ − 1 κ − ηβ κ − ηβ 2 √ p = γ(1 − αη) = √ · ≤ , κ κ+1 κ and p2 ≥ √ κ−1 √ κ 2 . Thus 4ηL k∆θt+1 k2 ≤ n t X i=0 ! i/2 (1 + i) (γ(1 − αη))  4ηL t+1 1 − p ≤ (1 − p)2 n   ! 4L 1 t+1 ≤ 1− 1− √ . αn κ 43 2ηL n in the first Yuansi Chen, Chi Jin and Bin Yu Together with the L-Lipschitz condition, we obtain that the heavy ball method with fixed momentum at iteration T is   ! 1 T 4L2 1− 1− √ αn κ uniform stable. Now we turn back to prove Lemma 22.   Qt at bt Proof of Lemma 22 Let i=1 H = . We are going to show by recursion that ct dt max(|at |, |bt |, |ct |, |dt |) ≤ (1 + t) (γ(1 − αη))t/2 . For t = 0, 1, the statement is easy to verify. Suppose that the statement is true until t. We have by recursion formular at+1 = ((1 + γ)hat − γhct ) ct+1 = at bt+1 = ((1 + γ)hbt − γhdt ) dt+1 = bt with initialization a1 = (1 + γ)h, b1 = −γh, c1 = 1 and d1 = 0. We remark that ai , satisfies the following second-order recursion, for i ≥ 1, ai+1 = (1 + γ)hai − γhai−1 , where a0 = 1, a1 = (1 + γ)h. We can also add a−1 = 0. The characteristic equation is x2 − (1 + γ)hx + γh = 0. The two roots are x1,2 = (1 + γ)h ± p (1 + γ)2 h2 − 4γh . 2 We verify that  2 2 ∆ = (1 + γ) h − 4γh = 4h κh − (κ − 1) √ ( κ + 1)2  ≤ 0, because h ≤ 1 − αη ≤ κ−1 κ . Hence either we have equal real roots, or we have complex roots with imaginary parts. We distinguish these two cases. 44 Stability and Convergence Trade-off of Iterative Optimization Algorithms √ • The two roots are equal. (1 + γ)h = 2 γh. Then p x1,2 = γh < 1. By single root theorem for second order homogeneous system, we have at = (1 + t) (γh)t/2 ≤ (1 + t) (γ(1 − αη))t/2 . • The two roots are distinct. |x1,2 | = p γh < 1. By distinct roots theorem for second order homogeneous system, we have at = l1 xt+1 + l2 xt+1 1 2 , where l1 and l2 are constants to be determined by the initial condition. Solving the initial condtion, we have 1 l1 = p (1 + γ)2 h2 − 4γh 1 l2 = − p . (1 + γ)2 h2 − 4γh Hence, we can bound at as follows, 1 |at | ≤ p |x1 − x2 | (1 + γ)2 h2 − 4γh ≤ t X t X i xt−i 1 x2 i=0 (γh)t/2 i=0 ≤ (1 + t) (γ(1 − αη))t/2 . We can bound bt , ct and dt similarly because they have similar recursion formular. max(|at | , |bt | , |ct | , |dt |) ≤ (1 + t) (γ(1 − αη))t/2 .. Using the relationship between spectral norm and Frobenius norm, we have ||| t Y i=1 H|||2 ≤ 2(1 + t) (γ(1 − αη))t/2 . 45
10math.ST
Panning for Gold: Model-X Knockoffs for High-dimensional Controlled Variable Selection Emmanuel Candès∗1 , Yingying Fan2 , Lucas Janson1 , and Jinchi Lv2 1 arXiv:1610.02351v4 [stat.ME] 12 Dec 2017 2 Department of Statistics, Stanford University Data Sciences and Operations Department, Marshall School of Business, USC Abstract Many contemporary large-scale applications involve building interpretable models linking a large set of potential covariates to a response in a nonlinear fashion, such as when the response is binary. Although this modeling problem has been extensively studied, it remains unclear how to effectively control the fraction of false discoveries even in high-dimensional logistic regression, not to mention general highdimensional nonlinear models. To address such a practical problem, we propose a new framework of model-X knockoffs, which reads from a different perspective the knockoff procedure (Barber and Candès, 2015) originally designed for controlling the false discovery rate in linear models. Whereas the knockoffs procedure is constrained to homoscedastic linear models with n ≥ p, the key innovation here is that model-X knockoffs provide valid inference from finite samples in settings in which the conditional distribution of the response is arbitrary and completely unknown. Furthermore, this holds no matter the number of covariates. Correct inference in such a broad setting is achieved by constructing knockoff variables probabilistically instead of geometrically. To do this, our approach requires the covariates be random (independent and identically distributed rows) with a distribution that is known, although we provide preliminary experimental evidence that our procedure is robust to unknown/estimated distributions. To our knowledge, no other procedure solves the controlled variable selection problem in such generality, but in the restricted settings where competitors exist, we demonstrate the superior power of knockoffs through simulations. Finally, we apply our procedure to data from a case-control study of Crohn’s disease in the United Kingdom, making twice as many discoveries as the original analysis of the same data. Keywords. False discovery rate (FDR), knockoff filter, testing for conditional independence in nonlinear models, generalized linear models, logistic regression, Markov blanket, genome-wide association study (GWAS) 1 Introduction 1.1 Panning for gold Certain diseases have a genetic basis, and an important biological problem is to find which genetic features (e.g., gene expressions or single nucleotide polymorphisms) are important for determining a given disease. In health care, researchers often want to know which electronic medical record entries determine future medical costs. Political scientists study which demographic or socioeconomic variables determine political opinions. Economists are similarly interested in which demographic/socioeconomic variables affect future income. Those in the technology industry seek out specific software characteristics they can change to increase user engagement. In the current data-driven science and engineering era, a list of such problems would go on and on. The common theme in all these instances is that we have a deluge of explanatory ∗ Author names are sorted alphabetically. 1 variables, often many more than the number of observations, knowing full well that the outcome we wish to understand better only actually depends on a small fraction of them. Therefore, a primary goal in modern “big data analysis” is to identify those important predictors in a sea of noise variables. Having said this, a reasonable question is why do we have so many covariates in the first place? The answer is twofold: first, because we can. To be sure, it may be fairly easy to measure thousands if not millions of attributes at the same time. For instance, it has become relatively inexpensive to genotype an individual, collecting hundreds of thousands of genetic variations at once. Second, even though we may believe that a trait or phenotype depends on a comparably small set of genetic variations, we have a priori no idea about which ones are relevant and therefore must include them all in our search for those nuggets of gold, so to speak. To further complicate matters, a common challenge in these big data problems, and a central focus of this paper, is that we often have little to no knowledge of how the outcome even depends on the few truly important variables. To cast the ubiquitous (variable) selection problem in statistical terms, call Y the random variable representing the outcome whose determining factors we are interested in, and X1 , . . . , Xp the set of p potential determining factors or explanatory variables. The object of study is the conditional distribution of the outcome Y given the covariates X = (X1 , . . . , Xp ), and we shall denote this conditional distribution function by FY |X . Ideally we would like to estimate FY |X , but in general, this is effectively impossible from a finite sample. For instance, even knowing that the conditional density depends upon 20 known covariates makes the problem impossible unless either the sample size n is astronomically large, and/or we are willing to impose a very restrictive model. However, in most problems FY |X may realistically be assumed to depend on a small fraction of the p covariates; that is, the function FY |X (y|x1 , . . . , xp ) only depends upon a small number of coordinates xi (or is well approximated by such a lower-dimensional function). Although this assumption does not magically make the estimation of FY |X easy, it does suggest consideration of the simpler problem: which of the many variables does Y depend upon? Often, finding a few of the important covariates—in other words, teasing out the relevant factors from those which are not—is already scientifically extremely useful and can be considered a first step in understanding the dependence between an outcome and some interesting variables; we regard this as a crucial problem in modern data science. 1.2 A peek at our contribution This paper addresses the selection problem by considering a very general conditional model, where the response Y can depend in an arbitrary fashion on the covariates X1 , . . . , Xp . The only restriction we place on the model is that the observations (Xi1 , . . . , Xip , Yi ) are independently and identically distributed (i.i.d.), which is often realistic in high-dimensional applications such as genetics, where subjects may be drawn randomly from some large population, or client behavioral modeling, where experiments on a service or user interface go out to a random subset of users. Therefore, the model is simply i.i.d. (Xi1 , . . . , Xip , Yi ) ∼ FXY , i = 1, . . . , n (1.1) for some arbitrary (p + 1)-dimensional joint distribution FXY . We will assume no knowledge of the conditional distribution of Y | X1 , . . . , Xp , but we do assume the joint distribution of the covariates is known, and we will denote it by FX . As a concrete example, consider a case-control experiment to determine the genetic factors which contribute to a rare disease, with diseased subjects oversampled to 50% to increase power. Then the joint distribution of features and disease status obeys the model (1.1), where FX is a 50%–50% mixture of the genetic distributions of diseased and healthy subjects, and Y is the subjects’ binary disease state. In Section 1.3 below we shall discuss the merits of this model but we would like to immediately remark on an important benefit: namely, one can pose a meaningful problem. To do this, observe that when we say that the conditional distribution of Y actually depends upon a (small) subset S ⊂ {1, . . . , p} of the variables X1 , . . . , Xp , which we would like to identify, we mean that we would like to find the “smallest” 2 subset S such that conditionally on {Xj }j∈S , Y is independent of all other variables. Another way to say this is that the other variables do not provide additional information about Y . A minimal set S with this property is usually called a Markov blanket or Markov boundary for Y in the literature on graphical models (Pearl, 1988, Section 3.2.1). Under very mild conditions about the joint distribution FXY , the Markov blanket is well defined and unique (see Section 2 for details) so that we have a cleanly stated selection problem. Note also that the Markov Blanket can be defined purely in terms of FY |X without any reference to FX , so that in our case-control example the problem is defined in exactly the same way as if FX were the true population genetic distribution instead of the oversampled mixture of diseased and healthy genetic distributions. In most problems of interest, even with the knowledge of FX , it is beyond hope to recover the blanket S with no error. Hence, we are naturally interested in procedures that control a Type I error; that is, we would like to find as many variables as possible while at the same time not having too many false positives. In this paper, we focus on controlling the false discovery rate (FDR) (Benjamini and Hochberg, 1995), which we can define here as follows: letting Ŝ be the outcome of a selection procedure operating on the sampled data (we put a hat because Ŝ is random), the FDR is FDR := E[FDP], FDP = #{j : j ∈ Ŝ \ S} #{j : j ∈ Ŝ} (1.2) with the convention 0/0 = 0. Procedures that control the FDR are interpretable, as they roughly bound what fraction of discoveries are false ones, and they can be quite powerful as well. One achievement of this paper is to show that we can design rather powerful procedures that rigorously control the FDR (1.2) in finite samples. This holds no matter the unknown relationship between the explanatory variables X and the outcome Y . We achieve this by rethinking the conceptual framework of Barber and Candès (2015), who originally introduced the knockoff procedure (throughout this paper, we will sometimes use “knockoffs” as shorthand for the knockoff framework or procedure). Their salient idea was to construct a set of so-called “knockoff” variables which were not (conditionally on the original variables) associated with the response, but whose structure mirrored that of the original covariates. These knockoff variables could then be used as controls for the real covariates, so that only real covariates which appeared to be considerably more associated with the response than their knockoff counterparts were selected. Their main result was achieving exact finite-sample FDR control in the homoscedastic Gaussian linear model when n ≥ 2p (along with a nearly-exact extension to when p ≤ n < 2p). By reading the knockoffs framework from a new perspective, the present paper places no restriction on p relative to n, in sharp constrast to the original knockoffs work which required the low-dimensional setting of n ≥ p. The conceptual difference is that the original knockoff procedure treats the Xij as fixed and relies on specific stochastic properties of the linear model, precluding consideration of p > n or nonlinear models. By treating the Xij as random and relying on that stochasticity instead, the model-X perspective allows treatment of the high-dimensional setting which is increasingly the norm in modern applications. We refer to the new approach as model-X (MX) knockoffs, and by contrast we refer to the original knockoffs approach of Barber and Candès (2015) as fixed-X (FX) knockoffs. In a nutshell: • We propose a new knockoff construction amenable to the random covariate setting (1.1). • As in Barber and Candès (2015) and further reviewed in Section 3, we shall use the knockoff variables as controls in such a way that we can tease apart important variables from noise while controlling the FDR. We place no restriction on the dimensionality of the data or the conditional distribution of Y | X1 , . . . , Xp . • We apply the new procedure to real data from a case-control study of Crohn’s disease in the United Kingdom, please see Section 7. There, we show that the new knockoff method makes twice as many discoveries as the original analysis of the same data. 3 Before turning to the presentation of our method and results, we pause to discuss the merits and limitations of our model, the relationships between this work and others on selective inference, and the larger problem of high-dimensional statistical testing. 1.3 Relationship with the classical setup for inference It may seem to the statistician that our model appears rather different from what she is used to. Our framework is, however, not as exotic as it looks. Classical setup The usual setup for inference in conditional models is to assume a strong parametric model for the response conditional on the covariates, such as a homoscedastic linear model, but to assume as little as possible about, or even condition on, the covariates. We do the exact opposite by assuming we know everything about the covariate distribution but nothing about the conditional distribution Y |X1 , . . . , Xp . Hence, we merely shift the burden of knowledge. Our philosophy is, therefore, to model X, not Y , whereas classically, Y (given X) is modeled and X is not. In practice, the parametric model in the classical approach is just an approximation, and does not need to hold exactly to produce useful inference. Analogously, we do not need to know the covariate distribution exactly for our method to be useful, as we will demonstrate in Sections 6 and 7. When are our assumptions useful? We do not claim our assumptions will always be appropriate, but there are important cases when it is reasonable to think we know much more about the covariate distribution than about the conditional distribution of the response, including: • When we in fact know exactly the covariate distribution because we control it, such as in gene knockout experiments (Cong et al., 2013; Peters et al., 2016), genetic crossing experiments (Haldane and Waddington, 1931), or sensitivity analysis of numerical models (Saltelli et al., 2008) (for example climate models). In some cases we may also essentially know the covariate distribution even when we do not control it, such as in admixture mapping (Tang et al., 2006). • When we have a large amount of unsupervised data (covariate data without corresponding responses/labels) in addition to the n labeled observations. This is not uncommon in genetic or economic studies, where many other studies will exist that have collected the same covariate information but different response variables. • When we simply have considerably more prior information about the covariates than about the response. Indeed, the point of many conditional modeling problems is to relate a poorly-understood response variable to a set of well-understood covariates. For instance, in genetic case-control studies, scientists seek to understand the genetic basis of an extremely biologically-complex disease using many comparatively simple single nucleotide polymorphisms (SNPs) as covariates. Payoff There are substantial payoffs to our framework. Perhaps the main advantage is the ability to use the knockoff framework in high dimensions, a setting that was impossible using the original approach. Even in high dimensions, previous inference results rely not only on a parametric model that is often linear and homoscedastic, but also on the sparsity or ultra-sparsity of the parameters of that model in order to achieve some asymptotic guarantee. In contrast, our framework can accommodate any model for both the response and the covariates, and our guarantees are exact in finite samples (non-asymptotic). In particular, our setup encompasses any regression, classification, or survival model, including any generalized linear model (GLM), and allows for arbitrary nonlinearities and heteroscedasticity, such as are found in many machine learning applications. 4 1.4 Relationship with work on inference after selection There is a line of work on inference after selection, or post-selection inference, for high-dimensional regression, the goal of which is to first perform selection to make the problem low-dimensional, and then produce p-values that are valid conditional on the selection step (Berk et al., 2013; Lockhart et al., 2014; Lee et al., 2016). These works differ from ours in a number of ways so that we largely see them as complementary activities. • First, our focus is on selecting the right variables, whereas the goal of this line of work is to adjust inference after some selection has taken place. In more detail, these works presuppose a selection procedure has been chosen (for reasons that may have nothing to do with controlling Type I error) and then compute p-values for the selected variables, taking into account the selection step. In contrast, MX knockoffs is by itself a selection procedure that controls Type I error. • Second, inference after selection relies heavily on parametric assumptions about the conditional distribution, namely that Y |X1 , . . . , Xp ∼ N (µ(X1 , . . . , Xp ), σ 2 ), making it unclear how to extend it to the more general setting of the present paper. • The third difference stems from their objects of inference. In the selection step, a subset of size m ≤ n of the original p covariates is selected, say Xj1 , . . . , Xjm , and the objects of inference are the coefficients of the Xjk ’s in the projection of µ onto the linear subspace spanned by the n × m matrix of observed values of these Xjk ’s. That is, the kth null hypothesis is that the aforementioned coefficient on Xjk is zero—note that whether or not inference on the jth variable is produced at all, and if it is, the object of that inference, both depend on the initial selection step. In contrast, if MX knockoffs were restricted to the homoscedastic Gaussian model above, the jth null hypothesis would be that µ does not depend on Xj , and there would be p such null hypotheses, one for each of the original variables. 1.5 Obstacles to obtaining p-values Our procedure does not follow the canonical approach to FDR control and multiple testing in general. The canonical approach is to plug p-values into the BHq procedure, which controls the FDR under p-value independence and certain forms of dependence (Benjamini and Hochberg, 1995; Benjamini and Yekutieli, 2001). Although these works have seeded a wealth of methodological innovations over the past two decades (Benjamini, 2010), all these procedures act on a set of valid p-values (or equivalent statistics), which they assume can be computed.1 The requirement of having valid p-values is quite constraining for general conditional modeling problems. 1.5.1 Regression p-value approximations In low-dimensional (n ≥ p) homoscedastic Gaussian linear regression, p-values can be computed exactly even if the error variance is unknown, although the p-values will not in general have any simple dependence properties like independence or positive regression dependency on a subset (PRDS). Already for just the slightly broader class of low-dimensional GLMs, one must resort to asymptotic p-values derived from maximum-likelihood theory, which we will show in Section 5.1 can be far from valid in practice. In high-dimensional (n < p) GLMs, it is not clear how to get p-values at all. Although some work (see 1 Benjamini and Gavrilov (2009) and Bogdan et al. (2015) transform the p-value cutoffs of common FDR-controlling procedures into penalized regression analogues to avoid p-values altogether. They only provably control the FDR in homoscedastic linear regression when the design matrix has orthogonal columns (necessitating, importantly, that n ≥ p) but the latter work empirically retains control more generally whenever the signal obeys sparsity constraints. In a very different setting with spatial hypotheses, Li et al. (2016) use approximations from Gaussian random field theory to heuristically control the FDR. 5 for example van de Geer et al. (2014)) exists on computing asymptotic p-values under strong sparsity √ assumptions (usually the number of important variables must be o( n/ log(p))), like their low-dimensional maximum-likelihood counterparts, these methods suffer from highly non-uniform null p-values in many finite-sample problems (see, for example, simulations in Dezeure et al. (2015)). For binary covariates, the causal inference literature uses matching and propensity scores for approximately valid inference, but extending these methods to high dimensions is still a topic of current research, requiring similar assumptions and asymptotic approximations to the aforementioned high-dimensional GLM literature (Athey et al., 2016). Moving beyond generalized linear models to the nonparametric setting, there exist measures of feature importance, but no p-values.2 1.5.2 Marginal testing Faced with the inability to compute p-values for hypothesis tests of conditional independence, one solution is to use marginal p-values, i.e., p-values for testing unconditional (or marginal) independence between Y and Xj . This simplifies the problem considerably, and many options exist for obtaining valid p-values for such a test. However, marginal p-values are in general invalid for testing conditional independence, and replacing tests of conditional independence with tests of unconditional independence is often undesirable. Indeed when p  n, so that classical (e.g., maximum-likelihood) inference techniques for regression give valid p-values for parametric tests of conditional independence, it would be very unusual to resort to marginal testing to select important covariates, and we cannot think of a textbook that takes this route. Furthermore, the class of conditional test statistics is far richer than that of marginal ones, and includes the most powerful statistical inference and prediction methodology available. For example, in compressed sensing, the signal recovery guarantees for state-of-the-art `1 -based (joint) algorithms are stronger than any guarantees possible with marginal methods. To constrain oneself to marginal testing is to completely ignore the vast modern literature on sparse regression that, while lacking finite-sample Type I error control, has had tremendous success establishing other useful inferential guarantees such as model selection consistency under high-dimensional asymptotics in both parametric (e.g., Lasso (Zhao and Yu, 2006; Candès and Plan, 2009)) and nonparametric (e.g., random forests (Wager and Athey, 2016)) settings. Realizing this, the statistical genetics community has worked on a number of multivariate approaches to improve power in genome-wide association studies using both penalized (Wu et al., 2009; He and Lin, 2011) and Bayesian regression (Guan and Stephens, 2011; Li et al., 2011), but both approaches still suffer from a lack of Type I error control (without making strong assumptions on parameter priors). We will see that the MX knockoff procedure is able to leverage the power of any of these techniques while adding rigorous finite-sample Type I error control when the covariate distribution is known. Some specific drawbacks of using marginal p-values are: 1. Power loss Even when the covariates are independent, so that the hypotheses of conditional and unconditional independence coincide, p-values resulting from marginal testing procedures may be less powerful than those from conditional testing procedures. This phenomenon has been reported previously, for example in statistical genetics by Hoggart et al. (2008) and many others. Intuitively, this is because a joint model in X1 , . . . , Xp for Y will have less residual variance than a marginal model in just Xj . There are exceptions, for instance if there is only one important variable, then its marginal model is the correct joint model and a conditional test will be less powerful due to the uncertainty in how the other variables are included in the joint model. But in general, marginal testing becomes increasingly underpowered relative to conditional testing as the absolute number of important covariates increases (Frommlet et al., 2012), suggesting particular advantage for conditional testing in modern applications with complex high-dimensional models. 2 In their online description of random forests (http://www.math.usu.edu/~adele/forests/), Leo Breiman and Adele Cutler propose a way to obtain a “z-score” for each variable, but without any theoretical distributional justification, and Strobl and Zeileis (2008) find “that the suggested test is not appropriate for statements of significance.” 6 There are also cases in which important variables are in fact fully marginally independent of the iid response. As a toy example, if X1 , X2 ∼ Bernoulli(0.5) and Y = 1{X1 +X2 =1} , then Y is marginally independent of each of X1 and X2 , even though together they determine Y perfectly. X1 and X2 are certainly conditionally dependent on Y , however, so a conditional test can have power to discover them. 2. Interpretability When the covariates are not independent, marginal and conditional independence do not correspond, and we end up asking the wrong question. For example, in a model with a few important covariates which determine the outcome, and many unimportant covariates which have no influence on the outcome but are correlated with the important covariates, marginal testing will treat such unimportant covariates as important. Thus, because marginal testing is testing the wrong hypotheses, there will be many “discoveries” which have no influence on the outcome. The argument is often made, especially in genetics, that although discovering an unimportant covariate just because it was correlated with an important one is technically incorrect, it can still be useful as it suggests that there is an important covariate correlated with the discovered one. While this is indeed useful, especially in genetics where correlated SNPs tend to be very close to one another on the genome, this comes at a price since it significantly alters the meaning of the FDR. Indeed, if we adopt this viewpoint, the unit of inference is no longer a SNP but, rather, a region on the genome, yet FDR is still being tested at the SNP level. A consequence of this mismatch is that the result of the analysis may be completely misleading, as beautifully argued in Pacifico et al. (2004); Benjamini and Heller (2007); Siegmund et al. (2011), see also Chouldechova (2014) and Brzyski et al. (2016) for later references. 3. Dependent p-values Marginal p-values will, in general, have quite complicated joint dependence, so that BHq does not control FDR exactly. Although procedures for controlling FDR under arbitrary dependence exist, their increased generality tends to make them considerably more conservative than BHq. In practice, however, the FDR of BHq applied to dependent p-values is usually below its nominal level, but the problem is that it can have highly variable FDP. Recall that FDR is the expectation of FDP, the latter being the random quantity we actually care about but cannot control directly. Therefore, FDR control is only useful if the realized FDP is relatively concentrated around its expectation, and it is well-established (Efron, 2010, Chapter 4) that under correlations BHq can produce highly skewed FDP distributions. In such cases, with large probability, FDP = 0 perhaps because no discoveries are made, and when discoveries are made, the FDP may be much higher than the nominal FDR, making it a misleading error bound. 1.6 Getting valid p-values via conditional randomization testing If we insist on obtaining p-values for each Xj , there is in fact a simple method when the covariate distribution is assumed known, as it is in this paper. This method is similar in spirit to both propensity scoring (where the distribution of a binary Xj conditional on the other variables is often estimated) and randomization/permutation tests (where Xj is either the only covariate or fully independent of the other explanatory variables). Explicitly, a conditional randomization test for the jth variable proceeds by first computing some feature importance statistic Tj for the jth variable. Then the null distribution of Tj can be computed through simulation by independently sampling Xj∗ ’s from the conditional distribution of Xj given the others (derived from the known FX ) and recomputing the same statistic Tj∗ with each new Xj∗ in place of Xj , see Section 4 for details. Despite its simplicity, we have not seen this test proposed previously in the literature, although it nearly matches the usual randomization test when the covariates are independent of one another. 7 1.7 Outline of the paper The remainder of the paper is structured as follows: • Section 2 frames the controlled selection problem in rigorous mathematical terms. • Section 3 introduces the model-X knockoff procedure, examines its relationship with the earlier proposal of Barber and Candès (2015), proposes knockoff constructions and feature statistics, and establishes FDR control. • Section 4 introduces the conditional randomization test. • Section 5 demonstrates through simulations that the MX knockoff procedure controls the FDR in a number of settings where no other procedure does, and that when competitors exist, knockoffs is more powerful. • Section 6 gives some preliminary simulations using artificial and real data regarding the robustness of MX knockoffs to unknown/misspecified covariate distributions. • Section 7 applies our procedure to a case-control study of Crohn’s disease in the United Kingdom. • Section 8 concludes the paper with extensions and potential lines of future research. 2 Problem statement To state the controlled variable selection problem carefully, suppose we have n i.i.d. samples from a population, each of the form (X, Y ), where X = (X1 , . . . , Xp ) ∈ Rp and Y ∈ R. If the conditional distribution of Y actually depends upon a smaller subset of these variables, we would like to classify each variable as relevant or not depending on whether it belongs to this subset or not. Mathematically speaking, we are looking for the Markov blanket S, i.e. the “smallest” subset S such that conditionally on {Xj }j∈S , Y is independent of all other variables. For almost all joint distributions of (X, Y ), there exists a unique Markov blanket but there are pathological cases where it does not. An example is this: suppose that X1 and X2 are independent Gaussian variables and that X3 = X1 − X2 . Further assume that the distribution of Y depends upon the vector X only through X1 + X2 , e.g., Y |X ∼ N (X1 + X2 , 1). Then the set of relevant variables—or equivalently, the Markov blanket—is ill defined since we can say that the likelihood of Y depends upon X through either (X1 , X2 ), (X1 , X3 ), or (X2 , X3 ), all these subsets being equally good. In order to define a unique set of relevant variables, we shall work with the notion of conditional pairwise independence. Definition 2.1. A variable Xj is said to be “null” if and only if Y is independent of Xj conditionally on the other variables X-j = {X1 , . . . Xp } \ {Xj }. The subset of null variables is denoted by H0 ⊂ {1, . . . p} and we call a variable Xj “nonnull” or relevant if j ∈ / H0 . From now on, our goal is to discover as many relevant (conditionally dependent) variables as possible while keeping the FDR under control.3 Formally, for a selection rule that selects a subset Ŝ of the covariates, " # |Ŝ ∩ H0 | FDR := E . (2.1) |Ŝ| In the example above, because of the perfect functional relationship X3 = X2 − X1 , all three variables X1 , X2 , X3 would be classified as nulls. Imagine, however, breaking this relationship by adding a bit of noise, e.g., X3 = X2 − X1 + Z, where Z is Gaussian noise (independent of X1 and X2 ) however small. 3 Using the methods of Janson and Su (2016), other error rates such as the k-familywise error rate can also be controlled using MX knockoffs, but we focus on FDR for this paper. 8 Then according to our definition, X1 and X2 are both nonnull while X3 is null—and everything makes sense. Having said this, we should not let ourselves be distracted by such subtleties. In the literature on graphical models there, in fact, exist weak regularity conditions that guarantee that the (unique) set of relevant variables defined by pairwise conditional independence, exactly coincides with the Markov blanket so that there is no ambiguity. In this field, researchers typically assume these weak regularity conditions hold (examples would include the local and global Markov properties), and proceed from there. For example, the textbook Edwards (2000) describes these properties on page 8 as holding “under quite general conditions” and then assumes them for the rest of the book. Our definition is very natural to anyone working with parametric GLMs. In a GLM, the response Y has a probability distribution taken from an exponential family, which depends upon the covariates only through the linear combination η = β1 X1 + · · · + βp Xp . The relationship between Y and X is specified via a link function g such that E (Y |X) = g −1 (η). In such models and under broad conditions, Y ⊥ ⊥ Xj | X-j if and only if βj = 0. In this context, testing the hypothesis that Xj is a null variable is the same as testing Hj : βj = 0. Proposition 2.2. Take a family of random variables X1 , . . . , Xp such that one cannot perfectly predict any one of them from knowledge of the others. If the likelihood of Y follows a GLM, then Y ⊥ ⊥ Xj | X-j if and only if βj = 0. Hence, H0 from Definition 2.1 is exactly the set {j : βj = 0}. Proof. We prove this in the case of the logistic regression model as the general case is similar. Here, the conditional distribution of Y is Bernoulli with eη E (Y |X) = P(Y = 1|X) = = g −1 (η), η = β1 X1 + · · · + βp Xp , 1 + eη and please note that the assumption about the covariates implies that the model is identifiable. Now assume first that βj = 0. Then pY,Xj |X-j (y, xj | x-j ) = pY |Xj ,X-j (y | xj , x-j ) pXj |X-j (xj | x-j ) (2.2) and since the first factor in the right-hand side does not depend on Xj , we see that the conditional probability distribution function factorizes. This implies conditional independence. In the other direction, assume that Y and Xj are conditionally independent. Then the likelihood function exp(Y (β1 X1 + · · · + βp Xp )) 1 + exp(β1 X1 + · · · + βp Xp ) must, conditionally on X-j , factorize into a function of Y times a function of Xj . A consequence of this is that conditionally on X-j , the odds ratio must not depend on Xj (it must be constant). However, this ratio is equal to exp(βj Xj ) and is constant only if βj = 0 since, by assumption, Xj is not determined by X-j . The assumption regarding the covariates is needed. Indeed, suppose X1 ∼ N (0, 1), X2 = 1{X1 > 0}, and Y follows a logistic model as above with η = X1 + X2 . Then Y ⊥ ⊥ X2 | X1 even though β2 = 1. In this example, the conditional distribution of Y depends on (X1 , X2 ) only through X1 . Therefore, for the purpose of identifying important variables (recall our task is to find important variables and not to learn exactly how the likelihood function depends upon these variables), we would like to find X1 and actually do not care about X2 since it provides no new information. 3 Methodology 3.1 3.1.1 Model-X knockoffs Definition Definition 3.1. Model-X knockoffs for the family of random variables X = (X1 , . . . , Xp ) are a new family of random variables X̃ = (X̃1 , . . . , X̃p ) constructed with the following two properties: (1) for any 9 subset S ⊂ {1, . . . , p},4 d (X, X̃)swap(S) = (X, X̃); (3.1) (2) X̃ ⊥ ⊥ Y | X if there is a response Y . (2) is guaranteed if X̃ is constructed without looking at Y . Above, the vector (X, X̃)swap(S) is obtained from (X, X̃) by swapping the entries Xj and X̃j for each j ∈ S; for example, with p = 3 and S = {2, 3}, d (X1 , X2 , X3 , X̃1 , X̃2 , X̃3 )swap({2,3}) = (X1 , X̃2 , X̃3 , X̃1 , X2 , X3 ). We see from (3.1) that original and knockoff variables are pairwise exchangeable: taking any subset of variables and swapping them with their knockoffs leaves the joint distribution invariant. Note that our exchangeability condition is on the covariates, and thus bears little resemblance to exchangeability conditions for closed permutation testing (see, e.g., Westfall and Troendle (2008)). To give an example of MX knockoffs, suppose that X ∼ N (0, Σ). Then a joint distribution obeying (3.1) is this:   Σ Σ − diag{s} (X, X̃) ∼ N (0, G), where G = ; (3.2) Σ − diag{s} Σ here, diag{s} is any diagonal matrix selected in such a way that the joint covariance matrix G is positive semidefinite. Indeed, the distribution obtained by swapping variables with their knockoffs is Gaussian with a covariance given by P GP , where P is the permutation matrix encoding the swap. Since P GP = G for any swapping operation, the distribution is invariant. For an interesting connection with the invariance condition in Barber and Candès (2015), see Appendix A. We will soon be interested in the problem of constructing knockoff variables, having observed X. In the above example, a possibility is to sample the knockoff vector X̃ from the conditional distribution d X̃ |X = N (µ, V ), where µ and V are given by classical regression formulas, namely, µ = X − XΣ−1 diag{s}, V = 2 diag{s} − diag{s}Σ−1 diag{s}. There are, of course, many other ways of constructing knockoff variables, and for the time being, we prefer to postpone the discussion of more general constructions. In the setting of the paper, we are given i.i.d. pairs (Xi1 , . . . , Xip , Yi ) ∈ Rp × R of covariates and responses, which we can assemble in a data matrix X and a data vector y in such a way that the ith row of X is (Xi1 , . . . , Xip ) and the ith entry of y is Yi . Then the MX knockoff matrix X̃ is constructed in such a way that for each observation label i, (X̃i1 , . . . , X̃ip ) is a knockoff for (Xi1 , . . . , Xip ) as explained above; that is to say, the joint vector (Xi1 , . . . , Xip , X̃i1 , . . . , X̃ip ) obeys the pairwise exchangeability property (3.1). 3.1.2 Exchangeability of null covariates and their knockoffs A crucial property of MX knockoffs is that we can swap null covariates with their knockoffs without changing the joint distribution of the original covariates X and their knockoffs X̃, conditional on the response Y . From now on, Xi:j for i ≤ j is a shorthand for (Xi , . . . , Xj ). Lemma 3.2. Take any subset S ⊂ H0 of nulls. Then d [X, X̃] | y = [X, X̃]swap(S) | y. 4 d = denotes equality in distribution, and the definition of the swapping operation is given just below. 10 Proof. Since y’s marginal distribution is the same on both sides of the equation, it is equivalent to show d that ([X, X̃], y) = ([X, X̃]swap(S) , y), which is how we proceed. Assume without loss of generality that d S = {1, 2, . . . , m}. By row independence, it suffices to show that ((X, X̃), Y ) = ((X, X̃)swap(S) , Y ), where d X (resp. Y ) is a row of X (resp. y). Furthermore, since (X, X̃) = (X, X̃)swap(S) , we only need to establish that d Y | (X, X̃)swap(S) = Y | (X, X̃). (3.3) Letting pY |X (y|x) be the conditional distribution of Y , observe that pY |(X,X̃)swap(S) (y|(x, x̃)) = pY |(X,X̃) (y|(x, x̃)swap(S) ) = pY |X (y|x0 ), where x0i = x̃i if i ∈ S and x0i = xi otherwise. The second equality above comes from the fact that Y is conditionally independent of X̃ by property (2) in the definition of MX knockoffs. Next, since Y and X1 are independent conditional on X2:p , we have pY |X1:p (y|x̃1 , x02:p ) = pY |X2:p (y|x02:p ) = pY |X1:p (y|x1 , x02:p ). This shows that d Y | (X, X̃)swap(S) = Y | (X, X̃)swap(S\{1}) . We can repeat this argument with the second variable, the third, and so on until S is empty. This proves (3.3). 3.2 Feature statistics In order to find the relevant variables, we now compute statistics Wj for each j ∈ {1, . . . , p}, a large positive value of Wj providing evidence against the hypothesis that Xj is null. This statistic depends on the response and the original variables but also on the knockoffs; that is, Wj = wj ([X, X̃], y) for some function wj . As in Barber and Candès (2015), we impose a flip-sign property, which says that swapping the jth variable with its knockoff has the effect of changing the sign of Wj . Formally, if [X, X̃]swap(S) is the matrix obtained by swapping columns in S, ( wj ([X, X̃], y), j 6∈ S, wj ([X, X̃]swap(S) , y) = (3.4) −wj ([X, X̃], y), j ∈ S. In contrast to the aforementioned work, we do not require the sufficiency property that wj depend on X, X̃, and y only through [X, X̃]> [X, X̃] and [X, X̃]> y. At this point, it may help the reader unfamiliar with the knockoff framework to think about knockoff statistics W = (W1 , . . . , Wp ) in two steps: first, consider a statistic T for each original and knockoff variable, T , (Z, Z̃) = (Z1 , . . . , Zp , Z̃1 , . . . , Z̃p ) = t([X, X̃], y), with the idea that Zj (resp. Z̃j ) measures the importance of Xj (resp. X̃j ). Assume the natural property that switching a variable with its knockoff simply switches the components of T in the same way, namely, for each S ⊂ {1, . . . , p}, (Z, Z̃)swap(S) = t([X, X̃]swap(S) , y). (3.5) 11 Then one can construct a Wj obeying the flip-sign condition (3.4) by setting Wj = fj (Zj , Z̃j ), where fj is any anti-symmetric function.5 (Conversely, any statistic Wj verifying the flip sign condition can be constructed in this fashion.) Adopting this approach, consider a regression problem and run the Lasso on the original design augmented with knockoffs, minb∈R2p 1 2 ky − [X, X̃]bk22 + λkbk1 (3.6) and denote the solution by b̂(λ) (the first p components are the coefficients of the original variables and the last p are for the knockoffs). Then the Lasso coefficient-difference (LCD) statistic sets Zj = |b̂j (λ)|, Z̃j = |b̂j+p (λ)|, and Wj = Zj − Z̃j = |b̂j (λ)| − |b̂j+p (λ)|. (3.7) A large positive value of Wj provides some evidence that the distribution of Y depends upon Xj , whereas under the null Wj has a symmetric distribution and, therefore, is equally likely to take on positive and negative values, as we shall see next. Before moving on, however, please carefully observe that the value of λ in (3.7) does not need to be fixed in advance, and can be computed from y and [X, X̃] in any datadependent fashion as long as permuting the columns of X does not change its value; for instance, it can be selected by cross-validation. Lemma 3.3. Conditional on (|W1 |, . . . , |Wp |), the signs of the null Wj ’s, j ∈ H0 , are i.i.d. coin flips. Proof. Let  = (1 , . . . , p ) be a sequence of independent random variables such that j = ±1 with probability 1/2 if j ∈ H0 , and j = 1 otherwise. To prove the claim, it suffices to establish that d W = W, (3.8) where denotes pointwise multiplication, i.e.  W = (1 W1 , . . . , p Wp ). Now, take  as above and put S = {j : j = −1} ⊂ H0 . Consider swapping variables in S: Wswap(S) , w([X, X̃]swap(S) , y). On the one hand, it follows from the flip-sign property that Wswap(S) =  W . On the other hand, Lemma d 3.2 implies that Wswap(S) = W since S ⊂ H0 . These last two properties give (3.8). In fact, since the pairwise exchangeability property of [X, X̃] holds conditionally on y according to Lemma 3.2, the coin-flipping property also holds conditionally on y. 3.3 FDR control From now on, our methodology follows that of Barber and Candès (2015) and we simply rehearse the main ingredients while referring to their paper for additional insights. It follows from Lemma 3.3 that the null statistics Wj are symmetric and that for any fixed threshold t > 0, d #{j : Wj ≤ −t} ≥ #{null j : Wj ≤ −t} = #{null j : Wj ≥ t}. Imagine then selecting those variables such that Wj is sufficiently large, e.g., Wj ≥ t, then the false discovery proportion (FDP) #{null j : Wj ≥ t} FDP(t) = (3.9) #{j : Wj ≥ t} 5 An anti-symmetric function f is such that f (v, u) = −f (u, v). 12 can be estimated via the statistic #{j : Wj ≤ −t} [ FDP(t) = #{j : Wj ≥ t} since the numerator is an upward-biased estimate of the unknown numerator in (3.9). The idea of the knockoff procedure is to choose a data-dependent threshold as liberal as possible while having an estimate of the FDP under control. The theorem below shows that estimates of the FDR process can be inverted to give tight FDR control. Theorem 3.4. Choose a threshold τ > 0 by setting6   #{j : Wj ≤ −t} τ = min t > 0 : ≤q #{j : Wj ≥ t} (Knockoffs), (3.10) where q is the target FDR level (or τ = +∞ if the set above is empty). Then the procedure selecting the variables Ŝ = {j : Wj ≥ τ } controls the modified FDR defined as " mFDR = E |{j ∈ Ŝ ∩ H0 }| # |Ŝ| + 1/q ≤ q. The slightly more conservative procedure, given by incrementing the number of negatives by one,   1 + #{j : Wj ≤ −t} τ+ = min t > 0 : ≤q (Knockoffs+) #{j : Wj ≥ t} (3.11) and setting Ŝ = {j : Wj ≥ τ+ }, controls the usual FDR, # " |{j ∈ Ŝ ∩ H0 }| ≤ q. E |Ŝ| ∨ 1 These results are non-asymptotic and hold no matter the dependence between the response and the covariates—in fact, they hold conditionally on the response y. The proof is the same as that of Theorems 1 and 2 in Barber and Candès (2015)—and, therefore, omitted—since all we need is that the null statistics have signs distributed as i.i.d. coin flips (even conditionally on y). Note that Theorem 3.4 only tells one side of the story: Type I error control; the other very important side is power, which leads us to spend most of the remainder of the paper considering how best to construct knockoff variables and statistics. 3.4 3.4.1 Constructing model-X knockoffs Exact constructions We have seen in Section 3.1.1 one way of constructing MX knockoffs in the case where the covariates are Gaussian. How should we proceed for non-Gaussian data? In this regard, the characterization below may be useful. Proposition 3.5. The random variables (X̃1 , . . . , X̃p ) are model-X knockoffs for (X1 , . . . , Xp ) if and only if for any j ∈ {1, . . . , p}, the pair (Xj , X̃j ) is exchangeable conditional on all the other variables and their knockoffs (and, of course, X̃ ⊥ ⊥ Y | X). 6 When we write min{t > 0 : . . .}, we abuse notation since we actually mean min{t ∈ W+ : . . .}, where W+ = {|Wj | : |Wj | > 0}. 13 The proof consists of simple manipulations of the definition and is, therefore, omitted. Our problem can thus also be posed as constructing pairs that are conditionally exchangeable. If the components of the vector X are independent, then any independent copy of X would work; that is, any vector X̃ independently sampled from the same joint distribution as X would work. With dependent coordinates, we may proceed as follows: Algorithm 1 Sequential Conditional Independent Pairs. j = 1 while j ≤ p do Sample X̃j from L(Xj | X-j , X̃1:j−1 ) j =j+1 end Above, L(Xj | X-j , X̃1:j−1 ) is the conditional distribution of Xj given (X-j , X̃1:j−1 ). When p = 3, this would work as follows: sample X̃1 from L(X1 | X2:3 ). Once this is done, L(X1:3 , X̃1 ) is available and we, therefore, know L(X2 | X1 , X3 , X̃1 ). Hence, we can sample X̃2 from this distribution. Continuing, L(X1:3 , X̃1:2 ) becomes known and we can sample X̃3 from L(X3 | X1:2 , X̃1:2 ). It is not immediately clear why Algorithm 1 yields a sequence of random variables obeying the exchangeability property (3.1), and we prove this fact in Appendix B. There is, of course, nothing special about the ordering in which knockoffs are created and equally valid constructions may be obtained by looping through an arbitrary ordering of the variables. For example, in a data analysis application where we would need to build a knockoff copy for each row of the design, independent (random) orderings may be used. To have power or, equivalently, to have a low Type II error rate, it is intuitive that we would like to have original features Xj and their knockoff companions X̃j to be as “independent” as possible. We do not mean to imply that running Algorithm 1 is a simple matter. In fact, it may prove rather complicated since we would have to recompute the conditional distribution at each step; this problem is left for future research. Instead, in this paper we shall work with approximate MX knockoffs and will demonstrate empirically that for models of interest, such constructions yield FDR control. 3.4.2 Approximate constructions: second-order model-X knockoffs Rather than asking that (X, X̃)swap(S) and (X, X̃) have the same distribution for any subset S, we can ask that they have the same first two moments, i.e., the same mean and covariance. Equality of means is a simple matter. As far as the covariances are concerned, equality is equivalent to   Σ Σ − diag{s} cov(X, X̃) = G, where G = . (3.12) Σ − diag{s} Σ We, of course, recognize the same form as in (3.2) where the parameter s is chosen to yield a positive semidefinite covariance matrix. (When (X, X̃) is Gaussian, a matching of the first two moments implies a matching of the joint distributions so that we have an exact construction.) Furthermore, Appendix A shows that the same problem was already solved in Barber and Candès (2015), as the same constraint on s applies but with the empirical covariance replacing the true covariance. This means that the same two constructions proposed in Barber and Candès (2015) are just as applicable to second-order model-X knockoffs. For the remainder of this section, we will assume the covariates have each been translated and rescaled to have mean zero and variance one. To review, the equicorrelated construction uses sEQ = 2λmin (Σ) ∧ 1 for all j, j which minimizes the correlation between variable-knockoff pairs subject to the constraint that all such pairs must have the same correlation. The semidefinite program (SDP) construction solves the convex 14 program minimize subject to SDP | j |1 − sj SDP sj ≥0 diag{sSDP }  P (3.13) 2Σ, which minimizes the sum of absolute values of variable-knockoff correlations among all suitable s. In applying these constructions to problems with large p, we run into some new difficulties: • Excepting very specially-structured matrices like the identity, λmin (Σ) tends to be extremely small as p gets large. The result is that constructing equicorrelated knockoffs in high dimensions, while fairly computationally easy, will result in very low power, since all the original variables will be nearly indistinguishable from their knockoff counterparts. • For large p, (3.13), while convex, is prohibitively computationally expensive. However, if it could be computed, it would produce much larger sj ’s than the equicorrelated construction and thus be considerably more powerful. To address these difficulties, we first generalize the two knockoff constructions by the following two-step procedure, which we call the approximate semidefinite program (ASDP) construction: Step 1. Choose an approximation Σapprox of Σ and solve: P minimize j |1 − ŝj | subject to ŝj ≥ 0 diag{ŝ}  2Σapprox . (3.14) Step 2. Solve: maximize subject to γ diag{γŝ}  2Σ, (3.15) and set sASDP = γŝ. Note this problem can be solved quickly by, e.g., bisection search over γ ∈ [0, 1]. ASDP with Σapprox = I trivially gives ŝj = 1 and γ = 2λmin (Σ) ∧ 1, reproducing the equicorrelated construction. ASDP with Σapprox = Σ clearly gives ŝj = sSDP and γ = 1, reproducing the SDP construction. Note that the ASDP step 2 is always fast, so the speed of the equicorrelated construction comes largely because the problem separates into p computationally independent SDP subproblems of min|1 − ŝj | s.t. 0 ≤ ŝj ≤ 2. However, power is lost due to the very naı̈ve approximation Σapprox = I which results in a very small γ. In general, we can choose Σapprox to be an m-block-diagonal approximation of Σ, so that the ASDP from Step 1 separates into m smaller, more computationally tractable, and trivially parallelizable SDP subproblems. If the approximation is fairly accurate, we may also find that γ remains large, so that the knockoffs are nearly as powerful as if we had used the SDP construction. We demonstrate the ASDP construction in Section 7 when we analyze the Crohn’s disease data. 4 The conditional randomization test This section presents an alternative approach to the controlled variable selection problem. To describe our approach, it may be best to consider an example. Assume we are in a regression setting and let b̂j (λ) be the value of the Lasso estimate of the jth regression coefficient. We would like to use the statistic b̂j (λ) to test whether Y is conditionally independent of Xj since large values of |b̂j (λ)| provide evidence against the null. To construct a test, however, we would need to know the sampling distribution of b̂j (λ) under the null hypothesis that Y and Xj are conditionally independent, and it is quite unclear how one would obtain such knowledge. 15 Algorithm 2 Conditional Randomization Test. Input: A set of n independent samples (Xi1 , . . . , Xip , Yi )1≤i≤n assembled in a data matrix X and a response vector y, a feature importance statistic Tj (X, y) to test whether Xj and Y are conditionally independent. Loop: for k = 1, 2, . . . , K do Create a new data matrix X (k) by simulating the jth column of X from L(Xj |X-j ) (and keeping the (k) remaining columns the same). That is, Xij is sampled from the conditional distribution Xij | {Xi1 , . . . , Xip } \ {Xij }, and is (conditionally) independent of Xij . Output: A (one-sided) p-value " # K X 1 Pj = 1+ 1Tj (X (k) ,y)≥Tj (X,y) . K +1 k=1 As with permutation tests, adding one in both the numerator and the denominator makes sure that the null p-values are stochastically larger than uniform variables. 4.1 The test A way out is to sample the covariate Xj conditional on all the other covariates (but not the response), where by “sample” we explicitly mean to draw a new sample from the conditional distribution of Xj | X-j using a random number generator. We then compute the Lasso statistic b̂∗j (λ), where the ∗ superscript indicates that the statistic is computed from the artificially sampled value of the covariate Xj . Now, under the null hypothesis of conditional independence between Y and Xj , it happens that b̂∗j (λ) and b̂j (λ) are identically distributed and that, furthermore, this statement holds true conditional on Y and all the other covariates. This claim is proved in Lemma 4.1 below. A consequence of this is that by simulating a covariate conditional on the others, we can sample at will from the conditional distribution of any test statistic and compute p-values as described in Algorithm 2. Lemma 4.1. Let (Z1 , Z2 , Y ) be a triple of random variables, and construct another triple (Z1∗ , Z2 , Y ) as d Z1∗ | (Z2 , Y ) = Z1 | Z2 . Then under the null hypothesis Y ⊥ ⊥ Z1 | Z2 , any test statistic T = t(Z1 , Z2 , Y ) obeys T | (Z2 , Y ) d = T ∗ | (Z2 , Y ), where T ∗ = t(Z1∗ , Z2 , Y ). Proof. To prove the claim, it suffices to show that Z1 and Z1∗ have the same distribution conditionally on (Z2 , Y ). This follows from Z1∗ | (Y, Z2 ) d = Z1 | Z2 d = Z1 | (Z2 , Y ). The first equality comes from the definition of Z1∗ while the second follows from the conditional independence of Y and Z1 , which holds under the null. The consequence of Lemma 4.1 is that we can compute the 95% percentile, say, of the conditional distribution of T ∗ denoted by t∗0.95 (Z2 , Y ). Then by definition, under the null, P(T > t∗0.95 (Z2 , Y ) | (Z2 , Y )) ≤ 0.05. Since this equality holds conditionally, it also holds marginally. 16 4.2 Literature review The conditional randomization test is most closely related to the propensity score (Rosenbaum and Rubin, 1983), which also uses the conditional distribution Xj | X-j to perform inference on the conditional relationship between Y and Xj given X-j . However, propensity scores require Xj be binary, and the propensity score itself is normally estimated, although Rosenbaum (1984) shows that when all the covariates jointly take a small number of discrete values, propensity score analysis can be done exactly. Doran et al. (2014) also rely on the data containing repeated observations of X-j so that certain observations can be permuted nonparametrically while maintaining the null distribution. In fact, the exact term “conditional randomization test” has also been used in randomized controlled experiments to test for independence of Y and Xj conditioned more generally on some function of X-j (such as a measure of imbalance in X-j if Xj is binary), again relying on discreteness of the function so that there exist permutations of Xj which leave the function value unchanged. Despite the similar name, our conditional randomization test is quite distinct from these, as it does not rely on discreteness or experimental control in any of the covariates. Another line of work exists within the linear model regime, whereby the null (without Xj ) model is estimated and then the empirical residuals are permuted to produce a null distribution for Y (Freedman and Lane, 1983). Because this approach is only exact when the empirical residuals match the true residuals, it explicitly relies on a parametric model for Y | X-j , as well as the ability to estimate it quite accurately. 4.3 Comparisons with knockoffs One major limitation of the conditional randomization method is its computational cost. It requires computing randomization p-values for many covariates and to a high-enough resolution for multiplecomparisons correction. Clearly, this requires samples in the extreme tail of the p-value distribution. This means computing a very large number of feature importance statistics Tj , each of which can be expensive since for reasons outlined in the drawbacks associated with marginal testing, powerful Tj ’s will take into account the full dimensionality of the model, e.g., absolute value of the Lasso-estimated coefficient. In fact, the number of computations of Tj , tallied over all j, required by the conditional randomization method is Ω(p).7 To see this, suppose for simplicity that all R rejected p-values take on the value of half the BHq cutoff equal to τ = qR/p, and all we need to do is upper-bound them below τ . This means there are R p-values Pj for which plugging K = ∞ into Algorithm 2 would yield Pj = τ /2. After K < ∞ samples, the approximate p-value (ignoring the +1 correction) is distributed as K −1 Bin(K, Pj ). We could then use this binomial count to construct a confidence interval for Pj . A simple calculation shows that to be reasonably confident that Pj ≤ τ , K must be on the order of at least 1/τ . Since there are R such p-values, this justifies the claim. Note that for knockoffs, the analogous computation of T need only be done exactly once. If, for instance, each Tj requires a Lasso computation, then the conditional randomization test’s computational burden is very challenging for medium-scale p in the thousands and prohibitive for large-scale (e.g., genetics) p in the hundreds of thousands or millions. We will see in Section 5.3.1 that there are power gains, along with huge computational costs, to be had by using conditional randomization in place of knockoffs, and Section 7 will show that the MX knockoff procedure easily scales to large data sets. Another advantage of MX knockoffs is its guaranteed control of the FDR, whereas the BHq procedure does not offer strict control when applied to arbitrarily dependent p-values. 5 Numerical simulations In this section we demonstrate the importance, utility, and practicality of MX knockoffs for high-dimensional nonparametric conditional modeling. 7 a(N ) ∈ Ω(b(N )) means that there exist N0 and C > 0 such that a(N ) ≥ Cb(N ) for N ≥ N0 . 17 20 Nonzero Coefficients, AR(1) Design 2000 1500 1500 count count Global Null, AR(1) Design 2000 1000 500 1000 500 0 0 0.00 0.25 0.50 0.75 1.00 0.00 0.25 P−Values 0.50 0.75 1.00 P−Values Figure 1: Distribution of null logistic regression p-values with n = 500 and p = 200; 10,000 replications. 5.1 Logistic regression p-values Asymptotic maximum likelihood theory promises valid p-values for each coefficient in a GLM only when n  p. However, these approximate p-values can usually be computed as long as n > p, so a natural question arising from high-dimensional applications is whether such asymptotic p-values are valid when n and p are both large with p/n ≥ 0.1, for example. We simulated 104 independent design matrices (n = 500, p = 200) and binary responses from a logistic regression for the following two settings: (1) (X1 , . . . , Xp ) is an AR(1) time series with AR coefficient 0.5 and Y | X1 , . . . , Xp ∼ Bernoulli(0.5) (2) (X1 , . . . , Xp ) is an AR(1) time series with AR coefficient 0.5 and Y | X1 , . . . , Xp ∼ Bernoulli (logit (0.08(X2 + · · · + X21 ))) Histograms for the p-values for β1 (null in all cases) are shown in Figure 1. Both histograms are far from uniform, and Table 1 shows each distribution’s concentration near zero. We see that the small quantiles have extremely inflated probabilities—over 20 times nominal for P {p-value ≤ 0.1%} in setting (2). We also see that the exact null distribution depends on the unknown coefficient sequence β2 , . . . , βp , since the probabilities between settings differ statistically significantly at all three cutoffs. To confirm that this non-uniformity is not just a finite-sample effect, we also simulated 104 i.i.d. N (0, 1) design matrices with independent Bernoulli(0.5) responses for n = 500, p = 200 and n = 5000, p = 2000 as settings (3) and (4), respectively. Table 1 shows that the distribution does not really change as n and p are increased with constant proportion. P {p-value ≤ 5%} P {p-value ≤ 1%} P {p-value ≤ 0.1%} (1) 16.89% (0.37%) 6.78% (0.25%) 1.53% (0.12%) (2) 19.17% (0.39%) 8.49% (0.28%) 2.27% (0.15%) (3) 16.88% (0.37%) 7.02% (0.26%) 1.87% (0.14%) (4) 16.78% (0.37%) 7.03% (0.26%) 2.04% (0.14%) Table 1: Inflated p-value probabilities with estimated Monte Carlo standard errors in parentheses. See text for meanings of settings (1), (2), (3), (4). These results show that the usual logistic regression p-values one might use when n ≥ p can have null distributions that are quite far from uniform, and even if one wanted to correct that distribution, it depends in general on unknown problem parameters, further complicating matters. When n < p the problem becomes even more challenging, with existing methods similarly asymptotic as well as requiring stringent sparsity assumptions (van de Geer et al., 2014). Thus, despite the wealth of research on controlling FDR, without a way to obtain valid p-values, even the problem of controlling FDR in medium-to-highdimensional GLMs remains unsolved. 18 5.2 Alternative knockoff statistics As mentioned in Section 3.2, the new model-X knockoffs framework allows for a wider variety of W statistics to be used than in the fixed-X framework. Choices of Zj include well-studied statistical measures such as the coefficient estimated in a GLM, but can also include much more ad-hoc/heuristic measures such as random forest bagging feature importances or sensitivity analysis measures such as the Monte-Carloestimated total sensitivity index. By providing variable selection with rigorous Type I error control for general models and statistics, knockoffs can be used to improve the interpretability of complex black-box supervised/machine learning models. There are also many available choices for the anti-symmetric function fj , such as |Zj | − |Z̃j |, sign(|Zj | − |Z̃j |) max{|Zj |, |Z̃j |}, or log(|Zj |) − log(|Z̃j |). The main point of this subsection is that knockoffs can be used as a wrapper around essentially any data-fitting or prediction algorithm, and regardless of the chosen algorithm still provides rigorous error control for variable selection. We discuss here a few appealing new options for statistics W , but defer full exploration of these very extensive possibilities to future work. 5.2.1 Adaptive knockoff statistics The default statistic suggested in Barber and Candès (2015) is the Lasso Signed Max (LSM), which corresponds to Zj being the largest penalty parameter at which the jth variable enters the model in the Lasso regression of y on [X, X̃], and fj = sign(|Zj | − |Z̃j |) max{|Zj |, |Z̃j |}. In addition to the LSM statistic, Barber and Candès (2015) suggested alternatives such as the difference in absolute values of estimated coefficients for a variable and its knockoff: Wj = |b̂j | − |b̂j+p |, where the b̂j , b̂j+p are estimated so that W obeys the sufficiency property required by the FX knockoff procedure, e.g., by ordinary least squares or the Lasso with a pre-specified tuning parameter. The removal of the sufficiency requirement for MX knockoffs allows us to improve this class of statistics by adaptively tuning the fitted model. The simplest example is the LCD statistic introduced in Section 3.2, which uses cross-validation to choose the tuning parameter in the Lasso. Note the LCD statistic can be easily extended to any GLM by replacing the first term in (3.6) by a non-Gaussian negative log-likelihood, such as in logistic regression; we will refer to all such statistics generically as LCD. The key is that the tuning and cross-validation is done on the augmented design matrix [X, X̃], so that W still obeys the flip-sign property. More generally, MX knockoffs allows us to construct statistics that are highly adaptive to the data, as long as that adaptivity does not distinguish between original and knockoff variables. For instance, we could compute the cross-validated error of the ordinary Lasso (still of y on [X, X̃]) and compare it to that of a random forest, and choose Z to be a feature importance measure derived from whichever one has smaller error. Since the Lasso works best when the true model is close to linear, while random forests work best in non-smooth models, this approach gives us high-level adaptivity to the model smoothness, while the MX knockoff framework ensures strict Type I error control. Returning to the simpler example of adaptivity, we found the LCD statistic to be uniformly more powerful than the LSM statistic across a wide range of simulations (linear and binomial GLMs, ranging covariate dependence, effect size, sparsity, sample size, total number of variables), particularly under covariate dependence. We note, however, the importance of choosing the penalty parameter that minimizes the cross-validated error, as opposed to the default in some computational packages of using the “one standard error” rule, as the latter causes LCD to be underpowered compared to LSM in low-power settings. Figure 2 shows a simulation with n = 3000, p = 1000 of a binomial linear model (with statistics computed from Lasso logistic regression) that is representative of the power difference between the two statistics. In all our simulations, unless otherwise specified, MX knockoffs is always run using the LCD statistic. Explicitly, when the response variable is continuous, we use the standard Lasso with Gaussian linear model likelihood, and when the response is binary, we use Lasso-penalized logistic regression. 19 1.00 0.75 0.75 FDR Power 1.00 0.50 0.25 Methods LCD Stat. LSM Stat. 0.00 0.0 0.2 0.50 0.25 0.00 0.4 0.6 0.8 0.0 0.2 Autocorrelation Coefficient 0.4 0.6 0.8 Autocorrelation Coefficient 1.00 1.00 0.75 0.75 FDR Power Figure 2: Power and FDR (target is 10%) for knockoffs with the LCD and LSM statistics. The design matrix has i.i.d. rows and AR(1) columns with autocorrelation coefficient specified by the x-axes of the plots, and marginally each Xj ∼ N (0, 1/n). Here, n = 3000, p = 1000, and y comes from a binomial linear model with logit link function with 60 nonzero regression coefficients of magnitude 3.5 and random signs. Each point represents 200 replications. 0.50 0.25 0.25 Methods BVS Stat. LCD Stat. 0.00 5 10 0.50 0.00 15 5 Amplitude 10 15 Amplitude Figure 3: Power and FDR (target is 10%) for knockoffs with the LCD and BVS statistics. The design matrix is i.i.d. N (0, 1/n), n = 300, p = 1000, and y comes from a Gaussian linear model with β and the noise variance randomly chosen (see Appendix C for the precise model). Here, the nonzero entries of β are Gaussian with mean zero and standard deviation given on the x-axis; the expected number of nonzero components is 60; the expected variance of the noise is 1. Each point represents 200 replications. 5.2.2 Bayesian knockoff statistics Another very interesting source of knockoff statistics comes from Bayesian procedures. If a statistician has prior knowledge about the problem, he or she can encode it in a Bayesian model and use the resulting estimators to construct a statistic (e.g., difference of absolute posterior mean coefficients, or difference or log ratio of posterior probabilities of nonzero coefficients with a sparse prior). What makes this especially appealing is that the statistician gets the power advantages of incorporating prior information, while maintaining a strict frequentist guarantee on the Type I error, even if the prior is false! As an example, we ran knockoffs in an experiment with a Bayesian hierarchical regression model with n = 300, p = 1000, and E (kβk0 ) = 60 (k · k0 denotes the `0 norm, or the number of nonzero entries in a vector); see Appendix C for details. We chose a simple canonical model with Gaussian response to demonstrate our point, but the same principle applies to more complex, nonlinear, and non-Gaussian Bayesian models as well. The statistics we used were the LCD and a Bayesian variable selection (BVS) statistic, namely Zj − Z̃j where Zj and Z̃j are the posterior probabilities that the jth original and knockoff coefficients are nonzero, respectively (George and McCulloch, 1997); again see Appendix C for details. Figure 3 shows that the accurate prior information supplied to the Bayesian knockoff statistic gives it improved power over LCD which lacks such information, but that they have the same FDR control (and they would even if the prior information were incorrect). 20 5.3 Alternative procedures To assess the relative power of knockoffs, we compare to a number of alternatives in settings in which they are valid: 1. The FX knockoff procedure with settings recommended in Barber and Candès (2015). This method can only be applied in homoscedastic Gaussian linear regression when n ≥ p. 2. BHq applied to asymptotic GLM p-values. This method can only be applied when n ≥ p, and although for linear regression exact p-values can be computed (when the MLE exists), for any other GLM these p-values can be far from valid unless n  p, as shown in Section 5.1. 3. BHq applied to marginal test p-values. The correlation between the response and each covariate is computed and compared to its null distribution, which under certain Gaussian assumptions is closed-form, but in general can at least be simulated exactly by conditioning on y and using the known marginal distribution of Xj . Although these tests are valid for testing hypotheses of marginal independence (regardless of n and p), such hypotheses only agree with the desired conditional independence hypotheses when the covariates are exactly independent of one another. 4. BHq applied to the p-values from the conditional randomization test described in Section 1.6 and Section 4. Note that we are using knockoffs, not knockoffs+, in all simulations, and thus we are technically controlling a slightly modified version of FDR. The FDR is nevertheless effectively controlled in all simulations except in extremely low-power settings, and even then the violations are small. We could have sacrificed a small amount of power and used knockoffs+ (both MX and FX) for exact FDR control, but then a more fair comparison in settings 2–4 would replace BHq with the conservative procedure in Benjamini and Yekutieli (2001), since the joint distribution of the p-values will not in general satisfy the assumptions for BHq to control the FDR exactly. However that conservative procedure had extremely noncompetitive power, so we prefer instead to compare knockoffs and regular BHq, which are more powerful and still effectively control the FDR. 5.3.1 Comparison with conditional randomization We start by comparing MX knockoffs with procedure 4, BHq applied to conditional randomization test p-values, for computational reasons. We simulated n = 400 i.i.d. rows of p = 600 AR(1) covariates with autocorrelation 0.3, and response following a logistic regression model with 40 nonzero coefficients of random signs. Figure 4 shows the power and FDR curves as the coefficient amplitude was varied. We see that the conditional randomization test gives higher power with similar FDR control, but this comes at a hugely increased computational cost. This simulation has considerably smaller n and p than any other simulation in the paper, and we still had to apply a number of computational speed-ups/shortcuts, described in Appendix D, to keep the computation time within reason. With these speed-ups, Figure 4 took roughly three years of serial computation time, while the MX knockoffs component took only about six hours, or about 5000 times less (all computation was run in Matlab 2015b, and both methods used glmnet to compute statistics). Because of the heavy computational burden, we were unable to include the conditional randomization test in our further, larger simulations—we show in Section 4.3 that the number of Tj computations scales optimistically linearly in p. To summarize, conditional randomization testing appears somewhat more powerful than MX knockoffs, but is computationally infeasible for large data sets (like that in Section 7). 5.3.2 Effect of signal amplitude Our first simulation comparing MX knockoffs to procedures 1–3 is by necessity in a Gaussian linear model with n > p and independent covariates—the only setting in which all procedures approximately control 21 1.00 0.75 0.75 FDR Power 1.00 0.50 0.25 0.25 Methods 0.00 10 20 30 0.50 BHq CRT MX Knockoffs 40 0.00 10 Amplitude 20 30 40 Amplitude Figure 4: Power and FDR (target is 10%) for MX knockoffs and BHq applied to conditional randomization test p-values. The design matrix has i.i.d. rows and AR(1) columns with autocorrelation 0.3, n = 400, p = 600, and y comes from a binomial linear model with logit link function with kβk0 = 40, and all nonzero entries of β having equal magnitudes and random signs; each point represents 200 replications. the FDR. Specifically, the left side of Figure 5 plots the power and FDR for the four procedures when i.i.d. Xij ∼ N (0, 1/n), n = 3000, p = 1000, kβk0 = 60, the noise variance σ 2 = 1, and the nonzero entries of β have random signs and equal magnitudes, varied along the x-axis. All methods indeed control the FDR, and MX knockoffs is the most powerful, with as much as 10% higher power than its nearest alternative. The right side of Figure 5 shows the same setup but in high dimensions: p = 6000. In the high-dimensional regime, neither maximum likelihood p-values nor FX knockoffs can even be computed, and the MX knockoff procedure has considerably higher power than BHq applied to marginal p-values. Next we move beyond the Gaussian linear model to a binomial linear model with logit link function, precluding the use of the original knockoff procedure. Figure 6 shows the same simulations as Figure 5 but with Y following the binomial model. The results are similar to those for the Gaussian linear model, except that BHq applied to the asymptotic maximum likelihood p-values now has an FDR above 50% (rendering its high power meaningless), which can be understood as a manifestation of the phenomenon from Section 5.1. In summary, MX knockoffs continues to have the highest power among FDR-controlling procedures. 5.3.3 Effect of covariate dependence To assess the relative power and FDR control of MX knockoffs as a function of covariate dependence, we ran similar simulations as in the previous section, but with covariates that are AR(1) with varying autocorrelation coefficient (while the coefficient amplitude remains fixed). It is now relevant to specify that the locations of the nonzero coefficients are uniformly distributed on {1, . . . , p}. In the interest of space, we only show the low-dimensional (p = 1000) Gaussian setting (where all four procedures can be computed) and the high-dimensional (p = 6000) binomial setting, as little new information is contained in the plots for the remaining two settings. Figure 7 shows that, as expected, BHq with marginal testing quickly loses FDR control with increasing covariate dependence. This is because the marginal tests are testing the null hypothesis of marginal independence between covariate and response, while recall from Definition 2.1 that all conditionally independent covariates are considered null, even if they are marginally dependent on the response. Concentrating on the remaining methods and just the left-hand part of the BHq marginal curves where FDR is controlled, Figure 7 shows that MX knockoffs continues to be considerably more powerful than alternatives as covariate dependence is introduced, in low- and high-dimensional linear and nonlinear models. 22 0.75 0.75 0.50 Methods BHq Marginal BHq Max Lik. FX Knockoffs MX Knockoffs 0.25 0.00 0.50 Methods 0.25 BHq Marginal MX Knockoffs 0.00 1.00 1.00 0.75 0.75 FDR FDR Gaussian Response, p = 6000 1.00 Power Power Gaussian Response, p = 1000 1.00 0.50 0.25 0.50 0.25 0.00 0.00 2 3 4 5 3 4 Coefficient Amplitude 5 6 Coefficient Amplitude Figure 5: Power and FDR (target is 10%) for MX knockoffs and alternative procedures. The design matrix is i.i.d. N (0, 1/n), n = 3000, p = (left): 1000 and (right): 6000, and y comes from a Gaussian linear model with 60 nonzero regression coefficients having equal magnitudes and random signs. The noise variance is 1. Each point represents 200 replications. 0.75 0.75 0.50 Methods 0.25 0.50 Methods 0.25 BHq Marginal BHq Max Lik. MX Knockoffs 0.00 BHq Marginal MX Knockoffs 0.00 1.00 1.00 0.75 0.75 FDR FDR Binomial Response, p = 6000 1.00 Power Power Binomial Response, p = 1000 1.00 0.50 0.25 0.50 0.25 0.00 0.00 6 8 10 8 Coefficient Amplitude 10 12 Coefficient Amplitude Figure 6: Power and FDR (target is 10%) for MX knockoffs and alternative procedures. The design matrix is i.i.d. N (0, 1/n), n = 3000, p = (left): 1000 and (right): 6000, and y comes from a binomial linear model with logit link function, and 60 nonzero regression coefficients having equal magnitudes and random signs. Each point represents 200 replications. 23 Binomial Response, p = 6000 1.00 0.75 0.75 Power Power Gaussian Response, p = 1000 1.00 0.50 0.25 Methods BHq Marginal MX Knockoffs 0.00 0.25 0.00 1.00 Methods BHq Marginal BHq Max Lik. 0.75 FX Knockoffs MX Knockoffs 0.50 1.00 0.75 FDR FDR 0.50 0.25 0.50 0.25 0.00 0.00 0.0 0.2 0.4 0.6 0.8 0.0 Autocorrelation Coefficient 0.2 0.4 0.6 0.8 Autocorrelation Coefficient Figure 7: Power and FDR (target is 10%) for MX knockoffs and alternative procedures. The design matrix has i.i.d. rows and AR(1) columns with autocorrelation coefficient specified by the x-axes of the plots, and marginally each Xj ∼ N (0, 1/n). (left): n = 3000, p = 1000, and y follows a Gaussian linear model. (right): n = 3000, p = 6000, and y follows a binomial linear model with logit link function. In both cases, there are 60 nonzero coefficients having magnitudes equal to 3.5 on the left and 10 on the right, random signs, and randomly selected locations. Each point represents 200 replications. 6 Robustness In many real applications, the true joint covariate distribution may not be known exactly, forcing the user to estimate it from the available data. As already mentioned, this is a challenging problem by itself, but often we have considerable outside information or unsupervised data that can be brought to bear to improve estimation. This raises the important question of how robust MX knockoffs is to error in the joint covariate distribution. Theoretical guarantees of robustness are beyond the scope of this paper, but we present instead three compelling simulation studies to demonstrate robustness. The first study investigates error that biases that distribution toward the empirical covariate distribution, often referred to as overfitting error, on simulated data. We generated knockoffs for Gaussian variables, but instead of using the true covariance matrix, we used in-sample covariance estimates which ranged in overfitting error. Figure 8 shows the power and FDR as the covariance we use ranges from the true covariance matrix (AR(1) with autocorrelation 0.3), to a graphical lasso estimator, to convex combinations of the true and empirical covariance (see Appendix E for explicit formulae for the estimators). The plot is indexed on the x-axis by the average relative Frobenius norm kΣ̂ − ΣkFro /kΣkFro of the estimator Σ̂. Although the graphical Lasso is well suited for this problem since the covariates have a sparse precision matrix, its covariance estimate is still off by nearly 50%, and yet surprisingly the resulting power and FDR are nearly indistinguishable from when the exact covariance is used. The covariance estimate worsens as the empirical covariance—a very poor estimate of the true covariance given the high dimensionality—is combined in increasing proportion with the truth. At 75% weight on the empirical covariance, the covariance estimate is nearly 100% off and yet the power and FDR of MX knockoffs are only slightly decreased. Beyond this point, MX knockoffs becomes quite conservative, with power and FDR approaching zero as the estimated covariance approaches the empirical covariance. This behavior at 100% weight on the empirical covariance is not surprising, since p > n and thus the empirical covariance is rank-deficient, forcing the knockoff variables to be exact replicas 24 1.00 1.00 50% Emp. Cov ● ● 62.5% Emp. Cov 0.75 ● FDR Power Exact Cov ● 0.75 ● Graph. Lasso 75% Emp. Cov 0.50 0.50 87.5% Emp. Cov ● 0.25 0.25 ● 100% Emp. Cov ● 0.00 0.0 0.5 ● ● ● ● ● 0.00 1.0 0.0 Relative Frobenius Norm Error 0.5 ● 1.0 Relative Frobenius Norm Error Figure 8: Power and FDR (target is 10%) for knockoffs with the LCD statistic as the covariance matrix used to generate knockoffs ranges from the truth to an estimated covariance; see text for details. The design matrix has i.i.d. rows and AR(1) columns with autocorrelation coefficient 0.3, and the matrix (including knockoffs) is standardized so that each column has mean zero and Euclidean norm 1. Here, n = 800, p = 1500, and y comes from a binomial linear model with logit link function with 50 nonzero entries having magnitude 20 and random signs. Each point represents 200 replications. of their original counterparts.8 The main take-aways from this plot are that (a) the nominal level of 10% FDR is never violated, even for covariance estimates very far from the truth, and (b) the more overfitting done on the covariance, the more conservative the procedure is, although even at almost 100% relative error, MX knockoffs had only lost about 20% of the power it would have had if the covariance were known exactly. Intuitively, instead of treating the variables as coming from their true joint distribution, MX knockoffs with an overfit covariate distribution seems to treat them as coming from their true distribution “conditional” on being similar to their observed values. Thus FDR should be roughly controlled conditionally which implies marginal FDR control, while power may be lost if the conditioning is too great, which matches what we see in the simulations. Our second and third experiments use real covariate data from a genome-wide association study (GWAS), the details of which are given in Section 7 and Appendix F. In brief, it is a high-dimensional setting with Xij ∈ {0, 1, 2} and strong spatial structure, whose covariance we estimate in-sample using the GWAS-tailored covariance estimator of Wen and Stephens (2010). We check the robustness of constructing second-order model-X knockoffs by ASDP (from Section 3.4.2) by choosing a reasonable but artificial model for Y |X1 , . . . , Xp and simulating artificial response data using the real covariate data. The exact details of the simulation are given in Section 7.1, but note that this simulation used the exact same covariance estimation, SNP clustering and representative selection, knockoff construction, and knockoff selection procedure as used for the real data analysis of the next section. Our second experiment varies the signal amplitude in a binomial linear model, and Figure 9 shows the FDR and power. As hoped, the FDR is consistently controlled over a wide range of powers. Our third experiment, instead of varying the signal strength of our artificial model for Y |X1 , . . . , Xp , deliberately corrupts the covariance estimate of Wen and Stephens (2010) by varying a shrinkage parameter that is not meant to be varied. That parameter is m in Wen and Stephens (2010, equation (2.7)), and we vary it from 1/10 to 10 times its intended value. This variation has a huge effect on how much shrinkage is applied off the diagonal, with the average correlation varying by a factor of about 13 over the range of shrinkage. Figure 10 shows that, even as we range from substantial undershrinkage to substantial overshrinkage, MX knockoffs never significantly violates FDR control, with only a bit of conservativeness when the undershrinkage is most drastic (the same phenomenon as the right side of Figure 8). 8 When the knockoff variables are exact copies of the original variables we are guaranteed zero power and zero FDR since all Wj = 0. Although in principle we could break ties and assign signs by coin flips when Wj = 0, we prefer to only select Xj with Wj > 0, as Wj = 0 provides no evidence against the null hypothesis. 25 1.00 0.75 0.75 Power FDR 1.00 0.50 0.25 0.50 0.25 0.00 0.00 9 12 15 18 21 9 Coefficient Amplitude 12 15 18 21 Coefficient Amplitude 1.00 1.00 0.75 0.75 Power FDR Figure 9: Power and FDR (target is 10%) for knockoffs with the LCD statistic applied to subsamples of a real genetic design matrix. Each boxplot represents 10 different logistic regression models with 60 nonzero coefficients with amplitudes given by the x-axis, and for each model, 1000 common observations were used for picking cluster representatives, and the remaining 13,708 observations were divided into 10 disjoint parts and knockoffs run on each part, with power and FDR for that model then computed by averaging the results over those 10 parts. 0.50 0.25 0.50 0.25 0.00 0.00 −1.0 −0.5 0.0 0.5 1.0 −1.0 log10(Shrinkage Multiplier) −0.5 0.0 0.5 1.0 log10(Shrinkage Multiplier) Figure 10: The setup is the same as Figure 9 except with the amplitude fixed at 14 and the amount of off-diagonal shrinkage in the covariance estimate varied on the x-axis. 26 7 Genetic analysis of Crohn’s disease To test the robustness and practicality of the new knockoff procedure, we applied it to a data set containing genetic information on cases and controls for Crohn’s disease (CD). The data is provided by the Wellcomme Trust Case Control Consortium and has been studied previously (WTCCC, 2007). After preprocessing, there were p = 377, 749 single nucleotide polymorphisms (SNPs) measured on n = 4, 913 subjects (1,917 CD patients and 2,996 healthy controls). Although p  n, the joint dependence of SNPs has a strong spatial structure, and outside data can be used to improve estimation. In particular, we approximated the standardized joint distribution as multivariate Gaussian with covariance matrix estimated using the methodology of Wen and Stephens (2010), which shrinks the off-diagonal entries of the empirical covariance matrix using genetic distance information estimated from the HapMap CEU population. This approximation was used on each chromosome, and SNPs on different chromosomes were assumed to be independent. The statistic we use is the LCD. Although the data itself cannot be made available, all code is available at http://web.stanford.edu/group/candes/knockoffs/software/knockoff/. One aspect of SNP data is that it contains some very high correlations, which presents two challenges to our methodology. The first is generic to the variable selection problem: it is very hard to choose between two or more nearly-identical (highly-correlated) variables if the data supports at least one of them being selected.9 To alleviate this, we clustered the SNPs using the estimated correlations as a similarity measure with a single-linkage cutoff of 0.5, and settle for discovering important SNP clusters. To do so we choose one representative from each cluster and approximate the null hypothesis that a cluster is conditionally independent of the response given the other clusters by the null hypothesis that a cluster representative is conditionally independent of the response given the other cluster representatives. To choose the representatives, we could ignore the observed data altogether and do something like pick representatives with the highest minor allele frequency (computed from outside data), and then run knockoffs as described in the paper. Although this produces a powerful procedure (about 50% more powerful than the original analysis by WTCCC (2007)), a more powerful approach is to select cluster representatives using a fraction of the observations, including their responses, such as by marginal testing. Note that such a data-splitting approach appears to make our null hypotheses random, as in the work on inference after selection reviewed in Section 1.4. However, the approximation we are making is that each representative stands for its cluster, and each cluster has exactly one associated null hypothesis, no matter how selection is performed, even if it were nonrandom. That is, the approximate hypotheses being tested do not actually depend on the selection (unlike Brzyski et al. (2016) where clusters are selected and where the very definition of a cluster actually depends on the selection), and our approach remains free of a model for Y | X, which together should make it clear that it is still quite different from the literature on inference after selection. Explicitly, we randomly chose 20% of our observations and on those observations only, we ran marginal t-tests between each SNP and the response. Then from each cluster we chose the SNP with smallest t-test p-value to be the single representative of that cluster. Because the observations used for selecting cluster representatives have had their representative covariate values selected for dependence on the outcome, if we constructed knockoff variables as usual and included them in our procedure, the required exchangeability established in Lemma 3.2 would be violated. However, taking a page from Barber and Candès (2016), we can still use these observations in our procedure by making their knockoff variables just identical copies of the original variables (just for these observations). It is easy to show (see Appendix G) that constructing knockoffs in this way, as exact copies for the observations used to pick representatives and as usual for the remaining observations, the pairwise exchangeability of null covariates with their knockoffs is maintained. Of course, the observations with identical original and knockoff covariate values do not directly help the procedure distinguish between the original and knockoff variables, but including them improves the accuracy of the fitting procedure used to produce the feature importance statistics, so that power is improved indirectly because the Zj become more accurate measures of feature importance. Replacing clusters with single representatives reduces p down to 71, 145 (so the average cluster size 9 This is purely a problem of power and would not affect the Type I error control of knockoffs. 27 was just over five SNPs, although there was substantial variance) and, by construction, upper-bounds pairwise SNP correlations by 0.5. Note that this is far from removing all dependence among the SNPs, so considering conditional independence instead of marginal dependence remains necessary for interpretation. Scientifically, we consider a selected SNP to be a true discovery if and only if it is the representative of a cluster containing a truly important SNP. The second challenge is the one discussed in Section 3.4, and we use the approximate SDP knockoff construction proposed there. The approximate covariance matrix was just the estimated covariance matrix with zeros outside of the block diagonal, with the blocks chosen by single-linkage clustering on the estimated correlation matrix, aggregating clusters up the dendrogram as much as possible subject to a maximum cluster size of 999. In this case, even separating the problem by chromosome, the SDP construction was computationally infeasible and the equicorrelated construction produced extremely small s: mean(sEQ ) = 0.08. The parallelized approximate SDP construction took just a matter of hours to run, and increased s on average by almost an order of magnitude, with mean(sASDP ) = 0.57. Although it incorporates strong prior information, our estimate of the joint distribution of the SNPs is still an approximation, so our first step is to test the robustness of knockoffs to this approximation. 7.1 Simulations with genetic design matrix In Section 6, the second and third experiments check the robustness of knockoffs to this particular joint distribution approximation by taking a reasonable model for Y |X1 , . . . , Xp and simulating artificial response data using the real covariate data itself. We split the rows of our design matrix into 10 smaller data sets (reestimating the joint covariate distribution each time), and for each conditional model we run knockoffs 10 times and compute the realized FDP each time. Then averaging the 10 FDPs gives an estimate of knockoffs’ FDR for that conditional model. In an attempt to make each smaller data set have size more comparable to the n ≈ 5, 000 in our actual experiment, we combined the healthy and CD genetic information with that from 5 other diseases from the same data set:10 coronary artery disease, hypertension, rheumatoid arthritis, type 1 diabetes, and type 2 diabetes. This made for 14, 708 samples altogether. To further increase the effective sample size and match the actual experiment, we used a random subset of 1000 observations for choosing cluster representatives, but the same 1000 for each smaller data set, so that each subsampled data set contained ≈ 1, 400 unique samples, +1000 common samples (for each of these common samples X̃ij = Xij ). For computational reasons, we used only the first chromosome in this experiment, so each of our simulations had (pre-clustering) 29, 258 covariates. The conditional model for the response was chosen to be a logistic regression model with 60 nonzero coefficients of random signs and locations uniformly chosen from among the original (not just representatives) SNPs. In the second experiment (Figure 9), the coefficient amplitude was varied, and for each amplitude value, 10 different conditional models (different random locations of the nonzero coefficients) were simulated. Each simulation ran the exact same covariance estimation, SNP clustering and representative selection, knockoff construction, and knockoff selection procedure as used for the real data. In the third experiment (Figure 10), the shrinkage was amplified or attenuated by varying the value m in Wen and Stephens (2010, Equation (2.7)) from its intended value, while the coefficient amplitude was fixed at 14. In both of these experiments, knockoffs appears to be quite robust to the approximation we make in estimating the joint distribution of the SNPs. 7.2 Results on real data Encouraged by these robustness simulations, we proceeded to run knockoffs with a nominal FDR level of 10% on the full genetic design matrix and real Crohn’s disease outcomes. Since knockoffs is a randomized procedure, we re-ran knockoffs 10 times (after choosing the representatives) and recorded the selected SNPs over all repetitions, summarized in Table 2. The serial computation time for a single run of knockoffs was about 6 hours, but the knockoff generation process is trivially parallelizable over chromosomes, so with 20 10 Bipolar disorder was also part of this data set, but a formatting error in the data we were given prevented us from including it. 28 available computation nodes, the total parallelized computation time was about one hour. Although in this case we certainly do not know the ground truth, we can get some sort of confirmation by comparing to the results of studies with newer and much larger data sets than ours. In particular, we compared with the results of Franke et al. (2010), which used roughly 22,000 cases and 29,000 controls, or about 10 times the sample size of the WTCCC data. We also compare to the WTCCC (2007) results, where the p-value cutoff used was justified as controlling the Bayesian FDR at close to 10%—the same level we use. We consider discovered clusters in different studies to correspond (“Yes” in Table 2) if their position ranges overlap, and to nearly correspond (“Yes*” in Table 2) if the distance from our discovered cluster to the nearest cluster in the other study was less than the width of that cluster in the other study. One thing to notice in the table is that a small number of the discovered clusters actually overlap with other clusters, specifically the clusters represented by rs11805303 and rs11209026 on chromosome 1, and rs17234657 and rs7726744 on chromosome 5. And although they don’t overlap one another, the three nearby clusters represented by rs3135503, rs6500315, and rs7186163 on chromosome 16 all overlap the same discovered region in Franke et al. (2010). Although puzzling at first, this phenomenon is readily explained by one of four possibilities: • By construction, the representatives of overlapping clusters are not very highly-correlated (less than 0.5), so the fact that knockoffs chose multiple clusters in the same region may mean there are multiple important SNPs in this region, with one (or more) in each cluster. Focusing on the clusters on chromosome 1, the same region on the IL23R gene was reported in Franke et al. (2010) to have by far the strongest signal (estimated odds ratio of 2.66, next highest was 1.53) among all the regions they identified. If we conclude from this that the region or gene is fundamentally important for Crohn’s disease, it stands to reason that mutations at multiple nearby but distinct loci could have important detrimental effects of their own. • There could be an important SNP located between the two clusters, but which was not in the data. Then the two clusters on either side would both be conditionally dependent on the response, and knockoffs would be correct to reject them. • One or more of the overlapping clusters could be mundane false discoveries caused by null covariates that happened to take values more conditionally related to the response than would be typical. This would be a facet of the data itself, and thus an unavoidable mistake. • The tandem discoveries could also be due to a breakdown in our covariate distribution estimate. If the covariance between the two representatives were substantially underestimated and one had a large effect while the other was null, then the Lasso would have a (relatively) hard time distinguishing the two original variables, but a much easier time separating them from the knockoff of the null representative, since it is less correlated with the signal variable. As a result, the null variable and its knockoff would not be exchangeable as required by knockoffs, and a consistent error could be made. However, given that the empirical and estimated correlations between the two representatives on chromosome 1 were -0.1813 and -0.1811, respectively, and for the two on chromosome 5 were -0.2287 and -0.2286, respectively, it seems unlikely that we have made a gross estimation error. Also, note that the separation of nearly all the discovered regions, along with the simulations of the previous subsection, suggest this effect is at worst very small among our discoveries. Overlapping clusters aside, the knockoffs results display a number of advantages over the original marginal analysis in WTCCC (2007): • First, the power is much higher, with WTCCC (2007) making 9 discoveries, while knockoffs made 18 discoveries on average, doubling the power. • Quite a few of the discoveries made by knockoffs that were confirmed by Franke et al. (2010) were not discovered in WTCCC (2007)’s original analysis. 29 Selection frequency 100% 100% 100% 100% 100% 90% 90% 90% 80% 80% 60% 60% 60% 60% 50% 50% 50% 50% 40% 40% 40% 40% 40% 30% 30% 30% 30% 10% 10% 10% 10% 10% 10% 10% 10% 10% 10% 10% Cluster Representative (Cluster Size) rs11805303 (16) rs11209026 (2) rs6431654 (20) rs6601764 (1) rs7095491 (18) rs6688532 (33) rs17234657 (1) rs3135503 (16) rs9783122 (234) rs11627513 (7) rs4437159 (4) rs7768538 (1145) rs6500315 (4) rs2738758 (5) rs7726744 (46) rs4246045 (46) rs2390248 (13) rs7186163 (6) rs10916631 (14) rs4692386 (1) rs7655059 (5) rs7759649 (2) rs1345022 (44) rs6825958 (3) rs9469615 (2) rs4263839 (23) rs2836753 (5) rs459160 (2) rs6743984 (23) rs2279980 (20) rs4959830 (11) rs13230911 (9) rs7807268 (5) rs2147240 (1) rs10761659 (53) rs4984405 (3) rs17694108 (1) rs3932489 (30) Chrom. Position Range (Mb) 1 1 2 10 10 1 5 16 10 14 3 6 16 20 5 5 7 16 1 4 4 6 9 4 6 9 21 1 2 5 6 7 7 9 10 15 19 20 67.31–67.46 67.31–67.42 233.94–234.11 3.85–3.85 101.26–101.32 169.4–169.65 40.44–40.44 49.28–49.36 106.43–107.61 96.61–96.63 84.8–84.81 25.19–32.91 49.03–49.07 61.71–61.82 40.35–40.71 150.07–150.41 19.8–19.89 49.2–49.25 220.87–221.08 25.81–25.81 89.5–89.53 21.57–21.58 21.67–21.92 55.73–55.77 33.91–33.92 114.58–114.78 39.21–39.23 44.75–44.75 230.91–231.05 57.95–58.07 3.36–3.41 1.9–2.06 147.65–147.7 71.83–71.83 64.06–64.41 93.06–93.08 38.42–38.42 15.01–15.09 Confirmed in Franke et al. (2010)? Yes Yes Yes No Yes Yes Yes Yes No No No Yes Yes Yes Yes Yes No Yes No No No Yes* No No Yes* Yes No No Yes No Yes No No No Yes No Yes No Selected in WTCCC (2007)? Yes Yes Yes No Yes No Yes Yes No No No No Yes No Yes Yes No Yes No No No No No No No No No No No No No No No No Yes No No No Table 2: SNP clusters discovered to be important for Crohn’s disease over 10 repetitions of knockoffs. Clusters not found in Franke et al. (2010) represent promising sites for further investigation, especially rs6601764 and rs4692386, whose nearest genes have been independendently linked to CD. See text for detailed description. SNP positions are as listed in the original data, which uses Human Genome Build 35. 30 • Knockoffs made a number of discoveries not found in either WTCCC (2007) or Franke et al. (2010). Of course we expect some (roughly 10%) of these to be false discoveries, particularly towards the bottom of the table. However, especially given the evidence from the simulations of the previous subsection suggesting the FDR is controlled, it is likely that many of these correspond to true discoveries. Indeed, evidence from independent studies about adjacent genes shows some of the top hits to be promising candidates. For example, the closest gene to rs6601764 is KLF6, which has been found to be associated with multiple forms of IBD, including CD and ulcerative colitis (Goodman et al., 2016); and the closest gene to rs4692386 is RBP-J, which has been linked to CD through its role in macrophage polarization (Barros et al., 2013). Note that these benefits required relatively little customization of the knockoff procedure. For instance, WTCCC (2007) used marginal tests specifically tailored to SNP case-control data, while we simply used the LCD statistic. We conjecture that the careful use of knockoffs by domain experts would compound the advantages of knockoffs, as such users could devise more powerful statistics and better model/cluster the covariates for their particular application. 8 Discussion This paper introduced a novel approach to variable selection in general non-parametric models, which teases apart important from irrelevant variables while guaranteeing Type I error control. This approach is a significant rethinking of the knockoff filter from Barber and Candès (2015). A distinctive feature of our approach is that selection is achieved without ever constructing p-values. This is attractive since (1) p-values are not needed and (2) it is unclear how they could be efficiently constructed, in general. (The conditional randomization approach we proposed is one way of getting such p-values but it comes at a computational cost.) Deployment in highly correlated settings We posed a simple question: which variables does a response of interest depend upon? In many problems, there may not be enough “resolution” in the data to tell whether Y depends on X1 or, instead, upon X2 when the two are strongly correlated. This issue is apparent in our genetic analysis of Crohn’s disease from Section 7, where co-located SNPs may be extremely correlated. In such examples, controlling the FDR may not be a fruitful question. A more meaningful question is whether the response appears to depend upon a group of correlated variables while controlling for the effects of a number of other variables (e.g., from SNPs located in a certain region of the genome while controlling for the effects of SNPs elsewhere on the chromosomes). In such problems, we envision applying our techniques to grouped variables: one possibility is to develop a model-X group knockoff approach following Dai and Barber (2016). Another is to construct group representatives and proceed as we have done in Section 7. It is likely that there are several other ways to formulate a meaningful problem and solution. Open questions Admittedly, this paper may pose more problems than it solves; we close our discussion with a few of them below. • How do we construct MX knockoffs? Even though we presented a general strategy for constructing knockoffs, we have essentially skirted this issue except for the important case of Gaussian covariates. It would be important to address this problem, and write down concrete algorithms for some specific distributions of features of practical relevance. • Which MX knockoffs? Even in the case of Gaussian covariates, the question remains of how to choose corr(Xj , X̃j ) or, equivalently, the parameter sj from Section 3 since corr(Xj , X̃j ) = 1 − sj . Should we make the marginal correlations small? Should we make the partial correlations small? Should we take an information-theoretic approach and minimize a functional of the joint distribution such as the mutual information between X and X̃? 31 • What would we do with multiple MX knockoffs? As suggested in Barber and Candès (2015), we could in principle construct multiple knockoff variables (X̃ (1) , . . . , X̃ (d) ) in such a way that the (d + 1)pdimensional family (X, X̃ (1) , . . . , X̃ (d) ) obeys the following extended exchangeability property: for any (1) (d) variable Xj , any permutation in the list (Xj , X̃j , . . . , X̃j ) leaves the joint distribution invariant. On the one hand, such constructions would yield more accurate information since we could compute, among multiple knockoffs, the rank with which an original variable enters into a model. On the other hand, this would constrain the construction of knockoffs a bit more, perhaps making them less distinguishable from the original features. What is the right trade off? Another point of view is to construct several knockoff matrices exactly as described in the paper. Each knockoff matrix would yield a selection, with each selection providing FDR control as described in this paper. Now an important question is this: is it possible to combine/aggregate all these selections leading to an increase in power while still controlling the FDR? • Can we prove some form of robustness? Although our theoretical guarantees rely on the knowledge of the joint covariate distribution, Section 6 showed preliminary examples with remarkable robustness when this distribution is simply estimated from data. For instance, the estimation of the precision matrix for certain Gaussian designs seems to have rather secondary effects on FDR and power levels. It would be interesting to provide some theoretical insights into this phenomenon. • Which feature importance statistics should we use? The knockoff framework can be seen as an inference machine: the statistician provides the test statistic Wj and the machine performs inference. It is of interest to understand which statistics yield high power, as well as design new ones. • Can we speed up the conditional randomization testing procedure? Conditional randomization provides a powerful alternative method for controlling the false discovery rate in model-X variable selection, but at a computational cost that is currently prohibitive for large problems. However, there exist a number of promising directions for speeding it up, including: importance sampling to estimate small p-values with fewer randomizations, faster feature statistics Tj with comparable or higher power than the absolute value of lasso-estimated coefficients, and efficient computation re-use and warm starts to take advantage of the fact that each randomization changes only a single column of the design matrix. In conclusion, much remains to be done. On the upside, though, we have shown how to select features in high-dimensional nonlinear models (e.g., GLMs) in a reliable way. This arguably is a fundamental problem, and it is really not clear how else it could be achieved. References Affymetrix (2006). BRLMM: an improved genotype calling method for the genechip human mapping 500k array set. Technical report, Affymetrix. Athey, S., Imbens, G. W., and Wager, S. (2016). Efficient inference of average treatment effects in high dimensions via approximate residual balancing. arXiv preprint arXiv:1604.07125. Barber, R. F. and Candès, E. J. (2015). Controlling the false discovery rate via knockoffs. Ann. Statist., 43(5):2055–2085. Barber, R. F. and Candès, E. J. (2016). A knockoff filter for high-dimensional selective inference. arXiv preprint arXiv:1602.03574. Barros, M. H. M., Hauck, F., Dreyer, J. H., Kempkes, B., and Niedobitek, G. (2013). Macrophage polarisation: an immunohistochemical approach for identifying m1 and m2 macrophages. PLoS ONE, 8(11). 32 Benjamini, Y. (2010). Discovering the false discovery rate. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(4):405–416. Benjamini, Y. and Gavrilov, Y. (2009). A simple forward selection procedure based on false discovery rate control. Ann. Appl. Stat., 3(1):179–198. Benjamini, Y. and Heller, R. (2007). False discovery rates for spatial signals. Journal of the American Statistical Association, 102(480):1272–1281. Benjamini, Y. and Hochberg, Y. (1995). Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society. Series B (Methodological), 57(1):pp. 289–300. Benjamini, Y. and Yekutieli, D. (2001). The control of the false discovery rate in multiple testing under dependency. Ann. Statist., 29(4):1165–1188. Berk, R., Brown, L., Buja, A., Zhang, K., and Zhao, L. (2013). Valid post-selection inference. Ann. Statist., 41(2):802–837. Bogdan, M., van den Berg, E., Sabatti, C., Su, W., and Candès, E. J. (2015). SLOPE—adaptive variable selection via convex optimization. Ann. Appl. Stat., 9(3):1103–1140. Brzyski, D., Peterson, C. B., Sobczyk, P., Candès, E. J., Bogdan, M., and Sabatti, C. (2016). Controlling the rate of gwas false discoveries. bioRxiv. Candès, E. J. and Plan, Y. (2009). 37(5A):2145–2177. Near-ideal model selection by `1 minimization. Ann. Statist., Chouldechova, A. (2014). False discovery rate control for spatial data. PhD thesis, Stanford University. Cong, L., Ran, F. A., Cox, D., Lin, S., Barretto, R., Habib, N., Hsu, P. D., Wu, X., Jiang, W., Marraffini, L. A., and Zhang, F. (2013). Multiplex genome engineering using crispr/cas systems. Science, 339(6121):819–823. Dai, R. and Barber, R. F. (2016). The knockoff filter for fdr control in group-sparse and multitask regression. arXiv preprint arXiv:1602.03589. Dezeure, R., Bhlmann, P., Meier, L., and Meinshausen, N. (2015). High-dimensional inference: Confidence intervals, p-values and r-software hdi. Statist. Sci., 30(4):533–558. Doran, G., Muandet, K., Zhang, K., and Schölkopf, B. (2014). A permutation-based kernel conditional independence test. The 30th Conference on Uncertainty in Artificial Intelligence. Edwards, D. (2000). Introduction to Graphical Modelling. Springer New York, New York, NY. Efron, B. (2010). Large-scale inference: empirical Bayes methods for estimation, testing, and prediction, volume 1. Cambridge University Press. Franke, A., McGovern, D. P., Barrett, J. C., Wang, K., Radford-Smith, G. L., Ahmad, T., Lees, C. W., Balschun, T., Lee, J., Roberts, R., et al. (2010). Genome-wide meta-analysis increases to 71 the number of confirmed Crohn’s disease susceptibility loci. Nature genetics, 42(12):1118–1125. Freedman, D. and Lane, D. (1983). A nonstochastic interpretation of reported significance levels. Journal of Business & Economic Statistics, 1(4):292–298. Frommlet, F., Ruhaltinger, F., Twaróg, P., and Bogdan, M. (2012). Modified versions of bayesian information criterion for genome-wide association studies. Computational Statistics & Data Analysis, 56(5):1038 – 1051. 33 George, E. I. and McCulloch, R. E. (1997). Approaches for bayesian variable selection. Statistica Sinica, 7(2):339–373. Goodman, W., Omenetti, S., Date, D., Di Martino, L., De Salvo, C., Kim, G., Chowdhry, S., Bamias, G., Cominelli, F., Pizarro, T., et al. (2016). Klf6 contributes to myeloid cell plasticity in the pathogenesis of intestinal inflammation. Mucosal immunology. Guan, Y. and Stephens, M. (2011). Bayesian variable selection regression for genome-wide association studies and other large-scale problems. Ann. Appl. Stat., 5(3):1780–1815. Haldane, J. B. S. and Waddington, C. H. (1931). Inbreeding and linkage. Genetics, 16(4):357–374. He, Q. and Lin, D.-Y. (2011). A variable selection method for genome-wide association studies. Bioinformatics, 27(1):1–8. Hoggart, C. J., Whittaker, J. C., De Iorio, M., and Balding, D. J. (2008). Simultaneous analysis of all snps in genome-wide and re-sequencing association studies. PLoS Genet, 4(7):1–8. Janson, L. and Su, W. (2016). Familywise error rate control via knockoffs. Electron. J. Statist., 10(1):960– 975. Lee, J. D., Sun, D. L., Sun, Y., and Taylor, J. E. (2016). Exact post-selection inference, with application to the lasso. Ann. Statist., 44(3):907–927. Li, J., Das, K., Fu, G., Li, R., and Wu, R. (2011). The bayesian lasso for genome-wide association studies. Bioinformatics, 27(4):516–523. Li, J., Gahm, J. K., Shi, Y., and Toga, A. W. (2016). Topological false discovery rates for brain mapping based on signal height. NeuroImage, pages –. Lockhart, R., Taylor, J., Tibshirani, R. J., and Tibshirani, R. (2014). A significance test for the lasso. Ann. Statist., 42(2):413–468. Lv, J. and Liu, J. S. (2014). Model selection principles in misspecified models. Journal of the Royal Statistical Society Series B, 76:141–167. Pacifico, M. P., Genovese, C., Verdinelli, I., and Wasserman, L. (2004). False discovery control for random fields. Journal of the American Statistical Association, 99(468):1002–1014. Pearl, J. (1988). Probabilistic inference in intelligent systems. Morgan Kaufmann, San Mateo, CA. Peters, J. M., Colavin, A., Shi, H., Czarny, T. L., Larson, M. H., Wong, S., Hawkins, J. S., Lu, C. H., Koo, B.-M., Marta, E., et al. (2016). A comprehensive, crispr-based functional analysis of essential genes in bacteria. Cell, 165(6):1493–1506. Rosenbaum, P. R. (1984). Conditional permutation tests and the propensity score in observational studies. Journal of the American Statistical Association, (79):pp. 565–574. Rosenbaum, P. R. and Rubin, D. B. (1983). The central role of the propensity score in observational studies for causal effects. Biometrika, 70(1):41–55. Saltelli, A., Ratto, M., Andres, T., Campolongo, F., Cariboni, J., Gatelli, D., Saisana, M., and Tarantola, S. (2008). Global sensitivity analysis: the primer. John Wiley & Sons. Siegmund, D. O., Zhang, N. R., and Yakir, B. (2011). Biometrika, 98(4):979–985. 34 False discovery rate for scanning statistics. Strobl, C. and Zeileis, A. (2008). Danger: High power! ? exploring the statistical properties of a test for random forest variable importance. Tang, H., Coram, M., Wang, P., Zhu, X., and Risch, N. (2006). Reconstructing genetic ancestry blocks in admixed individuals. The American Journal of Human Genetics, 79(1):1–12. van de Geer, S., Bühlmann, P., Ritov, Y., and Dezeure, R. (2014). On asymptotically optimal confidence regions and tests for high-dimensional models. Ann. Statist., 42(3):1166–1202. Wager, S. and Athey, S. (2016). Estimation and inference of heterogeneous treatment effects using random forests. arXiv preprint arXiv:1510.04342. Wen, X. and Stephens, M. (2010). Using linear predictors to impute allele frequencies from summary or pooled genotype data. Ann. Appl. Stat., 4(3):1158–1182. Westfall, P. H. and Troendle, J. F. (2008). Multiple testing with minimal assumptions. Biometrical Journal, 50(5):745–755. WTCCC (2007). Genome-wide association study of 14,000 cases of seven common diseases and 3,000 shared controls. Nature, 447(7145):661–678. Wu, T. T., Chen, Y. F., Hastie, T., Sobel, E., and Lange, K. (2009). Genome-wide association analysis by lasso penalized logistic regression. Bioinformatics, 25(6):714–721. Zhao, P. and Yu, B. (2006). On model selection consistency of lasso. Journal of Machine Learning Research, 7(Nov):2541–2563. A Relationship with the knockoffs of Barber and Candès We can immediately see a key difference with the earlier framework of Barber and Candès (2015). In their work, the design matrix is viewed as being fixed and setting Σ = X > X, knockoff variables are constructed as to obey " # Σ Σ − diag{s} > [X, X̃] [X, X̃] = G, G = . (A.1) Σ − diag{s} Σ Imagine the columns of X are centered, i.e., have vanishing means, so that we can think of X > X as a sample covariance matrix. Then the construction of Barber and Candès is asking that the sample covariance matrix of the joint set of variables obeys the exchangeability property—i.e., swapping rows and columns leaves the covariance invariant—whereas in this paper, it is the population covariance that must be invariant. In particular, the MX knockoffs will be far from obeying the relationship X > X = X̃ > X̃ required in (A.1). To drive this point home, assume X ∼ N (0, I). Then we can choose X̃ ∼ N (0, I) independently from X, in which case X > X/n and X̃ > X̃/n are two independent Wishart variables. An important consequence of this is that in the MX approach, the sample correlation between the jth columns of X and X̃ will typically be far smaller than that in the original framework of Barber and Candès. For example, take n = 3000 and p = 1000 and assume the equicorrelated construction from Barber and Candès (2015). Then the sample correlation between any variable Xj and its knockoff X̃j will be about 0.65 while in the random case, the average magnitude of the correlation is about 0.015. This explains the power gain of our new method that is observed in Section 5. 35 B Sequential conditional independent pairs algorithm We will prove by induction on j that Algorithm 1 produces knockoffs that satisfy the exchangeability property (3.1). We prove the result for the discrete case; the general case follows the same argument with a slightly more careful measure-theoretic treatment using Radon–Nikodym derivatives instead of probability mass functions. Below we denote the probability mass function (PMF) of (X1:p , X̃1:j−1 ) by L(X-j , Xj , X̃1:j−1 ). Induction Hypothesis 1. After j steps, every pair Xk , X̃k is exchangeable in the joint distribution of (X1:p , X̃1:j ) for k = 1, . . . , j. By construction, the induction hypothesis is true after 1 step since X1 and X̃1 are conditionally independent and have the same marginal distribution (this implies conditional exchangeability). Assuming the induction hypothesis holds until j − 1, we prove that it holds after j steps. Note that by by assumption, L is symmetric in Xk , X̃k (that is, the function value remains unchanged when the argument values Xk , X̃k are swapped) for k = 1, . . . , j − 1. Also, the conditional PMF of X̃j given X1:p , X̃1:j−1 is given by L(X-j , X̃j , X̃1:j−1 ) . P u L(X-j , u, X̃1:j−1 ) Therefore, the joint PMF of (X1:p , X̃1:j ) is given by the product of the aforementioned conditional PMF with the joint PMF of (X1:p , X̃1:j−1 ): L(X-j , Xj , X̃1:j−1 )L(X-j , X̃j , X̃1:j−1 ) . P u L(X-j , u, X̃1:j−1 ) (B.1) Exchangeability of Xj , X̃j follows from the symmetry of (B.1) to those two values. For k < j, note that (B.1) only depends on Xk , X̃k through the function L, and that L is symmetric in Xk , X̃k . Therefore, (B.1) is also symmetric in Xk , X̃k , and therefore the pair is exchangeable in the joint distribution of (X1:p , X̃1:j ). C Bayesian knockoff statistics The data for the simulation of Section 5.2.2 was drawn from: iid Xj ∼ N (0, 1/n), j ∈ {1, . . . , p}, iid βj ∼ N (0, τ 2 ), j ∈ {1, . . . , p}, iid δj ∼ Bernoulli(π), j ∈ {1, . . . , p}, 1 ∼ Gamma(A, B) (shape/scale parameterization, as opposed to shape/rate), σ2   X Y ∼N Xj βj , σ 2  . j:δj =1 60 The simulation used n = 300, p = 1000, with parameter values π = 1000 , A = 5, B = 4, and τ varied along the x-axis of the plot. To compute the Bayesian variable selection (BVS) knockoff statistic, we used a Gibbs sampler on the 36 following model (treating X1 , . . . , Xp and X̃1 , . . . , X̃p as fixed): iid βj ∼ N (0, τ 2 ), j ∈ {1, . . . , p}, iid β̃j ∼ N (0, τ 2 ), j ∈ {1, . . . , p}, iid λj ∼ Bernoulli(π), j ∈ {1, . . . , p},    if λj = 0   (0, 0)  iid (δj , δ̃j ) ∼ , j ∈ {1, . . . , p}, (0, 1) w.p. 1/2 if λj = 1   (1, 0) w.p. 1/2 if λ = 1   j 1 ∼ Gamma(A, B) (shape/scale parameterization, as opposed to shape/rate), σ2   X X Y ∼N Xj βj + X̃j β̃j , σ 2  , j:δj =1 j:δ̃j =1 which requires only a very slight modification of the procedure in George and McCulloch (1997). After ˆ computing the posterior probabilities δ̂j and δ̃j with 500 Gibbs samples (after 50 burn-in samples), we computed the jth knockoff statistic as ˆ Wj = δ̂j − δ̃j . D Conditional randomization speedups In order to make the conditional randomization computation feasible for Figure 4, we had to apply a number of speed-ups/shortcuts. With these, the serial computation time for the figure was reduced to roughly three years. • As mentioned, the LCD statistic is a powerful one for MX knockoffs, so we wanted to compare it to the analogue for the conditional randomization test, namely, the absolute value of the Lassoestimated coefficient. However, choosing the penalty parameter by cross-validation turned out to be too expensive, so instead we chose a fixed value by simulating repeatedly from the known model (with amplitude 30), running cross-validation for each repetition, and choosing the median of the cross-validation-error-minimizing penalty parameters (the chosen value was 0.00053). For a fair comparison, we did the same for MX knockoffs (except the simulations included knockoff variables too—the chosen value was 0.00077). This speed-up is of course impossible in practice, as the true model is not known. It is not clear how one would choose the penalty parameter if not by crossvalidation (at considerable extra computational expense), although a topic of current research is how to choose tuning parameters efficiently and without explicit reliance on a model for the response, e.g., (Lv and Liu, 2014). • Because the statistic used was the (absolute value of the) estimated coefficient from a sparse estimation procedure, many of the observed statistics were exactly zero, and for these, the conditional randomization p-values can be set to one without further computation. This did not require any prior knowledge, although it will only work for statistics whose distribution has a point mass at the smallest possible value. • Because the power was calibrated, we knew to expect at least around 10 discoveries, and thus could anticipate the BHq cutoff being at least 0.1 × 10/600. This cutoff gives a sense of the p-value resolution needed, and we chose the number of randomizations to be roughly 10 times the inverse of the BHq cutoff, namely, 10, 000. However, we made sure that all 10, 000 randomizations were only computed for very few covariates, both using the previous bullet point and also by checking after 37 periodic numbers of randomizations whether we can reject the hypothesis that the true p-value is below the approximate BHq cutoff upper-bound of 0.1 × 44/600 (the 44 comes from 40 nonzeros with 10% false discoveries). For instance, after just 10 randomizations, if the approximate p-value so far is greater than 0.2, we can reject the hypothesis that the exact p-value is below 0.1 × 44/600 at significance 0.0001 (and thus compute no further randomizations for that covariate). Speed-ups like this are possible in practice, although they require having an idea of how many rejections will be made, which is not generally available ahead of time. E Robustness Simulations In Figure 8, the points labeled “100α% Emp. Cov” represents knockoffs run using the following convex combination of the true and empirical covariance matrices: ΣEC = (1 − α)Σ + αΣ̂, where Σ̂ is the empirical covariance matrix. The point labeled “Graph. Lasso” represents knockoffs run using the following covariance estimate: ΣGL = diag(r) Θ̂−1 diag(r) q where the rescaling vector r has rj = Σjj /(Θ̂−1 )jj , and Θ̂ is the inverse covariance estimated by the graphical Lasso with penalty parameter chosen by 2-fold cross-validation on the log-likelihood. F Genetic analysis of Crohn’s disease The SNP arrays came from an Affymetrix 500K chip, with calls made by the BRLMM algorithm Affymetrix (2006). SNPs satisfying any of the following conditions were removed: • minor allele frequency (MAF) < 1%, • Hardy–Weinberg equilibrium test p-value < 0.01%, • missing > 5% of values (values were considered missing if the BRLMM score was > 0.5), • position was listed as same as another SNP (this occured just for the pair rs16969329 and rs4886982; the former had smaller MAF and was removed), • position was not in genetic map. Furthermore, subjects missing > 5% of values were removed. Following the original paper describing/using this data (WTCCC, 2007), we did not adjust for population structure. Any missing values that remained after the above preprocessing were replaced by the mean of the nonmissing values for their respective SNPs. G Knockoffs with selection First, recall that the results of Theorem 3.4 hold if for any subset S ⊂ H0 , we have d ([X, X̃]swap(S) , y) = ([X, X̃], y). (G.1) In fact, MX knockoffs are defined in such a way that this property holds. Now, the procedure employed in Section 7 to construct knockoffs is slightly different from that described in the rest of the paper. Explicitly, the data looks like " # " # X (1) y (1) X= , y = (2) , X (2) y 38 where y (1) is 983 × 1, X (1) is 983 × 71, 145, y (2) is 3930 × 1 and X (2) is 3930 × 71, 145; recall that the set of samples labeled (1) is used to select the cluster representatives, and that the two sets (1) and (2) are independent of each other. The knockoffs X̃ (2) for X (2) are generated as described in the paper (using the ASDP construction) and for (1), we set X̃ (1) = X (1) . To verify (G.1), it suffices to show that for any subset S ∈ H0 and each i ∈ {1, 2}, d ([X (i) , X̃ (i) ], y (i) ) = ([X (i) , X̃ (i) ]swap(S) , y (i) ) (G.2) since the sets (1) and (2) are independent. (G.2) holds for i = 2 because we are following the classical knockoffs construction. For i = 1, (G.2) actually holds with exact equality, and not just equality in distribution. We can also argue from the perspective of MX knockoffs from Definition 3.1. By construction, it is clear that X̃ (2) are valid MX knockoffs for X (2) . We thus study X̃ (1) : since X̃ (1) = X (1) , the exchangeability property is trivial; also, X̃ (1) ⊥ ⊥ y (1) | X (1) since X (1) determines X̃ (1) . 39
10math.ST
LOW COHERENCE UNIT NORM TIGHT FRAMES arXiv:1803.05531v1 [cs.IT] 14 Mar 2018 SOMANTIKA DATTA AND JESSE OLDROYD Abstract. Equiangular tight frames (ETFs) have found significant applications in signal processing and coding theory due to their robustness to noise and transmission losses. ETFs are characterized by the fact that the coherence between any two distinct vectors is equal to the Welch bound. This guarantees that the maximum coherence between pairs of vectors is minimized. Despite their usefulness and widespread applications, ETFs of a given size N are only guaranteed to exist in Rd or Cd if N = d + 1. This leads to the problem of finding approximations of ETFs of N vectors in Rd or Cd where N > d + 1. To be more precise, one wishes to construct a unit norm tight frame (UNTF) such that the maximum coherence between distinct vectors of this frame is as close to the Welch bound as possible. In this paper low coherence UNTFs in Rd are constructed by adding a strategically chosen set of vectors called an optimal set to an existing ETF of d + 1 vectors. In order to do so, combinatorial objects called block designs are used. Estimates are provided on the maximum coherence between distinct vectors of this low coherence UNTF. It is shown that for certain block designs, the constructed UNTF attains the smallest possible maximum coherence between pairs of vectors among all UNTFs containing the starting ETF of d + 1 vectors. This is particularly desirable if there does not exist a set of the same size for which the Welch bound is attained. Keywords: Block designs, coherence, equiangular frames, tight frames, Welch bound 2000 MSC: 42C15; 94Axx 1. Introduction 1.1. Background and Motivation. The maximum coherence between pairs in a set of N unit vectors {f1 , . . . , fN } in Cd satisfies the following inequality due to Welch [1]: s N −d (1.1) max |hfi , fj i| ≥ , N ≥ d. i6=j d(N − 1) q N −d The quantity α = appearing on the right side of (1.1) is known as the Welch d(N −1) bound. Sets of unit vectors attaining the lower bound in (1.1) are mathematical objects called equiangular tight frames (ETFs) [2, 3]. Such sets arise in many different areas as in communications, quantum information processing, and coding theory [1, 4, 5, 2, 6, 7, 8, 9, 10, 11]. Consequently, the problem of constructing ETFs and determining conditions under which they exist has gained substantial attention [2, 12, 13, 14, 15, 16, 17, 18, 19]. The Gram matrix of an ETF has two distinct eigenvalues: zero and Nd with multiplicities N − d and d, respectively [14]. Conditions on eigenvalues for the existence of an ETF have been discussed in [2, 12, 14, 15, 16], among others. A graph theoretic approach to constructing ETFs has been studied in [17]. A correspondence discovered by Fickus et al. [18] uses Steiner systems to directly construct the frame vectors of certain ETFs, bypassing the common technique of constructing a suitable Gram matrix. This approach lets one construct highly redundant sparse ETFs. However, in the real case, this approach can give rise to ETFs only if a real Hadamard matrix of a certain size exists. 1 2 SOMANTIKA DATTA AND JESSE OLDROYD Despite the desirability and importance of ETFs, these cannot exist for many pairs (N, d). When the Hilbert space is Rd , the maximum number of equiangular lines is bounded by d(d+1) , and for Cd the bound is d2 [20, 21]. Even when these restrictions hold, ETFs are very 2 hard to construct and do not exist for many pairs (N, d) [14]. This leads to generalizations and approximations of ETFs. For a real ETF, the off-diagonal entries of the Gram matrix are either α or −α, where α is the Welch bound. In other words, the off-diagonal entries of the Gram matrix all have modulus equal to α. Generalizing this notion, a unit norm tight frame (UNTF) whose associated Gram matrix has off-diagonal entries with k distinct moduli is called a k-angle tight frame [22]. These objects have also been explored in [23] under the name d-angular frames. Note that for a set of unit vectors, the diagonal entries of the corresponding Gram matrix will equal 1. Under this definition, ETFs are viewed as 1-angle tight frames. 2-angle tight frames, or biangular tight frames, are discussed in [23, 24] and combinatorial constructions are provided. It is to be noted that often in the literature, a unit norm tight frame is called a two-distance tight frame [25, 26] if the off-diagonal entries of the associated Gram matrix take on either of two values a and b. In that case, real ETFs are thought of as two-distance tight frames instead of 1-angle tight frames, as done here. Non-equiangular two-distance tight frames are examples of the biangular tight frames mentioned above. Explicit constructions of k-angle tight frames can be found in [22]. Besides generalizing the notion of an ETF, k-angle tight frames prove to be important due to their connection to graphs and association schemes as discussed in [22]. The goal here is to come up with objects that can be considered approximations of ETFs. In particular, one seeks UNTFs with low coherence among the vectors. Section 2 contains the main contribution of the work presented here. In Section 2, a deterministic way of constructing low coherence UNTFs is given that has the added benefit of being applicable when an equiangular set of lines, and in particular an ETF, of a certain size is known not to exist. The idea is to start from an ETF of d + 1 vectors in Rd and determine an optimal set of vectors that can be added to this ETF such that the resulting union is a UNTF in Rd for which the maximum coherence between distinct vectors can be minimized even if there does not exist a set of the same size for which the Welch bound is attained. This UNTF can be considered as an approximation of an ETF of the same size in Rd . The exact meaning of “optimal” in this context is given in Definition 2.1. This approach relies on the fact that an ETF of d + 1 vectors in Rd or Cd always exists [2, 14, 22, 27] which can be viewed as the vertices of a regular simplex centered at the origin. Combinatorial objects called block designs are used to determine the optimal sets to be added to the starting ETF. The main results of Section 2 are Theorem 2.9 and Theorem 2.18. Section 3 provides some concluding remarks. 1.2. Notation and Preliminaries. In a finite dimensional Hilbert space like Rd or Cd , a spanning set is called a frame.1 Given a set {f1 , . . . , fN } of vectors in Rd or Cd , let F be the matrix whose columns are the vectors f1 , . . . , fN . F will be called the synthesis operator of {f1 , . . . , fN }. For a tight frame the d × d matrix F F ∗ is a multiple of the identity. That is, F F ∗ equals λI, where I is the identity, and λ is called the frame bound. A tight frame for which each vector is unit norm is called a unit norm tight frame (UNTF). The matrix F ∗ F is the Gram matrix of the set {f1 , . . . , fN } and its non-zero eigenvalues are the same as the eigenvalues of F F ∗ . The (i, j)th entry of the Gram matrix is the inner product hfj , fi i. 1In an infinite dimensional space, the notion of a frame is far more subtle [28, 29] and will not be needed here. LOW COHERENCE UNIT NORM TIGHT FRAMES 3 An equiangular tight frame (ETF) is a set {f1 , . . . , fN } in a d-dimensional Hilbert space H satisfying [14]: (i) F F ∗ = Nd I, i.e., the set is a tight frame. (ii) kfi k = 1, for i = 1, . . . , N, i.e., the set is unit norm. (iii) |hfi , fj i| = α, 1 ≤ i 6= j ≤ N, where α is the Welch bound. Throughout, H will be either Cd or Rd .2 A frame of N vectors in Rd (respectively, Cd ) will be referred to as an (N, d) real (respectively, complex) frame. When H is not specified, the frame will be called an (N, d) frame. Let {λi }N i=1 be the eigenvalues of the corresponding Gram matrix G. The frame potential [30] of a set of unit vectors {f1 , . . . , fN } is the quantity F P ({fi }N i=1 ) given by (1.2) F P ({fi }N i=1 ) = N X N X i=1 j=1 2 |hfi , fj i| = N X λ2i = tr G2 . i=1 The following result on the frame potential is found in [30]. Theorem 1.1 (Theorem 6.2, [30]). Let d, N ∈ N with d ≤ N and let {fi }N i=1 be a set of unit N2 d d N norm vectors in R or C . Then F P ({fi }i=1 ) is bounded below by d with equality if and only if the frame is a unit norm tight frame (an orthonormal basis in the case N = d). 2. Constructing low coherence UNTFs with block designs 2.1. Optimal sets to add to ETFs. As already mentioned in Section 1.1, ETFs are useful due to their minimal maximum coherence between distinct vectors. Unfortunately, even though (d + 1, d) ETFs always exist, an (N, d) ETF may not always exist if N > d + 1. Since ETFs already minimize the maximum coherence among pairs of its vectors, a natural approach to approximating an (N, d) ETF, when N > d + 1, is to add an optimal set of vectors to a (d+1, d) ETF in such a way that the resulting set is still a UNTF with maximum coherence among its distinct vectors as close to the Welch bound as possible. By definition, a (d + 1, d) ETF is a UNTF. Since the union of two UNTFs is another UNTF for the same space, the optimal set to be added will be taken to be a UNTF to ensure that the resulting set is a UNTF. This is accomplished below in Theorem 2.9 and Theorem 2.18. In the absence of an (N, d) ETF, the low coherence UNTFs provided by Theorem 2.9 and Theorem 2.18 can be thought of as approximations of a corresponding (N, d) ETF, if it were to exist. From (1.1), for a (d + 1, d) ETF, the modulus of the inner product of any two distinct 1 d vectors is d1 . In what follows, {fi }d+1 i=1 ⊂ R will denote a (d + 1, d) ETF where hfi , fj i = − d for i 6= j. For any d, this ETF can be constructed based on an explicit construction given in [22]. d Definition 2.1. Let G0 ⊂ Rd be a UNTF. Let {fi }d+1 i=1 ⊂ R be a (d + 1, d) ETF where hfi , fj i = − d1 for i 6= j. G0 is said to be optimal with respect to {fi }d+1 i=1 if, among all possible UNTFs G ⊂ Rd , G0 minimizes the maximum coherence between distinct vectors of {fi }d+1 i=1 ∪ G. Given a set of unit vectors containing the real ETF {fi }d+1 i=1 of Definition 2.1, Theorem 2.2 below gives a lower bound for the maximum coherence between distinct vectors of this set. Using Theorem 2.2, one can determine a set that is optimal with respect to {fi }d+1 i=1 in the sense of Definition 2.1. The bound in (2.1) is similar to the orthoplex bound [31]. 2The results can be easily generalized to any d-dimensional Hilbert space H since H would be isomorphic to Rd or Cd . 4 SOMANTIKA DATTA AND JESSE OLDROYD 1 d Theorem 2.2. Let {fi }d+1 i=1 ⊂ R denote an ETF satisfying hfi , fj i = − d for 1 ≤ i < j ≤ d + 1. Let f ∈ Rd be a unit vector. Then 1 (2.1) max |hf, fi i| ≥ √ . 1≤i≤d+1 d Proof. Since f is a unit vector and {fi }d+1 i=1 is a UNTF, d+1 Pd+1 X d+1 d+1 |hf, fi i|2 . = kf k2 = d d i=1 |hf, fi i|2 must be bounded above by (d + 1) maxi |hf, fi i|2 , which gives d+1 ≤ (d + 1) max |hf, fi i|2 . i d Simplifying this gives 1 √ ≤ max |hf, fi i|. i d The sum i=1  Remark 2.3. Note that Theorem 2.2 only relies on the fact that {fi }d+1 i=1 is a UNTF. Hence the result still holds if the given (d + 1, d) ETF is replaced with an arbitrary (N, d) UNTF, although this fact will not be required in this paper. It is worthwhile to note here that if d is odd then Theorem 2.4 shows that the inequality in Theorem 2.2 is sharp for the (d + 1, d) ETF given in the statement of this theorem. If G0 is a UNTF such that the maximum coherence between distinct vectors of G0 ∪ {fi }d+1 i=1 is √1d , then Theorem 2.2 implies that G0 is optimal with respect to {fi }d+1 . It is possible to i=1 obtain such UNTFs using the construction given in Theorem 2.4 below. This is then further developed in Theorem 2.9, Theorem 2.14, and Theorem 2.18.   . Let {fi }d+1 Theorem 2.4. Let d ∈ N, set k = d+1 i=1 denote the (d + 1, d) ETF satisfying 2 1 hfi , fj i = − d for i 6= j. Let Λ denote a subset of {1, . . . , d + 1} of size k, and define the vector g by P fi . g = Pi∈Λ k i∈Λ fi k Then 1 if d is odd, max |hg, fj i| = √ 1≤j≤d+1 d and r d+2 max |hg, fj i| ≤ if d is even. 1≤j≤d+1 d2 Proof. First, note that * + 2 X X X k(k − 1) . fi , fj = k − fi = d i∈Λ j∈Λ i∈Λ q P , and it follows that Hence k i∈Λ fi k = k(d+1−k) d s * + X d hg, fj i = fi , fj k(d + 1 − k) i∈Λ LOW COHERENCE UNIT NORM TIGHT FRAMES 5 q  d+1−k if j = i for some i ∈ Λ, q dk = k − otherwise. d(d+1−k)   . If d is odd then k = d+1 and maxj |hg, fj i| = Now consider the case k = d+1 2 2 d+2 even, then k = 2 and ( 1 √ if j = i for some i ∈ Λ, d+2 q hg, fj i = − d+2 otherwise. d2 q q 1 d+2 , max |hg, f i| ≤ if d is even. Since √d+2 ≤ d+2 j j 2 d d2 √1 . d If d is  Theorem 2.4 shows how to construct vectors g whose maximum coherence with vectors of the given ETF {fi }d+1 i=1 either meets or comes very close to meeting the optimal bound √1 of Theorem 2.2. In order to construct UNTFs that are optimal with respect to the ETF d 1 d {fi }d+1 i=1 ⊂ R satisfying hfi , fj i = − d for i 6= j, one can then consider UNTFs of the form {gi } ⊂ Rd , where by the proof of Theorem 2.4, s P X f d j j∈Λ fj , = (2.2) gi = P i k j∈Λi fj k k(d + 1 − k) j∈Λ i ⌉. The problem now is to and {Λi } is a collection of subsets of {1, . . . , d + 1} of size k = ⌈ d+1 2 determine how to select the subsets {Λi } so that the vectors {gi } ⊂ Rd satisfy the following constraints: √1 , (i) the maximum coherence of {gi } ∪ {fi }d+1 i=1 is d (ii) the set {gi } is a UNTF. Note that the constraint in (ii) is equivalent to {gi } ∪ {fi }d+1 i=1 being a UNTF since the union of two UNTFs is another UNTF. To see how to choose subsets {Λi } that minimize the maximum coherence, the following computations will be useful. Recall q that, for i 6= j, |hfi , fj i| = d1 . Also, due to Theorems 2.2 and 2.4, to determine maxi6=j |hgi , gj i|. Due to (2.2), |hgi , gj i| = √1 d ≤ maxi,j |hgi , fj i| ≤ d+2 . d2 It remains X X d hfm , fn i . k(d + 1 − k) m∈Λ n∈Λ i j For i 6= j, let l = |Λi ∩ Λj |. Then out of the k 2 terms in the double summation, there will be l terms that equal 1 and k 2 − l terms that equal − d1 . Therefore, for i 6= j, (2.3) |hgi , gj i| = 1 k2 d+1 d l − (k 2 − l) = l− . k(d + 1 − k) d k(d + 1 − k) d+1 2 k Thus if l is the closest integer to d+1 , then the above inner product is minimized. The next example shows this approach in action. Example 2.5 (An optimal UNTF to add to a (4, 3) ETF). Let {fi }4i=1 ⊂ R3 be an ETF from the vertices satisfying hfi , fj i = − 31 for 1 ≤ i < j ≤ 4. Such an ETF can be constructed  d+1  of a regular tetrahedron inscribed within the unit sphere. Set k = 2 = 2. Then the goal is 6 SOMANTIKA DATTA AND JESSE OLDROYD to find a collection of subsets of {1, 2, 3, 4} of size k = 2 such that the intersection of any two k2 members has l = d+1 = 1 element. One such collection is given by {{1, 2}, {1, 3}, {1, 4}}. 3 Now define {gi }i=1 by f1 + f2 f1 + f3 f1 + f4 g1 = , g2 = , g3 = . kf1 + f2 k kf1 + f3 k kf1 + f4 k It can be checked that {gi }3i=1 forms an orthonormal basis for R3 . This implies that {fi }4i=1 ∪ {gi }3i=1 is a (7, 3) UNTF. By Theorem 2.4, the maximum coherence between distinct vectors of the set {fi }4i=1 ∪{gi }3i=1 is √13 which is the lower bound given in Theorem 2.2. By (1.1), the q √ 2 3 = ≈ .4714, corresponding Welch bound for a collection of 7 unit vectors in R is 7−3 3·6 3 whereas √13 ≈ .5774. However, there does not exist a (7, 3) ETF. In fact, the largest ETF in R3 is a (6, 3) ETF, and so no collection of 7 unit vectors in R3 has maximum coherence √ 2 . Further, by Theorem 2.2, the maximum coherence between distinct vectors of the set 3 {fi }4i=1 ∪ {gi }3i=1 is the smallest possible among all UNTFs containing the starting (4, 3) ETF {fi }4i=1 . In the absence of a (7, 3) ETF, the set {fi }4i=1 ∪ {gi }3i=1 can be thought of as a low coherence UNTF of 7 vectors in R3 that is an approximation of the hypothetical (7, 3) ETF. The set {fi }4i=1 ∪ {gi }3i=1 obtained in Theorem 2.5 formed a tight frame due to the fact that {gi }3i=1 turned out to be an orthonormal basis and hence a UNTF. However, this is not guaranteed in general. One way to ensure tightness is by utilizing block designs [32], as described in the following subsection. 2.2. Using block designs to determine optimal sets to add to ETFs. Definition 2.6. Let X denote a set containing v points and suppose there is a collection B of subsets (“blocks”) of X where each block has size k. If for any x ∈ X there are precisely r blocks in B containing x, and for any distinct x, y ∈ X there are precisely λ blocks containing {x, y}, then B is said to be a (v, k, λ) block design on X, or more simply a block design. Theorem 2.5 indirectly makes use of symmetric designs and Hadamard designs [33], which are particular examples of block designs 3. This is explained below. Definition 2.7. Let B denote a (v, k, λ) block design. B is a symmetric design if |B| = v. B is a Hadamard design if it is a symmetric design and the parameters v, k, λ satisfy v = 4n − 1, k = 2n − 1 and λ = n − 1 or v = 4n − 1, k = 2n and λ = n. A (4n − 1, 2n − 1, n − 1) or (4n − 1, 2n, n) Hadamard design exists if and only if there exists a corresponding 4n × 4n real Hadamard matrix [33]. Hadamard designs, like all symmetric designs, satisfy the following important property. Lemma 2.8 ([33]). Let B denote a (v, k, λ) symmetric design. Then any two distinct blocks in B have precisely λ elements in common. Hadamard designs, specifically (4n − 1, 2n − 1, n − 1) Hadamard designs, can now be used to extend the construction given in Theorem 2.5 to other dimensions besides d = 3. Theorem 2.9. Let d = 4n − 1 for some n and suppose that there exists a (4n − 1, 2n − − 1, d+1 − 1) Hadamard design B = {Bi }di=1 on the set {2, 3, . . . , d + 1}. 1, n − 1) = (d, d+1 2 4 3Particular block designs known as Steiner systems have been used to construct equiangular tight frames [18]. LOW COHERENCE UNIT NORM TIGHT FRAMES 7 1 d Let {fi }d+1 i=1 ⊂ R denote an ETF satisfying hfi , fj i = − d for 1 ≤ i < j ≤ d + 1. Define Λi = {1} ∪ Bi for 1 ≤ i ≤ d and for each i construct the vector gi by P j∈Λ fj . gi = P i k j∈Λi fj k d Then {fi }d+1 i=1 ∪ {gi }i=1 is a (2d + 1, d) UNTF, and the maximum coherence between distinct vectors of this UNTF is √1d . Proof. By (2.3), if 1 ≤ i < j ≤ d then |hgi , gj i| = where k = |Λi | = d+1 2 k2 d+1 l− k(d + 1 − k) d+1 and l = |Λi ∩ Λj | = l− d+1 . 4 Since k2 d+1 d+1 = − = 0, d+1 4 4 it follows that {gi }di=1 is an orthogonal set. Further, since each gi has unit norm by cond struction, {gi }di=1 is an orthonormal basis. Therefore {fi }d+1 i=1 ∪ {gi }i=1 must be a UNTF. 1 d The proof of Theorem 2.4 also shows that maxi,j |hgi , fj i| = √d . Hence {fi }d+1 i=1 ∪ {gi }i=1 is a (2d + 1, d) UNTF with maximum coherence between distinct vectors given by √1d .  One can now observe that Theorem 2.5 can also be obtained from Theorem 2.9 by setting n = 1. The needed (3, 1, 0) Hadamard design on the set {2, 3, 4} can be taken as B1 = {2}, B2 = {3}, B3 = {4}. Example 2.10 (An optimal UNTF to add to an (8, 7) ETF). Let {fi }8i=1 ⊂ R7 be an ETF satisfying hfi , fj i = − 71 for 1 ≤ i < j ≤ 8. Then Theorem 2.9 shows that a (7, 3, 1) Hadamard design on the set {2, 3, . . . , 8} can be used to find an optimal UNTF (specifically, an orthonormal basis) to add to this ETF. One such design can be found in [33] and is given by B1 = {2, 5, 6}, B2 = {3, 5, 7}, B3 = {4, 5, 8}, B4 = {2, 3, 4}, B5 = {2, 7, 8}, B6 = {3, 6, 8}, B7 = {4, 6, 7}. The next step is to add 1 to each block to create the sets {Λi }7i=1 , and use these to construct the orthonormal basis {gi }7i=1 : g1 = f1 + f2 + f5 + f6 f1 + f4 + f6 + f7 , . . . , g7 = . kf1 + f2 + f5 + f6 k kf1 + f4 + f6 + f7 k The resulting (15, 7) UNTF {fi }8i=1 ∪ {gi }7i=1 then has maximum coherence between distinct vectors given by √17 . Theorem 2.9 uses Hadamard designs to construct low coherence UNTFs that meet the lower bound of Theorem 2.2. However, as mentioned previously these designs are equivalent to the existence of a real Hadamard matrix of the right size. It is therefore desirable to use more general block designs to construct low coherence UNTFs. This will require the following definition. 8 SOMANTIKA DATTA AND JESSE OLDROYD Definition 2.11. Let X = {xi }vi=1 denote a finite set and let B = {Bi }bi=1 denote a block design on X. The matrix K = [kij ] for 1 ≤ i ≤ v, 1 ≤ j ≤ b, where ( 1 if xi ∈ Bj , kij = 0 otherwise, is called the incidence matrix of B. The following fundamental result on block designs will be necessary, and can be found in [32]. Lemma 2.12 ([32]). Let X = {xi }vi=1 denote a finite set and let B = {Bi }bi=1 denote a (v, k, λ) block design on X. Let r denote the number of blocks in B containing a given element of X. (i) Then  λ v2 b = k and r(k − 1) = λ(v − 1). 2 (ii) Let K = [kij ] denote the incidence matrix of B. Then KK T = (r − λ)I + λJ where J denotes the v × v matrix whose entries are all 1. The following inequality will also be required and can be found in [34]. Theorem 2.13 (Fisher’s Inequality [34]). If B is a block design on X = {1, . . . , d + 1} then B must contain at least d + 1 blocks. 1 d Theorem 2.14. Let {fi }d+1 i=1 ⊂ R denote an ETF satisfying hfi , fj i = − d for 1 ≤ i < j ≤ d + 1, and suppose that B = {Bi }bi=1 is a (d + 1, k, λ) block design on {1, . . . , d + 1} for some k, λ ∈ N. Define gi for 1 ≤ i ≤ b by P j∈B fj gi = P i . f j j∈Bi Then {gi }bi=1 is a (b, d) UNTF. Proof. Let F denote the synthesis operator of {fi }d+1 i=1 , let G denote the corresponding Gram matrix, and let K be the incidence matrix of the block design B. Let F1 denote the synthesis operator of {gi }bi=1 and G1 the corresponding Gram matrix. Then using the proof of Theorem 2.4, one can write s d d F K and G1 = F1T F1 = K T GK. F1 = k(d + 1 − k) k(d + 1 − k) To show that {gi }bi=1 is a UNTF, the frame potential is used in accordance to Theorem 1.1. This is valid since b > d by Theorem 2.13. Note that  2 d b 2 F P ({gi }i=1 ) = tr G1 = tr(K T GKK T GK). k(d + 1 − k) By Theorem 2.12 (ii), KK T = (r − λ)I + λJ. LOW COHERENCE UNIT NORM TIGHT FRAMES 9 Since GJ is the zero matrix, tr G21 =  d k(d + 1 − k) 2 tr((r − λ)G2 KK T ) 2 (d + 1)2 d (r − λ)2 = k(d + 1 − k) d where the last equality follows from the fact that the frame potential of the original ETF is (d+1)2 . By Theorem 2.12 (i), d  λ= bk(k − 1) (d + 1)d Thus r−λ = and r = dλ . k−1 bk(d + 1 − k) , (d + 1)d and so tr G21 =  d k(d + 1 − k) 2 (r − λ)2 b2 (d + 1)2 = . d d Therefore {gi }bi=1 is a (b, d) UNTF by Theorem 1.1.  As (2.3) shows, the coherence between two distinct vectors gi and gj obtained from this construction is related to the size of the intersection of the blocks Bi and Bj that determine gi and gj . Definition 2.15. Let B = {Bi }bi=1 denote a block design on a set X. An integer n ≥ 0 is said to be an intersection number of B if there are blocks Bi and Bj such that n = |Bi ∩ Bj |. Bounds on the possible intersection numbers of a block design are required in order to obtain UNTFs that are optimal in the sense of Theorem 2.1. The bound below was originally given in [35] but the form used here is from [36]. Theorem 2.16 ([36]). Let B = {Bi }bi=1 denote a (v, k, λ) block design on a set X, and let r denote the number of blocks containing a given element of X. Define σ, τ and Σ as follows: σ =k−r+λ k τ = (2k − v) v 2kλ − (k − r + λ). Σ= r Let Bi and Bj denote distinct blocks of B. Then max{σ, τ } ≤ |Bi ∩ Bj | ≤ Σ. Remark 2.17. Beutelspacher [36] gives a slight refinement of the bound given in Theorem 2.16 by showing that if τ as defined in Theorem 2.16 is an intersection number of a block design, then τ must equal 0. Finally, the previous results may now be used to obtain a UNTF {gi }bi=1 that is optimal or nearly optimal with respect to the (d + 1, d) ETF {fi }d+1 i=1 . Let N = b + d + 1. In cases d where an (N, d) ETF does not exist, the low coherence UNTF {gi }bi=1 ∪ {fi }d+1 i=1 ⊂ R can be considered an approximation. This is presented in Theorem 2.18. 10 SOMANTIKA DATTA AND JESSE OLDROYD 1 d Theorem 2.18. Let {fi }d+1 i=1 ⊂ R denote an ETF satisfying hfi , fj i = − d for 1 ≤ i < j ≤ d + 1. Let B = {Bi }bi=1 denote a (d + 1, k, λ) block design on {1, . . . , d + 1}. Let {gi }bi=1 be given by P j∈B fj . gi = P i f j∈Bi j Then (2.4) |hgi , gj i| ≤ Furthermore, suppose k = Then {fi }d+1 i=1 ∪ {gi }bi=1  d+1  2 d+1 λ − 1. k(k − 1) and B is a (d + 1, k, λ) block design with λ = is a (d + 1 + b, d) UNTF satisfying the following. l k(k−1) d+1 m . b (i) If d is odd then the maximum coherence between distinct vectors of {fi }d+1 i=1 ∪ {gi }i=1 is bounded above by   3 1 , max √ , d d−1 and b (ii) if d is even then the maximum coherence between distinct vectors of {fi }d+1 i=1 ∪ {gi }i=1 is bounded above by ) (r 3 d+2 4 . , + max d2 d + 2 d(d + 2) Proof. Let σ and Σ be as given in Theorem 2.16. By Theorem 2.17, the bound in Theorem 2.16 becomes σ ≤ |Bi ∩ Bj | ≤ Σ. First, recall (2.3): d+1 k2 |hgi , gj i| = l− . k(d + 1 − k) d+1 2 k will give maxi6=j |hgi , gj i|. Let Hence the intersection number of B that is farthest from d+1 2 σ+Σ k k2 σ̄ = 2 . It will be shown that σ̄ ≤ d+1 , which will imply that Σ is closer to d+1 than σ. The λ k−1 definitions of σ and Σ, as well as the relation r = d which is obtained from Theorem 2.12, give σ+Σ kλ k(k − 1) σ̄ = = = . 2 r d Therefore,     d+1−k k−1 k k2 = −k ≤ 0. =k − σ̄ − d+1 d d+1 d(d + 1) Thus l = σ gives the largest possible value in (2.3) and so |hgi , gj i| ≤ d+1 k2 σ− . k(d + 1 − k) d+1 Using the expression for σ from Theorem 2.16 as well as the fact that σ ≤  2  k2 d+1 k d+1 σ− = −σ k(d + 1 − k) d+1 k(d + 1 − k) d + 1 k2 , d+1 LOW COHERENCE UNIT NORM TIGHT FRAMES = As shown in the proof of Theorem 2.14, 11 k d+1 − [k − (r − λ)]. d + 1 − k k(d + 1 − k) r−λ= bk(d + 1 − k) d(d + 1) which gives d+1 d+1 k − [k − (r − λ)] = λ−1 d + 1 − k k(d + 1 − k) k(k − 1) after substituting the expression for b from Theorem 2.12. Therefore, d+1 |hgi , gj i| ≤ λ − 1. k(k − 1) b d+1 By Theorem 2.14, {gi }bi=1 is a UNTF. Since {fi }d+1 i=1 is also a UNTF, {fi }i=1 ∪ {gi }i=1 is a UNTF as well. The rest of the proof involves finding the bounds of parts (i) and (ii). Now     and suppose that λ = ⌈ k(k−1) ⌉. If d is odd, then k = d+1 and λ = d−1 . Thus let k = d+1 2 d+1 2 4 d−1 3 λ = 4 + ε where 0 ≤ ε ≤ 4 , and it follows that   d+1 d−1 4 3 |hgi , gj i| ≤ λ−1= +ε −1 ≤ . k(k − 1) d−1 4 d−1 m l d(d+2) . Thus λ = d(d+2) and λ = + ε where 0 ≤ ε ≤ Similarly, if d is even then k = d+2 2 4(d+1) 4(d+1) 4(d+1)−1 4(d+1) and so |hgi , gj i| ≤ d+1 4(d + 1)ε 4 3 λ−1= ≤ + . k(k − 1) d(d + 2) d + 2 d(d + 2) Combining these bounds with the bounds on the coherence between {gi } and {fi } given in Theorem 2.4 finishes the proof.  Remark 2.19. The bounds in (i) and (ii) of Theorem 2.18 are upper bounds on the maxib mum coherence between distinct vectors in the low coherence UNTF {fi }d+1 i=1 ∪ {gi }i=1 . When d is odd and d ≥ 11, the bound (i) simplifies to √1d . Similarly, if d is even and d ≥ 12, q d+2 . In particular, if d is odd, d ≥ 11 and there exists a the bound (ii) simplifies to d2 and λ = ⌈ d−1 ⌉, then the maximum coherence of the (d + 1, k, λ) block design B with k = d+1 2 4 UNTF constructed using Theorem 2.18 meets the lower bound of Theorem 2.2. According to the conditions given in Proposition 3.2 in [12], a real (22, 10) ETF does not exist. The following example uses Theorem 2.18 to give a low coherence UNTF in this case. 11 10 Example 2.20 (Approximating a (22, 10) ETF).  11  Let {fi }i=1 ⊂ R 6·5 denote an ETF where 1 hfi , fj i = − 10 for 1 ≤ i < j ≤ 11. Let k = 2 = 6 and λ = 11 = 3. Then the goal is to find an (11, 6, 3) block design. One such design can be found in [37] and is given by B = {Bi }11 i=1 with B1 = {4, 6, 7, 9, 10, 11}, B5 = {2, 3, 4, 8, 10, 11}, B3 = {1, 2, 6, 8, 9, 11}, B7 = {1, 2, 4, 5, 6, 10}, B2 = {1, 5, 7, 8, 10, 11}, B4 = {1, 2, 3, 7, 9, 10}, B6 = {1, 3, 4, 5, 9, 11}, B8 = {2, 3, 5, 6, 7, 11}, B9 = {1, 3, 4, 6, 7, 8}, B10 = {2, 4, 5, 7, 8, 9}, B11 = {3, 5, 6, 8, 9, 10}. 12 SOMANTIKA DATTA AND JESSE OLDROYD Now define {gi }11 i=1 by g1 = f4 + f6 + · · · + f11 f3 + f5 + · · · + f10 , . . . , g11 = . kf4 + f6 + · · · + f11 k kf3 + f5 + · · · + f10 k 11 Then by Theorems 2.14 and 2.18, {fi }11 i=1 ∪ {gi }i=1 is a UNTF with the maximum coherence between distinct vectors being bounded above by ) (r 43 d+2 4 3 = max , + ≈ .3583. 2 d d + 2 d(d + 2) 120 By Theorem 2.2, the lower bound on the maximum coherence between distinct vectors for this example is √110 ≈ .3162. Thus, the the maximum coherence between distinct vectors lies q 2 ≈ .2390. The low in [.3162, .3583]. The Welch bound for a hypothetical (22, 10) ETF is 35 11 11 coherence UNTF {fi }i=1 ∪ {gi }i=1 obtained here can be thought of as an approximation of a (22, 10) ETF. Remark 2.21. Armed with a table of block designs (such as the those provided in [37, 33]), it is possible to use Theorem 2.18 to investigate a wide variety of candidates for low coherence UNTFs. lIf d ismodd and d ≥ 11, and if one has a (d + 1, k, λ) block design with k = d+1 2 and λ = k(k−1) , i.e., a block design that satisfies the constraints required to use the bound d+1 (i) in Theorem 2.18, then Theorem 2.18 can be used to construct a low coherence UNTF that meets the lower bound of Theorem 2.2. Although the authors did not come across block designs that satisfied the constraints required for the bound (i) in Theorem 2.18, there are more designs that satisfy the bound (ii) than the one given in Theorem 2.20. One way to find these designs is to consider complements of block designs. The incidence matrix of the complement design is obtained by swapping 0 with 1 in the incidence matrix of the original design. For example, the bound (ii) does not apply to any (19, 9, 4) block design (which may be found in [33]), but the complement of such a design has parameters (19, 10, 5). These parameters do in fact satisfy the constraints required to use the bound (ii). Example 2.22. As seen in Theorem 2.20, when using block designs to find low coherence UNTFs in a certain dimensional space, one is constrained by a frame size that is determined by the block design used. For a lower redundancy, one might wish for a UNTF of smaller size. Suppose one wants a real (21, 10) ETF which does not exist by Corollary 16 in [14]. Consider the (22, 10) UNTF of Theorem 2.20, and discard a vector. The resulting (21,10) frame is no longer tight, and the condition number is approximately 1.833 for any vector removed. Note that for a tight frame the condition number is always one. After removing any vector, the maximum coherence between distinct vectors of the resulting (21, 10) frame q is bounded above by 43 120 ≈ .3583, while the Welch bound for a hypothetical (21, 10) ETF is 11 200 ≈ .2345. 3. Conclusion In a d-dimensional space, the UNTFs constructed in Section 2 all have maximum coherence bounded below by √1d due to Theorem 2.2. In order to judge the effectiveness of a particular (N, d) low coherence UNTF, one can compare this maximum coherence to the Welch bound of the corresponding hypothetical (N, d) ETF. The construction in Section 2.2 approximates an (N, d) ETF by using block designs and adding a UNTF to an ETF of size d + 1. In LOW COHERENCE UNIT NORM TIGHT FRAMES 13 this process, the number of added vectors is at least d + 1 due to Theorem 2.13. Thus the size N of the q low coherence q UNTF resulting from this construction is N ≥ 2(d + 1). The N −d d−1 Welch bound d(N = 1d − d(N increases as N increases and d is held fixed. Thus, −1) −1) q when N ≥ 2(d + 1), the corresponding Welch bound is at least 2dd+2 2 +d . For large d, this is approximately equal to √1 . 2d In comparison, a corresponding low coherence UNTF obtained m l  d+1  k(k−1) from Theorem 2.18 using a (d + 1, k, λ) block design with k = 2 and λ = d+1 would have maximum coherence approximately equal to √1d . So for large N and large d one can expect the frames provided by using such block designs to √ have maximum coherence larger than the corresponding Welch bound by a factor of about 2. For a given dimension d, the construction of low coherence UNTFs discussed in Section 2 starts with a (d+1, d) ETF. Instead, one can start with other sets of vectors, such as orthonormal bases or other ETFs. (d + 1, d) ETFs are slightly more redundant than orthonormal bases and are straightforward to construct in all finite dimensional Hilbert spaces, making them a desirable starting point for the construction in this paper, but it would still be worthwhile to investigate this construction starting with other sets of vectors. Determining for which UNTFs the inequality provided in Theorem 2.2 is sharp (see Theorem 2.3) and an analogue of Theorem 2.14 for other sets of vectors would be particularly interesting. Acknowledgement The authors would like to thank the anonymous reviewer for insightful comments and useful suggestions that greatly helped to improve the quality of the paper. Funding This material is based upon work supported by the National Science Foundation under Award No. CCF-1422252 References [1] L. R. Welch. Lower bounds on the maximum cross correlation of signals. IEEE Transactions on Information Theory, 20(3):397–399, 1974. [2] T. Strohmer and R. W. Heath, Jr. Grassmannian frames with applications to coding and communication. Applied and Computational Harmonic Analysis, 14(3):257–275, 2003. [3] S. Datta, S. D. Howard, and D. Cochran. Geometry of the Welch bounds. Linear Algebra Appl., 437(10):2455 – 2470, 2012. [4] J. L. Massey and T. Mittelholzer. Welch’s bound and sequence sets for code-division multiple-access systems. In R. Capocelli, A. De Santis, and U. Vaccaro, editors, Sequences II: Methods in Communication, Security and Computer Science, pages 63–78. Springer-Verlag, New York, 1991. [5] D. V. Sarwate. Meeting the Welch bound with equality. In T. Helleseth and H. Niederreiter, editors, Sequences and Their Applications, DMTCS Series, chapter 11. Springer-Verlag, 1999. [6] J. M. Renes, R. Blume-Kohout, A. J. Scott, and C. M. Caves. Symmetric informationally complete quantum measurements. Journal of Mathematical Physics, 45(6):2171 – 2180, 2004. [7] A. J. Scott. Tight informationally complete quantum measurements. Journal of Physics A: Mathematical and General, 39:13507 – 13530, 2006. [8] A. Klappenecker and M. Rötteler. Mutually unbiased bases are complex projective 2-designs. In Proceedings of the International Symposium on Information Theory, pages 1740 – 1744, September 2005. [9] A. Roy and A. J. Scott. Weighted complex projective 2-designs from bases: Optimal state determination by orthogonal measurements. Journal of Mathematical Physics, 48(072110), 2007. [10] S. G. Hoggar. t-designs in projective spaces. European J. Combin., 3(3):233–254, 1982. 14 SOMANTIKA DATTA AND JESSE OLDROYD [11] P. Xia, S. Zhou, and G. B. Giannakis. Achieving the Welch bound with difference sets. IEEE Transactions on Information Theory, 51(5):1900 – 1907, May 2005. [12] R. B. Holmes and V. I. Paulsen. Optimal frames for erasures. Linear Algebra Appl., 377:31–51, 2004. [13] J. A. Tropp. Complex equiangular tight frames. In Proc. SPIE Wavelets XI, volume 5914, pages 1 – 11, 2005. [14] M. A. Sustik, J. A. Tropp, I. S. Dhillon, and R. W. Heath, Jr. On the existence of equiangular tight frames. Linear Algebra Appl., 426(2-3):619–635, 2007. [15] B. G. Bodmann, V. I. Paulsen, and M. Tomforde. Equiangular tight frames from complex Seidel matrices containing cube roots of unity. Linear Algebra Appl., 430(1):396–417, 2009. [16] B. G. Bodmann and H. J. Elwood. Complex equiangular Parseval frames and Seidel matrices containing pth roots of unity. Proc. Amer. Math. Soc., 138(12):4387–4404, 2010. [17] S. Waldron. On the construction of equiangular frames from graphs. Linear Algebra Appl., 431(11):2228– 2242, 2009. [18] M. Fickus, D. Mixon, and J. Tremain. Steiner equiangular tight frames. Linear Algebra Appl., 436(5):1014–1027, March 2012. [19] D. J. Redmond. Existence and construction of real-valued equiangular tight frames. PhD thesis, University of Missouri–Columbia, 2009. [20] P. W. H. Lemmens and J. J. Seidel. Equiangular lines. J. Algebra, 24:494–512, 1973. [21] P. Delsarte, J. M. Goethals, and J. J. Seidel. Bounds for systems of lines and Jacobi polynomials. Philips Res. Repts., 30(3):91–105, 1975. Issue in honour of C.J. Bouwkamp. [22] S. Datta and J. Oldroyd. Construction of k-angle tight frames. Numerical Functional Analysis and Optimization, 37(8):975 – 989, 2016. [23] P. G. Casazza, A. Farzannia, J. I. Haas, and T. T. Tran. Toward the classification of biangular harmonic frames. Applied and Computational Harmonic Analysis, 2017. [24] J. I. Haas, J. Cahill, J. Tremain, and P. G Casazza. Constructions of biangular tight frames and their relationships with equiangular tight frames. arXiv preprint arXiv:1703.01786, 2017. [25] A. Barg, A. Glazyrin, K. A Okoudjou, and W.-H. Yu. Finite two-distance tight frames. Linear Algebra Appl., 475:163–175, 2015. [26] D. G. Larman, C. A. Rogers, and J. J. Seidel. On two-distance sets in Euclidean space. Bull. London Math. Soc., 9(3):261–267, 1977. [27] V. K. Goyal, J. Kovacevic, J. A. Kelner, Communicated Henrique, and S. Malvar. Quantized frame expansions with erasures. Applied and Computational Harmonic Analysis, 10:203 – 233, 2001. [28] O. Christensen. An Introduction to Frames and Riesz Bases. Birkhäuser, Boston, 2003. [29] I. Daubechies. Ten Lectures on Wavelets. SIAM, Philadelphia, 1992. [30] J. J. Benedetto and M. Fickus. Finite normalized tight frames. Advances in Computational Mathematics, 18:357–385, 2003. [31] B. Bodmann and J. Haas. Achieving the orthoplex bound and constructing weighted complex projective 2-designs with Singer sets. arXiv preprint arXiv:1509.05333, 2015. [32] E. H. Moore and H. S. Pollatsek. Difference Sets: Connecting Algebra, Combinatorics, and Geometry, volume 67. American Mathematical Soc., 2013. [33] C. J. Colbourn. CRC handbook of combinatorial designs. CRC press, 2010. [34] R. C. Bose. A note on Fisher’s inequality for balanced incomplete block designs. Ann. Math. Statist., 20(4):619–620, 12 1949. [35] K. N. Majumdar. On some theorems in combinatorics relating to incomplete block designs. The Annals of Mathematical Statistics, 24(3):377–389, 1953. [36] A. Beutelspacher. On extremal intersection numbers of a block design. Discrete Mathematics, 42:37–49, 1982. [37] W. G. Cochran and G. M. Cox. Experimental Designs. Wiley Publications in Statistics. John Wiley & Sons, 2 edition, 1957. Department of Mathematics, University of Idaho, Moscow, ID 83844-1103, USA E-mail address: [email protected] Department of Mathematics and Computer Science, West Virginia Wesleyan College, Buckhannon, WV 26201, USA E-mail address: [email protected]
7cs.IT
Deriving Neural Architectures from Sequence and Graph Kernels Tao Lei* 1 Wengong Jin* 1 Regina Barzilay 1 Tommi Jaakkola 1 arXiv:1705.09037v3 [cs.NE] 30 Oct 2017 Abstract The design of neural architectures for structured objects is typically guided by experimental insights rather than a formal process. In this work, we appeal to kernels over combinatorial structures, such as sequences and graphs, to derive appropriate neural operations. We introduce a class of deep recurrent neural operations and formally characterize their associated kernel spaces. Our recurrent modules compare the input to virtual reference objects (cf. filters in CNN) via the kernels. Similar to traditional neural operations, these reference objects are parameterized and directly optimized in end-to-end training. We empirically evaluate the proposed class of neural architectures on standard applications such as language modeling and molecular graph regression, achieving state-of-the-art results across these applications. 1. Introduction Many recent studies focus on designing novel neural architectures for structured data such as sequences or annotated graphs. For instance, LSTM (Hochreiter & Schmidhuber, 1997), GRU (Chung et al., 2014) and other complex recurrent units (Zoph & Le, 2016) can be easily adapted to embed structured objects such as sentences (Tai et al., 2015) or molecules (Li et al., 2015; Dai et al., 2016) into vector spaces suitable for later processing by standard predictive methods. The embedding algorithms are typically integrated into an end-to-end trainable architecture so as to tailor the learnable embeddings directly to the task at hand. The embedding process itself is characterized by a sequence operations summarized in a structure known as the computational graph. Each node in the computational * 1 Equal contribution MIT Computer Science & Artificial Intelligence Laboratory. Correspondence to: Tao Lei <[email protected]>, Wengong Jin <[email protected]>. Proceedings of the 34 th International Conference on Machine Learning, Sydney, Australia, PMLR 70, 2017. Copyright 2017 by the author(s). graph identifies the unit/mapping applied while the arcs specify the relative arrangement/order of operations. The process of designing such computational graphs or associated operations for classes of objects is often guided by insights and expertise rather than a formal process. Recent work has substantially narrowed the gap between desirable computational operations associated with objects and how their representations are acquired. For example, value iteration calculations can be folded into convolutional architectures so as to optimize the representations to facilitate planning (Tamar et al., 2016). Similarly, inference calculations in graphical models about latent states of variables such as atom characteristics can be directly associated with embedding operations (Dai et al., 2016). We appeal to kernels over combinatorial structures to define the appropriate computational operations. Kernels give rise to well-defined function spaces and possess rules of composition that guide how they can be built from simpler ones. The comparison of objects inherent in kernels is often broken down to elementary relations such as counting of common sub-structures as in X K(χ, χ0 ) = 1[s ∈ χ]1[s ∈ χ0 ] (1) s∈S where S is the set of possible substructures. For example, in a string kernel (Lodhi et al., 2002), S may refer to all possible subsequences while a graph kernel (Vishwanathan et al., 2010) would deal with possible paths in the graph. Several studies have highlighted the relation between feed-forward neural architectures and kernels (Hazan & Jaakkola, 2015; Zhang et al., 2016) but we are unaware of any prior work pertaining to kernels associated with neural architectures for structured objects. In this paper, we introduce a class of deep recurrent neural embedding operations and formally characterize their associated kernel spaces. The resulting kernels are parameterized in the sense that the neural operations relate objects of interest to virtual reference objects through kernels. These reference objects are parameterized and readily optimized for end-to-end performance. To summarize, the proposed neural architectures, or Kernel Neural Networks 1 , enjoy the following advantages: 1 Code available at https://github.com/taolei87/icml17 knn Deriving Neural Architectures from Sequence and Graph Kernels • The architecture design is grounded in kernel computations. • Our neural models remain end-to-end trainable to the task at hand. • Resulting architectures demonstrate state-of-the-art performance against strong baselines. In the following sections, we will introduce these neural components derived from string and graph kernels, as well as their deep versions. Due to space limitations, we defer proofs to supplementary material. 2. From String Kernels to Sequence NNs Notations We define a sequence (or a string) of tokens d (e.g. a sentence) as x1:L = {xi }L i=1 where xi ∈ R represents its ith element and |x| = L denotes the length. Whenever it is clear from the context, we will omit the subscript and directly use x (and y) to denote a sequence. For P a pair of vectors (or matrices) u, v, we denote hu, vi = k uk vk as their inner product. For a kernel function Ki (·, ·) with subscript i, we use φi (·) to denote its underlying mapping, i.e. Ki (x, y) = hφi (x), φi (y)i = φi (x)> φi (y). String Kernel String kernel measures the similarity between two sequences by counting shared subsequences (see Lodhi et al. (2002)). For example, let x and y be two strings, a bi-gram string kernel K2 (x, y) counts the number of bi-grams (xi , xj ) and (yk , yl ) such that (xi , xj ) = (yk , yl )2 , K2 (x, y) = X λx,i,j λy,k,l δ(xi , yk ) · δ(xj , yl ) 1≤i<j≤|x| 1≤k<l≤|y| (2) where λx,i,j , λy,k,l ∈ [0, 1) are context-dependent weights and δ(x, y) is an indicator that returns 1 only when x = y. The weight factors can be realized in various ways. For instance, in temporal predictions such as language modeling, substrings (i.e. patterns) which appear later may have higher impact for prediction. Thus a realization λx,i,j = λ|x|−i−1 and λy,k,l = λ|y|−k−1 (penalizing substrings far from the end) can be used to determine weights given a constant decay factor λ ∈ (0, 1). In our case, each token in the sequence is a vector (such as one-hot encoding of a word or a feature vector). We shall replace the exact match δ(u, v) by the inner product hu, vi. To this end, the kernel function (2) can be rewritten as, X X λx,i,j λy,k,l hxi , yk i · hxj , yl i 1≤i<j≤|x| 1≤k<l≤|y| 2 We define n-gram as a subsequence of original string (not necessarily consecutive). Figure 1. An unrolled view of the derived recurrent module for K2 (). Horizontal lines denote decayed propagation from c[t − 1] to c[t], while vertical lines represent a linear mapping Wxt that is propagated to the internal states c[t]. X = X λx,i,j λy,k,l hxi ⊗ xj , yk ⊗ yl i 1≤i<j≤|x| 1≤k<l≤|y| * = + X λ|x|−i−1 xi ⊗ xj , i<j X λ|y|−k−1 yk ⊗ yl k<l (3) where xi ⊗ xj ∈ Rd×d (and similarly yk ⊗ yl ) is the outerproduct. In other words, the underlying mapping of kernel P K2 () defined above is φ2 (x) = 1≤i<j≤|x| λ|x|−i−1 xi ⊗ xj . Note we could alternatively use a partial additive scoring hxi , yk i + hxj , yl i, and the kernel function can be generalized to n-grams when n 6= 2. Again, we commit to one realization in this section. String Kernel NNs We introduce a class of recurrent modules whose internal feature states embed the computation of string kernels. The modules project kernel mapping φ(x) into multi-dimensional vector space (i.e. internal states of recurrent nets). Owing to the combinatorial structure of φ(x), such projection can be realized and factorized via efficient computation. For the example kernel discussed above, the corresponding neural component is realized as,   c1 [t] = λ · c1 [t − 1] + W(1) xt   cj [t] = λ · cj [t − 1] + cj−1 [t − 1] W(j) xt h[t] = σ(cn [t]), 1<j≤n (4) where cj [t] are the pre-activation cell states at word xt , and h[t] is the (post-activation) hidden vector. cj [0] is initialized with a zero vector. W(1) , .., W(n) are weight matrices to be learned from training examples. The network operates like other RNNs by processing each input token and updating the internal states. The elementwise multiplication can be replaced by addition + (corresponding to the partial additive scoring above). As a special case, the additive variant becomes a word-level convolutional neural net (Kim, 2014) when λ = 0.3 3 h[t] = σ(W(1) xt−n+1 + · · · + W(n) xt ) when λ = 0. Deriving Neural Architectures from Sequence and Graph Kernels 2.1. Single Layer as Kernel Computation Now we state how the proposed class embeds string kernel computation. For j ∈ {1, .., n}, let cj [t][i] be the i-th entry (j) of state vector cj [t], wi represents the i-th row of ma(1) (2) (j) trix W(j) . Define wi,j = {wi , wi , ..., wi } as a “reference sequence” constructed by taking the i-th row from each matrix W(1) , .., W(j) . Theorem 1. Let x1:t be the prefix of x consisting of first t tokens, and Kj be the string kernel of j-gram shown in Eq.(3). Then cj [t][i] evaluates kernel function, cj [t][i] = Kj (x1:t , wi,j ) = hφj (x1:t ), φj (wi,j )i for any j ∈ {1, .., n}, t ∈ {1, .., |x|}. In other words, the network embeds sequence similarity computation by assessing the similarity between the input sequence x1:t and the reference sequence wi,j . This interpretation is similar to that of CNNs, where each filter is a “reference pattern” to search in the input. String kernel NN further takes non-consecutive n-gram patterns into consideration (seen from the summation over all n-grams in Eq.(3)). Applying Non-linear Activation In practice, a non-linear activation function such as polynomial or sigmoid-like activation is added to the internal states to produce the final output state h[t]. It turns out that many activations are also functions in the reproducing kernel Hilbert space (RKHS) of certain kernel functions (see Shalev-Shwartz et al. (2011); Zhang et al. (2016)). When this is true, the underlying kernel of h[t] is the composition of string kernel and the kernel containing the activation. We give the formal statements below. Lemma 1. Let x and w be multi-dimensional vectors with finite norm. Consider the function f (x) := σ(w> x) with non-linear activation σ(·). For functions such as polynomials and sigmoid function, there exists kernel functions Kσ (·, ·) and the underlying mapping φσ (·) such that f (x) is in the reproducing kernel Hilbert space of Kσ (·, ·), i.e., f (x) = σ(w> x) = hφσ (x), ψ(w)i for some mapping ψ(w) constructed from w. In particular, 1 Kσ (x, y) can be the inverse-polynomial kernel 2−hx,yi for the above activations. Proposition 1. For one layer string kernel NN with nonlinear activation σ(·) discussed in Lemma 1, h[t][i] as a function of input x belongs to the RKHS introduced by the composition of Kσ (·, ·) and string kernel Kn (·, ·). Here a kernel composition Kσ,n (x, y) is defined with the underlying mapping x 7→ φσ (φn (x)), and hence Kσ,n (x, y) = φσ (φn (x))>φσ (φn (y)). Proposition 1 is the corollary of Lemma 1 and Theorem 1, since h[t][i] = σ(cn [t][i]) = σ(Kn (x1:t , wi,j )) = hφσ (φn (x1:t )), w̃i,j i and φσ (φn (·)) is the mapping for the composed kernel. The same proof applies when h[t] is a linear combination of all ci [t] since kernel functions are closed under addition. 2.2. Deep Networks as Deep Kernel Construction We now address the case when multiple layers of the same module are stacked to construct deeper networks. That is, the output states h(l) [t] of the l-th layer are fed to the (l+1)th layer as the input sequence. We show that layer stacking corresponds to recursive kernel construction (i.e. (l + 1)th kernel is defined on top of l-th kernel), which has been proven for feed-forward networks (Zhang et al., 2016). We first generalize the sequence kernel definition to enable recursive construction. Notice that the definition in Eq.(3) uses the linear kernel (inner product) hxi , yk i as a “subroutine” to measure the similarity between substructures (e.g. tokens) within the sequences. We can therefore replace it with other similarity measures introduced by other “base kernels”. In particular, let K(1) (·, ·) be the string kernel (associated with a single layer). The generalized sequence kernel K(l+1) (x, y) can be recursively defined as, X λx,i,j λy,k,l Kσ(l) (x1:i , y1:k ) Kσ(l) (x1:j , y1:l ) = i<j k<l * + X φ(l) σ (x1:i ) i<j ⊗ φ(l) σ (x1:j ), X φ(l) σ (y1:k ) ⊗ φ(l) σ (y1:l ) k<l where φ(l) (·) denotes the pre-activation mapping of the l(l) th kernel, φσ (·) = φσ (φ(l) (·)) denotes the underlying (post-activation) mapping for non-linear activation σ(·), (l) and Kσ (·, ·) is the l-th post-activation kernel. Based on this definition, a deeper model can also be interpreted as a kernel computation. Theorem 2. Consider a deep string kernel NN with L layers and activation function σ(·). Let the final output (L) state h(L) [t] = σ(cn [t]) (or any linear combination of (l) {ci [t]}, i = 1, .., n). For l = 1, · · · , L, (l) (i) cn [t][i] as a function of input x belongs to the RKHS of kernel K(l) (·, ·); (l) (ii) h(l) [t][i] belongs to the RKHS of kernel Kσ (·, ·). 3. From Graph Kernels to Graph NNs In the previous section, we encode sequence kernel computation into neural modules and demonstrate possible extensions using different base kernels. The same ideas apply Deriving Neural Architectures from Sequence and Graph Kernels to other types of kernels and data. Specifically, we derive neural components for graphs in this section. Notations A graph is defined as G = (V, E), with each vertex v ∈ V associated with feature vector fv . The neighbor of node v is denoted as N (v). Following previous notations, for any kernel function K∗ (·, ·) with underlying mapping φ∗ (·), we use K∗,σ (·, ·) to denote the postactivation kernel induced from the composed underlying mapping φ∗,σ = φσ (φ∗ (·)). We start from random walk graph kernels (Gärtner et al., 2003), which count common walks in two graphs. Formally, let Pn (G) be the set of walks x = x1 · · · xn , where ∀i : (xi , xi+1 ) ∈ E.4 Given two graphs G and G0 , an n-th order random walk graph kernel is defined as: n−1 =λ X X n Y hfxi , fyi i (5) where fxi ∈ Rd is the feature vector of node xi in the walk. Now we show how to realize the above graph kernel with a neural module. Given a graph G, the proposed neural module is: cj [v] = W(1) fv X = λ cj−1 [u] X = σ( cn [v]) W(j) fv (6) 1<j≤n v where again c∗ [v] is the cell state vector of node v, and hG is the representation of graph G aggregated from node vectors. hG could then be used for classification or regression. Now we show the proposed model embeds the random walk kernel. To show this, construct Ln,k as a “refer(1) (n) ence walk” consisting of the row vectors {wk , · · · , wk } from the parameter matrices. Here Ln,k = (LV , LE ), where LV = {v0 , v1 , · · · , vn }, LE = {(vi , vi+1 )} and vi ’s (i) feature vector is wk . We have the following theorem: Theorem 3. For any n ≥ 1, the state value cn [v][k] (the k-th coordinate of cn [v]) satisfies: n For example, the random walk kernel KW can be equivan 0 lently defined with Kloc (v, v ) =  if n = 1  hfv , fv0 i P P n−1 0 Kloc (u, u ) if n > 1  hfv , fv0 i · λ Other kernels like subtree kernels could be recursively defined similarly. Therefore, we adopt this unified view of graph kernels for the rest of this paper. In addition, this definition of random walk kernel could be further generalized and enhanced by aggregating neighbor features non-linearly: X X n−1 n Kloc (v, v 0 ) = hfv , fv0 i ◦ λ Kloc,σ (u, u0 ) where ◦ could be either multiplication or addition. σ(·) n−1 denotes a non-linear activation and Kloc,σ (·, ·) denotes the post-activation kernel when σ(·) is involved. The generalized kernel could be realized by modifying Eq.(6) into: X cj [v] = W(j) fv ◦ λ σ(cj−1 [u]) (8) u∈N (v) where ◦ could be either + or n cn [v][k] = KW (G, Ln,k ) v P n thus v cn [v] lies in the RKHS of kernel KW . As a coroln lary, hG lies in the RKHS of kernel KW,σ (). 4 A single node could appear multiple times in a walk. operation. 3.3. Deep Graph Kernels and NNs Following Section 2, we could stack multiple graph kernel NNs to form a deep network. That is: (l) c1 [v] = W(l,1) h(l−1) [v] (l) cj [v] = W(l,j) h(l−1) [v] ◦ λ X   (l) σ cj−1 [u] u∈N (v) (l) X v0 u∈N (v) u0 ∈N (v 0 ) u∈N (v) hG v u∈N (v) u0 ∈N (v 0 ) x∈Pn (G) y∈Pn (G0 ) i=1 c1 [v] The derivation of the above neural module could be extended to other classes of graph kernels, such as subtree kernels (cf. (Ramon & Gärtner, 2003; Vishwanathan et al., 2010)). Generally speaking, most of these kernel functions factorize graphs into local sub-structures, i.e. XX K(G, G0 ) = Kloc (v, v 0 ) (7) where Kloc (v, v 0 ) measures the similarity between local sub-structures centered at node v and v 0 . 3.1. Random Walk Kernel NNs n KW (G, G0 ) 3.2. Unified View of Graph Kernels h [v] = σ(U(l) c(l) n [v]) 1 ≤ l ≤ L, 1 < j ≤ n The local kernel function is recursively defined in two dimensions: depth (term h(l) ) and width (term cj ). Let the pre-activation kernel in the l-th layer be (l) (l,n) Kloc (v, v 0 ) = Kloc (v, v 0 ), and the post-activation ker(l) (l,n) nel be Kloc,σ (v, v 0 ) = Kloc,σ (v, v 0 ). We recursively define Deriving Neural Architectures from Sequence and Graph Kernels (l,j) Kloc (v, v 0 ) =  (l−1)  Kloc,σ (v, v 0 )  (l−1) Kloc,σ (v, v 0 ) if j = 1 ◦λ P P u∈N (v) u0 ∈N (v 0 ) (l,j−1) Kloc,σ (u, u0 ) if j > 1 for j = 1, · · · , n. Finally, the graph kernel is P (L,n) (L,n) 0 0 K (G, G ) = v,v 0 Kloc (v, v ). Similar to Theorem 2, we have Theorem 4. Consider a deep graph kernel NN with L layers andPactivation function σ(·). Let the final output state hG = v h(L) [v]. For l = 1, · · · , L; j = 1, · · · , n: (l) (i) cj [v][i] as a function of input v and graph G belongs Figure 2. Node relabeling in Weisfeiler-Lehman isomorphism test. Figure taken from Shervashidze et al. (2011) (l,j) to the RKHS of kernel Kloc (·, ·); (l) (ii) h [v][i] belongs to the RKHS of kernel (l,n) Kloc,σ (·, ·). (iii) hG [i] belongs to the RKHS of kernel K(L,n) (·, ·). 3.4. Connection to Weisfeiler-Lehman Kernel We derived the above deep kernel NN for the purpose of generality. This model could be simplified by setting n = 2, without losing representational power (as non-linearity is already involved in depth dimension). In this case, we rewrite the network by reparametrization:     X (l) (l−1) U(l)  h(l) ◦ U2 σ V(l) h(l−1) v =σ u 1 hv u∈N (v) (9) In this section, we further show that this model could be enhanced by sharing weight matrices U and V across layers. This parameter tying mechanism allows our model to embed Weisfeiler-Lehman kernel (Shervashidze et al., 2011). For clarity, we briefly review basic concepts of WeisfeilerLehman kernel below. Weisfeiler-Lehman Graph Relabeling WeisfeilerLehman kernel borrows concepts from the WeisfeilerLehman isomorphism test for labeled graphs. The key idea of the algorithm is to augment the node labels by the sorted set of node labels of neighbor nodes, and compress these augmented labels into new, short labels (Figure 2). Such relabeling process is repeated T times. In the i-th iteration, it generates a new labeling li (v) for all nodes v in graph G, with initial labeling l0 . Generalized Graph Relabeling The key observation here is that graph relabeling operation could be viewed as neighbor feature aggregation. As a result, the relabeling process naturally generalizes to the case where nodes are associated with continuous feature vectors. In particular, let r be the relabeling function. For a node v ∈ G: X r(v) = σ(U1 fv + U2 σ(Vfu )) (10) u∈N (v) Note that our definition of r(v) is exactly the same as hv in Equation 9, with ◦ being additive composition. Weisfeiler-Lehman Kernel Let K be any graph kernel (called base kernel). Given a relabeling function r, Weisfeiler-Lehman kernel with base kernel K and depth L is defined as (L) KW L (G, G0 ) = L X K(ri (G), ri (G0 )) (11) i=0 where r0 (G) = G and ri (G), ri (G0 ) are the i-th relabeled graph of G and G0 respectively. Weisfeiler-Lehman Kernel NN Now with the above kernel definition, and random walk kernel as the base kernel, we propose the following recurrent module: (l) = (l) = c0 [v] cj [v] W(l,0) h(l−1) v X (l) λ cj−1 [u] W(l,j) h(l−1) v u∈N (v)  h(l) v  = σ U1 h(l−1) + U2 v = X X σ(Vh(l−1) ) u u∈N (v) (l) hG c(l) n [v] 1 ≤ l ≤ L, 1 < j ≤ n v (0) where hv = fv and U1 , U2 , V are shared across layers. PL (l) The final output of this network is hG = l=1 hG . The above recurrent module is still an instance of deep kernel, even though some parameters are shared. A minor difference here is that there is an additional random walk kernel NN that connects i-th layer and the output layer. But this is just a linear combination of L deep random walk kernels (of different depth). Therefore, as an corollary of Theorem 4, we have: Proposition 2. For a Weisfeiler-Lehman Kernel NN with L n iterations and random walk kernel KW as base kernel, the P (l) final output state hG = l hG belongs to the RKHS of (L) kernel KW L (·, ·). Deriving Neural Architectures from Sequence and Graph Kernels 4. Adaptive Decay with Neural Gates The sequence and graph kernel (and their neural components) discussed so far use a constant decay value λ regardless of the current input. However, this is often not the case since the importance of the input can vary across the context or the applications. One extension is to make use of neural gates that adaptively control the decay factor. Here we give two illustrative examples: Gated String Kernel NN By replacing constant decay λ with a sigmoid gate, we modify our single-layer sequence module as: λt = σ(U[xt , ht−1 ] + b)   c1 [t] = λt c1 [t − 1] + W(1) xt  cj [t] = λt cj [t − 1] + cj−1 [t − 1] h[t] = σ(cn [t]) W(j) xt  1<j≤n As compared with the original string kernel, now the decay factor λx,i,j is no longer λ|x|−i−1 , but rather an adaptive value based on current context. Gated Random Walk Kernel NN Similarly, we could introduce gates so that different walks have different weights: λu,v = σ(U[fu , fv ] + b) c0 [v] = cj [v] = W(0) fv X λu,v cj−1 [u] W(j) fv u∈N (v) hG = X σ( cn [v]) 1<j≤n v The underlying kernel of the above gated network becomes n KW (G, G0 ) = X X n Y λxi ,yi hfxi , fyi i x∈Pn (G) y∈Pn (G0 ) i=1 where each path is weighted by different decay weights, determined by network itself. 5. Related Work Sequence Networks Considerable effort has gone into designing effective networks for sequence processing. This includes recurrent modules with the ability to carry persistent memories such as LSTM (Hochreiter & Schmidhuber, 1997) and GRU (Chung et al., 2014), as well as non-consecutive convolutional modules (RCNNs, Lei et al. (2015)), and others. More recently, Zoph & Le (2016) exemplified a reinforcement learning-based search algorithm to further optimize the design of such recurrent architectures. Our proposed neural networks offer similar state evolution and feature aggregation functionalities but derive the motivation for the operations involved from wellestablished kernel computations over sequences. Recursive neural networks are alternative architectures to model hierarchical structures such as syntax trees and logic forms. For instance, Socher et al. (2013) employs recursive networks for sentence classification, where each node in the dependency tree of the sentence is transformed into a vector representation. Tai et al. (2015) further proposed tree-LSTM, which incorporates LSTM-style architectures as the transformation unit. Dyer et al. (2015; 2016) recently introduced a recursive neural model for transitionbased language modeling and parsing. While not specifically discussed in the paper, our ideas do extend to similar neural components for hierarchical objects (e.g. trees). Graph Networks Most of the current graph neural architectures perform either convolutional or recurrent operations on graphs. Duvenaud et al. (2015) developed Neural Fingerprint for chemical compounds, where each convolution operation is a sum of neighbor node features, followed by a linear transformation. Our model differs from theirs in that our generalized kernels and networks can aggregate neighboring features in a non-linear way. Other approaches, e.g., Bruna et al. (2013) and Henaff et al. (2015), rely on graph Laplacian or Fourier transform. For recurrent architectures, Li et al. (2015) proposed gated graph neural networks, where neighbor features are aggregated by GRU function. Dai et al. (2016) considers a different architecture where a graph is viewed as a latent variable graphical model. Their recurrent model is derived from Belief Propagation-like algorithms. Our approach is most closely related to Dai et al. (2016), in terms of neighbor feature aggregation and resulting recurrent architecture. Nonetheless, the focus of this paper is on providing a framework for how such recurrent networks could be derived from deep graph kernels. Kernels and Neural Nets Our work follows recent work demonstrating the connection between neural networks and kernels (Cho & Saul, 2009; Hazan & Jaakkola, 2015). For example, Zhang et al. (2016) showed that standard feedforward neural nets belong to a larger space of recursively constructed kernels (given certain activation functions). Similar results have been made for convolutional neural nets (Anselmi et al., 2015), and general computational graphs (Daniely et al., 2016). We extend prior work to kernels and neural architectures over structured inputs, in particular, sequences and graphs. Another difference is how we train the model. While some prior work appeals to convex optimization through improper learning (Zhang et al., 2016; Heinemann et al., 2016) (since kernel space is larger), we use the proposed networks as building blocks in typical non-convex but flexible neural network training. Deriving Neural Architectures from Sequence and Graph Kernels 6. Experiments The left-over question is whether the proposed class of operations, despite its formal characteristics, leads to more effective architecture exploration and hence improved performance. In this section, we apply the proposed sequence and graph modules to various tasks and empirically evaluate their performance against other neural network models. These tasks include language modeling, sentiment classification and molecule regression. 6.1. Language Modeling on PTB Dataset and Setup We use the Penn Tree Bank (PTB) corpus as the benchmark. The dataset contains about 1 million tokens in total. We use the standard train/development/test split of this dataset with vocabulary of size 10,000. Model Configuration Following standard practice, we use SGD with an initial learning rate of 1.0 and decrease the learning rate by a constant factor after a certain epoch. We back-propagate the gradient with an unroll size of 35 and use dropout (Hinton et al., 2012) as the regularization. Unless otherwise specified, we train 3-layer networks with n = 1 and normalized adaptive decay.5 Following (Zilly et al., 2016), we add highway connections (Srivastava et al., 2015) within each layer: c(l) [t] = λt c(l) [t − 1] + (1 − λt ) h(l) [t] = ft c(l) [t] + (1 − ft ) (W(l) h(l−1) [t]) h(l−1) [t] where h(0) [t] = xt , λt is the gated decay factor and ft is the transformation gate of highway connections.6 Results Table 1 compares our model with various state-ofthe-art models. Our small model with 5 million parameters achieves a test perplexity of 73.6, already outperforming many results achieved using much larger network. By increasing the network size to 20 million, we obtain a test perplexity of 69.2, with standard dropout. Adding variational dropout (Gal & Ghahramani, 2016) within the recurrent cells further improves the perplexity to 65.5. Finally, the model achieves 63.8 perplexity when the recurrence depth is increased to 4, being state-of-the-art and on par with the results reported in (Zilly et al., 2016; Zoph & Le, 2016). Note that Zilly et al. (2016) uses 10 neural layers and Zoph & Le (2016) adopts a complex recurrent cell found by reinforcement learning based search. Our network is architecturally much simpler. Figure 3 analyzes several variants of our model. Wordlevel CNNs are degraded cases (λ = 0) that ignore non5 See the supplementary sections for a discussion of network variants. 6 We found non-linear activation is no longer necessary when the highway connection is added. Table 1: Comparison with state-of-the-art results on PTB. |θ| denotes the number of parameters. Following recent work (Press & Wolf, 2016), we share the input and output word embedding matrix. We report the test perplexity (PPL) of each model. Lower number is better. Model LSTM (large) (Zaremba et al., 2014) Character CNN (Kim et al., 2015) Variational LSTM (Gal & Ghahramani) Variational LSTM (Gal & Ghahramani) Pointer Sentinel-LSTM (Merity et al.) Variational RHN (Zilly et al., 2016) Neural Net Search (Zoph & Le, 2016) Kernel NN (λ = 0.8) Kernel NN (λ learned as parameter) Kernel NN (gated λ) Kernel NN (gated λ) + variational dropout + variational dropout, 4 RNN layers CNNs PPL 78.4 78.9 78.6 73.4 70.9 65.4 64.0 84.3 76.8 73.6 69.2 65.5 63.8 99.0 constants (0.8) constants (trained) |θ| 66m 19m 20m 66m 21m 23m 25m 5m 5m 5m 20m 20m 20m 84.3 76.8 adaptive (x) 74.2 adaptive (x and h) 73.6 Figure 3. Comparison between kernel NN variants on PTB. |θ| = 5m for all models. Hyper-parameter search is performed for each variant. contiguous n-gram patterns. Clearly, this variant performs worse compared to other recurrent variants with λ > 0. Moreover, the test perplexity improves from 84.3 to 76.8 when we train the constant decay vector as part of the model parameters. Finally, the last two variants utilize neural gates (depending on input xt only or both input xt and previous state h[t−1]), further improving the performance. 6.2. Sentiment Classification Dataset and Setup We evaluate our model on the sentence classification task. We use the Stanford Sentiment Treebank benchmark (Socher et al., 2013). The dataset consists of 11855 parsed English sentences annotated at both the root (i.e. sentence) level and the phrase level using 5class fine-grained labels. We use the standard split for training, development and testing. Following previous work, we also evaluate our model on the binary classification variant of this benchmark, ignoring all neutral sentences. Deriving Neural Architectures from Sequence and Graph Kernels Table 2: Classification accuracy on Stanford Sentiment Treebank. Block I: recursive networks; Block II: convolutional or recurrent networks; Block III: other baseline methods. Higher number is better. Model RNN (Socher et al. (2011)) RNTN (Socher et al. (2013)) DRNN (Irsoy & Cardie (2014)) RLSTM (Tai et al. (2015)) DCNN (Kalchbrenner et al. (2014)) CNN-MC (Kim (2014)) Bi-LSTM (Tai et al. (2015)) LSTMN (Cheng et al. (2016)) PVEC (Le & Mikolov (2014)) DAN (Iyyer et al. (2014)) DMN (Kumar et al. (2016)) Kernel NN, λ = 0.5 Kernel NN, gated λ Fine 43.2 45.7 49.8 51.0 48.5 47.4 49.1 47.9 48.7 48.2 52.1 51.2 53.2 Binary 82.4 85.4 86.8 88.0 86.9 88.1 87.5 87.0 87.8 86.8 88.6 88.6 89.9 Table 3: Experiments on Harvard Clean Energy Project. We report Root Mean Square Error(RMSE) on test set. The first block lists the results reported in Dai et al. (2016) for reference. For fair comparison, we reimplemented their best model so that all models are trained under the same setup. Results under our setup is reported in second block. Model (Dai et al., 2016) Mean Predicator Weisfeiler-lehman Kernel, degree=3 Weisfeiler-lehman Kernel, degree=6 Embedded Mean Field Embedded Loopy BP Under Our Setup Neural Fingerprint Embedded Loopy BP Weisfeiler Kernel NN Weisfeiler Kernel NN, gated λ |θ| 1 1.6m 1378m 0.1m 0.1m RMSE 2.4062 0.2040 0.1367 0.1250 0.1174 0.26m 0.26m 0.26m 0.26m 0.1409 0.1065 0.1058 0.1043 emphasis on molecules with higher PCE values, since the data is distributed unevenly. Following the recent work of DAN (Iyyer et al., 2015) and RLSTM (Tai et al., 2015), we use the publicly available 300-dimensional GloVe word vectors (Pennington et al., 2014). Unlike prior work which fine tunes the word vectors, we normalize the vectors (i.e. kwk22 = 1) and fixed them for simplicity. We use the same feature set as in Duvenaud et al. (2015) for atoms and bonds. Initial atom features include the atoms element, its degree, the number of attached hydrogens, its implicit valence, and an aromaticity indicator. The bond feature is a concatenation of bond type indicator, whether the bond is conjugated, and whether the bond is in a ring. Model Configuration Our best model is a 3-layer network with n = 2 and hidden dimension d = 200. We average the hidden states h[t] across t, and concatenate the averaged vectors from the 3 layers as the input of the final softmax layer. The model is optimized with Adam (Kingma & Ba, 2015), and dropout probability of 0.35. Model Configuration Our model is a Weisfeiler-Lehman NN, with 4 recurrent iterations and n = 2. All models (including baseline) are optimized with Adam (Kingma & Ba, 2015), with learning rate decay factor 0.9. Results Table 2 presents the performance of our model and other networks. We report the best results achieved across 5 independent runs. Our best model obtains 53.2% and 89.9% test accuracies on fine-grained and binary tasks respectively. Our model with only a constant decay factor also obtains quite high accuracy, outperforming other baseline methods shown in the table. 6.3. Molecular Graph Regression Dataset and Setup We further evaluate our graph NN models on the Harvard Clean Energy Project benchmark, which has been used in Dai et al. (2016); Duvenaud et al. (2015) as their evaluation dataset. This dataset contains 2.3 million candidate molecules, with each molecule labeled with its power conversion efficiency (PCE) value. We follow exactly the same train-test split as Dai et al. (2016), and the same re-sampling procedure on the training data (but not the test data) to make the algorithm put more Results In Table 3, we report the performance of our model against other baseline methods. Neural Fingerprint (Duvenaud et al., 2015) is a 4-layer convolutional neural network. Convolution is applied to each atom, which sums over its neighbors’ hidden state, followed by a linear transformation and non-linear activation. Embedded Loopy BP (Dai et al., 2016) is a recurrent architecture, with 4 recurrent iterations. It maintains message vectors for each atom and bond, and propagates those vectors in a message passing fashion. Table 3 shows our model achieves stateof-the-art against various baselines. 7. Conclusion We proposed a class of deep recurrent neural architectures and formally characterized its underlying computation using kernels. By linking kernel and neural operations, we have a “template” for deriving new families of neural architectures for sequences and graphs. We hope the theoretical view of kernel neural networks can be helpful for future model exploration. Deriving Neural Architectures from Sequence and Graph Kernels Acknowledgement We thank Prof. Le Song for sharing Harvard Clean Energy Project dataset. We also thank Yu Zhang, Vikas Garg, David Alvarez, Tianxiao Shen, Karthik Narasimhan and the reviewers for their helpful comments. This work was supported by the DARPA Make-It program under contract ARO W911NF-16-2-0023. References Anselmi, Fabio, Rosasco, Lorenzo, Tan, Cheston, and Poggio, Tomaso. Deep convolutional networks are hierarchical kernel machines. preprint arXiv:1508.01084, 2015. Balduzzi, David and Ghifary, Muhammad. Strongly-typed recurrent neural networks. In Proceedings of 33th International Conference on Machine Learning (ICML), 2016. Bruna, Joan, Zaremba, Wojciech, Szlam, Arthur, and LeCun, Yann. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013. Cheng, Jianpeng, Dong, Li, and Lapata, Mirella. Long short-term memory networks for machine reading. Proceedings of the Conference on Empirical Methods in Natural Language Processing, pp. 551–562, 2016. Cho, Youngmin and Saul, Lawrence K. Kernel methods for deep learning. In Bengio, Y., Schuurmans, D., Lafferty, J. D., Williams, C. K. I., and Culotta, A. (eds.), Advances in Neural Information Processing Systems 22, pp. 342– 350. 2009. Dyer, Chris, Ballesteros, Miguel, Ling, Wang, Matthews, Austin, and Smith, Noah A. Transition-based dependency parsing with stack long short-term memory. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Beijing, China, July 2015. Dyer, Chris, Kuncoro, Adhiguna, Ballesteros, Miguel, and Smith, Noah A. Recurrent neural network grammars. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics, San Diego, California, June 2016. Gal, Yarin and Ghahramani, Zoubin. A theoretically grounded application of dropout in recurrent neural networks. In Advances in Neural Information Processing Systems 29 (NIPS), 2016. Gärtner, Thomas, Flach, Peter, and Wrobel, Stefan. On graph kernels: Hardness results and efficient alternatives. In Learning Theory and Kernel Machines, pp. 129–143. Springer, 2003. Greff, Klaus, Srivastava, Rupesh Kumar, Koutnı́k, Jan, Steunebrink, Bas R, and Schmidhuber, Jürgen. Lstm: A search space odyssey. arXiv preprint arXiv:1503.04069, 2015. Hazan, Tamir and Jaakkola, Tommi. Steps toward deep kernel methods from infinite neural networks. arXiv preprint arXiv:1508.05133, 2015. Heinemann, Uri, Livni, Roi, Eban, Elad, Elidan, Gal, and Globerson, Amir. Improper deep kernels. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pp. 1159–1167, 2016. Chung, Junyoung, Gulcehre, Caglar, Cho, KyungHyun, and Bengio, Yoshua. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014. Henaff, Mikael, Bruna, Joan, and LeCun, Yann. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015. Dai, Hanjun, Dai, Bo, and Song, Le. Discriminative embeddings of latent variable models for structured data. arXiv preprint arXiv:1603.05629, 2016. Hinton, Geoffrey E, Srivastava, Nitish, Krizhevsky, Alex, Sutskever, Ilya, and Salakhutdinov, Ruslan R. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012. Daniely, Amit, Frostig, Roy, and Singer, Yoram. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. CoRR, abs/1602.05897, 2016. Hochreiter, Sepp and Schmidhuber, Jürgen. Long shortterm memory. Neural computation, 9(8):1735–1780, 1997. Duvenaud, David K, Maclaurin, Dougal, Iparraguirre, Jorge, Bombarell, Rafael, Hirzel, Timothy, AspuruGuzik, Alán, and Adams, Ryan P. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224–2232, 2015. Irsoy, Ozan and Cardie, Claire. Deep recursive neural networks for compositionality in language. In Advances in Neural Information Processing Systems, 2014. Iyyer, Mohit, Boyd-Graber, Jordan, Claudino, Leonardo, Socher, Richard, and Daumé III, Hal. A neural network for factoid question answering over paragraphs. In Deriving Neural Architectures from Sequence and Graph Kernels Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 633– 644, Doha, Qatar, October 2014. Merity, Stephen, Xiong, Caiming, Bradbury, James, and Socher, Richard. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016. Iyyer, Mohit, Manjunatha, Varun, Boyd-Graber, Jordan, and Daumé III, Hal. Deep unordered composition rivals syntactic methods for text classification. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2015. Pennington, Jeffrey, Socher, Richard, and Manning, Christopher D. Glove: Global vectors for word representation. volume 12, 2014. Kalchbrenner, Nal, Grefenstette, Edward, and Blunsom, Phil. A convolutional neural network for modelling sentences. In Proceedings of the 52th Annual Meeting of the Association for Computational Linguistics, 2014. Kim, Yoon. Convolutional neural networks for sentence classification. In Proceedings of the Empiricial Methods in Natural Language Processing (EMNLP 2014), 2014. Kim, Yoon, Jernite, Yacine, Sontag, David, and Rush, Alexander M. Character-aware neural language models. Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015. Kingma, Diederik P and Ba, Jimmy Lei. Adam: A method for stochastic optimization. In International Conference on Learning Representation, 2015. Kumar, Ankit, Irsoy, Ozan, Ondruska, Peter, Iyyer, Mohit, James Bradbury, Ishaan Gulrajani, Zhong, Victor, Paulus, Romain, and Socher, Richard. Ask me anything: Dynamic memory networks for natural language processing. 2016. Le, Quoc and Mikolov, Tomas. Distributed representations of sentences and documents. In Proceedings of the 31st International Conference on Machine Learning (ICML14), pp. 1188–1196, 2014. Lee, Kenton, Levy, Omer, and Zettlemoyer, Luke. Recurrent additive networks. Preprint, 2017. Lei, Tao, Joshi, Hrishikesh, Barzilay, Regina, Jaakkola, Tommi, Tymoshenko, Katerina, Moschitti, Alessandro, and Marquez, Lluis. Semi-supervised question retrieval with gated convolutions. arXiv preprint arXiv:1512.05726, 2015. Press, Ofir and Wolf, Lior. Using the output embedding to improve language models. arXiv preprint arXiv:1608.05859, 2016. Ramon, Jan and Gärtner, Thomas. Expressivity versus efficiency of graph kernels. In First international workshop on mining graphs, trees and sequences, pp. 65–74. Citeseer, 2003. Shalev-Shwartz, Shai, Shamir, Ohad, and Sridharan, Karthik. Learning kernel-based halfspaces with the 01 loss. SIAM Journal on Computing, 40(6):1623–1646, 2011. Shervashidze, Nino, Schweitzer, Pascal, Leeuwen, Erik Jan van, Mehlhorn, Kurt, and Borgwardt, Karsten M. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(Sep):2539–2561, 2011. Socher, Richard, Pennington, Jeffrey, Huang, Eric H, Ng, Andrew Y, and Manning, Christopher D. Semisupervised recursive autoencoders for predicting sentiment distributions. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pp. 151–161, 2011. Socher, Richard, Perelygin, Alex, Wu, Jean, Chuang, Jason, Manning, Christopher D., Ng, Andrew Y., and Potts, Christopher. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1631–1642, October 2013. Srivastava, Rupesh K, Greff, Klaus, and Schmidhuber, Jürgen. Training very deep networks. In Advances in neural information processing systems, pp. 2377–2385, 2015. Li, Yujia, Tarlow, Daniel, Brockschmidt, Marc, and Zemel, Richard. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015. Tai, Kai Sheng, Socher, Richard, and Manning, Christopher D. Improved semantic representations from treestructured long short-term memory networks. In Proceedings of the 53th Annual Meeting of the Association for Computational Linguistics, 2015. Lodhi, Huma, Saunders, Craig, Shawe-Taylor, John, Cristianini, Nello, and Watkins, Chris. Text classification using string kernels. Journal of Machine Learning Research, 2(Feb):419–444, 2002. Tamar, Aviv, Levine, Sergey, Abbeel, Pieter, Wu, Yi, and Thomas, Garrett. Value iteration networks. In Advances in Neural Information Processing Systems, pp. 2146– 2154, 2016. Deriving Neural Architectures from Sequence and Graph Kernels Vishwanathan, S Vichy N, Schraudolph, Nicol N, Kondor, Risi, and Borgwardt, Karsten M. Graph kernels. Journal of Machine Learning Research, 11(Apr):1201–1242, 2010. Zaremba, Wojciech, Sutskever, Ilya, and Vinyals, Oriol. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014. Zhang, Yuchen, Lee, Jason D., and Jordan, Michael I. `1 regularized neural networks are improperly learnable in polynomial time. In Proceedings of the 33nd International Conference on Machine Learning, 2016. Zilly, Julian Georg, Srivastava, Rupesh Kumar, Koutnı́k, Jan, and Schmidhuber, Jürgen. Recurrent Highway Networks. arXiv preprint arXiv:1607.03474, 2016. Zoph, Barret and Le, Quoc V. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016. Supplementary Material A. Examples of kernel / neural variants Our theoretical results apply to some other variants of sequence kernels and the associated neural components. We give some examples in the this section. Table 4 shows three network variants, corresponding to three realizations of string kernels provided in Table 5. Connection to LSTMs Interestingly, many recent work has reached similar RNN architectures through empirical exploration. For example, Greff et al. (2015) found that simplifying LSTMs, by removing the input gate or coupling it with the forget gate does not significantly change the performance. However, the forget gate (corresponding to the decay factor λ in our notation) is crucial for performance. This is consistent with our theoretical analysis and the empirical results in Figure 3. Moreover, Balduzzi & Ghifary (2016) and Lee et al. (2017) both suggest that a linear additive state computation suffices to provide competitive performance compared to LSTMs: 7 c[t] = λf c1 [t − 1] + λi (Wxt ) h[t] = σ(c[t]) In fact, this variant becomes an instance of the kernel NN presented in this work (with n = 1 and adaptive gating), when λf = λt and λi = 1 − λt or 1. Balduzzi & Ghifary (2016) also includes the previous token , i.e. Wxt + W0 xt−1 , which doesn’t affect the discussion here. 7 Table 4: Example sequence NN variants. We present these equations in the context of n = 3. (a) Multiplicative mapping, aggregation un-normalized: c1 [t] = λ · c1 [t − 1] + W(1) xt  c2 [t] = λ · c2 [t − 1] + c1 [t − 1]  c3 [t] = λ · c3 [t − 1] + c2 [t − 1] W(2) xt  W(3) xt  (b) Multiplicative mapping, aggregation normalized: c1 [t] = λ · c1 [t − 1] + (1 − λ) · W(1) xt  c2 [t] = λ · c2 [t − 1] + (1 − λ) · c1 [t − 1]  c3 [t] = λ · c3 [t − 1] + (1 − λ) · c2 [t − 1] W(2) xt  W(3) xt  (c) Additive mapping, aggregation normalized: c1 [t] = λ · c1 [t − 1] + (1 − λ) · W(1) xt   c2 [t] = λ · c2 [t − 1] + (1 − λ) · c1 [t − 1] + W(2) xt   c3 [t] = λ · c3 [t − 1] + (1 − λ) · c2 [t − 1] + W(3) xt Final activation: h[t] = σ (c3 [t]) h[t] = σ (c1 [t] + c2 [t] + c3 [t]) (any linear combination of c∗ [t]) Table 5: Examples of sequence kernel functions and associated mappings. [xi , xj ] denotes the concatenation of two vectors. (a) Multiplicative mapping, aggregation un-normalized: X K2 (x, y) = X λ|x|−i−1 λ|y|−k−1 hxi , yk i · hxj , yl i 1≤i<j≤|x| 1≤k<l≤|y| X φ2 (x) = λ|x|−i−1 xi ⊗ xj 1≤i<j≤|x| (b) Multiplicative mapping, aggregation normalized: K2 (x, y) = s.t. 1 Z X X λ|x|−i−1 λ|y|−k−1 hxi , yk i · hxj , yl i 1≤i<j≤|x| 1≤k<l≤|y| X Z= X λ|x|−i−1 λ|y|−k−1 1≤i<j≤|x| 1≤k<l≤|y| φ2 (x) = s.t. 1 Z0 X λ|x|−i−1 xi ⊗ xj 1≤i<j≤|x| Z0 = X λ|x|−i−1 1≤i<j≤|x| (c) Additive mapping, aggregation normalized: K2 (x, y) = s.t. 1 Z X X λ|x|−i−1 λ|y|−k−1 (hxi , yk i + hxj , yl i) 1≤i<j≤|x| 1≤k<l≤|y| X Z= X λ|x|−i−1 λ|y|−k−1 1≤i<j≤|x| 1≤k<l≤|y| φ2 (x) = s.t. 1 Z0 X λ|x|−i−1 [xi , xj ] 1≤i<j≤|x| Z0 = X 1≤i<j≤|x| λ|x|−i−1 B. Proof of Theorem 1 We first generalize the kernel definition in Eq.(3) to the case of any n-gram. For any integer n > 0, the underlying mapping of the n-th order string kernel is defined as, X φn (x) = λ|x|−i1 −n+1 xi1 ⊗ xi2 ⊗ · · · ⊗ xin 1≤i1 <···<in ≤|x| We now show that String Kernel NN states cn [t] defined in (4), c1 [t] = λ · c1 [t − 1] + W(1) xt  cn [t] = λ · cn [t − 1] + cn−1 [t − 1] n=1: n>1: W(n) xt  is equivalent to summing over all n-grams within the first t tokens x1:t = {x1 , · · · , xt },   X W(1) xi1 · · · W(n) xin · λt−i1 −n+1 cn [t] = 1≤i1 <i2 <···<in ≤t Proof: We prove the equivalence by induction. When n = 1, for c1 [t] we have,  X  c1 [t] = W(1) xi1 · λt−i1 1≤i1 ≤t    X =   W(1) xi1 · λt−1−i1  ·λ + W(1) xt 1≤i1 ≤t−1 {z | } c1 [t−1] = c1 [t − 1] · λ + W(1) xt When n = k > 1, suppose the state iteration holds for 1, · · · , k − 1, we have,   X cn [t] = W(1) xi1 · · · W(n) xin · λt−i1 −n+1 1≤i1 <i2 <···<in ≤t    X =  W(1) xi1  W(n) xin · λt−1−i1 −n+1  ·λ ··· 1≤i1 <i2 <···<in ≤t−1 {z | } when in <t: cn [t−1]  +   X W(1) xi1 ···  W(n) xin · λt−1−i1 −n+1  1≤i1 <i2 <···<in =t | = cn [t − 1] · λ + {z } when in =t  Now we proceed to prove Theorem 1. cn−1 [t − 1] W(n) xt  Proof: From the above results, we know that for cn [t],  X W(1) xi1 · · · cn [t] =  W(n) xin · λt−i1 −n+1 1≤i1 <i2 <···<in ≤t In particular, the value of the i-th entry, cn [t][i], is equal to, D E D E X (1) (n) wi , xi1 · · · wi , xin · λt−i1 −n+1 cn [t][i] = {z } 1≤i1 <i2 <···<in ≤t | D (1) (n) xi1 ⊗···⊗xin ,wi ⊗···⊗wi E * = + X λ t−i1 −n+1 xi1 ⊗ · · · ⊗ xin , (1) wi ⊗ ··· ⊗ (n) wi 1≤i1 <i2 <···<in ≤t = hφn (x1:t ), φn (wi,n )i (k) (1) (n) where wi represents the i-th row of matrix W(k) and wi,n = {wi , · · · , wi }. This completes the proof since Kn (x1:t , wi,n ) = hφn (x1:t ), φn (wi,n )i by definition. Remarks This theorem demonstrates that the NN state vectors cn can be seen as projecting the kernel mapping φn (x) into a low-dimensional space using the parameterized matrices {W(i) }i = 1n . This is similar to word embeddings and CNNs, where the input (a single word or an n-gram) is projected to obtain a low-dimensional representation. C. Proof of Theorem 2 We first review necessary concepts and notations for the ease of reading. Similar to the proof in Ap(l) pendix B, the generalized string kernel K(l) and Kσ in Eq.(??) can be defined with the underlying mappings, X φ(l) (x) = λ|x|−i1 −n+1 φ(l−1) (x1:i1 ) ⊗ φ(l−1) (x1:i2 ) ⊗ · · · ⊗ φ(l−1) (x1:i1 ) σ σ σ 1≤i1 <···<in ≤|x| (l) φ(l) σ (x) = φσ (φ (x)) where φσ () is the underlying mapping of a kernel function whose reproducing kernel Hilbert space (RKHS) contains the non-linear activation σ() used in the String Kernel NN layer. Here K(l) () is the (l) “pre-activation kernel” and Kσ () is the “post-activation kernel”. To show that the values of String Kernel NN states c(l) [t] is contained in the RKHS of K(l) () and that of h(l) [t] is contained in the RKHS (l) of Kσ (), we re-state the claim in the following way, Theorem 5. Given a deep n-gram String Kernel NN with non-linear activation σ(). Assuming σ() lies in the RKHS of a kernel function with underlying mapping φσ (), then (i) c(l) [t] lies in the RKHS of kernel K(l) () in the sense that D E (l) (l) cj [t][i] = φ(l) (x1:t ), ψi,j (l) (l) for any internal state cj [t] (1 ≤ j ≤ n) of the l-th layer, where ψi,j is a mapping constructed from model parameters; (l) (ii) h(l) [t] lies in the RKHS of kernel Kσ () as a corollary in the sense that h(l) [t][i] = σ(c(l) n [t][i]) D E (l) = σ φ(l) (x1:t ), ψi,n D E (l) = φσ (φ(l) (x1:t )), ψσ (ψi,n ) (l) (based on (i)) (Lemma 1) (l) and we denote ψσ (ψi,n ) as ψσ,i,n for short. (1) Proof: We prove by induction on l. When l = 1, the proof of Theorem 1 already shows that cj [t][i] = D E (1) (1) (1) (1) φj (x1:t ), φj (wi,j ) in a one-layer String Kernel NN. Simply let ψi,j = φj (wi,j ) completes the proof for the case of l = 1. Suppose the lemma holds for l = 1, · · · , k, we now prove the case of l = k + 1. Similar to the proof of (k+1) Theorem 1, the value of cj [t][i] equals to (k+1) cj [t][i] = X 1≤i1 <···<ij ≤t D E D E (1) (j) wi , h(k) [i1 ] · · · wi , h(k) [ij ] · λt−i1 −j+1 (12) (j) where wi is theE i-th row of the parameter matrix W(j) of the l-th layer. Note h(k) [t][i] = D (k) (k) (k) φσ (x1:t ), ψσ,i,n , we construct a matrix M by stacking all {ψσ,i,n }i as the row vectors.8 We then (k) can rewrite h(k) [t] = M φσ (x1:t ). Plugging this into Eq (12), we get D E D E X (1) (j) (k+1) (k) wi , M φ(k) · λt−i1 −j+1 cj [t][i] = σ (x1:i1 ) · · · wi , M φσ (x1:ij ) 1≤i1 <···<ij ≤t + * X = > M | {z 1≤i1 <···<ij ≤t X = (1) wi , φ(k) σ (x1:i1 ) ui,1 D } * + > (j) wi , φ(k) σ (x1:ij ) ··· M | {z ui,j · λt−i1 −j+1 } E D E (k) ui,1 , φ(k) (x ) · · · u , φ (x ) · λt−i1 −j+1 1:i i,j 1:i σ σ 1 j 1≤i1 <···<ij ≤t * + X = (k) λt−i1 −j+1 φ(k) σ (xi1 ) ⊗ · · · ⊗ φσ (xij ), ui,1 ⊗ · · · ⊗ ui,j 1≤i1 <···<ij ≤t | = (k+1) Define ψi,j 8 {z φ(k+1) (x1:t ) } D E φ(k+1) (x1:t ), ui,1 ⊗ · · · ⊗ ui,j = ui,1 ⊗ · · · ⊗ ui,j completes the proof for the case of l = k + 1. (k) (k) Note in practice the mappings φσ and ψσ may have infinite dimension because the underlying mapping for the non-linear activation φσ () can have infinite dimension. The proof still apply since the dimensions are still countable and the vectors have finite norm (easy to show this by assuming the input xi and parameter W are bounded. D. Proof for Theorem 3 Recall that random walk graph kernel is defined as: Kn (G, G0 ) X = λn X n Y hfxi , fyi i x∈Pn (G) y∈Pn (G0 ) i=1 X = λn φn (G) fx0 ⊗ fx1 ⊗ · · · ⊗ fxn x∈Pn (G) and single-layer graph NN computes its states as: X cn [v] = λ cn−1 [u] W(n) fv u∈N (v) = λ n = λ n X X ··· un−1 ∈N (v) un−2 ∈N (un−1 ) X W (0) X W(0) fu0 W(1) fu1 ··· W(n) fun u0 ∈N (u1 ) fu0 W(1) fu1 ··· W(n) fun u=u0 ···un ∈Pn (G,v) where we define Pn (G, v) be the set of walks that end with node v. For the i-th coordinate of cn [v], we have E X Y D (i) cn [v][i] = λn wi , fui u∈Pn (G,v) i X v cn [v][i] = λn X E Y D (i) wi , fui u∈Pn (G) i = Kn (G, Ln,k ) (0) (1) (n) The last step relies on the fact that Pn (Ln,k ) has only one element {wi , wi , · · · , wi }. E. Proof for Theorem 4 For clarity, we re-state the kernel definition and theorem in the following: X X (L,n) Kloc,σ (v, v 0 ) K(L,n) (G, G0 ) = v0 v When l = 1:   if j = 1  hfv , fv0 i   P P (l,j−1) (l,j) Kloc,σ (u, u0 ) if j > 1 Kloc (v, v 0 ) = hfv , fv0 i + λ  u∈N (v) u0 ∈N (v 0 )   0 if Pj (G, v) = ∅ or Pj (G0 , v 0 ) = ∅ When l > 1:  (l−1)  Kloc,σ (v, v 0 ) if j = 1    (l−1) P P (l,j−1) 0 0 (l,j) 0 Kloc,σ (u, u ) if j > 1 Kloc (v, v ) = Kloc,σ (v, v ) + λ  u∈N (v) u0 ∈N (v 0 )    0 if Pj (G, v) = ∅ or Pj (G0 , v 0 ) = ∅ (l,j) where Pj (G, v) is the set of walks of length j starting from v. Note that we force Kloc = 0 when there is no valid walk starting from v or v 0 , so that it only considers walks of length j. We use additive version just for illustration (multiplicative version follows the same argument). Theorem 6. For a deep random P walk kernel NN with L layers and activation function σ(·), assuming the final output state hG = v h(l) [v], for l = 1, · · · , L; j = 1, · · · , n: (l) (l,j) (i) cj [v][i] as a function of input v and graph G belongs to the RKHS of kernel Kloc (·, ·) in that D E (l) (l,j) (l) cj [v][i] = φG (v), ψi,j (l) (l) where φG (v) is the mapping of node v in graph G, and ψi,j is a mapping constructed from model parameters. (l,n) (ii) h(l) [v][i] belongs to the RKHS of kernel Kloc,σ (·, ·) as a corollary: ! h(l) [v][i] = X σ uik c(l) n [v][k] =σ k (l,n) (l) φG (v), ψk,n +! (l,n) φG (v), σ uik D k * = X X (l) uik ψk,n k * !+ (l,n) φσ (φG (v)), ψσ = X (l) uik ψk,n k We denote ψσ P k (l)  (l) (l,n) uik ψk,n as ψσ,i,n , and φσ (φG (l) (v)) as φG,σ (v) for short. ! E (iii) hG [i] belongs to the RKHS of kernel K(L,n) (·, ·). Proof of (i), (ii): We prove by induction on l. When l = 1, from kernel definition, the kernel mapping is recursively defined as:   fv if j = 1   #  " √ P (1,j) (1,j−1) φG (v) = φσ (φG (u)) if j > 1 fv , λ   u∈N (v)    0 if Pj (G, v) = ∅ or Pj (G0 , v 0 ) = ∅ (1) We prove cj [v][i] = D E D E (1,j) (1) (1) (1,1) φG (v), ψi,j by induction on j. When j = 1, c1 [v][i] = wi , fv . (1) (1,1) Our hypothesis holds by ψi,1 = wi Pj (G, v) = ∅, we could always set (1) cj [v][i] = . Suppose induction hypothesis holds for 1, 2, · · · , j − 1. If (1) cj [v][i] = 0 in neural network computation. Otherwise: D E   X (1,j) (1) wi , fv + λ σ cj−1 [u][i] u∈N (v) D E D E X (1,j) (1,j−1) (1) = wi , fv + λ σ φG (u), ψi,j−1 u∈N (v) E D E √ X D √ (1) (1,j−1) (1,j) φσ (φG (u)), λψσ (ψi,j−1 ) = wi , fv + λ u∈N (v) * = √ fv , λ  (1,j−1) φσ (φG (u)) , X h (1,j) wi , √ i + (1) λψσ (ψi,j−1 ) u∈N (v) h i (1) (1,j) √ (1) Let ψi,j = wi , λψσ (ψi,j−1 ) concludes the base case l = 1. Suppose induction hypothesis holds for 1, 2, · · · , l − 1. Note that when l > 1:  (l−1)  φσ (φG (v)) if j = 1   #  " √ P (l,j) (l−1) (l,j−1) φG (v) = φσ (φG (v)), λ φσ (φG (u)) if j > 1   u∈N (v)    0 if Pj (G, v) = ∅ or Pj (G0 , v 0 ) = ∅ D E (l) (l,j) (l) Now we prove cj [v][i] = φG (v), ψi,j by induction on j. When j = 1, (l) c1 [v][i] D E (l,1) wi , h(l−1) [v] E X (l,1) D (l−1) (l−1) = wik φG,σ (v), ψσ,k,n = k * = (l,1) φG (v), + X k (l,1) (l−1) wik ψσ,k,n P (l) (l,1) (l−1) Let ψi,j = k wik ψσ,k,n completes the proof for j = 1. Now suppose this holds for 1, 2, · · · , j − 1. Same as before, we only consider the case when Pj (G, v) 6= ∅: D E   X (l) (l,j) (l) cj [v][i] = wi , h(l−1) [v] + λ σ cj−1 [u][i] u∈N (v) = X D E D E X (l,j) (l−1) (l−1) (l,j−1) (l) wik φG,σ (v), ψσ,k,n + λ σ φG (u), ψi,j−1 k u∈N (v) * + (l−1) φG,σ (v), = X (l,j) (l−1) wik ψσ,k,n k u∈N (v) * + (l−1) φG,σ (v), = X (l,j) (l−1) wik ψσ,k,n k X λ (l,j−1) φG,σ (u), √ + (l) λψσ (ψi,j−1 )  " u∈N (v) (l) + √ #+ X (l,j) (l−1) √ √ X (l,j−1) (l) φ(l−1) (v), λ  φG,σ (u) , wik ψσ,k,n , λψσ (ψi,j−1 ) G,σ = Let ψi,j = * u∈N (v) * = E X D (l,j−1) (l) φG,σ (u), ψσ (ψi,j−1 ) +λ D (l,j) (l) φG (v), ψi,j k E i (l,j) (l−1) √ (l) w ψ , λψ (ψ ) concludes the proof. σ i,j−1 k ik σ,k,n hP Proof for (iii): We construct a directed chain Ln,k = (V, E) from model parameters, with nodes V = (L) {ln , ln−1 , · · · , l0 } and E = {(vi+1 , vi )}. lj ’s underlying mapping is ψσ,i,j . Now we have hG [i] = X v h(L) [v][i] = E X X XD (L) (L) (L,n) φσ (φG (v)), ψσ,i,n = Kloc (v, ln ) = K(L,n) (G, Ln,k ) v∈G v∈G v∈Ln,k (L,n) Note that we are utilizing the fact that Kloc (v, lj ) = 0 for all j 6= n (because Pn (Ln,j , lj ) = ∅).
9cs.NE
Accurate reconstruction of image stimuli from human fMRI based on the decoding model with capsule network architecture Kai Qiao, Chi Zhang, Linyuan Wang, Bin Yan, Jian Chen, Lei Zeng, Li Tong* National Digital Switching System Engineering and Technological Research Center, Zhengzhou, China, 450001 *Correspondence author: Li Tong [email protected] Abstract In neuroscience, all kinds of computation models were designed to answer the open question of how sensory stimuli are encoded by neurons and conversely, how sensory stimuli can be decoded from neuronal activities. Especially, functional Magnetic Resonance Imaging (fMRI) studies have made many great achievements with the rapid development of the deep network computation. However, comparing with the goal of decoding orientation, position and object category from activities in visual cortex, accurate reconstruction of image stimuli from human fMRI is a still challenging work. In this paper, the capsule network (CapsNet) architecture based visual reconstruction (CNAVR) method is developed to reconstruct image stimuli. The capsule means containing a group of neurons to perform the better organization of feature structure and representation, inspired by the structure of cortical mini column including several hundred neurons in primates. The high-level capsule features in the CapsNet includes diverse features of image stimuli such as semantic class, orientation, location and so on. We used these features to bridge between human fMRI and image stimuli. We firstly employed the CapsNet to train the nonlinear mapping from image stimuli to high-level capsule features, and from highlevel capsule features to image stimuli again in an end-to-end manner. After estimating the serviceability of each voxel by encoding performance to accomplish the selecting of voxels, we secondly trained the nonlinear mapping from dimension-decreasing fMRI data to high-level capsule features. Finally, we can predict the high-level capsule features with fMRI data, and reconstruct image stimuli with the CapsNet. We evaluated the proposed CNAVR method on the dataset of handwritten digital images, and exceeded about 10% than the accuracy of all existing state-of-the-art methods on the structural similarity index (SSIM). Keywords: brain decoding, functional magnetic resonance imaging (fMRI), visual reconstruction, capsule network (CapsNet), capsule features. 1 Introduction Human brain decoding [1, 2, 3] plays an important role in brain-machine interfaces, may be extended to help disabled persons in expressing and motioning, and can also help us explore more about the brain mechanism. In these years, functional magnetic resonance imaging (fMRI) has become an effective tool to monitor brain activities and visual decoding based on fMRI data obtained more and more attention. In contrast to visual encoding [4] that predicts the brain activities in response to visual stimuli, the inverse decoding [5, 6] aims to predict the information about visual stimuli through brain activities. In general, classification, identification and reconstruction of image stimuli based on fMRI data are three main means of visual decoding. Some progresses [7] have been achieved, but the most of previous researches focused on either prediction of its category [8, 9] or identification [4] from a candidate set of image stimuli for the unknown image stimulus. The reconstruction of image stimuli is the full-information and most difficult means of decoding, and fewer studies [10] worked on it. The accuracy of visual reconstruction was restricted by several problems: 1) the complex noise during the acquisition of fMRI data; 2) the high dimensionality and limited number of fMRI data; 3) difficulties when imitating the human visual mechanism to develop the computation models. Current reconstruction methods mainly focused on some simple or small image stimuli. Thirion et al. [11] reconstructed the simple images by rotating Gabor filters in the passive viewing experiment and imagery experiment for the same subject. Miyawaki et al. [12] achieved the reconstruction of simple binary contrast patterns (resolution: 10×10) by linearly mapping fMRI data to each pixel of image stimuli. Van Gerven et al. [13] reconstructed handwritten digits 6 and 9 (resolution: 28×28) from the fMRI data based on deep belief network [14]. Schoenmakers et al. [15] tried to reconstruct handwritten English letter of ‘BRAINS’ (resolution: 56×56) from the fMRI data using linear gauss model based on sparse learning. Yargholi et al. [16] employed the gauss network to reconstruct handwritten digits 6 and 9. Fujiwara et al. [17] proposed the Bayesian CCA (BCCA) model based on probabilistic extension of canonical correlation analysis (CCA) model [18] that related fMRI data to image stimuli via a set of latent variables. Wang et al. [19] proposed the deep canonically correlated auto encoders (DCCAE) with nonlinear observation models, and reconstruct each view using the learned representations. Recently, some work [20, 21, 22] proved that features of some layers in CNN behaved strong correlation with the brain activities of particular visual cortex, and some researchers started to apply CNN to visual reconstruction. Using the convolution features of the first layer in CNN, Wen et al. [23] implemented the reconstruction of dynamic video frame by frame, and proposed two-stage cascade neural decoding method based on multivariate linear regression and deconvolutional neural network [24]. They first predicted features by multivariate linear regression, then reconstructed images by feeding the estimated features in a pretrained deconvolutional neural network. Du et al. [25] presented a deep generative multi-view model (DGMM) to regard the visual reconstruction as the Bayesian inference of the missing view. In a word, these studies have suggested that DNN especially CNN could help interpret human brain visual information. However, the accurate reconstruction of image stimuli remains to be challenging. In conclusion, the visual reconstruction aims to design the mapping from fMRI data to image stimuli. Some methods [11, 12] directly tried to learn a linear or nonlinear mapping based on limited number of samples. However, the linear mapping has limited ability to parse the complex function of visual information processing in human visual cortex, and nonlinear mapping is easy to be overfitting based on limited number of samples and has weak generalization. Depending on some specific architectures of feature representation, some methods [18] firstly mapped the fMRI data to the feature representation of corresponding image stimuli, then tried to employ these features to reconstruct the image stimuli through the architecture. CNN architecture with powerful image feature representation [26, 27], seems a good choice. The current state of the art visual reconstruction methods [23] relied on the linear or nonlinear mapping from fMRI data to the features of specific layer in CNN architecture, then tried to reconstruct image stimuli based on information stream of CNN architecture. However, is the path for the perfectly solving the reconstruction of image stimuli? As we know, there is a fact [28] that the performance on image classification task [29] is much better than on detection [30] and segmentation [31] tasks in computer vision in spite of both employing CNN architecture. CNN architecture composed of hierarchical convolutional and pooling layers, was firstly designed for invariance including translation invariance, rotating invariance, scale invariance and so on. During the forward propagation in CNN architecture, the extracted features are more and more abstract and the local detailed information such as pose and location which is valuable for detection or segmentation is sacrificed, which lead to the difference of performance on classification and detection or segmentation. CNN can be usually designed for specific procedure of information processing in human visual cortex, such as semantic extracting, or decoding of space location, however, CNN cannot extract diverse features of image stimuli, thus incapable of accurate reconstruction that require various sensory information extracting such as semantic class, orientation, location, scale, and so on. The fact that current reconstruction results were not similar with the image stimuli also proves the inference. Invariance and equivariance are two very important perceptions in visual representation. As shown in the figure 1, the invariance is usually designed for the specific task such as the semantic extracting, at the cost of discarding other features that are not correlated with the semantic information. However, the equivariance is designed for many tasks, because it keeps nearly all the features such as location, pose, orientation, and so on. Essentially, CNN architecture performs the invariance by hierarchical subsampling by pooling layer, instead of the equivariance that keeps the quantity of information unchanged while feature representation. The problem makes it difficult to rely on the incomplete information to perform full-information reconstruction of image stimuli. Fig. 1 The difference between invariance and equivariance. Invariance performs the invariable representation when transforming location, pose, and orientation of digit ‘6’, in order to keep invariable class. Equivariance performs the transformed representation when transforming the location, pose, and orientation of digit ‘6’, in order to keep equivariant representation. Invariance is usually designed for the specific task, but equivariance can be used for many tasks, because the equivariant representation contains more diverse features about the image. In addition, we analyzed it from the perspective of human visual mechanism. After one person glances at one image, he or she can simultaneously answer many questions about the image such as ‘what is the main object?’, ‘where is the object’, ‘what characteristics does the object have?’ and so on. We noticed that these questions contain many characteristics of the image and we can conclude that the procedure of visual information representation in human visual cortex requires the equivariance instead of invariance, because only equivariance can ensure that the semantic class, location, scale, orientation and some other detailed information be preserved instead of discarding, in order to deal with various visual tasks. According to the above analysis, in order to achieve accurate visual reconstruction, we need an architecture that can keep the equivariance when feature representation and contain diverse features to make it possible to achieve accurate reconstruction from the perspective of information completeness. Aimed at equivariance instead of simple invariance, Hinton [32] firstly proposed the concept of capsule and designed the promising capsule network (CapsNet) based on convolutional operation and routing by agreement. In CNN architecture, each layer just includes some disorder neurons which makes it hard to perform some organizations of detailed internal structure. However, in the CapsNet, Capsules serve as the basic units of each layer and contain a group of neurons, which can organize some internal structures inspired by the structure of cortical mini column [33] including several hundred neurons in primates. The length of a capsule can predict the presence of a particular object for the invariance, and the features in a capsule can predict the complete attributes of a particular object for the equivariance. The CapsNet reached high accuracy on MNIST [34] digits recognition and demonstrated considerably better results than CNN on highly overlapping digits. Most importantly, the CapsNet provide the equivariance when feature representation. The CapsNet can achieve the accurate classification, which can prove that the capsule features contained the abstract information; can achieve the accurate reconstruction, which prove that the capsule features contained the complete information of image stimuli and is the equivariance of image stimuli. In this study, we proposed the new CapsNet architecture based visual reconstruction (CNAVR) method that accords well with the human visual information representation in human visual cortex based on the equivariance. We relied on the linear mapping from fMRI data to the high-level capsule features in the CapsNet, then tried to reconstruct image stimuli through CapsNet architecture. To the best of our knowledge, this paper is the first to study visual reconstruction via the new promising capsule network architecture. 2 Materials and Methods 2.1 Experiment data The Dataset [16] employed in the study contains a hundred handwritten gray-scale digits (equal number of 6 and 9) at a 28×28 pixel resolution taken from the MNIST database and the fMRI data from V1, V2 and V3. The fMRI data contains 3092 voxels in total. In the experiment, we employed 10-fold cross validation to test the proposed CNAVR method. 2.2 Overview of the proposed CNAVR method In order to achieve accurate visual reconstruction, we introduced the new CapsNet architecture to construct the feature representation of the equivariance between the image stimuli and capsule features, and learned the mapping from the fMRI data to capsule features. Our proposed CNAVR method included two-stage training. Firstly, we employed the CapsNet to train the equivariance from image stimuli to capsule features, and from capsule features to image stimuli in an end-to-end manner by using convolutional, fully connected and routing by agreement operations. After the training, given one input image, we can obtain the corresponding capsule features, and can reconstruct the input image accurately again based on the capsule features, which indicated that the capsule features did not throw away location, pose, scale characteristics and so on for the sake of invariance, and kept complete information of image stimuli when feature representation. Then we selected voxels to reduce dimensionality of fMRI data by encoding performance, and learned the mapping from dimension-decreasing fMRI data to the capsule features using several fully connected layers. After the two-stage training, we realized the mapping from fMRI data to visual reconstruction of image stimuli. Given the fMRI data of one presented image stimulus, we can predict its capsule features about 6 and 9 with the learned mapping, and the accurate reconstruction can be accomplished using the max-length capsule. 2.3 Capsule and dynamic routing between capsules Hinton [32] recently proposed the perception of capsule and dynamic routing between capsules. Each capsule contains a group of neurons. As the equation (1), the capsule j performs the non-linear squashing activation function for the given input vector s j in the CapsNet, and output vector v j . The orientation of vector s j is preserved, but the length is squashed between 0 and 1. The parameters in v j represent the various properties (position, scale, and texture) of a particular entity, and the length are used to represent the existence of the entity. vj  sj 2 1 s j sj 2 sj (1) The input s j is a weighted sum over all prediction vectors uˆ j i that is produced by multiplying the output u i of a capsule in the layer below by a weight matrix Wij . uˆ j i  Wi u j i s j   cij uˆ j i i (2) The coupling coefficients cij are determined by the iterative dynamic routing process. The coupling coefficients between capsule i and all the capsules in the layer above are determined by the softmax of bij indicating the probability that capsule i should be coupled to capsule j . bij  bij  uˆ j i v j cij  exp(bij )  exp(bik ) (3) k Where bij is initially set to zero, then is iteratively refined by measuring the agreement between the output v j and the prediction uˆ j i made by capsule i in the layer below, using the scalar product v j u ˆ j i . Three looping can obtain the nice coupling coefficients and routing by agreement essentially tried to learn the relation between part and whole. 2.4 Training image feature representation of equivariance We employed the CapsNet to perform the equivariance between images and corresponding high-level capsule features. As shown in Figure 2, the CapsNet architecture is shallow with only two convolutional layers, dynamic routing layers and several fully connected layers. Given one image (size: 28×28), the first layer (Conv1) performs 256 convolutional (kernels: 9 ×9) operations with a stride of 1 and ReLU [35] activation. This layer converts pixel intensities to the local features (size: 20 × 20) that are then used as inputs to the primary capsules. The second layer (PrimaryCaps) also performs 256 (32 × 8) convolutional (kernels: 256 × 9 × 9) operations with a stride of 2 to produce 32 capsule maps (size: 6 ×6) whose capsule is an 8D vector. This layer is to construct capsules for dynamic routing operation in next layer. The final Layer (DigitCaps) has one 16D capsule per digit class (from 0 to 9) and each of these capsules receives input from all 1152 (32 × 6 × 6) capsules in the layer below. Fig. 2 The architecture of CapsNet. The first two layers perform convolutional operations to construct the primary capsule structure. Each capsule in the PrimaryCaps layer includes 8D features, and each high-level capsule in the DigitCaps layer includes 16D features that include more diverse features. The architecture employs the dynamic routing to replace the pooling operations to avoid the loss of the valuable information such as orientation, location, scale and other detailed features that are important for the equivariance when forward propagation. The ‘yellow’ mark represents the longest capsule in the DigitCaps and using it can predict the input image based on three fully connected layers. Because the length of the capsule represents the probability that a specific entity exists, the CapsNet aims to make the corresponding capsule vector longer if some digit is present in the image and make the other capsule vectors shorter. So, the classification loss is simply the sum of the losses of all digit capsules, and defined as shown below. In the training, set Tc =1 if a digit of class c is present and set m  0.9 , m  0.1 and  =0.5 . LClassification   Tc max(0, m  v c )2   (1  Tc ) max(0, v c  m )2  (4) c Most importantly, in order to ensure the equivariance of mapping from images to capsule features, the CapsNet adds a decoding network on top of the capsule network. The decoding network contains 3 fully connected layers using ReLU [35] activation function in the first two layer and sigmoid activation function in the output layer. The reconstruction can be accomplished with the corresponding capsule features. The full valuable diverse information for image reconstruction is preserved in the capsule features by minimizing the mean squared error (MSE) between the reconstructed image and the input image. So, the overall loss Loverall is the classification loss plus the weighted decoding loss. The classification loss is to force the high-level capsules distinct in the length for different digits. The reconstruction loss is to force the network to preserve all the information required to reconstruct the image throughout the CapsNet, and acts a bit like a regularization. (5) Loverall  Lclassification   MSE ( I , FCdecoding ( v k )) In the experiment, the Adam optimizing [36] was used to avoid overfitting and fasten the training. It is noted that  was set 4.0, batch size 10. We finished the training after about 20 epoch based on the MNIST dataset [34] using Tensorflow [37]. 2.5 Training the mapping from the fMRI data to capsule features After finishing the training of the CapsNet, we obtained the architecture of feature representation for equivariance instead of invariance. Given one image stimulus, we can predict its high-level capsules’ features and also can reconstruct the image using the longest 16D capsule features. In order to realize the reconstruction of image stimuli from fMRI data, we need to map the fMRI data to capsule features. However, the fMRI data is usually limited because of the acquiring device, subjects, time and other reasons, and the dataset used in this study only contain 100-pair digits and corresponding fMRI data in total. In addition to the problem about the data, the dimensionality of the fMRI data reaches 3092, a very high number compared to the number of the samples. Faced with the problem of high dimensionality, we chose to use those voxels that are maximally correlated with the image stimuli and the correlation is measured by the effect of fitting namely encoding performance. So, we firstly employed the simple linear regression to fit each voxel with the capsule features instead of images, because the capsule features are the equivariance of image representation, contain all valuable information and have the shorter dimensionality. In detailed, as shown in the Figure 3, given one image, we can predict its 10 high-level capsules, and selected the longest capsule, then employed the 16D vector and the corresponding 3092D fMRI vector as a training sample. In this way, we can make up 90 training samples and employ linear regression to fit each voxel. In order to measure the encoding performance of each fMRI voxel, the goodness-of-fit between model predictions and measured voxel activities was quantified using the coefficient of determination (R2), which indicates the percentage of variance that is explained by the model. Finally we selected those voxels whose R2 is at the top 100, and reduced the dimensionality of fMRI data. Fig. 3 The architecture from the fMRI data to capsule features. The three fully connected layers are employed to predict ‘pale yellow’ capsule and ‘deep yellow’ capsule that represent digit class 6 and 9 respectively. The ‘cyan’ vector represents the dimension-decreasing fMRI data based on the encoding performance that evaluated by the linear regression of highlevel capsule features. The previous trained CapsNet is used to make up training samples (pairs of two capsule features and dimension-decreasing fMRI data) to train the mapping from the fMRI data to capsule features. Next, we designed the network that maps fMRI data to the two capsules of digits 6 and 9. Our network is composed of three fully connected layer using ReLU activation function in the first two layer and no activation function in the last layer. It should be noted that we try to add the number of layers, but find no benefit in the experiment. The first layer’s dimensionality is 256, the second 128, and the last 32. We add the L2 regularization operations in the first two layers to prevent the network from overfitting because the number of training samples is too limited to be easily overfitting. The last layers are split into two 16D vectors in the middle and employed squashing function to resize each length between 0 and 1. Each pair of sample include one input image and one fMRI vector, we first employed trained CapsNet to predict the capsules in response to each input image. The capsules of digits 6 and 9 serve as the ground truth to train the mapping from the 100D fMRI data to it. We employed the mean square error (MSE) to perform gradient descent to update the weight parameters. It should be noted that the weights in the CapsNet is fixed when training the three layers’ network. Similarly, we employed the Adam optimizing method to perform the training. The batch size is set 10, initial learning rate is set 0.0001. The learning curve of the training was shown in the figure below. We finished the training after about 10000 iterations using Tensorflow [37]. From the figure below, we can see that our network behaves well on the 90 training samples and do not suffer from the overfitting because of the regularization and voxels selecting operations. So far, we accomplished the mapping from the fMRI data to capsule features. (a) The MSE on training samples (b) The MSE on testing samples Fig. 4 The learning curves during training. The mapping from the fMRI data to the capsule features is important for the next reconstruction. The MSE on testing samples is close to that on the training samples, which indicates that our proposed CNAVR method avoided the overfitting, because of the dimension-decreasing operations and the capsules including the feature information of equivariance. The performance will get improved when obtaining more fMRI data. 2.6 Reconstructing image stimuli from human fMRI After the two-stage training above, we accomplished the equivariance between the images and capsule features, and the mapping from the fMRI data to capsule features. We can reconstruct the image stimuli using fMRI data. As show in the Figure 5, given one fMRI vector, we firstly selected the valuable voxels and predicted its capsule features about the digits 6 and 9 based on the trained three layer’ network, secondly we take out the longer capsule, finally we can accomplish the accurate reconstruction by the mapping from capsule features to images in the trained CapsNet. Fig. 5 The flow of visual reconstruction. The former half part trained at the second training stage is responsible for the mapping from dimension-decreasing fMRI data to the two high-level capsules’ features, the latter part trained at the first stage is responsible for the reconstruction based on the longer capsule. In this way, the high-level capsule features are used to bridge between the fMRI data and image stimuli. 3 Results 3.1 The encoding performance The dimensionality (3092) of the fMRI data is too big to train the mapping from fMRI data to capsule features using limited number (90) of samples, so we selected some valuable voxels according to coefficient of determination R2 reflecting the performance of fitting on training set. As shown in the figure below, we employed the 10-fold cross validation to test our encoding performance for each voxel. We can see that mean correlation coefficient of top-100 voxels reached 0.86 and top-700 voxels exceed more than 0.65. The performance indicated that the capsule features make for better encoding although using the simplest linear regression, which proved the advantage of equivariance of CapsNet when feature representation, In addition, we found that we nearly selected the most of those top voxels using R2, and the selected voxels reached nearly about 85% of top-k voxels in terms of mean correlation coefficient. The comparison demonstrated that selecting voxels by R2 is a good choice and ensure the performance of the next visual reconstruction. Fig. 6 The encoding performance according to different methods of selecting. The X-axis represents the number of voxels selected from 3092 voxels. The Y-axis represents the mean correlation coefficient of prediction on testing set for selected voxels by 10-fold cross validation. We can see that employing capsule features can achieve good encoding performance, which indicate that capsules including diverse features such as semantic class, orientation, location, and so on. 3.2 The results of reconstruction We employed several standard image similarity metrics, including Pearson’s correlation coefficient (PCC), mean squared error (MSE) and structural similarity index (SSIM) [38]. Note that MSE and PCC is not highly indicative of similarity, and serves as the auxiliary metrics, while SSIM was proposed to measure structural similarity, can address this shortcoming by taking texture into account and has strong persuasion. Firstly, we presented the reconstruction results of 12 distinct handwritten digits including the equal number of digits 6 and 9. In order to present the results clearly, we gave the image stimuli, the theoretical reconstruction based on the capsule features of image stimuli, and the visual reconstruction based on the fMRI data. It should be noted that the theoretical reconstruction is obtained based on capsule features using image stimuli throughout CapsNet, and the visual reconstruction are obtained based on predicted capsule features using fMRI data. The theoretical reconstruction demonstrates the theoretical upper limit of our CNAVR method. From the figure below, we can see that the theoretical reconstruction is perfect and much close to the image stimuli, because the capsule’s feature guarantees no missing information when feature representation through trained CapsNet, which proved the equivariance. In addition, our visual reconstruction results are also much similar with the image stimuli, which prove the effective of the proposed CNAVR method. In detailed, we give corresponding quantitative evaluation for each reconstruction in table 1. It cannot be denied that some image reconstruction is not good, as shown in the last column in the figure. We analyzed that the second stage of mapping based on the limited samples remained improvement based on limited fMRI data, and the reconstruction part in the CapsNet is sensitive to the input capsule, and the reconstruction results will change when the capsule features are slightly perturbed. In addition, we can see that these image stimuli indeed do not belong to the common digits. He or she may recall corresponding common pattern if a common subject suddenly looks at the strange kind of image stimuli, which may be an interesting question. A B C D original image theoretical reconstruction visual reconstruction (a) The reconstruction of handwritten digit 6 E F G H I J K L original image theoretical reconstruction visual reconstruction (b) The reconstruction of handwritten digit 9 Fig. 7 Reconstruction results of the proposed CNAVR method. The presented reconstruction includes five high-quality and one low-quality results for (a) and (b). Except for the last column, the reconstruction gets close to the original image stimuli, from the view of orientation, scale, location, and so on. The last column represents the small number of lowquality reconstruction, and the most of low-quality reconstruction belong to the strange image stimuli, which needs further specific improvement. Table 1 The corresponding quantitative evaluation for each presented reconstruction in Figure 6. A B C D E F MSE 0.023 0.021 0.029 0.037 0.048 0.090 PCC 0.934 0.917 0.833 0.832 0.774 0.521 SSIM 0.906 0.885 0.826 0.826 0.772 0.516 G H I J K L MSE 0.014 0.013 0.022 0.026 0.024 0.115 PCC 0.912 0.900 0.890 0.873 0.869 0.460 SSIM 0.901 0.898 0.888 0.867 0.866 0.459 Next, we presented the quantitative results based on 10-fold cross validate compared to the several state of the art methods. As shown in the table 2 below, although the PCC and MSE of our proposed CNAVR method is a little weaker than the current best DGMM [23] and De-CNN [25], the CNAVR exceeds about 10% than them on the most important SSIM metric. We analyzed that the methods should not be crazy about the much high MSE and PCC, because the complex noise in the fMRI data and limited samples reduce the significance of pixel-level comparison. Moreover, human do not care much detailed information in pixel-level and care much of structure according to attention mechanism. So, the two metric just serve as the auxiliary measure, and our proposed methods performed better overall. Table 2 The quantitative comparison to other state of the art methods. Algorithms MSE PCC SSIM Miyawaki et al. [12] 0.042 0.767 0.466 Fujiwara et al. [17] 0.119 0.411 0.192 Wang et al. [19] 0.074 0.548 0.358 Wen et al. [23] 0.038 0.799 0.613 Du et al. [25] 0.037 0.803 0.645 Our CNAVR 0.042 0.769 0.750 4 Discussion The significance of the introduced new CapsNet architecture. In a regular CNN, there are general several pooling layers. Unfortunately, these subsampling layers tend to lose information for invariance, such as the precise location and pose of the objects. It’s really not a big deal if you want to classify the whole image, but it makes it challenging to perform accurate image segmentation, object detection and other tasks which require precise location and pose. Visual reconstruction is exactly the problem that needs to rely on complete characteristic information, which requires the equivariance instead of invariance when feature representation. The CapsNet architecture can be exactly fit for the problem, which benefits from the perception of capsule, dynamic routing and reconstruction regularization loss. In addition, it is obvious that human can simultaneously accomplish many different tasks such as image recognition, image object location, and object pose detection after looking at one image only once. Different tasks always need different characteristics of image and it can conclude that visual information processing in human visual cortex also requires the equivariance. The equivariance ensures that the location, scale, pose and some other detailed information be preserved instead of discarding. The similarity demonstrated that the new CapsNet architecture accords well with the human visual mechanism. Other architecture such as prevailing CNN does not have the equivariance, because they aimed at invariance, abstracting and continues hierarchical abstracting in the process of forward propagation. Our results about encoding during selecting voxels and reconstruction based on the fMRI data both proved the significance of the new CapsNet architecture, which is very promising for visual reconstruction including more complex natural image reconstruction. The importance of selecting voxels. As we know, selecting too many voxels will inevitably introduce more noise and not selecting enough voxels will miss some necessary information, which can both influence the quality of visual reconstruction. So, selecting voxels is an important procedure and challenging problem in visual reconstruction. On one hand, from the mean correlation coefficient of encoding based on top-k and R2 selection, we can find that the means of R2 nearly selected the most of top-k voxels. The second-stage training avoid the overfitting and the 10% higher on SSIM is partly attributed to the performance of selecting voxels, which indirectly indicate the importance of selecting voxels. On the other hand, we employed the much simple linear regression for the encoding to select voxels, and the distance between the theoretical reconstruction and visual reconstruction still remain wide, which indicates that we need to select better voxels to optimize the mapping from the fMRI data to capsule features. How to select the more of top-k voxels and employing nonlinear encoding may be some next choices. Two-stage training methods. We realized the reconstruction with the two-stage training by introducing the new CapsNet architecture that provides the equivariance. We tried to add the third stage of fine tuning that optimize the overall network include the CapsNet and the mapping from fMRI data to capsule features, however, the results did not have the prospective effects. We think that the limited training samples (less than 100) are not suitable for the jointly training. However, the jointly training or end-to-end training is indeed a good direction from the development of computer vision, and the end-to-end training for visual reconstruction based on the CapsNet and more samples may attract more attention in the future. Promising reconstruction for complex image stimuli. We only tested our proposed methods on the public dataset of digits 6 and 9. However, our proposed methods aimed at the reconstruction of digits from 0 to 9. In this study, we mainly aims at how to firstly introduce the new architecture to accomplish visual reconstruction. In addition, the CapsNet is promising for the reconstruction of more complex image stimuli, a more challengeable problem. The reconstruction of more complex image stimuli requires equivariance more, because more complex image stimuli have more complex characteristics and pattern. The next key procedure is to solve the problem of how to better measure the reconstruction results than the MSE error, in order to regularize the CapsNet to preserve the equivariance. 5 Conclusion This paper firstly introduced the new CapsNet architecture for the visual reconstruction, inspired by the equivariance of information processing in human visual cortex. We proposed CNAVR method that provide the equivariance when feature representation. Selecting voxels to reduce the dimensionality of fMRI data and learning the mapping from fMRI data to the capsule feature space are the two key stages in visual reconstruction. We firstly employed the capsule features to estimate the serviceability of each voxel to accomplish the selecting of voxels, secondly we learned the mapping using very few samples. Based on the capsule features, the quality of the two key stages are guaranteed. By qualitative and quantitative results and comparison to the state of the art methods, the CNAVR achieved overwhelming superiority and exceeded by about 10% than the state of the art in the most important SSIM metric. These results demonstrated that our proposed architecture better accords well with the human visual cortex. To the best of our knowledge, this paper is the first to study visual image reconstruction via promising capsule network, which easily lead to recall the breakthrough in the ImageNet classification 2012 [29] competition (the land mark of deep leaning era) by introducing CNN that created about 10% higher classification accuracy compared to traditional methods. Next, in order to achieve better visual reconstruction especially for complex images or videos, the exploration of CapsNet may spring up. There is no doubt that it’s still a start, but a promising start. 6 Conflict of Interest The authors declare no conflict of interest. 7 Acknowledgments This work was supported by the National Key R&D Program of China under grant 2017YFB1002502 and National Natural Science Foundation of China (No. 61701089, No.61601518 and No. 61372172). 8 Reference [1] Cox D D, Savoy R L. Functional magnetic resonance imaging (fMRI)“brain reading”: detecting and classifying distributed patterns of fMRI activity in human visual cortex[J]. Neuroimage, 2003, 19(2): 261-270. [2] Haynes J D, Rees G. Decoding mental states from brain activity in humans[J]. Nature Reviews Neuroscience, 2006, 7(7): 523-534. [3] Norman K A, Polyn S M, Detre G J, et al. Beyond mind-reading: multi-voxel pattern analysis of fMRI data[J]. Trends in cognitive sciences, 2006, 10(9): 424-430. [4] Kay K N, Naselaris T, Prenger R J, et al. Identifying natural images from human brain activity[J]. Nature, 2008, 452(7185): 352-355. [5] Kamitani Y, Tong F. Decoding the visual and subjective contents of the human brain[J]. Nature neuroscience, 2005, 8(5): 679-685. [6] Haynes J D, Rees G. Predicting the orientation of invisible stimuli from activity in human primary visual cortex[J]. Nature neuroscience, 2005, 8(5): 686-691. [7] Naselaris T, Kay K N, Nishimoto S, et al. Encoding and decoding in fMRI[J]. Neuroimage, 2011, 56(2): 400-410. [8] Damarla S R, Just M A. Decoding the representation of numerical values from brain activation patterns[J]. Human brain mapping, 2013, 34(10): 2624-2634. [9] Mokhtari F, Hossein-Zadeh G A. Decoding brain states using backward edge elimination and graph kernels in fMRI connectivity networks[J]. Journal of neuroscience methods, 2013, 212(2): 259-268. [10] Naselaris T, Prenger R J, Kay K N, et al. Bayesian reconstruction of natural images from human brain activity[J]. Neuron, 2009, 63(6): 902-915. [11] Thirion B, Duchesnay E, Hubbard E, et al. Inverse retinotopy: inferring the visual content of images from brain activation patterns[J]. Neuroimage, 2006, 33(4): 1104-1116. [12] Miyawaki Y, Uchida H, Yamashita O, et al. Visual image reconstruction from human brain activity using a combination of multiscale local image decoders[J]. Neuron, 2008, 60(5): 915-929. [13] van Gerven M A J, de Lange F P, Heskes T. Neural decoding with hierarchical generative models[J]. Neural computation, 2010, 22(12): 3127-3142. [14] Hinton G E, Salakhutdinov R R. Reducing the dimensionality of data with neural networks[J]. science, 2006, 313(5786): 504-507. [15] Schoenmakers S, Barth M, Heskes T, et al. Linear reconstruction of perceived images from human brain activity[J]. NeuroImage, 2013, 83: 951-961. [16] Hossein-Zadeh G A. Reconstruction of digit images from human brain fMRI activity through connectivity informed Bayesian networks[J]. Journal of neuroscience methods, 2016, 257: 159-167. [17] Fujiwara Y, Miyawaki Y, Kamitani Y. Modular encoding and decoding models derived from Bayesian canonical correlation analysis[J]. Neural computation, 2013, 25(4): 979-1005. [18] Hardoon D R, Szedmak S, Shawe-Taylor J. Canonical correlation analysis: An overview with application to learning methods[J]. Neural computation, 2004, 16(12): 2639-2664. [19] Wang W, Arora R, Livescu K, et al. On deep multi-view representation learning[C]//Proceedings of the 32nd International Conference on Machine Learning (ICML-15). 2015: 1083-1092. [20] Yamins D L, Hong H, Cadieu C, et al. Hierarchical modular optimization of convolutional networks achieves representations similar to macaque IT and human ventral stream[C]//Advances in neural information processing systems. 2013: 3093-3101. [21] Yamins D L K, Hong H, Cadieu C F, et al. Performance-optimized hierarchical models predict neural responses in higher visual cortex[J]. Proceedings of the National Academy of Sciences, 2014, 111(23): 8619-8624. [22] Kriegeskorte N. Deep neural networks: a new framework for modeling biological vision and brain information processing[J]. Annual Review of Vision Science, 2015, 1: 417-446. [23] Wen H, Shi J, Zhang Y, et al. Neural Encoding and Decoding with Deep Learning for Dynamic Natural Vision[J]. arXiv preprint arXiv:1608.03425, 2016. [24] Zeiler M D, Taylor G W, Fergus R. Adaptive deconvolutional networks for mid and high level feature learning[C]//Computer Vision (ICCV), 2011 IEEE International Conference on. IEEE, 2011: 2018-2025. [25] Du C, Du C, He H. Sharing deep generative representation for perceived image reconstruction from human brain activity[J]. arXiv preprint arXiv:1704.07575, 2017. [26] Simonyan K, Zisserman A. Very deep convolutional networks for large-scale image recognition[J]. arXiv preprint arXiv:1409.1556, 2014. [27] He K, Zhang X, Ren S, et al. Deep residual learning for image recognition[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2016: 770-778. [28] Deng J, Dong W, Socher R, et al. Imagenet: A large-scale hierarchical image database[C]//Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on. IEEE, 2009: 248-255. [29] Krizhevsky A, Sutskever I, Hinton G E. Imagenet classification with deep convolutional neural networks[C]//Advances in neural information processing systems. 2012: 1097-1105. [30] Girshick R, Donahue J, Darrell T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2014: 580-587. [31] Long J, Shelhamer E, Darrell T. Fully convolutional networks for semantic segmentation[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2015: 3431-3440. [32] Sabour S, Frosst N, Hinton G E. Dynamic Routing Between Capsules[C]//Advances in Neural Information Processing Systems. 2017: 3857-3867. [33] Buxhoeveden D P, Casanova M F. The minicolumn hypothesis in neuroscience[J]. Brain, 2002, 125(5): 935-951. [34] LeCun Y. The MNIST database of handwritten digits[J]. http://yann.lecun.com/exdb/mnist/, 1998. [35] Szegedy C, Ioffe S, Vanhoucke V, et al. Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning[C]//AAAI. 2017: 4278-4284. [36] Kingma D, Ba J. Adam: A method for stochastic optimization[J]. arXiv preprint arXiv:1412.6980, 2014. [37] Abadi M, Agarwal A, Barham P, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems[J]. arXiv preprint arXiv:1603.04467, 2016. [38] Wang Z, Bovik A C, Sheikh H R, et al. Image quality assessment: from error visibility to structural similarity[J]. IEEE transactions on image processing, 2004, 13(4): 600-612.
1cs.CV
1 Relationship between Cross-Polarization Discrimination (XPD) and Spatial Correlation in Indoor Small-Cell MIMO Systems arXiv:1707.00227v2 [cs.IT] 6 Dec 2017 Yeon-Geun Lim, Student Member, IEEE, Yae Jee Cho, Student Member, IEEE, TaeckKeun Oh, Member, IEEE, Yongshik Lee, Senior Member, IEEE, and Chan-Byoung Chae, Senior Member, IEEE Abstract—In this letter, we present a correlated channel model for a dual-polarization antenna to omnidirectional antennas in indoor small-cell multiple-input multiple-output (MIMO) systems. In an indoor environment, we confirm that the cross-polarization discrimination (XPD) in the direction of angle-of-departure can be represented as the spatial correlation of the MIMO channel. We also evaluate a dual-polarization antenna-based MIMO channel model and a spatially correlated channel model using a three-dimensional (3D) ray-tracing simulator. Furthermore, we provide the equivalent distance between adjacent antennas according to the XPD, providing insights into designing a dualpolarization antenna and its arrays. Index Terms—Dual-polarization antenna, XPD, MIMO, spatial correlation, and 3D ray-tracing. I. I NTRODUCTION Researchers have been able to extend mobile service coverage and network capacity through their development of small-cell technology [1]. In next-generation communications, researchers are considering multiple-input multipleoutput (MIMO) techniques [2]. One such technique is massive MIMO, in which base stations (BSs) are equipped with many antennas to increase capacity and to conserve energy [3], [4]. To establish MIMO schemes in small-cell systems, researchers must address certain issues. MIMO capacity can be degraded, for example, by a compact antenna array for small-sized BS. The degradation is due to the high spatial correlation of channels [3], [5]. A good solution for installing a compact antenna array could involve a collocated dual-polarization antenna system. One dual-polarization antenna could then play, equivalently, the roles of two dipole/patch-type antennas as long as there is high cross-polarization discrimination (XPD). Here, XPD is the ratio of the copolarization received power and the cross-polarization received power. To establish a dual-polarized MIMO system, we should investigate channel modeling, which is critical for performance evaluation [6]. In prior work [7], [8], the authors focused Y.-G. Lim, Y. J. Cho, and C.-B. Chae are with School of Integrated Technology, Yonsei University, Korea (e-mail: yglim, yjenncho, [email protected]). T. Oh is with LIG Nex1, Korea (e-mail: [email protected]). Y. Lee is with School of Electrical and Electronic Engineering, Yonsei University, Korea (e-mail: [email protected]). This research was supported by the MSIP (Ministry of Science, ICT and Future Planning), Korea, under the “IT Consilience Creative Program” (IITPR0346-16-1008) supervised by the IITP and ICT R&D program of MSIP/IITP (2015-0-00300). on the channel from a dual-polarization antenna to a dualpolarization antenna. Meanwhile, it is also important, in practice, to study channels from a dual-polarization antenna to dipole/patch-type antennas because a typical MS is likely to be equipped with dipole/patch-type antennas. It is necessary to have, as noted above, a high XPD to set up dual-polarized MIMO systems. Researchers have developed dual-polarization antennas that have a high XPD in the main direction of radiation [9], [10]. It is also important, on the other hand, to consider the average XPD in all directions in indoor environments, for signals go through a wall-induced reflection in all directions [11]. While the conventional approach to designing a dual-polarization antenna with high XPD provides better MIMO performance, it is a costly and complex process to make this antenna at a small size. From this perspective, it remains an open question as to how much XPD is needed to sustain MIMO performance at reasonable cost and level of complexity. In this letter, we provide a correlated channel model for a dual-polarization antenna to omnidirectional antennas in indoor small-cell MIMO systems. This channel model reflects the relationship of XPD in the direction of angle-ofdeparture (AoD) of a dual-polarization antenna and correlation of MIMO channel. We evaluate the dual-polarization antennabased MIMO channel model by using a three-dimensional (3D) ray-tracing simulator that can exploit physically specific behaviors of the polarized channel [12], [13]. We also investigate the equivalent distance between adjacent antennas according to the XPD. We provide insight into the XPD design aspect for a dual-polarization antenna at a small size and at a reasonable cost and level of complexity. To the best of our knowledge, this letter is the first work to explain and validate the relationship between an XPD and spatial correlation by utilizing the presented channel model and a 3D ray-tracing tool. In 3GPP, this problem has been an open issue. II. S YSTEM M ODEL Fig. 1 illustrates a block diagram of a dual-polarization antenna-based MIMO system. We consider a single-user MIMO with one collocated dual-polarization antenna that serves one MS equipped with two omnidirectional antennas. This model is considered a 2×2 MIMO system, since horizontally and vertically polarized waves are respectively radiated from Port-1 and Port-2 of the dual-polarization antenna, 2 Fig. 1. Block diagram of the dual-polarization antenna-based MIMO system. the waves go through the channel almost independently due to zero cross-correlation between the orthogonally polarized waves [6], [11], [14]. Let hrt denote the channel coefficient between the tth port at the BS and the rth antenna at the MS, which is an independent and identically distributed (i.i.d.) complex Gaussian random variable with zero mean and unit variance. From the channel model with a polarization transfer matrix that consists of random phases for different polarization combinations in [14], [15], the coefficient of the effective H eff ) is given by channel (H T q p  −1 jΦrH p L e √ r,t Gφ,αt   p q = αrt hrt + βrt0 hrt0 , heff = rt −1 jΦrV Gφ,βt L 0e r,t 0 1 rH rV where t 6= t . The notations Φ and Φ are random initial phases, the distributions of which are uniform within (−π, +π), for the horizontal and vertical polarization combinations at the rth MS antenna. In addition, αrt and βrt are the propagation gains from copolarization and cross-polarization, and Gφ,αt and Gφ,βt are, respectively, the antenna gain of copolarization and cross-polarization in the direction of AoD, which is denoted as φ. Finally, Lr,t is the path loss. Thus, the effective channel can be decomposed into the channels from copolarization and cross-polarization, which is given by H eff = H + G , where √  √  √ √ α h α h β h β h H = √ 11 11 √ 12 12 , G = √ 12 12 √ 11 11 . α21 h21 α22 h22 β22 h22 β21 h21 We assume that the large-scale parameters from the tth port at the BS are the same, regardless of the antenna index at the MS (i.e., αrt = αt , βrt = βt and Lr,t = Lt = L). This assumption is valid when the MS is a small device [12]. The XPD at the MS with the corresponding AoD from the tth port of a dual-polarization antenna is then expressed by √ Eh [| αt hrt |2 ] αt Gφ,αt Lrt0 Gφ,αt √ = = = . (1) χφ,t = 2 β t0 Gφ,βt Lrt Gφ,βt Eh [| βt0 hrt0 | ] III. C ORRELATED C HANNEL M ODEL FOR A D UAL -P OLARIZATION A NTENNA From the effective dual-polarization channel, we recognize that despite of the orthogonal polarization, G affects the correlation between its components in the real propagation 1 The conventional dual-polarization channel models in [6]–[8] can be obtained by letting Gφ,βt = 0. Since they did not consider the propagation of cross-polarized waves, they applied statistical XPD values to the off-diagonal elements in the polarization transfer matrix. Fig. 2. On the left are pictures of the fabricated dual polarization antenna (up: top view, down: bottom view). On the right are the radiation patterns of different XPD cases (up: E-plane, down: H-plane, solid line (outside): copolarization, dashed line (inside): cross-polarization). The shapes of patterns are measured from the fabricated dual-polarization antenna. Meanwhile, the gains of patterns of each XPD are estimated under the same power constraint. channel. From (1), while the formula of XPD is a function of the average received powers (αt and βt ) in a certain AoD, XPD can be calculated from the measured radiation pattern in an anechoic chamber. The spatial correlation between adjacent BS antennas depends on the antenna configuration and the AoD in the conventional spatial MIMO channel model. In contrast, since two ports are collocated in the dual-polarization antenna, to investigate such correlation, we consider XPD parameters rather than adjacent antenna spacing. To construct the correlated channel model for a dualpolarization antenna, we first assume that there is a negligible spatial correlation at the MS. This assumption ensures that the effective channel consists of only transmit side effects. From (1), the effective channel is decomposed into # √ " √ √1 1 α1 h11 α2 h12 χφ,1 √ . (2) H eff = √ α1 h21 α2 h22 √χ1φ,2 1 From (2), the effective channel can be represented as the Kro1/2 necker model (i.e., H eff = H R TX ), a model that is commonly used to analyze the correlation of channel components [14], [15]. Thus, the effective correlation matrix at the transmitter is expressed by # " √2 1 χφ,1 R TX(dualpole) ≈ , (3) √2 1 χφ,2 √ χ χ +1 φ,2 with an approximation, √φ,1 ≈ 1, in the high XPD χφ,1 χφ,2 2 regime. Equation (3) implies that the correlation coefficient √ between the ports can be represented as ρdualpole = 2/ χ when the XPDs of both ports in the same direction are the same. The effective correlation matrix implies that XPD affects 2 This approximation also holds in the typical range where the average XPDs are 7-9 dB [15]. 3 1 th is SINRi = ||w w i ||2 pn , where w i and pn are the i column vector of W and the background noise (-174 dBm/Hz), respectively. The average throughput is calculated from the results of 1,000 simulations for 802 differently located users of which the distribution is uniform within 1 m above the floor in the shaded region of the figure, assuming a single-user MIMO system (the BS serves only one MS at a time). A. Comparison of the Measured and Proposed Channels Fig. 3. Perspective view of the test site for 3D ray-tracing simulations. the correlation of channels, which affects the throughput of MIMO. Consider, for example, the worst case of XPD (= 0 dB). Since that yields a rank-1 MIMO channel, spatial multiplexing is not available. IV. 3D R AY- TRACING - BASED S YSTEM -L EVEL S IMULATION We develop a system-level simulator based on a 3D raytracing tool (WiSE, Wireless System Engineering developed by Bell Labs) [16]. Fig. 3 shows the building database of the test site from the perspective view of the second floor of the Veritas C Hall at Yonsei University [13]. The digital map includes concrete walls and floors, metallic doors, glass windows, and sheetrock ceilings. The BS is located immediately under a 3 m-high ceiling in a hallway with one dual-polarization antenna facing the rooms to the southeast. The system parameters are set to those for the Long Term Evolution (LTE) systems; the FFT size = 1024 (8.4 MHz effective bandwidth), the system overhead = 25.22 percent, and the maximum modulation order = 64 QAM (5/6 code rates) [17]. The propagation gains (αij and βij ) are measured by using the 3D ray-tracing tool based on the manufactured antenna pattern [11] in Fig. 2. We assume that, for notational convenience and for investigating the effect of different XPDs on MIMO systems without loss of generality, the shapes of the radiation patterns of both copolarization and cross-polarization are the same.3 We also measure the propagation gain (αomni ) from the BS with two omnidirectional antennas (for the conventional antenna configuration). From these measurements, we construct channel matrices H and G. Finally, we evaluate the average throughput in four effective channel models: i) the whole measured channel from the dual-polarization antenna H +G G); ii) the analytical channel with the effective correlation (H H R 1/2 matrix (H TX(dualpole) ); iii) the whole measured channel with the spatial correlation matrix of two omnidirectional antennas H omniR 1/2 (H TX(omni) ); iv) the analytical channel with the effective correlation matrix assuming the omnidirectional pattern H omniR 1/2 (H H is the channel matrix whose TX(dualpole) ), where √ omni elements are denoted by αomni hrt . We assume a zero-forcing receiver described as W T = H eff )−1 (i.e., open-loop spatial multiplexing assuming per(H fect channel estimation at the MS). Thus, the signal-tointerference-plus-noise-ratio (SINR) of the ith received signal 3 This assumption holds for a high average XPD in all directions, which is desired for a MIMO system in an indoor environment [11], and the extension for any pattern is straightforward. Fig. 4 shows the cumulative distribution function (CDF) of the average throughput extracted from our system-level simulator by the effective channel models i) and ii). It shows that the higher the XPD of the dual-polarization antenna, the higher the throughput of the MIMO channel it provides. Besides, the average throughput of the analytical channel well approaches that of the whole measured channel. There are small gaps between them because the 3D ray-tracing simulator measures accurate polarized-propagation. B. Relationship between XPD and Antenna Spacing In this section, we analyze the relationship between the antenna spacing of two omnidirectional antennas and the XPD of one dual-polarization antenna, the throughputs of which are the same. Such a relationship in the manner of the correlation comparison has not been investigated, while prior work has focused on the relationship between the cross-correlation of each polarization and the slant angle [6], [14]. 1/2 To obtain the average throughputs, we use H omniR TX(omni) where two types of AoD distribution, isotropic and Laplacian, are considered for calculating R TX(omni) . Isotropic distribution is usually used for the rich-scattering environments while Laplacian distribution reflects the real measurements of AoDs of corresponding MSs through the 3D ray-tracing simulation. From the given AoD distribution, we get the spatial correlation coefficient of the tth row of R TX(omni) as ρomni,t = Eφ [e−jkd sin φ ], where k is the wavenumber and d is the distance between adjacent antennas. Then, for each MS, the effective channel with the measured spatial correlation matrix of two omnidirectional antennas is derived as s L X p` T R1/2 H omni,` (R (4) H eff = PL TX(omni),` ) , p ` `=1 `=1 where p` is the power-delay profile for the `th tap and L is the total number of the channel taps for an MS, which are measured from the 3D ray-tracing simulation. Fig. 5 shows a comparison of the CDF of the average throughput calculated from effective channel models, iii) with Laplacian AoD distribution and iv). It shows that there is a relationship between the XPD and the spatial correlation and this affects the throughput. In Table I, we show an example (for our simulation set up) that compares the derived equivalent separation between adjacent omnidirectional antennas (i.e., disotropic , dLaplacian ) and the effective correlation coefficient, ρdualpole , for different XPD values. In can be seen that as ρdualpole decreases with the increasing XPD, disotropic and dLaplacian increase. Note that the gaps of the equivalent 4 Fig. 4. CDF of the ergodic throughput of 3D ray-tracing simulation for the effective channel models i) and ii). TABLE I E QUIVALENT SPATIAL SEPARATION BETWEEN ADJACENT ANTENNAS COMPARED WITH XPD XPD (dB) 3 5 10 20 30 ρdualpole (Eq. (3)) 0.9432 0.8545 0.5750 0.1980 0.0632 dLaplacian (Fig. 5) 0.100λ 0.150λ 0.255λ 0.820λ 0.850λ disotropic 0.076λ 0.124λ 0.220λ 0.326λ 0.364λ separation between XPD = 20, 30 dB in both the cases of disotropic and dLaplacian are much smaller than the others, which supports the result in Fig. 4. C. Antenna Design Aspect From the relationship between the XPD and the spatial correlation, we can gain two valuable insights into antenna design. First, our research shows a negligible difference in throughput between the cases of XPD = 20 dB and 30 dB. This result implies that it may be inefficient to make a very high XPD-dual-polarization antenna for MIMO, given the high complexity and cost of such an endeavor for small BSs or small devices. Second, using the equivalent separation, we can simply design various uniform arrays, which are organized by dual-polarization antennas. In this section, we use as an example the equivalent separation derived in Table I. If we make a uniform planner array with dual-polarization antennas with 20 dB of XPD for the compact antenna array, the distance between the adjacent dual-polarization antennas will be 0.820λ. Therefore, the presented effective correlation matrix could be a meaningful tool for both evaluating and designing dual-polarization antennas for a compact antenna array in indoor small-cell MIMO systems. V. C ONCLUSION In this letter, we have presented a correlated channel model for a dual-polarization antenna to omnidirectional antennas for indoor small-cell MIMO systems. The presented effective correlation matrix of a dual-polarization channel reflects the relationship between the XPD and the spatial correlation. From the analysis and the results through extensive 3D ray-tracingbased simulations, we have confirmed that the presented effective correlation matrix could be a potential tool for both evaluating and designing dual-polarization antennas. In future Fig. 5. CDF of the ergodic throughput of 3D ray-tracing simulation for the effective channel models, iii) with Laplacian AoD distribution and iv). The antenna separation (dLaplacian ) corresponding to the XPD are given in Table I. work, we will extend our research to various environments and systems. We will also analyze the cost and the complexity of manufacturing a high XPD-dual-polarization antenna. R EFERENCES [1] J. Jang et al., “Smart small cell with hybrid beamforming for 5G: Theoretical feasibility and prototype results,” IEEE Wireless Commun. Mag., vol. 23, no. 6, pp. 124–131, Dec. 2016. [2] D. Gesbert et al., “Shifting the MIMO paradigm: From single user to multiuser communications,” IEEE Sig. Proc. Mag., vol. 24, no. 5, pp. 36–46, Oct. 2007. [3] F. Rusek et al., “Scaling up MIMO: Opportunities and challenges with large arrays,” IEEE Sig. Proc. Mag., vol. 30, no. 1, pp. 40–60, Jan. 2013. [4] Y.-G. Lim, C.-B. Chae, and G. Caire, “Performance analysis of massive MIMO for cell-boundary users,” IEEE Trans. Wireless Commun., vol. 14, no. 12, pp. 6827–6842, Dec. 2015. [5] Y.-G. Lim and C.-B. Chae, “Compressed channel feedback for correlated massive MIMO systems,” in Proc. IEEE Int. Conf. on Comm., June 2014, pp. 360–364. [6] Y. He, X. Cheng, and G. L. Stuber, “On polarization channel modeling,” IEEE Wireless Commun. Mag., vol. 23, no. 1, pp. 80–86, Feb. 2016. [7] M. Coldrey, “Modeling and capacity of polarized MIMO channels,” in Proc. IEEE Veh. Tech. Conf., June 2008, pp. 440–444. [8] C. Degen and W. Keusgen, “Performance of polarisation multiplexing in mobile radio systems,” Electron. Lett., vol. 38, no. 25, pp. 1730–1732, Dec. 2002. [9] C. Y. D. Sim, C. C. Chang, and J. S. Row, “Dual-feed dual-polarized patch antenna with low cross polarization and high isolation,” IEEE Trans. Antennas Propag., vol. 57, no. 10, pp. 3405–3409, Oct. 2009. [10] K. L. Lau, K. M. Luk, and D. Lin, “A wide-band dual-polarization patch antenna with directional coupler,” IEEE Antennas Wireless Propag. Lett., vol. 1, no. 1, pp. 186–189, 2002. [11] T. Oh et al., “Dual-polarization slot antenna with high cross-polarization discrimination for indoor small-cell MIMO systems,” IEEE Antennas Wireless Propag. Lett., vol. 14, pp. 374–377, 2015. [12] J. Medbo et al., “Radio propagation modeling for 5G mobile and wireless communications,” IEEE Commun. Mag., vol. 54, no. 6, pp. 144–151, June 2016. [13] Y.-G. Lim et al., “Map-based millimeter-wave channel models: An overview, guidelines, and data,” arXiv preprint arXiv: 1711.09052, Nov. 2017. [14] M. Shafi et al., “Polarized MIMO channels in 3-D: models, measurements and mutual information,” IEEE J. Sel. Areas Commun., vol. 24, no. 3, pp. 514–527, Mar. 2006. [15] 3GPP TR 38.873 V12.2.0, Study on 3D channel model for LTE, June 2015. [16] R. Valenzuela, D. Chizhik, and J. Ling, “Measured and predicted correlation between local average power and small scale fading in indoor wireless communication channels,” in Proc. IEEE VTC Spring, vol. 3, May 1998, pp. 2104–2108. [17] S. Sesia, I. Toufik, and M. Baker, LTE, The UMTS Long Term Evolution: From Theory to Practice. Wiley, 2012.
7cs.IT
A Specification of Open Transactional Memory for Haskell Marino Miculan∗ Marco Peressotti [email protected] [email protected] arXiv:1602.05365v1 [cs.PL] 17 Feb 2016 Laboratory of Models and Applications of Distributed Systems Department of Mathematics, Informatics, and Physics University of Udine, Italy Abstract Transactional memory (TM) has emerged as a promising abstraction for concurrent programming alternative to lock-based synchronizations. However, most TM models admit only isolated transactions, which are not adequate in multi-threaded programming where transactions have to interact via shared data before committing. In this paper, we present Open Transactional Memory (OTM), a programming abstraction supporting safe, datadriven interactions between composable memory transactions. This is achieved by relaxing isolation between transactions, still ensuring atomicity: threads of different transactions can interact by accessing shared variables, but then their transactions have to commit together— actually, these transactions are transparently merged. This model allows for loosely-coupled interactions since transaction merging is driven only by accesses to shared data, with no need to specify participants beforehand. In this paper we provide a specification of the OTM in the setting of Concurrent Haskell, showing that it is a conservative extension of current STM abstraction. In particular, we provide a formal semantics, which allows us to prove that OTM satisfies the opacity criterion. 1 Introduction The advent of multicore architectures has emphasized the importance of abstractions supporting correct and scalable multi-threaded programming. In this model, threads can collaborate by interacting on data structures (such as tables, message queues, buffers, etc.) kept in shared memory. Traditional lock-based mechanisms (like semaphores and monitors) used to regulate access to these shared data are notoriously difficult and error-prone, as they easily lead to deadlocks, race conditions and priority inversions; moreover, they are not composable and hinder parallelism, thus reducing efficiency and scalability. Transactional memory (TM) has emerged as a promising abstraction to replace locks [3, 14]. The basic idea is to mark blocks of code as atomic; then, execution of each block will appear either as if it was executed sequentially and instantaneously at some unique point in time, or, if aborted, as if it did not execute at all. This is obtained by means of optimistic executions: the blocks are allowed to run concurrently, and eventually if an interference is detected a transaction is restarted and its effects are rolled back. Thus, each transaction can be viewed in isolation as a single-threaded computation, significantly reducing the programmer’s burden. Moreover, transactions are composable and ensure absence of deadlocks and priority inversions, automatic roll-back on exceptions, and increased concurrency. ∗ Partially supported by MIUR project 2010LHT4KM (CINA). 1 However, in multi-threaded programming different transactions may need to interact and exchange data before committing. In this situation, transaction isolation is a severe shortcoming. A simple example is a request-response interaction between two transactions via a shared buffer, like in a master/worker situation. We could try to synchronize the threads accessing the buffer b by means of two semaphores c1, c2 as follows: // Party1 (Master) // Party2 (Worker) atomically { atomically { <put request in b> down(c1); // wait for data up(c1); <get request from b> <some other code; may abort> <compute answer; may abort> down(c2); // wait for answer <put answer in b> <get answer from b; may abort> up(c2); } } Unfortunately, this solution does not work: any admissible execution requires an interleaved scheduling between the two transactions, thus violating isolation; hence, the transactions deadlock as none of them can progress. It is important to notice that this deadlock arises because interaction occurs between threads of different transactions; in fact, the solution above is perfectly fine for threads outside transactions or within the same transaction. To overcome this limitation, in this paper we propose a programming model for safe, datadriven interactions between memory transactions. The key observation is that atomicity and isolation are two disjoint computational aspects: • an atomic non-isolated block is executed “all-or-nothing”, but its execution can overlap others’ and uncontrolled access to shared data is allowed; • a non-atomic isolated block is executed “as it were the only one” (i.e., in mutual exclusion with others), but no rollback on errors is provided. Thus, a “normal” block of code is neither atomic nor isolated; a mutex block (like Java synchronized methods) is isolated but not atomic; and a usual TM transaction is a block which is both atomic and isolated. Our claim is that atomic non-isolated blocks can be fruitfully used for implementing safe composable interacting memory transactions—henceforth called open transactions. In this model, a transaction is composed by several threads, called participants, which can cooperate on shared data. A transaction commits when all its participants commit, and aborts if any thread aborts. Threads participating to different transactions can access to shared data, but when this happens the transactions are transparently merged into a single one. For instance, the two transactions of the synchronization example above would automatically merge becoming the same transaction, so that the two threads can synchronize and proceed. Thus, this model relaxes the isolation requirement still guaranteeing atomicity and consistency; moreover, it allows for loosely-coupled interactions since transaction merging is driven only by run-time accesses to shared data, without any explicit coordination among the participants beforehand. In summary, the contributions of this paper are the following: • We present Open Transactional Memory, a transactional memory model where multithreaded transactions can interact by non-isolated access to shared data. Consistency and atomicity are ensured by transparently merging transactions at runtime. • We describe this model in the context of Concurrent Haskell (Section 3). Namely, we define two monads OTM and ITM, representing the computational aspects of atomic multi-threaded open (i.e., non-isolated) transactions and atomic single-threaded isolated transactions, respectively. Using the construct atomic, programs in the OTM monad are executed “allor-nothing” but without isolation; hence these transactions can merge at runtime. When 2 needed, blocks inside transactions can be executed in isolation by using the construct isolated. Both OTM and ITM transactions are composable, and we exploit Haskell type system to forbid irreversible effects inside these two monads.1 • We provide a formal operational semantics of our system (Section 4). This semantics defines clearly the behaviour also in less intuitive situations, and serves as a reference for implementations. Using this semantics we prove that OTM satisfies the opacity correctness criterion for transactions [1]. Some concluding remarks and directions for future work are in Section 5. 2 Concurrency in Haskell Haskell was born as pure lazy functional language; side effects are handled by means of monads [13]. For instance, I/O actions have type IO a and can be combined together by the monadic bind combinator >>=. Therefore, the function putChar :: Char -> IO () takes a character and delivers an I/O action that, when performed (even multiple times), prints the given character. Besides external inputs/outputs, values of IO include operations with side effects on mutable (typed) cells. A cell holding values of type a has type IORef a and may be dealt with only via the following operations: newIORef :: a -> IO (IORef a) readIORef :: IORef a -> IO a writeIORef :: IORef a -> a -> IO () Concurrent Haskell [12] adds support to threads which independently perform a given I/O action as explained by the type of the thread creation function: forkIO :: IO () -> IO ThreadId The main mechanism for safe thread communication and synchronisation are MVars. A value of type MVar a is mutable location (as for IORef a) that is either empty or full with a value of type a. There are two fundamental primitives to interact with MVars: takeMVar :: Mvar a -> IO a putMvar :: Mvar a -> a -> IO () The first empties a full location and blocks otherwise whereas the second fills an empty location and blocks otherwise. Therefore, MVars can be seen as one-place channels and the particular case of MVar () corresponds to binary semaphores. We refer the reader to [11] for an introduction to concurrency, I/O, exceptions, and cross language interfacing (the “awkward squad” of pure, lazy, functional programming). STM Haskell [2] builds on Concurrent Haskell adding transactional actions and a transactional memory for safe thread communication, called transactional variables or TVars for short. Transactional actions have type STM a and are concatenated using STM monadic “bind” combinator, akin I/O actions. A transactional action remains tentative during its execution and (its effect) is exposed to the rest of the system by atomically :: STM a -> IO a 1 In fact, OTM model can be implemented in any programming language, provided we have some means, either static or dynamic, to forbid irreversible effects inside transactions. 3 which takes an STM action and delivers an I/O action that, when performed, runs the transaction guaranteeing atomicity and isolation with respect to the rest of the system. Transactional variables have type TVar a where a is the type of the value held and, like IOrefs, are manipulated via the interface: newTVar :: a -> STM (TVar a) readTVar :: TVar a -> STM a writeTVar :: TVar a -> a -> STM () For instance, the following code uses monadic bind to combine a read and write operation on a transactional variable and define a “transactional update”: modifyTVar :: TVar a -> (a -> a) -> STM () modifyTVar var f = do x <- readTVar var writeOTVar var (f x) Then, atomically (modifyTVar x f) delivers an I/O action that applies f to the value held by x and updates x accordingly—the two steps being executed as a single atomic isolated operation. The primitives recalled so far cover memory interaction, but STM allows also for composable blocking. In STM Haskell, blocking translates in “this thread has been scheduled too early, i.e., the right conditions are not fulfilled (yet)”. The programmer can tell the scheduler about this fact by means of the primitive: retry :: STM a The semantics of retry is to abort the transaction and re-run it after at least one of the transactional variables it has read from has been updated—there is no point in blindly restarting a transaction. Finally, transactions can be composed as alternatives by means of orElse :: STM a -> STM a -> STM a which evaluates its first argument, and if this results is a retry the second argument is evaluated discarding any effect of the first. 3 Composable open transactions In this section we present the key ideas of the paper by gradually introducing the primitives from the OTM library, summarised in Figure 1. Although the OTM model can be implemented in any language, we consider Haskell because its expressive type system offers a perfect environment for studying the ideas of transactional memory. In [2] this has been used to single out computations which can be executed in transactions, i.e. terms which can perform memory effects, from those which can perform irreversible input/output effects. In this paper we refine further this approach by using the type system to separate isolated transactions from those which can interact, and hence merged. The key point is to separate isolation from atomicity. In fact, isolation is a computational aspect which can be added to atomic transactions. From this perspective, we distinguish between isolated atomic actions and (non isolated) atomic actions. The former are values of type ITM a and the latter of OTM a. Each type of actions can be sequentially composed (by the corresponding monadic binders) preserving atomicity and, for the former, isolation. 4 data ITM a data OTM a -- henceforth, t is a placeholder for ITM or OTM --- Sequencing, do notation -----------------------(>>=) :: t a -> (a -> t b) -> t b return :: a -> t a -- Running isolated and atomic computations ------atomic :: OTM a -> IO a isolated :: ITM a -> OTM a retry :: ITM a orElse :: ITM a -> ITM a -> ITM a -- Exceptions ------------------------------------throw :: Exception e => e -> t a catch :: Exception e => t a -> (e -> t a) -> t a -- Threading -------------------------------------fork :: OTM () -> OTM ThreadId -- Transactional memory --------------------------data OTVar a newOTVar :: a -> ITM (OTVar a) readOTVar :: OTVar a -> ITM a writeOTVar :: OTVar a -> a -> ITM () Figure 1: The base interface of OTM. The function isolated takes an isolated atomic action and delivers an atomic action whose effects are guaranteed to be executed in isolation with respect to other actions. Then, atomic takes an atomic action and delivers an I/O action that when performed runs a transaction whose effects are kept tentative until it commits. Tentative effects are shared among all non-isolated transactions. Therefore, any value of type STM a can be seen as a value of ITM a for the I/O they deliver is the same: atomically = atomic . isolated Isolation OTM supports composable blocking via the primitive retry, under STM slogan “a thread that has to be blocked because it has been scheduled too soon”. As for STM, retrying a transactional action actually corresponds to block the threads on some condition. Note that retry :: OTM a is not a primitive since it can be defined from that of ITM as isolated retry. Checks may be declared as follows: check :: Bool -> ITM () check b = if b then return () else retry although similar primitives may be implemented at the runtime level in order to use this information in thread scheduling. OTM provides a mechanism for safe thread communication by means of transactional variables called OTVars, similar to STM’s TVars but supporting open transactions. These variables are 5 values of type OTVar a where a is the type of value held. Creating, reading and writing OTVars is done via the interface shown in Figure 1. All these actions are both atomic and isolated as ensured by their type. Therefore, when it comes to actions of type ITM a, OTVars are basically TVars; e.g. modifyTVar from STM corresponds to: modifyOTVar :: OTVar a -> (a -> a) -> ITM () modifyOTVar var f = do x <- readOTVar var writeOTVar var (f x) From its type it is immediate to see that the update is both atomic and isolated. In fact, read and write operations are glued together by the >>= combinator, preserving both properties. Likewise, invariants on transactional variables can be easily checked by composing reads and checks as follows: assertOTVar :: OTVar a -> (a -> Bool) -> ITM () assertOTVar var p = do x <- readOTVar var check (p x) Blocking A semaphore is a counter with two fundamental operation: up which increments the counter and down which decrements the counter if it is not zero and blocks otherwise. Semaphores are implemented using OTM as OTVars holding a counter: type Semaphore = OTVar Int Then, up and down are two trivial atomic and isolated updates, with the latter being guarded by a pre-condition: up :: Semaphore -> ITM () up s = modifyOTvar s (1+) down :: Semaphore -> ITM () down s = do assertOTVar s (> 0) modifyOTVar s (-1+) Actions can also be composed as alternatives by means of the primitive orElse. For instance, the following takes a family of semaphores and delivers an action that decrements one of them, blocking only if none can be decremented: downAny :: [Sempahore] -> ITM () downAny (x:xs) = down x ‘orElse‘ downAny xs downAny [] = retry Interaction The interchangeability of OTM and STM ends when isolation is dropped. In fact, OTM offers shared OTVars as a mechanism for safe transaction interaction. This means that non-isolated transactional actions see the effects on shared variables of any other non-isolated transactional action, as they are performed concurrently on the same object. This flow of information introduces dependencies between concurrent tentative actions tying together their fate: an action cannot make its effects permanent, if it depends on informations produced by another action which fails to complete. OTM guarantees coherence of transactional actions in presence 6 of interaction through shared transactional variables. Thus, OTVars enables loosely-coupled interaction right inside atomic actions taking the programming style of STM a step further. For instance, communication, rendezvous, brokering, and in general, multi-party interactions can all be atomic (non-isolated) actions. In order to substantiate these claims, let us see open transactions in action by implementing a synchronisation scenario as described in Section 1. In this example a master process outsources part of an atomic computation to some thread chosen from a worker pool; data is exchanged via some shared variable, whose access is coordinated by a pair of semaphores. Notably, both the master and the worker can abort the computation at any time, leading the other party to abort as well. This can be achieved straightforwardly using OTM: master c1 c2 = do worker c1 c2 = do -- put request -- do something isolated (up c1) isolated (down c1) -- do something else -- get request isolated (down c2) -- put answer -- get answer isolated (up c2) Both functions deliver atomic actions in OTM, and hence are not isolated. We used semaphores for the sake of exposition but we could synchronize by means of more abstract mechanisms, like barriers, channels or futures, which can be implemented using OTM. Concurrency Differently from STM, OTM supports parallelism inside non-isolated transactions. We can easily fork new threads without leaving OTM but, like any effect of a transactional action, thread creation and execution remain tentative until the whole transaction commits. Forked threads participate to their transaction and impact its life-cycle (e.g. issuing aborts) as any other participant. This means that before committing, all forked threads have to complete their transactional action, i.e. terminate. Therefore, although the whole effect delivered by the transaction has happened concurrently, forked threads never leave a transaction alive. Because of their transactional nature, threads forked inside a transaction do not have compensations nor continuations (i.e. I/O actions to be executed after an abort or after a commit). Compensations are pointless since aborts revert all effects including thread creation. It is indeed possible to replace the primitive fork with one supporting I/O actions as continuations like forkCont :: OTM a -> (a -> IO ()) -> OTM ThreadID In fact, this mechanism can be implemented by means of the primitives already offered OTM: since commits are synchronisation points, the above corresponds to the parent thread forking a thread for each continuation, after the atomic action is successfully completed. On the other hand, by definition isolated atomic actions have to appear as being executed in a single-threaded setting; hence ITM, like STM, does not support thread creation. 4 4.1 Formal specification of OTM Syntax and abstract machine states We fix an Haskell-like language extended with the OTM primitives of Figure 1. The syntax is summarised in Figure 2 where the meta-variables x and r range over a given countable set of variables Var and of location names Loc, respectively. We assume Haskell typing conventions and denote the set of all well-typed terms by Term. 7 Value V ::= Term M, N ::= r | \x -> M | return M | M >>= N | throw M | catch M N | putChar c | getChar | fork M | atomic M N | isolated M | retry | M ‘orElse‘ N | newOTVar M | readOTVar r | writeOTVar r M x | V | M N | ... Figure 2: The syntax of values and terms. Thread Thread family Expression Plain process Transaction Any process Tt ::= P ::= E ::= Pt ::= Tt,k ::= At ::= ([M ])t | ([M ; N ])t,k ∀i, j ti 6= tj Tt1 k · · · k Ttn [−] | E >>= M ([E])t k P t∈ /P ([E; M ])t,k k P t∈ /P Pt | Tt,k Figure 3: Threads and evaluation contexts. Terms of this language are evaluated by an abstract state machine whose states are pairs hP ; Σi formed by: • a thread family (process) P = Tt1 k · · · k Ttn , • a memory Σ = hΘ, ∆, Ψi, where Θ : Loc ⇀ Term is the heap and ∆ : Loc ⇀ Term× TrName is the working memory; TrName is a set of names used to identify active transactions; Ψ is a forest of threads identifiers. Threads Threads are the smaller unit of execution the machine scheduler operates on; they execute OTM terms and do not have any private transactional memory. A thread outside transactions is represented by ([M ])t where M is the term being evaluated and t is a unique thread identifier (Figure 3). A thread inside a transaction k is represented by ([M ; N ])t,k where M is the term being evaluated inside the transaction k and N is the term being evaluated as continuation after k commits or aborts. At any time, all thread identifiers are stored in the auxiliary structure Ψ, which is a forest reflecting how threads are forked: if t′ has been forked by t while inside k then t′ belongs to k too and occurs in Ψ as a child of t. We shall present thread families borrowing the parallel operator k from process algebra (Figure 3). The operator is associative, commutative and defined only on threads whose thread identifiers are distinct. The notation is extended to thread families (i.e. processes) with 0 denoting the empty family. Memory The memory Σ is divided in the heap Θ and in the distributed working memory ∆ (plus the auxiliary structure Ψ recording thread fork hierarchy). As for traditional closed (ACID) transactions (e.g. [2]), operations inside a transaction are evaluated against ∆ and effects are propagated to Θ only on commits. When a thread inside a transaction k accesses a location outside ∆ the location is claimed by transaction k and remains claimed until k commits, aborts or restarts. Threads in k can interact only with locations claimed by k, but active transactions can be merged to share their claimed locations. We shall denote the set of all possible states as State, and reference to each projected component of Σ by a subscript, i.e. ΣΘ for the heap and Σ∆ for the working memory. When describing updates to the memory Σ, we adopt the convention that Σ′ has to be intended equals to Σ except 8 [Eval] [BindVal] [CatchVal] M 6≡ V V[M ] = V M →V [BindEx] return M >>= N → N M r ∈ {retry, return N } r ‘catch‘ M → r [CatchEx] e ∈ {retry, throw N } e >>= M → e throw M ‘catch‘ N → N M Figure 4: Term reductions: M → N . [InChar] [OutChar] ?c hPt [getChar]; Σi −→ hPt [return c]; Σi !c hPt [putChar c]; Σi − → hPt [return ()]; Σi [TermIO] [ForkIO] M →N hPt [M ]; Σi − → hPt [N ]; Σi t′ ∈ / threadsPt [fork M ] hPt [fork M ]; Σi − → hPt [return t′ ] k ([M ; return])t′ ,k ; Σi Figure 5: IO state transitions. if stated otherwise, i.e. by statements like Σ′Θ = ΣΘ [r 7→ M ]. Finally, the completely undefined partial function ∅ denotes the empty heap and working memory. 4.2 Operational semantics The dynamics of the machine is defined by two transition relations presented in Figures 4 to 7. The first relation M → N is defined on terms only and models pure computations (Figure 4). Rule (Eval) allows a term M that is not a value to be evaluated by means of an auxiliary (partial) function V[M ] yielding the value V ; the other rules define the semantics of the monadic bind and exception handling in a standard way. We remark the symmetry between bind and catch and how retry is treated as an exception by (BindEx) and as a result value by (CatchVal). β Relation → can be thought as accessory to the second relation hP ; Σi − → hP ′ ; Σ′ i, which describes state transitions. Since several rules can apply to a given state according to different evaluation contexts as per Figure 3, this relation is non-deterministic; this models the fact that the scheduler can choose which thread to execute next among various possibilities. Labels β describe the kind of transition, and are defined as follows: β ::= τ | newhki | cohki | abhk, t, M i | abhk, t, M i for k ∈ TrName, M ∈ Term Transitions labelled by τ represent internal steps of transitions, i.e., steps which do not need a coordination among transactions: reduction of pure terms, thread creation and memory operations. These transitions are defined by the rules in Figure 6. Reading a location falls into 9 M →N [TermT] t′ ∈ / threads(Tt,k [fork M ]) [ForkT] Σ′Ψ = add child(t, t′ , ΣΨ ) τ hTt,k [fork M ]; Σi − → hTt,k [return t′ ] k ([M ; return])t′ ,k ; Σ′ i [NewVar] [Read1] [Write1] [Write2] Σ′∆ = Σ∆ [r 7→ (M, k)] r∈ / dom(ΣΘ ) ∪ dom(Σ∆ ) τ hTt,k [newOTVar M ]; Σi − → hTt,k [return r]; Σ′ i Σ′∆ = Σ∆ [r 7→ (M, k)] r∈ / dom(Σ∆ ) ΣΘ (r) = M [Read2] [Or1] τ hTt,k [M ]; Σi − → hTt,k [N ]; Σi τ hTt,k [readOTVar r]; Σi − → hTt,k [return M ]; Σ′ i Σ′∆ = Σ∆ [k 7→ j] Σ∆ (r) = (M, j) τ hTt,k [readOTVar r]; Σi − → hTt,j [return M ]; Σ′ i Σ′∆ = Σ∆ [r 7→ (M, k)] r∈ / dom(Σ∆ ) τ hTt,k [writeOTVar r M ]; Σi − → hTt,k [return ()]; Σ′ i Σ∆ (r) = (N, j) Σ′∆ = Σ∆ [k 7→ j][r 7→ (M, j)] τ hTt,k [writeOTVar r M ]; Σi − → hTt,k [return ()][k 7→ j]; Σ′ i op ∈ {throw, return} τ ∗ h([M ; return])t,k ; Σi − → h([op N ; return])t,j ; Σ′ i τ hTt,k [M ‘orElse‘ M ′ ]; Σi − → hT′t,j [op N ]; Σ′ i τ ∗ [Or2] [Isolated] h([M ; return])t,k ; Σi − → h([retry; return])t,j ; Σ′ i τ hTt,k [M ‘orElse‘ M ′ ]; Σi − → hTt,k [M ′ ]; Σi op ∈ {throw, return} τ ∗ h([M ; return])t,k ; Σi − → h([op N ; return])t,j ; Σ′ i τ hTt,k [isolated M ]; Σi − → hTt,j [op N ]; Σ′ i τ Figure 6: Transactional state transitions: hP ; Σi −→ hP ′ ; Σ′ i. two cases: rule (Read1) models the reading of an unclaimed location and its memory effect is to record the claim in ∆, while rule (Read2) models the reading of a claimed location and its effect is to merge the transactions of the current thread with that claiming the location. Writes behave similarly. Rules (Or1) and (Or2) describe the semantics of alternative sub-transactions: if the first one retry-es the second is executed discarding any effect of the first. Rule (ForkT) spawns a new thread for the current transaction; a term fork M can appear inside atomic, thus allowing multi-threaded open transactions, but its use inside isolated is prevented by the type system and by the shape of (Isolated) as well. The remaining labels describe state transitions concerning the life-cycle of transactions: creation, commit, abort, and restart (Figure 7). These operations require a coordination among threads; for instance, an abort from a thread has to be propagated to every thread participating to the same transaction. This is captured in the semantics by labelling the transition with the operation and the name of the transaction involved; this information is used by the derivation rules to force synchronisation of all participants of that transaction. To illustrate this mechacohki nism, we describe the commit of a transaction k, namely hP ; Σi −−−→ hP ′ ; Σ′ i. First, by means of (MCastGroup) we split P into two subprocesses, one of which contains all threads participating in k (those not in k cannot do a transition whose label contains k). Secondly, using 10 [New] [Commit] newhki h([atomic M >>= N ])t ; Σi −−−−→ h([M ; N ])t,k ; Σi Σ′Θ = commit(k, Σ) Σ′∆ = cleanup(k, Σ) cohki h([return M ; N ])t,k ; Σi −−−→ h([return M >>= N ])t ; Σ′ i Σ′Θ = leak(k, Σ) Σ′∆ = cleanup(k, Σ) ′ ΣΨ = remove(r, ΣΨ ) r = root(t, ΣΨ ) [Abort1] abhk,t,Mi h([throw M ; N ])t,k ; Σi −−−−−−→ h([throw M >>= N ])t ; Σ′ i Σ′Ψ [Abort2] Σ′Θ = leak(k, Σ) Σ′∆ = cleanup(k, Σ) = remove(r, ΣΨ ) r = root(t, ΣΨ ) r = root(t′ , ΣΨ ) abhk,t,Mi h([M ′ ; N ])t′ ,k ; Σi −−−−−−→ h([throw M >>= N ])t′ ; Σ′ i [Abort3] Σ′Ψ Σ′Θ = leak(k, Σ) Σ′∆ = cleanup(k, Σ) = remove(r, ΣΨ ) r = root(t, ΣΨ ) r 6= root(t′ , ΣΨ ) abhk,t,Mi h([M ′ ; N ])t′ ,k ; Σi −−−−−−→ h([retry])t′ ; Σ′ i abhk,t,Mi abhk,t,Mi [MCastAb] hP ; Σi −−−−−−→ hP ′ ; Σ′ i hQ; Σi −−−−−−→ hQ′ ; Σ′ i abhk,t,Mi hP k Q; Σi −−−−−−→ hP ′ k Q′ ; Σ′ i cohki [MCastCo] cohki hP ; Σi −−−→ hP ′ ; Σ′ i hQ; Σi −−−→ hQ′ ; Σ′ i cohki hP k Q; Σi −−−→ hP ′ k Q′ ; Σ′ i β [MCastGroup] hP ; Σi − → hP ′ ; Σ′ i β 6= τ transaction(β) ∈ / transactions(Q) β hP k Q; Σi − → hP ′ k Q; Σ′ i β Figure 7: Transaction management transitions: hP ; Σi −→ hP ′ ; Σ′ i. recursively (MCastCo) we single out every thread in k. Finally, we apply (Commit) provided that every thread is ready to commit, i.e., it is of the form ([return M ; N ])t,k . Aborting a transaction works similarly, but it based on vetoes instead of an unanimous vote. Aborts are triggered by unhandled exceptions raised by some thread, but threads react to this situation in different ways: • threads in the same tree of the thread rasing the exception have been forked within the transaction; hence, the root thread is aborted and all other threads in the tree are killed because their creation, as for any transactional side-effect, have to be discarded; • threads in different trees joined the transaction after it was created, due to a merging; hence, these threads just retry their transaction, since aborting would require them to handle exceptions raised by “foreign” threads. Notice that there are no derivation rules for retry, since its meaning is to inform the scheduler that the execution is stuck; hence the machine has to re-execute the transaction from the beginning (or a suitable check-point), following a different execution order, if and when possible. 11 threads(Tt1 k · · · k Ttn ) , {t1 , . . . tn } transaction(β) , k for β ∈ {newhki, cohki, abhk, t, M i, abhk, t, M i} ( ∆(r) if ∆(r) = (M, l), l 6= k (∆[k 7→ j])(r) , (M, j) if ∆(r) = (M, k)   transactions(P1 ) ∪ transactions(P2 ) if P = P1 k P2 transactions(P ) , {k} if P = ([M ; N ])t,k   ∅ otherwise   P1 [k 7→ j] k P2 [k 7→ j] if P = P1 k P2 P [k 7→ j] , ([M ; N ])t,j if P = ([M ; N ])t,k   P otherwise ( M if r = s Θ[r 7→ M ](s) , Θ(s) otherwise ( (M, k) if r = s ∆[r 7→ (M, k)](s) , ∆(s) otherwise ( ⊥ if Σ∆ (r) = (M, k) cleanup(k, Σ)(r) , Σ∆ (r) otherwise ( M if Σ∆ (r) = (M, k) commit(k, Σ)(r) , ΣΘ (r) otherwise leak(k, Σ)(r) , M if ΣΘ (r) = M or ΣΘ (r) = ⊥ and Σ∆ (r) = (M, k) Figure 8: Auxiliary functions. 4.3 Opacity In this section we use the formalisation of OTM to prove that it meets the opacity criterion. The opacity correctness criterion for transactional memory [1] is an extension of the classical serialisability property for databases with the additional requirement that even non-committed transactions must access consistent states. Intuitively, this property ensures that: (a) effects of any committed transaction appear performed at a single, indivisible point during the transaction lifetime, (b) effects of any aborted transaction cannot be seen by any other transaction, and (c) transactions always access consistent states of the system. In order to formally capture these intuitive requirements let us recall some notions from [1]. A history is a sequence of read, write, commit, and abort operations2 ordered according to the time at which they were issued (simultaneous events are arbitrarily ordered) and such that no operation can be issued by a transaction that has already performed a commit or an abort. A transaction k is said to be in a history H if the latter contains at least one operation issued by 2 The definition given in [1] considers finer-grained events; in particular, read and write operations are formed by request, execution, and response events. However in loc. cit. the authors restrict to histories where requestexecution-response sequences are not interleaved, hence we can consider the simpler read/writes events in the first place. 12 k. Any history H defines a happens-before partial order ≺H where k ≺H k ′ iff the transaction k becomes committed or aborted in H before k ′ issues its first operation. If ≺H is total then H is called sequential. For a history H, let complete(H) be the set of histories obtained by adding either a commit or an abort for every live transaction in H. We are now able to recall Guerraoui and Kapalka’s definition3 of opacity. Definition 4.1 ([1, Def. 1]). A history H is said to be opaque if there is a sequential history S equivalent to some history in the set complete(H) such that ≺S ⊆ ≺H . As shown in [1], opacity corresponds to the absence of mutual dependencies between live transactions, where a dependency is created whenever a transaction reads an information written by another or depends from its outcome. Definition 4.2 (Opacity graph [1, Sec. 5.4]). For a history H let ≪ be a total order on the set T of all transactions in H. An opacity graph for H and ≪, OP G(H, ≪), is a bi-coloured directed graph on T such that a vertex is red if the corresponding transaction is either running or aborted, it is black otherwise, and such that there is an edge from k to k ′ whenever any of the following holds: (a) (b) (c) (d) k ′ happens-before k; k reads something written by k ′ ; k ′ reads some location written by k and k ′ ≪ k; k ′ is neither running nor aborted and there are a location r and a transaction k ′′ such that k ′ ≪ k ′′ , k ′ writes to r, and k ′′ reads r from k. The edge is red if the second case applies otherwise it is black. If all edges from red nodes in OP G(H, ≪) are also red then the graph is said to be well-formed. Let H be a history and let k be a transaction appearing in it. A read operation by k is said to be local (to k) whenever the previous operation by k on the same location was a write. A write operation by k is said to be local (to k) whenever the next operation by k on the same location is a write. We denote by nonlocal (H) the longest sub-history of H without any local operations. A history H is said locally-consistent if every local read is preceded by a write operation that writes the red value; it is said consistent if, additionally, whenever some k reads v from r in nonlocal (H) then some k ′ writes v to r in nonlocal (H). Theorem 4.3 ([1, Thm. 2]). A history H is opaque if and only if (a) H is consistent and (b) there exists a total order ≪ on the set of transactions in H such that OP G(nonlocal (H), ≪) is well– formed and acyclic. In [1] transactions may encapsulate several threads but cannot be merged. Therefore, in order to study opacity of OTM we extend the set of operations considered in loc. cit. with explicit merges. Let k, k ′ be two running transactions in the given history; when they merge, they share their threads, locations, and effects. From this perspective, k is commit-pending and depends from k ′ and hence in the opacity graph, k is a red node connected to k ′ by a red edge. Hence, merges can be equivalently expressed at the history level by sequences like: (1) new x; (2) k ′ writes on x; (3) k reads from x; (4) k prepares to commit. These are the only dependencies found in histories generated by OTM. 3 The original definition requires the history H to be also “legal”, but this notion is relevant only in presence of non-transactional operations which both STM and OTM prevent by design. 13 Theorem 4.4. For H a history describing an execution of a OTM program and a total order ≪, OP G(nonlocal (H), ≪) is a forest of red edges where only roots may be white. Proof. By inspection of the rules it is easy to see that (a) transactions may access only locations they claimed; (b) claimed locations are released only on commits, aborts and retries; (c) transactions have to merge with any transaction holding a location they need. Therefore, at any time there is at most one running transaction issuing operations on a given location, hence reads and writes do not create edges. Thus edges are created only during the execution of merges and, by inspecting the above implementation, it easy to see that (d) any transaction can issue at most one merge; (e) a transaction issuing a merge is a red node; (f ) the edge created by a merge is red. Therefore, transactions form a forest made of red edges where any non-root node is red. Corollary 4.5 (Opacity). OTM meets the opacity criterion. Proof. A forest formed by red edges whose sources are always red is acyclic and well-formed. 5 Conclusions In this paper we have presented OTM, a programming model supporting interactions between composable memory transactions. This model separates isolated transactions from non-isolated ones, still guaranteeing atomicity; the latter can interact by accessing to shared variables. Consistency is ensured by transparently merging interacting transactions at runtime. We have showed the versatility and simplicity of OTM by implementing some examples which are incompatible with isolation, and we have given a formal semantics for OTM, which allowed us to prove that this model satisfies the opacity criterion. There are two main directions for future work each posing its own challenges. First, like STM, this model supports nesting (via orElse); however, this feature is currently limited to isolated (sub)transactions. Supporting nesting of open transaction requires additional care in the handling of side-effects: is merging transactions at different level of nesting feasible and meaningful or are we breaking the intuition behind the programming model? Secondly, an implementation is due in order to validate experimentally the model. A possible approach is to implement OTM completely in Haskell on top of STM. This solution does not need any specific support from the Haskell RunTime (HRT) but cannot benefit of the performance gains offered by a deeper integration, thus hindering any fair comparison with existing TM models, like STM. On the other hand, integrating OTM with the HRT and the Glasgow Haskell Compiler, akin STM, would be more efficient but also more complex and invasive. We have presented OTM within Haskell (especially to leverage its type system), but this model is general and can be applied to other languages. A possible future work is to port this model to an imperative object oriented language, such as Java or C++; however, like other TM implementations, we expect that this extension will require some changes in the compiler and/or the runtime. This work builds on the ideas in [10] where we described an abstract calculus with shared memory and open transactions. In loc. cit. we showed how this model is expressive enough to represent T CCS m [4], a variant of the Calculus of Communicating Systems with transactional synchronization. Being based on CCS, communication in T CCS m is synchronous; however, nowadays asynchronous models play an important rôle (see e.g. actors, event-driven programming, etc.). It may be interesting to generalize the discussion so as to consider also this case, e.g. by defining an actor-based calculus with open transactions. Such a calculus can be quite useful also for modelling speculative reasoning for cooperating systems [5–9]. A local version of actor-based open transactions can be implemented in OTM using lock-free data structures (e.g., message queues) in shared transactional memory. 14 Acknowledgements We thank Nicola Gigante and Valentino Picotti for their valuable feedback about the OTM programming model. References [1] R. Guerraoui and M. Kapalka. On the correctness of transactional memory. In Proc. PPoPP, pages 175–184. ACM, 2008. [2] T. Harris, S. Marlow, S. L. Peyton Jones, and M. Herlihy. Composable memory transactions. In Proc. PPoPP, pages 48–60. ACM, 2005. [3] M. Herlihy and J. E. B. Moss. Transactional memory: Architectural support for lock-free data structures. In A. J. Smith, editor, Proc. ISCA, pages 289–300. ACM, 1993. [4] V. Koutavas, C. Spaccasassi, and M. Hennessy. Bisimulations for communicating transactions. In A. Muscholl, editor, Proc. FOSSACS, volume 8412 of LNCS, pages 320–334. Springer, 2014. [5] J. Ma, K. Broda, R. Goebel, H. Hosobe, A. Russo, and K. Satoh. Speculative abductive reasoning for hierarchical agent systems. In J. Dix, J. Leite, G. Governatori, and W. Jamroga, editors, Computational Logic in Multi-Agent Systems, volume 6245 of LNCS, pages 49–64. 2010. [6] A. Mansutti, M. Miculan, and M. Peressotti. Distributed execution of bigraphical reactive systems. ECEASST, 71, 2014. [7] A. Mansutti, M. Miculan, and M. Peressotti. Towards distributed bigraphical reactive systems. In R. Echahed, A. Habel, and M. Mosbah, editors, Proc. GCM’14, page 45, 2014. [8] A. Mansutti, M. Miculan, and M. Peressotti. Multi-agent systems design and prototyping with bigraphical reactive systems. In K. Magoutis and P. Pietzuch, editors, Proc. DAIS, volume 8460 of LNCS, pages 201–208. 2014. [9] M. Miculan and M. Peressotti. A CSP implementation of the bigraph embedding problem. CoRR, abs/1412.1042, 2014. [10] M. Miculan, M. Peressotti, and A. Toneguzzo. Open transactions on shared memory. In COORDINATION, volume 9037 of LNCS, pages 213–229. Springer, 2015. [11] S. L. Peyton Jones. Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell. Engineering theories of software construction, 180:47, 2001. [12] S. L. Peyton Jones, A. D. Gordon, and S. Finne. Concurrent Haskell. In H. Boehm and G. L. S. Jr., editors, Proc. POPL, pages 295–308. ACM, 1996. [13] S. L. Peyton Jones and P. Wadler. Imperative functional programming. In M. S. V. Deusen and B. Lang, editors, Proc. POPL, pages 71–84. ACM 1993. [14] N. Shavit and D. Touitou. Software transactional memory. Distributed Computing, 10(2):99– 116, 1997. 15
6cs.PL
arXiv:1705.03392v2 [cs.AI] 13 May 2017 Asynchronous Announcements Hans van Ditmarsch, LORIA – CNRS / University of Lorraine May 16, 2017 1 Introduction Public announcement logic [7] is a well-known modal logic to model change of information. Given a group A of agents that is uncertain about a set of propositional variables P , including higher-order uncertainty (agent a does not know p but considers it possible that agent b knows p), they are simultaneously informed by an outsider of new information. The assumption is that the information is true (reliable) and that it is common knowledge among the agents that all agents receive the information. We consider a version of truthful public announcement logic where announcements are still truthful and (in some sense) public, but where they may not be received instantly by the agents. Let us illustrate this by an example. Consider two agents Anne (a) and Bill (b), and two propositional variables p and q. Anne knows the truth about p and Bill knows the truth about q, and this is common knowledge between them. In fact, p and q are both true. A truthful public announcement of p ∨ q is now made. The model encoding the uncertainty of Anne and Bill and the model transition resulting from the announcement are as follows — we represent Anne’s uncertainty by a-labelled links (representing indistinguishable states) and Bill’s uncertainty by b-labelled links; the actual state is framed. States have been given mnemonic names reflecting the valuation of atoms in that state, e.g., pq is the state where p is false and q is true. b pq b pq pq a a p∨q a pq pq pq ⇒ pq b After the announcement of p ∨ q, Bill does not know that p is true but Anne considers it possible that he knows, [p ∨ q](¬Kb p ∧ K̂a Kb p), where [p ∨ q] is a dynamic modality standing for ‘after the announcement of p ∨ q, it holds that’, Kb is a static (epistemic) 1 modality standing for ‘Bill knows that’, and K̂a is the diamond version of such an epistemic modality. A different way to view the model transformation induced by the public announcement is as an internal step in a larger model, known as the protocol-generated forest [8, 9]. (For announcements, that are functional, it is a bamboo forest, but this does not matter.) Such are also known as history-based structures [6], as we do not discard the state of information before the announcement/message. This forest is the perspective we need to continue our story. It can be visualized as follows — a dotted, directed, link transforms a state preserved in the transition. (We could also have labelled these with the announcement.) pq pq pq a p∨q a pq pq b b pq ⇒ b a a pq b pq pq pq b a pq In [5], Panangaden and Taylor presented a system wherein agents/processes can receive messages at different times, in order to model asynchronous communication. All messages will be received eventually by all agents, but it is not known when. This implies that when an agent receives a message, she does not know when other agents have received that message. We may then make further assumptions, such that the messages will be received by each agent in the order in which they are sent. But these assumptions may also be relaxed. Panangaden and Taylor investigate what knowledge agents can eventually obtain under such asynchronous and concurrent conditions. For events such as public announcements we can also assume that they are not necessarily received by all agents at the same time, but that they are still broadcast to all agents. This leads to novel forms of uncertainty. For example, Anne may have received the information p ∨ q but Bill may not yet have received it. (Other observations than hearing speech seem now more intuitive to describe events. Anne having already heard it but Bill not yet, when both are being spoken to, does not seem to make much sense.) We can refine our visualization to express this. Below, the announcement of p ∨ q now only means that this information is broadcast to Anne and Bill. Anne and Bill have not received it yet. Therefore, the designated point of the structure does not yet move along (as above). Anne receiving that information is a separate event, as is Bill receiving that information. Below we visualize that Anne received this information. This is the action +a. We indicate this visually by Anne’s perspective, the a-labelled frame, moving along. Bill’s perspective, the b-labelled frame, remains the same. 2 ab pq pq ab pq b pq a p∨q a pq b pq ⇒ b a pq b pq a +a a (novel) pq b pq pq a pq b pq pq ⇒ b a a pq b pq pq b a pq In the right-hand structure: 1. Anne considers it possible that Bill now knows that p is true — namely if the actual state is pq and if the announcement has been received by Bill; 2. Anne also considers it possible that Bill does not know that p is true — namely if the actual state is pq and if the announcement has been received by Bill; 3. Anne also considers it possible for another reason that Bill does not know that p is true — namely if the actual state is pq but the announcement has not been received by Bill. Anne’s uncertainty in cases 2. and 3. is of a different nature. The first corresponds to her inability to distinguish two state descriptions at the same time, the second corresponds to her inability to distinguish the same state description at different moments in time. Instead of the usual notion of knowledge, we need to define a notion of asynchronous knowledge. A further +b action would lead to Anne and Bill both knowing that p ∨ q. However, unlike in public announcement logic, they do not know that the other knows: there is no common knowledge between them of p ∨ q. Our framework is then more alike [5] (we will discuss this later). If messages need not be received simultaneously, Anne also considers it possible that Bill has received more announcements than herself. This is problematic, as Anne does not yet know what these announcements will be. If Anne and Bill are executing a commonly known protocol, such uncertainty over the future is bounded, but otherwise, it amounts to quantifying over all future announcements (any further modally definable restrictions of the current model and that contain the actual state). Such scenarios are considered in arbitrary public announcement logic [1], although, there, not with asynchronicity in mind. If we allow reasoning over future announcements a very weak notion of knowledge would result: agents then cannot know that other agents are ignorant (unless this ignorance was initially distributed knowledge). In this work we assume that agents only speculate over the past. Differently said, we do not consider epistemic planning (and the agents have no goals for their reasoning anyway), but only learning from all the available information received so far, including uncertainty over when others receive the same information. We make the following modelling assumptions towards formalizing asynchronous knowledge resulting from announcements: • The agents have common knowledge of the initial uncertainty 3 • Messages (announcements) are received by the agents in the order in which they are sent. • Agents receive announcements independently from one another. • Whether an agent receives an announcement does not depend on the state (therefore agents know if they have received announcements). • Agents reason about the past, not about the future. Before we plunge into the syntax and semantics, let us point out two salient features of asynchronous announcements and asynchronous knowledge: (i) announcements may result in partial synchronization, and (ii) knowledge is no longer truthful. For the first, consider a slightly different scenario wherein the first announcement is p and wherein the second announcement is Kb p (overlooking the, so far, absent definition of asynchronous knowledge — in this case it corresponds to usual knowledge). If Anne has received both announcements, she should consider it possible that Bill has also received both announcements or only the first announcement. But she should not consider it possible that Bill has not received the first announcement. Because the second announcement, of Kb p, can only be truthfully made after Bill has received the first announcement, of p. The second announcement therefore enforces a restricted kind of synchronization between Anne and Bill. A list stating which announcements have been received by which agents we call, following [5], a cut. If Anne received two announcements and Bill none, this is cut 20. Also following [5], we can call this an inconsistent cut; whereas 21 is a a consistent cut. Below we visualize the announcement of p, followed by Bill receiving this, followed by the announcement of Kb p (cut 01). We cannot visualize the announcement of p followed by the announcement of Kb p without b first receiving it, as the announcement of Kb p can then not be truthfully made. In our framework, an inconsistent cut corresponds to a sequence of sending and receiving announcements that cannot be executed. ab pq pq b pq a p a pq ab pq b pq ⇒ b a a pq a pq pq b pq pq a pq +b ⇒ b a pq a Kb p a pq b pq b pq pq ⇒ b pq pq a a a pq pq pq b a pq a pq b The other mentioned feature of our semantics is that knowledge is no longer truthful. We can illustrate this by the model above. The cut is 01: Bill received p, but Anne did not receive p yet. According to the semantics, we will then get that Kb p ∧ Ka ¬Kb p is true in this model. Bill knows that p is true because he just heard so. Simultaneously Anne knows (or rather, thinks to know) that Bill does not know that p is true because she has not heard p yet. Anne’s knowledge is incorrect. The notion of asynchronous knowledge that we will propose satisfies the properties of consistent belief (KD45). But it is a rather special kind 4 of (possibly false) belief: eventually, after all agents have received all messages, beliefs are correct and thus knowledge. Asynchronous announcements are not public in the usual sense. But they are also not private, or semi-private or semi-public: the agents assume that in due time all others will receive the message: it is a broadcast. So what is it? After the announcement of p, and after Anne and Bill have both have received the announcement, they both know p — Ka p ∧ Kb p, for which we can write Eab p (everybody knows p) — but they do not know that the other knows p. After the announcement of Eab p and both receiving it we obtain 2 Eab p: everybody knows that everybody knows p. And so on. Anne and Bill never obtain common knowledge of p. (And no growth of common knowledge will ever occur, unlike in public announcement logic.) But they gradually construct common knowledge: it is the concurrent common knowledge of [5]. For the Pandora box opened by such phenomena, see also the delightful [2]. We now implement these ideas into a logic of asynchronous announcements. 2 Language and Semantics We introduce the language and semantics of asynchronous announcement logic. Definition 1 (Language) Given are a finite set of agents A and a countable set of propositional variables P . Let a ∈ A and p ∈ P : LAA ∋ ϕ ::= p | ¬ϕ | ϕ ∧ ϕ | Ka ϕ | [ϕ]ϕ | Xa ϕ ⊣ Other propositional connectives and the constants ⊤ (‘true’) and ⊥ (‘false’) are defined by the usual abbreviations. For arbitrary formulas we write ϕ, ψ, ... Formula Ka ϕ stands for ‘agent a asynchronously knows ϕ,’ [ϕ]ψ stands for ‘after sending announcement ϕ, ψ (is true),’ and Xa ψ stands for ‘after agent a receives the next announcement, ψ (is true).’ The language without construct Xa ϕ is called LP AL (the language of public announcement logic. The language without constructs Xa ϕ and [ϕ]ϕ is LEL (multi-agent epistemic logic). We now simultaneously define the structures (Def. 2), namely the asynchronous model, and the semantics (Def. 3) of asynchronous announcement logic AA. The reason for simultaneity is that asynchronous models incorporate histories of prior truthful asynchronous announcements. To determine if an announcement is truthful (i.e., true) when constructing a model, we need the semantics; whereas to determine the meaning of truthful announcements in the semantics, we need the asynchronous epistemic models. Definition 2 (Asynchronous Model) An asynchronous pre-model over A and P is a sextuple (S, ∼, V, s, ϕ ~ , f ) where S is a (nonempty) domain of states, ∼ : A → P(S × S) is an accessibility function such that for each 5 agent a ∈ A, ∼(a), for which we write ∼a , is an accessibility relation for agent a, that is an equivalence relation, valuation V : P → P(S) assigns primitive propositions to the set of states in which they are true, s ∈ S is the actual state, protocol ϕ ~ is a finite sequence of formulas of L, and function f : A → {0, . . . , |~ ϕ|} is a |~ ϕ|-cut (or simply, cut). An asynchronous model is an asynchronous pre-model that satisfies the following inductively defined dependencies between the parameters of the pre-model. 1. If (S, ∼, V, s, ǫ, f0 ) is an asynchronous pre-model, then (S, ∼, V, s, ǫ, f0 ) is (also) an asynchronous model, called an initial asynchronous model; where ǫ is the empty sequence of announcements and f0 : A → {0} assigns 0 to all agents. 2. If (S, ∼, V, s, ϕ ~ , f ) is an asynchronous model and (S, ∼, V, s, ϕ ~ , f ) |= ϕ, then (S, ∼, V, s, ϕ ~ .ϕ, f ′ ) is an asynchronous model; where ϕ ~ .ϕ is the concatenation of ϕ ~ and ϕ and where for ′ all agents a, f (a) = f (a). 3. If (S, ∼, V, s, ϕ ~ , f ) is an asynchronous model, and f (a) < |~ ϕ|, then (S, ∼, V, s, ϕ ~ , f +a ) +a +a +a is an asynchronous model, where f is defined as: f (a) = f (a) + 1, and f (b) = f (b) for all b 6= a. ⊣ In clause 2. above, note that f is a |~ ϕ|-cut whereas f ′ is a (|~ ϕ|+1)-cut. They define the same function, because value |~ ϕ|+1 does not occur in f ′ . In clause 3., note that the function f +a is not defined if f (a) = |~ ϕ|. Although, given (S, ∼, V, s, ϕ ~ , f ), we call s the actual state, one could more properly consider the entire part (s, ϕ ~ , f ) as the, structured, ‘actual state’. In particular, not just any s ∈ S can be actual state (as in an asynchronous pre-model), but only those (s, ϕ ~ , f ) such that (S, ∼, V, s, ϕ ~ , f ) is an asynchronous model — this entails that the announcements in ϕ ~ , given the cuts at the moment of the announcements, can all be truthfully executed in s: these are the surviving states in the restricted domain, so to speak. Definition 3 (Semantics) Let (S, ∼, V, s, ϕ ~ , f ) be an asynchronous model and ϕ ∈ L. (S, ∼, V, s, ϕ ~ , f ) |= p (S, ∼, V, s, ϕ ~ , f ) |= ϕ ∧ ψ (S, ∼, V, s, ϕ ~ , f ) |= ¬ϕ (S, ∼, V, s, ϕ ~ , f ) |= Ka ϕ (S, ∼, V, s, ϕ ~ , f ) |= [ψ]ϕ (S, ∼, V, s, ϕ ~ , f ) |= Xa ϕ iff iff iff iff s ∈ V (p) (S, ∼, V, s, ϕ ~ , f ) |= ϕ and (S, ∼, V, s, ϕ ~ , f ) |= ψ (S, ∼, V, s, ϕ ~ , f ) 6|= ϕ (S, ∼, V, t, ϕ ~ , g) |= ϕ for all t ∼a s, g ≤a f such that (S, ∼, V, t, ϕ ~ , g) is an asynchronous model iff (S, ∼, V, s, ϕ ~ , f ) |= ψ implies (S, ∼, V, s, ϕ ~ .ψ, f ) |= ϕ iff f (a) < |ϕ| implies (S, ∼, V, s, ϕ ~ , f +a ) |= ϕ In clause Ka ϕ, the relation ≤a between cuts is defined as: g ≤a f iff g(a) = f (a), and for all b 6= a, g(b) ≤ f (a). Validity on a model, and validity, are defined as usual. The set of validities is called AA. Additionally, we consider validity of a formula ϕ on the class of initial asynchronous models, for which we write |=ǫ ϕ. ⊣ 6 Also in clause Ka ϕ, in the definiens, note that we quantify over t ∈ S and |~ ϕ|-cuts g. Additionally to ≤a we define ≤ between |~ ϕ|-cuts g and f as: g ≤ f iff for all a ∈ A, g(a) ≤ f (a) (note that g ≤ f does not imply g ≤a f ). Instead of ‘for all t ∼a s, g ≤a f such that (S, ∼, V, t, ϕ ~ , g) is an asynchronous model’ we will say ‘for all good t ∼a s, g ≤a f ’, and instead of ‘(S, ∼, V, t, ϕ ~ , g) is an asynchronous model’ we say ‘(S, ∼, V, t, ϕ ~ , g) is good.’ We may then even write (s, ϕ ~ , f ) →a (t, ϕ ~ , g), for: ‘given (s, ϕ ~ , f ), agent a considers (t, ϕ ~ , g) possible.’ This notation emphasizes that ‘actual states’ are structured. In other words: (S, ∼, V, s, ϕ ~ , f ) |= Ka ϕ iff (S, ∼, V, t, ϕ ~ , g) |= ϕ for all good t ∼a s, g ≤a f or iff (S, ∼, V, t, ϕ ~ , g) |= ϕ for all (t, ϕ ~ , g) s.t. (s, ϕ ~ , f ) →a (t, ϕ ~ , g) 3 Examples We illustrate the language of asynchronous announcement logic and its semantics in a series of successively more complex examples. Example 4 (Asynchronous knowledge after asynchronous announcement) Consider the initial asynchronous model from the introductory section wherein Anne knows whether p and Bill knows whether q. After the asynchronous announcement of p ∨ q, and Anne hearing it (+a), we claimed that: (item 1.) Anne considers it possible that Bill knows that p is true, formally [p∨q]Xa K̂a Kb p, and that (items 2. and 3) Anne considers it possible that Bill does not know that p is true, formally [p ∨ q]Xa K̂a ¬Kb p, for two different reasons. We can now indeed compute that. Let S = {pq, pq, pq, pq}, ∼a and ∼b as visually indicated (e.g., ∼a consists of two classes {pq, pq} and {pq, pq}), and the valuation as suggested by the names of the states (e.g., V (p) = {pq, pq}). For notational clarity we write cuts f as lists f (a1 )f (a2 ). . .f (an ), for example, for two agents the zero-cut f0 is written as 00, etc. 1. (S, ∼, V, pq, ǫ, 00) |= [p ∨ q]Xa K̂a Kb p because (S, ∼, V, pq, (p ∨ q), 00) |= Xa K̂a Kb p because (S, ∼, V, pq, (p ∨ q), 10) |= K̂a Kb p because pq ∼a pq, 11 ≤a 10, and (S, ∼, V, pq, (p ∨ q), 11) |= Kb p. Given (pq, (p∨q), 11), Kb p is indeed true, because triples (t, (p∨q), g) then considered possible by Bill are (pq, (p∨q), 11) and (pq, (p∨q), 01). We have that (S, ∼, V, pq, (p∨ q), 11) |= p as well as (S, ∼, V, pq, (p ∨ q), 01) |= p. 2. (S, ∼, V, pq, ǫ, 00) |= [p ∨ q]Xa K̂a ¬Kb p because (S, ∼, V, pq, (p ∨ q), 10) |= K̂a ¬Kb p because pq ∼a pq, 11 ≤a 10, and (S, ∼, V, pq, (p ∨ q), 11) |= ¬Kb p. 7 The conclusion (S, ∼, V, pq, (p ∨ q), 11) |= ¬Kb p follows from: pq ∼b pq, 11 ≤b 11, and (S, ∼, V, pq, (p ∨ q), 11) |= ¬p. 3. (S, ∼, V, pq, ǫ, 00) |= [p ∨ q]Xa K̂a ¬Kb p because (S, ∼, V, pq, (p ∨ q), 10) |= K̂a ¬Kb p because (alternatively) pq ∼a pq, 10 ≤a 10, and (S, ∼, V, pq, (p ∨ q), 10) |= ¬Kb p. In this (alternative) case, (S, ∼, V, pq, (p∨q), 10) |= ¬Kb p because pq ∼b pq, 00 ≤b 10, and (S, ∼, V, pq, (p ∨ q), 00) |= ¬p. ⊣ Example 5 (Synchronization by elimination of inconsistent cuts) Now consider the other example in the introductory section, wherein given the same initial asynchronous model, announcement p is followed by b hearing this, then followed by announcement Kb p (as all pictured), and subsequently followed by a successively hearing both announcements (not pictured). The result is asynchronous model (S, ∼, V, pq, (p, Kbp), 21). The second announcement of Kb p is truthful: It is the case that (S, ∼, V, pq, (p), 01) |= Kb p, because for all (t, (p), g) such that (pq, (p), 01) →b (t, (p), g) we have that (S, ∼, V, t, (p), g) |= p. Note that pq ∼b pq, 11 ≤b 01 and 01 ≤b 01. We therefore only have (pq, (p), 01) →b (pq, (p), 01) and (pq, (p), 01) →b (pq, (p), 11). Both (S, ∼, V, pq, (p), 01) |= p and (S, ∼, V, pq, (p), 11) |= p. We now continue the computation. (S, ∼, V, pq, (p, Kb p), 21) |= Ka Kb p because (S, ∼, V, pq, (p, Kb p), 21) |= Kb p and (S, ∼, V, pq, (p, Kb p), 22) |= Kb p. Intuitively, asynchronous pre-model (S, ∼, V, pq, (p, Kb p), 20) is not considered possible by Anne, as the announcement of Kb p cannot be truthfully made before Bill has received the first announcement. Formally, given 21, although 22 ≤a 21, 21 ≤a 21, 20 ≤a 21, pre-model (S, ∼, V, pq, (p, Kbp), 20) is not an asynchronous model, and therefore only (pq, (p, Kbp), 21) →a (pq, (p, Kbp), 21) and (pq, (p, Kbp), 21) →a (pq, (p, Kb p), 22). String 20 is an inconsistent cut. ⊣ Example 6 (Knowledge may become incorrect) Given the previous example with only the first announcement (see also the introductory section), we can observe that: (S, ∼, V, pq, (p), 01) |= Ka ¬Kb p (S, ∼, V, pq, (p), 01) |= Kb p Anne’s knowledge is incorrect! The computations are straightforward. This also means that Ka ¬Kb p ∧ Kb p would be a truthful (true) announcement in asynchronous model (S, ∼, V, pq, (p), 01). After later receiving that announcement, Anne and 8 Bill can deduce that they had not received the same number of messages at some previous stage. ⊣ Example 7 (Concurrent common knowledge) Consider again that Anne knows whether p and Bill knows whether q, but there now also is a third agent, Cath, who knows whether p and who also knows whether q (her accessibility relation ∼c is the identity on domain {pq, pq, pq, pq}. There are three announcements, of p, q, and Eabc (p ∧ q) (where Eabc ϕ := Ka ϕ ∧ Kb ϕ ∧ Kc ϕ), and the reception is such that after each announcement all agents ‘immediately’ hear it — we will show later that a property of the semantics is that the order then does not matter. So the sequence of events is: p, +a, +b, +c, q, +a, +b, +c, Eabc (p ∧ q), +a, +b, +c Note that the third annoucement is truthful. The resulting asynchronous model is (S, ∼, V, pq, (p, q, Eabc (p ∧ q)), 333). The cuts that are consistent from Cath’s perspective are {333, 233, 323, 223, 213, 313}. So, Cath considers it possible that Bill has only received the first announcement and considers it possible that Anne has only received the first two announcement. Anything upwards from cut 213 is considered possible by Cath. One can show that 2 (S, ∼, V, pq, (p, q, Eabc (p ∧ q)), 333) |= Eabc (p ∧ q) 2 3 (S, ∼, V, pq, (p, q, Eabc (p ∧ q), Eabc (p ∧ q)), 444) |= Eabc (p ∧ q) and so on (where E n+1 ϕ := EE n ϕ and E 1 ϕ := Eϕ). Anne, Bill and Cath cannot achieve common knowledge of p ∧ q with asynchronous announcements, but they can achieve any finite approximation of it [5]. ⊣ 4 Validities Typical schemata that are not valid in asynchronous announcement logic but that are valid in the standard public announcement logic are the following: 6|= Ka ϕ → ϕ This is not valid as the knowledge of agent a may not be updated yet with the most recent announcement (as in Example 6). 6|= [ϕ][ψ]η ↔ [ϕ ∧ [ϕ]ψ]η 9 This is not valid as in asynchronous announcement logic the number of messages is the number of announcements. Making two announcements into one reduces the number of messages, and thus the meaning of formulas. For example, in an initial asynchronous model [p][q]Xa Xa ⊥ is false whereas [p ∧ [p]q]Xa Xa ⊥ is true. Asynchronous knowledge has the properties of consistent belief. Knowledge may be incorrect, as other agents may have received more announcements than yourself (see the first item: it may be false that f ≥a f ). Proposition 8 The following valid schemata describe the properties of asynchronous knowledge. 1. |= Ka ϕ → K̂a ϕ 2. |= Ka ϕ → Ka Ka ϕ 3. |= ¬Ka ϕ → Ka ¬Ka ϕ ⊣ Proof Let (S, ∼, V, s, ϕ ~ , f ) be an asynchronous model. 1. Assume (S, ∼, V, s, ϕ ~ , f ) |= Ka ϕ. Let g be the cut defined as g(b) = f (a) for all b ∈ A. As s ∼a s and g ≤a f , the required now follows, because from the semantics of Ka ϕ we then get (S, ∼, V, s, ϕ ~ , g) |= ϕ. (If there is a b such that f (b) > f (a), we do not have that f ≤a f . The knowledge of a may then be incorrect.) 2. We show the dual K̂a K̂a ϕ → K̂a ϕ. Let u ∼a t and t ∼a s, and h ≤a g as well as g ≤a f . (So that (S, ∼, V, u, ϕ ~ , h) |= ϕ.) As ∼a is an equivalence relation, s ∼a u. From f (a) = g(a) and g(a) = h(a) we get f (a) = h(a). And from h(b) ≤ g(a) and g(a) = f (a) we get h(b) ≤ f (a). Thus, h ≥a f . Therefore, (S, ∼, V, s, ϕ ~ , f ) |= K̂a ϕ. 3. Assume t ∼a s and g ≤a f . Now consider any u and h such that u ∼a s and h ≤a f . Relation ∼a is euclidean, so u ∼a t. From h(a) = f (a) and g(b) ≤ f (a) follows g(b) ≥ h(a); thus g ≤a h. (The winding up is elementary.)  The following validities describe the interaction between announcements and other connectives except next. Proposition 9 • |= [ϕ]p ↔ (ϕ → p) • |= [ϕ]¬ψ ↔ (ϕ → ¬[ϕ]χ) • |= [ϕ](ψ ∧ χ) ↔ ([ϕ]ψ ∧ [ϕ]χ) • |= [ϕ]Ka ψ ↔ (ϕ → Ka ψ) ⊣ 10 Proof Straightforward. For the last equivalence, note that: (S, ∼, V, s, ϕ ~ , f ) |= [ϕ]Ka ψ ⇔ (S, ∼, V, s, ϕ ~ , f ) |= ϕ implies (S, ∼, V, s, ϕ ~ .ϕ, f ) |= Ka ψ ⇔ (S, ∼, V, s, ϕ ~ , f ) |= ϕ implies (S, ∼, V, s, ϕ ~ , f ) |= Ka ψ ⇔ (S, ∼, V, s, ϕ ~ , f ) |= ϕ → Ka ψ semantics of announcement a |~ ϕ|-cut is also a (|~ ϕ| + 1)-cut  The principle for knowledge after (sending) announcement is different from the well-known principle in standard public announcement logic for knowledge after (sending and receiving) announcement: [ϕ]Ka ψ ↔ (ϕ → Ka [ϕ]ψ). This is because in AA sending an announcement is independent from an agent receiving that announcement. The semantics of knowledge only depends on how many announcements have already been received by that agent. It does not matter if yet more announcements have been made/sent. As a corollary, for formulas without Xa operators (but not for formulas with Xa operators), public announcement is like a P DL-test [3] — and thus every formula with dynamic announcement modalities is equivalent to a multi-agent epistemic logic formula without announcements. Corollary 10 Let ϕ ∈ LAA and ψ ∈ LP AL . Then |= [ϕ]ψ ↔ (ϕ → ψ). ⊣ We continue with validities involving the next operator, where it matters whether an agent can still receive an announcement (¬Xa ⊥ is true) or has received all announcements (Xa ⊥ is true). Proposition 11 |= Xa ⊥ → (Xa ϕ ↔ ⊤) ⊣ Proof Obvious.  Corollary 12 Let ϕ ∈ LAA . Then |=ǫ Xa ϕ ↔ ⊤. ⊣ Proposition 13 |= [ϕ]¬Xa ⊥ ⊣ Proof Obvious.  Proposition 14 • Xa p ↔ (¬Xa ⊥ → p) • Xa ¬ψ ↔ (¬Xa ⊥ → ¬Xa ψ) • Xa (ψ ∧ χ) ↔ (Xa ψ ∧ Xa χ) 11 • Xa Xb ϕ ↔ (¬Xa ⊥ → Xb Xa ϕ) • Xa Kb ϕ ↔ (¬Xa ⊥ → Kb Xa ϕ) where b 6= a • Xa [ψ]ϕ ↔ (¬Xa ⊥ → [ψ]Xa ϕ) ⊣ Proof Obvious. (Note the absence of a reduction for Xa Ka ϕ!)  Corollary 15 |= (¬Xa ⊥ ∧ ¬Xb ⊥) → (Xa Xb ϕ ↔ Xb Xa ϕ) ⊣ Corollary 16 Let ϕ ∈ LAA such that Ka does not occur in ϕ. Then |= ¬Xa ⊥ → (Xa ϕ ↔ ϕ). ⊣ Proposition 17 (Substitution of equivalents) |= ψ ↔ η implies |= ϕ[p/ψ] ↔ ϕ[p/η]. ⊣ Proof Standard, by induction on ϕ.  Although knowledge is not affected by sending an announcement, as formulated in Proposition 9, it is affected by the combination of sending and receiving an announcement, as we will now prove in Proposition 18. This is our most important semantic result. It is not at all obvious, as the interaction involves asynchronous knowledge that quantifies over all possibilities for other agents to receive announcements. We will use the following abbreviation: let B ⊆ A, B = {b1 , . . . , bn }, then XXB := Xb1 . . .Xbn ϕ — in whatever order, see also Corollary 15. Proposition 18 V V |= ( b∈A Xb ⊥) → ([ϕ]Xa Ka ψ ↔ (ϕ → B⊆A,a∈B Ka [ϕ]XXB ψ)). ⊣ Proof W.l.o.g. we give the proof for A = {a, b}, and to suit the intuition we give the equivalence in dual diamond-form, such that (with ψ = ¬ψ) the validity becomes ^ |= ( Xb ⊥) → (hϕiX̂a K̂a ψ ↔ (ϕ ∧ (K̂a hϕiX̂a ψ ∨ K̂a hϕiX̂a X̂b ψ)). b∈A Given (S, ∼, V, s, ϕ ~ , f ), f (a) = f (b) = |~ ϕ| so that (S, ∼, V, s, ϕ ~ , f ) |= Xa ⊥ ∧ Xb ⊥. Then: (S, ∼, V, s, ϕ ~ , f ) |= hϕiX̂a K̂a ψ ⇔ semantics of announcement (S, ∼, V, s, ϕ ~ , f ) |= ϕ and (S, ∼, V, s, ϕ ~ .ϕ, f ) |= X̂a K̂a ψ ⇔ semantics of next (S, ∼, V, s, ϕ ~ , f ) |= ϕ and (S, ∼, V, s, ϕ ~ .ϕ, f +a ) |= K̂a ψ ⇔ semantics of knowledge (S, ∼, V, s, ϕ ~ , f ) |= ϕ and ∃t′ ∼a s, ∃g ′ ≤a f +a , good, such that (S, ∼, V, t′ , ϕ ~ .ϕ, g ′) |= ψ 12 ⇔ (∗∗) (S, ∼, V, s, ϕ ~ , f ) |= ϕ and ∃t ∼a s, ∃g ≤a f, good, such that (S, ∼, V, t, ϕ ~ , g) |= ϕ, and +a +ab (S, ∼, V, t, ϕ ~ .ϕ, g ) |= ψ or (S, ∼, V, t, ϕ ~ .ϕ, g ) |= ψ ⇔ write g +ab for (g +a )+b (S, ∼, V, s, ϕ ~ , f ) |= ϕ and ∃t ∼a s, ∃g ≤a f, good, such that (S, ∼, V, t, ϕ ~ , g) |= ϕ, and (S, ∼, V, t, ϕ ~ .ϕ, g) |= X̂a ψ or (S, ∼, V, t, ϕ ~ .ϕ, g) |= X̂a X̂b ψ ⇔ (S, ∼, V, s, ϕ ~ , f ) |= ϕ and ∃t ∼a s, ∃g ≤a f, good, such that (S, ∼, V, t, ϕ ~ , g) |= hϕiX̂a ψ or (S, ∼, V, t, ϕ ~ , g) |= hϕiX̂a X̂b ψ ⇔ (. . . ) (S, ∼, V, s, ϕ ~ , f ) |= ϕ and (S, ∼, V, s, ϕ ~ , f ) |= K̂a hϕiX̂aψ ∨ K̂a hϕiX̂a X̂b ψ ⇔ (S, ∼, V, s, ϕ ~ , f ) |= ϕ ∧ (K̂a hϕiX̂a ψ ∨ K̂a hϕiX̂a X̂b ψ) The crucial step (**) in the proof is justified as follows. First observe that g ≤a f iff g +a ≤a f +a (for any |~ ϕ|-cuts f, g, so that f +a , g +a are defined as (|~ ϕ| + 1)-cuts). ′ ′ +a (⇒) Let (S, ∼, V, s, ϕ ~ , f ) |= ϕ and take t ∼a s, g ≤a f , good, such that (S, ∼, V, t′ , ′ ϕ ~ .ϕ, g ) |= ψ, and such that (importantly) g ′ (b) ≥ f (a). (This choice can be made because we use our initial assumption that ¬Xb ⊥ ∧ ¬Xa ⊥. Without that assumption there is no proof.) We now distinguish the case where g ′(b) = |~ ϕ|+1 from the case where g ′ (b) = |~ ϕ|. In ′ the first case, define h as: h(b) = g (b) and h(a) = g ′(a)−1. This is a |~ ϕ|-cut, and h+a = g ′ . Thus, from g ′ ≤a f +a follows h ≤a f . We now take t = t′ , g = h, and using the assumption we obtain the required (S, ∼, V, t′ , ϕ ~ .ϕ, h+a ) |= ψ (and thus its weakening in a disjunction). In the second case, define h′ as: h′ (b) = g ′ (b) − 1 and h′ (a) = g ′(a) − 1. We now get that h′ is a |~ ϕ|-cut and that h+ab = g ′ . Similarly, we obtain (S, ∼, V, t′ , ϕ ~ .ϕ, (h′ )+ab ) |= ψ (and thus its weakening, using the other disjunct). (⇐) Let (S, ∼, V, t, ϕ ~ , g) |= ϕ and take t ∼a s, g ≤a f , good, such that (S, ∼, V, t, ϕ ~ , g) |= +a +ab +a ϕ and also (S, ∼, V, t, ϕ ~ .ϕ, g ) |= ψ or (S, ∼, V, t, ϕ ~ .ϕ, g ) |= ψ. Note that g ≤a f +a but also g +ab ≤a f +a (as g +ab (b) = f +a (b)). Either way, take t′ = t, and g ′ = g +a or g ′ = g +ab , and we are done.  There are two differences with the interaction between announcement and knowledge in standard public announcement logic ([ϕ]Ka ψ ↔ (ϕ → Ka [ϕ]ψ)). In the first place, we have to rule out that Xa meansVthat agent a receives an announcement sent prior to [ϕ]. This is guaranteed by requiring b∈A Xb ⊥. In the second place, in AA we describe the effects of agent a receiving the announcement while all other agents have not received it yet. This means that the receiving agent remains uncertain about any other number of agents also V having received the message. Thus the part B⊆A,a∈B Ka [ϕ]XXB ψ that quantifies over this. But, as said, even when all agents received the message, they do not know that from each other: given uncertainty about p with two agents a and b, then after the announcement of p is sent and received by agent a and agent b, agent a knows that p and agent b knows that p, but agent a considers it possible that agent b does not know p and vice versa. 13 Theorem 19 Let ϕ ∈ LAA . Then there is a ϕ′ ∈ LEL such that |=ǫ ϕ ↔ ϕ′ . ⊣ Proof (Sketch) To each Xa operator in a given formula we associate a weight corresponding to the number of unreceived announcements binding it. For example, in Xa r → [p][Xa q]Xb Xa Xa (r ∨ Xa p) the weights of the successive Xa operators are: 0, 1, 2, 1, 0 and the weight of Xb is 1. Clearly, if the weight is 0 then Xa ⊥ is true at that stage, and if larger, then ¬Xa ⊥ is true. These weights only make sense when evaluating formulas in an initial asynchronous model (or when all agents have received all formulas), which is what we do. By a combined inside-out and outside-in reduction we rewrite every formula of asynchronous announcement logic to a formula in multi-agent epistemic logic. The proof is by induction of the number of announcement modalities in a given formula (just as for public announcement logic, but in this case rather more complex), with a subinduction on the Xa operators bound by such announcements. That inside-out reductions preserve validity is guaranteed by Proposition 17. Let ϕ ∈ LAA be given. For the base case, if the formula contains no announcements, by an outside-in reduction, we can replace every subformula of shape Xa ϕ′ by ⊤ (Corollary 12). It does not have to be outside-in, but this is computationally preferable over inside-out. Note these Xa all have weight 0 (we can see it as a subinduction on the number of such operators in ϕ.) For the inductive case, take an innermost subformula of ϕ of shape [ϕ′ ]ψ. If ψ contains no Xa modalities, we can reduce the announcement with Corollary 10 of Proposition 9 stating that [ϕ′ ]ψ ↔ (ϕ′ → ψ). Then, use induction (on the number of announcements in ϕ). Again, we are done. But, of course, there are other cases. If ψ contains subformulas of shape Xa ξ but no such ξ contains Ka modalities (so ψ may contain Ka modalities, but only if they are not bound by Xa ), then the weight of Xa determines what to do. If the weight of Xa is 0 (if at that stage of evaluation, Xa ⊥ is true), then replace Xa ξ by ⊤ (Proposition 11). If the weight of Xa is at positive (if at that stage ¬Xa ⊥), then replace Xa ξ by ξ (Corollary 16), and reduce the weight of all Xa operators in ξ by 1. Do this for all such Xa operators bound by [ϕ′ ] (i.e., treat them depending on whether they are 0 or positive). Thus we reduce the formula [ϕ′ ]ψ to an equivalent formula [ϕ′ ]ψ ′ with ψ ′ ∈ LEL . We then again use Corollary 10 to get an equivalent formula ψ ′′ ∈ LEL that is equivalent to [ϕ]ψ ′ . Then, we use induction (on the number of announcements in ϕ), and we are done. The final, most complex, case is when ϕ has an innermost announcement subformula ′ [ϕ ]ψ such that ψ has a subformula of shape Xa ψ ′ and ψ ′ has a subformula of shape Ka ψ ′′ . If Xa has weight 0, replace Xa ψ ′ by ⊤, as above. If Xa has weight 2 or more, by rewriting we can get Xa to bind [ϕ′ ] instead and we continue treatment (using a previous case, or again this case). (Incidentally, an outside-in reduction for Xa ψ ′ subformulas may again be preferred here, as this guarantees that the weight of Xa is positive, avoiding this case.) If Xa has weight 1, then by rewriting (using that Xa commutes with Kb for any b 6= a ∈ A 14 and that Xa commutes with any Xb , Proposition 14) we get a formula of shape [ϕ′ ]Xa Ka ξ ′ . We then use Proposition 18 to ‘push’ the [ϕ′ ]Xa part jointly beyond the Ka operator. We end up with an innermost [ϕ′ ]XXB ξ ′ where a ∈ B. (Recalculate all the weights in ξ ′ .) Now this may introduce a lot of additional Xb operators for b 6= a, but this does not matter: if ξ ′ contains no (other) Ka operator, and contains no Kb operator, we continue rewriting, as before, and get a ξ ′′ ∈ LEL equivalent to [ϕ′ ]XXB ξ ′ , and we use induction on the number of remaining announcements again. Otherwise, also similar to above, we may get again a formula of shape [ϕ′ ]Xb Kb η and repeat the application of Proposition 18, but now for agent b. As the set of agents is finite, this process will terminate. Beyond that, subformula ξ ′ of the formula [ϕ]Xa Ka ξ ′ that we obtained in this case may contain further Ka operators, leading to further [ϕ]Xa Ka ξ ′′′ -reducable patterns (we can see this as a subinduction on the number of Ka modalities in the subinduction on the number of Xa modalities in the main induction on the number of ϕ modalities). Finally, we end up eliminating [ϕ], we use induction on the number of announcements, and we are done.  An explicit algorithm, or a complexity measure on formulas shown to decrease by every equivalence transformation (while other transformations, such as swapping Xb Xa by Xb Xa , should not change the complexity), would be clearer than this proof sketch, but we think that the sketch is clear enough to count as proof. As initial asynchronous models correspond to multi-agent models where all accessibility relations are equivalence relations (epistemic models), and logic S5 is decidable, it follows from Theorem 19 that: Corollary 20 Asynchronous announcement logic is decidable on the class of epistemic models. ⊣ 5 Comparison and Further Research We proposed a logic of asynchronous announcements, where truthful announcements are publicly sent but individually received by agents. Additional to epistemic modalities, the logic therefore contains two types of dynamic modalities, for sending messages and for receiving messages. The semantics defines truth relative to the current state of reception of messages for all agents. This means that knowledge need not be truthful, because some messages may not have been received by the knowing agent. Messages that are announcements may also result in partial synchronization, namely when an agent learns from receiving an announcement that other announcements must already have been received by other agents. We give detailed examples of the semantics, and prove several semantic results, including that: after an announcement an agent knows that a proposition is true, if and only if on condition of the truth of that announcement, the agent knows that after that announcement and after any number of other agents also receiving it, the proposition is true. We show that on multi-agent epistemic models, each formula in asynchronous announcement logic is equivalent to a formula in epistemic logic. Our proposal was inspired by [5] and it shares with that original source the notion of the consistent and inconsistent cut. However, in our case the messages are formulas that 15 are announcements and not mere identifiers, and are not sent between agents but from an outside, trusted, source, to the agents. In [4] the authors provide an analysis of asynchronous announcements that is different from ours in the following features: it does not consider models with equivalence relations but arbitrary relations (and tree models), the knowledge of agents is not only with respect to announcements prior to those they have already received but also speculates over future announcements that may still come, and the dynamic modalities are not interpreted as model transformations, dynamic epistemic logic style, but as inductively defined transformations of rooted trees. A somewhat curious aspect of our semantics is that Ka Xa ⊥ ∨ Ka ¬Xa ⊥ is valid: if the agent received all announcements she knows that, and if not, she knows that too. (This can be easily shown.) Also, if the agent has received two of five sent announcements she knows that she will receive in due time three more announcements — but she does not know what the announcements will be: we then have that Ka Xa Xa Xa Xa ⊥ and, if ϕ is the next announcement, we have hϕi⊤ and therefore K̂a hϕi⊤ but we do not have Ka hϕi⊤, as the agent does not know what the actual state is. This is of course a far shot from the ideal asynchronicity of [2] wherein asynchronous knowledge is interpreted over arbitrarily long finite sequences. But it may be useful in certain security or communication protocols of commonly known finite length. It then means that you know when you are done. There, our decidability result might come in handy (unlike the, typically, semantics for asynchronous behaviour with undecidable features). For further research, we wish to prove the decidability of the logic AA (i.e., for all models, beyond the obtained result for initial asynchronous models), determine the complexity of model checking and of satisfiability of the logic, and determine the axiomatization. A number of further generalizations are also conceivable. Asynchronous versions of non-public dynamic epistemic logics such as action model logic should, we think, be straightforward extensions. Beyond that, instead of individually received messages one can think of messages received by (synchronized) groups of agents, such that the message received by all (synchronized) is the standard public announcement. Finally, as in [5], one can also model agents sending each other truthful announcements instead of receiving them from a trusted outside source. Acknowledgements Hans van Ditmarsch is also affiliated to IMSc (Institute of Mathematical Sciences), Chennai. This research has been carried out supported by ERC (European Research Council) project EPS 313360. I have been hosted in Chennai some ten years now. Always, from my first visit onward until now, Ramanujam engaged me in discussions on how to model asynchronous messaging and distributed computing in dynamic epistemic logic. I owe him much and I hope this work is a start and not a finish. Sophia Knight introduced me to the work of Prakash Panangaden that directly inspired asynchronous announcements, and later Bastien Maubert and Fran¸ois Schwarzentruber also became involved in this pursuit. Then, our ways parted and their work took the direction of [4]. Clearly, without this past collaboration the underlying 16 could not have resulted and I thank them for all the interaction (and music) that we had together. Finally, I thank Philippe Balbiani and Ramanujam for discussing this work with me. References [1] P. Balbiani, A. Baltag, H. van Ditmarsch, A. Herzig, T. Hoshi, and T. De Lima. ‘Knowable’ as ‘known after an announcement’. Review of Symbolic Logic, 1(3):305– 334, 2008. [2] J.Y. Halpern and Y. Moses. Knowledge and common knowledge in a distributed environment. Journal of the ACM, 37(3):549–587, 1990. [3] D. Harel, D. Kozen, and J. Tiuryn. Dynamic Logic. MIT Press, Cambridge MA, 2000. Foundations of Computing Series. [4] S. Knight, B. Maubert, and F. Schwarzentruber. Asynchronous announcements in a public channel. In Proc. of 12th ICTAC, pages 272–289, 2015. LNCS 9399. [5] P. Panangaden and K. Taylor. Concurrent common knowledge: Defining agreement for asynchronous systems. Distributed Computing, 6:73–93, 1992. [6] R. Parikh and R. Ramanujam. A knowledge based semantics of messages. Journal of Logic, Language and Information, 12:453–467, 2003. [7] J.A. Plaza. Logics of public communications. In Proc. of the 4th ISMIS, pages 201–216. Oak Ridge National Laboratory, 1989. [8] J. van Benthem, J.D. Gerbrandy, T. Hoshi, and E. Pacuit. Merging frameworks for interaction. Journal of Philosophical Logic, 38:491–526, 2009. [9] H. van Ditmarsch, J. Ruan, and W. van der Hoek. Connecting dynamic epistemic and temporal epistemic logics. Logic journal of the IGPL, 21(3):380–403, 2013. 17
2cs.AI
Dynamic Models of Appraisal Networks Explaining Collective Learning∗ Wenjun Mei Noah E. Friedkin Kyle Lewis Francesco Bullo † arXiv:1609.09546v1 [cs.SI] 29 Sep 2016 October 3, 2016 Abstract This paper proposes models of learning process in teams of individuals who collectively execute a sequence of tasks and whose actions are determined by individual skill levels and networks of interpersonal appraisals and influence. The closely-related proposed models have increasing complexity, starting with a centralized manager-based assignment and learning model, and finishing with a social model of interpersonal appraisal, assignments, learning, and influences. We show how rational optimal behavior arises along the task sequence for each model, and discuss conditions of suboptimality. Our models are grounded in replicator dynamics from evolutionary games, influence networks from mathematical sociology, and transactive memory systems from organization science. Index terms: collective learning, transactive memory systems, appraisal networks, influence networks, evolutionary games, replicator dynamics, multi-agent systems 1 1.1 Introduction Motivation and problem description Researchers in sociology, psychology, and organization science have long studied the inner functioning and performance of teams with multiple individuals engaged in tasks. Extensive qualitative studies, conceptual models and empirical studies in the laboratory and field reveal some statistical features and various phenomena of teams [15,17,23,26,33,34], but only a few quantitative and mathematical models are available [1,13,20]. In this paper we build mathematical models for the dynamics of team structure and performance. Our work is based on the core idea that all the exhibited phenomena and features of teams must result from some essential elements, that is, individual (member) attributes and the team’s inner structure. We aim to mathematically characterize these essential elements of teams, investigate how they are related to team performance and, most importantly, how they evolve with time. ∗ This material is based upon work supported by, or in part by, the U. S. Army Research Laboratory and the U. S. Army Research Office under grant numbers W911NF-15-1-0577 and W911NF-16-1-0005. The content of the information does not necessarily reflect the position or the policy of the Government, and no official endorsement should be inferred. A preliminary version [24] has been accepted to the 53rd IEEE Conference on Decision and Control. Compared with [24], this paper proposes more generalized models, discusses numerous model variations, and provides all the mathematical proofs absent in [24]. † Wenjun Mei and Francesco Bullo are with the Department of Mechanical Engineering and with Center for Control, Dynamical Systems, and Computation, University of California, Santa Barbara, Santa Barbara, CA 93106, USA, [email protected], [email protected] Noah E. Friedkin is with the Department of Sociology and with Center for Control, Dynamical Systems, and Computation, University of California, Santa Barbara, Santa Barbara, CA 93106, USA, [email protected] Kyle Lewis is with the Technology Management Program, University of California, Santa Barbara, Santa Barbara, CA 93106, USA, [email protected] 1 We consider a team of individuals with unknown skill levels who complete a sequence of tasks. The team’s basic inner structure is characterized by the appraisal network. The appraisal network determines how each task is assigned, and is updated via performance feedback and its co-evolution with the team’s influence network. We aim to build multi-agent dynamical models in which (i) the team as an entirety eventually achieves the optimal assignment of tasks to members; (ii) each individual’s true relative skill level is asymptotically learned by the team members, which is referred to as collective learning. We then investigate the model variations for what impairs collective learning. 1.2 Literature review Our work is deeply connected with a conceptual model of team learning and performance, a transactive memory system (TMS). A TMS is characterized by individuals’ skills and knowledge, combined with members’ collective understanding of which members possess what knowledge [31]. When members share an understanding of who knows what on the team, tasks can be assigned to members most likely to possess the appropriate skills. As members observe the task performances of other members, their understanding of ”who knows what” tends to become more accurate and more similar, leading to greater coordination and integration of members’ knowledge. Empirical research across a range of team types and settings demonstrates a strong positive relationship between the development of a team TMS and team performance [16, 17, 35]. In our models, collective learning arises as the result of the co-evolution of interpersonal appraisals and influence networks. Related previous work includes social comparison theory [5], averaging-based social learning [9], opinion dynamics on influence networks [4,8,18,25], reflected appraisal mechanisms [2,7,11], dynamic balance theory [22, 30], and the combined evolution of interpersonal appraisals and influence networks [10]. In the modeling and analysis of the evolution of appraisal and influence networks, we also build an insightful connection between our model and the well-known replicator dynamics studied in evolutionary game theory; see the textbook [28], some control applications [6, 21], and the recent contributions [3, 19]. 1.3 Contribution Firstly, based on a few natural assumptions, we propose three novel models with increasing complexity for the dynamics of teams: the manager dynamics, the assign/appraise dynamics, and the assign/appraise/influence dynamics. Our work integrates three well-established types of dynamics: the replicator dynamics, the dynamics of appraisal networks, and the opinion dynamics on influence networks. To the best of our knowledge, this is the first time that such an integration has been proposed. Our models provide an insightful perspective on the connection between team performance and the interpersonal appraisal networks. In our models, the performances of a team of individuals, with fixed skill levels, are determined by how a task is assigned. For the baseline manager dynamics, task assignment is adjusted by an outside authority, according to the replicator dynamics, with individuals’ performances as the feedback signals. The assign/appraise dynamics elaborates the baseline model by assuming that, instead of an outside authority, the team members’ interpersonal appraisals as the basic inner structure determine the task assignments. In the assign/appraise/influence dynamics model, we further elaborate the model by considering the co-evolution of appraisal and influence networks. Secondly, theoretical analysis is presented on the dynamical properties of the models we propose. We prove that, for the assign/appraise and the assign/appraise/influence dynamics, task assignments determined by the interpersonal appraisals satisfy the replicator dynamics in a generalized form. Moreover, results on the models’ asymptotic behavior relate collective learning with the connectivity property of the observation network, which defines the heterogeneous feedback signals each individual observes. We find that, for the 2 assign/appraise dynamics with the initial appraisal network that is strongly connected and ha a self loop for each node, the team achieves rational task assignment, if the observation network is strongly connected. For the assign/appraise/influence dynamics with strongly connected and aperiodic initial appraisal network, the team achieves collective learning, if the observation network has a globally reachable node. Our theoretical results on the asymptotic behavior can be interpreted as the exploration of the most relaxed condition for asymptotic optimal task assignment. In addition, the assign/appraise/influence dynamics describes an emergence process by which team members’ perception of “who knows what” become more similar over time, a fundamental feature of TMS [14, 27]. Thirdly, besides the models in which the team eventually learns the individuals’ true relative skill levels, we propose one variation in each of the three phases of the assign/appraise/influence dynamics: the assignment rule, the update of appraisal network based on feedback signal, and the opinion dynamics for the interpersonal appraisals. The variations reflect some sociological and psychological mechanisms known to prevent the team from learning. We investigate by simulation numerous possible causes of failure to learn. 1.4 Organization The rest of this paper is organized as follows: the next subsection introduces some preliminaries on evolutionary games and replicator dynamics; Section II proposes our problem set-up and centralized manager model; Section III introduces the assign/appraise dynamics; Section IV is the assign/appraise/influence model; Section V discusses some causes of failure to learn; Section VI provides some further discussions and conclusion. 1.5 Preliminaries Evolutionary games apply game theory to evolving populations adopting different strategies. Consider a game with finite pure strategies e1 , e2 , . . . , en and mixed strategies w ∈ int(∆n ). The expected payoff for Pn mixed strategy v against mixed strategy w is defined as the payoff function π(v, w) = i=1 vi πi (w), with πi (w) = π(ei , w) for simplicity. A strategy ŵ is an evolutionary stable strategy (ESS) if any mutant strategy v 6= ŵ, adopted by an -fraction of the population, brings less expected payoff than the majority strategy ŵ, as long as  is sufficiently small. A necessary and sufficient condition for a local ESS is stated as follows: there exists a neighborhood U (ŵ) such that, for any v ∈ U (ŵ) \ {ŵ}, π(ŵ, v) > π(v, v). Replicator dynamics, given by equation (1), models the evolution of sub-population distribution w(t) ∈ ∆n . Each sub-population i, with fraction wi (t) at time t, is using strategy ei and has the growth rate proportional to its fitness, defined as the expected payoff πi (w(t)). n   X ẇi = wi πi (w) − wk πk (w) . (1) k=1 The time index t is omitted for simplicity. There is a simple connection between the ESS and the replicator dynamics [28]: if the payoff function π(v, w) is linear to w, then an ESS is a globally asymptotically stable equilibrium for system (1); if π(v, w) is nonlinear to w, then the ESS is locally asymptotically stable. 2 Problem Set-up and Manager Dynamics In this section we introduce some basic formulations and a baseline centralized system on the evolution of a team. Frequently used notations are listed in Table 1. 3 2.1 Model assumptions and notations a) Team, tasks and assignments: The basic assumption on the individuals and the tasks are given below. Assumption 1 (Team, task type and assignment). Consider a team of n individuals characterized by a fixed but unknown vector x = (x1 , . . . , xn )> satisfying x  0n and x> 1n = 1, where each xi denotes the skill level of individual i. The tasks being completed by the team are assumed to have the following properties: (i. The total workload of each task is characterized by a positive scalar and is fixed as 1 in this paper; (ii. The task can be arbitrarily decomposed into n sub-tasks according to the task assignment w = (w1 , . . . , wn )> , where each wi is the sub-task workload assigned to individual i. The task assignment satisfies w  0n and w> 1n = 1. The sub-tasks are executed simultaneously. The selection of scalar values for skill levels and task assignments can be simply interpreted as the assumption that the type of tasks considered in this paper only requires some one-dimension skill. Alternatively, the skill levels can be considered more generally as the individuals’ overall abilities of contributing to the completion of tasks, and the task assignments are the individuals’ relative responsibilities to the team. b) Individual performance: With fixed skill levels x, each individual i’s performance is assumed to depend only on the task assignment w, denoted by pi (w). The measure of individual performance is defined below. Assumption 2 (Individual performance). Given fixed skill levels, each individual i’s performance, with the assignment w, is measured by pi (w) = f (xi /wi ), where f : [0, +∞) → [0, +∞) is a concave, continuously differentiable and monotonically increasing function. The function f is assumed to be concave in that, it is widely adopted that the relation between the performance f and individual ability x obeys the power law, i.e., f (x) ∼ xγ , with 0 < γ < 1 [1]. Despite the specific form f (xi /wi ) as in Assumption 2, the measure of individual performance can be quite general by adopting difference measures of xi and wi . c) Optimal assignment: It is reasonable to claim that, in a well-functioning team, individuals’ relative responsibilities, characterized by the task assignment in this paper, should be proportional to their actual abilities. Define the measure of the mismatch between task assignment and individual’s true skill levels as Pn H1 (w) = i=1 |wi /xi − 1|. For fixed x, the optimal assignment w∗ = x minimizes H1 (w). 2.2 Centralized manager dynamics In this subsection we introduce a continuous-time centralized model on the evolution of task assignment, referred to as the manager dynamics. The diagram illustration is given by Figure 1(a). Suppose that, at each time t, a team of n individuals is completing a task based on the assignment w(t), which is determined and adjusted along t by an outside manager. The manager observes the individuals’ real-time performance  p w(t) and adjust the task assignment w(t) according to the dynamics: n   X ẇi = wi pi (w) − wk pk (w) , (2) k=1 for any i ∈ {1, . . . , n}. The following theorem states the asymptotic behavior of the manager dynamics. Theorem 1 (Manager dynamics). Consider the manager dynamics (2) for the task assignment as in Assumption 1 with performance as in Assumption 2. Then 4 Table 1: Notations frequently used in this paper  (≺ resp.)  ( resp.) 1n (0n resp. ) x w f entry-wise greater than (less than resp.). entry-wise no less than (no greater than resp.). n-dimension column vector with all entries equal to 1 (0 resp.) vector of individual skill levels, with x = (x1 , x2 , . . . , xn )>  0n and x> 1n = 1. task assignment. w  0n and w> 1n = 1 a concave, continuously differentiable and increasing function f : [0, +∞) → [0, +∞) > vector of individual performances. p(w) = p1 (w), . . . , pn (w) , where pi (w) = f (wi /xi ) is the performance of individual i. appraisal matrix. A = (aij )n×n , where aij is individual i’s appraisal of j’s skill level. influence matrix. W = (wij )n×n , where wij is the weight individual i assigns to j’s opinion. n-dimension simplex {y ∈ Rn≥0 | y > 1n = 1} the interior of ∆n . the left dominant eigenvector of the non-negative and irreducible matrix A, i.e., the normalized entry-wise positive left eigenvector associated with the eigenvalue equal to A’s spectral radius. the directed and weighted graph associated with the adjacency matrix B ∈ Rn×n . p(w) A W ∆n int(∆n ) vleft (A) G(B) assignment task execution based on skill levels replicator dynamics individual performance appraisal network assignment rule appraise dynamics (a) manager assignment feedback signal task execution based on skill levels observation network individual performance (b) assign/appraise Figure 1: Diagram illustrations sign/appraise/influence dynamics. of appraisal network assignment rule appraise / influence dynamics assignment feedback signal task execution based on skill levels observation network individual performance (c) assign/appraise/influence manager dynamics, assign/appraise dynamics, and as- (i. the set int(∆n ) is invariant; (ii. the optimal assignment w∗ = x is the ESS for the evolutionary game defined by the payoff function Pn π(v, w) = i=1 vi f (xi /wi ), and is thus a locally asymptotically stable equilibrium for equation (2) as a replicator dynamics; (iii. for any w(0) ∈ int(∆n ), the manager’s assignment w(t) converges to w∗ = x, as t → ∞. The proof is given in Appendix .1. Equation (2) takes the same form as the classic replicator dynamics [28], with the nonlinear fitness function πi (w) = f (xi /wi ). The same Lyapunov function is used in the proof for the asymptotic stability. Distinct from the classic result that the ESS, with nonlinear payoff function, can only lead to local asymptotic stability for the replicator dynamics, our model is a special case in which the ESS associated with a nonlinear payoff function is also a globally asymptotically stable equilibrium of the replicator dynamics. 5 3 The Assign/Appraise Dynamics of the Appraisal Networks Despite the desired property on the convergence of the task assignment to optimality, the manager dynamics does not capture one of the most essential aspects of team dynamics: the evolution of the team’s inner structures. In this section, we introduce a multi-agent system, in which task assignments are determined by the team members’ interpersonal appraisals, rather than any outside authority, and the appraisal network is updated in a decentralized manner, driven by the heterogeneous feedback signals observed by each team member. 3.1 Model description and problem statement Appraisal network: Denote by aij the individual i’s evaluation of j’s skill levels and refer to A = (aij )n×n as the appraisal matrix. Since the evaluations are in the relative sense, we assume A  0n×n and A1n = 1n . The directed and weighted graph G(A), referred to as the appraisal network, reflects the team’s collective knowledge on the distribution of its members’ abilities. Assign/appraise dynamics: We propose a multi-agent model on the evolution of the appraisal network. The model is referred to as the assign/appraise dynamics and illustrated by the diagram in Figure 1(b). We model three phases: the task assignment, the feedback signal and the update of the appraisal network, specified by the following three assumptions respectively. Assumption 3 (Assignment rule). At any time t ≥ 0, the task is assigned according to the left dominant  eigenvector of the appraisal matrix, i.e., w(t) = vleft A(t) . Justification of Assumption 3 is given in Appendix .2. For now we assume A(t) is row-stochastic and  irreducible for all t ≥ 0, so that vleft A(t) is always well-defined. This will be proved later in this section. Assumption 4 (Feedback signal). After executing the task assignment w, each individual i observes, with no noise, the difference between her own performance and the quality of some part of the whole task, given by P k mik pk (w), in which mik denotes the fraction of workload individual k contributes to this part of task. The matrix M = (mij )n×n defines a directed and weighted graph G(M ), referred to as the observation network, and satisfies M  0n×n and M 1n = 1n by construction. The topology of the observation network defines the individuals’ feedback signal structure and influences the asymptotic behavior of assign/appraise dynamics. Notice that, the feedback signal for each individual i  P  is the difference pi w(t) − k mik pk w(t) , while the matrix M is not necessarily known to the individuals. Assumption 5 (Update of interpersonal appraisals). With the performance feedback signal defined as in Assumption 4, each individual i increases her self appraisal and decreases the appraisals of all the other P individuals, if pi (w) > k mik pk (w), and vice versa. In addition, the appraisal matrix A(t) remains rowstochastic. The following dynamical system for the appraisal matrix, referred to as the appraise dynamics, is arguably the simplest model satisfying Assumptions 4 and 5:  n   X    ȧii = aii (1 − aii ) pi (w) − m p (w) ,  ik k  k=1 (3) n   X    ȧ = −a a p (w) − m p (w) .  ii ij i ik k  ij k=1 6 The matrix form of the appraise dynamics, together with the assignment rule as in Assumption 3, is given by   Ȧ = diag p(w) − M p(w)A (I − A), d n (4)  w = vleft (A), and collectively referred to as the assign/appraise dynamics. Here Ad = diag(a11 , . . . , ann ). Problem statement: In Section III.B, we investigate the asymptotic behavior of dynamics (4), including: (i. convergence to the optimal assignment, which means that the team as an entirety eventually learns all its members’ relative skill levels, i.e., limt→+∞ w(t) = x; (ii. appraisal consensus, which means that the individuals asymptotically reach consensus on the appraisals of all the team members, i.e., aij (t) − akj (t) → 0 as t → +∞, for any i, j, k. Collective learning is the combination of the convergence to optimal assignment and appraisal consensus. 3.2 Dynamical behavior of the assign/appraise dynamics We start by establishing that the appraisal matrix A(t), as the solution to equation (4), is extensible to all t ∈ [0, +∞) and the assignment w(t) is well-defined, in that A(t) remains row-stochastic and irreducible. Moreover, some finite-time properties are investigated. Theorem 2 (Finite-time properties of assign/appraise dynamics). Consider the assign/appraise dynamics (4), based on Assumptions 3-5, describing a task assignment as in Assumption 1, with performance as in Assumption 2. For any observation network G(M ), and any initial appraisal matrix A(0) that is row-stochastic, irreducible and has strictly positive diagonal, (i. The appraisal matrix A(t), as the solution to (4), is extensible to all t ∈ [0, +∞). Moreover, A(t) remains row-stochastic, irreducible and has strictly positive diagonal for all t ≥ 0; (ii. there exists a row-stochastic irreducible matrix C ∈ Rn×n with zero diagonal such that   A(t) = diag a(t) + In − diag a(t) C, for all t ≥ 0, where a(t) = a1 (t), . . . , an (t) > (5) and ai (t) = aii (t), for i ∈ {1, . . . , n}; (iii. Define the reduced assign/appraise dynamics as  n X     ȧ = a (1 − a ) p (w) − mik pk (w) ,  i i i i  k=1 n  ck ci . X   ,  wi = (1 − ai ) (1 − ak ) (6) k=1 where c = (c1 , . . . , cn )> = vleft (C). This dynamics is equivalent to system (4) in the following sense: The matrix A(t)’s each diagonal entry aii (t) satisfies the dynamics (6) for ai (t), and, for any t ≥ 0,   aii (t) = ai (t) for any i, and aij (t) = aij (0) 1 − ai (t) / 1 − ai (0) for any i 6= j;    (iv. The set Ω = a ∈ [0, 1]n 0 ≤ ai ≤ 1 − ζi a(0) , where ζi a(0) = xcii mink positively invariant set for the reduced assign/appraise dynamics (6); 7 xk ck  1 − ak (0) , is a compact x w x w x w x w A A A A (a) t = 0 (b) t = 2 (c) t = 10 (d) t = 30 Figure 2: Visualization of the evolution of A(t) and w(t) obeying the assign/appraise dynamics with n = 6. The observation network is strongly connected. In these visualized matrices and vectors, the darker the entry, the higher value it has. (v. the assignment w(t) satisfies thegeneralized replicator dynamics with time-varying fitness function   P  ai (t) pi w(t) − l mil pl w(t) for each i: n n n  X X  X  ẇi = wi ai pi (w) − mil pl (w) − wk ak pk (w) − mkl pl (w) . l=1 k=1 (7) l=1 The proof for Theorem 2 is presented in Appendix .3. With the extensibility of A(t) and the finite-time properties, we now present the main theorem of this section. Theorem 3 (Asymptotic behavior of assign/appraise dynamics). Consider the assign/appraise dynamics (4), based on Assumptions 3-5, with the task assignment as in Assumption 1 and the performance as in Assumption 2. Assume the observation network G(M ) is strongly connected. For any initial appraisal matrix A(0) that is row-stochastic, irreducible and has positive diagonal, (i. the solution A(t) converges, i.e., there exists A∗ ∈ Rn×n such that limt→∞ A(t) = A∗ ; (ii. the limit appraisal matrix A∗ is row-stochastic and irreducible. Moreover, the task assignment satisfies limt→∞ w(t) = vleft (A∗ ) = x. The proof is presented in Appendix .4. Theorem 3 indicates that, the teams obeying the assign/appraise dynamics asymptotically achieves the optimal task assignment, but do not necessarily reach appraisal consensus. Figure 2 gives a visualized illustration of the asymptotic behavior of the assign/appraise dynamics. Remark 4. From the proof for Theorem 3 we know that, the teams obeying the following dynamics  ȧ = γ (t)a (1 − a ) p (w) − P m p (w), ii i ii ii i ik k k  ȧij = −γi (t)aii aij pi (w) − P mik pk (w) , k also asymptotically achieve the optimal assignment, if each γi (t) remains strictly bounded from 0. This result indicates that our model can be generalized to the case of heterogeneous sensitivities to performance feedback. 4 The Assign/appraise/influence Dynamics of the Appraisal Networks In this section we further elaborate the assign/appraise dynamics by assuming that the appraisal network is updated via not only the performance feedback, but also its co-evolution with the team members’ interper8 sonal influences. In other words, we include an opinion dynamics process among the individuals who discuss and possibly reach consensus on the values of interpersonal appraisals. 4.1 Model description The new model, named the assign/appraise/influence dynamics, is defined by three components: the assignment rule as in Assumption 3, the appraise dynamics based on Assumptions 4 and 5, and the influence dynamics, which is the opinion exchanges among individuals on interpersonal appraisals. Denote by wij the weight individual i assigns to j (including self weight wii ) in the opinion exchange. The matrix W = (wij )n×n defines a directed and weighted graph, referred to as the influence network, is row-stochastic and possibly time-varying. The diagram illustration of assign/appraise/influence dynamics is presented in Figure 1(c), and the general form is given as follows:  Ȧ = 1 F (A, W ) + 1 F (A, w), τave ave τapp app (8) w = vleft (A). The time index t is omitted for simplicity. The term Fapp (A, w) corresponds to the appraise dynamics given by the right-hand side of the first equation in (4), while the term Fave (A, W ) corresponds to the influence dynamics specified by the assumption below. Parameters τave and τapp are positive, and relate to the time scales of influence dynamics and appraise dynamics respectively. Assumption 6 (Influence dynamics). For the assign/appraise/influence dynamics, assume that, at each time t ≥ 0, the influence network is identical to the appraisal network, i.e., W (t) = A(t). Moreover, assume that the individuals obey the classic DeGroot opinion dynamics [4] for the interpersonal appraisals, i.e., Fave (W, A) = −(In − W )A. Based on equation (8) and Assumptions 3-6, the assign/appraise/influence dynamics is written as  Ȧ = 1 (A2 − A) + 1 diag p(w) − M p(w)A (I − A), d n τave τapp w = vleft (A), (9) In the next subsection, we relate the topology of the observation network G(M ) to the asymptotic behavior of the assign/appraise/influence dynamics, i.e., the convergence to optimal assignment and the appraisal consensus. 4.2 Dynamical behavior of the assign/appraise/influence dynamics The following lemma shows that, for the assign/appraise/influence dynamics, we only need to consider the all-to-all initial appraisal network. Lemma 5 (entry-wise positive for initial appraisal). Consider the assign/appraise/influence dynamics (9) based on Assumptions 3-6, with the task assignment and performance as in Assumptions 1 and 2 respectively. For any initial appraisal matrix A(0) that is primitive and row-stochastic, there exists ∆t > 0 such that A(t)  0n×n for any t ∈ (0, ∆t]. The proof is given in Appendix .5. Before discussing the asymptotic behavior, we state a technical assumption. 9 x w x w x w x w A A A A (a) t = 0 (b) t = 2 (c) t = 10 (d) t = 30 Figure 3: Visualization of the evolution of A(t) and w(t) obeying the assign/appraise/influence dynamics with n = 6. The observation network contains a globally reachable node. In these visualized matrices and vectors, the darker the entry, the higher value it has. Conjecture 6 (Strict lower bound of the interpersonal appraisals). Consider the assign/appraise/influence dynamics (9) based on Assumptions 3-6, with the task assignment and performance as in Assumptions 1 and 2 respectively. For any A(0) that is entry-wise positive and row-stochastic, there exists amin > 0, depending on A(0), such that A(t)  amin 1n 1> n for any time t ≥ 0, as long as A(τ ) and w(τ ) are well-defined for all τ ∈ [0, t]. Monte Carlo validation and a sufficient condition for Conjecture 6 are presented in Appendix .6. Now we state the main results of this section. Theorem 7 (Assign/appraise/influence dynamical behavior). Consider the assign/appraise/influence dynamics (9) based on Assumptions 3-6, with the task assignment and performance as in Assumptions 1 and Assumption 2 respectively. Suppose that Conjecture 6 holds. Assume that the observation network G(M ) contains a globally reachable node. For any initial appraisal matrix A(0) that is entry-wise positive and row-stochastic,  (i. the solution A(t) exists and w(t) = vleft A(t) is well-defined for all t ∈ [0, +∞). Moreover, A(t)  0n×n and A(t)1n = 1n for any t ≥ 0;  (ii. the assignment w(t) obeys the generalized replicator dynamics (7), and ξ0 1n  w(t)  1−(n−1)ξ0 1n , where  −1 maxk xk maxk xk /wk (0) ξ0 = 1 + (n − 1) ; γ0 , and γ0 = minl xl minl xl /wl (0) (iii. as t → +∞, A(t) converges to 1n x> and thereby w(t) converges to x. The proof is given in Appendix .7. As Theorem 7 indicates, the team obeying the assign/appraise/ influence dynamics achieves collective learning. A visualized illustration of the dynamics is given by Figure 3. 5 Model Variations: Causes of Failure to Learn The baseline assign/appraise/influence dynamics (9) consists of three phases: the assignment rule, the appraise dynamics, and the influence dynamics. In this section, we propose one variation in each of the three phases, based on some socio-psychological mechanisms that may cause a failure in team learning. We investigate the behavior of each model variation by numerical simulation. a) Variation in the assignment rule: task assignment based on degree centrality: In Assumption 3, the task assignment is based on the individuals’ eigenvector centrality in the appraisal network. If we assume 10 x w x w x w x w A A A A (a) no influence dynamics, (b) no influence dynamics, (c) no influence dynamics, (d) no influence dynamics, t=0 t=2 t = 30 t = 50 x w x w x w x w A A A A (e) with influence dynamics, (f) with influence dynamics, (g) with influence dynamics, (h) with influence dynamics, t=0 t=2 t = 30 t = 50 Figure 4: Examples of the assign/appraise (first row) and the assign/appraise/influence (second row) dynamics in which the assignment is based on the individuals’ in-degree centrality. The assign/appraise dynamics does not achieve the collective learning, while the assign/appraise/influence dynamics does. instead that the assignment is based on the individuals’ normalized in-degree centrality in the appraisal network, i.e., w(t) = A> (t)1n /1> n A(t)1n , then the numerical simulation, see Figure 4, shows the following results: the team obeying the assign/appraise dynamics does not necessarily achieve collective learning, while the team obeying the assign/appraise/influence dynamics still achieves both collective learning and appraisal consensus. b) Variation in the appraise dynamics: partial observation of performance feedback: According to Assumption 4, the observation network G(M ) determines the feedback signals received by each individual. If the observation network does not have the desired connectivity property, the individuals do not have sufficient information to achieve collective learning. Simulation results in Figure 5 shows that, if G(M ) is not strongly connected for the assign/appraise dynamics, or if G(M ) does not contain a globally reachable node for the assign/appraise/influence dynamics, the team does not necessarily achieve collective learning. c) Variation in the influence dynamics: prejudice model: In Assumption 6, we assume that the individuals obey the DeGroot opinion dynamics. If we instead adopt the Friedkin-Johnsen opinion dynamics, given by Fave (A, W ) = −Λ(In − W )A + (In − Λ)(A(0) − A), where Λ = diag(λ1 , . . . , λn ) and each λi characterizes individual i’s attachment to her initial appraisals. Numerical simulation, see Figure 6, shows that the team does not necessarily achieve collective learning. The Friedkin-Johnsen model captures the social-psychological mechanism in which individuals show an attachment to their initial opinions. This attachment is a cause of failure of collective learning. 11 x w x w x w x w A A A A (a) no influence dynamics, (b) no influence dynamics, (c) no influence dynamics, (d) no influence dynamics, t=0 t=1 t=5 t = 10 x w x w x w x w A A A A (e) with influence dynamics, (f) with influence dynamics, (g) with influence dynamics, (h) with influence dynamics, t=0 t=5 t = 50 t = 60 Figure 5: Examples of failure to learn with partial observation for a six-individual team. The figures in the first row correspond to the assign/appraise dynamics, in which the observation network is not strongly connected but contains a globally reachable node. The figures in the second row correspond to the assign/appraise/influence dynamics, in which the observation network does not contain a globally reachable node. In both cases, A(t) converges but lim w(t) 6= x. t→+∞ x w x w x w x w A A A A (a) t = 0 (b) t = 1 (c) t = 5 (d) t = 10 Figure 6: Example of the evolution of A(t) and w(t) in the prejudice model with n = 6. The darker the  entry, the higher value it has. The simulation result shows that A(t) converges but w(t) = vleft A(t) does not necessarily converges to x. 12 1 75 assign/appraise/influence assign/appraise random assignment 0.8 0.6 45 0.4 30 0.2 15 0 0 50 100 (a) 150 200 250 assign/appraise/influence assign/appraise random assignment 60 300 0 0 e−H1 (w,x) 50 100 150 200 250 300 (b) Number of non-transitive triads Figure 7: Evolution of the measure of mismatch between assignment and individual skill levels, and the number of non-transitive triads in the comparative appraisal graph. The solid curves represent the team obeying the assign/appraise/influence dynamics. The dash curves represent the team obeying the assign/appraise dynamics. The dotted curves represent the team that randomly assign sub-task workloads. 6 6.1 Further Discussion and Conclusion Connections with TMS theory TMS structure: As discussed in the introduction, one important aspect of TMS is the members’ shared understanding about who possess what expertise. For the case of one-dimension skill, TMS structure is approximately characterized by the appraisal matrix and thus the development of TMS corresponds to the collective learning on individuals’ true skill levels. Simulation results in Figure 7 compare the evolution of some features among the teams obeying the assign/appraise/influence model, the assign/appraise model, and the team that randomly assigns the sub-tasks, respectively. Figure 7(a) shows that, for both the assign/appraise/influence dynamics and the assign/appraise dynamics, function H1 (w, x), as the measure of the mismatch between task assignment and individual skill levels, converge to 0, which exhibits the advantage of a developing TMS. Transitive triads: As Palazzolo [27] points out, transitive triads are indicative of a well-organized TMS. The underlying logic is that inconsistency of interpersonal appraisals lowers the efficiency of locating the expertise and allocating the incoming information. In order to reveal the evolution of triad transitivity in our models, we define an unweighted and directed graph, referred to as the comparative appraisal graph e G(A) = (V, E), with V = {1, . . . , n}, as follows: for any i, j ∈ V , (i, j) ∈ E if aij ≥ aii , i.e., if individual i thinks j has no lower skill level than i herself. We adopt the standard notion of triad transitivity and use the number of non-transitive triads as the indicator of inconsistency in a team. Figure 7(b) shows that, the non-transitive triads vanish in the team obeying the assign/appraise/influence dynamics, but persist in the teams obeying the assign/appraise dynamics or just randomly assigning subtasks. 6.2 Minimum condition for convergence to optimal assignment Analysis of the asymptotic behavior of assign/appraise dynamics, assign/appraise/influence dynamics and partial observation model can be interpreted as the exploration of the most relaxed condition for the convergence to optimal task assignment, concluded as follows: 13 (i. Each individual only needs to know, as feedback, the difference between her own performance and the quality of some parts of the entire task, but do not need to know whom they are compared with; (ii. The individuals can have heterogeneous but strictly positive sensitivities to the performance feedback; (iii. The exchange of opinions on the interpersonal appraisals is not necessary; (iv. With opinion exchange, the observation network with one globally reachable node is sufficient for the convergence to optimal assignment; (v. Without opinion exchange, strongly connected observation network is sufficient for the convergence to optimal assignment. 6.3 Conclusion This paper proposes a baseline model: the centralized manager dynamics, and two elaborative multi-agent models on team dynamics: the assign/appraise and the assign/appraise/influence dynamics. We reveal insightful connections between our models and the replicator dynamics in evolutionary game theory. For the multi-agents models, the appraisal network is modeled as a team’s basic inner structure. the appraisal network generates the team’s task assignments, and the mismatch between the assignment and individuals’ true skill levels might indicate the level of team performance. By theoretical analysis we investigate the evolution of appraisal network, and relate its asymptotic behavior, i.e., the convergence to optimal assignment and the appraisal consensus, with the individuals’ feedback signal structures. We then propose some variations of the baseline models, in which some sociological and psychological mechanisms, e.g., the assignment by in-degree centrality in the appraisal network, the prejudice in opinion dynamics, and the lack of the desired connectivity property for the observation network, cause the failure of collective learning. In addition, we show that the qualitative predictions made by our models are consistent with TMS theory in organization science. .1 Proof for Theorem 1 The vector form of equation (2) is written as  ẇ = diag(w) p(w) − w> p(w)1n . (10) > Left multiply both sides by 1> n . We get d(1n w)/dt = 0. Since the function f is continuously differentiable, the right-hand side of equation (10) is continuously differentiable and locally Lipschitz in int(∆n ). Define V (w) = − n X i=1 xi log wi . xi We have V (w) ≥ 0 for any w ∈ ∆n , due to the concavity of log function, and V (w) = 0 if and only if w = x. Moreover, since V (w) is continuously differentiable in w, the level set {w ∈ int(∆n ) | V (w) = ξ} is a compact subset of int(∆n ). Along the trajectory, X X dV (w) =− (xi − wi )f (xi /wi ) − (xi − wi )f (xi /wi ) < 0, dt i∈θ1 (w) i∈θ2 (w) where θ1 (w) = {i | xi ≥ wi } and θ2 (w) = {i | xi < wi }. This concludes the proof for the invariant set and the asymptotic stability of w∗ = x, and one can infer, from the inequality above, that w∗ = x is the ESS 14 for the evolutionary game with the payoff function πi (w) = f (xi /wi ). Moreover, since V (w) → +∞ as w tends to the boundary of ∆n , the region of attraction is int(∆n ). .2 Justifications of Assumption 3 on task assignment We provide some justification of Assumption .2 that, the task assignment w is given by w = vleft (A). Firstly, the entries of vleft (A) correspond to the individuals’ eigenvector centrality in the appraisal network and thus reflect how much each individual is appraised by the team. Secondly, there is a natural way in which the  interpersonal interactions lead to the assignment w(t) = vleft A(t) . Assume that for any incoming task, at step k = 0, each individual i evenly get 1/n workload, and at each step, each individual i passes aij (t) of the workload she currently possesses to each individual j ∈ {1, . . . , n}, until the substask distribution reaches the steady state. Denote by qi (k) the fraction of the workload at individual i, at step k, this workload distribution process is given by q(k + 1) = A(t)> q(k). According to Perron-Frobenius theorem, q(k) converges to  vleft A(t) ; Thirdly, our eigenvector assignment rule has the following natural property: in a team deprived of performance feedback as the information inflow, the team’s task assignment does not change. In other  1 = 0, vector vleft A(t) remains unchanged. words, along the assign/appraise/influence dynamics with τapp These arguments justify Assumption 3; recall also Section 5(a) with a numerical evaluation of a different assignment rule. .3 Proof for Theorem 2 Before the proof, we state a useful lemma summarized from the argument on Page 62-67 of [32]. Lemma 8 (Continuity of eigenvalue and eigenvector). Suppose A, B ∈ Rn×n satisfy |aij | < 1 and |bij | < 1 for any i, j ∈ {1, . . . , n}. For sufficiently small  > 0, 0 (i. the eigenvalues λ and λ of A and (A + B), respectively, can be put in one-to-one correspondence so 0 1 that |λ − λ| < 2(n + 1)2 (n2 ) n ; (ii. if λ is a simple eigenvalue of A, then the corresponding eigenvalue λ() of A + B satisfies |λ() − λ| = O(); (iii. if v is an eigenvector of A associated with a simple eigenvalue λ, then the eigenvector v() of A + B associated with the corresponding eigenvalue λ() satisfies |vi () − vi | = O() for any i ∈ {1, . . . , n}. Proof of Theorem 2: In this proof, we extend the definition of vleft (A) to the normalized entry-wise positive left eigenvector, associated with the eigenvalue of A with the largest magnitude, if such an eigenvector exists and is unique. According to Perron-Frobenius theorem and Lemma 8, vector vleft (A), as long as welldefined, depends continuously on the entries of A. Therefore, for system (4), there exists a sufficiently small τ > 0 such that A(t) and w(t) are well-defined and continuously differentiable at any t ∈ [0, τ ], and,  P  moreover, pi w(t) − k mik pk w(t) remains finite. Therefore, for any t ∈ [0, τ ] and i, j ∈ {1, . . . , n}, aij (t) > 0 if aij (0) > 0; aij (t) = 0 if aij (0) = 0, and thus A(t) is row-stochastic and primitive for any t ∈ [0, τ ]. For any i ∈ {1, . . . , n}, there exists k 6= i such that aik (0) > 0. According to equation (3), daij (t) aij (t) = , ∀t ∈ [0, τ ], ∀j ∈ {1, . . . , n} \ {i, k}, daik (t) aik (t) which leads to aij (t)/aik (t) = aij (0)/aik (0). Let C be an n × n matrix with the entries cij defined as:   (i) cii = 0 for any i ∈ {1, . . . , n}; (ii) cij = aij (0) 1 − aii (0) for any j 6= i. One can check that C is 15 > row-stochastic and A(t) is given by equation (5), for any t ∈ [0, τ ], where a(t) = a1 (t), . . . , an (t) with ai (t) = aii (t). Since the digraph, with C as the adjacency matrix, has the same topology with the digraph associated with A(0), matrix C is irreducible and c = vleft (C) is well-defined. Since the matrix A(t) has the structure given by (5), according to Lemma 2.2 in [11], for any t ∈ [0, τ ], .X ci ck wi (t) = . 1 − ai (t) 1 − ak (t) k Therefore, for any t ∈ [0, τ ], ! X ck xi 1 − ai (t) . wk (t) ci 1 − ak (t) k   According to equation (3), ȧj (t) ≤ 0 for any j ∈ argmink xckk 1 − ak (t) . Therefore, argmink xckk 1 − ak (t) is  increasing, and similarly, argmaxk xckk 1 − ak (t) is decreasing with t, which implies that, the set  n  o ci xk ΩA A(0) = A ∈ Rn×n A = diag(a) + (I − diag(a))C, 0 ≤ ai ≤ 1 − 1 − akk (0) , ∀i min x i k ck  pi w(t) = f is a compact positive invariant set for system (4), as long as A(0) is row-stochastic, irreducible and has  strictly positive diagonal. Moreover, one can check that, for any A ∈ ΩA A(0) , w = vleft (A) is well-defined and strictly lower (upper resp.) bounded from 0 (1 resp.). Therefore, the solution A(t) is extensible to all  P  t ∈ [0, +∞) and equations (5) and (6) hold for any t ∈ [0, +∞). Moreover, since pi w(t) − k mik pk w(t) remains bounded, we have aij > 0 if aij (0) > 0 and aij (t) = 0 if aij (0) = 0. This concludes the proof for (i) - (iv). For statement (v), differentiate both sides of the equation w> (t)A(t) = w> (t) and substitute equation (4) into the differentiated equation. We obtain (w> diag(p(w) − M p(w))Ad − dw> )(In − A) = 0> n, dt where time index t is omitted for simplicity. Equation (7) in (v) is obtained due to w> (t)1n = 1. .4 Proof for Theorem 3 We prove the theorem by analyzing the generalized replicator dynamics (7) for w(t), and the reduced assign/appraise dynamics (6) for a(t), given any constant, normalized and entry-wise positive vector c. According to equation (6), the assignment w = vleft (A) can be considered as a function of the self appraisal    vector a, that is, w(t) = w a(t) for any t ≥ 0. In this proof, let φ(a) = p w(a) − M p w(a) and denote by D : Rn × Rn → R≥0 the distance induced by the 2-norm in Rn . For any x ∈ Rn and subset S of Rn , defined D(x, S) = inf y∈S D(x, y). First of all, for any given a(0) ∈ (0, 1)n , we know that the set Ω, as defined in Theorem 2(iv), is a compact positively invariant set for dynamics (6), and w(t) is well-defined and entry-wise strictly lower (upper resp.) bounded from 0n (1n resp.), for all t ∈ [0, +∞). Secondly, for any a ∈ Ω, define a scalar function V (a) = log maxk xk /wk (a) , mink xk /wk (a) and the following index sets n θ(a) = i ∃ti > 0 s.t. o xi xk  = max  for any t ∈ [0, ti ], with a(0) = a , and, k wk a(t) wi a(t) n o xj xk  = min  for any t ∈ [0, tj ], with a(0) = a . θ(a) = j ∃tj > 0 s.t. k wk a(t) wj a(t) 16  Then the right time derivative of V a(t) , along the solution a(t), is given by    d+ V a(t) = aj (t)φj a(t) − ai (t)φi a(t) , dt   for any i ∈ θ a(t) and j ∈ θ a(t) . Define  E = a ∈ Ω aj φj (a) − ai φi (a) = 0for any i ∈ θ(a), j ∈ θ(a) ,  E1 = a ∈ E φ(a) = 0n ,  E2 = a ∈ E φ(a) 6= 0n . One can check that E and E1 are compact subsets of Ω, E = E1 ∪ E2 , and E1 ∩ E2 is empty. Denote by Ê the largest invariant subset of E. Applying the LaSalle Invariance Principle, see Theorem 3 in [12], we have   D a(t), Ê → 0 as t → +∞. Note that, lim D a(t), Ê = 0 does not necessarily leads to lim w(t) = x. t→+∞ t→+∞ We need to further refine the result. For set E1 , it is straightforward to see that E1 ∈ Ê and w(a) = x for any a ∈ E1 . Now we prove by contradiction that, if E2 ∩ Ê is not empty, then, for any a ∈ E2 ∩ Ê, there exists i ∈ θ(a) such that ai = 0. Suppose ai > 0 for any i ∈ θ(a). Since the observation network G(M ) is strongly connected, there exists a directed path i, k1 , . . . , kq , j on G(M ), where i ∈ θ(a) and j ∈ θ(a). We have k1 ∈ θ(a), otherwise,  starting with ã(0) = a, there exists sufficiently small ∆t > 0 such that φi ã(t) > 0 and ãi (t) > 0, which contradicts the fact that a is in the largest invariant set of E. Repeating this argument, we have j ∈ θ(a), which contradicts φ(a) 6= 0n . Similarly, we have that, for any a ∈ E2 ∩ Ê, there exists j ∈ θ(a) with aj = 0. If the fixed vectors c and x satisfy c = x, then there can not exist a ∈ E2 ∩ Ê satisfying all the following three properties: i) there exists i ∈ θ(a) such that ai = 0; ii) there exists j ∈ θ(a) such that aj = 0; iii) φ(a) 6= 0n . In this case, E2 ∩ Ê is an empty set, which implies that a(t) → Ê = E1 and thus w(t) → x as t → +∞. Before discussing the case when c 6= x, we present some properties of the individual performance measure: P1: For any k, l ∈ {1, . . . , n}, xckk (1 − ak ) ≤ xcll (1 − al ) leads to pk (a) ≤ pl (a), and xckk (1 − ak ) > xcll (1 − al ) leads to pk (a) > pl (a);   P2: If there exists τ ≥ 0 such that i ∈ θ a(τ ) and ai (τ ) = 0, then i ∈ θ a(t) for all t ≥ τ ; P3: p(a(t)) is finite and strictly bounded from 0, satisfying   xi xi X ck f (1 − ζi (a(0))) ≤ pi (a(t)) ≤ f , ci ci ζk (a(0)) k with ζi (a) defined in Theorem 2(iv). For the case when c 6= x, consider the partition ϕ1 , . . . , ϕm of the index set {1, . . . , n}, with m ≤ n, satisfying the following two properties: (i. xk /ck = xl /cl for any k, l in the same subset ϕr ; (ii. xk /ck > xl /cl for any k ∈ ϕr , l ∈ ϕs , with r < s. For any a ∈ E2 ∩ Ê, since there exists j ∈ θ(a) with aj = 0, we have ϕm ⊂ θ(a). For any i ∈ ∪m−1 r=1 ϕr , let n E2,i = a ∈ Ω ai = 0, aj = 0 for any j ∈ ϕm , o xi ck xl ck 1− ≤ ak ≤ 1 − min for any k ∈ ϕ1 ∪ · · · ∪ ϕm−1 \ {i} . ci xk l∈{1,...,n} cl xk With properties P1 and P2 of p(a), for any a ∈ E2,i , we have i ∈ θ(a) and ai = 0. Moreover, 17 (i. E2,i ⊂ Rn is compact for any i ∈ ϕ1 ∪ · · · ∪ ϕm−1 ; (ii. ∪i∈ϕ1 E2,i , . . . , ∪i∈ϕm−1 E2,i are disjoint and compact subsets of Rn ; (iii. E2 ∩ Ê ⊂ S i∈ϕ1 ∪···∪ϕm−1 E2,i . For any a ∈ E2 ∩ Ê, since there exists i ∈ θ(a) and j ∈ θ(a) such that ai = aj = 0, on the observation network G(M ), there must exists a path i, k1 , . . . , kq satisfying: i) i ∈ θ(a) and ai = 0; ii) akq = 0 and xkq /ckq < xi /ci ; iii) akl > 0 for any l ∈ {1, . . . , q − 1}. Consider the trajectory ã(t) with ã(0) = a, we have    n n X xk q xi  X cl  cl   ˙ãkq−1 ≥ ãkq−1 (1 − ãkq−1 ) f xkq−1 (1 − ãkq−1 ) f mkq−1 kq . + (1 − mkq−1 kq ) ckq−1 1 − ãl ckq ci 1 − ãl l=1 l=1 The inequality is due to properties P1-P3 of pi (a) for i ∈ θ(a) with ai = 0, and the concavity of the function P f . Moreover, since ãkq−1 is strictly bounded from 1 and l cl /(1 − ãl ) is strictly lower bounded from 0, there exists Tkq−1 (M, a(0), a) > 0 such that  mkq−1 kq   2 − mkq−1 kq pi ã(t) + pkq ã(t) . pkq−1 ã(t) < 2 2 Applying the same argument to kq−2 , . . . , k1 , we have that, there exists Tk1 (M, a(0), a) > 0 and ηik1 ...kq (M ) ∈ (0, 1) such that, for the solution ã(t) with ã(0) = a,     pk1 ã(t) < 1 − ηik1 ...kq (M ) pi ã(t) + ηik1 ...kq (M )pkq ã(t) , for all t ≥ Tk1 (M, a(0), a). This inequality implies that,     φi ã(t) ≥ mik1 ηik1 ...kq (M ) pi ã(t) − pkq ã(t)   X n x xk  xi cl  i − q > 0. ≥ mik1 ηik1 ...kq (M )f 0 · ci ckq 1 − ζl a(0) ci l=1 Since the choices of i and the paths i, k1 , . . . , kq are finite, there exists a constant η > 0 such that, for any   a ∈ E2 ∩ Ê, there exists T a(0), a > 0 such that, for any t ≥ T a(0), a > 0, the solution ã(t), with   ã(0) = a, satisfies i ∈ θ ã(t) and φi ã(t) ≥ η > 0. For any i ∈ ϕ1 ∪ · · · ∪ ϕm−1 , define n X  Ê2,i = a ∈ E2,i pi (a) − mik pk (a) ≥ η . k=1 We have: i) each Ê2,i is a compact subset of Rn ; ii) ∪i∈ϕ1 Ê2,i , . . . , ∪i∈ϕm−1 Ê2,i are disjoint and compact  subsets of Rn . Let Ê2 = ∪m−1 ∪r∈ϕr Ê2,i . For dynamics (6), due to the continuous dependency on the r=1 initial condition, for any a ∈ (E2 ∩ Ê)\(Ê2 ∩ Ê), there exists δ > 0 such that, for any ã(0) ∈ U(a, δ)∩(E2 ∩ Ê),  where U(a, δ) = b ∈ Ω D(b, a) ≤ δ , ã(t) ∈ Ê2 ∩ Ê for sufficiently large t. Therefore, a can not be an ω-limit point of a(0). We thus obtain that, the ω-limit set of a(0) is in the set E1 ∪ (Ê2 ∩ Ê). Moreover, since E1 , ∪i∈ϕ1 Ê2,i , . . . , ∪i∈ϕm−1 Ê2,i are disjoints compact subsets of Rn , and the ω-limit set of a(0) is connected and compact, a(t) can only converge to one of the sets E1 , ∪i∈ϕ1 Ê2,i , . . . , ∪i∈ϕm−1 Ê2,i .  Now we prove limt→+∞ D(a(t), E1 ) = 0 by contradiction. Suppose ω a(0) ∈ ∪i∈ϕr Ê2,i for some r ∈ {1, . . . , m − 1}. Since each Ê2,i is a compact set, there exists  > 0 and η() > 0 such that φi (a) ≥ η() > 0   for any a ∈ U(Ê2,i , ). For this given  > 0, since ω a(0) ∈ ∪i∈ϕr Ê2,i leads to D a(t), ∪i∈ϕr Ê2,i → 0 as t → +∞, we conclude that, there exists T > 0 such that, for any t ≥ T , a(t) ∈ ∪i∈ϕr U(Ê2,i , ). Define 18 Vr (a) = mini∈ϕr ai , for any a ∈ ∪i∈ϕr U(Ê2,i , ). The function Vr (a) satisfies that, Vr (a) ≥ 0 for any  a ∈ ∪i∈ϕr U(Ê2,i , ) and Vr (a) = 0 if and only if a ∈ ∪i∈ϕr Ê2,i . Therefore, D a(t), ∪i∈ϕr Ê2,i → 0 leads to  Vr a(t) → 0 as t → +∞. Moreover, since a ∈ U(Ê2,i , ) for any i ∈ argmink∈ϕr ak , we have   d+ Vr a(t) ȧi (t) ≥ δai (t) 1 − ai (t) . = min dt i∈argmin ak (t) k∈ϕr According to Theorem 2(i), for any given a(0) ∈ (0, 1)n , a(t) ∈ (0, 1)n for all t ≥ 0. Therefore,  d+ Vr (a(t))/dt > 0 for all t ≥ T , which contradicts limt→+∞ Vr a(t) = 0. Therefore, we have limt→+∞ D(a(t), E1 ) = 0 and limt→+∞ w(t) = x.  Since Ȧ(t) → 0n×n as φ a(t) → 0n , there exists an entry-wise non-negative and irreducible matrix A∗ , depending on A(0) and satisfying vleft (A∗ ) = x, such that A(t) → A∗ as t → +∞. This concludes the proof. .5 Proof for Lemma 5 Since A(0) is primitive and row-stochastic, following the same argument in the proof for Theorem 2(i), we have that, there exists ∆t̃ > 0 such that, for any t ∈ [0, ∆t̃]: i) w(t) is well-defined and w(t)  0n ; ii) A(t)   is bounded, continuously differentiable to t, and satisfies A(t)1n = 1n ; iii) p w(t) − M p w(t) is bounded. 1 1 Therefore, for any t ≥ 0, there exists µ, depending on t and A(0), such that Ȧ(t)  τave A2 (t) − ( τave + µ)A(t). 1 1 2 Consider the equation Ḃ(t) = τave B (t) − ( τave + µ)B(t), with B(0) = A(0). According to the comparison 1 theorem, A(t)  B(t) for any t ≥ 0. Let bi (t) be the i-th column of B(t) and let yk (t) = e( τave +µ)t bk (t). We 1 B(t)yk (t). obtain ẏk (t) = τave 1 Denote by Φ(t, 0) the state transition function for the equation ẏk (t) = τave B(t)yk (t), which is written Rt Rt R τ1 Rτ P∞ as Φ(t, 0) = In + k=1 Φk (t), where Φ1 (t) = 0 B(τ1 )dτ1 and Φl (t) = 0 B(τ1 ) 0 . . . B(τl−1 ) 0 l−1 B(τl )dτl for l ≥ 2. By computing the MacLaurin expansion for each Φk (t) and summing them together, we obtain that Φ(t, 0) = In + h1 (t)B(0) + h2 (t)B 2 (0) + · · · + hn−1 (t)B n−1 (0) + O(tn ), where hk (t) is a polynomial with the form hk (t) = ηk,k tk + ηk,k+1 tk+1 + . . . , and, moreover, ηk,k > 0 for any k ∈ N. Therefore, for t sufficiently small, we have hk (t) > 0 for any k ∈ {1, . . . , n − 1}. Moreover, since B k (0)  0n×n for any k ∈ N and B(0)+· · ·+B n−1 (0)  0n×n , there exists ∆t ≤ ∆t̃ such that Φ(t, 0)  0n×n for any t ∈ [0, ∆t]. .6 Discussion on Conjecture 6 The Monte Carlo method [29] is adopted to estimate the probability that Conjecture 6 holds. For any randomly generated A(0) ∈ int(∆n ), define the random variable Z : int(∆n ) → {0, 1} as  (i. Z A(0) = 1 if there exists amin > 0 such that A(t)  amin 1n 1> n for all t ∈ [0, 1000];  (ii. Z A(0) = 0 otherwise.    Let p = P Z A(0) = 1 . For N independent random samples Z1 , . . . , ZN , in each of which A(0) is randomly PN generated in int(∆n ), define p̂N = i=1 Zi /N . For any accuracy  ∈ (0, 1) and confidence level 1 − ξ ∈ (0, 1), |p̂N − p| <  with probability greater than 1 − ξ if N≥ 2 1 log . 22 ξ 19 (11) For  = ξ = 0.01, the Chernoff bound (11) is satisfied by N = 27000. We run 27000 independent MATLAB simulations of the assign.appraise/influence dynamics with n = 7 and find that p̂N = 1. Therefore, for any A(0) ∈ int(∆n ), with 99% confidence level, there is at least 0.99 probability that A(t) is entry-wise strictly lower bounded from 0n×n for all t ∈ [0, 10000]. Moreover, we present in the following lemma a sufficient condition for Conjecture 6 on the initial appraisal matrix A(0) and the parameters τave , τapp . Lemma 9 (Strictly positive lower bound of appraisals). Consider the assign/appraise/influence dynamics (9), based on Assumptions 3-6, with the assignment w(t) and performance p(w) as in Assumptions 1 and 2 respectively. For any initial appraisal matrix A(0) that is entry-wise positive and row-stochastic, as long as      τapp 1 − ξ0 xmax xmin ≥ f −f , τave ξ0 ξ0 1 − (n − 1)ξ0 where the constant ξ0 is defined as in Theorem 7 (ii), then there exists amin > 0 such that A(t)  amin 1n 1> n. P Proof. First of all, by definition we have ws (t) = k wk (t)aks (t). The right-hand side of this equation is a convex combination of {a1s (t), . . . , ans (t)}. Therefore, maxk aks (t) ≥ ws (t) ≥ ξ0 for all t ∈ [0, +∞). At any time t ≥ 0, for any pair (i, j) such that aij (t) = mink,l akl (t), the dynamics for aij (t) is ! n  X   X 1 1 aik (t)akj (t) − aij (t) − mik pk w(t) . aii (t)aij (t) pi w(t) − ȧij (t) = τave τapp k k=1  Pn  For simplicity, in this proof, denote φi = pi w(t) − k=1 mik pk w(t) . Suppose amj (t) = maxk akj (t). We have 1 2 1 1 aij (t)amj (t) − a (t) − aii (t)aij (t)φi . ȧij (t) ≥ τave τave ij τapp Therefore,  x  xmin ȧij 1 1 max  ≥ ξ0 − (1 − ξ0 ) f −f . aij τave τapp ξ0 1 − (n − 1)ξ0  1 1 The condition on τave / τapp in Lemma 9 guarantees that ȧij (t) aij (t) is positive if aij (t) = mink,l akl (t). This concludes the proof. .7 Proof for Theorem 7 Statement (i) is proved following the same argument in the proof for Theorem 2 (i). For any given A(0) that is row-stochastic and entry-wise positive, the closed and bounded invariant set Ω for A(t) is given by  Ω = A ∈ Rn×n A  amin 1n 1> , A1n = 1n , where amin > 0 is given by Conjecture 6. n Since w> (t) A2 (t) − A(t) = 0> n for all t ≥ 0, we conclude that, w(t) in the assign/appraise/influence dynamics also obeys the generalized replicator dynamics (7). Consider w(t) as a function of A(t). Define   φ(A) = p w(A) − M p w(A) and maxk xk /wk (A) . mink xk /wk (A)   For any t ∈ [0, +∞), there exists i ∈ argmaxk xk /wk A(t) and j ∈ argmink xk /wk A(t) such that     + V A(t) = log xi wj A(t) xj wi A(t) , and d Vdt(A) = ajj φj (A) − aii φi (A) ≤ 0. Therefore, V A(t) is non-increasing with t, which in turn implies V (A) = log xi wj (t) maxk xk /wk (0) ≤ = γ0 , xj wi (t) mink xk /wk (0) 20 P for any i, j ∈ {1, . . . , n}. This inequality, combined with the fact that k wk (t) = 1 for any t ≥ 0, leads to the inequalities in statement (ii). Similar to the proof for Theorem 3, define o n xk xi  = max  for any t ∈ [0, ti ] with A(0) = A , θ(A) = i ∃ ti > 0 s.t. k wk A(t) wi A(t) n o xj xk  = min  for any t ∈ [0, tj ] with A(0) = A , θ(A) = j ∃ tj > 0 s.t. k wk A(t) wj A(t)  and let E = A ∈ Ω d+ V (A)/dt = 0 . For any A ∈ E, since A  amin 1n 1> n , we have φi (A) = φj (A) = 0 for any i ∈ θ(A) and j ∈ θ(A). Suppose individual s is a globally reachable node in the observation network. There exists a directed path i, k1 , . . . , kq , s. Without loss of generality, suppose q ≥ 1. For any A in the largest invariant subset of E, we have k1 ∈ θ(A) and therefore φk1 (A) = 0. This iteration of argument leads to s ∈ θ(A). Following the same line of argument, we have s ∈ θ(A). Therefore, for any given A(0)  0n×n that is row-stochastic, the solution A(t) converges to Ê = {A ∈ Ω | φ(A) = 0n } = {A ∈ Ω | vleft (A) = x}.  Let à = maxj maxk akj − mink akj . One can check that d+ Ṽ (A)/dt along the dynamics (9) is a  continuous function of A for any A ∈ Ω. Define Ê/2 = A ∈ Ê kA − 1n x> k2 ≥ /2 . Since Ê is compact, Ê/2 is also a compact set. For any A ∈ Ê/2 , since d+ Ṽ (A)/dt is strictly negative and depends continuously on A, there exists a neighborhood U(A, rA ) = {à ∈ Ω | kà − Ak2 ≤ rA } such that d+ Ṽ (Ã)/dt < 0 for any à ∈ U(A, rA ). Due to the compactness of Ê/2 and according to the Heine-Borel finite cover theorem, there exists K ∈ N and {Ak , rk }k∈{1,...,K} , where Ak ∈ Ê/2 and rk > 0 for any k ∈ {1, . . . , K}, such that Ê/2 ⊂ ∪K k=1 U(Ak , rk ). Define the distance D : Rn × Rn → R≥0 as in the proof for Theorem 3. Let δ = min{r1 , . . . , rk , /2} and  B1 = A ∈ Ω D(A, Ê) ≤ δ, D(A, Ê/2 ) > δ ,  B2 = A ∈ Ω D(A, Ê) ≤ δ, D(A, Ê/2 ) ≤ δ . We have B1 ∩ B2 is empty. For any A ∈ B1 , since D(A, Ê) ≤ δ, D(A, Ê/2 ) > δ, there exists à ∈ Ê/2 such that D(A, Ã) ≤ δ. Since D(Ã, 1n x> ) < /2, we have D(A, 1n x> ) ≤ D(A, Ã) + D(Ã, 1n x> ) < . Therefore, B1 ⊂ U(1n x> , ). Moreover, since B2 is compact, Ṽ (A) is lower bounded and d+ Ṽ (A)/dt is strictly upper bounded from 0 in B2 . Since limt→+∞ D(A(t), Ê) = 0, there exists t0 > 0 such that A(t) ∈ B1 ∪ B2 for any t ≥ 0. Therefore, for any t ≥ t0 , there exists t1 ≥ t such that A(t1 ) ∈ B1 . This argument is valid for any  > 0, which implies that 1n x> is an ω-limit point for any given A(0).  Since Ê is compact, D(A, Ẽ) is strictly positive. Since limt→+∞ D A(t), Ê = 0, any A ∈ Ω \ Ê can not be an ω-limit point of A(0). For any A ∈ Ê \ {1n x> }, since the solution passing through A asymptotically converges to 1n x> , A ∈ Ê \ {1n x> } can not be an ω-limit point of A(0) either. Therefore, the ω-limit set of A(0) is {1n x> }. This concludes the proof. References [1] E. G. Anderson Jr and K. Lewis. A dynamic model of individual and collective learning amid disruption. Organization Science, 25(2):356–376, 2013. [2] X. Chen, J. Liu, Z. Xu, and T. Başar. Distributed evaluation and convergence of self-appraisals in social networks. In IEEE Conf. on Decision and Control, pages 2895–2900, Osaka, Japan, 2015. [3] R. Cressmana and Y. Tao. The replicator equation and other game dynamics. Proceedings of the National Academy of Sciences, 111:10810–10817, 2014. 21 [4] M. H. DeGroot. Reaching a consensus. Journal of the American Statistical Association, 69(345):118–121, 1974. [5] L. Festinger. A theory of social comparison processes. Human Relations, 7(2):117–140, 1954. [6] M. J. Fox, B. Touri, and J. S. Shamma. Dynamics in atomic signaling games. Journal of Theoretical Biology, 376:82–90, 2015. [7] N. E. Friedkin. A formal theory of reflected appraisals in the evolution of power. Administrative Science Quarterly, 56(4):501–529, 2011. [8] N. E. Friedkin and C. E. Johnsen. Attitude change, affect control, and expectation states in the formation of influence networks. Advances in Group Processes, 20:1–29, 2003. [9] A. Jadbabaie, A. Sandroni, and A. Tahbaz-Salehi. Non-Bayesian social learning. Games and Economic Behavior, 76(1):210–225, 2012. [10] P. Jia, N. E. Friedkin, and F. Bullo. The coevolution of appraisal and influence networks leads to structural balance. IEEE Transactions on Network Science and Engineering, July 2016. To appear. [11] P. Jia, A. MirTabatabaei, N. E. Friedkin, and F. Bullo. Opinion dynamics and the evolution of social power in influence networks. SIAM Review, 57(3):367–397, 2015. [12] J. P. LaSalle. Stability theory for ordinary differential equations. Journal of Differential Equations, 4:57–65, 1968. [13] D. Lazer and A. Friedman. The network structure of exploration and exploitation. Administrative Science Quarterly, 52(4):667–694, 2007. [14] J. Y. Lee, D. G. Bachrach, and K. Lewis. Social network ties, transactive memory, and performance in groups. Organization Science, 25(3):951–967, 2014. [15] K. Lewis. Measuring transactive memory systems in the field: scale development and validation. Journal of Applied Psychology, 88(4):587, 2003. [16] K. Lewis. Knowledge and performance in knowledge-worker teams: A longitudinal study of transactive memory systems. Management Science, 50:1519–1533, 2004. [17] D. W. Liang, R. Moreland, and L. Argote. Group versus individual training and group performance: The mediating role of transactive memory. Personality and Social Psychology Bulletin, 21:384–393, 1995. [18] J. Lorenz and D. A. Lorenz. On conditions for convergence to consensus. IEEE Transactions on Automatic Control, 55:1651–1656, 2010. [19] D. Madeo and C. Mocenni. Game interactions and dynamics on networked populations. IEEE Transactions on Automatic Control, 60:1801–1810, 2015. [20] J. G. March. Exploration and exploitation in organizational learning. Organization Science, 2(1):71–87, 1991. [21] J. R. Marden, H. P. Young, G. Arslan, and J. S. Shamma. Payoff-based dynamics for multiplayer weakly acyclic games. SIAM Journal on Control and Optimization, 48(1):373–396, 2009. 22 [22] S. A. Marvel, J. Kleinberg, R. D. Kleinberg, and S. H. Strogatz. Continuous-time model of structural balance. Proceedings of the National Academy of Sciences, 108(5):1771–1776, 2011. [23] W. Mason and D. J. Watts. Collaborative learning in networks. Proceedings of the National Academy of Sciences, 109(3):764–769, 2011. [24] W. Mei, N. E. Friedkin, K. Lewis, and F. Bullo. Dynamic models of appraisal networks explaining collective learning. In IEEE Conf. on Decision and Control, Las Vegas, NV, USA, December 2016. To appear. [25] A. MirTabatabaei and F. Bullo. Opinion dynamics in heterogeneous networks: Convergence conjectures and theorems. SIAM Journal on Control and Optimization, 50(5):2763–2785, 2012. [26] J. Morand-Ferron and J. L. Quinn. Larger groups of passerines are more efficient problem solvers in the wild. Proceedings of the National Academy of Sciences, 108(38):15898–15903, 2011. [27] E. T. Palazzolo. Organizing for information retrieval in transactive memory systems. Communication Research, 32(6):726–761, 2005. [28] W. H. Sandholm. Population Games and Evolutionary Dynamics. MIT Press, 2010. [29] R. Tempo, G. Calafiore, and F. Dabbene. Randomized Algorithms for Analysis and Control of Uncertain Systems. Springer, 2005. [30] V. A. Traag, P. Van Dooren, and P. De Leenheer. Dynamical models explaining social balance and evolution of cooperation. PLOS ONE, 8(4):e60063, 2013. [31] D. M. Wegner, T. Giuliano, and P. T. Hertel. Cognitive interdependence in close relationships. In J. Ickes, editor, Compatible and Incompatible Relationships, pages 253–276. Springer, 1985. [32] J. H. Wilkinson. The Algebraic Eigenvalue Problem. Oxford University Press, 1965. [33] A. W. Woolley, C. F. Chabris, A. Pentland, N. Hasnmi, and T. W. Malone. Evidence for a collective intelligence factor in the performance of human groups. Science, 330:686–688, 2010. [34] S. Wuchty, B. F. Jones, and B. Uzzi. The increasing dominance of teams in production of knowledge. Science, 316:1036–1039, 2007. [35] Y. C. Yuan, I. Carboni, and K. Ehrlich. The impact of awareness and accessibility on expertise retrieval: A multilevel network perspective. Journal of the American Society for Information Science and Technology, 61(4):700–714, 2010. 23
3cs.SY
Wasserstein Riemannian Geometry of Positive Definite Matrices∗ arXiv:1801.09269v2 [math.ST] 19 Mar 2018 Luigi Malagò† , Luigi Montrucchio‡ , and Giovanni Pistone§ Abstract. The Wasserstein distance on multivariate non-degenerate Gaussian densities is a Riemannian distance. After reviewing the properties of the distance and the metric geodesic, we derive an explicit form of the Riemannian metrics on positive-definite matrices and compute its tensor form with respect to the trace scalar product. The tensor is a matrix which is the solution of a Lyapunov equation. We compute the explicit form for the Riemannian exponential, the normal coordinates charts and the Riemannian gradient. Finally, the Levi-Civita covariant derivative is computed in matrix form together with the differential equation for the parallel transport. While all computations are given in matrix form, nonetheless we discuss also the use of a special moving frame. Key words. Gaussian distribution, Wasserstein distance, Riemannian metrics, Natural gradient, Riemannian Exponential, Normal coordinates, Levi-Civita covariant derivative, Optimization on positive-definite symmetric matrices, Information Geometry. AMS subject classifications. 15B48, 53C23, 53C25, 60D05 1. Introduction and overview. Given two Gaussian distributions Nn (µi , Σi ), i = 1, 2, consider the Gaussian vector (X1 , X2 ) where each block has an assigned distribution. The use of the number (1)   G2 = inf E kX1 − X2 k2 .. as an index of dissimilarity between distributions has been considered by many classical authors, C. Gini (1914), P. Levy, and M. R. Fréchet. There is a considerable contemporary literature on this problem, where the index is called L2 -Wasserstein distance and it is discussed in general, outside our special case of Gaussian distributions. Among the most relevant literature for the approach used in this paper, we mention Y. Brenier [8], R. J. McCann [21], F. Otto [23]. The value of the index of Eq. (1) as a function of the mean and the dispersion matrix has been computed by some authors, in particular I. Olkin and F. Pukelsheim [22], D. C. Dowson and B. V. Landau [11], C. R. Givens and R. M. Shortt [14], M. Gelbrich [13], R. Bhatia et al. ∗ Compiled Tuesday 20th March, 2018, 01:55 Funding: L. Malagò acknowledges the support of RIST. L. Montrucchio acknowledges the support of Collegio Carlo Alberto. G. Pistone is member of GNAFA-INdAM and acknowledges the support of de Castro Statistics and Collegio Carlo Alberto. † Romanian Institute of Science and Technology - RIST, Str. Virgil Fulicea nr. 17, 400022 Cluj-Napoca, Romania ([email protected]). ‡ Collegio Carlo Alberto, Piazza Vincenzo Arbarello 8, 10122 Torino, Italy ([email protected]). § de Castro Statistics, Collegio Carlo Alberto, Piazza Vincenzo Arbarello 8, 10122 Torino, Italy ([email protected]). 1 2 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE [7]. They found the two equivalent forms (2) (3) 2 2    1/2 1/2 1/2 Σ1 Σ2 Σ1 G = kµ1 − µ2 k + Tr Σ1 + Σ2 − 2   = kµ1 − µ2 k2 + Tr Σ1 + Σ2 − 2 (Σ1 Σ2 )1/2 .  The G2 index is actually the square of a distance, hence a measure of divergence between distributions. We can mimic the argument of a famous paper by Amari [3], which derived the notion of both Fisher metric and natural gradient from the second-order approximation of the Kullback-Leibler divergence. In fact, we show that for small H such that the divergence of Σ + H and Σ remains constant it holds  1/2  1  1/2 1/2 (4) Tr Σ + (Σ + H) − 2 Σ (Σ + H)Σ ≃ Tr (LΣ [H] H) , 2 where LΣ [H] = X is the solution to the Lyapunov equation XΣ + ΣX = H. According to a standard argument, for any smooth function f , as H → 0, the increment f (Σ + H) − f (Σ) is maximized along the direction (5) grad f (Σ) = ∇f (Σ)Σ + Σ∇f (Σ) . The quadratic form in Eq. (4) is the natural candidate to be the Riemannian metric associated with the given distance, while the gradient in Eq. (5) is the natural gradient. The fact that the L2 -Wasserstein geometry is actually Riemannian on a suitable subset of distributions has been stated in general in [23, §4] and has been developed in the Gaussian case by A. Takatsu [26]. In the present paper, we proceed along these lines by deriving explicit forms of the Riemannian metrics, the Riemannian exponential, the Levi-Civita (covariant) derivative, Riemannian parallel transport, and the Riemannian Hessian. The perspective is dictated by the authors’ interests in Machine Learning, Manifold Optimization, and Information Geometry. Further relevant, more technical, references are cited in the text when needed. 1.1. Overview. In Sec. 2 we review the properties of the space of symmetric matrices we are going to use, in particular, the trace norm, Riccati equation, Lyapunov equation, and the calculus of the mapping σ : A 7→ AA∗ , where A is a non-singular square matrix. The set of positive-definite matrices is seen as an elementary manifold, as it is an open set of an Euclidean space. In this context, the mapping σ is a submersion and we compute the horizontal vectors at each point. Despite of our manifold being finite dimensional, there is no need of choosing a basis as all operations of interest are matrix operations. For that reason, we use the language of non-parametric differential geometry of W. Klingenberg [16] and S. Lang [17]. A short review of the matrix algebra we need is given in Sec. 2 In Sec. 3 we review for reference purposes well-known results about the metric geometry induced by the dissimilarity index. We re-state the result as Prop. 3.2 and, for sake of completeness, we provide in Appendix a further proof inspired by [11]. The index itself turns out to be a distance. Its value is attained on a joint degenerate distribution, and, it is possible WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 3 to write down an explicit metric geodesic, when the distributions at end-points are not both singular. This has been done by R. J. McCann [21, Example 1.7] and it is restated in Prop. 3.4. The space of nondegenerate Gaussian measures (or, equivalently, the space of positive definite matrices) can be endowed with a Riemann structure that induces the L2 -Wasserstein distance. This is discussed in Sec. 4. We use the presentation given by [26], cf. also [7], which in turn adapts to the Gaussian case the original work [23, §4]. We add a detailed clarification of the “coordinate system” associated with the Riemannian geometry. The Wasserstein Riemannian metric will be given at each dispersion matrix Σ by (6) WΣ (U, V ) = Tr (LΣ [U ] Σ LΣ [V ]) = 1 Tr (LΣ [U ] V ) , 2 where U, V are symmetric matrices. The Riemannian exponential is introduced in Sec. 5. The natural gradient is defined in Sec. 6 and some applications to optimization are discussed in Sec. 9.4.1. The analysis of the second-order geometry is treated in Sec. 7, where we compute the Levi-Civita covariant derivative, the Riemannian Hessian, and other related topics. 2. Symmetric matrices. Given a mean vector µ ∈ Rn and a symmetric n × n nonnegative definite dispersion matrix Σ ∈ Sym+ (n), there exists a unique Gaussian distribution on Rn , denoted Nn (µ, Σ), with the given parameters, and conversely. The set G n of Gaussian distributions on Rn is in 1-to-1 correspondence with the space of its parameters, (7) G n ∋ Nn (µ, Σ) ↔ (µ, Σ) ∈ Rn × Sym+ (n) . Moreover, G n is closed for weak convergence and the identification is continuous in both directions. A reference for Gaussian distributions is T. W. Anderson [5]. For ease of later reference, we recall a few results on spaces of matrices. General references are the monographs by P. R. Halmos [15], J. R. Magnus and H. Neudecker [18], and R. Bhatia [6]. The vector space of n × m real matrices is denoted by M(n × m), while square matrices are denoted M(n) = M(n × n). It is an Euclidean space of dimension nm and the vectorization mapping M(n × m) ∋ A 7→ vec (A) ∈ Rnm is an isometry, hA, Bi = (vec (A))∗ (vec (B)) = p Tr (AB ∗ ). The norm is denoted by kAk = Tr (AA∗ ). Symmetric matrices Sym (n) form a vector subspace of M (n) whose orthogonal complement is the vector space of anti-symmetric matrices Sym⊥ (n). We will find it convenient to use, with reference to symmetric matrices, the equivalent scalar product hA, Bi2 = 21 Tr (AB ∗ ), see e.g. Eq. (6). The closed pointed cone of non-negative-definite symmetric matrices is Sym+ (n) and its interior, the open cone of the positive-definite symmetric matrices, is Sym++ (n). Given A, B ∈ Sym (n), the equation T AT = B is called Riccati equation. If A ∈ Sym++ (n) and B ∈ Sym+ (n), then the equation T AT = B has unique solution T ∈ Sym+ (n). In fact, from T AT = B it follows A1/2 T A1/2 A1/2 T A1/2 = A1/2 BA1/2 and, in turn, A1/2 T A1/2 = 1/2 because T ∈ Sym+ (n) hence, the solution is A1/2 BA1/2 1/2  A−1/2 . (8) T = A−1/2 A1/2 BA1/2 4 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE Notice that det (T ) = det (A)−1/2 det (B)1/2 , hence det (T ) > 0 if det (B) > 0. In terms of random variables, if X ∈ Nn (0, A) and Y = Nn (0, B), then T is the unique matrix of Sym+ (n) such that Y ∼ T X. A more compact closed-form solutions of the Riccati equation are available. Given A ∈ Sym++ (n) and B ∈ Sym+ (n), observe that AB = A1/2 (A1/2 BA1/2 )A−1/2 . By similarity, we see that the eigenvalues of AB are non-negative, hence the square root (9) (AB)1/2 = A1/2 (A1/2 BA1/2 )1/2 A−1/2 is well defined, see [6, Ex. 4.5.2]. Therefore, we can re-write Eq. (8) as (10) 1/2  A−1/2 = A−1 (AB)1/2 . T = A−1 A1/2 A1/2 BA1/2 As AB = A(BA)A−1 , the eigenvalues of AB and BA are the same, so that the same argument used before yields too (11) T = (BA)1/2 A−1 . The mapping σ : A 7→ A2 is an injection of Sym++ (n) onto itself. Its derivative is dX σ(A) = XA + AX and the derivative operator dσ(A) is invertible. Alternative notation for the derivative we would occasionaly find convenient to use are dX σ(A) = dσ(A)[X]. For each assigned matrix V ∈ Sym (n), the matrix X = (dσ(A))−1 V is the unique solution X in the space Sym (n) to the Lyapunov equation (12) V = XA + AX . Its solution will be written X = LA [V ]. We are going to use in the paper the obvious relations (13) V = LA [V ] A + ALA [V ] , (14) X = LA [XA + AX] . The Lyapunov operator itself can be seen as a derivative. In fact, the inverse of the mapping σ is σ −1 : Σ → Σ1/2 . By the derivative-of-the-inverse rule (15) dV σ −1 (Σ) = (dσ(σ −1 (Σ)))−1 [V ] = LA [V ] , Σ1/2 = A . If Σ is the dispersion of a non-singular Gaussian distribution, then C = Σ−1 ∈ Sym++ (n) is the concentration matrix and represents an alternative and useful parameterization. From the Lyapunov equation V = XΣ + ΣX we obtain Σ−1 V Σ−1 = Σ−1 X + XΣ−1 , hence   (16) LΣ [V ] = LΣ−1 Σ−1 V Σ−1 and LΣ−1 [U ] = LΣ [ΣU Σ] . In a similar way, nother useful formula is i h (17) LΣ [V ] = Σ−1/2 LΣ Σ−1/2 V Σ−1/2 Σ−1/2 . WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 5 There is also a relation between the Lyapunov equation and the trace. From XΣ + ΣX = V , it follows Σ−1 XΣ + X = Σ−1 V , then (18) Tr (LΣ [V ]) =  1 Tr Σ−1 V . 2 We will need later the derivative of A 7→ LA [V ] for a fixed V . This can be computed by differentiating the identity (13) in the direction U . We have (19) 0 = dU LA [V ] A + LA [V ] U + U LA [V ] + A dU LA [V ] . Hence dU LA [V ] is the solution to the Lyapunov equation (20) dU LA [V ] A + AdU LA [V ] = −(LA [V ] U + U LA [V ]) , so that (21) dU LA [V ] = −LA [LA [V ] U + U LA [V ]] . We shall need also the second derivative of the function σ −1 : Σ 7→ Σ1/2 . From Eq. (15) we have dσ −1 (Σ)[V ] = LΣ1/2 [V ], then, (22) d2 σ −1 (Σ)[U, V ] = LΣ1/2 [LΣ1/2 [V ] U + U LΣ1/2 [V ]] . Lyapunov equation is of crucial importance to us, as the linear operator LA enters the expression of the Riemannian metric with respect to the standard scalar product, see Eq. (6). In fact, the numerical implementation of the scalar product WΣ (U, V ) will require the computation of the matrix LΣ [U ]. There are many ways to write down the closed-form solution to Eq. (12). These closed forms solutions are discussed in [6]. Efficient numerical solutions are not based on the closed forms above, but rely on specialized numerical algorithms as argued by E. L. Wachspress [27] and by V. Simoncini [25]. We study now the square-of-a-matrix operation when acting on general invertible matrices. We show in the next proposition that this operation is a submersion. We recall the definition, see [10, Ch. 8, Ex. 8–10] or [17, §II.2]. Let O be an open set of the Hilbert space H, and f : O → N a smooth surjection from the Hilbert space H onto a manifold N , i.e., assume that for each A ∈ O the derivative at A, df (A) : H → Tf (A) N is surjective. In such a case, for each C ∈ N , the fiber f −1 (C) is a sub-manifold. Given a point A ∈ f −1 (C), a vector U ∈ H is called vertical if it is tangent to the manifold f −1 (C). Each such a tangent vector U is the velocity at t = 0 of some smooth curve t 7→ γ(t) with γ(0) = A and γ̇(0) = U . Precisely, from f (γ(t)) = C for all t we derive the characterization of vertical vectors. We have df (A)[γ̇(0)] = 0 i.e., the tangent space at A is TA f −1 (f (A)) = Ker(df (A)). The orthogonal space to the tangent space TA f −1 (f (A)) is called the space of horizontal vectors at A, (23) HA = Ker(df (A))⊥ = Im (df (A)∗ ) . 6 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE Let us apply this argument to our specific case. We denote by GL(n) ⊂ M(n) the open set of invertible matrices; O (n) the subgroup of GL(n) of orthogonal matrices; Sym⊥ (n) the subspace of M(n) of anti-symmetric matrices. We are going to show that the mapping σ : GL (n) ∋ A 7→ AA∗ ∈ Sym++ (n) (24) is indeed a submersion. Proposition 2.1. 1. For each given A ∈ GL(n) we have the orthogonal splitting M(n) = Sym (n) A ⊕ Sym⊥ (n) (A∗ )−1 . (25) 2. The mapping σ : GL(n) ∋ A 7→ AA∗ ∈ Sym++ (n) (26) is a submersion with fibers (27) n o σ −1 (C) = C 1/2 R| R ∈ O (n) and its differential at A is dX σ(A) = XA∗ + AX ∗ . The kernel of the differential is (28) Ker(dσ(A)) = Sym⊥ (n) (A∗ )−1 and its orthogonal complement, HA = Ker(dσ(A))⊥ , is (29) HA = Sym (n) A. 3. The orthogonal projection of X ∈ M (n) onto HA is LAA∗ [XA∗ + AX ∗ ]. Proof. 1. Assume hB, CAi = 0, for all C ∈ Sym (n) that is, CA ∈ Sym+ (A) . Then Tr (BA∗ C) = 0, so that BA∗ ∈ Sym⊥ (n) that is, B ∈ Sym⊥ (n) (A∗ )−1 . 2. Consider the matrix A as a point in the fiber manifold σ −1 (AA∗ ). The derivative of σ at A, X 7→ dX σ(A) = XA∗ + AX ∗ , is surjective, because for each W ∈ Sym (n) we have dσ(A) 12 W (A∗ )−1 = W , hence σ is a surjection and the fiber σ −1 (AA∗ ) is a sub-manifold of GL(n). Let us compute the splitting of M(n) into the kernel of dσ(A) and its orthogonal, M(n) = Ker(dσ(A)) ⊕ HA . As the vector space tangent to σ −1 (AA∗ ) at A is the kernel of the derivative at A: Ker(dσ(A)) = {X ∈ M(n)| XA∗ + AX ∗ = 0} = {X ∈ M(n)| (AX ∗ )∗ = −AX ∗ } . Hence, X ∈ Ker(dσ(A)) ⇐⇒ AX ∗ ∈ Sym⊥ (n). Namely, Ker(dσ(A)) = Sym⊥ (n) (A∗ )−1 . But we have just proved that this implies HA = Sym (n) A. 3. Consider the decomposition of X into the horizontal and the vertical part, X = CA+D(A∗ )−1 with C ∈ Sym (n) and D ∈ Sym⊥ (n). By transposition, we get X ∗ = A∗ C − A−1 D. From the previous two equations, we obtain the two equations XA∗ = C(AA∗ ) + D and AX ∗ = (AA∗ )C − D. The sum of the two previous equations is XA∗ + AX ∗ = C(AA∗ ) + (AA∗ )C, which is a Lyapunov equation. WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 7 3. Wasserstein distance. The aim of this section is to present the Wasserstein distance for the Gaussian case as well as the equation for the associated metric geodesic. 3.1. Block-Gaussian. Let us suppose that the dispersion matrix Σ ∈ Sym+ (2n) is partitioned into n × n blocks, and consider random variables X and Y such that     X Σ1 K (30) ∼ N2n (µ, Σ) , Σ = , Y K ∗ Σ2 2 ≤ so that Kij = Cov (Xi , Yj ) if i = 1, . . . , n and j = (n + 1), . . . , 2n. It follows that Kij (Σ1 )ii (Σ2 )jj , which in turn imply the bounds (31) kKk22 ≤ Tr (Σ1 ) Tr (Σ2 ) and 1 sup |Kij | ≤ (Tr (Σ1 ) + Tr (Σ2 )) . 2 ij Assigned the mean vectors µ1 , µ2 ∈ R2 and dispersion matrices Σ1 , Σ2 ∈ Sym+ (n), define the set of jointly Gaussian distributions with given marginals to be      µ1 Σ1 K (32) G((µ1 , Σ1 ), (µ2 , Σ2 )) = N2n , , µ2 K ∗ Σ2 and the Gini dissimilarity index (33) G2 ((µ1 , Σ1 ), (µ2 , Σ2 )) =  h i X  2 inf E kX − Y k ∼ γ, Y  γ ∈ G((µ1 , Σ1 ), (µ2 , Σ2 )) =     Σ1 K 2 + kµ1 − µ2 k + Tr (Σ1 ) + Tr (Σ2 ) − 2 sup Tr (K) | ∈ Sym (2n) K ∗ Σ2 K Actually, because of the bound of Eq. (31), the set G((µ1 , Σ1 ), (µ2 , Σ2 )) is compact and the inf is attained. It is easy to verify that the relation s  h  i X  2 (34) G((µ1 , Σ1 ), (µ2 , Σ2 )) = min E kX − Y k | ∼ γ, γ ∈ G((µ1 , Σ1 ), (µ2 , Σ2 )) Y defines a distance on the space Gn ≃ Rn × Sym+ (n). Observe that the symmetry of G is clear as well as the triangle inequality, by considering Gaussian distributions on Rn × Rn × Rn with given marginals. To conclude, assume that the min is reached at some γ. Then i h (35) 0 = G((µ1 , Σ1 ), (µ2 , Σ2 )) = Eγ |X − Y |2 ⇔ µ1 = µ2 and Σ1 = Σ2 . A further observation is that distance G is homogeneous i.e., (36) G((λµ1 , λ2 Σ1 ), (λµ2 , λ2 Σ2 )) = λG((µ1 , Σ1 ), (µ2 , Σ2 )), λ≥0. 8 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE 3.2. Computing the quadratic dissimilarity index. We will present a proof as given by Dowson and Landau [11], but with some corrections. Given Σ1 , Σ2 ∈ Sym+ (n), each admissible K’s in (33) belongs to a compact set of M(n) thanks to bound (31), so the maximum of the function 2 Tr (K) is reached. Therefore, we are led to study:  α(Σ1 , Σ2 ) = max 2 Tr (K)   K∈M(n)    subject to (37)      Σ1 K   Σ= ∈ Sym+ (2n) K ∗ Σ2 Similarly, the value of the min problem will be denoted by β(Σ1 , Σ2 ). Proposition 3.1. 1. Let Σ1 , Σ2 ∈ Sym+ (n). Then    1/2 1/2 1/2 Σ1 Σ2 Σ1 (38) α(Σ1 , Σ2 ) = 2 Tr and β(Σ1 , Σ2 ) = −α(Σ1 , Σ2 ) . 2. If moreover det (Σ1 ) > 0, then (39)   α(Σ1 , Σ2 ) = 2 Tr (Σ1 Σ2 )1/2 . Proof. 1. The lengthy proof is gathered in a final App. 9.1. 2. From Eq. (9) we obtain          1/2 1/2 1/2 1/2 1/2 1/2 1/2 −1/2 Σ1 Σ2 Σ1 Tr = Tr Σ1 Σ1 Σ2 Σ1 Σ1 (40) = Tr (Σ1 Σ2 )1/2 . i h The following result enables us to find easily the exact lower and upper bounds of E kX − Y k2 . Proposition 3.2. Let X, Y be multivariate Gaussian random variables taking values in Rn and having means µ1 and µ2 and dispersion matrices Σ1 and Σ2 respectively. Then     i h 1/2 1/2 1/2 2 kµ1 − µ2 k + Tr Σ1 + Σ2 − 2 Σ1 Σ2 Σ1 ≤ E kX − Y k2 ≤     1/2 1/2 1/2 2 kµ1 − µ2 k + Tr Σ1 + Σ2 + 2 Σ1 Σ2 Σ1 . If det Σ1 6= 0, then the extremal values are attained at the joint distribution of   X (41) ∼ µ2 ± T (X − µ1 )         µ1 µ1 Σ1 ±(Σ2 Σ1 )1/2 Σ1 ±T Σ1 , , , = N2n N2n µ2 µ2 ±Σ1 T Σ2 ±(Σ1 Σ2 )1/2 Σ2 respectively, where T ∈ Sym+ (n) is the solution to the Riccati equation T Σ1 T = Σ2 . WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 9 Proof. From Proposition 3.1 and Eq. (33), it follows    i h 1/2 1/2 1/2 2 2 Σ1 Σ2 Σ1 min kX − Y k = kµ1 − µ2 k + Tr (Σ1 ) + Tr (Σ2 ) − 2 Tr ,     i h 1/2 1/2 1/2 Σ1 Σ2 Σ1 max kX − Y k2 = kµ1 − µ2 k2 + Tr (Σ1 ) + Tr (Σ2 ) + 2 Tr . To check the extremal points it suffices to observe that, in view of relation (8):        −1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 (42) Tr (T Σ1 ) = Tr Σ1 Σ1 Σ2 Σ1 Σ1 Σ2 Σ1 Σ1 = Tr . Hence it is verified that the extremal values are attained at Y = µ2 ± T (X − µ1 ). In the second form of the distribution we are using Eq. (10) and Eq. (11). The fact that the Gini dissimilarity is a distance which makes Rn × Sym+ (n) a metric space is formally claimed in the next Proposition. Proposition 3.3. The relation (43) G ((µ1 , Σ1 ), (µ2 , Σ2 )) = s 2  kµ1 − µ2 k + Tr Σ1 + Σ2 − 2 defines a distance on Rn × Sym+ (n).   1/2 1/2 1/2 Σ1 Σ2 Σ1   Let us now find the geodesics in the metric space Rn × Sym++ (n) , G . Proposition 3.4. The geodesic from (µ1 , Σ1 ) to (µ2 , Σ2 ), with (µ1 , Σ1 ), (µ2 , Σ2 ) ∈ Rn × Sym++ (n), is the curve Γ : [0, 1] ∋ t 7→ (µ(t), Σ(t)) , (44) where µ(t) = (1 − t)µ1 + tµ2 and (45) Σ(t) = ((1 − t)I + tT )Σ1 ((1 − t)I + tT ) =   (1 − t)2 Σ1 + t2 Σ2 + t(1 − t) (Σ1 Σ2 )1/2 + (Σ2 Σ1 )1/2 , and T is the (unique) non-negative definite solution to the Riccati equation T Σ1 T = Σ2 . Proof. See Appendix A few remarks are of order. 1. Clearly Proposition 3.4 still holds under the only assumption that Σ1 is not singular. 2. The definition of geodesic in metric spaces we use here is related to Merger convexity property, see [24, p. 78]. A stronger definition requires the proportionality of the distance between couple of points on the curve, i.e., (46) G (Γ(s), Γ(t)) = |t − s| G (Γ(0), Γ(1)) , for s, t ∈ [0, 1]. It will be proved later that in fact our geodesic enjoy such a stronger property. 3. The discussion above excludes the case of degenerate distributions. Some further comments are gathered in Appendix. 10 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE 4. Wasserstein Riemannian geometry. We have seen how to compute the geodesic for the distance given by the Gini dissimilarity. Since the component Rn carries the standard Euclidean geometry, we focus on the geometry of the matrix part i.e., we shall restrict our analysis to 0-mean distributions Nn (0, Σ). Moreover, we assume Σ to be positive definite. The purpose of this section is to endow the open set Sym++ (n) with a structure of Riemannian manifold by deriving a metric whose distance is equal to the Wasserstein distance. The Riemannian metric is obtained by pushing forward the Euclidean geometry of square matrices to the space of dispersion matrices via the mapping σ : A 7→ AA∗ = Σ, cf. [26]. In view of Prop. 2.1, the mapping σ : GL(n) → Sym++ (n) ⊂ M(n), is a submersion, the space Sym⊥ (n) (A∗ )−1 is the space of the vertical vectors at A, and the space HA = Sym (n) A is the set of horizontal vectors at A. We recall that a submersion f : GL(n) → Sym++ (n) is called Riemannian if for all A the differential restricted to horizontal vectors df (A) : HA → Tf (A) Sym++ (n) is an isometry i.e., (47) U, V ∈ HA ⇒ hdf (A)[U ], df (A)[V ]if (A) = hU, V i . A linear isometry is always 1-to-1 and, if it is onto, we can write backward that  −1  −1  ++ Y . X, df (A)|HA df (A)|HA (48) X, Y ∈ Tf (A) Sym (n) ⇒ hX, Y if (A) = A Riemannian submersion preserves the length of curves. Let [0, 1] ∋ t 7→ γ(t) be a smooth curve in H and consider its image [0, 1] ∋ t 7→ f (γ(t)). The velocity of the image is t 7→ df (γ(t))[γ̇(t)] and its length is Z 1 Z 1 dt kdf (γ(t))[γ̇(t)]kf (γ(t)) = dt kγ̇(t)kH (49) 0 0 Fix a matrix A ∈ GL(n) such that σ(A) = AA∗ = Σ, and consider the open convex cone ++ = Sym++ (n) A ⊂ HA . HA (50) ++ of σ. We denote by σA the restriction to HA Proposition 4.1. The mapping ++ ∋ B 7→ BB ∗ = C ∈ Sym++ (n) σA : H A (51) is globally invertible, the solution to σA (B) = C being B = C −1/2 (C 1/2 ΣC 1/2 )1/2 C −1/2 A . (52) Proof. For each C ∈ Sym++ (n), the equation (53) C = BB ∗ = (BA−1 A)(BA−1 A)∗ = (BA−1 )Σ(BA−1 )∗ is a Riccati equation for BA−1 . As B ∈ Sym++ (n) A, we have BA−1 ∈ Sym++ (n) and (54) is the unique solution. BA−1 = C −1/2 (C 1/2 ΣC 1/2 )1/2 C −1/2 WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 11 We come now to the point, i.e., the construction of a metric based on horizontal vectors at a given point. Proposition 4.2. The scalar product (55) hU, V iΣ ≡ WΣ (U, V ) = Tr [LΣ [U ]ΣLΣ [V ]] , U, V ∈ Sym (n) , is the isometric push-forward through the map σ : A 7→ AA∗ = Σ of the metric on the set of nonsingular symmetric matrices . Proof. Let X ∈ M(n) and consider the decomposition of X = XV +XH with XV vertical at A and XH horizontal at A. Then dσ(A)[X] = dσ(A)[XH ] and the restriction of the derivative dσ(A) to the vector space HA of horizontal vectors at A is 1-to-1 onto the tangent space of Sym++ (n) at AA∗ , that is, Sym (n). For such a restriction, we have, for each H ∈ HA , U = dσ(A)[H] = HA∗ + AH ∗ = HA−1 AA∗ + A(HA−1 A)∗ = (HA−1 )AA∗ + AA∗ (HA−1 )∗ = (HA−1 )AA∗ + AA∗ (HA−1 ) , so that the inverse mapping of the restriction is given by −1  (U ) = LAA∗ [U ]A , (56) H = dσ(A)|HA Let us push-forward the inner product from HA to TAA∗ Sym++ (n). From Eq. (56), we have WAA∗ (U, V ) =  dσ(A)|HA −1  −1  (V ) = (U ), dσ(A)|HA hLAA∗ [U ]A, LAA∗ [V ]Ai = Tr (LAA∗ [U ]AA∗ LAA∗ [V ]) . which depends on AA∗ = Σ only. There is a tensorial form of Wasserstein Riemannian metric which is useful because it represents the bilinear form of the metric in the standard scalar product. Proposition 4.3. It holds (57) WΣ (U, V ) = 1 1 Tr (LΣ [U ]V ) = hLΣ [U ], V i ≡ hLΣ [U ], V i2 . 2 2 Proof. We have (58) Tr (LΣ [U ]ΣLΣ [V ]) = Tr (LΣ [V ]ΣLΣ [U ]) = Tr (LΣ [U ]LΣ [V ]Σ) , and, taking the semi-sum of the first and the last term of the previous equation, (59) WΣ (U, V ) = 1 1 Tr {LΣ [U ] [LΣ [V ]Σ + ΣLΣ [V ]]} = Tr {LΣ [U ]V } , 2 2 where the last line follows from Eq. (13). 12 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE We have shown the existence of a metric geodesic for the Wasserstein distance, connecting a pair of matrices Σ1 , Σ2 ∈ Sym++ (n). We now show that the same curve is the Wasserstein Riemannian geodesic. Recall that the symmetric matrix −1/2 (60) T = Σ1 1/2 1/2 −1/2 (Σ1 Σ2 Σ1 )1/2 Σ1 . is the unique solution in Sym+ (n) of the Riccati equation T Σ1 T = Σ2 . Note further that det (T ) = det (Σ2 )1/2 det (Σ1 )−1/2 > 0. (61) Proposition 4.4. The parametric curve t 7→ Σ(t) = ((1 − t)I + tT )Σ1 ((1 − t)I + tT ) ∈ Sym++ (n) (62) is the unique Wasserstein Riemannian geodesic from Σ1 to Σ2 . 1/2 Proof. Set A1 = Σ1 1/2 and A2 = T Σ1 . We have 1/2 ++ A1 , A2 ∈ H++ (n) Σ1 . 1/2 = Sym (63) Σ1 1/2 1/2 Actually, A1 = IΣ1 and A2 = T Σ1 , with I, T ∈ Sym++ (n). Consequently, the straight line from A1 to A2 , t 7→ A(t) = (1 − t)A1 + tA2 ∈ H++ 1/2 , (64) Σ1 t ∈ [0, 1] , ∗ = Σ(t) is the geodesic for the Wasserstein lies in H++ 1/2 . As a consequence, t 7→ A(t)A(t) Σ1 Riemannian metric connecting Σ1 to Σ2 = A(1)A(1)∗ . This way, we get the curve (65) t 7→ Σ(t) = A(t)A(t)∗ = (I + t(T − I))Σ1 (I + t(T − I)) ∈ Sym++ (n) that agrees with Eq. (44). 5. Wasserstein Riemannian exponential. We aim now at reformulating Riemannian geodesic in terms of the exponential map. In other words, the purpose is that of writing the geodesic arc passing through a given point and having a given velocity at the point itself. The velocity of the geodesic (62): (66) Σ̇(t) = (T − I)Σ1 + Σ1 (T − I) + 2t(T − I)Σ1 (T − I) is affine in t. In particular, its initial velocity is (67) Σ̇(0) = (T − I)Σ1 + Σ1 (T − I). By inverting Lyapunov equation (67), we get T − I = LΣ(0) [Σ̇(0)]. Therefore, (68) Σ(t) = Σ(0) + t [(T − I)Σ(0) + Σ(0)(T − I)] + t2 (T − I)Σ(0)(T − I) = Σ(0) + tΣ̇(0) + t2 LΣ(0) [Σ̇(0)]Σ(0)LΣ(0) [Σ̇(0)] . We are so led to the following definition (see [1, p. 101–102]). WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 13 Definition 5.1. For any C ∈ Sym++ (n) and V ∈ Sym (n) ≃ TC Sym++ (n), the Wasserstein Riemannian exponential is (69) ExpC (V ) = C + V + LC [V ]CLC [V ] = (LC [V ] + I)C(LC [V ] + I) , Next proposition lists some properties of the Riemannian exponential. Proposition 5.2. 1. All geodesics emanating from a point C ∈ Sym++ (n) are of the form Σ(t) = ExpC (tV ), with t ∈ JV , where JV is the open interval about the origin:  (70) JV = t ∈ R : I + tLC [V ] ∈ Sym++ (n) . 2. The map V 7→ ExpC (V ) , restricted to the open set  (71) Θ = V ∈ Sym (n) : I + LC [V ] ∈ Sym++ (n) , is a diffeomorphism of Θ into Sym++ (n) with inverse LogC (B) = (BC)1/2 + (CB)1/2 − 2C ; (72) 3. The derivative of the Riemannian exponential is (73) dX (V 7−→ ExpC (V )) = X + LC [X]CLC [V ] + LC [V ]CLC [X] . Remark 5.3. Clearly, 0 ∈ JV . Moreover, the interval JV is unbounded from the right, i.e., it is of the kind JV = (t̄, +∞), provided V ∈ Sym+ (n). Likewise, JV = (−∞, t̄), if V ∈ Sym− (n). Similarly, Θ is an open set containing the origin and so V 7→ ExpC (V ) is a local diffeomorphism around the origin. Since the geodesics are not defined for all the values of the parameter t ∈ R, we infer that the Riemannian manifold Sym++ (n) is geodesically incomplete. Of course this is not a surprising fact: Sym++ (n) is not a complete metric space, and hence Hopf-Rinow theorem implies that it cannot be geodesically complete (see [10]). Proof of Prop. 5.2. 1. Let (74) Σ (t) = ExpC (tV ) = C + tV + t2 LC [V ]CLC [V ], t ∈ JV . Clearly, Σ(0) = C and Σ̇(0) = V . Pick a scalar t̄ ∈ JV and consider the two matrices Σ (0) and Σ (t̄) belonging to the curve Σ. Introduce the new parametrization Σ̃ (τ ) = Σ (τ t̄), so that Σ̃ (0) = Σ (0) and Σ̃ (1) = Σ (t̄). We have, (75) Σ̃ (τ ) = C + τ t̄V + τ 2 t̄2 LC [V ] CLC [V ] . By the relation (13) and setting T − I = t̄LC [V ], the equation above becomes (76) Σ̃ (τ ) = C + t̄τ LC [V ] C + t̄τ CLC [V ] + t̄2 τ 2 LC [V ] CLC [V ] (77) = C + τ (T − I)C + τ C(T − I) + τ 2 (T − I)C(T − I) = T CT (78) = [(1 − τ ) I + τ T ] C [(1 − τ ) I + τ T ] . 14 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE On the other hand, t̄ ∈ JV implies T = I + t̄LC [V ]) ∈ Sym++ (n). Moreover, Σ̃ (1) = T CT = T Σ̃ (0) T. In view of Eq. (62), the curve Σ(t) = ExpC (tV ), with t ∈ [0, t̄] (or [t̄, 0]) is a portion of the geodesic Σ(t), t ∈ JV . 2. By Eq. (69) the solution to Riccati equation ExpC (V ) = (I + LC [V ])C(I + LC [V ]) = B (79) is I + LC [V ] = C −1/2 (C 1/2 BC 1/2 )1/2 C −1/2 (80) provided I + LC [V ] ∈ Sym++ (n). This is true in a sufficiently small neighborhood kV k < r of the origin. The inversion of the operator LC [·] and Eq. (9) provide the desired formula for LogC (B). 3. The derivative follows from a simple bilinear computation. 6. Natural gradient. Let us first study the second order approximation of the matrix function in Eq. (2). For a given Σ ∈ Sym++ (n), let H ∈ Sym (n) such that (Σ ± H) ∈ Sym++ (n). It follows that Σ + θH ∈ Sym++ (n) for all θ ∈ [−1, +1]. Consider the divergence in Eq. (2) with µ1 = µ2 = 0, Σ1 = Σ, Σ2 = Σ + θH, and the parametric function  2  (81) θ 7→ G (Σ, Σ + θH) = Tr Σ + (Σ + θH) − 2 Σ 1/2 1/2 1/2  (Σ + θH)Σ =  1/2  2 1/2 1/2 Σ + θΣ HΣ . 2 Tr (Σ) + θ Tr (H) − 2 Tr By Eq. (15) and Eq. (18), the first derivative is (82)  i h d 2 1/2 1/2 G (Σ, Σ + θH) = Tr (H) − 2 Tr L 2 HΣ = 1/2 Σ (Σ +θΣ1/2 HΣ1/2 ) dθ   −1/2  1/2 1/2 2 1/2 1/2 Σ HΣ Σ + θΣ HΣ . Tr (H) − Tr Observe that (83) G2 (Σ, Σ + θH) θ=0 = d 2 G (Σ, Σ + θH) dθ =0, θ=0 and by derivation of the composed function, we find d2 2 G (Σ, Σ + θH) = (84) 2  dθ −1/2 Σ2 + θΣ1/2 HΣ1/2 L Tr (Σ2 +θΣ1/2 HΣ1/2 ) 1/2 h Σ 1/2 HΣ 1/2  −1/2  i 1/2 1/2 2 1/2 1/2 Σ HΣ Σ + θΣ HΣ , WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 15 so that (85) d2 2 G (Σ, Σ + θH) dθ 2 θ=0  i h  = Tr Σ−1 LΣ Σ1/2 HΣ1/2 Σ−1 Σ1/2 HΣ1/2 = i  h  Tr Σ−1/2 LΣ Σ1/2 HΣ1/2 Σ−1/2 H = Tr (LΣ [H] H) , where Eq. (17) is used. Finally, we have shown that (86) G2 (Σ, Σ + θH) = θ2 Tr (LΣ [H] H) + o(θ 2 ) . 2 This equation confirms that the form of the Riemannian metric associated to Wasserstein distance is the metric that has been introduced above. In addition, the solution to the problem (87)   max f (X + H) − f (X) subject to   2 G (X, X + H) = ε (small and fixed) allows the identification of the direction of the maximal increase of the function f as the natural gradient, according to the name introduced by Amari [3], i.e., the Riemannian gradient as defined below. The Riemannian gradient is the gradient with respect to the scalar product of the metric. We denote by ∇ the gradient with respect to the scalar product h·, ·i2 and by grad the gradient with respect to the Riemannian metric. By Prop. 4.3 WΣ (X, Y ) = hLΣ [X] , Y i2 , hence for each smooth scalar field φ we have (88) grad φ(Σ) = L−1 Σ [∇φ(Σ)] = ∇φ(Σ)Σ + Σ∇φ(Σ) , where the second equality follows from Eq. (14). Conversely, (89) LΣ [grad φ(Σ)] = ∇φ(Σ) . The gradient flow of a smooth scalar field φ is the flow generated by the vector field γ 7→ (γ, − grad φ(γ)), that is, the flow of the differential equation (90) γ̇(t) = − grad φ(γ(t)) = − (∇φ(γ(t))γ(t) + γ(t)∇φ(γ(t))) . In Appendix Sec. 9.4 two relevant examples of gradient flow are presented. 7. Second order geometry. Recall that Sym++ (n) as an open set of the Hilbert space Sym (n), endowed with the scalar product hX, Y i2 = 12 Tr (XY ). We have shown in Prop. 4.3 that the Wasserstein Riemannian metric W is expressed in terms of the scalar product of Sym (n) by (91) WΣ (X, Y ) = hX, Y iΣ = hLΣ [X] , Y i2 , 16 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE for each (Σ, X) and (Σ, Y ) in the trivial tangent bundle T Sym++ (n) ≃ Sym++ (n) × Sym (n). In the equation above, L : Sym++ (n) 7→ L(Sym (n) , Sym (n)) is the operator defining the Wasserstein metric the standard scalar product. In the trivial chart, a smooth vector field X is a smooth mapping X : Sym++ (n) → Sym (n). The action of the vector field X on the scalar field f that is, Xf , is expressed in the trivial chart by dX f , i.e., the scalar field whose value at point Σ is the derivative of f in the direction X(Σ). Similarly, dY X denotes the vector field whose value at point Σ is the derivative at Σ of X in the direction Y (Σ). The Lie bracket [X, Y ] of two smooth vector fields X, Y is expressed by dX Y − dY X. 7.1. The moving frame. While we prefer to express our computation in matrix algebra, in some cases it may be useful to employ a vector basis. We discuss below a field of vector bases of particular interest. The set of symmetric matrices E p,q = ep e∗q + eq e∗p , (92) p, q = 1, . . . , n , ep being the p-th element of the standard basis of Rn , spans the vector space Sym (n). To avoid repeated elements, a unique enumeration is obtained by taking the set A of the parts of {1, . . . , n} having 1 or 2 elements. This generating set is related to the product of matrices by the equation (93) E p,q E r,s + E r,s E p,q = δq,r E p,s + δq,s E p,r + δp,r E q,s + δp,s E q,r , where δ is the Kronecker symbol. In particular, if we take the trace of the equation above, we get (94) hE p,q , E r,s i = δp,r δq,s + δp,s δq,r , which in turn implies (95)  6 {r, s},  0 if {p, q} = p,q r,s hE , E i = 1 if {p, q} = {r, s} and p 6= q,   2 if {p, q} = {r, s} and p = q We can select an orthogonal basis by deleting the repeated elements. In the sequel, we denote by (E α )α∈A the vector basis above, properly normalized to obtain an orthonormal basis. We do not show the normalising constants in order to simplify the notation. For each Σ ∈ Sym++ (n) the sequence (96) E α (Σ) = E α Σ + ΣE α , α∈A, is a vector basis of Sym (n) ≃ TΣ Sym++ (n), because it is the image of a vector basis under a linear mapping which is onto. We will call such a sequence of vector fields the (principal) moving frame. WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 17 Notice the following properties: E α = dE α Σ2 ; LΣ [E α (Σ)] = E α ; E α (I) = 2E α . At a generic point Σ, we can express each E α in the (E β )β ’s orthonormal basis as (97) E α (Σ) = X 2gα,β (Σ)E β , β   gα,β (Σ) = Tr E α ΣE β , which is verified by right-multiplying Eq. (96) by E γ and taking the trace of the resulting equation. Since  h i   (98) WΣ (E α , E β ) = Tr LΣ [E α (Σ)] ΣLΣ E β (Σ) = Tr E α ΣE β , the matrix [gα,β ]α,β is the expression of the Riemannian metric in such a moving P frame. α In fact, if X, Y are vector fields expressed in the moving frame as, X = α xα E , Y = P β β yβ E , then (99) WΣ (X, Y ) = X α,β  xα (Σ)yβ (Σ)gα,β (Σ) = Tr  X xα (Σ)E α α !  Σ X β  yβ (Σ)E β  . This expression of the scalar product is to be compared to that used in [26]. In this way, any vector field X has two representations: one with respect to the moving frame (E α )α and another one with respect to the basis (E α )α . These two representations are related to each other as follows. We have ! X X X X X (100) X= xα E α = xα 2gα,β E β = 2xα gα,β E β , α α β β α so that (101) X X 1 xα gα,β hX, E γ i2 = Tr (XE γ ) = 2 α β !  X  xα gα,γ , Tr E β E γ = α hence, by applying the inverse matrix [gα,β (Σ)] = [gα,β (Σ)]−1 , we have (102) xα = X g α,γ hX, E γ i2 . γ For example, LΣ [V ] = (103) ℓαΣ (V ) = P α α ℓΣ (V X γ )E α (Σ), with gα,γ (Σ) hLΣ [V ] , E γ i2 = WΣ (V, X γ gα,γ E γ ) . 18 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE 7.2. Covariant derivatives. For a couple of vector fields X, Y , denote by DY X the action of a covariant derivative, namely, a bilinear operator satisfying, for each scalar field f , (CD1) Df Y X = f DY X , (CD2) DY (f X) = dY f X + f DY X . see e.g [10, Sect. 3] or [17, Ch. 8.4]. A convenient way to express a covariant derivative in the moving frame (96) is to define the Christoffel symbols DE α E β = (104) X Γγα,β E γ , γ P yβ E β , by using (CD1), (CD2), and Eq. (97), we obtain   X X  = (105) DX Y = xα DE α (yβ E β ) = xα (dE α yβ ) E β + yβ DE α E β If X = α xα E α P α,β and Y = X α,γ β α,β xα dE α yγ E γ + X α,β,γ P yβ Γγα,β E γ = XX γ α,β   xα dE α yγ + yβ Γγα,β E γ . The scalar product of DX Y and Z = δ zδ E δ is   X (106) hDX Y, ZiΣ = xα dE α yγ + yβ Γγα,β gδ,γ zδ . α,β,γ,δ 7.3. Levi-Civita derivative. The Levi-Civita (covariant) derivative of a vector field, is the unique covariant derivative D that, for all vector fields X, Y, Z, is (LC1) compatible with the metric, i.e., dX W (Y, Z) = W (DX Y, Z) + W (Y, DX Z) (LC2) torsion-free, DY X − DX X = [X, Y ] = dY X − dX Y . Lang [17, Ch. 8.4] in his statement MD3 provides an equation to compute the LeviCivita derivative without introducing any base in the vector space of coordinates. We use his formalism but we talk about Cristoffel symbols that is, minus the spray in Lang’s language. This allows us to write the differential equation of the parallel transport without resorting to a vector basis. In order to have a compact notation, it will be convenient to write the symmetrized of a matrix A ∈ M (n) as {A}S = 21 (A + A∗ ). If either A or B is symmetric, then Tr ({A}S B) = Tr (AB). We denote by X, Y, Z smooth vector fields on Sym++ (n). We shall use repeatedly the expression for the derivative of the vector field Σ 7→ LΣ [X]. In view of Eq. 21 and our notation for the symmetrization, it holds dY LΣ [X] = −2LΣ [{LΣ [X] Y }S ] . (107) Proposition 7.1. The Levi-Civita derivative DX Y is implicitly defined by (108) hDX Y, ZiΣ = hdX Y, ZiΣ + hX, {LΣ [Y ] Z}S iΣ − hX, {LΣ [Z] Y }S iΣ − hY, {LΣ [Z] X}S iΣ = 1 1 1 hdX Y, ZiΣ + Tr (LΣ [X] ZLΣ [Y ]) − Tr (LΣ [X] Y LΣ [Z]) − Tr (LΣ [Y ] XLΣ [Z]) , 2 2 2 WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 19 while the Levi-Civita derivative itself is given by (109) DX Y = dX Y − {LΣ [X] Y + LΣ [Y ] X}S + {ΣLΣ [X] LΣ [Y ] + ΣLΣ [Y ] LΣ [X]}S . Proof. In our case, Eq. MD3 of [17, p. 205] becomes (110) 2 hDX Y, LΣ [Z]i2 = 2 hdX Y, LΣ [Z]i2 + hY, dX LΣ [Z]i2 + hX, dY LΣ [Z]i2 − hX, dZ LΣ [Y ]i2 . By Eq. (21) we have hY, dX LΣ [Z]i2 = −2 hY, LΣ [{LΣ [Z] X}S ]i2 = −2 hY, {LΣ [Z] X}S iΣ , (111) and, analogously, (112) hX, dY LΣ [Z]i2 = −2 hX, {LΣ [Z] Y }S iΣ , hX, dZ LΣ [Y ]i2 = −2 hX, {LΣ [Y ] Z}S iΣ . This way, Eq. (110) becomes the first part of Eq. (108). The second part of Eq. (108) is then easily obtained. For instance, hX, {LΣ [Z]}S iΣ = (113) 1 1 Tr (LΣ [X] {ZLΣ [Y ]}S ) = Tr (LΣ [X] ZLΣ [Y ]) . 2 2 Regarding the explicit formula of the Levi-Civita derivative (109), observe that (114) 1 1 1 Tr (LΣ [X] ZLΣ [Y ]) = Tr (LΣ [Y ] LΣ [X] Z) = Tr ({LΣ [X] LΣ [Y ]}S Z) = 2 2 2 1 Tr (LΣ [{LΣ [X] LΣ [Y ]}S Σ + Σ {LΣ [X] LΣ [Y ]}S ] Z) = 2 h{LΣ [X] LΣ [Y ]}S Σ + Σ {LΣ [X] LΣ [Y ]}S , ZiΣ = h{ΣLΣ [X] LΣ [Y ]}S + {ΣLΣ [Y ] LΣ [X]}S , ZiΣ = h{ΣLΣ [X] LΣ [Y ] + ΣLΣ [Y ] LΣ [X]}S , ZiΣ . Moreover, (115) 1 1 Tr (LΣ [X] Y LΣ [Z]) + Tr (LΣ [Y ] XLΣ [Z]) = 2 2 1 Tr ({LΣ [X] Y + LΣ [Y ] X}S LΣ [Z]) = h{LΣ [X] Y + LΣ [Y ] X}S , ZiΣ . 2 Therefore, Eq. (108) can be written as (116) hDX Y, ZiΣ = hdX Y − {LΣ [X] Y + LΣ [Y ] X}S + {ΣLΣ [X] LΣ [Y ] + ΣLΣ [Y ] LΣ [X]}S , ZiΣ , and the desired result obtains. The equation we have used for computing the Levi-Civita derivative is proved in the given reference. However, we have included in Sec. 10 a direct check. 20 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE 7.4. Levi-Civita derivative in the moving frame. Let us express the Levi-Civita derivative in the moving frame (96). Consider the vector field X(Σ) = E α (Σ) = E α Σ + ΣE α and the vector field Y (Σ) = E β (Σ) = E β Σ + ΣE β . By Eq. (109), we have (117) DE α E β = o h i h i n h i o n dE α E β − LΣ [E α ] E β + LΣ E β E α + ΣLΣ [E α ] LΣ E β + ΣLΣ E β LΣ [E α ] S S . We are going to compute one by one the three terms in the equation above. The first term in Eq. (117) is (118) dE α E β = d(E α Σ+ΣE α ) (E β Σ + ΣE β ) = E β (E α Σ + ΣE α ) + (E α Σ + ΣE α )E β = E β E α Σ + E β ΣE α + E α ΣE β + ΣE α E β . The second one is (119) n o h i o n = − E α (E β Σ + ΣE β ) + E β (E α Σ + ΣE α ) − LΣ [E α ] E β + LΣ E β E α = S S o n − E α E β Σ + E α ΣE β + E β E α Σ + E β ΣE α = S     1 − E α E β Σ + E β E α Σ + ΣE β E α + ΣE α E β − E α ΣE β + E β ΣE α . 2 The sum is (120) The third term is (121) n  1  1 β α E E Σ + ΣE α E β − E α E β Σ + ΣE β E α . 2 2 o o h i n h i = ΣE α E β + ΣE β E α = ΣLΣ [E α ] LΣ E β + ΣLΣ E β LΣ [E α ] S S  1 ΣE α E β + ΣE β E α + E β E α Σ + E α E β Σ . 2 In conclusion, (122) DE α E β = E β E α Σ + ΣE α E β . P The computation of the Christoffel symbols γ Γσα,β E γ = DE α E β would require the solution of the equations X γ (123) E β E α Σ + ΣE α E β = Γα,β (Σ) (E γ Σ + ΣE γ ) . γ We do not do that here. WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 21 Instead, let us take now X = xα E α and Y = yβ E β . From the properties (CD1) and (CD2), we have   (124) D(xα E α ) (yβ E β ) = xα DE α (yβ E β ) = xα dE α yβ E β + yβ DE α E β =   xα dE α yβ E β + xα yβ E β E α Σ + ΣE α E β . Finally, for general X and Y ,   X X (125) DX Y = xα dE α yβ E β + xα yβ E β E α Σ + ΣE α E β . α,β α,β 7.5. Parallel transport. The expression of the Levi-Civita derivative in Eq. (108) can be re-written as hDX Y, ZiΣ = hdX Y, ZiΣ + hΓ(Σ; X, Y ), ZiΣ , (126) where Γ(Σ; ·, ·) is the symmetric tensor field defined by (127) hΓ(Σ; X, Y ), ZiΣ = 1 1 1 Tr (LΣ [X] ZLΣ [Y ]) − Tr (LΣ [X] Y LΣ [Z]) − Tr (LΣ [Y ] XLΣ [Z]) = 2 2 2 1 1 Tr (LΣ [Y ] LΣ [X] Z) − Tr ((LΣ [X] Y + LΣ [Y ] X) LΣ [Z]) = 2 2 1 1 Tr (LΣ [Y ] LΣ [X] (LΣ [Z] Σ + ΣLΣ [Z])) − Tr ((LΣ [X] Y + LΣ [Y ] X) LΣ [Z]) = 2 2 1 Tr ((ΣLΣ [Y ] LΣ [X] + LΣ [Y ] LΣ [X] Σ − LΣ [X] Y − LΣ [Y ] X) LΣ [Z]) = 2 h{ΣLΣ [Y ] LΣ [X] + LΣ [Y ] LΣ [X] Σ − LΣ [X] Y − LΣ [Y ] X}S , ZiΣ . We have (128) Γ(Σ; X, Y ) = {ΣLΣ [Y ] LΣ [X] + LΣ [Y ] LΣ [X] Σ − LΣ [X] Y − LΣ [Y ] X}S , and, on the diagonal, (129) Γ(Σ; X, X) = ΣLΣ [X] LΣ [X] + LΣ [X] LΣ [X] Σ − LΣ [X] X − XLΣ [X] . Γ(Σ; X, Y ) is the expression in the trivial chart of the Christoffel symbol of the Levi-Civita derivative as in [16]. In [17], −Γ is called the spray of the Levi-Civita derivative. Given the Christoffel symbol, we can write the linear differential equation of the parallel transport along a curve t 7→ Σ(t) as ( U̇V (t) + Γ(Σ(t); Σ̇(t), UV (t)) = 0 , (130) UV (0) = V , see [17, VIII, §3 and §4]. Recall that the parallel transport for the Levi-Civita derivative is isometric. 22 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE We do not discuss here the representation in the moving frame of Eq. (130). We limit ourselves to mention that the action of the Christoffel symbol on vector fields expressed in the moving frame can be computed from (131) Γ(Σ; E α , E β ) = h i o h i h i n = ΣLΣ E β LΣ [E α ] + LΣ E β LΣ [E α ] Σ − LΣ [E α ] E β − LΣ E β E α S n o ΣE β E α + E β E α Σ − E α (E β Σ + ΣE β ) − E β (E α Σ + ΣE α ) = S o n ΣE β E α + E β E α Σ − E α E β Σ − E α ΣE β − E β E α Σ − E β ΣE α = α S β − (E ΣE + E β ΣE α ) . 7.6. Riemannian Hessian. According to [1, Def. 5.5.1] and [10, p. 141], the Riemannian Hessian of a smooth scalar field φ : Sym++ (n) → R, is the Levi-Civita covariant derivative of grad φ, namely, for each vector field X, it is the vector field HessX φ whose value at Σ is (132) HessX φ(Σ) = DX (grad φ)(Σ) = DX (∇φ(Σ)Σ + Σ∇φ(Σ)) . The associated symmetric bilinear form is (see [1, Proposition 5.5.3]) (133) Hess φ(Σ) (X, Y ) = hDX (grad φ)(Σ), Y iΣ . It is enough to compute the diagonal of the symmetric form. Therefore, letting X = Z = V in the second part of Eq. (108), we obtain Hess φ(Σ) (V, V ) = hdV Y, V iΣ + 1 1 1 Tr [LΣ [V ] V LΣ [Y ]] − Tr [LΣ [V ] Y LΣ [V ]] − Tr [LΣ [V ] V LΣ [Y ]] = 2 2 2 1 hdV Y, V iΣ − Tr [LΣ [V ] Y LΣ [V ]] , 2 where Y = grad φ (Σ). After plugging Y = grad φ (Σ) = Σ∇φ (Σ) + ∇φ (Σ) Σ into it, we get easily (134) Hess φ(Σ) (V, V ) = ∇2V φ (Σ) Σ + Σ∇2V φ (Σ) , V Σ + Tr [∇φ (Σ) V LΣ [V ]] − Tr [LΣ [V ] ∇φ (Σ) ΣLΣ [V ]] . Plugging V = LΣ [V ] Σ + ΣLΣ [V ] into the second term of the RHS, we have at last (135) Hess φ(Σ) (V, V ) = ∇2V φ (Σ) Σ + Σ∇2V φ (Σ) , V Σ + Tr [∇φ (Σ) LΣ [V ] ΣLΣ [V ]] . Relation (135) substantiates the following important property that links the Hessian to the derivative along a geodesic (see the proof of Proposition 5.5.4 of [1]). WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 23 Proposition 7.2. Let φ : Sym++ (n) → R be a smooth scalar field and define (136) ϕ (t) = φ (expΣ (tV )) . It holds (137) ϕ̈ (0) = Hess φ(Σ) (V, V ) . Proof. By Proposition 5.2 Σ(t) = ExpΣ (tV ) = Σ + tV + t2 LΣ [V ]ΣLΣ [V ] D E where Σ(0) = Σ and Σ̇(0) = V. Hence ϕ̇ (t) = ∇φ(Σ(t)), Σ̇(t) , and (138) 2 (139) At t = 0, (140) D E D E ϕ̈ (t) = ∇2 φ(Σ(t))[Σ̇(t)], Σ̇(t) + ∇φ(Σ(t)), Σ̈(t) . 2 ϕ̈ (0) = ∇2 φ(Σ)[V ], V 2 2 + 2 h∇φ(Σ), LΣ (V )ΣLΣ (V )i2 . In view of Eq. (135), (141) Hess φ(Σ) (V, V ) = ∇2V φ (Σ) , V 2 + 2 h∇φ (Σ) , LΣ [V ] ΣLΣ [V ]i = ϕ̈ (0) .  8. Conclusion. The present paper is intended to be an introduction to a research project in progress. It contains both a review of the literature and novel results. The issue of a comparison between Fisher and Wasserstein metric is not discussed as it is, for example, in Chevallier et al. [9]. It is the authors’ plan to investigate the following developments and applications. 1. Computation of the curvature tensor. 2. Numerical solution and simulation methods for the relevant equation of the geometry, namely: geodesic, parallel transport, Hessian. 3. Linear optimization method using the natural gradient as direction of increase using the Riemannian exponential as a retraction. Cf. [1] and in Amari monograph [4]. 4. Second order optimization method with the Riemannian Hessian and the Riemannian exponential. Cf. [1] and [4]. 5. Sub-manifold of the correlation matrices i.e, with unitary diagonal elements. In this case, the tangent space at each point is the space of symmetric matrices with zero diagonal. 6. Sub-manifold of trace 1 matrices. This application possibly requires the generalization to Complex Gaussians see e.g., Fassino et al. [12], and Hermitian matrices as in Bhatia et al. [7]. 7. Sub-manifold of the concentration matrices with a given sparsity pattern. In this case the Wasserstein distance interpretation is not available but see the Bhatia interpretation of the distance [7]. 24 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE REFERENCES [1] P.-A. Absil, R. Mahony, and R. Sepulchre, Optimization algorithms on matrix manifolds, Princeton University Press, 2008. With a foreword by Paul Van Dooren. [2] C. D. Aliprantis and K. C. Border, Infinite dimensional analysis, Springer, Berlin, third ed., 2006. A hitchhiker’s guide. [3] S.-I. Amari, Natural gradient works efficiently in learning, Neural Computation, 10 (1998), pp. 251–276, https://doi.org/10.1162/089976698300017746, http://dx.doi.org/10.1162/089976698300017746. [4] S.-i. Amari, Information geometry and its applications, vol. 194 of Applied Mathematical Sciences, Springer, [Tokyo], 2016, https://doi.org/10.1007/978-4-431-55978-8. [5] T. W. Anderson, An introduction to multivariate statistical analysis, Wiley Series in Probability and Statistics, Wiley-Interscience [John Wiley & Sons], Hoboken, NJ, third ed., 2003. [6] R. Bhatia, Positive definite matrices, Princeton Series in Applied Mathematics, Princeton University Press, Princeton, NJ, 2007. [7] R. Bhatia, T. Jain, and Y. Lim, On the Bures-Wasserstein distance between positive definite matrices. arXiv:1712.01504, Dec. 2017. [8] Y. Brenier, Polar factorization and monotone rearrangement of vector-valued functions, Comm. Pure Appl. Math., 44 (1991), pp. 375–417, https://doi.org/10.1002/cpa.3160440402. [9] E. Chevallier, E. Kalunga, and J. Angulo, Kernel density estimation on spaces of Gaussian distributions and symmetric positive definite matrices, SIAM J. Imaging Sci., 10 (2017), pp. 191–215, https://doi.org/10.1137/15M1053566. [10] M. P. do Carmo, Riemannian geometry, Mathematics: Theory & Applications, Birkhuser Boston Inc., 1992. Translated from the second Portuguese edition by Francis Flaherty. [11] D. C. Dowson and B. V. Landau, The Fréchet distance between multivariate normal distributions, J. Multivariate Anal., 12 (1982), pp. 450–455, https://doi.org/10.1016/0047-259X(82)90077-X, http:// dx.doi.org/10.1016/0047-259X(82)90077-X. [12] C. Fassino, G. Pistone, E. Riccomagno, and M. P. Rogantin, Moments of the multivariate Gaussian complex random variable. arXiv:170809622, Aug. 2017. [13] M. Gelbrich, On a formula for the L2 Wasserstein metric between measures on Euclidean and Hilbert spaces, Math. Nachr., 147 (1990), pp. 185–203, https://doi.org/10.1002/mana.19901470121. [14] C. R. Givens and R. M. Shortt, A class of Wasserstein metrics for probability distributions, Michigan Math. J., 31 (1984), pp. 231–240, https://doi.org/10.1307/mmj/1029003026. [15] P. R. Halmos, Finite-dimensional vector spaces, The University Series in Undergraduate Mathematics, D. Van Nostrand Co., Inc., Princeton-Toronto-New York-London, 1958. 2nd ed. [16] W. P. A. Klingenberg, Riemannian geometry, vol. 1 of De Gruyter Studies in Mathematics, Walter de Gruyter & Co., Berlin, second ed., 1995, https://doi.org/10.1515/9783110905120. [17] S. Lang, Differential and Riemannian manifolds, vol. 160 of Graduate Texts in Mathematics, SpringerVerlag, third ed., 1995. [18] J. R. Magnus and H. Neudecker, Matrix differential calculus with applications in statistics and econometrics, Wiley Series in Probability and Statistics, John Wiley & Sons, Ltd., Chichester, 1999. Revised reprint of the 1988 original. [19] L. Malagò and G. Pistone, Combinatorial optimization with information geometry: Newton method, Entropy, 16 (2014), pp. 4260–4289. [20] O. L. Mangasarian and S. Fromovitz, The Fritz John necessary optimality conditions in the presence of equality and inequality constraints, J. Math. Anal. Appl., 17 (1967), pp. 37–47, https://doi.org/10. 1016/0022-247X(67)90163-1. [21] R. J. McCann, Polar factorization of maps on Riemannian manifolds, Geom. Funct. Anal., 11 (2001), pp. 589–608, https://doi.org/10.1007/PL00001679. [22] I. Olkin and F. Pukelsheim, The distance between two random vectors with given dispersion matrices, Linear Algebra Appl., 48 (1982), pp. 257–263, https://doi.org/10.1016/0024-3795(82)90112-4. [23] F. Otto, The geometry of dissipative evolution equations: the porous medium equation, Comm. Partial Differential Equations, 26 (2001), pp. 101–174, https://doi.org/10.1081/PDE-100002243. [24] A. Papadopoulos, Metric spaces, convexity and non-positive curvature, vol. 6 of IRMA Lectures in Mathematics and Theoretical Physics, European Mathematical Society (EMS), Zürich, second ed., WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 25 2014, https://doi.org/10.4171/132. [25] V. Simoncini, Computational methods for linear matrix equations, SIAM Rev., 58 (2016), pp. 377–441, https://doi.org/10.1137/130912839. [26] A. Takatsu, Wasserstein Geometry of Gaussian measures, Osaka J. Math., 48 (2011), pp. 1005–1026. [27] E. L. Wachspress, Trail to a Lyapunov equation solver, Comput. Math. Appl., 55 (2008), pp. 1653–1659, https://doi.org/10.1016/j.camwa.2007.04.048. 26 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE 9. Appendix. 9.1. Proof of Proposition 3.1. A symmetric matrix Σ ∈ Sym (2n) is non-negative define if, and only if, it is of the form Σ = SS ∗ , with S ∈ M (2n). In our case, given the block structure of Σ in (37), we can write (142)        AA∗ AB ∗ Σ1 K A  ∗ ∗ , A B = = BA∗ BB ∗ K ∗ Σ2 B where A and B are two matrices in M(n × 2n). Therefore, problem (37) becomes (143)  α(Σ1 , Σ2 ) = max 2 Tr (AB ∗ )   A,B∈M(n×2n)  subject to    Σ1 = AA∗ , Σ2 = BB ∗ We have already observed that the optimum exists, so the necessary conditions of Lagrange theorem allows us to characterize this optimum. However, the two constraints Σ1 = AA∗ and Σ2 = BB ∗ are not necessarily regular at every point (i.e., the Jacobian of the transformation may fail to be of full rank at some point), so we must take into account that the optimum could be an irregular point. To this purpose, as a customary, we shall adopt Fritz John first-order formulation for the Lagrangian (see [20]). We shall initially assume that both Σ1 and Σ2 are non-singular. Let then (ν0 , Λ, Γ) ∈ {0, 1} × Sym (n) × Sym (n), with (ν0 , Λ, Γ) 6= (0, 0, 0), where the symmetric matrices Λ and Γ are the Lagrange multipliers. The Lagrangian function will be L = 2ν0 Tr (AB ∗ ) − Tr (ΛAA∗ ) − Tr (ΓBB ∗ ) = 2ν0 Tr (AB ∗ ) − Tr (A∗ ΛA) − Tr (B ∗ ΓB) The critical points of L lead to the following first order conditions ( ν0 B = ΛA, ν0 A = ΓB . (144) Σ1 = AA∗ , Σ2 = BB ∗ In the case ν0 = 1, i.e., the case of stationary regular points, Eq. (144) becomes ( (145) B = ΛA, A = ΓB ∗ Σ1 = AA , Σ2 = BB ∗ , which in turn implies (146) ( ΛΣ1 Λ = Σ2 ΓΣ2 Γ = Σ1 , Λ, Γ ∈ Sym (n) WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 27 and further (147) K = Σ1 Λ = ΓΣ2 . Of course, Eq.s (146) could be more general than Eq.s (145) and thus possibly contain undesirable solutions. In this light, we establish the following facts, in which both matrices Σ1 and Σ2 must be nonsingular. Notice that in this case Eq.s (146) imply that both Λ and Γ are nonsingular as well. Claim 1: If (Γ, Λ) is a solution to (146) and Λ−1 = Γ, then the couple (Γ, Λ) are Lagrange multipliers of Problem (37). Actually, let Σ1 = AA∗ , A ∈ M(n × 2n) be any representation of the matrix Σ1 . Define B = ΛA so that A = Λ−1 B = ΓB. Moreover BB ∗ = ΛAA∗ Λ = ΛΣ1 Λ = Σ2 , (148) and so (Λ, Γ) are multipliers associated with the feasible point (A, B). Claim 2: The setof solutions to (146), such that Γ−1 = Λ, is not empty. In particular, there  e Γ e where both Λ e and Γ e are positive definite. is a unique pair Λ, We have already observed that Eq.s (146) imply that Λ and Γ are nonsingular. Moreover, we have Γ−1 Σ1 Γ−1 = Σ2 . Recalling that Riccati’s equation has one and only one solution in the class of positive definite matrices, then X = Λ = Γ−1 . Now we proceed to study the solutions to ΛΣ1 Λ = Σ2 and we shall show that Eq (146) has infinitely many solutions. In correspondence to each one Λ, the value of the objective function will be given by 2 Tr (K) = 2 Tr (Σ1 Λ). Therefore, we must select the matrix Λ such that Tr (Σ1 Λ) be maximized. Following [11], we define 1/2 (149) 1/2 R = Σ1 ΛΣ1 ∈ Sym (n) , so that, in view of (146), we have (150) 1/2 1/2 1/2 1/2 R2 = Σ1 ΛΣ1 Σ1 ΛΣ1 1/2 1/2 = Σ1 ΛΣ1 ΛΣ1 1/2 1/2 = Σ1 Σ2 Σ1 ∈ Sym+ (n) . Moreover, (151)     1/2 1/2 1/2 1/2 Tr (R) = Tr Σ1 ΛΣ1 = Tr Σ1 Σ1 Λ = Tr (Σ1 Λ) = Tr (K) . Eq. (150) shows that, though the Lagrangian can have many rest points (i.e., many 1/2 1/2 solutions Λ) the matrix R2 = Σ1 Σ2 Σ1 ∈ Sym+ (n) remains constant. Not so the value of the objective function Tr (K) = Tr (R) which depends on R (i.e., on Λ). Let (152) R2 = X k λk Ek 28 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE denote the spectral decomposition of R2 , then the solutions to R will be X 1/2 (153) R= εk λk Ek k with εk = ±1. Hence Tr (K) = Tr (R) will be maximized whenever εk ≡ 1 and so R ∈ Sym+ (n). Clearly the objective function will be minimized if εk ≡ −1. From now on the proof of the min statement follows similarly. It follows that the maximum of the trace occurs at   1/2 1/2 1/2 (154) R = Σ1 Σ2 Σ1 ,   −1/2 1/2 1/2 1/2 −1/2 namely Λ = Σ1 Σ1 Σ2 Σ1 Σ1 . Thanks to Claims 1-2 this matrix is a multiplier of the Lagrangian and so we would have   1/2 1/2 1/2 (155) α (Σ1 , Σ2 ) = 2Tr Σ1 Σ2 Σ1 , as long as the optimum is attained at a regular point. In fact, to complete the proof, we must still examine the case ν0 = 0, for which Eq. (144) becomes (156) ΛA = 0, ΓB = 0 . It follows ΛΣ1 = ΛAA∗ = 0 ΓΣ2 = ΓBB ∗ = 0 , and consequently Λ = Γ = 0. Therefore there is no irregular point, provided Σ1 and Σ2 are not singular matrices. So we have proved the relation (155) under the above assumptions. Last step will be that of extending our result when the matrices Σ1 and Σ2 are not both nonsingular. Given the two matrices Σ1 , Σ2 ∈ Sym+ (n), set (157) Σ1 (ε) = Σ1 + εIn and Σ2 (ε) = Σ2 + εIn , with ε ∈ [0, 1] . If ε > 0, then (158) det (Σi + εI) = n Y (λi,j + ε) > 0, i = 1, 2 . j=1 where λi,j , j = 1, . . . , n is a set of eigenvalues of Σi , i = 1, 2. Let us consider the parametric programming problem  α(Σ1 (ε), Σ2 (ε)) = max 2 Tr (K)   K∈M(n)    subject to (159)      Σ1 (ε) K   ∈ Sym+ (2n) K ∗ Σ2 (ε) WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 29 Observe that the feasible region is contained in a compact set independent of ε ∈ [0, 1] because of the bound (31). Now the continuity of the optimal value ε 7→ α(Σ1 (ε), Σ2 (ε)) follows easily from Berge maximum theorem, see for instance [2, Th. 17.31]. Hence   1/2 1/2 (160) α(Σ1 , Σ2 ) = lim α(Σ1 (ε), Σ2 (ε)) = 2 Tr (Σ1 Σ2 Σ1 )1/2 ε→0 and the assertion is proved for any Σ1 , Σ2 ∈ Sym+ (n). 9.2. Proof of Prop. 3.4. Clearly, Γ(0) = (µ1 , Σ1 ) and Γ(1) = (µ2 , Σ2 ). Let us compute the distance between Γ(0) and the point Γ(t) = (µ(t), Σ(t)) = (µ1 + t(µ2 − µ1 ), ((1 − t)I + tT )Σ1 ((1 − t)I + tT )) . (161) We have 1/2 1/2 Σ1 Σ(t)Σ1 so that  (162) 1/2 1/2 = Σ1 ((1 − t)I + tT )Σ1 ((1 − t)I + tT )Σ1    1/2 1/2 1/2 1/2 = Σ1 ((1 − t)I + tT )Σ1 Σ1 ((1 − t)I + tT )Σ1 , 1/2  1/2 1/2 Σ1 Σ(t)Σ1 1/2 1/2 = Σ1 ((1 − t)I + tT )Σ1 , and hence (163)      1/2 1/2 1/2 1/2 1/2 Σ1 Σ(t)Σ1 Tr = Tr Σ1 ((1 − t)I + tT )Σ1 = (1 − t) Tr (Σ1 ) + t Tr (T Σ1 ) . We have Tr (Σ(t)) = Tr (((1 − t)I + tT )Σ1 ((1 − t)I + tT )) = (1 − t)2 Tr (Σ1 ) + 2t(1 − t) Tr (T Σ1 ) + t2 Tr (Σ2 ) Collecting all the above results,     1/2 1/2 1/2 Tr Σ1 + Σ(t) − 2 Σ1 Σ(t)Σ1 = Tr (Σ1 ) + (1 − t)2 Tr (Σ1 ) + 2t(1 − t) Tr (T Σ1 ) + t2 Tr (Σ2 ) − 2(1 − t) Tr (Σ1 ) − 2t Tr (T Σ1 ) =     1/2 1/2 1/2 2 2 2 2 t Tr (Σ1 ) + t Tr (Σ2 ) − 2t Tr (T Σ1 ) = t Tr Σ1 + Σ2 − 2 Σ1 Σ2 Σ1 . In conclusion, G(Γ(0), Γ(t)) = r  1/2  = kµ(0) − µ(t)k2 + Tr Σ(0) + Σ(t) − 2 Σ(0)1/2 Σ(t)Σ(0)1/2 tG(Γ(0), Γ(1)) . 30 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE 9.3. Degenerate distributions. A few results formulated in the previous section required the dispersion matrices to be nonsingular. It is interesting to analyze the opposite case in which both matrices Σ1 and Σ2 are singular. The simplest case occurs when the two subspaces, Range Σ1 and Range Σ2 , are orthogonal. Under all joint distribution for the random vector (X, Y ), with marginals X ∼ N2 (0, Σ1 ) and Y ∼ N2 (0, Σ2 ) , the values of X and Y will lie into orthogonal subspaces, so that XY ∗ = 0. Hence kX − Y k2 = kXk2 + kY k2 , and E kX − Y k2 = E kXk2 + E kY k2 = Tr (Σ1 ) + Tr (Σ2 ) . p So any joint distribution (X, Y ) attains the optimal value Tr (Σ1 ) + Tr (Σ2 ). If we now define X(t) = (1 − t)X + tY , then i i h h (165) E kX − X(t)k2 = E t2 kX − Y k2 = t2 [Tr (Σ1 ) + Tr (Σ2 )] , (164) and so we have the geodesic joining the two random vectors X and Y . The previous example can be extended by taking two singular matrices (166) Σ1 = σ12 vv ∗ and Σ2 = σ22 ww∗ where v 6= w ∈ Rn and kvk = kwk = 1. Clearly, Range Σ1 ∩ Range Σ2 = {0} and they are one-dimensional spaces spanned by vectors v and w, respectively (it is not restrictive to assume v ∗ w ≥ 0, too). By (43), it follows that the distance between the two matrices is q (167) G (Σ1 , Σ2 ) = σ12 + σ22 − 2σ1 σ2 v ∗ w. Despite singularity of these matrices, it can be directly found the point realizing the minimum in (33). It is given by the singular matrix in Sym+ (2n):      σ1 σ2 vw∗ σ1 v  σ12 vv ∗ = (168) σ1 v ∗ σ2 w ∗ . ∗ ∗ 2 σ1 σ2 wv σ2 ww σ2 w 9.4. Examples of gradient flow. With reference to the full Gaussian distribution, one considers smooth functions defined on Rn × Sym++ (n). The first component of the gradient does not require a special gradient as the Riemannian structure is the Euclidean one. The full gradient will thus have two components: (169) grad φ(µ, Σ) = (∇1 φ(µ, Σ), grad2 φ(µ, Σ)) = (∇1 φ(µ, Σ), ∇2 φ(µ, Σ)Σ + Σ∇2 φ(µ, Σ)) . 9.4.1. Optimization. The first example in refers to the gradient flow of the mean value of an objective function f : Rn → R. Its Euler scheme is used in optimization, see [1, Ch. 4] and [19]. In the second example in Sec. 9.4.2 we discuss the gradient flow of the entropy function of a centered Gaussian.We call relaxation to the full Gaussian model of the objective function f : Rn → R the function (170) φ(µ, Σ) = E [f (X)] , X ∼ Nn (µ, Σ) . WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 31 If we would include the Dirac measures in the Gaussian model, then f (x) = φ(x, 0) and the function φ would actually be an extension of the given function. However, we consider only Σ ∈ Sym++ (n) in order to work with a function defined on our manifold. There are two ways to calculate the expected value as a function of µ and Σ. Each of them leads to a peculiar expression of the natural gradient. The first one arises from the relation h i (171) φ(µ, Σ) = E f (Σ1/2 Z + µ) , Z ∼ Nn (0, I) . which will lead to an equation for the gradient involving the derivatives of f . The second one uses   Z 1 −1/2 ∗ −1 −n/2 (172) φ(µ, Σ) = f (x)(2π) det (Σ) exp − (x − µ) Σ (x − µ) dx . 2 In this second case the natural gradient will be achieved by an equation not involving the gradient of the function f . Both forms have their own field of application. Let us start with Case (171). Under standard conditions regarding the derivation under the expectation sign, we have h i (173) ∇1 φ(µ, Σ) = E ∇f (Σ1/2 Z + µ) = E [∇f (X)] . By means of (15), it is straightforward to calculate the derivative dU (Σ 7→ φ(µ, Σ)). Note that ∇f is the column vector and so ∇∗ f will be a row vector. We have i i h h dU φ(µ, Σ) = E df (Σ1/2 Z + µ)[LΣ1/2 (U ) Z] = E ∇∗ f (Σ1/2 Z + µ)LΣ1/2 (U ) Z i h = E Tr ∇∗ f (Σ1/2 Z + µ)LΣ1/2 (U ) Z . Under symmetrization (and setting X = Σ1/2 Z + µ): 1 E [Tr LΣ1/2 (U ) (Z∇∗ f (X) + ∇f (X)Z)] 2 = hU, E ((Z∇∗ f (X) + ∇f (X)Z))iΣ1/2 1 = E Tr LΣ1/2 (Z∇∗ f (X) + ∇f (X)Z) U 2 = hELΣ1/2 (Z∇∗ f (X) + ∇f (X)Z) , U i2 . dU φ(µ, Σ) = It follows that (174) ∇2 φ(µ, Σ) = ELΣ1/2 (Z∇∗ f (X) + ∇f (X)Z) . Calculating the natural gradient: grad2 φ(µ, Σ) = ΣELΣ1/2 (Z∇∗ f (X) + ∇f (X)Z) + ELΣ1/2 (Z∇∗ f (X) + ∇f (X)Z) Σ. 32 L. MALAGÒ, L. MONTRUCCHIO, AND G. PISTONE If we set Ξ = E [Z∇∗ f (X) + ∇f (X)Z], the natural gradient admits the representation grad2 φ(µ, Σ) = ΣLΣ1/2 (Ξ) + LΣ1/2 (Ξ) Σ. (175) We move on to consider the second Case (172). Following the standard computation of the Fisher score and starting from the log-density p(x; µ, Σ) of Nn (µ, Σ), we have (176) n 1 1 log p(x; µ, Σ) = − log 2π − log det Σ − (x − µ)∗ Σ−1 (x − µ) 2 2 2  1 1 n −1 = − log 2π − log det Σ − Tr Σ (x − µ)(x − µ)∗ . 2 2 2 Denoting the partial derivative du (µ 7−→ log p(x; µ, Σ)) as du log p(x; µ, Σ), and dU (Σ 7−→ log p(x; µ, Σ)) as dU log p(x; µ, Σ), we get: du log p(x; µ, Σ) = (x − µ)∗ Σ−1 u = Σ−1 (x − µ), u  1  1 dU log p(x; µ, Σ) = − Tr Σ−1 U + Tr Σ−1 U Σ−1 (x − µ)(x − µ)∗ 2 2 1 −1 = Σ (x − µ)(x − µ)∗ Σ−1 − Σ−1 , U 2 = Σ−1 ((x − µ)(x − µ)∗ − Σ) Σ−1 , U 2 So that du φ(µ, Σ) = Z f (x) du log p(x; µ, Σ) p(x; µ; Σ) dx   Z −1 = Σ f (x)(x − µ)p(x; µ; Σ) dx, u and dU φ(µ, Σ) = Z f (x) dU log p(x; µ, Σ) p(x; µ, Σ) dx   Z = Σ−1 f (x) ((x − µ)(x − µ)∗ − Σ) p(x; µ, Σ) dx Σ−1 , U . 2 At last, thanks to (169), the natural gradient of φ(µ, Σ) will be −1 Z ∇1 φ(µ, Σ) = Σ f (x)(x − µ)p(x; µ; Σ) dx Z grad2 φ(µ, Σ) = f (x) ((x − µ)(x − µ)∗ − Σ) p(x; µ, Σ) dx Σ−1 Z −1 +Σ f (x) ((x − µ)(x − µ)∗ − Σ) p(x; µ, Σ) dx. WASSERSTEIN RIEMANNIAN GEOMETRY OF POSITIVE DEFINITE MATRICES 33 9.4.2. Entropy flow. The flow of entropy can be easily calculated by Eq. 176. We have Z E(µ, Σ) = − log p(x; µ, Σ)p(x; µ, Σ) dx  n 1 1 log 2π + log det Σ − Tr Σ−1 Σ 2 2 2 1 n = (log 2π − 1) + log det Σ . 2 2 = The entropy does not depend on µ so that ∇1 E(µ, Σ) = 0. Moreover (see [18, §8.3]) we know that ∇E(Σ) = Σ−1 , so that grad E(Σ) = (Σ−1 Σ + ΣΣ−1 ) = 2I. (177) The entropic flow will be solution to the equations (178) µ̇(t) = 0, Σ̇(t) + 2I = 0 , that is (179) µ(t) = µ(0), Σ(t) = Σ(0) − 2tI . The integral curve is defined for all t such that 2t < λ∗ , λ∗ being the minimum of the spectre of Σ(0). 10. Check of the Covariant derivative. Let us check Eq. (108) against conditions (LC1) and (LC2). In fact, we have hDX Y, ZiΣ + hY, DX ZiΣ = hdX Y, ZiΣ + hY, dX ZiΣ − Tr (LΣ [Y ] XLΣ [Z]) . (180) On the other hand, if we compute the derivative of W (Y, Z) at Σ, we obtain (181) dX hY, ZiΣ = dX Tr (LΣ [Y ] ΣLΣ [Z]) = Tr (dX LΣ [Y ] ΣLΣ [Z]) + Tr (LΣ [Y ] ΣdX LΣ [Z]) + Tr (LΣ [Y ] XLΣ [Z]) . Since dX LΣ [Y ] = LΣ [dX Y ] − 2LΣ [{LΣ [Y ]}S X] , (182) we have (183) Tr (dX LΣ [Y ] ΣLΣ [Z]) = hdX Y, ZiΣ − 2 h{LΣ [Y ] X}S , ZiΣ = hdX Y, ZiΣ − Tr ({LΣ [Y ] X}S LΣ [Z]) = hdX Y, ZiΣ − Tr (LΣ [Y ] XLΣ [Z]) , and, in a similar way, we can write (184) Tr (LΣ [Y ] ΣdX LΣ [Z]) hY, dX ZiΣ − Tr (LΣ [Z] XLΣ [Y ]) . Inserting equations above in Eq. (181) yields (LS1). Condition (LS2), is checked by (185) hDX Y − DY X, ZiΣ = hdX Y − dY X, ZiΣ = h[Y, X] , ZiΣ .
10math.ST
A Faster FPTAS for the Subset-Sums Ratio Problem Nikolaos Melissinos1 and Aris Pagourtzis2 arXiv:1803.09952v1 [cs.DS] 27 Mar 2018 1 School of Applied Mathematical and Physical Sciences National and Technical University of Athens Polytechnioupoli, 15780 Zografou, Athens, Greece, [email protected] 2 School of Electrical and Computer Engineering National and Technical University of Athens Polytechnioupoli, 15780 Zografou, Athens, Greece, [email protected] Abstract. The Subset-Sums Ratio problem (SSR) is an optimization problem in which, given a set of integers, the goal is to find two subsets such that the ratio of their sums is as close to 1 as possible. In this paper we develop a new FPTAS for the SSR problem which builds on techniques proposed in [D. Nanongkai, Simple FPTAS for the subset-sums ratio problem, Inf. Proc. Lett. 113 (2013)]. One of the key improvements of our scheme is the use of a dynamic programming table in which one dimension represents the difference of the sums of the two subsets. This idea, together with a careful choice of a scaling parameter, yields an FPTAS that is several orders of magnitude faster than the best currently known scheme of [C. Bazgan, M. Santha, Z. Tuza, Efficient approximation algorithms for the Subset-Sums Equality problem, J. Comp. System Sci. 64 (2) (2002)]. Keywords: approximation scheme, subset-sums ratio, knapsack problems, combinatorial optimization 1 Introduction We study the optimization version of the following NP-hard decision problem which given a set of integers asks for two subsets of equal sum (but, in contrast to the Partition problem, the two subsets do not have to form a partition of the given set): Equal Sum Subsets problem (ESS). Given a set A = {a1 , . . . , an } of n positive integers, are there P P two nonempty and disjoint sets S1 , S2 ⊆ {1, . . . , n} such that i∈S1 ai = j∈S2 aj ? Our motivation to study the ESS problem and its optimization version comes from the fact that it is a fundamental problem closely related to problems appearing in many scientific areas. Some examples are the Partial Digest problem, which comes from molecular biology (see [2,3]), the problem of allocating individual goods (see [8]), tournament construction (see [7]), and a variation of the Subset Sum problem, namely the Multiple Integrated Sets SSP, which finds applications in the field of cryptography (see [10]). The ESS problem has been proven NP-hard by Woeginger and Yu in [11] and several of its variations have been proven NP-hard by Cieliebak et al. in [4,5,6]. The corresponding optimization problem is: Subset-Sums Ratio problem (SSR). Given a set A = {a1 , . . . , an } of n positive integers, find two nonempty and disjoint sets S1 , S2 ⊆ {1, . . . , n} that minimize the ratio P P max{ i∈S1 ai , j∈S2 aj } P P . min{ i∈S1 ai , j∈S2 aj } The SSR problem was introduced by Woeginger and Yu [11]. In the same work they present an 1.324 approximation algorithm which runs in O(n log n) time. The SSR problem received its first FPTAS by Bazgan et al. in [1], which approximates the optimal solution in time no less than O(n5 /ε3 ); to the best of our knowledge this is still the faster scheme proposed for SSR. A second, simpler but slower, FPTAS was proposed by Nanongkai in [9]. The FPTAS we present in this paper makes use of some ideas proposed in [9], strengthened by certain key improvements that lead to a considerable acceleration: our algorithm approximates the optimal solution in O(n4 /ε) time, several orders of magnitude faster than the best currently known scheme of [1]. 2 Preliminaries We will first define two functions that will allow us to simplify several of the expressions that we will need throughout the paper. Definition 1 (Ratio of two subsets). Given a set A = {a1 , . . . , an } of n positive integers and two sets S1 , S2 ⊆ {1, . . . , n} we define R(S1 , S2 , A) as follows: P  P i∈S1 ai if S1 ∪ S2 6= ∅, j∈S2 aj R(S1 , S2 , A) = +∞ otherwise. Definition 2 (Max ratio of two subsets). Given a set A = {a1 , . . . , an } of n positive integers and two sets S1 , S2 ⊆ {1, . . . , n} we define MR(S1 , S2 , A) as follows: MR(S1 , S2 , A) = max{R(S1 , S2 , A), R(S2 , S1 , A)} . Note that, in cases where at least one of the sets is empty, the Max Ratio function will return ∞. Using these functions, the SSR problem can be rephrased as shown below. 2 Subset-Sums Ratio problem (SSR) (equivalent definition). Given a set A = {a1 , . . . , an } of n positive integers, find two disjoint sets S1 , S2 ⊆ {1, . . . , n} such that the value MR(S1 , S2 , A) is minimized. In addition, from now on, whenever we have a set A = {a1 , . . . , an } we will assume that 0 < a1 < a2 < . . . < an (clearly, if the input contains two equal numbers then the problem has a trivial solution). The FPTAS proposed by Nanonghai [9] approximates the SSR problem by solving a restricted version. Restricted Subset-Sums Ratio problem. Given a set A = {a1 , . . . , an } of n positive integers and two integers 1 ≤ p < q ≤ n, find two disjoint sets S1 , S2 ⊆ {1, . . . , n} such that {max S1 , max S2 } = {p, q} and the value MR(S1 , S2 , A) is minimized. Inspired by this idea, we define a less restricted version. The new problem requires one additional input integer, instead of two, which represents the smallest of the two maximum elements of the sought optimal solution. Semi-Restricted Subset-Sums Ratio problem. Given a set A = {a1 , . . . , an } of n positive integers and an integer 1 ≤ p < n, find two disjoint sets S1 , S2 ⊆ {1, . . . , n} such that max S1 = p < max S2 and the value MR(S1 , S2 , A) is minimized. Let A = {a1 , . . . , an } be a set of n positive integers and p ∈ {1, . . . , n − 1}. Observe that, if S1∗ , S2∗ is the optimal solution of SSR problem of instance A and S1p , S2p the optimal solution of Semi-Restricted SSR problem of instance A, p then: MR(S1∗ , S2∗ , A) = min MR(S1p , S2p , A) . p∈{1,...,n−1} Thus, we can find the optimal solution of SSR problem by solving the SSR Semi-Restricted SSR problem for all p ∈ {1, . . . , n − 1}. 3 Pseudo-polynomial time algorithm for Semi-Restricted SSR problem Let the A, p be an instance of the Semi-Restricted SSR problem where A = {a1 , . . . , an } and 1 ≤ p < n. For solving the problem we have to check two cases for the maximum element of the optimal solution. Let S1∗ , S2∗ be the optimal solution of this instance and P max S2∗ = q. We define B = {ai | i > p, ai < Pp p j=1 aj } and C = {ai | ai ≥ j=1 aj } from which we have that either aq ∈ B or aq ∈ C. Note that A = {a1 , . . . , ap } ∪ B ∪ C. Case 1 (aq ∈ C). It is easy to see that if aq ∈ C, then aq = min C and the optimal solution will be (S1 = {1, . . . , p}, S2 = {q}). We describe below a function that returns this pair of sets, thus computing the optimal solution if Case 1 holds. 3 Definition 3 (Case 1 solution). Given a set A = {a1 , . . . , an } of n positive integers and an integer 1 ≤ p < n we define the function SOL1 (A, p) as follows: ( ({1, . . . , p}, {min C}) SOL1 (A, p) = (∅, ∅) where C = {ai | ai > Pp j=1 if C 6= ∅, otherwise, aj }. Case 2 (aq ∈ B). This second case is not trivial. Here, we define an integer m Pp= max{j | ajP∈p A r C} and a matrix T , where T [i, d], 0 ≤ i ≤ m, −2 · k=1 ak ≤ d ≤ k=1 ak , is a quadruple to be defined below. A cell T [i, d] is nonempty if there exist two disjoint sets S1 , S2 with sums sum1 , sum2 such that sum1 − sum2 = d, max S1 = p, and S1 ∪ S2 ⊆ {1, . . . , i} ∪ {p}; if i > p, we require in addition that p < max S2 . In such a case, cell T [i, d] consists of the two sets S1 , S2 , and two integers max(S1 ∪S2 ) and sum1 +sum2 . A crucial point in our algorithm is that if there exist more than one pairs of sets which meet the required conditions, we keep the one that maximize the value sum1 + sum2 ; for convenience, we make use of a function to check this property and select the appropriate sets. The algorithm for this case (Algorithm 1) finally returns the pair S1 , S2 which, among those that appear in some T [m, d] 6= ∅, has the smallest ratio MR(S1 , S2 , A). Definition 4 (Larger total sum tuple selection). Given two tuples v1 = (S1 , S2 , q, x) and v2 = (S10 , S20 , q 0 , x0 ) we define the function LT ST (v1 , v2 ) as follows: ( v2 LT ST (v1 , v2 ) = v1 if v1 = ∅ or x0 > x, otherwise . Algorithm 1 Case 2 solution [SOL2 (A, p) function] Input: a strictly sorted set A = {a1 , . . . , an }, ai ∈ Z+ , and an integer p, 1 ≤ p < n. Output: the sets of an optimal solution for Case 2. 1: S10 ←P ∅, S20 ← ∅ 2: Q ← pi=1 ai , m ← max{i | ai < Q} 3: if m > p then 4: for all i ∈ {0, . . . , m}, d ∈ {−2 · Q, . . . , Q} do 5: T [i, d] ← ∅ 6: end for 4 7: T [0, ap ] ← ({p}, ∅, p, ap ) . p ∈ S1 by problem definition 8: for i ← 1 to m do 9: if i < p then 10: for all T [i − 1, d] 6= ∅ do 11: (S1 , S2 , q, x) ← T [i − 1, d] 12: T [i, d] ← LT ST (T [i, d], T [i − 1, d]) 13: T [i, d + ai ] ← LT ST (T [i, d + ai ], (S1 ∪ {i}, S2 , q, x + ai )) 14: T [i, d − ai ] ← LT ST (T [i, d − ai ], (S1 , S2 ∪ {i}, q, x + ai )) 15: end for 16: else if i = p then . p is already placed in S1 17: for all T [i − 1, d] 6= ∅ do 18: T [i, d] ← T [i − 1, d] 19: end for 20: else 21: for all T [i − 1, d] 6= ∅ do 22: (S1 , S2 , q, x) ← T [i − 1, d] 23: if i > p + 1 then 24: T [i, d] ← LT ST (T [i, d], T [i − 1, d]) 25: end if 26: if d − ai ≥ −2 · Q then 27: T [i, d − ai ] ← LT ST (T [i, d − ai ], (S1 , S2 ∪ {i}, i, x + ai )) 28: end if 29: end for 30: for all T [p, d] 6= ∅ do 31: (S1 , S2 , q, x) ← T [p, d] 32: if d − ai ≥ −2 · Q then 33: T [i, d − ai ] ← LT ST (T [i, d − ai ], (S1 , S2 ∪ {i}, i, x + ai )) 34: end if 35: end for 36: end if 37: end for 38: for d ← −2 · Q to Q do 39: (S1 , S2 , q, x) ← T [m, d] 40: if MR(S1 , S2 , A) < MR(S10 , S20 , A) then 41: S10 ← S1 , S20 ← S2 42: end if 43: end for 44: end if 45: return S10 , S20 We next present the complete algorithm for Semi-Restricted SSR (Algorithm 2) which simply returns the best among the two solutions obtained by solving Pp the two cases. Algorithm 2 runs in time polynomial in n and Q (where Q = i=1 ai ), therefore it is a pseudo-polynomial time algorithm. More precisely, by using appropriate data structures we can store the sets in the matrix cells in O(1) time (and space) per cell, which implies that the time complexity of the algorithm is O(n · Q). 5 Algorithm 2 Exact solution for Semi-Restricted SSR [SOLex (A, p) function] Input: a strictly sorted set A = {a1 , . . . , an }, ai ∈ Z+ , and an integer p, 1 ≤ p < n. Output: the sets of an optimal solution of Semi-Restricted SSR. 1: (S1 , S2 ) ← SOL1 (A, p) 2: (S10 , S20 ) ← SOL2 (A, p) 3: if MR(S1 , S2 , A) ≤ MR(S10 , S20 , A) then 4: return S1 , S2 5: else 6: return S10 , S20 7: end if 4 Correctness of the Semi-Restricted SSR algorithm In this section we will prove that Algorithm 2 solves exactly the Semi-Restricted SSR problem. Let S1∗ , S2∗ be the sets of an optimal solution for input (A = {a1 , . . . , an }, p). Pp Starting with the case 1 (where max S2∗ ∈ {i | ai ≥ j=1 aj }), is easy to see that: Pp Observation 1. The sets S1∗ = {1, . . . , p}, S2∗ = {min{i | ai ≥ j=1 aj }} give the optimal ratio. Those are the sets which the function SOL1 (A, p) returns. Pp For the case 2 (where max S2∗P∈ {i | i > p, Pai < j=1 aj }) we have to show that the cell T [m, d] (where d = i∈S ∗ ai − j∈S ∗ aj ) contains two sets S1 , S2 1 2 with ratio equal to optimum. Before that we will show a lemma for the sums of the sets of the optimal solution. Pp P P Lemma 1. Let Q = i=1 ai then we have i∈S ∗ ai ≤ Q and i∈S ∗ ai < 2 · Q. 1 max S1∗ 2 Pp P Proof. Observe that = p. This gives us i∈S ∗ ai ≤ i=1 ai so it remains 1 P P to prove i∈S ∗ ai < 2 · Q. Suppose that i∈S ∗ ai ≥ 2 · Q. We can define the set 2 2 Pp S2 as S2∗ r {min S2∗ }. Note that, for all i ∈ S2∗ , we have that the ai < i=1 ai . Because of that, X i∈S1∗ ai ≤ p X ai < i=1 X i∈S2 ai < X ai i∈S2∗ which means that the pair (S1∗ , S2 ) is a feasible solution with smaller max ratio than the optimal, which is a contradiction. The next two lemmas describe same conditions which guarantee that the cells of T are nonempty. Furthermore, they secure that we will store the appropriate sets to return an optimal solution. 6 Lemma 2. If there exist two disjoint sets (S1 , S2 ) such that – max P S2 < max P S1 = p – a − i∈S1 i j∈S2 aj = d then T [i, d] 6= ∅ for all p ≥ i ≥ max(S1 ∪ S2 r {p}). Furthermore for the sets (S10 , S20 ) which are stored in T [i, d] it holds that X X X X ai + aj ≥ ai + aj . i∈S10 j∈S20 i∈S1 j∈S2 Proof. Note that, for all pairs (S1 , S2 ) which meet the conditions, P their sums are smaller than Q because max(S ∪ S ) = p so for the value d = 1 2 i∈S1 ai − P a we have j j∈S2 −Q ≤ d ≤ Q . The same clearly holds for every pair of subsets of S1 , S2 . We will prove the lemma by induction on q = max(S1 ∪ S2 r {p}). For convenience if S1 ∪ S2 r {p} = ∅ we let q = 0. • q = 0 (base case). The only pair which meets the conditions for q = 0 is the ({p}, ∅). Observe that cell T [0, ap ] is nonempty by the construction of the table and the same holds for T [i, ap ], 1 ≤ i ≤ p (by line 12). In this case the pair of sets which meets the conditions and the pair which is stored are exactly the same, so the lemma statement is obviously true. • Assume that the lemma statement holds for q = k ≤ p − 1; we will prove it for q = k + 1 as well. Let (S1 , S2 ) be a pair of sets which meets the conditions. Either q ∈ S1 or q ∈ S2 ; therefore either (S1 r {q}, S2 ) or (S1 , S2 r {q}) (respectively) meets the conditions. By the inductive hypothesis, we know that – either T [q − 1, d − aq ] or T [q − 1, d + aq ] (resp.) is nonempty 0 0 – in P any of the Pabove cases Pfor the stored P pair (S1 , S2 ) it holds that: i∈S 0 ai + j∈S 0 aj ≥ i∈S1 ai + j∈S2 aj − aq 1 2 In particular, if (S1 r {q}, S2 ) meets the conditions then T [q − 1, d − aq ] is nonempty. In line 13 q is added to the first set and therefore T [q, d] is nonempty and the stored pair is (S10 ∪{q}, S20 ) (or some other with larger total sum). Hence, the total sum of the pair in T [q, d] is at least X X X X ai + aj + aq ≥ ai + aj . i∈S10 j∈S20 i∈S1 j∈S2 If on the other hand (S1 , S2 r {q}) is the pair that meets the conditions then T [q − 1, d + aq ] is nonempty. In line 14 q is added to the second set and therefore T [q, d] is nonempty and the stored pair is (S10 , S20 ∪ {q}) (or other with larger total sum). Hence, the total sum of the pair in T [q, d] is at least X X X X ai + aj + aq ≥ ai + aj . i∈S10 j∈S20 i∈S1 7 j∈S2 The same holds for cells T [i, d] with q < i ≤ p (due to line 12). This concludes the proof. A similar lemma can be proved for sets with maximum element index greater than p. Lemma 3. If there exist two disjoint sets (S1 , S2 ) such that – P max S2 = q > pP = max S1 – Pi∈S1 ai ≤ P Q, j∈S2 aj < 2 · Q – i∈S1 ai − j∈S2 aj = d then T [i, d] 6= ∅ for all i ≥ q. Furthermore for the sets (S10 , S20 ) which are stored in T [i, d] it holds that X X X X ai + aj . ai + aj ≥ i∈S10 j∈S20 i∈S1 j∈S2 Proof. P Note that, P for all pairs (S1 , S2 ) which meet the conditions, the value d = i∈S1 ai − j∈S2 aj it holds that −2 · Q ≤ d ≤ Q . The same clearly holds for every pair of subsets of S1 , S2 . We will prove the lemma by induction. Let (S1 , S2 ) meet the conditions and q = max S2 . • q = p + 1 (base case) Clearly max S2 = p + 1 so the sets (S1 , S2 r {p + 1}) meet the conditions of the Lemma 2 which gives us that – T [p, d + ap+1 ] is nonempty 0 0 – P for the stored that: 2 ) it holds P P pair (S1 , SP a + a ≥ a + i∈S 0 i j∈S 0 j i∈S1 i j∈S2 aj − ap+1 1 2 Having the T [p, d + ap+1 ] 6= ∅ the algorithm uses it in lines 31-34 and adds p + 1 to the second (stored) set so, we have that T [p + 1, d] is nonempty and the stored sets have total sum (at least): X X X X ai + aj + ap+1 ≥ ai + aj . i∈S10 j∈S20 i∈S1 j∈S2 Furthermore, because T [p + 1, d] is nonempty the above hold, additionally, for all T [i, d], i > p + 1 (because the condition at line 23 is met, the algorithm fills those cells). The above conclude the base case. • Assuming that the lemma statement holds for q = k > p, we will prove it for q = k + 1. Here we have to check two cases. Either max(S2 r {q}) > p or not. Case 1 (max(S2 r{q}) > p). The pair of sets (S1 , S2 r{q}) meets the conditions; by the inductive hypothesis, we have 8 – T [q − 1, d − aq ] is nonempty 0 0 – P for the stored that: 2 ) it holds P P pair (S1 , SP a + a ≥ a + 0 0 i j i i∈S j∈S i∈S1 j∈S2 aj − aq 1 2 Having the T [q − 1, d + ap+1 ] 6= ∅ the algorithm uses it in line 27 and adds q to the second (stored) set so we have that T [q, d] is nonempty and the stored sets have total sum (at least): X X X X ai + aj + aq ≥ ai + aj . i∈S10 j∈S20 i∈S1 j∈S2 As before, the same holds for the cells T [i, d] with i > p + 1 because the condition at line 23 is met. Case 2 (max(S2 r {q}) < p). The sets (S1 , S2 r {q}) meets the conditions of the Lemma 2 (because max S1 = p) which gives that – T [p, d + aq ] is nonempty 0 0 – P for the stored that: 2 ) it holds P P pair (S1 , SP a + a ≥ a + 0 0 i j i i∈S j∈S i∈S1 j∈S2 aj − aq 1 2 Having T [p, d + aq ] 6= ∅ the algorithm uses it in lines 31-34 and adds q to the second (stored) set so we have that T [q, d] is nonempty and the stored sets have total sum (at least): X X X X ai + aj + aq ≥ ai + aj . i∈S10 j∈S20 i∈S1 j∈S2 Furthermore, because T [q, d] is nonempty the previous hold for all T [i, d], i > q ≥ p + 1 (because the condition at line 23 is met). Now we can prove that, in the second case, the pair of sets which the algorithm returns and the pair of sets of an optimal solution have the same ratio. Lemma 4. If (S10 , S20 ) is the pair of sets that Algorithm 1 returns, then: MR(S10 , S20 , A) = MR(S1∗ , S2∗ , A) . Proof. Let m be the size of the first dimension of the matrix T . Observe that for all i, p + 1 ≤ i ≤ m, the sets S1 , S2 of the nonempty cells T [i, d] are constructed (lines 21-35 of Algorithm 1) such that max S1 = p and i ≥ max S2 > p. Therefore the pair (S10 , S20 ) returned by the algorithm is a feasible solution. We can see that the sets S1∗ , S2∗ meet the conditions of Lemma 3 (the conditions for the sumsP are met because of Lemma 1) which give us that the cell T [m, d] (where P d = i∈S ∗ ai − j∈S ∗ aj ) is non empty and contains two sets with total sum 1 2 P P non less than i∈S ∗ ai + j∈S ∗ aj . Let S1 , S2 be the sets which are stored to 1 2 the cell T [m, d]. Then we have MR(S10 , S20 , A) ≤ MR(S1 , S2 , A) ≤ MR(S1∗ , S2∗ , A) 9 (1) where the second inequality is because X X X X ai − aj = ai − aj i∈S1∗ j∈S2∗ i∈S1 j∈S2 and X i∈S1∗ ai + X j∈S2∗ aj ≤ X i∈S1 ai + X aj . j∈S2 By the Eq.1 and because the S1∗ , S2∗ have the smallest Max Ratio we have MR(S10 , S20 , A) = MR(S1∗ , S2∗ , A) . Now, we can write the next theorem, which follows by the previous cases. Theorem 1. Algorithm 2 returns an optimal solution for Semi-Restricted SSR. 5 FPTAS for Semi-Restricted SSR and SSR Algorithm 2, which we presented at Section 3, is an exact pseudo-polynomial time algorithm for the Semi-Restricted SSR problem. In order to derivee a (1+ε)ε·a approximation algorithm we will define a scaling parameter δ = 3·np which we ai 0 0 0 0 will use to make a new set A = {a1 , . . . , an } with ai = b δ c. The approximation algorithm solves the problem optimally on input (A0 , p) and returns the sets of this exact solution. The ratio of those sets is a (1 + ε)-approximation of the optimal ratio of the original input. Algorithm 3 FPTAS for Semi-Restricted SSR [SOLapx (A, p, ε) function] Input: a strictly sorted set A = {a1 , . . . , an }, ai ∈ Z+ , an integer p, 1 ≤ p < n, and an error parameter ε ∈ (0, 1). Output: the sets of a (1 + ε)-approximation solution for Semi-Restricted SSR. ε·a 1: δ ← 3·np 0 2: A ← ∅ 3: for i ← 1 to n do 4: a0i ← b aδi c 5: A0 ← A0 ∪ {a0i } 6: end for 7: (S1 , S2 ) ← SOLex (A0 , p) 8: return S1 , S2 Now, we will prove that the algorithm approximates the optimal solution by factor (1 + ε). Our proof follows closely the proof of Theorem 2 in [9]. Let SA , SB be the pair of sets returned by Algorithm 3 on input A = {a1 , . . . , an }, p and ε and (S1∗ , S2∗ ) be an optimal solution to the problem. 10 Lemma 5. For any S ∈ {SA , SB , S1∗ , S2∗ } X ai − n · δ ≤ i∈S X δ · a0i ≤ i∈S n·δ ≤ X ai , (2) i∈S ε X · ai . 3 (3) i∈S Proof. For Eq. (2) notice that for all i ∈ {1, . . . , n} we define a0i = b aδi c. This gives us ai ai − 1 ≤ a0i ≤ ⇒ ai − δ ≤ δ · ai ≤ ai . δ δ In addition, for any S ∈ {SA , SB , S1∗ , S2∗ } we have |S| ≤ n, which means that X ai − n · δ ≤ i∈S X δ · a0i ≤ i∈S X ai . i∈S For the Eq. (3) observe that max S ≥ p for any S ∈ {SA , SB , S1∗ , S2∗ }. By this observation, we can show the second inequality n·δ ≤n· ε · ap ε X ≤ · ai . 3·n 3 i∈S Lemma 6. MR(SA , SB , A) ≤ MR(SA , SB , A0 ) + ε 3 Proof. P P δ · a0i + δ · n i∈SA ai A R(SA , SB , A) = P ≤ i∈SP j∈SB aj j∈SB aj P a0i δ·n ≤ P i∈SA 0 + P a j∈SB j j∈SB aj ε ≤ MR(SA , SB , A0 ) + 3 [by Eq. (2)] [by Eq. (2)] [by Eq. (3)] The same way, we have R(SB , SA , A) ≤ MR(SA , SB , A0 ) + ε 3 thus the lemma holds. Lemma 7. For any ε ∈ (0, 1), MR(S1∗ , S2∗ , A0 ) ≤ (1 + 2ε ) · MR(S1∗ , S2∗ , A). 11 Proof. If R(S1∗ , S2∗ , A0 ) ≥ 1, let (S1 , S2 ) = (S1∗ , S2∗ ), otherwise (S1 , S2 ) = (S2∗ , S1∗ ). That gives us P a0i ∗ ∗ 0 0 MR(S1 , S2 , A ) = R(S1 , S2 , A ) = P i∈S1 0 j∈S2 aj P i∈S1 ai ≤P [by Eq. (2)] j∈S2 aj − n · δ P P ai i∈S2 ai =P · P i∈S1 j∈S2 aj − n · δ j∈S2 aj P ai n·δ = (1 + P ) · P i∈S1 . j∈S2 aj − n · δ j∈S2 aj Because S2 ∈ {S1∗ , S2∗ } by Eq. (3) it follows that P ai 1 ) · P i∈S1 MR(S1∗ , S2∗ , A0 ) ≤ (1 + 3 j∈S aj ε −1 P 2 ai ε ) · P i∈S1 = (1 + 3−ε j∈S2 aj P ai ε ≤ (1 + ) · P i∈S1 2 a j∈S2 j ε ≤ (1 + ) · MR(S1∗ , S2∗ , A). 2 [because ε ∈ (0, 1)] This concludes the proof. Now we can prove that Algorithm 3 is a (1 + ε) approximation algorithm. Theorem 2. Let SA , SB be the pair of sets returned by Algorithm 3 on input (A = {a1 , . . . , an }, p, ε) and S1∗ , S2∗ be an optimal solution, then: MR(SA , SB , A) ≤ (1 + ε) · MR(S1∗ , S2∗ , A). Proof. The theorem follows from a sequence of inequalities: ε 3 ε ∗ ∗ 0 ≤ MR(S1 , S2 , A ) + 3 ε ε ∗ ≤ (1 + ) · MR(S1 , S2∗ , A) + 2 3 ≤ (1 + ε) · MR(S1∗ , S2∗ , A). MR(SB , SA , A) ≤ MR(SA , SB , A0 ) + [by Lemma 6] [by Lemma 7] It remains to show that the complexity of Algorithm 3 is O(poly(n, 1/ε)). Like we said at 3 the algorithm solves the Semi-Restricted SSR problem in O(n · Q) 12 (where Q = we have, Pp i=1 a0i ). We have to bound the value of Q. By the definition of a0i Q= p X a0i ≤ n · a0p ≤ i=1 n · ap 3 · n2 = δ ε which means that Algorithm 3 runs in O(n3 /ε). Clearly, it suffices to perform n − 1 executions of the FPTAS for Semi-Restricted SSR (Algorithm 3), and pick the best of the returned solutions, in order to obtain an FPTAS for the (unrestricted) SSR problem. Therefore, we obtain the following. Theorem 3. The above described algorithm is an FPTAS for SSR that runs in O(n4 /ε) time. 6 Conclusion In this paper we provide an FPTAS for the Subset-Sums Ratio (SSR) problem that is much faster than the best currently known scheme of Bazgan et al. [1]. There are two novel ideas that provide this improvement. The first comes from observing that in [9] the proof of correctness essentially relies only on the value of the smallest of the two maximum elements; this led to the idea to use only that information in order to solve the problem by defining and solving a new variation which we call Semi-Restricted SSR. A key ingredient in our approximation scheme is the use, in the scaling parameter δ, of a value smaller than the sums of the sets of both optimal and approximate solutions (which in our case is the value of the smallest of the two maximum elements). We believe that this technique can be used in several other partition problems, e.g. such as those described in [8,10]. The second idea was to use one dimension only, for the difference of the sums of the two sets, instead of two dimensions, one for each sum. This idea, combined with the observation that between two pairs of sets with the same difference, the one with the largest total sum has ratio closer to 1, is the key to obtain an optimal solution in much less time. It’s interesting to see whether and how this technique could be used to problems that seek more than two subsets. A natural open question is whether our techniques can be applied to obtain approximation results for other variations of the SSR problem [5,6]. References 1. C. Bazgan, M. Santha, Z. Tuza, Efficient Approximation Algorithms for the SubsetSums Equality Problem, Journal of Computer and System Sciences 64(2): 160-170 (2002). https://doi.org/10.1006/jcss.2001.1784 2. M. Cieliebak, S. Eidenbenz, P. Penna, Noisy data make the partial digest problem NP-hard, in Benson, G., Page, R.D.M. (eds.) WABI 2003, LNCS (LNBI) 2812: 111123, Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-39763-2 9 13 3. M. Cieliebak, S. Eidenbenz, Measurement Errors Make the Partial Digest Problem NP-Hard, in Farach-Colton M. (eds) LATIN 2004: Theoretical Informatics, LNCS 2976: 379-390, Springer, Berlin, Heidelberg. https://doi.org/10.1007/ 978-3-540-24698-5 42 4. M. Cieliebak, S. Eidenbenz, A. Pagourtzis, K. Schlude, Equal Sum Subsets: Complexity of Variations, Tech. Report 370, ETH Zürich, Dept. of Computer Sci., 2002. Available at ftp://ftp.inf.ethz.ch/doc/tech-reports/3xx/370.pdf 5. M. Cieliebak, S. Eidenbenz, A. Pagourtzis, Composing Equipotent Teams, in Lingas A., Nilsson B.J. (eds) Fundamentals of Computation Theory, FCT 2003, LNCS 2751: 98-108. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45077-1 10 6. M. Cieliebak, S. Eidenbenz, A. Pagourtzis, K. Schlude, On the Complexity of Variations of Equal Sum Subsets, Nordic Journal of Computing 14(3): 151-172 (2008). Available at http://users.softlab.ntua.gr/∼pagour/papers/NJC09.pdf 7. M.A. Khan, Some Problems on Graphs and Arrangements of Convex Bodies (Ph.D. Thesis), University of Calgary, 2017. Retrieved from https://prism.ucalgary.ca/ handle/11023/3765 8. R. J. Lipton , E. Markakis , E. Mossel , A. Saberi. On approximately fair allocations of indivisible goods. Proceedings of the 5th ACM conference on Electronic Commerce (EC’04), pp. 125–131, May 17-20, 2004, New York, NY, USA. https://doi.org/10.1145/988772.988792 9. D. Nanongkai. Simple FPTAS for the subset-sums ratio problem. Information Processing Letters 113(19-21): 750-753 (2013). https://doi.org/10.1016/j.ipl.2013.07. 009 10. N. Voloch: MSSP for 2-D sets with unknown parameters and a cryptographic application. Contemporary Engineering Sciences, 10(19): 921-931 (2017). https:// doi.org/10.12988/ces.2017.79101 11. G. J. Woeginger, Z. Yu: On the Equal-Subset-Sum Problem.Information Processing Letters 42(6): 299-302 (1992). https://doi.org/10.1016/0020-0190(92)90226-L 14
8cs.DS
Prioritized Sweeping Neural DynaQ with Multiple Predecessors, and Hippocampal Replays arXiv:1802.05594v1 [cs.AI] 15 Feb 2018 Lise Aubin, Mehdi Khamassi, and Benoı̂t Girard Sorbonne Université, CNRS, Institut des Systèmes Intelligents et de Robotique (ISIR), F-75005 Paris, France [email protected] Abstract. During sleep and awake rest, the hippocampus replays sequences of place cells that have been activated during prior experiences. These have been interpreted as a memory consolidation process, but recent results suggest a possible interpretation in terms of reinforcement learning. The Dyna reinforcement learning algorithms use off-line replays to improve learning. Under limited replay budget, a prioritized sweeping approach, which requires a model of the transitions to the predecessors, can be used to improve performance. We investigate whether such algorithms can explain the experimentally observed replays. We propose a neural network version of prioritized sweeping Q-learning, for which we developed a growing multiple expert algorithm, able to cope with multiple predecessors. The resulting architecture is able to improve the learning of simulated agents confronted to a navigation task. We predict that, in animals, learning the world model should occur during rest periods, and that the corresponding replays should be shuffled. Keywords: Reinforcement Learning, Replays, DynaQ, Prioritized Sweeping, Neural Networks, Hippocampus, Navigation 1 Introduction The hippocampus hosts a population of cells responsive for the current position of the animal within the environment, the place cells (PCs), a key component of the brain navigation system [1]. Since the seminal work of [2], it has been shown that PCs are reactivated during sleep – obviously without any locomotion – and that these reactivations are functionally linked with the improvement of the learning performance of a navigation task [3]. Similar reactivations have been observed in the awake state [4], while the animal is immobile, either consuming food at a reward site, waiting at the departure site for the beginning of the next trial or stopped at a decision point. These reactivations contain sequences of PCs’ activations experienced in the awake state (forward reactivations) [5], sequences played in the reverse order (backward reactivations) [4], and sometimes never experienced sequences (resulting from the concatenation of experienced sequences) [6]. These reactivations have been interpreted in the light of the act 1 .6 .2 dist 0 T2 R1 T1 R2 . . . 0 0.2 0.6 1 φ= 0.6 0.2 0 . . 1 0.5 Location Memory Fig. 1. Model of the rat experiment used in [6]. The maze is discretized into 32 positions (squares). The agent can use 4 discrete actions (N,E,S,W). The input state φ is the concatenation of 32 location components and two reward memory components. The location part of φ represents the activation of 32 place cells co-located with the maze discrete positions, their activity act depends on the Manhattan distance of the agent to the cell. All figures by Aubin & Girard, 2018; available at https://doi.org/10.6084/m9.figshare.5822112.v2 under a CC-BY4.0 license. memory consolidation theory [7]: they would have the role of copying volatile hippocampal memories into the cortex [8] for reorganization and longer-term storage [9]. Some recent results have however shown that these reactivations also have a causal effect on reinforcement learning processes [3,10]. A number of reinforcement learning (RL) algorithms make use of reactivations of their inputs, reminiscent of hippocampal reactivations, that are thus candidates to explain this phenomenon [11]. Among them, the Dyna family of algorithms [12] is of special interest because it was specifically designed to make the best possible use of alternation between on-line and off-line learning phases (i.e. phases during which the agent acts in the real world or in simulation). We concentrate here on the Q-learning version of Dyna (Dyna-Q). When operating on-line, Dyna-Q is indistinguishable from the original model-free Q-learning algorithm: it computes reward prediction error signals, and uses them to update the estimated values of the (state, action) couples, Q(s, a). In its original version [12], when off-line, the Dyna algorithm reactivates randomly chosen quadruplets composed of an initial state, a chosen action, and the predicted resulting state and reward (produced by a learned world-model, this phase being thus modelbased ), in order to refine the on-line estimated values. However, when the number of reactivations is under a strict budget constraint, it is more efficient to select those that will provide more information: those that effectively generated a large reward prediction error in the last on-line phase, and those that are predicted to do so by the world model, a principle called prioritized sweeping [13,14]. We are here interested in mimicking the process by which the basal ganglia, which is central for RL processes [15], can use the state representations of the world that are provided by the hippocampus. The manipulated state descriptor will thus be a population activity vector, and we will represent the Q-values and the world model with neural network approximators [16]. In the following, we describe the rat experimental setup proposed in [6], and how we simulated it. In this task, a state can have multiple predecessor states resulting from the execution of a single action, we thus present a modified Dyna-Q learning algorithm, with a special stress on the neural-network algorithm we designed to learn to approximate binary relations (not restricted to functions) with a growing approach: GALMO for Growing Algorithm to Learn Multiple Outputs. Our results successively illustrate three main points. First, because of interferences between consecutively observed states during maze experience, themselves due to the use of a neural-network function approximator, the world model had to be learned with shuffled states during off-line replay. Second, GALMO allows to efficiently solve the multiple predecessor problem. Third, the resulting system, when faced with a training schedule similar to [6], generates a lot of disordered state replays, but also a non-negligible set of varied backward and forward replay sequences, without explicitly storing and replaying sequences. 2 2.1 Methods Experimental task We aim at modeling the navigation task used in [6]: two successive T-mazes (T1 and T2 on Fig. 1), with lateral return corridors. The left and right rewarding sites deliver food pellets with different flavors. The training involves daily changing contingencies, forcing rats to adapt their choice to turn either left or right at the final choice (T2) based on the recent history of reward. These contingencies are: 1) always turn right, while the left side of the maze is blocked; 2) always turn left, while the right side of the maze is blocked; 3) always turn right; 4) always turn left; 5) alternate between left and right on a lap-by-lap basis. Rats attempting to run backward on the maze were physically prevented to do so by the experimenter. They had forty trials the first day to learn task 1, and forty trials the second day to learn task 2. Then, depending on their individual learning speed, rats had between seventeen and twenty days to learn task 3, 4 and 5 (a single condition being presented each day). Once they reached at least 80% success rate on all tasks, rats were implanted with electrodes; after recovery, recording sessions during task performance lasted for six days. During the six recording sessions, the reward contingency was changed approximately midway through the session and hippocampal replays were analyzed when rats paused at reward locations. Original analyses of replayed sequences [6] revealed that: during same-side replays (i.e., replays representing sequences of previously visited locations on the same arm of the maze as the current rat position) forward and backward replays started from the current position; during opposite-side replays (i.e., representing locations on the opposite arm of the maze) forward replays occurred mainly on the segment leading up to reward sites, and backward replays covered trajectories ending near reward sites. In general, the replay content did not seem to only reflect recently experienced trajectories, since trajectories experienced 10 to 15 minutes before were replayed as well. Indeed, there were more opposite-side replays during task 3 and 4 than during the alternation task. Finally, among all replays, a few were shortcuts never experienced before which crossed a straight path on the top or bottom of the maze between the reward sites. 2.2 Simulation We have reproduced the T-maze configuration with a discrete environment composed of 32 squares (Fig. 1, left), each of them represents a 10 × 10 cm area. States are represented by a vector φ, concatenating place cells activity and a memory of past rewards (Fig. 1, right). The modeled place cells are centered on the discrete positions, their activity (color-coded on Fig. 1) decreases with the Manhattan distance between the simulated rat position to the position they encode (top of Fig. 1). When a path is blocked (contingencies 1 and 2), the activity field does not expand beyond walls and will thus shrink, as is the case of real place cells [17]. To represent the temporal dimension, which is essential during the alternation task, we have added two more components in the state’s vector representation (Fig. 1, right): the left side reward memory (L) and the right side reward memory (R). They take a value of 1 if the last reward was obtained on that side, 0.5 if the penultimate reward was on that side, and 0 if that side has not been rewarded during the last two reward events. Therefore, after two successful laps, the task at hand can be identified by the agent based on the value of this memory (Tab. 1). This ability to remember the side of the rewards is supposed to be anchored both on the different position and flavor cues that characterize each side. Since it has been shown that, beyond purely spatial information, the hippocampus contains contextual information important for the task at hand [18], we hypothesize that this memory is also encoded within the hippocampus, along with the estimation of the agent’s current position. The agent can choose between four actions: North, South, East and West. As in the real experiment, the agent cannot run backward. Table 1. State of the L and R memory components of φ and corresponding meaning in terms of task at hand, after two successful laps. L 1 0 0.5 1 R 0 1 1 0.5 Task identification (after 2 laps) Always turn right (Tasks 1 & 3) Always turn left (Tasks 2 & 4) Alternation (Task 5), go left next time Alternation (Task 5), go right next time 2.3 Neural DynaQ with a prioritized sweeping algorithm Our algorithm is based on a Dyna architecture [12] which means that, as in model-based architectures, we need to learn a world model composed of a reward and a transition model [19]. In order to implement prioritized sweeping [13,14], the transition model must be designed so as to allow the prediction of the predecessors of a state s given an action a, because it will be needed to backpropagate the reward prediction computed in state s to its predecessors. Hence, our architecture is composed of two distinct parts: one dedicated to learning the world model, and the other one to learning the Q-values. Algorithm 1 LearnWM: learn the world model collect S // a set of (φt , φt−1 , a, r) quadruplets for k ∈ {N, S, E, W } do SPk ← {(φt , φt−1 ) : (φt , φt−1 , a, r) ∈ S and a = k} k ← {(φt , r) : (φt , φt−1 , a, r) ∈ S and a = k} SR for f ∈ {P, R} do // P,R: Predecessor and Reward types of networks Nfk ← null // list of networks (outputs) Gfk ← null // list of networks (gates) k k create Nnew ; append Nnew to Nfk k k create Gnew ; append Gnew to Gfk GALMO(Sfk , Nfk , Gfk ) // refer to Algo 2 for this specific training procedure end for end for Learning the world model. Two sets of neural networks compose the world model. Four reward networks NRa , one for each action a, learn the association between (state, action) couples and rewards (NRa : s → r(s, a)). Four other networks NPa learn the states for which a transition to a given state s is produced after execution of action a, i.e., the predecessors of s (NPa : s → {s0 }). Owing to the nature of the task (navigation constrained by corridors) and the states’ representation, the data that must be learned are not independent. Indeed, successive state vectors are very similar due to the overlap between place-fields, and are always encountered in the same order during tasks execution (because the agent always performs the same stereotyped trajectories along the different corridors). However, it is well known that the training of a neural network is guaranteed to converge only if there is no correlation in the sequence of samples submitted during learning, a condition that is often not respected when performing on-line reinforcement learning [20]. We indeed observed that in the task at hand, despite its simplicity, it was necessary to store the successive observations and to train the world model off-line with a shuffled presentation of the training samples (for the general scheme of the off-line training, see Algo. 1). For that reason, we created a dataset S compiling all transitions, i.e (φt , φt−1 , a, r) quadruplets from all tasks. When there is no predecessor of φt by action a (as can be the case when this action would require to come through a wall), the transition is represented as (φt , 0, a, r): those ”null” transitions allow NPa networks to represent the fact that the transition does not exist. Correct alternation from left to right T2 T2 T1 Memory part of Φ: Followed by a wrong choice at T2 R R T2 T1 L=1 R=0.5 L=0.5 R=1 L=0.5 R=1 L=1 R=0.5 T1 same action different predecessors L=1 R=0.5 L=1 R=0.5 R Fig. 2. Example of multiple predecessors in the alternation task. The agent first correctly goes to the right (left). It then goes to the left (middle) where, at the reward site, its predecessor state has a (L = 0.5, R = 1) memory component. It then makes a wrong decision and goes to the left again (right), but is not rewarded: at this last position, the location component of the predecessor state (white mouse) is identical but the memory component is different (L = 1, R = 0.5) from the previous lap. Violet gradient: past trajectory; white mouse: previous position; gray mouse: current position; white R: agent rewarded; black R: current position of the reward. Despite its simplicity, the navigation task modeled here has some specificities: during task 5 (alternation), some states have more than one predecessor for a given action (see an example on Fig. 2), the algorithm must thus be capable of producing more than one output for the same input. To do that, we have created a growing type of algorithm inspired by mixture of expert algorithms [21] (which we call here the GALMO algorithm, see Algo. 2), based on the following principles: – The algorithm should allow the creation of multiple Ni networks (if needed) so that a single input can generate multiple outputs. Each of these network is coupled with a gating network Gi , used after training to know if the output of Ni has to be taken into account when a given sample is presented. – When a sample is presented, the algorithm should only train the Ni network that generates the minimal error (to enforce network specialization), and remember this training event by training Gi to produce 1 and the other Gk6=i to produce 0. – The algorithm should track the statistics of the minimal training errors of each sample during an epoch, so as to detect outliers (samples whose error is much higher than the others’). GALMO assumes that these outliers are caused by inputs who should predict multiple outputs and are stuck in predicting the barycenter of the expected outputs. A sample is considered an outlier when its error is larger than a threshold θ, equal to the median of the current error distribution, plus w times the amplitude of the third quartile (Q3 − median). When such a detection occurs, a new network is created on the fly, based on a copy of the network that produced the minimal error for the sample. The new network is then trained once on the sample at hand. Algorithm 2 GALMO: Growing algorithm to learn multiple outputs INPUT: S, N , G OUTPUT: N , G // S = h(in0 , out0 ), ..., (inn , outn )i : list of samples // N = hN0 i : lists of neural networks (outputs) // G = hG0 i : lists of neural networks (gates) θ ← +∞ for nbepoch ∈ {1, maxepoch} do M ← null // M is a list of the minimal error per sample for each (in,out)∈ S do E ← null // E is a list of errors for a sample for each N ∈ N do append kN (in) − outkL1 to E end for if min(E) < θ then backprop(Nargmin(E) , in, out) backprop(Gargmin(E) , in, 1) for each G ∈ G with G 6= Gargmin(E) do backprop(G, in, 0) end for else create Nnew ; append Nnew to N Nnew ← copy(Nargmin(E) ) backprop(Nnew , input =in, target =out) create Gnew ; append Gnew to G backprop(Gnew , in, 1) end if end for θ ← median(M) + w ∗ (Q3(M) − median(M)) end for In principle, the algorithm could be modified to limit the maximal number of created networks, or to remove the networks that are not used anymore, but these additions were not necessary here. Neural Dyna-Q. The second part of the algorithm works as a classical neural network-based Dyna-Q [16] with prioritized sweeping [13,14]. As in [16], a the Q-values are represented by four 2-layer feedforward neural networks NQ (one per action). During on-line phases, the agent makes decisions that drive its movements within the maze, and stores the samples in a priority queue, their priority is the absolute value of the reward prediction error, i.e., |δ|. Every time the agent receives a reward, similarly to rats, it stops and replays are simulated with a budget B (Algo. 3): the samples with the highest priority are replayed Algorithm 3 Neural Dyna-Q with prioritized sweeping & multiple predecessors INPUT: φt=0 , NP , GP , NR , GR a∈{N,S,E,W } OUTPUT: NQ PQueue ← {} // PQueue: empty priority queue nbTrials ← 0 repeat a ← softmax(NQ (φt )) take action a, receive r, φt+1 a backprop(NQ , input = φt , target = r + γmaxa (NQ (φt+1 )) a Put φt in PQueue with priority |NQ (φt ) − (r + γmaxa (NQ (φt+1 )))| if r> 0 then nbReplays ← 0 Pr = hi // empty list of predecessors repeat φ ← pop(PQueue) for each GP ∈ GP do if GP (φ) > 0 then k ← index(GP ) append NPk (φ) to Pr end if end for for each p ∈ Pr s.t norm(p) >  do for each a ∈ {N, S, E, W } do a a a (φ))) (p) + γmaxa (NQ , input = p, target = NR backprop(NQ a a a (φ)))| (p) + γmaxa (NQ (p) − (NR Put p in PQueue with priority |NQ nbReplays ← nbReplays + 1 end for end for until PQueue empty OR nbReplays ≥ B end if φt ← φt+1 nbTrials ← nbTrials +1 until nbTrials = maxNbTrials first, their potential predecessors are then estimated and placed in the queue with their respective priorities, and so on until the replay budget is exhausted. The various parameters used in the simulations are summarized in Tab. 2. 3 3.1 Results Learning the world model Because of correlations in sample sequences, the world model is learned off-line: the samples are presented in random order, so as to break temporal correlations. We illustrate this necessity with the learning of the reward networks NR : when trained on-line (Fig. 3, left), the reward networks make a lot of erroneous pre- Table 2. Parameter values. value parameter 4000 maxepch: number of epoch replays to train the world model 3 w: gain of the outlier detector threshold in GALMO 20 B: replay budget per stop at reward sites 2 number of layers in NP , NR and NQ 10, 16, 26 size of the hidden layers in NQ , NR and NP (respectively) ±0.05, ±0.0045, ±0.1 weight initialization bound in NQ , NR and NP (resp.) 0.5, 0.1, 0.1 learning rate in NQ , NR and NP (resp.) 0.9, 1, 1 sigmoid slope in NP , NR and NQ (resp.) (hidden layer) 0.5, 0.4, 0.4 sigmoid slope in NP , NR and NQ (resp.) (output layer) Fig. 3. Reward predictions are inaccurate when the model is trained on-line (Left panel) and accurate when it is trained off-line (Right panel). L, R: memory configuration. Note the use of a logarithmic scale, so as to make visible errors of small amplitude. dictions for each possible task, while when trained off-line with samples presented in randomized order, the predictions are correct (Fig. 3, right). With a single set of NP networks, the error of the whole set of states decreases steadily with learning, except for four states which have multiple predecessors (Fig. 4, top left). With the GALMO algorithm, when the error of these states reaches the threshold θ (in red on Fig. 4, top right), networks are duplicated and specialized for each of the possible predecessors. We repeated the experiment 10 times. It always converged, with a number of final networks comprised between 2 and 5 (3 times 2 networks, 1 time 3, 5 times 4, and 1 time 5). 3.2 Reinforcement learning with multiple predecessors We compare the efficiency of the Dyna-Q model we developed with the corresponding Q-learning (i.e. the same architecture without replays with the world model). As expected, Q-learning is able to learn the task, measured here with the proportion of erroneous choices at the decision point T2 (Fig. 4, bottom left). On average it does not fully converge before 1000 epochs of training, the Dyna-Q learns much faster, thanks to the replay mechanism (Fig. 4, bottom right), converging on average after 200 trials. Error evolution at state T2 Error evolution at state T2 1 0.9 0.8 0.8 0.7 0.7 0.6 0.6 Errors Errors 1 0.9 0.5 0.5 0.4 0.4 0.3 0.3 0.2 0.2 0.1 0 0 0.1 200 400 600 800 1000 1200 1400 1600 1800 2000 0 0 200 400 600 800 #episodes 1000 1200 1400 1600 1800 2000 #episodes Fig. 4. Top: Learning error dynamics without (left) and with (right) GALMO. Errors of all samples (gray) during epochs of training. GALMO allows for the creation of multiple prediction networks to handle the states where multiple outputs have to be generated. Bottom: Learning without (left) and with (right) replays. Evolution of the proportion of decision errors at point T2 during the alternation task. Blue: 10 run average, light blue: standard deviation. 3.3 Preliminary analysis of generated replays Always Right B RND Same Opposite Always Left B Alternate B RND Same Opposite Same Central F RND Opposite Central O Fig. 5. Type of replays. B: backward, F: forward, RND: random. We analyze a posteriori the state reactivations caused by the prioritized sweeping DynaQ algorithm in always turn right, always turn left and alternate tasks. Prioritized sweeping does not rely on explicit replay of sequences, but it however favors them. We considered sequences or replays implying three or more consecutive steps; with 128 possible states, a 3-state sequence has a chance level of 0.01% of being produced by a uniform random selection process. We observed in all cases (Fig. 5) that a bit more than 80% of the state reactivations did not correspond to actual sequences. Most of the sequences are backward, except for the alternate task, which also generated 4.5% of forward ones. As in [6], we classified these sequences as being on the same side as the current agent location, on the opposite side, or in the central part of the maze. There is no clear pattern here, except that central reactivations were observed in the alternate task only. 4 Discussion We proposed a new neural network architecture (GALMO) designed to associate multiple outputs to a single input, based on the multiple expert principle [21]. We implemented a neural version of the DynaQ algorithm [16], using the prioritized sweeping principle [13,14], using GALMO to learn the world model. This was necessary because the evaluation task, adapted from [6], contained some states that have multiple predecessor. We showed that this system is able to learn the multiple predecessors cases, and to solve the task faster than the corresponding Q-learning system (i.e., without replays). This required learning the world-model off-line, with data presented in shuffled order, so as to break the sequential correlations between them, which prevented the convergence of the learning process. A neuroscience prediction derives from this result (independently from the use of GALMO): if the learning principles of the rat brain are similar to those of the gradient descent for artificial neural network, then the world model has to be learned off-line, which would be compatible with non-sequential hippocampal replays. Besides, the part of the DynaQ algorithm that uses the world model to update the Q-values predicts a majority of non-sequential replays, but also 15 to 20% of sequential reactivations, both backward and forward. Concerning GALMO, it has been tested with a quite limited set of data, and should thus be evaluated against larger sets in future work. In our specific case, the reward networks NRa did not require the use of GALMO; a single network could learn the full (s, a) → r mapping as rewards were deterministic. But should they be stochastic, GALMO could be used to learn the multiple possible outcomes. Note that, while it has been developed in order to learn a predecessor model in a DynaQ architecture, GALMO is much more general, and would in principle be able to learn any one-to-many mapping. Finally, in the model-based and dyna reinforcement learning contexts, having multiple predecessors or successors is not an exceptional situation, especially in a robotic paradigm. The proposed approach is thus of interest beyond the task used here. Acknowledgements The authors would like to thank Olivier Sigaud for fruitful discussions. This work has received funding from the European Unions Horizon 2020 research and innovation programme under grant agreement No 640891 (DREAM Project). This work was performed within the Labex SMART (ANR-11-LABX-65) supported by French state funds managed by the ANR within the Investissements d’Avenir programme under reference ANR-11-IDEX-0004-02. References 1. O’Keefe, J., Dostrovsky, J.: The hippocampus as a spatial map. preliminary evidence from unit activity in the freely-moving rat. Brain research 34(1) (1971) 171–175 2. Wilson, M.A., McNaughton, B.L., et al.: Reactivation of hippocampal ensemble memories during sleep. Science 265(5172) (1994) 676–679 3. Girardeau, G., Benchenane, K., Wiener, S.I., Buzsáki, G., Zugaro, M.B.: Selective suppression of hippocampal ripples impairs spatial memory. Nature neuroscience 12(10) (2009) 1222–1223 4. Foster, D.J., Wilson, M.a.: Reverse replay of behavioural sequences in hippocampal place cells during the awake state. Nature 440(7084) (2006) 680–3 5. Lee, A.K., Wilson, M.A.: Memory of Sequential Experience in the Hippocampus during Slow Wave Sleep. Neuron 36(6) (2002) 1183–1194 6. Gupta, A.S., van der Meer, M.A.A., Touretzky, D.S., Redish, A.D.: Hippocampal Replay Is Not a Simple Function of Experience. Neuron 65(5) (2010) 695–705 7. Chen, Z., Wilson, M.A.: Deciphering neural codes of memory during sleep. Trends in Neurosciences (2017) 8. Peyrache, A., Khamassi, M., Benchenane, K., Wiener, S.I., Battaglia, F.P.: Replay of rule-learning related neural patterns in the prefrontal cortex during sleep. Nature Neuroscience 12(7) (2009) 919–926 9. McClelland, J.L., McNaughton, B.L., O’reilly, R.C.: Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and memory. Psychological review 102(3) (1995) 419 10. De Lavilléon, G., Lacroix, M.M., Rondi-Reig, L., Benchenane, K.: Explicit memory creation during sleep demonstrates a causal role of place cells in navigation. Nature neuroscience 18(4) (2015) 493–495 11. Cazé, R., Khamassi, M., Aubin, L., Girard, B.: Hippocampal replays under the scrutiny of reinforcement learning models. submitted (2018) 12. Sutton, R.S.: Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In: Proceedings of the seventh international conference on machine learning. (1990) 216–224 13. Moore, A.W., Atkeson, C.G.: Prioritized sweeping: Reinforcement learning with less data and less time. Machine learning 13(1) (1993) 103–130 14. Peng, J., Williams, R.J.: Efficient learning and planning within the dyna framework. Adaptive Behavior 1(4) (1993) 437–454 15. Khamassi, M., Lacheze, L., Girard, B., Berthoz, A., Guillot, A.: Actor-critic models of reinforcement learning in the basal ganglia: from natural to arificial rats. Adaptive Behavior 13 (2005) 131–148 16. Lin, L.H.: Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning 8(3/4) (1992) 69–97 17. Paz-Villagrán, V., Save, E., Poucet, B.: Independent coding of connected environments by place cells. European Journal of Neuroscience 20(5) (2004) 1379–1390 18. Eichenbaum, H.: Prefrontal–hippocampal interactions in episodic memory. Nature Reviews Neuroscience 18(9) (2017) 547 19. Sutton, R., Barto, A.: Reinforcement Learning: An Introduction. Cambridge, MA: MIT Press (1998) 20. Tsitsiklis, J.N., Van Roy, B.: Analysis of temporal-diffference learning with function approximation. In: Advances in neural information processing systems. (1997) 1075–1081 21. Jacobs, R.A., Jordan, M.I., Nowlan, S.J., Hinton, G.E.: Adaptive mixtures of local experts. Neural computation 3(1) (1991) 79–87
9cs.NE
Localization in mobile networks via virtual convex hulls arXiv:1504.01207v2 [cs.SY] 21 Jan 2017 Sam Safavi, Student Member, IEEE, and Usman A. Khan, Senior Member, IEEE Localization is a well-studied problem, which refers to the collection of algorithms that estimate the location of nodes in a network. Relevant applications include traffic control, industrial automation, robotics, and environment monitoring [1]– [4]. In terms of the information used for estimating the locations, localization schemes in Wireless Sensor Networks (WSN) can be classified as range-based, [5]–[7], and rangefree, [8]–[11]. While the former depends on measuring the distance and/or angle between the nodes, the latter makes no assumptions about the availability of such information and relies on the connectivity of the network. The literature on localization also consists of centralized and distributed approaches. Centralized algorithms, [12]–[15], despite their benefits, are impractical in large networks where each node has limited power and communication capability. Some notable distributed localization techniques include successive refinements, [16]–[18], multilateration, [19]–[21], estimation based methods, multidimentional scaling [22], and graph-theoretical methods, [23]–[25]. When ranging data is noisy, the following estimation-based localization techniques are widely used. Maximum Likelihood Estimation (MLE) methods estimate the most probable location of a mobile node based on prior statistical models. MLE only requires (current) measured data and does not integrate prior data. Sequential Bayesian Estimation (SBE) methods use the recursive Bayes rule to estimate the likelihood of an agent’s location. The solution to SBE is generally intractable and cannot be determined analytically. An alternative approach is Kalman-based techniques, which are only optimal when the uncertainties are Gaussian and the system dynamics are linear, [26], [27]. However, localization has always been considered as a nonlinear problem and hence the optimality of Kalman-based solutions are not guaranteed. To address the nonlinear nature of localization problems, other suboptimal solutions to approximate the optimal Bayesian estimation include Extended Kalman Filter (EKF) and Particle Filters (PF), [27]. In particular, Sequential Monte Carlo (SMC) method is a PF that exploits posterior probability to determine the future location of an agent. Localization algorithms specifically designed for mobile networks have been proposed in [8]–[11]. Ref. [8] introduces the Monte Carlo Localization (MCL) method, which exploits mobility to improve the accuracy of localization. Inspired by [8], the authors in [10] propose Mobile and Static sensor network Localization (MSL*) that extends MCL to the case where some or all nodes are static or mobile. Ref [11] proposes variations of MCL, namely dual and mixture MCL to increase the accuracy of the original MCL algorithm. On the other hand, Ref [9] provides Range-based Sequential Monte Carlo Localization method (Range-based SMCL), which combines range-free and range-based information to improve localization performance in mobile sensor networks. In this paper, we consider localization of a mobile network, assuming that each agent measures a noisy version of its distances to the nodes (agents and/or anchors) in its communication radius1 , and the motion it undertook, e.g., by using an accelerometer. We focus on scenarios where GPS (or related positioning system) is compromised and/or unavailable, and develop a collaborative algorithm for a network of agents/robots to find their locations in order to implement a location-aware task or a mission. As an example, consider a network of mobile robots with no central or local coordinator and with limited communication, whose task is to transport goods in an indoor facility where GPS signals are not avail- The authors are with the Department of Electrical and Computer Engineering, Tufts University, 161 College Ave, Medford, MA 02155, {sam.safavi@,khan@ece.}tufts.edu. This work is partially supported by an NSF Career award: CCF # 1350264. 1 In wireless networks, the distance may be estimated with, e.g., Received Signal Strength (RSS), Time of Arrival (ToA), Time Difference of Arrival (TDoA) measurements, [28]. We further note that the distance information can also be obtained using a camera at each agent, [29]. Abstract—In this paper, we develop a distributed algorithm to localize an arbitrary number of agents moving in a bounded region of interest. We assume that the network contains at least one agent with known location (hereinafter referred to as an anchor), and each agent measures a noisy version of its motion and the distances to the nearby agents. We provide a geometric approach, which allows each agent to: (i) continually update the distances to the locations where it has exchanged information with the other nodes in the past; and (ii) measure the distance between a neighbor and any such locations. Based on this approach, we provide a linear update to find the locations of an arbitrary number of mobile agents when they follow some convexity in their deployment and motion. Since the agents are mobile, they may not be able to find nearby nodes (agents and/or anchors) to implement a distributed algorithm. To address this issue, we introduce the notion of a virtual convex hull with the help of the aforementioned geometric approach. In particular, each agent keeps track of a virtual convex hull of other nodes, which may not physically exist, and updates its location with respect to its neighbors in the virtual hull. We show that the corresponding localization algorithm, in the absence of noise, can be abstracted as a Linear TimeVarying (LTV) system, with non-deterministic system matrices, which asymptotically tracks the true locations of the agents. We provide simulations to verify the analytical results and evaluate the performance of the algorithm in the presence of noise on the motion as well as on the distance measurements. I. I NTRODUCTION 2 able. In order to perform a delivery task, each mobile robot has to know its own location first. In such settings, we are interested in developing an anchor-based distributed algorithm that uses only the distance and angle measurements to track the agent locations such that the convergence is invariant to the initial position estimates. However, the implementation and analysis of such distributed algorithm in mobile networks is not straightforward, because: (i) an agent may not be able to find nearby nodes at any given time to implement a distributed algorithm; (ii) an agent may not be in the proximity of an anchor at any given time; (iii) the neighborhood at each agent is dynamic, resulting into a time-varying distributed algorithm. In this context, the main contribution of this work is to develop a linear framework for localization that enables us to circumvent the challenges posed by the predominant nonlinear approaches to this problem. This linear framework is not to be interpreted as a linearization of an existing nonlinear algorithm. Instead, the nonlinearity from range to location is embedded in an alternate representation provided by the barycentric coordinates. However, forcing this linear update comes at a price, i.e., a location update is only possible when an agent lies in a triangle (convex hull in R2 ) formed by three neighboring nodes. Since such neighbors may never exist, see (i) above, we introduce the notion of a virtual convex hull. We then show that localization in mobile networks can be achieved with exactly one anchor when the total number of nodes (agents and anchors) is at least 4 in R2 . This is in stark contrast to the requirement of at least 3 anchors that is prevalent in the triangulation-based localization literature. See [30] for a recent survey on localization approaches with single vs. multiple anchor nodes. As we will discuss in Section V, we abstract the corresponding localization algorithm as a Linear Time-Varying (LTV) system whose system matrices may be: identity–when no location update occurs; stochastic–when there is no anchor among the neighbors of the updating agent; and, strictly sub-stochastic–when the neighborhood includes at least one anchor. Note that the order in which the updates occur and the weights assigned to the neighbors are not known a priori. To address these challenges, we apply a novel method to study LTV convergence by partitioning the entire chain of system matrices into slices and relating the convergence rate to the slice lengths. In particular, we show that the algorithm converges if the slice lengths do not grow faster than a certain exponential rate. Since our localization scheme is based on the motion and the distance measurements, it is meaningful to evaluate the performance of the algorithm when these parameters are corrupted by noise. Therefore, we study the impact of noise on the convergence of the algorithm and provide modifications to counter the undesirable effects of noise. Owing to the linear representation, we are able to provide a few simple yet comprehensive modifications to the proposed approach, which as shown in the simulations lead to a bounded error in the location estimates. We now describe the rest of the paper. In Section II, we formulate the problem. We introduce the geometric approach to track the distances in Section III. We then provide our localization algorithm that relies on the notion of virtual convex hull in Section IV, followed by the convergence analysis in Section V. In Section VI, we examine the effects of noise on the algorithm. We provide simulation results and compare the performance of the algorithm with MCL, MSL*, Dual MCL, and Range-based SMCL algorithms in Section VII. Finally, Section VIII concludes the paper. II. P RELIMINARIES AND P ROBLEM FORMULATION Consider a network of N mobile agents, in the set Ω, with unknown locations, and M anchor(s), in the set κ, with fixed known locations, all located in R2 ; let Θ = Ω ∪ κ be the set of 2 all nodes. Let xi∗ k ∈ R be a row vector that denotes the true location of the i-th agent, i ∈ Ω, at time k, where k ≥ 0 is the discrete-time index. Regardless of what motion modality (aerial, ground, kinematics) is employed by the agents, their motion can be expressed as the deviation between the current and next locations, i.e., i∗ eik+1 , xi∗ k+1 = xk + x i ∈ Ω, (1) eik is the true motion vector at time k. We assume that where x the agents move along straight lines, or otherwise the motion trajectories can be approximated by a piecewise linear model. This is a common assumption in robotics literature [31], e.g., a simple differential wheeled robot whose wheels run in the same direction and speed, will move in a straight line. We bik , of this also assume that agent i measures a noisy version, x motion, e.g., by using an accelerometer: bik = x eik + nik , x (2) where nik is the accelerometer noise at time k. We assume that the motion is restricted in a bounded region in R2 . We define the distance between any two nodes, i and j, measured at the time of communication, k, as deij k . We assume that the ij b distance measurement, dk , at node i is not perfect and includes noise, i.e., ij eij dbij (3) k = dk + rk , in which rkij is the noise in the distance measurement at time k. The problem is to find the locations of the mobile agents in the set Ω given any initialization of the underlying algorithm. We then consider the minimal number of anchors required for such a process to work. Main idea: We now describe the main idea behind our approach. In order to avoid nonlinearity in the solution2 , we consider a barycentric-based linear representation of positions; the advantage of a linear approach is that the convergence is independent of the initial location estimates. Let Θi (k) denote a set of three agents such that agent i lies inside their convex hull, C(Θi (k)), at time k. In the barycentric-representation, the location of node i is described by a linear-convex combination of the nodes in Θi (k), i.e., i1 1∗ i2 2∗ i3 3∗ xi∗ k = ak xk + ak xk + ak xk , Θi (k) = {1, 2, 3} (4) 2 When only distances to at least m+1 anchors are known in Rm , trilateration, e.g., in R2 , requires 3 anchors and solves 3 circle equations, [32]. Clearly, trilateration is nonlinear and coupled in the coordinates; while an iterative procedure built on these nonlinear updates does not converge in general. 3 in which xi∗ k represents the true location of node i at time k, and the coefficients, aij k ’s, are the barycentric coordinates, associated to Möbius, [33], given by AΘi (k)∪{i}\j aij , (5) k = AΘi (k) where AΘi (k)∪{i}\j denotes the area of the convex hull formed by the agents in the subscript set. To implement this update, agent i has to lie inside the convex hull of the (three) neighbors in the set Θi (k). Appendix F provides a simple procedure, [34], to test if an agent lies inside or outside of the convex hull formed by the nearby nodes. Finally, note that the barycentric coordinates are always positive and they sum to 1. Challenges and our approach: To implement the above barycentric-based procedure, agent i must acquire the mutual distances among the 4 nodes (in the set {i∪Θi (k)}). However, an agent may never find such a convex hull because the nodes are mobile, in a region possibly full of obstacles, with limited communication and/or visual radius. To address this challenge, we provide a geometric approach that allows an agent to track its distance to any location, where it has exchanged information with the other nodes in the past (Section III-A). We further show that at the time of communication an agent can compute the distance between a neighbor and any such locations (Section III-B). Using these methods, we introduce the notion of a virtual convex hull, which is a triangle whose vertices are located at the virtual locations where the agent exchanged information in the past (Section IV). The described approach results in a rather opportunistic algorithm where an update occurs only when a certain set of real and virtual conditions are satisfied. The subsequent analysis is to characterize the convergence of such LTV algorithms whose system matrices are non-deterministic. In this paper, we rigorously develop the conditions of convergence and study the locationtracking performance of this procedure (Section V). We now enlist our assumptions: i∗ A0: Each anchor, i ∈ κ, knows its location, xi∗ k = x0 , ∀k. i bk , of its A1: Each agent, i ∈ Ω, has a noisy measurement, x eik , see Eq. (2). motion vector, x A2: Each agent, i ∈ Ω, has a noisy measurement, dbij k , of the distances to nodes, j ∈ Θ within a radius, r, see Eq. (3). Under the above assumptions, we are interested in finding the true locations of each agent in the set Ω, without the presence of any central coordinator. In the process, we study what is the minimal number of anchors required and in particular: does mobility reduce the number of anchors3 from 3 in R2 (Section V). In the following, we first discuss the ideal scenario when the motion and distance measurements are not affected by noise. We then evaluate the performance of the algorithm in the presence of noise on the motion as well as on the distance measurements, and present a modified algorithm to counter the undesirable effects of noise (Section VI). the true location of the i-th agent, i ∈ Ω in R2 , be decomposed i∗ i∗ as xi∗ k = [xk yk ]. We then describe the motion of agent i as: ! k+1 X i∗ i∗ i i i xk+1 = xk + dk→k+1 cos θk0 →k0 +1 + θ0 , i∗ yk+1 = yki∗ + dik→k+1 k0 =1 k+1 X sin ! θki 0 →k0 +1 + θ0i , (6) k0 =1 i where dik→k+1 and θk→k+1 denote the distance and angle traveled by agent i, between time k and k + 1, and θ0i is agent i’s initial orientation4 , see Fig. 1. Let us also consider 𝜃0𝑛 𝐱 0𝑛 𝜃0𝑖 ∗ ∗ ∗ 𝑗 𝐱 0𝐴 𝐱 0𝑖 𝜃0 𝜃0𝑙 𝑗∗ 𝐱0 𝑙∗ 𝐱0 Fig. 1. Initial orientations of N = 4 agents; filled colored circles and red triangle indicate the initial locations of the agents, i, j, l, n and the anchor, A, respectively; red circle shows the communication radius of agent i. a vision-based distance measurement process, where an agent needs to see another agent with its camera in order to find the mutual distance, as opposed to wireless-based distance measurements that are prone to extremely large errors. When agent i moves to a new location at time k, it first scans the neighborhood, i.e., rotates by an angle, 0 ≤ βki < 2π, in order to find (and make visual contact with) another node (agent or anchor). If the agent does not find any neighbor at time k, then βki = 0. If on the other hand, agent i finds another node within the communication radius, it exchanges information with that node, then makes another rotation by an angle, 0 ≤ αki < 2π, which is randomly chosen at each iteration, and travels the distance of dik→k+1 in the new direction. Thus, the angle traveled by agent i between time k i and k + 1, θk→k+1 , can be represented as i θk→k+1 = αki + βki k ≥ 0. (7) III. A G EOMETRIC A PPROACH TOWARDS L OCALIZATION In this section, we consider the motion and distance in the noiseless case, i.e., nik = 0 and rkij = 0, in Eqs. (2) and (3). Let Before we proceed, note that under perfect motion and noiseless distance measurements, an agent cannot find its position by direct communication with an anchor, unless it knows its angle towards the anchor with respect to a mutual frame; in contrast, the proposed framework in this paper assumes that only relative angles are known to each agent. For example, agent i in Fig. 1 initially finds anchor A in its communication radius. However, in order to find its exact location, agent i needs to know θ0i , in addition to xA∗ and deiA 0 0 . We assume that such angles are not available to the agents. In what follows, we first explain the procedure to track the distance between an agent and the locations where it has exchanged information with other nodes in the past. We 3 The minimal number of anchors required to solve a localization problem, without ambiguity, given only distance measurements is m in Rm , [32]. 4 Note that these initial orientations, θ i ’s, are arbitrary and we neither 0 assume any global synchronization nor we know what the true angles are. 4 then show how an agent can compute the distance between a neighbor and any such location at the time of communication. A. Tracking the distance after a direct communication Consider an agent, i ∈ Ω, to fall within a distance, r, of node, j ∈ Θ, at some time kj ; by Assumption A2, agent i can measure its distance, deij kj to node j, and receive j-th node’s location estimate, hereinafter denoted as xjkj . Once this information is acquired at time kj , agent i tracks the distance to the true position, xj∗ kj , for all k ≥ kj , even when the two agents move apart. In other words, agent i, has the following information for each node it has communicated with: {j, kj , deij , xj }, k ≥ kj , j ∈ Θ, (8) k kj where kj is the instant of the most-recent contact, and deij k is j∗ the distance between the true positions, xi∗ and x , k ≥ kj . k kj This procedure is illustrated in Fig. 2. Note that in order to 𝑗∗ We now show how agent i can use the distance/angle information to find the distances between a neighbor and any virtual location, where it has previously communicated with another node. Lemma 2. Suppose agent i has previously made contact with node, j, hence possesses the following information: j {j, kj , deij k , xkj }, k ≥ kj , Suppose agent i finds a neighbor, say agent `, at time k` > kj . `∗ Agent i can then find the distance between xj∗ kj and xk` as follows: q 2 ei` 2 eij ei` eij ei` (deij (10) dej` = k` ) + (dk` ) − 2dk` dk` cos ∠(dk` , dk` ), k` j∗ i∗ in which deij k` is the distance between xk` and xkj , ei` and ∠(deij k` , dk` ) is the angle between the two lines connectj∗ `∗ ing xi∗ k` to xkj and xk` . 𝑗∗ 𝐱 𝑘𝑗 𝑗∗ 𝐱 𝑘𝑗 𝜷𝑖𝑘𝑗 𝐱 𝑘𝑗 𝑖𝑗 𝒅𝑘𝑗 𝜶𝑖𝑘𝑗 ∗ 𝐱 𝑘𝑖 𝑗 𝑖𝑗 𝒅𝑘𝒋+1 ∗ 𝐱 𝑘𝑖 𝑗 ∗ 𝐱 𝑘𝑖 𝑗 +1 (𝒂) (𝒃) 𝑗∗ 𝐱 𝑘𝑗 𝑖𝑗 𝑑𝑘𝑗 +1 𝒅𝑘𝑗 𝜶𝑖𝑘𝑗 𝑗∗ ∗ 𝐱 𝑘𝑖 𝑗 𝒅𝑖𝑘𝑗→𝑘𝑗+1 𝜑1 𝒅𝑖𝑘𝑗 +1→𝑘𝓁 ∗ 𝐱 𝑘𝑖 𝑗 ∗ 𝐱 𝑘𝑙 𝑗 +1 𝒅𝑘𝒋 ∗ 𝐱 𝑘𝑖 𝑗 𝜑3 ∗ 𝐱 𝑘𝑖 𝓁 ∗ 𝐱 𝑘𝑖 𝑗 +1 𝑖𝑗 𝜶𝑖𝑘𝑗 𝜑2 𝜶𝑖𝑘𝑗 +1 𝐱 𝑘𝑗 𝑖𝑗 ∗ 𝐱 𝑘𝑖 𝑗 +1 (𝒄) B. Finding the distance with indirect communication 𝑖𝑗 𝒅𝑘𝓁 𝓁𝑗 𝒅𝑘 𝓁 𝜑4 𝒅𝑖𝓁 𝑘𝓁 𝜷𝑖𝑘𝓁 ∗ 𝐱 𝑘𝑙 𝓁 ∗ 𝐱 𝑘𝑙 𝑗 +1 𝜷𝑖𝑘𝑗 +1 (𝒅) Fig. 2. Distance tracking after a direct communication; agent i is indicated by red filled circle; agents j and l are represented by blue and green circles, respectively; red circle indicates the communication radius. make contact with agent j, agent i has changed its orientation by βki j at time kj , see Fig. 2 (a). After the two agents exchange information, agent i changes its orientation by αki j , Fig. 2 (b), and travels the distance of dikj →kj +1 in the new direction, Fig. 2 (c). We now show how an agent tracks the distance to a virtual location, where it has exchanged information with another node in the past. Lemma 1. Consider agent, i ∈ Ω, with true position, xi∗ kj . Suppose agent i communicates with node, j ∈ Θ, at time kj . Let deij kj be the distance between i and j at the time of communication. Suppose agent i and j move apart at time kj + 1, where the motion is given by dikj →kj +1 and θki j →kj +1 , both known to agent i. The distance between the true posij∗ tions, xi∗ kj +1 and xkj , is Fig. 3. At time k` , agent i finds the distance between a new neighbor, node `, and the virtual location, xj∗ kj , where it exchanged information with node j at time kj < k` . See Appendix C for the proof. In the next section, we use these distance tracking methods to describe the position tracking algorithm. IV. D ISTRIBUTED M OBILE L OCALIZATION : A LGORITHM Consider a network of N agents with unknown locations and M anchors, according to the motion model introduced in Section II. Let Vi (k) ⊆ Θ be the i-visited set, defined as the set of distinct nodes visited by agent, i ∈ Ω, up to time k; and call an element in this set as i-visited node. We start by introducing the notion of a virtual convex hull. A. Virtual convex hull Suppose agent i communicates with node j at time kj , and obtains the distance, deij kj to j, along with j’s current location j estimate, xkj , i.e., j ∈ Vi (kj ). At any time, k > kj , agents, i  1 and j, may move apart but agent i now knows deij k ∀k > kj , 2 ij ij 2 i 2 ij i i e e e dkj +1 = (dkj ) + (dkj →kj +1 ) − 2dkj dkj →kj +1 cos(αkj ) . (9) using the geometric framework discussed in Section III-A. See Appendix B for the proof. Note that at time kj + 1, At some later time, k` > kj , agent i makes contact with ` i` agent i finds agent l in its communication radius, hence another node, `, and thus obtains xk` and dek` , and keeps i i` e changes its direction by βkj +1 in order to make contact with track of dk , ∀k > k` , thus j, ` ∈ Vi (k), ∀k ≥ k` . Using agent l, see Fig 2 (d). the approach described in Section III-B, at time k` , agent i 5 j∗ `∗ also computes dej` k` , i.e., the distance between xkj and xk` . Finally, agent i meets agent n at some kn > k` , and thus now possesses the location estimates: xjkj , x`k` , xnkn ; and the distances: deiq k , k > kn , with q = j, `, n (computed by Lemma 1), enj en` along with the following distances: dej` kn , dkn , and dkn (computed by Lemma 2). At this point j, `, n ∈ Vi (k), ∀k ≥ kn , and agent i can use the 6 distances to perform the inclusion test, described in Appendix F, to check if the three visited nodes forms a virtual convex hull in which agent i lies at time k. If the test is passed, the set, Θi (k) , {j, `, n} ⊆ Vi (k), forms the virtual convex hull; otherwise, agent i continues to move and add nodes in Vi (k) until some combination passes the convexity test. Note that the distance between the agent and each of the virtual locations is updated every time agent i moves to a new location. However, the distance between the virtual locations does not change unless agent i revisits any of the previously visited nodes. Fig. 4 (a) shows the trajectories of four agents: #, 2, D, 7, over k = 1, . . . , 9; the time-indices are marked inside the agent symbols. From the perspective of agent #, see Fig. 4 (b): it first makes contact (communicates) with agent , at time k = 2, and then they both move apart; next, it makes contact with agents, D at kD = 4, and 7 at k7 = 6. We have V# (2) = {2}, V# (4) = {2, D}, and V# (6) = {2, D, 7}, where a non-trivial convex hull becomes available at k = 6. However, agent # does not lie in the corresponding convex hull, C(V# (6)), and cannot update its location estimate D 7 with the past neighboring estimates: x k , xk , xk7 . At this D point, agent # must wait until it either moves inside the convex hull of 2, D, 7, or finds another agent with which the convexity condition is satisfied. Fig. 4 illustrates this process in four frames. The former is shown in Fig. 4 (d), where agent # has moved inside C(V# (6)) at some later time, k = 9; we have Θ# (9) = {2, D, 7}. The notion of a virtual convex hull is evident from this discussion: an agent may only communicate with at most one agent at any given time; when the convexity condition is satisfied eventually, the updating agent may not be in communication with the corresponding nodes. Once Θ# (k) is successfully formed, agent # updates its location linearly using the barycentric representation in Eq. (4), where the coefficients are computed using the distance equations in Lemmas 1, 2, and the Cayley-Menger determinant to compute areas. After this update, agent # removes Θ# (k) from Vi (#), as the location estimates of the nodes in Θ# (k) have been consumed5 . The following result will be useful in the sequel. B. Algorithm We now describe the localization algorithm6 in this case according to the number, |Vi (k)|, of i-visited nodes in the ivisited set, Vi (k). There are two different update scenarios for any arbitrary agent, i: (i) 0 ≤ |Vi (k)| < 3: Agent, i, does not update its current location estimate. (ii) |Vi (k)| ≥ 3 : Agent, i, performs the inclusion test; if the test is passed the location update is applied. Using the above, consider the following update: X ij j eik+1 , xik+1 = αk xik + (1 − αk ) ak xk + x (11) j∈Θi (k) xik where is the vector of the i-th agent’s coordinates at eik+1 is the motion vector, aij time k, x k is the barycentric coordinate of node i with respect to the nodes j ∈ Θi (k), and αk is such that  1, ∀k | Θi (k) = ∅, αk = (12) ∈ [β, 1) , ∀k | Θi (k) 6= ∅, where β is a design parameter and Θi (k) is a virtual convex hull. As we explain later, an updating agent receives the valuable location information only if it updates with respect to an anchor, or another agent that has previously communicated with an anchor. The non-zero self-weights assigned to the previous state of the updating agent guarantees that the agent does not completely forget the valuable information after receiving them, e.g., by performing an update where none of the agents in the triangulation set has previously received anchor information. Note that Θi (k) = ∅ does not necessarily imply that agent i has no neighbors at time k, but only that no set of neighbors meet the (virtual) convexity. The above algorithm can be written in matrix form as ek+1 , xk+1 = Pk xk + Bk uk + x 5 We choose this simple strategy to remove information from Vi (k) for convenience. Another candidate strategy is to use a forgetting factor, which chooses the past used nodes less frequently. (13) where xk is the vector of agent coordinates evaluated at time k, uk is the vector of anchor coordinates at time k, ek+1 is the change in the location of agents at the and x beginning of the k−th iteration according to the motion model. Also Pk and Bk are the system matrix and the input matrix of the above LTV system. We denote the (i, j)-th element of the matrices, Pk and Bk , as (Pk )i,j and (Bk )i,j , respectively. We can now rewrite Eq. (11) as   X j xik+1 = αk xik + (1 − αk )  aij , k xk j∈Θi (k)∩Ω  Lemma 3. For each i ∈ Ω, there exists a set, Θi (k) ⊆ Vi (k), such that |Θi (k)| = 3 and i ∈ C(Θi (k)), for infinitely many k’s. See Appendix D for the proof. k > 0, + (1 − αk )   X m eik+1 , aim +x k uk (14) m∈Θi (k)∩κ where um k denotes the known coordinates of the m-th anchor at time k. Thus, (Pk )i,i = αk as defined in Eq. (12), and (Pk )i,j = (1 − αk )aij k if j ∈ Θi (k) ∩ Ω, (Bk )i,m = (1 − αk )aim if m ∈ Θi (k) ∩ κ, k 6 Main steps of the algorithm are summarized in Appendix E. (15) 6 1 1 3 1 2 5 4 4 5 3 1 4 4 5 3 1 2 2 6 6 5 4 3 4 6 6 5 (b) (c) 6 4 9 7 5 (d) 5 3 1 2 1 5 6 8 2 6 (a) 5 3 1 2 7 1 5 6 3 4 2 4 4 8 5 4 9 1 2 6 4 5 1 5 1 2 6 4 6 3 4 1 2 5 1 5 6 2 3 3 6 4 3 7 2 3 1 9 3 2 3 6 8 1 3 2 3 4 2 2 6 6 7 5 8 9 Fig. 4. Virtual convex hull with four agents: #, 2, D, 7; with respect to agent #: (a) Agent trajectories and time-indices; (b) # ↔  at k = 4, # ↔ D at kD = 4, # ↔ 7 at k7 = 6; circles indicate communication radius of agent #; (c) Virtual convex hull of agents, 2, D, 7, available at agent # at k = 6; (d) Trajectories at k > 6, test passed at k = 9. If the triangulation set for agent i at time k does not contain the j-th agent or the m-th anchor, the corresponding elements in system and input matrices, (Pk )i,j and (Bk )i,m are zero. Note that Eq. (12) immediately implies that the self-weight at each agent is always lower bounded, i.e., 0 < β ≤ (Pk )i,i ≤ 1, ∀k, i. (16) Since accurate information is only injected via the anchors, it is reasonable (and necessary) to set a lower bound on the weights assigned to the anchor states. In particular, we make the following assumption. A3: Anchor contribution. For any update that involves an anchor, i.e., for any (Bk )i,m 6= 0, we assume that 0 < α ≤ (Bk )i,m , ∀k, i ∈ Ω, m ∈ Θi (k) ∩ κ, (17) where α is the minimum anchor contribution, see Section V-B. Assumption A3 implies that if there is an anchor in the (virtual) convex hull, it always contributes a certain amount of information. In other words, the updating agent has to lie in an appropriate position inside the convex hull. Assumption A3 states that the weight assigned to the anchor (which comes from barycentric coordinates) should be at least α. Therefore, the area (in R2 ) of the triangle corresponding to the anchor must take an adequate portion of the area of the whole convex hull triangle. This is illustrated in Fig. 5, where the updating agent lies inside a virtual convex hull, consisting of an anchor (node j), and two other agents, m and `. Node i has communicated with the anchor and the two other agents, at time instants, kj , km , and k` , respectively. 𝑗∗ 𝐱 𝑘𝑗 𝐱 𝑘𝑚∗ 𝑚 Definition 1. A non-negative, stochastic matrix is such that all of its row sums are one. A non-negative, strictly sub-stochastic matrix is such that it has at least one row that sums to strictly less than one and every other row sums to at most one. V. D ISTRIBUTED M OBILE L OCALIZATION : A NALYSIS 𝐱 𝑘𝑚∗ 𝑚 𝐱𝑘𝑖∗′ 𝐱 𝑙∗ 𝑘𝑙 Fig. 5 (Right) on the other hand shows that if the agent lies i∗ l∗ in xi∗ k0 (or any other position within the triangle of xk , xkl , and xm∗ ), the left hand side of Eq. (18) becomes less than α, km and Eq. (17) does not hold. Since the corresponding update does not provide enough valuable information for agent i, no update occurs in this case. With the lower bounds on both the self-weights, Eq. (16), and the anchor weights, Eq. (17), we note that at time k, the matrix of barycentric coordinates with respect to agents with unknown locations, i.e., the system matrix Pk , is either (i) identity, when no update occurs; or, (ii) identity except a stochastic i-th row, when there is no anchor in the virtual convex hull, i.e., Θi (k) ∩ κ = ∅; or, (iii) identity except a strictly sub-stochastic i-th row, when there is at least one anchor in the virtual convex hull7 . In the next section, we provide sufficient conditions under which the iterative localization algorithm, Eq. (13), tracks the true agent locations. Before we proceed, let us make the following definitions to clarify what we mean by (strictly sub-) stochasticity throughout this paper: In this section, we address the challenge on the analysis of LTV systems with potentially non-deterministic system matrices. We borrow the following result on the asymptotic stability of LTV systems from [35]. 𝑗∗ 𝐱 𝑘𝑗 𝐱 𝑘𝑖∗ Fig. 5 (Left) illustrates the position of agent i at time k, xik on the threshold boundaries, such that AΘi (k)∪{i}\j (Bk )i,j = = α. (18) AΘi (k) 𝐱 𝑙∗ 𝑘𝑙 Fig. 5. (Left) At time k, agent i is located on the threshold boundaries, which assigns the minimum weight, α, to the anchor. (Right) At time k0 agent i is located in an inappropriate location inside the convex hull. A. Asymptotic stability of LTV systems Consider an LTV system: xk+1 = Pk xk such that the system matrix, Pk , is time-varying and non-deterministic. The 7 Note that if an agent lies inside a virtual convex hull of three anchors, then practically by assigning a zero weight on its past, the agent can find its exact location and take the role of an anchor, which could subsequently increase the convergence rate of the algorithm. 7 system matrix, Pk , represents at most one state update, say the i-th state, for any k, i.e., at most one row, i, of Pk is different from identity and can be either stochastic or strictly sub-stochastic, not necessarily in any order and with arbitrary elements as long as the bounds in (A3), (B0), and (B1) in the following are satisfied: B0: If the updating row, i, in Pk sums to 1, then 0 < β1 ≤ (Pk )i,i , β1 ∈ R, (19) B1: If the updating row, i, in Pk does not sum to 1, then X (Pk )i,j ≤ β2 < 1, β2 ∈ R. (20) j To analyze the asymptotic behavior of an LTV system with such system matrices, we utilize the notion of a slice, Mj , which is the smallest product of consecutive system matrices, such that the entire chain of systems matrices Q Q is covered by non-overlapping slices, i.e., t Mt = k Pk , and each slice has a subunit infinity norm (maximum row sum), i.e., kMt k∞ < 1, ∀t. 𝑀𝑀0 𝑃𝑃𝑚𝑚0−1 ⋯ 𝑃𝑃1 𝑃𝑃0 𝑀𝑀1 𝑃𝑃𝑚𝑚1−1 ⋯ 𝑃𝑃𝑚𝑚0+1 𝑃𝑃𝑚𝑚0 𝑀𝑀𝑗𝑗 𝑃𝑃𝑚𝑚𝑗𝑗−1 ⋯ 𝑃𝑃𝑚𝑚𝑗𝑗−1+1 𝑃𝑃𝑚𝑚𝑗𝑗−1 Fig. 6. Slice representation. ⋮ ⋮ Slices are initiated by strictly sub-stochastic system matrices, and terminated after all row sums are strictly less than one. Slice representation is depicted in Fig. 6, where the rightmost system matrices (encircled in Fig. 6) of each slice, i.e., P0 , Pm0 , . . . , Pmj−1 . . ., are strictly sub-stochastic. The length of a slice is defined as the number of matrices forming the slice, and for the j-th slice length we have |Mj | = mj − mj−1 , m−1 = 0. Ref. [35] also shows that the upper bound on the infinity norm of a slice is further related to the length of the slice, i.e., the number of matrices forming the slice. The following theorem characterizes the asymptotic stability of the above LTV system. Theorem 1. With Assumptions, B0-B1, the system, xk+1 = Pk xk , converges to zero, i.e., limk→∞ xk = 0N , if for every i ∈ N, there exists a subset, J, of slices such that ! −γ1 1 1 − e(−γ2 i ) ∃Mj ∈ J : |Mj | ≤ ln + 1, (21) ln (β1 ) 1 − β2 for some γ1 ∈ [0, 1], γ2 > 0. For any other slice, j ∈ / J we have |Mj | < ∞. The proof is available in our prior work, [35]. Here, we explain the intuition behind the above theorem. The asymptotic stability of the system is guaranteed if all (or and infinite subset of) slices have bounded lengths. Theorem 1 states that the system is asymptotically stable even in the non-trivial case, where there exist an infinite subset of slices whose lengths are not bounded, but do not grow faster than the exponential growth in Eq. (21). As detailed in [35], if the lengths of an infinite subset of slices follow Eq. (21), the infinite product of slices goes to a zero matrix, and the system is asymptotically stable. Note that in the RHS of Eq. (21), the first ln is negative; for the bound to remain meaningful, the second ln must also −γ1 be negative that requires β2 < e(−γ2 i ) , which holds for any value of β2 ∈ [0, 1) by choosing an appropriate γ2 > 0. Please see [35] for a detailed discussion on Eq. (21) and its parameters. With the help of this theorem, we now analyze the convergence of Eq. (13) in the following section. B. Convergence Analysis We now adapt the above LTV results to the distributed localization setup described in Section II. Recall that the ith row of the system matrix, Pk in Section V-A, collects the agent-to-agent barycentric coordinates corresponding to agent i and its neighbors. We now relate the slice representation in Theorem 1 to the information flow in the network: Each slice, Mj , is initiated with a strictly sub-stochastic update, i.e., when one agent with unknown location directly receives information from an anchor by having this anchor in its virtual convex hull. On the other hand, a slice, Mj , is terminated after the information from the anchor(s) is propagated through the network and reaches every agent either directly or indirectly. Here, directly means that an agent has an anchor in its virtual convex hull; while indirectly means that an agent has a neighbor in its virtual convex hull, which has previously received the information (either directly or indirectly) from an anchor. Once the anchor information reaches every agent in the network, the slice notion and Theorem 1 provide the conditions on the rate, Eq. (21), at which this information should propagate for convergence. We proceed with the following lemma. Lemma 4. Under the conditions A0-A3 and no noise, the product of system matrices, Pk ’s, in the LTV system, Eq. (13), converges to zero if the condition in Theorem 1 holds. Proof. First, we need to show that the Assumptions B0-B1 follow from A0-A3. First, note that B0 is immediately verified by Eq. (16), assuming β1 = β. Next, we note that B1 is implied by A3. This is because if Θi ∩ κ is not empty, we can write X X (Pk )i,j = 1 − (Bk )i,m , (22) j∈Θi (k)∩Ω m∈Θi (k)∩κ where we used the fact that the barycentric coordinates sum to one. When there is only one anchor among the nodes forming the virtual convex hull, and the minimum weight is assigned to this anchor, Eq. (17), the right hand side of Eq. (22) is maximized. This provides an upper bound on the i-th row sum: X (Pk )i,j ≤ 1 − α < 1, (23) j∈Θi (k)∩Ω 8 which ensures B1 with β2 = 1 − α. In addition, Lemma 3 ensures that each agent updates infinitely often with different neighbors. Subsequently, each slice is completed after all agents receive anchor information (at least once) either directly or indirectly, and the asymptotic convergence of Eq. (13) follows under the conditions in Theorem 1. Theorem 3. Under Assumptions A0-A3 and no noise, Eq. (13) tracks the true agent locations in R2 , when the number of agents, N , and the number of anchors, M , follow: Note that Assumption B0, which is equivalent to Eq. (16), implies that each agent remembers its past information. If a lower bound on the self-weights is not assigned, an agent may lose valuable information when it updates with other agents that have not previously updated (directly or indirectly) with an anchor. On the other hand, Assumption B1 restricts the amount of unreliable information added in the network by the agents, when an anchor is involved in an update. The following theorem completes the localization algorithm for mobile multi-agent networks. Proof. Let us first consider the requirement of at least one anchor. Without an anchor, a strictly sub-stochastic row never appears in Pk , making Pk stochastic at each time and hence the infinite product of Pk ’s is also stochastic and not zero. With at least one anchor, strictly sub-stochastic rows, following Eq. (23), appear in Pk ’s, and zero convergence of the error dynamics, Eq. (25), follows. Next, exactly 3 nodes (agents and/or anchors) are required to form a (virtual) convex hull in R2 . Thus, when the total number of nodes, N + M , is 3 or less, no agent can find 3 other nodes to find (virtual) convex hulls. Using the same argument as the one in the proof of Lemma 3, we can show that with at least one anchor and at least 4 total nodes, any agent with unknown location infinitely finds itself in arbitrary (virtual) convex hulls. Thus, Theorem 1 is applicable and the proof follows. Theorem 2. Under the Assumptions A0-A3 and no noise, for any (random or deterministic) motion that satisfies Eq. (21), Eq. (13) asymptotically tracks the exact agent locations. Proof. In order to show the convergence to the true locations, we show that the error between the location estimate, xk , and the true location, x∗k , goes to zero. To find the error dynamics, note that the true agent locations follow: ek+1 . x∗k+1 = Pk x∗k + Bk uk + x (24) Subtracting Eq. (13) from Eq. (24), we get the network error ek+1 , x∗k+1 − xk+1 = Pk (x∗k − xk ) = Pk ek , (25) which goes to zero when lim k→∞ k Y Pl = 0N ×N , M ≥ 1, (27) N +M ≥ 4. (28) VI. M OBILE LOCALIZATION UNDER IMPERFECT MEASUREMENTS The noise on distance measurements and motion degrades the performance of the localization algorithm, as expected, and in certain cases the location error is as large as the region of motion; this is shown experimentally in Section VII-B. In what follows, we discuss the modifications, M1-M3, to the proposed bik , and on algorithm to address the noise in case of motion, x ij the distance measurements, dbk . (26) l=0 from Lemma 4. Before we proceed, it is reasonable to comment on the choice of parameter α; The proposed localization algorithm is proved, both in theory and simulations, to converge for any value of 0 < α < 1. However, the convergence rate of the algorithm is affected by the choice of α as follows. Choosing α arbitrarily close to zero corresponds to an infinitely large upper-bound on the length of a slice (this can be verified by replacing α = 1 − β2 by zero on the right hand side of Eq. (21). On the other hand, by setting α arbitrarily close to one, an agent has to get arbitrarily close to an anchor in order to perform an update with respect to the anchor (see Fig. 5), which again leads to arbitrary large number of iterations required for each slice to complete. In summary, there is a trade-off in the choice of α, between receiving more information from an anchor at the time of an update, which is the case for α values closer to 0, and increasing the chance of an update with an anchor, which requires for α to be closer to 1. A proper choice can be made by considering the motion model, the communication protocol, and the number of available anchors in the network. The following theorem characterizes the number of anchors. A. Agent contribution If an agent is located close to the boundaries of a (virtual) convex hull, noise on distance measurements may lead to incorrect inclusion test, Appendix F, results, i.e., a set of visited neighbors may fail the convexity test while the agent is indeed located inside the convex hull, or vice versa. To avoid such scenarios, we generalize Assumption A3 to non-anchor agents. In particular, we restrict an agent from performing an update, unless it is located in a proper position inside a candidate (virtual) convex hull. We augment Assumption A3 by the following: M1: For any agent, j ∈ Ω, involved in an update, i.e., for any (Pk )i,j 6= 0, we assume that 0 < α0 ≤ (Pk )i,j , ∀k, i ∈ Ω, j ∈ Θi (k) ∩ Ω, (29) where i is the updating agent’s index, and α0 is the minimum agent contribution. In other words, for agent i to perform an update, the area of the corresponding inner triangle has to constitute a minimum proportion, α0 , of the area of the convex hull triangle. This is shown in Fig. 7 (Left); At time k1 , agent i is located in the virtual convex hull of the nodes j, m and `, such that the ratio of the area of the shaded triangle to the area of the convex hull triangle is α0 . Agent i can perform an update at time k1 . The upper side of the shaded trapezoid in 9 𝑗∗ A. Localization without noise 𝐱 𝑘𝑖∗1 𝐱𝑘𝑖∗2 𝐱 𝑘𝑚∗ 𝑚 𝐱 𝑙∗ 𝑘𝑙 𝐱 𝑙∗ 𝑘𝑙 𝐱 𝑘𝑚∗ 𝑚 Fig. 7. (Left) Agent i is located on the threshold boundaries, which assigns the minimum weight, α, to the anchor. (Right) Agent i is located in an inappropriate location inside the convex hull. Fig. 7 (Right) is the threshold boundary. If agent i remains in the same virtual convex hull, but moves inside the shaded trapezoid, e.g., to xi∗ k2 at time k2 , Eq. (29) will not hold and no update will occur at that time. Clearly, Assumption M1 can be relaxed if the noise is negligible. Otherwise, the value of α0 can be adjusted according to the amount of noise on distance measurements. B. Inclusion test error Even if Assumption M1 is satisfied, the inclusion test results may not be accurate due to the noise on the motion, which corresponds to imperfect location updates at each and every iteration. To tackle this issue, we propose the following modification to the algorithm: M2: If the inclusion test is passed at time k by a triangulation set, Θi (k), agent i performs an update only if P j∈Θi (k) AΘi (k)∪{i}\j − AΘi (k) i | ≤ , (30) k = | AΘi (k) in which ik ≥ 0 is the inclusion test relative error for agent i at time k, and  ≥ 0 is a design parameter. C. Convexity Finally, recall that if the inclusion test is passed at time k, by a triangulation set, Θi (k), the updating agent, i, updates its location estimate, xi∗ k , as a convex combination of the location estimates of the nodes in Θi (k). In order to guarantee the convexity in the updates in presence of noise, we consider the following modification to the algorithm: M3: If the inclusion test is passed at time k by a triangulation set, Θi (k), and Eq. (30) holds at time k, agent i (randomly) chooses one of the i-visited nodes from the triangulation set Θi (k), say agent j, and finds the corresponding im in weight, aij k , as follows: assuming that ak + ak < 1, We now consider the noiseless scenarios, i.e., we assume that nik = 0 and rkij = 0, in Eqs. (2) and (3). In the beginning, all nodes (agents and anchor(s)) are randomly deployed within the region of x ∈ [−5 15], y ∈ [−5 15] in R2 . For the simulations, we consider random waypoint mobility model, [36], for the motion in the network, which has been the predominant motion model in the localization literature over the past decade, see e.g., [7]–[10], [37]. We note that better performance may be achieved if the agents follow some deterministic (mission-related) motion model. However, our localization algorithm converges if the motion is such that the slice lengths grow slower than the exponential rate in Eq. (21). i For all mobile nodes, i ∈ Θ, we chose dik→k+1 and θk→k+1 in Eq. (6) as random variables with uniform distributions over the intervals of [0 5] and [0 2π], respectively. Each agent can only communicate with the nodes within its communication radius, which is set to r = 2 for all simulations. For each simulation, we assume exactly one fixed anchor, i.e., M = 1. In all simulations, we set αk = 0.2 to ensure that the agents do not completely forget the past information and α = 0.1 to guarantee an adequate contribution from the anchor(s). Fig. 8 (Left) shows the random trajectories of N = 3 mobile agents and M = 1 anchor for the first 25 iterations. To characterize the convergence, we choose the 2-norm of the error vector normalized with respect to the dimensions of the region as follows:  2  2 ! 12 xk − x∗k yk − yk∗ 1 + , (32) kek k2 = 2 ∆x ∆y in which ∆x = 20 and ∆y = 20 denote the lengths of the region, which is a square in this case. The division by ∆x and ∆y is done to obtain a normalized error. It can be verified that the maximum error with this normalization is √12 . The algorithm converges when kek k2 → 0. As shown in Fig. 8 (Right), the localization algorithm, Eq. (13), tracks the true agent locations. The simulation results for a network of 10 3 agents, 1 anchor 0.35 0.3 0.25 kek k2 𝐱 𝑘𝑗 y 𝑗∗ 𝐱 𝑘𝑗 0.2 0.15 0.1 0.05 0 0 x 200 400 600 800 1000 k→ (31) Fig. 8. A network of 3 mobile agents and 1 anchor; (Left) Motion model; (Right) Convergence; red triangle indicates anchor and filled circles show the initial positions of the agents. In this section, we first provide simulation in noiseless scenarios and then examine the effects of noise. and 100 mobile agents and one mobile anchor is illustrated in Fig. 9 (Left) and (Right), respectively. Before we examine the effects of noise on the proposed localization algorithm, let us study the case where there is no anchor in the network, i.e., Eq (27) is not satisfied; In most aij k in = 1 − aim k − ak , {j, m, n} ∈ Θi (k). VII. S IMULATIONS 10 0.6 0.6 0.5 0.5 0.4 0.4 10 agents,1 anchor 10 agents, 1 anchor kek k2 kek k2 normalized localization error is reduced to less than 5% for one simulation. 100 agents, 1 anchor 10 agents, 1 anchor 0.7 5 0.5 4 0.4 3 0.3 0.3 0.3 0.1 0 500 0 1000 50 100 150 200 k→ 1 Fig. 9. Convergence of a network with one anchor; (Left) 10 mobile agents (Right) 100 mobile agents. 400 600 800 0 0 1000 200 400 600 800 1000 k→ Fig. 11. Effect of noise on the convergence of a network of 10 mobile agents and 1 mobile anchor with ±10% noise on distance measurements and ±1% noise on the motion; (Left) Original algorithm (Right) Modified algorithm. Finally, in Fig. 12 we provide 20 Monte Carlo simulations for a network of M = 1 mobile anchor and N = 10 and N = 20 mobile agents in presence of noise. 10 agents, 1 anchor, 20 Monte Carlo trials 20 agents, 1 anchor, 20 Monte Carlo trials 0.7 0.7 0.6 0.6 0.5 0.5 0.4 0.3 0.4 0.3 0.2 0.2 0.1 0.1 0.2 5 0.1 0 −5 1100 1120 200 400 600 800 1000 0 0 200 400 600 800 1000 k→ Fig. 12. 20 Monte Carlo trials; ±10% noise on distance measurements, ±1% noise on the motion; (Left) N = 10, M = 1 (Right) N = 20, M = 1. 10 0.3 k→ 200 k→ x kek k2 0.4 1000 0.1 k→ 0 0 15 500 0.2 20 0.5 0 0 0 0 maxi (keik k2) localization algorithms, m + 1 anchors are required to localize an agent with unknown location in Rm without ambiguity. However, when the nodes are mobile, exactly one anchor is sufficient to inject valuable information and the motion of the agents provides the remaining degrees of freedom. When there is no anchor in the network, all updates are stochastic, and we get ek+1 = Pk ek , with ρ(Pk ) = 1, ∀k, where ρ(.) denotes the spectral radius, i.e., a neutrally stable system, which leads to a bounded steady-state error in location estimates. In other words, relative locations are tracked because the motion removes certain ambiguity from the locations. However, absolute tracking without any ambiguity requires at least one anchor. This is illustrated in Fig. 10 for a network of M = 4 agents and no anchor. 4 agents, 0 anchor 2 250 k! maxi (keik k2) 0.1 0 0 kek k2 0.2 kek k2 0.2 1140 1160 x1 x1∗ 1180 1200 k→ Fig. 10. Steady state error for a network of 4 mobile agents and no anchor; (Left) 2-norm (Right) Red and blue curves represent the exact and estimated values of x coordinate, for the last 100 iterations of a simulation. B. Localization with noise To examine the effects of noise on the proposed localization algorithm, we let the noise on the motion of agent i ∈ Θ at time k, nik to be ±1% of the magnitude of the motion eik , and the noise on distance measurements, rkij to vector, x be ±10% of the actual distance between nodes i and j, dij k. As shown in Fig. 11 (Left) this amount of noise leads to an unbounded error, which is due to incorrect inclusion test results and the continuous location drifts because of the noise on the distance measurements and the noise on motion, respectively. However, by modifying the algorithm according to Section VI, it can be seen in Fig. 11 (Right) that the C. Performance evaluation We now evaluate the performance of our algorithm in contrast with some well-known localization methods; MCL [8], MSL* [10], Dual MCL [11], and Range-based SMCL [9]. Please refer back to Section I for a brief description of these methods. In Fig. 13, we compare the localization error in the Virtual Convex Hull (VCH) algorithm with MCL, MSL*, and Range-based SMC. As shown in Table I, in these algorithms node density, nd , and anchor (seed) density, ns , denote as the average number of nodes and anchors in the neighborhood of an agent, respectively. Total number of agents and anchors can therefore be determined by knowing these densities as well as the area of the region. We consider N = 20 agents and M = 2 anchors, and use the same metric as used in [8]–[10], i.e., the location error as a percentage of the communication range. Each data point in Fig. 13 is computed by averaging the results of 20 simulation experiments. We keep the other parameters the same as described earlier in this section. With high measurement noise, i.e., in the presence of 10% noise on the range measurements and 1% noise on the motion, our algorithm outperforms MCL, MSL* and Range-based 11 algorithm in presence of noise and provide modifications to the proposed algorithm to address noise on motion and on distance measurements. Mean Error (%r) 2 MSL* MCL Range-based SMCL Proposed VCH 1.5 A PPENDIX A TABLE OF PARAMETERS 1 Table II summarizes the important notation. 0.5 A PPENDIX B P ROOF OF L EMMA 1 0 0 10 20 30 40 50 Time Fig. 13. Accuracy comparison SMCL after 20 iterations. Clearly, the localization error in our algorithm decreases as the amount of noise decreases, and our algorithm converges to the exact agent locations in the absence of noise. Table I summarizes the performance of the proposed VCH algorithm in comparison to the above methods. Localization algorithm Simulation environment, Network size, Communication range Average error %r MCL 500*500, nd=10, ns=1, r =50 0.2 - 0.6 Dual MCL 250*250, nd=10, ns=2, r =25 0.4 - 0.6 MSL* 500*500, nd=10, ns=2, r =100 0.1 - 0.5 Range-based SMCL 1*1, nd=13.9, ns=1.3, r =0.125 0.2 - 0.4 Proposed VCH 20*20, N=20, M=2, r=2 < 0.1 TABLE I C OMPARATIVE PERFORMANCE OF LOCALIZATION ALGORITHMS VIII. C ONCLUSIONS In this paper, we provide a distributed algorithm to localize a network of mobile agents moving in a bounded region of interest. Assuming that each agent knows a noisy version of its motion and the distances to the nodes in its communication radius, we provide a geometric framework, which allows an agent to keep track of the distances to any previously visited nodes, and find the distance between a neighbor and any virtual location where it has exchanged information with other nodes in the past. Since agents are mobile, they may not be able to find neighbors to perform distributed updates at any time. To avoid this issue, we introduce the notion of a virtual convex hull, which forms the basis of a range-based localization algorithm in mobile networks. We abstract the algorithm as an LTV system with (sub-) stochastic matrices, and show that it converges to the true locations of agents under some mild regularity conditions on update weights. We further show that exactly one anchor suffices to localize an arbitrary number of mobile agents when each agent is able to find appropriate (virtual) convex hulls. We evaluate the performance of the i∗ Proof. Consider the triangle, whose vertices are at xi∗ kj , xkj +1 j∗ and xkj . To find the current distance of agent i, from the position of agent j at time kj , we can use the law of cosines, which connects the length of an unknown side of a triangle to the lengths of the two other sides and the angle opposite to the unknown side. This triangle is depicted in Fig. 2 (c), in which the two known side lengths are deij kj and dikj →kj +1 . Thus, knowing the angle between these sides of the triangle, αki j →kj +1 , the length of the third side can be determined according to the following 2 (deij kj +1 ) = 2 i 2 (deij kj ) + (dkj →kj+1 ) − i i 2deij kj dkj →kj+1 cos(αkj ), (33) which corresponds to Eq. (9), and completes the proof. A PPENDIX C P ROOF OF L EMMA 2 Proof. We illustrate this procedure in Fig. 3, where all known/measured distances and angles are distinguished from the unknowns by bold lines and bold arcs, respectively. After agent i makes contact and exchange information with node j at time kj , it moves the distance of dikj →kj +1 to the new location, xi∗ kj +1 . At this point, agent i can (use the law i eij of cosines to) find deij kj +1 as a function of dkj , dkj →kj +1 , i and αkj , which are all known to this agent, i.e., deij kj +1 = ij ij i i e e f (dkj , dkj →kj +1 , αkj ). Knowing dkj +1 , agent i can then i eij find φ1 = g(deij kj , dkj →kj +1 , dkj +1 ). Note that given the three sides of a triangle, each angle can be computed. Since agent i cannot find any neighbor at time kj + 1, we have βki j +1 = 2π. Agent i then changes its direction by αki j +1 and travels the distance of dikj +1→k` to the new location, xi∗ k` , where k` = kj +2. ij i e At this point, agent i can find dk` = f (deij kj +1 , dkj +1→k` , φ2 ), i note that φ2 = π − αkj +1 + φ1 . Agent i can then find φ3 = i eij g(deij k` , dkj +1→k` , dkj +1 ) at time k` . Since agent i finds node ` within the communication radius at time k` , it changes its direction by βki ` in order to make a contact with agent `. Fii eij eij ei` nally, knowing dei` k` , dk` , and, φ4 = ∠(dk` , dk` ) = π−φ3 −βk` , j∗ agent i can find the distance between xkj and xk`∗` according to Eq. (10). 12 TABLE II PARAMETERS AND DESCRIPTIONS ; RANDOM PARAMETERS ARE DISTINGUISHED BY ?. ∗ 𝐱 𝑘𝑖 1 𝑗∗∗ 𝐱𝑘1 lies inside the corresponding virtual triangle. The probability of such event at any given time, k > k3 , is given by ∗ 𝐱 𝑘𝑖 3 𝑙∗ 𝐱 𝑘3 m∗ l∗ area(4(xj∗ k1 , xk2 , xk3 ) , n2 which corresponds to a non-zero probability for agent i to find a triangulation set. m∗ l∗ P(i ∈ C(xj∗ k1 , xk2 , xk3 )) = ∗ 𝐱 𝑘𝑖 2 Fig. 14. Existence of a virtual convex hull; Agent i can perform an update if it lies inside the blue triangle at any time k > k3 . A PPENDIX D P ROOF OF L EMMA 3 Proof. Consider a network of 4 agents, {i, j, m, l}, and let us focus on finding a triangulation set for agent i. Suppose all agents are moving in an n by n region, and the communication radius for each agent is r. In order for agent i to communicate with another agent, say j, at time k1 , agent j has to lie inside a circle with radius r centered at agent i’s location, xi∗ k1 , see Fig. 14. The probability of such event at time k1 , is 2 8 therefore given by P(j ∈ Vi (k1 )) = πr n2 . Similarly, the probability that agent i communicates with agent m at a later time, k2 > k1 , and with agent l, at time k3 > k2 > k1 can 2 πr 2 be given by P(m ∈ Vi (k2 )) = πr n2 and P(l ∈ Vi (k3 )) = n2 , respectively. Note that the probability of agent m being exactly at xj∗ k1 at time k2 is zero, and therefore we can draw a virtual line (the dotted line in Fig. 14) between the locations at which agent i has communicated with agents j and m, i.e., m∗ between xj∗ k1 and xk2 . Similarly the probability of agent l lying on the aforementioned line at time k3 is zero. Thus, the locations where agent i can meet the other three agents at different times with nonzero probability, form a virtual convex hull. Therefore, the three agents j, m and l can pass the inclusion test for agent i at any given time k > k3 , if agent i 8 This expression assumes that agents are uniformly distributed over the region at any given time. This assumption can be justified by considering random initial deployment and motion. However, the proof follows as long as there is a nonzero probability for each agent to communicate with other agent(s) in the network. A PPENDIX E P SEUDOCODE Algorithm 1 Localize N agents in R2 in the presence of M anchors with precision p Require: M ≥ 1 and N + M ≥ 4 k←0 x0 ← random initial coordinates for i = 1 to N do Vi (0) = ∅ end for while k < termination criterion9 do k ←k+1 for i = 1 to N do Vi (k) ← nodes in the communication radius of agent i at time k if 0 ≤ |Vi (k)| < 3 then do not update else perform inclusion test on (all possible combinations of) 3 neighbors if no triangulation set found then do not update else update location according to Eq. (11) end if end if end for end while 9 The termination criterion can be designed according to the number of iterations typically needed given the size, mobility, models, and noise parameters, as evident from the simulation figures in Section VII. 13 A PPENDIX F C ONVEX HULL INCLUSION TEST In R2 , a convex hull inclusion test is as follows i ∈ C(Θi (k)), if X AΘi (k)∪{i}\j = AΘi (k) , (34) AΘi (k)∪{i}\j > AΘi (k) , (35) j∈Θi (k) i∈ / C(Θi (k)), if X j∈Θi (k) in which “ \ ” denotes the set difference, C(·) is the convex 1 𝐴𝑖12 1 𝐴𝑖13 𝑖 𝑖 3 2 2 3 𝐴𝑖23 Fig. 15. R2 : (Left) Robot i lies inside the triangle formed by the neighboring nodes, 1, 2 and 3 (Right) Inclusion test is not passed. hull, and AΘi (k) represents the area of C(Θi (k)), see Fig. 15, and can be computed by using the Cayley-Menger determinant, [38]. Thus, AΘi (k)∪{i}\j is the area of the set Θi (k) with node i added and node j removed. R EFERENCES [1] D. Estrin, L. Girod, G. Pottie, and M. Srivastava, “Instrumenting the world with wireless sensor networks,” in Acoustics, Speech, and Signal Processing, 2001. Proceedings.(ICASSP’01). 2001 IEEE International Conference on, vol. 4. IEEE, 2001, pp. 2033–2036. [2] G. J. Pottie and W. J. Kaiser, “Wireless integrated network sensors,” Communications of the ACM, vol. 43, no. 5, pp. 51–58, 2000. [3] D. Estrin, R. Govindan, J. Heidemann, and S. Kumar, “Next century challenges: Scalable coordination in sensor networks,” in Proceedings of the 5th annual ACM/IEEE international conference on Mobile computing and networking. ACM, 1999, pp. 263–270. [4] D. C. Steere, A. Baptista, D. McNamee, C. Pu, and J. Walpole, “Research challenges in environmental observation and forecasting systems,” in Proceedings of the 6th annual international conference on Mobile computing and networking. ACM, 2000, pp. 292–299. [5] S. Pandey and S. Varma, “A range based localization system in multihop wireless sensor networks: A distributed cooperative approach,” Wireless Personal Communications, vol. 86, no. 2, pp. 615–634, 2016. [6] Y. Zhang, W. Wu, and Y. Chen, “A range-based localization algorithm for wireless sensor networks,” Journal of Communications and Networks, vol. 7, no. 4, pp. 429–437, 2005. [7] S. A. Mageid, “Autonomous localization scheme for mobile sensor networks in fading environments,” in IEEE International Conference on Selected Topics in Mobile Wireless Networking (MoWNeT), April 2016, pp. 1–8. [8] L. Hu and D. Evans, “Localization for mobile sensor networks,” in Proceedings of the 10th annual international conference on Mobile computing and networking. ACM, 2004, pp. 45–57. [9] B. Dil, S. Dulman, and P. Havinga, “Range-based localization in mobile sensor networks,” in Wireless Sensor Networks. Springer, 2006, pp. 164–179. [10] M. Rudafshani and S. Datta, “Localization in wireless sensor networks,” in Information Processing in Sensor Networks, 2007. IPSN 2007. 6th International Symposium on. IEEE, 2007, pp. 51–60. [11] E. Stevens-Navarro, V. Vivekanandan, and V. W. Wong, “Dual and mixture monte carlo localization algorithms for mobile wireless sensor networks,” in IEEE Wireless Communications and Networking Conference. IEEE, 2007, pp. 4024–4028. [12] N. Patwari, A. O. Hero, M. Perkins, N. S. Correal, and R. J. O’dea, “Relative location estimation in wireless sensor networks,” Signal Processing, IEEE Transactions on, vol. 51, no. 8, pp. 2137–2148, 2003. [13] F. Thomas and L. Ros, “Revisiting trilateration for robot localization,” Robotics, IEEE Transactions on, vol. 21, no. 1, pp. 93–101, 2005. [14] S. T. Roweis and L. K. Saul, “Nonlinear dimensionality reduction by locally linear embedding,” Science, vol. 290, no. 5500, pp. 2323–2326, 2000. [15] J. Aspnes, T. Eren, D. K. Goldenberg, A. S. Morse, W. Whiteley, Y. R. Yang, B. D. Anderson, and P. N. Belhumeur, “A theory of network localization,” Mobile Computing, IEEE Transactions on, vol. 5, no. 12, pp. 1663–1678, 2006. [16] J. Albowicz, A. Chen, and L. Zhang, “Recursive position estimation in sensor networks,” in Network Protocols, 2001. Ninth International Conference on. IEEE, 2001, pp. 35–41. [17] C. Savarese, J. M. Rabaey, and J. Beutel, “Location in distributed ad-hoc wireless sensor networks,” in Acoustics, Speech, and Signal Processing, 2001. Proceedings.(ICASSP’01). 2001 IEEE International Conference on, vol. 4. IEEE, 2001, pp. 2037–2040. [18] S. Čapkun, M. Hamdi, and J.-P. Hubaux, “Gps-free positioning in mobile ad hoc networks,” Cluster Computing, vol. 5, no. 2, pp. 157–167, 2002. [19] A. Savvides, H. Park, and M. B. Srivastava, “The bits and flops of the n-hop multilateration primitive for node localization problems,” in Intl. Workshop on Sensor Networks and Applications, Atlanta, GA, Sep. 2002, pp. 112–121. [20] R. Nagpal, H. Shrobe, and J. Bachrach, “Organizing a global coordinate system from local information on an ad hoc sensor network,” in Information Processing in Sensor Networks. Springer, 2003, pp. 333– 348. [21] A. Savvides, C.-C. Han, and M. B. Strivastava, “Dynamic fine-grained localization in ad-hoc networks of sensors,” in Proceedings of the 7th annual international conference on Mobile computing and networking. ACM, 2001, pp. 166–179. [22] X. Ji and H. Zha, “Sensor positioning in wireless ad-hoc sensor networks using multidimensional scaling,” in INFOCOM 2004. Twenty-third AnnualJoint Conference of the IEEE Computer and Communications Societies, vol. 4. IEEE, 2004, pp. 2652–2661. [23] B. D. Anderson, P. N. Belhumeur, T. Eren, D. K. Goldenberg, A. S. Morse, W. Whiteley, and Y. R. Yang, “Graphical properties of easily localizable sensor networks,” Wireless Networks, vol. 15, no. 2, pp. 177– 191, 2009. [24] M. Deghat, I. Shames, B. D. Anderson, and J. M. Moura, “Distributed localization via barycentric coordinates: Finite-time convergence,” in 18th World Congress of the International Federation of Automatic Control,(IFAC 2011), Milan, Italy, 2011, pp. 7824–7829. [25] S. Lederer, Y. Wang, and J. Gao, “Connectivity-based localization of large-scale sensor networks with complex shape,” ACM Transactions on Sensor Networks (TOSN), vol. 5, no. 4, p. 31, 2009. [26] D. Fox, J. Hightower, L. Liao, D. Schulz, and G. Borriello, “Bayesian filtering for location estimation,” 2003. [27] I. Amundson and X. D. Koutsoukos, “A survey on localization for mobile wireless sensor networks,” in Mobile Entity Localization and Tracking in GPS-less Environnments. Springer, 2009, pp. 235–254. [28] N. Patwari, “Location Estimation in Sensor Networks,” Ph.D., University of Michigan–Ann Arbor, 2005. [29] Y.-G. Kim, J. An, and K.-D. Lee, “Localization of mobile robot based on fusion of artificial landmark and RF TDOA distance under indoor sensor network,” International Journal of Advanced Robotic Systems, vol. 8, no. 4, pp. 203–211, September 2011. [30] G. Han, J. Jiang, C. Zhang, T. Q. Duong, M. Guizani, and G. K. Karagiannidis, “A survey on mobile anchor node assisted localization in wireless sensor networks,” IEEE Communications Surveys Tutorials, vol. 18, no. 3, pp. 2220–2243, 2016. [31] H. M. Choset, Principles of robot motion: theory, algorithms, and implementation, 2005. [32] A. Boukerche, H. Oliveira, E. Nakamura, and A. Loureiro, “Localization systems for wireless sensor networks,” Wireless Communications, IEEE, vol. 14, no. 6, pp. 6–12, December 2007. [33] A. F. Möbius, Der barycentrische calcul, 1827. [34] U. A. Khan, S. Kar, and J. M. Moura, “Distributed sensor localization in random environments using minimal number of anchor nodes,” Signal Processing, IEEE Transactions on, vol. 57, no. 5, pp. 2000–2016, May 2009. [35] S. Safavi and U. A. Khan, “Asymptotic stability of stochastic LTV systems with applications to distributed dynamic fusion,” IEEE Transactions on Automatic Control, provisionally accepted. [Online]. Available: http://arxiv.org/abs/1412.8018 [36] T. Camp, J. Boleng, and V. Davies, “A survey of mobility models for ad hoc network research,” Wireless communications and mobile computing, vol. 2, no. 5, pp. 483–502, 2002. [37] W. Wang and Q. Zhu, “Sequential monte carlo localization in mobile sensor networks,” Wireless Networks, vol. 15, no. 4, pp. 481–495, 2009. [38] M. J. Sippl and H. A. Scheraga, “Cayley-menger coordinates,” Proceedings of the National Academy of Sciences, vol. 83, no. 8, pp. 2283–2287, 1986.
3cs.SY
arXiv:1710.06846v1 [cs.IT] 17 Sep 2017 Kolmogorov Complexity and Information Content Fouad B. Chedid∗ Abstract In this paper, we revisit a central concept in Kolmogorov complexity in which one would equate program-size complexity with information content. Despite the fact that Kolmogorov complexity has been widely accepted as an objective measure of the information content of a string, it has been the subject of many criticisms including the fundamental one directed by logicians and philosophers towards the statistical and semantical theories of information, which is about confusing an object and its name. In this paper, we clarify a number of subtle issues that are at the center of this debate. 1 Introduction In his seminal paper (Kolmogorov 1965), Kolmogorov introduced an algorithmic approach to quantitatively define information using the theory of algorithms. In particular, the Kolmogorov complexity of a finite binary string x is defined as the length of a shortest binary program p, which when interpreted by some Universal Turing Machine M , causes that machine to output x and then halt. Formally put, KM (x) = min .p {|p| : M (p) = x} = ∞, if there is no p such that M (p) = x. So, one can view KM (x) as the size of an ultimate, most compressed, code p for x using a universal Turing machine as a decompressor. Unfortunately, the compressor that generates p is not known. This is true because of the Halting problem (Turing 1936). That is, there is no effective procedure for determining the size of a smallest program for x. Of course, we can always estimate KM (x) from above by discovering shorter and shorter programs for x, but we can never be certain that our best discovered short program for x is a shortest one. In that same paper (Kolmogorov 1965), Kolmogorov used the expression ”the information content of a message”, and then he went on to define I(x : y) as ”the quantity of information conveyed by an individual object x about an individual object y”, and concluded that the information conveyed by x about itself, I(x : x), is equal to KM (x). ∗ A’Sharqiyah University, Ibra, Oman, [email protected] 1 We mention that prior to this work of Kolmogorov, the notion of the information content of a string wasn’t there. For example, Shannon’s work (Shannon 1948) was about the minimum number of bits needed on the average to transmit a value taken by a random variable, as a syntactic unit independent of any semantic (Shannon wrote “ ... semantic aspects of communication are irrelevant to the engineering problem ..”). Similarly, Chaitin was interested in studying the size of a shortest binary program capable of generating a given sequence of bits on a universal Turing machine (Chaitin 1966), and Solomonoff was interested in predicting the next value taken by a random variable following an unknown probability distribution (Solomonoff 1964). The following definition of a possible information measure was first suggested by Wiener: “The amount of information provided by a single message mi , I(mi ) = − log2 pi ” (Wiener 1948), which is related to the number of bits needed to identify any of the messages which happen to occur with probability pi . Still, we should be clear that neither Wiener nor Kolmogorov has made the shift from the sense of treating information as a sequence of bits to the sense where information is about what is expressed by that sequence of bits, which was the main drive behind what has become known as the semantic theory of information (Popper 1934, Bar-Hillel 1952, Carnap 1964). The comforting thing is that both statistical (= Shannonian) and semantical theories of information agree that information is about removal of uncertainty. This agrees with the point of view suggested by Kolmogorov, though seen from an opposite end, that information is about uncompressed regularities. That is, the more compressible a string is, the less information it contains, and vice versa. For a wealth of information on Kolmogorov complexity and its applications, the reader is referred to Cover and Thomas 2006 and Li and Vitányi 2008. Despite the fact that Kolmogorov complexity has been widely accepted as an objective measure of the information content of a string, the concept of equating program-size complexity with information content continues to be challenged using several arguments (See for e.g., Grassberger 1990, Li 1991, GellMann and Lloyd 2003) including the fundamental criticism directed by logicians and philosophers towards the statistical and semantical theories of information (Raatikainen 1998), which is about confusing an object and its name, or equivalently confusing the object language and the metalanguage. We show that understanding Kolmogorov’s notions of randomness in the positive versus negative sense is at the center of this debate. We also explain the works of Shannon, Solomonoff, and Kolmogorov using the language of analytic philosophy. We clarify that both Shannon’s entropy and Solomonoff’s universal probability use their arguments and that Kolmogorov complexity mentions its argument, which explains the suitability of Kolmogorov complexity as a measure of the information content of an individual string. The rest of the paper is organized as follows. Section 2 gives the necessary background about related theories. We discuss the notions of Shannon’s entropy, Solomonoff’s universal probability, and Kolmogorov’s algorithmic description. Section 3 contains our contribution. 2 2 Background Shannon’s information theory is about the most economical way of transmitting a message between a sender and a receiver over a binary communciation channel. For simplicity, we assume that messages are the outputs of a discrete random variable X that can take its values from a finite alphabet X = {x1 , . . . , xn } using a probability distribution P = {p1 , . . . , pn }. That is, Prob.{X = xi } = pi , ∀1 ≤ i ≤ n. We also say that X is distributed according to P (x). We mention that the Shannon-Fano code (Shannon 1948, Fano 1949) is the most fundamental result in determining the descriptive complexity of an object in both probabilistic (Shannon’s) and algorithmic (Kolmogorov’s) settings. It is a simple observation which states that if an event has a probability of occurrence p, then the number of possible outcomes of that event is p1 , and the smallest number of bits needed to represent any of those outcomes is ⌈log p1 ⌉. Then, it is a straighforward result that the expected value of the smallest number of bits needed to represent any of the outcomes of the random variable X is X pi ⌈log xi ∈X 1 ⌉. pi Shannon had wanted to call this quantity the “uncertainty” or “unexpectedness” of the random variable, but then he went along with a suggestion from John von Neumann and calledl it “entropy”1 (Wicken 1987). The entropy of a random variable X drawn according to a mass probability function p is often denoted by H(X) or H(p). The idea is that when a receiver learns about some output value xi , then by doing so, she eliminates 2H(X) possible outcomes on the average, which is a measure of the average unexpectedness or uncertainty stored in X. Furthermore, if we accept the notion that removal of uncertainty constitutes information gain, then the entropy of the random variable becomes a measure of the average amount of information stored in X. In the Shannon’s theory of information, one of the main issues was to find the length of a shortest description, on the average, of a string of symbols given those symbols’ probabilities of occurrence. We now know that the solution to this specific issue is the P entropy of the probabitliy distribution p of the symbols given by H(p) = − x px log px . Thus, the entire theory of Shannon rests on the assumption that the probability distribution of the information source is made available to us in advance. We next ask what happens if we don’t know the probability distribution of the information source? This is the same question that Solomonoff asked himself in the early 1960s, although his intention was to develop a formal theory of inductive inference. Investing in the main idea of Wiener and Shannon on the relationship between the length lx of an optimal code for a symbol x and the probability of occurence px of x; that is, lx = − log px , or equivalently, px = 1 In thermodynamics, if we let n be the number of ways in which a physical sysem S can be configured, then the quantity defined by log n is a measure of uncertainty or disorganization in S, also called entropy of S. 3 2−lx , Solomonoff combined (i) the simple idea that whatever binary encoding the sender develops for x, it is something that the receiver must be able to decode in order to recover x and (ii) the widely accepted Church’s thesis about the Turing Machine as being the most general model capturing the notion of effective computation to propose that whatever encoding ex of length lx the sender decides to use to encode x, the receiver (Turing machine) should be able to recover x from ex . In particular, if we let M be a fixed Universal Turing Machine, then we want M (ex ) = x. In this sense, ex acts as a program that when interpreted by M causes M to generate x and then halt. Moreover, we already know that there is a relationship between lx and the probability distribution generating x as assumed by the sender, namely px = 2−lx . Putting all these ideas together, Solomonoff proposed to model the true probability distribution of x, whatever that may be, by his notion of Universal Probability2 defined as X 2−|p| P (x) = p:M(p)=x which is basically the probability that a random string will print out x. An additional requirement is needed here for P (x) to be a true probability. P (x) ≤ 1 if and only if all programs p such that M (p) = x form a prefix-free set3 . This follows from Kraft Inequality (Shannon 1948, Kraft 1949). Around the same time in the early 1960s, Kolmogorov developed similar ideas to Solomonoff’s, although for the purpose of studying the algorithmic complexity of randomness. To motivate this discussion, let us first consider an experiment in which we flip a fair coin 30 times and write down 1 if the coin shows Head and 0 if it shows Tail. Let x1 and x2 be the outputs of two runs of this experiment. x1 : 101010101010101010101010101010 x2 : 110001010110100010111011101010 We next ask which of these two strings is the more random? Although x1 and x2 have the same probabilities of occurrence (= 2−30 ), it is obvious that these two strings have different levels of randomness with x2 being the more random. This is true because while x1 consists of 15 repetitions of the pattern“10”, there doesn’t seem to be an obvious way to generate x2 than by rewriting x2 in its entirety, and so, we would like to conclude that x2 is more random than x1 . As a matter of fact, Laplace (1749-1827) explained this a long time ago by considering the set S of all binary strings of length 30, and by showing that among all elements of S, the size of the subset S1 ⊂ S of which x1 is a typical element is much smaller than the size of the subset S2 ⊂ S of which x2 is a 2 Taking all programs for x into account follows Epicurus’ approach, while limiting our attention to the shortest program for x follows Occam’s razor. 3 Prefix-freeness means that if M (p) = x, then there is no other prefix q of p (q 6= p) that can cause M to print x and then halts. 4 typical element, and hence, the probability of the event S1 is smaller than that of S2 , which explains why x1 is less random than x2 . Kolmogorov, similar to Solomonoff, used the widely accepted Church’s thesis about Turing machines to propose an algorithmic description of a binary string x as the length of a shortest program x∗ for x on a universal Turing machine. In particular, if we let M be a fixed Universal Turing Machine, then we want M (x∗ ) = x. In this sense, M acts as a decompressor of an ultimately compressed program (encoding) for x. Kolmogorov called the length of x∗ the descriptive complexity of x (also known as Kolmogorov complexity) to be denoted by KM (x) = |x∗ | or equivalently, KM (x) = minp {|p| : M (p) = x}. We note that the Kolmogorov Complexity of a string is defined up to an addtive constant. This is true because on one hand, KM (x) is defined relative to a fixed Universal Turing Machine and on another hand we have the Invariance Theorem, which states that given two fixed universal Turing machines M1 and M2 , |KM1 (x) − KM2 (x)| ≤ c, for some positive constant c which depends on M1 and M2 , but not on x. This is why it is fair to say that (up to an additive constant) the Kolmogorov Complexity of a string is an intrinsic property of x itself and is independent of the fixed universal Turing machine used to generate it. Hereafter, we drop the reference to any fixed universal Turing machine and write K(x) for the Kolmogorov Complexity of x. Knowing that there is a relationship between the length of an encoding for x and the probability of occurence of x, we have X P rob.(x) = 2|K(x)| . x∗ An additional technical requirement is needed here for P rob.(x) to be a true probability. P rob.(x) ≤ 1 if and only if all shortest programs x∗ for x form a prefix-free set4 . Comparing the expression of P rob.(x) to Solomonoff’s universal probability shows that Kolmogorov’s work supports the principle of Occam’s razor5 while Solomonoff’s work supports the principle of Epicurus6 . Solomonoff believed it is important to consider other programs (other than a shortest one) for x because by not doing so, we would be missing on some information that could be helpful for our understanding of the true distribution of x (Personal communication 2008). 4 This is obviously true because otherwise there would be some shortest program that is shorter than another shortest program, which is a contradiction. 5 William of Ockham (1287-1347): If a phenomenon can be explained using several theories, then it is best to adopt the simplest (shortest?) one. 6 Epicurus (341-270 BC): If a phenomenon can be explained using several theories, then it is important to keep all of them. 5 Kolmogorov writes “In practice, we are most interested in the quantity of information conveyed by an individual object x about an individual object y” (Kolmogorov 1965). The conditional (relative) Kolmogorov complexity of a string x when another string y is given is K(x/y) = min.p {|p| : M (y, p) = x} Here, we follow Kolmogorov’s notation and place the auxilliary information y before p. Kolmogorov argued that since K(x/y) ≤ K(x), it is fair to call the differene K(x) − K(x/y) the amount of information in y about x, and so, he defined I(y : x) = K(x) − K(x/y) as the amount of information in y about x. If we next compute I(x : x), we have K(x/x) = min.p {|p| : M (x, p) = x} = O(1), where the O(1) term is the length of the copy program p that copies its input to its output. Thus, up to an additive constant, K(x/x) = 0 and I(x : x) = K(x). Thus, Kolmogorov suggested to call K(x) the amount of information in x about itself7 . In the next section, we show that understanding Kolmogorov’s notions of randomness in the positive versus negative sense is at the center of this debate. We also explain the works of Shannon, Solomonoff, and Kolmogorov using the language of analytic philosophy. We clarify that both Shannon’s entropy and Solomonoff’s universal probability use their arguments and that Kolmogorov complexity mentions its argument, which explains the suitability of Kolmogorov complexity as a measure of the amount of information in an individual string. 3 3.1 Criticisms and Clarifications Equating Program-Size Complexity With Information Content According to Kolmogorov complexity, the information content of a string is solely determined by the size of a shortest program capable of generating that string on a Universal Turing Machine. Equating program-size complexity with information content implies that strings that admit short descriptions (or equivalently, that can be significantly compressed) have low complexity (little information) and strings that resist short descriptions have high complexity (lots of information). This equality is an ingenious idea that, while supported by many, has been the subject of many criticisms. To motivate this discussion, consider, for example, the case of two strings x and y of 1000 characters each, where x is a passage from Tolstoy’s masterpiece War and Peace and y is a string of 1000 characters chosen at random. Using Kolmogorov complexity as a measure of information content, we conclude that x has less information than y. This is true because it is always possible to encode the string x by abbreviating some 7 We could as well call it self-information, similar to the notion of self-entropy in Shannon’s information theory. 6 sentences in it to be recovered by the reader (say we use “btw” for “by the way”, etc.). However, the only way to generate y is to copy it in its entirety. This absurdity is a main argument used against using program-size complexity as a measure of information content. For example, the German physicist Grassberger writes “Kolmogorov complexity seems to be the quantity most closely related to the intutive notion of randomness, not of complexity” (Grassberger 1986). Grassberger suggested using the word “randomness” for the property measured by Kolmogorov complexity and reserving the word “complexity” for something that is between total regularity and total randomness (Grassberger 1990). Thus, according to Grassberger, strings of total regularity (those that can be significanlty compressed) or total randomness (those that can’t be compressed at all) have small complexity. In either case, the string can be generated by a simple procedure. Here, simplicity is not related to the size of the procedure, but rather to the process involved in the generation of the string. Similarly, the American physicist Gell-Mann supported the unsuitability of the quantity measured by Kolmogorov compelxity as a measure of complexity (Gell-Mann 2003). Furthermore, Gell-Mann defined the Effective Complexity of an object as the length of a highly compressed description of that objects’ regularities (Gell-Mann 1996). Another interesting view was proposed in (Li 1991), from which we quote the following text: It has been pointed out repeatedly that algorithmic complexity does not fit our intuitive notion of complexity. One vague argument is that algorithmic complexity measures the difficulty of the task – to reconstruct a sequence exactly – that is not very “meaningful.” To say that this task is not very meaningful is partly based on our daily experience that we can pick up the main feature of a picture or the basic meaning of a text by quickly scanning it without paying attention to every detail. A similar argument for algorithmic complexity not being a “good” measure of compelxity is that the effort put in to generate a sequence to be exactly correct does not contribute to the “important features” of that sequence. Rather, they contribute too much to the “trivial” details. We now return to Kolmogorov and recall some of his work from 1974. Kolmogorov (though he never published anything on this himself) proposed a structure function hx () (Cover 1985) as a way to divide a shortest program x∗ for a finite binary string x into two parts responsible for encoding the regular and nonregular (random) aspects of x separately. Of course, both parts are maximally random, and hence it is not clear how such a division can be made. Still, the clever idea is that while we agree that the length of a shortest program x∗ for x is a measure of the amount of information (let’s call it total information) in x, we would like to know more about the constituents of x∗ . In particular, we would like to know how much of x∗ is responsible for coding the regular aspects of x (to be associated with meaningful information in x) and how much is responsible for coding the random aspects of x (to be associated with accidental information in x). Kolmogorov suggested to model the regular aspects of 7 x by a finite set S of which x is a typical element. The notion of Kolmogorov’s minimal sufficent statistic as the length of an optimally compressed description of the regular aspects of a string in the model class of finite sets was then coined. A string x for which its minimal sufficient statistic is about the length of x was called absolutely nonrandom (nonstochastic) by Kolmogorov. Thus, an absolutely nonrandom string contains almost no random information. In other words, almost all regularities in a nonrandom string are incompressible. Kolmogorov called such objects random in the negative sense. Interestingly (and this can be a source of confusion), the incompressibility property of absolutely nonrandom objects is shared with Kolmogorov random objects, which are incompressible because they contain few regularities. Kolmogorov called these objects random in the positive sense. We now know that absolutely nonrandom objects exist (See lemma by Gács in (Gács et al. 2001), which was first proved by Levin in 1973 (unpublished)). In 2006, Vitányi developed the theory of recursive function statistic and explained the importance of using a total recursive function to model the regular aspects of an object if we are to be able to identify absolutely nonrandom objects (Vitányi 2006). This is true because in the model class of partial recursive functions, all objects have low minimal sufficient statistic, the main reason being that the complexity of the model part can always be shifted to the data-to-model part of a universal Turing machine of constant complexity. We conclude this section by making the following three observations, which should clarify a lot of confusion as to how the literature on Kolmogorov complexity ought to be read and understood. • It has been common in the Kolmogorov complexity literature to talk about the Kolmogorov complexity of an object on the assumption that there is a one-to-one mapping between objects x and binary specifications spec(x). Unfortunately, the literature doesn’t distinguish explicitly between a binary specification and the object it specifies, and this has been a source of confusion for many. If we are to be more explicit, we shouldn’t be talking about the Kolmogorov complexity of an object x, but about the complexity of the binary encoding, spec(x), of a specification of x, and write K(spec(x)) = min.p {|p| : U (p) = spec(x)}, where U is a fixed reference universal Turing machine. By the same token, when the literature talks about the information content of an object, it is the information content of the binary encoding of a specification of that object that should be inferred. • The Kolmogorov complexity of a finite string x is an objective measure of the amount of information in x, which includes information about both regular and random parts in x. What one would usually mean by the word “information” in ordinary language is really about the amount of information in the regular parts of x, which is captured by Kolmogorov algorithmic sufficent statistic, Gell-Mann’s effective complexity, or Vitányi’s meaningful information. Thus, if we consider a 2-part description (p, d) of a shortest program x∗ for x, where p and d describe the regular and 8 random parts in x∗ , respectively, then the amount of meaningful information in x is about the size of p, and not the size of x∗ . Returning to our example at the beginning of this section about the two 1000-character strings x and y, where x is a passage from the book War and Piece and y is a sequence of randomly generated characters, let the 2-part descriptions of the shortest progams for x and y be (px∗ , dx∗ ) and (py∗ , dy∗ ), respectively. It is true that K(y) > K(x), but it is also true that K(x) ≈ |px∗ | and K(y) ≈ |dy∗ |. In other words, most of the information content of x is about the regular parts in x, while most of the information content of y is about the random parts in y. This explains why x contains more meaningful information than y. • Kolmogorov distinguished between two types of random strings. Those that are random in the positive sense and those random in the negative sense. While both types of random strings have maximal Kolmogorov complexity, only random strings in the negative sense are complex and have maximal (meaningful) information content. On the other hand, random strings in the positive sense are not complex at all and have little or no information content. An example of a random object in the negative sense would be the United States tax code since it contains many rules and each rule is a regularity. An example of a random object in the positive sense would be a string of 1000 characters selected at random. 3.2 Confusing an Object and Its Name The use-mention distinction in analytic philosophy is about confusing an object and its name. We shall make this distinction clear using the following, rather peculiar, example: Steve has five letters. If this sentence is telling us that the word Steve consists of 5 letters, then we say that this sentence mentions the word Steve. In here, the word Steve refers to its own text. However, if this sentence is telling us that a man named Steve has received 5 letters in the mail, then we say that this sentence uses the word Steve. In here, the word Steve refers to a specific person. Thus, mentioning an object refers to the name of the object, while using an object refers to the object itself. We note that confusing an object and its name is a classical philosophical fallacy (Raatikainen 1998). This is because determining the truth value of a sentence depends very much on whether a sentence uses or mentions something. For example, in the above example, the mention of Steve is a true statement because there are indeed 5 letters in the word Steve. However, the truth value of the use of Steve in the above sentence is not clear at all. It depends on whether Steve has actually received 5 letters in the mail or not. Things can get even more complicated when a sentence is self-referential, which could lead to what is known as the semantic paradox. For example, consider the following statement: 9 This statement is false. The use of the word This in the above statement could be either true or false, depending on the truth value of the thing This refers to. However, the mention of the word This gives a contradiction. This is true because if the statement “This statement is false” is true, then it cannot be true because it says about itself that it is false. Similarily, if the statement “This statement is false” is false, then it must be true. In either case, we get a contradiction. Using the language of analytic philosophy, we can say that both Shannon’s entropy H(X) and Solomonoff’s universal probability P (x) use their arguments. This is true because both H(X) and P (x) report information about the source probability distributions of their arguments. Thus, the values of H(X) and P (x) are useful only in so far as they describe the true probability distributions of the information sources of their arguments. Returning to Kolmogorov complexity, we say that K(x) mentions x. This is because K(x) reports the length of a shortest program capable of generating x on a Universal Turing machine, which is an intrinsic property of x. Thus, while both H(X) and P (x) refer to information sources, K(x) refers to the name x. This explains why Kolmogorov complexity is a suitable objective measure for the amount of information stored in the individual string x. Furthermore, it is known that Shannon’s entropy H(X) and Solomonoff’s universal probability P (x) are closely related to Kolmogorov complexity K(x) (Cover 2006). In particular, we know that K(x) ≈ − log P (x) and H(X) ≈ The expected value of K(x) With this in mind, it is only fair that all three measures be accepted as objective measures for the amount of information in an individual string. References [1] Bar-Hillel, Yehoshua (1952), “Semantic information and its measures”, Trans. of the 10th conference on Cybernetics, 33–48. [2] Carnap, Rudolf and Bar-Hillel, Yehoshua (1952) “An outline of a theory of semantic information”, Technical Report no. 247, MIT Research Laboratory in Electronics. [3] Chaitin, Gregory J. (1966) “On the length of programs for computing binary sequences”, Journal of the ACM. 13:4, 547–569. [4] Cover, Thomas and Thomas, Joy (2006) Elements of Information Theory, Second Edition, John Wiley & Sons. 10 [5] Cover, Thomas, M. (1985) “Kolmogorov complexity, data compression, and inference”. In J. K. Skwirzynski, editor, The Impact of Processing Techniques on Communications, Martinus Nijhoff Pubslishers, 23–33. [6] Fano, Roberto, M. (1949) “The transmission of information”, Technical Report No. 65, Research Laboratory of Electronics at MIT. [7] Gács, Peter, John T. Tromp, and Paul M. B. Vitányi (2001) “Algorithmic statistics”, IEEE Transactions on Information Theory, 47:6, 2443–2463. [8] Gell-Mann, Murray and Seth Lloyd (2003) “Effective complexity”, The Santa Fe Institute, 387–398. [9] Gell-Mann, Murray and Seth Lloyd (1996) “Information measures, effective complexity, and total information”, Complexity, 2:1, 44-52. [10] Grassberger, Peter (1990) “Information and compelxity measures in dynamical systems”, Information Dynamics, Plenum Press. [11] Grassberger, Peter (1986) “Toward a quantitative theory of self-generated complexity”, International Journal of Theoretical Physics, 25:9, 907–938. [12] Kolmogorov, Andrey and V.A. Uspenski (1963) “On the definition of an algorithm”, Uspehi Mat. Nauk. 13, 3–28. AMS Transl. 2nd ser.29 (1963) 217–245. [13] Kolmogorov, Andrey (1965) “Three approaches for defining the concept of information quantity”, Problems of Information Transmission, 1:1,1–7. [14] Kolmogorov, Andrey (1983) “Combinatorial foundations of information theory and the calculus of probabilities”, Russian Mathematical Surveys, 38:4, 29–40. [15] Kraft, Leon, G. (1949) “A device for quantizing, grouping, and coding amplitude modulated pulses”, MS Thesis, Electrical and Engineering Department, MIT. [16] Li, Wentian (1991) “On the relationship between complexity and entropy for Markov chains and regular languages”, Complex Systems, 5, 381–399. [17] Li, Ming and Paul Vitányi (2008) An Introduction to Kolmogorov Complexity and Its Applications, Third Edition, Springer-Verlag. [18] Popper, Karl, R. (1934) Logic der Forschung, Springer, Wien. [19] Raatikainen, Panu (1998) “Complexity and information: a critical evaluatioin of algorithmic information theory”, Reports from the Department of Philosophy, University of Helsinki 2, 1–32. [20] Solomonoff, Ray, J. (1985) “Optimum sequential searh”. 11 [21] Solomonoff, Ray, J. (1964) “A formal theory of inductive inference”, Part 1 and 2, Inform. Control. 7, 1–22, 224–254. [22] Shannon, Claude, E. (1948) “A mathematical theory of communication”, Bell System Technical Journal. 27, 379–423. [23] Turing, Alan M. (1936) “On computable numbers, with an application to the Entscheidungsproblem”, Proceedings of the London Mathematical Society, 2: 42, 230–265. [24] Vitányi, Paul (2006) “ Meaningful information”, IEEE Transactions on Information Theory, 52:10, 4617–4626. [25] Wiener, Norbert (1948) , Cybernetics, or Control and Communication in the Animal and the Machine, MIT Press, Cambridge, Mass. [26] Wicken, Jeffrey S. (1987) “Entropy and information: suggestion for common language”, Philosophy of Science, 54, 176-193. 12
7cs.IT
To appear in Theory and Practice of Logic Programming (TPLP) 2005 1 arXiv:cs/0408027v1 [cs.CL] 12 Aug 2004 CHR Grammars HENNING CHRISTIANSEN Roskilde University, Computer Science Dept., P.O. Box 260, DK-4000 Roskilde, Denmark (e-mail: [email protected]) submitted 31 August 2002; revised 26 September 2004, 15 June 2004; accepted 9 August 2004 Abstract A grammar formalism based upon CHR is proposed analogously to the way Definite Clause Grammars are defined and implemented on top of Prolog. These grammars execute as robust bottom-up parsers with an inherent treatment of ambiguity and a high flexibility to model various linguistic phenomena. The formalism extends previous logic programming based grammars with a form of context-sensitive rules and the possibility to include extra-grammatical hypotheses in both head and body of grammar rules. Among the applications are straightforward implementations of Assumption Grammars and abduction under integrity constraints for language analysis. CHR grammars appear as a powerful tool for specification and implementation of language processors and may be proposed as a new standard for bottom-up grammars in logic programming. KEYWORDS: Constraint logic programming, Constraint Handling Rules, Logic grammars 1 Introduction Constraint Handling Rules (Frühwirth 1998b) (CHR) provide a natural framework for extending logic programming with bottom-up evaluation which, together with other qualities of CHR, makes it interesting to consider CHR for language processing. In general, constraint solving techniques have proved to be important for expressing and solving linguistic problems. In order to promote and facilitate language processing in CHR, we propose a standard for a grammar notation built upon CHR, called CHR Grammars or CHRG for short. At a first glance, CHRG may be seen as a bottom-up counterpart to the well-known Definite Clause Grammars (Pereira and Warren 1980) (DCG), but the CHRG formalism includes additional facilities that are not obvious or possible in DCG. Most notably, the notation supports context-sensitive rules that may consider arbitrary symbols to the left and right of a sequence be matched. Counterparts to the different sorts of rules of CHR (propagation, simplification, and simpagation) are present in CHRG and grammar rules may also refer to extra-grammatical hypotheses in both head and body of rules. CHRGs are implemented by a compiler into CHR analogously to the way DCGs usually are translated into Prolog. This 2 H. Christiansen provides a seamless integration with CHR and Prolog, so that the high-level notation of CHRG is combined with the sort of tools and libraries that are relevant for practical applications. When executed as a parser, a CHRG is robust of errors and provides an elegant handling of ambiguity: Rules apply bottom-up as long as possible and grammar nodes corresponding to the different parses can be read out of the final constraint store. The context-sensitive rules provide a high degree of expressiveness both for simplifying the overall grammar structure and for modeling phenomena such as longdistance reference and coordination in natural language. Context-sensitivity can also be used for classifying lexical tokens in a way quite similarly to the component called a tagger in language processing systems. The possibility to apply extra-grammatical constraints in grammar rules makes it straightforward to express abductive language interpretation with integrity constraints written as CHR rules; no extra meta-level overhead is necessary. Facilities from Assumption Grammars (AG) are included in CHRG in a similar way; AGs are in many ways similar to abduction but provide also primitive scoping mechanisms not found in the abductive approach. The CHRG system accepts any grammar whose context-free backbone is without empty-productions and loops and it has no problems with left-recursion as is the case for DCG. The efficiency is highly dependent on the grammar: For locally unambiguous grammars (to be defined), execution is linear and for a general context-free grammar cubic similarly to other general parsing algorithms. The CHRG system is implemented in SICStus Prolog and is available on the Internet (Christiansen 2002b). Overview The following section 2 provides the background and motivation of this work and reviews important, related work. Section 3 describes syntax and semantics of the CHRG notation together with the principles used for its implementation in CHR; section 4 shows examples of CHRGs. The approach to abductive language interpretation is described in section 5, firstly at an abstract level as a general method for transforming abductive language interpretation into a deductive form which is not tied to a specific grammar formalism. We then show how the principles can be applied in CHRG in a version for unambiguous grammars and an extension for ambiguous grammars (some extra machinery is needed as to avoid cluttering up abducibles for different parses). Section 6 explains the implementation of Assumption Grammars in CHRG. Section 7 gives a summary and discusses future perspectives. CHR Grammars 3 2 Background and related work Our work can be described as filling out the lower right corner in the following commutative diagram: Prolog −−−−→ CHR     y y DCG −−−−→ CHR Grammars Definite Clause Grammars (Pereira and Warren 1980) (DCGs) have been an integral component of most Prolog systems for decades and are basically a derivative of Colmerauer’s Metamorphosis Grammars (Colmerauer 1975) that were designed together with one of the first versions of Prolog. DCGs are syntactic sugar for Prolog programs which in their now standard implementation represent strings by means of difference lists. When executed as a parser, a DCG inherits Prolog’s top-down strategy with backtracking for checking out different alternatives. DCGs are very popular as they are very easy to write down and get running, especially for toy languages and not too complicated fragments of, say, natural language or programming languages. DCGs put very few restrictions on the context-free backbone of the grammar, as do most traditional methods for writing parsers; see, e.g., (Aho et al. 1986). The main drawbacks of DCGs are • lack of robustness, if the string to be analyzed does not conform with the grammar the result is simply failure, • backtracking may lead to combinatorial explosions, so a grammar for a larger application needs to be tuned very carefully with cuts and the like to avoid this, • lacking ability to handle left-recursive grammars. To compensate partly for this, different authors (not referenced here) have proposed compiling DCGs into bottom-up parsers by traditional means. The CHR language (Frühwirth 1998b) was introduced as a tool for writing constraint solvers in a declarative way for traditional constraint domains such as real or integer numbers and finite domains. CHR has proved to be of more general interest and is available as extension of, among others, SICStus Prolog (Swedish Institute of Computer Science 2003). The CHR web pages (Constraint Handling Rules Online 2002) contain a growing collection of applications. Being of special interest to language processing, (Abdennadher and Schütz 1998) have shown that CHR adds bottom-up evaluation to Prolog and a flexibility to combine top-down and bottom-up computations; (Abdennadher and Christiansen 2000) have taken this a step further showing that abductive logic programs can be expressed directly in CHR. The metaphor given by the diagram above is very precise as we propose a notation that can be seen as a layer of syntactic sugar over CHR rules that parses bottom-up. A string is entered as a set of initial constraints and the rules apply 4 H. Christiansen over and over producing more and more syntax nodes from those already found. In this way we achieve a robustness not found in DCGs and avoid also the problems with backtracking and left-recursion; furthermore, this approach gives an inherent and elegant treatment of ambiguity without backtracking. In our approach, a string is encoded by means of integer word boundaries as also used in Datalog grammars (Dahl et al. 1994) and the classical paper on DCGs (Pereira and Warren 1980). It is interesting to compare our CHRG formalism with Constraint Multiset Grammars (Marriott 1994) (CMGs) that can apply also to multidimensional languages such as diagrams. The rules of CMG include also context-conditions which seems capable of expressing the sort of context conditions included in CHRG. Meyer (Meyer 2000) has applied CHR for parsing of CMGs with techniques very similar to ours, however without considering the compilation of a grammar notation into CHR. Recent work by (Bottoni et al. 2001) has proposed to apply a variant of linear logic for parsing CMGs. Morawietz (Morawietz 2000) has implemented deductive parsing (Shieber et al. 1995) in CHR and shown that a specialization of a general bottom-up parser for context-free rules leads to propagation rules similar to those produced by our compiler. Our proposal for a grammar notation upon CHR was put forward in (Christiansen 2001) and presented briefly in (Christiansen 2002c); the CHRG system has also been presented as (Christiansen 2003). An attempt to characterize the grammar of ancient Egyptian hieroglyph inscriptions by means of context-sensitive rules in CHRG is given by (Hecksher et al. 2002). In (Christiansen and Dahl 2002; Christiansen and Dahl 2003), we have applied CHR for parsing with error detection and correction in which we employ CHRs ability to combine top-down and bottom-up computations, cf. (Abdennadher and Schütz 1998): Parsing proceeds bottom-up as described in the present paper and when symptoms of an error are seen, a top-down sweep for correcting the string is started, so that the parser may continue. The notion of constraints, with slightly different meanings, is often associated with language processing. “Constraint grammars” and “unification grammars” are 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., (Gazdar and Mellish 1989; Allen 1995; Duchier 2000) for introduction and overview. One approach using CHR for this purpose in HPSG is (Penn 2000). Blache (Blache 2000) proposes a formalism with specific kinds of constraints for natural language which also seems to fit with an implementation in CHR. This approach combines constraints on the order in which things must occur, on which things imply the presence or absence of other things, etc. We have not tried to model this in CHRG, but CHRGs contexts and possible use of arbitrary hypotheses seems to be suited. See also (Duchier and Thater 1999; Maruyama 1994; Schröder et al. 2000) for similar approaches. Our approach to abductive language interpretation using CHR Grammars is based on extension of our previous work (Abdennadher and Christiansen 2000) who showed how an abductive logic program with integrity constraint (but limited CHR Grammars 5 use of negation) can be rewritten as a CHR program; basically, the idea is to declare abducibles as constraints and write integrity constraints as CHR rules, and abduction works so to speak for free without any meta-level interpreter which usually is associated with abduction. We are not aware of other approaches to abductive language interpretation using CHR in this way. The advantages of abduction for language interpretation — as theoretical model or as implementation — has been recognized be several authors, e.g., (Charniak and McDermott 1985; Gabbay et al. 1997; Hobbs et al. 1993; Christiansen 1993) just to mention a small fraction, and this is taken in the present work as an established fact. A conventional implementation of DCGs (Pereira and Warren 1980) applies a purely deductive interpretation method, synthesizing the meaning of a phrase from the meanings of its subphrases. This works well when context is known and every piece of information to be extracted is expressed in an explicit way. Abduction is in favour for more subtle meanings given, e.g, by linguistic implicature, and when the attention is on context comprehension. In (Christiansen 1999) we have related Stalnaker’s (Stalnaker 1998) view of context comprehension to abductive language interpretation. One way to achieve abduction with logic grammars is, of course, to interpret a DCG using an interpreter for abductive logic programs such as (Kakas et al. 2000); we have not made any benchmark tests but we expect this to be far less efficient than what is described in the present paper. An interesting variation of our method is to combine the core of our abduction method with DCGs as shown in example 12 below: The DCG is processed in the usual way but it may refer to abducible predicates defined as CHR constraints. An earlier paper (Christiansen 2002a) on our approach to abductive language interpretation discusses in more detail the relation to other abduction methods. In (Christiansen and Dahl 2004) we have considered how our CHR versions of abduction and assumptions (Dahl et al. 1997) with integrity constraints can be used as an extension to Prolog. 3 Syntax, semantics, and implementation of CHRG 3.1 Preliminaries: First-order logic and CHR First-order logic is assumed; variables are typically denoted by letters such as x , y, . . . or with capital letters in typewriter font in programming notation; constants are typically denoted by letters such as a, b, . . .; notation with a horizontal bar as in x̄ refers to a sequence of variables, similarly ā, . . . for sequences of constants and t̄, . . . for sequences of terms. We give the necessary definitions and properties for Constraint Handling Rules (CHR) in a slightly simplified form and refer to a general introduction elsewhere (Frühwirth 1998b). Two disjoint sets of constraint predicates are assumed, called defined constraints (i.e., defined by the current program) and built-in constraints, the latter including “=”, “6=”, true, and false. Atoms of constraint predicates are (with a slight over- 6 H. Christiansen loading of usage) called (defined and built-in) constraints. Conjunctions are written by either “∧” or, in programming notation, a comma. The following CHR rules1 are recognized: Progagation rules H ==> G|B , Simplification rules H <=> G|B , and Simpagation rules H \H ′ <=> G|B being an abbreviation for H ,H ′ ==> G|H ,B . Each H (and H \H ′) is called the head2 of the rule and is a conjunction of one or more defined constraints indicated by commas, G the guard being a conjunction of built-in atoms, and B the body being a conjunction of constraints. A guard corresponding to true can be left out together with the vertical bar. In examples and extensions to the framework we apply occasionally the possibility in the implemented CHR system of including arbitrary Prolog code in rule bodies, including those auxiliaries of the CHR system that goes beyond a declarative semantics as well as the abstract, procedural semantics given below. The same goes for the application of so-called deep guards in which constraints are called in the guard. In such cases we supply suitable informal descriptions. A CHR program is a finite set of rules with its declarative semantics given as the conjunction of a logical reading of each rule as follows; the built-in “=” and “6=” have their standard syntactic meaning. Propagation rules and simplification rules in the format above are taken as abbreviations for the following respective formulas:  ∀x̄ (∃ȳG) → (H → ∃z̄ B )  ∀x̄ (∃ȳG) → (H ↔ ∃z̄ B ) where x̄ refer to the variables in H , ȳ to those in G not overlapping with x̄ , and z̄ to those in B not overlapping with x̄ ; for simplicity it is assumed that ȳ and z̄ do not overlap; see (Frühwirth 1998a; Frühwirth 1998b) for a generalization. A rule with z̄ empty is said to be range-restricted. A state is defined to be a set of constraints and an initial state for a query Q (being a conjunction of constraints) is Q itself; we do not distinguish between sets and conjunctions. We distinguish a special state referred to as failure and any derivation step (below) leading to this state is said to be failed. To execute a(n instance of a) body C ∧ E ∧ N where C are defined constraints, E and N built-in’s with predicates “=” and “6=”, resp., in state S , consists of forming the state (S ∪C ∪N )σ where σ is a common, most general unifier for E . In addition, any s 6= t with s and t nonunifiable is removed. However, if no such σ exists or (S ∪ N )σ contains t 6= t for some term t , the execution fails. Execution of a body containing false fails. For an instance H ==> G|B of a propagation rule, we say that it can be applied 1 2 Our usage is to consider “CHR” as a name of a language rather that a written shorthand for a three-word term, thus “CHR rule” is not redundant. Our terminology differs slightly from (Frühwirth 1998b) who refers to each atom to the left of the arrow as a head. CHR Grammars 7 in a state S whenever H ⊆ S and S |= ∃G, and to apply it means to execute B leading to a new state. When referring to an application of a rule H ==> G|B of the current program, this refers to some application of an instance (H ==> G|B )σ where σ is a substitution to the variables of H (referred to as x̄ above). No rule can be applied to a failure state. Application of simplification rules is defined in a similar way except that the head constraints are removed from the state before the body is executed. A derivation for a query Q with program P is a sequence of states Q = S0 , S1 , . . . , Sn where each Si , 0 < i ≤ n is the result of applying a rule of P to Si−1 with Si−1 6= Si . A given propagation rule cannot be applied to the same constraints more than once. A state in a derivation is final if it is not failed and no rule can apply, and in this case the derivation is successful; a derivation ending with a failure state is said to be failed. In practice, CHR programs are executed in a specific left-to-right order which may or may not restrict the final result. To define this, we must pay attention to the order in which conjunctions are written and the textual order of the rules; the actual computation rule applied in, say, the SICStus Prolog version of CHR (Swedish Institute of Computer Science 2003) is quite complicated but the following simplified characterization is a good approximation that covers most cases. An LR-derivation is one in which: • A state is a sequence of constraints c1 , . . .,cn . • A built-in constraint is considered (as specified above) only when it appears as c1 and this takes priority over rule applications. • For all i, no rule application involves any of ci , . . .,cn if another application of a rule is possible. • Rules are tested for applicability in the textual order in which they occur in the program. • Whenever a rule is applied in a step, requiring constraints R to be removed from and A (as a sequence given by textual order in rule body) to be added to a state S = c1 , . . .,cn , the new state is A,S ′ where S ′ is S with R removed and with the order of the remaining constraints preserved. This principle is also referred to as the LR computation rule and it implies that there is only one possible derivation. The version of CHR that underlies the implemented CHRG system (Christiansen 2002b) performs LR-derivations. A derivation without this computation rule is called unrestricted. The following correctness properties for CHR derivations follow from (Frühwirth 1998b): Proposition 1 (Soundness) Let P be a CHR program, Q a ground query, and F a final state in a derivation for Q . Then P |= Q ↔ ∃F and P ∪ Q |= ∃F . 8 H. Christiansen Proposition 2 (Completeness) Let P be a CHR program and Q a ground query which has at least one finite derivation and let F be a conjunction of constraints so that P |= Q ↔ ∃F . Then there exists a derivation with final state F ′ so that P |= ∃F ′ ↔ ∃F . The following consequences are relevant for soundness and completeness of bottomup parsers written in CHR. Proposition 3 Let P be a CHR program consisting of range-restricted propagation rules only and let F be a final state for a ground query Q . Then F is the least Herbrand model for P ∪ Q . In our treatment of abduction we may occasionally arrive at rules that are not range-restricted so the following refinement is useful: Proposition 4 Let P be a CHR program consisting of propagation rules only and let F be a final state for a ground query Q . Then there exists a ground instance of F which is a least Herbrand model for P ∪ Q . When using CHR for checking integrity constraints we rely on: Proposition 5 Let P be a CHR program with the property that any derivation with P is finite. We have, then, that P ∪ ∃Q for any query Q is consistent if and only if there is a successful derivation for Q with P . Soundness of disambiguation of grammars by replacing propagation rules by simplification rules follows from: Proposition 6 Let P be a CHR program consisting of propagation rules, and P ′ derived from P by changing some rules into simplification or simpagation rules, and let S and S ′ be final states for a given query with the programs P and P ′ . Then S ′ ⊆ S . 3.2 Syntax and informal semantics of CHRG A CHR Grammar, or CHRG for short consists of finite sets of grammar symbols and constraints and a finite set of grammar rules, each of which may be a propagation (grammar) rule, a simplification (grammar) rule, or a simpagation (grammar) rule. An attributed grammar symbol, for short called a grammar symbol, is formed as an atom whose predicate symbol is a grammar symbol; a grammar symbol formed by token/1 is called a terminal, any other grammar symbol a nonterminal. Sequences of terminal symbols token(a1), . . ., token(an ) may also be written [a1 , . . ., an ]; if ground, such a sequence is called a string. A few grammar symbols and operators are given a special meaning (made precise later): CHR Grammars 9 • “...” and “i...j ” with i < j called gaps3 supposed to match sequences of arbitrary length, resp., length n with i ≤ n ≤ j , • “all” referring to the entire input string, which may be useful together with: • “α $$ β”, called parallel match, supposed to match strings that are matched by α as well as β. When referring to a sequence of grammar symbols, this may involve applications of the parallel match operator. A propagation rule is of the form α -\ β /- γ ::> G | δ. The part of the rule preceding the arrow ::> is called the head, G the guard, and δ the body; α, β, γ, δ are sequences of grammar symbols and constraints so that β contains at least one grammar symbol, and δ contains exactly one grammar symbol which is a nonterminal (and perhaps constraints); α (γ) is called left (right) context and β the core of the head; G is a conjunction of built-in constraints as in CHR and no variable in G can occur in δ. If left or right context is empty, the corresponding marker is left out and if G is empty (interpreted as true), the vertical bar is left out. The convention from DCG is adopted that constraints (i.e., non-grammatical stuff) in head and body of a rule are enclosed by curly brackets). Gaps and parallel match are not allowed in rule bodies. There is a restriction on the use of gaps in the core of a head so that the core must be bounded defined in the following way. This ensures that the core matches a specific interval of word boundaries when applied (and thus defines meaningful boundaries for the body): • The core is bounded if it is left and right bounded. • A sequence A1 , . . . , An is left bounded (right bounded) if A1 (An ) is not a gap. • A parallel match A $$ B is left bounded (right bounded) if at least one of A and B is left bounded (right bounded). Furthermore, it is assumed that any variable appearing in body as well as guard also must occur in the head. A grammar rule is range-restricted if any variable in the body appears in the head. A simplification (grammar) rule is similar to a propagation rule except that the arrow is replaced by <:>; a simpagation (grammar) rule is similar to a simplification except that one or more grammar symbols or constraints in the core of the head are prefixed by an exclamation mark “!”. The intended meaning is that head core elements under a derivation are removed, except those prefixed by “!”. (As the order of the elements in the head of a grammar rule does matter, we cannot take over the syntax from CHR.) 3 These gaps provide a superficial resemblance with Gapping Grammars (Dahl 1984), however, in the present version of CHGR it is not possible to move around the string matched by a gap as in Gapping Grammars. 10 H. Christiansen Example 1 The following source text shows the actual syntax used in the implemented system. The “handler” command is a reminiscent from the underlying CHR system; grammar symbols are declared by the grammar_symbols construct as shown; constraints to be used in grammar rules are declared as in CHR which will be shown in subsequent examples. The final command has no effect in the present example, but it adds extra rules needed for the extensions of CHRG described in sections 5 and 6. handler my_grammar. grammar_symbols np/0, verb/0, sentence/0. np, verb, np ::> sentence. [peter] ::> np. [mary] ::> np. [likes] ::> verb. end_of_CHRG_source. When the string “peter likes mary” is entered word by word, the words are recognized as a respectively np, verb, and np in that order, and then the rule for sentence can apply. Since this grammar consists of propagation rules, the lexical tokens as well as the nps and verb are not consumed. If we added a rule, say np, [likes] ::> sentence1, a sentence as well as a sentence1 would be recognized. If all rules were changed into simplification rules, i.e., replacing ::> by <:>, only one of sentence and sentence1 would be recognized. Left and right contexts of a rule may include “disjunctions” denoted by semicolon of different alternatives, and this is considered syntactic sugar for the set of different rules, taking one alternative for the left and one for the right. Example 2 The rule (a ; b) -\ c /- (d ; e) ::> f is an abbreviation for the following four rules: a b a b -\ -\ -\ -\ c c c c ////- d d e e ::> ::> ::> ::> f f f f The implemented version of CHRG allows control structures in the body (conditionals and Prolog-style disjunctions) and arbitrary Prolog goals inside {· · ·} as well as bodies with no grammar symbols; for the reason of simplicity, we ignore these options in this presentation. 3.3 Bottom-up derivations as semantics and the relation to top-down syntax derivations In order to capture the whole CHRG formalism, a semantic definition needs to be based on bottom-up derivations and the simplest way to achieve this is by a trans- CHR Grammars 11 lation of CHRG into CHR. For comparison with traditional grammar formalisms, we provide also a definition of top-down derivations that characterize a subclass of GHRGs. For each grammar symbol N of arity n, we assume a corresponding constraint also denoted by N of arity n + 2 called an indexed grammar symbol, with the extra two arguments referred to as phrase (or word) boundaries. For a grammar symbol S = N (ā), the notation S n0 ,n1 refers to the indexed grammar symbol N (n0 ,n1 ,ā) with integers n0 < n1 ; in case of a terminal, n0 + 1 = n1 is assumed. For any sequence σ of grammar symbols S1 , . . . , Sk and increasing n ,n integers n0 , n1 , . . . , nk , we let σ n0 ,nk refer to the set {S1n0 ,n1 , . . . , Sk k −1 k } with the existence of n1 , . . . , nk −1 understood. For the parallel match operator, we define (α $$ β)n,m = αn,m $$ β n,m . This notation is extended so that for a sequence of grammar symbols and constraints, we remove all constraints from the sequence, put indexes on the remaining grammar symbols, and add again the constraints to the sequence in their original position. Gaps are removed from rule heads under this translation but give rise to inequations to be added to the guard of the resulting CHR rule; we do not formalize this here but illustrate the principle in example 4 below. The translation of rules from CHRG into CHR adds two extra variables to each grammar symbol and we use a notation analogous to the above to indicate this. So for a sequence σ of grammar symbols S1 , . . . , Sk and variables x0 , x1 , . . . , xk , we let x ,x σ x0 ,xk refer to the set {S1x0 ,x1 , . . . , Sk k −1 k } with the existence of x1 , . . . , xk −1 understood. The notation is extended to sequences of grammar symbols and constraints as above so that constraints are unaffected. The translation of a CHRG G into CHR is denoted C (G) and consists of the translation C (R) of each rule R ∈ G. For propagation and simplification rules we have C (α -\ β /- γ ::> G|δ) = (αx0 ,x1 ,β x1 ,x2 ,γ x2 ,x3 ==> G|δ x1 ,x2 ), C (α -\ β /- γ <:> G|δ) = (αx0 ,x1 ,γ x2 ,x3 \β x1 ,x2 <=> G|δ x1 ,x2 ). Simpagation grammar rules are translated similarly to simplifications except that those elements of β x1 ,x2 that were preceded by “!” in the original grammar rule are moved to the left of the backslash. Notice that a grammar rule R is range-restricted if and only if the CHR rule C (R) is range-restricted. Example 3 The rule in following source text: constraints h/1. grammar_symbols a/0, b/1, d/1, e/2. a -\ b(X), [c], {h(Y)} /- d(Y) ::> e(X,Y). is translated into this CHR rule: a(N0,N1), b(N1,N2,X), token(N2,N3,c), h(Y), d(N3,N4,Y) ==> e(N1,N3,X,Y). 12 H. Christiansen Example 4 The translation of gaps and parallel matching into CHR is illustrated for the following CHRG rules. a, ..., b /- ..., c(X) <:> d(X). a$$b ::> e. They are translated into the following CHR rules: c(N5,_,X) \ a(N1,N2),b(N3,N4) <=> N2=<N3, N4=<N5 | d(N1,N4,X) a(N1,N2),b(N1,N2)==>e(N1,N2) The gap in the context part of the first rule is used in order to make a “long-distance reference” to c. Notice that a gap in the head of core of a simplification rule does not imply the removal of any grammar symbols recognized in the substring spanned by the particular “instance” of the gap. A (bottom-up) parsing derivation for a string σ with a CHRG G is a derivation with the CHR program C (P ) for the query σ 0,n where n is the length of σ. An interesting class of parsing derivations are those that apply an LR computation rule as in the implemented CHRG system and for which we describe some optimizations below. Definition 1 A single-production is a grammar rule with singleton grammar symbols in head core and in body. A grammar is loop-free if there is no chain of single productions · · · g1 (. . .) · · · >>> · · · g2 (. . .) · · · , ..., · · · gn−1 (. . .) · · · >>> · · · gn (. . .) · · · , with g1 = gn ; here each occurrence of “>>>” may stand for any of “<:>” or “::>”. In order get rid of termination problems once and for all, any CHRG is assumed to be loop-free.4 We notice without proof the following obvious properties. Proposition 7 1. Any parsing derivation is finite (as we assume all grammars to be loop-free). 2. Any state in a parsing derivation with a range-restricted grammar is ground. 3. The final state in an LR parsing derivation for a given string is unique (up to renaming of existentially quantified variables that may occur for non-rangerestricted grammars). 4. The final state in a parsing derivation with a propagation rule grammar is unique (up to renaming . . .); thus LR-derivations are complete for propagation rule grammars. 4 It is possible to weaken this definition slightly: Some chains of single-productions can be allowed provided their arguments plus non-grammatical hypotheses do not grow in an application of the rule. As we have assumed a set-based semantics for CHR (as opposed to multi-sets), we could allow even p(X)::>p(X) but not p(X)::>p(f(X)) or p(X),{h(Y)}::>p(X),{h(f(Y))}. CHR Grammars 13 5. Completeness of LR-derivations does not necessarily hold for a grammar with simplification or simpagation rules. 6. Let G be a propagation rule grammar without context parts, and G ′ be derived from G by adding to some rules context parts and changing some rules into simplification or simpagation rules, and let S and S ′ be final states for a given string with the grammars G and G ′ . Then S ′ ⊆ S . This holds also when we restrict to LR-derivation for G ′ or for both G and G ′ In order to discuss ambiguity, we define syntax trees but we do not intend that an implementation should generate trees. Definition 2 Let CHRG G and input string σ be given. The set of syntax trees over σ is defined as follows. • Any t = token(a,n,n + 1) in σ is a syntax tree with top node t . • Whenever a rule instance α -\ β /- γ>>>G | δ, “>>>” being one of “::>” or “<:>”, is applied in a derivation and T1 , . . ., Tn are trees whose top nodes are the grammar symbols in β, then T1 δ / ··· \ · · · Tn is a syntax tree with top node δ. A syntax tree whose top node does not occur in the final state (i.e., it has been consumed by a propagation or simpagation rule) is called a hidden syntax tree and similarly for the node itself. The set of LR syntax trees is defined in a similar way, considering only instances applied in the LR-derivation from σ with G. The notions of subtree and proper subtree are defined in the usual way. The relevant notion of unambiguity in the context of CHRG is called local unambiguity and is a stronger property than the usual notion of unambiguity for context-free grammars. CHRG works bottom-up with no sort of top-down guidance so even with an unambiguous grammar (in traditional sense), it may be the case that some subtree becomes part of two different, larger trees (but only one of these contribute to a tree for the entire string). Definition 3 Consider a CHRG G and a derivation for string σ and let T be a set of syntax trees with set of top nodes N. The set T (and N) is said to be unambiguous whenever, for any two grammar symbols p(i,j ,· · ·), q(k ,ℓ,· · ·) ∈ N it holds that • if i ≤ k < j ≤ ℓ, then i = k and j = ℓ, and • if i ≤ k ≤ ℓ ≤ j , then q(k ,ℓ,· · ·) is top node of a subtree of p(i,j ,· · ·) or the other way round [the last case requires single productions in the grammar and hi, j i = hk , ℓi]. 14 H. Christiansen If, furthermore no new syntax tree of the derivation can be added to T without destroying unambiguity, we say that T and N are maximal. A CHRG G is locally unambiguous if the set of syntax trees in the derivation from any input string is unambiguous, and locally LR-unambiguous if the set of syntax tree in the LRderivation from any input string is unambiguous. Maximal unambiguous sets for a given parsing derivation may overlap, and each such set corresponds to one possible way of parsing the string. As we will see later, when doing abduction with ambiguous grammars, it is possible to extend a grammar so that the different unambiguous sets are kept apart by means of indexes. Although CHRG provides an elegant handling of ambiguous grammars, it may be relevant to aim at unambiguity, e.g., for efficiency or to avoid mixing up extragrammatical constraints for different parses. One obvious way to achieve this is given by the following which is easy to prove. Proposition 8 A simplification rule CHRG is locally LR-unambiguous. Although we have no theoretical result, it seems reasonable to believe that the local unambiguity of CHRGs is undecidable as is unambiguity for context-free grammars. If unambiguity is required this can be guaranteed by proposition 8 or perhaps using a combination of different sorts of rules, in which case the property needs to be verified. It should be noticed, that the definition of unambiguous sets does not take into account left and right context parts of grammar rules. A rule that produces a node belonging to one unambiguous set may very likely do so by referring to contextual nodes belonging to other sets. This may be considered a bug or a feature but it seems to be the only solution that fits with our general implementation principle. To compare with traditional grammar formalisms having their meaning defined by top-down derivations we consider definite clause grammars; to simplify the comparison, we make a restriction on how variables can be used. Definition 4 A definite clause grammar (DCG) D consists of rules of the form A-->B1 , . . .,Bn ,{G} where A is a nonterminal, B1 , . . ., Bn are grammar symbols, and G a conjunction of built-in’s so that any variable in A and G occurs in some Bi . A DCG is assumed to be loop-free and without single productions (defined in the usual way). For any ground sequence of grammar symbols αAβ (A a single grammar symbol), define the relation αAβ ⇒ αB1 . . . B2 β whenever there is a rule in D with a ground instance A-->B1 , . . . , Bn , {G} with G satisfied. The reflexive, transitive closure of ⇒ is denoted ⇒∗ . CHR Grammars 15 Proposition 9 Let D be a DCG and C the CHRG that for each rule in D of the form indicated above contains B1 , . . .,Bn ::> G|A. For ground grammar symbol A and terminal string α, the following statements are equivalent: • A ⇒∗ α using the rules of D , • A is contained in the final state in any parsing derivation for α using rules of C. The proof is easily made by induction over the length of the derivations. Combining this with proposition 7, part 6, we see that a CHRG with context parts corresponds to a DCG with context-sensitive restrictions on the derivation relation (that are not easily formalized in the setting of DCG). Finally, notice that CHRG do not provide empty productions. These, however, are easily mimicked by inserting for each DCG rule A-->[] grammar symbols A(0, 0), A(1, 1), . . . into the initial constraint store. 3.4 A compile-on-consult implementation We describe here very briefly the principles used for the implementation of CHRG in SICStus Prolog (Swedish Institute of Computer Science 2003) and describe some additional features of the implemented system not already covered; all facilities are described at the online Users Guide to CHRGs available at (Christiansen 2002b). Similarly to DCG and CHR, CHRG is implemented by changing Prolog’s reader so that the terms read are translated into another form before given to the Prolog compiler (or interpreter). SICStus Prolog includes a so-called hook predicate called term expansion that can be extended by the user and which is called automatically by the Prolog reader for each term read from a source file. The term_expansion clauses defining the CHRG syntax must work together with those already defined by CHR. The general structure of the CHRG implementation is illustrated by the following fragment that treats the grammar_symbols declaration: term expansion( (grammar symbols G), T):add 2 to arities of gr. sym. spec’s G and add token/3 and a few more to form C, term expansion((constraints C), T). Similar rules catch terms formed by the operators <:> and ::>, translate them into CHR rules as described in section 3.3 above and let the CHR system translate them further into Prolog rules.5 The CHRG notation includes counterparts to CHR’s pragmas and rule names (in 5 It is not possible to compile CHR into ordinary Prolog clauses and the SICStus Prolog implementation of CHR is based on the low-level library of Attributes Variables. 16 H. Christiansen CHR using an @ operator), but since it is not possible for override the term expansion clauses given by CHR, it has been necessary to rename these operators in the CHRG syntax, gpragma and @@. Notice that this sort of implementation makes it possible to mix freely the rule formats of Prolog, CHR and CHRG, and DCG for that matter. Finally, the CHRG notation includes a where notation which can be applied to rules of Prolog and CHR as well. We describe it by an example: a(A) -\ where A B C B = = = /- ..., q(X,Y) ::> {C}, funny_sentence(A,Z) ugly(st(r,u,c(t,u,r(e)))), (np, verb, np), (append(X,Y,Z), write(Z)) The meaning is that any occurrence in the rule of A, B, and C is replaced by the indicated term. The implementation is very simple and one might wonder why this syntax is not standard in Prolog systems: term_expansion((Rule where Goal), Result):(Goal -> term_expansion(Rule, Result) ; write(’Error: where-clause failed: <rule> where ’), write(Goal),nl,write(’Compilation stopped’), abort). The CHRG system includes a number of options of which the most important is an optimization in the compilation of grammar rules, so that all but leftmost symbols of core and possible right context are marked by passive pragmas; see the section on CHR of (Swedish Institute of Computer Science 2003) for a detailed explanation of these concepts. For example, with this option the rule np, verb, np ::> sentence gets compiled into np(X0,X1)#A, verb(X1,X2)#B, np(X2,X3) ==> sentence(X0,X3) pragma passive(A), passive(B). This has significant influence on the efficiency that we analyze in detail in section 3.5 below. Operationally, the principle means that this rule is not checked for applicability at the moment when a new verb constraint is created as is the case if no pragma passive stuff were added. And, as the system performs LR-derivation, this check for applicability would anyhow fail. For the nps it means that when a new np is created, the system does not check if it might be followed (qua the word boundary arguments) by verb, np; it is only checked if the new np happens to follow some existing np, verb sequence. It can be shown that the semantics is not changed for propagation rule grammars with only right contexts. When left and right context or simplification or simpagation rules are used, there are subtle cases where a rule is not applied although it intuitively should be applied. When this optimization is used for a grammar of simplification rules only, the constraint store is used effectively as a parsing stack in quite the same way as in a traditional LR(k ) parser. For parsing a specific string, the system includes an auxiliary predicate parse that converts a list of constants to a sequence of calls to token constraints. This CHR Grammars 17 predicate may (as an option that can be switched on and off) display the word boundaries which makes it easy to compare input and result. Assuming the grammar of example 1 above, we have the following dialogue. ?- parse([peter,likes,mary]). <0> peter <1> likes <2> mary <3> np(0,1), verb(1,2), np(2,3), sentence(0,3), token(0,1,peter), token(1,2,likes), token(2,3,mary) ? This grammar consists of propagation rules; if all are changed into simplification rules, only sentence(0,3) appears as answer. 3.5 Time complexity An apparent advantage of CHRG as compared with DCG is that we avoid the combinatorial explosions that may arise under backtracking in case a wrong choice of rule is made in beginning of the string to be analyzed. Here we give theoretical measures for the running time of CHRGs, more precisely the CHR rules that are produced by their compilation, and discuss the behaviour of the implemented system. For simplicity, we do not consider context parts or the use of extra-grammatical constraints. Without loss of generality, we consider only rules with one or two grammar symbols in the head. The CHR rules to consider are, thus, of one of the following forms, possibly with <=> instead of ==>. 1. A(i, j , t̄1 ) ==> B (i, j , t̄2 ) 2. A(i, j , t̄1 ), B (j , k , t̄2 ) ==> C (i, k , t̄3 ) We refer to the so-called meta-complexity theorems of (McAllester 2000; Ganzinger and McAllester 2001; Ganzinger and McAllester 2002) for bottom-up evaluation of logic programs including deletion. CHR rules, such as those we use, with one constraint in the body are covered by this scheme. The main theorem of (Ganzinger and McAllester 2001) gives that time complexity for reaching a final state is of order O(n + p) where n is number of constraints in an initial state and p the number of prefix firings that have appeared in some state in the derivation. The number n is the length of the string in our case. Estimating p is more difficult: For each rule of type 1 (above), we count the number of occurrences of A(i, j , t̄1 ) that have occurred in a state; summing for all type 1 rules, we can limit the contribution by size of grammar times total number of grammar symbols that have occurred in the derivation. For each rule of type 2, the prefix firings are of two kinds, 18 H. Christiansen • occurrences of A(i, j , t̄1 ) (that can be estimated as for type 1), and • occurrences in any state of a pattern matching the entire head A(i, j , t̄1 ), B (j , k , t̄2 ). The dominant contribution is the last one for type 2 rules, i.e., for each rule of type 2 and each C (i, k , t̄3 ) occurring in a state, the possible ways the interval [i, k ] can be split up into [i, j ] and [j , k ] so that some A(i, j , t̄1 ), B (j , k , t̄2 ) have appeared at the same time in the state during the derivation. We continue the analysis for two special cases. • Locally unambiguous grammars: Each C (i, k , t̄3 ) in some state is created exactly once from a specific A(i, j , t̄1 ), B (j , k , t̄2 ) combination. Thus the overall time complexity is proportional to the total number of grammar symbols that have appeared in the derivation, and we argue that it is of order O(n) for a locally unambiguous grammar: Worst case is a binary branching everywhere, so a syntax tree over a string of length n has n nodes in its deepest layer, ⌊n/2⌋ in the second deepest layer, ⌊n/4⌋ in the next one and so. Summing up, we get at most 2n − 1 tree nodes. • Arbitrary grammars without attributes: First of all, let us estimate the maximum number of nodes. There are O(n 2 ) different substrings of the input string, each of which can represent up to g different nodes where g is the number of different grammar symbols in the vocabulary; this is constant, so number of different nodes is O(n 2 ). Each such node C (i, k ) spans over an interval [i, k ], and the maximum number of ways it can be split up into two subintervals by some j , i < j < k , possibly representing A(i, j ), B (j , k ), is k − i − 1. This adds another factor n, so we end up with a total time complexity of O(n 3 ). The general cubic complexity for context-free grammars is similar to that of classical algorithms such as Early and Cocke-Younger-Kasami. Its interesting to notice that parsing is linear for locally unambiguous grammars despite the very naive parsing algorithm which simply applies rules over and over as long as possible. It is straightforward to show that the results also hold for grammars with context parts. So if a grammar is made locally unambiguous by a combination of simplification rules and context parts, it runs in linear time; the presence of attributes does not affect this. When attributes are added in the general case, we can have much worse than cubic complexity as it appears in the following example: Example 5 Consider the grammar [a]::>a(0) a(T1),a(T2)::>a(t(T1,T2)) For each pair of i, j marking a substring of the input string, there will be as many different nodes as there are binary trees with a frontier of j − i + 1 nodes. It appears that each node is constructed in a unique way, but the total number of nodes is given by a terrible combinatorial expression far beyond n 3 . CHR Grammars 19 How do these results compare with practice? First of all, the optimization in section 3.4 adding passive pragmas to all but rightmost symbols is necessary in order to achieve an execution as the one assumed in the theorem of (Ganzinger and McAllester 2001). Secondly, the method behind the implementation of CHR that we have used (based on attributed variables), as described by (Holzbaur and Frühwirth 1999), indicates that word boundaries should be uninstantiated Prolog variables to achieve full efficiency and not integers as we have used. Experiments with Prolog variables for boundaries confirm these results but even with integer indexes, CHRGs without too much local ambiguity execute equally fast for strings up to several hundreds of tokens. Unfortunately, CHR does not construct explicit prefix-firings during execution, which means that only grammars with at most two grammar symbols show the expected running times. It is possible to have the CHRG compiler reduce the size of heads to at most two, but a general improvement of CHR so that it incrementally builds prefix firings would solve the problem. In practice, however, grammars with heads with up to three or four symbols may run almost linearly provided the passive pragma optimization is used and local ambiguity is limited. 4 Examples in plain CHRG 4.1 Disambiguation with simplification and context parts It is often the case that an unambiguous grammar, e.g., a context-free grammar for a programming language, can be written in a much simpler form as an ambiguous grammar with additional “disambiguation principles” specified outside the grammar formalism; see, e.g., (Aho et al. 1986). As we have noticed already, simplification rule grammars are unambiguous and by means of context parts, we can direct the derivations as to respect the priorities we have in mind. Example 6 The following simplification rule CHRG is based on a simple and highly ambiguous grammar for arithmetic expressions with addition, multiplication, and exponentiation. Right contexts have been added which provides a conventional operator precedence. e, [+], e /- ([’+’];[’)’];[eof]) <:> e. e, [*], e /- ([*];[+];[’)’];[eof]) <:> e. e, [^], e /- [X] <:> X \= ^ | e. [’(’], e, [’)’] <:> e. [N] <:> integer(N) | e. In general, both left and right contexts are relevant, and for natural language application, it may be relevant to disambiguate some portions of the grammar in this way but keeping, say, possibilities of ambiguity at the sentence structure level. Natural language processing often involves a phase called tagging in which the 20 H. Christiansen different words are classified before the “real” parsing process takes place. Tagging is often performed by means of context sensitive rules that take into account what is immediately to the left and to the right of the given word (Brill 1995). Such rules can be expressed in quite natural way in CHRG using context parts. Example 7 We consider a languages including sentences such as “Peter and Paul like Martha and Eve”. The following rules classify the names as subject or object according to their position relative to the verb. name(A) /- verb(_) <:> subject(A). name(A), [and], subject(B) <:> subject(A+B). verb(_) -\ name(A) <:> object(A). object(A), [and], name(B) <:> object(A+B). 4.2 Long-distance reference in natural language parsing Context parts can also be used as a way to access attributes of grammar symbols at a certain distance. This is relevant in natural language when a part of a sentence is left out when this part is understood to be identical to the matching part of a neighbouring sentence. Example 8 Let us extend the language of example 7 with coordination as in “Peter and Paul likes and Mary hates Martha and Eve”; The first sentence is incomplete but is understood to borrow its subject from the second sentence. This can be expressed as follows. subject(A), verb(V), object(B) ::> sentence(s(A,V,B)). subject(A), verb(V) /- [and], sentence(s(_,_,B)) ::> sentence(s(A,V,B)). For the sample sentence above, the final constraint store contains sentence nonterminals with attributes s(peter+paul,like,martha+eve) and s(mary,hate, martha+eve). These rules work also in the case when three or more sentences share a common object. For analyzing texts consisting of a single sentence, a rule with a gap could have been used instead: subject(A), verb(V), /- [and], ..., object(B) ::> sentence(s(A,V,B)) 4.3 Post-parsing processing in CHRG In an application program using CHRG for text analysis it may be relevant to make some formatting of the constraint store produced by the parser. As we have noticed, parsing with an ambiguous propagation rule grammar may result in a large number of nodes, most of them not relevant for the further processing (but necessary to guide parsing). It may be the case that we do not want to reduce CHR Grammars 21 ambiguity in the grammar, so some elaboration of the constraint store needs to take place following parsing. Part of such post-parsing processing can in fact be specified conveniently in CHRG. Example 9 Assume we are scanning a text for noun phrases (nps) by means of a highly ambiguous grammar with a detailed description of sentence structure as a way to obtain a high degree of precision in the parser. When the parser has finished its job, we are only interested in noun phrases and let us suppose that only maximal noun phrases are of interest, maximality with respect to text inclusion. This can be achieved by using a constraint cleanup defined by the following rules. vp(_), {!cleanup} <:> true. pp(_), {!cleanup} <:> true. sentence(_), {!cleanup} <:> true. % etc. (..., np(_), ... $$ !np(_)), {!cleanup} <:> true. cleanup <=> true. Recall that the exclamation mark combined with the double arrow indicates simpagation rules: All but those symbols marked by “!” are removed from the store. Assume the following query is issued ?- parse([string]), cleanup. The cleanup rules does not affect parsing as there is no cleanup constraint in the store before all token constraints have been entered and no parsing rule can apply anymore. Now the call to cleanup will, via the first set of rules, remove all nonnp nodes; these simpagation rules will apply over and over until all such nodes are removed but each application leaves cleanup in the store. Then the rule concerning nps will apply to each occurrence of one np textually included in a larger np; recall that $$ is the parallel match operator and the three dots are a gap. The final rule, conveniently written as a CHR rule, will apply when the other rules are exhausted and thus clean up the cleanup constraint. Left in the constraint store is the set of all maximal nps. 5 Abductive language interpretation in CHRG As shown by (Abdennadher and Christiansen 2000) and developed further in (Christiansen 2002a), abduction with integrity constraints can be implemented in a straightforward fashion in CHR, basically by declaring abducible predicates as constraints: When an abducible atom is called, it is added to the constraint store and possible integrity constraints will be triggered automatically. The approach is limited with respect to negation: Explicit negation of abducibles is easily implemented by means of an integrity constraint but more general application of negation-asfailure in background clauses or CHR rules has no obvious representation. We can illustrate the application to language interpretation in CHRG by means 22 H. Christiansen of an example. Consider the following grammar rule in which F refers to a fact about the semantical context for a given discourse. a, b, {F } ::> ab (1) If two subphrases referred to by a and b have been recognized and the context condition F holds, it is concluded that an ab phrase is feasible, grammatically as well as with respect to the context. Language analysis with such rules works quite well when context is completely known in advance, and a given discourse can be checked to be syntactically and semantically sound. Here we provide a solution to the extended problem referred to as language interpretation, of finding proper context theory so that an analysis of an observed discourse is possible. This involves a transformation of grammar rules as above by moving contextual predicates to the other side of the implication: a, b ::> {F }, ab (2) Ituitively it reads: If suitable a and b are found, it is feasible to assert F and (thus, under this assumption) to conclude ab. Although (1) and (2) are not logically equivalent it is straightforward to formulate and prove correctness of this transformation as we will see below. A grammar as depicted by (1) can be thought of as part of a speaker’s capabilities, embedding his knowledge about the context into language, whereas (2) is relevant for a listener who wants to gain new context knowledge by an interpretation of the spoken. 5.1 Abduction as bottom-up deduction The transformation indicated above can be formulated without detailed assumptions about the grammar formalism applied, it may in principle include any kind of transformations, multiple passes and be based on trees, graphs or something completely different. The input need not necessarily be strings or sequences but might also be a combination of sensor signals or multidimensional structures, e.g., described by means of Constrained Multiset Grammars (Marriott 1994). The vocabulary for a language interpretation problem consists of disjoint sets of constraints referred to as grammar symbols and context predicates. Grammar symbols are separated into token level symbols and phrase level symbols. The basic components in a language interpretation scenario are the following. Discourse: A set of ground token level atoms giving the set of input tokens and their relative order (e.g., sequentially or in the shape of a graph for a visual language) and, if available, extra information such as prosody, colour, etc. Context: A set of ground context atoms describing a part of the world. IC: A set of integrity constraints which must be satisfied by Context, each of the form H → B where H is a conjunction of context atoms and B a conjunction of built-in’s and context atoms; however, the total set of integrity constraints must not be recursive (or should satisfy some weaker criterion that guarantees termination). CHR Grammars 23 Phrases: A set of ground phrase level atoms giving the phrases contained in the Discourse that are grammatically correct and consistent with Context. Grammar: A set of formulas for the form ∀(Constituents ∧ Facts → Phrase), where Constituents and Phrase are nonempty conjunctions of grammar atoms, Facts a conjunction of context atoms. Each rule must be range-restricted in the sense that any variable in Phrase must occur in Constituents or Facts and the grammar must be loop-free defined analogously to definition 1 (for CHRG). Furthermore, each argument in the lefthand side must be a variable that do not occur elsewhere in that lefthand side. We require the following fundamental relation referred to as faithfulness between the components: n Grammar ∧ Discourse ∧ Context → Phrases (3) IC ∪ Context is consistent This means that the Discourse and the Phrases in it are true to the Context and correctly formulated with respect to the Grammar. In case of an ambiguous grammar, we can expect different interpretations for different parses of the string. However, we do not require the grammar to be unambiguous, but assume a criterion of unambiguity of a set of Phrases which is particular to the grammar formalism applied; a criterion for CHRG is given by definition 3 above. Not every pair of unambiguous Phrases and Context is interesting: Definition 5 A pair of unambiguous Phrases and Context is a competent interpretation of given Discourse with respect to given Grammar whenever faithfulness and the following conditions hold: 1. (Minimality of Context) If any element is removed from Context, faithfulness fails to hold. 2. (Maximality of Phrases) If any new element is added to Phrases, unambiguity or faithfulness fails to hold. 3. (Analysis is exhaustive) No new elements can be added to Context which allow an extension of Phrases so that points 1 and 2, and faithfulness are preserved. A language interpretation problem is a problem, given Grammar and Discourse of finding a competent interpretation. The condition of exhaustive interpretation excludes Context = Phrases = ∅ unless the Discourse is completely senseless. Language interpretation is partly deductive and partly abductive: The Context is a premise in (3) and by standard usage, the finding of it is an abductive problem. Identifying phrases is a mainly deductive parsing process, applying grammar rules over and over, however, interacting with abduction in order to have the necessary contextual facts ready. 24 H. Christiansen The translation of a grammar G into an version that can be executed in a purely deductive way is defined by a transformation T (G) in which each rule ∀(C ∧ F → P ) (4) is replaced by the rule ∀(C → ∃z̄ (F ∧ P )) (5) where z̄ are the variables in F that do not occur in C . The fact that T (G) may not be range-restricted indicates some technical problems that we have to deal with, but it should be emphasized that T (G) being non-range-restricted does not necessarily indicate that G is too weakly specified: Although a variable in F does not receive a value by the matching of C , it may receive a value later from an integrity constraint — or it may remain unbound in case the discourse does not provide enough information. The presence of such variables indicates that we cannot expect derivations to produce ground Context and Phrases, and an arbitrary grounding (instantiation of variables) in such cases will produce a more specific solution than there is evidence for — even if it is minimal wrt. set-inclusion. This discussion should clarify the following correctness theorems. Theorem 1 (Completeness) Let Grammar, T (Grammar) and ground Discourse be given as above. If there exist ground Context and Phrases so that faithfulness (3) holds with Context minimal wrt. this property, then there exist Context ′ and Phrases ′ so that T (Grammar) ∧ Discourse ∧ IC → ∃(Context ′ ∧ Phrases ′ ) (6) where hContext, Phrasesi is an instance of hContext ′ , Phrases ′ i. Theorem 2 (Soundness) Let Grammar, T (Grammar) and ground Discourse be given as above. If there exist Context ′ and Phrases ′ so that T (Grammar) ∧ Discourse ∧ IC → ∃(Context ′ ∧ Phrases ′ ), (7) then there exists a ground instance hContext, Phrasesi of hContext ′ , Phrases ′ i so that IC ∪ Context ′ is consistent and Grammar ∧ Discourse ∧ Context ′ → Phrases ′ (8) Proof of theorem 1 Let Grammar, T (Grammar), ground Discourse, Context and Phrases be as in the theorem so that (3) holds. Define G to be the set of all ground instances of rules in Grammar, and let G0 = {c → p | (c ∧ f → p) ∈ G and f ∈ Context} G T = {c → f ∧ p | (c ∧ f → p) ∈ G and f ∈ Context} We have from (3) that G ∧ Discourse ∧ Context → Phrases CHR Grammars 25 and from this that G0 ∧ Discourse → Phrases. I.e., we have eliminated Context by using a specialized grammar. The rules of G T differs from those of G0 by introducing on the righthand side an element of Context. Referring to minimality of Context, we have that G T ∧ Discourse → Context ∧ Phrases. Consider now a “proof” of Context ∧ Phrases applying a finite sequence of rules ci → fi ∧ pi , i = 1, . . . , n to generate the following sets: C0 = Discourse, F0 = ∅ Ci = Ci−1 ∪ pi , ci ⊆ Ci−1 Fi = Fi−1 ∪ fi Cn = Phrases, Fn = Context From this, we construct another parallel proof in which the rules applied are instances of clauses of T (Grammar), (ci′ → fi′ ∧ pi′ )σi where σi is a substitution to the variables of ci′ so that C0′ = Discourse, ′ Ci′ = Ci−1 ∪ pi′ σi , F0′ = ∅ ′ ci′ σi ⊆ Ci−1 ′ Fi′ = Fi−1 ∪ fi′ σi Cn′ = Phrases ′ , Fn′ = Context ′ By induction over i, it is straightforward to prove that T (Grammar) ∧ Discourse → ∃(Context ′ ∧ Phrases ′ ) and that hContext, Phrasesi is an instance of hContext ′ , Phrases ′ i. From this, (6) follows immediately. Example 10 The restriction that each argument in the head of a grammar rule must a variable that do not occur elsewhere in that head is necessary as indicated by the following example. Let a/0, b/1, and c/1 be grammar symbols, f /1 a context predicate and let Grammar consist of (i) ∀x (a ∧ f (x ) → b(x )), (ii) b(7) → c(7). Then T (Grammar) consists of (ii) and (i′ ) ∀x (a → f (x ) ∧ b(x )). Given Discourse = {a} and Context = {f (7)} we have that Phrases = {a, b(7), c(7)} satisfies the faithfulness condition 3. However, a proof using T (Grammar) will only give Phrases ′ = {a, ∃x b(x )}, and it not sound to set this x = 7 so that rule (ii) can be applied. If the head of (ii) had an unrestricted variable instead of a constant, it would be possible to relate it to the existentially quantified ∃x b(x ). 26 H. Christiansen Proof of theorem 2 Similarly to the proof of theorem 1. 5.2 First version of abduction in CHRG: Locally unambigous grammars The general model developed in section 5.1 fits perfectly with locally unambigous CHRGs. For simplicity, we formulate the approach for propagation rule grammars without left and right context parts, but it is obvious that it works also in the general case; especially interesting are CHRGs of simplification rules only that are guaranteed to be locally unambigous. (Section 5.3 below describes a generalization to ambiguous grammars.) Let us define an abductive CHRG as a grammar with range-restricted rules of the form constituents,{context-facts} ::> nonterminal in which (cf. section 5.1) each argument in constituents and context-facts is a unique variable. The grammar may be extended with a set of integrity constraints expressed as CHR propagation rules. Combining theorems 1 and 2 with the completeness and soundness properties for parsing derivations, shows that a locally unambiguous, abductive grammar, written in the format constituents ::> {context-facts},nonterminal produces competent interpretations of the given input string. The implemented CHRG system does not include this translation but assumes the user to write abductive grammars directly in the “translated form” which is anyhow the intuitively simplest for someone with experience in CHR programming.6 Example 11 We consider language interpretation of discourses such as the following. Garfield eats Mickey, Tom eats Jerry, Jerry is mouse, Tom is cat, Mickey is mouse. (9) What we intend to learn from (9) are the categories to which the mentioned proper names belong and which categories that are food items for others. An interesting question is to which category Garfield belongs as this is not mentioned explicitly. We define the following vocabulary; the abducibles declaration is synonymous with CHR’s constraints except that it also introduces predicates for negated abducibles with integrity constraints that implement explicit negation.7 6 7 The user may, so to speak, use abduction for text interpretation in this deductive fashion without being aware that he or she is using a “nonstandard” reasoning technique; abduction works so to speak for free in CHRG. The declaration of an abducible a/1 introduces also constraint a /1 (representing “not a”) and integrity constraint a(X), a (X) ==> fail. CHR Grammars 27 abducibles food_for/2, categ_of/2. grammar_symbols name/1, verb/1, sentence/1, category/1. The background theory is the following consisting of integrity constraints only. categ_of(N,C1), categ_of(N,C2) ==> C1=C2. food_for(C1,C), food_for(C2,C) ==> C1=C2. I.e., the category for a name is unique, and for the sake of this example it is assumed that a given category is the food item for at most one other category. The following part of the grammar classifies the different tokens. [tom] ::> name(tom). ... [is] ::> verb(is). ... verb(is) -\ [X] <:> category(X). The last rule applies a syntactic left context part in order to classify any symbol to the right of an occurrence of “is” as a category. A sentence such as “Tom is cat” is only faithful to a context if categ of(tom, cat) holds in it. So the grammar in the original specification of the current language interpretation problem may contain the following rule. name(i1 , i2 , N) ∧ verb(i2 , i3 , is) ∧ category(i3 , i4 , C) ∧ categ-of(N,C) → sentence(is(N,C)) (10) By moving the context condition from the premises to the conclusion we achieve a rule that can contribute to solve the problem deductively. In CHRG it becomes the following: name(N), verb(is), category(C) ::> {categ_of(N,C)}, sentence(is(N,C)). A sentence such as “Tom eats Jerry” is only faithful to a context if the proper categ of and food for facts hold in it. A CHRG rule with this in its conclusion looks as follows. name(N1), verb(eats), name(N2) ::> {categ_of(N1,C1), categ_of(N2,C2), food_for(C1,C2)}, sentence(eats(N1,N2)). Let us now trace the processing of the discourse (9) when entered into the constraint store; we record only the context facts. “Garfield eats Mickey” gives rise to categ_of(garfield,X1), categ_of(mickey,X2), food_for(X1,X2). The “X”s are uninstantiated variables. The next “Tom eats Jerry” gives categ_of(tom,X3), categ_of(jerry,X4), food_for(X3,X4). 28 H. Christiansen “Jerry is mouse” gives categ_of(jerry,mouse), and the background theory immediately unifies X4 with mouse. In a similar way “Tom is cat” gives rise to a unification of X3 with cat and food_for(X3,X4) has become food_for(cat,mouse). Finally “Mickey is mouse” produces categ_of(mickey,mouse) that triggers the first integrity constraint unifying X2 with mouse and thus the second integrity constraint sets X1=cat and there is no other possibility. So as part of the solution to this language interpretation problem, we have found that Garfield is a cat. In addition to what we have shown, the user may also define background theories involving Prolog rules that include calls to abducibles. The only restriction is that a call to an abducible must not be embedded in an application of Prolog’s negation by failure. Interestingly, this form of abduction works also together with a definite clause grammar: Declare your abducibles as CHRG abducibles (or CHR constraints), add integrity constraints and apply them in the body of your DCG rules. Example 12 The following DCG together with the declarations of abducibles and integrity constraints written as CHR rules will produce the same abducibles as the CHRG described above. name(tom) --> [tom]. % etc. category(mouse) --> [mouse]. % etc. sentence(is(N,C)) --> name(N), [is], category(C), {categ_of(N,C)}. sentence(eats(N1,N2)) --> name(N1), [eats], name(N2), {categ_of(N1,C1), categ_of(N2,C2), food_for(C1,C2)}. The DCG+CHR approach to abductive language interpretation works also correctly for ambiguous grammars as backtracking keeps separated the different possible parses with their abducibles. Compacting abductive answers The final state may include abducible atoms with variables with the meaning that any ground assignment to such variables (not conflicting with integrity constraints) represents a solution to the abductive problem. Consider as an example the following set of abducible atoms returned as part of the answer {abd(X), abd(Y)}. It may subsume solutions with X=Y as well as X6=Y, e.g., {abd(a)}, {abd(b), abd(c)}; both may be minimal but the application may impose reasons to prefer the one with fewest elements. CHR Grammars 29 It is possible to extend our method so that it dynamically tries to compact solutions by equating new abducibles to existing ones as a first choice, and then generate the other possibilities under backtracking. In fact, such a step is included in many abduction algorithms, e.g., (Kakas et al. 2000). To provide this, we may add for each abducible predicate, an integrity constraint here shown for a predicate abd of arity one. abd(X), abd(Y) ==> (X=Y ; dif(X,Y)) (11) The semicolon is Prolog’s disjunction realized by means of backtracking and dif/2 is a lazy test for syntactic nonidentity that behaves the way we specified for built-in “6=” constraints in section 3.1. Whenever a new abducible fact, say h(a) or h(X), is created by the application of some rule, (11) is applied provided there is another fact p(t ) in the constraint store. Notice that (11) is logically redundant and only affects the execution. An optimization of (11) using facilities of the implemented version of CHR (see (Swedish Institute of Computer Science 2003) for details) is in place: h(X), h(Y)#Id ==> (\+X==Y, unifiable(X,Y)) | (X=Y ; dif(X,Y)) pragma passive(Id) (12) The pragma prevents the rule from being activated twice due to the symmetry in its head and the purpose of the guard is to suppress useless applications. The implemented CHRG system (Christiansen 2002b) includes this compaction principle as an option. However, in many cases the problem does not exist as userdefined integrity constraints may instantiate and equate abducibles sufficiently during the computation; this is the case in the example with Garfield and friends above. 5.3 Evaluation of all abductive answers in parallel The implemented CHRG system incorporates a technique for keeping track of the different unambiguous sets of grammar symbols that are created with a locally ambiguous grammar. Each syntax tree and the abducibles associated with it are identified by an index, actually a Prolog variable, hence referred to in the following as an index variable. Grammar symbols (apart from token/1) and abducibles are given an extra argument to hold the index. Whenever a rule applies to syntax nodes with indices x1 ,. . .,xn , a new index x is created for the new node. Fresh copies are made of any abducible with an index among x1 ,. . .,xn , but now with x as index. These constraints are called together with any new abducibles from the body of the rule (also indexed by x ). This activates possible integrity constraints (translated in a suitable way to cope with indexes; see below). This may result in a failure and to avoid the whole computation to stop (as does a failure in a committed choice language such as CHR), a suitable control structure is embedded in the body of the rule. If such a failure occurs, the rule simply succeeds but avoids the creation of a new syntax node (and cleanses the constraint store for the newly constructed constraints); this effectively stops this branch of computation but allows other successful syntax trees to continue growing. 30 H. Christiansen The compilation of integrity constraints ensures that they only apply to abducibles with identical indices. The compilation of the sample father(F1,C) \ father(F2,C) <=> F1=F2 shows the principle: father(X,F1,C) \ father(X,F2,C) <=> F1=F2 (13) The final state in a derivation contains the collection of all constraints relating to the different parses; each parse, i.e., each competent interpretation can be printed out separately. This implementation principle involves a quite heavy overhead due to the continual copying of constraints and repeated execution of integrity constraints that have been executed already. It is available as an option in the CHRG system. Obviously this is not an ultimate method for evaluation of all different abductive interpretations in parallel, but it may give inspiration for more efficient methods; we discuss this topic in the final section. 6 Assumption grammars in CHRG As our implementation of abduction has shown, CHRG can work with different sort of hypotheses passed through the constraint store. Assumption Grammars (Dahl et al. 1997) (AGs) are similar to abductive grammars in many respect but differ in that hypotheses are explicitly produced and explicitly used, possible being consumed. Assumption grammars provide a collection of operators that makes it possible to control the scope of these hypotheses which is not possible with an abductive approach. We describe here an extension of CHRGs with a version of AG which is included in the available implementation of the system (Christiansen 2002b). For simplicity, we describe it in a version that is only correct for locally unambiguous grammars but it is easily extended to ambiguous grammars with the technique described for abductive grammars in section 5.3. In an AG, the expression +h(a) means to assert a linear hypothesis which can be used once in the subsequent text by means of the expression -h(a) (or -h(X), binding X to a) called an expectation. Asserting the hypothesis by *h(a) means that it can be used over and over again. We deviate slightly from the syntax of (Dahl et al. 1997) as to achieve a more symmetric notation and introduce three operators for so-called time-less hypotheses, =+, =-, and =*, whose meaning are similar except that hypothesis can be used and consumed in any order. Compared with the initial proposal for AG, our version extends also with other features of CHRG, most notably integrity constraints and context parts. These operators are defined as constraints in CHR and can be called from the body of grammar rules. We introduce the principle by a simplified and incorrect version of the time-less versions given by the following CHR rules. =+A, =-B <=> A=B. =*A \ =-B <=> A=B. CHR Grammars 31 By the first rule, a pair of assumption =+h(a) and expectation =-h(X) are removed from the constraint store producing the effect of binding X to a. If assumption =*h(a) were used instead, the second rule can apply to several instances of =-h(· · ·). The problems with this implementation are: • The computation fails in case one of the rules is applied for incompatible hypotheses, e.g., =+h(a) and =-g(X). • If two different hypotheses can apply for the same expectation =-h(X) things go wrong: Rule one will only apply one of them and forget all about the other one, and rule two applies both of them leading obviously to failure. To repair this, we introduce backtracking and give back hypotheses to the store when a choice of an expectation-hypothesis pair is given up; the latter is necessary as CHR uses committed choice. In order to avoid loops, some book-keeping is added so that a choice already tested is not tried again. For =+ the following is sufficient; the rule for =* is quite similar. =+A, =-B <=> (\+ has_tried_rule1(A,B), unifiable(A,B)) | (A=B ; tried_rule1(A,B), =+A, =-B). (14) The predicate has_tried_rule1 uses CHR facilities to check whether the indicated instance of the auxiliary constraint tried_rule1 is present in the store. The test for unifiability in the guard is an obvious optimization which in principle could have been left out. The operators denoted by prefix +, -, and * are implemented in a quite similar way, with the CHRG compiler adding an extra argument corresponding to positions in the input string; a test that assumption is created textually before expectation is easily added to the guard. Example 13 (Adapted from (Dahl et al. 1997)) We consider sentences with pronouns and coordination such as “Martha likes and Mary likes Paul, she hates her”. We add gender to names and pronouns, and whenever a name appears as subject or object (in this grammar grouped as nps), an assumption is made that the given name is acting. A pronoun as subject or object gives rise to an expectation for someone acting of appropriate gender. The principles is shown by the following excerpt. [mary] <:> name(mary, fem). [she] <:> pronoun(fem). name(X,Gender) <:> *acting(X,Gender), np(X,Gender). pronoun(Gender) <:> -acting(X,Gender), np(X,Gender). To handle the coordination problem, an incomplete sentence followed by and raises a time-less expectation for a subject which is met by the assumption produced by the full sentence at the end. np(A,_), verb(V) /- [and] <:> =-ref_object(B), sentence(s(A,V,B)). np(A,_), verb(V), np(B,_) <:> =*ref_object(B), sentence(s(A,V,B)). 32 H. Christiansen One of the possible final states produced for the sample text above contains sentence symbols with the following attributes: s(martha,like,paul), s(mary,like,paul), and s(mary,hate,martha). The AG operators are included in the available CHRG package (Christiansen 2002b) together with other facilities of AGs described in (Dahl et al. 1997). As mentioned, the CHRG version of AG goes beyond the original proposal by adding integrity constraints. To see the use of this, consider again example 13. Another final state for the given sentence gives s(mary,hate,mary). We can exclude this by an integrity constraint to prevent that people hate themselves: sentence(s(A,hate,A)) ::> fail. In general we can have such rules produce new hypotheses, e.g., =*depressed(A) instead of failing in the rule above, and combinations of hypotheses can give rise other hypotheses. 7 Summary and future perspectives CHR Grammars founded on current constraint logic technology have been introduced, and their application to aspects of natural language syntax has been illustrated by small examples. CHRG can bee seen as a technologically updated ancestor of Definite Clause Grammars: A relative transparent layer of syntactic sugar over a declarative programming language, providing both conceivable semantics and fairly efficient implementation. In CHRG we have replaced Prolog by Constraint Handling Rules. The result of this shift is a very powerful formalism in which several linguistic aspects, usually considered to be complicated or difficult, are included more or less for free: • Ambiguity and grammatical errors are handled in a straightforward way as all different (partial) parses are evaluated in parallel. • Context-sensitive rules, which are an inherent part of the paradigm, handle examples of coordination in an immediate way. • Abduction, which is useful for identifying indirectly implied information, is expressed directly with no additional computational devices being involved. Context-sensitive rules combined with the ability to handle left-recursion (as opposed to DCG) are a great help for producing grammars with relatively few, concise rules without artificial nonterminals; a drawback is the lack of empty production. No real-world applications have been developed in CHRG yet, but we have good expectation for scalability as selected grammars can run in linear time. Furthermore, the full flexibility of the underlying CHR and Prolog machinery is available for optimizations. Independently, CHRG is available as powerful modeling and prototyping tool. The approach of using Constraint Handling Rules for language possesses a potentiality for getting closer to a full integration of lexical, semantic, and pragmatic analysis. A lexical schism S , for example, in the beginning of a discourse may be CHR Grammars 33 delayed until a few sentences later when the semantic context is identified so that S can be resolved and, thus, that analysis can resume for the first sentence. Although being a very powerful system in itself, CHRG and the examples we have tested appear only to touch upon the surface of what is possible. It is obvious that weights can be added and used to suppress all but the most likely interpretation, and arbitrary constraint solvers can be incorporated in this process. Although presented here as a strict bottom-up paradigm, it is possible to add top-down guidance to parsing in CHR and CHRG which is useful in order to prevent local ambiguity to result in the creation of a lot of useless constraints; top-down guidance is applied in the work of (Christiansen and Dahl 2002; Christiansen and Dahl 2003) but for other purposes. The basic principle may seem quite naı̈ve, almost too naı̈ve, just applying grammar rules bottom-up over and over until the process stops. However, we can rely now on the underlying, well-established computational paradigm of CHR for such rules-based computations. Furthermore, the approach can profit from any future improvements of CHR and similar deductive systems. As noticed above, our implementation in CHR for parallel evaluation of different abductive interpretations of a discourse is far from ideal, but it may serve as an important source of inspiration for the development of better systems. Instead of simulating several constraint stores by means of extra index arguments, it seems obvious to apply a sort of shared representation for the different stores so that copying of constraints is avoided. Acknowledgements Part of this work has been carried out while the author visited Simon Fraser University, Canada, partly supported by the Danish Natural Science Council; thanks to Verónica Dahl for helpful discussion and providing a stimulating environment. This research is supported in part by the OntoQuery funded by the Danish Research Councils, and the IT-University of Copenhagen. References Abdennadher, S. and Christiansen, H. 2000. An experimental clp platform for integrity constraints and abduction. In Proceedings of FQAS2000, Flexible Query Answering Systems: Advances in Soft Computing series. Physica-Verlag (Springer), 141–152. Abdennadher, S. and Schütz, H. 1998. CHR∨ : A flexible query language. In Proc. Int. Conference on Flexible Query Answering Systems FQAS, Roskilde, Denmark, T. Andreasen, H. Christansen, and H. L. Larsen, Eds. LNCS, vol. 1495. Springer-Verlag, 1–15. Aho, A., Sethi, R., and Ullman, J. 1986. Compilers. Principles, techniques, and tools. Addison-Wesley. Allen, J. 1995. Natural language understanding, 2nd ed. Benjamin Cummings. Blache, P. 2000. Constraints, linguistic theories and natural language processing. In Lecture Notes in Computer Science 1835. Springer, 221–232. Bottoni, P., Meyer, B., Marriott, K., and Presicce, F. P. 2001. Deductive parsing of visual languages. Lecture Notes in Computer Science 2099, 79–94. 34 H. Christiansen Brill, E. 1995. Transformation-based error-driven learning and natural language processing: A case study in part-of-speech tagging. Computational Linguistics 21(4), 543–565. Charniak, E. and McDermott, D. 1985. Introduction to Artificial Intelligence. Addison-Wesley Publishing Company. Christiansen, H. 1993. Why should grammars not adapt themselves to context and discourse? In 4th International Pragmatics Conference, Kobe, Japan, July 23–30 1993, (Abstract collection). International Pragmatics Association, 23. Extended version: http://www.dat.ruc.dk/˜henning/IPRA93.ps. Christiansen, H. 1999. Open theories and abduction for context and accommodation. In Proceedings of the 2nd International and Interdisciplinary Conference on Modeling and Using Context (CONTEXT-99), P. Bouquet, L. Serafini, P. Brézillon, M. Benerecetti, and F. Castellani, Eds. LNAI, vol. 1688. Springer, Berlin, 455–458. Christiansen, H. 2001. CHR as grammar formalism, a first report. Annual Workshop of the ERCIM Working group on Constraints. Available at CoRR: http://arXiv.org/abs/cs.PL/0106059. Christiansen, H. 2002a. Abductive language interpretation as bottom-up deduction. In Natural Language Understanding and Logic Programming, S. Wintner, Ed. Datalogiske Skrifter, vol. 92. Roskilde, Denmark, 33–47. Christiansen, H. 2002b. CHR Grammar web site; released 2002. http://www.ruc.dk/˜henning/chrg. Christiansen, H. 2002c. Logical grammars based on constraint handling rules. In Logic Programming, P. J. Stuckey, Ed. Lecture Notes in Computer Science, vol. 2401. Springer-Verlag, 481. Christiansen, H. 2003. A constraint-based bottom-up counterpart to DCG. In Proceedings of RANLP 2003, Recent Advances in Natural Language Processing, Bovorovets, Bulgaria, 10–12 September 2003, G. Angelova, K. Bontcheva, R. Mitkov, N. Nicolov, and N. Nikolov, Eds. INCOMA Ltd., 105–111. Christiansen, H. and Dahl, V. 2002. Logic grammars for diagnosis and repair. In ICTAI’02, proc. of 14th IEEE International Conference on Tools with Artificial Intelligence, November 4-6, 2002 Washington D.C. IEEE, 307–314. Christiansen, H. and Dahl, V. 2003. Logic grammars for diagnosis and repair. International Journal on Artificial Intelligence Tools 12, 3, 227–248. Christiansen, H. and Dahl, V. 2004. Assumptions and abduction in Prolog. In 3rd International Workshop on Multiparadigm Constraint Programming Languages, MultiCPL’04; At the 20th International Conference on Logic Programming, ICLP’04 SaintMalo, France, 6-10 September, 2004, E. Albert, M. Hanus, P. Hofstedt, and P. Van Roy, Eds. To appear. Colmerauer, A. 1975. Les grammaires de metamorphose. Tech. rep., Groupe d’Intelligence Artificielle, Université de Marseille-Luminy. Nov. Translated into English as (1978). Colmerauer, A. 1978. Metamorphosis grammars. In Natural Language Communication with Computers, L. Bolc, Ed. Lecture Notes in Computer Science, vol. 63. SpringerVerlag, Berlin, 133–189. English translation of (1975). Constraint Handling Rules Online 2002. Constraint handling rules online. http://www.pms.informatik.uni-muenchen.de/˜webchr. Dahl, V. 1984. More on gapping grammars. In Proceedings of the International Conference on Fifth Generation Computer Systems. ICOT, Tokyo, 669–677. Dahl, V., Tarau, P., and Li, R. 1994. Datalog Grammars. Proc. GULP-PRODE’94. Dahl, V., Tarau, P., and Li, R. 1997. Assumption grammars for processing natural language. In Proceedings of the 14th International Conference on Logic Programming, L. Naish, Ed. MIT Press, Cambridge, 256–270. CHR Grammars 35 Duchier, D. 2000. Constraint Programming For Natural Language Processing. Lecture Notes, ESSLLI 2000. Duchier, D. and Thater, S. 1999. Parsing with tree descriptions: A constraint-based approach. In 6th International Workshop on Natural Language Understanding and Logic Programming (NLULP ’99), December 3-4. Las Cruces, New Mexico, USA, 17–32. Frühwirth, T. 1998a. A declarative language for constraint systems - Theory and Practice of Constraint Handling Rules. Habilitation, Computer Science Institute, LMU Munich. Frühwirth, T. 1998b. Theory and practice of constraint handling rules, special issue on constraint logic programming. Journal of Logic Programming 37, 1–3 (Oct.), 95–138. Gabbay, D., Kempson, R., and Pitt, J. 1997. Labeled abduction and relevance reasoning. In Nonstandard Queries and Nonstandard Answers, R. Demolombe and T. Imielinski, Eds. Oxford Science Publications, , 155–185. Ganzinger, H. and McAllester, D. 2001. A new meta-complexity theorem for bottomup logic programs. Lecture Notes in Computer Science 2083, 514–528. Ganzinger, H. and McAllester, D. 2002. Logical algorithms. In Logic Programming, P. J. Stuckey, Ed. Lecture Notes in Computer Science, vol. 2401. Springer-Verlag, 209– 223. Gazdar, G. and Mellish, C. 1989. Natural Language Processing in Prolog: An Introduction to Computational Linguistics. Addison-Wesley Publishing Co., Reading, Massachusetts. Hecksher, T., Nielsen, S. T. B., and Pigeon, A. 2002. A CHRG model of the ancient Egyptian grammar. Unpublished student project report, Roskilde University, Denmark. Hobbs, J. R., Stickel, M. E., Appelt, D. E., and Martin, P. 1993. Interpretation as abduction. Artificial Intelligence 63, 1–2 (Oct.), 69–142. Holzbaur, C. and Frühwirth, T. 1999. Compiling constraint handling rules into prolog with attributed variables. In Principles and Practice of Declarative Programming, International Conference PPDP’99, Paris, France, September 29 - October 1, 1999, Proceedings, G. Nadathur, Ed. Lecture Notes in Computer Science, vol. 1702. SpringerVerlag, 117–133. Kakas, A. C., Michael, A., and Mourlas, C. 2000. ACLP: Flexible solutions to complex problems. Journal of Logic Programming 44 (1–3), 129–177. Marriott, K. 1994. Constraint multiset grammars. In Proceedings of the Symposium on Visual Languages, A. L. Ambler and T. D. Kimura, Eds. IEEE Computer Society Press, Los Alamitos, CA, USA, 118–127. Maruyama, H. 1994. Structural disambiguation with constraint propagation. In Proceedings of the 28th Annual Meeting of the ACL. Pittsburgh, 31–38. McAllester, D. A. 2000. Meta-complexity theorems: Talk abstract. In Principles and Practice of Constraint Programming - CP 2000, 6th International Conference, Singapore, September 18-21, 2000, Proceedings, R. Dechter, Ed. Lecture Notes in Computer Science, vol. 1894. Springer, 13–17. Meyer, B. 2000. A constraint-based framework for diagrammatical reasoning. Journal of Applied Artificial Intelligence 14, 327–244. Morawietz, F. 2000. Chart parsing as contraint propagation. Proceedings of COLING2000. Penn, G. 2000. Applying Constraint Handling Rules to HPSG. Workshop on Rule-Based Constraint Reasoning and Programming. Available at http://www.cs.cmu.edu/˜gpenn/trale.ps.gz. Pereira, F. C. N. and Warren, D. H. D. 1980. Definite clause grammars for language analysis—A survey of the formalism and a comparison with augmented transition networks. Artificial Intelligence 13, 3, 231–278. 36 H. Christiansen Schröder, I., Menzel, W., Foth, K., and Schulz, M. 2000. Dependency modelling with restricted constraints. International Journal Traitement Automatique des Langues: Les grammaires de dépendance 41(1), 113–144. Shieber, S. M., Schabes, Y., and Pereira, F. C. N. 1995. Principles and implementation of deductive parsing. Journal of Logic Programming 24, 1–2, 3–36. Stalnaker, R. 1998. On the representation of context. Journal of Logic, Language, and Information 7, 3–19. Swedish Institute of Computer Science. 2003. SICStus Prolog user’s manual, Version 3.10. Most recent version available at http://www.sics.se/isl
6cs.PL
Efficient Gradual Typing Andre Kuhlenschmidt Deyaaeldeen Almahallawi Jeremy G. Siek Indiana University [email protected] Indiana University [email protected] Indiana University [email protected] arXiv:1802.06375v1 [cs.PL] 18 Feb 2018 Abstract To date, implementations of gradual typing have only delivered two of these three properties. For example, Typed Racket [48] provides soundness and interoperability but suffers from slowdowns of up to 100× [45, 46] on a partially typed program. Thorn [10, 50] and Safe TypeScript [34] provide better performance but limit interoperability. TypeScript [9, 27] and Gradualtalk [2–4] do not provide soundness and their performance is on par with dynamic languages but not static ones, but they provide seamless interoperability. Several papers at OOPSLA 2017 begin to address the efficiency concerns for gradually typed languages that are committed to soundness and interoperability. Bauman et al. [7] demonstrate that a tracing JIT can eliminate 90% of the overheads in Typed Racket due to gradual typing. Richards et al. [35] augment the Higgs JIT compiler and virtual machine (VM) [13] for JavaScript, re-purposing the VM’s notion of shape to implement monotonic references [42]. Richards et al. [35] reports that this reduces the worst slowdowns to 45%, with an average slowdown of just 7%. Meanwhile, Muehlboeck and Tate [33] show that for nominally-typed object-oriented languages, efficiency is less of a problem. In this paper we demonstrate that efficient gradual typing can be achieved in structurally-typed languages by relatively straightforward means. We build and evaluate an ahead-oftime compiler that uses carefully chosen runtime representations and implements two important ideas from the theory of gradual typing. It uses space efficient coercions [20, 30, 40, 43] to implement casts and it reduces overhead in statically typed code by using monotonic references [42]. Gradual typing combines static and dynamic typing in the same program. One would hope that the performance in a gradually typed language would range between that of a dynamically typed language and a statically typed language. Existing implementations of gradually typed languages have not achieved this goal due to overheads associated with runtime casts. Takikawa et al. (2016) report up to 100× slowdowns for partially typed programs. In this paper we present a compiler, named Grift, for evaluating implementation techniques for gradual typing. We take a straightforward but surprisingly unexplored implementation approach for gradual typing, that is, ahead-of-time compilation to native assembly code with carefully chosen runtime representations and space-efficient coercions. Our experiments show that this approach achieves performance on par with OCaml on statically typed programs and performance between that of Gambit and Racket on untyped programs. On partially typed code, the geometric mean ranges from 0.42× to 2.36× that of (untyped) Racket across the benchmarks. We implement casts using the coercions of Siek, Thiemann, and Wadler (2015). This technique eliminates all catastrophic slowdowns without introducing significant overhead. Across the benchmarks, coercions range from 15% slower (fft) to almost 2× faster (matmult) than regular casts. We also implement the monotonic references of Siek et al. (2015). Monotonic references eliminate all overhead in statically typed code, and for partially typed code, they are faster than proxied references, sometimes up to 1.48×. Contributions This paper makes these contributions. 1 Introduction • A space-efficient semantics for monotonic references and lazy-D coercions (Section 3). • The first ahead-of-time compiler, named Grift, for a gradually typed language that targets native assembly code. The compiler is the first to implement spaceefficient coercions (Section 4). • Experiments (Section 5.2) showing – performance on statically typed code that is on par with OCaml, – performance on dynamically typed code that is between Gambit and Racket, and – performance on partially typed code ranging from 0.42× to 2.36× that of Racket. • Experiments showing that coercions eliminate catastrophic slowdowns without adding significant overhead (Section 5.3). Gradual typing combines static and dynamic type checking in the same program, giving the programmer control over which typing discipline is used for each region of code [5, 24, 32, 39, 47]. We would like gradually typed languages to be efficient, sound, and provide interoperability. Regarding efficiency, we would like the performance of gradual typing to range from being similar to that of a dynamically typed language to that of a statically typed language. Regarding soundness, programmers (and compilers) would like to trust type annotations and know that runtime values respect their compile-time types. Third, regarding interoperability, static and dynamic regions of code should interoperate seamlessly. PL’17, January 01–03, 2017, New York, NY, USA 2017. https://doi.org/0000001.0000001 1 PL’17, January 01–03, 2017, New York, NY, USA Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek • Experiments showing that monotonic references eliminate overhead in statically typed code (Section 5.4). Parameter m of modinv has type Dyn, but b of egcd has type Int, so there is an implicit cast from Dyn to Int. With gradual typing, this implicit cast comes with a runtime cast that will trigger an error if the input to this program is a string. This runtime cast is required to ensure soundness: without it a string could flow into egcd and masquerade as an Int. Soundness is not only important for software engineering reasons but it also impacts efficiency both positively and negatively. Ensuring soundness in the presence of first-class functions and mutable references is nontrivial. When a function is cast from Dyn to a type such as Int → Int, it is not possible for the cast to know whether the function will return an integer on all inputs. Instead, the standard approach is to wrap the function in a proxy that checks the return value each time the function is called [18]. Similarly, when a mutable reference is cast, e.g., from Ref Int to Ref Dyn, the reference is wrapped in a proxy that casts from Int to Dyn on every read and from Dyn to Int on every write [29, 30]. Section 2 provides background on gradual typing, focusing on runtime casts and the tension between efficiency, soundness, and interoperability. 2 Tensions in Gradual Typing From a language design perspective, gradual typing touches both the type system and the operational semantics. The key to the type system is the consistency relation on types, which enables implicit casts to and from the unknown type, here written Dyn, while still catching static type errors [5, 24, 39]. The dynamic semantics for gradual typing is based on the semantics of contracts [18, 21], coercions [28], and interlanguage migration [32, 47]. Because of the shared mechanisms with these other lines of research, much of the ongoing research in those areas benefits the theory of gradual typing, and vice versa [14–16, 22, 23, 25, 31, 44]. In the following we give a brief introduction to gradual typing by way of an example that emphasizes the three main goals of gradual typing: supporting interoperability, soundness, and efficiency. Efficiency Ideally, statically typed code within a gradually typed program should execute without overhead. Likewise, partially typed or untyped code should execute with no more overhead than is typical of dynamically typed languages. Consider the egcd on the right side of Figure 1. Inside this egcd, the expression (modulo b a) should simply compile to an idiv instruction (on x86). However, if the language did not ensure soundness as discussed above, then this efficient compilation strategy would result in undefined behavior (segmentation faults at best, hacked systems at worst). It is soundness that enables type-based specialization. However, soundness comes at the cost of the runtime casts at the boundaries of static and dynamic code. Interoperability and Evolution Consider the example program in Figure 1, written in a variant of Typed Racket that we have extended to support fine-grained gradual typing. On the left side of the figure we have an untyped function for the extended greatest common divisor. With gradual typing, unannotated parameters are dynamically typed and therefore assigned the type Dyn. On the right side of the figure is the same function at a later point in time in which the parameter types have been specified (Int) but not the return type. With gradual typing, both programs are well typed because implicit casts are allowed to and from Dyn. For example, on the left we have the expression (modulo b a), so b and a are implicitly cast from Dyn to Int. On the right, there is an implicit cast around (list b 0 1) from (List Int) to Dyn. The reason that gradual typing allows implicit casts both to and from Dyn is to enable evolution. As a programmer adds or removes type annotations, the program continues to type check and also exhibits the same behavior up to cast errors, a property called the gradual guarantee [41]. 3 Semantics of a Gradual Language The type system of Grift’s input language is the standard one for the gradually typed lambda calculus [30, 36, 39]. The operational semantics, as usual, is expressed by a translation to an intermediate language with explicit casts. Consider the source program in Figure 2 which calculates the value 42 by applying the add1 function, by way of variable f, to the integer value 41. The type of add1 does not exactly match the type annotation on f (which is Dyn → Dyn) so the compiler inserts the cast: Soundness Next consider the function modinv defined below that computes the modular inverse using the second version of egcd. What happens when the code on the right forgets to convert the input string from (read) to an integer before passing it to modinv? (cast add1 (Int → Int) (Dyn → Dyn) l2) The application of f to 42 requires a cast on 42 from Int to Dyn. Also, the return type of f is Dyn, so the compiler inserts a cast to convert the returned value to Dyn to satisfy the type ascription. In this paper we consider two approaches to the implementation of runtime casts: traditional casts, which we refer to as type-based casts, and coercions. Type-based casts provide the most straightforward implementation, but the proxies they generate can accumulate and consume an unbounded (define (modinv a m) (let ([input (read)]) (let ([r (egcd a m)]) (modinv 42 input)) (if (not (= (car r) 1)) (error ...) (modulo (cadr r) m)))) 2 Efficient Gradual Typing PL’17, January 01–03, 2017, New York, NY, USA (define (egcd a b) (if (= a 0) (list b 0 1) (let ([r (egcd (modulo b a) a)]) (list (car r) (- (caddr r) (* (/ b a) (cadr r))) (cadr r))))) (define (egcd [a:Int] [b:Int]) (if (= a 0) (list b 0 1) (let ([r (egcd (modulo b a) a)]) (list (car r) (- (caddr r) (* (/ b a) (cadr r))) (cadr r))))) Figure 1. Two gradually typed versions of extended GCD. Source Program: (let ([add1 : (Int → Int) (λ ([x : Int]) (+ x 1))]) (let ([f : (Dyn → Dyn) add1]) (: (f 41) Int))) After Cast Insertion: (let ([add1 (λ (x) (+ x 1))]) (let ([f (cast add1 (Int → Int) (Dyn → Dyn) L1)]) (cast (f (cast 41 Int Dyn L2)) Dyn Int L3))) Figure 2. An example of the Grift compiler inserting casts. The L1, L2, etc. are blame labels that identify source code location. amount of space [30]. The coercions of Henglein [28] solve the space problem with a representation that enables the compression of higher-order casts [30]. For type-based casts, the dynamic semantics that we use is almost covered in the literature. We use the lazy-D cast semantics which is described by Siek and Garcia [37]. (They were originally described using coercions by Siek et al. [38].) The distinction between lazy-D and the more commonly used lazy-UD semantics [49] is not well-known, so to summarize the difference: in lazy-D, arbitrary types of values may be directly injected into type Dyn, whereas in lazy-UD, only values of a ground type may be directly injected into Dyn. For example, Int and Dyn → Dyn are ground types, but Int → Int is not. The one missing piece for our purposes are the reduction rules for proxied references, which we adapt from the coercion-based version by Herman et al. [30]. In this setting, proxied references are values of the form (v : Ref pT1 ⇒ℓ Ref pT2 ). The following are the reduction rules for reading and writing to a proxied reference. !(v : Ref pT1 ⇒ℓ Ref pT2 ) −→ !v : T1 ⇒ℓ T2 and to the composition operator. Also, that work did not consider mutable references, so here we add support for both proxied and monotonic references. Regarding monotonic references, Siek et al. [42] define the lazy-D semantics, but again, they did not define a space-efficient semantics. Here we make it space-efficient by defining the normal forms for reference coercions and the composition operation on them. Figure 3 defines a representative subset of the types and coercions used in Grift’s intermediate language. The figure also defines the meet operation and the consistency relation on types and the composition operator on coercions. Instead of defining two different languages, one with proxied references and the other with monotonic references, we instead present a single language with both kinds of references. The type Ref pT is for proxied references and RefmT is for monotonic references. Likewise, Ref p c d is the coercion for proxied references and Refm T is the coercion for monotonic references. Space-efficient coercions are defined by a grammar consisting of three rules that enable coercion composition by the composition operator defined in Figure 3. Let c, d range over space-efficient coercions, i range over final coercions, and д range over middle coercions. Space-efficient coercions are either the identity coercion ι, a projection followed by a final coercion (I ?p ; i), or just a final coercion. A final coercion is either the failure coercion ⊥I p J , a middle coercion followed by an injection (д ; I !), or just an intermediate coercion. An intermediate coercion is either the identity coercion ι, the function coercion c → d, the tuple coercion c ×d, the proxied reference coercion Ref p c d, where c is applied when writing and d is applied when reading, or the monotonic reference coercion Refm T . The main difference between the lazy-D coercions shown here and those of Siek et al. [40] is in the injection I ! and projection J ?p coercions, which take any injectable type (anything but Dyn) instead of only ground (v 1 : Ref pT1 ⇒ℓ Ref pT2 ) := v 2 −→ v 1 := (v 2 : T2 ⇒ℓ T1 ) For monotonic references with type-based casts, the dynamic semantics for lazy-D is given by Siek et al. [42]. Regarding coercions, the dynamic semantics that we used is less well-covered in the literature. Again, we use the lazy-D semantics of Siek et al. [38], but that work, despite using coercions, did not define a space-efficient semantics. On the other hand, Siek et al. [40] give a space-efficient semantics with coercions, but for the lazy-UD semantics. To this end, they define a normal form for coercions and a composition operator that compresses coercions. Here we adapt that approach to lazy-D, which requires some changes to the normal forms 3 PL’17, January 01–03, 2017, New York, NY, USA Types and coercions Base Types Injectables Types Coercions Final Crcns Mid. Crcns Id-free Crcns B I, J T c, d i д f ::= ::= ::= ::= ::= ::= ::= Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek types. This change impacts the coercion composition operation, in the case where an injection I ! meets a projection J ?p Int | Bool | . . . B | T → T | T × T | Ref pT | RefmT we make a new coercions whose source is I and target is J with the coercion creation operation ⟨I ⇒p J ⟩ (Figure 3). Dyn | I The following is the syntax of Grift’s intermediate lanι | (I ?p ; i) | i I p J guage, including both proxied and monotonic references. ⊥ | (д ; I !) | д u ::= k | a | λx .M | (u, u) ι | c → d | c × d | Ref p c d | Refm T p (I ? ; i) | (д ; I !) | c → d | c × d v ::= u | (v, v) | u ⟨д ; I !⟩ | u⟨c → d⟩ | u ⟨Ref p c d⟩ Ref p c d | Refm T | ⊥I p J b ::= blame p | error T ∼T Consistency M, N ::= b | v | x | M N | (M, M) | (fst M) | (snd M) | Dyn ∼ T T ∼ Dyn B∼B T1 ∼ T2 T1 ∼ T2 Ref pT1 ∼ Ref pT2 RefmT1 ∼ RefmT2 M ⟨c⟩ | refP M | !P M | M:=P N | refM M@T | !M M | !M@T | M:=M N | M:=N @T Figure 4 defines the dynamic semantics. The language forms refP M, !P M, and M:=P N are for allocating, dereferencing, and updating a proxied pointer, respectively. The language form refM M@T is for allocating a monotonic reference. The form !M M is for dereferencing a monotonic reference with a fully static type whereas !M@T dereferences a monotonic reference that is partially or fully dynamic. Similarly, M:=M N is for updating a monotonic reference with a fully static type and M:=N @T is for updating a partially or fullydynamic monotonic reference. Regarding the definition of values, the value form u ⟨Ref p c d⟩ represents a proxied reference whereas an address a is a regular reference. The dynamic semantics is given by three reduction relations: cast reductions, program reductions, and state reductions. This organization streamlines the treatment of monotonic references. The heap µ maps an address to a value (for proxied references) or to a value and a type (for monotonic references). We refer to this type as the run-time type information (RTTI) of the value and write µ(a)val to access the value and µ(a)rtti to access the RTTI. The cast reduction rules define the semantics of applying a cast to a value. Space efficiency is achieved with the reduction that takes a coerced value u ⟨i⟩ and a coercion c and compresses the two coercions to produce the coerced value u ⟨i # c⟩. There need not be any cast reduction rules for proxied references, as a cast applied to a reference is a value, similar to the function case. In contrast, when a coercion is applied to a monotonic reference, we cast the underlying value on the heap. This cast is only allowed to make the RTTI more precise. Any attempt to cast to an inconsistent type triggers a runtime error. Also, casting the underlying value causes the heap to become an “evolving heap” which propagates the cast via subsequent state transitions. Regarding the program reduction rules, we have a different set of reductions for operations on proxied versus monotonic references. For dereferencing a proxied reference, there are two rules, one for raw addresses and the other for a proxy. Thus, an implementation must dispatch on the kind of reference. If it’s an address, the value is loaded from the heap. If it’s a proxy, the underlying reference is dereferenced T1 ∼ T3 T2 ∼ T4 T1 × T2 ∼ T3 × T4 T1 ∼ T3 T2 ∼ T4 T1 → T2 ∼ T3 → T4 T ⊓T Meet operation (greatest lower bound) Dyn ⊓ T = T ⊓ Dyn = T B⊓B =B (T1 × T2 ) ⊓ (T3 × T4 ) = (T1 ⊓ T3 ) × (T2 ⊓ T4 ) (T1 → T2 ) ⊓ (T3 → T4 ) = (T1 ⊓ T3 ) → (T2 ⊓ T4 ) Ref pT1 ⊓ Ref pT2 = Ref p (T1 ⊓ T2 ) RefmT1 ⊓ RefmT2 = Refm (T1 ⊓ T2 ) (T ⇒l T ) = c Coercion creation (B ⇒l B) = (Dyn ⇒l Dyn) = ι (I ⇒l Dyn) = I ! (Dyn ⇒l I ) = I ?l (T1 → T2 ⇒l T1′ → T2′) = (T1′ ⇒l T1 ) → (T2 ⇒l T2′) (T1 × T2 ⇒l T1′ × T2′) = (T1 ⇒l T1′) × (T2 ⇒l T2′) (Ref pT ⇒l Ref pT ′) = Ref p (T ′ ⇒l T ) (T ⇒l T ′) (RefmT ⇒l RefmT ′) = Refm T ′ Coercion composition (д ; I !) # (J ?p ; i) = c → d # c′ → d′ = c × d # c′ × d′ = Ref p c d # Ref p c ′ d ′ = Refm T # Refm T ′ = (I ?p ; i) # c д1 # (д2 ; I !) ι # c =c # ι д # ⊥I p J = ⊥I p J # c c # d =r д # (⟨I ⇒p J ⟩ # i) (c ′ # c) → (d # d ′) (c # c ′) × (d # d ′) Ref p (c ′ # c) (d # d ′) Refm (T ⊓ T ′) = I ?p ; (i # c) = (д1 # д2 ) ; I ! = c = ⊥I p J Figure 3. Types, coercions, and their operations. 4 Efficient Gradual Typing PL’17, January 01–03, 2017, New York, NY, USA Runtime Structures cv ::= v | v ⟨c⟩ | (cv, cv) µ ::= ∅ | µ(a 7→ v) | µ(a 7→ v : T ) ν ::= µ | ν (a 7→ cv : T ) E ::= F | F [□⟨f ⟩] F ::= □ | E[□ M] | E[v □] | E[(□, M)] | E[(v, □)] | E[(fst □)] | E[(snd □)] | E[refP □] | E[!P □] | E[□:=P M] | E[v:=P □] | E[refM □@T ] | E[!M □] | E[!□@T ] | E[□:=M M] | E[v:=M □] | E[□:=M@T ] | E[v:=□@T ] M, µ −→c N , ν Cast reduction rules F [u ⟨ι⟩], µ F [u ⟨i⟩⟨c⟩], µ F [(u, u ′)⟨c × d⟩], µ F [u ⟨⊥I p J ⟩], µ F [a⟨Refm T2 ⟩], ν −→c −→c −→c −→c −→c F [a⟨Refm T2 ⟩], ν −→c F [a⟨Refm T2 ⟩], ν −→c Program reduction rules E[(λx .M) v], µ E[u⟨c → d⟩ v], µ E[(fst (v, v ′ ))], µ E[(snd (v, v ′ ))], µ E[blame p], µ E[error], µ E[refPv], µ E[!Pa], µ E[!P (a⟨Refp c d⟩)], µ E[a:=P v], µ E[a⟨Refp c d⟩:=P v], µ E[refMv@T ], µ E[!Ma], µ E[!a@T ], µ E[a:=M v], µ E[a:=v@T ], µ State reduction rules −→e −→e −→e −→e −→e −→e −→e −→e −→e −→e −→e −→e −→e −→e −→e −→e F [u], µ F [u⟨i # c⟩], µ E[(u ⟨c⟩, u ′ ⟨d⟩)], µ blame p, µ F [a], ν (a 7→ cv ⟨T1 ⇒ T3 ⟩ : T3 ) if ν(a) = cv:T1 ,T3 =T1 ⊓ T2 ,T3 , T1 F [a], ν if ν (a) = cv : T1 ,T1 = T1 ⊓ T2 error, ν if ν (a) = cv : T1 ≁ T2 M, µ −→e N , ν and then the proxy’s read coercion c is applied. The story is similar for writing to a proxied reference. For monotonic references, there are two dereference operators. For the fully static dereference, we simply load the value from the heap. For the partially dynamic dereference, we load the value from the heap and cast it from it’s RTTI to the expected type T . The story is similar for writing to a monotonic reference. Regarding the state reduction rules, the first rule simply enables transitions according to the cast or program reduction rules. The next three rules propagate casts within an evolving heap. The first of them commits the result of casting a value in the heap whereas the second throws away the result of a cast in the case when the RTTI has changed (due to cycles). The last rule handles the case when a cast fails. 4 The Grift Compiler The Grift compiler takes programs in an extended version of the gradually typed lambda calculus and compiles them to C, using the Clang compiler to generate x86 executables. The Clang compiler provides low level optimizations. The first step in the Grift compiler is to translate to an intermediate language with explicit casts. This process is standard [30, 36, 39] except for optimizations to avoid unnecessary casts in dynamically typed code, which we describe in Section 4.6. The next step in the compiler is exposing the runtime functions that implement casts. We describe the representation of values in 4.1. We describe the implementation of typed-based casts in Section 4.2, coercions in Section 4.3, and monotonic references in Section 4.4. After lowering casts, Grift performs closure conversion using a flat representation [6, 11, 12], and translates all constructors and destructors to memory allocations, reads, writes, and numeric manipulation. E[[x := v]M], µ E[u (v ⟨c⟩)⟨d⟩], µ F [v], µ F [v ′ ], µ blame p, µ if E , □ error, µ if E , □ F [a], µ(a 7→ v) if a < dom(µ) F [µ(a)], µ F [(!Pa)⟨d⟩], µ F [a], µ(a 7→ v) 4.1 Value Representation E[a:=P v ⟨c⟩], µ Values are represented according to their type. An Int value F [a], µ(a 7→ v : T ) if a < dom(µ) is a 64-bit integer. A Bool value is also a 64-bit integer, using F [µ(a)val ], µ F [µ(a)val ⟨µ(a)rtti ⇒ T ⟩], µ the C encoding of 1 for true and 0 for false. For values of F [a], µ(a 7→ v : µ(a)rtti ) function type, the representation depends on whether Grift F [a], µ(a 7→ v ⟨T ⇒ µ(a)rtti ⟩ : µ(a)rtti ) uses type-based casts or coercions. In the former case, a function value is a pointer to a closure. A closure consists of 1) a function pointer, 2) a pointer to a function for casting the closure, and 3) the values of the free variables. In the later case (for coercions), a function value is a pointer to one of two different kinds of closures and the lowest bit of the pointer indicates which kind. The first kind, for regular functions, is the same as above. The second kind which we call a proxy closure, is for functions that have been cast. It consists of a function pointer (to a “wrapper” function), a pointer to the underlying closure, and a pointer to a coercion. A value of proxied reference type is a pointer to the data or to a proxy. The lowest bit of the pointer indicates which. The representation of the proxy depends on whether Grift uses type-based casts or coercions. In the former case, the M, ν −→ N , ν M, µ −→X N , ν X ∈ {c, e} M, µ −→ N , ν ν (a) = cv : T ν ′(a)rtti = T cv, ν −→c cv ′, ν ′ M, ν −→ M, ν ′(a 7→ cv ′ : T ) ν (a) = cv : T E ∈ {error, blame p} ν (a) = cv : T ν ′(a)rtti , T cv, ν −→c cv ′, ν ′ cv, ν −→c E, ν ′ M, ν −→ M, ν ′ M, ν −→ E, ν ′ Figure 4. Semantics of the intermediate language of Grift, with proxied and monotonic references. 5 PL’17, January 01–03, 2017, New York, NY, USA Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek obj cast(obj val, type src, type tgt, blame lbl) { if (src == tgt) { return val; } else if (src == DYN_TYPE) { return cast(UNTAG(val), TYPE(val), tgt, lbl); } else if (tgt == DYN_TYPE) { return INJECT(val, src); } else if (TAG(src)==FUN_TAG && TAG(tgt)==FUN_TAG && ARITY(src)==ARITY(tgt)) return UNTAG_FUN(val)->caster(val,src,tgt,lbl); else if (TAG(src)==REF_TAG && TAG(tgt)==REF_TAG) { type s = REF_TYPE(src), t = REF_TYPE(tgt); return MK_REF_PROXY(val, s, t, lbl); } else { raise_blame(lbl); } } obj ref_read(obj ref) { if (TAG(ref) == REF_PROXY_TAG) { ref_proxy p = UNTAG_PREF(ref); obj v = ref_read(p->ref); return cast(v, p->src, p->tgt, p->lbl); } else { return *UNTAG_REF(ref); } } obj ref_write(obj ref, obj v) { if (TAG(ref) == REF_PROXY_TAG) { ref_proxy p = UNTAG_PREF(ref); obj cv = cast(v, p->tgt, p->src, p->lbl); return ref_write(p->ref, cv); } else { *UNTAG_REF(ref) = v; return UNIT; } } Figure 6. Code for reading and writing to references. Figure 5. The cast function. proxy consists of a reference, the source and target types, and a blame label. In the later case, the proxy consists of a reference and a pointer to a coercion (that is, a reference coercion). A value of monotonic reference type is an address. A value of type Dyn is a 64-bit integer, with the 3 lowest bits indicating the type of the injected value. For atomic types (e.g. Int and Bool), the injected value is stored in the other 61 bits. For non-atomic types, the other 61 bits are a pointer to a pair of the injected value and its type. In the following, the macros for manipulating values have all uppercase names to distinguish them from C functions. The macro definitions are listed in Appendix A. 4.2 (cast add1 (Int → Int) (Dyn → Dyn) L) produces the wrapper function: (λ (x) (cast (add1 (cast x Dyn Int L)) Int Dyn L)) The wrapper function needs to have the same arity as the wrapped function, so we find it convenient to attach to every closure, in field caster, a function that knows how to generate the appropriate wrapper function. This function allocates a closure whose code pointer is to a wrapper function of the appropriate arity and whose free variables provide access to the original closure and the source and target types for the casts. If the source and target type are inconsistent, an error is signaled with a message that includes the blame label. In case the source and target of the cast are proxied reference types, cast allocates a reference proxy that stores the referred-to types of the source and target and the underlying reference (which could be either a pointer or another proxy). To better understand the cost of a cast, Figure 5 colors the used macros and functions to indicate how expensive they are. TAG and UNTAG_FUN perform pointer and bit manipulation; UNTAG, TYPE, and REF_TYPE have a few branches and perform loads from memory; INJECT, caster, MK_REF_PROXY allocate memory; and cast is recursive but bound by the depth of types. Implementation of Type-based Casts Type-based casts require a runtime representation of types. Grift allocates all types known at compile time at the start of the program. Each type is a 64 bit value, the lower 3 bits categorize whether it is an atomic, function, proxied reference or monotonic reference type. For atomic types, the other 61 bits indicate which atomic type. For function and reference types, the other 61 bits point to a larger structure. The structure for a function type stores the arity, return type, and types for the parameters. The structure for reference types consists of the referred-to type. Applying Functions For type-based casts, Grift doesn’t need to distinguish between the closures created by casting functions and closures created by defining functions. As a result, the calling convention is simple and direct. The generated code at each call site accesses the function pointer at the beginning of the closure and performs an indirect call, passing the closure to the function as an additional argument. Casting Values Grift implements type-based casts with the C function named cast (Figure 5) that takes a value, two types (source and target), and a blame label, and returns a value or signals an error. If the cast is between two identical types, then cast returns the value unaltered. If the source type is Dyn, then the underlying value and the type are extracted and used to recursively cast to the target type of the original cast. Conversely, if the target type is Dyn, then the value is injected into the representation for Dyn. In case the source and target of the cast are function types, cast wraps the value in a function that casts the arguments and the return value appropriately. For example, the cast: Reading and Writing to Proxied References The C functions for reading and writing references are listed in Figure 6. The code for reading dispatches on whether the reference is proxied or not, and if proxied, recurses on the underlying reference (because it could be another proxy). When the 6 Efficient Gradual Typing PL’17, January 01–03, 2017, New York, NY, USA recursion returns, the code casts the read value from the source to the target type of the proxy. Otherwise the read is accomplished by clearing the tag and dereferencing the pointer. The story for writing to a reference is similar. 4.3 obj coerce(obj v, crcn c) { switch(TAG(c)) { case ID_TAG: return v; case SEQUENCE_TAG: sequence seq = UNTAG_SEQ(c); return coerce(coerce(v, seq->fst), seq->snd); case PROJECT_TAG: projection proj = UNTAG_PRJ(c); crcn c2 = mk_crcn(TYPE(v), proj->type, proj->lbl); return coerce(UNTAG(v), c2); case INJECT_TAG: injection inj = UNTAG_INJECT(c); return INJECT(v, inj->type); } case HAS_2ND_TAG: { sec_tag tag = UNTAG_2ND(c)->second_tag; if (tag == REF_COERCION_TAG) { if (TAG(v) != REF_PROXY) { return MK_REF_PROXY(v, c); } else { ref_proxy p = UNTAG_PREF(v); crcn c2 = compose(p->coercion, c); return MK_REF_PROXY(p->ref, c2); } } else if (tag == FUN_COERCION_TAG) if (TAG(v) != FUN_PROXY) { return UNTAG_FUN(v).caster(v, c); } else { fun_proxy p = UNTAG_FUN_PROXY(v); crcn c2 = compose(p->coercion, c); return MK_FUN_PROXY(p->wrap, p->clos, c2); } } case FAIL_TAG: raise_blame(UNTAG_FAIL(c)->lbl); } } Implementation of Coercions The coercion implementation closely mirrors the semantics of coercions given in Section 3. Coercions are represented as heap allocated objects and the ones that are known at compile time are allocated once at the start of the program. Grift calls the C function coerce, described below, that interprets the coercion in accordance with the semantics. Coercion Representation. Similar to types, coercions are represented as 64-bit values where the lowest 3 bits indicate whether the coercion is a projection, injection, sequence, failure, or identity. The number of pointer tags is limited, so the rest of the coercions are identified by a tag stored in the first word of their structures. For an identity coercion, the remaining 61 bits are not used. For the other coercions, the remaining 61 bits stores a pointer to heap-allocated structure that depends on the kind of coercion: • Projection coercion (T ?p ) is represented in 2 × 64 bits: the first word is a pointer to the typeT of the projection and the second is a pointer to the blame label p. • Injection coercion (T !) is represented in 64 bits, holding a pointer to the type T of the injected value. • Function coercion (c 1 , . . . , c n → c r ) with n parameters is represented in 64(n + 2) bits, where the first word stores the secondary tag and arity, the second store a coercion on the return, and the remaining words store n coercions for the arguments. • Proxied reference coercion (Ref p c 1 c 2 ) is represented in 3 × 64 bits, including the secondary tag, a coercion c 1 for writing, and another coercion c 2 for reading. • Monotonic reference coercion (Refm T ) is represented in 2 × 64 bits, including the secondary tag and a type. • Sequences (c 1 ; c 2 ) store two coercions in 2 × 64 bits. • Failure coercion (⊥p ) is represented in 64 bits to store a pointer to the blame label. Figure 7. The coerce function applies a coercion to a value. new proxy closure by copying over the wrapper function and the underlying closure, but its coercion is the result of composing the proxy’s coercion with the coercion being applied via compose (Appendix A Figure 14). If the function has not been previously coerced, then we access its function pointer for casting and apply that to the function and the coercion that needs to be applied. This “caster” function allocates and initializes a proxy closure. Coercing a proxied reference builds a proxy that stores two coercions, one for reading and one for writing, and the pointer to the underlying reference. In case the reference has already been coerced, the old and new coercions are composed via compose, so that there will only ever be one proxy on a proxied reference, which ensures space efficiency. Failure coercions halt execution and report an error using the blame label. Applying a Coercion The application of a coercion to a value is implemented by a C function named coerce, shown in Figure 7, that takes a value and a coercion and either returns a value or signals an error. The coerce functions dispatches on the coercion’s tag. Identity coercions return the value unchanged. Sequence coercions apply the first coercion and then the second coercion. Injection coercions build a value of type Dyn. Projection coercions take a value of type Dyn and build a new coercion from the runtime type to the target of the projection, which it applies to the underlying value. When coercing a function, coerce checks whether the function has previously been coerced. If so, Grift builds a Applying Functions Because the coercions implementation distinguishes between regular closures and proxy closures, one might expect closure call sites to branch on the type of closure being applied. However, this is not the case 7 PL’17, January 01–03, 2017, New York, NY, USA Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek Coercions The story for coercions is similar. The only difference is that the generated code builds coercions out of the RTTI and the other input type with a call to mk_crcn and calls coerce instead of cast. because Grift ensures that the memory layout of a proxy closure is compatible with the regular closure calling convention. The only change from the type-based implementation’s calling convention (described in Section 4.2) is that we have to clear the lowest bit of the pointer to the closure which distinguishes proxy closures from regular closures. This representation is inspired by a technique used in Siek and Garcia [37] which itself is inspired by Findler and Felleisen [19]. Coercions and casts together? An astute reader would notice that the implementation details of coercing is very similar to casting in many scenarios with the difference being creating a coercion out of the source and target types and calling coerce instead of cast. Reading and writing partially typed monotonic references is an obvious example of such scenario where a coercion is created only to be immediately consumed. Grift is clever in optimizing such cases by deferring coercion creation until it is actually needed to be stored or composed and uses the types to simulate coercions in other cases. We refer to this as lazy coercion creation. Our experiments show that this optimization results in performance gains on the quicksort and n-body benchmarks and no performance differences on the others. Reading and Writing to Proxied References For the coercion implementation, Grift generates code for proxied reference reads and writes that is similar to the code in the type-based cast implementation. However, there are two slight differences: since coercions are space-efficient, we know that there will be at most one proxy, and therefore there is no need to recurse on the proxied reference and the coerce function is used with the coercion contained in a proxy if present. 4.4 4.5 Implementation of Monotonic References Specializing Casts and Coercions Typically, types and coercions are inspected at runtime when values get casted. However, for many casts, some or all of the types/coercions involved are known at compile time. Grift can recognize such casts and partially evaluate them, generating more efficient code. Consider the following expression in the intermediate language where casts are explicit: A monotonic heap cell has two parts; the first stores runtime type information (RTTI), and the second stores the value. Grift generates pointer dereference and write instructions for reading and writing a fully statically-typed monotonic reference. Otherwise, the value being read or written has to be cast. The details of the latter process and that of casting an address is described below. (cast n Dyn Int l) a straight forward compilation is a cast call which dispatches on types at runtime. But with specialization, it will get compiled to the following efficient code: Type-based Casts To cast a monotonic reference, we cast the underlying value on the heap. First, the RTTI is read from the first word pointed to by the address. The address is returned if the RTTI equals the target type of the cast. However the equality check can be expensive if implemented naively because the structures of both types will be traversed. Instead, we hashcons [1] all types to reduce structural equality to pointer equality. If the check fails, we call tglb, which computes the greatest lower bound of two types, and then overwrite the RTTI with the result. Next we call cast on the value to cast it from the old RTTI to the new RTTI. After cast returns, we check if the current RTTI is the same as the one we wrote earlier to the heap and write the new value to the heap only if they are indeed equal. Otherwise, a value with a more precise type has already been written to the heap so we discard the current value and return the address. Reading from a non-static reference proceeds as follows: the value is read from the second word pointed to by the address, the RTTI is read from the first word, then cast is called on the value, the RTTI, and the statically recorded type. For writing, the RTTI will be read first from the heap and then cast will be called on the new value, the statically recorded type and the RTTI. Again, we check if the RTTI has changed during the casting process, if yes, we drop the casted value, otherwise, we write the new value to the heap. (TAG(n) == INT_TYPE) ? UNTAG_INT(n) : raise_blame(l) which is basically the body of the branch inside cast where the type arguments are Dyn and Int. While lazy coercion creation reduces the number of coercions that get allocated dynamically in certain cases, specialization simplifies the coercions that are known at compile time. Our experiments show that specializing coercions significantly improves some benchmarks, such as Matrix Multiplication, but only slightly improves the rest (Appendix ??). 4.6 Optimizing Dynamically Typed Code The straightforward approach to inserting casts [41] can cause unnecessary overhead in dynamically typed regions of code. Consider the function (λ (f) (f 42)) which applies a function f injected into Dyn. The straightforward cast insertion would compile it to: (λ (f : Dyn) ((cast f Dyn (Dyn → Dyn) L) (cast 42 Int Dyn L))) The cast on f will allocate a function proxy if the source type of f is not (Dyn → Dyn). Although allocating a proxy is important to maintain the semantics, the allocation is unnecessary in this case because it will be consumed right away. Instead, Grift specializes these cases by generating 8 Efficient Gradual Typing PL’17, January 01–03, 2017, New York, NY, USA fft (R6RS) Fast Fourier Transform on 65, 536 real-valued points. A test of floating point. n-body (CLBG) Models the orbits of Jovian planets, using a simple symplectic-integrator. code that does what a proxy would do without allocating one. Grift applies this optimization to proxied references and tuples as well. 5 Performance Evaluation Experimental Setup All experiments were conducted on an unloaded machine with a 4-core Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz processor with 8192 MB of cache and 16 GB of RAM running Red Hat 4.8.5-16. The C compiler we used is Clang 5.0.0, the Gambit compiler is version 4.8.8, Racket is version 6.10.1, and Chez Scheme is version 9.5.1. All time measurements use real time, and 30 samples were collected of each time measurement and the mean reported. In this performance evaluation, we seek to answer a number of research questions regarding the runtime overheads associated with gradual typing. 1. What is the overhead of gradual typing? (Sec. 5.2) We subdivide this question into the overheads on programs that are (a) statically typed, (b) dynamically typed, and (c) partially typed. 2. What is the cost of achieving space efficiency with coercions? (Section 5.3) 3. How do monotonic references compare with proxied references? (Section 5.4) 5.1 Measuring the Performance Lattice Takikawa et al. [46] observe that evaluating the performance of implementations of gradually typed languages is challenging because one needs to consider not just one version of each program, but the very many versions of a program that can be obtained by adding/removing static types. For languages with coarsegrained gradual typing, as in Takikawa et al. [46], one considers all the combinations of making each module typed or untyped, so there are 2m configurations of the m modules. The situation for languages with fine-grained gradual typing, as is the case for Grift, is considerably more difficult because any type annotation, and even any node within a type annotation, may be changed to Dyn, so there are millions of ways to add type annotations to these benchmarks. For our experiments on partially typed programs, we randomly sample 90 configurations from across the spectrum of type annotations for each benchmark. Our sampling approach starts from a statically-typed program, and at each type annotation in the program, we generate the array of all types that are less precise than that type. We then sample a program from the lattice at a certain percentage of type annotation by generating random indices into these arrays, use them to choose less precise types, and finally, insert the chosen types into the locations of the original type annotations in the benchmark. The random indices are generated in a controlled way to make sure the percentage of type annotations in the resultant sample will fall within the range we are aiming for. This algorithm ensures that when sampling to produce programs with a particular percentage of type annotations, all programs that satisfy the type percentage constraint are equally likely to be chosen. However, the algorithm suffers from large memory consumption. At this time we are unable to run it on the ray tracing benchmark because of the size of its types. As such, we have omitted ray from the partially typed comparisons. Experimental Methodology In these experiments we use benchmarks from a number of sources: the well-known Scheme benchmark suite (R6RS) used to evaluate the Larceny [26] and Gambit [17] compilers, the PARSEC benchmarks [8], and the Computer Language Benchmarks Game (CLBG). We do not use all of the benchmarks from these suites due to the limited number of language features currently supported by the Grift compiler. We continue to add benchmarks as Grift grows to support more language features. In addition to the above benchmarks, we also include two textbook algorithms: matrix multiplication and quicksort. We chose quicksort in particular because it exhibits space efficiency issues similar to the benchmarks of Takikawa et al. [45, 46]. The benchmarks that we use are: tak (R6RS) This benchmark, originally a Gabriel benchmark, is a triply recursive integer function related to the Takeuchi function. It performs the call (tak 40 20 12). A test of non-tail calls and arithmetic. ray (R6RS) Ray tracing a simple scene, 20 iterations. A test of floating point arithmetic. Adapted from Example 9.8 of Paul Graham’s book on ANSI Common Lisp. blackscholes (PARSEC) This benchmark, originally an Intel RMS benchmark, calculates the prices for a portfolio of European options analytically with the BlackScholes partial differential equation. There is no closedform expression for the Black-Scholes equation and as such it must be computed numerically. matmult (textbook) A triply-nested loop for matrix multiplication, with integer elements. The matrix size is 400×400 in the comparisons to other languages (Sec. 5.2.1 and 5.2.2) and 200 × 200 for the evaluation of partially typed programs (Sec. 5.3 and 5.4). quicksort (textbook) The standard quicksort algorithm on already-sorted (worst-case) input, with integer arrays of size 10, 000 in the comparison to other languages and 1, 000 for the partially typed programs. 5.2 Gradual Typing Overhead and Comparison The purpose of this section is to answer research question 1, i.e., what is the overhead of gradual typing? Of course, to ultimately answer this question one would need to consider all 9 PL’17, January 01–03, 2017, New York, NY, USA Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek possible implementations. So the actual question we answer is: what is the overhead of gradual typing in an ahead-oftime compiler that implements space-efficient coercions and monotonic references? To answer this question, it is important to isolate the overheads of gradual typing from other sources of overhead. Thus, we have implemented a variant of the Grift compiler, named Static Grift, that requires the input program to be statically typed and does not generate any code in support of gradual typing. We then compare (gradually typed) Grift with Static Grift. Of course, one threat to validity is the possibility that the performance of Static Grift could be so poor that the overheads due to gradual typing are drowned out. To allay this fear, we include external comparisons to other programming language implementations, including statically typed languages such as OCaml, and dynamically typed languages such as Scheme and Racket. The upshot of this comparison is that the performance of Grift is in the same ballpark as these other implementations. It is tempting to interpret these comparisons in a competitive light, but we encourage the reader to abstain from such thoughts. The point is not that we would convince the reader to start compiling programs with Grift (you shouldn’t because it does not support a full language), but to convince implementors of gradually-typed languages that coercions and monotonic references are worthwhile. Finally, we note that the semantics of monotonic references is different from proxied references, so the Grift compiler implements two different gradually typed languages. We refer to them as Proxied Grift and Monotonic Grift. Both versions use coercions (not type-based casts), specialize casts, and perform lazy coercion creation, as described in Section 4. In this section we report on the performance of both Proxied Grift and Monotonic Grift. 5.2.1 Figure 8. A comparison of the speedup on statically typed programs of Proxied Grift and Monotonic Grift with respect to Static Grift. For context, we also include the speedup of Typed Racket and OCaml. Evaluation on Statically Typed Programs Figure 8 shows the results of evaluating the speedup of Proxied and Monotonic Grift with respect to Static Grift on statically typed versions of the benchmarks. We see that the performance of Monotonic Grift is no lower than 0.99× of Static Grift on all the benchmarks whereas the performance of Proxied Grift sometimes dips to 0.65× that of Static Grift. To put the performance of Grift in context, it is comparable to OCaml and better than fully static Typed Racket. Figure 9. A comparison of the speedup on dynamically typed programs of Proxied Grift and Monotonic Grift with respect to Racket. For context, we also include the speedup of other Scheme implementations (Gambit and Chez Scheme). Answer to research question (1 a): the overhead of gradual typing for statically typed code is consistently low with monotonic references but sometimes high with proxied references. math operators for integers. We also make no attempt to account for differences in garbage collection. To mitigate the differences between runtime initialization we use internal timing. For Type Racket we make sure to use the floating point specialized math operations, but since there is no safe and well-performing equivalent operation for fixed width integers we are forced to use the polymorphic Figure 9 shows the results of evaluating the speedup of Proxied and Monotonic Grift with respect to Racket on dynamically typed versions of the benchmarks. Note that we have not implemented a “Dynamic Grift” (analogous to Static Grift, but for dynamic languages), but instead we compare to 5.2.2 10 Evaluation on Dynamically Typed Programs Efficient Gradual Typing PL’17, January 01–03, 2017, New York, NY, USA Racket. The figure also includes results for Gambit and Chez Scheme. We see that the performance of Grift is generally higher than Gambit but lower than Racket and Chez Scheme on these benchmarks. This experiment does not tease apart which of these performance differences are due to gradual typing per se and which of them are due to orthogonal differences in implementation, e.g., ahead-of-time versus JIT compilation, quality of general-purpose optimizations, etc. Thus we draw the following conservative conclusion. Answer to research question (1 b) the overhead of gradual typing for dynamically typed code is currently reasonable but there is still some improvement to be made. 5.2.3 Evaluation on Partially Typed Programs Figure 10 shows the speedup of Proxied and Monotonic Grift with respect to Racket on a large number of partially typed configurations of each benchmark (recall that Section 5.1 discusses the selection of configurations). The x-axis varies the amount of type annotations in the program, from 0% on the left to 100% on the right. The performance of Racket is the horizontal line at 1. We also include a horizontal line for Static Grift, which represents the best performance one could hope for. In Figure 10 we show the results for three benchmarks. We select matmult, blackscholes, and n-body as representatives of best, middle, and worst case comparisons to Racket. In matmult, the performance of Monotonic Grift is slightly below Racket for the untyped configurations but then climbs to nearly 10× speedup for configurations that are 80% typed or more. The performance of Proxied Grift trails that of Monotonic, but the trend is similar. Note that the mean for Proxied Grift (purple horizontal line) and for Monotonic Grift (green horizontal line) are both well above Racket. In blackscholes, Grift starts around 0.3× the speed of Racket and then gradually climbs to match Racket at 60% typed and then exceeds Racket by about 2× at 80% typed. The mean for Grift is similar to Racket on this benchmark. In n-body, Grift again starts out slower than Racket but becomes faster once the configurations are 80% typed. However, in this benchmark the mean for Grift is significantly lower, around 0.6× the speed of Racket. Answer to research question (1 c) the overhead of gradual typing on partially typed code is currently reasonable but there is still some improvement to be made. 5.3 Figure 10. Evaluation of Monotonic Grift and Proxied Grift on partially typed programs. The y-axis is speedup relative to Racket on a logarithmic scale. The x-axis varies the amount of type annotations in the program, from 0% to 100%. On the whole, monotonic references are more efficient than proxied references in partially typed code. The Runtime Cost of Space Efficiency In Figure 11 we compare the performance of Grift with typebased casts, to Grift with coercions, which are space-efficient. We compare these two approaches on partially typed configurations of the benchmarks. The quicksort benchmark is the 11 PL’17, January 01–03, 2017, New York, NY, USA Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek only one that elicits space efficiency problems. In that benchmark, type-based casts exhibit catastrophic performance on some configuration (the circles at the bottom, between 0.001 and 0.002). In fact, in some configurations, the time complexity of quicksort changes from O(n2 ) to O(n 3 )! This occurs when the array is cast on each recursive call, and each cast adds another proxy that induces overhead on subsequent reads and writes to the array. On the other hand, the coercion-based approach successfully eliminates these catastrophic slowdowns. In benchmarks that do not elicit space efficiency problems, we see a general trend of the coercions being roughly equal to the performance type-based casts. Across all benchmarks the speedup of coercions over type-based cast is between 0.82× (the fft benchmark) and 1.93× (the matmult benchmark). Answer to research question (2): Space-efficient coercions offer a “pay as you go” cost model. On benchmarks without space-efficiency issues, we sometimes see a mild speedup and sometimes a mild slowdown. However, where space efficiency is needed, coercions eliminate the catastrophic slowdowns. 5.4 Monotonic versus Proxied References We return our attention to Figure 10, but this time with an eye towards evaluating whether monotonic references perform better than proxied references. Indeed, monotonic references are faster by 1.48× in matmult and by 1.08× in n-body. Additionally, the experiment shows that monotonic references match the performance of Static Grift in cases where the benchmark source code is closer to be fully typed. Answer to research question (3): Monotonic references are more efficient than proxied ones on partially typed programs and enable especially low overhead in statically typed code. 6 Conclusion We have presented Grift, a compiler for exploring implementations of gradually typed languages. In particular, we implement several technologies that enable gradual typing: type-base cast, space-efficient coercions, traditional proxied references, and monotonic references. Our experiments show that Grift with monotonic references is competitive with OCaml on statically typed code. For dynamically typed code, Grift is on par with Scheme implementations using both proxied and monotonic implementations. On partially typed code, our experiments show that coercions eliminate the catastrophic slowdowns caused by space-inefficient casts. Furthermore, we see significant speedups (10×) as 60% or more of a program is annotated with types. Future work remains to improve the efficiency of coercions. Figure 11. We compare Grift with coercions to Grift with type-based casts (both use proxied references) across partially typed-programs to evaluate the cost of space-efficiency. The y-axis is speedup over Racket on a log scale. The x-axis is the percentage of types annotations, from 0% to 100%. Note that some configurations of quicksort exhibit catastrophic slowdowns with type-based casts. 12 Efficient Gradual Typing PL’17, January 01–03, 2017, New York, NY, USA References [21] Kathryn E. Gray, Robert Bruce Findler, and Matthew Flatt. 2005. Finegrained interoperability through mirrors and contracts. In OOPSLA ’05: Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applications. ACM Press, New York, NY, USA, 231–245. [22] Michael Greenberg. 2015. Space-Efficient Manifest Contracts. In Proceedings of the 42Nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’15). ACM, New York, NY, USA, 181–194. https://doi.org/10.1145/2676726.2676967 [23] Michael Greenberg, Benjamin C. Pierce, and Stephanie Weirich. 2010. Contracts Made Manifest. In Principles of Programming Languages (POPL) 2010. [24] Jessica Gronski, Kenneth Knowles, Aaron Tomb, Stephen N. Freund, and Cormac Flanagan. 2006. Sage: Hybrid Checking for Flexible Specifications. In Scheme and Functional Programming Workshop. 93–104. [25] Arjun Guha, Jacob Matthews, Robert Bruce Findler, and Shriram Krishnamurthi. 2007. Relationally-Parametric Polymorphic Contracts. In Dynamic Languages Symposium. [26] Lars T. Hansen and William D. Clinger. 2002. An Experimental Study of Renewal-older-first Garbage Collection. In Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming (ICFP ’02). ACM, New York, NY, USA, 247–258. https://doi.org/10.1145/ 581478.581502 [27] Anders Hejlsberg. 2012. Introducing TypeScript. Microsoft Channel 9 Blog. (2012). [28] Fritz Henglein. 1994. Dynamic typing: syntax and proof theory. Science of Computer Programming 22, 3 (June 1994), 197–230. [29] David Herman, Aaron Tomb, and Cormac Flanagan. 2007. SpaceEfficient Gradual Typing. In Trends in Functional Prog. (TFP). XXVIII. [30] David Herman, Aaron Tomb, and Cormac Flanagan. 2010. Spaceefficient gradual typing. Higher-Order and Symbolic Computation 23, 2 (2010), 167–189. [31] Jacob Matthews and Amal Ahmed. 2008. Parametric Polymorphism Through Run-Time Sealing, or, Theorems for Low, Low Prices!. In Proceedings of the 17th European Symposium on Programming (ESOP’08). [32] Jacob Matthews and Robert Bruce Findler. 2007. Operational Semantics for Multi-Language Programs. In The 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. [33] Fabian Muehlboeck and Ross Tate. 2017. Sound Gradual Typing is Nominally Alive and Well. Proc. ACM Program. Lang. 1, OOPSLA, Article 56 (Oct. 2017), 30 pages. https://doi.org/10.1145/3133880 [34] Aseem Rastogi, Nikhil Swamy, Ce ÌĄdric Fournet, Gavin Bierman, and Panagiotis Vekris. 2014. Safe & Efficient Gradual Typing for TypeScript. Technical Report MSR-TR-2014-99. Microsoft Research. [35] Gregor Richards, Ellen Arteca, and Alexi Turcotte. 2017. The VM Already Knew That: Leveraging Compile-time Knowledge to Optimize Gradual Typing. Proc. ACM Program. Lang. 1, OOPSLA, Article 55 (Oct. 2017), 27 pages. https://doi.org/10.1145/3133879 [36] Jeremy G. Siek. 2008. Space-Efficient Blame Tracking for Gradual Types. (April 2008). [37] Jeremy G. Siek and Ronald Garcia. 2012. Interpretations of the Gradually-Typed Lambda Calculus. In Scheme and Functional Programming Workshop. [38] Jeremy G. Siek, Ronald Garcia, and Walid Taha. 2009. Exploring the Design Space of Higher-Order Casts. In European Symposium on Programming (ESOP). 17–31. [39] Jeremy G. Siek and Walid Taha. 2006. Gradual typing for functional languages. In Scheme and Functional Programming Workshop. 81–92. [40] Jeremy G. Siek, Peter Thiemann, and Philip Wadler. 2015. Blame and coercion: Together again for the first time. In Conference on Programming Language Design and Implementation (PLDI). [41] Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. 2015. Refined Criteria for Gradual Typing. In SNAPL: Summit on Advances in Programming Languages (LIPIcs: Leibniz International [1] John Allen. 1978. Anatomy of LISP. McGraw-Hill, Inc., New York, NY, USA. [2] Esteban Allende, Oscar Callaú, Johan Fabry, Éric Tanter, and Marcus Denker. 2013. Gradual Typing for Smalltalk. Science of Computer Programming (Aug. 2013). Available online. [3] Esteban Allende and Johan Fabry. 2011. Application optimization when using gradual typing. In Proceedings of the 6th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems (ICOOOLPS ’11). ACM, New York, NY, USA, Article 3, 6 pages. [4] Esteban Allende and Johan Fabry. 2012. Method Lookup Simulation with a Gradual Typing Language. In Chilean Computer Science Society (SCCC), 31st International Conference of the. IEEE Computer Society Press, 1–8. [5] Christopher Anderson and Sophia Drossopoulou. 2003. BabyJ - From Object Based to Class Based Programming via Types. In WOOD ’03, Vol. 82. Elsevier. [6] Andrew W. Appel. 1992. Compiling with continuations. Cambridge University Press, New York, NY, USA. [7] Spenser Bauman, Carl Friedrich Bolz-Tereick, Jeremy Siek, and Sam Tobin-Hochstadt. 2017. Sound Gradual Typing: Only Mostly Dead. Proc. ACM Program. Lang. 1, OOPSLA, Article 54 (Oct. 2017), 24 pages. https://doi.org/10.1145/3133878 [8] Christian Bienia, Sanjeev Kumar, Jaswinder Pal Singh, and Kai Li. 2008. The PARSEC Benchmark Suite: Characterization and Architectural Implications. Technical Report TR-811-08. Princeton University. [9] Gavin Bierman, Martín Abadi, and Mads Torgersen. 2014. Understanding TypeScript. In ECOOP 2014 – Object-Oriented Programming, Richard Jones (Ed.). Lecture Notes in Computer Science, Vol. 8586. Springer Berlin Heidelberg, 257–281. [10] Bard Bloom, John Field, Nathaniel Nystrom, Johan Östlund, Gregor Richards, Rok Strniša, Jan Vitek, and Tobias Wrigstad. 2009. Thorn: Robust, Concurrent, Extensible Scripting on the JVM. In ACM SIGPLAN Conference on Object Oriented Programming Systems Languages and Applications. 117–136. [11] Luca Cardelli. 1983. The Functional Abstract Machine. Technical Report TR-107. AT&T Bell Laboratories. [12] Luca Cardelli. 1984. Compiling a Functional Language. In ACM Symposium on LISP and Functional Programming (LFP ’84). ACM, 208–217. [13] M. Chevalier-Boisvert and M. Feeley. 2015. Interprocedural Type Specialization of JavaScript Programs Without Type Analysis. ArXiv e-prints (Nov. 2015). arXiv:cs.PL/1511.02956 [14] Olaf Chitil. 2012. Practical Typed Lazy Contracts. In Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming (ICFP ’12). ACM, New York, NY, USA, 67–76. [15] Christos Dimoulas, Robert Bruce Findler, Cormac Flanagan, and Matthias Felleisen. 2011. Correct blame for contracts: no more scapegoating. In Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL ’11). ACM, New York, NY, USA, 215–226. [16] Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. 2012. Complete Monitors for Behavioral Contracts. In ESOP. [17] Marc Feeley. 2014. Gambit-C: A portable implementation of Scheme. Technical Report v4.7.2. Universite de Montreal. [18] R. B. Findler and M. Felleisen. 2002. Contracts for higher-order functions. In International Conference on Functional Programming (ICFP). 48–59. [19] Robert Bruce Findler and Matthias Felleisen. 2002. Contracts for HigherOrder Functions. Technical Report NU-CCS-02-05. Northeastern University. [20] Ronald Garcia. 2013. Calculating Threesomes, with Blame. In ICFP ’13: Proceedings of the International Conference on Functional Programming. 13 PL’17, January 01–03, 2017, New York, NY, USA Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek Proceedings in Informatics). [42] Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, Sam TobinHochstadt, and Ronald Garcia. 2015. Monotonic References for Efficient Gradual Typing. In European Symposium on Programming (ESOP). [43] Jeremy G. Siek and Philip Wadler. 2009. Threesomes, with and without blame. In Proceedings for the 1st workshop on Script to Program Evolution (STOP ’09). ACM, New York, NY, USA, 34–46. https://doi.org/10.1145/ 1570506.1570511 [44] T. Stephen Strickland, Sam Tobin-Hochstadt, Robert Bruce Findler, and Matthew Flatt. 2012. Chaperones and impersonators: run-time support for reasonable interposition. In Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA ’12). [45] Asumu Takikawa, Daniel Feltey, Earl Dean, Matthew Flatt, Robert Bruce Findler, Sam Tobin-Hochstadt, and Matthias Felleisen. 2015. Towards Practical Gradual Typing. In European Conference on Object-Oriented Programming (LIPICS). Dagstuhl Publishing. [46] Asumu Takikawa, Daniel Feltey, Ben Greenman, Max New, Jan Vitek, and Matthias Felleisen. 2016. Is Sound Gradual Typing Dead?. In Principles of Programming Languages (POPL). ACM. [47] Sam Tobin-Hochstadt and Matthias Felleisen. 2006. Interlanguage Migration: From Scripts to Programs. In Dynamic Languages Symposium. [48] Sam Tobin-Hochstadt and Matthias Felleisen. 2008. The Design and Implementation of Typed Scheme. In Symposium on Principles of Programming Languages. [49] Philip Wadler and Robert Bruce Findler. 2009. Well-typed programs can’t be blamed. In European Symposium on Programming (ESOP). 1–16. [50] Tobias Wrigstad, Francesco Zappa Nardelli, Sylvain Lebresne, Johan Östlund, and Jan Vitek. 2010. Integrating typed and untyped code in a scripting language. In Symposium on Principles of Programming Languages (POPL). 377–388. 14 Efficient Gradual Typing A PL’17, January 01–03, 2017, New York, NY, USA Values, Macros, and Compose Figure 12 lists the C structs use to represent values. Figure 13 lists the macros for manipulating values. Figure 14 show the code for compose runtime function which directly follows the equations for compose in Figure 4. Received November 2017 15 PL’17, January 01–03, 2017, New York, NY, USA Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek /* Types */ typedef type* ref_type; typedef struct {int64_t arity; type ret; type args[]} fun_type; typedef union {int64_t atm; ref_type* ref; fun_type* fun;} type; /* Coercions */ typedef struct {type to; blame info;} project_crcn; typedef type* inject_crcn; typedef struct {crcn fst; crcn snd;} seq_crcn; typedef struct {snd_tag second_tag; int32_t arity; crcn ret; crcn args[]} fun_crcn; typedef struct {snd_tag second_tag; crcn write; crcn read} pref_crcn; typedef struct {snd_tag second_tag; crcn rtti} mref_crcn; typedef struct {char* lbl} fail_crcn; #define ID NULL /* Values */ #ifdef TYPE_BASED_CASTS typedef struct {obj* ref; type source; type target blame info;} ref_proxy; typedef struct {void* code; (obj)(*caster)(obj, type, type, blame); obj[]; } closure; #elseif COERCIONS typedef struct {obj* ref; crcn cast;} ref_proxy typedef struct {void* code; (obj)(*caster)(obj, type, type, blame); union {crcn coerce; obj[] fvars;} } closure; #endif typedef struct {obj value; type source} nonatomic_dyn; typedef union {int64_t atomic; nonatomic_dyn*} dynamic; typedef union {int64_t fixnum; double flonum; closure* clos; dynamic dyn} obj; Figure 12. Value representations 16 Efficient Gradual Typing PL’17, January 01–03, 2017, New York, NY, USA /* All allocated values have 3 bits that can be used for tagging */ #define TAG(value) (((int64_t)value)&0b111) #define UNTAG_INT(value) (((int64_t)value)&~0b111) #define TAG_INT(value, tag) (((int64_t)value)|tag) /* Macros that manipulate types */ #define HEAD(type) (TAG(type)) #define ARITY(type) (((fun_type)UNTAG_INT(type))->arity) #define REF_TYPE(type) (*((ref_type)UNTAG_INT(type))) /* Macros that manipulate values in the obj union */ #define UNTAG_REF(ref) ((obj*)UNTAG_INT(ref)) #ifdef TYPE_BASED_CASTS #define UNTAG_FUN(fun) ((closure*)(fun))) #define MK_REF_PROXY(v, s, t, l) (tmp_rp = (ref_proxy*)GC_MALLOC(RP_SIZE), tmp_rp->value=v, \ tmp_rp->source=s,tmp_rp->target=t,tmp_rp->info=l, (obj)TAG_INT(tmp_rp, REF_PROXY_TAG) #elseif COERCIONS #define UNTAG_FUN(fun) ((closure*)UNTAG_INT(fun)) #define MK_REF_PROXY(v, c) (tmp_rp = (ref_proxy*)GC_MALLOC(RP_SIZE), tmp_rp->value=v, \ tmp_rp->coerce=c, (obj)TAG_INT(tmp_rp, REF_PROXY_TAG) #endif /* Macros that manipulate values in the dynamic union */ #define UNTAG_NONATOMIC(value) ((nonatomic_dyn)UNTAG_INT(value)) #define UNTAG(v) ((TAG(v) == INT_TAG) ? (obj)(UNTAG_INT(v)>>3) : \ (TAG(v) == UNIT_TAG) ? (obj)UNIT_CONSTANT : ... (obj)UNTAG_NONATOMIC(v).value) #define TYPE(v) ((TAG(v) == INT_TAG) ? (type)INT_TYPE : (TAG(v) == UNIT_TAG) ? (type)UNIT_TYPE : ... \ UNTAG_NONATOMIC(v)->source) #define INJECT(v, s) ((s==INT_TYPE) ? TAG_INT(v<<3, INT_TAG) : (source==UNIT_TYPE) ? DYN_UNIT_CONSTANT : ... \ (tmp_na = (nonatomic_dyn*)GC_MALLOC(NA_DYN_SIZE), tmp_na->value=value, tmp_na->source=s, (obj)tmp_na) /* Macros that manipulate types in the crcn union */ #define UNTAG_2ND(c) ((struct {snd_tag second_tag;}*)UNTAG_INT(c)) /* UNTAG_PRJ, UNTAG_FAIL, UNTAG_SEQ are similar to UNTAG_INJ */ #define UNTAG_INJ(inj) ((inject_crcn)UNTAG_INT(inj)) /* MK_SEQ, MK_PROJECTION, MK_INJECTION are similar */ #define MK_REF_COERCION(r, w) (tmp_rc = (ref_crcn*)GC_MALLOC(RC_SIZE), tmp_rc->second_tag=REF_COERCION_TAG,\ tmp_rc->read=r, tmp_rc->write=w, (crcn)(TAG_INT(tmp_rc, HAS_2ND_TAG))) Figure 13. Macros for manipulating values 17 PL’17, January 01–03, 2017, New York, NY, USA Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek crcn compose(crcn fst, crcn snd) { if (fst == ID) { return snd; } else if (snd == ID) { return fst; } else if (TAG(fst) == SEQUENCE_TAG) { sequence s1 = UNTAG_SEQ(fst); if (TAG(s1->fst) == PROJECT_TAG) { return MK_SEQ(s1->fst, compose(s1->snd, snd)); } else if (TAG(snd) == FAIL_TAG) { return snd; } else { sequence s2 = UNTAG_SEQ(snd); type src = UNTAG_INJ(s1->snd)->type; type tgt = UNTAG_PRJ(s2->fst)->type; blame lbl = UNTAG_PRJ(s2->fst)->lbl; crcn c = mk_crcn(src, tgt, lbl); return compose(compose(seq->fst, c), s2->snd); } } else if (TAG(snd) == SEQUENCE_TAG) { if (TAG(fst) == FAIL) { return fst; } else { crcn c = compose(fst, s2->fst); return MK_SEQ(c, UNTAG_SEQ(seq)->snd); } } else if (TAG(snd) == FAIL) { return TAG(fst) == FAIL ? fst : snd; } } else if (TAG(fst) == HAS_2ND_TAG) { snd_tag tag = UNTAG_2ND(fst)->second_tag; if (tag == FUN_COERCION_TAG) { return compose_fun(fst, snd); } else if (tag == REF_COERCION_TAG) { ref_crcn r1 = UNTAG_REF(fst); ref_crcn r2 = UNTAG_REF(snd); if (read == ID && write == ID) return ID; else { crcn c1 = compose(r1->read, r2->read); crcn c2 = compose(r2->write, r1->write); return MK_REF_COERCION(c1, c2); } } } else { raise_blame(UNTAG_FAIL(fst)->lbl); } } Figure 14. The compose function for normalizing coercions. 18
6cs.PL
A Monadic Formalization of ML5 Daniel R. Licata∗ Robert Harper∗ Carnegie Mellon University {drl,rwh}@cs.cmu.edu ML5 is a programming language for spatially distributed computing, based on a Curry-Howard correspondence with the modal logic S5. However, the ML5 programming language differs from the logic in several ways. In this paper, we give a semantic embedding of ML5 into the dependently typed programming language Agda, which both explains these discrepancies between ML5 and S5 and suggests some simplifications and generalizations of the language. Our embedding translates ML5 into a slightly different logic: intuitionistic S5 extended with a lax modality that encapsulates effectful computations in a monad. Rather than formalizing lax S5 as a proof theory, we embed it as a universe within the the dependently typed host language, with the universe elimination given by implementing the modal logic’s Kripke semantics. 1 Introduction One of the many benefits of formalizing programming languages and logics is that the process of formalization, and the constraints of the particular techniques used, can lead to new insights about the system being studied. This paper provides a worked example of this phenomenon, investigating the ML5 programming language for spatially distributed computing [23]. ML5 has previously been formalized [23] using syntactic methods in Twelf [26]. However, we wished to give a semantic interpretation of ML5 into a dependently typed programming language, as a first step towards extending work on embeddings of security typed-languages [22] to account for spatially distributed access control, as in the PCML5 extension of ML5 [7]. Our semantic formalization of ML5 provides insight into several discrepancies between ML5 and the logic upon which it is based, and suggests some simplifications and generalizations of the language, as we now describe. ML5 facilitates distributed programs that deal with located resources, such as a database on a server, the browser display on a client, or heap references on any particular site. When a distributed program running at one site attempts to access a resource located at another site, the program must either communicate with the other site or fail. Because tacit communication makes it very difficult to reason about the execution time of a program (e.g. every memory dereference might involve a network communication), ML5 is based on the stance that all communication should be explicit in the program. However, rather than letting accesses from the wrong site fail dynamically, ML5 employs a type system based on a Curry-Howard correspondence with the modal logic S5 to catch these errors statically. ML5 is defined as an intuitionistic modal logic in the style of Simpson [28], where hypotheses and conclusions are considered relative to worlds, which represent places on a network. The ML5 typing judgement has the form x1 : A1 [w1 ], . . . , xn : An [wn ] ⊢ e : C[w], where Ai and C are modal types and wi and w are worlds. ∗ This research was sponsored in part by the National Science Foundation under grant number CCF-0702381 and by the Pradeep Sindhu Computer Science Fellowship. The views and conclusions contained in this document are those of the author and should not be interpreted as representing the official policies, either expressed or implied, of any sponsoring institution, the U.S. government or any other entity. K. Crary, M. Miculan (Eds.): Logical Frameworks and Meta-languages: Theory and Practice (LFMTP) 2010 EPTCS 34, 2010, pp. 69–83, doi:10.4204/EPTCS.34.7 c D. Licata & R. Harper This work is licensed under the Creative Commons Attribution License. A Monadic Formalization of ML5 70 Despite being designed by a correspondence with S5 modal logic, the ML5 programming language differs from S5 in several ways: First, ML5 ensures that all communication is explicit in the program by providing only a single communication primitive that, operationally, goes to world w′ , runs e, and brings the resulting value back to w: Γ ⊢ e : A[w′ ] A mobile Γ ⊢ get e : A[w] The condition A mobile rules out instances of get where A is, for example, ref int—which would take a reference that should be used at w′ and turn it into a reference that should be used at w, violating the intended typing guarantees. Second, in the standard presentation of S5, elimination rules for positive connectives such as sums allow an arbitrary conclusion, which is unconnected to the principal formula. In ML5, this rule is tethered, in that the world in the conclusion must be equal to the world in the premise: Γ ⊢ A ∨ B[w] Γ, x : A[w] ⊢ C[w′ ] Γ, x : B[w] ⊢ C[w′ ] Γ ⊢ C[w′ ] untethered case Γ ⊢ A ∨ B[w] Γ, x : A[w] ⊢ C[w] Γ, x : B[w] ⊢ C[w] Γ ⊢ C[w] tethered case ML5 makes the tethering restriction because the obvious operational interpretation of the untethered rule requires communication (go to w to run the principal formula). Indeed, the untethered rule is derivable using get. However, this tethering is at odds with the Kripke semantics of modal logic, where A ∨ B[w] is interpreted as A[w] or B[w]—if the interpretation commutes with disjunction, then a disjunction should be eliminable no matter the conclusion of the sequent. Third, ML5 includes two different -like modalities with the same introduction rule. The first is written A, while the second, ∀w.A at w, is a composition of the connective ∀ (quantification over worlds) and the hybrid logic [5] at modality, which internalizes the judgement A[w] as a connective. (Hybrid logic is between modal logic (truth is relativised to worlds) and first-order logic (propositions may mention worlds)). The two connectives are eliminated differently: ML5 distinguishes a syntactic category of values from ordinary expressions, and A can be eliminated to construct a value but ∀w.A at w cannot. In addition to these discrepancies, there is some confusion over the meaning the world in ML5 value judgements v :: A[w] and expression judgements e : A[w]. An expression judgement means that e is an expression that must be evaluated at w, and produces a value v :: A[w], but what does the world in the value judgement mean? One cannot think of values as just a subset of expressions, as the value rules for certain connectives, such as at and , would violate the property that all communication happens through get. Additionally, in the dynamic semantics of the ML5 internal language given in Section 3.3 of Murphy [23], get e returns the entire value of e to the calling world, so the value judgement does not mean that the value v is physically located at w. In this paper, we propose a new logical foundation for ML5, which explains the differences between ML5 and S5 and clarifies the role of the world in a value judgement. We translate ML5 into the intuitionistic logic S5 extended with a lax modality, written A, that encapsulates effectful computations in a monad [10, 15, 21]. This monadic distinction between pure terms and effectful computations is already tacit in ML5’s distinction between values and expressions—and in intermediate languages used in the ML5 compiler (e.g. the CPS language in Murphy [23]), which include elimination forms for “values” as “values”. Here, we draw out this distinction by formalizing a monadic interpretation of ML5, and make some improvements to the language based on this formulation. D. Licata & R. Harper 71 In our interpretation, ML5 values of type A[w] are interpreted as pure terms of type A∗ hwi, where A∗ is a monadic translation of A, and we write Bhwi for a worlded type in the lax modal logic. On the other hand, potentially effectful ML5 expressions are interpreted as inhabitants of type ( A∗ )hwi. The role of the world in a value judgement, i.e. the role of the world in Bhwi, is to describe where the resources in subexpressions of the type A may be used and where the computations in the type A must be run. For example, the value judgement (ref int ⊃ unit)hclienti describes a function that takes a reference that must be used at the client and produces a computation that must be run at the client. Our interpretation explains the three discrepancies between ML5 and S5 mentioned above: the get primitive is an extra operation on the monad that allows a computation that must be run at one world to be run from another. The tethered case rule is a derived rule: in ML5, the scrutinee of the case is an effectful expression, so it is necessary to sequence evaluating this expression with an actual case analysis on the value produced—and it is the sequencing that requires tethering. Indeed, we show that we can enrich ML5 with an untethered case rule on values, which would permit simpler code. Finally, the connective can be eliminated in favor of ∀ and at, given the standard pure elim rules for these types. Rather than formalizing lax S5 as a proof theory, we embed it inside a dependently typed host language, Agda [25]. First, we define a lax logic for distributed programming, L5, which is embedded in Agda using an indexed monad of computations at a place. Next, we define a universe of hybrid modal types, HL5, and give them meaning by interpretation into L5—i.e. we define a syntax of HL5 types, along with a function interpreting them as L5 types. Finally, we translate ML5 into HL5. This technique saves us the work of defining a proof theory for HL5, and additionally allows us to inherit the equational theory of the meta-language, which can be exploited in proving that the semantics validates the operational semantics of ML5. While it is simple to embed type systems specified by standard judgements of the form x1 : A1 , . . . , xn : An ⊢ e : C as a universe, it requires a bit of thought to adapt these techniques to languages with modal type systems, such as HL5. In previous work on programming with variable binding [20], we employed a technique for embedding such modal type systems: intuitionistic modal logics can be given a Kripke semantics in first-order intuitionistic logic [28], and we can formalize this semantics in a dependently typed language host language. However, the presentation of this technique in that paper was somewhat obscured by the particular example. In this paper, we present this technique in a simpler setting, and apply it to explain the proof theory of ML5. The Agda code for this paper is available from www.cs.cmu.edu/~drl. We briefly review Agda’s syntax; see the Agda Wiki(wiki.portal.chalmers.se/agda/) for more introductory materials. Dependent function types are written with parentheses as (x : A)  B. An implicit dependent function space is written as {x : A}  B or ∀ {x}  B and arguments to implicit functions are inferred. Non-dependent functions are written as A  B. Functions are written as λ x  e. Named functions are defined by clausal pattern-matching definitions. Set is the classifier of classifiers in Agda, like the kind type in ML or Haskell. 2 L5 In this section, we define an interface for distributed programming in Agda, based on lax logic [10, 15]. We define a type of worlds and a family of monads IO w S indexed by worlds, which represent an effectful computation that runs at world w and produces a value of type S. World : Set server : World client : World A Monadic Formalization of ML5 72 IO : World  return : ∀ {w S} _»=_ : ∀ {w S get : ∀ {w’ w Ref : World _:=_ : ∀ {w ! : ∀ {w new : ∀ {w Set  Set  S  IO w S S’}  IO w S  (S  IO w S’)  IO w S’ S}  IO w’ S  IO w S  Set  Set S}  Ref w S  S  IO w Unit S}  Ref w S  IO w S S}  IO w (Ref w S) The definitions are parametrized by a type of worlds, which we here assume to contain client and server. IO w S is axiomatized as a monad, with return and bind (»=), along with an additional operation get that allows the computation to switch to a different world. The command get can be thought of as a remote procedure call, which goes to w’, runs the given command, and then brings the resulting value back to w. Next, we define a type Ref w S of heap references located at world w. The operations for setting (:=), getting (!), and creating (new) references require the reference to be at the same world as the computation. Because these types are embedded in Agda, they may interact freely with the host language types— e.g., a computation may return value of any Agda Set, and we can use Agda Π and Σ types to quantify over worlds. In Agda, we use the postulate keyword to assume an implementation of this interface. Under the hood, these operations can be implemented using foreign-function calls, e.g. interpreting IO k A as the IO monad in Haskell. A trivial implementation of this interface may run all computations in a single executable on a single machine. A more realistic implementation would require compiler support for (a) compiling a single program to run on multiple hosts and (b) marshaling and unmarshaling all values (the ML5 compiler implements both of these). We also give a high-level abstract operational semantics for computations in the companion code. L5 satisfies the design goals of ML5: it ensures that resources are only used by a computation running at the appropriate world, and it also makes all communication explicit via get. The following example illustrates the use of the indexed types Ref and IO, as well as the get operation on the monad: update : (Ref server (IO server Unit))  IO client Unit  update l clicomp = get{server} (l := (get{client} clicomp)) IO client Unit This function takes a reference at the server that stores a callback computation, which itself runs at the server, as well as a computation that runs on the client, and produces a computation that runs on the client. This computation goes to the server (the outer get), and updates the callback ref (l) to point to a computation that goes back to the client and runs clicomp (the inner get). Omitting either get causes a type error, preventing resources from being used at the wrong location. In fact, nothing about the code is specific to the worlds client and server, so we can make it polymorphic in the worlds: update’ : (w1 : World) (w2 : World)  Ref w2 (IO w2 Unit)  IO w1 Unit  IO w1 Unit update’ w1 w2 l comp1 = get{w2} (l := (get{w1} comp1)) 3 HL5 A disadvantage of L5 is that types can be somewhat verbose, as they they repeat the same world multiples times (e.g. both client and server occur twice in the type of update). A hybrid modal type system, D. Licata & R. Harper 73 as in ML5, permits more concise specifications: one writes a modal type A, which for the most part does not mention worlds, and then interprets it relative to a world at the outside by writing A < w >. In this section, we define HL5, which is a hybrid type system constructed on top of the above lax logic. We define HL5 by semantic embedding into L5 (which itself is just a library in Agda): we define a syntax of HL5 types, and then an interpretation function mapping HL5 types to functions from worlds to Agda Sets (or, thinking constructively, predicates on worlds). 3.1 HL5 Types The datatype of HL5 types is defined as follows (note that Agda allows multiple datatype constructors per line): data Type : Set where _⊃_ _∨_ : Type  Type  Type ∀5 ∃5 : (World  Type)  Type _at_ : Type  World  Type : Type  Type ref : Type  Type The types ⊃ and ∨ represent functions and sums (the notation _∨_ allows ∨ to be used infix). The types ∀5 and ∃5 represent quantifiers over worlds. Next, at is a connective of hybrid logic, which allows types to set the world at which the type is interpreted. Finally, and ref represent monadic computations and references; note that they are not indexed by a world. Box and diamond can be defined using quantifiers and at:  A = ∀5 (λ w  A at w) and ♦ A = ∃5 (λ w  A at w). Below we define the interpretation function A < w >, which takes a modal type and a world and produces an Agda Set. Using modal types, we can rewrite the type of update as follows: update : (((ref ( ⊤)) at server) ⊃ ⊤ ⊃ ⊤) < client > The type ((ref ( ⊤)) at server) ⊃ ⊤ ⊃ ⊤ says that update takes a reference to a computation, located at the server, along with a computation, and produces a computation. The Agda function A < w > takes a Type and a World and produces a Set; here, it is used to say that the whole type is interpreted relative to the client. The above polymorphic update’ is typed as follows: update’ : ((∀5 (λ w2  ref ( ⊤) at w2 ⊃ ⊤ ⊃ ⊤))) <*> where the postfix symbol <*> : Type  Set means that the proposition is true in all worlds (i.e. A <*> means the Agda type {w : World}  A < w >). The outer  binds the "client" world (i.e. the world for the computations in ⊤ ⊃ ⊤); the inner ∀5 binds the "server" world (i.e. the world of the ref ( ⊤). 3.2 Interpretation We define an interpretation function A < w > interpreting a type A and a world w as an Agda classifier (a Set). Then the proof of an HL5 judgement A1 < w1 > ... ⊢ C < w > is an Agda function of type A1 < w1 > ...  C < w >. This interpretation is a constructive Kripke semantics—i.e. a Kripke semantics of an intuitionistic modal logic in intuitionistic first-order logic, relative to the Kripke structure given by the type World.1 The interpretation is defined as as follows: 1 Technically, we omit two of the pieces of a Kripke structure: World is the set of states, but because we are representing S5, we can elide the accessibility relation, and because we do not have uninterpreted base Types, we do not need an interpretation of them. A Monadic Formalization of ML5 74 _<_> : Type  World  Set (ref A) < w > = Ref w (A < w >) ( A) < w > = IO w (A < w >) (A at w’) < _ > = A < w’ > (A ⊃ B) < w > = A < w >  B < w > (A ∨ B) < w > = Either (A < w >) (B < w >) (∀5 A) < w > = (w’ : World)  (A w’) < w > (∃5 A) < w > = Σ \ (w’ : World)  (A w’) < w > The main action of the translations is to annotate ref and with the world at which the type is being interpreted. The hybrid connective at interprets its body at the specified world, ignoring the current world. Otherwise, the translation interprets each connective as the corresponding Agda Set-former, with the translation applied recursively. Note that the interpretation of ⊃ is simply : when giving a Kripke semantics for intuitionistic logic in a classical meta-language, it is necessary to interpret A ⊃ B as if it were boxed, by quantifying over future worlds; but because our meta-language is intuitionistic, this is not necessary here. The function <*> : Type  Set is defined to be the Agda set {w : World}  A < w >—A is true in all worlds, with the world itself an implicit argument to the function. Agda verifies that the modal types of update and update’ reduce to the explicit types given above. This formalization has several benefits: we can immediately use Agda to program in the modal logic, and existing Agda code can be used at modal types. For example, one can check that this definition validates all of the rules of intuitionistic S5 [28], by implementing the proof that the Simpson rules are sound for the Kripke semantics. The untethered elimination rule for disjunction and a projective elimination rule for at are defined as follows: casev : ∀ {A B C w w’}  A ∨ B < w >  (A < w >  C < w’ >)  (B < w >  C < w’ >)  C < w’ > casev (Inl e) b1 b2 = b1 e casev (Inr e) b1 b2 = b2 e unatv : ∀ {A w w’} unatv x = x  (A at w’) < w >  A < w’ > Additionally, we can see that the return and bind operations on the monad have their expected types at any world: hl5ret : ∀ {A}  hl5ret = return A ⊃ hl5bind : ∀ {A B}  hl5bind = _»=_ A <*> A ⊃ (A ⊃ B) ⊃ B <*> The type of bind insists that all three ’s be at the same world: sequencing tethers the premise to the conclusion. Having considered return and bind, it is natural to ask what hybrid type can we ascribe to the get operation on the indexed monad IO w A. If we try defining hl5get : ∀ {A w1 w2}  (( A) at w1) ⊃ (( A) at w2) <*> we see that hl5get must transform IO w1 (A < w1 >) into IO w2 (A < w2 >). L5 get satisfies this requirement if A is a constant function of its world argument, in which case A < w1 > is the same Agda Set as A < w2 >. D. Licata & R. Harper 75 We characterize constant modal types by the property that they yield the same Set for any two arguments: Constant : Type  Set1 Constant A = ∀ {w w’}  EqSet (A < w >) (A < w’ >) Here EqSet is an Agda relation expressing that the two Sets are equal classifiers (in fact, we need a notion of equality that compares the bodies of Π and Σ on all arguments, which we borrow from OTT [4]); it is equipped with an operation coerce : ∀ {A B}  EqSet A B  A  B. It is simple to prove that A at w is constant, and that the connectives ∨ ⊃ ∀5 ∃5 preserve constantness. Neither ref nor is constant, as their interpretation directly mentions the world. Thus, the constant types are those where all refs and ’s are guarded by an at. Now, we can ascribe get the following monadic type: hl5get : ∀ {A w1 w2}  Constant A  (( A) at w1) ⊃ (( hl5get con e = get e »= \ v  return (coerce con v) A) at w2) <*> hl5get is equivalent to get, using the monad laws and the fact that coercion based on a proof of EqSet is the identity (at least up to extensional equality), 4 ML5 In this section, we give inductive definitions of the syntactic apparatus of ML5: First, we define the syntax of types. Next, we represent programs using an intrinsic encoding, which represents only well-typed syntax (i.e. typing derivations or natural deduction proofs). Variables are represented as well-scoped de Bruijn indices—pointers into a typing context, which is an explicit parameter to the typing judgements. The static semantics requires an auxiliary definition of a mobility judgement on types, which is defined below. 4.1 Types data Type5 : Set where _⇀_ _∨_ : Type5  Type5  Type5 ∀5 ∃5 : (World  Type5)  Type5 _at_ : Type5  World  Type5 ref : Type5  Type5 : (World  Type5)  Type5 The type ⇀ represents partial functions, and the type ∨ represents sums. The types ∀5 ∃5 cdat and ref are the same as in HL5. There is an additional type constructor "shamrock", rendered here as , which is a -like modality, but its rules in the ML5 proof theory are subtly different than the rules for ∀5 (λ w  A at w). We represent types with free world variables as Agda functions from worlds to types. This is permissible because World is defined prior to type (i.e. we are using Weak HOAS[11, 16]). If World is chosen to be a base type in Agda, then it adequately represents ML5 types as in Murphy [23]. If instead World is chosen to be an inductive type, this representation yields a language with type-level case analysis over worlds—i.e. one could define types whose structure varies depending on their world, such as ∃5 (λ w  if w = server then nat else bool); we leave an exploration of the practical uses of this alternative to future work. A Monadic Formalization of ML5 76 4.2 Mobility ML5’s notion of mobility identifies constant functions, analogously to the Constant relation on HL5 types above. data Mobile5 : Type5  Set where mat5 : ∀ {A w}  Mobile5 (A at w) m 5 : ∀ {A}  Mobile5 ( A) –– no rule for ⇀ or refs m∨5 : ∀ {A B}  Mobile5 A  Mobile5 B  Mobile5 (A ∨ B) m∀5 : ∀ {A}  ((w’ : _)  Mobile5 (A w’))  Mobile5 (∀5 A) m∃5 : ∀ {A}  ((w’ : _)  Mobile5 (A w’))  Mobile5 (∃5 A) is always mobile, essentially because ∀5 (λ w  (A w) at w) is To foreshadow the interpretation: constant. Functions are never mobile, because they hide a in their domain, and is not constant. 4.3 Typing judgements ML5 judgements have the form Γ ⊢ e : A [ w ] and Γ ⊢ v :: A [ w ]. These judgements mean that the expression e and the value v are well-formed with modal type A at world w. Here Γ contains assumptions x:A[w] and u ∼ w.A. The former, a value hypothesis, means that x stands for a value of type A at world w. The latter, a valid hypothesis, means that u stands for a value of type A that makes sense at all worlds (w is bound in A). In the operational semantics, we will substitute a proof of the judgement w:world ⊢ v :: (A w)[ w ] for a valid variable. We combine both of the above judgements into one Agda type, defining a relation Γ ⊢ γ . Here Γ is a list of hypotheses, which are either value (A [ w ]) or valid (w.A) and γ is a conclusion, which is either exp (A [ w ]) (for expressions) or value (A [ w ]) (for values). As in the syntax of types, w.A is represented by an Agda function from worlds to types. ⊢ binds more tightly than , so we can write e.g. Γ ⊢ C1  Γ ⊢ C2 for (Γ ⊢ C1)  (Γ ⊢ C2). We define the notation A [ w ] to mean the pair of A and w, and we define sum types for hypotheses and conclusions as follows: data Hyp : Set where value : (Type5 × World)  Hyp valid : (World  Type5)  Hyp data Conc : Set where exp : (Type5 × World)  Conc value : (Type5 × World)  Conc Ctx = List Hyp Term variables x and u are represented by well-scoped de Bruijn indices—pointers into Γ: data _∈_ {A : Set} : A  List A  Set where i0 : {α : A} {Γ : List A}  α ∈ (α :: Γ) iS : {α α ’ : A} {Γ : List A}  α ∈ Γ  α ∈ (α ’ :: Γ) The typing rules are defined in Figure 1. The first rule says that (⊲ x) is a value if x is a de Bruijn index for a value assumption in Γ. The next rule represents the application of a valid assumption in Γ to a world w; we use propositional equality Id to state that the conclusion type is A w because otherwise D. Licata & R. Harper 77 the higher-order conclusion blocks pattern-matching. lam takes an expression in an extended context to a value of function type; this rule expresses the idea that a function of type A ⇀ B in a world w is an expression of type B at w, hypothetically in a variable standing for a value of type A at w. Sums are introduced by commuting the world with the connective. hold switches worlds to introduce an at; wlam and wpair introduce quantifiers in the usual way; the world in the conclusion does not change (also, note the parentheses, which in Agda’s notation for datatype constructors are the only difference between the two rules: the premise of wlam is a function, whereas wpair has two premises). However, note that the body of a wlam is a value, not an expression—ML5 has a value restriction on world quantification, to support type inference in the style of ML. sham both quantifies over a new world and switches the world of the conclusion—indeed, this is the derived intro rule that one would expect for A = ∀5 (λ w  (A w) at w). val injects values into expressions, whereas let sequences the evaluation of two expressions. put runs an expression of mobile type and then binds the resulting value as a valid assumption. app and wapp eliminate functions and universals, with the world along for the ride. The remaining rules are patternmatching-style elimination rules. In these rules, the world in the conclusion C [ w ] is tethered to the world in the principal premise, as discussed in the introduction. This system is the ML5 internal language described in Section 4.3 of [23] with one minor change: we have eliminated the syntactic class of valid values, which allowed validity to appear as a conclusion as well as as a hypothesis—valid values are unnecessary because validity is invertible on the right. An alternate formalization with valid values is included in the companion code. 5 Semantics Our semantics explains the meaning of an ML5 program by translation into HL5. As discussed above, our translation clarifies the essential difference between the role that the world plays in the judgements value (A [ w ]) and exp (A [ w ]): a value hypothesis or conclusion value (A [ w ]) is interpreted as a pure term of HL5 type (eff A) < w >, where eff A is a monadic translation of A. Thus, the role of the world w is only to describe where the resources in A may be used and where the computations must be run. On the other hand, an expression exp (A [ w ]) is interpreted as a monadic computation of type ( (eff A)) < w >, so the world determines both the site at which the effectful computation must be run and where the resources/computations in A may be used. 5.1 Type Translation The type translation from ML5 types to HL5 translates to HL5 , adds a to the codomain of ⇀ (as in any monadic translation [21]), and is defined compositionally otherwise. The ML5 connective ∀5 has a value-restriction, so there is no inserted in its body. Note that Agda allows datatype constructors to be overloaded, so we can have both ML5 types and HL5 types in scope at once. eff eff eff eff eff eff eff eff : Type5  Type (A ⇀ B) = eff A ⊃ (eff B) (A ∨ B) = eff A ∨ eff B (∀5 A) = ∀5 (λ w  (eff (A w))) (∃5 A) = ∃5 (λ w  eff (A w)) (A at w) = (eff A) at w (ref A) = ref (eff A) ( A) = ∀5 (λ w  ((eff (A w)) at w)) A Monadic Formalization of ML5 78 data _⊢_ (Γ : Ctx) : Conc  Set where lete : ∀ {A C w}  Γ ⊢ exp (A [ w ])  (Γ „ value (A [ w ])) ⊢ exp (C [ w ])  Γ ⊢ exp (C [ w ]) –– values ⊲ : ∀ {A w}  value (A [ w ]) ∈ Γ  Γ ⊢ value (A [ w ]) ⊲v : ∀ {w A C}  valid A ∈ Γ  Id C (A w)  Γ ⊢ value (C [ w ]) get5 : ∀ {A w w’}  Γ ⊢ exp (A [ w’ ])  Γ ⊢ exp (A [ w ])  Mobile5 A lam : ∀ {A B w}  (Γ „ value (A [ w ])) ⊢ exp (B [ w ])  Γ ⊢ value (A ⇀ B [ w ]) put : ∀ {A C w}  Γ ⊢ exp (A [ w ])  Mobile5 A  (Γ „ valid (\ _  A)) ⊢ exp (C [ w ])  Γ ⊢ exp (C [ w ]) inl : ∀ {A B w}  Γ ⊢ value (A [ w ])  Γ ⊢ value (A ∨ B [ w ]) app : ∀ {A B  Γ ⊢ exp  Γ ⊢ exp  Γ ⊢ exp inr : ∀ {A B w}  Γ ⊢ value (B [ w ])  Γ ⊢ value (A ∨ B [ w ]) hold : ∀ {A w w’}  Γ ⊢ value (A [ w’ ])  Γ ⊢ value ((A at w’) [ w ]) wlam : ∀ {A w}  ((w’ : _)  Γ ⊢ value ((A w’) [ w ]))  Γ ⊢ value (∀5 A [ w ]) wpair : ∀ {A w}  (w’ : World)  Γ ⊢ value ((A w’) [ w ])  Γ ⊢ value ((∃5 A) [ w ]) sham : ∀ {A w’}  ((w : _)  Γ ⊢ value (A w [ w ]))  Γ ⊢ value ( A [ w’ ]) w} (A ⇀ B [ w ]) (A [ w ]) (B [ w ]) wapp : ∀ {A w}  Γ ⊢ exp (∀5 A [ w ])  (w’ : World)  Γ ⊢ exp ((A w’) [ w ]) case : ∀ {A B C  Γ ⊢ exp (A  (Γ „ value  (Γ „ value  Γ ⊢ exp (C w} ∨ B [ w ]) (A [ w ]) ⊢ exp (C [ w ])) (B [ w ]) ⊢ exp (C [ w ])) [ w ]) wunpack : ∀ {A w C}  Γ ⊢ exp ((∃5 A) [ w ])  ((w’ : _)  Γ „ value ((A w’) [ w ]) ⊢ exp (C [ w ]))  Γ ⊢ exp (C [ w ]) leta : ∀ {A w w’ C}  Γ ⊢ exp ((A at w’) [ w ])  (Γ „ value (A [ w’ ]) ⊢ exp (C [ w ]))  Γ ⊢ exp (C [ w ]) ––- expressions val : ∀ {L}  Γ ⊢ value L  Γ ⊢ exp L lets : ∀ {A w C}  Γ ⊢ exp ( A [ w ])  (Γ „ valid A ⊢ exp (C [ w ]))  Γ ⊢ exp (C [ w ]) Figure 1: ML5 Static Semantics D. Licata & R. Harper 79 A simple induction verifies that mobile ML5 types translate to constant HL5 types: eff-mobile : ∀ {A}  Mobile5 A  Constant (eff A) 5.2 Term translation Next, we interpret hypotheses and conclusions. Values and expressions are interpreted as described above (note that for L = A [ w ], fst L = A and snd L = w). A valid hypothesis is interpreted as the Agda set (w : World)  (interp-hyp (value (A w [ w ]))), though to appease the termination checker we have to unroll the definiton of interp-hyp. interp-hyp : Hyp  Set interp-hyp (value L) = (eff (fst L)) < (snd L) > interp-hyp (valid A) = (w : World)  (eff (A w)) < w > interp-conc : Conc  Set interp-conc (value L) = interp-hyp (value L) interp-conc (exp L) = ( (eff (fst L))) < (snd L) > Next, we interpret the syntax (Figure 2). The Agda type Everywhere P xs represents a list with one element of type P x for each element x in xs; we use this to represent a substitution of semantic values for syntactic variables. The usual propositional connectives are interpreted in the standard way, by sequencing evaluation if necessary and then applying the corresponding Agda introduction or elimination form. Subexpressions that are under bound variables are interpreted in an extended context (e.g. e in lam e). ListM.EW.there looks up a de Bruijn index into Γ in a substitution of type Everywhere P Γ. sham is interpreted as an Agda function, which is applied in the translation of the ⊲v rule for using valid variables. There are no Agda term constructors for at, so the translation simply proceeds inductively. The quantifiers are interpreted by supplying the world arguments in the syntax, rather than by extending the substitution (recall that the proof terms wlam and wunpack contain Agda functions). Recall that the body of wlam is already a value, so no further evaluation is necessary. val and lete are interpreted directly as return and bind. get5 is translated as a get in the target, followed by a coercion by the mobility proof. put e extends the substitution with the value of e, applying the mobility proof to the value so it can be used at any other world. Agda verifies that the interpretation is type correct and total, establishing that the interpretation is total and type-preserving. 6 Revised ML5 In this section, we simplify and generalize the ML5 source language based on the above semantics. First, our analysis has shown that Mobile5 A really means that A [ w ] and A [ w’ ] are equal types for any w and w’. We can internalize this principle as a value coercion vshift in Figure 3. This makes it possible to implement some additional programs without communication. For example, consider a function move : ∀ {A w w’}  Mobile5 A  move m = (get5 (val (⊲ i0)) m) (value (A [ w ]) :: []) ⊢ exp (A [ w’ ]) Operationally, this is quite inefficient: it sends the value of the variable from w’ to w, as the environment of the val (⊲ i0) closure, and w then returns this value back to w’. This whole process is unnecessary, A Monadic Formalization of ML5 80 eval : ∀ {Γ L}  Γ ⊢ L  Everywhere interp-hyp Γ  interp-conc L –– usual connectives eval (⊲ x) σ = (ListM.EW.there σ x) eval (lam e) σ = λ x  eval e (x E:: σ ) eval (app e1 e2) σ = (eval e1 σ ) »= λ f  (eval e2 σ ) »= λ a  f a eval (inl v) σ = Inl (eval v σ ) eval (inr v) σ = Inr (eval v σ ) eval (case e e1 e2) σ = eval e σ »= docase where docase : Either _ _  _ docase (Inl x) = eval e1 (x E:: σ ) docase (Inr y) = eval e2 (y E:: σ ) –– eval (⊲v{w} x Refl) σ = (ListM.EW.there σ x) w eval (sham v) σ = λ w’  (eval (v w’) σ ) eval (lets e e’) σ = eval e σ »= λ x  eval e’ (x E:: σ ) –– at eval (hold v) σ = eval v σ eval (leta e e’) σ = eval e σ »= λ x  eval e’ (x E:: σ ) –– ∀ and ∃ eval (wlam v) σ = λ w  eval (v w) σ eval (wapp e w) σ = eval e σ »= λ f  return (f w) eval (wpair w v) σ = w , eval v σ eval (wunpack e e’) σ = eval e σ »= λ p  eval (e’ (fst p)) (snd p E:: σ ) –- monad operations and world movement eval (val v) σ = return (eval v σ ) eval (lete e1 e2) σ = eval e1 σ »= λ x  eval e2 (x E:: σ ) eval (get5{A} e mob) σ = get (eval e σ ) »= λ v  return (coerce (eff-mobile mob) v) eval (put e mob e’) σ = eval e σ »= λ v  eval e’ ((λ w’ -> coerce (eff-mobile mob) v) E:: σ ) Figure 2: Interpretation of the syntax as the value was available at w’ to begin with! However, it does not seem possible to implement this function without communication in ML5. In our revised ML5, as in HL5, it can be implemented as a simple type coercion: move : ∀ {A w w’}  Mobile5 A move m = val (vshift (⊲ i0) m)  (value (A [ w ]) :: []) ⊢ exp (A [ w’ ]) Second, in HL5, the worlding of values always "gets out of the way" because it commutes with type constructors down to ref and . In Figure 3, we add these non-local elimination rules for values of each connective to the source. For example, we add the untethered case rule for values of sum type and a projective elimination rule for at and ∀5 values. We could additionally add elimination rules like case, split, etc. to the syntactic class of "values"— i.e. we could admit that we are really dealing with a syntactic class of pure terms: casev/val : ∀ {A B C w’ w}  Γ ⊢ value (A ∨ B [ w ])  (Γ „ value (A [ w ]) ⊢ val (C [ w’ ]))  (Γ „ value (B [ w ]) ⊢ val (C [ w’ ]))  Γ ⊢ val (C [ w’ ]) However, in an operational semantics where worlds and types are erased at run-time, wappv and unatv will not create any real redexes at run-time, whereas casev/val will. Thus a reasonable design choice D. Licata & R. Harper 81 New value rules: vshift : ∀ {A w w’}  Γ ⊢ value (A [ w ])  Mobile5 A  Γ ⊢ value (A [ w’ ]) wappv : ∀ {A w}  Γ ⊢ value (∀5 A [ w ])  (w’ : World)  Γ ⊢ value ((A w’) [ w ]) unatv : ∀ {A w w’}  Γ ⊢ value ((A at w’) [ w ])  Γ ⊢ value (A [ w’ ]) New expression rules: casev : ∀ {A B L w}  Γ ⊢ value (A ∨ B [ w ])  (Γ „ value (A [ w ]) ⊢ exp L)  (Γ „ value (B [ w ]) ⊢ exp L)  Γ ⊢ exp L wunpackv : ∀ {A w L}  Γ ⊢ value ((∃5 A) [ w ])  ((w’ : _)  Γ „ value ((A w’) [ w ]) ⊢ exp L)  Γ ⊢ exp L Remove rules put, ⊲v, lets, sham, wapp, leta, case, wunpack. Figure 3: Revised ML5 for ML5 would be to allow wappv and unatv but not the corresponding case rule. It is simple to extend the semantics to these new constructs, as they were derived from it: eval (vshift e m) σ = coerce (eff-mobile m) (eval e σ ) eval (wappv e w’) σ = eval e σ w’ eval (unatv e ) σ = eval e σ eval (casev v e1 e2) σ = docase (eval v σ ) where docase : Either _ _  _ docase (Inl x) = eval e1 (x E:: σ ) docase (Inr y) = eval e2 (y E:: σ ) eval (wunpackv v e’) σ = let p = eval v σ in eval (e’ (fst p)) (snd p E:: σ ) Derived Forms Once we have added the aforementioned rules, we can remove rules put, ⊲v, lets, sham, wapp, leta, case, wunpack, which become derivable. Shamrock is defined using ∀5 and at in the straightforward way: A = ∀5 (λ w  A w at w). Validity is defined as a value assumption of shamrock type: valid A = value (( A) [ dummy ]), where dummy is any arbitrary world— A is mobile, and therefore constant, but because all value assumptions are worlded, we must pick one. The term ⊲v, which represents a use of a valid hypothesis, is derived by eliminating a shamrock. The term put is derived by introducing a shamrock, using vshift to retype the assumption in the body—we use letv to refer to the substitution principle plugging a value in for a variable, and we use weaken for weakening in the de Bruijn syntax. ⊲v : ∀ {Γ A C w}  valid A ∈ Γ  ⊲v i Refl = unatv (wappv (⊲ i) _) Id C (A w)  Γ ⊢ value (C [ w ]) put : ∀ {Γ A C w}  Γ ⊢ exp (A [ w ])  Mobile5 A  (Γ „ valid (\ _  A)) ⊢ exp (C [ w ])  Γ ⊢ exp (C [ w ]) put e m e’ = lete e (letv (wlam (\ w’  hold (vshift (⊲ i0) m))) (weaken (extend⊆ iS) e’)) The remaining derivabilities show that the old rules for the connectives are derivable using the new ones. 7 Related Work Murphy [23] describes ML5 and related languages, such as work by Jia and Walker [19]. A Monadic Formalization of ML5 82 Altenkirch and McBride [3], Benke et al. [9], Chlipala [12], Crary [14] describe other uses of universes and semantic embeddings in type theory, though they do not consider embedding a modal type system. We have used the same technique for embedding a hybrid type system in Agda in previous work [20]. Our technique is quite similar to that of Allen [2], who defines modal types as display forms for NuPRL types. The technical difference is that Allen considers the modal types simply as notation, whereas in our approach the modal types are data, equipped with a translation to meta-language types. This shows how to achieve similar convenience of notation, without requiring separate display-form facilities. Avron et al. [8] consider representations of modal logics in LF [18], some of which use worldindexed judgements to track scoping. We also use a world-indexed type family A < w >, but this relation is defined semantically (by interpretation into Agda) rather than syntactically (by inference rules). At the core, our interpretation reduces ML5 to L5, a language with an indexed monad IO w A of computations at a place. Indexed monads have been studied in a variety of previous work, including Abadi et al. [1], Atkey [6], Nanevski et al. [24], Russo et al. [27]. However, to interpret ML5, we require the programming language to provide quantification over the indices to the monad, which DCC [1], for example, does not provide. It would be interesting to adapt our work to these other settings, using a modal logic to manage the indices to the monad. 8 Conclusion While we have used Agda for our development, we conjecture that the work described in this paper could be carried out with similar effort in Coq [13], as we have not used very complicated dependent pattern matching. However, in future work we would like to embed proof-based access control following PCML5 [7], which will require a modal universe with dependent types. Dependently typed universes are easiest to represent using induction-recursion [17], which Agda supports but Coq does not. In future work, we also plan to complete a proof that the operational semantics of ML5 are sound for the denotational semantics. We have formalized the operational semantics of λ5 and an operational semantics for computations. We have also proved soundness, assuming a standard compositionality lemma (substitution of interpretations is the interpretation of the substitution), which we are in the process of formalizing. β -reduction in Agda validates the β -steps for functions, sums, etc. in the source. Because compositionality is really a property only of the binding structure of the language and the semantics, not of the particular language constructs, it should be possible to implement compositionality in a datatypegeneric manner, as in Chlipala [12]. We also leave the question of full abstraction to future work. Acknowledgements We thank Jason Reed and Rob Simmons for discussions about this article, and the anonymous reviewers for their helpful comments. References [1] M. Abadi, A. Banerjee, N. Heintze, and J. G. Riecke. A core calculus of dependency. In Proc. 26th ACM Symp. on Principles of Programming Languages (POPL, pages 147–160. ACM Press, 1999. [2] S. F. Allen. From dy/dx to []P: A matter of notation. In Proceedings of the Conference on User Interfaces for Theorem Provers, 1998. [3] T. Altenkirch and C. McBride. Generic programming within dependently typed programming. In IFIP TC2 Working Conference on Generic Programming, Schloss Dagstuhl, 2003. [4] T. Altenkirch, C. McBride, and W. Swierstra. Observational equality, now! In Programming Languages meets Program Verification Workshop, 2007. D. Licata & R. Harper 83 [5] C. Areces, P. Blackburn, and M. Marx. Hybrid logics: Characterization, interpolation and complexity. Journal of Symbolic Logic, 66(3):977–1010, 2001. [6] R. Atkey. Parameterised notions of computation. Journal of Functional Programming, 19(3–4):335–376, 2009. [7] K. Avijit, A. Datta, and R. Harper. Distributed programming with distributed authorization. In ACM SIGPLAN-SIGACT Symposium on Types in Language Design and Implementation, 2010. [8] A. Avron, F. Honsell, M. Miculan, and C. Paravano. Encoding modal logics in logical frameworks. Studia Logica, 60(1):161–208, 1998. [9] M. Benke, P. Dybjer, and P. Jansson. Universes for generic programs and proofs in dependent type theory. Nordic Journal of Computing, 10(4):265–289, 2003. [10] P. Benton, G. M. Bierman, and V. C. V. D. Paiva. Computational types from a logical perspective. Journal of Functional Programming, 8(2):177–193, 1998. [11] A. Bucalo, M. Hofmann, F. Honsell, M. Miculan, and I. Scagnetto. Consistency of the theory of contexts. Journal of Functional Programming, 16(3):327–395, May 2006. [12] A. Chlipala. A certified type-preserving compiler from λ -calculus to assembly language. In ACM SIGPLAN Conference on Programming Language Design and Implementation, 2007. [13] Coq Development Team. The Coq Proof Assistant Reference Manual. INRIA, 2007. Available from http://coq.inria.fr/. [14] K. Crary. Type Theoretic Methodology for Practical Programming Languages. PhD thesis, Cornell University, 1998. [15] H. Curry. The elimination theorem when modality is present. Journal of Symbolic Logic, 17:249–265, 1952. [16] J. Despeyroux, A. Felty, and A. Hirschowitz. Higher-order abstract syntax in Coq. In M. Dezani-Ciancaglini and G. Plotkin, editors, International Conference on Typed Lambda Calculi and Applications, volume 902 of Lecture Notes in Computer Science, pages 124–138, Edinburgh, Scotland, 1995. Springer-Verlag. [17] P. Dybjer and A. Setzer. Indexed induction-recursion. In Proof Theory in Computer Science, pages 93–113. Springer, 2001. [18] R. Harper, F. Honsell, and G. Plotkin. A framework for defining logics. Journal of the Association for Computing Machinery, 40(1), 1993. [19] L. Jia and D. Walker. Modal proofs as distributed programs. In European Symposium on Programming, volume 2986 of Lecture Notes in Computer Science. Springer, April 2004. [20] D. R. Licata and R. Harper. A universe of binding and computation. In ACM SIGPLAN International Conference on Functional Programming, 2009. [21] E. Moggi. Notions of computation and monads. Information And Computation, 93(1), 1991. [22] J. Morgenstern and D. R. Licata. Security-typed programming within dependently-typed programming. Available from http://www.cs.cmu.edu/~drl, April 2010. [23] T. Murphy, VII. Modal Types for Mobile Code. PhD thesis, Carnegie Mellon, January 2008. Available as technical report CMU-CS-08-126. [24] A. Nanevski, G. Morrisett, and L. Birkedal. Polymorphism and separation in Hoare Type Theory. In ACM SIGPLAN International Conference on Functional Programming, pages 62–73, Portland, Oregon, 2006. [25] U. Norell. Towards a practical programming language based on dependent type theory. PhD thesis, Chalmers University of Technology, 2007. [26] F. Pfenning and C. Schürmann. System description: Twelf - a meta-logical framework for deductive systems. In H. Ganzinger, editor, International Conference on Automated Deduction, pages 202–206, 1999. [27] A. Russo, K. Claessen, and J. Hughes. A library for light-weight information-flow security in Haskell. In ACM SIGPLAN Symposium on Haskell, pages 13–24. ACM, 2008. [28] A. Simpson. The Proof Theory and Semantics of Intuitionistic Modal Logic. PhD thesis, University of Edinburgh, 1993.
6cs.PL
arXiv:1609.08311v1 [math.GR] 27 Sep 2016 A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM PAUL FLAVELL Abstract. The Signalizer Functor Method as developed by Gorenstein and Walter played a fundamental role in the first proof of the Classification of the Finite Simple Groups. It plays a similar role in the new proof of the Classification in the Gorenstein-Lyons-Solomon book series. The key results are Glauberman’s Solvable Signalizer Functor Theorem and McBride’s Nonsolvable Signalizer Functor Theorem. Given their fundamental role, it is desirable to have new and different proofs of them. This is accomplished in A new proof of the Solvable Signalizer Functor Theorem, P. Flavell, J. Algebra, 398 (2014) 350–363 for Glauberman’s Theorem. The purpose of this paper is to give a new proof of McBride’s Theorem. 1. Introduction The Signalizer Functor Method as developed by Gorenstein and Walter played a fundamental role in the first proof of the Classification of the Finite Simple Groups. It plays a similar role in the new proof of the Classification in the Gorenstein-LyonsSolomon book series [11]. A discussion of the method may be found in [1, 11, 12, 13]. The key results being Glauberman’s Solvable Signalizer Functor Theorem [10] and McBride’s Nonsolvable Signalizer Functor Theorem [15, 16]. They are taken as background results in the Gorenstein-Lyons-Solomon project and not reproved there. Given their fundamental role, it is desirable to have new and different proofs. This is accomplished in [3] for Glauberman’s Theorem. The purpose of this paper is to give a new proof of McBride’s Theorem. We have taken the liberty of combining the theorems of Glauberman and McBride into a single result. We shall prove: The Signalizer Functor Theorem. Let A be a finite abelian group of rank at least 3 that acts on the group G. Let θ be an A-signalizer functor on G and assume that θ(a) is a K-group for all a ∈ A# . Then θ is complete. Moreover, the composition factors of the completion of θ are to be found amongst the composition factors of the subgroups θ(a); a ∈ A# . Recall that by definition, θ ia a mapping that assigns to each a ∈ A# a finite A-invariant subgroup θ(a) of CG (a) with order coprime to | A | that satisfies θ(a) ∩ CG (b) ≤ θ(b) 2010 Mathematics Subject Classification. TO DO Primary 20D45 20D05 20E34 . A considerable portion of this research was done whilst the author was in receipt of a Leverhulme Research Project grant and during visits to the Mathematisches Seminar, ChristianAlbrechts-Universität, Kiel, Germany. The author expresses his thanks to the Leverhulme Trust for their support and to the Mathematisches Seminar for its hospitality. 1 2 PAUL FLAVELL for all a, b ∈ A# . Note that G is not assumed to be finite. To say that θ is complete means there exists a finite A-invariant subgroup K, of order coprime to | A |, such that θ(a) = CK (a) for all a ∈ A# . In particular, the subgroup generated by the subgroups θ(a) is finite with order coprime to | A |. An exposition of elementary signalizer functor theory may be found in [3]. Recall also that a K-group is a finite group all of whose simple sections are known simple groups. The K-group assumption indicates that some portions of the argument rely on properties of simple groups that are established by taxonomy. The main application of the Signalizer Functor Theorem is to construct large subgroups in a minimal counterexample to the Classification Theorem. Thus, whilst not ideal, the K-group assumption causes no difficulty. The proof of McBride’s Theorem presented here is very different from the original. It is based on the author’s proof of Glauberman’s Theorem and a general theory of automorphisms of finite groups as developed in [6, 7, 8, 9]. We prefer the view that the Signalizer Functor Theorem is not a single isolated result but rather one of the high points of a well developed theory of automorphisms of finite groups. Indeed, although much of the material in [6, 7, 8, 9] was motivated by the present work, it has been developed in much greater depth and generality than is required for the proof of the Signalizer Functor Theorem. Sections §2,. . . ,§7 consist mainly of statements of the general theory required and in §8, the proof begins. The author would like to thank Professor George Glauberman for his careful reading of an earlier version of this manuscript. 2. Preliminaries The reader is assumed to be familiar with elementary signalizer functor theory, see for example [3] or [14]. An understanding of the author’s proof of the Solvable Signalizer Functor Theorem [3] would be advantageous. Unless stated otherwise, the word group will mean finite group. The reader is assumed to be familiar with the notions of the Fitting subgroup, the set of components, the layer and the generalized Fitting subgroup of a group G denoted by F (G), comp(G), E(G) and F ∗ (G) respectively. See for example [14]. The notation sol(G) is used to denote the largest normal solvable subgroup of G. We will need a number of variations of the notion of component as developed in [6]. Definition 2.1. A sol-component of G is a perfect subnormal subgroup of G that maps onto a component of G/ sol(G). The set of sol-components of G is denoted by compsol (G) and we define Esol (G) = h compsol (G) i and O∗ (G) = sol(G)Esol (G). Lemma 2.2. Let G be a group. (a) The sol-components of G are the minimal nonsolvable subnormal subgroups of G. A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 3 (b) Set G = G/ sol(G). The map K 7→ K is a bijection compsol (G) −→ comp(G). (c) If K ∈ compsol (G) and N E E G then K ≤ N or N ≤ NG (K). (d) Distinct sol-components of G normalize each other and commute modulo sol(G). (e) If K ∈ compsol (G) then K E O∗ (G). (f) (McBride) If H satisfies O∗ (G) ≤ H ≤ G then O∗ (G) = O∗ (H). Proof. (a),. . . ,(e) are well known and elementary, see for example [6, Lemma 3.2]. For (f) see [15, Lemma 2.15] or [6, Lemma 8.2].  Next we bring in a group of automorphisms. Definition 2.3. Let the group A act on the group G. (a) G is A-simple if G is nonabelian and the only A-invariant normal subgroups of G are 1 and G. (b) G is A-quasisimple of G is perfect and G/Z(G) is A-simple. (c) An A-component of G is the subgroup generated by an orbit of A on comp(G). The set of A-components of G is denoted by compA (G). (d) An (A, sol)-component of G is the subgroup generated by an orbit of A on compsol (G). The set of (A, sol)-components of G is denoted by compA,sol (G). The A-components of G are the subnormal A-quasisimple subgroups of G. The (A, sol)-components of G are the minimal nonsolvable A-invariant subnormal subgroups of G. A result exactly analogous to Lemma 2.2 holds for (A, sol)-components. Recall that a group X is semisimple if X = E(X) and constrained if CX (F (X)) ≤ F (X). Then any (A, sol)-component of G is either semisimple or constrained. The group A acts coprimely on the group G if A acts on G; the orders of A and G are coprime; and A or G is solvable. If p is a prime then we denote by Sylp (G; A) the set of maximal A-invariant p-subgroups of G with respect to inclusion. Theorem 2.4 (Coprime Action). Suppose the group A acts coprimely on the group G. (a) Let p be a prime. Then Sylp (G; A) ⊆ Sylp (G) and CG (A) acts transitively by conjugation on Sylp (G; A). (b) Let N be an A-invariant normal subgroup of G and set G = G/N . Then CG (A) = CG (A). (c) G = [G, A]CG (A) and [G, A] = [G, A, A]. (d) Suppose A is elementary and noncyclic. Then G = h CG (B) | B ∈ Hyp(A) i = h CG (a) | a ∈ A# i. Moreover if T ≤ A then [G, T ] = h [CG (B), T ] | B ∈ Hyp(A) i = h [CG (a), T ] | a ∈ A# i. (e) If G = XY where X and Y are A-invariant subgroups of G then CG (A) = CX (A)CY (A). 4 PAUL FLAVELL (f) Suppose K E E G and [K, A] = [CG (K), A] = 1. Then [G, A] = 1. (g) If [F ∗ (G), A] = 1 then [G, A] = 1. (h) Suppose that G is p-solvable for some prime p and that A centralizes a Sylow p-subgroup of G. Then [G, A] ≤ Op′ (G). (i) Suppose that G is a p-group for some prime p; that A centralizes every characteristic abelian subgroup of G and that G = [G, A]. Then G′ = Φ(G) = Z(G) = CG (A). Proof. For (a),(b),(c),(e) see [14, p.184–187]. (d) is [17, p.484]. (f). By induction, we may suppose K E G. Then [G, A, A] ≤ [CG (K), A] = 1. Apply (c). (g). Since CG (F ∗ (G)) = Z(F (G)), this follows from (f). (h). Set G = G/Op′ (G) so F ∗ (G) = Op (G). Then [F ∗ (G), A] = 1. Apply (g). (i). This is well known, see [5, Corollary 3.3] for example.  Note that (a) implies that for each prime p, G possesses a unique maximal ACG (A)invariant p-subgroup, namely the intersection of the members of Sylp (G; A). Definition 2.5. Suppose that group A acts coprimely on the group G. Let p be a prime. Then Op (G; A) is the intersection of all the A-invariant p-subgroups of G. Finally, we collect together some more specialized results. Lemma 2.6. Let R be an elementary abelian r-group that acts coprimely on the K-group X. (a) Op (X; R)′ ≤ sol(X) for all primes p. (b) Suppose R is noncyclic. Then \ sol(CX (b)) ≤ sol(X). b∈R# (c) Suppose R is cyclic, X = [X, R], t is a prime and RX acts on the t-group T with CT (R) = 1. Set X = X/CX (T ). Then π(X) ⊆ { 2, t } and X/Ot (X) is either trivial or a nonabelian 2-group. Proof. (a). This is [8, Theorem 3.1(c)]. (b). Because if H is a simple K-group with order coprime to r then the Sylow r-subgroups of Aut(K) are cyclic. (c). This reduces to the case where T is elementary abelian and RX acts nontrivially and irreducibly on T . [6, Theorem 7.1] implies X is a special 2-group.  3. A-simple groups In the proof of the Signalizer Functor Theorem presented here, much of the argument concerns A-components. Consequently it is necessary to have an understanding of A-simple groups. Throughout this section, r is a prime and A 6= 1 is an elementary abelian r-group. Theorem 3.1. Suppose that A acts faithfully and coprimely on the K-group K and that K is A-simple. A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 5 (a) K = K1 × · · · × Kn where { K1 , . . . , Kn } is a collection of simple subgroups of K that is permuted transitively by A. Define A∞ = ker A −→ Sym({ K1 , . . . , Kn }). (b) | A∞ | = 1 or r. (c) Let a ∈ A \ A∞ . Then CK (a) is a maximal ACK (A)-invariant proper subgroup of K. It is A-simple and has | A |/r| A∞ | components, each of which is normalized by A∞ . Moreover CA (CK (a)) = h a i. ∗ (d) Let a ∈ A# ∞ . Then either CK (a) is solvable or F (CK (a)) is A-simple. In ∗ the latter case, CK (a)/F (CK (a)) is abelian. (e) Assume that CK (A) is solvable. (i) | A∞ | = r and K1 is isomorphic to L2 (2r ), L2 (3r ), U3 (2r ) or Sz(2r ). (ii) K possesses a unique maximal ACK (A)-invariant solvable subgroup S. (iii) CK (A∞ ) ≤ S and S is maximal subject to being an ACK (A)-invariant proper subgroup of K. (f) Assume that CK (A) is nonsolvable. (i) F ∗ (CK (A)) is simple and CK (A)/F ∗ (CK (A)) is cyclic. (ii) K does not possess a nontrivial ACK (A)-invariant solvable subgroup. Proof. See [6, §6].  We note in particular that if a ∈ A# then either F ∗ (CK (a)) is A-simple or CK (a) is solvable. By (d), the following balance property holds, for all a, b ∈ A# E(E(CK (a)) ∩ CK (b)) ≤ E(CK (b)). These properties characterize K and the collection { CK (a) | a ∈ A# } of fixed point subgroups. It is convenient to state this characterization in the language of signalizer functor theory. Theorem 3.2 (Characterization of A-Simple Groups [9]). Suppose that rank(A) ≥ 3 and that A acts on the (possibly infinite) group G. Assume the following: (i) θ is an A-signalizer functor on G. (ii) θ(a) is a K-group for all a ∈ A# . (iii) If a ∈ A# with E(θ(a)) 6= 1 then E(θ(a)) is A-simple, F (θ(a)) = 1 and CA (E(θ(a))) = h a i. (iv) For all a, b ∈ A# , E(E(θ(a)) ∩ CG (b)) ≤ E(θ(b)). (v) G = h E(θ(a)) | a ∈ A# i 6= 1. Then G is a finite r′ -group, it is A-simple, a K-group and θ(a) = CG (a) # for all a ∈ A . In particular θ is complete and G is its completion. We close this section with three results on A-quasisimple groups. Definition 3.3. Whenever K is an A-quasisimple group define  CK (A) if CK (A) is solvable ∗ CK (A) = E(CK (A)) if CK (A) is nonsolvable. 6 PAUL FLAVELL Lemma 3.4. Suppose that K is an A-quasisimple K-group on which A acts coprimely. ∗ (a) CK (A) is nonabelian. (b) Suppose that H is an ACK (A)-invariant nonsolvable subgroup of K. Then ∗ ∗ H (∞) = E(H) is A-quasisimple and CE(H) (A) = CK (A). Proof. Set K = K/Z(K), so K is A-simple. Coprime Action(b) implies CK (A) = CK (A). Write K = K 1 × · · · × K n where { K 1 , . . . , K n } is a collection of simple subgroups of K that is permuted transitively by A. Set A∞ = ker A −→ Sym({ K 1 , . . . , K n }). Recall that if X is a group and Z ≤ Z(X) then E(X) maps onto E(X/Z). (a). If A∞ = CA (K) then [6, Lemma 6.5] implies CK (A) ∼ = K 1 , so CK (A) is simple. If A∞ 6≤ CA (K) then [6, Lemma 6.5] implies CK (A) ∼ = CK 1 (A∞ ) and then [6, Theorem 4.1] implies F ∗ (CK 1 (A∞ )) is simple or CK 1 (A∞ ) is solvable ∗ and nonabelian. Since E(CK (A)) maps onto E(CK (A)) it follows that CK (A) is nonabelian. (b). Recall from [6] that H is overdiagonal if H projects onto each K i . In the contrary case, H is underdiagonal. Suppose that H is overdiagonal. [6, Lemma 6.6] implies H = CK (B)(H ∩ Z(K)) for some B ≤ A with B ∩ A∞ = CA (K). Then [6, Lemma 6.5] implies CK (B) is A-quasisimple. Consequently H (∞) = E(H) = CK (B) and as B ≤ A we have CE(H) (A) = CK (A) and the conclusion holds in this case. Hence we may assume that H is underdiagonal. If K possesses a nontrivial ACK (A)-invariant solvable subgroup then all ACK (A)invariant underdiagonal subgroups are solvable by [6, Lemma 6.7]. Thus K possesses no such subgroup. In particular, CK (A) is nonsolvable, whence F ∗ (CK (A)) is simple. Also, F (H) = 1 so we may choose H 0 ∈ compA (H). Since H 0 is nonsolvable, [6, Theorem 4.4] implies CH 0 (A) 6= 1. Now CH 0 (A) E E CK (A) whence F ∗ (CH 0 (A)) = F ∗ (CK (A)) and H 0 is uniquely determined. Then E(H) = H 0 and E(H) is A-simple. Now F ∗ (CK (A)) ≤ E(H). Recall that CK (A)/F ∗ (CK (A)) is cyclic. Consequently CH/E(H) (A) is cyclic so [6, Theorem 4.4] implies H/E(H) is solvable. We have shown that H (∞) = E(H) is A-simple and E(CE(H) (A)) = E(CK (A)) 6= 1. Then H (∞) Z(K) = E(H)Z(K) so taking the derived group yields H (∞) = E(H). Similarly E(CE(H) (A)) = E(CK (A)), completing the proof.  Lemma 3.5 ([6, Lemma 6.12]). Suppose A acts coprimely on the A-quasisimple group K. (a) If A is noncyclic then K = h CK (D) | D ∈ Hyp(A) and CK (d) is A-quasisimple for all d ∈ D# i. (b) If D ∈ Hyp(A) and D is noncyclic then K = h CK (d) | d ∈ D# and CK (d) is A-quasisimple i. Lemma 3.6 ([6, Theorem 4.4(c)]). Suppose A acts coprimely on the K-group G and that K ∈ compA (G). Then CG (CK (A)) = CG (K). A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 7 4. Automorphisms Throughout this section we assume: Hypothesis 4.1. • r is a prime and A 6= 1 is an elementary abelian r-group. • A acts coprimely on the K-group G. • a ∈ A# . • H is an ACG (a)-invariant subgroup of G. The following result relates the structure of H to the structure of G in the case that G is solvable. Theorem 4.2. Assume that G is solvable and H = [H, a]. (a) Let p be a prime. Then Op (H) ≤ Op (G) or all of the following hold: p = 2, r is Fermat and the Sylow 2-subgroups of H are nonabelian. (b) O2 (O2 (H)) ≤ O2 (G). This result is fundamental to the author’s proof of the Solvable Signalizer Functor Theorem. It is a consequence of well known results on the representation theory of solvable groups. See [5, Corollary 5.2] for example. To deal with nonsolvable signalizer functors, it is necessary to have analogous results for nonsolvable groups. Theorem 4.3. (a) Suppose K ∈ compA,sol (H) and K = [K, a]. Then K ∈ compA,sol (G). (b) [O∗ (H), a](∞) E O∗ (G). Proof. (a). This is [7, Theorem 7.5(a)]. (b). Note that if K ∈ compA,sol (H) then either [K, a] ≤ sol(K) ≤ sol(H) or K = [K, a]. Then [O∗ (H), a](∞) = h K ∈ compA,sol (H) | K = [K, a] i. Apply (a).  e with Theorem 4.4. Suppose K ∈ compA (H). Then there exists K e ∈ compA,sol (G). K ≤K Moreover: e (a) If [K, a] 6= 1 then K = [K, a] = K. (b) If [K, a] = 1 then K = E(CKe (a)). e is constrained. Then [K, a] = 1 and (c) Suppose K e = K sol(K). e K e = h K, C e (b) i. Moreover if b ∈ A \ CA (K) then K sol(K) (d) Let L ∈ compA,sol (G). Assume e L] = 1. Then [K, e and L = [L, a]. L 6= K Proof. This is [6, Theorem 9.8] except for the final assertion in (c) which is [6, Lemma 8.2].  8 PAUL FLAVELL e = KF (K), e Remark. In the constrained case, it is in fact possible to show that K but we do not need this stronger result. Recall that distinct A-components of G commute. This fact is very useful. However, the same is not necessarily true of (A, sol)-components. (d) circumvents this difficulty. 5. P-subgroups Throughout this section, we assume: Hypothesis 5.1. • r is a prime and A 6= 1 is an elementary abelian r-group. • P is a group theoretic property that is closed under subgroups, quotients and extensions. Definition 5.2. Suppose A acts on the group G. OP (G) = h X | X is an A-invariant normal P-subgroup of G i. OP (G; A) = h X | X is an ACG (A)-invariant P-subgroup of G i. It is clear that OP (G) is itself a P-group and is thus the unique maximal normal P-subgroup of G. The following is less clear: Theorem 5.3 ([7, Theorem 5.2]). Suppose A acts coprimely on the K-group G. Then OP (G; A) is a P-group. In other words, G possesses a unique maximal ACG (A)-invariant P-subgroup. A useful corollary is the following: Corollary 5.4. Assume the hypotheses of Theorem 5.3. Suppose that N is an A-invariant subnormal subgroup of G. Then OP (N ; A) = OP (G; A) ∩ N. Proof. Consider first the case that N E G. Then OP (G; A) ∩ N is an ACN (A)invariant P-subgroup of N so OP (G; A) ∩ N ≤ OP (N ; A). Now CN (A) E CG (A) so it follows that CG (A) permutes the ACN (A)-invariant P-subgroups of N . Then CG (A) normalizes OP (N ; A). Theorem 5.3 implies OP (N ; A) is a P-subgroup so OP (N ; A) ≤ OP (G; A) and the result follows in this case. Suppose that N is not normal in G. Set G0 = h N G i. Since N is a proper subnormal subgroup of G it follows that G0 is a proper A-invariant normal subgroup of G. Apply the previous case and induction.  The main result of this section is the following: Theorem 5.5. Suppose A acts on the (possibly infinite) group G and that θ is an A-signalizer functor on G. Assume that θ(a) is a K-group for all a ∈ A# . Define θP by θP (a) = OP (θ(a); A). (a) θP is an A-signalizer functor on G. (b) Assume that A is noncyclic; that θP is complete; and that θP (G) is a Kgroup. Then θP (G) is the unique maximal θ(A)-invariant (P, θ)-subgroup of G. (A (P, θ)-subgroup is a θ-subgroup that is a P-group.) We also need the following: A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 9 Lemma 5.6. Suppose that A acts coprimely on the K-group G. Assume that A is noncyclic and that CG (a) is a P-group for all a ∈ A# . Then G is a P-group. Proof. Using Coprime Action(b) we may suppose that 1 and G are the only Ainvariant normal subgroups of G. Then G is characteristically simple. Suppose G is abelian. Then G is an elementary abelian p-group for some prime p. Coprime Action(d) implies CG (a) 6= 1 for some a ∈ A# . Since CG (a) is A-invariant and normal we have G = CG (a) so G is a P-group. Hence we may suppose that G is nonabelian. Then G = G1 × · · · × Gn where { G1 , . . . , Gn } is a collection of simple subgroups of G that is permuted transitively by A. Suppose that n > 1. Choose r−1 a ∈ A such that Ga1 6= G1 . Then { gg a · · · g a | g ∈ G1 } is a normal subgroup of CG (a) that is isomorphic to G1 . Then G1 is a P-group, whence G is also. Suppose that n = 1. Then G is a simple K-group. Consequently the Sylow r-subgroups of Aut(G) are cyclic so G = CG (a) for some a ∈ A# and G is a P-group.  Proof of Theorem 5.5. (a). Let a, b ∈ A# . Note that Cθ(a) (A) = θ(A) = Cθ(b) (A). Now θP (a) ∩ CG (b) ≤ θP (a) ∩ θ(b) ≤ θP (b), the first inclusion because θ is an A-signalizer functor and the second because θP (a) ∩ θ(b) is an Aθ(A)-invariant P-subgroup of θ(b). Hence θP is an A-signalizer functor. (b). Set K = θP (G). Since θP is complete, θP (a) = CK (a) for all a ∈ A# . Lemma 5.6 implies K is a P-group. Suppose L is a θ(A)-invariant (P, θ)-subgroup of G. If a ∈ A# then CL (a) is a θ(A)-invariant (P, θ)-subgroup of θ(a), whence CL (a) ≤ θP (a) ≤ K. Coprime Action(d) implies L ≤ K.  6. Bender’s Maximal Subgroup Theorem The aim of this section is to prove slight extension of a result of Bender [2, 1.7]. Bender’s result gave a criterion for two maximal subgroups M and N of a simple group to be equal. First we need some definitions. Definition 6.1. Suppose that M and N are finite subgroup of a (possibly infinite) group. • M is maximal with respect to N if NN (T ) ≤ M whenever 1 6= T char M with T ≤ M ∩ N . • M and N are comaximal if M is maximal with respect to N and N is maximal with respect to M . • M N means XCF ∗ (M) (X) ≤ N for some X E E F ∗ (M ). • If p is a prime then M has characteristic p if F ∗ (M ) = Op (M ). Theorem 6.2 (Bender’s Maximal Subgroup Theorem). Suppose that M and N are finite subgroups of a (possibly infinite) group, that M is maximal with respect to N and that M N. (a) E(M ) ≤ N and M ∩ Op (N ) = 1 for all p 6∈ π(F (M )). (b) Assume that E(M ) 6= 1 or | π(F (M )) | ≥ 2. Then Op (N ) ≤ M for all p ∈ π(F (M )). 10 PAUL FLAVELL (c) Assume in addition that N is maximal with respect to M and that (i) N M or (ii) E(N ) ≤ M and π(F (N )) ⊆ π(F (M )). Then M = N or M and N have characteristic p for some prime p. Proof. This is proved in [2, 1.7] under the assumption that M and N are maximal subgroups of a simple group. However, only the stated hypotheses are required.  The result stated below is used to handle the characteristic p case. Under the given hypotheses, it leads to the same conclusion. Theorem 6.3 ([8, Theorem A]). Let p be a prime and suppose M1 and M2 are finite subgroups of a (possibly infinite) group with the following properties: • M1 and M2 are comaximal. • M1 and M2 are K-groups with characteristic p. • For each i there is an elementary abelian group Ai that acts coprimely on Mi and Op (M1 ; A1 ) = Op (M2 ; A2 ). Then M1 = M2 . Unfortunately, at one point in the argument this result is not strong enough. However, the following result, provides the necessary extra leverage. Note that Theorem 6.3 is a trivial corollary. Theorem 6.4 ([8, Theorem 4.3]). Let p be a prime and suppose that M and S are subgroups of a group. Assume that: • M and S are finite K-groups with characteristic p. • M is maximal with respect to S. • There exist elementary abelian groups Am and As that act coprimely on M and S respectively and Op (M ; Am ) = Op (M ; As ). Set P = Op (M )Op (S). Then the following hold: (a) If Op (M ) is abelian then J(P ) = J(Op (M )). (b) J(P ) = J(Op (S)). Note that Op (M ) ≤ Op (M ; Am ) = Op (S; As ) ≤ S whence P is a p-group. 7. Elementary results A number of elementary results are presented. In particular, to any signalizer functor θ we associate a positive integer ||θ||. Note that the group G in the statement of the Signalizer Functor Theorem is not assumed to be finite. Hence this device is needed to enable inductive arguments. Throughout this section we assume the following: Hypothesis 7.1. • A is an noncyclic abelian group that acts on the (possibly infinite) group G. • θ is an A-signalizer functor on G. Lemma 7.2. Let B ≤ A be noncyclic and define a B-signalizer functor θ0 by θ0 (b) = θ(b) for all b ∈ B # . If θ0 is complete then so is θ and θ(G) = θ0 (G). A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 11 Proof. Let K = θ0 (G), so K is A-invariant and θ(b) = θ0 (b) = CK (b) for all b ∈ B # . Let a ∈ A# . Note that θ(a) ∩ CG (b) = CG (a) ∩ θ(b) for all b ∈ B # . Using Coprime Action(d) we have θ(a) = h θ(a) ∩ CG (b) | b ∈ B # i = h CG (a) ∩ θ(b) | b ∈ B # i = h CG (a) ∩ CK (b) | b ∈ B # i = CK (a). The conclusion follows.  Henceforth we assume in addition to Hypothesis 7.1 that A is an elementary abelian r-group for some prime r. Recall (see [3] for example) that if 1 6= B ≤ A then θ(B) is defined by \ θ(b). θ(B) = b∈B # Moreover if H is a θ-subgroup then CH (B) = H ∩ θ(B). Definition 7.3. ||θ|| = | θ(A) | Y | θ(B) : θ(A) |. B∈Hyp(A) Note that ||θ|| < ∞ since by the definition of signalizer functor, the subgroups θ(a) are finite. The definition is motivated by the following: Theorem 7.4 (The Wielandt Order Formula). Suppose that A acts coprimely on the group H. Then Y | CH (B) : CH (A) |. | H | = | CH (A) | B∈Hyp(A) Lemma 7.5. (a) Let ψ be a subfunctor of θ. Then ||ψ|| ≤ ||θ|| with equality if and only if ψ = θ. (b) Let H be a θ-subgroup of G. Then | H | ≤ ||θ|| with equality if and only if θ(a) ≤ H for all a ∈ A# . (c) If θ is complete then | θ(G) | = ||θ||. (d) Suppose that N is a normal θ-subgroup of G. Set G = G/N and define θ by θ(a) = θ(a) # for all a ∈ A . Then: (i) θ is an A-signalizer functor on G. (ii) θ(B) = θ(B) for all 1 6= B ≤ A. (iii) θ is complete if and only if θ is complete. (iv) ||θ|| ≤ ||θ|| with equality if and only if N = 1. (e) Let a ∈ A# . Then θ(a) = h θ(B) | a ∈ B ∈ Hyp(A) i. Proof. This follows from Coprime Action and the Wielandt Order Formula.  Finally we develop an idea of McBride that results in a fundamental dichotomy in the proof of the Signalizer Functor Theorem. Definition 7.6. 12 PAUL FLAVELL • θ is semisimple if 1 is the only θ(A)-invariant solvable θ-subgroup. • θ is nearsolvable if θ(A) is solvable and every composition factor of every proper θ-subgroup is isomorphic to L2 (2r ), L2 (3r ), U3 (2r ) or Sz(2r ). McBride’s idea was to separate out the nonsolvable pieces of θ from the solvable pieces. This is not possible – but it nearly is. The difficulty arises because the groups listed possess an automorphism of order r whose fixed point subgroup is solvable. The following result is [15, Theorem 6.6], a presentation of which may also be found in [7, Theorem 8.8]. Theorem 7.7 (McBride’s Dichotomy). Suppose that θ is a minimal counterexample to the Signalizer Functor Theorem. Then θ is either semisimple or nearsolvable. 8. The minimal counterexample Henceforth we assume the Signalizer Functor Theorem to be false and let (A, G, θ) to be a counterexample. By Lemma 7.2 we may suppose that A is an elementary abelian r-group with rank 3 for some prime r. Then we may assume that ||θ|| has been minimized. Without loss G = h θ(a) | a ∈ A# i. (1) In broad outline, the proof proceeds as follows: show that the family of subgroups { θ(a) | a ∈ A# } resembles the family of centralizers { CG∗ (a) | a ∈ A# } of some A-simple group G∗ . Then invoke a suitable characterization theorem, namely Theorem 3.2. Most of the difficulty lies in establishing E(θ(a)) 6= 1 for some a ∈ A# and then that E(E(θ(a)) ∩ CG (b)) ≤ E(θ(b)) # for all a, b ∈ A . We define some notation: • Θ is the set of proper θ-subgroups of G. • L is the set of θ(A)-invariant members of Θ. • Θ∗ and L∗ denote the sets of maximal members of Θ and L respectively. Note that it could be the case that G is itself a θ-subgroup, but in that case, G is not a K-group. If H is an A-invariant subgroup of G and of the θ-subgroups of G contained in H there is a unique maximal one, then we denote that θ-subgroup by θ(H) and say that θ(H) is defined. If X ≤ G then we abbreviate NG (X) and CG (X) to N (X) and C(X) respectively. Lemma 8.1. (a) The members of Θ are K-groups. (b) Every member of Θ, resp. L, is contained in a member of Θ∗ , resp. L∗ . (c) If H is a proper A-invariant subgroup of G then θ(H) is defined and θ(H) ∈ Θ. (d) If 1 6= H ∈ Θ then N (H) 6= G. (e) If M ∈ Θ∗ then M = θ(N (X)) for all 1 6= X char M . (f) If M, L ∈ Θ∗ then NL (X) ≤ M for all 1 6= X char M . A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 13 (g) θ(A) is contained in every member of L∗ and L∗ ⊆ Θ∗ . Proof. This is a consequence of Lemma 7.5, (1) and the minimality of ||θ||.  Corollary 8.2. Let M, N ∈ Θ∗ . Suppose that O∗ (M ) ≤ N and O∗ (N ) ≤ M . Then M = N . Proof. We have O∗ (M ) ≤ M ∩ N ≤ N so Lemma 2.2(f) implies O∗ (M ) = O∗ (M ∩ N ). Similarly O∗ (N ) = O∗ (M ∩ N ). Then O∗ (M ) = O∗ (N ). If O∗ (M ) 6= 1 then the conclusion follows from Lemma 8.1(e). If O∗ (M ) = 1 then M = N = 1 and again the conclusion holds.  If M, N ∈ L∗ then M and N are comaximal by Lemma 8.1(f). However, a little more can be said. Lemma 8.3. Let M, N ∈ L∗ , B ∈ Hyp(A) and x ∈ θ(B). Then M and N x are comaximal. Proof. Suppose 1 6= T char M with T ≤ M ∩ N x . Set L = NN x (T ). Let b ∈ B # . Then CL (b) ≤ CM x (b) = (CM (b))x ≤ θ(b)x = θ(b) so CL (b) ≤ θ(b) ∩ N (T ) ≤ θ(N (T )) = M . Since B is noncyclic, Coprime Action(d) implies L ≤ M . Hence M is maximal with respect to N x . Similarly, N x is maximal with respect to M .  Recall from §5 that θsol is defined by θsol (a) = Osol (θ(a); A) # for each a ∈ A , where Osol (θ(a); A) is the largest ACθ(a) (A)-invariant solvable subgroup of θ(a). Note that Cθ(a) (A) = θ(A). Theorem 5.5 implies that θsol (a) is itself solvable and that θsol is an A-signalizer functor on G. The Solvable Signalizer Functor Theorem implies that θsol is complete. Let S = θsol (G). Lemma 8.4. S is the unique maximal θ(A)-invariant solvable θ-subgroup of G. Proof. Apply Theorem 5.5  McBride’s Dichotomy implies that if S = 1 then θ is semisimple and if S 6= 1 then θ is nearsolvable. This section concludes by eliminating a certain configuration. Lemma 8.5. The following is impossible: e ∈ A# , M ∈ Θ and [θ(a), e] ≤ M # for all a ∈ A . Proof. Assume that it does hold. An argument of Bender, see [3, Theorem 4.2], implies that θ(e) normalizes [M, e] and that θ is complete with θ(G) = θ(e)[M, e]. Then θ(G) is a K-group because θ(e) and [M, e] are K-groups. Lemma 5.6 implies that the composition factors of θ(G) are to be found amongst the composition factors of the subgroups θ(a); a ∈ A# , contrary to (A, G, θ) being a counterexample to the Signalizer Functor Theorem.  14 PAUL FLAVELL Corollary 8.6. Suppose that ψ is a subfunctor of θ, e ∈ A# and [θ(a), e] ≤ ψ(a) for all a ∈ A# . Then ψ = θ. Proof. Suppose that ψ 6= θ. Lemma 7.5(a) implies that ||ψ|| < ||θ|| so the minimality of ||θ|| implies that ψ is complete and that ψ(G) is a K-group. Note that Cψ(G) (a) = ψ(a) ≤ θ(a) for all a ∈ A# so ψ(G) is a θ-subgroup. In particular, ψ(G) 6= G as (A, G, θ) is a counterexample to the Signalizer Functor Theorem. Lemma 8.5, with ψ(G) in the role of M , supplies a contradiction.  9. Subfunctors Recall from [3] that if p is a prime then a (p, θ)-subgroup is a θ-subgroup that is also a p-group. The collection of (p, θ)-subgroups is partially ordered by inclusion and its set of maximal elements is denoted by Sylp (G; θ). The Transitivity Theorem asserts that θ(A) acts transitively on Sylp (G; θ). In the proof of the Solvable Signalizer Functor Theorem it was necessary to show that CA (P ) = 1 whenever 1 6= P ∈ Sylp (G; θ). This was accomplished using the subfunctor θp′ . We shall extend those ideas to obtain information in the case CA (P ) 6= 1 and θ is nearsolvable. First, a simple criterion for CA (P ) to be nontrivial. Lemma 9.1. Let e ∈ A# and suppose θ(e) ≤ M ∈ L∗ . Assume p ∈ π(F (M )) and [M, e] is a p′ -group. Then e centralizes every (p, θ)-subgroup of G. Proof. Choose P ∈ Sylp (M ; A). Then [P, e] = 1. Also, 1 6= Op (M ) ≤ P so as M ∈ L∗ we have θ(C(P )) ≤ θ(N (Op (M ))) = M . Choose Q with P ≤ Q ∈ Sylp (G; θ). By Coprime Action(e), NQ (P ) = [NQ (P ), e](NQ (P ) ∩ C(e)). Now [P, e] = 1 so [NQ (P ), e] ≤ CQ (P ) ≤ θ(C(P )) ≤ M . Also NQ (P ) ∩ C(e) ≤ θ(e) ≤ M whence NQ (P ) ≤ M . Since P ∈ Sylp (M ) this forces NQ (P ) = P and then P = Q ∈ Sylp (G; θ). As [P, e] = 1 and θ(A) ≤ C(e), the Transitivity Theorem implies that e centralizes every member of Sylp (G; θ). The conclusion follows.  Recall that if p is a prime and X is a group then Op−sol (X) is the largest normal p-solvable subgroup of X. Theorem 5.5 asserts that the map θp−sol defined by θp−sol (a) = Op−sol (θ(a); A) = the unique maximal Aθ(A)-invariant p-solvable subgroup of θ(a) is a subfunctor of θ. Similarly so is the map θp′ defined by θp′ (a) = Op′ (θ(a); A). We state the main result of this section. Theorem 9.2. Assume the following: • p ∈ π(θ). • e ∈ A# and e centralizes every (p, θ)-subgroup of G. • θ is nearsolvable. Then the following hold: (a) G possesses a unique maximal θ(A)-invariant p-solvable θ-subgroup. A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 15 (b) For all a ∈ A# , θ(a) = [θ(a), e]θp−sol (a). In particular, θ(e) is p-solvable. Proof of Theorem 9.2(a). Assume that θp−sol = θ. Let a ∈ A# . By hypothesis, e centralizes every A-invariant Sylow p-subgroup of θ(a) so using Coprime Action(h) we have [θ(a), e] ≤ Op′ (θ(a)) ≤ θp′ (a). Corollary 8.6 implies that θ = θp′ . But then θ(a) is a p′ -group for all a ∈ A# , contrary to p ∈ π(θ). We deduce that θp−sol 6= θ. The minimality of ||θ|| implies that θp−sol is complete and that θp−sol (G) is p-solvable. Theorem 5.5 implies that θp−sol (G) is the unique maximal θ(A)-invariant p-solvable θ-subgroup.  Lemma 9.3. Assume the hypotheses of Theorem 9.2. Let X ∈ L and suppose that X = [X, e]. Set X = X/Op−sol (X). (a) F ∗ (X) = E(X), Z(E(X)) = 1 and each component of X is normalized but not centralized by e. (b) CX (e) is p-solvable. Proof. Since Op−sol (X) = 1 we have Z(E(X)) = F (X) = Op′ (X) = 1. In particular, each component of X has order divisible by p. By hypothesis, e centralizes a Sylow p-subgroup of E(X). Then e acts trivially on comp(X). Since X = [X, e] it follows that each component of X is normal in X. If K ∈ comp(X) and [K, e] = 1 then X = [X, e] centralizes K, a contradiction. Thus (a) holds. Let K ∈ comp(X). Since θ is nearsolvable, X is nearsolvable and K ∼ = L2 (2r ), r r r L2 (3 ), U3 (2 ) or Sz(2 ). Now e induces a nontrivial automorphism of order r on K and K is an r′ -group. It follows that CK (e) is solvable. Then CE(X) (e) is solvable. By (a) and the Schreier Property, X/E(X) is solvable. Now X = X/Op−sol (X), whence CX (e) is p-solvable and (b) holds.  Proof of Theorem 9.2(b). For each a ∈ A# define ψ(a) by ψ(a) = [θ(a), e]θp−sol (a). We claim that ψ is an A-signalizer functor. Indeed, let a, b ∈ A# . Coprime Action(e) implies ψ(a) ∩ C(b) = ([θ(a), e] ∩ C(b))(θp−sol (a) ∩ C(b)). Let Y = [θ(a), e] ∩ C(b). Then Y ≤ θ(a) ∩ C(b) ≤ θ(b). Now Y = [Y, e]CY (e) by Coprime Action(c) and [Y, e] ≤ ψ(b). Lemma 9.3(b) implies that [θ(a), e] ∩ C(e) is p-solvable. Then CY (e) is an Aθ(A)-invariant p-solvable subgroup of θ(b), so CY (e) ≤ θp−sol (b) ≤ ψ(b). Thus Y ≤ ψ(b). As θp−sol is an A-signalizer functor we have θp−sol (a) ∩ C(b) ≤ θp−sol (b) ≤ ψ(b). Hence ψ(a) ∩ C(b) ≤ ψ(b) and the claim is established. Corollary 8.6 implies ψ = θ. Also, θ(e) = ψ(e) = θp−sol (e) so θ(e) is p-solvable.  10. The First Uniqueness Theorem The aim of this section is to prove a result that deals with the characteristic p case arising in conclusion (c) of Bender’s Maximal Subgroup Theorem. First we recall the following: let p be a prime. • A group M has characteristic p if F ∗ (M ) = Op (M ). 16 PAUL FLAVELL • If A acts coprimely in the group M then Op (M ; A) is the intersection of all A-invariant Sylow p-subgroups of M . It is the unique maximal ACM (A)invariant p-subgroup of M . • Op (G; θ) is the intersection of the members of Sylp (G; θ). It is the unique maximal θ(A)-invariant (p, θ)-subgroup. The uniqueness assertions follow from Coprime Action(a) and the Transitivity Theorem. Theorem 10.1 (The First Uniqueness Theorem). Let p be a prime and suppose M ∈ L∗ has characteristic p. (a) Op (G; θ) ≤ M . (b) M is the only member of L∗ with characteristic p. Proof of Theorem 10.1. Let N = θ(N (Op (M ; A))). Note that Op (M ) ≤ Op (M ; A) so Op (M ; A) 6= 1 since M has characteristic p. Let B ∈ Hyp(A) and x ∈ CN (B). Then Op (M ; A) = Op (M ; A)x = Op (M x ; Ax ). Using Lemma 8.3 we see that the hypotheses of Theorem 6.3 are satisfied with M1 = M, A1 = A, M2 = M x and A2 = Ax . Consequently M = M x . Then x ∈ θ(B) ∩ N (M ) ≤ θ(N (M )) = M . We deduce that CN (B) ≤ M for all B ∈ Hyp(A). Coprime Action(d) implies N ≤ M . Let P = Op (G; θ). Then P contains every θ(A)-invariant (p, θ)-subgroup. Also M ∈ L∗ so θ(A) ≤ M , in fact θ(A) = CM (A). It follows that P ∩ M = Op (M ; A). Then NP (P ∩ M ) ≤ θ(N (Op (M ; A))) = N ≤ M so NP (P ∩ M ) ≤ P ∩ M . This forces P = P ∩ M ≤ M so P = Op (M ; A) and (a) holds. To prove (b), suppose N ∈ L∗ also has characteristic p. Then Op (M ; A) = P = Op (N ; A). Another application of Theorem 6.3 forces M = N .  11. The subgroups Ma The main result of this section is the following: Theorem 11.1. Let a ∈ A# . There exists Ma such that the following hold: (a) θ(a) ≤ Ma ∈ L∗ . (b) If N ∈ L∗ satisfies Ma N and θ(a) ≤ N then Ma = N . (c) If X 6= 1 is an Aθ(a)-invariant subnormal subgroup of Ma then θ(N (X)) ≤ Ma . Throughout the remainder of this paper, we let { Ma | a ∈ A# } be the family of subgroups constructed in Theorem 11.1. It is a trivial consequence of Coprime Action and the fact that G = h θ(a) | a ∈ A# i that if B ∈ Hyp(A) then there exists b, b′ ∈ B # with Mb 6= Mb′ . In fact, we can go a little further. Lemma 11.2. Let B ∈ Hyp(A). (a) Let B0 ∈ Hyp(B). Then Mb takes at least two values as b ranges over B \ B0 . A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 17 (b) Ma takes at least three values as a ranges over A \ B. Proof of Theorem 11.1. Choose W maximal subject to W ∈ L, W is θ(a)-invariant and W = E(W ) = [W, a]. If W 6= 1 choose M with θ(N (W )) ≤ M ∈ L∗ . If W = 1 choose M with θ(a) ≤ M ∈ L∗ and if possible with COp (M) (a) = 1 for some p ∈ π(F (M )). In both cases, θ(a) ≤ M and θ(a) = CM (a). Moreover, W is ACM (a)-invariant so as W = E(W ) = [W, a], Theorem 4.3(a) implies W ≤ E(M ). Suppose N satisfies θ(a) ≤ N ∈ L∗ and M N. We will prove that (∗) M = N. Since M N we have W ≤ E(M ) ≤ N by Theorem 6.2(a) so another application of Theorem 4.3(a) implies W ≤ E(N ). Then W = [W, a] ≤ [E(N ), a]. Now θ(a) ≤ N so [E(N ), a] is θ(a)-invariant. It is also normal in E(N ) so it is the central product of its components. The maximal choice of W forces W = [E(N ), a] E F ∗ (N ). Suppose W 6= 1. Then F ∗ (N ) ≤ θ(N (W )) ≤ M so N M . Since E(N ) 6= 1, Theorem 6.2(c) forces M = N . Hence we may assume that W = 1. In particular E(N ) ≤ θ(a) ≤ M. We claim that π(F (N )) ⊆ π(F (M )). Assume false and choose q ∈ π(F (N )) \ π(F (M )). Theorem 6.2(a) implies M ∩ Oq (N ) = 1. Now COq (N ) (a) ≤ θ(a) ∩ Oq (N ) ≤ M ∩ Oq (N ) so COq (N ) (a) = 1. Recall that θ(a) ≤ N . The choice of M implies that there exists p ∈ π(F (M )) with COp (M) (a) = 1. As M N we have Z(Op (M )) ≤ N . Set X = Z(Op (M ))Oq (N ). Then Z(Op (M )) is an h a iCX (a)-invariant subgroup of X and Coprime Action(c) implies Z(Op (M )) = [Z(Op (M )), a]. Theorem 4.2(a) implies Z(Op (M )) ≤ Op (X) whence Oq (N ) ≤ θ(N (Z(Op (M )))) = M , contrary to M ∩ Oq (N ) = 1. The claim is established. Theorem 6.2(c) and the First Uniqueness Theorem imply M = N , which proves (∗). Suppose 1 6= X E E M is Aθ(a)-invariant. Choose N with θ(N (F ∗ (X))) ≤ N ∈ L∗ . Now F ∗ (X) E E F ∗ (M ) so M N . Then M = N by (∗) and so θ(N (X)) ≤ θ(N (F ∗ (X))) ≤ M . Set Ma = M to complete the proof.  Proof of Lemma 11.2. (a). Recall that rank(A) = 3 so B0 is cyclic. Let e be a generator for B0 . Assume the result is false and let M denote the common value of Mb as b ranges over B \ B0 . By Coprime Action(d), for each a ∈ A# , [θ(a), e] = h [θ(a) ∩ C(b), e] | b ∈ B \ B0 i ≤ h θ(b) | b ∈ B \ B0 i ≤ M. Lemma 8.5 supplies a contradiction. 18 PAUL FLAVELL (b). Assume the result is false. Then there exist M, L with Ma ∈ { M, L } for all a ∈ A \ B. Let a ∈ A \ B. Then θ(a) = h θ(D) | a ∈ D ∈ Hyp(A) i. If a ∈ D ∈ Hyp(A) then D 6= B so D ∩ B ∈ Hyp(D). By (a), with D in the role of B, Md takes at least two values as d ranges over D \ D ∩ B. Hence Md = M for some d ∈ D \ D ∩ B. Consequently θ(D) ≤ θ(d) ≤ M and we deduce that θ(a) ≤ M for all a ∈ A \ B. Choose D ∈ Hyp(A) with D 6= B. Set D0 = D ∩ B ∈ Hyp(D) and let e be a generator for D0 . Let T be any θ-subgroup. By Coprime Action(d), [T, e] = h [CT (d), e] | d ∈ D \ D0 i ≤ M. In particular, [θ(a), e] ≤ M for all a ∈ A# . Again, Lemma 8.5 supplies a contradiction.  12. The Fermat case Since S is the unique maximal θ(A)-invariant solvable θ-subgroup it follows that F (Ma ) ≤ S for all a ∈ A# . The goal of this section is to prove: Theorem 12.1. Let a ∈ A# and suppose E(Ma ) = 1. Then [F (Ma ), a]F (S) is nilpotent. In the case that r is not a Fermat prime, this follows readily from Theorem 4.2(a), with [F (Ma ), a] in the role of H. Just as in the author’s proof of the Solvable Signalizer Functor Theorem, the Fermat case requires special treatment. Throughout the remainder of this section we assume Theorem 12.1 to be false. Theorem 4.2(a) implies r is Fermat and that [O2 (Ma ), a]F (S) is not nilpotent. Set Q = [O2 (Ma ), a] and choose an odd prime p such that [Op (S), Q] 6= 1. Lemma 12.2. (a) Op (Ma ) = 1, Ma ∩ Op (S) = 1 and COp (S) (a) = 1. (b) Q = [Q, a] and Q′ = Φ(Q) = Z(Q) = CQ (a). Proof. (a). Since F (Ma ) ≤ S and E(Ma ) = 1 we have Ma S. Suppose p ∈ π(F (Ma )). Then { 2, p } ⊆ π(F (Ma )) so Theorem 6.2(b) implies Op (S) ≤ Ma . Then [Op (S), Q] ≤ Op (S) ∩ O2 (Ma ) = 1, a contradiction. Thus p 6∈ π(F (Ma )). Theorem 6.2(a) implies Ma ∩ Op (S) = 1. Finally COp (S) (a) ≤ θ(a) ∩ Op (S) ≤ Ma ∩ Op (S) = 1. (b). The first assertion is Coprime Action(c) and the second is Coprime Action(i) provided we can show [U, a] = 1 whenever U is a characteristic abelian subgroup of Q. Assume this to be false. Now [U, a] ≤ O2 (Ma ) so U is an Aθ(a)-invariant subnormal subgroup of Ma and Theorem 11.1 implies θ(N ([U, a])) ≤ Ma . On the other hand, Lemma 2.6(c) implies [U, a] acts trivially on Op (S). Hence Op (S) ≤ θ(N ([U, a])) contrary to Ma ∩ Op (S) = 1 which completes the proof.  Set W = h [CQ (B), a]′ | B ∈ Hyp(A) i. A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 19 Lemma 12.3. (a) W ≤ Z(Q) and 1 6= W E θ(A). (b) If H ∈ L∗ then W ≤ sol(H). (c) COp (S) (W ) = 1. Proof. Lemma 12.2(b) implies W ≤ Q′ = Z(Q) = CQ (a). Let B ∈ Hyp(A), set Q0 = [CQ (B), a] and suppose Q0 6= 1. Then a 6∈ B and A = h B, a i. As Q′0 ≤ W ≤ CQ (a) we obtain [Q′0 , A] = 1. Moreover θ(A) normalizes Q, B and a so Q0 is θ(A)-invariant and Q′0 E θ(A). Consequently W E θ(A). For each b ∈ B # we have Q0 ≤ O2 (θ(b); A) and then Lemma 2.6(a) implies ′ Q0 ≤ sol(θ(b)). Let H ∈ L∗ . Then Q′0 ≤ θ(A) ≤ H. Using Lemma 2.6(b) for the last containment, we have \ \ sol(CH (b)) ≤ sol(H). sol(θ(b)) ∩ H ≤ Q′0 ≤ b∈B # b∈B # This proves (b). By Coprime Action(d), Q = h [CQ (B), a] | B ∈ Hyp(A) i. (∗) As [Op (S), Q] 6= 1 we may choose B with [Op (S), Q0 ] 6= 1. Lemma 2.6(c), with Q0 in the role of X, implies that Q0 is nonabelian. Then 1 6= Q′0 ≤ W , which completes the proof of (a). To prove (c) consider the action of Q0 on COp (S) (W ). Note that COp (S) (W ) is Q-invariant because W ≤ Z(Q). Now Q′0 ≤ W so Q0 induces an abelian group on COp (S) (W ). Lemma 2.6(c) implies [COp (S) (W ), Q0 ] = 1. Then (∗) implies [COp (S) (W ), Q] = 1. Now Q is an Aθ(a)-invariant subnormal subgroup of Ma so Theorem 11.1 implies θ(N (Q)) ≤ Ma . Then COp (S) (W ) ≤ Ma ∩ Op (S) = 1.  Lemma 12.4. Let H ∈ L∗ and suppose Op (S) ∩ H 6= 1. Then Op (S) E Op (H). Proof. Set P = Op (S) ∩ H. Lemma 12.3(b),(c) and Coprime Action(c) imply P = [P, W ] ≤ sol(H). ∗ Now H ∈ L so sol(H) ≤ S and then 1 6= P ≤ Op (sol(H)) ≤ Op (H). Also Op (H) ≤ S so Op (H)Op (S) is a p-group. Since NOp (S) (Op (H)) ≤ Op (S) ∩ H = P ≤ Op (H) it follows that Op (H)Op (S) = Op (H). As Op (H) ≤ S, the conclusion follows.  Choose N with θ(N (Op (S))) ≤ N ∈ L∗ . Lemma 12.5. E(N ) = 1. Proof. We have Q ≤ N whence Q ≤ O2 (N ; A). Lemma 2.6(a) implies Q′ ≤ sol(N ), so [Q′ , E(N )] = 1. Now Q′ 6= 1 so Theorem 11.1 implies θ(N (Q′ )) ≤ Ma , whence E(N ) ≤ Ma . Now F (Ma ) ≤ S ≤ N and E(N ) and F (Ma ) normalize each other. Then [E(N ), F (Ma )] = 1. By hypothesis, E(Ma ) = 1 so it follows that E(N ) = 1.  We can now complete the proof of Theorem 12.1. By Coprime Action(d) there exists B ∈ Hyp(A) with COp (S) (B) 6= 1. By Lemma 11.2 there exists b ∈ B # with Mb 6= N . Now 1 6= COp (S) (B) ≤ θ(b) ∩ Op (S) ≤ Mb ∩ Op (S) so Lemma 12.4 implies 20 PAUL FLAVELL Op (S) E Op (Mb ). Then F ∗ (Mb ) ≤ N and Mb N . Since E(N ) = 1, Theorem 6.2 and the First Uniqueness Theorem imply there exists a prime t with Ot (N ) 6= 1, Ot (Mb ) = 1 and Mb ∩ Ot (N ) = 1. As θ(COt (N ) (b)) ≤ θ(b) ≤ Mb we also have COt (N ) (b) = 1. Since p 6= 2, Lemma 2.6(c) implies [Op (Mb ), b] centralizes Ot (N ). If [Op (Mb ), b] 6= 1 then Ot (N ) ≤ θ(N ([Op (Mb ), b])) ≤ Mb by Theorem 11.1, a contradiction. Thus [Op (Mb ), b] = 1. Then as Op (S) ≤ Op (Mb ), we have [Mb , b] ≤ CMb (Op (Mb )) ≤ θ(N (Op (S))) ≤ N. Set U = [Mb , b]. Lemma 2.6(c) implies that U/CU (Ot (N )) is a solvable { 2, t }group. Let V be the subgroup of U generated by U (∞) and the { 2, t }′-elements of U . Then [Ot (N ), V ] = 1. Also V char U E Mb so V E Mb . If V 6= 1 then Ot (N ) ≤ Mb , a contradiction. Thus V = 1 and U is a solvable { 2, t }-group. Note that p ∈ π(F (Mb )) since Op (S) E Op (Mb ) and so p 6= t as Ot (Mb ) = 1. Also, p 6= 2. Thus [Mb , b] is a p′ -group. McBride’s Dichotomy, Lemma 9.1 and Theorem 9.2 imply that there exists a unique maximal θ(A)-invariant p-solvable θ-subgroup K and that θ(b) is p-solvable. Now Mb = CMb (b)U = θ(b)U . Since U is a normal solvable subgroup of Mb we deduce that Mb is p-solvable and then that Mb = K. But Ot (N ) is p-solvable and θ(A)-invariant, whence Ot (N ) ≤ Mb . This contradiction completes the proof of Theorem 12.1. 13. The Second Uniqueness Theorem The goal of this section is the prove the following: Theorem 13.1 (The Second Uniqueness Theorem). Let a ∈ A# and suppose that E(Ma ) = 1. Then: (a) S ≤ Ma . (b) If b ∈ A# and E(Mb ) = 1 then Mb = Ma . Lemma 13.2. Suppose I and J are subgroups of the group X. Suppose also that E(X) = 1 and that IF (X) and JF (X) are nilpotent. Let p and q be distinct primes. Then [Op (I), Oq (J)] = 1. Proof. Set Z = Z(F (X)). Since E(X) = 1 we have CX (F (X)) = Z. Now [Op (I), Oq (J)] ≤ [CX (Op′ (F (X))), CX (Oq′ (F (X)))] ≤ CF (X) (=)Z. Hence Op (I) normalizes the nilpotent group Oq (X)Z. Then [Op (I), Oq (J)] ≤ Oq (Oq (J)Z) and the commutator is a q-group. Similarly, it is a p-group and hence is trivial.  Proof of Theorem 13.1. Set M = Ma . Since E(M ) = 1 we have F (M ) 6= 1 so McBride’s Dichotomy implies that θ is nearsolvable. (a). Suppose first that [F (M ), a] = 1. Coprime Action(g) implies [M, a] = 1. Thus M = θ(a). Choose p ∈ π(F (M )). Theorem 9.1 implies that there exists a unique maximal θ(A)-invariant p-solvable θ-subgroup and that θ(a), and hence M is p-solvable. Since M ∈ L∗ it follows that M is the said subgroup. Now S is θ(A)-invariant and solvable so S ≤ M . Hence we may assume that [F (M ), a] 6= 1. A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 21 Note that F (M ) ≤ S because F (M ) is θ(A)-invariant and solvable. In particular, M S. We claim that π(F (S)) ⊆ π(F (M )). Indeed, suppose q is a prime with q 6∈ π(F (M )). Using Theorems 12.1 and 11.1 we have Oq (S) ≤ θ(N ([F (M ), a])) ≤ M . On the other hand, Theorem 6.2(a) implies M ∩ Oq (S) = 1. Hence Oq (S) = 1 and the claim is established. Consider the case that | π(F (M )) | ≥ 2. Theorem 6.2(b) implies F (S) ≤ M. Since F (M ) ≤ S we deduce that F (M )F (S) is nilpotent. Let x ∈ S and let p, q ∈ π(F (M )) be distinct. Now F (M )x F (S) is nilpotent so Lemma 13.2 implies [Op (M ), Oq (M )x ] = 1. Then Oq (M )x ≤ NS (Op (M )) ≤ M . We deduce that F (M )x ≤ M and so M x M . If x ∈ CS (B) for some B ∈ Hyp(A) then Lemma 6.3 implies that M and M x are comaximal and so M = M x by Theorem 6.2(c)(ii). Then x ∈ NS (M ) ≤ M and we deduce that CS (B) ≤ M for all B ∈ Hyp(A). Coprime Action(d) forces S ≤ M . Hence we may assume that F (M ) is a p-group for some prime p. The First Uniqueness Theorem implies Op (G; θ) ≤ M so Op (G; θ) = Op (M ; A). As Op (G; θ) is θ(A)-invariant and solvable we have Op (G; θ) ≤ S and so Op (G; θ) = Op (S; A). Consequently Op (M ; A) = Op (S; A). Note that Op (M ) 6= 1 since F (M ) is a p-group. If Op (M ) is abelian then Theorem 6.4 implies J(Op (M )) = J(Op (S)). Then S ≤ θ(N (J(Op (M )))) = M . Hence we may assume that Op (M ) is nonabelian. Choose N with S ≤ N ∈ L∗ . As above, Op (G; θ) = Op (N ; A) whence Op (M ) ≤ Op (N ; A). Lemma 12.2(a) implies Op (M )′ ≤ sol(N ). Consequently E(N ) ≤ θ(N (Op (M )′ )) ≤ M . As S ≤ N and F (N ) is θ(A)-invariant and solvable we have F (N ) ≤ F (S). Then π(F (N )) ⊆ π(F (S)) ⊆ π(F (M )) = { p }. Theorem 6.2(c) and the First Uniqueness Theorem imply Ma = N , so S ≤ M . (b). Recall that S contains every θ(A)-invariant solvable θ-subgroup. Using (a) we have F ∗ (Ma ) = F (Ma ) ≤ S ≤ Mb so Ma Mb . Similarly Mb Ma . Theorem 6.2(c) and the First Uniqueness Theorem force Mb = Ma .  Remark. In [8] it is conjectured that if p is a prime then to each nontrivial p-group P there exists a nontrivial characteristic subgroup W (P ) such that whenever A acts coprimely on the group M and M has characteristic p then W (Op (M ; A)) E M . A proof of this conjecture would lead to a much cleaner proof of the Second Uniqueness Theorem. The conjecture is known to be true if p > 3, see [4]. 14. A-components # For each a ∈ A let Ωa = { K | K ∈ compA (M ) for some M with θ(a) ≤ M ∈ L }. In particular, compA (θ(a)) ∪ compA (Ma ) ⊆ Ωa . Let [ Ωa . Ω= a∈A# 22 PAUL FLAVELL The Second Uniqueness Theorem and Lemma 11.2 imply Ω 6= ∅. The subsequent analysis is dominated by the elements of Ω. Recall the definition ∗ of CK (A) given in §3. Theorem 14.1. Let K, L ∈ Ω. The following are equivalent: (a) [K, L] 6= 1. ∗ (b) CK (A) = CL∗ (A). ∗ (c) [CK (A), CL∗ (A)] 6= 1. In particular ‘does not commute’ is an equivalence relation on Ω. Lemma 14.2. Suppose a, b ∈ A# , K ∈ Ωa , L ∈ Ωb and N ∈ L. Set K0 = E(K ∩N ) and L0 = E(L ∩ N ). Assume that [K0 , L0 ] 6= 1. Then there exists X such that: (a) (b) (c) (d) h K0 , L0 i ≤ X ∈ compA,sol (N ). If [K0 , a] 6= 1 then X = K0 and if [L0 , b] 6= 1 then X = L0 . ∗ CK (A) = CL∗ (A). If X is constrained then K0 = L0 and X = K0 sol(X). Proof. Choose M ∈ L with θ(a) ≤ M and K ∈ compA (M ). Now CN (a) ≤ θ(a) ∩ N ≤ M ∩ N so Hypothesis 4.1 is satisfied with N and M ∩ N in the roles of G and H respectively. Also K E E M so K0 E E M ∩ N . As [K0 , L0 ] 6= 1 we have K0 6= 1 and then Lemma 3.4 implies K0 is A-quasisimple, so K0 ∈ compA (M ∩ N ). e with Theorem 4.4 implies there exists K e with Similarly there exists L e ∈ comp K0 ≤ K A,sol (N ). e ∈ compA,sol (N ). L0 ≤ L e L] e 6= 1. Consequently either K e and L e are both Since [K0 , L0 ] 6= 1 we have [K, semisimple or both constrained. e and L e are both semisimple. Since [K, e L] e 6= 1 this forces K e = L. e Suppose that K e Put X = K. Then (a) holds and (b) follows from Theorem 4.4(a). We claim that ∗ ∗ e CK e (A) = CK0 (A). If [K0 , a] 6= 1 then (b) implies K = K0 and the claim is clear. Suppose [K0 , a] = 1. Theorem 4.4(b) implies K0 = E(CKe (a)). In particular, K0 is CKe (A)-invariant. The claim follows from Lemma 3.4. Similarly CL∗e (A) = CL∗ 0 (A). ∗ ∗ e = L, e (c) Also by Lemma 3.4, CK (A) = CK (A) and CL∗ (A) = CL∗ 0 (A). Since K 0 follows. Note that (d) is not applicable in this case. e and L e are both constrained. Theorem 4.4 implies Suppose K e = K0 sol(K). e [K0 , a] = 1 and K e a] ≤ sol(K). e Recall that K0 ∈ compA (M ∩ N ). As θ(a) ≤ M and In particular [K, [K0 , a] = 1 it follows that K0 ∈ compA (θ(a) ∩ N ). Similarly (∗) L0 ∈ compA (θ(b) ∩ N ). Since L0 is A-quasisimple, we have [L0 , a] = 1 or L0 . Suppose [L0 , a] = L0 . Then e a] 6≤ sol(L) e and since every proper A-invariant normal subgroup of L e is solvable [L, A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 23 e = [L, e a]. As [K, e a] ≤ sol(K) e we have K e 6= L. e Theorem 4.4(d) it follows that L e L] e = 1, a contradiction. We deduce that [L0 , a] = 1. Then (∗) implies implies [K, L0 ∈ compA (θ(a) ∩ θ(b) ∩ N ). Similarly K0 ∈ compA (θ(a) ∩ θ(b) ∩ N ) so as [K0 , L0 ] 6= 1 we must have K0 = L0 . e ∩L e is nonsolvable so K e = L. e Put X = K. e Then (a) holds. (b) is In particular, K ∗ ∗ not applicable in this case. Lemma 3.4 implies that CK (A) = CK (A) = CL∗ 0 (A) = 0 ∗ CL (A). Then (c) holds. (d) has also been proved.  Proof of Theorem 14.1. Suppose (a) holds, so [K, L] 6= 1. Lemma 3.5(a) implies there exists D ∈ Hyp(A) such that CL (d) is A-quasisimple for all d ∈ D# and [K, CL (D)] 6= 1. Lemma 3.5(b) implies there exists d ∈ D# such that CK (d) is A-quasisimple and [CK (d), CL (D)] 6= 1. Then [CK (d), CL (d)] 6= 1. Put N = θ(d). Now CK (d) = K ∩ N so CK (d) = E(K ∩ N ). Similarly CL (d) = ∗ E(L ∩ N ). Lemma 14.2 implies CK (A) = CL∗ (A) so (b) holds. ∗ Lemma 3.4 implies that CK (A) is nonabelian. The remaining implications follow trivially.  15. The Balance Theorem The aim of this section is to prove the following. Theorem 15.1 (The Balance Theorem). Suppose a, b ∈ A# , K ∈ Ωa and E(K ∩ Mb ) 6= 1. Then E(K ∩ Mb ) is A-quasisimple and is contained in an A-component of Mb . In particular E(K ∩ Mb ) ≤ E(Mb ). A number of lemmas are required. Recall that S is the unique maximal θ(A)invariant solvable θ-subgroup. Lemma 15.2. Suppose a ∈ A# , K ∈ Ωa and θ is nearsolvable. Let Y be a nonsolvable ACK (A)-invariant subgroup of K. Then K = h Y, K ∩ S i. Proof. Choose M with θ(a) ≤ M ∈ L and K ∈ compA (M ). Since θ(A) ≤ M we have S ∩ M = Osol (M ; A). Since K is an A-invariant subnormal subgroup of M , Corollary 5.4 implies Osol (K; A) = K ∩ Osol (M ; A). Then Osol (K; A) = K ∩ S. Now θ is nearsolvable so θ(A) and hence CK (A) is solvable. Apply Theorem 3.1(e) to K/Z(K).  Lemma 15.3. Suppose a, b ∈ A# , K ∈ Ωa and E(K ∩ Mb ) 6= 1. Then E(K ∩ Mb ) is A-quasisimple. Suppose also that E(K ∩Mb ) is not contained in an A-component of Mb . Then: e with (a) K ≤ Mb and there exists K (b) (c) (d) e ∈ compA,sol (Mb ). K≤K e is constrained, K e = K sol(K) e and K ∩ E(Mb ) ≤ Z(K). K e e If c ∈ A \ CA (K) then K = [K, c] = h K, Csol(K) e (c) i. θ is nearsolvable. 24 PAUL FLAVELL Proof. Choose M with θ(a) ≤ M ∈ L and K ∈ compA (M ). Set K0 = E(K ∩ Mb ). Lemma 3.4 implies that K0 is A-quasisimple. Since CMb (a) ≤ θ(a) ∩ Mb ≤ M ∩ Mb , Hypothesis 4.1 is satisfied with Mb and M ∩Mb in the roles of G and H respectively. As K ∩ Mb E E M ∩ Mb we have K0 ∈ compA (M ∩ Mb ). Theorem 4.4 implies that e with there exists K e ∈ comp K0 ≤ K A,sol (Mb ). e is constrained. By assumption, K0 is not contained in an A-component of Mb so K e Then 1 6= sol(K) ≤ sol(Mb ) ∈ L and McBride’s Dichotomy implies that θ is nearsolvable. ∗ ∗ e is constrained we have Lemma 3.4 implies that CK (A) = CK (A). Since K 0 e E(Mb )] = 1, whence [K, ∗ (A), E(Mb )] = 1. [CK Recall that E(Mb ) is generated by the A-components of Mb . Theorem 14.1 implies [K, E(Mb )] = 1. If E(Mb ) 6= 1 then K ≤ Mb . If E(Mb ) = 1 then the Second Uniqueness Theorem implies S ≤ Mb and then Lemma 15.2 yields K = h K0 , K ∩ S i ≤ Mb . In both cases, K ≤ Mb so K0 = K. e ∩ E(Mb ) ≤ sol(K) e so K ∩ E(Mb ) is solvable normal Also K ∩ E(Mb ) ≤ K subgroup of the A-quasisimple group K. Hence it is contained in Z(K). e c] so as K e ∈ To prove (c), suppose c ∈ A \ CA (K). Then K = [K, c] ≤ [K, e e compA,sol (Mb ) it follows that K = [K, c]. The remaining assertion follows from Theorem 4.4(c).  Proof of the Balance Theorem. Assume false. Lemma 15.3 implies there exists a e with constrained K e ∈ comp K≤K A,sol (Mb ). e We may suppose that (a, b, K) has been chosen to maximize K. Claim 1. Let L ∈ Ω and suppose [K, L] 6= 1. Then K = L. Proof. Lemma 3.5 implies there exists D ∈ Hyp(A) and d ∈ D# such that CK (d) and CL (d) are A-quasisimple. Let K0 = E(K ∩ Md ) and L0 = E(L ∩ Md ). Since CK (d) ≤ K ∩ θ(d) ≤ K ∩ Md , Lemma 3.4 implies CK (d) ≤ K0 . Similarly CL (d) ≤ ∗ L0 . Now [K, L] 6= 1 so Theorem 14.1 implies [CK (A), CL∗ (A)] 6= 1. Then [K0 , L0 ] 6= 1. Lemma 14.2, with Md in the role of N , implies there exists X with h K0 , L0 i ≤ X ∈ compA,sol (Md ). Suppose X is constrained. Then K0 is not contained in a component of Md . As K0 = E(K ∩ Md ), Lemma 15.3(a) implies K ≤ Md , so K0 = K. Similarly L0 = L. Lemma 14.2(d) implies K0 = L0 so we are done in this case. Suppose X is semisimple. Then X is A-quasisimple. Now CK (d) ≤ X ∩ Mb so as CK (d) is A-quasisimple, Lemma 3.4(b), with X and X ∩ Mb in the roles of K and H respectively, implies CK (d) ≤ E(X ∩ Mb ). By Lemma 15.3, K ∩ E(Mb ) ≤ Z(K) so E(X ∩ Mb ) 6≤ E(Mb ). In particular, E(X ∩ Mb ) is not contained in an Acomponent of Mb . Now X ∈ compA (Md ) ⊆ Ωd so Lemma 15.3(a) forces X ≤ Mb and X ∩ E(Mb ) ≤ Z(X). Now CL (d) is A-quasisimple and CL (d) ≤ X ≤ Mb . Then CL (d) ≤ E(L ∩ Mb ) 6≤ E(Mb ) and Lemma 15.2 forces L ≤ Mb . We apply Lemma 14.2, with Mb , K and A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 25 L in the roles of N, K0 and L0 respectively. Since K is not contained in an Acomponent of Mb , Lemma 14.2(d) forces K = L.  e ∈ compA,sol (Mc ). Claim 2. Suppose c ∈ A \ CA (K) and E(Mc ) 6= 1. Then K Proof. Claim 1 implies K normalizes E(Mc ) so K ≤ Mc . Using Lemma 15.3(c) we have e = h K, C e (c) i ≤ h K, θ(c) i ≤ Mc . K sol(K) As previously, Theorem 4.4, implies that there exists K ∗ with K ≤ K ∗ ∈ compA,sol (Mc ). e E E K. e But K e contains no proper A-invariant nonsolvable Then K ≤ K ∗ ∩ K ∗ e =K e and K e ≤ K ∗ . As K e is constrained we subnormal subgroups, whence K ∩ K ∗ ∗ ∗ e have K < K ≤ K and then Claim 1 implies K 6∈ Ω, so K is not semisimple. e forces K e = K ∗ , which proves the claim. The maximal choice of K  Choose N with e ≤ N ∈ Θ∗ . θ(N (K)) Claim 3. Suppose c ∈ A \ CA (K) and E(Mc ) 6= 1. Then Mc = N . e ∈ compA,sol (Mc ). In particular, K e E O∗ (Mc ) and then Proof. Claim 2 implies K e e O∗ (Mc ) ≤ N . Lemma 15.3 implies K = [K, c] so using Theorem 4.3(b) we have e ≤ [O∗ (Mc ), c](∞) E O∗ (N ). 1 6= K Theorem 11.1 implies O∗ (N ) ≤ Mc and then Corollary 8.2 forces Mc = N .  It is straightforward to complete the proof of the Balance Theorem. Now θ is nearsolvable so θ(A) is solvable and we may choose B with CA (K) ≤ B ∈ Hyp(A). The Second Uniqueness Theorem and Claim 3 implies that Mc takes at most two values as c ranges over A \ B. Lemma 11.2(b) supplies a contradiction.  16. The Structure Theorem The following result will be proved. Once it has, Theorem 3.2 and Lemma 5.6 will supply a contradiction and complete the proof of the Signalizer Functor Theorem. Theorem 16.1 (The Structure Theorem). (a) If a ∈ A# with E(θ(a)) 6= 1 then E(θ(a)) is A-simple, F (θ(a)) = 1 and CA (E(θ(a))) = h a i. (b) For all a, b ∈ A# , E(E(θ(a)) ∩ C(b)) ≤ E(θ(b)). (c) G = h E(θ(a)) | a ∈ A# i. Lemma 16.2. Let B ∈ Hyp(A). Then G = h E(Mb ) | b ∈ B # i. Proof. For each D ≤ A set GD = h E(Md ) | d ∈ D# i. Let D ∈ Hyp(A) and a ∈ A# . We claim that E(Ma ) ≤ GD . Indeed, let K ∈ compA (Ma ). If d ∈ D# and CK (d) is A-quasisimple then CK (d) ≤ E(K ∩ Md ) by Lemma 3.4. Lemma 3.5 and the Balance Theorem yield K = h CK (d) | d ∈ D# and CK (d) is A-quasisimple i ≤ h E(Md ) | d ∈ D# i ≤ GD . 26 PAUL FLAVELL The claim is established. In particular, GA = GD . Note that θ(D) normalizes GD and hence GA . Using Lemma 7.5 and the fact that G = h θ(a) | a ∈ A# i we have G = h θ(D) | D ∈ Hyp(A) i and it follows that GA E G. We have previously observed that E(Ma ) 6= 1 for some a by the Second Uniqueness Theorem. Hence GA = G. Then G = GB .  ∗ Lemma 16.3. (a) Let K, L ∈ Ω. Then [K, L] 6= 1 and CK (A) = CL∗ (A). # (b) Let a ∈ A with E(Ma ) 6= 1. Then E(Ma ) is A-quasisimple. Proof. (a). Theorem 14.1 implies that ‘does not commute’ is an equivalence relation on Ω. Let K1 , . . . , Kn be representatives for the equivalence classes and let [Ki ] denote the subgroup generated by the class of Ki . Suppose n ≥ 2. Then for all i 6= j we have [Ki ] ≤ θ(C(Kj )) so [Ki ] is a θ-subgroup. Moreover [Ki ] and [Kj ] commute. Then [Ki ] E h Ω i. Lemma 16.2 implies h Ω i = G and then Lemma 8.1(d) supplies a contradiction. Hence there is only one equivalence class so [K, L] 6= 1. ∗ Theorem 14.1 implies CK (A) = CL∗ (A). (b). Distinct A-components of Ma commute. Then (a) implies E(Ma ) is Aquasisimple.  Lemma 16.4. Let a ∈ A# . Then E(Ma ) = 1 or F (Ma ) = 1. Proof. Assume false. Then F (Ma ) 6= 1 and McBride’s Dichotomy implies that θ is nearsolvable, whence θ(A) is solvable. By Coprime Action(d) there exists B ∈ Hyp(A) with CF (Ma ) (B) 6= 1. Set Z = CF (Ma ) (B). Let b ∈ B # and suppose ∗ ∗ E(Mb ) 6= 1. Lemma 16.3 implies CE(M (A) = CE(M (A) so as [Z, E(Ma )] = 1 we a) b) ∗ ∗ (A) = CE(Mb ) (A) and have [Z, CE(Mb ) (A)] = 1. Now θ is nearsolvable so CE(M b) Z ≤ θ(b) ≤ Mb . Lemma 3.6 implies [Z, E(Mb )] = 1. But then Lemma 16.2 implies Z E G, contrary to Lemma 8.1(d).  Lemma 16.5. Let a ∈ A# with E(Ma ) 6= 1. Then Ma = θ(a). Proof. Assume false. Recall that θ(a) = CMa (a). Lemma 16.4 implies F (Ma ) = 1 so Coprime Action(g) implies [E(Ma ), a] 6= 1. Set K = E(Ma ), so K ∈ Ω by Lemma 16.3(b). Lemma 3.5(a) implies there exists D ∈ Hyp(A) such that [CK (D), a] 6= 1 and CK (d) is A-quasisimple for all d ∈ D# . ∗ Let L ∈ Ω. Lemma 16.3(a) and Theorem 14.1 imply [CK (A), CL∗ (A)] 6= 1. # Let d ∈ D and suppose CL (d) is A-quasisimple. Note that [CK (d), a] 6= 1 and ∗ that 1 6= [CK (A), CL∗ (A)] ≤ [CK (d), CL (d)]. Lemma 14.2(b), with θ(d), CK (d) and CL (d) in the roles of N, K0 and L0 respectively, forces CL (d) ≤ CK (d) ≤ K. Then Lemma 3.5(b) implies L ≤ K. But then, by Lemma 16.2, G = h Ω i ≤ K, a contradiction.  Proof of the Structure Theorem. (a). The Balance Theorem implies E(θ(a)) ≤ E(Ma ) so E(Ma ) 6= 1. Lemma 16.5 implies Ma = θ(a). Lemmas 16.4 and 16.3(b) imply that F (θ(a)) = 1 and then that E(θ(a)) is A-simple. Let B = CA (E(θ(a))). Coprime Action(g) implies B = CA (θ(a)), so as θ(a) = Ma ∈ L∗ we have Ma ≤ θ(b) ≤ Mb and then Ma = Mb for all b ∈ B # . Recall that rank(A) = 3. Then Lemma 11.2 implies B is cyclic. Consequently B = h a i as required. (b). Set J = E(E(θ(a)) ∩ C(b)) ≤ θ(b) and H = E(θ(a)) ∩ Mb . We may assume that J 6= 1. Then E(θ(a)) 6= 1. (a) implies E(θ(a)) is A-simple, so E(θ(a)) ∈ Ω. A NEW PROOF OF THE NONSOLVABLE SIGNALIZER FUNCTOR THEOREM 27 Since J ≤ H, Lemma 3.4 implies H (∞) is A-quasisimple. The Balance Theorem implies H (∞) ≤ E(Mb ), whence Mb = θ(b) by Lemma 16.5. Since J = J (∞) ≤ H (∞) we have J ≤ E(θ(b)). Finally, (c) follows from Lemma 16.2 and Lemma 16.5. This completes the proof of the Structure Theorem and hence of the Signalizer Functor Theorem.  References 1. M. Aschbacher, R. Lyons, S.D. Smith, R.M. Solomon, The Classification of the Finite Simple Groups: Groups of Characteristic 2-type, Mathematical Surverys and Monographs, 172, American Math. Soc., Providence Rhode Island 2011 2. H. Bender, On groups with abelian Sylow 2-subgroups, Math. Z., 117 (1970) 164–176 3. P. Flavell, A new proof of the Solvable Signalizer Functor Theorem, J. Algebra 398 (2014) 350–363 4. P. Flavell, An equivariant analogue of Glauberman’s ZJ-Theorem, J. Algebra 257(2) (2002) 249–264 5. P. Flavell, Automorphisms of soluble groups, Proceedings of the London Mathematical Society 2016 112 (4): 623–650 doi: 10.1112/plms/pdw005 6. P. Flavell, Automorphisms of K-groups I, Preprint: http://arxiv.org/abs/1609.01969 7. P. Flavell, Automorphisms of K-groups II, Preprint: http://arxiv.org/abs/1609.02380 8. P. Flavell, Primitive pairs of K-groups, Preprint: http://arxiv.org/abs/1609.03026 9. P. Flavell, A characterization of A-simple groups, Preprint: http://arxiv.org/abs/1609.03028 10. G. Glauberman, On solvable signalizer functors in finite groups. Proc. Lond. Math. Soc. (3) 33 (1976) 1–27. 11. D. Gorenstein, R. Lyons, R.M. Solomon, The classification of the finite simple groups, Mathematical Surverys and Monographs, 40, American Math. Soc., Providence Rhode Island 1994 12. D. Gorenstein, R. Lyons, R.M. Solomon, The classification of the finite simple groups. Number 2, Mathematical Surverys and Monographs, 40, American Math. Soc., Providence Rhode Island 1996 13. D. Gorenstein, Finite Simple Groups: An Introduction to their Classification. Plenum Press, New York 1982. 14. H. Kurzweil and B. Stellmacher, The theory of finite groups. An introduction. Universitext, Springer-Verlag, New York 2004. 15. P.P. McBride, Near solvable signalizer functors on finite groups, J. Algebra 78(1) (1982) 181-214 16. P.P. McBride, Nonsolvable signalizer functors on finite groups, J. Algebra 78(1) (1982) 215238 17. M. Suzuki, Group Theory II. Springer-Verlag, Berlin 1986 The School of Mathematics, University of Birmingham, Birmingham B15 2TT, Great Britain E-mail address: [email protected]
4math.GR
arXiv:1711.07924v1 [math.GR] 21 Nov 2017 c-NILPOTENT MULTIPLIER OF FINITE p-GROUPS FARANGIS JOHARI, MOHSEN PARVIZI, AND PEYMAN NIROOMAND Abstract. The aim of this work is to find some exact sequences on the cnilpotent multiplier of a group G. We also give an upper bound for the cnilpotent multiplier of finite p-groups and give the explicit structure of groups whose take the upper bound. Finally, we will get the exact structure of the cnilpotent multiplier and determine c-capable groups in the class of extra-special and generalized extra-special p-groups. It lets us to have a vast improvement over the last results on this topic. 1. introduction and motivation Let G be a group presented as the quotient F/R of a free group F by a normal subgroup R. The c-nilpotent multiplier of G is defined as γc+1 (F ) ∩ R M(c) (G) = γc+1 (R, F ) is the Baer invariant of G with respect to the variety of nilpotent groups of class at most c in which γc+1 (F ) is the (c + 1)-th term of the lower central series of F and γ1 (R, F ) = R, γc+1 (R, F ) = [γc (R, F ), F ], inductively. The c-nilpotent multiplier of G was born in the work of Baer [1](see also [5, 6, 12, 23] for more details in this topic). It is readily verified that the c-nilpotent multiplier M(c) (G) is abelian and independent of the choice of the free presentation of G (see [22]). The 1-nilpotent multiplier of G is denoted by M(G) and it is called the Schur multiplier of G. There are many stories involving this concept and it can be found for instance in [2, 9, 10, 19, 20, 21, 29, 30, 34]. The main reason to study the c-nilpotent multiplier comes from the isologism theory of P. Hall [14, 15]. It is an instrument for classification of groups into isologism classes. Some results about the Baer invariant can be found in [5, 6, 12, 23, 24, 26, 27, 28]. The aim of paper is to obtain some more inequalities on the c-nilpotent multiplier of a finite p-group G. For instance, among the results for non-abelian p-groups, we give a vast improvement over the result due to Moghaddam [26, 28]. The results also gives an extension of the results obtained recently in [32]. In the class of extraspecial p-groups and generalized extra-special p-groups, we characterize the explicit structure of the c-nilpotent multiplier. In the other direction, it seems finding a suitable upper bound may be useful to know more about the c-nilpotent multiplier and c-capability of groups. It is shown in [27, 28] that for a p-group G of order pn , |M(c) (G)||γc+1 (G)| ≤ |M(c) (Z(n) p )|, Date: March 29, 2018. Key words and phrases. c-Nilpotent multiplier, Capability, p-Groups. Mathematics Subject Classification 2010. Primary 20C25; Secondary 20D15. This research was supported by a grant from Ferdowsi University of Mashhad-Graduate Studys ( No. 31659). 1 2 F. JOHARI, M. PARVIZI, AND P. NIROOMAND (n) where Zp = Zp ⊕ Zp ⊕ · · · ⊕ Zp . | {z } n-times Using this inequality and Corollary 2.10 we have |M(c) (G)| is bounded by pχc+1 (n−1) , where c ≥ 2. We will show that the bound is attained exactly when G is elementary abelian similar to the result of [2, Corollary 2] due to Berkovich. Although we will reduce the upper bound as much as possible in the case of non-abelian p-groups, and as a result we will generalize the work of Berkovich [2] to the c-nilpotent multipliers of finite p-groups. Finally we are able to identify which of generalized extra-special p-groups are c-capable. It also generalizes the result about the capability and 2capability of extra-special p-groups in [4, 32]. 2. Preliminaries In this section, we state the concepts and results which will be used in the next sections. Notation. We use techniques involving the concept of basic commutators. Here is the definition. Let X be an arbitrary subset of a free group, and select an arbitrary total order for X. The basic commutators on X, their weight wt, and the order among them are defined as follows: (i) The elements of X are basic commutators of weight one, ordered according to the total order previously chosen. (ii) Having defined the basic commutators of weight less than n, a basic commutator of weight n is ck = [ci , cj ], where: (a). ci and cj are basic commutators and wt(ci ) + wt(cj ) = n, and (b). ci > cj , and if ci = [cs , ct ], then cj ≥ ct . (iii) The basic commutators of weight n follow those of weight less than n. The basic commutators of weight n are ordered among themselves in any total order, but the most common used total order is lexicographic order; that is, if [b1 , a1 ] and [b2 , a2 ] are basic commutators of weight n. Then [b1 , a1 ] < [b2 , a2 ] if and only if b1 < b2 or b1 = b2 and a1 < a2 . The number of basic commutators is given in the following: Theorem 2.1. (Witt Formula). The number of basic commutators of weight n on d generators is given by the following formula: 1X µ(m)dn/m , χn (d) = n m|n where µ(m) is the Möbius function, which is defined to be  if m = 1,  1 αk 1 0 if m = pα ∃αi > 1, µ(m) = 1 . . . pk  s (−1) if m = p1 . . . ps , where the pi , 1 ≤ i ≤ k, are the distinct primes dividing m. Theorem 2.2. ([13, M. Hall] and [17, Theorem 11.15(a)]) Let F be a free group on {x1 , x2 , . . . , xd }. Then for all i, 1 ≤ i ≤ n, γn (F ) γn+i (F ) is a free abelian group freely generated by the basic commutators of weights n, n + 1, . . . , n + i − 1 on the letters {x1 , x2 , . . . , xd }. c-NILPOTENT MULTIPLIER OF FINITE p-GROUPS 3 Recall that from [5] if N is a normal subgroup of G, then we can form the nonabelian tensor product (N ⊗ G) ⊗ G. Therefore N ⊗c G is defined recursively by N ⊗0 G = N and N ⊗c+1 G = (N ⊗c G) ⊗ G. Moreover, the exterior product N ∧c G is defined recursively by N ∧0 G = N and N ∧c+1 G = (N ∧c G) ∧ G. Here we give some results concerning M(c) (G) which are used in the proof of the main results. This result are proved in [27] for any variety, but we need them only for the variety of nilpotent groups of class at most c. Theorem 2.3. [27, Lemma 2.2] Let G be a finite group, B ✂ G and A = G/B. Then there exists a finite group L with a normal subgroup M such that (i) γc+1 (G) ∩ B ∼ = L/M , (ii) M ∼ = M(c) (G), (iii) M(c) (A) is a homomorphic image of L. Corollary 2.4. Let G be a finite group, B ✂ G and A = G/B. Then M(c) (A) divides M(c) (G) γc+1 (G) ∩ B . γc+1 (B, G) Proof. Let 1 → R → F → G → 1 be a free presentation of G and suppose B = S/R so that A = G/B ∼ = F/S. By Theorem 2.3, we have γc+1 (S, F ) = M(c) (G) γc+1 (R, F ) M(c) (A) Since γc+1 (G) ∩ B . h S F i γ (S, F ) R γc+1 (S, F ) c+1 ∼ γc+1 (B, G) ∼ = ,c , = = R R R R ∩ γc+1 (S, F ) γc+1 (S, F ) γc+1 (S, F ) = γc+1 (R, F ) R ∩ γc+1 (S, F ) = γc+1 (B, G) R ∩ γc+1 (S, F ) γc+1 (R, F ) R ∩ γc+1 (S, F ) . γc+1 (R, F ) It follows that M(c) (A) divides M(c) (G) γc+1 (G) ∩ B . γc+1 (B, G)  ′ ab For a group G, the quotient G/G is denoted by G . Lemma 2.5. Let G be a finite group and 1 → R → F → G → 1 be a free presentation of G. Let B be a central subgroup of G with B = S/R. Put A =  G ab γc+1 (S, F ) ∼ F/S. Then G/B = . is a homomorphic image of B ⊗c γc+1 (R, F ) γc+1 (S) B Proof. Define θ:B×  G ab |B  G ab γc+1 (S, F ) × ...× −→ B γ c+1 (R, F ) γc+1 (S) {z } c-times (sR, f1 F ′ S, . . . , fc F ′ S) 7−→ [s, f1 , . . . , fc ] γc+1 (R, F ) γc+1 (S) 4 F. JOHARI, M. PARVIZI, AND P. NIROOMAND where f1 , . . . , fc ∈ F, s ∈ S. Put T = γc+1 (R, F ) γc+1 (S). We claim that θ is welldefined. Let fi = fi′ xi yi where fi′ ∈ F, xi ∈ F ′ , yi ∈ S and 1 ≤ i ≤ c and also s = s1 r′ with r′ ∈ R, s1 ∈ S. It is easy to see that [s, f1 , . . . , fc ] ≡ [s1 , f1′ , . . . , fc′ ] mod T . This follows that θ is well-defined. Therefore there exists a unique homomorphism  G ab  G ab γc+1 (S, F ) ⊗ ...⊗ −→ θ:B⊗ B B γ (R, F ) γc+1 (S) c+1 | {z } c-times sR ⊗ f1 F ′ S ⊗ . . . ⊗ fc F ′ S 7−→ [s, f1 , . . . , fc ] γc+1 (R, F ) γc+1 (S), such that Im θ = γc+1 (S, F ) . γc+1 (R, F ) γc+1 (S)  Theorem 2.6. Let G be a finite group, B ⊆ Z(G) and A = G/B. Then  G ab M(c) (G) γc+1 (G) ∩ B divides M(c) (A) M(c) (B) B ⊗c . B Proof. Let 1 → R → F → G → 1 be a free presentation of G, and B be a central subgroup of G. Put B = S/R so that A ∼ = F/S. Clearly, [F, S] ⊆ R. By Theorem 2.3 and its proof, M(c) (G) γc+1 (G) ∩ B = M(c) (A) Since γc+1 (S, F ) . γc+1 (R, F ) γc+1 (S, F ) γc+1 (S, F ) γc+1 (R, F ) ∼ , = γc+1 (R, F ) γc+1 (S) γc+1 (R, F ) γc+1 (S) γc+1 (R, F ) we have M(c) (G) γc+1 (G) ∩ B = M(c) (A) γc+1 (S, F ) γc+1 (R, F ) γc+1 (S) γc+1 (R, F )γc+1 (S) . γc+1 (R, F ) But γc+1 (S) γc+1 (R, F )γc+1 (S) ∼ γc+1 (S) γ (R, S) c+1 ∼ . = = γc+1 (S) ∩ γc+1 (R, F ) γc+1 (R, F ) γc+1 (S) ∩ γc+1 (R, F ) γc+1 (R, S) Now since γc+1 (S) ⊆ γc+1 (S, F ) ⊆ [S, F ] ⊆ R, we have γc+1 (S) γc+1 (S) ∩ R = = M(c) (B). γc+1 (R, S) γc+1 (R, S) Therefore M(c) (A) M(c) (G) γc+1 (G) ∩ B = M(c) (B) γc+1 (S, F ) γc+1 (S)γc+1 (R, F ) γc+1 (S) ∩ γc+1 (R, F ) γc+1 (R, S) . Finally by Lemma 2.4, M(c) (G) γc+1 (G) ∩ B divides M(c) (A) M(c) (B) B ⊗c  G ab B . c-NILPOTENT MULTIPLIER OF FINITE p-GROUPS 5  We just need the results of the next three propositions, so they come without proof. Proposition 2.7. [5, Theorem 2.6] Let G be a group and B be a central subgroup of G. Then the sequence B ∧c G −→ M(c) (G) −→ M(c) (G/B) −→ B ∩ γc+1 (G) −→ 1 is exact. G. Ellis in [7] has generalized the formula of M. R. R. Moghaddam in [26], for the c-nilpotent multiplier of the direct product of two groups. In the next theorem Γc+1 (A, B) for abelian groups A and B is defined as follows. Let A and B be d-generator and d′ -generator abelian groups with generating sets {a1 , . . . , ad } and {b1 , . . . , bd′ }, respectively. For each basic commutator of weight c + 1 on {a1 , . . . , ad , b1 , · · · , bd′ } which is ordered as a1 < a2 < · · · < ad < b1 < b2 < · · · < bd′ such as [xi1 , · · · , xic+1 , (with any bracketing), we correspond an iterating tensor product X1 ⊗ · · · ⊗ Xc+1 in which Xij = A if xij ∈ {a1 , . . . , ad } and Xij = B if xij ∈ {b1 , . . . , bd′ }. Now Γc+1 (A, B) is the direct sum of all such iterated tensor products involving at least one A and one B. (See [7] for more information). Proposition 2.8. [7, Theorem 5] Let G and H be finite groups. Then there is an isomorphism M(c) (G × H) ∼ = M(c) (G) ⊕ M(c) (H) ⊕ Γc+1 (Gab , H ab ). (m) Let Zn denote the direct product of m copies of Zn . Proposition 2.9. [24, Theorem 2.4] Let G ∼ = Zn1 ⊕ . . . ⊕ Znk , where ni+1 ni , 1 ≤ i ≤ k − 1. Then M(c) (G) ∼ = Z(χc+1 (2)) ⊕ Z(χc+1 (3)−χc+1 (2)) ⊕ . . . ⊕ Z(χc+1 (k)−χc+1 (k−1)) . n2 nk n3 Where χr (s) is the number of all basic commutators of weight r on s letters. Corollary 2.10. Let G ∼ = Zpm1 ⊕ . . . ⊕ Zpmk , where m1 ≥ . . . ≥ mk . Then M(c) (G) ∼ = k M (χ Zpmc+1 i (i)−χc+1 (i−1)) . i=2 3. c-nilpotent multipliers of finite p-groups In this section, we intend to obtain an upper bound for the order of the cnilpotent multiplier of a finite p-group. While we’re working on the p-groups, the extra-special p-groups can not be overlooked. At first, we compute the c-nilpotent multipliers of these groups. The following theorem of Beyl et al. to see the analogies between the Schur multiplier and the c-nilpotent multiplier of extra-special p-groups (see Theorem 3.8). Theorem 3.1. (Beyl and Tappe 1982) [21, Theorem 3.3.6] Let G be an extra-special p-group of order p2n+1 . (i) If n > 1, then G is unicentral and M(G) is an elementary abelian p-group 2 of order p2n −n−1 . 6 F. JOHARI, M. PARVIZI, AND P. NIROOMAND (ii) Suppose that G of order p3 and p is odd. Then M(G) ∼ = Zp × Zp if G is of exponent p and M(G) = 0 if G is of exponent p2 . (iii) The quaternion group of order 8, Q8 , has trivial multiplier, whereas the multiplier of the dihedral group of order 8, D8 , is of order 2. The concept of epicenter Z ∗ (G) is defined by Beyl et al. in [4]. It gives a criterion for detecting capable groups. In fact G is capable if and only if Z ∗ (G) = 1. Ellis in [8] defined the exterior center Z ∧ (G) of G the set of all elements g of G for which g ∧ h = 1G∧G for all h ∈ G and he showed Z ∗ (G) = Z ∧ (G). Using the next lemma, the c-nilpotent multiplier of non-capable extra-special pgroups can be easily computed. Lemma 3.2. (See [4, Theorem 4.2]) Let N be a central subgroup of a group G. Then N ⊆ Z ∧ (G) if and only if M(G) → M(G/N ) is a monomorphism. Theorem 3.3. Let G be a non-capable extra-special p-group of order pn and c ≥ 2. Then M(c) (G) ∼ = M(c) (G/G′ ). Proof. Since G is a non-capable extra-special p-group, Z ∗ (G) = G′ . Now by virtue of Proposition 2.7, the sequence τ G′ ∧c G −→ M(c) (G) −→ M(c) (Gab ) −→ G′ ∩ γc+1 (G) −→ 1 is exact. The rest of proof is obtained by the fact that G is nilpotent of class 2 and Im τ = 0. Therefore M(c) (G) ∼ = M(c) (G/G′ ).  Corollary 3.4. Let G be a non-capable extra-special p-group of order p2n+1 and c ≥ 2. Then  χc+1 (2n) (c) ∼ . M (G) = Zp  χc+1 (2n) (c) ∼ Proof. By Corollary 2.10 and Theorem 3.3, we have M (G) = Zp .  There are only two capable extra-special p-groups, D8 and E1 , in which E1 is the extra-special p-group of order p3 and exponent p for odd p, in [4] . In the following we compute M(c) (E1 ) which has the following presentation. E1 = hx, y|xp = y p = [y, x]p = [y, x, y] = [y, x, x] = 1i. R ∩ γc+1 (F ) in which F is the free group on the set {x, y} [R,c F ] and R = hxp , y p , [y, x]p , [y, x, y], [y, x, x]iF . Since E1 is nilpotent of class 2, we have γc+1 (F ) ⊆ γ3 (F ) ⊆ R. Therefore for every c ≥ 2, γc+1 (F ) γ (F ) γ c+1 c+3 (F ) ∼ . M(c) (E1 ) = = [R,c F ] [R,c F ] γc+3 (F ) γc+1 (F ) is the free abelian group with the basis of all basic commuWe know that γc+3 (F ) tators of weights c + 1 and c + 2 on {x, y}, by Theorem 2.2. We have M(c) (E1 ) = c-NILPOTENT MULTIPLIER OF FINITE p-GROUPS 7 Theorem 3.5. With the above notations and assumptions we have  p [R,c F ] ≡ γc+1 (F ) (mod γc+3 (F )), f or all c ≥ 2. Proof. Using induction on c, the result is true for c = 2 ([32, Theorem 2.6]). Assume that the result holds for c ≥ 2. By hypothesis, we have " #  p [R,c+1 F ] ≡ γc+1 (F ) , F (mod γc+4 (F )). It follows that  p [R,c+1 F ] ≡ γc+2 (F ) (mod γc+4 (F )).  Theorem 3.6. With that above notations and assumptions we have  χc+1 (2)+χc+2 (2) (c) ∼ M (E1 ) = Zp , for c ≥ 2. γc+1 (F ) is the free abelian group with the γc+3 (F ) basis of all basic commutators of wight c + 1 and c + 2 on {x, y}. By Theorem 3.5, we have !p [R,c F ] γc+1 (F ) , = γc+3 (F ) γc+3 (F ) Proof. By Theorem 2.2, we know that so the result holds.  Theorem 3.7. [11, Theorem C] Let G be a group and 1 → R → F → G → 1 be a γc+1 (F ) ∗ , then free presentation of G. Put γc+1 (G) = γc+1 (R, F ) ∗ (i) 0 −→ M(c) (G) −→ γc+1 (G) −→ γc+1 (G) −→ 0 is exact. (ii) For n ≥ 2, we have  Zn n is odd ∗ ∼ , γc+1 (Dn ) = (χc+1 (2)−1) Zn × Z2 n is even where Dn is dihedral group of order 2n. (χ (2)−1) It is known that M(c) (D8 ) ∼ . Also we know that E2 , the = Z4 × Z2 c+1 extra-special p-group of order p3 and exponent p2 for odd p, and Q8 are not capable groups, so we can summarize the explicit structure of the c-nilpotent multipliers of all extra-special p-groups as follows, for c ≥ 2. Theorem 3.8. Let G be an extra-special p-group of order p2n+1 and c ≥ 2. (i) If n > 1, then M(c) (G) is an elementary abelian p-group of order pχc+1 (2n) . (χ (2)+χc+2 (2)) (ii) Suppose that G of order p3 and p is odd. Then M(c) (G) ∼ = Zp c+1 (χ (2)) c+1 if G is of exponent p and M(c) (G) ∼ if G is of exponent p2 . = Zp (χc+1 (2)) (iii) The quaternion group of order 8, Q8 , has Z2 as c-nilpotent multiplier and the c-nilpotent multiplier of the dihedral group of order 8, D8 , is Z4 × (χ (2)−1) Z2 c+1 . In the proof of some of next theorems, we need to work with the c-nilpotent multiplier of finite abelian p-groups. For abelian p-groups we have. 8 F. JOHARI, M. PARVIZI, AND P. NIROOMAND Theorem 3.9. Let G ∼ = Zpm1 ⊕ . . . ⊕ Zpmk , where m1 ≥ m2 ≥ . . . ≥ mk and |G| = pn . Then (i) M(c) (G) = pχc+1 (n) if and only if mi = 1 for all i. (ii) M(c) (G) ≤ pχc+1 (n−1) if and only if m1 ≥ 2. Pk Proof. Using Corollary 2.10, we have |M(c) (G)| = p i=2 (χc+1 (i)−χc+1 (i−1))mi . Define k X (χc+1 (i) − χc+1 (i − 1))mi . S(k : m1 , . . . , mk ) = i=2 It is easy to see that S(n : 1, . . . , 1) = χc+1 (n) and S(n : 2, 1, . . . , 1) = χc+1 (n − 1). Assume that for some j, we have mj > 1 an straightforward computation shows that S(k : m1 , . . . , mk ) − S(k + 1 : m1 , . . . , mj − 1, . . . , mk , 1) = (χc+1 (j − 1) − χc+1 (j)) + (χc+1 (k) − χc+1 (k + 1)) which is negative. Hence the maximum value of S(k : m1 , . . . , mk ) is S(n : 1, . . . , 1) and the next largest value of S(k : m1 , . . . , mk ) is S(n − 1 : 2, 1, . . . , 1).  Here we recall the notion of central product of two groups. Definition 3.10. The group G is a central product of A and B, if G = AB, where A and B are normal subgroups of G and A ⊆ CG (B). We denote the central product of two groups A and B by A · B. Recall that a group G is said to be minimal non-abelian if it is non-abelian but all its proper subgroups are abelian. The number minimal generators of group of G and the Frattini subgroup of G are denoted by d(G) and Φ(G), respectively. This lemma gives information on minimal non-abelian p-groups. Lemma 3.11. [35, Lemma 2.2] Assume that G is a finite nonabelian p-group. Then the following conditions are equivalent: (1) G is minimal non-abelian; (2) d(G) = 2 and |G′ | = p; (3) d(G) = 2 and Φ(G) = Z(G). For p-groups with small derived subgroup we have: Lemma 3.12. [3, Lemma 4.2] Let G be a p-group with |G′ | = p. Then G = (A1 · A2 · . . . · As )Z(G), the central product, where A1 , . . . , As are minimal nonabelian groups. Furthermore G/Z(G) is an elementary abelian group of even rank. The order of the c-nilpotent multiplier of a finite p-group depends somehow on the order of its derived subgroup. Lemma 3.13. Let G be a non-abelian finite p-group of order pn whose derived subgroup is of order p and c ≥ 2. Then M(c) (G) ≤ pχc+1 (n−1)+χc+2 (2) , and the (n−3) equality holds if and only if G ∼ = E1 × Zp . c-NILPOTENT MULTIPLIER OF FINITE p-GROUPS 9 Proof. By Lemma 3.12, G = (A1 · A2 · . . . · As )Z(G) where Ai ’s are minimal nonabelian groups. First suppose that Z(G) is not elementary abelian. Then by Theorem 2.6, we have M(c) (G) γc+1 (G) ∩ Z(G) ≤ M(c) (G/Z(G)) M(c) (Z(G)) Z(G) ⊗c G/Z(G) . Using Proposition 2.8 and Theorem 3.9(ii), since Z(G) ⊗c G/Z(G) is the direct summand of Γc+1 (Z(G), G/Z(G)), we have Z(G) ⊗c G/Z(G) ≤ Γc+1 (Z(G), G/Z(G)) . Therefore M(c) (G) ≤ M(c) (Z(G) × G/Z(G)) ≤ pχc+1 (n−1) ≤ pχc+1 (n−1)+χc+2 (2) . Now assume that Z(G) is elementary abelian. If |Z(G)| = p, then G is extra-special due to Theorem 3.8. We may assume that |Z(G)| ≥ p2 . If G/G′ is not elementary abelian, then by a similar way in the previous case and using Theorem 2.6 and Proposition 2.8, we have M(c) (G) γc+1 (G) ∩ G′ ≤ M(c) (G/G′ ) M(c) (G′ ) G′ ⊗c G/G′ . ≤ M(c) (G′ × G/G′ ) . Thus Theorem 3.9(ii), implies M(c) (G) ≤ pχc+1 (n−1) ≤ pχc+1 (n−1)+χc+2 (2) . Now assume that G/G′ is elementary abelian. It is shown that [29, Lemma 2.2], G is a central product of an extra-special p-group H of order p2k+1 and Z(G) of order pn−2k . Still in the case that Z(G) is elementary abelian, suppose that T be a complement of G′ in Z(G), we have Z(G) = G′ × T and so G = H × T . By Proposition 2.8, we have M(c) (G) = M(c) (H × T ) = M(c) (H) M(c) (T ) Γc+1 (H ab , T ) . If H is not capable, then Theorems 3.3 and 3.8 imply M(c) (H/H ′ ) = M(c) (H) = pχc+1 (2k) . By Theorem 3.9(ii), we have M(c) (G) = M(c) (T × H ab ) = pχc+1 (n−1) . Now assume that H = E1 or H = D8 . By Proposition 2.8 and Theorem 3.9 (ii), we have M(c) (T ) = pχc+1 (n−3) , Γc+1 (H ab , T ) = pχc+1 (n−1)−χc+1 (n−3)−χc+1 (2) . Thus M(c) (G) =  2χc+1 (n−1)+1 pχc+1 (n−1)+χc+2 (2) if p = 2, if p > 2. Now it is easy to see that M(c) (G) = pχc+1 (n−1)+χc+2 (2) if and only if G ∼ = (n−3) E1 × Zp . Now we are in a position to summarize the results in the following theorem.  10 F. JOHARI, M. PARVIZI, AND P. NIROOMAND Theorem 3.14. Let G be a p-group of order pn with |G′ | = pm (m ≥ 1) and c ≥ 2. Then c M(c) (G) ≤ pχc+1 (n−m)+χc+2 (2)+(m−1)(n−m) . In particular, if |G′ | = p, then we have M(c) (G) ≤ pχc+1 (n−1)+χc+2 (2) and the (n−3) equality holds in last one if and only if G ∼ = E1 × Zp . Proof. Let G be an arbitrary non-abelian p-group of order pn . We proceed by induction on m. The case m = 1 follows from Lemma 3.13. Therefore, we may assume that m ≥ 2. Let B a central subgroup of order p in G′ , by Theorem 2.6, we have M(c) (G) ≤ M(c) (G) γc+1 (G) ∩ B ≤ M(c) (G/B) B ⊗c Gab . Using induction hypothesis c M(c) (G/B) ≤ pχc+1 (n−m)+χc+2 (2)+(m−2)(n−m) , and so M(c) (G) ≤ pχc+1 (n−m)+χc+2 (2)+(m−2)(n−m) c +(n−m)c c = pχc+1 (n−m)+χc+2 (2)+(m−1)(n−m) , which completes the proof.  4. c-Capability of extra-special p-groups . The first study of the capability of extra-special p-groups was by Beyl et al. in [4]. They showed that in extra-special p-groups, only E1 and D8 are capable. Recently the last two authors, proved that for extra-special p-groups, the notions “capable” and “2-capable” are equivalent. Here we generalize it and show that for these groups, “capability” and “c-capability” are equivalent. Recall that if G is a c-capable group, that is G ∼ = E/Zc (E) for some group E; then G ∼ = E E /Z( ) which shows G is capable too. So we just have to prove the Zc−1 (E) Zc−1 (E) c-capability of D8 and E1 . To do this we need the following proposition which can be found in [5, Lemma 2.1(iv) and Proposition 1.2]. For the statement of this fact we need terminology from [5] as below. Let F/R be a free presentation for G and π : F/[R, c F ] −→ G be the canonical surjection. The c-central subgroup Zc∗ (G) of G is the image in G of the section term of the upper central series of F/[R, c F ]. More precisely it is equal to π(Zc (F/[R, c F ])). Proposition 4.1. [11, Proposition 12] (i) A group G is c-capable if and only if Zc∗ (G) is trivial; (ii) If N is normal subgroup of G contained in Zc∗ (G), then the canonical M(c) (G) −→ M(c) (G/N ) homomorphisms is injection. ∗ (iii) Zc+1 (G) contains Zc∗ (G) for c ≥ 0. Proposition 4.1 yields the sequences 1 = Z0∗ (G) ⊆ Z1∗ (G) ⊆ Z2∗ (G) ⊆ Z3∗ (G) ⊆ . . . , we recall that Z1∗ (G) the epicentre of G. Beyl’s results can be extended to c-capability as follows. c-NILPOTENT MULTIPLIER OF FINITE p-GROUPS 11 Theorem 4.2. An extra-special p-group is c-capable if and only if G is isomorphic to one of the groups D8 or E1 . Proof. Let G be an extra-special p-group of order p3 and exponent p. We will show there is no nontrivial normal subgroup of G for which the natural homomorphism M(c) (G) −→ M(c) (G/N ) is injective. Let N be a nontrivial normal subgroup of G, so G/N is an abelian p-group of order at most p2 and hence, Theorem 3.9 shows M(c) (G/N ) ≤ pχc+1 (2) . Since M(c) (G) = pχc+1 (2)+χc+2 (2) by Theorem 3.14, M(c) (G) −→ M(c) (G/N ) fails to be injective and the result holds. For the case G = D8 , we have D2c+1 /Zc (D2c+1 ) ∼  = D8 . The proof is complete. 5. c-Capability and c-nilpotent multiplier of generalized extra-special p-groups Jafari et al. in [18] studied the Schur multiplier of generalized extra-special p-groups. We obtain the c-nilpotent multiplier of a generalized extra-special pgroups. Niroomand and Parvizi in [31] first studied the capability of generalized extra-special p-groups. They showed that in generalized extra-special p-groups, only (n−3) and G = D8 ×Z2n−3 are capable. Here we generalize the results and G = E1 ×Zp show that for these groups, “capability” and “c-capability” are equivalent. Because non-capable groups are not c-capable, we just have to prove the c-capability of (n−3) (n−3) G = E1 × Zp and G = D8 × Z2 . Definition 5.1. [33, Definition 3.1] Let G be a finite p-group. Then G is called generalized extra-special p-group if Φ(G) = G′ ∼ = Zp . The structure of generalized extra-special p-groups is as follows. Here by Ep2m+1 we mean the extra-special p-group of order p2m+1 . Lemma 5.2. [33, Lemma 3.2] Let G be a generalized extra-special p-group. Then if Z(G) ∼ = Φ(G) × A then G ∼ = Ep2m+1 × A, and if Z(G) ∼ = Zp2 × A then G ∼ = (Ep2m+1 · Zp2 ) × A, in which A is an elementary abelian p-group. The capability of the generalized extra-special p-groups is determined in the following. Proposition 5.3. [31, Theorem 3.4] Let G be a generalized extra-special p-group. (n−3) (n−3) . G is capable if and only if G = E1 × Zp or G = D8 × Z2 Proposition 5.4. [18, Lemma 2.9] Let G be the generalized extra-special p-group 2 and isomorphic to Ep2m+1 · B such that B ∼ = Zp2 . Then M(G) = p2m +m−1 . The following proposition will be used in the next investigation. Proposition 5.5. Let G = Ep2m+1 · B such that B ∼ = Zp2 . Then Mc (G) = pχc+1 (2m) , for all c ≥ 2. Proof. By Proposition 5.3, since G is a non-capable generalized extra-special pgroup, Z ∗ (G) = G′ . Now by Proposition 4.1, the homomorphism M(c) (G) −→ M(c) (Gab ) is an isomorphism. Therefore M(c) (G) = M(c) (Gab ) . Now the result holds by Theorem 3.9.  The following theorem determines the c-capability of the generalized extraspecial p-groups. 12 F. JOHARI, M. PARVIZI, AND P. NIROOMAND Theorem 5.6. Let G be a generalized extra-special p-group and |G| = pn . G is (n−3) (n−3) c-capable if and only if G = E1 × Zp or G = D8 × Z2 . (n−3) Proof. Let G = E1 × Zp be a generalized extra-special p-group. We will show there is no nontrivial normal subgroup of G for which the natural homomorphism M(c) (G) −→ M(c) (G/N ) is injective. Let N be a nontrivial normal subgroup of G, so G/N is an abelian p-group of order at most pn−1 and hence Theorem 3.9 (i) shows M(c) (G/N ) ≤ pχc+1 (n−1) . Since M(c) (G) = pχc+1 (n−1)+χc+2 (2) by Theorem 3.14, M(c) (G) −→ M(c) (G/N ) fails to be injective and the result holds. (n−3) Now Proposition 4.1 shows G = E1 ×Zp is c-capable. The proof for the case G = (χ (2)−1) (n−3) .  D8 × Z2 is completely similar expect that M(c) (D8 ) ∼ = Z4 × Z2 c+1 Corollary 5.7. Let G be a generalized extra-special p-group. Then G is c-capable if and only if G is capable. References [1] R. Baer, Representations of groups as quotient groups, I, II, and III. Trans Amer. Math. Soc. 54 (1945) 295-419. [2] Ya. G. Berkovich, On the order of the commutator subgroups and the Schur multiplier of a finite p-group, J. Algebra 144 (1991) 269-272. [3] Ya. G. Berkovich, Zvonimir, J. Groups of Prime Power Order. Vol. 2. de Gruyter Expositions in Mathematics, 47. Walter de Gruyter GmbH & Co. KG, Berlin, 2008. [4] F. R. Beyl, U. Felgner, P. Schmid, On groups occurring as center factor groups, J. Algebra 61 (1970) 161-177. [5] J. Burns, G. Ellis, On the nilpotent multipliers of a group, Math. Z. 226 (1997) 405-428. [6] J. Burns, G. Ellis, Inequalities for Baer invariants of finite groups. Canad. Math. Bull. 41 No. 4, (1998) 385-391. [7] G. Ellis, On groups with a finite nilpotent upper central quotient, Arch. Math. 70 (1998) 89-96. [8] G. Ellis, Tensor products and q-crossed modules, J. London Math. Soc. 51(2) (1995) 243-258. [9] G. Ellis, On the Schur multiplier of p-groups, Comm. Algebra 9 (1999) 4173-4177. [10] G. Ellis, J. Wiegold, A bound on the Schur multiplier of a prime power group, Bull. Austral. Math. Soc. 60 (1999) 191-196. [11] G. Ellis, On the relation between upper central quotient and lower central series of a group, A.M.S. Soc. 353 (2001) 4219-4234. [12] A, Fröhlich, Baer invariants of algebras. Trans. Amer. Math. Soc. 109, (1962) 221-244. [13] M. Hall, The Theory of Groups, MacMillan Company, NewYork, 1959. [14] P. Hall, The classificatin of prime-power groups, J. Reine Angew. Math. 182 (1940) 130-141. [15] P. Hall, Verbal and marginal subgroups, J. Reine Angew. Math. 182 (1940) 156-157. [16] H. Heineken, D. Nikolova, Class two nilpotent capable groups, Bull. Austral. Math. Soc. 54 (1996) 347-352. [17] B. Huppert, N. Blackburn, Finite Groups II (Springer, Berlin, 1982). [18] S. H. Jafari, F. Saeedi, E. Khamseh, Characterization of finite p-groups by their non-abelian tensor square, Comm. Algebra, 41 (2013) 1954-1963, [19] M. R. Jones, Multiplicutors of p-groups, Math Z. 127 (1972) 165-166. [20] M. R. Jones, Some inequalities for the multiplicator of a finite group, Proc. Amer. Math. Soc. 39 (1973) 450-456. [21] G. Karpilovsky, The Schur Mulptiplier, N.S. 2, London Math . Soc. Monogr, 1987. c-NILPOTENT MULTIPLIER OF FINITE p-GROUPS 13 [22] C. R. Leedham-Green, S. MacKay, Baer invariants, isologism, varietal laws and homology, Acta Math. 137(1976) 99-150. [23] J. L. MacDonald, Group derived functors. J. Algebra 10 (1968) 448-477. [24] B. Mashayekhy, M. A. Sanati, On the order of nilpotent multipliers of finite p-groups, Comm. Algebra 33(7) (2005) 2079-2087. [25] B. Mashayekhy, F. Mohammadzadeh, Some inequalities for nilpotent multipliers of powerful p-groups, Bull. Iranian Math. Soc. Vol. 33, No. 2 (2007) 61-71. [26] M. R. R. Moghaddam, The Baer invariant of a direct product, Arch. Math. 33 (1980) 504-511. [27] M. R. R. Moghaddam, Some inequalities for Baer invariant of a finite group, Bull. Iranian Math. Soc. 9 (1981) 5-10. [28] M. R. R. Moghaddam, On the Schur-Baer property. J. Austral. Math. Soc. Ser. A 31 (1981) 343-361. [29] P. Niroomand, On the order of Schur multiplier of non-abelian p-groups, J. Algebra 322 (2009) 4479-4482. [30] P. Niroomand, The Schur multiplier of p-groups with large derived subgroup, Arch. Math. 95 (2010) 101-103. [31] P. Niroomand, M. Parvizi, A remark on the capability of finite p-groups, J. Adv. Res. Pure Math (2013) 91-95. [32] P. Niroomand , M. Parvizi, On the 2-nilpotent multiplier of finite p-groups, Glasg. Math J. 57 (2015) 201-210. [33] R. Stancu, Almost all generalized extra-special p-groups are resistant. J. Algebra 249 (2002) 120-126. [34] X. Zhou, On the order of Schur multipliers of finite p-groups, Comm. Algebra 1 (1994) 1-8. [35] Xu, M. Y., An, L. J. and Zhang, Q. H., Finite p-groups all of whose non-abelian proper subgroups are generated by two elements, J. Algebra, 319, 2008, 3603-3620 Department of Pure Mathematics, Ferdowsi University of Mashhad, Mashhad, Iran E-mail address: [email protected] Department of Pure Mathematics, Ferdowsi University of Mashhad, Mashhad, Iran E-mail address: [email protected] School of Mathematics and Computer Science, Damghan University, Damghan, Iran E-mail address: [email protected], p [email protected]
4math.GR
Power-Based Direction-of-Arrival Estimation Using a Single Multi-Mode Antenna Robert Pöhlmann, Siwei Zhang, Thomas Jost, Armin Dammann arXiv:1706.09690v3 [cs.IT] 30 Jan 2018 German Aerospace Center (DLR) Institute of Communications and Navigation Oberpfaffenhofen, 82234 Wessling, Germany Email: {Robert.Poehlmann, Siwei.Zhang, Thomas.Jost, Armin.Dammann}@dlr.de Abstract—Phased antenna arrays are widely used for direction-of-arrival (DoA) estimation. For low-cost applications, signal power or received signal strength indicator (RSSI) based approaches can be an alternative. However, they usually require multiple antennas, a single antenna that can be rotated, or switchable antenna beams. In this paper we show how a multi-mode antenna (MMA) can be used for power-based DoA estimation. Only a single MMA is needed and neither rotation nor switching of antenna beams is required. We derive an estimation scheme as well as theoretical bounds and validate them through simulations. It is found that power-based DoA estimation with an MMA is feasible and accurate. I. I NTRODUCTION The state-of-the-art approach of direction-of-arrival (DoA) estimation relies on signal phase differences (assuming narrowband signals) between the elements of an antenna array [1]. DoA estimation methods are well known, however using an antenna array requires a complex receiver structure. For each array element, a separate receiver channel is required and the receiver channels have to be coherent and the system well calibrated. For low-cost applications, another possibility is to use signal power, i.e. received signal strength indicator (RSSI) measurements for DoA estimation. This requires knowledge of the antenna pattern and the possibility to cancel out or estimate the unknown path loss and transmit power of the signal. In this paper we focus on power-based DoA estimation. Different techniques can be found in literature. One approach is to use an array of directional antennas pointing in different directions, see e.g. [2]. If only one antenna is available, an actuator can be used to rotate the antenna and thus obtain measurements from different angles. This approach may be used with either omnidirectional antennas having knowledge of the null in the pattern, see e.g. [3], or directional antennas, e.g. [4]. Instead of rotating the antenna, it is possible to make a controlled movement with the whole platform (e.g. a quadrocopter) [5]. Mechanical actuators have the drawback that they increase the power consumption of the system, possibly need maintenance and limit the update rate. Hence the authors in [6] avoid moving parts and propose a switched beam antenna. In general, high-resolution properties can be achieved with RSSI measurements. In [7], a variant of multiple signal characterization (MUSIC) suitable for signal power measurements is presented. The authors in [8] apply methods known from finite-rate-of-innovation (FRI) sampling to obtain high-resolution. All methods in the literature that the authors are aware of have in common that they either use multiple antennas or a single antenna with some sort of rotational movement or beams that require switching. In contrast, this paper presents a power-based DoA estimation scheme with a multi-mode antenna (MMA), which does not require any movement or switching of antenna beams. An MMA is in fact a single antenna element. Compared to antenna arrays, it has the advantage of being more compact, which can be important for applications with size constraints. The remainder of this paper is organised as follows. In Section II, the concept of the MMA is introduced. Section III quickly recapitulates the theoretical basis of this work termed wavefield modelling. The DoA estimation scheme is then developed in Section IV. The performance is evaluated in terms of theoretical bounds and simulations. Section V concludes the paper. II. M ULTI -M ODE A NTENNA In this section we provide a brief introduction to MMAs. The concept of MMAs is based on the theory of characteristic modes [9], [10]. This theory is available for more than 40 years, with significant amount of attention over the last 15 years. Recently the theory is more popular among antenna designers and is now known to be a useful design aid [11]. The main idea is to express the surface current distribution of conducting bodies as a sum of orthogonal functions called characteristic modes. These modes are independent of the excitation, i.e. they are defined by the shape and the size of the conductor. It is possible to determine modes numerically for antennas of arbitrary shape. For electrically small conductors, few modes are sufficient to describe the antenna behaviour [12]. Hence, electrically small conductors are well suited for an application of the theory of characteristic modes. The idea of MMAs is to excite different characteristic modes independently. The current distribution for the particular mode, found by the theory of characteristic modes, defines the locations for excitation. In general, excitation is possible by inductive coupling at the current maxima, or by capacitive coupling at the respective minima [13]. The couplers belonging 0/ !30/ 30/ !60/ 60/ !90/ 90/ -20dB -15dB -10dB -5dB 0dB Port 1 Fig. 2. Fig. 1. -15 -10 Power [dB] -5 0 MMA power patterns for RHCP Port 3 WAVEFIELD M ODELLING The MMA is described in terms of spatial samples of the antenna power pattern obtained by electromagnetic field (EMF) simulation or calibration measurements. Since that representation might be relatively sparse, an interpolation strategy is needed, where we apply wavefield modelling and manifold separation [18]. In general, the manifold of the MMA is defined by θ ∈ [−π, π) for 2D and θ ∈ [0, π], φ ∈ [0, 2π) for the 3D case, where θ is the co-elevation and φ the azimuth. If a function is square integrable on this manifold, then it can be expanded in terms of an orthonormal basis. Hence the power pattern of an MMA with M ports, g(θ, φ) ∈ RM ×1 , can be decomposed [18], such that g(θ, φ) = G Ψ(θ, φ). to one mode are then connected to one port of the antenna. Due to the different modes being orthogonal to each other, MMAs are able to provide sufficient isolation of the ports [14]. Compared to classic antenna arrays MMAs are potentially more compact, which could be an advantage for applications with stringent size and weight constraints. The theory of characteristic modes provides a useful tool to design chassis antennas. For example, the case structure of a mobile handset device [15] or the platform of an unmanned aerial vehicle (UAV) can be used as antenna [16]. To the authors knowledge, MMAs have so far been investigated only for communication applications, see e.g. [17]. The aim of this paper is to show how their potential can be used for DoA estimation, enabling applications like localisation and orientation estimation. The antenna that we analyse in this paper has been proposed in [14]. Figure 1 shows the power pattern of this four port MMA for right hand circular polarisation (RHCP). The respective power pattern of the x-z plane is given in Figure 2. Obviously the antenna gain strongly depends on the incident angle of the signal. Moreover, the antenna patterns differ significantly between the four ports. Therefore the received signal power could be used to estimate the DoA of the signal. In the following, we assume that the polarisation of the received narrowband signal is purely RHCP. Port 4 MMA x-z plane power patterns for RHCP III. -20 Port 2 (1) The matrix G ∈ RM ×N is called sampling matrix and Ψ(θ, φ) ∈ RN ×1 is the basis vector, with N being the order of the basis. For 2D, the Fourier functions, 1 Ψ(θ) = √ ejnθ , n = [−N, ..., N ], (2) 2π can be used as a basis. Then Gm,N/2+1:N = G∗m,1:N/2 , because g(θ) must be real valued. For 3D we use the real spherical harmonic functions, √ m m  m>0  2Nl cos(mφ)Pl (cos(θ)) m 0 m m=0 Yl (θ, φ) = Nl Pl (cos(θ))  √2N |m| sin(|m|φ)P |m| (cos(θ)) m < 0, l l (3) with degree l = 0, ..., L and order m = −l, ..., l. Plm (.) is the associated Legendre polynomial with degree l and order m. The normalization factor Nlm is given by s 2l + 1 (l − m)! Nlm = . (4) 4π (l + m)! Using the enumeration n = (l + 1)l + m, we can form an orthonormal basis, Ψ(θ, φ) = Yn (θ, φ), n = [0, ..., N ]. (5) It is known that the magnitude of G decays superexponentially for n → ∞ beyond n = kr, with k being the angular wavenumber and r the radius of the smallest sphere enclosing Port 1 0 0 l 5 l 5 Port 2 10 10 15 -15 -10 -5 0 15 -15 -10 -5 5 10 15 m Port 3 0 0 5 10 15 m 0 (7) 10 15 -15 -10 -5 0 5 10 15 15 -15 -10 -5 m -100 0 5 10 15 m -80 -60 -40 Magnitude [dB] -20 with the antenna power pattern gm (θ) and the signal power Ps . We follow an RSSI based approach, hence only power measurements are available to the receiver. The antenna power patterns, g(θ) = [g1 (θ), ..., gM (θ)], are normalized such that max g(θ) = 1. The SNR for gm (θ) = 1 is then given by Ps . (8) σ2 Defining rm,r (k) = Re[rm (k)] and rm,i (k) = Im[rm (k)], the sum of the squared magnitude of the received signal, SNR = 0 Fig. 3. Magnitude of spherical harmonic coefficients, indices l and m are degree and order of the spherical harmonics in (3) Sr,m = K X |rm (k)|2 = k=1 the antenna [18]. Figure 3 shows the magnitude of G, i.e. the spherical harmonic coefficients, for the MMA. As can be seen, most of the energy is contained in the low order coefficients. Hence the expansion can be safely truncated at a certain order. As (1) is linear, having enough spatial samples of the antenna power pattern g̃(θ, φ) available from calibration measurements or EMF simulation, it is straightforward to determine the sampling matrix G for a given basis Ψ(θ, φ). Due to the assumption of narrowband and pure polarisation, it is sufficient to consider a scalar wavefield. Nevertheless, an extension to vector fields is possible [19]. Having a suitable model of the antenna at hand, we will now take a look at power-based DoA estimation. IV. k=1 = gm (θ, φ)Ps + σ 2 , Port 4 l 10 k=1 gm (θ,φ) 5 l 5 over K samples in time can be calculated by " # K 1 X 2 E[Pr,m ] = E |rm (k)| K k=1 " # K K X 1 X 2 1 2 2 |s(k)| + E |nm (k)| = |am (θ, φ)| | {z } K K D IRECTION - OF -A RRIVAL E STIMATION For simplicity, the derivations and simulations in Sections IV-A to IV-D focus on the 2D case, i.e. only a single angle θ is to be estimated. The extension to 3D and two angles of arrival follows in Section IV-E. The received, sampled signal rm (k) at port m of the MMA is given by 2 2 rm,r (k)+rm,i (k) ∼ χ2 (2K, λ, σ 2 /2) k=1 (9) follows a noncentral χ2 distribution [20] with 2K degrees of freedom and noncentrality parameter λ= = = K X E[rm,r (k)]2 + E[rm,i (k)]2  k=1 K X (am (θ))2 (Re[s(k)]2 + Im[s(k)]2 ) k=1 K X (10) gm (θ)|s(k)|2 k=1 = Kgm (θ)Ps . Its probability density function (PDF) is given by √ ! K−1 λx 2 1  x  2 − λ+x e σ2 IK−1 , pSr,m (x) = 2 σ λ σ2 (11) with the modified Bessel function of the first kind Iν (.). Since Pr,m is just a scaled version of that, its distribution can be obtained by transformation pPr,m (x) = KpSr,m (Kx). Inserting (10), we obtain pPr,m (x) = A. Signal Model K X K σ2  x gm (θ)Ps  K−1 2 IK−1 e− K(gm (θ)Ps +x) σ2 2K p gm (θ)Ps x σ2 ! . (12) The mean and variance are given by rm (k) = am (θ)s(k) + nm (k) (6) where k is the sample index, am (θ) is the attenuation caused by the antenna, s(k) is the transmitted signal as it arrives at the receive antenna and nm (k) ∼ CN (0, σ 2 ) is white circular symmetric normal distributed noise with variance σ 2 . Assuming stationarity, the time-averaged received signal power µ̃m = E[Pr,m ] = K −1 E[Sr,m ] = K −1 (Kσ 2 + λ) = gm (θ)Ps + σ 2 , (13) 2 σ̃m = VAR[Pr,m ] = K −2 VAR[Sr,m ] = K −2 (Kσ 4 + 2σ 2 λ) = K −1 (σ 4 + 2gm (θ)Ps σ 2 ). (14) The parameters to be estimated are given by 2 Γ = [θ, Ps , σ ]. (15) MSE(3) [deg] B. ML Estimator 101 We consider the case of unknown signal power Ps and noise variance σ 2 . Using the Gaussian approximation, i.e. K is large, the log-likelihood function for the signal power measurements Pr = [Pr,1 , ..., Pr,M ] can be written as 10!2 -90 Γ̂ML = arg max ln p(Pr ; Γ) Γ + ln 2πK 4 2  (σ + 2gm (θ)Ps σ ) (17) m=1 K(Pr,m − Ps gm (θ) − σ 2 )2 . σ 4 + 2Ps gm (θ)σ 2 Γ M X (Pr,m − Ps gm (θ) − σ 2 )2 , Ps gm (θ) + 2σ 2 m=1 100 10!1 10!2 -10 A simplified version of the estimator, Γ̂S = arg min 90 101 MSE(3) [deg] The corresponding maximum likelihood (ML) estimator can then be derived as −1 45 102 2 1 Pr,m − (gm (θ)Ps + σ 2 ) . (16) 2 2σ̃m M X 0 RMSE of the simulation and CRB for SNR = 20 dB p − -45 3 [deg] 1 2 ln p(Pr ; Γ) = − ln(2πσ̃m ) 2 m=1 Γ 10!1 Fig. 4. M X = arg min 100 CRB ^ ML ! p For large λ or large K, (12) is approximately Gaussian 2 distributed Pr,m ∼ N (µ̃m , σ̃m ). CRB ^ ML 90/ FOV ! ^ ML 180/ FOV ! ^ S 90/ FOV ! ^ S 180/ FOV ! 0 10 20 30 40 SNR [dB] (18) Fig. 5. Simulated RMSE of ML and simplified estimator and CRB vs. SNR for full (180◦ ) and limited (90◦ ) FOV can be obtained by neglecting the logarithmic term. D. Simulation Results C. CRB Derivation A lower bound on the variance of any unbiased estimator is the Cramér-Rao bound (CRB) [21]. For a given set of unknowns Γ = [θ, Ps , σ 2 ], it is defined as the inverse of the Fisher information matrix (FIM) I(Γ), VAR[Γ̂] ≥ I(Γ)−1 . (19) Following the Gaussian assumption in (16), the elements of the FIM I(Γ) ∈ R3×3 can be calculated as [21] [I(Γ)]i,j = M 2 2 X 1 ∂ µ̃m ∂ µ̃m 1 ∂ σ̃m ∂ σ̃m + . 4 ∂Γ ∂Γ σ̃ 2 ∂Γi ∂Γj 2σ̃m i j m=1 m (20) Calculation of the partial derivatives of (13) and (14) requires the derivative of (1) and (2), which is given by ∂g(θ) jn = G √ ejnθ , n = [−N, ..., N ]. ∂θ 2π (21) Finally we obtain the CRB for the estimation of θ, VAR[θ] ≥ [I(Γ)−1 ]1,1 = CRB(θ). (22) In order to evaluate the feasibility of the proposed DoA estimation approach, we have used EMF simulation data of the MMA prototype, visualized in Figure 2. The simulated root-mean-square error (RMSE) and the CRB depending on θ are shown in Figure 4. The plot indicates that the achievable accuracy depends on the incident angle, with a RMSE spread of more than one order of magnitude over the manifold. Nevertheless, the ML estimator is able to attain the CRB for high signal-to-noise ratio (SNR). In Figure 5 the mean over the manifold is plotted in dependence of the SNR present at the receiver. We have seen earlier, in Figure 2, that the antenna patterns are relatively symmetric around 0◦ . For that reason, we compare the performance with a limited field of view (FOV) of 90◦ to the full FOV of 180◦ . It can be seen that for SNR ≥ 18 dB, the ML estimator Γ̂ML defined in (17) is efficient, i.e. it attains the CRB. For lower SNR, the RMSE is significantly bigger for 180◦ due to ambiguities caused by the antenna pattern. The CRB is calculated independent of the a-priori information regarding FOV limitation, hence it is not an accurate lower bound in the low SNR region. Finally the plot indicates that the simplified estimator Γ̂S given by (18) is sufficiently accurate. Only for high SNR, a slight increase in RMSE compared to the ML 101 101 100 100 10!1 10!1 p p CRB(θ) (left) and CRB(φ) (right) for SNR = 20 dB Fig. 8. p p CRB(θ) (left) and CRB(φ) (right) for SNR = 30 dB 102 101 101 [deg] 102 [deg] Fig. 6. [deg] 102 [deg] 102 Fig. 7. 100 100 10!1 10!1 Fig. 9. p p M SE(θ) (left) and M SE(φ) (right) for SNR = 20 dB estimator is visible. E. Extension to 3D Having studied the performance in 2D, we now extend the proposed DoA estimation scheme to the more practical case of 3D, i.e. two unknown angles of arrival. The extension of the signal model to 3D, rm (k) = am (θ, φ)s(k) + nm (k), (23) is straight forward. One more parameter, φ, has to be estimated, so we have Γ = [θ, φ, Ps , σ 2 ]. The FIM then grows to I(Γ) ∈ R4×4 . Applying wavefield modelling with spherical harmonics as described in Section III, the partial derivatives of the antenna power pattern are ∂g(θ, φ) ∂ = G Yn (θ, φ), ∂θ ∂θ ∂g(θ, φ) ∂ = G Yn (θ, φ), ∂φ ∂φ (24a) (24b) using the enumeration n = (l + 1)l + m. The partial derivative of (3) with respect to θ (for θ 6= 0) is given by √ m ∂P m (cos(θ)) 2Nl cos(mφ) l ∂θ   ∂ m ∂P m (cos(θ)) Yl (θ, φ) = Nl0 l ∂θ  ∂θ |m| √ |m| ∂P (cos(θ)) 2Nl sin(|m|φ) l ∂θ m>0 m=0 m < 0. (25) The derivative of the Legendre polynomial Plm (cos(θ)), l+1 m ∂Plm (cos(θ)) 1+l−m m = Pl+1 (cos(θ))− P (cos(θ)), ∂θ sin(θ) tan(θ) l (26) p p M SE(θ) (left) and M SE(φ) (right) for SNR = 30 dB can be calculated with the help of [22]. The corresponding partial derivative of (3) with respect to φ is given by √ m m  m>0  2Nl (−m) sin(mφ)Pl (cos(θ)) ∂ m m=0 Y (θ, φ) = 0  ∂φ l √2N |m| (−m) cos(mφ)P |m| (cos(θ)) m < 0. l l (27) Finally we obtain the CRBs for the estimation of θ and φ in the 3D case, VAR[θ̂] ≥ [I(Γ)−1 ]1,1 = CRB(θ), (28a) −1 (28b) VAR[φ̂] ≥ [I(Γ) ]2,2 = CRB(φ). In order to confirm the expected DoA estimation performance, we performed simulations for the 3D case. Figure 6 shows the CRB in θ- and φ-domain for SNR = 20 dB. The corresponding simulation result can be seen in Figure 7. Apparently, the CRB is not attained on the whole manifold. Especially for low elevations, an excessive estimation error can be observed. Taking another look at the antenna power pattern in Figure 1, it is obvious that at low elevations the antenna gain is very small. This leads to a degradation of the DoA estimation performance. For mid and high elevations, the CRB is usually attained, except for a few directions which appear as dark dots in Figure 7. This is most likely caused by estimation ambiguities due to the symmetry of the antenna pattern. In practice a-priori information, i.e. a rough knowledge of the direction, is often available, which may help to solve the ambiguity. Next we take a look at Figures 8 and 9 showing the CRB and simulation RMSE at SNR = 30 dB. To allow comparison, Figures 6 to 9 use the same scaling. It can be seen that by increasing the SNR by 10 dB, both perturbing effects, i.e. low gain at low elevation angles and estimation ambiguities, are strongly reduced. Only for low elevations, an increased error can still be observed. The higher RMSE at high elevation for the φ-domain is less problematic, since at the pole this translates to a smaller directional error. V. C ONCLUSION A suitable model for MMAs, building on the concept of wavefield modelling, was introduced. Based on that model, a power-based maximum likelihood DoA estimation scheme has been introduced. Simulations have shown that in general, power-based DoA estimation with MMAs is feasible. However, for certain incident angles, ambiguities in the antenna pattern cause an increased estimation variance. For the investigated MMA prototype, low elevations are problematic due to low antenna gain. Altogether it can be concluded that power-based DoA estimation is possible with MMAs, but for accurate estimates a relatively high SNR is required. Further work will be performed by using signal polarisations as well as investigations into coherent receivers, that are able to obtain phase information from the different ports of the MMA. [12] [13] [14] [15] [16] [17] ACKNOWLEDGMENT This work has been funded by the German Research Foundation (DFG) under contract no. HO 2226/17-1. The authors are grateful for the constructive cooperation with Sami Alkubti Almasri, Niklas Doose and Prof. Peter A. Hoeher from the University of Kiel. Also, the authors would like to thank Prof. Dirk Manteuffel and his team for providing the antenna pattern of the MMA prototype investigated in this paper. R EFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] T. E. Tuncer and B. Friedlander, Classical and Modern Direction-ofArrival Estimation. Academic Press, Jul. 2009. J. Ash and L. Potter, “Sensor network localization via received signal strength measurements with directional antennas,” in Proceedings of the 2004 Allerton Conference on Communication, Control, and Computing, 2004, pp. 1861–1870. M. Malajner, P. Planinsic, and D. Gleich, “Angle of Arrival Estimation Using RSSI and Omnidirectional Rotatable Antennas,” IEEE Sensors Journal, vol. 12, no. 6, pp. 1950–1957, Jun. 2012. B. N. Hood and P. Barooah, “Estimating DoA From Radio-Frequency RSSI Measurements Using an Actuated Reflector,” IEEE Sensors Journal, vol. 11, no. 2, pp. 413–417, Feb. 2011. J. T. Isaacs, F. Quitin, L. R. G. Carrillo, U. Madhow, and J. P. Hespanha, “Quadrotor control for RF source localization and tracking,” in 2014 International Conference on Unmanned Aircraft Systems (ICUAS), May 2014, pp. 244–252. A. Cidronali, S. Maddio, G. Giorgetti, and G. Manes, “Analysis and Performance of a Smart Antenna for 2.45-GHz Single-Anchor Indoor Positioning,” IEEE Transactions on Microwave Theory and Techniques, vol. 58, no. 1, pp. 21–31, Jan. 2010. M. Passafiume, S. Maddio, A. Cidronali, and G. Manes, “MUSIC algorithm for RSSI-based DoA estimation on standard IEEE 802.11/802.15. x systems,” WSEAS Trans. Signal Process., vol. 11, pp. 58–68, 2015. J. P. Lie, T. Blu, and C. M. S. See, “Single Antenna Power Measurements Based Direction Finding,” IEEE Transactions on Signal Processing, vol. 58, no. 11, pp. 5682–5692, Nov. 2010. R. Garbacz and R. Turpin, “A generalized expansion for radiated and scattered fields,” IEEE Transactions on Antennas and Propagation, vol. 19, no. 3, pp. 348–358, 1971. R. Harrington and J. Mautz, “Theory of characteristic modes for conducting bodies,” IEEE Transactions on Antennas and Propagation, vol. 19, no. 5, pp. 622–628, 1971. B. K. Lau, D. Manteuffel, H. Arai, and S. V. Hum, “Guest Editorial Theory and Applications of Characteristic Modes,” IEEE Transactions on Antennas and Propagation, vol. 64, no. 7, pp. 2590–2594, Jul. 2016. [18] [19] [20] [21] [22] M. Cabedo-Fabres, E. Antonino-Daviu, A. Valero-Nogueira, and M. F. Bataller, “The theory of characteristic modes revisited: A contribution to the design of antennas for modern applications,” IEEE Antennas and Propagation Magazine, vol. 49, no. 5, pp. 52–68, 2007. R. Martens, E. Safin, and D. Manteuffel, “Inductive and capacitive excitation of the characteristic modes of small terminals,” in Antennas and Propagation Conference (LAPC), 2011 Loughborough. IEEE, 2011, pp. 1–4. D. Manteuffel and R. Martens, “Compact Multimode Multielement Antenna for Indoor UWB Massive MIMO,” IEEE Transactions on Antennas and Propagation, vol. 64, no. 7, pp. 2689–2697, Jul. 2016. H. Li, Y. Tan, B. K. Lau, Z. Ying, and S. He, “Characteristic Mode Based Tradeoff Analysis of Antenna-Chassis Interactions for Multiple Antenna Terminals,” IEEE Transactions on Antennas and Propagation, vol. 60, no. 2, pp. 490–502, Feb. 2012. Y. Chen and C. F. Wang, “Electrically Small UAV Antenna Design Using Characteristic Modes,” IEEE Transactions on Antennas and Propagation, vol. 62, no. 2, pp. 535–545, Feb. 2014. P. A. Hoeher and N. Doose, “A massive MIMO terminal concept based on small-size multi-mode antennas,” Transactions on Emerging Telecommunications Technologies, p. e2934, Mar. 2015. M. A. Doron and E. Doron, “Wavefield modeling and array processing. I. Spatial sampling,” IEEE Transactions on Signal Processing, vol. 42, no. 10, pp. 2549–2559, 1994. M. Costa, A. Richter, and V. Koivunen, “DoA and Polarization Estimation for Arbitrary Array Configurations,” IEEE Transactions on Signal Processing, vol. 60, no. 5, pp. 2330–2343, May 2012. J. G. Proakis and M. Salehi, Digital Communications, 5th ed. Boston, Mass.: McGraw-Hill, 2008. S. M. Kay, Fundamentals of Statistical Signal Processing, Volume I: Estimation Theory, 1st ed. Englewood Cliffs, N.J: Prentice Hall, Apr. 1993. F. W. J. Olver and National Institute of Standards and Technology (U.S.), Eds., NIST Handbook of Mathematical Functions. Cambridge; New York: Cambridge University Press : NIST, 2010.
7cs.IT
A Nonlinear Constrained Optimization Framework for Comfortable and Customizable Motion Planning of Nonholonomic Mobile Robots – Part I arXiv:1305.5024v1 [cs.RO] 22 May 2013 Shilpa Gulati∗ Chetan Jhurani† Benjamin Kuipers‡ Abstract In this series of papers, we present a motion planning framework for planning comfortable and customizable motion of nonholonomic mobile robots such as intelligent wheelchairs and autonomous cars. In this first one we present the mathematical foundation of our framework. The motion of a mobile robot that transports a human should be comfortable and customizable. We identify several properties that a trajectory must have for comfort. We model motion discomfort as a weighted cost functional and define comfortable motion planning as a nonlinear constrained optimization problem of computing trajectories that minimize this discomfort given the appropriate boundary conditions and constraints. The optimization problem is infinite-dimensional and we discretize it using conforming finite elements. We also outline a method by which different users may customize the motion to achieve personal comfort. There exists significant past work in kinodynamic motion planning, to the best of our knowledge, our work is the first comprehensive formulation of kinodynamic motion planning for a nonholonomic mobile robot as a nonlinear optimization problem that includes all of the following – a careful analysis of boundary conditions, continuity requirements on trajectory, dynamic constraints, obstacle avoidance constraints, and a robust numerical implementation. In this paper, we present the mathematical foundation of the motion planning framework and formulate the full nonlinear constrained optimization problem. We describe, in brief, the discretization method using finite elements and the process of computing initial guesses for the optimization problem. Details of the above two are presented in Part II (Gulati et al., 2013) of the series. 1 Introduction Autonomous mobile robots such as intelligent wheelchairs and autonomous cars have the potential to improve the quality of life of many demographic groups. Recent surveys have concluded that many users with mobility impairments find it difficult or impossible to operate existing power wheelchairs because they lack the necessary motor skills or cognitive abilities (Fehr et al., 2000; Simpson et al., 2008). Assistive mobile robots ∗ Corresponding author. This work was performed as part of Shilpa’s Ph.D. (Gulati, 2011) in the Mechanical Engineering Department at the University of Texas, Austin, TX 78712, USA. Shilpa now works at Bosch Research and Technology Center, 4009 Miranda Ave Suite 150, Palo Alto, CA 94304, USA. Email: [email protected] † Tech-X Corporation, 5621 Arapahoe Ave, Boulder, CO 80303, USA. Email: [email protected] ‡ Electrical Engineering and Computer Science Department, University of Michigan, Ann Arbor, MI 48109 USA. Email: [email protected] such as smart wheelchairs and scooters that can navigate autonomously benefit such users by increasing their mobility (Fehr et al., 2000). Autonomous cars have the potential to increase the mobility of a significant proportion of the elderly whose driving ability is reduced due to age-related problems (Silberg et al., 2012). The motion of an autonomous mobile robot should be comfortable to be acceptable to human users. Moreover, since the feeling of comfort is subjective, different users should be able to customize the motion according to their comfort. Motion planning is a challenging problem and has received significant attention. See (Latombe, 1991; Hwang and Ahuja, 1992; Choset et al., 2005; LaValle, 2006, 2011a,b). However, most of the existing motion planning methods have been developed for robots that do not transport a human user and issues such as comfort and customization have not been explicitly addressed. In this paper we focus on planning comfortable motion for nonholonomic mobile robots such that the motion can be customized by different users. Our key contributions are as follows: • We model user discomfort as a weighted cost functional. This is informed by studies of human comfort in road and railway vehicle literature that indicate that human discomfort increases with the magnitude of acceleration and jerk and that comfortable levels of these quantities have different magnitudes in the direction of motion and perpendicular to the direction of motion (Suzuki, 1998). Thus, our cost functional is a weighted sum of the following three physical quantities: total travel time, tangential jerk, and normal jerk. Minimum jerk cost functionals have previously been used in literature (Žefran, 1996; Arechavaleta et al., 2008) for optimal motion planning. What is new here is the separation of tangential and normal components, and computing the weights using the technique of dimensional analysis (Langhaar, 1951) that allows us to develop a straightforward procedure for varying the weights for customization. • We develop a framework for planning comfortable and customizable motion. Here, we present a precise mathematical formulation of kinodynamic motion planning of a nonholonomic mobile robot moving on a plane as a nonlinear constrained optimization problem. This includes an in-depth analysis of conditions under which the cost-functional is mathematically meaningful, analysis of boundary conditions, and precise formulation of constraints necessary for motion comfort and for obstacle avoidance. To the best of our knowledge, such a formulation is absent from the literature. The idea of computing optimal trajectories that minimize a cost functional is not new and has been used for planning optimal trajectories for wheeled robots (Dubins, 1957; Reeds and Shepp, 1990; Balkcom and Mason, 2002; Bianco and Romano, 2005) and manipulators (Fernandes et al., 1991; Shiller, 1994; Žefran, 1996; Arechavaleta et al., 2008). All of these formulations make several limiting assumptions, such as known travel time, or known path, or boundary conditions on configuration but not its derivatives. None of these approaches consider obstacles. The closest existing work to ours in terms of problem formulation and numerical solution method is (Žefran, 1996), but obstacle avoidance constraints are not part of this formulation. The trajectories planned by our framework have several useful properties – they exactly satisfy boundary conditions on position, orientation, curvature, speed and tangential acceleration, satisfy kinematic and dynamic constraints, and avoid obstacles while minimizing discomfort. Further, our framework is capable of planning a family of trajectories between a given pair of boundary conditions and can be customized by different users to obtain a trajectory that satisfies their comfort requirements. • We represent obstacles as star-shaped domains with piecewise C 2 boundary. This choice allows treatment of non-convex obstacles without subdividing them into a union of convex shapes. This reduces the number of constraints imposed due to obstacles and leads to a faster optimization process. Such a representation of obstacles is not very common in robotics where most collisiondetection algorithms assume polygonal obstacles, and detect collisions between non-convex polygons by subdividing them into convex polygons (Quinlan, 1994; Mirtich, 1998; Lin and Manocha, 2004). 2 • We use the Finite Element Method to discretize the above infinite-dimensional problem into a finite dimensional problem. The finite element method is not unknown in trajectory planning but it is not very common. However, it is a natural choice for problems like ours and we strongly believe that using it provides us insight, flexibility, and reliability that is not easily obtained by choosing other discretization methods. • Our method can be used independently for motion planning of nonholomic mobile robots. It can also be a used as local planner in sampling-based methods (LaValle, 2006) since the trajectories computed by our method exactly satisfy boundary conditions, kinodynamic constraints, continuity requirements, and avoid obstacles. 2 Background and related work In this section, we characterize motion comfort by analyzing studies in ground vehicles, elevator design, and robotics. We then review existing motion planning methods and identify their strengths and limitations in planning comfortable motion. 2.1 Comfort Comfort - What is it? Comfort has both psychological and physiological components, but it involves a sense of subjective well-being and the absence of discomfort, stress or pain (Richards, 1980). Studies to characterize comfort in ground vehicles such as automobiles and trains have shown that the feeling of comfort in a vehicle is affected by various characteristics of the vehicle environment including dynamic factors (such as acceleration and jerk), ambient factors (such as temperature and air quality), and spatial factors (such as seat quality and leg room) (Richards, 1980). In this work we focus on comfort due to dynamic factors alone. Passenger discomfort increases as the magnitude of acceleration increases (Suzuki, 1998; Jacobson et al., 1980; Pepler et al., 1980; Förstberg, 2000; Chakroborty and Das, 2004). This is because an increase in magnitude of acceleration implies increase in magnitude of force experienced by a passenger. Two separate components of acceleration effect discomfort – tangential component along the direction of motion and normal component perpendicular to the direction of motion (Jacobson et al., 1980; Pepler et al., 1980; Förstberg, 2000). The normal component is zero in a straight line motion but becomes important when traversing curves. The actual values of comfortable bounds of the two components may be different (Suzuki, 1998), may vary across people, may depend on the mode of transportation, and may depend on the passenger’s position (Pepler et al., 1980; Förstberg, 2000). Hence, guidelines for ground transportation design prescribe maximum values of accelerations (Suzuki, 1998; Chakroborty and Das, 2004; Iwnicki, 2006), or maximum values of comfort indices that are functions of accelerations (ISO, 1997; CEN, 1999). Discomfort also increases as the magnitude of jerk increases (Pepler et al., 1980; Förstberg, 2000). This is because a high rate of change of jerk implies a high rate of change of magnitude or direction or both of the forces acting on the passenger. Upper bounds on jerk for comfort have been proposed for road (Chakroborty and Das, 2004) and railway vehicles (Suzuki, 1998). In elevator design, motion profiles are designed for user comfort by choosing profiles with smooth accelerations and low jerk (Hall et al., 1970; Krapek and Bittar, 1993; Spielbauer and Peters, 1995). From a geometric standpoint, it has been known for more than a century that sharp changes in curvature of roads and railway tracks can be dangerous and can cause passenger discomfort (Laundhart, 1887; Glover, 1900; Lamm et al., 1999). For a point mass moving on a path, the normal acceleration at a point is given by κv 2 where κ is the curvature of the path and v is the speed at that point. If curvature is not continuous, then normal acceleration cannot be continuous unless the speed goes to zero at the point of discontinuity. 3 This is clearly undesirable for comfort. In robotics, the desire to drive a robot with non-zero speed from start to goal has led to the development of methods for planning continuous curvature paths (Lamiraux and Laumond, 2001; Fraichard and Scheuer, 2004; Bianco and Romano, 2004, 2005; Piazzi et al., 2007). To summarize, in a motion planning context, a trajectory should have the following properties for comfort. First, the acceleration should be continuous and bounded. Second, jerk should be bounded. Third, the geometric path should have curvature continuity so that is is possible to travel from start to end without stopping. Fourth, a trajectory should exactly satisfy appropriate end point boundary conditions boundary conditions on position, orientation, curvature, speed, and acceleration since many tasks require precise these (for example, positioning at a desk for an intelligent wheelchair, parking in a tight parking space for a car). Fifth, it should be possible to join multiple trajectories such that the combined trajectory has the above properties. This means that a trajectory should satisfy the above described boundary conditions on both ends. 2.2 Motion planning There exists a large body of work on motion planning. Before reviewing this work, we define some terms. The space of all possible positions and orientations of a robot is called configuration space. The space of all possible configurations and their first derivatives is called state space. A trajectory is a time-parameterized function of configuration. A control trajectory is a time-parameterized function of control inputs. Motion planning is the problem of finding either a trajectory, or a control trajectory, or both, given the initial and final configuration, and possibly their first and higher derivatives, such that the geometric path does not intersect any obstacles, and the trajectory satisfies kinematic and dynamic constraints. Kinematic constraints refer to constraints on configuration and dynamic constraints refer to constraints on velocity and its higher derivatives. These constraints arise from physics, engineering limitations, or comfort requirements. A variety of methods have been used to solve various aspects of the motion planning problem. Path Planning methods focus on the purely geometric problem of finding a collision-free path. Another set of methods, stemming from differential geometric control theory, focus on computing control inputs that steer a robot to a specified position and orientation or that make a robot follow a specified path. Kinodynamic motion planning methods, consider both dynamics and obstacles and focus on computing collision-free trajectories that satisfy kinematic and dynamic constraints. See (Hwang and Ahuja, 1992; Latombe, 1991; Choset et al., 2005; LaValle, 2006) for excellent presentation of all three kinds of methods, (Laumond et al., 1998) for differential geometric control methods, and (Donald et al., 1993; Fraichard, 1996; LaValle and Kuffner, 2001a; Hsu et al., 2002) for kinodynamic planning. In this work, we use motion planning in the sense of (Donald et al., 1993), that is, we speak of kinodynamic motion planning, consistent with the informal definition presented above. Sampling-based methods Sampling-based methods have found widespread acceptance and practical use for motion planning. These methods are used for both path planning (LaValle, 1998; Kavraki et al., 1996; LaValle and Kuffner, 2001b) and for motion planning (Canny, 1988; Barraquand and Latombe, 1989; Donald et al., 1993; Fraichard, 1996; LaValle and Kuffner, 2001b,a; Hsu et al., 2002). See (LaValle, 2006) for an in-depth discussion. The main idea in all sampling-based methods is to sample the state space (Donald et al., 1993; LaValle and Kuffner, 2001a) or state-time space (Erdman and Lozano-Pérez, 1987; Barraquand and Latombe, 1990; Fraichard, 1996; Hsu et al., 2002) to construct a directed graph called a roadmap from the start state to the goal region. The vertices of this graph are points in the obstacle free region of the appropriate space (state space or state-time space) and the edges are trajectory segments that satisfy kinodynamic constraints. The sequence of control inputs associated with the edges of the roadmap is the control trajectory. Among the most computationally efficient methods here are the ones that add vertices to the graph by randomized 4 sampling. Randomized sampling-based algorithms follow two paradigms – multiple-query and single-query. In the multiple-query paradigm, a roadmap is constructed once and used to answer multiple path planning queries. These algorithms are particularly computationally efficient in an unchanging environment since a single roadmap can be used to answer multiple queries. Some of the most well-known algorithms that follow this paradigm are Probabilistic Roadmaps (PRMs) and its variants (Kavraki et al., 1996). In the single-query paradigm, a roadmap is constructed for each query. Some of the most well-known algorithms that follow this paradigm are Randomly Exploring Dense Trees (RDT) (LaValle, 2006) and its variants (Hsu et al., 2002; Karaman and Frazzoli, 2011). These methods start with a roadmap rooted at the start state and iteratively add vertices by randomized sampling of the appropriate space. Different variants differ in the way they add a new vertex to the roadmap. We describe RDT in some detail here. A new vertex is added as follows (i) a sample point qnew is chosen from a randomized sequence (ii) a vertex qcurr in the graph that is closest to the sample point, according to a distance metric, is selected (iii) all controls from a set of discretized controls are applied to qcurr and the system is allowed to evolve for a fixed time ∆t (iv) out of all the new points that can be reached via collision-free trajectories satisfying differential constraints, the point nearest qcurr is chosen and added to the graph. This process is continued till a vertex in the goal region is added to the graph. The closeness of the end point of the trajectory to the goal state increases as the resolution increases, but in general, it is not possible to find a trajectory that exactly reaches the goal state. If it is desired to reach a goal state exactly, then a boundary value problem has to be solved between the end state of the solution trajectory and the goal state. This is a non-trivial problem since the solution must avoid obstacles and satisfy kinodynamic constraints. Some sampling-based methods are bidirectional, that is, they simultaneously grow roadmaps from the start state as well as the goal state. In this case, a solution trajectory exactly satisfies the boundary conditions. However, like before, a boundary value problem has to be solved to connect the two roadmaps. Since a fixed value of control input is applied for a finite length of time at each step, the planned path lacks curvature continuity and has to be smoothed in a post-processing step. Curvature continuity can be attained at the cost of increasing the dimensionality of the state space, and has been demonstrated only for a path planning problem (Scheuer and Laugier, 1998). Similarly, for achieving acceleration continuity the dimensionality of the state space has to be increased resulting in increased computational complexity. Recently, sampling-based algorithms described above have been shown to almost always converge to solution that has non-optimal cost (Karaman and Frazzoli, 2011) and a new algorithm, RRT* was proposed for planning asymptotically optimal paths. Results in a two dimensional configuration space showed that algorithm is computationally efficient. While promising, these results are very recent, and extending this work to kinodynamic motion planning is yet to be carried out. Another set of sampling-based methods can compute optimal trajectories by constructing a grid over the state space or state-time space and searching this discrete grid using graph-search algorithms such as A* (Canny, 1988; Barraquand and Latombe, 1989; Fraichard, 1996). This grid is called the state-lattice. Each pair of neighboring vertices of the grid are connected to each other by a trajectory that satisfies kinodynamic constraints. Three key choices effect the solution quality. First, the choice of discretization determines the closeness of the solution to the true optimum and the speed of computing the solution. Second, the choice of a neighborhood (e.g. k-nearest) for a vertex determines the connectivity of the space. Third, the choice of a method for computing trajectory segments between vertices determines the quality of the solution trajectory. Computing trajectory segments between adjacent states involve solving a non-trivial boundary value problem. For continuity of curvature, velocity and acceleration between connected trajectory segments, the state space should include curvature, and the first and second derivative of configuration. This results in increase in dimensionality of the search space and hence increase in computational time. For this reason, lattice-based methods have been shown to plan trajectories, with some but not all of the properties 5 necessary for comfort (Section 2.1) in autonomous driving applications. Continuous curvature trajectories are demonstrated in (Pivtoraiko et al., 2009), continuous velocity but not continuous curvature trajectories are demonstrated in (Likhachev and Ferguson, 2009). Trajectories with continuous curvature, speed, and acceleration are demonstrated in (McNaughton et al., 2011) Here the problem is tractable because the sampling can be restricted to the road on which the vehicle drives. Efficiently planning trajectories that satisfy all properties of comfort as described in Section 2.1 in less structured environments very much remains an open problem. Optimal-control based methods The problem of planning trajectories that are optimal with respect to some performance measure and also avoid obstacles has been shown to very hard (Canny and Reif, 1987), even in relatively simple cases. However, for many applications, we do require that a solution trajectory be optimal with respect to some performance measure such as time, path length, energy etc. Optimal control methods (Bryson and Ho, 1975; Troutman, 1995) have traditionally been used for computing optimal trajectories for systems subject to dynamic constraints in the absence of obstacles and have been widely applied in aerospace engineering and control-systems engineering. The formulation consists of constructing a cost functional representing the cumulative cost over the duration of motion and minimizing the cost functional to find a desired state trajectory or control trajectory or both. A functional is an operator that maps a function to a real or complex number. Sufficient conditions for a solution of the minimization problem are given by the Hamilton-Jacobi-Bellman (HJB) equation. HJB is a second-order partial differential equation with end-point boundary conditions. Analytic solutions of the HJB equation for linear systems with quadratic cost have long been known (Bryson and Ho, 1975). For general nonlinear systems, the HJB equation has to be solved numerically. Necessary conditions for optimality are derived using Pontryagin’s principle and consist of a set of first-order ordinary differential equations. These differential equations convert the optimization problem into a twopoint boundary value problem. The system of differential equations can either be solved analytically (where possible) or numerically using methods such as the shooting method or finite-difference methods. Analytical solution to the problem of finding minimum length paths for Dubins (Dubins, 1957) car and Reeds and Shepp (Reeds and Shepp, 1990) car (see (Souères and Boissonnat, 1998)) was found using such an approach. Dubins car is only allowed to move forward while Reeds and Shepp car is also allowed to move backward. These paths are comprised of straight line and arc segments and minimize the distance traveled by the mid-point of the rear axle. Each path segment is traversed at a fixed speed, so the trajectories corresponding to these paths are also time-optimal for a given speed. More recently, shortest paths for a differential drive wheeled robot were developed by including a rotation cost in the cost functional (Balkcom and Mason, 2002) (since a differential drive robot can turn in place). Such minimum-time paths lack curvature continuity and require frequent stopping and reorienting of wheels. More complex problems generally require a numerical solution. One frequently used numerical method is the shooting method where the two point boundary value problem is converted into an initial value problem. Shooting methods have been used for trajectory planning for nonholonomic mobile robots (Howard and Kelly, 2007; Ferguson et al., 2008). However, in shooting methods, it is challenging to specify a good initial guess of the unknown parameters that produces a final state reasonably close to the specified state. In general, the trajectories computed do not exactly satisfy end point boundary conditions. Instead of solving the differential equations representing necessary conditions, approximation methods that discretize the infinite-dimensional problem into a finite-dimensional one and optimize the cost functional directly in this finite-dimensional space can be used. Such methods have been used for planning optimal trajectories of robots. In (Fernandes et al., 1991), control inputs that minimize total control energy to 6 travel between a given pair of boundary states are computed. Here Fourier basis functions are used for discretization. In (Žefran, 1996), trajectories that minimize the integral of square of L2 norm of end-effector jerk and the square of L2 norm of time derivatives of joint torque vector, subject to torque constraints, are computed. Here a finite-element discretization is used. Other discretizations are also possible, such as B-spline (Bobrow et al., 2001) and spectral (Strizzi et al., 2002) discretization. Very few of the existing optimal control approaches include obstacle-avoidance. Not only do obstacle avoidance constraints make the optimal control problem highly nonlinear, but also each obstacle divides the set of feasible solutions into disjoint regions. One of the earliest methods that included dynamic constraints and obstacle-avoidance for motion planning of autonomous vehicles used a two step approach – first an obstacle free path was found and then an optimal speed on this path was computed (Shiller and Dubowsky, 1991; Shiller and Gwo, 1991). Because of path-velocity decomposition, the resulting trajectory is, in general, not optimal. Obstacles were included as hard constraints for a two-dimensional translating robot in (Tominaga and Bavarian, 1990). Learning methods Optimal control methods require an accurate model of the kinematics and dynamics of the robot as well as models of the robot’s interactions with the world. Such models are not always available. Further, it is not straightforward to develop an appropriate cost functional for a given task. Even if such models and cost functionals are available, searching through the high dimensional configuration space of the robot (e.g. in the case of humanoid robots) for an optimal trajectory can be computationally expensive. One set of learningbased methods use the key observation that, in practice, robot trajectories are restricted to a manifold by the task and by the kinodynamic constraints. The dimension of this manifold is, in general, lower than the dimension of the configuration space. These methods aim to learn the structure of this manifold from observed data of the robot’s movement (Ramamoorthy and Kuipers, 2008). Another set of methods aim to learn motion primitives for a specific task using observed data from human movements (Schaal et al., 2003). A detailed discussion of these methods is beyond the scope of this work and the interested reader is referred to the following works for more details: (Full and Koditschek, 1999; Schaal et al., 2003; Calinon and Billard, 2009; Ramamoorthy and Kuipers, 2008; Havoutis, 2012). Summary Trajectories computed by sampling-based methods, in general, lack continuity of curvature and acceleration. While these problems can be solved by increasing the dimensionality of state space at the cost of increased computational complexity, the problems of lack of optimality and not satisfying the goal boundary conditions exactly still remain. Optimal control methods have primarily been demonstrated for trajectory planning in the absence of obstacles. Further, a comprehensive formulation of kinodynamic motion planning problem for nonholonomic mobile robots that includes obstacle avoidance is absent. Thus, none of the existing methods can be directly applied to planning comfortable and trajectories. To this end, we develop a motion planning framework to compute trajectories that result in comfortable motion. 3 Overview of the approach At the root of our framework is the assumption that user discomfort can be quantified as a cost functional, and that trajectories that minimize this discomfort and avoid obstacles will result in user-acceptable motion. We outline the main steps of our approach below. • Formulate user discomfort as a mathematically meaningful cost functional. Based on existing lit7 erature, and making the assumption that a user would like to travel as fast as is consistent with comfort, we define a measure of discomfort as a weighted sum of the following three terms: total travel time, time integrals of squared tangential jerk and squared normal jerk. Each weight used in the discomfort measure to add different quantities is the product of two factors. The first factor has physical units so that the physical quantities with different dimensions can be added together. It is a fixed function of known length and velocity scales. The second factor is a dimensionless parameter that can be varied according to user preferences. The dimensional part is derived using the standard technique of dimensional analysis (Langhaar, 1951). • Define the problem. We formulate our motion planning problem as follows: “Given the appropriate boundary conditions, kinodynamic constraints, the weights in the cost functional, and a representation of obstacles, find a trajectory that minimizes the cost functional, satisfies boundary conditions, respects constraints, and avoids obstacles”. This description is transformed into a precise mathematical problem statement using a general nonlinear constrained optimization approach. • Choose a parameterization of the trajectory. Mathematically, one can use different functions to fully describe a trajectory. We express the trajectory by an orientation and a velocity as functions of a scaled arc-length parameter where the scaling factor is an additional scalar unknown to be solved for. This leads to a relatively simple expression for discomfort. We use a scaled arc-length parameterization Thus, we do not assume that the path length is known until the problem is solved. • Analyze the boundary conditions. A complete analysis of boundary conditions shows that for the optimization problem to be well-posed, we need to impose boundary conditions on position, orientation, curvature, speed, and tangential acceleration on each end. Further, we find that three different types of boundary conditions on speed and tangential acceleration on each end describe all types of motion tasks of interest such as starting/ending at rest or not. • Choose a representation of obstacles. To incorporate obstacle avoidance, we make the assumption that each obstacle can be modeled as a star-shaped domain with a boundary that is a piecewise smooth curve with continuous second order derivative. If an obstacle is not star-shaped, our framework can still handle it if it can be expressed as a finite union of piecewise smooth star-shaped domains. It is assumed that a representation of each obstacle is known in polar coordinates where the origin lies in the interior of the kernel of the star-shaped domain. Since each obstacle is assumed star-shaped, the constraint that the trajectory stay outside obstacles can be easily cast as an inequality. To efficiently incorporate obstacle avoidance constraints, we have to introduce position on the path as an additional unknown. This leads to a sparse Hessian of constraint inequalities, which otherwise would be dense. The position as an unknown is redundant in that it can be computed from the two primary unknowns (orientation and speed). Hence that relation is included as an extra equality constraint. • Discretize the problem. We use finite elements to convert the infinite-dimensional minimization problem to a finite dimensional one. For discomfort to be mathematically meaningful and bounded, both speed and orientation must have square-integrable second derivatives. We use a uniform mesh and cubic Hermite polynomial shape functions on each element for speed and orientation. Starting or stopping with zero speed is a special case that requires that speed have an infinite derivative (with respect to scaled arc-length) with a known strength on the corresponding boundary point. In this case we use singular shape functions for speed only on elements adjacent to the corresponding boundary. In the non-discretized version of the optimization problem the obstacle avoidance constraint can be expressed as the condition that each point on the trajectory should be outside each obstacle. We discretize this into a finite dimensional set of inequalities by requiring that some fixed number of points on the trajectory be outside each obstacle. • Compute an appropriate initial guess. A good initial guess is necessary for efficiently solving any nonlinear optimization problem. In general, there exist infinitely many trajectories between any 8 given pair of boundary conditions. Based on our analysis of this non-uniqueness, we compute a set of four good quality initial guesses by solving another, simpler, optimization problem. These initial guesses do not incorporate obstacle-avoidance constraints. Four discomfort minimization problems, corresponding to these four initial guesses, are solved to find four trajectories. The lowest cost trajectory can be chosen as the final solution. • Implement and solve. We use Ipopt, a robust large-scale nonlinear constrained optimization library (Wächter and Biegler, 2006) to solve the discretized problem. 4 Organization of this paper This paper is organized as follows. Section 5 presents some preliminary material on the motion of nonholonomic mobile robot on a plane and on parametric curves. Section 6 lays out the mathematical foundation of our framework, and is followed by the numerical solution method in Section 7 and computing an initial guess in Section 8. Evaluation of the framework and results are presented in Section 9, followed by concluding remarks and direction for future work in Section 10. 5 Preliminary material In this section, we present the notation and some preliminary material that is relevant to our formulation. We begin by an analysis of motion of a nonholonomic mobile robot moving on a plane. We then provide a brief introduction to parametric curves and arc-length parameterization of curves. 5.1 Motion of a nonholonomic mobile robot moving on a plane The configuration of a rigid body moving on a plane at any time t can be completely specified by specifying the position vector r(t) = {x(t), y(t)} and orientation θ(t) of a body-fixed frame with respect to a fixed reference frame. Suppose the rigid body starts from an initial configuration at time t = 0 and reaches a final configuration at time t = τ . To fully specify the motion of the body it is necessary to specify the functions x(t), y(t) and θ(t) on I = [0, τ ]. If this body is a physical system, it cannot change its position instantaneously. Further, since forces of infinite magnitude cannot be applied in the real world, the acceleration of the body must be finite. Hence x(t), y(t), and θ(t) must be at least C 1 on I. If this rigid body has directional wheels, its motion should obey the following nonholonomic constraint ẋ sin θ − ẏ cos θ = 0. (1) Here dot, (˙), represents derivative with respect to t. For motion planning, it is common to model a mobile robot as a wheeled rigid body subject to above nonholonomic constraint, and we will do the same. A motion of such a body can be specified by specifying a travel time τ and a trajectory r(t) for t ∈ [0, τ ]. The orientation θ(t) can be computed from Equation (1). Essentially, θ(t) = arctan2(ṙ(t)). If ṙ(t) is zero, which means the velocity is zero, then this equation cannot be used. If the instantaneous velocity is zero at t = t0 , and non-zero in a neighborhood of t0 , then θ(t0 ) can be defined as a limt→t0 arctan2(ṙ(t)). 5.2 Parametric curves and the arc-length parameterization We present a brief introduction to parametric curves and the arc-length parameterization. The reader can refer to any book on differential geometry of curves for more details. 9 Let qa < qb and I = [qa , qb ] ⊂ R. A planar parametric curve is a mapping r : I 7→ R2 . If components of r are of class C 1 , the vector space of functions with continuous first derivatives, the tangent vector at r(q) for q ∈ [qa , qb ] is r0 (q). In this section, we denote derivatives with respect to the parameter q by a prime ( 0 ). Let the length of a curve be denoted by λ, where Z λ= qb ||r0 (q)|| dq. (2) qa Define a function s = s(q), which is the length of the curve between [qa , q]. Then, Z q s(q) = ||r0 (q)|| dq. (3) qa Note that the integrand ||r0 (q)|| is non-negative throughout I. We make an assumption that it is zero only at a finite number of q’s in I. If q represented time, the physical interpretation is that the velocity is equal to zero only at a finite number of discrete instants in time. This assumption implies that s is an increasing function of q. That is, if q2 > q1 , then s(q2 ) > s(q1 ). This, in turn, means that for any given s ∈ [0, λ], a unique q = q(s) can be found that corresponds to that s. If components of r are of class C 1 , then ||r0 (q)|| ds is defined and is a continuous function. Obviously, is continuous, and thus s = s(q) is also in C 1 . Thus, dq ds 0 dq = ||r (q)||. With the assumption above that ||r0 (q)|| can be zero only at a finite number of q’s, it is possible to introduce the arc-length parameterization. For s ∈ [0, λ] define b r(s) = r(q) where s = s(q). (4) The function b r is well-defined because for each s ∈ [0, λ] a unique q can be found. Using the chain-rule for differentiation, db r dr dq = . ds dq ds Now dr dq exists and is continuous and dq ds = Thus, at points where ||r0 (q)|| > 0, db r ds 1 ds dq = also exists (and is continuous) if ||r0 (q)|| is not zero. 1 ||r0 (q)|| = ||r0 (q)|| / ||r0 (q)|| = 1. db r On points where ||r0 (q)|| = 0, ds cannot be computed by the expression above. However, the choice that makes it continuous for all s is 1. This is analogous to computing the limiting value of the orientation when velocity is zero as shown earlier in this section. db r Symbolically, the curve has been parameterized by the arc-length. Since ds = 1, the tangent vector computed in the new parameterization is a unit vector. The tangent vector is T(s) and the unit normal vector is N(s), where T(s) = db r ds N(s) = dT ds dT ds (5) See Figure 1. The signed curvature κ(s) is defined as κ(s) = 10 dθ ds (6) N y θ T r 0 x Figure 1: Tangent and Normal to a curve where θ(s) is the tangent angle. 6 Formulating motion planning as a constrained optimization problem This section presents the mathematical formulation of our framework for planning comfortable and customizable motion of a planar nonholonomic mobile robot. The steps involved are: (1) formulating a discomfort cost functional (Section 6.1) (2) dimensional analysis of cost functional (Section 6.2) (3) formulating an informal problem statement (Section 6.3) (4) choosing an appropriate parameterization of the trajectory (Section 6.4), (5) choosing the function space to which the trajectory should belong for the cost functional to be well-defined (Section 6.5), (6) analysis of boundary conditions to determine the boundary conditions that should be imposed for the problem to be well-posed (Section 6.6), (7) choosing a representation of obstacles and imposing constraints for obstacle avoidance (Section 6.7), and finally, (8) formulating the full infinite-dimensional constrained optimization problem (Section 6.8). 6.1 The discomfort cost functional In Section 2.1, we saw that for motion comfort, it is necessary to have continuous and bounded acceleration along the tangential and normal directions. It is possible that the actual values of the bounds on the tangential and normal components are different. It is also desirable to keep jerk small and bounded. We model user discomfort as a weighted sum of the following three terms: total travel time, time integral of squared tangential jerk and time integral of squared normal jerk. Travel time is included because we make the justifiable assumption that a user would prefer to reach a goal as fast as is consistent with comfort. Thus, longer travel time implies greater discomfort. We will see later in Section 6.5 that this cost functional is mathematically meaningful only when both tangential and normal acceleration are continuous. Thus, we get continuous accelerations by construction. To keep accelerations within comfortable bounds, we impose explicit constraints on the maximum and minimum values. We construct a cost functional J as follows: Z τ Z τ ... ... 2 ( r · T) dt + wN ( r · N)2 dt. J = τ + wT 0 (7) 0 ... ... Here τ is the total travel time and r is the position of robot at time t ∈ [0, τ ]. r represents the jerk. r ·T and ... r · N are the tangential and normal components of jerk respectively. We assume that r(t) is smooth enough for the cost functional to be well-defined. This means (at least) that the acceleration vector is continuous 11 and normal and tangential components of jerk are square integrable. The term τ is necessary. If it is not included in the functional, the optimal solution is to reach the destination at τ = ∞ traveling at essentially zero speed in the limit (except perhaps at the end-points where the speed is already specified). Thus, minimizing just the integral terms will not lead to a good solution. The weights (wT and wN ) are non-negative known real numbers. We separate tangential and normal jerk to allow a choice of different weights (wT and wN ). The weights serve two purposes. First, they act as scaling factors for dimensionally different terms. Second, they determine the relative importance of the terms and provide a way to adjust the robot’s performance according to user preferences. For example, for a wheelchair, some users may not tolerate high jerk and prefer traveling slowly while others could tolerate relatively high jerks if they reach their destination quickly. The typical values of weights will be chosen using dimensional analysis. 6.2 Dimensional analysis of cost functional and determination of characteristic weights Choosing the weights in an ad hoc manner does not provide weights that lead to similar comfort levels independent of the input (the boundary conditions). Moreover, since the different components of the total discomfort are different physical quantities, choice of weights should reflect this. In other words, for the total discomfort to make physical sense, the weights cannot be dimensionless numbers but should have physical units. We determine the weights using dimensional analysis (Langhaar, 1951). If the weights are chosen without the dimensional analysis step, the optimal trajectory will be different just by specifying the input in different physical units. In addition, using the same numerical weights for different tasks will not lead to similar quantitative discomfort level. All the physical quantities in the cost functional (time, jerk) depend on only two units − length L and time T . From Equation (7) we see that J has dimensions L0 T 1 due to the first term (τ ). Thus wT should have dimensions T 6 /L2 . Similarly, the dimensions of wN is T 6 /L2 . Alternatively, since T = L/V , wT and wN has dimensions L4 /V 6 . We now determine the base values of weights analytically. The main idea behind determining the base values is that the correct base values should keep the maximum speed below the maximum allowable speed. A user can then customize the weights by multiplying the base values by a dimensionless constant that indicates user preference. Weight for tangential and normal jerk We first determine wT . Consider a one dimensional motion with a trajectory that starts from origin and travels a distance L > 0 in an unknown time τ > 0. The starting and ending speeds and accelerations are zero. We choose the exact form of the trajectory to be a quintic polynomial in time t ∈ [0, τ ]. This choice uniquely determines the trajectory. The reason we have chosen a quintic is that it minimizes integral of squared jerk (a third derivative), just like a cubic spline minimizes integral of squared second derivative. Additionally, we choose the quintic to satisfy the boundary conditions. Let s(t) be the distance traveled in time t. It is easily seen that the quintic s(t) =  Lt3 6t2 − 15tτ + 10τ 2 5 τ 12 satisfies all the boundary conditions. For such a trajectory, the discomfort functional is Z τ 720L2 wT ... 2 s (t) dt = τ + . J = τ + wT τ5 0 We do not know τ and wT yet. We first choose a τ that minimizes J for all wT . This means τ = 3600L2 wT 1/6 . Obviously, choosing a large value of wT will increase τ , which is natural because doing so penalizes jerk and would slow down the motion. We now choose a wT so that the maximum speed during the motion is V , a dimensional velocity scale. It can be seen that the maximum speed occurs at t = τ /2 and it is  225 2048 1/3  L4 wT 1/6 2 L4 . V6 Hence we choose  wT = 225 2048 . (8) The base value for the weight corresponding to the normal jerk (wN ) is chosen to be the same. We emphasize that both wT and wN will be present in a real problem and the maximum speed constraint is imposed explicitly rather than relying on weights. The analysis done here is to get dimensional dependencies of the base weight and reasonable proportionality constants using a simple problem that can be treated analytically. If a different problem is chosen, these base values will change. Factoring the weights for customization In the preceding discussion, we determined the base values of weights using simple analytical problems. We will refer to these base values as w bT and w bN . Let R∗ be the minimum turning radius of the robot. For any given input, we determine the characteristic length L∗ as max(∆L, πR∗ ) where ∆L is the straight line distance between the start and end points. The characteristic speed V∗ is the maximum allowable speed of the robot. The base values of weights are then computed as  w bT = w bN = 225 2048 2 L4∗ . V∗6 (9) The weights for the actual problem are chosen as a multiple of these base weights where the multiplying factors fT and fN are chosen by a user. wT = fT w bT , wN = fN w bN . 6.3 (10) Problem statement We formulate motion planning as a constrained optimization problem as follows: Given the appropriate boundary conditions on position, orientation, and derivatives of position and orientation, bounds on curvature, speed, tangential and normal accelerations, the weight factors fT and fN (Equation (9)), and a representation of obstacles, find a trajectory that minimizes the cost functional representing user discomfort Equation (7) such that the trajectory satisfies boundary conditions, respects bounds, and avoids obstacles We model the robot as a rigid body moving on a plane, subject to the nonholonomic constraint of Equa13 r0 x q0 q0 y θ r0 0 θτ qτ 0 y rτ rτ θτ θτ 0 qτ x θ (a) qτ x (b) Figure 2: Illustration of the optimization problem. (a) The initial configuration of the robot at time t = 0 is given by the position r0 and orientation θ0 . The final configuration at time t = τ is given by the position rτ and orientation θτ . The speed at an end point, when non-zero, q0 is necessarily along the vector q. (b) There exist infinitely many trajectories that satisfy boundary conditions and y θ respect constraints, illustrated by the solid and dotted curves. Infinitely many of such trajectories will not result in comfortable motion, illustrated by the dotted curves. Our objective is to find a trajectory r(t) that additionally θτ minimizes the cost functional of Equation (7) and results in comfortable motion. Such a trajectory is illustrated by the solid curve. q 0 x τ tion (1), and assume that the robot moves with non-zero speed except at a finite number of points. Let the robot start from r0 at t = 0 and reach rτ in time τ (Figure 2). From the discussion in Section 5.1, we see that to fully specify the motion of the robot, we need only to specify a curve r(t) on t ∈ [0, τ ] such that the curve is at least C 1 continuous. Henceforth, in this chapter, we will use trajectory to refer to a function of robot position with respect to time. We now transform the above problem description into a precise mathematical problem statement using a general nonlinear constrained optimization approach. 6.4 Parameterization of the trajectory Mathematically, one can use different primary variables to describe a trajectory. For example, assuming the trajectory starts at zero time, one way to describe a trajectory is to provide the final time and the position vector as a function of time in between. Another way is to provide the final time and specify the orientation and velocity as functions of time. Another way is to represent the geometric path separately, using either position vector or orientation as a function of arc-length. The velocity at each point on the path is provided separately in this case. We have found that making the assumption that speed be non-zero except at boundaries and expressing the trajectory solely in terms of speed and orientation as functions of a scaled arc-length parameter leads to relatively simple expressions for all the remaining physical quantities (such as accelerations and jerks). We shall see below, that with this parameterization, the primary variables (speed and orientation) and their derivatives enter the cost functional polynomially. This would not have been the case if everything were expressed in terms of r as a function of time as we did in our previous work (Gulati et al., 2009). In the following discussion, we implicitly assume that all the quantities have sufficient smoothness for expressions to be mathematically meaningful. In some cases, the derivatives appear not as point-wise values but inside an integral sign. In such a case we will assume that the integrands belong to an appropriate space of functions so that the integrals are well-defined. We explicitly state the requirements on the regularity when posing the optimization problem later in Section 6.5. 14 Scaled arc-length parameterization Let u ∈ [0, 1]. The trajectory is parameterized by u. The starting point is given by u = 0 and the ending point is given by u = 1. Let r = r(u) denote the position vector of the robot in the plane. Let v = v(u) be the speed. Both r and v are functions of u. Let λ denote the length of the trajectory. Since only the start and end positions are known, λ cannot be specified in advance. It has to be an unknown that will be found by the optimization process. Let s ∈ [0, λ] be the arc-length parameter. We choose u to be a scaled arc-length parameter where u = λs so that the unknown constant λ is not used in defining an unknown sized interval (as would be the case if u was chosen as the arc-length parameter). In the following discussion we will see that the trajectory, r(t), t ∈ [0, τ ] is completely specified by the trajectory length λ, the speed v = v(u), and the orientation or the tangent angle θ = θ(u) to the curve. λ is a scalar while speed and orientation are functions of u. These are the three unknowns, two functions and one scalar, that will be determined by the optimization process. Since speed is the rate of change of arc length, we have ds . dt (11) du v(u) = . dt λ (12) v(u) = Using u = s λ in the above equation, we get This gives, Z t = t(u) = 0 u λ du. v(u) (13) If v(u) is zero only at a finite number of points in [0, 1], then t(u) is well defined for all u ∈ [0, 1]. Equation (13) is a key relation and gives us the means to convert between the time domain and scaled arc-length domain. We now introduce the third unknown – the orientation or the tangent angle to the curve θ = θ(u). Using the results of Section 5.2, we can show that ||r0 (u)|| = λ. (14) The tangent vector r0 (u) to the curve r(u) is given by r0 (u) = ||r0 (u)|| T(u) = λT(u) (15) T(u) = {cos(θ(u)), sin(θ(u))} . (16) where T(u) is the tangent function. The braces {} enclose the components of a 2D vector. Thus, r(u) can be computed via the following integrals. Z u Z r(u) = r(0) + λ cos θ(u) du, 0 u  sin θ(u) du . (17) 0 Now, if θ(u) is known, r(u) can be computed from Equation (17). If v(u) and λ are known, t(u) can be computed from Equation (13). Using these two, we can determine the function r(t), t ∈ [0, τ ]. 15 We now have all the basic relations to use chain-rule to derive expressions for all the physical quantities needed to pose the constrained optimization problem. We drop explicit references to u as a function parameter to keep the expression concise. We compute first, second, and third derivatives of r with respect to time. These expressions are easily derived in one or two steps of chain rule differentiation and so we do not present the intermediate steps in detail. = v {cos θ, sin θ} v 0 (v {cos θ, sin θ} + vθ0 {− sin θ, cos θ}) r̈ = λ  v ... r = (v 02 + vv 00 − v 2 θ02 ) {cos θ, sin θ} 2 λ  v + (3vv 0 θ0 + v 2 θ00 ) {− sin θ, cos θ} λ2 ṙ (18) (19) (20) From the equations above, the expressions for tangential acceleration aT and normal acceleration aN are aT = r̈ · T = aN = r̈ · N = The tangential jerk jT is vv 0 λ (21) v2 θ0 . λ (22) v ... jT = r · T = 2 (v 02 + vv 00 − v 2 θ02 ) λ (23) and the normal jerk jN is v2 ... jN = r · N = 2 (3v 0 θ0 + vθ00 ). (24) λ Here N is the direction normal to the tangent (rotated π2 anti-clockwise). The signed curvature is given by κ(u) = θ0 . λ (25) The angular speed ω is given by θ0 v . λ We can use the Equations 23 and 24. to express the total discomfort Z τ Z τ Z τ ... ... J(r, τ ) = dt + wT ( r · T)2 dt + wN ( r · N)2 dt ω(u) = 0 0 (26) (27) 0 in terms of v, θ, and λ. First, we express the travel time τ in terms of the primary unknowns. Z Z 1 Z 1 dt λ τ = dt = du = du. 0 du 0 v (28) Using a similar change of variables in the integration (t → u), the total discomfort can be written as Z J(v, θ, λ) = 0 1 λ du + wT v Z 0 1 v 02 (v + vv 00 − v 2 θ02 )2 du + wN λ3 Z 0 1 v3 (3v 0 θ0 + vθ00 )2 du. λ3 (29) The first integral (Jτ ) is the total time, the second integral (JT ) is total squared tangential jerk, and the third integral (JN ) is total squared normal jerk. 16 Note that except for the term due to total travel time, the primary variables v and θ and their derivatives enter the total discomfort expression polynomially. The discomfort J is now a function of the primary unknown functions v, θ, and a scalar λ, the trajectory length. All references to time t have disappeared. However, once the unknowns are found via optimization, we must compute a mapping between t and u. This can be done using Equation (13). 6.5 Function spaces for v and θ for a finite discomfort Now that we have a concrete expression for the discomfort J in Equation (29), it can be used to define the function spaces to which v and θ can belong so that the discomfort is well-defined (finite). This will, in turn, lead to conditions on the physical quantities for safe and comfortable motion. We have two distinct cases depending on whether the speed is zero at an end-point on not. Conditions for positive speeds Let Ω = [0, 1] and H 2 (Ω) be the Sobolev space of functions on Ω with square-integrable derivatives of up to order 2. Let f : Ω → R. Then 2 def Z  f ∈ H (Ω) ⇐⇒ Ω dj f dxj 2 dx < ∞ ∀ j = 0, 1, 2. (30) First, we show that if v, θ ∈ H 2 (Ω), then the integrals of squared tangential and normal jerk are finite. Using the Sobolev embedding theorem (Adams and Fournier, 2003) it can be shown that if f ∈ H 2 (Ω), then f 0 ∈ C 0 (Ω) and by extension f ∈ C 1 (Ω). Here C j (Ω) is the space of functions on Ω whose up to j th derivatives are bounded and continuous. Thus, if v, θ ∈ H 2 (Ω), then all the lower derivatives are bounded and continuous. Physically this means that quantities like the speed, acceleration, and curvature are bounded and continuous − all desirable properties for comfortable motion. Expanding all the jerk related terms in Equation (29), bounding all the non-second derivative terms by a constant using the results from the Sobolev embedding theorem, we immediately see that the jerk part of discomfort is finite if v, θ ∈ H 2 (Ω). This is a sufficient condition only and not a necessary one as we shall see below. We also need that the inverse of v be integrable so that Jτ is finite. This is trivially true if v is uniformly positive, that is, v ≥ v > 0 for some constant positive v throughout the interval [0, 1]. However, v can be zero at one or both end-points because of the imposed conditions. Section 6.6 analyzes the boundary conditions in detail. Here we assume that speed on both end-points is positive. The cases with zero end-point speed are treated below in Section 6.5. Thus, consider the case that v is positive on both end-points. Since v is speed and always non-negative, it can approach zero from above only. We make a justifiable assumption that v can be zero only at end-points if at all and not in the interior. Otherwise, the robot would stop and then start again. This is costly for discomfort since it increases travel time and leads to acceleration and deceleration. Of course, we can choose a motion in which v = 0 in the interior and it can still be a valid motion with finite discomfort. The assumption is that the trajectory that actually minimizes discomfort will not have a halt in between. Thus, if v > 0 on end-points, it remains uniformly positive in the interior and the discomfort is finite. 17 Conditions for zero speed on boundary Consider the case in which v(0) = 0. The case v(1) = 0 can be treated in a similar manner. If v(0) = 0, v1 must not blow up faster than u1p where p < 1. This is to keep Jτ finite. This can be seen as follows. Lets λ provided p < 1, otherwise assume v(u) = up for some p > 0 (so that v(0) = 0). This implies that Jτ = 1−p it is not defined. 2 2 p For simplicity, assume a 1D motion so that θ(u) ≡ 0. Then JT = λ13 (1−2p) provided p > 35 . Taking 5p−3 all conditions into account, if v(0) = 0, the discomfort is finite if v(u) behaves like up where 35 < p < 1. R1 2 2 p is defined and finite only if p > 3/2. This conflicts with the However, in such a case, 0 v 002 du = (−1+p) 2p−3 2 assumption that v ∈ H (Ω). Thus, we can have a finite discomfort even if v ∈ / H 2 (Ω). We see that the R 1 3 002 reason for this is the zero speed boundary condition, which leads to 0 v v du being finite for 53 < p < 1 R1 even though 0 v 002 du (which is the highest order term in JT ) is not finite for such a range of p. 2 2 p If we look at the integral JT = λ13 (1−2p) carefully, we see that it can be finite even if p < 35 , provided 5p−3 p = 21 . This is a special case because vv 00 + v 02 is identically zero for such a p and tangential jerk discomfort is finite for a 1-D motion. For a mathematically meaningful problem we must treat zero speed boundary conditions separately from non-zero speed boundary condition. This analysis will be done in more detail in Sections 6.6 and 7 which are focused on boundary conditions and appropriate singular finite elements respectively. Summary To summarize, the total discomfort is finite if v, θ ∈ H 2 (Ω) and the inverse of v is integrable. Inverse of v is integrable if v is uniformly positive in [0, 1]. If zero speed boundary conditions are imposed, we will have to choose v outside H 2 (Ω). In such a case, at u = 0, it is sufficient that v approaches zero as up where 35 < p < 1 or p = 21 . For the right end point, where u = 1, replace u with (1 − u) in the condition. We do not lose higher regularity of v throughout the interval Ω just because v ∈ / H 2 (Ω). Assume v > 0 in the interior, as def justified above. Then v ≥ v > 0 in Ωδ = [δ, 1 − δ] where δ = δ(v) > 0. Thus v ∈ H 2 (Ωδ ) is necessary to keep total discomfort finite. This implies continuity and boundedness of velocity and acceleration in Ωδ ∀δ > 0. 6.6 Analysis of boundary conditions The expression for the cost functional J in Equation (29) shows that the highest derivative order for v and θ is two. Thus, for the boundary value problem to be well-posed we need two boundary conditions on v and θ at each end-point − one on the function and one on the first derivative. We also have to impose that the robot move from a specific starting point to a specific ending point. This condition is a set of two equality constraints on λ and θ based on Equation (17). If the motion is from positions r0 to rτ , then Z  Z 1 rτ − r0 = λ 1 cos θ du, 0 sin θ du . (31) 0 We now relate the mathematical requirement on v and θ boundary values above to expressions of physical quantities. We do this for the starting point only. The ending point relations are analogous. 18 Positive speed on boundary First, consider the case when v > 0 on the starting point. The speed v needs to be specified, which is quite natural. The u-derivative of v, however, is not tangential acceleration. The tangential acceleration is 0 the t-derivative and is given by Equation (21). It is vv λ . Here v is known but λ is not. Thus specifying tangential acceleration gives us a constraint equation and not directly a value for v 0 (0). This is imposed as an equality constraint. Similarly, fixing a value for θ on starting point is natural. We “fix” the values of 0 θ0 (0) by fixing the signed curvature κ = θλ . As before, this leads to an equality constraint relating θ0 (0) and λ if κ 6= 0. Since choosing a meaningful non-zero value of κ is difficult, it is natural to impose κ = 0. In this case θ0 (0) = 0 can be imposed easily. Zero speed on boundary We now discuss the v = 0 case. If v(0) = 0, then, as seen in Section 6.5, v(u) must behave like up for 1 2 1 3 0 q 5 < p < 1 or p = 2 near u = 0 and v (u) ∼ u for − 5 < q < 0 or q = − 2 respectively. This means the 0 limu→0 v (u) is infinite. This leads to a difficulty in analyzing the expression for the tangential acceleration 0 p ( vv λ ) without using limits. We prove that if v ∼ u at boundary, then the tangential acceleration is 0 if 3 1 < p < 1 and it is finite but non-zero if p = . If v(u) ∼ up , then, vv 0 ∼ u2p−1 . If 35 < p < 1, it means 5 2 1 1 0 0 5 < 2p − 1 < 1. Thus as u → 0, vv → 0 because of the allowable range of p. If p = 2 , vv behaves like a 1 positive constant as u → 0. Hence p = 2 corresponds to non-zero tangential acceleration. We still have to decide with what strength does v 0 (u) tend to infinity at an end-point. If v = 0 and a 6= 0, it is clear that v 0 (u) ∼ u−1/2 . If v = 0 and a = 0, the analysis above has only shown that limu→0 v(u)v 0 (u) = 0, and limu→0 v 0 (u) = ∞. In this case, we need to use the time domain. The reason we have such a singularity is because of working in the arc-length domain. Consider starting from origin with zero speed and acceleration at zero time (t) in 1D. Expanding the distance traveled (s) as a function of time, we see that 1 1 s(t) = 0 + 0t + 0t2 + jt3 + . . . . 2 6 Here j > 0 is the jerk at t = 0. We ignore the higher order terms. Then, to the lowest power of t, the speed as a function of t is 1 v(t) = jt2 . 2 Eliminating t to relate v and s, we get 62/3 1/3 2/3 j s . v= 2 Now s = λu because u is the scaled arc-length parameter. Using this we get v = Cu2/3 , where all the constants are absorbed in C. Thus, v(u) ∼ up for p = 32 . This value of p is within the acceptable range of p, the open interval ( 35 , 1). This also tells us that v 0 (u) ∼ u−1/3 (32) is the appropriate strength of the singularity. Summary To summarize, we must specify following boundary conditions at both end points: position, orientation, curvature, and speed. If a specified speed is non-zero, the tangential acceleration must be specified. If the speed is zero, the tangential acceleration can be zero. If tangential acceleration is non-zero, it must be positive if it is the starting point or must be negative if it is the ending point. 19 {x, y} y ρ(φ) φ {x0 , y0 } x Figure 3: Notation for star-shaped obstacles. A non-convex star-shaped obstacle is shown with its “center” {x0 , y0 } and a distance function ρ = ρ(φ). The distance function gives a single point on the boundary for φ ∈ [0, 2π]. The robot trajectory must lie outside the obstacle. 6.7 Obstacle avoidance For safe motion, it is necessary that the robot avoid obstacles while navigating. Simply speaking, obstacles are regions in the plane of motion through which the geometric path must not pass. Obstacles can be represented in a variety of ways. For example, convex polygons, rectangular cells, simple closed shapes like ellipses, or level sets of implicitly defined simple functions of two arguments are some possibilities. Modeling obstacles as star-shaped domains We have chosen to model the “forbidden” region formed by the obstacles as a union of star-shaped domains with boundaries that are closed curves with piecewise continuous second derivative. A set in Rn is called a star-shaped domain if there exists at least one point x0 in the set such that the line segment connecting x0 and x lies in the set for all x in the set. Intuitively this means that there exists at least one point in the set from which all other points are “visible”. We will refer to such a point x0 as a center of the star-shaped domain. The choice of using star-shaped domains is made so that each point on the boundary of an obstacle can be treated as coming from a well-defined function in polar coordinates centered within the particular obstacle. See Figure 3. This also allows treatment of non-convex obstacles without subdividing them into a union of convex shapes. A big advantage is that we reduce the number of imposed constraints since the number of inequality constraints is proportional to the number of obstacles. This leads to a faster optimization process. This approach is a special case of using level sets of an implicitly defined function as an obstacle boundary. What is different here is that given the description of the boundary in polar coordinates, which is easy to specify for common shapes, we construct an implicit function (see the following section). This is done based on the assumption that the boundary encloses a star-shaped region. The piecewise smoothness property is required to impose the obstacle constraint in a numerical optimization method. Since up to second derivative of constraint can be required, the obstacle boundary should also be smooth to that order (or at least piecewise smooth). If an obstacle is not star-shaped, our framework can still handle it if it can be expressed as a finite union of piecewise smooth star-shaped domains. Efficient algorithms to decompose any polygon into a finite number of star-shaped polygons exist (Avis and Toussaint, 1981). 20 Incorporating constraints for obstacle avoidance We now derive a function for the inequality constraint that a given point in the plane is not inside the boundary of one star-shaped obstacle. It is easy to extend this to multiple points and multiple obstacles by just repeating the inequality with different parameters. Let an obstacle be specified by its boundary in polar coordinates that are centered at r0 = {x0 , y0 }. Each φ ∈ [0, 2π) gives a point on the boundary using the distance ρ(φ) from the obstacle origin. The distance function ρ must be periodic with a period 2π. See Figure 3. Suppose we want a point r = {x, y} to be outside the obstacle boundary. Define C(r) as C(r) = ||r − r0 ||2 − ρ(arctan2(r − r0 )) (33) where the subscript 2 refers to the Euclidean norm. It is obvious that C(r) ≥ 0 ⇐⇒ the point r is outside the obstacle. This can be seen using a 1D graph of ρ(φ). For example, let an obstacle be represented as shown in Figure 4(a). Figure 4(b) shows the same obstacle flattened out as a 1D curve. Then C(r) is positive in the top region and negative below. The star-shaped property leads to a single-valued curve ρ(φ) when flattened like this. The vector r is related to the primary variables in our optimization problem using Equation (17). Derivatives of obstacle avoidance constraint We will need derivatives of C(r) with respect to r for incorporating C(r) ≥ 0 as a constraint in the trajectory optimization problem. Here r is any point on the path that we want to lie outside a given obstacle. We can derive the following expressions for first and second derivatives of C(r). The derivatives of ρ below are evaluated at φ = arctan2(r − r0 ). To simplify the expressions, x, y, r refer to the offsets from obstacle origin r0 instead of absolute positions in the plane. r {−y, x} ∂C = − ρ0 (φ) 2 ∂r ||r||2 ||r||2 ∂2C 1 = 3 2 ∂r ||r||2  1− ρ00 (φ) ||r||2 y2 −xy    ρ0 (φ) −xy 2xy − 2 2 4 x2 ||r||2 y − x (34) y 2 − x2 −2xy  (35) Obviously, the second derivative is a 2 × 2 matrix. The constraint function C(r) is piecewise differentiable for all r except at a single point r = r0 . If r = r0 by chance, which is easily detectable, we know that the r is inside the obstacle and can perturbed to avoid this undefined behavior. Note that C(r) remains bounded inside the obstacle. It is the derivatives that are not bounded as r → r0 Figure 4(c) shows a surface plot of C(r) for the obstacle shown in Figure 4(a). The contours of constant values are shown in Figure 4(d). Incorporating robot shape The discussion on obstacle avoidance constraints so far has assumed that the robot is a point. In reality, the robot is not a point. To impose obstacle avoidance constraints in this case, the robot can be modeled as a closed curve that encloses the projection of its boundary in the plane of motion. We can choose a set of points on this curve and impose the constraint that all these points be outside all obstacles. The distance between any pair of points can be smaller than the smallest obstacle. We have currently not implemented this and this is part of future work. 21 ΡHΦL=1H3+sinH3ΦLL ΡHΦL=1H3+sinH3ΦLL ΡHΦL 1 0.6 0.4 0.2 1 2 0.0 -0.2 -0.4 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0 0 (a) Obstacle shape Π 2 Π 3Π 2 Φ 2Π (b) Obstacle as a 1-D curve (c) Surface plot of constraint (d) Level sets of constraint Figure 4: Obstacle and constraint plots. The figures show an obstacle in polar coordinates in (a), and its 1-D representation in (b). The region with darker shade is the interior and a feasible trajectory must not pass through it. The surface plot of the corresponding constraint function C(r) of Equation (33) is shown in (c) and its level set is shown in (d). The arrow marks the zero level set, which is the obstacle boundary. 22 6.8 The full nonlinear constrained optimization problem We now summarize the nonlinear and constrained trajectory optimization problem taking into account all input parameters, all the boundary conditions, and all the constraints. This is the “functional” form of the problem (posed in function spaces). We will present an appropriate discretization procedure valid for all input combinations in the next chapter. Minimize the discomfort functional J, where Z 1 3 Z 1 Z 1 v λ v 02 00 2 02 2 (v + vv − v θ ) du + w (3v 0 θ0 + vθ00 )2 du, J(v, θ, λ) = du + wT N 3 3 0 λ 0 v 0 λ given the following boundary conditions for both starting point and ending point • position (r0 , rτ ), • orientation (θ0 , θτ ), • signed curvature (κ0 , κτ ), • speed (v0 ≥ 0, vτ ≥ 0), • tangential acceleration (aT ,0 , aT ,τ ), and constraints on allowable range of • speed (vmin = 0, vmax ), • tangential acceleration (aT ,min , aT ,max ), • normal acceleration (aN ,min , aN ,max ), • angular speed (ωmin , ωmax ), • curvature, if necessary (κmin = 0, κmax ), and • number of obstacles Nobs , obs • locations of obstacles {ci }N i=1 obs • representation of obstacles that allows computation of {ρi (φ)}N i=1 , for φ ∈ [0, 2π) and • an initial guess for (v(u), θ(u), λ), in u ∈ [0, 1], • weights wT > 0 and wN > 0. 23 Figure 5: Finite-element mesh for the optimization problem. The figure at the top shows the finite-element mesh consisting of n elements and n + 1 nodes. There are 4 primary unknowns at each node – speed, orientation, and their derivatives with respect to the scaled-arc length parameter u. The figure on the bottom left shows how dynamic constraints are imposed. P points are chosen in the interior of each element, and speed, angular speed, curvature, and tangential and normal accelerations are computed at each of these points in terms of the primary unknowns. Bounds are then imposed as constraints on these computed values. The figure on the bottom right shows how obstacle constraints are imposed. Addition variables (x, y) representing position are introduced at M points in the interior of each element and at each node. Each (x, y) pair is related to each of its neighboring pairs by a constraint. For obstacle avoidance, a constraint is imposed on each (x, y) pair so that it is stays outside all obstacles. The constraint on starting and ending position requires that Z 1 Z rτ − r0 = λ cos θ du, 0 1  sin θ du 0 Staying outside all obstacles requires that ||r(u) − ci ||2 − ρi (arctan2(r(u) − ci )) ≥ 0 ∀ i ∈ 1, . . . , Nobs , and ∀ u ∈ [0, 1] where Z r(u) = r(0) + λ u Z cos θ du, 0 u  sin θ du . 0 As a post-processing step, we compute time t as a function of u using Z u λ du t = t(u) = v(u) 0 and convert all quantities (v, θ, r, and their derivatives) from u domain to t domain. 7 Numerical solution The optimization problem posed in Section 6.8 is infinite dimensional since it is posed on infinite dimensional function spaces. This means that we must discretize it as a finite dimensional problem before it can be solved numerically. We saw in Section 6.6 that we must be able to impose two kinds of boundary conditions. In the first kind, the problem is set in the Sobolev space of functions whose up to second derivatives are square integrable. In the second kind, we must allow functions that are singular at the boundary (with a known strength) but still lie in the same Sobolev space in the interior. Keeping the problem setting and requirements 24 mentioned above in mind, it is natural to use the Finite Element Method (FEM) to discretize it. For the first kind of boundary conditions, where speed is non-zero at both boundaries, v(u) must belong to H 2 (Ω). It is natural to use the basis functions in C 1 (Ω), the space of functions that are continuous and have continuous first derivatives. In accordance with standard FEM practice (Hughes, 2000), we choose the cubic Hermite shape functions to discretize v(u). For the second kind of boundary conditions, when either one or both the boundary points have zero speed specified, we must allow functions that are singular at the boundary (with a known strength) but still belong to H 2 (Ω) in the interior. We use special shape functions for v(u) on the boundary element where speed is zero so that v(u) has the appropriate strength of singularity at the boundary, and use regular cubic Hermite shape functions in the interior. For both kinds of boundary conditions, we use cubic Hermite shape functions for θ(u) on all elements. With the above choice of shape functions, an n element mesh for the problem consists of the following unknowns at each node – v, v 0 , θ, θ0 resulting in a total of 4(n + 1) unknowns. In addition, the path length λ is also an unknown. For optimization, the values of the objective function, its gradient and Hessian, the values of constraints, and the gradient and Hessian of each constraint are required. For efficiency, it is desirable that objective function and constraint Hessians be sparse. We show in the second paper of this series that the Hessian of obstacle avoidance constraints can be kept sparse if we introduce 2N N additional unknowns in the form nR of position Rr(ui ) = {x(u oi ), y(ui )}i=1 at N points on the mesh and a ui ui constraint r(ui ) − r(ui−1 ) = λ ui−1 cos θ du, ui−1 sin θ du between each pair of r(ui−1 ) and r(ui ). We choose uniformly separated N points and let N = nM + (n + 1) so that obstacle avoidance constraints are imposed at M points in the interior of each element and at each of the n + 1 nodes. With the discretization above, the infinite dimensional problem of Section 6.8 is converted into a finitedimensional nonlinear constrained optimization problem. The objective now is to determine the values of the 4(n + 1) + 2N + 1 unknowns that minimize the discomfort cost functional and satisfy the boundary conditions and constraints described in (Section 6.8). To impose boundary conditions, we impose constraints on some of the degrees of freedom and eliminate some of the degrees of freedom at the end points. To impose dynamic constraints, we compute the speed v, tangential acceleration aT , normal acceleration aN , angular speed ω, and curvature κ in terms of the unknowns at P points in the interior of each element and impose bounds on these quantities as constraints. See Figure 5. To numerically compute the integrals in the cost functional and constraints, we use Gauss quadrature formulas with 12 integration points. In our implementation, the number of elements in the finite element mesh, n = 32, number of intervals per element for obstacle avoidance constraints, M = 20, the number of points per element on which to impose dynamic constraints P = 12. The rationale for choosing these particular values is discussed in the second paper in this series. 8 Initial guess for the optimization problem Because of the non-linearity in the optimization problem, and the presence of both inequality and inequality constraints, it is crucial that a suitable initial guess of the trajectory be computed and provided to an optimization algorithm. Many software packages can generate their own “starting points”, but a good initial guess that is within the feasible region can easily reduce the computational effort (measured by number of function and derivative evaluation steps) many times. Not only that, reliably solving a nonlinear constrained optimization problem without a high quality initial guess can be extremely difficult. Because of these reasons, we invest considerable mathematical and computational effort to generate a high quality initial guess of the trajectory. Our optimization problem is to find the scalar λ and the two functions θ and v that minimize the discomfort. We compute the initial guess of trajectory by computing λ and θ first and then computing v by solving a separate optimization problem. We emphasize that the initial guess computation process must deal with 25 arbitrary inputs and reliably compute the initial guesses. 8.1 Initial guess of path To compute initial guess for θ(u) and λ for any pair of specified initial and final orientations (θ0 , θτ ), we solve an auxiliary (but simpler) nonlinear constrained optimization problem for the four pairs of orientations (θ0 , θτ ), (θ0 , θτ ), (θ0 , θτ + 2π), and (θ0 , θτ − 2π). We minimize Z J(θ, λ) = λ + w 1 θ002 du (36) 0 where w := max(∆L, R), and θ must satisfy the boundary conditions, the two equality constraints of Equation (31), and the curvature constraint |θ0 (u)| ≤ λκmax ∀u ∈ [0, 1]. We do not impose obstacle related constraints in this problem. Here ∆L is the distance between start and end positions and R is the minimum allowed radius of curvature. Note that this is a geometric and time is absent. This method of computing four different initial guesses is based on a special kind of non-uniqueness of paths. This particular kind of non-uniqueness arises because a single physical orientation θ can correspond to multiple numerical values of θ (θ ± 2nπ ∀n ∈ N). This is because θ is continuous and cannot jump to a different value in between. Of course, this optimization problem needs its own initial guess, and we use paths similar to Dubins curves to compute a suitable initial guess. Our method generates two different initial guesses for the auxiliary problem for the pair (θ0 , θτ ), leading to 4 initial guesses of θ(u) for the discomfort minimization problem. λ is the length of the paths computed above. The non-uniqueness in paths and the computation of initial guess is discussed in greater detail in the second paper (Part II) of this series. 8.2 Initial guess of speed For the case when both end-points have non-zero speed, we compute initial guess of v(u) by solving an auxiliary optimization problem. We minimize Z 1 J(v) = v 002 du (37) 0 subject to boundary constraints v(0) = v0 > 0, v(1) = v1 > 0, v 0 (0) = av00λ , v 0 (1) = av11λ and inequality constraints vmin (u) ≤ v(u) ≤ vmax (u) and Amin (u) ≤ v 0 (u) ≤ Amax (u). The expressions for v 0 (0) and v 0 (1) come from the relation in Equation (21). The length λ is computed when the initial guess for θ is computed. Here we choose vmin (u) = min(v0 , v1 )/2 and vmax (u) is a constant that comes from the hardware limits. The function Amin (u) is chosen to be the constant 10amin λ/ min(v0 , v1 ) where amin is the minimum allowed physical acceleration. Amax (u) is chosen similarly using amax . If both end-points have zero speeds, the function v(u) = vmax (4u(1 − u)) 2/3 (38) satisfies the boundary conditions and singularities and has a maximum value of vmax . This case does not require any optimization. If only one of the end-points has a zero speed boundary condition, we split the initial guess for v into a sum of two functions. The first one takes care of the singularity and the second takes care of the non-zero speed boundary condition on the other end-point. We now maintain only the vmax constraint because v 0 (u) is unbounded and vmin = 0 naturally. If the right end-point has zero speed, we choose v(u) = vsingular (u) + vnon-singular (u) 26 (39) where 16 1/3 2 vmax u2 (1 − u)2/3 . (40) 9 This function has the correct singularity behavior and its maximum value is vmax /2. The non-singular part is computed via optimization so that the sum is always less than vmax . For the other case, when left end-point has zero speed, the singular part (using symmetry) is vsingular (u) = 16 1/3 2 vmax (1 − u)2 u2/3 . 9 8.3 Summary For any given pair of orientations, we compute four initial guesses of path θ(u) and corresponding path lengths λ. To compute initial guess of speed v(u), we treat zero speed and non-zero speed boundary conditions differently. When speed is zero at both ends, we use Equation (38). When speed is non-zero at either ends, we use Equation (39). In this case, we compute vnon-singular (u) by solving the optimization problem Equation (37). In this case, four initial guesses of speed are computed corresponding to each guess of λ. 9 Evaluation and results The motion planning framework described in this paper is expected to reliably plan trajectories for different types of boundary conditions. These trajectories should satisfy dynamic constraints and the corresponding geometric paths should not intersect obstacles. Further, this framework should reliably compute trajectories between a given pair of boundary conditions for a range of weights, wT and wN , so that users can customize the motion by changing these weights. In the following discussion, we refer to optimization problem of Section 6.8 as the discomfort minimization problem. We begin by describing the input to the discomfort minimization problem. Some quantities in the input such as dynamic bounds are fixed, while others such as boundary conditions and obstacle locations and shapes are problem dependent. We also provide some implementation details. Next, we present illustrative examples showing the various steps of the solution method, and demonstrate some of the strengths of our method such as the ability to plan trajectories for a wide variety of boundary conditions and obstacle shapes. We then analyze how varying the weight factors fT and fN affect the solution trajectory. Our objective is to find qualitative relationships between these weight factors and each of the terms in the discomfort measure (total travel time, integral of squared tangential jerk, and integral of squared normal jerk). These relationships should provide guidelines for user customization. Next, to evaluate the reliability of our method, we construct a set of problems by varying boundary conditions and find the success rate. We also analyze the run-time and number of iterations to solve the discomfort minimization problem. 9.1 Experimental setting The input to the discomfort minimization problem described in Section 6.8 consists of: 1. Number of elements, n, for finite element discretization. We choose n = 32 based on a numerical experiment based on convergence to the “exact” solution of the infinite dimensional optimization 27 problem as the maximum finite element size is reduced. Details are in the second paper (Part II) of this series. 2. Number of intervals per element M , to compute the {x, y} pairs for imposing obstacle constraints (see Section 6.7 and Section 7). We choose M = 20 when obstacles are present, otherwise the choice is irrelevant. 3. Values of bounds on curvature, speed, angular speed, tangential acceleration, and normal acceleration (See Section 6.8). Curvature bound should be determined from the robot’s geometry. We choose the value for a typical assistive wheelchair. While we assume a point robot and do not consider robot shape for obstacle-avoidance, we do include curvature constraints based on the dimensions of a typical wheelchair. All other bounds should be chosen for comfort. In the absence of relevant comfort studies for assistive robots, we choose bounds on linear and angular speed based on our experience with an intelligent wheelchair (Gulati and Kuipers, 2008; Gulati et al., 2009; Murarka et al., 2009) and studies of comfort in ground vehicles (see Section 2.1). All these values are shown in Table 1. Quantity Curvature (1/m) Speed (m/s) Angular speed (rad/s) Tangential acceleration (m/s2 ) Normal acceleration (m/s2 ) Lower Bound −1.8 0.0 -1.57 -1.0 -1.0 Upper Bound 1.8 3.0 1.57 1.0 1.0 Table 1: Lower and upper bounds on curvature, speeds, and accelerations used in experiments. Curvature bounds are based on a minimum turning radius of 0.55 m. 4. Non-dimensional multiplying factors for weights, fT > 0 and fN > 0. Both these values are set to 1 unless mentioned otherwise. 5. Representation of obstacles as star-shaped domains with piecewise C 2 boundary (see Section 6.7). In our experiments, we use circular, elliptical, and star-shaped polygonal obstacles. See Figures 11 and 12. 6. Boundary conditions on position, orientation, curvature, speed and tangential acceleration (see Section 6.6). These are problem specific and we describe these for each of the experiments. We have implemented our code in C++. We use Ipopt, a robust large-scale nonlinear constrained optimization library (Wächter and Biegler, 2006), also written in C++, to solve the optimization problem. We explicitly compute gradient and Hessian for the optimization problem in our code instead of letting Ipopt compute these using finite difference. This leads to greater robustness and faster convergence. We set the Ipopt parameter for relative tolerance as 10−8 and set the maximum number of iterations to 500. After optimization, the outputs are the nodal values of v, v 0 , θ, and θ0 , and the curve length λ (see Section 7). The functions v(u) and θ(u), u ∈ [0, 1] are known in terms of these nodal values. We use Equation (13) to construct a table of u values for u ∈ [0, 1] and the corresponding t values for t ∈ [0, τ ]. The value of any of the quantities of interest (orientation, speed, etc.) at any time t ∈ [0, τ ] is computed using this table by linear interpolation. 9.2 Illustrative examples We begin by presenting an example that illustrates the optimization process. In Figure 6, the initial position is {0, 0} and final position is {−1, −4}. The initial and final orientations are both zero. The speed and tangential acceleration at both ends are also zero. 28 First, four initial guesses of path (θ(u), u ∈ [0, 1] and λ) are computed as described in Section 8.1. These four initial guesses are shown in Figure 6. The first two guessed have θτ = 0, the third guess has θτ = −2π, and the fourth guess has θτ = 2π. An initial guess of speed, v(u), is computed as described in Section 8.2. In this example, speed at both ends is zero and hence v(u) is computed using Equation (38). Thus we get the same function v(u) for all guesses of path. See Figure 7. The discomfort minimization problem is solved for each of these four initial guesses. The four solution paths that minimize discomfort are shown in Figure 8. The travel time and costs for the four solution paths are shown in Table 2. The path corresponding to Solution 1 has the minimum cost, and is thus in agreement with our intuitive notion of the best path among these four. Notice the circular arcs at the start and end of the path of Solution 2. These arcs have a constant radius equal to the minimum turning radius of the robot because of curvature constraints. If curvature constraints are not imposed, these arcs have a smaller radius and the path has a smaller length. Note that it is not always true that all four solutions are distinct since two or more problems starting from different initial guesses may converge to the same solution. The solution speeds are shown in Figure 9. The final speeds in Solution 1 and Solution 2 are symmetric about t = τ2 because of the inherent “symmetry” due to zero orientation, speed, and acceleration at both ends. The final speeds in Solution 3 and Solution 4 are mirror images of each other about t = τ2 because the final orientations in these two are −2π and 2π respectively. The figures also show that the initial guesses of the paths and speeds are quite good, which is important for nonlinear optimization. In Figure 10, we introduce five elliptical obstacles for the same boundary conditions. All four initial guesses of path and solution paths are shown. The initial guesses of path and speed do not consider obstacles and hence are identical to those in Figures 8 and 9 respectively. Four distinct solution paths are found. The travel time and total cost for all four solutions is shown in Table 3, and is greater than for the problem of Figure 8 (see Table 2). The minimum cost path is that of Solution 1 which again agrees with our intuition. Notice how the path of Solution 3 passes above the lowermost elliptical obstacle, while the path of Solution 4 passes below the uppermost elliptical obstacle. Our experience with this and other examples shows that once the optimization algorithm takes a step that brings an iterate to one side of the obstacle, further iterations keep it on the same side. We believe that this is because paths passing an obstacle on different “sides” cannot be transformed to each other via a continuous deformation of the path and lie in disjoint feasible regions. The iterates in the optimization process cannot jump from one feasible region to a different feasible region in general. 29 Solution 2 2 0 0 y (m) 2 2 2 4 4 6 6 3 2 10 1 2 x (m) 3 2 10 1 2 x (m) Solution 3 Solution 4 2 2 0 0 y (m) y (m) y (m) Solution 1 2 2 4 4 6 6 3 2 10 1 2 x (m) 3 2 10 1 2 x (m) Figure 6: Four initial guess of path. Problem input is as follows: initial position = {0, 0}, orientation = 0, speed = 0, tangential acceleration = 0; final position = {−1, −4}, orientation = 0, speed = 0, tangential acceleration = 0. The four initial guesses of path are computed using the method described in Section 8.1 so that final orientation in (a),(b),(c) and (d) is 0, 0, −2π and 2π respectively. All quantities have appropriate units in terms of meters and seconds. Initial and final positions are shown by markers and orientations are indicated by arrows. While the path is parameterized by u, for ease of visualization, we show markers at equal intervals of time. Thus distance between markers is inversely proportional to speed. Solution1 2.5 2.5 2.0 2.0 1.5 1.0 0.5 0.0 0.00 Solution2 3.0 v (m/s) v (m/s) 3.0 1.5 1.0 0.5 0.25 0.50 t/ 0.75 0.0 0.00 1.00 0.25 0.50 t/ Solution3 Solution4 Figure 7: Initial guess of speed for problem of Figure 6. 3.0 3.0 In this case, because of zero speed boundary condition on both ends, the same initial guess of speed is produced for each path guess. When speed is non-zero 2.5 on one or both ends, four distinct guesses of speed 2.5 may be produced. 30 1.5 2.0 v (m/s) v (m/s) 2.0 1.5 0.75 1. Solution 2 2 0 0 y (m) 2 2 2 4 4 6 6 3 2 10 1 2 x (m) 3 2 10 1 2 x (m) Solution 3 Solution 4 2 2 0 0 y (m) y (m) y (m) Solution 1 2 2 4 4 6 6 3 2 10 1 2 x (m) 3 2 10 1 2 x (m) Figure 8: Solution paths of the problem of Figure 6. Final (optimal) path for each solution is shown as solid curve. Initial guess is shown as dashed curve. The number of DOFs for the discomfort minimization problem were 1403 and number of constraints were 3232. The total cost and travel time for the four solutions are shown in Table 2. 31 Solution1 2.5 2.5 2.0 2.0 1.5 1.0 0.5 0.0 0.00 0.25 0.50 t/ 0.75 1.0 0.0 0.00 1.00 Solution3 0.25 2.5 2.5 2.0 2.0 1.5 1.0 0.5 0.50 t/ 0.75 1.00 0.75 1.00 Solution4 3.0 v (m/s) v (m/s) 1.5 0.5 3.0 0.0 0.00 Solution2 3.0 v (m/s) v (m/s) 3.0 1.5 1.0 0.5 0.25 0.50 t/ 0.75 0.0 0.00 1.00 0.25 0.50 t/ Figure 9: Solution speeds of the problem of Figure 6. Final (optimal) speed for each solution is shown as the solid curve. Initial guess is shown as the dashed curve. Solution Number 1 2 3 4 Travel time (s) 6.3 10.0 7.9 7.9 Total cost (s) 6.5 11.0 8.0 8.0 Table 2: Travel time and total cost for problem of Figure 6. 32 Solution 2 2 0 0 y (m) 2 2 2 4 4 6 6 3 2 10 1 2 x (m) 3 2 10 1 2 x (m) Solution 3 Solution 4 2 2 0 0 y (m) y (m) y (m) Solution 1 2 2 4 4 6 6 3 2 10 1 2 x (m) 3 2 10 1 2 x (m) Figure 10: Solution paths to a problem with five elliptical obstacles. The boundary conditions of this problem are identical to the problem of Figure 6. Four distinct solution paths in the neighborhood of the four initial guesses are found. Initial guesses are the dotted curves while the final solutions are the solid curves. This problem had 3195 constraints for obstacle-avoidance in addition to the constraints in Figure 6. The total cost and travel time for the four solutions are shown in Table 3. 33 Solution Number 1 2 3 4 Travel time (s) 7.0 11.7 9.1 10.3 Total cost (s) 7.1 11.9 9.4 10.4 Table 3: Travel time and total cost for problem of Figure 10. Figure 11 show an example where the initial and final speeds are both non-zero. This scenario exemplifies one of the common navigation tasks for an autonomous mobile robot – that of navigating in a corridor or sidewalk or driving in a lane on a road. We show only one solution out of four in this case. Figure 11(a) has two rectangular obstacles, signifying a wall. In the sequence Figure 11(b)–(f), one obstacle is added at a time, and each time a path is found that avoids all the obstacles. Figure 12 shows an example when the initial speed is non-zero and the initial acceleration is positive. There are four rectangular and two star-shaped obstacles. This is a particularly difficult case because it involves a non-zero speed and high acceleration(0.5 m/s2 , half the maximum allowable acceleration) at the beginning and a narrow passage between obstacles. In this case, only one of the four initial guesses resulted in a solution. Notice the loop in the path near the start. This is because the initial speed and acceleration are non-zero, and hence a sharp 90 degree left turn is not possible without violating dynamic bounds. If dynamic bounds are removed, another path, without a loop, starting from another initial guess is also found as a solution. This path does not have a loop. Also notice how the path just touches the vertices of obstacles so that its length is as small as is consistent with comfort. 34 3 y(m) y(m) 3 0 3 0 5 10 x(m) 15 0 3 0 20 5 (a) y(m) y(m) 5 10 x(m) 15 15 20 15 20 0 3 0 20 5 (c) 10 x(m) (d) 3 y(m) 3 y(m) 20 3 0 0 3 0 15 (b) 3 3 0 10 x(m) 5 10 x(m) 15 0 3 0 20 (e) 5 10 x(m) (f) Figure 11: Obstacle avoidance in a corridor-like setting with non-zero speed at both ends. Problem input is as follows: initial position = {0, 0}, orientation = 0, speed = 1, tangential acceleration = 0; final position = {20, 0}, orientation = 0, speed = 1, tangential acceleration = 0. One of the four solution paths is shown. Initial guess is shown as the dashed curve while solution is shown as the solid curve. (a) Only two rectangular obstacles, comprising the corridor walls are present. The solution path is a straight line. (b) Addition of a circular obstacle results in a path that passes below the obstacle. Another solution path that passes above the obstacle and is symmetric to this path about the center line would also be a solution with same cost. (c),(d),(e),(f) One more obstacle is added and the same problem is solved starting from the same initial guess as in (a). All quantities have appropriate units in terms of meters and seconds. 35 60 50 40 y (m) 30 20 10 0 10 2030 20 10 0 x (m) 10 20 30 Figure 12: Illustrative example showing passage through narrow space between star-shaped obstacles with non-zero speed at both ends and high positive acceleration at start. Problem input is as follows: initial position = {−5, −5}, orientation = 0, speed = 1, tangential acceleration = 0.5; final position = {2.5, 45}, orientation = π/2, speed = 1, tangential acceleration = 0. Four rectangular and two star-shaped obstacles are present. Initial guess is shown as the dashed curve while solution is shown as the solid curve. The loop in the solution at the beginning of the path is because the initial acceleration is high and hence it is not possible to make a sharp turn without violating dynamic constraints. All quantities have appropriate units in terms of meters and seconds. 36 9.3 Effect of weights on discomfort In this section we analyze the effect of the two dimensionless factors fT and fN on the individual terms comprising the cost functional (travel time, integral of squared tangential jerk, and integral of squared normal jerk) (see Equation (7)). This analysis provides us with guidelines for choosing the values of weights for customization by human users. Henceforth, for conciseness, we will refer to the three terms – travel time, integral of squared tangential jerk, and integral of squared normal jerk as τ , JT and JN respectively. Thus, the cost functional of Equation (7) is J = τ + fT JT + fN JN For this experiment, we construct a problem with identical boundary conditions as that of the example in Figure 6. In order to delineate the effect of weights, we remove all constraints and solve the unconstrained problem for a range of factors fT and fN for each of the four initial guesses. fT is varied from 2−13 to 213 in a geometric sequence, each subsequent value being obtained by multiplying the current value by 10. For each value of fT , fN is varied from 2−13 to 213 in a similar manner. Thus each weight roughly ranges between 0.0001 and 10000. This results in 4 × 27 × 27 = 2916 problems out of which 97% were successfully solved. We show plots corresponding to only one of these four solutions. Plots for the remaining solutions are similar, although the number of problems that converge is different for each initial guess. Figures 13, 14, and 15 show τ , JT and JN respectively. In each figure, part (a) shows log of the respective quantity as a function of fT and fN on a log-log-log scale. Part (b) is a top view of the surface plot above. Part (c) shows slices of this surface plot at fN = 1 and fT = 1 respectively. The “holes” in the surface plots correspond to the problems that did not converge to a solution. In general, the surfaces are rougher and there are more failures when fN is much larger than fT . This indicates that the problem becomes less “stable” as the weight factors are too imbalanced. (In reality there are more holes in the surfaces than there are non-convergent problems. This is an unfortunate artifact of the plotting software that we use. In the surface plot, a vertex corresponds to a problem rather than a cell. Thus, one non-convergent problem causes all the cells that share that vertex to be removed. The actual non-convergent problems correspond to the empty cells of Figure 16). In this experiment, the ratio of tangential jerk weight to normal jerk weight has been varied by nearly 8 orders of magnitude and we get solutions in almost all cases. From Figure 13, we see that the travel time increases with increase in weights. This is expected since large weights mean that the contribution of travel time to total discomfort is relatively low compared to the contribution of the terms due to jerk. We also see that τ monotonically increases with fT . For low values of fN , τ does not change appreciably with fN . As the value of fN increases beyond a threshold, τ monotonically increases with fN . The rate of increase of τ with respect to fT is higher than it is with respect to fN . From Figure 14, we observe that log JT decreases linearly with log fT while it is almost constant with respect to log fN . Thus, the integral of squared tangential jerk, JT , is related to fT by a power law. From Figure 15 we see that for low values of fT , JN does not change appreciably with fT . As the value of fT increases beyond a threshold, JN monotonically decreases with fT . A similar behavior is observed with respect to fN although the threshold value appears lower than that for fT . Once the values exceed the threshold, the rate of change of JN with respect to both fN and fT is almost the same. Thus, we see that the integral of squared tangential jerk, JT is a function of fT alone, and travel time changes more rapidly by changing fT compared to fN . Integral of squared normal jerk, JN is a function of both fT and fN . Whenever a relationship exist between fT or fN and any of the quantities travel time, integral of squared tangential jerk, and integral of squared normal jerk, it is of the form of a power law. 37 10000 2.5 2.5 2 2 2 1.5 1.5 1.5 fN log(travel time) 2.5 1 1 0.5 1 1 0.5 0 0.5 0 10000 1 fN 0.0001 0.0001 0 0.0001 0.0001 10000 1 1 fT (a) (b) 2.4 2.4 2.2 2.2 2 log(travel time) log(travel time) 2 1.8 1.6 1.4 1.2 1.8 1.6 1.4 1.2 1 1 0.8 0.8 0.0001 0.001 10000 fT 0.01 0.1 1 fT 10 100 1000 10000 0.0001 0.001 (c) 0.01 0.1 1 fN 10 100 1000 10000 (d) Figure 13: Effect of weights on travel time. (a) Surface plot of log τ as a function of fT and fN on a log-log scale. (b) Top view of the surface plot. (c) Slice of the surface plot at fN = 1. (d) Slice of the surface plot at fT = 1. From this analysis, we can draw some useful guidelines for customizing weights for comfort even though the effect of weight on discomfort is nonlinear. Since JT is a function of fT alone, we can devise experiments that allow a user to choose fT that keeps tangential jerk to an acceptable level. For example, we can devise experiments that consist primarily of straight line motion, and has zero speeds on both ends. In such a motion, normal component of jerk will make none or minimal contribution to discomfort. Hence, it would be easy to set fT . Next, we can devise experiments that consist of at least some curved segments. The user can choose fN to keep normal jerk during this curved motion to an acceptable level. Because of power law relationships, the weights should be varied in a geometric manner rather than a linear manner for faster customization. Figure 16 shows the number of iterations taken by Ipopt to find a solution. Apart from a few isolated outliers that require large number of iterations, it is clear that the number of iterations is small in the region where fT is not too small compared to fN and both factors are not too small either. If fN is much larger than fT , the problems still converge in most cases but require many iterations. Most of the failures are when fN is too large compared to unity. Hence, we recommend that for customization fN should not be too large compared to fT and both should be not too small compared to unity. 38 10000 12 12 10 10 8 8 6 6 8 6 fN 10 log(integral of squared tangential jerk) 12 4 1 4 4 2 2 0 0 0 −2 −2 2 0.0001 −2 0.0001 0.0001 10000 1 1 10000 fT 0.0001 fN (a) (b) 12 log(integral of squared tangential jerk) 12 log(integral of squared tangential jerk) 10000 fT 1 10 8 6 4 2 0 −2 0.0001 0.001 0.01 0.1 1 fT 10 100 1000 10000 10 8 6 4 2 0 −2 0.0001 0.001 0.01 0.1 (c) 1 fN 10 100 1000 10000 (d) Figure 14: Effect of weights on integral of squared tangential jerk. (a) Surface plot of log(integral of squared tangential jerk) as a function of fT and fN on a log-log scale. (b) Top view of the surface plot. (c) Slice of the surface plot at fN = 1. (d) Slice of the surface plot at fT = 1. 10000 12 12 10 10 12 6 6 8 fN log(integral of squared normal jerk) 8 8 10 1 4 6 4 4 2 2 2 0 0 0 −2 −2 −2 0.0001 0.0001 0.0001 0.0001 1 10000 fT 1 (a) (b) 6 5 4 3 2 1 0 −1 39 −2 0.01 0.1 1 fT (c) 10 100 1000 10000 log(integral of squared normal jerk) log(integral of squared normal jerk) 6 −3 0.0001 0.001 10000 fT 1 10000 fN 5 4 3 2 1 0 −1 −2 −3 0.0001 0.001 0.01 0.1 1 fN (d) 10 100 1000 10000 f_N 1/8192 1 126 28 61 24 19 35 19 30 63 31 31 39 45 18 11 12 20 17 17 17 17 30 18 28 19 60 41 32 78 24 22 62 78 58 44 26 41 262 16 10 11 12 19 17 17 17 17 66 18 28 19 51 30 211 21 23 204 29 20 27 21 45 59 21 179 12 12 11 12 20 17 17 17 17 54 18 37 19 49 79 26 86 20 19 19 18 19 16 24 57 18 12 12 11 11 12 25 17 17 17 17 0 18 231 19 19 38 55 62 431 37 17 17 41 121 214 19 11 24 13 12 11 12 29 17 17 17 17 173 18 80 19 19 29 33 18 231 15 22 20 18 22 35 27 12 47 11 23 12 12 24 17 17 17 17 220 18 31 19 19 28 37 111 52 22 22 26 18 15 18 35 63 23 12 19 16 16 20 358 17 17 17 24 47 11 25 25 55 64 20 19 11 15 9 9 20 18 17 14 17 57 17 31 18 61 19 19 85 65 23 213 14 16 28 41 17 14 16 12 18 16 35 21 225 34 41 19 33 18 18 19 19 105 42 149 47 56 34 18 19 11 13 13 18 9 100 17 26 17 22 24 47 84 19 26 18 18 19 19 32 33 20 44 20 14 23 55 14 51 11 11 14 13 17 31 15 20 22 23 45 19 31 19 25 19 19 25 65 27 46 26 30 26 18 14 25 12 10 10 15 18 23 15 15 70 147 36 17 103 19 107 19 19 88 35 54 42 52 58 28 43 13 15 16 24 12 160 12 18 15 14 14 17 16 23 24 19 31 20 19 84 74 58 34 45 163 58 45 22 17 62 11 34 12 18 11 16 14 13 28 17 23 27 36 23 19 38 45 31 356 52 49 21 33 23 16 95 11 16 39 14 13 15 12 15 13 12 20 167 40 24 25 18 22 90 69 135 76 40 29 25 25 23 20 19 68 24 14 15 12 14 18 14 12 18 16 22 172 147 23 39 314 83 40 74 33 24 28 16 15 153 13 17 13 16 13 16 20 19 22 24 67 239 138 124 176 159 154 38 137 43 35 34 32 20 18 18 20 257 12 14 12 13 16 16 18 30 21 32 39 103 223 81 190 56 89 42 49 73 27 25 37 26 25 18 24 12 13 16 18 17 39 22 231 26 30 72 111 112 155 41 78 104 39 36 42 74 115 91 83 38 0 84 84 33 33 88 19 87 21 13 12 14 12 13 0 21 23 21 23 73 81 70 113 113 99 86 77 38 149 47 59 33 44 29 20 22 32 13 14 13 15 14 21 21 22 26 82 82 78 130 103 55 52 64 299 38 95 43 31 38 50 68 19 19 19 15 13 16 13 14 21 23 21 56 131 46 54 108 97 52 38 56 102 37 49 20 112 20 31 16 15 14 13 15 20 21 50 36 68 42 36 32 20 56 14 16 16 15 20 99 113 158 44 134 78 205 73 76 78 124 434 55 46 42 32 25 22 25 63 351 123 51 14 15 459 186 78 67 102 87 101 71 125 112 142 258 199 123 86 127 41 285 66 118 216 175 103 8192 18 374 19 19 21 174 71 35 38 92 94 85 0 0 85 116 78 0 184 199 255 0 0 0 135 71 44 80 83 47 48 56 278 43 0 41 31 75 52 43 24 19 19 17 0 0 106 0 0 80 29 60 36 0 23 20 19 32 64 1 f_T 1/8192 121 64 8192 Figure 16: Number of iterations for the range of weight factors. The green cells indicate smaller number of iterations compared to red cells. It is clear that the least number of iterations are taken in the region where both factors are greater than 1/32 and one factor is roughly within 1/16 to 16 times the other. The empty cells correspond to problems that failed to converge. 9.4 Reliability To evaluate the reliability of our method, we construct a set of 7500 problems with different boundary conditions and solve the full constrained optimization problem corresponding to each of the 4 initial guesses for each problem. We do not include obstacles in this test. We generate the problem set as follows. Fix the initial position as {0, 0} and orientation as 0. Choose final position at different distances along radial lines from the origin. Choose 10 radial lines that start from 0 degrees and go up to 180 degrees in equal increments. The distance on the radial line is chosen from the set {1, 2, 4, 8, 16}. The angle of the radial line and the distance on the line determines the final position. Choose 30 final orientations starting from 0 up to 360 degrees (360 degrees not included) in equal increments. The speed, v, and tangential acceleration, aT , at both ends are varied by choosing {v, aT } pairs from the set {{0, 0} , {1, −0.1} , {1, 0} , {1, 0.1} , {3, 0}}. Thus we have 10 radial lines, 5 distances on each radial line, 30 orientations, 5 {v, aT } pairs, resulting in 10 × 5 × 30 × 5 = 7500 cases. Each problem has 189 degrees of freedom, 2018 constraints, out of which 66 are equality constraints and 1952 are inequality constraints. For computation of initial guess of path, we set the maximum number of iterations to 100. For discomfort minimization problem we set the maximum number of iterations to 200. An average of 3.6 solution paths were found for each problem. This average would be higher if we set the maximum number of iterations even higher. However, since we wanted to evaluate how reliably our method 40 performed in a reasonable amount of computation time, we kept the maximum number of iteration as 200. All the problems were solved on a computer with an Intel Core i7 CPU running at 2.67 GHz, 4 GB RAM, and 4 MB L-2 cache size. Histogram of run-time for computing the solution of the discomfort minimization problem is shown in Figure 17 respectively. In this histogram, we have removed 1% of cases that lie outside the range of the axis shown for better visualization. This histogram shows both successful and unsuccessful cases. For each of the 7500 problems, each of the successful initial guesses was used to compute a solution of the discomfort minimization problem. For all the problems, at least one successful solution was computed. Table 4 shows the number of problems for which one, two, three, or four solutions were successfully computed. From Figure 17 we see that 99% or more of the solutions of the full problem are computed in less than 4 seconds. To get an estimate of the percentage of outliers, we fit a Gaussian to each of the four guesses. The results are shown in Table 5. This is a simplified approximation and should be seen just as an indicator of reliability of the method. Time taken to compute the solution is further visualized in Figure 18 that shows a normalized cumulative histogram. Histograms of number of iterations for computing final solution are shown in Figure 19. On average, 90% all four solutions were computed in 100 iterations or less. Frequency Solution 2 800 700 600 500 400 300 200 100 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 0.0 Run time (s) Frequency Solution 1 800 700 600 500 400 300 200 100 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 0.0 Run time (s) (a) 99% solved within 4 s. (b) 99% solved within 4 s. Frequency Solution 4 800 700 600 500 400 300 200 100 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 0.0 Run time (s) Frequency Solution 3 800 700 600 500 400 300 200 100 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 0.0 Run time (s) (c) 99% solved within 4 s. (d) 100% solved within 4 s. Figure 17: Histogram of time taken to compute solution of discomfort minimization problem. This includes both successful and unsuccessful cases. Total 7500 cases. 41 Solution 1 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.00 4 2 6 8 Run time (s) 10 0.2 0.00 12 (a) 99% solved within 4 s. 4 6 8 Run time (s) 10 12 Solution 4 1.0 Fraction of solved problems Fraction of solved problems 2 (b) 99% solved within 4 s. Solution 3 1.0 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.00 Solution 2 1.0 Fraction of solved problems Fraction of solved problems 1.0 2 4 6 Run time (s) 8 0.2 0.00.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Run time (s) 10 (c) 99% solved within 4 s. (d) 100% solved within 4 s. Figure 18: Normalized cumulative histogram of time taken to compute solution of discomfort minimization problem. This includes both successful and unsuccessful cases. Total 7500 cases. Percentage of problems 0.39 6.20 34.45 58.96 Number of successful solutions 1 2 3 4 Table 4: Percentage of problems with one, two, three, or four successfully computed solutions. At least one solution was found for all of the 7500 problems while all four solutions were found for almost 60% of the problems. Solution 1 2 3 4 Gaussian (µ, σ) (0.668, 0.751) (0.686, 0.795) (0.612, 0.564) (0.662, 0.344) Percentage of outliers 3.56 2.74 3.35 2.64 Table 5: Estimating the percentage of outliers in computation time for the discomfort minimization problem. Mean and standard deviation of the Gaussian fitted to the data of Figure 17. Points that lie outside [µ − 3σ, µ + 3σ] are outliers. 42 Solution 1 500 Frequency 400 Frequency 400 300 300 200 200 100 00 100 50 100 150 Number of iterations 00 200 (a) 89% solved in 100 iterations or less 50 100 150 Number of iterations 200 (b) 88% solved in 100 iterations or less Solution 3 500 Solution 4 500 Frequency 400 Frequency 400 300 300 200 200 100 00 Solution 2 500 100 50 100 150 Number of iterations 00 200 (c) 93% solved in 100 iterations or less 50 100 150 Number of iterations 200 (d) 94% solved in 100 iterations or less Figure 19: Histogram of number of iterations to compute solution of discomfort minimization problem. Total number of problems is 7500. The peak at 200 iterations is due to failed cases since maximum number of iterations was set to 200. 9.5 Discussion of results and limitations Results show that our framework is capable of reliably planning trajectories between a large variety of boundary conditions and for a range of weights. 97% of 2916 unconstrained problems for a fixed boundary condition but varying weights were solved successfully when weights were varied by 8 orders of magnitude. Out of a set of 7500 examples with varying boundary conditions, and all dynamic constraints imposed, 3.6 solution paths, on average, were found per example. At least one solution was found for all of the problems and four solutions were found for roughly 60% of the problems. The time taken to compute the solution to the discomfort minimization problem was less than 10 seconds for all the cases, 99% of all problems were solved in less than 4 seconds, and roughly 90% were solved in less than 100 iterations. We also saw that our framework can plan trajectories with a variety of boundary conditions that avoid obstacles. We presented concrete examples for circular, elliptical, and star-shaped obstacles. Thus, our framework, with some more speedups in run-time, can be implemented for efficient and robust motion-planning of nonholonomic mobile robots. We will discuss possible way of achieving speedups in computational time in Section 10.1. One of the limitations of our current implementation is that if the initial guess of path passes through obstacles, it may take a large number of iterations for the optimization algorithm to converge to a solution, and sometimes a solution may not even be found. We have observed 43 this on some example cases and this will need a more careful analysis in the future. One way to deal with this issue is to generate initial guesses of path that are obstacle free and this is part of future work. There are many tasks in which an autonomous mobile robot must back up and then move towards the goal. For example, if an assistive robot is positioned at a user’s desk, it cannot move forward. To go anywhere it must back up first. Such tasks can be handled with the help of a high-level planner that breaks this sequence into two and provides a set of two boundary conditions in sequence to our framework – one for backing up and one for the goal. The intermediate waypoint can also be chosen by an optimization process. In our method, we impose obstacle avoidance constraints on a discrete set of points on the path. Thus, we cannot guarantee that segments of the path between these points will not intersect obstacles. In practice, if the points are chosen to be close enough, so that distance between these points is smaller than most obstacles, the path would be collision-free. Even so, sharp pointed corners of obstacles can intersect the path. This is a problem that will arise with any discretization. This can be handled in two ways. First, when we incorporate robot’s body for obstacle-avoidance an extra margin of safety can be added. Second, obstacles can be represented with a piecewise smooth boundary curve that encloses the obstacle shape such that sharp corners are smoothed out. 10 Concluding remarks and directions for future research We make two main contributions in this work. First, we characterize comfort for a user of an autonomous nonholonomic mobile robot. Among the various contributing factors to comfort, we focus on dynamic factors. For comfortable motion, a trajectory should have the following properties – it should satisfy boundary conditions on position, orientation, speed and tangential acceleration at the start and end points, have continuous acceleration, the geometric path should avoid obstacles, have curvature continuity, and should satisfy boundary conditions on curvature. In addition, the trajectory should respect bounds on curvature, speed, angular speed, and tangential and normal accelerations. While human user studies are required to validate this characterization of comfort, we believe that we have taken an important first step in formalizing motion comfort for autonomous mobile robots. Second, we develop a nonlinear constrained optimization based motion planning framework to plan trajectories such that the trajectories minimize discomfort and have all the properties described above. To the best of our knowledge, this is the first comprehensive formulation of kinodynamic motion planning for a planar nonholonomic mobile robot that includes all of the following – a careful analysis of boundary conditions and continuity requirements on trajectory, dynamic constraints, obstacle avoidance constraints, and a robust numerical method that computes solution trajectories in a few seconds. One of the strengths of our framework is that it is easy to incorporate additional kinematic and dynamic constraints, and additional terms can also be incorporated in the discomfort functional. Of course, care has to be taken to keep the problem mathematically meaningful. We believe that our work is an important step in developing autonomous robots that are acceptable to human users. For application to real-world robotic systems, some important extensions to our framework will be required. First, our current implementation achieves obstacle avoidance for a point robot. We have described a method for incorporating robot shape, and this will have to be implemented. Second, our results show that time taken to find a solution is of the order of seconds. This will have to be reduced for real-time planning. We discuss these, and several other extensions, below. 10.1 Directions for future research Incorporating robot shape for obstacle avoidance. We described a general method to incorporate 44 arbitrary shaped robot body in Section 6.7. This method consists of modeling the robot as a closed curve that encloses the projection of its boundary in the plane of motion, choosing a set of points on this curve, and imposing the constraints that all these points be outside all obstacles. If m points are chosen on the boundary and there are n obstacles, this method will result in m × n constraints. A more efficient approach may be possible when the robot can be modeled by a simple shape such as a circle or a convex polygon. Since most mobile robots, in practice, have simple shapes, it is worthwhile to explore these shapes as special cases for obstacle avoidance. Incorporating moving obstacles. One way to incorporate moving obstacles is to frequently update a map of the world and use this updated map to re-plan a new trajectory starting from the current state. For comfort of a human user, it may be useful to develop models that estimate a moving obstacle’s trajectory, and use this trajectory during planning. This could result in paths that have fewer changes in direction (compared to those found by fast-re planning) and are perceived to be more comfortable. Such obstacle models have been previously employed for motion planning (Fiorini and Shiller, 1998). Culling obstacles intelligently. In our method, we choose a set of points on the path, and impose the constraint that all obstacles be outside all points on the path. In our earlier approaches, we have experimented with culling these obstacles intelligently so that the number of obstacle constraints is reduced. If the trajectory is well-behaved, that is, if the geometric path does not have too many self intersections, and if one iterate does not vary too wildly from the previous, then we may be able to achieve a reduction in the number of constraints. First, we can remove, in advance, all obstacles that are too far from the initial guess of path. Second, for every point, we impose the constraint that it be outside obstacles within its “neighborhood” rather than being outside all obstacles. Under the above described conditions, if a point is outside obstacles in its neighborhood, it can be expected to be outside all other obstacles that are far from it. In our experiments with our current approach, we have observed that the above conditions hold if the initial guess of path is outside obstacles. Computing initial guesses that avoid obstacles We have observed that the solution to the discomfort minimization problem converges slowly if the initial guess of path passes through an obstacle. We believe that we can achieve fast convergence if the initial guess of path lies outside obstacles even if it does not respect continuity and kinodynamic constraints. Many of the existing path planning approaches can be used to compute an initial guess of path that has the above properties. Reducing computational time. For real-time implementation, it would be necessary to achieve a reduction in the computational time so that the problem is solved in a few milliseconds. Many steps can be taken to achieve this. First, we have observed that when an initial guess of path is inside an obstacle, it takes longer for the optimization algorithm to converge to a solution. Therefore, it would be worthwhile to invest some effort in generating an initial guess of path that is outside obstacles. This would reduce the number of iterations required to find a solution. Second, intelligently culling obstacles and efficiently implementing obstacle avoidance constraints for special robot shapes, as discussed earlier, could result in significant reduction in the number of constraints and faster computations in every iteration. Third, a multi-step optimization procedure can be tried. A coarser finite element mesh with fewer elements can be used to find a solution which would serve as an initial guess for a problem with a finer mesh. Finally, parallelism inherent in the problem can be exploited and parts of the program can be executed on a 45 GPU. For example, computation of constraint values, gradients and Hessians can be parallelized. Other such parallelisms should also be exploited. In addition, many other code optimizations can also be implemented. Evaluating the “goodness” of discomfort measure. We have formulated a measure of discomfort based on comfort studies in ground vehicles such as automobiles and trains. To the best of our knowledge, no such studies have been conducted for assistive robots. Since discomfort is subjective, the best way to assess comfort is to ask a user. Hence, to validate this discomfort measure, human user studies should be conducted with enough users to yield statistically significant data. We provide some guidelines on how such a study may be conducted in Section 10.2 below. Motion planning for non-planar surfaces. The motion planning framework presented in this work was developed for planning trajectories for a nonholonomic mobile robot moving on a plane. This assumption holds, for the most part, in indoor environments. For navigating in an urban outdoor environment, this framework can be extended by parameterizing the path as a space curve rather than a 2D curve and formulating the cost functional and constraints to take into account the 3D geometry of the surface on which the robot moves. 10.2 Implementation of the motion planning framework for human users A human user study can be conducted to either confirm that the measure of discomfort is good by showing that multiple human users can achieve comfort after choosing the weights, or failing that, to provide additional insight into what might be missing. Below are some guidelines on implementing the framework on an assistive robot and conducting such a study. • Our motion planning framework requires a representation of the local environment to plan trajectories. An occupancy-grid based representation can be used. In such a representation, obstacles are represented as occupied cells in the grid. See (Thrun et al., 2005) for a detailed discussion of such a representation. For efficient motion planning, these cells should be grouped together, where possible, into a single star-shaped polygon. When such a grouping yields an obstacle that is not star-shaped, it should be decomposed into a union of star-shaped polygons. An efficient algorithm for doing so can be found in (Avis and Toussaint, 1981). • A goal state consisting of position, orientation, curvature, speed, and magnitude of tangential acceleration, is required as input to the motion planning framework. Position and orientation may be provided by a human user through some input device (e.g by clicking on a map as in (Murarka and Kuipers, 2009)). Curvature should be set to zero. Speed may be specified as zero if it is desired to stop at the final position, otherwise is should be a speed that is typically found comfortable by the user. Tangential acceleration should be set to zero. For navigating in large-scale space, a high-level planner such as that used in (Murarka and Kuipers, 2009) could be used for generating intermediate way points. Such a planner usually provides only position and orientation. The rest of the quantities can be provided according to the guidelines above. • All necessary bounds should also be provided as input. The bounds in Table 1 may be used as a start if the study is conducted for an intelligent wheelchair, while the references cited in Section 2.1 can be used for the bounds if the study is conducted for an autonomous car. • A controller that can track the planned trajectory should be implemented. We have achieved good tracking accuracy, in our previous work (Murarka et al., 2009), with a feedback-linearization based controller described in (Luca et al., 1998). 46 • Before performing human user experiments, the framework should be comprehensively tested in the environment in which the users will evaluate it. If the environment is likely to have moving obstacles, fast re-planning should be implemented. This requires trajectories to be computed in at most a tenth of second. A relatively safe indoor environment with no drop-offs and other hazards should be chosen and common failure cases should be identified via experimentation. • In the first step of the study, a user should be asked to manually operate the assistive robot on a variety of tasks. A speed that the user typically operates at should be determined from these tasks. • Although a more detailed study than that described in Section 9.3 could yield an empirical relationship between weights and the individual terms in our discomfort measure, such a study is not an absolute prerequisite to performing human user studies. The two dimensionless factors corresponding to the weights for integral of squared tangential jerk and squared normal jerk are the parameters that should be varied in the experiments. • First, the weight factor for tangential jerk should be determined. To do this, the following experiment can be conducted. Set start and end boundary conditions such that motion is along a straight line. Set initial and final speed and acceleration to zero. Use the motion planning framework to plan trajectories for this task for a range of weight factors for tangential jerk. Ask the user to compare discomfort for every pair of weights. This comparison should include subjective questions on overall comfort as well as questions comparing the level of tangential jerk, and asking whether the time of travel was satisfactory. Vary the total length of the path and repeat the experiment for multiple lengths. Based on these experiments, fix a value of this weight factor. • Next, the weight factor for normal jerk should be determined. To do this, the following experiment can be conducted. Set start at end boundary conditions such that most of the motion is along a curved path. One way to achieve this is by choosing final position very close to the start position such that the robot has to travel along a curve to reach the goal. Follow a procedure similar to the one described above (for tangential jerk) to determine the weight factor for normal jerk. • Once the weight factors are determined, a set of motion tasks with a variety of boundary conditions should be performed and user should be asked to rate comfort. • If the motion for the above tasks is found to be comfortable, then it can be concluded that the measure of discomfort, in fact, captures user discomfort. If not, a set of questions designed to learn what might be missing should be asked. • In all cases, all quantitative information such as speed, acceleration, jerk, travel time, length of path etc., should be collected. 11 Acknowledgements This work has taken place in the Intelligent Robotics Lab at the Artificial Intelligence Laboratory, The University of Texas at Austin. Research of the Intelligent Robotics lab was supported in part by grants from the National Science Foundation (IIS-0413257, IIS-0713150, and IIS-0750011), the National Institutes of Health (EY016089), and from the Texas Advanced Research Program (3658-0170-2007). References Adams, R. A. and Fournier, J. F. (2003). Sobolev spaces. Elsevier. Arechavaleta, G., Laumond, J.-P., Hicheur, H., and Berthoz, A. (2008). An optimality principle governing human walking. IEEE Transactions on Robotics, 24:5–14. 47 Avis, D. and Toussaint, G. (1981). An efficient algorithm for decomposing a polygon into star-shaped polygons. Pattern Recognition, 13(6):395–398. Balkcom, D. J. and Mason, M. T. (2002). Time optimal trajectories for differential drive vehicles. International Journal of Robotics Research, 21(3):199–217. Barraquand, J. and Latombe, J.-C. (1989). On nonholonomic robots and optimal maneuvering. Revue dIntelligence Artificielle, 3(2):77–103. Barraquand, J. and Latombe, J.-C. (1990). Robot motion planning: A distributed representation approach. International Journal of Robotics Research, 10:72–89. Bianco, C. G. L. and Romano, M. (2004). Smooth motion generation for unicycle mobile robots via dynamic path inversion. IEEE Transactions on Robotics, 20(5):884 – 891. Bianco, C. G. L. and Romano, M. (2005). Bounded velocity planning for autonomous vehicles. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 685–690. Bobrow, J. E., Martin, B., Sohl, G., Wang, E. C., Park, F. C., and Kim, J. (2001). Optimal robot motions for physical criteria. Journal of Robotic Systems, 18(12):785–795. Bryson, A. E. and Ho, Y.-C. (1975). Applied Optimal Control : Optimization, Estimation, and Control. Hemisphere Publishing Corporation. Calinon, S. and Billard, A. (2009). Statistical learning by imitation of competing constraints in joint space and task space. Advanced Robotics, 23(15):2059–2076. Canny, J. (1988). Complexity of robot motion planning. MIT press. Canny, J. and Reif, J. (1987). New lower bound techniques for robot motion planning problems. In IEEE Symposium on Foundations of Computer Science, pages 49–60. CEN (1999). Railway applications - ride comfort for passengers - measurements and evaluation. ENV 12299. Chakroborty, P. and Das, A. (2004). Principles of Transportation Engineering. PHI Learning Pvt. Ltd. Choset, H., Lynch, K. M., Hutchinson, S., Kantor, G., Burgard, W., Kavraki, L. E., and Thrun, S. (2005). Principles of Robot Motion: Theory, Algorithms, and Implementations. MIT Press. Donald, B., Xavier, P., Canny, J., and Reif, J. (1993). Kinodynamic motion planning. Journal of the ACM, 40(5):1048–1066. Dubins, L. E. (1957). On curves of minimal length with a constraint on average curvature and with prescribed initial and terminal positions and tangents. American Journal of Mathematics, 79:497–516. Erdman, M. and Lozano-Pérez, T. (1987). On multiple moving objects. Algorithmica, 2(4):477–521. Fehr, L., Langbein, W. E., and Skaar, S. B. (2000). Adequacy of power wheelchair control interfaces for persons with severe disabilities: A clinical survey. Journal of Rehabilitation Research and Development, 37(3):353–360. Ferguson, D., Howard, T. M., and Likhachev, M. (2008). Motion planning in urban environments: Part I. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 1063–1069. Fernandes, C., Gurvits, L., and Li, Z. X. (1991). A variational approach to optimal nonholonomic motion planning. In IEEE International Conference on Robotics and Automation, pages 680–685. Fiorini, P. and Shiller, Z. (1998). Motion planning in dynamic environments using velocity obstacles. International Journal of Robotics Research, 17(2):760–772. Förstberg, J. (2000). Ride comfort and motion sickness in tilting trains: Human responses to motion environments in train experiment and simulator experiments. PhD thesis, KTH Royal Institute of Technology. Fraichard, T. (1996). Dynamic trajectory planning with dynamic constraints: A state-time space approach. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 1394–1400. Fraichard, T. and Scheuer, A. (2004). From Reeds and Shepp’s to continuous-curvature paths. IEEE Transactions on Robotics and Automation, 20(6):1025–1035. Full, R. and Koditschek, D. (1999). Templates and anchors: neuromechanical hypotheses of legged locomotion on land. Journal of Experimental Biology, 202(23):3325–3332. 48 Glover, J. (1900). Transition curves for railways. In Minutes of Proceedings of the Institution of Civil Engineers, pages 161–179. Gulati, S. (2011). A framework for characterization and planning of safe, comfortable, and customizable motion of assistive mobile robots. In Ph.D. Thesis. Gulati, S., Jhurani, C., and Kuipers, B. (2013). A nonlinear constrained optimization framework for comfortable and customizable motion planning of nonholonomic mobile robots – part ii. Submitted to The International Journal of Robotics Research. Gulati, S., Jhurani, C., Kuipers, B., and Longoria, R. (2009). A framework for planning comfortable and customizable motion of an assistive mobile robot. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 4253–4260. Gulati, S. and Kuipers, B. (2008). High performance control for graceful motion of an intelligent wheelchair. In IEEE International Conference on Robotics and Automation, pages 3932–3938. Hall, D. L., Loshbough, R., and Robaszkiewicz, G. D. (1970). Jerk, acceleration, and limited pattern generator for an elevator system. U.S. Patent number: 3523232. Havoutis (2012). Motion planning and reactive control on learnt skill manifolds. PhD thesis, The University of Edinburgh. Howard, T. M. and Kelly, A. (2007). Optimal rough terrain trajectory generation for wheeled mobile robots. The International Journal of Robotics Research, 26(2):141–166. Hsu, D., Kindel, R., Latombe, J.-C., and Rock, S. (2002). Randomized kinodynamic motion planning with moving obstacles. Int. J. Robotics Research, 21(3):233–255. Hughes, T. J. (2000). The Finite Element Method: Linear Static and Dynamic Finite Element Analysis. Dover Publications. Hwang, Y. K. and Ahuja, N. (1992). Gross motion planning – a survey. ACM Computing Surveys, 24(3):219 – 291. ISO (1997). Mechanical vibration and shock – evaluation of human exposure to whole body vibrations - part 1: General requirements. ISO 2631-1.2(E). Iwnicki, S. (2006). Handbook of Railway Vehicle Dynamics. CRC Press. Jacobson, I. D., Richards, L. G., and Kuhlthau, A. R. (1980). Models of human comfort in vehicle environments. Human factors in transport research, 20:24–32. Karaman, S. and Frazzoli, E. (2011). Sampling-based algorithms for optimal motion planning. The International Journal of Robotics Research, 30(7):846–894. Kavraki, L. E., Svestka, P., Latombe, J.-C., and Overmars, M. (1996). Probabilistic roadmaps for path planning in high dimensional configuration spaces. IEEE Transactions on Robotics and Automation, 12(4):566–580. Krapek, K. J. and Bittar, J. (1993). Elevator motion profile selection. U.S. Patent number: 5266757. Lamiraux, F. and Laumond, J.-P. (2001). Smooth motion planning for car-like vehicles. IEEE Transactions on Robotics and Automation, 17(4). Lamm, R., Psarianos, B., and Mailaender, T. (1999). Highway design and traffic safety engineering handbook. McGraw-Hill. Langhaar, H. L. (1951). Dimensional Analysis and Theory of Models. Wiley. Latombe, J.-C. (1991). Robot Motion Planning. Kluwer Academic Press. Laumond, J.-P., Sekhavat, S., and Lamiraux, F. (1998). Guidelines in nonholonomic motion planning for mobile robots. In Laumond, J.-P., editor, Robot Motion Planning and Control, pages 1–53. Springer-Verlag, Berlin. Laundhart (1887). Theory of the alignment. Schmorl & von Seefeld publishing house. LaValle, S. M. (1998). Rapidly-exploring random trees: A new tool for path planning. Technical Report 98-11, Computer Science Department, Iowa State University. 49 LaValle, S. M. (2006). Planning Algorithms. Cambridge University Press. LaValle, S. M. (2011a). Motion planning: The essentials. IEEE Robotics and Automation Society Magazine, 18(1):79–89. LaValle, S. M. (2011b). Motion planning: Wild frontiers. IEEE Robotics and Automation Society Magazine, 18(2):108–118. LaValle, S. M. and Kuffner, J. J. (2001a). Randomized kinodynamic planning. International Journal of Robotics Research, 20(5):378–400. LaValle, S. M. and Kuffner, J. J. (2001b). Rapidly-exploring random trees: Progress and prospects. In Donald, B. R., Lynch, K. M., and Rus, D., editors, Algorithmic and Computational Robotics: New Directions, pages 293–308. A. K. Peters, Wellesley, MA. Likhachev, M. and Ferguson, D. (2009). Planning long dynamically feasible maneuvers for autonomous vehicles. The International Journal of Robotics Research, 28(8):933–945. Lin, M. C. and Manocha, D. (2004). Collision and proximity queries. In Goodman, J. E. and O’Rourke, J., editors, Handbook of Discrete and Computational Geometry, 2nd Ed., pages 787–807. Chapman and Hall/CRC Press, New York. Luca, A. D., Oriolo, G., and Samson, C. (1998). Feedback control of a nonholonomic car-like robot. In Laumond, J.-P., editor, Robot Motion Planning and Control, pages 171–253. Springer-Verlag, Berlin. McNaughton, M., Urmson, C., Dolan, J., and Lee, J. W. (2011). Motion planning for autonomous driving with a conformal spatiotemporal lattice. In IEEE International Conference on Robotics and Automation, pages 4889–4895. Mirtich, B. (1998). Efficient algorithms for two-phase collision detection. In Gupta, K. and del Pobil, A., editors, Practical Motion Planning in Robotics: Current Approaches and Future Directions, pages 203–223. Wiley, New York. Murarka, A., Gulati, S., Beeson, P., and Kuipers, B. (2009). Towards a safe, low-cost, intelligent wheelchair. In Workshop on Planning, Perception and Navigation for Intelligent Vehicles (PPNIV), pages 42–50. Murarka, A. and Kuipers, B. (2009). A stereo vision based 3D mapping algorithm for detecting ramps, drop-offs, and obstacles for safe local navigation. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 1646–1653. Pepler, R. D., Sussman, E. D., and Richards, L. G. (1980). Passenger comfort in ground vehicles. Human factors in transport research, 20:76–84. Piazzi, A., Bianco, C. G. L., and Romano, M. (2007). η 3 splines for the smooth path generation of wheeled mobile robots. IEEE Transactions on Robotics, 23(5). Pivtoraiko, M., Knepper, R., and Kelly, A. (2009). Differentially constrained mobile robot motion planning in state lattices. Journal of Field Robotics, 26(3):308–333. Quinlan, S. (1994). Efficient distance computation between non-convex objects. In IEEE International Conference on Robotics and Automation, pages 3324 – 3329. Ramamoorthy, S. and Kuipers, B. (2008). Trajectory generation for dynamic bipedal walking through qualitative model based manifold learning. In IEEE International Conference on Robotics and Automation, pages 359–366. Reeds, J. A. and Shepp, L. A. (1990). Optimal paths for a car that goes both forward and backward. Pacific Journal of Mathematics, 145(2):367–393. Richards, L. G. (1980). On the psychology of passenger comfort. Human factors in transport research, 20:15–23. Schaal, S., Ijspeert, A., , and Billard, A. (2003). Computational approaches to motor learning by imitation. Philosophical Transactions: Biological Sciences, 1431(358):537–547. Scheuer, A. and Laugier, C. (1998). Planning sub-optimal and continuous-curvature paths for car-like robots. In IEEE International Conference on Intelligent Robots and Systems, pages 25–371. 50 Shiller, Z. (1994). Time-energy optimal control of articulated paths with geometric path constraints. In International Conference on Robotics and Automation. Shiller, Z. and Dubowsky, S. (1991). On computing the global time-optimal motions of robotic manipulators in the presence of obstacles. IEEE Transactions on Robotics and Automation, 7(6):785–797. Shiller, Z. and Gwo, Y.-R. (1991). Dynamic motion planning of autonomous vehicles. IEEE Transactions on Robotics and Automation, 7(2):241–249. Silberg, G., Wallace, R., Matuszak, G., Plessers, J., Brower, C., and Subramanian, D. (2012). Self-driving cars: The next revolution. Technical report, KPMG Center for Automotive Research. Simpson, R. C., LoPresti, E. F., and Cooper, R. A. (2008). How many people would benefit from a smart wheelchair? Journal of Rehabilitation Research and Development, 45(1):53–72. Souères, P. and Boissonnat, J. (1998). Optimal trajectories for nonholonomic mobile robots. In Laumond, J.-P., editor, Robot Motion Planning and Control, pages 93–170. Springer-Verlag, Berlin. Spielbauer, H.-K. J. and Peters, M. (1995). Elevator start jerk removal. U.S. Patent number: 5424498. Strizzi, J., Ross, I. M., and Fahroo, F. (2002). Towards real-time computation of optimal controls for nonlinear systems. In AIAA Guidance, Navigation, and Control Conference. Suzuki, H. (1998). Research trends on riding comfort evaluation in japan. Proceedings of the Institution of Mechanical Engineers – Part F – Journal of Rail and Rapid Transit, 212(1):61–72. Thrun, S., Burgard, W., and Fox, D. (2005). Probabilistic Robotics. MIT Press. Tominaga, H. and Bavarian, B. (1990). Global robot path planning using exact variational methods. In IEEE International Conference on Systems, Man and Cybernetics, pages 617–619. Troutman, J. L. (1995). Variational Calculus and Optimal Control: Optimization with Elementary Convexity. Springer, 2 edition. Žefran, M. (1996). Continuous Methods for Motion Planning. PhD thesis, University of Pennsylvania, Philadelphia, PA. Wächter, A. and Biegler, L. T. (2006). On the implementation of a primal-dual interior point filter line search algorithm for large-scale nonlinear programming. Mathematical Programming, 106(1):25–57. 51
5cs.CE
A General Safety Framework for Learning-Based Control in Uncertain Robotic Systems arXiv:1705.01292v3 [cs.RO] 14 Feb 2018 Jaime F. Fisac˚1 , Anayo K. Akametalu˚1 , Melanie N. Zeilinger2 , Shahab Kaynama3 , Jeremy Gillula4 , and Claire J. Tomlin1 Abstract— The proven efficacy of learning-based control schemes strongly motivates their application to robotic systems operating in the physical world. However, guaranteeing correct operation during the learning process is currently an unresolved issue, which is of vital importance in safety-critical systems. We propose a general safety framework based on Hamilton-Jacobi reachability methods that can work in conjunction with an arbitrary learning algorithm. The method exploits approximate knowledge of the system dynamics to guarantee constraint satisfaction while minimally interfering with the learning process. We further introduce a Bayesian mechanism that refines the safety analysis as the system acquires new evidence, reducing initial conservativeness when appropriate while strengthening guarantees through real-time validation. The result is a least-restrictive, safety-preserving control law that intervenes only when (a) the computed safety guarantees require it, or (b) confidence in the computed guarantees decays in light of new observations. We prove theoretical safety guarantees combining probabilistic and worst-case analysis and demonstrate the proposed framework experimentally on a quadrotor vehicle. Even though safety analysis is based on a simple point-mass model, the quadrotor successfully arrives at a suitable controller by policygradient reinforcement learning without ever crashing, and safely retracts away from a strong external disturbance introduced during flight. (a) With online guarantee validation (b) Without online guarantee validation Fig. 1: Hummingbird quadrotor learning a vertical flight policy under the requirement of not colliding. When the fan is turned on, the system experiences an unmodeled disturbance that it has not previously encountered. This can lead to a ground collision even under robust safety policies (right). The proposed Bayesian validation method detects the inconsistency and prevents the vehicle from entering the uncertain region (left). Video: www.eecs.berkeley.edu/~jfisac/safelearning I. I NTRODUCTION research community. The auspicious results of deep reinforcement learning schemes in virtual environments such as arcade videogames [32] and physics simulators [39], make ˚ The first two authors contributed equally. these techniques extremely attractive for robotics applications, This work was supported by the NSF CPS project ActionWebs under in which complex dynamics and hard-to-model environments grant 0931843, NSF CPS project FORCES under grant 1239166, and limit the effectiveness of purely model-based approaches. by ONR under the HUNT, SMARTS and Embedded Humans MURIs, and by AFOSR under the CHASE MURI. The research of J. F. Fisac However, the difficulty of interpreting the inner workings of received funding from the “la Caixa” Foundation. The research of A.K. many machine learning algorithms (notably in the case of deep Akametalu received funding from the NSF Bridge to Doctorate program. neural networks), makes it challenging to make meaningful The research of M.N. Zeilinger received funding from the EU FP7 (FP7/2007-2013) under grant PIOFGA-2011-301436-COGENT. statements about the behavior of a system during the learning 1 Department of Electrical Engineering and Computer Sciences, process, especially while the system has not yet converged University of California, Berkeley. Cory Hall, Berkeley, CA 94720, United to a suitable control policy. While this may not be a critical States. 2 Department of Mechanical and Process Engineering, ETH Zurich. issue in a simulated reality, it can quickly become a limiting Rämistrasse 101, 8092 Zürich, Switzerland. factor when attempting to put such an algorithm in control of 3 Clearpath Robotics. 1425 Strasburg Rd, Suite 2A, Kitchener, ON a system in the physical world, where certain failures, such N2R 1H2, Canada. 4 Electronic Frontier Foundation. 815 Eddy St, San Francisco, CA as collisions, can result in damage that would severely hinder 94109, United States. or even terminate the learning process, in addition to material Email: {jfisac, kakametalu, tomlin} @eecs.berkeley.edu, loss or human injury. We refer to systems in which certain [email protected], [email protected], failure states are unacceptable as safety-critical. [email protected] Learning-based methods in control and artificial intelligence are generating a considerable amount of excitement in the In the last decade, learning-based control schemes have been successfully demonstrated in robotics applications in which the safety-critical aspects were effectively removed or mitigated, typically by providing a manual fallback mechanism or retrofitting the environment to allow safe failure. In [1], [10] a trained pilot was able to remotely take over control of the autonomous helicopter at any time; the power slide car maneuvers in [27] were performed on an empty test track; and the aerobatic quadrotor in [29] was enclosed in a safety net. While mostly effective, these ad hoc methods tend to come with their own issues (pilot handoffs, for instance, are notoriously prone to result in accidents [22]) and do not generalize well beyond the context of the particular demonstration. It therefore seems imperative to develop principled and provably correct approaches to safety, attuned to the exploration-intense needs of learning-based algorithms, that can be built into the autonomous operation of learning robotic systems. Current efforts in policy transfer learning propose training an initial control policy in simulation and then carrying it over to the physical system [9]. While progress in this direction is likely to reduce overall training time, it does not eliminate the risk of catastrophic system misbehavior. State-of-the art neural network policies have been shown to be vulnerable to small changes between training and testing conditions [23], which inevitably arise between simulated and real systems. Guaranteeing correct behavior of simulation-trained schemes in the real world thus remains an important unsolved problem. Providing guarantees about a system’s evolution inevitably requires some form of knowledge about the causal mechanisms that govern it. Fortunately, in practice it is never the case that the designer of a robotic system has no knowledge whatsoever of its dynamics: making use of approximate knowledge is both possible and, we argue, advantageous for safety. Yet, perfect knowledge of the dynamics can hardly if ever be safely assumed either. This motivates searching for points of rapprochement between data-driven and model-based techniques. We identify three key properties that we believe any general safe learning framework should satisfy: ‚ High confidence. The framework should be able to keep the system safe with high probability given the available knowledge about the system and the environment. ‚ Modularity. The framework should work in conjunction with an arbitrary learning-based control algorithm, without requiring modifications to said algorithm. ‚ Minimal intervention. The framework should not interfere with the learning process unless deemed strictly necessary to ensure safety, and should return control to the learning algorithm as soon as possible. We can use these criteria to evaluate the strengths and shortcomings of existing approaches to safety in intelligent systems, and place our work in the context of prior research. Related Work Early proposals of safe learning date back to the turn of the century. Lyapunov-based reinforcement learning [35] allowed a learning agent to switch between a number of pre-computed “base-level” controllers with desirable safety and performance properties; this enabled solid theoretical guarantees at the expense of substantially constraining the agent’s behavior; in a similar spirit, later work has considered constraining policy search to the space of stabilizing controllers [38]. In risk-sensitive reinforcement learning [17], the expected return was heuristically weighted with the probability (risk) of reaching an “error state”; while this allowed for more general learning strategies, no guarantees could be derived from the heuristic effort. Nonetheless, the ideal problem formulation proposed in the paper, to maximize performance subject to some maximum allowable risk, inspired later work (see [16] for a survey) and is very much aligned with our own goals. More recently, [33] proposed an ergodicity-based safe exploration policy for Markov decision processes (MDPs) with uncertain transition measures, which imposed a constraint on the probability, under the current belief, of being able to return to the starting state. While practical online methods for updating the system’s belief on the transition dynamics are not discussed, and the toy grid-world demonstrations fall short of capturing the criticality of dynamics in many real-world safety problems, the probabilistic safety analysis is extremely powerful, and our work certainly takes inspiration from it. Recent safe exploration efforts in robotics concurrent with our work use Gaussian processes to model uncertain dynamics, but restrict safety analysis to local stability (i.e. region of attraction) and do not consider state constraints [5], [6]. The robust model-predictive control approach in [3] learns about system dynamics for performance only, while enforcing constraints based on a robust nominal model. The method was successfully demonstrated on problems with nontrivial dynamics, including quadrotor flight. However, using an a priori model for safety at best constrains the system’s ability to explore, and at worst may fail to keep the real system safe. To explicitly account for model uncertainty, the safety problem can be studied as a differential game [30], in which the controller must keep the system within the specified state constraints (i.e. away from failure states) in spite of the actions of an adversarial disturbance: the optimal solution to this reachability game, obtainable through Hamilton-Jacobi methods [31], [34], has been used to guarantee safety in a variety of engineering problems [13], [7], [21]. This robust, worstcase analysis determines a safe region in the state space and a control policy to remain inside it; a related approach involves ensuring invariance through “barrier functions” [36], [41]. A key advantage is that in the interior of this safe set one can execute any desired action, as long as the safe control is applied at the boundary: in this sense, the technique yields a least-restrictive control law, which naturally lends itself to minimally constrained learning-based control. Initial work exploring this was presented in [19], [20]. The above methods are subject, however, to the fundamental limitation of any model-based safety analysis, namely, the contingency of all guarantees upon the validity of the model. This faces designers with a difficult tradeoff. On the one hand, if, in order to guarantee safety under large or poorly understood uncertainty, they assume conservative bounds on model error, this will reduce the computed safe set, and thereby restrict the freedom of the learning algorithm. If, on the other hand, the assumed bounds fail to fully capture the true evolution of the state, the theoretical guarantees derived from the model may not in fact apply to the real system. Contribution In this work we propose a novel general safety framework that combines model-based control-theoretical analysis with data-driven Bayesian inference to construct and maintain highprobability guarantees around an arbitrary learning-based control algorithm. Drawing on Hamilton-Jacobi robust optimal control techniques, it defines a least-restrictive supervisory control law, which allows the system to freely execute its learning-based policy almost everywhere, but imposes a computed action at states where it is deemed critical for safety. The safety analysis is refined through Bayesian inference in light of newly gathered evidence, both avoiding excessive conservativeness and improving reliability by rapidly imposing the computed safe actions if confidence in model-based guarantees decreases due to unexpected observations. This paper consolidates the preliminary work presented in [19], [20], [2], extending the theoretical results to provide a unified treatment of model learning and guarantee validation, and presenting significant novel experimental results. To our knowledge this is the first work in the area of reachability analysis that reasons online about the validity of computed guarantees and uses a resilient mechanism to continue exploiting them under inaccurate prior assumptions on model error. Our framework relies on reachability analysis for the modelbased safety guarantees, and on Gaussian processes for the online Bayesian analysis. It is important to acknowledge that both of these techniques are computationally intensive and scale poorly with the dimensionality of the underlying continuous spaces, which can generally limit their applicability to complex dynamical systems. However, recent compositional approaches have dramatically increased the tractability of lightly coupled high-dimensional systems [25], [24], [7], [8], while new analytic solutions entirely overcome the “curse of dimensionality” in some relevant cases [12], [26]. The key contribution of this work is in the principled methodology for incorporating safety into learning-based systems: we thus focus our examples on problems of low dimensionality, implicitly bypassing the computational issues, and note that our method can readily be used in conjunction with these decomposition techniques to extend its application to more complex systems. We demonstrate our method on a quadrotor vehicle learning to track a vertical trajectory close to the ground (Fig. 1), using a policy gradient algorithm [28]. The reliability of our method is evidenced under uninformative policy initializations, inaccurate safe set estimation and strong unmodeled disturbances. The remainder of the paper is organized as follows: In Section II we introduce the modeling framework and formally state the safe learning problem. Section III presents the differential game analysis and derives some important properties. The proposed methodology is described in Section IV with the proofs of its fundamental guarantees, as well as a computationally tractable alternative with weaker, but practically useful, properties. Lastly, in Section V we present the experimental results. II. P ROBLEM F ORMULATION A. System Model and State-Dependent Uncertainty The analysis in this paper considers a fully observable system whose underlying dynamics are assumed deterministic, but only partially known. This modeling framework can in practice be applied to a wide range of systems for which an approximate dynamic model is available but the exact behavior is hard to model a priori (due to manufacturing tolerances, aerodynamic effects, uncertain environments, etc.). We can formalize this as a dynamical system with state x P Rn , and two inputs, u P U Ă Rnu , d P D Ă Rnd (with U and D compact) which we will refer to as the controller and the disturbance: x9 “ f px, u, dq. (1) In this context, however, d is thought of as a deterministic state-dependent disturbance capturing unmodeled dynamics, given by an unknown Lipschitz function d : Rn Ñ D. That is, we could` in principle ˘ write the unknown dynamics as F px, uq “ f x, u, dpxq . Unlike F , f is a known function, with all uncertainty captured by dp¨q. The flow field f : Rn ˆ U ˆ D Ñ Rn is assumed uniformly continuous and bounded, as well as Lipschitz in x and d for all u: this ensures that the unknown dynamics F are Lipschitz in x. Letting U and D denote the collections of measurable1 functions u : r0, 8q Ñ U and d : r0, 8q Ñ D respectively, and allowing the controller and disturbance to choose any such signals, the evolution of the system from any initial state x is determined (see for example [11], Ch. 2, Theorems 1.1, 2.1) by the unique continuous trajectory ξ : r0, 8q Ñ Rn solving 9 ξpsq “ f pξpsq, upsq, dpsqq, a.e. s ě 0, ξp0q “ x. (2) Note that this is a solution in Carathéodory’s extended sense, that is, it satisfies the differential equation almost everywhere (i.e. except on a subset of Lebesgue measure zero). Since dpxq is unknown, we attempt to bound it at each state by a compact set D̂pxq Ď D, which is allowed to vary in the state space. In Section III, we present a robust, least-restrictive safety control law that enforces constraint satisfaction subject to dpxq P D̂pxq. In Section IV, we present a Bayesian approach to find a bound D̂pxq based on a Gaussian process model of dpxq. Our overall approach therefore combines robust (worst-case) guarantees with Bayesian (probabilistic) analysis, by constructing the disturbance bound to reflect the local uncertainty around the inferred disturbance function.2 Any model-based safety guarantees for the system will require that the bound D̂pxq correctly captures the unknown 1 A function f : X Ñ Y between two measurable spaces pX, Σ q and X pY, ΣY q is said to be measurable if the preimage of a measurable set in Y is a measurable set in X, that is: @V P ΣY , f ´1 pV q P ΣX , with ΣX , ΣY σ-algebras on X,Y . 2 Alternative methods to providing the disturbance bounds (for example, a conservative a priori estimate, or a system identification procedure) are possible, provided some basic conditions to ensure that the dynamical system resulting from (2) with the restriction d P D̂pxq remains well defined. For the interested reader, sufficient conditions on D̂pxq are discussed in the Appendix. part of the dynamics given by dpxq, at least at some critical set of states x (discussed in Section III). One key insight in this work is that the system should take action to ensure safety not only when the model predicts that this action may be necessary, but also when the system detects that the model itself may become unreliable in the predictable future. We state here a preliminary result that will be useful later on in the paper, and introduce the notion of local model reliability. Proposition 1: If dpxq P int D̂pxq and the set-valued map D̂ : Rn Ñ 2D is Lipschitz-continuous under the Hausdorff metric3 , then there exists ∆t ą 0 such that all possible trajectories ` ˘ followed ` by˘ the system starting at x will satisfy d ξpτ q P D̂ ξpτ q for all τ P rt, t ` ∆ts. Proof: Let LD̂ be the Lipschitz (Hausdorff) constant of D̂, Ld the Lipschitz constant of d, and Cf a norm bound on the dynamics f . We then have that over an arbitrary time interval rt, t ` ∆ts, regardless of the control and disturbance signals up¨q, dp¨q, any system trajectory starting at ξptq “ x satisfies |ξpτ q ´ x| ď Cf ∆t, @τ P rt, t ` ∆ts. This` implies both |dpξpτ qq ´ dpxq| ď Ld Cf ∆t and ˘ dH` D̂pξpτ qq, D̂pxq ď LD̂˘Cf ∆t. Requiring that the open ball B dpxq, pLd ` LD̂ qCf ∆t be contained in D̂pxq ensures dpξpτ qq P D̂pξpτ qq. Since dpxq P int D̂pxq, there must exist a small enough ∆t ą 0 for which this condition is met. We can further quantify this ∆t through the signed distance4 to D̂pxq at the current dpxq. Corollary 1: If the Lipschitz constants are known, then dpxq P int D̂pxq implies dpξpτ qq P D̂pξpτ qq for all times τ P rt, t ` ∆ts, with ` ˘ ´sD̂pxq dpxq ∆t “ . pLd ` LD̂ qCf The disturbance bounds D̂ derived in this paper satisfy the hypothesis of Proposition 1 (see Appendix for details), and we thus refer to the condition dpxq P int D̂pxq as the model being locally reliable at x. Finally, we assume that the effect of the disturbance on the dynamics is independent of the action applied by the controller. ` ˘ ` ˘ ` ˘ x9 “ f x, u, dpxq “ g x, u ` h dpxq . (3) with g : Rn ˆ Rnu Ñ Rn , h : Rnp Ñ Rn , where g, and h inherit Lipschitz continuity in their first argument from f and h is injective onto its image. This decoupling assumption, made for ease of exposition, is not strictly necessary, and the theoretical results in this paper can be easily adapted to the coupled case. u,d Throughout our analysis, we will use the notation ξx, p¨q to D̂ denote the state trajectory t ÞÑ x corresponding to the initial condition x P Rn , the control signal u P U and the disturbance ` u,d ˘ signal d P D, subjecting the latter to satisfy dptq P D̂ ξx, ptq D̂ for all t ě 0. 3 The Hausdorff metric (or Hausdorff distance) between any two sets A and B in a metric space pM, dM q is defined as dH pA, Bq “ maxt supaPA inf bPB dM pa, bq, supbPB inf aPA dM pa, bq u. 4 For any nonempty set M Ă Rm , the signed distance function sM : Rm Ñ R is defined as inf yPM |z ´ y| for points z P Rm zM and ´ inf yPRm zM |z ´ y| for points z P M, where | ¨ | denotes a norm on Rm . B. State Constraints A central element in our problem is the constraint set, which defines a region K Ď Rn of the state space, typically the complement of all unacceptable failure states, where the system is required to remain throughout the learning process. This set is assumed closed and time-invariant; no further assumptions (boundedness, connectedness, convexity, etc.) are needed. From closedness, we can implicitly characterize K as the zero superlevel set of a Lipschitz surface function l : Rn Ñ R: x P K ðñ lpxq ě 0. (4) This function always exists, since we can simply choose lpxq “ ´sK pxq, which is Lipschitz continuous by definition. To express whether a given trajectory ever violates the constraints, let the functional V : Rn ˆ U ˆ D Ñ R assign to each initial state x and input signals up¨q, dp¨q the lowest value u,d p¨q over all times t ě 0: of lp¨q achieved by trajectory ξx, D̂ ` ˘ ` u,d ˘ V x, up¨q, dp¨q :“ inf l ξx, ptq . (5) D̂ tě0 This outcome V will be strictly smaller than zero if there exists any t P r0, 8q at which the trajectory leaves the constraint set, and will be nonnegative if the system remains ` in the constraint ˘ set for all of t ě 0. Denoting V u,d pxq “ V x, up¨q, dp¨q , the following statement follows from (4) and (5) by construction. Proposition 2: The set of points x from which the system u,d trajectory ξx, p¨q under given inputs up¨q P U, dp¨q P D will D̂ remain in the constraint set K at all times t ě 0 is equal to the zero superlevel set of V u,d p¨q: u,d tx P Rn : @t ě 0, ξx, ptq P Ku “ tx P Rn : V u,d p¨q ě 0u. D̂ Guaranteeing safe evolution from a given point x P Rn given an uncertainty bound D̂ requires determining whether there exists a control input up¨q P U such that, for all ` u,d ˘ disturbance inputs dp¨q P D satisfying dptq P D̂ ξx, ptq , D̂ the evolution of the system remains in K, or equivalently V u,d pxq ě 0. In Section III, we review how to answer this question using differential game theory and state some important properties of the associated solution. C. Objective: Safe Learning Learning-based control aims to achieve desirable system behavior by autonomously improving a policy κl : Rn Ñ U, typically seeking to optimize an objective function. Safe learning additionally requires that certain constraints K remain satisfied while searching for such a policy. ` With full ˘ knowledge of the system dynamics F px, uq “ f x, u, dpxq , we would like to find a safe control policy κ˚ : Rn Ñ U producing trajectories ξptq P K, @t ě 0, for the largest set of initial states x “ ξp0q, then restrict any learned policy so that κl pxq “ κ˚ pxq wherever required to ensure safety. When dpxq is not known exactly, however, this problem cannot be solved. Instead, given an estimated disturbance set D̂pxq, we can find an inner approximation of the set of safe states by considering all the possible trajectories that can be produced under the bounded uncertainty dpxq P D̂pxq. Our goal, then, is to find the set of robustly safe states x for which there exists a control policy κ˚ that can keep the closed-loop system evolution in K, and consistently limit κl to ensure that κ˚ is applied when necessary. To formally state this, we introduce an important notion from robust control theory. Definition 1: A subset M Ă Rn is a robust controlled invariant set under uncertain dynamics x9 “ f px, u, dq, d P D̂pxq, if there exists a feedback control policy κ : Rn Ñ U such that all possible system trajectories starting at ξp0q P M are guaranteed to satisfy ξptq P M for all time t ě 0. Given that trajectories are continuous, the system state can only leave M by crossing its boundary BM. Hence if M is closed, applying the feedback policy κpxq for x P BM is enough to render M robust controlled invariant, allowing an arbitrary control action to be applied in the interior of M. Definition 2: The safe set ΩD̂ is the maximal robust controlled invariant set under uncertain dynamics x9 “ f px, u, dq, d P D̂pxq, that is contained in the constraint set K. Success in safe learning therefore seems closely linked to model uncertainty: a tighter bound D̂pxq on dpxq yields a less conservative safe set ΩD̂ , which in turn reduces the restrictions on the learning process. However, an estimated bound that fails to fully capture dpxq may allow the system to execute control actions resulting in a constraint violation. The disturbance bound should thus be as tight as possible, to allow the system greater freedom in learning, yet wide enough to confidently capture the unknown dynamics, in order to ensure safety. In the following two sections, we formalize this tradeoff and propose a framework to reason about safety guarantees under uncertainty. Section III poses the safety problem as a differential game between the controller and an adversarial disturbance, presenting a stronger result than commonly used in the reachability safety literature, which exploits the entire value function of the game rather than only its zero level set. Section IV leverages this result to provide a principled approach to global safety under model uncertainty, as well as a fast local alternative that may often be useful in practice. III. S AFETY AS A D IFFERENTIAL G AME The safety problem can be posed as a two-player zerosum differential game between the system controller and the disturbance. Intuitively, we are requiring the controller to keep the system from violating the constraints for all possible disturbance inputs within a certain family: by conducting a worstcase analysis assuming an optimally adversarial disturbance, we implicitly protect the system against all “suboptimal” disturbances as well. We first introduce relevant background on differential games, and then present new enabling insights. prevent it from succeeding. Following [14], we define the set of nonanticipative strategies for the disturbance containing the functionals B “ tβ : ˘U Ñ` D | @t ě 0, @up¨q, ûp¨q P ˘U, ` upτ q “ ûpτ q a.e.τ ě 0 ñ βruspτ q “ βrûspτ q a.e.τ ě 0 u. Since the disturbance and the control inputs are decoupled in the system dynamics, Isaacs’ minimax condition holds5 and the value of the game is well defined as: ` ˘ V pxq :“ inf sup V x, up¨q, βrusp¨q . (6) βrusp¨qPB up¨qPU Under this information structure, we draw on the (infinitehorizon) discriminating kernel concept from viability theory. Definition 3: A point x P K is in K’s discriminating kernel u,d DiscD̂ pKq if the system trajectory ξx, starting at x, with D̂ both players acting optimally, remains in K for all time t ě 0: DiscD̂ pKq :“ tx P Rn : @βp¨q P B, Dup¨q P U , u,βrus @t ě 0, ξx,D̂ ptq P Ku . The following classical result follows from Proposition 2. Proposition 3: The discriminating kernel of the constraint set K is the zero superlevel set of the value function V : DiscD̂ pKq “ tx P Rn : V pxq ě 0u. Further, from Definitions 2 and 3, it can be seen that the discriminating kernel DiscD̂ pKq is identical to the safe set ΩD̂ . It has been shown that the value function for minimum payoff games of the form presented in Section III-A (i.e. games in which the payoff is the minimum of a state function over time) can be characterized as the unique viscosity solution to a variational inequality involving an appropriate Hamiltonian [4], [15]; an alternative formulation involves a modified partial differential equation [30]. In a finite-horizon setting, with the game taking place over the compact time interval r0, T s, the value function V px, tq can be computed by solving the Hamilton-Jacobi-Isaacs (HJI) variational inequality: # + BV BV min lpxq´V px, tq, px, tq`max min px, tqf px, u, dq uPU dPD̂pxq Bx Bt (7a) V px, T q “ lpxq. (7b) As long as there exists a nonempty safe set in the problem, V px, tq becomes independent of t inside of this set as T Ñ 8. We accordingly drop the dependence on t and recover V pxq as defined in (6), which we refer to as the safety function. Definition 4: The optimal safe policy κ˚ p¨q is the solution to the optimization:6 BV pxqf px, u, dq. Bx Policy κ˚ pxq attempts to drive the system to the safest possible state always assuming an adversarial disturbance. If the disturbance bound D̂pxq is correct everywhere, then one can allow the system to execute any desired control while in the interior of ΩD̂ , as long as the safety preserving action κ˚ pxq is taken κ˚ pxq “ arg max min uPU dPD̂pxq A. Background: HJI Equation and Safe Set To obtain a safe set and an associated safety policy, we formulate a game ` ˘ whose outcome is given by the functional V x, up¨q, dp¨q introduced in (5), negative for those trajectou,d ries ξx, p¨q that at some point violate the constraints K. D̂ In the robust safety problem, the controller seeks to maximize the outcome of the game, while the disturbance tries to minimize it: that is, the disturbance is trying to drive the system out of the constraint set, and the controller wants to 5 This means that we could have alternatively let the controller use nonanticipative strategies, without affecting the solution of the game. 6 While in general the solution need not be unique, we can always choose one element of the arg max set arbitrarily. Therefore we will assume for simplicity a policy κ˚ : Rn Ñ U uniquely mapping states to control inputs. whenever the state reaches the boundary BΩD̂ ; the system is then guaranteed to remain inside ΩD̂ for all time. This leastrestrictive control law can be used in conjunction with an arbitrary learning-based control policy κl pxq (which may be repeatedly updated by the corresponding learning algorithm), to produce a safe learning policy: # κpxq “ κl pxq, if V pxq ą 0, κ˚ pxq, otherwise. (8) Rather than imposing the optimal safe action κ˚ pxq, it would have, in principle, been sufficient to project the desired κl pxq onto the set of control inputs that guarantee nonnegative local evolution of V for all d P D̂pxq. However, κ˚ pxq results in the greatest predicted increase in value, which is desirable under model uncertainty, as we will see in Section IV-C. B. Invariance Properties of Level Sets Traditionally, the implicit hypothesis made to guarantee safety using a least-restrictive law in the form of (8) has been correctness of the estimated disturbance bound D̂ everywhere in the state space, (i.e. dpxq P D̂pxq @x P Rn ), or at least everywhere in the constraint set K [30], [20]. We will now argue that the necessary hypothesis for safety is in fact much less stringent, by proving an important result that we will use in the following section to strengthen the proposed safety framework and retain safety guarantees under partially incorrect models. Proposition 4: Any nonnegative superlevel set of V pxq is a robust controlled invariant set with respect to d P D̂pxq. Proof: By Lipschitz continuity of f and l, we have that V is Lipschitz continuous [14] and hence, by Rademacher’s theorem, almost everywhere differentiable. The convergence of V px, tq to V pxq as T Ñ 8 implies that at the limit BV Bt px, tq “ 0. Therefore, given any α ě 0, for any point x P tx | V pxq ě αu there must exist a control action u˚ ˚ such that @d P D̂pxq, BV Bx pxqf px, u , dq ě 0; otherwise the right hand side of (7a) would be strictly negative for T Ñ 8, contradicting convergence. Then, the value of V from any such state x can always be kept from decreasing, so tx|V pxq ě αu is a robust controlled invariant set with respect to d P D̂pxq. Proposition 5: Consider two disturbance sets D1 pxq and D2 pxq, and a closed set M Ă Rn that is robustly controlled invariant under D1 pxq. If D2 pxq Ď D1 pxq @x P BM, then M is robustly controlled invariant also under D2 pxq. Proof: Consider an arbitrary trajectory ξxu,d P XD2 0 ,D2 under the disturbance set D2 pxq, starting at x0 P M, such that for some τ ă 8, ξpτ q R M. Since trajectories in XD2 are continuous, there must then exist s P rt0 , τ s such that ξxu,d psq P BM. On the other hand, because M is robustly 0 ,D2 controlled invariant under D1 pxq, we know that Dκ : Rn Ñ U such that no possible disturbance d P D1 pxq can drive the system out of M. Since D2 pxq Ď D1 pxq @x P BM, the same control policy κ˚ pxq on the boundary guarantees that no disturbance d P D2 pxq Ď D1 pxq can drive the system out of M. Hence, for ξxu,d , switching to policy κ at time s 0 ,D2 guarantees that the system will remain in M. Therefore M is a robust controlled invariant set under D2 pxq. Corollary 2: Let Qα “ tx P Rn : V pxq “ αu with α ě 0 be any nonnegative level set of the safety function V , computed for some disturbance set D̂pxq. If dpxq P D̂pxq @x P Qα , then the superlevel set tx P Rn : V pxq ě αu is an invariant set under the computed safe control policy κ˚ pxq. This corollary, which follows from Propositions 4 and 5 by considering the singleton tdpxqu, is an important result that will be at the core of our data-driven safety enhancement. It provides a sufficient condition for safety, but unlike the standard HJI solution, it does not readily prescribe a leastrestrictive control law to exploit it: how should one determine what candidate α ě 0 to choose, or whether a valid Qα exists at all? Deciding when the safe controller should intervene and what guarantees are possible is nontrivial and requires additional analysis. The next section proposes a Bayesian approach enabling the safety controller to reason about its confidence in the modelbased guarantees described in this section. If this confidence reaches a prescribed minimum value in light of the observed data, the controller can intervene early to ensure that safety will be maintained with high probability. IV. B AYESIAN S AFETY A NALYSIS A. Learning-Based Safe Learning As we have seen, robust optimal control and dynamic game theory provide powerful analytical tools to study the safety of a dynamical model. However, it is important to realize that the applicability of any theoretically derived guarantee to the real system is contingent upon the validity of the underlying modeling assumptions; in the formulation considered here, this amounts to the state disturbance function dpxq being captured by the bound D̂pxq on at least a certain subset of the state space. The system designer therefore faces an inevitable tradeoff between risk and conservativeness, due to the impossibility of accounting for every aspect of the real system in a tractable model. In many cases, choosing a parametric model a priori forces one to become overly conservative in order to ensure that the system behavior will be adequately captured: this results in a large bound D̂pxq on the disturbance, which typically leads to a small safe set ΩD̂ , limiting the learning agent’s ability to explore and perform the assigned tasks. In other cases, insufficient caution in the definition of the model can lead to an estimated disturbance set D̂pxq that fails to contain the actual model error dpxq, and therefore the computed safe set ΩD̂ may not in fact be controlled invariant in practice, which can end all safety guarantees. In order to avoid excessive conservativeness and keep theoretical guarantees valid, it is imperative to have both a principled method to refine the system model based on acquired measurements and a reliable mechanism to detect and react to model discrepancies with the real system’s behavior; both of these elements are necessarily data-driven. We thus arrive at what is perhaps the most important insight in this work: the relation between safety and learning is reciprocal. Not only is safety a key requirement for learning in autonomous systems: learning about the real system’s behavior is itself indispensable to provide practical safety guarantees. In the remainder of this section we propose a method for reasoning about the uncertain system dynamics, using Gaussian processes to regularly update the model used for safety analysis, and introduce a Bayesian approach for online validation of model-based guarantees in between updates. We then define an adaptive safety control strategy based on this real-time validation, which leverages the theoretical results from Hamilton-Jacobi analysis to provide stronger guarantees for safe learning under possible model inaccuracies. B. Gaussian Process To estimate the disturbance function dpxq over the state space, we model it as being drawn from a Gaussian process. Gaussian processes are a powerful abstraction that extends multivariate Gaussian regression to the infinite-dimensional space of functions, allowing Bayesian inference based on (possibly noisy) observations of a function’s value at finitely many points.7 A Gaussian process is a random process or field defined by a mean function µ : Rn Ñ R and a positive semidefinite covariance kernel function k : Rn ˆ Rn Ñ R. We will treat each component dj , j P t1, ..., nd u, of the disturbance function as an independent Gaussian process: dj pxq „ GPpµj pxq, k j px, x1 qq. (9) A defining characteristic of a Gaussian process is that the marginal probability distribution of the function value at any finite number of points is a multivariate Gaussian. This will allow us to obtain the disturbance bound D̂pxq as a Cartesian product of confidence intervals for the components of dpxq at each state x, choosing the bound to capture a desired degree of confidence.8 Gaussian processes allow incorporating new observations in a nonparametric Bayesian setting. First, assume a prior Gaussian process distribution over the j-th component of dp¨q, with mean µj p¨q and covariance kernel k j p¨, ¨q. The class of the prior mean function and covariance kernel function is chosen to capture the characteristics of the model (linearity, periodicity, etc), and is associated to a set of hyperparameters θp . These are typically set to maximize the marginal likelihood of an available set of training data, or possibly to reflect some prior belief about the system. Next, consider N measurements d̂j “ rdˆj1 , . . . , dˆjN s, observed with independent Gaussian noise ji „ N p0, pσnj q2 q at the points X “ rx1 , . . . , xN s, i.e. dˆji “ dj pxi q ` ji . Combined with the prior distribution (9), this new evidence induces a Gaussian process posterior; in particular, the value of dj at 7 We give here an overview of Gaussian process regression and direct the interested reader to [37] for a more comprehensive introduction. 8 By assuming independence of disturbance components we are effectively over-approximating the confidence ellipsoid in Rnd by its minimal containing box; a less conservative analysis could compute D̂pxq using a vector-valued Gaussian process model, at the expense of heavier computation. finitely many points X˚ is distributed as a multivariate normal: Erdj pX˚ q | d̂j , Xs “ j j (10a) j µ pX˚ q ` K pX˚ , XqpK pX, Xq ` pσnj q2 Iq´1 pd̂j ´ µ pXqq, covrdj pX˚ q | Xs “ j j j (10b) j K pX˚ , X˚ q ´ K pX˚ , XqpK pX, Xq ` pσnj q2 Iq´1 K j pX, X˚ q, where dji pXq “ dj pxi q, µji pXq “ µj pxi q, and for any X, X 1 the matrix K j pX, X 1 q is defined component-wise as j Kik pX, X 1 q “ k j pxi , x1k q. Note that whenever a new batch of data X is obtained the hyperparameters of the kernel function are refitted, so the variance implicitly depends on the measurements dj . If a single query point is considered, i.e. X˚ “ tx˚ u, the marginalized Gaussian process posterior becomes a univariate normal distribution quantifying both the expected value of the disturbance d¯j px˚ q, and the ` j function, ˘2 uncertainty of this estimate, σ px˚ q , d¯j px˚ q “ Erdj px˚ q|d̂j , Xs ` j ˘2 σ px˚ q “ covrdj px˚ q|Xs . (11a) (11b) We can use the Bayesian machinery of Gaussian process regression to compute a likely bound D̂pxq on the disturbance function dpxq based on the history of commanded inputs ui and state measurements xi , i P t1, ..., N u. To this effect, we assume that a method for approximately measuring the state derivatives is available (e.g. by numerical differentiation), and denote each of these measurements by fˆi . Based on (3), we can obtain measurements of dpxi q from the residuals between the observed dynamics and the model’s prediction: ´ ` ˘¯ ˆ i q “ h´1 fˆi ´ g xi , ui . dpx (12) ˆ 1 q, . . . , dpx ˆ N qs are processed through The residuals d̂ “ rdpx (10) to infer the marginal distribution of dpx˚ q for an arbitrary point x˚ , specified by the expected value d¯j px˚ q and the standard deviation σ j px˚ q of each component of the disturbance. This distribution can be used to construct a disturbance set D̂px˚ q Ď D at any point x˚ ; in practice, this will be done at finitely many points xi on a grid, and used in the numerical reachability computation to obtain the safety function and the safe control policy. We now introduce the design parameter p as the desired marginal probability that the disturbance function dpxq will belong to the bound D̂pxq at each point x; typically, p should be chosen to be close to 1. The ? set D̂pxq is then chosen for each x as follows. Let z “ 2 erf´1 pp1{nd q, where erfp¨q denotes the Gauss error function; that is, define z so that the probability that a sample from a standard normal distribution N p0, 1q lies within r´z, zs is p1{nd . We construct D̂pxq by taking a Cartesian product of confidence intervals: D̂pxq “ nd ź rd¯j pxq ´ zσ j pxq, d¯j pxq ` zσ j pxqs. (13) j“1 j Since each ` j component ˘ d pxq is given by an independent Gausj ¯ sian N d pxq, σ pxq , the probability of `dpxq lying ˘nd within the above hyperrectangle is by construction p1{nd “ p. Remark 1: It is commonplace to use Gaussian distributions to capture beliefs on variables that are otherwise known to be bounded. While one might object that the unbounded support of (11) contradicts our problem formulation (in which the disturbance d took values from some compact set D Ă Rnd ), the hyperrectangle D̂pxq in (13) is always a compact set. Note that the theoretical input set D is never needed in practice, so it can always be assumed to contain D̂pxq for all x. Under Lipschitz continuous prior means µj and covariance kernels k j , the disturbance bound (13) varies (Hausdorff) Lipschitz-continuously in x, satisfying the hypotheses of Proposition 1. This is formalized and proved in the Appendix. The safety analysis described in Section III can be carried out by solving the Hamilton-Jacobi equation (7) for D̂pxq given by (13), which—based on the information available at the time of computation—will be a correct disturbance bound at any single state x with probability p. As the system goes on to gather new information, however, the posterior probability for dpxq P D̂pxq will change at each x (and will typically no longer equal p). More generally, we have the following result. Proposition 6: Let q be the probability that dpxq P D̂pxq for some state x with V pxq ě 0. Then the probability that L˚f V pxq :“ Dx V pxq ¨ f px, κ˚ pxq, dpxqq ě 0 is at least q. Proof: Omitting x for conciseness, we have: P pL˚f V ě 0q “ ` ˘ ` ˘ ` ˘ ` ˘ P L˚f V ě 0|d P D̂ P d P D̂ `P L˚f V ě 0|d R D̂ P d R D̂ . By Corollary 2, the first term evaluates to 1 ¨ q; the second term is nonnegative (and will typically be positive, since not all values of d R D̂ will be unfavorable for safety, and there may be some for which the input κ˚ pxq leads the system to locally increase V ). Based on this result, we can begin to reason about the guarantees of the reachability analysis applied to the real system in a Bayesian framework, inherited from the Gaussian process model. C. Online Safety Guarantee Validation In order to ensure safety under the possibility of model mismatch with the real system, it may become necessary to intervene not only on the boundary of the computed safe set, but also whenever the observed evolution of the system indicates that the model-based safety guarantees may lose validity. Indeed, failure to take a safe action in time may lead to complete loss of guarantees if the system enters a region of the state space where the model is consistently incorrect. While the estimated bound D̂ (Section IV-B) and the associated safety guarantees (Section III) should certainly be recomputed as frequently as possible in light of new evidence, this process can typically take seconds or minutes, and in some cases may even require offline computation. This motivates the need to augment model-based guarantees through an online data-driven mechanism to quickly adapt to new incoming informationeven as new, improved guarantees are computed. Bayesian analysis allows us to update our belief on the disturbance function as new observations are obtained. This in turn can be used to provide a probabilistic guarantee on the validity of the safety results obtained from the robust dynamical model generated from the older observations. In the remainder of this section, we will discuss how to update the belief on the disturbance function, and then provide two different theoretical criteria for safety intervention. The first criterion provides global probabilistic guarantees, but has computational challenges associated to its practical implementation. The alternative method only provides a local guarantee, but can more easily be applied in real time. Let us denote Xold and d̂jold as the evidence used in computing the disturbance set D̂pxq, and Xnew and d̂jnew as the evidence acquired online after the disturbance set is computed. Conditioned on the old evidence, the function dj pxq is normally distributed with mean and variance given by (10) with X “ Xold and d̂j “ d̂jold , and the disturbance set is given by (13). If we also condition on the new evidence and keep the hyperparameters fixed, then the mean and variance are updated by modifying (10) with X “ rXold , Xnew s and d̂j “ rd̂jold , d̂jnew s. Remark 2: Performing the update requires inverting K j prXold , Xnew s, rXold , Xnew sq. This can be done efficiently employing standard techniques: since K j pXold , Xold q has already been inverted (in order to compute the disturbance bound D̂), all that is needed is inverting the Schur Complement of K j pXold , Xold q in K j prXold , Xnew s, rXold , Xnew sq, which has the same size as K j pXnew , Xnew q. Ideally we would incorporate Xnew and d̂jnew to relearn the Gaussian process hyperparameters as quickly as new measurements come in: otherwise new measured disturbance values d̂jnew will only affect the posterior mean, with the variance depending exclusively on where the measurements were made (Xnew ). However, performing this update online is computationally prohibitive. Instead, we update the hyperparameters every time a new estimated bound D̂ is produced for safety analysis, keeping them fixed in between. In practice the set Xold will be much larger than Xnew , so the estimated hyperparameters would not be expected to change significantly. Remark 3: In settings where conditions are slowly timevarying, it may be desirable to give recently observed data more weight than older observations. This can naturally be encoded by the Gaussian process by appending time as an additional dimension in X: points that are distant in time would then be more weakly correlated, analogous to space. Based on the new Gaussian distribution, we can reason about the posterior confidence in the safety guarantees produced by our original safety analysis, which relied on the prior Gaussian distribution resulting from measurements d̂jold at states Xold . 1) Global Bayesian safety analysis: The strongest result available for guaranteeing safety under the present framework is Corollary 2, which allows the system to exploit any superzero level set Qα (α ě 0) of the safety function V throughout which the model is locally correct; all that is needed is for such a Qα to exist for α P r0, V pxqs given the current state x. It is possible to devise a safety policy to fully exploit the sufficient condition in Corollary 2 in a Bayesian setting: if the posterior probability that the corollary’s hypotheses will hold drops to some arbitrary global confidence threshold γ0 , the safe controller can override the learning agent. With probability γ0 , the corollary will still apply, in which case the system is guaranteed to remain safe for all time; even if Corollary 2 does not apply at this time (which could happen with probability 1 ´ γ0 ), it is still possible that the disturbance dpxq will not consistently take adversarial values that force the computed safety function V pxq to decrease, in which case the system may still evolve safely. Therefore, this policy guarantees a lower bound on the probability of maintaining safety for all time. In order to apply this safety criterion, the system needs to maintain a Bayesian posterior of the sufficient condition in Corollary 2. We refer to this posterior probability as the global safety confidence γpx; X, d̂j q, or γpxq for conciseness: ` ˘ γpx; X, d̂j q :“ P Dα P r0, V pxqs, @x P Qα : dpxq P D̂pxq|X, d̂j . (14) Based on this, we propose the least-restrictive control law: # ` ˘ ` ˘ κl pxq, if γpxq ą γ0 ^ V pxq ą 0 , κpxq “ (15) κ˚ pxq, otherwise, so the system applies any action it desires if the global safety confidence is above the threshold, but applies the safe controller once this is no longer the case. Note that if confidence in the safety guarantees is restored after applying the safety action the learning algorithm will be allowed to resume control of the system. This can happen by multiple mechanisms: moving to a region with higher V pxq will tend to increase the probability that some lower level set may satisfy the hypotheses of Corollary 2; moving to a region with less inconsistency between expected and observed dynamics will typically lead to higher posterior belief that nearby level sets will satisfy the hypotheses of Corollary 2; and generally acquiring new data may, in some cases, increase the posterior confidence that Corollary 2 may apply. Computing the joint probability that the bound D̂pxq captures the Gaussian process dpxq everywhere on a level set Qα is not possible, since the set of functions dpxq satisfying this condition is bounded on uncountably many dimensions, and thus not measurable in function space. Similarly, evaluating the joint probability for a continuum of level sets Qα for α P r0, V pxqs is not feasible. Instead, exploiting the Lipschitz assumption on dpxq, we can obtain the sought probability γpxq from a marginal distribution over a sufficiently dense set of sample points on each Qα and a sufficiently dense collection of level sets between 0 and V pxq. We can then use numerical methods [18] to compute the multivariate normal cumulative distribution function and estimate the marginal probability (using compact logic notation): ˆł ˙ S ľ I γpxq « P dpxs,i q P D̂pxs,i q , (16) s“1 i“1 over S level sets 0 “ α0 ă ... ă αS “ V pxq and I sample points from each level set Qαs . As the density of samples increases with larger S and I, the marginal probability (16) asymptotically approaches the Gaussian process probability (14). Unfortunately, however, current numerical methods can only efficiently approximate these probabilities for multivariate Gaussians of about 25 dimensions [18], which drastically limits the number of sample points (S ˆ I « 25) that the marginal probability can be evaluated over, making it difficult to obtain a useful estimate. In view of this, a viable approach may be to bound (14) below as follows: ` ˘ γpxq ě γpxq :“ max P @x P Qα : dpxq P D̂pxq , (17) αPr0,V pxqs and approximately compute this as ˆľ ˙ I γpxq « max P dpxs,i q P D̂pxs,i q , sPt1,...,Su (18) i“1 with the advantage that a separate multivariate Gaussian evaluation can be done now for each level set (I « 25). Computing this approximate probability as the system explores its state space provides a decision mechanism to guarantee safe operation of the system with a desired degree of confidence, which the system designer or operator can adjust through the γ0 parameter. 2) Local Bayesian safety analysis: Evaluating the expression in (18) is still computationally intensive, which can limit the practicality of this method for real-time validation of safety guarantees in some applications, such as mobile robots relying on on-board processing. An alternative is to replace the global safety analysis with a local criterion that offers much faster computation traded off with a weaker safety guarantee. Instead of relying on Corollary 2, this lighter method exploits Propositions 1 and 6. The system is allowed to explore the computed safe set freely as long as the probability of the estimated model D̂ being locally reliable remains above a certain threshold λ0 ; if this threshold is reached, the safe controller intervenes, and the system is guaranteed to locally maintain or increase the computed safety value V pxq with probability no less than λ0 . While this local guarantee does not ensure safety globally, it does constitute a useful heuristic effort to prevent the system from entering unexplored and potentially unsafe regions of the state space. Further, although the method is not explicitly tracking the hypotheses of Corollary 2, the local result becomes a global guarantee if these hypotheses do indeed hold. We define the local safety confidence λpx; X, d̂j q, more concisely λpxq, as the posterior probability that dpxq will be contained in D̂pxq at the current state x, given all observations made until now: ` j˘ λpx; X, d̂j q :“ P dpxq P D̂pxq | X, d̂ (19) We then have the following local safety certificate. Proposition 7: Let the disturbance dp¨q be distributed component-wise as nd independent Gaussian processes (9). The safety policy κ˚ p¨q is guaranteed to locally maintain or increase the system’s computed safety V p¨q with probability greater than or equal to the local safety confidence λpxq. Proof: The proof follows directly from Propositions 1 and 6, and the definition of λpxq, noting that the boundary of D̂pxq has zero Lebesgue measure and thus under any Gaussian distribution P pd P int D̂pxq|d P D̂pxqq “ 1. A local confidence threshold λ0 P p0, pq can be established such that whenever λpxq ă λ0 the model is considered insufficiently reliable (reachability guarantees may fail locally with probability greater than 1 ´ λ0 ), and the safety control is applied. The proposed safety control strategy is therefore as follows: # ` ˘ ` ˘ κl pxq, if V pxq ą 0 ^ λpxq ą λ0 , κpxq “ (20) κ˚ pxq, otherwise, Similarly to (15), under this control law, if confidence on the local reliability of the model is restored after applying the safe action and making new observations, the system will be allowed to resume its learning process, as long as it is in the interior of the computed safe set. After generating a new Gaussian process model and defining D̂pxq as described in Section IV-B, the prior probability with which the disturbance function dpxq belongs to the set D̂pxq is by design p everywhere in the state space. As the system evolves, more evidence is gathered in the form of measurements of the disturbance along the system trajectory, so that the belief that dpxq P D̂pxq is updated for each x. In particular, in the Gaussian process model, this additional evidence amounts to augmenting the covariance matrix K j in (10) with additional data points and reevaluating the mean and variance of the posterior distribution of dpxq. Based on the new Gaussian distribution, λpx; X, d̂j q can readily be evaluated for each x as ¸ ˜ ¸ff « ˜ nd ź dj´ pxq ´ mj pxq dj` pxq ´ mj pxq 1 ? ? λpxq “ ´ erf , erf 2 sj pxq 2 sj pxq 2 j“1 (21) j j ¯j with dj` pxq “ d¯j pxq ` zσ j pxq, da ´ pxq “ d pxq ´ zσ pxq, mj pxq “ Erdj pxq|X, d̂j s, sj pxq “ varpdj pxq|Xq; recall that z was defined to yield the desired probability mass p in D̂pxq at the time of safety computation, as per (13). Parameters p and λ0 (or, in its case, γ0 ) allow the system designer to choose the degree of conservativeness in the system: while p regulates the amount of uncertainty accounted for by the robust model-based safety computation, λ0 (γ0 ) determines the acceptable degradation in the resulting certificate’s posterior confidence before a safety intervention is initiated. A value of p close to 1 will lead to a large, highconfidence D̂pxq throughout the state space, but this analysis may result in a small or even empty safe set; on the other hand, if p is low, D̂pxq will be smaller and the computed safe set will be larger, but guarantees are more likely to be deemed unreliable (as per λ0 or γ0 ) in light of later observations. In the case of local safety analysis, immediately after computing a new model D̂, λpxq is by construction equal to p everywhere in the state space. As more measurements are obtained, the posterior distribution over the disturbance changes, as illustrated in Fig. 2, which can result in λpxq locally increasing or decreasing. If λ0 is chosen to be close to p, it is likely that the safety override will take place under minor deviations with respect to the model’s prediction; as λ0 becomes lower, however, the probability that the disturbance will violate the modeling assumptions before the safety controller intervenes increases. This reflects the fundamental tradeoff between risk and conservativeness in safety-critical Fig. 2: Evolution of the probability distribution of the disturbance dpxq at a particular state x. The prior distribution is used to compute the bound D̂pxq using confidence intervals, such that it contains a specified probability mass p. As more data are obtained, the distribution may shift, leading to a different posterior probability mass contained within D̂pxq. decision making under uncertainty. The proposed framework therefore allows the system designer to adjust the degree of conservativeness according to the needs and characteristics of the system at hand. V. E XPERIMENTAL R ESULTS We demonstrate our framework on a practical application with an autonomous quadrotor helicopter learning a flight controller in different scenarios. Our method is tested on the Stanford-Berkeley Testbed of Autonomous Rotorcraft for Multi-Agent Control (STARMAC), using Ascending Technologies Pelican and Hummingbird quadrotors (Fig. 1). The system receives full state feedback from a VICON motion capture system. For the purpose of this series of experiments, the vehicle’s dynamics are approximately decoupled through an on-board controller responsible for providing lateral stability around hover and vertical flight; our framework is then used to learn the feedback gains for a hybrid vertical flight controller. The learning and safety controllers were implemented and executed in MATLAB, on a Lenovo Thinkpad with an Intel i7 processor that communicated wirelessly with the vehicle’s 1.99 GHz Quadcore Intel Atom processor. This was all done using the Indigo version of the Robot Operating System (ROS) framework. Reachability computations are executed using the Level Set Toolbox [31], employing the Lax-Friedrich approximation for the numerical Hamiltonian; a weighted essentially nonoscillatory scheme for spatial derivatives; and a third-order total variation diminishing Runge-Kutta scheme for the time derivative [34], [40]. Once the safety function and safety policy have been computed, they are stored as look-up tables that can be quickly consulted in constant time. The purpose of the results presented here is not to advance the state of the art of quadrotor flight control or reinforcement learning techniques, but to illustrate how the proposed method can allow safe execution of an arbitrary learningbased controller without requiring any particular convergence rate guarantees. To fully demonstrate the reliability of our safe learning framework, in our first setup we let the vehicle begin its online learning in mid-air starting with a completely untrained controller. The general functioning of the framework can be observed in the second flight experiment, in which the vehicle starts with a conservative model and iteratively computes empirical estimates of the disturbance, gradually expanding its computed safe set while avoiding overreliance on poor predictions. Finally, we include an experiment in which an unexpected disturbance is introduced into the system. The vehicle reacts by immediately applying the safe action dictated by its local safety policy and retracting from the perturbed region, successfully maintaining safety throughout its trajectory. We show how the absence of online guarantee validation in the same scenario can result in loss of safety. We use an affine dynamical model of quadrotor vertical flight, with state equations: x9 1 “ x2 x9 2 “ kT u ` g ` k0 ` dpxq (22) where x1 is the vehicle’s altitude, x2 is its vertical velocity, and u P r0, 1s is the normalized motor thrust command. The gravitational acceleration is g “ ´9.8 m/s2 . The parameters of the affine model kT and k0 are determined for the Pelican and the Hummingbird vehicles through a simple on-the-ground experimental procedure—a scale is used to measure the normal force reduction for different values of u. The state constraint K “ tx : 0 m ď x1 ď 2.8 mu encodes the position of the floor and the ceiling, which must be avoided. Finally, d is an unknown, state-dependent scalar disturbance term representing unmodeled forces in the system. We learn dpxq using a Gaussian process model, and generate D̂pxq as the marginal 95% confidence interval at each x. We implement local Bayesian guarantee validation, (21) by a a conservatively approximating assuming sj pxq :“ varpdj pxq|Xq « varpdj pxq|Xold q, that is, neglecting the (favorable but often small) reduction in uncertainty due to Xnew . This was done for ease of prototyping. As the learning-based controller, we choose an easily implementable policy gradient reinforcement learning algorithm [28], which learns the weights for a linear mapping from state features to control commands. Following [20], we define different features for positive and negative velocities and position errors, since the (unmodeled) rotor dynamics may be different in ascending and descending flight. This can be seen as the policy gradient algorithm learning the feedback gains for a hybrid proportional-integral-derivative (PID) controller. aggressively alternate between hovering at two altitudes, one of them (1.5 m) near the center of the room, the other (0.1 m) close to the floor. This first experiment illustrates the interplay between the learning controller and the safety policy. The iterative safety re-computation and Bayesian guarantee validation components of the framework are not active here. Consistently, this demonstration uses (8) as the least-restrictive safe policy. The experiment, shown in Fig. 3, is initialized with the vehicle in mid-air. Since all feature weights are initially set to zero, the vehicle’s initial action is to enter free fall. However, as the quadrotor is accelerated by gravity towards the floor, the boundary of the computed safe set is reached, triggering the intervention of the safety controller, which automatically overrides the learning controller and commands the maximum available thrust to the motors (u “ 1), causing the vehicle to decelerate and hover at a small distance from the ground. For the next few seconds, there is some chattering near the boundary of the safe set, and the policy gradient algorithm has some occasions to attempt to control the vehicle when it is momentarily pushed into the interior of the safe set. Initially it has little success, which leads the safety controller to continually intervene to prevent the quadrotor from colliding with the floor; this has the undesirable effect of slowing down the learning process, since observations under this interference are uninformative about the behavior of the vehicle when actually executing the commands produced by the learning controller (which is an “on-policy” algorithm). However, at approximately t “ 40 s, the learning controller is able to make the vehicle ascend towards its tracking reference, retaining control of the vehicle for a longer span of time and accelerating the learning process. By t “ 60 s, the quadrotor is approximately tracking the reference, with the safety controller only intervening during the aggressive descent phase of the repeated trajectory, to ensure (under its conservative model) that there is no risk of a ground collision. The controller continues to learn in subsequent iterations, overall improving its tracking accuracy. The remarkable result in this experiment is not in the quality of the learned tracking controller after only a few seconds of active exploration (a merit that corresponds to the reinforcement learning method [28]), but the system’s ability to achieve competent performance at its task from an extremely poor initial policy while remaining safe at all times. B. When in Doubt A. From Fall to Flight To demonstrate the strength of Hamilton-Jacobi-based guarantees for safely performing learning-based control on a physical system, we first require a Pelican quadrotor to learn an effective vertical trajectory tracking controller with an arbitrarily poor initialization. To do this, the policy gradient algorithm is initialized with all feature weights set to 0. The pre-computed safety controller (numerically obtained using [31]) is based on a conservative uncertainty bound of ˘1.5 m/s2 everywhere in the state space; no new bounds are learned during this experiment. The reference trajectory requires the quadrotor to In the second experiment, we demonstrate the iterative updating of the safe set and safety policy using observations of the system dynamics gathered over time, as well as the online validation of the resulting guarantees. All components of the framework are active during the test, namely learning controller, safety policy, iterative safety re-computation, and Bayesian guarantee validation, with the main focus being on the latter two. Here, the Pelican quadrotor attempts to safely track the same reference trajectory, while using the gathered information about the system’s evolution to refine its notion of safety. In Reference Learning Override: max 1.5 1.6 1.6 11 1.4 1.4 0.5 00 0 0 20 20 40 40 60 80 60 80 Time (s) Time (s) 100 100 Reference 1.8 1.8 22 120 120 140 140 Fig. 3: Vehicle altitude and reference trajectory over time. Initial feedback gains are set to zero. When the learning controller (green) lets the vehicle drop, the safety control (red) takes over preventing a collision. Within a few seconds, the learned feedback gains allow rough trajectory tracking and are subsequently tuned as the vehicle attempts to minimize error. where L is a diagonal matrix, with ‰ Li as the ith diagonal “ element, and θp “ σf2 , σn2 , L1 , L2 are the hyperparameters, σf2 being the signal variance, σn2 the measurement noise variance, and the Li the squared exponential’s characteristic length for position and velocity respectively. The hyperparameters are chosen to maximize the marginal likelihood of the training data set, and are recomputed for each new batch of data when a new disturbance model D̂pxq is generated for safety analysis. Finally, the chosen prior mean and covariance kernel classes are both Lipschitz continuous, ensuring that all required technical conditions for the theoretical results hold (proofs are presented in the Appendix). The expressions (10), (11) give the marginal Gaussian process posterior on dpx˚ q for a query point x˚ . To numerically compute the safe set, the system first evaluates (13) to obtain the disturbance bound D̂pxi q at every point xi on a state-space grid, as the 95% confidence interval (p “ 0.95) of the Gaussian process posterior over dpxq; next, it performs the robust safety analysis by numerically solving the HJI equation (7) on this grid (using [31]) and obtaining the safety function V pxq. The trajectory followed by the quadrotor in this experiment is shown in Fig. 4. The vehicle starts off with an a priori conservative global bound on dpxq and computes an initial conservative safe set Ω1 (Fig. 5). It then attempts to track the reference trajectory avoiding the unsafe regions by transitioning to the safe control u˚ pxq on BΩ1 . The disturbance is measured and monitored online during this test, under the local safety confidence criterion, and found to be locally consistent Safety: max Safety: min 11 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2 00 this case, the policy gradient learning algorithm is initialized to a hand-tuned set of parameter values. The initial dynamic model available to the safety algorithm is identical to the one used in the previous experiment, with a uniform uncertainty bound of ˘1.5m/s2 . However, the system is now allowed to update this bound, throughout the state space, based on the disturbance posterior computed by a Gaussian process model. To learn the disturbance function, the system starts with a Gaussian process prior over dp¨q defined by a zero mean function and a squared exponential covariance function: ˙ ˆ px ´ x1 qT L´1 px ´ x1 q 1 2 , (23) kpx, x q “ σf exp 2 Learning 1.2 1.2 Altitude Altitude(m) (m) Altitude (m) Altitude (m) 2.5 00 55 10 10 15 15 20 20 2525 Time(s) (s) Time 30 30 3535 4040 Fig. 4: Vehicle altitude and reference trajectory over time. After flying with an initial conservative model, the vehicle computes a first Gaussian process model of the disturbance with only a few data points, resulting in an insufficiently accurate bound. The safety policy detects the low confidence and refuses to follow the reference to low altitudes. Once a more accurate disturbance bound is computed, tracking is resumed, with a less restrictive safe set than the original one. with the initial conservative bound. After collecting 10 s of data, a new disturbance bound D̂pxq is constructed using the corresponding Gaussian process posterior, from which a second safety function V2 pxq and safe set Ω2 are computed via Hamilton-Jacobi reachability analysis. This process takes roughly 2 seconds, and at approximately t “ 12 s the new safety guarantees and policy are substituted in. The Pelican continues its flight under the results of this new safety analysis: however, shortly after, the vehicle measures values of d that consistently approach the boundary of D̂pxq, and reacts by applying the safe control policy and locally climbing the computed safety function. This confidence-based intervention takes place several times during the test run, as the vehicle measures disturbances that lower its confidence in the local model bounds, effectively preventing the vehicle from approaching the ground. After a few seconds, a new Gaussian process posterior is computed based on the first 20 s of flight data, resulting in an estimated safe set Ω3 , an intermediate result between the initial conservative Ω1 and the overly permissive Ω2 (Fig. 5). The learning algorithm is then allowed to resume tracking under this new safety analysis, and no further safety overrides take place due to loss of safety confidence. This experiment demonstrates the algorithm’s ability to safely refine its notion of safety as more data become available, without requiring the process to consist in a series of strictly conservative under-approximations. C. Gone with the Wind In this last experimental result, we display the efficacy of online safety guarantee validation in handling alterations Executed 33 ⌦4 3 ⌦3 11 With online guarantee validation With model validation Fan Off 1.5 1.5 0.5 0.5 00 0 00 -3 -3 -0.5 -0.5 ⌦1 00 0.5 0.5 11 1.5 1.5 Altitude Altitude (m) (m) 22 2.5 2.5 33 1 Fig. 5: Safe sets computed online by the safety algorithm as it gathers data and successively updates its Gaussian process disturbance model. The vehicle’s trajectory eventually leaves the initial, conservative Ω1 , but remains in the converged safe set (Ω4 ) at all times, even before this set is computed. While the intermediate set Ω2 would have been overly permissive, this is remedied by the intervention of the safety controller as soon as the model is observed to behave poorly. in operating conditions unforeseen by the system designer. All components of the framework are active, except for the iterative safety re-computation, which is not used in this case. This experiment is performed using the lighter Hummingbird quadrotor, which is more agile than the Pelican but also more susceptible to wind. We initialize the disturbance set to a conservative range of ˘2 m/s2 , which amply captures the error in the double-integrator model for vertical flight. The vehicle tracks a slow sinusoidal trajectory using policy gradient [28] to improve upon the manually initialized controller parameters. At approximately t “ 45 s an unmodeled disturbance is introduced by activating a fan aimed laterally at the quadrotor. The fan is positioned on the ground and angled slightly upward, so that its effect increases as the quadrotor flies closer to the ground. The presence of the airflow causes the attitude and lateral position controllers to use additional control authority to stabilize the quadrotor, which couples into the vertical dynamics as an unmodeled force. The experiment is performed with and without the Bayesian guarantee validation component, with resulting trajectories shown in Fig. 6. Without validation, the quadrotor violates the constraints, repeatedly striking the ground. With validation, the fan’s airflow is quickly detected as a discrepancy with the model near the floor, and the safety controller override is triggered. The vehicle avoids entering the affected region for the remainder of the flight. Although only the local confidence method is used, providing a strictly local safety guarantee, the safe controller succeeds in maintaining safety throughout the experiment. This provides strong evidence suggesting that, beyond its theoretical guarantees, the local Bayesian analysis also constitutes an effective best-effort approach to 60 60 Time (s) Time (s) 90 120 90 120 90 90 120120 Without model validation Fan Off 1.5 1.5 Altitude (m) -2 -2 30 30 Without online guarantee validation ⌦2 2 -1 -1 Fan On 11 0 Altitude (m) Velocity (m/s) (m/s) 22 4 Altitude (m) Reference Altitude (m) 44 Fan On 11 0.5 0.5 00 0 0 30 30 60 60 Time (s) Time (s) Fig. 6: Vehicle altitude and reference trajectory over time, shown with and without online model validation. After the fan is turned on, the vehicle checking local model reliability detects the inconsistency and overrides the learning controller, avoiding the region with unmodeled dynamics; the vehicle without model validation enters this region and collides with the ground multiple times. The behavior is repeated when the reference trajectory enters the perturbed region a second time. safety in more general conditions, given limited computational resources and available knowledge about the system. VI. C ONCLUSION We have introduced a safe learning framework that combines robust reachability guarantees from control theory with Bayesian analysis based on empirical observations. This results in a minimally restrictive supervisory controller that can allow an arbitrary learning algorithm to safely explore its state and strategy spaces. As more data are gathered online, the framework allows the system to probabilistically reason about the validity of its robust model-based safety guarantees in light of the latest empirical evidence. We firmly believe that providing strong and practically useful safety guarantees for systems that navigate unstructured environments requires a rapprochement between model-based and data-driven techniques, often regarded as a dichotomy by both theoreticians and practitioners. With this work we intend to provide mathematical arguments and empirical evidence of the potential that the two approaches hold when used in conjunction. Scaling up safety certificates as intelligent systems achieve increasing complexity poses an important open research problem. Our prediction is that, as autonomous systems interact increasingly closely with human beings, the graceful interplay of safety and learning, combining theoretical guarantees with empirical grounding, will become central to their success. A PPENDIX Restricting one of the control inputs d to a state-dependent bound D̂pxq introduces questions as to whether a unique Carathéodory solution to (2) continues to exist. The basic existence and uniqueness theorems [11] assume fixed control sets. If the variation in the control sets can instead be expressed through the dynamic equation itself without breaking the continuity conditions, then it is easy to extend the classical result to at least a class of space-dependent control sets. We introduce two technical assumptions, which give sufficient conditions for the existence and uniqueness of a solution to the dynamical equations, and prove that any disturbance set D̂pxq obtained from a Gaussian process model with Lipschitz prior mean and covariance kernel satisfies these assumptions. Assumption 1: For all x P Rn , D̂pxq is a closed deformation retract of D, that is, there exists a continuous map Hx : D ˆ r0, 1s Ñ D̂pxq such that for every d P D and ˆ 1q “ d. ˆ dˆ P D̂pxq, Hx pd, 0q “ d, Hx pd, 1q P D̂pxq, Hx pd, n Assumption 2: Let r : R ˆ D Ñ D be such that rpx, dq “ Hx pd, 1q as defined above. Then r is Lipschitz continuous in x, and uniformly continuous in d. Intuitively, the first assumption means that D can be continuously deformed into D̂pxq for any x, while the second prevents the disturbance bound D̂pxq from changing abruptly as one moves in the state space. The retraction map r allows us to absorb the state-dependence of the disturbance bound into the system dynamics, enabling us to use the standard analysis for differential games, which considers measurable time signals drawn from fixed input sets. This is formalized in the following result. Proposition 8: `The saturated system dynamics ˘ f˜D̂ px, u, dq :“ f x, u, rpx, dq are bounded and uniformly continuous in all variables, and Lipschitz in x. Proof: Boundedness and uniform continuity of f˜D̂ in u are trivially inherited from f ; we therefore focus on d and x. First, since r is uniformly continuous in d, and f is Lipschitz (hence uniformly continuous) in its third argument, we have by composition that f˜D̂ is uniformly continuous in d. Lipschitz continuity in x is less immediate due to its appearance in both the first and third arguments of f . Again by` composition, ˘ Lipschitz continuity of r in x implies that f y, u, rp¨, dq is also Lipschitz for all y P Rn , u P U and d P D. Letting Lr be the Lipschitz constant of r and Lx be the Lipschitz constant of f in its first argument, we have, for any x, x̃ P Rn : |f px, u, rpx, dqq ´ f px̃, u, rpx̃, dqq| ď |f px, u, rpx, dqq ´ f px̃, u, rpx, dqq| ` |f px̃, u, rpx, dqq ´ f px̃, u, rpx̃, dqq| ď pLx ` Ld Lr q|x ´ x̃| Thus f˜D̂ p¨, u, dq “ f p¨, u, rp¨, dqq is indeed Lipschitz in x. Corollary 3: The dynamical system given by (2) with d constrained to lie in a state-dependent set D̂pxq satisfying Assumptions 1 and 2 has a unique continuous solution in the extended (Carathéodory) sense. The above result is important in that it guarantees existence and uniqueness of system trajectories for any state-dependent disturbance bound D̂p¨q that satisfies Assumptions 1 and 2. Moreover, the above construction allows us to transform the system dynamics f px, u, dq with d P D̂pxq into the standard form with fixed input sets (i.e. f˜D̂ px, u, dq with u P U, d P D), so that all results from the differential games literature can readily be applied to our formulation. Let us now see that the posterior mean and standard deviation of the components of dpxq are Lipschitz continuous functions of the state x under our Gaussian process framework. Proposition 9: Let the prior mean function µj be Lipschitz continuous, and the covariance kernel k j be jointly Lipschitz continuous, for the jth component of the disturbance function dpxq. Then the posterior mean d¯j pxq and standard deviation σ j pxq, as given by (10), (11) are Lipschitz continuous in x. Proof: The result follows from applying the hypotheses to (10), (11). Note that the standard deviation σ j pxq is the square root of the variance in (11); the square root function is Lipschitz everywhere except at 0, and Bayesian inference under nondegenerate prior and likelihood never results in 0 posterior variance. Thus σ j p¨q is also Lipschitz. The following proposition relates the state-dependent bound D̂pxq obtained from Gaussian process regression to Assumptions 1 and 2, ensuring that the dynamical system (2) is welldefined, and therefore the associated dynamic game be solved using the methods presented in Section III. Proposition 10: Let the prior mean function µj be Lipschitz continuous, and the covariance kernel k j be jointly Lipschitz continuous in its two variables, for all components j of the disturbance function dpxq. Then the disturbance bound D̂pxq, as defined in (13), satisfies Assumptions 1 and 2. Proof: Assumption 1 holds independently of the Lipschitz condition. The bound D̂pxq given by (13) is a compact convex set in D. As a result, the retraction map πx : D Ñ D̂pxq assigning every d P D its (unique) nearest point in D̂pxq is a Lipschitz continuous function (with Lipschitz constant ˆ “ dˆ for all dˆ P D̂pxq. Then, equal to 1); of course with πx pdq the function Hx pd, tq :“ p1 ´ tqd ` tπx pdq is continuous by composition and further satisfies Hx pd, 0q “ d, Hx pd, 1q P ˆ 1q “ dˆ for all d P D and dˆ P D̂pxq. D̂pxq, Hx pd, Assumption 2 can be shown to hold by noting that the extrema of each of the intervals in (13) are affine in d¯j pxq and σ j pxq, which are Lipschitz continuous in x by Proposition 9. This implies that the position of all vertices of the hyperrectangle in (13) varies as a Lipschitz continuous function of x, and so does, as a result, the nearest point in D̂pxq to any fixed d P D. The map rpx, dq “ πx pdq is hence Lipschitz continuous in x. Finally, since πx is Lipschitz continuous in d, r is also uniformly continuous in d. Finally, we can show that, under the same Lipschitz assumptions on the Gaussian process prior, the disturbance bound D̂pxq is Lipschitz continuous under the Hausdorff distance, which we required in Proposition 1. Proposition 11: Let the prior mean function µj be Lipschitz continuous, and the covariance kernel k j be jointly Lipschitz continuous in its two variables, for all components j of the disturbance function dpxq. Then the set-valued map D̂ is Lipschitz continuous under the Hausdorff distance. Proof: Since the disturbance set D̂pxq given by (13) is a hyperrectangle, the Hausdorff distance between the disturbance sets D̂px1 q and D̂px2 q is upper-bounded by the maximum distance between any pair of corners: ` ˘ δpx1 , x2 q :“ dH D̂px1 q, D̂px2 q ď max max |ci ´ ck | , i k with ci ,ck used to enumerate all corners of each of the two hyperrectangles. For simplicity of exposition, we use the equivalence of all norms in Rdn to upper-bound the above, arbitrary norm in Rnd , by the infinity norm, up to a constant factor m, which in combination with (13) gives: ` ˘ δpx1 , x2 q ď m¨max |d¯j px1 q´d¯j px2 q|`|zσ j px1 q´zσ j px2 q| . [11] [12] [13] j Now, by Proposition 9, d¯j pxq and σ j pxq are Lipschitz continuous in x; let their respective constants be Ljµ and Ljσ . We then have ` ˘ ` ˘ dH D̂px1 q, D̂px2 q ď m ¨ max Ljµ ` zLjσ |x1 ´ x2 | , j [14] [15] which proves Hausdorff Lipschitz continuity of the set-valued map D̂, with a Lipschitz constant LD̂ upper bounded by m ¨ maxj Ljµ ` zLjσ . R EFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] P. Abbeel, A. Coates, M. Quigley, and A. Y. Ng. “An application of reinforcement learning to aerobatic helicopter flight”. Advances in Neural Information Processing Systems (2007). A. K. Akametalu, J. F. Fisac, J. H. Gillula, S. Kaynama, M. N. Zeilinger, and C. J. Tomlin. “Reachability-based safe learning with Gaussian processes”. Conference on Decision and Control (2014). A. Aswani, H. Gonzalez, S. S. Sastry, and C. Tomlin. “Provably safe and robust learning-based model predictive control”. Automatica 49.5 (2013). E. Barron. “Differential Games with Maximum Cost”. Nonlinear analysis: Theory, methods & applications (1990). F. Berkenkamp, R. Moriconi, A. P. Schoellig, and A. Krause. “Safe learning of regions of attraction for uncertain, nonlinear systems with Gaussian processes”. Conference on Decision and Control (2016). F. Berkenkamp, M. Turchetta, A. P. Schoellig, and A. Krause. “Safe Model-based Reinforcement Learning with Stability Guarantees”. Advances in Neural Information Processing Systems (2017). M. Chen, J. F. Fisac, S. Sastry, and C. J. Tomlin. “Safe sequential path planning of multi-vehicle systems via double-obstacle Hamilton-Jacobi-Isaacs variational inequality”. European Control Conference (2015). M. Chen, S. Herbert, and C. J. Tomlin. “Fast Reachable Set Approximations via State Decoupling Disturbances”. Conference on Decision and Control (2016). P. Christiano, Z. Shah, I. Mordatch, J. Schneider, T. Blackwell, J. Tobin, P. Abbeel, and W. Zaremba. “Transfer from Simulation to Real World through Learning Deep Inverse Dynamics Model”. arXiv preprint (2016). A. Coates, P. Abbeel, and A. Y. Ng. “Learning for control from multiple demonstrations”. International Conference on Machine Learning (2008). [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] E. A. Coddington and N. Levinson. Theory of ordinary differential equations. Tata McGraw-Hill, 1955. J. Darbon and S. Osher. “Algorithms for overcoming the curse of dimensionality for certain Hamilton-Jacobi equations arising in control theory and elsewhere”. Research in the Mathematical Sciences 3.1 (2016). J. Ding, J. Gillula, H. Huang, M. P. Vitus, W. Zhang, and C. J. Tomlin. “Toward reachability-based controller design for hybrid systems in robotics”. International Symposium on Artificial Intelligence, Robotics and Automation in Space (2011). L. C. Evans and P. E. Souganidis. “Differential games and representation formulas for solutions of HamiltonJacobi-Isaacs equations”. Indiana University mathematics journal 33.5 (1984). J. F. Fisac, M. Chen, C. J. Tomlin, and S. S. Sastry. “Reach-avoid problems with time-varying dynamics, targets and constraints”. 18th International Conference on Hybrid Systems Computation and Control (HSCC). ACM Press, 2015. J. Garcı́a and F. Fernández. “A Comprehensive Survey on Safe Reinforcement Learning”. Journal of Machine Learning Research 16 (2015). P. Geibel and F. Wysotzki. “Risk-sensitive reinforcement learning applied to control under constraints”. Journal of Artificial Intelligence Research 24 (2005). A. Genz. “Numerical computation of multivariate normal probabilities”. Journal of computational and graphical statistics 1.2 (1992). J. H. Gillula and C. J. Tomlin. “Guaranteed Safe Online Learning via Reachability: tracking a ground target using a quadrotor”. International Conference on Robotics and Automation (2012). J. H. Gillula and C. J. Tomlin. “Reducing Conservativeness in Safety Guarantees by Learning Disturbances Online: Iterated Guaranteed Safe Online Learning.” Robotics: Science and Systems (2012). S. L. Herbert, M. Chen, S. Han, S. Bansal, J. F. Fisac, and C. J. Tomlin. “FaSTrack: a Modular Framework for Fast and Guaranteed Safe Motion Planning”. Conference on Decision and Control (submitted) (2017). A. Hobbs. “Unmanned aircraft systems”. Human factors in aviation. Ed. by E. Salas and D. Maurino. 2nd ed. Elsevier, 2010. S. Huang, N. Papernot, I. Goodfellow, Y. Duan, and P. Abbeel. “Adversarial Attacks on Neural Network Policies”. arXiv preprint (2017). S. Kaynama, I. M. Mitchell, M. Oishi, and G. A. Dumont. “Scalable safety-preserving robust control synthesis for continuous-time linear systems”. IEEE Transactions on Automatic Control 60.11 (2015). S. Kaynama and M. Oishi. “A modified Riccati transformation for decentralized computation of the viability kernel under LTI dynamics”. IEEE Transactions on Automatic Control 58.11 (2013). M. R. Kirchner, R. Mar, G. Hewer, J. Darbon, S. Osher, and Y. T. Chow. “Time-Optimal Collaborative Guidance [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] using the Generalized Hopf Formula”. IEEE Control Systems Letters 2.2 (2017). J. Z. Kolter, C. Plagemann, D. T. Jackson, A. Y. Ng, and S. Thrun. “A probabilistic approach to mixed open-loop and closed-loop control, with application to extreme autonomous driving”. International Conference on Robotics and Automation (2010). J. Z. Kolter and A. Y. Ng. “Policy search via the signed derivative.” Robotics: Science and Systemsystems (2009). S. Lupashin, A. Schöllig, M. Sherback, and R. D’Andrea. “A simple learning strategy for high-speed quadrocopter multi-flips”. International Conference on Robotics and Automation (2010). I. M. Mitchell, A. M. Bayen, and C. J. Tomlin. “A timedependent Hamilton-Jacobi formulation of reachable sets for continuous dynamic games”. IEEE Transactions on Automatic Control 50.7 (2005). I. Mitchell and J. Templeton. “A Toolbox of HamiltonJacobi Solvers for Analysis of Nondeterministic Continuous and Hybrid Systems”. Hybrid Systems: Computation and Control (2005). V. Mnih, K. Kavukcuoglu, D. Silver, A. a. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, and D. Hassabis. “Human-level control through deep reinforcement learning”. Nature 518.7540 (2015). T. M. Moldovan and P. Abbeel. “Safe exploration in Markov decision processes”. International Conference on Machine Learning (2012). S. Osher and R. Fedkiw. Level set methods and dynamic implicit surfaces. Vol. 153. Springer Science & Business Media, 2003. T. J. Perkins and A. G. Barto. “Lyapunov design for safe reinforcement learning”. The Journal of Machine Learning Research 3 (2003). S. Prajna and A. Jadbabaie. “Safety verification of hybrid systems using barrier certificates”. Hybrid Systems: Computation and Control (2004). C. E. Rasmussen and C. K. I. Williams. Gaussian processes for machine learning. MIT Press, 2006. J. W. Roberts, I. R. Manchester, and R. Tedrake. “Feedback controller parameterizations for Reinforcement Learning”. Symposium on Adaptive Dynamic Programming and Reinforcement Learning (2011). J. Schulman, S. Levine, M. Jordan, and P. Abbeel. “Trust Region Policy Optimization”. International Conference on Machine Learning (2015). C.-W. Shu and S. Osher. “Efficient implementation of essentially non-oscillatory shock-capturing schemes”. Journal of Computational Physics 77.2 (1988). C. Sloth, G. J. Pappas, and R. Wisniewski. “Compositional safety analysis using barrier certificates”. International Conference on Hybrid Systems: Computation and Control (2012). Jaime F. Fisac is a Ph.D. candidate in Electrical Engineering and Computer Sciences at the University of California, Berkeley. He received a B.S./M.S. degree in Electrical Engineering from the Universidad Politécnica de Madrid, Spain, in 2012, and a M.Sc. in Autonomous Vehicle Dynamics and Control from Cranfield University, UK, in 2013. He is a recipient of the “la Caixa” Foundation Fellowship (2013-2015). His research interests lie in control theory, artificial intelligence, and cognitive science, with a focus on safety for robotic and AI systems operating closely with people. Anayo K. Akametalu is a PhD. candidate in Electrical Engineering and Computer Sciences at the University of California, Berkeley. He obtained his B.S. degree in Electrical Engineering from the University of California, Santa Barbara in 2012. His research interests lie at the intersection of control theory and reinforcement learning. He has been funded through the National Science Foundation Bridge to Doctorate Fellowship, UC Berkeley Chancellor’s Fellowship, and GEM Fellowship. In 2016 he took a break from his graduate studies to work at Apple. Melanie N. Zeilinger is an Assistant Professor at the Department of Mechanical and Process Engineering, ETH Zurich, Switzerland. She received a Diploma in Engineering Cybernetics (2006) from the University of Stuttgart, Germany, and a Ph.D. in Electrical Engineering (2011) from ETH Zurich. She was a Marie Curie Fellow and Postdoctoral Researcher at the Max Planck Institute for Intelligent Systems, Germany (until 2015), UC Berkeley, CA (2012-14), and EPFL, Switzerland (2011-12). Her research interests include distributed control and optimization, as well as safe learningbased control, with applications to human-in-the-loop systems. Shahab Kaynama is a Senior Algorithms Architect at Apple. Between 2014-2017 he was with Clearpath Robotics as an Autonomy Team Lead for Navigation and Controls, where he helped launch its two OTTO flagship products. He was a Postdoctoral Research Scholar at UC Berkeley (since 2012) and at the University of British Columbia (since 2014). Dr. Kaynama received a Ph.D. (2012) in Electrical and Computer Engineering from the University of British Columbia, Canada and an M.Sc. (2006) in Advanced Control and Systems Engineering from the University of Manchester, UK. Jeremy Gillula received a B.S. in Computer Science from Caltech, CA, in 2006, and a M.S. and Ph.D. in Computer Science from Stanford University, CA, in 2011 and 2013. After spending eight months as a Postdoctoral Researcher at UC Berkeley, he became a Staff Technologist at the Electronic Frontier Foundation, a San Francisco-based nonprofit organization dedicated to defending civil liberties in the digital world. Claire J. Tomlin is the Charles A. Desoer Professor of Engineering in Electrical Engineering and Computer Sciences at the University of California, Berkeley. She was an Assistant, Associate, and Full Professor in Aeronautics and Astronautics at Stanford from 1998 to 2007, and in 2005 joined Berkeley. Claire works in the area of control theory and hybrid systems, with applications to air traffic management, UAV systems, energy, robotics, and systems biology. She is a MacArthur Foundation Fellow (2006) and an IEEE Fellow (2010), and in 2010 held the Tage Erlander Professorship of the Swedish Research Council at KTH in Stockholm.
3cs.SY
The Concurrent Language Aldwych Matthew Huntbach Department of Computer Science, Queen Mary and Westfield College Mile End Road, London, UK, E1 4NS [email protected] Abstract: Aldwych is proposed as the foundation of a general purpose language for parallel applications. It works on a rule-based principle, and has aspects variously of concurrent functional, logic and object-oriented languages, yet it forms an integrated whole. It is intended to be applicable both for small-scale parallel programming, and for large-scale open systems. arXiv:cs.PL/0009029 29 Sep 2000 1. Introduction Actors [9], [1] and concurrent logic languages [21] have been proposed as the two paradigms most suitable as a foundation on which to design languages suitable for open systems [15]. The advantage offered by actors of the clarity of direct representation of objects is offset by the greater flexibility of direct representation of channels and the possibility of multiple input ports in concurrent logic languages [14]. Also actors offer many-to-one communication directly but one-to-many communication is awkward and must be managed by the programmer, while with concurrent logic languages it is the other way round. In this paper we define a language which combines aspects of both Actors and the concurrent logic languages. Previous attempts to build actor languages on top of concurrent logic languages have, as noted by Kahn [14], tended to lose the advantages of the underlying logic language by modelling the actor principle too closely. We avoid this trap, combining the advantages stated above of both actors and concurrent logic languages. 2. A Language of Rewrite Rules We start by describing a simple rewrite language [18] for manipulation of futures. The term “future” is used in parallel functional [8] and object-oriented [17] languages to refer to a value in a language which may be passed as an argument or incorporated in a structure simultaneously with being written to by another process. A future has exactly one writer but any number of readers, it may be bound to a tuple containing further futures. A reader of a future becomes a reader of any arguments of such a tuple, a writer becomes a writer to arguments of the tuple to which it has bound a future. Thus it is more limited than the single-assignment logic variable as that may have several writers and “back communication” [3]. Processes which depend on the value of a future suspend until they learn of its value. We initiate a process of class p by p(u1,…,um)→(v1,…,vn), the process is a writer to each future vi and a reader to each ui. An ensemble of processes is created by a list of such initiations, where a future occurs exactly once in a vi position and one or more times in a ui position. A class is described by a header taking the form #p(x1,…,xm)→(y1,…,yn) and a set of rules. A rewrite rule has two parts, the left and right hand sides (lhs and rhs), the lhs representing the conditions needed for a rewrite to take place, the rhs giving the rewrite. The lhs consists of a list of equality statements, <Future>=<Tuple>, where <Future> is any input future named in the header which does not occur in another equality statement in the same lhs, and <Tuple> a tuple or constant, whose arguments may be further tuples or constants or new futures. The rhs consists of a list of process creations in which the input futures are new futures or any future from the header or any future from tuples on the lhs, plus mandatory equality statements <Future>=<Tuple> for every output future from the header not used in a process creation. Any future which occurs only on the rhs must occur in exactly one output position and one or more input positions, any future from a tuple on the lhs must occur at least once in a process creation or a rhs equality statement. The equalities on the rhs are the mechanism by which futures are written to, and have an alternative form <Future>←<Future> which binds an output future to an input future. The restrictions ensure that all futures have exactly one writer. As an example: #p(u,v)→(x,y) { u=f(w) || u=g(w) || u=h(w), v=a || v=e || } r(u,v,w)→(y,x); q(v,w)→x, y=g(v); x←w, y=b; x=k(u,z), s(u)→(z,y) is the syntax used to indicate that a p process waits on two futures it calls u and v, and is a writer for two futures it calls x and y. If u becomes bound to f(w), where w is another future, it creates an r process taking u, v and w as inputs (u is at this point necessarily bound to f(w), but may still be used as input), and writing to x and y. If u becomes bound to g(w) it creates a q process taking v and w as inputs and writing to x, while y is bound to the tuple g(v). If u becomes bound to h(w) and v becomes bound to the constant a, the constant b is written to y while x becomes bound to w (if w is not itself bound at this point, any reader of x will become a reader for w). If v becomes bound to e, x is bound to the tuple k(u,z) (where z is a new future) while the process s with argument u writes to z and y. Note that it is possible to determine whether something is a future or a constant by context, thus x=w in the place of x←w would cause x to be bound to the constant w. If more than one rule is applicable, for example if v is bound to e and u to f(w) in a p process, either may be used. A process may react using one rule without waiting to see if another becomes applicable later, for example if v is bound to e but u not yet bound. Rewriting is a commitment, there is no Prolog-like backtracking. If rewriting is dependent on more than one future value, as in the third rule above, no commitment to any rule is made before all necessary variables are bound. For example, if v becomes bound to a, p is not committed to wait for u to become bound to h(w), it will rewrite according to its first rule if u becomes bound to f(w). Any number of rewrites may take place simultaneously if the system is implemented on a parallel architecture. 3. Rewrite Rules to Processes So far our processes disappear as soon as they rewrite. Long-lasting processes are created with a variant form of rewrite rule, indicated by using a single bar to separate the lhs and rhs. In this case there is an implicit but unwritten recursive call. By default, the arguments to the unwritten recursive call are those of the original process. A statement <Future>=<Tuple> on the rhs, where <Future> is an input future in the header, sets the input argument of the recursive call in the position of <Future> in the header to <Tuple>. If an output future is not written to on the rhs, it takes its value from the equivalent output of the recursive call. If an output future is written to, either with an equality statement or by putting it as an output argument to a new process, any other use of that future is taken to refer to the output in the equivalent position in the recursive call. Thus, #p(u,v)→(x,y) { u=f(w) | u←w, q(u,w,x)→x; u=g(w) | v=a, r(v,x,w)→u; v=e || x←u, y=b } is a shorthand for: #p(u,v)→(x,y) { u=f(w) || q(u,w,x1)→x, p(w,v)→(x1,y); u=g(w) || v1=a, r(v,x,w)→u1, p(u1,v1)→(x,y); v=e || x←u, y=b } In effect, the arguments to a process may be considered its state, with any changes in the recursive call representing a change of state. We now have something similar to the Actors concept. An actor reacts on receiving a message by doing three actions: creating new actors, sending messages to other actors, and becoming a new actor. In our language, a process reacts on receiving a future binding by creating new processes, binding other futures, and becoming its recursive call. 4. Futures to Channels Futures seem to provide once-only communication, rather than the extended communication across channels of notations like CSP [10]. However a value which is constructed piece-by-piece can be regarded as a stream of information rather than seen in its entirety. A future may be treated as a stream or channel communicating a value if it is bound to a tuple with two arguments, one the value, the second a further future representing the remainder of the stream or the continuation of the channel. For example, the following represents a simple process which has a single input channel and a single output channel. It sends out a b when it receives an a and a c when it receives a d, and terminates when it reaches the end of the input stream, indicated by it being bound to the constant end, it then similarly ends its output stream. #p(in)→out { in=f(x,y), x=a | z=b, in←y, out=f(z,out); in=f(x,y), x=c | z=d, in←y, out=f(z,out); in=end || out=end } The syntax, however, is awkward, so we introduce further notation, where #p(in)→out { in.a | out.b; in.c | out.d; in$ || out$ } is the equivalent to the above, except a standard cons operator (expressible using infix :) is used in the place of f, and a standard nil constant (expressible as $) is used for end. In general, x.<Tuple> on the lhs of a rule, where x is any input future name, is a shorthand for x=<Tuple>:x' combined with a replacement of all occurrences of x on the rhs by the new name x'. We can send any tuple not just constants as in the example above. On the rhs of a rule, x.<Tuple> is equivalent to x=<Tuple>:x, where we already have any input use of x referring to the future in the x position in the recursive call. x$ is equivalent to x=$ on both lhs and rhs. Note that since in.a inputs the constant a, we need another notation to input a nondefined future, and similarly to output one. We use x?y on the lhs to mean x=y:x, where y is a new future, and x^y to output y on output channel x. So, for example, an indeterminate merger of two channels into one is given by: #merge(in1,in2)→out { in1?m | out^m; in2?m | out^m; in1$ || out←in2; in2$ || out←in1 } Input and output of multiple messages is allowed, so x?a.b on the lhs matches against the input of any value (which may then be referred to as a) followed by constant b on channel x, while y.b^c.d(a) on the rhs indicates sending the constant b, followed by the future c followed by the tuple d(a) (where a is a future) on channel y. There is a lookahead mechanism, enabling a value in a channel to be viewed but not consumed, so x?a/.b on the lhs matches only when the constant b is the second value on channel x, but as it is not consumed the b becomes the first item on channel x in the recursive call. 5. Representation in a Concurrent Logic Language The language proposed so far is actually a variant syntax of a restricted form of a concurrent logic language. Each rule is equivalent to a clause, replacing the pattern matching of standard logic programming with named argument matching. So the equivalent of our first program is: p(f(W),V,X,Y) :- r(U,V,W,Y,X). p(g(W),V,X,Y) :- q(V,W,X), y=g(V). p(h(W),a,X,Y) :- X=W, Y=b. p(U,e,X,Y) :- X=k(U,Z), s(U,Z,Y). Restricting variables to have a strict input/output mode with a single writer just formalises a practice which is generally kept to by programmers in the concurrent logic languages. Enforcing this restriction through syntax aids the production of bug-free programs. The lack of back-communication is however a serious problem since this technique is commonly used in concurrent logic programming. We shall show how this problem is overcome in the next section. Note we do not require the convention, inherited from Edinburgh Prolog, of distinguishing between variables and constants by initial capital and small letters, since we make the distinction by context. A major aim of our syntax is to remove the redundancy inherent in the attempt of the concurrent logic languages to hold on to the logic-like syntax of Prolog. We develop from the view of concurrent logic languages as variants of the object-oriented paradigm [22], [12] by introducing this syntax tailored to that view. The ability to translate to a concurrent logic language, which we shall keep for all additional features, gives both a semantics for our language and a means of easy implementation since efficient implementations of concurrent logic languages exist [19]. Our work has some aims similar to that of Foster and Taylor [4] who set out to promote a concurrent logic language, which they called “Strand” from “stream ANDparallelism”, without placing any emphasis on its logic background. Our language is called “Aldwych”, since it turns into the language Strand (or a similar one) and the street “Aldwych” turns into the street “Strand” on the London street-map. Strand was developed further into a notation called PCN [5], which like Aldwych makes use of the single-assignment logic variable but replaces pattern-matching in a logic-style clause by named argument matching. However, PCN kept Prolog’s lack of syntactic distinction between input and output variables, which we regard as a major limiting factor on its development. Like PCN, Aldwych could be used as a coordination language [6] so long as foreign language components are given a suitable interface. Simple conditional statements may be added to the lhs of Aldwych rules translating directly to the guards of flat concurrent logic languages. For example, an ordered merge of two ordered streams is given by: #ordmerge(in1,in2)→out { in1?m1, in2/?m2, m2>=m1 | out^m1; in1/?m1, in2?m2, m1>=m2 | out^m2; in1$ || out←in2; in2$ || out←in1 } As a further removal of redundancy, we shall allow functional-like embedded calls on the rhs of rules. For example, p(q(x))→y will be interpreted as q(x)→z,p(z)→y. This aids clarity by reducing the name space (no need for new variable z) and the need to match output in one place with input in another through an extra variable. Any embedded call will be assumed to have just one output argument. 6. Introducing Objects In a concurrent logic language, several objects may access one object if each has a channel to which it writes, and these channels are merged to form a single channel which the object being accessed reads. Each writing object may regard its channel as a handle on the reading object. Thus: p(pargs)→s1, q(qargs)→s2, r(rargs)→s3, s(s0,sargs), merge(s1,s2)→s4, merge(s4,s3)→s0 Here, the p, q and r objects have s1, s2 and s3 as their respective handles on the s object, with the s object receiving a single stream of messages from them in s0. To simplify this, we add handles to Aldwych as a different type of value from futures. We distinguish them by using names beginning with capital letters. References to a handle are converted into channels with mergers added as appropriate for implementation. The above could be given as: p(pargs)→S, q(qargs)→S, r(rargs)→S, s(S,sargs) but this is counter-intuitive. S should be viewed as an argument and hence an input of the p, q, and r objects. The handle of an object is better seen as an output from its initiator. So we write the system of a p, q and r object having common access to an s object as an acquaintance as: p(S,pargs), q(S,qargs), r(S,rargs), s(sargs)→S This is converted into the form with merged channels automatically for implementation. Syntactically, handle variables are treated like future variables, for instance as above they must be in exactly one output position, but may be in any number of input positions; they may be assigned to each other (though handles may not be assigned to futures and vice versa). So: #p(u,v,S,T)→H { u=f(w) | q(w,S)→u, r(v,w)→T; u=g(w) | r(v,w)→H, s(H,T)→(u,v); u=h(R) | S←R, q(x,S)→u, s(R,T)→(x,v) } becomes, on making the recursion explicit: #p(u,v,S,T)→H { u=f(w) || q(w,S)→u1, r(v,w)→T1, p(u1,v,S,T1)→H; u=g(w) || r(v,w)→H, s(H1,T)→(u1,v1), p(u1,v1,S,T)→H1; u=h(R) || q(x,S)→u1, s(R,T)→(x,v), p(u1,v,R,T)→H } and then with the conversion of handles to channels and the addition of the merges: #p(u,v,h)→(s,t) { u=f(w) || q(w)→(s1,u1), r(v,w,t1), p(u1,v,h)→(s2,t1), merge(s1,s2)→s, t$; u=g(w) || r(v,w,h), s()→(h1,t1,u1,v1), p(u1,v1,h1)→(s,t2), merge(t1,t2)→t; u=h(r) || q(x,s)→u1, s()→(r1,t1,x,v), p(u1,v,h)→(r2,t2), merge(r1,r2)→r, merge(t1,t2)→t, s$ } Note how an input object which is unused converts to an output channel which is closed by assigning the nil constant, $, to it. The third rule above causes us a problem. We wanted to deal with a case where an input tuple contained a handle, but the reversal of input/output polarity in the conversion of handles to channels would require back communication (the r in h(r) should be used for output) which we have ruled out. To prevent this we do not allow futures to be assigned tuples which contain handles or to be used as channels to send messages containing handles, so this is invalid Aldwych. However, note how the rule that handles, like futures, have only one writer means they convert to channels with only one reader. This means we can allow them to be used for back-communication. The objection to back-communication was that the one-to-many communication meant messages intended for back-communication could become duplicated and thus the back-communication slots could have multiple writers. As this is not the case with channels derived from objects, we allow handles to be used to send messages which do have reply slots and which have arguments, both input and/or reply, which are themselves handles. As an alternative to a collection of merge processes, object variables could be implemented using the port mechanism described by Janson et al [13], which would be more efficient. Since this is operationally equivalent to a collection of merge processes, it keeps the concurrent logic semantics. The syntax for reading and writing message to and from handles is the same as that for reading one from a channel, but messages are read from an output handle. Messages take the form <Name>(<Input arguments>)→<Output Arguments>, with argument names beginning with capital letters if they are intended to be handles, and the → omitted if there are no output arguments. All output arguments on the lhs of a rule must be given a value on the rhs by occurring exactly once in an output position. Messages may be sent on both input and output handles, the latter being equivalent to “sending a message to self” in standard object-oriented terminology, working by joining the message to the front of the incoming stream that forms the output handle. Thus: #p(a,b,Q)→H { H.f(x)→(y,z) | H.g(c,R)→S | H.h(c)→d | H.r(R) | H.s(c)→S | H$ || } q(a,b)→y, r(x,Q)→z; p(q(c,b),b,R)→S, b←c; Q.m(c,t(a,Q))→d; Q←R, s(b,Q,R); H.g(c,Q)→S; Q.bye(a) defines a p process which has two input futures and one input object and outputs one handle. It reacts to five different sorts of messages received on the handle it outputs: f: has one input future and two output futures; p computes these outputs using q and r processes. g: has one input future, one input object and one output object; p sets up the output object by setting up another p object (with its a argument produced by a q process) , and replaces its own b value by the value input in the message. h: has one input future and one output future; p sends an m message to its own input object to obtain the output value, with an extra value produced by a new t process. r: has just an input object; p changes its own input object to the new input object, and sets up a new s process (note though this process has no output it can affect the rest of the system by sending messages to its object inputs). s: has an input future and an output object; p gives a value to the output object by sending itself a g message. The final rule may be considered as providing a destructor function. It tells the p process what to do when there are no references anywhere to its output handle, in this case send a final bye message containing its input values to its input object. Making the recursion explicit, converting the objects to tuples (including syntactically incorrect back-communication arguments to channel messages, indicated by italics), and expanding the embedded calls gives the following as the equivalent to the above: #p(a,b,h)→q { h=f(x,y,z):h1 || h=g(c,s,r):h1 || h=h(c,d):h1 || h=r(r):h1 || h=s(c,s):h1 || h=$ || q(a,b)→y, r(x)→(q1,z), p(a,b,h1)→q2, merge(q1,q2)→q; p(d,b,s)→r, p(a,c,h1)→q, q(c,b)→d; q=m(c,e,d):q3, p(a,b,h1)→q1, t(a)→(q2,e), merge(q1,q2)→q3; s(b)→(q,r1), p(a,b,h1)→r2, merge(r1,r2)→r; h2=g(c,s,q1):h1, p(a,b,h2)→q2, merge(q1,q2)→q; q=bye(a):$ } Messages may be received on handles using ?, and sent using ^, with the rule that any message received using ? must be referred to again exactly once in a message send using ^, and no where else. This is because such a message is not a normal tuple as it may contain object arguments and back-communication arguments. Lookahead is permitted on object messages as well as channel messages, though an object message which is being looked at but not consumed has its output arguments treated as additional inputs, since they are only written to when consumed. We allow arguments to tuples and messages and ← assignments on the rhs of rules to be expressions built up using the arithmetic and a few other infix. Values in expressions of the form <Name>(<Args>) are replaced by a new variable name, say X, with the call <Name>(<Args>)→X added to the statement, while <Handle>.<Name>(<Args>) is replaced by X with the object message send <Handle>.<Name>(<Args>)→X added. The ^ notation used to send messages on channels is extended so that if its right-hand argument is an expression the value of that expression is sent on the channel. It may not however be used if the left-hand argument is an object name and the right-hand argument anything but a variable name representing a previously read object message. The form: S.p(a)-|> <Value>, … where -, | and > are separate symbols of the language, is equivalent to S.p(a)→x | x←<Value>, … The p(a)- message pattern may occur anywhere on a lhs, so long as it is the only anonymous return on that lhs. The statement > <Value> writes the value to the anonymous return. Message patterns may be given without being attached to a particular output handle, in which case it is taken to be a shorthand for rules attaching them to every handle, so #p(sum,count)→(Priv,Ord) { inc(x) | sum←sum+x; Priv.dec(x) | sum←sum-x; balance -|> sum, count←count+1 } is a shorter form of: #p(sum,count)→(Priv,Ord) { Priv.inc(x) | sum←sum+x; Ord.inc(x) | sum←sum+x; Priv.dec(x) | sum←sum-x; Priv.balance→r | r←sum, count←count+1; Ord.balance→r | r←sum, count←count+1; Priv$, Ord$ || } Note the ability to have more than one output handle allows different classes of access to an object. In this example, the Priv handle enables dec messages to be sent to a p object, whereas the Ord handle does not. 7. Cells, Pointers and Functional Programming Objects may be linked together with handles in a way similar to the linking of cells with pointers in standard imperative programming data structures. So: #empty()→Self { isempty-|>=true; cons(X)-|>list(X,Self) } #list(Hd,Tl)→Self { head-|>Hd; tail-|>Tl; isempty-|>=false; cons(X)-|>list(X,Self) } provides lists of objects using the linked list rule. If L represents a list, then the head of the tail of the tail of the list (assuming its length is known to be more than two) is obtained by ((L.tail).tail).head, while a list of three objects, A, B and C is obtained by ((empty().cons(A)).cons(B)).cons(C). Note that we allow f(<Args>).<Message> to be the equivalent of f(<Args>)→X,X.<Message>, and (<Expression>).<Message> equivalent to X.<Message> where <Expression> evaluates to X. The syntax L~tail~tail~head and empty()~cons(A)~cons(B)~cons(C) is provided as an alternative to the above, where in general, L~f(<Args>) is a value which, as with L.f(<Args>) before, evaluates to X, where L.f(<Args>)→X is added to the rhs of a rule. However, in this context any further message sent is taken to be sent not to L, but to the reply from f(<Args>), so while the value L.f(<Args>).g(<Args>) is equivalent to X where L is sent first f(<Args>) then g(<Args>)→X, L~f(<Args>)~g(<Args>) is equivalent to Y where L is sent f(<Args>)→X, then X is sent g(<Args>)→Y. Juxtaposition of two values is also used as a syntax for message sending, with the distinction between juxtaposition and ~ roughly equivalent to that between using ^ and using . for sending messages, that is it sends a message which is the result of an evaluation. The message sent is an empty name message with one reply, in other words it matches the lhs pattern (<Args>)→R. So, for example, d ← (f(a) P.m(b) g(c)) is equivalent to f(a)→X, P.m(b)→Y, X.(Y)→Z, g(c)→W, Z.(W)→d. Juxtaposition is left-associative, which means there is a distinction between the expression F(<Expression>) and the expression F (<Expression>) (with a space between the F and the bracket). The former treats F as a process name, taking one input argument the value of <Expression> and having one output argument which is returned as the value of the expression. The latter treats it as a variable representing an object to which the value of <Expression> is sent as the input argument to a nilname message, the output argument being the value of the expression. The effect is to enable functional programming in the higher order style [2] to be embedded within Aldwych. A function is an entity which when presented with a value returns a result, and in the higher order style such an entity is itself a first class citizen of the language. An object which is restricted to taking nil-messages and which does not change its internal state at any stage may be regarded as a function. An important aspect of functional programming is the idea of currying where a function may be supplied with a partial number of its arguments and return a function specialised to those arguments. Given a function f which takes n arguments, f a 1 a 2 … a n-1 returns a function f' which when supplied with the final argument an gives the same result as f when given all n arguments a1 … an. A similar argument applies to f', and so on, hence functions need only take one argument supplied by juxtaposition. In Aldwych, a header of the form: #p(a1,…,ak)[ak+1 … ak+n]→(v1,…,vm) followed by a set of rules suitable for a header #p(a1,…,ak+n)→(v1,…,vm) translates to a set of process declarations, starting with: #p(a1,…,ak)→Self { Self.(Val)→Return | p1(a1,…,ak,Val)→Return; Self$ || } which could be written in the briefer style introduced above: #p(a1,…,ak)→Self { (Val)-|> p1(a1,…,ak,Val) } followed by (in the briefer style again): #p1(a1,…,ak,ak+1)→Self { (Val)-|> p2(a1,…,ak,ak+1,Val) } and so on, ending with with one with header #pn(a1,…,ak+n)→(v1,…,vm) and the original body. So if P is the output of p i(a 1,…,a k+i), then P X will be Y where the message (X)→Y is sent to P, which is the output of p i+1(a 1,…,a k+i,X), which is P specialised with the next argument set to X, and may be used as a first class object. P may be thought of as a higher-order function, but it can also be seen as an objectcreating object, equivalent to a class in pure object-oriented languages like Smalltalk [7], where classes are themselves objects. 8. Initialisation, Default Values and Delegation Many concurrent logic languages have an “otherwise” construct which separates clauses. Computation may only commit to a clause following the “otherwise” if variables have been sufficiently bound to rule out the possibility of committing to any clauses before it. We use the colon character as Aldwych’s “otherwise”, thus a procedure to return the maximum of two inputs is: #max(a,b)< { a>b ||> a; : ||> b } Here the otherwise gives us a form of if-then-else. This also shows an extension to the anonymous return (< is used for anonymous return of a value in a header), allowing the return value for a whole process to be anonymous, giving a more functional appearance to the code. The symbol < may be used as a value elsewhere if it is necessary to use the anonymous output of a recursive call as input. Delegation [17] has been recommended as an alternative to inheritance in a concurrent object-oriented system. The idea is that one of the arguments to an object is another object termed a “proxy”, any messages an object cannot handle are passed to its proxy. Below is an example of its use to define the class of royal elephants, which are like ordinary elephants in every way except their colour is white: #RoyalElephant(Proxy)~ { colour-|>=white; : ?m | Proxy^m } The ~ indicates an anonymous handle return, the above could be written more fully #RoyalElephant(Proxy)→Self { Self.colour→return | return=white; : Self?m | Proxy^m } A ~ as a value in an expression is used to mean Self as above, similar to < as above, while ~<Mess> is equivalent to Self.<Mess>. The delegation effect depends on royal elephant objects being declared with an appropriate proxy. We introduce a syntax allowing processes to have local variables which are initialised when the processes are created. In this case, a royal elephant class is declared by: #RoyalElephant(Args)~ = Elephant(Args)→Proxy, <(Proxy) { colour-|>=white; : ?m | Proxy^m } In general, an = following a header indicates there is some initialisation code, this code must write values to all local input arguments, and use all local output arguments. An argument may be local to just the initialisation code provided it has exactly one writer and at least one reader within that code. The < indicates the declaration of local arguments, which are treated in the rules just like other arguments to the object. In effect, any call RoyalElephant(Args)→E is transformed to one Elephant(Args)→Proxy, RoyalElephant'(Args,Proxy)→E, where RoyalElephant' has the rules declared for RoyalElephant. It is assumed that Args hold the arguments needed for any elephant. So each royal elephant object has its own elephant object which acts as its proxy. An alternative way of declaring this is: #RoyalElephant(Args,Proxy←Elephant(Args))~ { colour-|>=white; : ?m | Proxy^m } Here Proxy is an argument with a default value. In general, a default value argument is declared in a header by following it with ←<Expression>, where <Expression> is any expression using the arguments of the header as input. It has a similar effect to a local variable, but the default may be overridden when an object is created, thus the call RoyalElephant(Args)→E works as before, but RoyalElephant(Args,Proxy←FunnyElephant(Args))→E creates a royal elephant object whose proxy is a funny elephant object, in other words it is equivalent to FunnyElephant(Args)→Proxy, RoyalElephant'(Args,Proxy)→E. Note that == is used for initialisation where there is no body, in effect declaring a macro, for example (using anonymous output, so <, ==, and > are separate symbols): #square(x) <==> x*x; This can also be seen as a way of avoiding “single rule” processes like: #square(x)< { ||>x*x } 9. More Control The next addition to the language deals with the fact that programs in concurrent logic languages tend to have a tangled structure of mutually recursive procedures. We allow anonymous embedded procedures, with their bodies written at the end of the rhs of the rule where they are called. This reduces the name space of procedures, and takes away the goto-like jumping between the mutually recursive procedures. In general, an embedded procedure is declared by adding a set of rules, with the same syntax as top-level rules, at the end of the rule which calls it. The embedded procedure has the same header (including local arguments) as the calling procedure with the addition of the anonymous return for the rule if there is one and it has not been given a value in the rule. A call to it is made in the place of the recursive call, with the arguments the recursive call would have had. A double bar on an embedded procedure rule indicates that recursion reverts to the embedding procedure, a triple bar means that there is no recursion. In general, given there is no limit on the level of embedding, the number of bars is one greater than the number of embeddings which are exited. So, the following declares a process with one input and one output channel which reads a series of constants, deleting those which are enclosed by the constants stop and start: #delbetween(in)→out { in.stop | { in.start || ; : in?m | ; in$ ||| out$ } : in?m | out^m; in$ || out$ } Using mutual recursion would make the above: #delbetween(in)→out { in.stop || delbetween1(in)→out; : in?m | out^m; in$ || out$ } #delbetween1(in)→out { in.start || delbetween(in)→out; : in?m | ; in$ || out$ } Embedded procedures may have local variables which are declared in a similar way to local variables for top-level procedures, so, for example, the following is similar to the above but outputs a separate stream which sends a list of the number of characters deleted on after each occurrence of stop: #delcountbetween(in)→(out,count) { in.stop | num←0,<(num) { in.start || count^num; : in?m | num←num+1; in$ ||| count^num$, out$ } : in?m | out^m; in$ || out$, count$ } Here the equivalent is: #delcountbetween(in)→(out,count) { in.stop || delcountbetween1(in,0)→(out,count); : in?m | out^m; in$ || out$, count$ } #delcountbetween1(in,num)→(out,count) { in.start || count^num, delcountbetween(in)→(out,count); : in?m | num←num+1; in$ || count^num$, out$ } Any output local variable must have an explicit writer in any rule whose number of bars is such that the variable is no longer in scope and hence not an argument to the mutually recursive call. A variant of the embedded procedure gives an if-then-else construct (which could be expressed, but awkwardly, using the previous syntax), which overcomes some of the problems of “flat” guards (conditionals on the left hand side of rules being only system primitives, not user-defined expressions). The if-then-else takes the form <Decl>?<Cond>:<Statement>:<Statement>. Here <Decl> is an optional statement of local variables, taking the same form as previous local declarations, <Cond> is an expression which evaluates to true or false, and <Statement> has the same structure as the rhs of a rule (including the possibility of further embedding). <Cond> is part of the statement preceding the if-then-else, thus having variable values as input into the procedure, but the <Statement>s describe the embedded procedure, and thus have variable values as changed by any assignments. The embedded procedure has an extra argument, the result of the expression <Cond>, and just two non-recursive rules given by the <Statement>s, the first taken if <Cond> evaluates to true, the second if it evaluates to false. As an example, here is a version of list filtering, using the linked list form of lists given above, and the filtering function passed in as an argument: #filter(Func,InList)→OutList { || ? InList.isempty : empty()→OutList; : InList.head→H.tail→T,<(H,T) ? Func H : filter(Func,T).cons(H)→OutList; : filter(Func,T)→OutList } A more concise form involving implicit recursion and anonymous output is: #filter(Func,InList)~ { | ? InList.isempty :| <=empty(); : InList.head→H.tail→InList,<(H) ? Func H : <=~cons(H); : } where <= is a new construct introduced to assign a value to the anonymous object output, equivalent to Actors “become”. Without the embedded procedures, this would be: #filter(Func,InList)∼ == <=filter1(InList.Isempty,Func,InList); #filter1(t,Func,InList)→OutList { t=true || empty()→OutList; t=false || InList.head→H, filter2(Func H,H,Func,InList.tail)→OutList } #filter2(t,H,Func,InList)→OutList { t=true || filter(Func,InList).cons(H)→OutList; t=false || filter(Func,InList)→OutList } A further control structure gives sequencing. A statement may take the form +<Decl><Statement>;<Statement>, with <Decl> again an optional declaration of further local variables taken from the first of the <Statement>s added to the arguments of the embedded procedure, and the second <Statement> being the sole rule, entered without condition, of this embedded procedure. The recursive call from this second statement will return to the calling procedure. Again, the <Statement>s may contain further embedding. Note the “sequencing” here refers to values of variables: the first statement may change a variable value, the second will make use of the changed value and may change it again. It does not necessarily apply to execution order of every component of the statements, components of the first statement could indeed be suspended waiting for values to be returned from the second. 10. Conclusion A language with a simply rule-based operational model, originally inspired by the concurrent logic languages, has been constructed by adding derived forms to that model. Following from concurrent logic programming, the language uses single-assignment variables, but it imposes a type discipline which ensures any variable has exactly one writer. A variable in a particular position has either input type or output type, and it also has either object type or simple type (where a simple type variable can be bound to a constant or a tuple containing only input simple variables). We have described briefly, using examples, a variety of the features which are included in Aldwych. The flexibility of the underlying model is clear from this. Currently the language is at an experimental stage. We welcome further discussion in order to settle on a suitable set of features to be included in the first distribution of the language. We would prefer to think of Aldwych as it currently exists as akin to Landin’s ISWIM [16], a basis for a family of languages rather than a language in its own right. However, a working version which includes all the features mentioned in this paper is in existence, and has been used to construct several medium-sized programs. The productivity improvement when using it and compared to constructing the same program directly in a concurrent logic language is large. 11. References 1. G.Agha. Concurrent object-oriented programming. Comm. ACM 33, 9 pp.125-141. 2. R.Bird and P.Wadler. Introduction to Functional Programming, Prentice Hall. 3. K.L.Clark. PARLOG and its applications. IEEE Trans. Soft. Eng. 14, 12 pp.17921804. 4. I.Foster and S.Taylor, Strand: New Concepts in Parallel Programming, PrenticeHall. 5. I.Foster, R.Olson and S.Tuecke. Productive parallel programming: the PCN approach. Scientific Programming 1, 1 pp.51-66. Reprinted in Programming Languages for Parallel Processing D.B.Skillicorn and D.Talia (eds), IEEE Press, 1995. 6. D.Gelernter and N.Carriero. Co-ordination languages and their significance. Comm. ACM 35, 2 pp.97-107. 7. A.Goldberg and D.Robson. Smalltalk 80: The Language and its Implementation. Addison-Wesley. 8. R.H.Halstead. Multilisp: a language for concurrent symbolic computation. A C M Trans. Prog. Lang Sys. 7, 4 pp.501-538. 9. C.Hewitt. Viewing control structures as patterns of passing messages. Artificial Intelligence 8, 3 pp.323-364. 10. C.A.R.Hoare. Communicating sequential processes. Comm. ACM 21, 8 pp.666677. 11. M.Huntbach. The concurrent object-oriented language Braid. In ACM Symp. on Applied Computing, Nashville TN, pp.140-146. 12. M.Huntbach. An introduction to RGDC as a concurrent object-oriented programming language. J. Obj. Oriented Prog., Sep. 1995. 13. S.Janson, J.Montelius and S.Haridi. Ports for objects in concurrent logic programs. In Research Directions in Concurrent Object-Oriented Programming, MIT Press. 14. K.M.Kahn. Objects – a fresh look. In Proceedings of the Third European Conference on Object-Oriented Programming (ECOOP 89) S.Cook (ed), Cambridge University Press. 15. K.M.Kahn and M.S.Miller. Language design and open systems. In The Ecology of Computation, B.A.Huberman (ed), Elsevier, pp.291-312. 16. P.J.Landin. The next 700 programming languages. Comm ACM 9, 3 pp.157-166. 17. H.Lieberman. Concurrent object-oriented programming in Act 1. In ObjectOriented Concurrent Programing A.Yonezawa and M.Tokoro (eds) MIT Press, pp.9-36. 18. J.Meseguer and T.Winkler. Parallel programming in Maude. In Research Directions in High-Level Parallel Programming Languages, J.P.Banâtre and D.Le Métayer (eds), Springer LNCS 574, pp.253-293. 19. K.Rokusawa, A.Nakase and T.Chikayama. Distributed memory implementation of KLIC. New Generation Computing 14, pp.261-280. 20. E.Shapiro. Systolic programming: a paradigm for parallel processing. In Proc. Int. Conf. on Fifth Generation Computer Systems, Tokyo, pp.458-471. 21. E.Shapiro. The family of concurrent logic programming languages. ACM Comp. Surv. 21, 3 pp.413-510. 22. E.Shapiro and A.Takeuchi. Object-oriented programming in Concurrent Prolog, New Generation Computing 1, pp.25-48.
6cs.PL
Dual Path Networks for Multi-Person Human Pose Estimation Guanghan Ning, Zhihai He University of Missouri Columbia, MO arXiv:1710.10192v1 [cs.CV] 27 Oct 2017 [email protected], [email protected] Abstract 60% in mean average precision (mAP). Existing methods can be classified into two kinds of approaches, the top-down approach and the bottom-up approach. The top-down approach [11, 22] relies on a detection module to obtain human candidates and then apply a single-person human pose estimator to detect human keypoints. The bottom-up approach [8, 12, 34, 20], on the other hand, detects human keypoints from all potential human candidates and then assemble these keypoints into human limbs for each individual based on various data association techniques. The main advantage of the bottom-up approaches is its excellent tradeoff between estimation accuracy and computational cost. It takes the winner [8] of MS COCO 2016 keypoint challenge less than 200 ms to run the pose estimator for one frame on a Pascal TITAN X GPU. More importantly, contrary to top-down approaches, its computational cost is invariant to the number of human candidates in the image. We follow the bottom-up approach of the works of Zhe. et. al [8] and aim to design smaller, faster, and more accurate neural networks for multi-person keypoints regression. According to [8], their proposed Part Affinity Fields (PAF) and its corresponding data-association techniques are robust and reliable. More accurate keypoint and PAF regression would potentially increase the overall performance up to 10%. In this work, we focus on the network regression part and leave the data association part to future works. We propose a dual-path network specially designed for multiperson human pose estimation, and compare our performance with the openpose [2] network in aspects of model size, forward speed, and estimation accuracy. Our contributions include: (1) We analyze the tasks of keypoint regression and PAF, where PAF estimation depends heavily on keypoints estimation but not vice versa. (2) We then design a dual-path network, the denseNet path responsible for PAF regression while the resNeXt path regressing human keypoints. Our performance is superior than the openpose [2] network even though the proposed network is of lower computational complexity and smaller model size. The rest of the paper is organized as follows. In section The task of multi-person human pose estimation in natural scenes is quite challenging. Existing methods include both top-down and bottom-up approaches. The main advantage of bottom-up methods is its excellent tradeoff between estimation accuracy and computational cost. We follow this path and aim to design smaller, faster, and more accurate neural networks for the regression of keypoints and limb association vectors. These two regression tasks are naturally dependent on each other. In this work, we propose a dual-path network[9] specially designed for multi-person human pose estimation, and compare our performance with the openpose[2, 8] network in aspects of model size, forward speed, and estimation accuracy. 1. Introduction The task of human pose estimation is to determine the precise pixel locations of body keypoints from a single input image [15, 21]. Human pose estimation is very important for many high-level computer vision tasks, including action and activity recognition, human-computer interaction, motion capture, and animation. Estimating human poses from natural images is quite challenging. An effective pose estimation system must be able to handle large pose variations, changes in clothing and lighting conditions, severe body deformations, heavy body occlusions [32, 31, 21]. It is naturally a regression task. With Convolutional Neural Networks (ConvNets) and many assistive methods such as batch normalization [16], resnet [13], and inception design [28, 29], single-person human pose estimation has recently achieved significant progress. Recent research emphasis has been put on multi-person human pose estimation, where multiple individuals may exist in a natural scene. Compared to single person human pose estimation, where human candidates are cropped and centered in the image patch, the task of multi-person human pose estimation is more challenging. The best performance on MS COCO 2016 Keypoints challenge [1] is only around 1 Channels = 3 Channels = Y n end-to-end DPN blocks <M, M> <X+Z, Y> VGG-16 ... <X+(n-1)Z, Y> <X+nZ, Y> Channels= M <X> k=1x1 <128> <128> k=1x1 <kpts> <X+nZ> k=1x1 <128> <128> k=1x1 <PAFs> Channels = X+nZ t stages <185> k=1x1 <N> Channels = N F Channels = 128 Convolution DPN block Batch Norm Relu Unit Concatenate Figure 1. Our proposed network. The image feeds into the first 16 layers of VGG [26] network and outputs 128 channels of low-level visual features. These features are subsequently fed into each stage of the repetive sub-network illustrated in this image. Each DPN block takes as input two branches of feature maps and also output feature maps of two branches, one with a consistent number of channels, the other one with accumulated channels over DPN blocks. 2, we provide a brief review of recent works on multi-person human pose estimation. Section 3 introduces the proposed network. Section 4 presents our experimental results. Section 5 concludes our paper. 2. Related Work 2.1. Single-Person Human Pose Estimation This task is simpler than multi-person pose estimation because it aims to estimate the pose of a single person, where the image is cropped assuming the person dominates the image content. Traditional methods for single-person human pose estimation are mostly based on pictorial structure models [25, 23, 27, 30, 10, 19]. Since the work of DeepPose by Toshev et al. [32], research on human pose estimation has shifted from traditional approaches to deep neural networks (DNN) due to their superior performance. Recent methods [21, 33, 15, 7] have achieved quite accurate performance on popular datasets [6, 18]. However, the assumption that the person can always be correctly located is not necessarily satisfied. 2.2. Multi-Person Human Pose Estimation Multi-person human pose estimation is a more realistic problem. It attempts to estimate the poses of multiple persons in natural scenes. It is quite challenging due to the variance of sizes and scales of the persons. Existing methods can be classified into two kinds of approaches, the topdown approach and the bottom-up approach. The top-down approach [11, 22] relies on a detection module to obtain human candidates and then apply a singleperson human pose estimator to detect human keypoints. Insafutdinov et al [15] propose a pipeline which uses the Faster R-CNN [24] as detection module and a unary DeeperCut as their single-person pose estimator. Their method achieves 51.0 in mAP on MPII dataset [6]. Because the single-person pose estimator is usually sensitive to the detection results, this approach requires the detection module to be very robust. More accurate performance has been achieved by Hao et al [11]. Their framework facilitates pose estimation in the presence of inaccurate human bounding boxes by introducing more components into the pipeline that refine the detection and pose estimation results. The bottom-up approach [8, 12, 34, 20], on the other hand, detects human keypoints from all potential human candidates and then assemble these keypoints into human limbs for each individual based on various data association techniques. Many of these techniques are graph-based [8, 34]. The main advantage of the bottom-up approaches is its excellent tradeoff between estimation accuracy and computational cost. The winner of COCO2016 [1] proposes to estimate human keypoints as well as Part-Affinity Fields (PAF) simultaneously. PAFs are limb association vectors that can be used to assemble the keypoints into multi-person poses with certain graph-based association techniques. According to [8], their proposed PAF and corresponding dataassociation techniques are robust and reliable. More accurate keypoint and PAF regression would potentially increase the overall performance up to 10%. We follow their works and focus on the network regression part, aiming to design smaller, faster, and more accurate neural networks for multi-person human pose estimation. 2.3. Dual Path Networks According to [8], their proposed data-association technique is robust and reliable; more accurate keypoint and PAF regression would potentially increase the overall performance up to 10%. Motivated by this, we look into network engineering and explore more robust and efficient learning of features and spatial inter-dependencies. <X> k=1x1 <X> Association Path Channels = X+Z Channels = X Channels = Y <X> k=1x1 <128> <128> kxk group=4 <128> <Y> k=1x1 <128> <128> k=1x1 <Y+Z> Channels = Z Channels = Y <Y> k=1x1 <Y> Keypoints Path Channels = Y Convolution Batch Norm Relu Unit Concatenate Pixel-wise Add Figure 2. Proposed DPN block. It consists of two paths: the keypoints path and the data association path. The regression of human keypoints and association vectors are dependent on each other and share information from the previous block. The association vectors however, need more features to further explore spatial interdependency and they are regressed with accumulated channels of feature maps from all previous DPN blocks. Dual Path Networks (DPN) is first proposed in [9] as a hybrid network design that incorporates the core idea of DenseNet [14] with that of ResNeXt [35]. ResNeXt is a variant of the widely-used ResNet [13], introducing a homogeneous, multi-branch architecture that has a new dimension called cardinality (the size of the set of transformations), as an essential factor in addition to the dimensions of depth and width. They show that increasing cardinality is able to improve classification accuracy, and is more effective than going deeper or wider when we increase the capacity of the network. The core of denseNet is that it connects each layer to every other layer in a feed-forward fashion. They alleviate the vanishing-gradient problem, strengthen feature propagation, encourage feature reuse, and substantially reduce the number of parameters. According to the research of DPN, ResNet and its variants enable feature re-usage while DenseNet enables new features exploration which are both important for learning good representations. By carefully incorporating these two network designs into dual-path topologies, DPN shares common features while maintaining the flexibility to explore new features through dual path architectures. Inspired by the DPN network that is originally designed for the task of image classfication, we aim to design a variant of DPN that is specially tailored for multi-person human pose estimation because the regression tasks for keypoints and association vectors are naturally two paths. The two tasks are dependent on each other but unique in their own ways. In the next section, we introduce our proposed DPN network, describe how the regression of keypoints and association vectors are assigned to each path and, explain the intuition behind it. For detailed description of part associ- ation techniques, please refer to the original paper of PAF [8]. 3. Proposed Method The proposed network is highly modulized. We intentionally follow the general network structure of openpose. As shown in Figure 1, there are multiple stages of repetitive subnetworks, where each subnetwork outputs estimated heatmaps of keypoints and PAFs and is enforced with loss functions as intermediate supervision. The network is first fed with an image into the first 16 layers of the VGG network and outputs 128 channels of low-level visual features, denoted by F. These features are then fed into each stage of the following subnetworks. The modules in the figure only indicates the input and output channels and leaves out the resolution because the convolutional layers are all padded such that the resolution of the feature maps do not change. Our proposed network differs from the openpose network in the structure of the subnetwork patterns, specifically, the DPN blocks. As shown in Figure 2, our proposed DPN block consists of two paths. The regression of human keypoints and association vectors are dependent on each other and share information from the previous block. With the operator of element-wise addition, the Keypoints Path (KP) leverages features before and after the feature fusion/transition within a DPN block. The association vectors in the Association Path (AP), however, accumulate features over blocks to further exploit spatial interdependencies. They are regressed with accumulated channels of feature maps from all previous DPN blocks. With such representation, features from the AP path is less constrained and more flexible than the KP path. It enforces the AP path to learn features at a higher level compared to the KP path, even though they are dependent and share common features. It is declared in [8] that most of their false positives come from imprecise localization, other than background confusion and that there is more improvement space in capturing spatial dependencies than in recognizing body parts appearances. Therefore, we set the learning rate for the VGG layers to be zero, thus maintaining the same low-level visual features as that used in the openpose model. In this way, we can purely compare the capability of the networks in capturing spatial dependencies. The network from the first stage produces a set of keypoint heatmaps S1 = ρ1 (F) and a set of PAFs L1 = φ1 (F), where ρ1 and φ1 represent high-dimensional functions of the KP path and AP path networks. To guide the network to iteratively predict keypoint heatmaps and PAFs at each stage, we apply two loss functions in each sub-network. We use an L2 loss between the estimated predictions and the groundtruth maps and fields. Specifically, the loss functions for the dual paths at stage t are: fSt = J X X kStj (p) − S∗j (p)k22 , (1) kLtc (p) − L∗c (p)k22 , (2) j=1 p fLt = C X X 4.1. Algorithm Performance Analysis Average Precision We compare the AP scores of the proposed network with openpose on the validation set. All experiments are performed on the local machine with the same resolution and single scale. Method Head Sho. Elb. Wri. Hip Knee Ank. Total openpose@6stages 46.8 76.4 68.7 54.7 63.6 59.6 52.8 59.5 openpose@3stages 45.5 72.1 63.1 48.1 58.4 51.9 45.8 54.4 Ours@3stages 47.5 76.3 67.6 53.3 62.9 57.9 49.7 58.5 Table 2. Comparisons of Average Precision (AP) scores on the PoseTrack validation set. Experiments are performed at the same original resolution and single scale. Speed and Model Size Comparison We test and compare the networks by averaged forward time for a single frame. The unit is miliseconds (ms). Both experiments are performed at the same original resolution and single scale. Method forward time (ms) openpose@6stages 155.8 Ours@3stages 186.6 Table 3. Comparisons of feedforward time in miliseconds (ms) of different networks for a single frame. Evaluations are performed with a single Pascal TITAN X GPU. c=1 p where S∗j is the groundtruth keypoint heatmap, L∗c is the groundtruth PAF vector field, at an image location p. 4. Experimental Results Dataset The PoseTrack [3] dataset consists of over 68, 000 frames. The workshop is organized around a challenge with three competition tracks focusing on single frame multi-person pose estimation, multi-person pose estimation in videos, and multi-person articulated tracking. In our work, we focus on the single frame multi-person pose estimation. Experimental Settings In order to make a fair comparison with the openpose network, which is trained on the MS COCO dataset [1], we use the same training data before testing on the PoseTrack dataset. In our experiments, all the experiment settings including the testing scales and parameters in the data association techniques are uniform for the two networks. Therefore, no special tuning on the training and testing for the PoseTrack dataset is made. Quantitative Results We report our Average Precision (AP) scores on the PoseTrack test set1 . The result on test set is performed at 3 stages and 2 scales (1, 0.75). Method Head Sho. Elb. Wri. Hip Knee Ank. Total Ours 48.2 75.4 68.8 59.5 63.6 60.1 53.9 62.4 Table 1. Average Precision (AP) scores on the PoseTrack test set. Method 3 stages 4 stages 5 stages 6 stages openpose 103.8 139.0 174.1 209.3 Ours 43.7 50.1 56.4 62.7 Table 4. Comparisons of model size of different networks in Mega Bytes (MB). Both models have the same input image resolution and share the same VGG-16 layers. Even though our model is much smaller than the openpose model, the intermediate storage of network strucures including accumulated feature maps from AP path consume GPU memory greatly in current Caffe [17] version. In the future, by porting memory-efficient denseNet implementation from other deep learning frameworks [5, 4] into Caffe, which enables more stages of DPN to fit into the GPU memory, we believe the performance will potentially be better. 5. Conclusion In this work, we propose a dual-path network specially designed for multi-person human pose estimation, and compare our performance with the openpose[8] network in aspects of model size, forward speed, and estimation accuracy. Extentive experiments on PoseTrack challenge dataset show that our method is both accurate and efficient. Even though the method described in this work regresses PAFs[8] as the association vector, the dual-path network is generic and not limited to specific vector representation and association techniques. References [1] Coco keypoints challenge. http://image-net.org/ challenges/ilsvrc+coco2016, 2016. 1, 2, 4 [2] Openpose library. May, 2017. 1 [3] Posetrack: Iccv workshop. https://posetrack.net/ workshops/iccv2017/, October, 2017. 4 [4] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016. 4 [5] B. Amos and J. Z. Kolter. A pytorch implementation of densenet, 2017. 4 [6] M. Andriluka, L. Pishchulin, P. Gehler, and B. Schiele. 2d human pose estimation: New benchmark and state of the art analysis. In CVPR, 2014. 2 [7] V. Belagiannis and A. Zisserman. Recurrent human pose estimation. arXiv preprint arXiv:1605.02914, 2016. 2 [8] Z. Cao, T. Simon, S.-E. Wei, and Y. Sheikh. Realtime multiperson 2d pose estimation using part affinity fields. arXiv preprint arXiv:1611.08050, 2016. 1, 2, 3, 4 [9] Y. Chen, J. Li, H. Xiao, X. Jin, S. Yan, and J. Feng. Dual path networks. arXiv preprint arXiv:1707.01629, 2017. 1, 3 [10] M. Dantone, J. Gall, C. Leistner, and L. Van Gool. Human pose estimation using body parts dependent joint regressors. In CVPR, 2013. 2 [11] Y.-W. T. Hao-Shu Fang, Shuqin Xie and C. Lu. RMPE: Regional multi-person pose estimation. In ICCV, 2017. 1, 2 [12] K. He, G. Gkioxari, P. Dollár, and R. Girshick. Mask r-cnn. arXiv preprint arXiv:1703.06870, 2017. 1, 2 [13] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. 1, 3 [14] G. Huang, Z. Liu, K. Q. Weinberger, and L. van der Maaten. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016. 3 [15] E. Insafutdinov, L. Pishchulin, B. Andres, M. Andriluka, and B. Schiele. Deepercut: A deeper, stronger, and faster multiperson pose estimation model. In ECCV, 2016. 1, 2 [16] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. 1 [17] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, and T. Darrell. Caffe: Convolutional architecture for fast feature embedding. In Proceedings of the 22nd ACM international conference on Multimedia, pages 675–678. ACM, 2014. 4 [18] S. Johnson and M. Everingham. Clustered pose and nonlinear appearance models for human pose estimation. In BMVC, 2010. 2 [19] L. Karlinsky and S. Ullman. Using linking features in learning non-parametric part models. In ECCV, 2012. 2 [20] A. Newell and J. Deng. Associative embedding: End-toend learning for joint detection and grouping. arXiv preprint arXiv:1611.05424, 2016. 1, 2 [21] A. Newell, K. Yang, and J. Deng. Stacked hourglass networks for human pose estimation. In ECCV, 2016. 1, 2 [22] G. Papandreou, T. Zhu, N. Kanazawa, A. Toshev, J. Tompson, C. Bregler, and K. Murphy. Towards accurate multi-person pose estimation in the wild. arXiv preprint arXiv:1701.01779, 2017. 1, 2 [23] L. Pishchulin, M. Andriluka, P. Gehler, and B. Schiele. Poselet conditioned pictorial structures. In CVPR, 2013. 2 [24] S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pages 91–99, 2015. 2 [25] B. Sapp and B. Taskar. Modec: Multimodal decomposable models for human pose estimation. In CVPR, 2013. 2 [26] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 2 [27] M. Sun and S. Savarese. Articulated part-based model for joint object detection and pose estimation. In ICCV, 2011. 2 [28] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In CVPR, 2015. 1 [29] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016. 1 [30] Y. Tian, C. L. Zitnick, and S. G. Narasimhan. Exploring the spatial hierarchy of mixture models for human pose estimation. In ECCV, 2012. 2 [31] J. J. Tompson, A. Jain, Y. LeCun, and C. Bregler. Joint training of a convolutional network and a graphical model for human pose estimation. In NIPS, 2014. 1 [32] A. Toshev and C. Szegedy. Deeppose: Human pose estimation via deep neural networks. In CVPR, 2014. 1, 2 [33] S.-E. Wei, V. Ramakrishna, T. Kanade, and Y. Sheikh. Convolutional pose machines. In CVPR, 2016. 2 [34] F. Xia, P. Wang, X. Chen, and A. Yuille. Joint multi-person pose estimation and semantic part segmentation. arXiv preprint arXiv:1708.03383, 2017. 1, 2 [35] S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. arXiv preprint arXiv:1611.05431, 2016. 3 Notes 1 Performance on test set is evalutaed by the PoseTrack server. Challenge results available at: https://posetrack.net/workshops/ iccv2017/posetrack-challenge-results.html
1cs.CV
MAttNet: Modular Attention Network for Referring Expression Comprehension Licheng Yu1 , Zhe Lin2 , Xiaohui Shen2 , Jimei Yang2 , Xin Lu2 , Mohit Bansal1 , Tamara L. Berg1 arXiv:1801.08186v3 [cs.CV] 27 Mar 2018 1 University of North Carolina at Chapel Hill 2 Adobe Research Abstract Module Weights [0.49,'0.31,'0.20] In this paper, we address referring expression comprehension: localizing an image region described by a natural language expression. While most recent work treats expressions as a single unit, we propose to decompose them into three modular components related to subject appearance, location, and relationship to other objects. This allows us to flexibly adapt to expressions containing different types of information in an end-to-end framework. In our model, which we call the Modular Attention Network (MAttNet), two types of attention are utilized: languagebased attention that learns the module weights as well as the word/phrase attention that each module should focus on; and visual attention that allows the subject and relationship modules to focus on relevant image components. Module weights combine scores from all three modules dynamically to output an overall score. Experiments show that MAttNet outperforms previous state-of-the-art methods by a large margin on both bounding-box-level and pixel-level comprehension tasks. Demo1 and code2 are provided. Expression=“man in red holding controller on the right” man in red Subject Module on the right holding controller Location Module Relationship Module ["# ,%# ,"& ,%& ] scoresubj ⨂ scoreloc ⨂ scorerel ⨂ ⨁ scoreoverall Figure 1: Modular Attention Network (MAttNet). Given an expression, we attentionally parse it into three phrase embeddings, which are input to three visual modules that process the described visual region in different ways and compute individual matching scores. An overall score is then computed as a weighted combination of the module scores. 1. Introduction ing, the proposal/object with highest likelihood/probability is selected as the predicted region. However, most of these work uses a simple concatenation of all features (target object feature, location feature and context feature) as input and a single LSTM to encode/decode the whole expression, ignoring the variance among different types of referring expressions. Depending on what is distinctive about a target object, different kinds of information might be mentioned in its referring expression. For example, if the target object is a red ball among 10 black balls then the referring expression may simply say “the red ball”. If that same red ball is placed among 3 other red balls then location-based information may become more important, e.g., “red ball on the right”. Or, if there were 100 red balls in the scene then the ball’s relationship to other objects might be the most distinguishing information, e.g., “red ball next to the cat”. Therefore, it is natural and intuitive to think about the com- Referring expressions are natural language utterances that indicate particular objects within a scene, e.g., “the woman in the red sweater” or “the man on the right”. For robots or other intelligent agents communicating with people in the world, the ability to accurately comprehend such expressions in real-world scenarios will be a necessary component for natural interactions. Referring expression comprehension is typically formulated as selecting the best region from a set of proposals/objects O = {oi }N i=1 in image I, given an input expression r. Most recent work on referring expressions uses CNN-LSTM based frameworks to model P (r|o) [19, 11, 32, 20, 18] or uses a joint vision-language embedding framework to model P (r, o) [22, 26, 27]. During test1 Demo: 2 Code: Language Attention Network vision2.cs.unc.edu/refer/comprehension https://github.com/lichengunc/MAttNet 1 prehension model as a modular network, where different visual processing modules are triggered based on what information is present in the referring expression. Modular networks have been successfully applied to address other tasks such as (visual) question answering [2, 3], visual reasoning [8, 12], relationship modeling [10], and multi-task reinforcement learning [1]. To the best our knowledge, we present the first modular network for the general referring expression comprehension task. Moreover, these previous work typically relies on an off-the-shelf language parser [24] to parse the query sentence/question into different components and dynamically assembles modules into a model addressing the task. However, the external parser could raise parsing errors and propagate them into model setup, adversely effecting performance. Therefore, in this paper we propose a modular network for referring expression comprehension - Modular Attention Network (MAttNet) - that takes a natural language expression as input and softly decomposes it into three phrase embeddings. These embeddings are used to trigger three separate visual modules (for subject, location, and relationship comprehension, each with a different attention model) to compute matching scores, which are finally combined into an overall region score based on the module weights. Our model is illustrated in Fig. 1. There are 3 main novelties in MAttNet. First, MAttNet is designed for general referring expressions. It consists of 3 modules: subject, location and relationship. As in [13], a referring expression could be parsed into 7 attributes: category name, color, size, absolute location, relative location, relative object and generic attribute. MAttNet covers all of them. The subject module handles the category name, color and other attributes, the location module handles both absolute and (some) relative location, and the relationship module handles subject-object relations. Each module has a different structure and learns the parameters within its own modular space, without affecting the others. Second, MAttNet learns to parse expressions automatically through a soft attention based mechanism, instead of relying on an external language parser [24, 13]. We show that our learned “parser” attends to the relevant words for each module and outperforms an off-the-shelf parser by a large margin. Additionally, our model computes module weights which are adaptive to the input expression, measuring how much each module should contribute to the overall score. Expressions like “red cat” will have larger subject module weights and smaller location and relationship module weights, while expressions like “woman on left” will have larger subject and location module weights. Third, we apply different visual attention techniques in the subject and relationship modules to allow relevant attention on the described image portions. In the subject mod- ule, soft attention attends to the parts of the object itself mentioned by an expression like “man in red shirt” or “man with yellow hat”. We call this “in-box” attention. In contrast, in the relationship module, hard attention is used to attend to the relational objects mentioned by expressions like “cat on chair” or “girl holding frisbee”. Here the attention focuses on “chair” and “frisbee” to pinpoint the target object “cat” and “girl”. We call this “out-of-box” attention. We demonstrate both attentions play important roles in improving comprehension accuracy. During training, the only supervision is object proposal, referring expression pairs, (oi , ri ), and all of the above are automatically learned in an end-to-end unsupervised manner, including the word attention, module weights, soft spatial attention, and hard relative object attention. We demonstrate MAttNet has significantly superior comprehension performance over all state-of-the-art methods, achieving ∼10% improvements on bounding-box localization and almost doubling precision on pixel segmentation. 2. Related Work Referring Expression Comprehension: The task of referring expression comprehension is to localize a region described by a given referring expression. To address this problem, some recent work[19, 32, 20, 11, 18] uses CNNLSTM structure to model P (r|o) and looks for the object o maximizing the probability. Other recent work uses joint embedding model [22, 26, 16, 4] to compute P (o|r) directly. In a hybrid of both types of approaches, [33] proposed a joint speaker-listener-reinforcer model that combined CNN-LSTM (speaker) with embedding model (listener) to achieve state-of-the-art results. Most of the above treat comprehension as bounding box localization, but object segmentation from referring expression has also been studied in some recent work [9, 15]. These papers use FCN-style [17] approaches to perform expression-driven foreground/background classification. We demonstrate that in addition to bounding box prediction, we also outperform previous segmentation results. Modular Networks: Neural module networks [3] were introduced for visual question answering. These networks decompose the question into several components and dynamically assemble a network to compute an answer to the given question. Since their introduction, modular networks have been applied to several other tasks: visual reasoning [8, 12], question answering [2], relationship modeling [10], multitask reinforcement learning [1], etc. While the early work [3, 12, 2] requires an external language parser to do the decomposition, recent methods [10, 8] propose to learn the decomposition end-to-end. We apply this idea to referring expression comprehension, also taking an end-to-end approach bypassing the use of an external parser. 2 man in red holding controller on the right We find that our soft attention approach achieves better performance over the hard decisions predicted by a parser. The most related work to us is [10], which decomposes the expression into (Subject, Preposition/Verb, Object) triples. However, referring expressions have much richer forms than this fixed template. For example, expressions like “left dog” and “man in red” are hard to model using [10]. In this paper, we propose a generic modular network addressing all kinds of referring expressions. Our network is adaptive to the input expression by assigning both word-level attention and module-level weights. word embedding Bi-LSTM man in red holding controller on the right ⨀ Modular Phrase Embedding [" #$%&, " ()* , " +,( ] man in red holding controller on the right Figure 2: Language Attention Network Different from relationship detection [10] where phrases are always decomposed as (Subject, Preposition/Verb, Object) triplets, referring expressions have no such well-posed structure. For example, expressions like “smiling boy” only contain language relevant to the subject module, while expressions like “man on left” are relevant to the subject and location modules, and “cat on the chair” are relevant to the subject and relationship modules. To handle this variance, we compute 3 module weights for the expression, weighting how much each module contributes to the expressionobject score. We concatenate the first and last hidden vectors from H which memorizes both structure and semantics of the whole expression, then use another fully-connected (FC) layer to transform it into 3 module weights: MAttNet is composed of a language attention network plus visual subject, location, and relationship modules. Given a candidate object oi and referring expression r, we first use the language attention network to compute a soft parse of the referring expression into three components (one for each visual module) and map each to a phrase embedding. Second, we use the three visual modules (with unique attention mechanisms) to compute matching scores for oi to their respective embeddings. Finally, we take a weighted combination of these scores to get an overall matching score, measuring the compatibility between oi and r. 3.1. Language Attention Network Instead of using an external language parser [24][3][2] or pre-defined templates [13] to parse the expression, we propose to learn to attend to the relevant words automatically for each module, similar to [10]. Our language attention network is shown in Fig. 2. For a given expression r = {ut }Tt=1 , we use a bi-directional LSTM to encode the context for each word. We first embed each word ut into a vector et using an one-hot word embedding, then a bidirectional LSTM-RNN is applied to encode the whole expression. The final hidden representation for each word is the concatenation of the hidden vectors in both directions: et = embedding(ut ) ~ ~ht = LSTM(e ~ t , ht−1 ) T [wsubj , wloc , wrel ] = softmax(Wm [h0 , hT ] + bm ) 3.2. Visual Modules While most previous work [32, 33, 19, 20] evaluates CNN features for each region proposal/candidate object, we use Faster R-CNN [21] as the backbone net for a faster and more principled implementation. Additionally, we use ResNet [7] as our main feature extractor, but also provide comparisons to previous methods using the same VGGNet features [23] (in Sec. 4.2). Given an image and a set of candidates oi , we run Faster R-CNN to extract their region representations. Specifically, we forward the whole image into Faster R-CNN and crop the C3 feature (last convolutional output of 3rd-stage) for each oi , following which we further compute the C4 feature (last convolutional output of 4th-stage). In Faster R-CNN, C4 typically contains higher-level visual cues for category prediction, while C3 contains relatively lower-level cues including colors and shapes for proposal judgment, making both useful for our purposes. In the end, we compute the matching score for each oi given each modular phrase embedding, i.e., S(oi |q subj ), S(oi |q loc ) and S(oi |q rel ). ~ ~ h~t = LSTM(e t , ht+1 ) ht = [~ht , h~t ]. Given H = {ht }Tt=1 , we apply three trainable vectors fm where m ∈ {subj, loc, rel}, computing the attention on each word [29] for each module: T exp (fm ht ) am,t = PT T k=1 exp (fm hk ) The weighted sum of word embeddings is used as the modular phrase embedding: qm = Module Weights [.#$%&, .()* , .+,( ] Word Attention man in red holding controller on the right 3. Model T X FC 3.2.1 Subject Module Our subject module is illustrated in Fig. 3. Given the C3 and C4 features of a candidate oi , we forward them to two am,t et t=1 3 Matching function Visual subject representation avg. pooling Attribute blob concat-1x1 conv RoI Res-C3 blob Res-C4 blob man boy girl red blue black running … MLP L2%normlize MLP L2%normlize Phrase-guided embedding Subj. phrase embedding * &'() concate-1x1 conv Subject blob Matching Phrase-guided Attentional Pooling score&'() Figure 3: The subject module is composed of a visual subject representation and phrase-guided embedding. An attribute prediction branch is added after the ResNet-C4 stage and the 1x1 convolution output of attribute prediction and C4 is used as the subject visual representation. The subject phrase embedding attentively pools over the spatial region and feeds the pooled feature into the matching function. then use a 1×1 convolution to fuse them into a subject blob, which consists of spatial grid of features V ∈ Rd×G , where G = 14 × 14. Given the subject phrase embedding q subj , we compute its attention on each grid location: tasks. The first is attribute prediction, helping produce a representation that can understand appearance characteristics of the candidate. The second is the phrase-guided attentional pooling to focus on relevant regions within object bounding boxes. Attribute Prediction: Attributes are frequently used in referring expressions to differentiate between objects of the same category, e.g. “woman in red” or “the fuzzy cat”. Inspired by previous work [30, 28, 31, 16, 25], we add an attribute prediction branch in our subject module. While preparing the attribute labels in the training set, we first run a template parser [13] to obtain color and generic attribute words, with low-frequency words removed. We combine both C3 and C4 for predicting attributes as both low and high-level visual cues are important. The concatenation of C3 and C4 is followed with a 1 × 1 convolution to produce an attribute feature blob. After average pooling, we get the attribute representation of the candidate region. A binary cross-entropy loss is used for multi-attribute classification: XX Lattr wjattr [log(pij )+(1−yij )log(1−pij )] subj = λattr i Ha = tanh(Wv V + Wq q subj ) T av = softmax(wh,a Ha ) The weighted sum of V is the final subject visual representation for the candidate region oi : veisubj = G X avi vi i=1 Matching Function: We measure the similarity between the subject representation veisubj and phrase embedding qsubj using a matching function, i.e, S(oi |q subj ) = F (e visubj , q subj ). As shown in top-right of Fig. 3, it consists of two MLPs (multi-layer perceptions) and two L2 normalization layers following each input. Each MLP is composed of two fully connected layers with ReLU activations, serving to transform the visual and phrase representation into a common embedding space. The inner-product of the two l2normalized representations is computed as their similarity score. The same matching function is used to compute the location score S(oi |q loc ), and relationship score S(oi |q rel ). j p where wjattr = 1/ freqattr weights the attribute labels, easing unbalanced data issues. During training, only expressions with attribute words go through this branch. Phrase-guided Attentional Pooling: The subject description varies depending on what information is most salient about the object. Take people for example. Sometimes a person is described by their accessories, e.g., “girl in glasses”; or sometimes particular clothing items may be mentioned, e.g., “woman in white pants”. Thus, we allow our subject module to localize relevant regions within a bounding box through “in-box” attention. To compute spatial attention, we first concatenate the attribute blob and C4, 3.2.2 Location Module Our location module is shown in Fig. 4. Location is frequently used in referring expressions with about 41% expressions from RefCOCO and 36% expressions from RefCOCOg containing absolute location words [13], e.g. “cat on the right” indicating the object location in the image. 4 Loc. phrase embedding + ,-. ! " %" ! ' %' )ℎ , , , , # & # &( #& Matching This can be regarded as weakly-supervised Multiple Instance Learning (MIL) which is similar to [10][20]. scoreloc concat 3.3. Loss Function same-type location difference The overall weighted matching score for candidate object oi and expression r is: Figure 4: Location Module S(oi |r) = wsubj S(oi |q subj ) + wloc S(oi |q loc ) + wrel S(oi |q rel ) Following previous work [32][33], we use a 5-d vector li to encode the top-left position, bottom-right position and relative area to the image for the candidate object, i.e., w·h li = [ xWtl , yHtl , xWbr , yHbr , W ·H ]. Additionally, expressions like “dog in the middle” and “second left person” imply relative positioning among objects of the same category. We encode the relative location representation of a candidate object by choosing up to five surrounding objects of the same category and calculating their offsets and area ratio, i.e., δlij = [4y ] [4x ] [4y ] w h [4x ] [ wtli ij , htli ij , wbri ij , hbri ij , wji hji ]. The final location representation for the target object is: During training, for each given positive pair of (oi , ri ), we randomly sample two negative pairs (oi , rj ) and (ok , ri ), where rj is the expression describing some other object and ok is some other object in the same image, to calculate a combined hinge loss, Lrank = +λ2 max(0, ∆ + S(ok |ri ) − S(oi |ri ))] The overall loss incorporates both attributes cross-entropy loss and ranking loss: L = Lattr subj + Lrank . 4. Experiments 4.1. Datasets and the location module matching score between oi and q loc is S(oi |q loc ) = F (e liloc , q loc ). We use 3 referring expression datasets: RefCOCO, RefCOCO+ [13], and RefCOCOg [19] for evaluation, all collected on MS COCO images [14], but with several differences. 1) RefCOCO and RefCOCO+ were collected in an interactive game interface, while RefCOCOg was collected in a non-interactive setting thereby producing longer expressions, 3.5 and 8.4 words on average respectively. 2) RefCOCO and RefCOCO+ contain more same-type objects, 3.9 vs 1.63 respectively. 3) RefCOCO+ forbids using absolute location words, making the data more focused on appearance differentiators. During testing, RefCOCO and RefCOCO+ provide person vs. object splits for evaluation, where images containing multiple people are in “testA” and those containing multiple objects of other categories are in “testB”. There is no overlap between training, validation and testing images. RefCOCOg has two types of data partitions. The first [19] divides the dataset by randomly partitioning objects into training and validation splits. As the testing split has not been released, most recent work evaluates performance on the validation set. We denote this validation split as RefCOCOg’s “val*”. Note, since this data is split by objects the same image could appear in both training and validation. The second partition [20] is composed by randomly partitioning images into training, validation and testing splits. We denote its validation and testing splits as RefCOCOg’s “val” and “test”, and run most experiments on this split. Relationship Module Rel. phrase embedding ! "#$ Matching max() X [λ1 max(0, ∆ + S(oi |rj ) − S(oi |ri )) i e liloc = Wl [li ; δli ] + bl 3.2.3 (1) scorerel + Relative location difference Figure 5: Relationship Module While the subject module deals with “in-box” details about the target object, some other expressions may involve its relationship with other “out-of-box” objects, e.g., “cat on chaise lounge”. The relationship module is used to address these cases. As in Fig. 5, given a candidate object oi we first look for its surrounding (up-to-five) objects oij regardless of their categories. We use the average-pooled C4 feature as the appearance feature vij of each supporting object. Then, we encode their offsets to the candidate object via [4x ] [4y ] [4x ] [4y ] w h δmij = [ wtli ij , htli ij , wbri ij , hbri ij , wji hji ]. The visual representation for each surrounding object is then: rel veij = Wr [vij ; δmij ] + br We compute the matching score for each of them with q rel and pick the highest one as the relationship score, i.e., 4.2. Results: Referring Expression Comprehension Given a test image, I, with a set of proposals/objects, O = {oi }N i=1 , we use Eqn. 1 to compute the matching score rel rel S(oi |q rel ) = maxj6=i F (e vij ,q ) 5 1 2 3 4 5 6 7 8 9 10 11 Mao [19] Varun [20] Luo [18] CMN [10] Speaker/visdif [32] Listener [33] Speaker+Listener+Reinforcer [33] Speaker+Listener+Reinforcer [33] MAttN:subj(+attr)+loc(+dif)+rel MAttN:subj(+attr)+loc(+dif)+rel MAttN:subj(+attr+attn)+loc(+dif)+rel feature vgg16 vgg16 vgg16 vgg16-frcn vgg16 vgg16 vgg16 vgg16 vgg16 res101-frcn res101-frcn val 76.90 76.18 77.48 79.56 78.36 80.94 83.54 85.65 RefCOCO testA 63.15 75.60 74.04 74.39 76.58 78.95 77.97 79.99 82.66 85.26 testB 64.21 78.00 73.43 77.30 78.94 80.22 79.86 82.30 84.17 84.57 val 58.94 60.50 62.26 61.33 63.07 68.34 71.01 RefCOCO+ testA testB 48.73 42.13 60.26 55.03 61.29 56.24 61.39 58.11 64.60 59.62 63.10 58.19 65.04 61.77 69.93 65.90 75.13 66.17 val* 62.14 65.36 69.30 59.40 71.12 72.63 72.02 73.08 - RefCOCOg val 69.93 71.65 71.32 73.04 76.63 78.10 test 68.40 69.03 71.92 71.72 72.79 75.92 78.12 Table 1: Comparison with state-of-the-art approaches on ground-truth MS COCO regions. 1 2 3 4 5 6 7 Matching:subj+loc MAttN:subj+loc MAttN:subj+loc(+dif) MAttN:subj+loc(+dif)+rel MAttN:subj(+attr)+loc(+dif)+rel MAttN:subj(+attr+attn)+loc(+dif)+rel parser+MAttN:subj(+attr+attn)+loc(+dif)+rel val 79.14 79.68 82.06 82.54 83.54 85.65 80.20 RefCOCO testA 79.42 80.20 81.28 81.58 82.66 85.26 79.10 testB 80.42 81.49 83.20 83.34 84.17 84.57 81.22 val 62.17 62.71 64.84 65.84 68.34 71.01 66.08 RefCOCO+ testA testB 63.53 59.87 64.20 60.65 65.77 64.55 66.59 65.08 69.93 65.90 75.13 66.17 68.30 62.94 RefCOCOg val test 70.45 70.92 72.12 72.62 75.33 74.46 75.96 74.56 76.63 75.92 78.10 78.12 73.82 73.72 Table 2: Ablation study of MAttNet using different combination of modules. The feature used here is res101-frcn. S(oi |r) for each proposal/object given the input expression r, and pick the one with the highest score. For evaluation, we compute the intersection-over-union (IoU) of the selected region with the ground-truth bounding box, considering IoU > 0.5 a correct comprehension. First, we compare our model with previous methods using COCO’s ground-truth object bounding boxes as proposals. Results are shown in Table. 1. As all of the previous methods (Line 1-8) used a 16-layer VGGNet (vgg16) as the feature extractor, we run our experiments using the same feature for fair comparison. Note the flat fc7 is a single 4096-dimensional feature which prevents us from using the phrase-guided attentional pooling in Fig. 3, so we use average pooling for subject matching. Despite this, our results (Line 9) still outperform all previous state-of-the-art methods. After switching to the res101-based Faster R-CNN (res101-frcn) representation, the comprehension accuracy further improves another ∼3% (Line 10). Note our Faster R-CNN is pre-trained on COCO’s training images, excluding those in RefCOCO, RefCOCO+, and RefCOCOg’s validation+testing. Thus no training images are seen during our evaluation3 . Our full model (Line 11) with phrase-guided attentional pooling achieves the highest accuracy over all others by a large margin. Second, we study the benefits of each module of MAttNet by running ablation experiments (Table. 2) with the same res101-frcn features. As a baseline, we use the concatenation of the regional visual feature and the location feature as the visual representation and the last hidden output of LSTM-encoded expression as the language representation, then feed them into the matching function to obtain the similarity score (Line 1). Compared with this, a simple two-module MAttNet using the same features (Line 2) already outperforms the baseline, showing the advantage of modular learning. Line 3 shows the benefit of encoding location (Sec. 3.2.2). After adding the relationship module, the performance further improves (Line 4). Lines 5 and Line 6 show the benefits brought by the attribute subbranch and the phrase-guided attentional pooling in our subject module. We find the attentional pooling (Line 6) greatly improves on the person category (testA of RefCOCO and RefCOCO+), demonstrating the advantage of modular attention on understanding localized details like “girl with red hat”. Third, we tried training our model using 3 hard-coded phrases from a template language parser [13], shown in Line 7 of Table. 2, which is ∼5% lower than our end-toend model (Line 6). The main reason for this drop is errors made by the external parser which is not tuned for referring expressions. Fourth, we show results using automatically detected objects from Faster R-CNN, providing an analysis of fully automatic comprehension performance. Table. 3 shows the ablation study of fully-automatic MAttNet. While perfor- 3 Such constraint forbids us to evaluate on RefCOCOg’s val* using the res101-frcn feature in Table 1. 6 1 2 3 4 5 6 7 8 9 Speaker+Listener+Reinforcer [33] Speaker+Listener+Reinforcer [33] Matching:subj+loc MAttN:subj+loc MAttN:subj+loc(+dif) MAttN:subj+loc(+dif)+rel MAttN:subj(+attr)+loc(+dif)+rel MAttN:subj(+attr+attn)+loc(+dif)+rel MAttN:subj(+attr+attn)+loc(+dif)+rel detector res101-frcn res101-frcn res101-frcn res101-frcn res101-frcn res101-frcn res101-frcn res101-frcn res101-mrcn val 69.48 68.95 72.28 72.72 72.96 73.25 74.51 76.40 76.65 RefCOCO testA 73.71 73.10 75.43 76.17 76.61 76.77 77.81 80.43 81.14 testB 64.96 64.85 67.87 68.18 68.20 68.44 68.39 69.28 69.99 val 55.71 54.89 58.42 58.70 58.91 59.45 62.13 64.93 65.33 RefCOCO+ testA testB 60.74 48.80 60.04 49.56 61.46 52.73 61.65 53.41 63.06 55.19 63.31 55.68 66.33 55.75 70.26 56.00 71.62 56.02 RefCOCOg val test 60.21 59.63 59.33 59.21 64.15 63.25 64.40 63.74 64.66 63.88 64.87 64.01 65.33 65.19 66.67 67.01 66.58 67.27 Table 3: Ablation study of MAttNet on fully-automatic comprehension task using different combination of modules. The features used here are res101-frcn, except the last row using res101-mrcn. Model D+RMI+DCRF [15] MAttNet D+RMI+DCRF [15] MAttNet D+RMI+DCRF [15] MAttNet Backbone Net res101-DeepLab res101-mrcn res101-DeepLab res101-mrcn res101-DeepLab res101-mrcn Split val val testA testA testB testB RefCOCO [email protected] [email protected] 42.99 33.24 75.16 72.55 42.99 33.59 79.55 77.60 44.99 32.21 68.87 65.06 [email protected] 22.75 67.83 23.69 72.53 22.69 60.02 [email protected] 12.11 54.79 12.94 59.01 11.84 48.91 [email protected] 2.23 16.81 2.44 13.79 2.65 21.37 IoU 45.18 56.51 45.69 62.37 45.57 51.70 Model D+RMI+DCRF [15] MAttNet D+RMI+DCRF [15] MAttNet D+RMI+DCRF [15] MAttNet Backbone Net res101-DeepLab res101-mrcn res101-DeepLab res101-mrcn res101-DeepLab res101-mrcn Split val val testA testA testB testB RefCOCO+ [email protected] 20.52 64.11 21.22 70.12 20.78 54.82 [email protected] 8.46 58.06 8.99 63.97 8.80 47.27 [email protected] 3.77 47.42 3.91 52.13 4.58 38.58 [email protected] 0.62 14.16 0.49 12.28 0.80 17.00 IoU 29.86 46.67 30.48 52.39 29.50 40.08 Model MAttNet MAttNet Backbone Net res101-mrcn res101-mrcn Split val test [email protected] 14.02 61.87 14.43 68.48 14.56 51.73 RefCOCOg [email protected] [email protected] 64.48 61.52 65.60 62.92 [email protected] 56.50 57.31 [email protected] 43.97 44.44 [email protected] 14.67 12.55 IoU 47.64 48.61 Table 4: Comparison of segmentation performance on RefCOCO, RefCOCO+, and our results on RefCOCOg. mance drops due to detection errors, the overall improvements brought by each module are consistent with Table. 2, showing the robustness of MAttNet. Our results also outperform the state-of-the-art [33] (Line 1,2) with a big margin. Besides, we show the performance when using the detector branch of Mask R-CNN [6] (res101-mrcn) in Line 9, whose results are even better than using Faster R-CNN. more frequently, which accords with the dataset property. Note that for some complex expressions like “woman in plaid jacket and blue pants on skis” which contains several relationships (last row in Fig. 6), our language model is able to attend to the portion that should be used by the “in-box” subject module and the portion that should be used by the “out-of-box” relationship module. Additionally our subject module also displays reasonable spatial “in-box” attention, which qualitatively explains why attentional pooling (Table. 2 Line 6) outperforms average pooling (Table. 2 Line 5). For comparison, some incorrect comprehension are shown in Fig. 7. Most errors are due to sparsity in the training data, ambiguous expressions, or detection error. Finally, we show some example visualizations of comprehension using our full model in Fig. 6 as well as visualizations of the attention predictions. We observe that our language model is able to attend to the right words for each module even though it is learned in a weakly-supervised manner. We also observe the expressions in RefCOCO and RefCOCO+ describe the location or details of the target object more frequently while RefCOCOg mentions the relationship between target object and its surrounding object 4.3. Segmentation from Referring Expression Our model can also be used to address referential object segmentation [9, 15]. Instead of using Faster R7 Comprehension Lang. attention Subj. attention Comprehension Lang. attention Subj. attention Expression=“second from right guy” Expression=“bottom left bowl” (a) RefCOCO Expression=“man with hands up” Expression=“suit guy under umbrella” (b) RefCOCO+ Expression=“a man with a silver ring is holding a phone” Expression=“woman in plaid jacket and blue pants on skis” (c) RefCOCOg Figure 6: Examples of fully automatic comprehension. The blue dotted boxes show our prediction with the relative regions in yellow dotted boxes, and the green boxes are the ground-truth. The word attention is multiplied by module weight. Comprehension Lang. attention Expression=“right kid” Subj. attention Expression=“left elephant” Expression=“dude with 9” (a) RefCOCO (a) RefCOCO Expression=“woman with short red hair” Expression=“brown and white horse” Expression=“boy with striped shirt” (b) RefCOCO+ (b) RefCOCO+ Expression=“a woman with full black tops” Expression=“the tennis player in red shirt” Expression=“man standing behind person hitting ball” (c) RefCOCOg (c) RefCOCOg Figure 8: Examples of fully-automatic MAttNet referential segmentation. Figure 7: Examples of incorrect comprehensions. Red dotted boxes show our wrong prediction. with our model outperforming state-of-the-art results by a large margin under all metrics5 . As both [15] and MAttNet use res101 features, such big gains may be due to our proposed model. We believe decoupling box localization (comprehension) and segmentation brings a large gain over FCN-style [17] foreground/background mask classification [9, 15] for this instance-level segmentation problem, but a more end-to-end segmentation system may be studied in future work. Some referential segmentation examples are shown in Fig. 8. CNN as the backbone net, we now turn to res101-based Mask R-CNN [6] (res101-mrcn). We apply the same procedure described in Sec. 3 on the detected objects, and use the one with highest matching score as our prediction. Then we feed the predicted bounding box to the mask branch to obtain a pixel-wise segmentation. We evaluate the full model of MAttNet and compare with the best results reported in [15]. We use Precision@X (X ∈ {0.5, 0.6, 0.7, 0.8, 0.9})4 and overall Intersectionover-Union (IoU) as metrics. Results are shown in Table. 4 4 [email protected] is the percentage of expressions where the IoU of the predicted segmentation and ground-truth is at least 0.5. 5 There is no experiments on RefCOCOg’s val/test splits in [15], so we show our performance only for reference in Table 4. 8 5. Conclusion Our modular attention network addresses variance in referring expressions by attending to both relevant words and visual regions in a modular framework, and dynamically computing an overall matching score. We demonstrate our model’s effectiveness on bounding-box-level and pixellevel comprehension, significantly outperforming state-ofthe-art. Acknowledgements: This research is supported by NSF Awards #1405822, 1562098, 1633295, NVidia, Google Research, Microsoft Research and Adobe Research. (a) RefCOCO A. Appendix A.1. Training Details We optimize our model using Adam with an initial learning rate of 0.0004 and with a batch size of 15 images (and all their expressions). The learning rate is halved every 8,000 iterations after the first 8,000-iteration warm-up. The word embedding size and hidden state size of the LSTM are set to 512. We also set the output of all MLPs and FCs within our model to be 512-dimensional. To avoid overfitting, we regularize the word-embedding and output layers of the LSTM in the language attention network using dropout with ratio of 0.5. We also regularize the two inputs (visual and language) of matching function using a dropout with a ratio of 0.2. For the constrastive pairs, we set λ1 = 1.0 and λ2 = 1.0 in the ranking loss Lrank . Besides, we set λattr = 1.0 for multi-label attribute cross-entropy loss Lattr subj . (b) RefCOCO+ (c) RefCOCOg Figure 9: Attribute histogram for three datasets. A.2. Computational Efficiency RefCOCO RefCOCO+ RefCOCOg During training, the full model of MAttNet converges at around 30,000 iterations, which takes around half day using single Titan-X(Pascal). At inference time, our fully automatic system goes through both Mask R-CNN and MAttNet, which takes on average 0.33 seconds for a forward, where 0.31 seconds are spent on Mask R-CNN and 0.02 seconds on MAttNet. Split val val val Precision 63.48 61.78 68.18 Recall 29.91 20.11 34.79 F1 40.66 30.14 46.07 Table 5: Multi-attribute prediction on the validation split of each dataset. backbone net. Actually, the mask branch of MAttNet could be any foreground-background decomposition method. The simplest replacement might be GrabCut. We show the results of MatNet+GrabCut in Table 6. Note even though GrabCut is an inferior segmentation method, it still far outperforms previous state-of-the-art results [15]. Thus, we believe the way of decoupling box localization (comprehension) and segmentation is more suitable for instance-level referential segmentation task. A.3. Attribute Prediction Our full model is also able to predict attributes during testing. Our attribute labels are extracted using the template parser [13]. We fetch the object name, color and generic attribute words from each expression, with low-frequency words removed. We use 50 most frequently used attribute words for training. The histograms for top-20 attribute words are shown in Fig. 9, and the quantitative analysis of our multi-attribute prediction results is shown in Table. 5. A.5. Mask R-CNN Implementation Our implementation of Mask R-CNN6 is based on the single-GPU Faster R-CNN implementation [5]. For the mask branch, we follow the structure in the original pa- A.4. MAttNet + Grabcut In Section 4.3, we show MAttNet could be extended to referential segmentation by using Mask R-CNN as the 6 Our 9 implementation: https://github.com/lichengunc/mask-faster-rcnn. RefCOCO [email protected] 33.24 41.89 33.59 42.60 32.21 38.27 Model D+RMI+DCRF [15] MAttNet+GrabCut D+RMI+DCRF [15] MAttNet+GrabCut D+RMI+DCRF [15] MAttNet+GrabCut Split val val testA testA testB testB [email protected] 42.99 51.25 42.99 52.94 44.99 47.18 [email protected] 22.75 29.77 23.69 27.68 22.69 29.97 [email protected] 12.11 17.13 12.94 13.29 11.84 20.35 [email protected] 2.23 5.38 2.44 2.92 2.65 7.85 IoU 45.18 42.86 45.69 44.37 45.57 40.71 Model D+RMI+DCRF [15] MAttNet+GrabCut D+RMI+DCRF [15] MAttNet+GrabCut D+RMI+DCRF [15] MAttNet+GrabCut Split val val testA testA testB testB RefCOCO+ [email protected] [email protected] [email protected] 20.52 14.02 8.46 45.24 37.09 26.51 21.22 14.43 8.99 47.10 37.86 24.66 20.78 14.56 8.80 38.52 31.13 24.44 [email protected] 3.77 14.95 3.91 11.67 4.58 16.71 [email protected] 0.62 4.34 0.49 2.27 0.80 6.20 IoU 29.86 37.18 30.48 38.32 29.50 33.30 Table 6: Comparison of referential segmentation performance between D+RMI+DCRF [15] and MatNet+GrabCut. per [6], with several differences: 1) We sample R = 256 regions from N = 1 image during each forward-backward propagation due to the constraint of single GPU, while [6] samples R = 128 regions from N = 16 images using 8 GPUs. 2) During training, the shorter edge of our resized image is 600 pixels instead of 800 pixels, for saving memory. 3) Our model is trained on a union of COCO’s 80k train and 35k subset of val (trainval35k) images excluding the val/test (valtest4k) images in RefCOCO, RefCOCO+ and RefCOCOg. We firstly show the comparison between Faster R-CNN and Mask R-CNN on object detection in Table. 7. Both models are based on ResNet101 and were trained using same setting. In the main paper, we denote them as res101frcn and res101-mrcn respectively. It shows that Mask RCNN has higher AP than Faster R-CNN due to the multitask training (with additional mask supervision). net res101-frcn res101-mrcn AP bb 34.1 35.8 bb AP50 53.7 55.3 lower. The main reason may due to the shorter 600-pixel edge setting and smaller training batch size. Even though, our pixel-wise comprehension results already outperform the state-of-the-art ones with a huge margin (see Table. 4, and we believe there exists space for further improvements. A.6. More Examples We show more examples of comprehension using our full model in Fig. 10 (RefCOCO), Fig. 11 (RefCOCO+) and Fig. 12 (RefCOCOg). For each example, we show the input image (1st column), the input expression with our predicted module weights and word attention (2nd column), the subject attention (3rd column) and top-5 attributes (4th column), box-level comprehension (5th column), and pixelwise segmentation (6th column). As comparison, we also show some incorrect comprehension in Fig. 13. bb AP75 36.8 38.6 Table 7: Object detection results. net res101-mrcn (ours) res101-mrcn [6] AP 30.7 32.7 AP50 52.3 54.2 AP75 32.4 34.0 Table 8: Instance segmentation results. We then compare our Mask R-CNN implementation with the original one [6] in Table 8. Note this is not a strictly fair comparison as our model was trained with fewer images. Overall, the AP of our implementation is ∼2 points 10 Input image Expression & Lang. attention Subj. attention Top-5 attributes Box localization Segmentation Expression=“woman second from left” 1. guy (0.91) 2. black (0.20) 3. white (0.04) 4. woman (0.04) 5. lady (0.02) Expression=“man standing up” 1. guy (0.44) 2. woman (0.20) 3. gray (0.19) 4. white (0.16) 5. shirt (0.16) Expression=“man on far right” 1. guy (0.58) 2. jacket (0.49) 3. woman (0.24) 4. black (0.24) 5. lady (0.12) Expression=“second from right guy” 1. guy (0.44) 2. blue (0.29) 3. woman (0.25) 4. girl (0.12) 5. shirt (0.11) Expression=“pink donut on top” 1. pink (0.64) 2. purple (0.15) 3. white (0.13) 4. baby (0.04) 5. brown (0.04) Expression=“bottom left bowl” 1. food (0.80) 2. plate (0.42) 3. white (0.12) 4. brown (0.01) 5. black (0.01) Expression=“teddy bear left” 1. food (0.80) 2. plate (0.42) 3. white (0.12) 4. brown (0.01) 5. black (0.01) Figure 10: Examples of fully automatic comprehension on RefCOCO. The 1st column shows the input image. The 2nd column shows the expression, word attention and module weights. The 3rd column shows our predicted subject attention, and the 4th column shows its top-5 attributes. The 5th column shows box-level comprehension where the red dotted boxes show our prediction and yellow dotted boxes shows the relative object, and the green boxes are the ground-truth. The 6th column shows the segmentation. 11 Input image Expression & Lang. attention Subj. attention Top-5 attributes Box localization Segmentation Expression=“pink girl” 1. girl (0.33) 2. pink (0.26) 3. shirt (0.24) 4. white (0.12) 5. guy (0.11) Expression=“woman with sun glasses” 1. woman (0.44) 2. shirt (0.27) 3. girl (0.25) 4. lady (0.19) 5. guy (0.10) Expression=“man on far right” 1. black (0.58) 2. guy (0.56) 3. shirt (0.43) 4. hand (0.25) 5. woman (0.18) Expression=“player with the ball” 1. blue (0.37) 2. white(0.29) 3. guy (0.22) 4. boy (0.19) 5. black (0.16) Expression=“red blue white phone case” 1. red (0.16) 2. black (0.11) 3. white (0.11) 4. girl (0.04) 5. blue (0.02) Expression=“biggest lamb” 1. animal (0.32) 2. face (0.26) 3. white (0.20) 4. dark (0.11) 5. black (0.10) Expression=“largest compute screen” 1. white (0.94) 2. gray (0.13) 3. number (0.04) 4. old (0.04) 5. black (0.03) Figure 11: Examples of fully automatic comprehension on RefCOCO+.The 1st column shows the input image. The 2nd column shows the expression, word attention and module weights. The 3rd column shows our predicted subject attention, and the 4th column shows its top-5 attributes. The 5th column shows box-level comprehension where the red dotted boxes show our prediction and yellow dotted boxes shows the relative object, and the green boxes are the ground-truth. The 6th column shows the segmentation. 12 Input image Expression & Lang. attention Subj. attention Top-5 attributes Box localization Segmentation Expression=“a woman with a blue headband holding a tennis racket” 1. woman (0.45) 2. player (0.23) 3. boy (0.09) 4. young (0.07) 5. gray (0.05) Expression=“a man with a silver ring is holding a phone” 1. guy (0.39) 2. black (0.24) 3. hand (0.14) 4. woman (0.07) 5. grey (0.05) Expression=“a girl in a black and white dress playing tennis” 1. woman (0.67) 2. player (0.57) 3. girl (0.25) 4. red (0.11) 5. blonde (0.04) Expression=“woman in plaid jacket and blue pants on skis” 1. woman (0.45) 2. skier (0.40) 3. blue (0.16) 4. girl (0.12) 5. child (0.08) Expression=“man wearing glasses sitting at table” 1. guy (0.66) 2. woman (0.15) 3. boy (0.09) 4. young (0.08) 5. lady (0.08) Expression=“a woman in a gray top playing wii” 1. woman (0.80) 2. girl (0.17) 3. lady (0.13) 4. young (0.10) 5. boy (0.07) Expression=“giraffe bending down” 1. baby (0.40) 2. young (0.26) 3. brown (0.25) 4. white (0.05) 5. adult (0.02) Figure 12: Examples of fully automatic comprehension on RefCOCOg. The 1st column shows the input image. The 2nd column shows the expression, word attention and module weights. The 3rd column shows our predicted subject attention, and the 4th column shows its top-5 attributes. The 5th column shows box-level comprehension where the red dotted boxes show our prediction and yellow dotted boxes shows the relative object, and the green boxes are the ground-truth. The 6th column shows the segmentation. 13 Input image Expression & Lang. attention Subj. attention Top-5 attributes Box localization Segmentation Expression=“man” 1. guy (0.40) 2. shirt (0.35) 3. white (0.15) 4. blue (0.05) 5. green (0.04) RefCOCO: Expression=“giraffe to far left” 1. animal (0.50) 2. face (0.08) 3. pink (0.03) 4. middle (0.03) 5. baby (0.02) Expression=“pointing and smiling” RefCOCO+: 1. shirt (0.33) 2. woman (0.29) 3. girl (0.18) 4. white (0.16) 5. guy (0.15) Expression=“red cover mustard” 1. red (0.81) 2. full (0.03) 3. pink (0.02) 4. glass (0.01) 5. dark (0.01) Expression=“the empty part of the blue plate on the left” 1. blue (0.24) 2. plate (0.08) 3. glass (0.06) 4. full (0.05) 5. red (0.05) RefCOCOg: Expression=“a white chair behind a man” 1. wooden (0.87) 2. brown (0.33) 3. table (0.20) 4. empty (0.17) 5. white (0.07) Figure 13: Examples of incorrect comprehension on three datasets. The 1st column shows the input image. The 2nd column shows the expression, word attention and module weights. The 3rd column shows our predicted subject attention, and the 4th column shows its top-5 attributes. The 5th column shows box-level comprehension where the red dotted boxes show our prediction and yellow dotted boxes shows the relative object, and the green boxes are the ground-truth. The 6th column shows the segmentation. 14 References [22] A. Rohrbach, M. Rohrbach, R. Hu, T. Darrell, and B. Schiele. Grounding of textual phrases in images by reconstruction. In ECCV, 2016. 1, 2 [23] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 3 [24] R. Socher, J. Bauer, C. D. Manning, et al. Parsing with compositional vector grammars. In ACL, 2013. 2, 3 [25] J.-C. Su, C. Wu, H. Jiang, and S. Maji. Reasoning about fine-grained attribute phrases using reference games. ICCV, 2017. 4 [26] L. Wang, Y. Li, and S. Lazebnik. Learning deep structurepreserving image-text embeddings. CVPR, 2016. 1, 2 [27] L. Wang, Y. Li, and S. Lazebnik. Learning two-branch neural networks for image-text matching tasks. arXiv preprint arXiv:1704.03470, 2017. 1 [28] Q. Wu, C. Shen, P. Wang, A. Dick, and A. van den Hengel. Image captioning and visual question answering based on attributes and external knowledge. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. 4 [29] Z. Yang, D. Yang, C. Dyer, X. He, A. J. Smola, and E. H. Hovy. Hierarchical attention networks for document classification. In HLT-NAACL, 2016. 3 [30] T. Yao, Y. Pan, Y. Li, Z. Qiu, and T. Mei. Boosting image captioning with attributes. arXiv preprint arXiv:1611.01646, 2016. 4 [31] Q. You, H. Jin, Z. Wang, C. Fang, and J. Luo. Image captioning with semantic attention. In CVPR, 2016. 4 [32] L. Yu, P. Poirson, S. Yang, A. C. Berg, and T. L. Berg. Modeling context in referring expressions. In ECCV, 2016. 1, 2, 3, 5, 6 [33] L. Yu, H. Tan, M. Bansal, and T. L. Berg. A joint speakerlistener-reinforcer model for referring expressions. In CVPR, 2017. 2, 3, 5, 6, 7 [1] J. Andreas, D. Klein, and S. Levine. Modular multitask reinforcement learning with policy sketches. ICML, 2017. 2 [2] J. Andreas, M. Rohrbach, T. Darrell, and D. Klein. Learning to compose neural networks for question answering. NAACL, 2016. 2, 3 [3] J. Andreas, M. Rohrbach, T. Darrell, and D. Klein. Neural module networks. In CVPR, 2016. 2, 3 [4] K. Chen, R. Kovvuri, and R. Nevatia. Query-guided regression network with context policy for phrase grounding. In ICCV, 2017. 2 [5] X. Chen and A. Gupta. An implementation of faster rcnn with study for region sampling. arXiv preprint arXiv:1702.02138, 2017. 9 [6] K. He, G. Gkioxari, P. Dollár, and R. Girshick. Mask r-cnn. In ICCV, 2017. 7, 8, 9, 10 [7] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. 3 [8] R. Hu, J. Andreas, M. Rohrbach, T. Darrell, and K. Saenko. Learning to reason: End-to-end module networks for visual question answering. ICCV, 2017. 2 [9] R. Hu, M. Rohrbach, and T. Darrell. Segmentation from natural language expressions. In ECCV, 2016. 2, 7, 8 [10] R. Hu, M. Rohrbacnh, J. Andreas, T. Darrell, and K. Saenko. Modeling relationship in referential expressions with compositional modular networks. In CVPR, 2017. 2, 3, 5, 6 [11] R. Hu, H. Xu, M. Rohrbach, J. Feng, K. Saenko, and T. Darrell. Natural language object retrieval. CVPR, 2016. 1, 2 [12] J. Johnson, B. Hariharan, L. van der Maaten, J. Hoffman, L. Fei-Fei, C. L. Zitnick, and R. Girshick. Inferring and executing programs for visual reasoning. ICCV, 2017. 2 [13] S. Kazemzadeh, V. Ordonez, M. Matten, and T. L. Berg. Referitgame: Referring to objects in photographs of natural scenes. In EMNLP, 2014. 2, 3, 4, 5, 6, 9 [14] 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. 5 [15] C. Liu, Z. Lin, X. Shen, J. Yang, X. Lu, and A. Yuille. Recurrent multimodal interaction for referring image segmentation. In ICCV, 2017. 2, 7, 8, 9, 10 [16] J. Liu, L. Wang, and M.-H. Yang. Referring expression generation and comprehension via attributes. In ICCV, 2017. 2, 4 [17] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015. 2, 8 [18] R. Luo and G. Shakhnarovich. Comprehension-guided referring expressions. CVPR, 2017. 1, 2, 6 [19] 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, 5, 6 [20] V. K. Nagaraja, V. I. Morariu, and L. S. Davis. Modeling context between objects for referring expression understanding. In ECCV, 2016. 1, 2, 3, 5, 6 [21] S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, 2015. 3 15
2cs.AI
arXiv:1704.02598v2 [cs.GT] 11 Apr 2017 A Sample Complexity Measure with Applications to Learning Optimal Auctions Vasilis Syrgkanis Microsoft Research April 12, 2017 Abstract We introduce a new sample complexity measure, which we refer to as split-sample growth rate. For any hypothesis H and for any sample S of size m, the split-sample growth rate τ̂H (m) counts how many different hypotheses can empirical risk minimization output on any sub-sample q of S of size  m/2. We show that the expected generalization error is upper bounded log(τ̂H (2m)) by O . Our result is enabled by a strengthening of the Rademacher complexity m analysis of the expected generalization error. We show that this sample complexity measure, greatly simplifies the analysis of the sample complexity of optimal auction design, for many auction classes studied in the literature. Their sample complexity can be derived solely by noticing that in these auction classes, ERM on any sample or sub-sample will pick parameters that are equal to one of the points in the sample. 1 Introduction We look at the sample complexity of optimal auctions. We consider the case of m items, and n bidders. Each bidder has a value function vi drawn independently from a distribution Di and we denote with D the joint distribution. We assume we are given a sample set S = {v1 , . . . , vm }, of m valuation vectors, where each vt ∼ D. Let H denote the class of all dominant strategy truthful single item auctions (i.e. auctions where no player has incentive to report anything else other than his true value to the auction, independent of what other players do). Moreover, let r(h, v) = n X phi (v) (1) i=1 where phi (·) is the payment function of mechanism h, and r(h, v) is the revenue of mechanism h on valuation vector v. Finally, let RD (h) = Ev∼D [r(h, v)] (2) be the expected revenue of mechanism h under the true distribution of values D. Given a sample S of size m, we want to compute a dominant strategy truthful mechanism hS , such that: ES [RD (hS )] ≥ sup RD (h) − ǫ(m) (3) h∈H where ǫ(m) → 0 as m → ∞. We refer to ǫ(m) as the expected generalization error. Moreover, we define the sample complexity of an auction class as: 1 Definition 1 (Sample Complexity of Auction Class). The (additive error) sample complexity of an auction class H and a class of distributions D, for an accuracy target ǫ is defined as the smallest number of samples m(ǫ), such that for any m ≥ m(ǫ): ES [RD (hS )] ≥ sup RD (h) − ǫ (4) h∈H We might also be interested in a multiplcative error sample complexity, i.e. ES [RD (hS )] ≥ (1 − ǫ) sup RD (h) (5) h∈H The latter is exactly the notion that is used in [2, 3]. If one assumes that the optimal revenue on the distribution is lower bounded by some constant quantity, then an additive error implies a multiplicative error. For instance, if one assumes that player values are bounded away from zero with significant probability, then that implies a lower bound on revenue. Such assumptions for instance, are made in the work of [7]. We will focus on additive error in this work. We will also be interested in proving high probability guarantees, i.e. with probability 1 − δ: RD (hS ) ≥ sup RD (h) − ǫ(m, δ) (6) h∈H where for any δ, ǫ(m, δ) → 0 as m → ∞. Related work. The seminal work of [9] gave a recipe for designing the optimal truthful auction when the distribution over bidder valuations is completely known to the auctioneer. Recent work, starting from [2], addresses the question of how to design optimal auctions when having access only to samples of values from the bidders. We refer the reader to [3] for an overview of the existing results in the literature. [2, 7, 8, 1] give bounds on the sample complexity of optimal auctions without computational efficiency, while recent work has also focused on getting computationally efficient learning bounds [3, 11, 4]. This work solely focuses on sample complexity and not computational efficiency and thus is more related to [2, 7, 8, 1]. The latter work, uses tools from supervised learning, such as pseudodimension [10] (a variant of VC dimension for real-valued functions), compression bounds [6] and Rademacher complexity [10, 12] to bound the sample complexity of simple auction classes. Our work introduces a new measure of sample complexity, which is a strengthening the Rademacher complexity analysis and hence could also be of independent interest outside the scope of the sample complexity of optimal auctions. Moreover, for the case of auctions, this measure greatly simplifies the analysis of their sample complexity in many cases. 2 Generalization Error via the Split-Sample Growth Rate We turn to the general PAC learning framework, and we give generalization guarantees in terms of a new notion of complexity of a hypothesis space H, which we denote as split-sample growth rate. Consider an arbitrary hypothesis space H and an arbitrary data space Z, and suppose we are given a set S of m samples {z1 , . . . , zm }, where each zt is drawn i.i.d. from some distribution D on Z. We are interested in maximizing some reward function r : H × Z → [0, 1], in expectation over distribution D. In particular, denote with RD (h) = Ez∼D [r(h, z)]. We will look at the Expected Reward Maximization algorithm on S, with some fixed tie-breaking rule. Specifically, if we let m 1 X r(h, zt ) (7) RS (h) = m t=1 2 then ERM is defined as: (8) hS = arg sup RS (h) h∈H where ties are broken based on some pre-defined manner. We define the notion of a split-sample hypothesis space: Definition 2 (Split-Sample Hypothesis Space). For any sample S, let ĤS , denote the set of all hypothesis hT output by the ERM algorithm (with the pre-defined tie-breaking rule), on any subset T ⊂ S, of size ⌈|S|/2⌉, i.e.: ĤS = {hT : T ⊂ S, |T | = ⌈|S|/2⌉} (9) Based on the split-sample hypothesis space, we also define the split-sample growth rate of a hypothesis space H at value m, as the largest possible size of ĤS for any set S of size m. Definition 3 (Split-Sample Growth Rate). The split-sample growth rate of a hypothesis H and an ERM process for H, is defined as: τ̂H (m) = sup |ĤS | (10) S:|S|=m We first show that the generalization error is upper bounded by the Rademacher complexity evaluated on the split-sample hypothesis space of the union of two samples of size m. The Rademacher complexity R(S, H) of a sample S of size m and a hypothesis space H is defined as: # " 2 X σt · r(h, zt ) (11) R(S, H) = Eσ sup h∈H m zt ∈S where σ = (σ1 , . . . , σm ) and each σt is an independent binary random variable taking values {−1, 1}, each with equal probability. Lemma 1. For any hypothesis space H, and any fixed ERM process, we have: i h ES [RD (hS )] ≥ sup RD (h) − ES,S ′ R(S, ĤS∪S ′ ) , (12) h∈H where S and S ′ are two independent samples of some size m. Proof. Let h∗ be the optimal hypothesis for distribution D. First we re-write the left hand side, by adding and subtracting the expected empirical reward: ES [RD (hS )] = ES [RS (hS )] − ES [RS (hS ) − RD (hS )] ≥ ES [RS (h∗ )] − ES [RS (hS ) − RD (hS )] (hS maximizes empirical reward) = RD (h∗ ) − ES [RS (hS ) − RD (hS )] (h∗ is independent of S) Thus it suffices to upper bound the second quantity in the above equation. Since RD (h) = ES ′ [RS ′ (h)] for a fresh sample S ′ of size m, we have: ES [RS (hS ) − RD (hS )] = ES [RS (hS ) − ES ′ [RS ′ (hS )]] = ES,S ′ [RS (hS ) − RS ′ (hS )] 3 Now, consider the set ĤS∪S ′ . Since S is a subset of S ∪ S ′ of size |S ∪ S ′ |/2, we have by the definition of the split-sample hypothesis space that hS ∈ ĤS∪S ′ . Thus we can upper bound the latter quantity by taking a supremum over h ∈ ĤS∪S ′ : # " ES [RS (hS ) − RD (hS )] ≤ ES,S ′ RS (h) − RS ′ (h) sup h∈ĤS∪S ′ = ES,S ′ " sup h∈ĤS∪S ′ m  1 X r(h, zt ) − r(h, zt′ ) m t=1 # Now observe, that we can rename any sample zt ∈ S to zt′ and sample zt′ ∈ S ′ to zt . By doing show we do not change the distribution. Moreover, we do not change the quantity HS∪S ′ , since S ∪ S ′ is invariant to such swaps. Finally, we only change the sign of the quantity (r(h, zt ) − r(h, zt′ )). Thus if we denote with σt ∈ {−1, 1}, a Rademacher variable, we get the above quantity is equal to: # # " " m m X   1 X 1 (13) σt r(h, zt ) − r(h, zt′ ) ES,S ′ r(h, zt ) − r(h, zt′ ) = ES,S ′ sup sup m m h∈Ĥ h∈Ĥ ′ ′ S∪S t=1 S∪S t=1 for any vector σ = (σ1 , . . . , σm ) ∈ {−1, 1}m . The latter also holds in expectation over σ, where σt is randomly drawn between {−1, 1} with equal probability. Hence: " # m  1 X ′ ES [RS (hS ) − RD (hS )] ≤ ES,S ′ ,σ sup σt r(h, zt ) − r(h, zt ) m t=1 h∈Ĥ ′ S∪S By splitting the supremma into a positive and negative part and observing that the two expected quantities are identical, we get: # " m 1 X σt r(h, zt ) ES [RS (hS ) − RD (hS )] ≤ 2ES,S ′ ,σ sup h∈ĤS∪S ′ m t=1 i h = ES,S ′ R(S, ĤS∪S ′ ) where R(S, H) denotes the Rademacher complexity of a sample S and hypothesis H. Observe, that the latter theorem is a strengthening of the fact that the Rademacher complexity upper bounds the generalization error, simply because: i h ES,S ′ R(S, ĤS∪S ′ ) ≤ ES,S ′ [R(S, H)] = ES [R(S, H)] (14) Thus if we can bound the Rademacher complexity of H, then the latter lemma gives a bound on the generalization error. However, the reverse might not be true. Finally, we show our main theorem, which shows that if the split-sample hypothesis space has small size, then we immediately get a generalization bound, without the need to further analyze the Rademacher complexity of H. Theorem 2 (Main Theorem). For any hypothesis space H, and any fixed ERM process, we have: r 2 log(τ̂H (2m)) (15) ES [RD (hS )] ≥ sup RD (h) − m h∈H Moreover, with probability 1 − δ: 1 RD (hS ) ≥ sup RD (h) − δ h∈H 4 r 2 log(τ̂H (2m)) m (16) Proof. By applying Massart’s lemma (see e.g. [12]) we have that: s r 2 log(|ĤS∪S ′ |) 2 log(τ̂H (2m)) R(S, ĤS∪S ′ ) ≤ ≤ m m (17) Combining the above with Lemma 1, yields the first part of the theorem. Finally, the high probability statement follows from observing that the random variable suph∈H RD (h)− RD (hS ) is non-negative and by applying Markov’s inequality: with probability 1 − δ r   1 2 log(τ̂H (2m)) 1 (18) sup RD (h) − RD (hS ) ≤ ES sup RD (h) − RD (hS ) ≤ δ δ m h∈H h∈H The latter theorem can be trivially extended to the case when r : H × Z → [α, β], leading to a bound of the form: r 2 log(τ̂H (2m)) (19) ES [RD (hS )] ≥ sup RD (h) − (β − α) m h∈H We note that unlike the standard Rademacher complexity, which is defined as R(S, H), our bound, which is based on bounding R(S, ĤS∪S ′ ) for any two datasets S, S ′ of equal size, does not imply a high probability bound via McDiarmid’s inequality (see e.g. Chapter 26 of [12] of how this is done for Rademacher complexity analysis), but only via Markov’s inequality. The latter yields a worse dependence on the confidence δ on the high probability bound of 1/δ, rather than log(1/δ). The reason for the latter is that the quantity R(S, ĤS∪S ′ ), depends on the sample S, not only in terms of on which points to evaluate the hypothesis, but also on determining the hypothesis space ĤS∪S ′ . Hence, the function:   m X  1 σt r(h, zt ) − r(h, zt′ )  (20) f (z1 , . . . , zm ) = ES ′  sup m h∈Ĥ ′ t=1 {z1 ,...,zm }∪S 1 does not satisfy the stability property that |f (z) − f (zi′′ , z−i )| ≤ m . The reason being that the supremum is taken over a different hypothesis space in the two inputs. This is unlike the case of the function: # " m  1 X (21) σt r(h, zt ) − r(h, zt′ ) f (z1 , . . . , zm ) = ES ′ sup h∈H m t=1 which is used in the standard Rademacher complexity bound analysis, which satisfies the latter stability property. 3 Sample Complexity of Auctions via Split-Sample Growth We now present the application of the latter measure of complexity to the analysis of the sample complexity of revenue optimal auctions. Thoughout this section we assume that the revenue of any auction lies in the range [0, 1]. The results can be easily adapted to any other range [α, β], by re-scaling the equations, which will lead to blow-ups in the sample complexity of the order of an extra (β − α) multiplicative factor. This limits the results here to bounded distributions of values. However, as was shown in [3], one can always cap the distribution of values up to some upper bound, for the case of regular distributions, by losing only an ǫ fraction of the revenue. So one can apply the results below on this capped distribution. 5 Single bidder and single item. Consider the case of a single bidder and single item auction. In this setting, the space of hypothesis is H = {post a reserve price r for r ∈ [0, 1]}. We consider, the ERM rule, which for any set S, in the case of ties, it favors reserve prices that are equal to some valuation vt ∈ S. Wlog assume that samples v1 , . . . , vm are ordered in increasing order. Observe, that for any set S, this ERM rule on any subset T of S, will post a reserve price that is equal to some value vt ∈ T . Any other reserve price in between two values [vt , vt+1 ] is weakly dominated by posting r = vt+1 , as it does not change which samples are allocated and we can only increase revenue. Thus the space ĤS is a subset of {post a reserve price r ∈ {v1 , . . . , vm }. The latter is of size m. Thus the split-sample growth of H is τ̂H (m) ≤ m. This yields: r 2 log(2m) (22) ES [RD (hS )] ≥ sup RD (h) − m h∈H   Equivalently, the sample complexity is mH (ǫ) = O log(1/ǫ) . 2 ǫ Multiple i.i.d. regular bidders and single item. In this case the space of hypotheses are the space of second price auctions with some reserve r ∈ [0, 1]. Again if we consider ERM which in case of ties favors a reserve that equals to a value in the sample (assuming that is part of the tied set, or outputs any other value otherwise), then observe that for any subset T of a sample S, ERM on that subset will pick a reserve price that is equal to one of the values in the samples S. Thus τ̂H (m) ≤ n · m. This yields: r 2 log(2 · n · m) (23) ES [RD (hS )] ≥ sup RD (h) − m h∈H   2) . Equivalently, the sample complexity is mH (ǫ) = O log(n/ǫ ǫ2 Non-i.i.d. regular bidders, single item, second price with player specific reserves. In this case the space of hypotheses HSP are the space of second price auctions with some reserve ri ∈ [0, 1] for each player i. Again if we consider ERM which in case of ties favors a reserve that equals to a value in the sample (assuming that is part of the tied set, or outputs any other value otherwise), then observe that for any subset T of a sample S, ERM on that subset will pick a reserve price ri that is equal to one of the values vti of player i in the sample S. There are m such possible choices for each player, thus mn possible choices of reserves in total. Thus τ̂H (m) ≤ mn . This yields: r 2n log(2m) (24) ES [RD (hS )] ≥ sup RD (h) − m h∈HSP If H is the space of all dominant strategy truthful mechanisms, then by prophet inequalities (see [5]), we know that suph∈HSP RD (h) ≥ 21 suph∈H RD (h). Thus: 1 ES [RD (hS )] ≥ sup RD (h) − 2 h∈H r 2n log(2m) m (25) Non-i.i.d. irregular bidders single item. In this case the space of hypotheses are the space of all virtual welfare maximizing auctions: For each player i, pick a monotone function φ̂i (vi ) ∈ [−1, 1] and allocate to the player with the highest non-negative virtual value, charging him the lowest value 6 he could have bid and still win the item. In this case, we will first coarsen the space of all possible auctions. In particular, we will consider the class of t-level auctions of [7]. In this class, we constrain the value functions φ̂i (vi ) to only take values in the discrete ǫ grid in [0, 1]. We will call this class Hǫ . An equivalent representation of these auctions is by saying that for each player i, we define a vector i = 1, with s = 1/ǫ. The index of a player is the largest of thresholds 0 = θ0i ≤ θ1i ≤ . . . ≤ θsi ≤ θs+1 j for which vi ≥ θj . Then we allocate the item to the player with the highest index (breaking ties lexicographically) and charge the minimum value he has to bid to continue to win. Observe that on any sample S of valuation vectors, it is always weakly better to place the thresholds θji on one of the values in the set S. Any other threshold is weakly dominated, as it does not change the allocation. Thus for any subset T of a set S of size m, we have that the thresholds of each player i will take one of the values of player i that appears in set S. We have 1/ǫ thresholds for each player, hence m1/ǫ combinations of thresholds for each player and mn/ǫ combinations of thresholds for all players. Thus τ̂H (m) ≤ mn/ǫ . This yields: r 2n log(2m) (26) ES [RD (hS )] ≥ sup RD (h) − ǫ·m h∈Hǫ Moreover, by [7] we also have that: (27) sup RD (h) ≥ sup RD (h) − ǫ h∈Hǫ Picking, ǫ =   2n log(2m) 1/3 , m h∈H we get:  2n log(2m) ES [RD (hS )] ≥ sup RD (h) − 2 m h∈H   Equivalently, the sample complexity is mH (ǫ) = O n log(1/ǫ) . 3 ǫ 1/3 (28) k items, n bidders, additive valuations, grand bundle pricing. If the reserve price was anonymous, then the reserve price output by ERM on any subset of a sample S of size m, will take the value of one of the m total values for the items of the buyers in S. So τ̂H (m) = m · n. If the reserve price was not anonymous, then for each buyer ERM will  pick one  of the m total item values, n log(1/ǫ) n so τ̂H (m) ≤ m . Thus the sample complexity is mH (ǫ) = O . ǫ2 k items, n bidders, additive valuations, item prices. If reserve prices are anonymous, then each reserve price on item j computed by ERM on any subset of a sample S of size m, will take the value of one of the player’s values for item j, i.e. n · m. So τ̂H (m) = (n · m)k . If reserve prices are not anonymous, then the reserve price on item j for player i will take the value of one   of the player’s n·k . values for the item. So τ̂H (m) ≤ m . Thus the sample complexity is mH (ǫ) = O nk log(1/ǫ) ǫ2 k items, n bidders, additive valuations, best of grand bundle pricing and item pricing. ERM on the combination will take values on any subset of a sample S of size m, that is at most the product of the values of each of the classes (bundle or item pricing). Thus, for anonymous pricing: τ̂H (m) = (m · n)k+1 pricing: τ̂H (m) ≤ mn(k+1) . Thus the sample  and for non-anonymous  complexity is mH (ǫ) = O n(k+1)ǫlog(1/ǫ) . 2 7 In the case of a single bidder, we know that the best of bundle pricing or item pricing is a 1/8 approximation to the overall best truthful mechanism for the true distribution of values, assuming values for each item are drawn independently. Thus in the latter case we have: r 2(k + 1) log(2m) 1 ES [RD (hS )] ≥ sup RD (h) − (29) 6 h∈H m where H is the class of all truthful mechanisms. Comparison with [8]. The latter three applications were analyzed by [8], via the notion of the log(1/ǫ) pseudo-dimension, but their results lead to sample complexity bounds of O( nk log(nk) ). Thus ǫ2 the above simpler analysis removes the extra log factor on the dependence. References [1] Maria-Florina F Balcan, Tuomas Sandholm, and Ellen Vitercik. Sample complexity of automated mechanism design. In Advances in Neural Information Processing Systems, pages 2083–2091, 2016. [2] Richard Cole and Tim Roughgarden. The sample complexity of revenue maximization. In 46th, pages 243–252. ACM, 2014. [3] Nikhil R. Devanur, Zhiyi Huang, and Christos-Alexandros Psomas. The sample complexity of auctions with side information. In Proceedings of the Forty-eighth Annual ACM Symposium on Theory of Computing, STOC ’16, pages 426–439, New York, NY, USA, 2016. ACM. [4] Yannai A. Gonczarowski and Noam Nisan. Efficient empirical revenue maximization in singleparameter auction environments. CoRR, abs/1610.09976, 2016. [5] Jason D. Hartline and Tim Roughgarden. Simple versus optimal mechanisms. In Proceedings of the 10th ACM Conference on Electronic Commerce, EC ’09, pages 225–234, New York, NY, USA, 2009. ACM. [6] Nick Littlestone. Learning quickly when irrelevant attributes abound: A new linear-threshold algorithm. Machine learning, 2(4):285–318, 1988. [7] Jamie Morgenstern and Tim Roughgarden. The pseudo-dimension of near-optimal auctions. In Proceedings of the 28th International Conference on Neural Information Processing Systems, NIPS’15, pages 136–144, Cambridge, MA, USA, 2015. MIT Press. [8] Jamie Morgenstern and Tim Roughgarden. Learning simple auctions. In COLT 2016, 2016. [9] Roger B Myerson. Optimal auction design. Mathematics of operations research, 6(1):58–73, 1981. [10] D. Pollard. Convergence of Stochastic Processes. Springer Series in Statistics. 2011. [11] Tim Roughgarden and Okke Schrijvers. Ironing in the dark. In Proceedings of the 2016 ACM Conference on Economics and Computation, EC ’16, pages 1–18, New York, NY, USA, 2016. ACM. 8 [12] S. Shalev-Shwartz and S. Ben-David. Understanding Machine Learning: From Theory to Algorithms. Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, 2014. 9
10math.ST
arXiv:1206.4812v2 [q-bio.NC] 11 Jun 2013 1 A biological gradient descent for prediction through a combination of STDP and homeostatic plasticity. Mathieu N. Galtier1 , Gilles Wainrib2 1 School of Engineering and Science, Jacobs University Bremen gGmbH, College Ring 1, 28759 Bremen, Germany 2 Laboratoire Analyse Géométrie et Applications, Université Paris 13, 99 avenue Jean-Baptiste Clément, Villetaneuse, France Abstract Identifying, formalizing and combining biological mechanisms which implement known brain functions, such as prediction, is a main aspect of current research in theoretical neuroscience. In this letter, the mechanisms of Spike Timing Dependent Plasticity (STDP) and homeostatic plasticity, combined in an original mathematical formalism, are shown to shape recurrent neural networks into predictors. Following a rigorous mathematical treatment, we prove that they implement the online gradient descent of a distance between the network activity and its stimuli. The convergence to an equilibrium, where the network can spontaneously reproduce or predict its stimuli, does not suffer from bifurcation issues usually encountered in learning in recurrent neural networks. 2 1 Introduction One of the main functions of the brain is prediction [Bar, 2009]. This function is generally thought to rely on the idea that cortical regions learn a model of the world and simulate it to generate predictions of future events [Gilbert and Wilson, 2007, Schacter et al., 2008]. Several recent experimental findings support this view, showing in particular that the spontaneous neuronal activity after presentation of a stimulus is correlated with the evoked activity [Kenet et al., 2003], and that this similarity increases along development and learning [Berkes et al., 2011]. Moreover, at the scale of neuronal networks, prediction can also be seen as a general organization principle : it has been argued [Rao et al., 1999, Clark, 2012] that the brain would contain a hierarchy of predictive units which are able to predict their direct stimuli or inputs, through the modification of the synaptic connections. Understanding the mechanisms and principles underlying this prediction function is a key challenge, not only from a neuroscience perspective but also for machine learning where the number of applications requiring prediction is significant. In the field of machine learning, recurrent neural networks have been successfully proposed as candidates for these predictive units [Williams and Zipser, 1989, Williams and Zipser, 1995, Pearlmutter, 1995, Jaeger and Haas, 2004, Sussillo and Abbott, 2009]. In most cases, these algorithms aim at creating a neural network that autonomously and sponta- 3 neously reproduces a given time series. The Bayesian approach is also useful in designing predictors [Dayan et al., 1995, George and Hawkins, 2009] and has also been mapped to neural networks [Deneve, 2008, Friston, 2010, Bitzer and Kiebel, 2012]. However, apart from a rough conceptual equivalence, this paper is devoid of Bayesian terminology and directly focuses on neural networks. In this framework, prediction is often achieved by minimizing a distance between the activity of the neural network and the target time series. Although neural networks were originally studied in a feedforward framework [Rosenblatt, 1958], the most efficient networks for prediction shall involve recurrent connections giving the network some memory properties. So called gradient descent algorithms in recurrent neural network [Mandic and Chambers, 2001] involve the learning of the entire connectivity matrix. They minimize the distance between a target trajectory and the trajectory of the network. On the other hand, researchers in the field of reservoir computing [Lukosevicius and Jaeger, 2009] only optimize some connections in the network whereas the others are randomly drawn and fixed. To do prediction, they minimize the “one-step ahead” error corresponding to the distance between the network predictions and the next time step of the target time series. Thus, these algorithms are derived to optimize an accuracy criterion, with learning rules generally favoring prediction efficiency over biological meaning. In the field of neuroscience, these last years have seen many discoveries in the study of synaptic plasticity, in particular providing experimental 4 evidences and possible mechanisms for two major concepts in the current biology of learning. The first is the discovery of spike-timing dependent plasticity (STDP) [Markram et al., 1997, Bi and Poo, 1998, Sjöström and Gerstner, 2010]. Caporale and Dan, 2008, It is a temporally asymmetric form of Hebbian learning induced by temporal correlations between the spikes of pre- and post-synaptic neurons. The general principle is that if a neuron fires before (resp. after) another then the strength of the connection from the former to the latter will be increased (resp. decreased). The summation of all these modification leads to the strengthening of causality links between neurons. Although STDP is originally based on spiking network, it has several extensions or analogs for ratebased networks (those used in machine learning) [Kempter et al., 1999, Izhikevich and Desai, 2003, Pfister and Gerstner, 2006]. The functional role of STDP is still discussed, for instance: reducing latency [Song et al., 2000], optimizing information transfer [Hennequin et al., 2010], invariant recognition [Sprekeler et al., 2007] [Gerstner et al., 1993, and even learning Rao and Sejnowski, 2001, temporal patterns Yoshioka et al., 2007] (non exhaustive list). Second, the notion of homeostatic plasticity [Miller, 1996, Abbott and Nelson, 2000, Turrigiano and Nelson, 2004], including mechanisms such as synaptic scaling, has proved to be important to moderate the growth of connection strength. In contrast to previously theory-motivated 5 normalization of the connectivity [Miller and MacKay, 1994, Oja, 1982], there is a need of a biologically plausible means to prevent the connectivity from exploding under the influence of shaping mechanisms like Hebbian learning or STDP. From a theoretical viewpoint, STDP and homeostatic plasticity are almost always studied independently. An extensive bottom-up numerical analysis of the combination of such learning mechanisms, done by Triesch and colleagues, has already lead to biologically relevant behaviors [Lazar et al., 2007, Lazar et al., 2009, Zheng et al., 2013]. However, the mathematical understanding of their combination in terms of functionality still stands as an undocumented challenge to researchers. This letter aims at bridging the gap between biological mechanisms and machine learning regarding the issue of predictive neural networks. We rigorously show how a biologically-inspired learning rule, made of an original combination of STDP mechanism and homeostatic plasticity, mimics the gradient descent of a distance between the activity of the neural network and its direct stimuli. This results in capturing the underlying dynamical behavior of the stimuli into a recurrent neural network and therefore in designing a biologically plausible predictive network. The letter is organized as follows. In section 2, we construct a theoretical learning rule designed for prediction, based on an appropriate gradient descent method. Then, in section 3, we introduce a biologically inspired learning rule, combining the concepts of STDP and homeostatic plasticity, 6 whose purpose is to mimic the theoretical learning rule. We discuss the various biological mechanisms which may be involved in this new learning rule. Finally in section 4, we provide a mathematical justification of the link between the theoretical and the biologically inspired learning rule, based on the key idea that STDP can be seen as a differential operator. 2 Theoretical learning rule for prediction In a machine learning approach, we introduce here a procedure to design a neural network which autonomously replays a target time series. 2.1 Set-up We consider a recurrent neural network made of n neurons which is exposed to a time dependent input u(t) ∈ Rn of the same dimension. Our aim is to construct a learning rule which will enable the network to reproduce the input’s behavior. Our approach is focused on learning the underlying dynamics of the input. Therefore, we assume that u is generated by an arbitrary dynamical system: u̇ = ξ(u) (1) with ξ a smooth vector field from Rn to Rn . We also assume that the trajectory of the inputs or stimuli is τ -periodic. The key mathematical assumptions 7 on the input u is in fact ergodicity, but we restrict our study to periodic inputs for simplicity. In particular, periodic inputs can be constructed by the repetition of a given finite-time sample. Although the following method virtually works with any network equations, we focus on a neural network composed of n neurons and governed by v̇ = −lv + W.S(v) (2) where v ∈ Rn is a vector representing neuronal activity, W ∈ Rn×n is the connectivity matrix, l ∈ R+ is a decay constant and S is an entry-wise sigmoid function. 2.2 Gradient descent learning rule The idea behind our learning rule is to find the best connectivity matrix W which will minimize a distance between the two functions ξ(u) and −lu + W.S(u). In this perspective, we define the following quantity: 1 Hu := 2 Z τ 0   2 − lu(t) + W.S u(t) − ξ u(t) dt (3) When Hu = 0, the vector fields of systems (1) and (2) are equal on the trajectories of the inputs. This quantity may be viewed as a distance between the two vector fields defining the dynamics of the inputs and of the neuronal network along the trajectories of the inputs. One shall notice that it is similar to classical gradient methods [Pearlmutter, 1995, Williams and Zipser, 1995, 8 Mandic and Chambers, 2001], except that the norms are applied to the flows of inputs and neural network instead of their activity. Thus, it focuses more specifically on the dynamical structure of the inputs. Moreover, it is possible to show, using Girsanov’s Theorem, that this definition coincides with the concept of relative entropy between two diffusion processes, namely the ones obtained by adding a standard Gaussian perturbation to both equations. Therefore, we will call Hu the relative entropy. In order to capture the dynamics of the inputs into the network, it is natural to look for a learning rule minimizing this quantity. To this end, we consider the gradient of this measure with respect to the connectivity matrix: h i ′ ′ ′ ∇W Hu = − ξ(u) · S(u) + lu · S(u) − W.S(u) · S(u) where the component i, j of x.y′ ∈ Rn×n is {x · y′ }ij = Rτ 0 (4) xi (s)yj (s)ds for x, y functions from [0, τ [ to Rn . Equivalently, these functions can be seen as semi continuous matrices in Rn×[0,τ ] and x′ is the transpose of x. Thus, an algorithm implementing the gradient descent Ẇ = −∇W Hu is a good candidate to minimize the relative entropy between inputs and spontaneous activity. Since Hu is quadratic in W, it follows that W → Hu is a convex function, thus excluding situations with multiple local minima. Moreover, if S(u) · S(u)′ is invertible, one can compute directly the minimizing 9 connectivity as   −1 W∗ = ξ(u) · S(u)′ + lu · S(u)′ . S(u) · S(u)′ (5) Implementing a gradient descent based on equation (4) does not immediately lead to a biologically relevant mechanism. First, it requires a direct access to the inputs u, whereas synaptic plasticity mechanisms shall only rely on the network activity v. Second, it is a batch learning algorithm which requires an access to the entire history of the inputs. Third, it requires the ability to compute ξ(u). Therefore, we will see in section 3 how to overcome these issues combining biologically inspired synaptic plasticity mechanisms. 2.3 Example 1 0.8 0.6 0.4 0.2 0 Figure 1: Learning how to write the letter A. Time evolution of the input movie (top row) and of the network activity after learning (bottom row). Each pixel corresponds to a neuron. Parameters: Number of neurons n = 400; l = 1; S(x) = tanh(x). 10 In order to illustrate the idea that learning rule (4) enables the network to learn dynamical features of the input, we have constructed the following experiment. We present to the network an input movie displaying sequentially the writing of the letter A (Figure 1 - top row). To each pixel we assign one neuron, so that the input and the network share the same dimension. This input movie is repeated periodically until the connectivity matrix of the network, evolving under rule (4), stabilizes. Then the input is turned off and we set the initial state of the network to a priming image showing the bottom left part of letter A. The network evolving without input strikingly reproduces the dynamical writing of letter A as displayed in Figure 1. Thus, with this example we have illustrated the ability of the learning rule we have derived from a theoretical principle to capture a dynamic input into a connectivity matrix. 3 A biological learning rule We now introduce a biological learning rule made of the combination of STDP and homeostatic plasticity. Later in section 4, we show that this learning rule minimizes Hu . Here, we first give a mathematical description of this learning rule and, second, relate the different terms to biological mechanisms. 11 3.1 Mathematical description Learning corresponds to a modification of the connectivity simultaneous to the network activity evolution. The result is a coupled system of equations. The learning rate ǫ is chosen to be small: ǫ ≪ 1, so that learning can be considered slow compared to the evolution of the activity. The full online learning system is           v̇ = −lv + W.S(v) + u X 1  − Wik S(v̄k )S(v̄j ) Ẇ = δ[v̄ , S(v̄ )]  ij i j  ǫ  | {z }  k   | {z } STDP   homeostatic plasticity (6) where v̄ = lv − W.S(v) ∗ gl and δ[x, y] = γ−l γ+l x(y ∗ gγ ) − (x ∗ gγ )y 2 2 (7) where the notation ∗ denotes the convolution operator. The function gc is defined as gc : t 7→ ce−ct H(t) with H the Heaviside function and for any positive number c as shown in the left picture of Figure 2. As illustrated in the right picture of Figure 2, the operator δ roughly corresponds to the classical STDP window [Bi and Poo, 1998] (taking into account a y-axis symmetry corresponding to the symmetric formalism we are using). The constant γ ∈ 12 R+ is a time constant corresponding to the width of the STDP window used for learning. Figure 2: (left) Plots of the function gc for c ∈ {1/2, 1, 2}. (right) Plot of the function ∆γ (t) + lΣγ (t) = γ+l g (t) − γ−l g (−t) 2 γ 2 γ for γ = 0.5 and l = 0.2. This function corresponds to the operator δ as shown in section 4.1.2. 3.2 3.2.1 Biological mechanisms An input estimate The variable v̄ can be seen as a spatio-temporal differential variable which approximates the inputs u. Although unsupervised learning rules are often algebraic combinations of element-wise functions applied to the activity of the network [Gerstner and Kistler, 2002], it is not precisely the case here. Indeed, learning is based on the variable v̄ which corresponds to the subtraction of the temporally integrated synaptic drive W.S(v) ∗ gl from the activity of the neurons lv. For each neuron, this variable takes into ac- 13 count the past of all the neurons which are then spatially averaged through the connectivity to be subtracted from the current activity. This gives a differential flavor to this variable which is reminiscent of former learning rules [Bienenstock et al., 1982, Sejnowski, 1977] for the temporal aspect and [Miller and MacKay, 1994] for the spatial aspect. Note that this variable is not strictly speaking local (i.e. the connection Wij needs the values of vk  to be updated), yet it is biologically plausible since the term W.S(v) i is accessible for neuron i on its dendritic tree, which is a form of locality in a broader sense. 3.2.2 An STDP mechanism The first term δ[v̄i , S(v̄j )] in (6) can be related to STDP. The antisymmetric part of this term is responsible for retrieving the drift ξ in equation (4). The symmetric part (corresponding to Hebbian learning) is responsible for retrieving the second term in (4). Thus, it captures the causality structure of the inputs which is a task generally attributed to STDP [Sjöström and Gerstner, 2010]. Beyond the simple similarity of functional role, we believe a simplification of this term may shed light on the deep link it has with STDP. The main difference between our setup and STDP is that the former is based on a rate-based dynamics, whereas the latter is based on a spiking dynamics. In a pure spike framework, i.e the activity is a sum of Diracs, the STDP can be seen as this simple learning rule Ẇij = δ[vi , vj ] = γ+l vi (vj 2 ∗ gγ ) − γ−l (vi 2 ∗ gγ ) vj . Indeed, the term 14 vi (vj ∗ gγ ) is non-null only when the post-synaptic neuron i is firing and then, via the factor vj ∗ gγ , it counts the number of preceding pre-synaptic spikes that might have caused i’s excitation and weight them by the decreasing exponential gγ . Thus, this term exactly accounts for the positive part of the STDP curve. The negative term −(vi ∗ gγ )vj takes the opposite perspective and accounts for the negative part of the STDP curve. A loose extension of this rule to the case where the activity is smoothly evolving leads to identifying the function δ to the STDP mechanism for rate-based networks [Galtier, 2012, Izhikevich and Desai, 2003]. 3.2.3 Homeostatic plasticity The second term − P k Wik S(v̄k )S(v̄j ) in (6) accounts for what is usu- ally presented as homeostatic plasticity mechanisms. The previous STDP term seems to be a powerful mechanism to shape the response of the network. However, there is a need of a regulatory process to prevent from uncontrolled growth of the network connectivity [Abbott and Nelson, 2000, Turrigiano and Nelson, 2004, Miller, 1996]. It has been argued that STDP could be self regulatory [Van Rossum et al., 2000, Song et al., 2000], but it is not the case in our framework and an explicit balancing mechanism is necessary to avoid the divergence of the system. This last term is the only one with a negative sign and is multiplicative with respect to the connectivity. Thus, according to [Abbott and Nelson, 2000], it is a reasonable candidate for homeostasis. It has been argued [Turrigiano et al., 1998, 15 Kim et al., 2012] that homeostatic plasticity might keep the relative synaptic weights by dividing the connectivity with a common scaling factor, theoretically preventing from a possible information loss. In con- trast to these ad hoc re-normalizations often introduced in other learning rules [Miller and MacKay, 1994, Oja, 1982], our relative entropy minimizing learning rule thus introduces naturally an original form of homeostatic plasticity. Although we have separated the description of the various terms in (6), our approach suggests that homeostasis may be seen, not necessarily as a scaling term, but as a constitutive part of a learning principle, deeply entangled [Turrigiano, 1999] with the other learning mechanisms. 3.3 Numerical application Although the focus of the paper is on theory, we introduce a simple numerical example to illustrate the predictive properties of the biological learning rule. More precisely, we investigate the question of retrieving the connectivity of a neural network based on the observation of the time series of its activity. This is an inverse problem which is a usual challenging topic in computational neuroscience [Friston et al., 2003, Galán, 2008, Potthast and beim Graben, 2009] since it may give access to large scale effective connectivities simply from the observation of a neuronal activity. Here we address it in an elementary framework. The network generating the activity patterns is referred as input network and evolves according to 16 u̇ = −l0 u + W0 .S(u). For this example, the network is made of n = 3 neurons and its connectivity W0 is shown in Figure 3.a). These parameters were chosen so that the activity is periodic as shown by the dashed curves in Figure 3.c). Then, we simulate the entire system (6) with a decay constant lnet and observe that its connectivity Wnet converges to W0 . As shown in the next section, it is necessary u ∗ gl ∗ gγ ≃ u in order to approximate accurately the input’s activity with the online learning rule (6). Given that the time constant of the inputs is governed by l0 , the previous approximation holds only if γ, lnet ≫ l0 . If this assumption is broken, e.g. lnet = l0 , then the final connectivity matrix is different from W0 , see the black dot-dashed curve in Figure 3.b). Indeed, in this case, the network only learns to replay the slow variation of the inputs. A method to recover the precise time course of the inputs consists in artificially changing the time constants at different steps of an algorithm described in the following. First, simulate the network equation (top equation in (6)) with a constant lnet ≫ l0 . Yet, the time constant in the learning equation (bottom equation in (6)) is to be kept at l0 , thus introducing a hybrid model. In this framework, the connectivity converges exactly to W0 as shown in the grey dashed curve in Figure 3.b). After learning, simulate the network equation with the learned connectivity and with a time constant switched back to l0 . This gives an activity as shown in the plain curves in Figure 3.c). 17 4 Link between theoretical and biological learning rules In this part, we show how the biological learning rule (6) implements the gradient descent based on equation (4). First, we introduce three technical results which are the mathematical cornerstones of the paper and then combine them to obtain the desired result. 4.1 Three technical results As mentioned previously, equation (4) is not biologically plausible for three main reasons: (i) it requires a direct access to the inputs u, whereas synaptic plasticity mechanisms shall only rely on the network activity v; (ii) it is a batch learning algorithm which requires an access to the entire history of the inputs; (iii) it requires the ability to compute ξ(u) (equal to the timederivative of the inputs according to equation (1)). On the contrary, the biological learning rule (6) does not have these problems. First, it uses an estimate of the inputs, noted v̄, which is based on the activity variable only. Second, it is an online learning rule, i.e. it takes input on the fly, and relies on a slow-fast mechanism to temporally average the variables. Third, it approximates the computation of ξ(u) with a function δ inspired from STDP convolution. In the following, we mathematically address these three points successively. 18 4.1.1 v̄ is an input estimate The online learning rule (6) is expressed by means of the activity of the neural network v governed by the top equation in (6). However, to be comparable to the gradient of the relative entropy (4), we first need to make explicit the dependency on the inputs u. Therefore, we show that the network dynamics induces a simple relation between v̄ and the inputs u: a simple computation in the Fourier domain shows that the convolution between the temporal operator d dt + lId and gl results in lId . Applying this result to the neural dynamics leads to reformulating the top equation in (6) as lv−W·S(v)∗gl = u ∗ gl . We recognize the definition of the variable v̄ (which was originally defined according to this relation) such that the network’s dynamics of the fast equation in (6) is equivalent to v̄ = u ∗ gl 4.1.2 (8) Temporal averaging of the learning rule To prove that (6) implements the gradient descent of the relative entropy, we need to use a time-scale separation assumption, enabling the input to reveal its dynamical structure through ergodicity. Indeed, the fact that learning is very slow compared to the activity v corresponds to the assumption ǫ ≪ 1. In this case, we can apply classical results of periodic averaging [Sanders and Verhulst, 1985] (see also [Galtier and Wainrib, 2012] in the context of neural networks) to show that the evolution of W is well- 19 approximated by   Ẇ = v̄ ∗ ∆γ + lv̄ ∗ Σγ − W.S(v̄) · S(v̄)′ where ∆γ : t 7→ γ 2  gγ (−t) − gγ (t) and Σγ : t 7→ gγ (−t)+gγ (t) . 2 (9) The right picture of Figure 2 shows a plot of the function ∆γ + lΣγ . 4.1.3 STDP as a differential operator Here, we prove the two following equalities [x ∗ Σγ ] · y′ = (x ∗ gγ ) · (y ∗ gγ )′ (10) [x ∗ ∆γ ] · y′ = (ẋ ∗ gγ ) · (y ∗ gγ )′ (11) and This second equation is the key mathematical mechanism that makes STDP a good approximation of the temporal derivative of the inputs. Both proofs consist in going in the Fourier domain, where convolutions are turned into multiplications. We use the unitary, ordinary frequency convention for the Fourier transform. Observe that the Fourier transform of gγ is ĝγ (ξ) = γ . γ+2iπξ And we define1 gγ′ : t 7→ gγ (−t) such that ∆γ = γ2 (gγ′ − gγ ) and gˆγ′ (ξ) = ĝγ (−ξ). 1 This notation is motivated by the following: the convolution with gγ can be written as a matrix multiplication with a continuous Toeplitz matrix RR×R whose component ts is gγ (t − s). In this framework, the convolution with gγ′ corresponds to the multiplication 20 1. Let us show that [x ∗ Σγ ] · y′ = (x ∗ gγ ) · (y ∗ gγ )′ We proceed in two steps: (a) Let us show that gγ +gγ′ 2 = gγ ∗ gγ′ The Fourier transform of the convolution gγ ∗ gγ′ is the product γ γ γ+2iπξ γ−2iπξ = γ2 . γ 2 +4π 2 ξ 2 From the usual Fourier tables we observe that the right hand side is the Fourier transform of t 7→ γ2 e−γ|t| . This immediately leads to the result. (b) Let us show that (x ∗ gγ′ ) · y′ = x · (y ∗ gγ )′ Compute {(x∗gγ′ )·y′ }ij = Z = Z ∞Z −∞ ∞ −∞ +∞ xi ∗gγ′  (s)yj (s)ds = Z ∞ −∞ Z +∞ xi (t)gγ′ (s−t)yj (s)dsdt −∞ xi (t)gγ (t − s)yj (s)dsdt = {x · (y ∗ gγ )′ }ij −∞ Using the result (a) and applying result (b) to x ∗ gγ and y leads to the result [x ∗ Σγ ] · y′ = (x ∗ gγ ) · (y ∗ gγ )′ . 2. To prove equation (11), let us first show that x ∗ ∆γ = ẋ ∗ gγ +gγ′ . 2 ˆ γ. The Fourier transform of the convolution x ∗ ∆γ is the product x̂ ∆ with the transpose of the previous Toeplitz operator. 21 Besides, γ 2ˆ γ 2γ ′ ∆γ = g\ − = 2iπξ 2 γ − gγ (ξ) = γ γ − 2iπξ γ + 2iπξ γ + 4π 2 ξ 2    2iπξ γ 2iπξ \ γ = = gγ′ + gγ (ξ) + γ γ + 2iπξ γ − 2iπξ γ ˆ (ξ) = x̂ 2iπξ, taking the inverse Fourier transform of Because dx dt ′ +g g[ g +g ′ x̂ 2iπξ γ 2 γ (ξ) gives the intermediary result x ∗ ∆γ = ẋ ∗ γ 2 γ . Using it and applying the first result to ẋ and y leads to equation (11). 4.2 Main result We prove here that the biological learning rule (6) implements the gradient descent based on (4). The temporally averaged version of the biological learning rule is given by (9). We simultaneously use equations (8) and (11) on this formula to show that the solution of the biological learning rule is well approximated by    ′ ′ Ẇ = ξ(u ∗ gl ) ∗ gγ · S(u ∗ gl ) ∗ gγ + l(u ∗ gl ∗ gγ ) · S(u ∗ gl ) ∗ gγ − W · S(u ∗ gl ) · S(u ∗ gl )′ If u is slow enough, i.e. u ∗ gl ∗ gγ ≃ u, then this equation is precisely the gradient descent of Hu . If u is too fast, then the network will only learn to predict the slow variations of the inputs. Some fast-varying information 22 is lost in the averaging process, mainly because the network equation in (6) acts as a relaxation equation which filters the activity. Note that this loss of information is not necessarily a problem for the brain, since it may be extracting and treating information at different time scales [Kiebel et al., 2008]. Actually, the choice of the parameter l specifies the time scale under which the inputs are observed. 4.3 Stability Both theoretical and biological learning rules are assured to make the connectivity converge to an equilibrium point whatever the initial condition. In particular, this method does not suffer from the bifurcation issues often encountered in recurrent neural network learning [Doya, 1992]. In most cases, problems arise when learning leads the network activity to a bifurcation. The bifurcation suddenly changes the value of the quantity being minimized and this intricate coupling leads to very slow convergence rates. The reason why this method has such an unproblematic converging property is because the relative entropy (as opposed to other energy functions traditionally used) is independent from the network activity v. Besides, for any network pattern v equation (8) ensures that v̄ is always equal to the convolved inputs. These two arguments break the pathologic coupling preventing from getting interesting convergence results. From a mathematical perspective, the Krasovskii-Lasalle invariance principle [Khalil and Grizzle, 1992] ensures that the theoretical learning rule 23 Ẇ = −∇W Hu converges to a equilibrium point. Indeed, the relative entropy acts as an energy or Lyapunov function. If S(u).S(u)′ is invertible then the equilibrium point is unique and defined by equation (5). If it is not invertible then the equilibrium depends on the initial condition. If the inputs are slow enough, it has been shown that the biological learning is well approximated by the theoretical gradient descent. Therefore, the former exhibits the same stable converging behavior as the latter. Thus, the biological learning rule (6) is stable. In practice, we have never encountered a diverging situation even when the inputs are not slow enough. 5 Discussion and conclusion We have shown that a biological learning rule shapes a network into a predictor of its stimuli. This learning rule is made of a combination of a STDP mechanism and homeostatic plasticity. After learning the network would spontaneously predict and replay the stimuli it has previously been exposed to. This was achieved by showing that this learning rule minimizes a quantity analogous to the relative entropy (or Kullback-Leibler divergence) between the stimuli and the network activity as for other well-known algorithms [Ackley et al., 1985, Hinton, 2009]. We believe this letter brings interesting arguments in the debate concerning the functional role of STDP. We have shown that the antisymmetric part of STDP can be seen as a differential operator. When its effect is moder- 24 ated by an appropriate scaling term, we argue that it could correspond to a generic mechanism shaping neural networks into predictive units. This idea is not new, but this letter may give it a stronger theoretical basis. This study also gives central importance to the time constants characterizing the network. Indeed, the fact the biological learning rule (6) implements a gradient descent is rigorously true for slow inputs. Inputs are slow if they are significantly slower than both the time window of the STDP and the decay constant of the network. This means that sub-networks in the brain could select the frequency of the information they are predicting. Given that the brain may process information at different time scales [Kiebel et al., 2008], this may be an interesting feature. Besides, note that the proposed biological learning rule (6) is partly characterized by the activity decay parameter l. This is surprising because it links the intrinsic dynamics of the neurons to the learning processes corresponding to the synapse. Therefore, it may provide a direction to experimentally check this theory: is the symmetric part of STDP (i.e. Hebbian learning) stronger between faster neurons? One of the characteristic features of this research is the combination of rate-based networks and the concept of spike timing dependent plasticity. Obviously, this made impossible to consider the rigorous definition of STDP. However, we have argued that the function δ in (7) is an alternative formulation which is equivalent to the others in the spiking framework and which can be trivially extended to analog networks. Besides, it does capture the functional mechanism of the STDP in the rate-based framework: when 25 the activation of a neuron precedes (resp. follows) the activation of another the strength of the synapse from the former to the latter is increased (resp. decreased). Finally, we believe the theory presented in this paper gives support to this rate-based STDP since it appears to fill a gap between machine learning and biology by implementing a differential operator. This approach can be applied to other forms of network equations than (2) such as the Wilson-Cowan or Kuramoto models, leading to different learning rules. In this perspective, learning can be seen as a projection of a given arbitrary dynamical system to a versatile neuronal network model, and the learning rule will depend on the chosen model. However, we shall remark that any network equation with an additive structure – intrinsic dynamics + communication with other neurons – as in (2) will lead to a similar structure for the learning rule, with terms that may share similar biological interpretations as developed above. A special case is the linear network v̇ = −lv + W.v for which various statistical methods to estimate the connectivity matrix have been applied e.g. in climate modeling [Penland and Sardeshmukh, 1995], gene regulatory networks [Yeung et al., 2002] and spontaneous neuronal activity [Galán, 2008]. In this simpler case, the biological learning rule in equaP tion (6) would be 1ǫ Ẇij = δ[v̄i , v̄j ]− k Wik v̄k v̄j with v̄ = lv−W.v∗gl . The method developed in this article can be used to extend the inverse modeling approach previously developed in the linear case to models with non-linear interactions. One of the main restrictions of this approach is that the dimensionality 26 of the stimuli and that of the network have to be identical. Therefore, as such, the accuracy of this biological mechanism does not match the state of the art machine learning algorithms.This is not necessarily a big issue since a high dimensional projections of the inputs may be used as preprocessing. From a biological viewpoint and taking the example of vision, this would correspond to the retino-cortical pathway which is not one to one and very redundant. But this limitation also puts forward the necessity to study a network containing hidden neurons in a similar fashion. Ongoing research is revealing that the mathematical formalism is well suited to extend this approach to the field of reservoir computing [Jaeger and Haas, 2004]. Acknowledgments The authors thank Herbert Jaeger for his helpful comments on the manuscript. MNG was partially funded by the Amarsi project (FP7-ICT #24833), the ERC advanced grant NerVi #227747, the région PACA, France and the IP project BrainScaleS #269921. References [Abbott and Nelson, 2000] Abbott, L. and Nelson, S. (2000). Synaptic plasticity: taming the beast. Nature neuroscience, 3:1178–1183. 27 [Ackley et al., 1985] Ackley, D., Hinton, G., and Sejnowski, T. (1985). A learning algorithm for boltzmann machines. Cognitive science, 9(1):147– 169. [Bar, 2009] Bar, M. (2009). Predictions: a universal principle in the operation of the human brain. Philosophical Transactions of the Royal Society B: Biological Sciences, 364(1521):1181–1182. [Berkes et al., 2011] Berkes, P., Orbán, G., Lengyel, M., and Fiser, J. (2011). Spontaneous cortical activity reveals hallmarks of an optimal internal model of the environment. Science, 331(6013):83. [Bi and Poo, 1998] Bi, G. and Poo, M. (1998). Synaptic modifications in cultured hippocampal neurons: dependence on spike timing, synaptic strength, and postsynaptic cell type. The Journal of Neuroscience, 18(24):10464–10472. [Bienenstock et al., 1982] Bienenstock, E., Cooper, L., and Munro, P. (1982). Theory for the development of neuron selectivity: orientation specificity and binocular interaction in visual cortex. The Journal of Neuroscience, 2(1):32–48. [Bitzer and Kiebel, 2012] Bitzer, S. and Kiebel, S. (2012). Recognizing recurrent neural networks (rrnn): Bayesian inference for recurrent neural networks. Biological cybernetics, pages 1–17. 28 [Caporale and Dan, 2008] Caporale, N. and Dan, Y. (2008). Spike timingdependent plasticity: a hebbian learning rule. Annu. Rev. Neurosci., 31:25–46. [Clark, 2012] Clark, A. (2012). Whatever next? predictive brains, situated agents, and the future of cognitive science. Behav. Brain Sci. [Dayan et al., 1995] Dayan, P., Hinton, G., Neal, R., and Zemel, R. (1995). The helmholtz machine. Neural computation, 7(5):889–904. [Deneve, 2008] Deneve, S. (2008). Bayesian spiking neurons i: inference. Neural computation, 20(1):91–117. [Doya, 1992] Doya, K. (1992). Bifurcations in the learning of recurrent neural networks. In Circuits and Systems, 1992. ISCAS’92. Proceedings., 1992 IEEE International Symposium on, volume 6, pages 2777–2780. IEEE. [Friston, 2010] Friston, K. (2010). The free-energy principle: a unified brain theory? Nature Reviews Neuroscience, 11(2):127–138. [Friston et al., 2003] Friston, K., Harrison, L., and Penny, W. (2003). Dynamic causal modelling. Neuroimage, 19(4):1273–1302. [Galán, 2008] Galán, R. (2008). On how network architecture determines the dominant patterns of spontaneous neural activity. PLoS One, 3(5):e2148. 29 [Galtier, 2012] Galtier, M. (2012). A mathematical approach to unsupervised learning in recurrent neural networks. PhD thesis, Mines Paristech / INRIA. [Galtier and Wainrib, 2012] Galtier, M. and Wainrib, G. (2012). Multiscale analysis of slow-fast neuronal learning models with noise. The Journal of Mathematical Neuroscience, 2(1):13. [George and Hawkins, 2009] George, D. and Hawkins, J. (2009). Towards a mathematical theory of cortical micro-circuits. PLoS computational biology, 5(10):e1000532. [Gerstner and Kistler, 2002] Gerstner, W. and Kistler, W. (2002). Spiking neuron models: Single neurons, populations, plasticity. Cambridge Univ Pr. [Gerstner et al., 1993] Gerstner, W., Ritz, R., and Van Hemmen, J. (1993). Why spikes? hebbian learning and retrieval of time-resolved excitation patterns. Biological cybernetics, 69(5):503–515. [Gilbert and Wilson, 2007] Gilbert, D. and Wilson, T. (2007). Prospection: experiencing the future. Science, 317(5843):1351–1354. [Hennequin et al., 2010] Hennequin, G., Gerstner, W., and Pfister, J. (2010). Stdp in adaptive neurons gives close-to-optimal information transmission. Frontiers in Computational Neuroscience, 4. 30 [Hinton, 2009] Hinton, G. E. (2009). Deep belief networks. Scholarpedia, 4(4):5947. [Izhikevich and Desai, 2003] Izhikevich, E. and Desai, N. (2003). Relating stdp to bcm. Neural Computation, 15(7):1511–1523. [Jaeger and Haas, 2004] Jaeger, H. and Haas, H. (2004). Harnessing nonlinearity: Predicting chaotic systems and saving energy in wireless communication. Science, 304(5667):78–80. [Kempter et al., 1999] Kempter, R., Gerstner, W., and Van Hemmen, J. (1999). Hebbian learning and spiking neurons. Physical Review E, 59(4):4498. [Kenet et al., 2003] Kenet, T., Bibitchkov, D., Tsodyks, M., Grinvald, A., and Arieli, A. (2003). Spontaneously emerging cortical representations of visual attributes. Nature, 425(6961):954–956. [Khalil and Grizzle, 1992] Khalil, H. and Grizzle, J. (1992). Nonlinear systems. Macmillan Publishing Company New York. [Kiebel et al., 2008] Kiebel, S., Daunizeau, J., and Friston, K. (2008). A hierarchy of time-scales and the brain. PLoS computational biology, 4(11):e1000209. [Kim et al., 2012] Kim, J., Tsien, R., and Alger, B. (2012). An improved test for detecting multiplicative homeostatic synaptic scaling. PloS one, 7(5):e37364. 31 [Lazar et al., 2007] Lazar, A., Pipa, G., and Triesch, J. (2007). Fading memory and time series prediction in recurrent networks with different forms of plasticity. Neural Networks, 20(3):312–322. [Lazar et al., 2009] Lazar, A., Pipa, G., and Triesch, J. (2009). Sorn: a self-organizing recurrent neural network. Frontiers in computational neuroscience, 3. [Lukosevicius and Jaeger, 2009] Lukosevicius, M. and Jaeger, H. (2009). Reservoir computing approaches to recurrent neural network training. Computer Science Review, 3(3):127–149. [Mandic and Chambers, 2001] Mandic, D. and Chambers, Recurrent neural networks for prediction: J. (2001). Learning algorithms, architectures and stability. John Wiley & Sons, Inc. [Markram et al., 1997] Markram, H., Lübke, J., Frotscher, M., and Sakmann, B. (1997). Regulation of synaptic efficacy by coincidence of postsynaptic aps and epsps. Science, 275(5297):213–215. [Miller, 1996] Miller, K. (1996). Synaptic economics: Competition and cooperation in correlation-based synaptic plasticity. Neuron, 17:371–374. [Miller and MacKay, 1994] Miller, K. and MacKay, D. (1994). The role of constraints in hebbian learning. Neural Computation, 6(1):100–126. [Oja, 1982] Oja, E. (1982). Simplified neuron model as a principal component analyzer. Journal of mathematical biology, 15(3):267–273. 32 [Pearlmutter, 1995] Pearlmutter, B. (1995). Gradient calculations for dynamic recurrent neural networks: A survey. Neural Networks, IEEE Transactions on, 6(5):1212–1228. [Penland and Sardeshmukh, 1995] Penland, C. and Sardeshmukh, P. (1995). The optimal growth of tropical sea surface temperature anomalies. Journal of climate, 8(8):1999–2024. [Pfister and Gerstner, 2006] Pfister, J. and Gerstner, W. (2006). Triplets of spikes in a model of spike timing-dependent plasticity. The Journal of neuroscience, 26(38):9673–9682. [Potthast and beim Graben, 2009] Potthast, R. and beim Graben, P. (2009). Inverse problems in neural field theory. SIAM Journal on Applied Dynamical Systems, 8:1405. [Rao et al., 1999] Rao, R., Ballard, D., et al. (1999). Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptivefield effects. Nature neuroscience, 2:79–87. [Rao and Sejnowski, 2001] Rao, R. and Sejnowski, T. (2001). Spike-timingdependent hebbian plasticity as temporal difference learning. Neural computation, 13(10):2221–2237. [Rosenblatt, 1958] Rosenblatt, F. (1958). The perceptron: a probabilistic model for information storage and organization in the brain. Psychological review, 65(6):386. 33 [Sanders and Verhulst, 1985] Sanders, J. and Verhulst, F. (1985). Averaging methods in nonlinear dynamical systems, volume 59. Springer. [Schacter et al., 2008] Schacter, D., Addis, D., and Buckner, R. (2008). Episodic simulation of future events. Annals of the New York Academy of Sciences, 1124(1):39–60. [Sejnowski, 1977] Sejnowski, T. (1977). Statistical constraints on synaptic plasticity. Journal of theoretical biology, 69(2):385. [Sjöström and Gerstner, 2010] Sjöström, J. and Gerstner, W. (2010). Spiketiming dependent plasticity. 5(2):1362. [Song et al., 2000] Song, S., Miller, K., and Abbott, L. (2000). Competitive hebbian learning through spike-timing-dependent synaptic plasticity. Nature neuroscience, 3:919–926. [Sprekeler et al., 2007] Sprekeler, H., Michaelis, C., and Wiskott, L. (2007). Slowness: An objective for spike-timing–dependent plasticity? PLoS Computational Biology, 3(6):e112. [Sussillo and Abbott, 2009] Sussillo, D. and Abbott, L. (2009). Generating coherent patterns of activity from chaotic neural networks. Neuron, 63(4):544–557. [Turrigiano, 1999] Turrigiano, G. (1999). Homeostatic plasticity in neuronal networks: the more things change, the more they stay the same. Trends in neurosciences, 22(5):221–227. 34 [Turrigiano et al., 1998] Turrigiano, G., Leslie, K., Desai, N., Rutherford, L., and Nelson, S. (1998). Activity-dependent scaling of quantal amplitude in neocortical neurons. NATURE, 391:893. [Turrigiano and Nelson, 2004] Turrigiano, G. and Nelson, S. (2004). Homeostatic plasticity in the developing nervous system. Nature Reviews Neuroscience, 5(2):97–107. [Van Rossum et al., 2000] Van Rossum, M., Bi, G., and Turrigiano, G. (2000). Stable hebbian learning from spike timing-dependent plasticity. The Journal of Neuroscience, 20(23):8812–8821. [Williams and Zipser, 1989] Williams, R. and Zipser, D. (1989). A learning algorithm for continually running fully recurrent neural networks. Neural computation, 1(2):270–280. [Williams and Zipser, 1995] Williams, R. and Zipser, D. (1995). Gradientbased learning algorithms for recurrent networks and their computational complexity. Back-propagation: Theory, architectures and applications, pages 433–486. [Yeung et al., 2002] Yeung, M., Tegnér, J., and Collins, J. (2002). Reverse engineering gene networks using singular value decomposition and robust regression. Proceedings of the National Academy of Sciences, 99(9):6163. 35 [Yoshioka et al., 2007] Yoshioka, M., Scarpetta, S., and Marinaro, M. (2007). Spatiotemporal learning in analog neural networks using spike-timingdependent synaptic plasticity. Physical Review E, 75(5):051917. [Zheng et al., 2013] Zheng, P., Dimitrakakis, C., and Triesch, J. (2013). Network self-organization explains the statistics and dynamics of synaptic connection strengths in cortex. PLoS Computational Biology, 9(1). 36 1 -5 -2 3 5 -1 -5 -2 b) error a) 1 time activity c) 2 0 0 time 100 Figure 3: Retrieving the connectivity a) Connectivity matrix W0 of the input network. b) Evolution of the difference between current connectivity and input connectivity through learning. The black dot-dashed curve corresponds to the online learning rule (6) in the homogeneous case, i.e. l = lnet = l0 in both equations in (6). The grey dashed curve corresponds to the online learning system (6) in the hybrid framework, i.e. l = l0 for the learning equation and l = lnet ≫ l0 for the network equation. For this simulation we chose lnet = 50. The black plain curve (superposed to the grey dashed curve) corresponds to the batch relative entropy minimization (4). c) The dashed curves correspond to the activity of the inputs. It is a three dimensional input (i.e. n = 3) and the three different grey levels correspond to the different dimensions. The plain curves correspond to the simulation of the network (top equation in (6)) post learning, in the hybrid framework, and without inputs. The parameters for these simulations are l0 = 1, ǫ = 0.01 and γ = 100.
9cs.NE
arXiv:1211.5318v1 [math.AC] 22 Nov 2012 BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS LE VAN DINH AND TIM RÖMER A BSTRACT. We study Stanley-Reisner ideals of broken circuits complexes and characterize those ones admitting a linear resolution or being complete intersections. These results will then be used to characterize arrangements whose Orlik-Terao ideal has the same properties. As an application, we improve a result of Wilf on upper bounds for the coefficients of the chromatic polynomial of a maximal planar graph. We also show that for an ordered matroid with disjoint minimal broken circuits, the supersolvability of the matroid is equivalent to the Koszulness of its Orlik-Solomon algebra. 1. I NTRODUCTION Let V be a vector space of dimension r over a field K. Denote by V ∗ the dual space of V . Let A = {H1 , . . . , Hn } be an essential central hyperplane arrangement in V . Then the underlying matroid M(A ) of A hasSrank r and there are linear forms αi ∈ V ∗ such that ker αi = Hi for i = 1, . . . , n. Let X = V \ ni=1 Hi be the complement of the hyperplanes. It is well-known that when K = C the cohomology ring H . (X , Z) of X depends only on the matroid M(A ): H . (X , Z) is isomorphic as a graded C-algebra to the Orlik-Solomon algebra A(A ) of A ; see [22, Theorem 5.2]. Here the Orlik-Solomon algebra A(A ) is defined as the quotient of the standard graded exterior algebra E = Zhe1 , . . . , en i by the Orlik-Solomon ideal J(A ) of A which is generated by all elements of the form m ∂ ei1 ...im = ∑ (−1)t−1 ei1 · · · ebit · · · eim , t=1 where {Hi1 , . . . , Him } is a dependent subset of A , i.e., αi1 , . . . , αim are linearly dependent. Since their appearance in [22], the Orlik-Solomon algebra has been proved to be a very important algebraic object associated to an arrangement and it has been studied intensively; see, e.g., [3, 15, 21, 23, 32, 39] for details. The Orlik-Terao algebra of A , which was first introduced in [24], is a commutative analog of the Orlik-Solomon algebra. For our purposes we follow the exposition of Schenck-Tohaneanu [33]. Let S = K[x1 , . . . , xn ] be the polynomial ring in n variables over K (n is the number of hyperplanes of A ). Define a K-linear map ϕ : S1 = n M Kxi → V ∗ , xi 7→ αi for i = 1, . . . , n. i=1 We call the kernel of this map the relation space and denote it by F(A ). Elements of F(A ) are called relations. Observe that relations come from dependencies among hyperplanes in A : If m at αit = 0, then {Hi1 , . . . , Him } is a dependent subset of A and at ∈ K are coefficients such that ∑t=1 m r = ∑t=1 at xit is a relation. Mathematics Subject Classification (2010): 05E40, 13C40, 13D02, 13F55, 52B40, 52C35. Key words and phrases: broken circuit complex, complete intersection, hyperplane arrangement, matroid, Orlik-Terao algebra, resolution. 1 2 LE VAN DINH AND TIM RÖMER m at xit with at 6= 0 for all t = 1, . . . , m. Definition 1.1. For each relation r ∈ F(A ), we write r = ∑t=1 Let m ∂ (r) = ∑ at (xi1 · · · xbit · · · xim ) ∈ S. t=1 Then I(A ) = (∂ (r) : r ∈ F(A )) is the Orlik-Terao ideal, and C(A ) = S/I(A ) is the Orlik-Terao algebra of the arrangement A . From the similarity between the Orlik-Solomon algebra and the Orlik-Terao algebra it is natural to hope that the Orlik-Terao algebra also encodes useful information about the arrangement (in some sense the Orlik-Terao algebra seems to see “more” because it records the “weights” of the dependencies among the hyperplanes). In fact, Orlik-Terao [24] proved, when K = R, that the dimension of the artinian Orlik-Terao algebra (i.e., the quotient of C(A ) by the ideal (x21 , . . . , x2n )) is equal to the number of connected components of the complement X of the hyperplanes. Then Terao [35] computed the Hilbert series of C(A ) via the Poincaré polynomial of A (see Proposition 2.4). In [33], Schenck-Tohaneanu raised a new interest in the Orlik-Terao algebra by giving a characterization of the 2-formality of A in terms of the quadratic component of its Orlik-Terao ideal. See also the survey of Schenck [31] for other results and problems concerning the OrlikTerao algebra. In this paper we are interested in Orlik-Terao algebras with extremal properties like, e.g., having a linear resolution or being complete intersections. We give characterizations for arrangements whose Orlik-Terao algebra has one of these two properties. It turns out that these properties of the Orlik-Terao algebra are combinatorial, in the sense that they only depend on the underlying matroid of the arrangement. Our approach is based on a closed connection between the Orlik-Terao ideal and the StanleyReisner ideal of the broken circuit complex of the underlying matroid of the arrangement which was in particular studied in [29]: the latter one is the initial ideal of the former one (see Theorem 2.3). Normally, a property which holds for an ideal need not hold for its initial ideal and vice versa. Fortunately, this is the case for the Orlik-Terao ideal and the two properties we are interested in (see Corollary 3.2 and Theorem 4.16). Thus our strategy is as follows: We first consider StanleyReisner ideals of the broken circuit complexes of simple matroids and characterize those admitting a linear resolution or being complete intersections (see Theorem 3.3, Theorem 4.1). These results will then be applied to yield characterizations of arrangements whose Orlik-Terao ideal having the same properties (see Theorem 3.5, Theorem 4.16). Our results have several interesting consequences. For instance, it is shown in Corollary 4.8 that for a triangulation of a simple polygon, its cycle matroid, with respect to a suitable ordering of the edges, has pairwise disjoint minimal broken circuits. Whereas Theorem 4.12 is an improvement of Wilf’s upper bounds on the coefficients of the chromatic polynomial of a maximal planar graph in [37]. For matroids whose Stanley-Reisner ideal of the broken circuit complex is a complete intersection, we compute the Poincaré polynomials of their Orlik-Solomon algebras and verify in Theorem 4.9 the following conjecture which was first studied in [34]: Conjecture 1.2. A matroid (an arrangement) is supersolvable if and only if its Orlik-Solomon algebra is Koszul. A similar result for arrangements whose Orlik-Terao algebra is a complete intersection will then be derived in Corollary 4.18. Note that up to now, the above conjecture has been proved for hypersolvable arrangements and graphic arrangements; see [19], [32]. Note also that Denham, Garrousian and Tohaneanu have recently studied Orlik-Terao algebras which are quadratic complete intersections with a different method and they have independently obtained a result similar to Corollary 4.18; see [13, Corollary 5.12]. BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 3 Before going into details, let us explain how this paper is organized. In Section 2, we recall some notions and facts concerning broken circuit complexes and hyperplane arrangements. Section 3 is divided into two parts. We first characterize simple matroids whose Stanley-Reisner ideal of the broken circuit complex admits a linear resolution. Characterizations of arrangements whose OrlikTerao ideal has the same property will be given thereafter. Note that similar characterizations for matroids and hyperplane arrangements whose Orlik-Solomon ideal admits a linear resolution were obtained before in [15] and [21]. Section 4 also contains two parts. In the first part, after giving characterizations of simple matroids whose Stanley-Reisner ideal of the broken circuit complex is a complete intersection, we prove that Conjecture 1.2 holds for those matroids. Apart from the applications to graph theory mentioned above, we also show that for the Stanley-Reisner ideal of a broken circuit complex of codimension 3, the Gorensteiness implies the complete intersection property (Proposition 4.13). In the second part, we characterize arrangements whose Orlik-Terao ideal is a complete intersection and verify again Conjecture 1.2 for those arrangements. 2. P RELIMINARIES In this section we review some notions and results from the theory of matroids and hyperplane arrangements which will be used throughout this paper. For unexplained terms and further details we refer to [3], [23], [26] . Let us first recall the notion of matroid. A matroid M on the ground set Γ is a collection I of subsets of Γ satisfying the following conditions: (i) 0/ ∈ I; (ii) If I ∈ I and I ′ ⊆ I, then I ′ ∈ I; (iii) If I, I ′ ∈ I and |I ′ | < |I|, then there is an element i ∈ I − I ′ such that I ′ ∪ {i} ∈ I. The members of I are called independent sets. All the maximal independent sets of M have the same cardinality, we call this cardinality the rank of M. Dependent sets are subsets of Γ that are not in I. Minimal dependent sets are called circuits. The matroid M is simple if each circuit has cardinality at least 3. Denote by C(M) the set of all circuits of M. Clearly, C(M) determines M: I consists of subsets of Γ that do not contain any member of C(M). We will need the following elimination theorem for circuits. A more general version of this result can be found in [2, Theorem 3]. Theorem 2.1. Let M be a matroid on Γ and let C1 , . . . ,Cm be circuits of M. Assume that Ci * [ Cj for all i = 2, . . . , m. j<i Then for each subset B of Γ with |B| = m − 1, there exists a circuit C of M such that C⊆ m [ C j − B. j=1 For two matroids M1 and M2 on disjoint ground set Γ1 and Γ2 , we define their direct sum M1 ⊕ M2 to be the matroid on the ground set Γ1 ∪ Γ2 whose independent sets are the unions of an independent set of M1 and an independent set of M2 . In other words, the circuits of M1 ⊕ M2 are those of M1 and those of M2 , i.e., C(M1 ⊕ M2 ) = C(M1 ) ∪ C(M2 ). Example 2.2. (i) Let m ≤ n be non-negative integers and let Γ be an n-element set. The uniform matroid Um,n on Γ is the matroid whose the independent sets are the subsets of Γ of cardinality at most m. This matroid has rank m and its circuits are the (m + 1)-element subsets of Γ. For m ≥ 2, Um,n is simple. When m = n, the matroid Un,n has no dependent sets and is called free. 4 LE VAN DINH AND TIM RÖMER (ii) Let A = {H1 , . . . , Hn } be a central hyperplane arrangement in a vector space V and let αi ∈ V ∗ be linear forms such that ker αi = Hi for i = 1, . . . , n. Then we can define a matroid M(A ) on the ground set A by taking the independent sets to be the independent subsets of A , i.e., the subsets {Hi1 , . . . , Him } such that αi1 , . . . , αim are linearly independent. We call M(A ) the underlying matroid of A . Clearly, this matroid is simple. In the following we will usually identify the ground set A with [n] := {1, . . . , n} and consider M(A ) as a matroid on [n]. It is apparent that uniform matroids and free matroids are underlying matroids of generic arrangements and Boolean arrangements, respectively. Moreover, if we have two arrangements A1 and A2 in vector spaces V1 and V2 , then M(A1 × A2 ) = M(A1 ) ⊕ M(A2 ), where the product arrangement A1 × A2 is defined in the space V = V1 ⊕V2 as follows: A1 × A2 = {H1 ⊕V2 : H1 ∈ A1 } ∪ {V1 ⊕ H2 : H2 ∈ A2 }. (iii) Let G be a graph whose the edge set is E . Let C be the set of edge sets of cycles of G. Then C forms the set of circuits of a matroid M(G) on E . We call M(G) the cycle matroid (or graphic matroid) of G. This matroid is simple if G is a simple graph. Now assume that (M, ≺) is an ordered matroid of rank r on [n]. This means that the matroid M is given with a linear ordering ≺ of the ground set [n]. (Notice that ≺ need not be the ordinary ordering of [n].) For each circuit C of M, let min≺ (C) be the minimal element of C with respect to ≺. By abuse of notation, we sometimes also write min≺ (C) for the set {min≺ (C)}. Then bc≺ (C) = C − min≺ (C) is called a broken circuit. The broken circuit complex of (M, ≺), denote by BC≺ (M), is the collection of all subsets of [n] that do not contain a broken circuit. It is wellknown that BC≺ (M) is an (r − 1)-dimensional shellable complex; see [28] or also [3, 7.4]. Let K be a field and let I≺ (M) ⊂ S = K[x1 , . . . , xn ] be the Stanley-Reisner ideal of the broken circuit complex BC≺ (M). Then I≺ (M) is generated by all the monomials xbc≺ (C) := ∏i∈bc≺ (C) xi , where C ∈ C(M). From the shellability of BC≺ (M) it follows that the Stanley-Reisner ring S/I≺ (M) is a Cohen-Macaulay ring of dimension r. When M = M(A ) is the underlying matroid of a central arrangement A , Proudfoot and Speyer [29] showed that the Stanley-Reisner ring of BC≺ (M(A )) is a degeneration of the Orlik-Terao algebra of A for any choice of the ordering ≺ (here M(A ) is considered as a matroid on [n]; see Example 2.2(ii)). This relation between the two algebras, which plays an important role to our paper, is the spirit of the following theorem. Note that if C is a circuit of M(A ), then there exist nonzero scalars {ai : i ∈ C}, unique up to scaling, such that rC = ∑i∈C ai xi is a relation of the relation space F(A ). Recall from [29, Theorem 4]: Theorem 2.3. Let A be a central arrangement of n hyperplanes in a vector space V over a field K. Let M = M(A ) be the underlying matroid of A . Then the set {∂ (rC ) : C ∈ C(M)} is a universal Gröbner basis for the Orlik-Terao ideal I(A ) of A . Given any ordering ≺ of [n], with an arbitrary induced monomial order on K[x1 , . . . , xn ], we have in≺ (I(A )) = I≺ (M). In particular, it follows from the above theorem that Orlik-Terao ideals are Cohen-Macaulay. These ideals are also prime, as shown in [33, Proposition 2.1]. We now turn to necessary results concerning Orlik-Solomon algebras of matroids. Observe that the definition of the Orlik-Solomon algebra of an arrangement depends only on its underlying matroid and thus can be extended to the matroid level. Let M be a matroid on [n] and let E = Khe1 , . . . , en i be a standard graded exterior algebra over a field K (one can also replace K by any commutative ring). The Orlik-Solomon ideal of M is the ideal J(M) ⊂ E generated by ∂ eT for every dependent set T of M. Here, for a subset T = {i1 , . . . , im } of [n], we write eT = ei1 · · · eim and m (−1)t−1 eT −{it } . The Orlik-Solomon algebra A(M) of M is the quotient ring E/J(M). ∂ eT = ∑t=1 Assume now that (M, ≺) is an ordered simple matroid of rank r. Then we have a decomposition BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS Lr A(M) = of A(M): p=0 A p (M) as a graded K-vector space. π (A(M),t) = 5 Recall the definition of the Poincaré polynomial r ∑ dimK A p(M)t p . p=0 It is known that π (A(M),t) = (1) r ∑ f p−1t p, p=0 where f−1 = 1 and ( f0 , . . . , fr−1 ) is the f -vector of the broken circuit complex BC≺ (M); see [3, Corollary 7.10.3]. This leads to the following relation between π (A(M),t) and the Hilbert series of the Stanley-Reisner ring of BC≺ (M), from which a formula of Terao for the Hilbert series of theLOrlik-Terao algebra [35, Theorm 1.2] follows immediately. For a graded K-vector space W = p≥0 Wp , we denote HW (t) = ∑ p≥0 dimK Wp t p the Hilbert series of W. Proposition 2.4. Let (M, ≺) be an ordered simple matroid of rank r on [n]. Let I≺ (M) ⊂ S = K[x1 , . . . , xn ] be the Stanley-Reisner ideal of the broken circuit complex BC≺ (M). Then we have  t  . HS/I≺ (M) (t) = π A(M), 1−t In particular, if M = M(A ) is the underlying matroid of a central arrangement A then  t  . HC(A ) (t) = HS/I≺ (M) (t) = π A(M), 1−t Proof. Let ( f0 , . . . , fr−1 ) be the f -vector of the complex BC≺ (M) and let f−1 = 1. Then it is well i t ; see, e.g., [18, Proposition 6.2.1]. This, together with known that HS/I≺ (M) (t) = ∑rp=0 f p−1 1−t (1), implies the first assertion of the proposition. The second one follows from the first one and Theorem 2.3.  We conclude this section with a quick review of the chromatic polynomial of a graph. Let G be a simple graph on ℓ vertices. For each positive integer t, let χ (G,t) be the number of colorings of G with t colors. This function is a polynomial, called the chromatic polynomial of G. Let M(G) be the cycle matroid of G (see Example 2.2(iii)) and let ≺ be an ordering of the edge set of G. A classical theorem of Whitney [36] (see also the exposition of Wilf [37]) says that χ (G,t) = t ℓ − a1t ℓ−1 + a2t ℓ−2 − · · · + (−1)ℓ−1 aℓ−1t, where (a1 , . . . , ar ) = ( f0 , . . . , fr−1 ) is the f -vector of the broken circuit complex BC≺ (M(G)) (r is the rank of M(G)) and ai = 0 for i > r. By (1), one can rewrite χ (G,t) as follows χ (G,t) = r ∑ (−1) p f p−1t ℓ−p = t ℓ p=0 r ∑ f p−1(−t)−p = t ℓ π (A(M(G)), −t −1). p=0 Thus we have the well-known result (which is also a consequence of [3, Corollary 7.10.3]): Corollary 2.5. Let G be a simple graph on ℓ vertices. Then χ (G,t) = t ℓ π (A(M(G)), −t −1 ). 3. C OHEN -M ACAULAY IDEALS AND LINEAR RESOLUTIONS Orlik-Solomon ideals admitting a linear free resolution were first characterized by Eisenbud, Popescu and Yuzvinsky [15, Corollary 3.6]. This result was then extended to matroids by Kämpf and Römer [21, Theorem 6.11]. In this section, we characterize Orlik-Terao ideals which have a linear resolution. This will be done first for the Stanley-Reisner ideal of the broken circuit complex of a matroid. Our characterizations are similar to those in [15], [21]. 6 LE VAN DINH AND TIM RÖMER Recall that S = K[x1 , . . . , xn ] is a standard graded polynomial ring over a field K. Throughout this section, K is assume to be infinite. A finitely generated graded S-module W is said to have a p-linear resolution if the graded minimal free resolution of W is of the form 0 → S(−p − m)βm → · · · → S(−p − 1)β1 → S(−p)β0 → W → 0. The following characterization of Cohen-Macaulay ideals with linear resolution is essentially due to Cavaliere, Rossi and Valla [11, Proposition 2.1] (see also Renterı́a and Villarreal [30, Theorem 3.2]). We present here another proof for later use. L Proposition 3.1. Let I = j≥0 I j be a graded Cohen-Macaulay ideal in S of codimension h. Assume p is the smallest integer such that Ip 6= 0. Then the following conditions are equivalent: (i) I has a p-linear resolution; (ii) For any maximal S/I-regular sequence y1 , . . . , yn−h of linear forms in S, we have I¯ = m p , where I¯ and m are respectively the image of I and the maximal graded ideal m = (x1 , . . . , xn )in S/(y1 , . . . , yn−h ); p+h−1 (iii) H(I, p) = , where H(I, .) denotes the Hilbert function of I. p Proof. Note that there always exists a maximal S/I-regular sequence of linear forms in S as the coefficient field K is infinite; see, e.g., [9, Proposition 1.5.12]. (i)⇒(ii): By factoring out the sequence y1 , . . . , yn−h , it is possible to assume that S/I is an artinian ring. Then we have the following formula for the regularity of this ring: reg(S/I) = max{i : (S/I)i 6= 0}; see, e.g., [27, Theorem 18.4]. On the other hand, since I admits a p-linear resolution, it is wellknown that reg(S/I) = reg(I) − 1 = p − 1; see, e.g., [27, Proposition 18.2]. Thus we obtain max{i : (S/I)i 6= 0} = p − 1, which simply means that I = m p . (ii)⇒(i): Since m p has linear quotients, it admits a p-linear resolution; see, e.g., [18, Proposition ¯ and thus I, also admits a p-linear resolution. 8.2.1]. It follows that I, (ii)⇔(iii): Note that if a linear form y ∈ S is a nonzero divisor on S/I then L I I + (y) ∼ I j≥p I j = =L . = (y) (y) ∩ I yI j≥p yI j   In particular, H(I, p) = H I+(y) , p . Now since y1 , . . . , yn−h is an S/I-regular sequence and I¯ ⊆ m p (y) we have   p+h−1 p ¯ , H(I, p) = H(I, p) ≤ H(m , p) = p with equality if and only if I¯ = m p . Note that the last equality in the above equation follows from the fact that S/(y1 , . . . , yn−h ) is a polynomial ring in h variables over K.  Corollary 3.2. Let I be a graded ideal in S and ≺ a monomial order on S. Assume that in≺ (I) is Cohen-Macaulay. Then I has a linear resolution if and only if in≺ (I) has one. Proof. Note that I is also a Cohen-Macaulay ideal (see, e.g., [18, Corollary 3.3.5]). The corollary now follows from the equivalent of conditions (i) and (iii) in Proposition 3.1 since I and in≺ (I) have the same codimension and Hilbert function.  BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 7 3.1. Stanley-Reisner ideals of broken circuit complexes. Let (M, ≺) be an ordered simple matroid of rank r on [n]. Let I≺ (M) ⊂ S be the Stanley-Reisner ideal of the broken circuit complex BC≺ (M). Those matroids M whose I≺ (M) admits a linear resolution are characterized in the following theorem. For Orlik-Solomon ideals, a similar characterization can be found in [21, Theorem 6.11]. In fact, one can prove the theorem by utilizing [21, Theorem 6.11] and [1, Corollary 2.2]. However, we present here a somewhat more direct proof which does not involve exterior algebras. Theorem 3.3. Let (M, ≺) be an ordered simple matroid of rank r on [n] and let I≺ (M) be the Stanley-Reisner ideal of the broken circuit complex of M. Then the following conditions are equivalent: (i) I≺ (M) has a p-linear resolution; (ii) 2 ≤ p ≤ r and M is isomorphic to U p,n−r+p ⊕Ur−p,r−p. Proof. (ii)⇒(i): Assume M is isomorphic to U p,n−r+p ⊕ Ur−p,r−p . Then after renumbering the variables (if necessary) we get I≺ (M) = (xi1 · · · xi p : 1 ≤ i1 < · · · < i p < n − r + p). This ideal clearly has linear quotients, and consequently, it has a linear resolution. (i)⇒(ii): Assume I≺ (M) has a p-linear resolution. Evidently, 2 ≤ p ≤ r as M is simple. Recall that the ring S/I≺ (M) is Cohen-Macaulay of dimension r. Let y = y1 , . . . , yr be a maximal S/I≺ (M)-regular sequence of linear forms in S. Denote by I¯≺ (M) the image of I≺ (M) in S̄ = S/(y). It follows from Proposition 3.1 that  K[z1 , . . . , zn−r ] , R := S/ I≺ (M) + (y) ∼ = = S̄/I¯≺ (M) = S̄/m p ∼ (z1 , . . . , zn−r ) p where m = (x1 , . . . , xn ) and z1 , . . . , zn−r are variables. Since y is an S/I≺ (M)-sequence, one gets the following relation between the Hilbert series of S/I≺ (M) and R: HS/I≺(M) (t) = HR (t)/(1 − t)r . The h-vector (h0 , . . . , hr ) of S/I≺ (M) is now computable: ( n−r+k−1 for 0 ≤ k ≤ p − 1 k hk = H(R, k) = 0 for p ≤ k ≤ r, where H(R, .) denotes the Hilbert function of R. This yields the following formula for the f -vector ( f0 , . . . , fr−1 ) of S/I≺ (M):   p−1    r r−i n−r+i−1 r−i fk−1 = ∑ hi =∑ for k = 0, . . . , r. k−i i k−i i=0 i=0 Note that c = p + 1 is the smallest size of a circuit of M since I≺ (M) is generated by monomials of degree p. So by [3, Proposition 7.5.6], the f -vector of S/I≺ (M) attains its minimum and this forces M to be isomorphic to U p,n−r+p ⊕Ur−p,r−p.  Corollary 3.4. With the assumption of Theorem 3.3, if I≺ (M) has a linear resolution, then so do all of its powers. Proof. By Theorem 3.3, if I≺ (M) has a linear resolution, then it is a so-called squarefree Veronese ideal. It is known that all powers of this ideal have linear quotients; see [18, Corollary 12.6.4]. Therefore, they all have a linear resolution.  8 LE VAN DINH AND TIM RÖMER 3.2. Orlik-Terao ideals. Return to our assumption in the introduction: A is an essential central arrangement of n hyperplanes in an r-dimensional vector space V over K. Let M(A ) be the underlying matroid and I(A ) ⊂ S the Orlik-Terao ideal of A . We refer to [23, Definition 1.15] for the coning construction of an arrangement. Characterizations of arrangements whose OrlikTerao ideal has a linear resolution are given below. It turns out that this property of the Orlik-Terao ideal is combinatorial and holds for “almost all” arrangements. Theorem 3.5. For an essential central arrangement A of n hyperplanes in a vector space of dimension r, the following conditions are equivalent: (i) I(A ) has a p-linear resolution; (ii) 2 ≤ p ≤ r and M(A ) is isomorphic to U p,n−r+p ⊕Ur−p,r−p; (iii) 2 ≤ p ≤ r and A = A1 × A2 , where A1 is a generic central arrangement of n − r + p hyperplanes in a p-dimensional vector space and A2 is a Boolean arrangement in an (r − p)-dimensional vector space; (iv) 2 ≤ p ≤ r and A is obtained by successively coning a generic central arrangement of n − r + p hyperplanes in a p-dimensional vector space. Proof. For an ordering ≺ of the ground set [n] of M(A ), we use the same notation to denote an induced monomial order on S. Then by Theorem 2.3, in≺ (I(A )) = I≺ M(A ) . Now the equivalence of (i) and (ii) follows by combining Corollary 3.2 and Theorem 3.3. Whereas the equivalences of (ii) and (iii), (iii) and (iv) are just a matter of interpreting terminologies.  Before going further, let us recall shortly here the notion of Koszul algebra. For more information, we refer to the survey of Fröberg [17]. Let B = S /I be a graded K-algebra, where S is either a polynomial algebra or an exterior algebra over K and I is a graded ideal of S . Then B is called a Koszul algebra if K has a linear resolution over B. It is well-known that if B is Koszul then I is generated by quadrics. The converse is not true in general. However, it follows from a result of Fröberg that if I has a quadratic Gröbner basis then B is Koszul. The following consequence is immediate from the above theorem. Corollary 3.6. Let A be an essential central arrangement. Then I(A ) has a 2-linear resolution if and only if A is obtained by successively coning a central arrangement of lines in a plane. In this case, the Orlik-Terao algebra C(A ) is Koszul. 4. T HE COMPLETE INTERSECTION PROPERTY The broken circuit complex was introduced by Wilf in [37]. There he found several necessary conditions for a polynomial to be the chromatic polynomial of a graph. He also computed the chromatic polynomials of the graphs that admit a broken circuit complex with disjoint minimal broken circuits, and derived from that upper bounds for coefficients of the chromatic polynomial of a maximal planar graph. In this section, we characterize, in terms of the set of circuits, those ordered matroids whose minimal broken circuits are pairwise disjoint, i.e., those ordered matroids whose Stanley-Reisner ideal of the broken circuit complex is a complete intersection. This result is applied to triangulations of simple polygons to show that the cycle matroid of such a graph admits a broken circuit complex with disjoint minimal broken circuits. Then we show that Conjecture 1.2 holds for matroids whose minimal broken circuits are pairwise disjoint. As another application, we improve Wilf’s upper bounds mentioned above. We also show, in codimension 3, that Gorensteiness of the Stanley-Reisner ideal of the broken circuit complex is equivalent to be a complete intersection. Finally, we characterize arrangements whose Orlik-Terao ideal is a complete intersection and verify Conjecture 1.2 for those arrangements. For the last result see also [13, Cor. 5.12] who proved independently a variation of this statement with a different method. BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 9 4.1. Stanley-Reisner ideals of broken circuit complexes. Let (M, ≺) be an ordered simple matroid on [n]. We keep some notation introduced before: C(M) is the set of circuits of M; I≺ (M) ⊂ S = K[x1 , . . . , xn ] denotes the Stanley-Reisner ideal of the broken circuit complex BC≺ (M); and min≺ (C) and bc≺ (C) are respectively the minimal element and the broken circuit of a given circuit C with respect to ≺. Recall that I≺ (M) = (xbc≺ (C) : C ∈ C(M)), where xbc≺ (C) = ∏i∈bc≺ (C) xi . Let D be a subset of C(M). We call D a generating set of C(M) if {xbc≺ (C) : C ∈ D} generates I≺ (M). Obviously, D is a generating set of C(M) if and only if for any C′ ∈ C(M), there is a C ∈ D with bc≺ (C) ⊆ bc≺ (C′ ), or, in other words, {bc≺ (C) : C ∈ D} contains the set of minimal broken circuits of M. Let G (D) be the intersection graph of D, i.e., the graph whose vertex set is D and edges are pairs {C,C′ } with C ∩ C′ 6= 0. / We say that D is connected (respectively, a tree, a forest) when so is the graph G (D). We will often consider those subsets D of C(M) with this property: for any distinct elements C,C′ ∈ D, one has either C ∩ C′ = min≺ (C) or C ∩ C′ = min≺ (C′ ) whenever C ∩ C′ 6= 0. / We call them simple subsets. Apparently, D is a simple subset of C(M) if and only if the broken circuits of the elements of D are pairwise disjoint. Now for each subset D of C(M), set [ [ [ [  C (D) = D− D− (D ∩ D′) . (D ∩ D′) = D∈D D,D′ ∈D,D6=D′ D∈D D′ ∈D−{D} Then our characterizations for the complete intersection property of the ideal I≺ (M) can be stated as follows. Theorem 4.1. Let (M, ≺) be an ordered simple matroid on [n]. The following conditions are equivalent: (i) I≺ (M) is a complete intersection; (ii) The minimal broken circuits of M are pairwise disjoint; (iii) There exists a simple subset D of C such that C(M) = {C (D′ ) : D′ ⊆ D is a tree}. To prove this theorem, we need some preparations. Lemma 4.2. Let D ⊆ C(M) be a simple subset of cardinality m. Then the following statements hold. (i) There is an enumeration of elements of D, say as C1 , . . . ,Cm , such that [  C j ≤ 1 for all i = 2, . . . , m. Ci ∩ j<i Moreover, if D′ ⊆ D is connected, then there exists such an enumeration so that the elements of D′ appear first. (ii) D is a tree if and only if D is connected and any three distinct elements of D have empty intersection. (iii) We have [ C,C′ ∈D,C6=C′ with equality if and only if D is a tree. (C ∩C′ ) ≤ m − 1, 10 LE VAN DINH AND TIM RÖMER Proof. (i) By induction on m, to prove the first assertion it suffices to show that there exists a circuit C ∈ D such that [  C′ ≤ 1. d(C) := C ∩ C′ ∈D−{C} Assume the contrary, i.e., d(C) ≥ 2 for all C ∈ D. Consider the intersection graph G (D) of D. For each edge {C,C′ } of G (D) we call C ∩C′ its label. Then it is easily seen that G (D) contains a cycle C1 . . .Ck with pairwise distinct edge labels, i.e., Ci ∩ Ci+1 6= C j ∩ C j+1 for i 6= j (Ck+1 = C1 ). Let {ei } = Ci ∩Ci+1 and assume e1 = min{ei : i = 1, . . . , k}. Recall that one has either e1 = min≺ (C1 ) or e1 = min≺ (C2 ). We will consider the case e1 = min≺ (C1 ), the other one can be treated similarly. Since {ek } = Ck ∩C1 6= C1 ∩C2 = {e1 }, it follows that ek = min≺ (Ck ). Proceeding in this way, we obtain ei = min≺ (Ci ) for all i = 1, . . . , k. In particular, we have e2 = min≺ (C2 ) ≤ e1 ∈ C2 . This, however, is impossible because e1 6= e2 and e1 = min{ei } ≤ e2 . In order to prove the second assertion, we first enumerate the set D′ as in the first assertion and then try − D′ to get a desired enumeration of D. The case that C ∩  to enumerate the set D S ′ ′ / for all C ∈ D − D is trivial: any enumeration of D −D′ as in the first assertion C′ ∈D′ C = 0 S / If we can show that works. In the remaining case choose C ∈ D such that C ∩ C′ ∈D′ C′ 6= 0.  S |C ∩ C′ ∈D′ C′ | = 1 then the assertion will follow by induction. Assume that there are C1 ,C2 ∈ D′ such that C ∩C1 6= C ∩C2 . Since G (D′ ) is connected, there exists a path in G (D′ ) connecting C1 and C2 . It follows that G (D) has cycles containing {C1 ,C,C2 }. Let γ be such a cycle wit h shortest length. Then it is easy to see that the labels of the edges of γ are pairwise distinct. But this cannot be the case as we have shown before. (ii) If three distinct elements C1 ,C2 ,C3 of D have non-empty intersection, then they form a cycle in the graph G (D), hence D cannot be a tree. Conversely, assume that D is connected. If D is not a tree, then G (D) must contain some cycle γ . As shown in (i), there are two edges of γ which share the same label. The vertices of these two edges then have non-empty intersection. (iii) Enumerate the elements of D as in (i). We have [ (C ∩C′ ) = C,C′ ∈D,C6=C′ m [ i=2 Ci ∩ [ j<i Cj  m ≤ ∑ Ci ∩ i=2 [ j<i Cj  ≤ m − 1.  S The equality holds if and only if the sets Ci ∩ j<i C j for i = 2, . . . , m satisfy two conditions: they are non-empty; and, they are pairwise distinct. Observe that the first condition is equivalent to the connectedness of D, while the second one means that the intersection of any three distinct elements of D is empty. The assertion now follows from (ii).  Remark 4.3. The proof of Lemma 4.2(i) is based on a fact that the graph G (D) contains no cycles whose edges have pairwise distinct labels. So when G (D) has no cycles with pairwise distinct edge labels (in particular, when G (D) has no cycles at all, i.e., D is a forest) and any two distinct members of D intersect in at most one element (but D need not be simple), the conclusion of Lemma 4.2(i) is still true. Moreover, in this case, there is an ordering of the ground set [n] such that D is simple with respect to this ordering. Indeed, one first enumerates the elements of D as C1 , . . . ,Cm such that [  C j ≤ 1 for all i = 2, . . . , m. Ci ∩ S j<i Set D1 = C1 and Di = Ci − j<i C j for i = 2, . . . , m. Then any ordering ≺ of [n] such that di ≺ d j whenever di ∈ Di , d j ∈ D j and i < j satisfies the requirement. BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 11 Lemma 4.4. Let D, D′ ⊆ C(M) be non-empty simple subsets. Then the following statements hold. (i) There exists a circuit C ∈ C(M) such that C ⊆ C (D). (ii) If C (D) ⊆ C′ for some circuit C′ ∈ C(M), then C (D) = C′ and D is a tree. (iii) If D is a tree, D ∪ D′ is simple and C (D′ ) ⊆ C (D), then D = D′ . Proof. Enumerate the elements of D as in Lemma 4.2(i). It is clear that with this enumeration we have [ Ci * C j for all i = 2, . . . , m, j<i where m = |D|.SBy virtue of Lemma 4.2(iii), one can choose a subset B of [n] with |B| = m − 1 so that B contains D,D′ ∈D,D6=D′ (D ∩ D′ ). It now follows from Theorem 2.1 that there exists a circuit C ∈ C(M) such that C⊆ m [ Ci − B ⊆ i=1 [ D− [ (D ∩ D′) = C (D). D,D′ ∈D,D6=D′ D∈D If there is another circuit C′ ∈ C(M) with C (D) ⊆ C′ ,Sthen since C ⊆ C′ are both circuits we must have C = C′ . This implies that C′ = C (D) and B = D,D′ ∈D,D6=D′ (D ∩ D′). As | [ (D ∩ D′ )| = |B| = m − 1, D,D′ ∈D,D6=D′ Lemma 4.2(iii) guarantees that D is a tree. To prove (iii), we first show that D′ ⊆ D. Indeed, we have C (D) = C (D) ∪ C (D′ ) ⊇ C (D ∪ D′ ). Choose an enumeration of elements of D ∪ D′ in which the elements of D appear first as in Lemma 4.2(i). If D′ * D, then there exists a circuit D′ ∈ D′ (for instance, D′ can be chosen to be the last element in the enumeration) such that D′ * [ D. D′ 6=D∈D∪D′ S Then for any d ∈ D′ − D′ 6=D∈D∪D′ D we have d ∈ C (D ∪ D′ ) − C (D). This contradiction shows that D′ ⊆ D. Suppose D′ 6= D. Then since D is connected, there exist D1 ∈ D′ and D2 ∈ D − D′ such that D1 ∩ D2 6= 0. / The fact that three distinct elements of D have empty intersection (see Lemma 4.2(ii)) yields [ D1 ∩ D2 * (D ∩ D′ ). D,D′ ∈D′ ,D6=D′ This implies D1 ∩ D2 ⊆ C (D′ ) − C (D), which contradicts the hypothesis. Hence D = D′ .  Lemma 4.5. Let D ⊆ C(M) be simple. Assume that DSis a generating set of C(M). Then for any C ∈ C(M), there exists a subset D′ ⊆ D such that C ⊆ D∈D′ D and [  D′ for all D ∈ D′ . D ⊆C∪ D′ ∈D′ −{D} If this is the case, then D′ must be a tree and we have C = C (D′ ). S Proof. Suppose on the contrary that there is no such D′ . If C ⊆ D∈D D (we will not exclude the S case that C * D∈D D in our argument below), then there must be some Dm ∈ D (m = |D|) such that [  D , Dm * C ∪ D∈Dm 12 LE VAN DINH AND TIM RÖMER where Dm = D − {Dm}. If C ⊆ S then there exists again some Dm−1 ∈ Dm such that [  D , Dm−1 * C ∪ D∈Dm D, D∈Dm−1 where Dm−1 = D − {Dm−1 , Dm }. Continuing this argument, we eventually get an index 1 ≤ i ≤ m + 1, elements Di , . . . , Dm ∈ D, and subsets D j = D − {D j , . . . , Dm } ( j = i, . . . , m) such that C* [ D, D∈Di [ Dj * C ∪ D∈D j  D for all j = i, . . . , m. S (The case i = m + 1 simply means that C * D∈D D.) Now enumerate the set Di as in Lemma 4.2(i): Di = {D1 , . . . , Di−1 }. Then for j = 2, . . . , i − 1 we have Dj * [ Dl . l< j So the following enumeration of the set D ∪ {C}: D1 , . . . , Di−1 ,C, Di , . . . , Dm satisfies the hypothesis of Theorem 2.1. Therefore, if we take d j ∈ bc≺ (D j ) for j = 1, . . . , m, then there exists a circuit C′ ∈ C(M) such that C′ ⊆ C ∪ m [ j=1 (C′ )  D j − {d1 , . . . , dm }, Obviously, bc≺ (D j ) * bc≺ for all j = 1, . . . , m. But this contradicts the hypothesis that D is a generating set of C(M). Hence, there must be a subset D′ of D having the required properties.  S Since D ⊆ C ∪ D′ ∈D′ −{D} D′ we have D− [ (D ∩ D′ ) ⊆ C for all D ∈ D′ . D′ ∈D′ −{D} It follows that C (D′ ) = [ D− D∈D [  (D ∩ D′ ) ⊆ C. D′ ∈D−{D} The last assertion now follows from Lemma 4.4(ii).  Let D be a simple subset of C(M) which is also a tree. We have not yet known whether C (D) is a circuit of M (this is true, though, at least in the case where the minimal broken circuits of M are pairwise disjoint, as will be proved below). However, in the following lemma we still use the notation bc≺ (C (D)) to denote the set C (D) − min≺ (C (D)). Lemma 4.6. Let D ⊆ C(M) be a non-empty simple subset. Assume further that D is a tree. Then there exists a circuit C ∈ D such that bc≺ (C) ⊆ bc≺ (C (D)). Proof. The case |D| = 1 is trivial, so we will assume that |D| ≥ 2. Then it is a basic fact in graph theory that the tree G (D) has at least two leaves; see, e.g., [6, Proposition 4.2]. Thus there are two circuits C1 ,C2 ∈ D such that [  C = 1 for i = 1, 2. Ci ∩ C∈D−{Ci } BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 13 Denote by m(D) the set {min≺ (C) : C ∈ D}. Recall that [ (C ∩C′ ) ⊆ m(D), C,C′ ∈D,C6=C′ and since D is a tree, [ (C ∩C′ ) = |D| − 1 ≥ |m(D)| − 1. C,C′ ∈D,C6=C′ S Thus there might be at most one element of m(D) which is not in C,C′ ∈D,C6=C′ (C ∩C′ ). It follows  S that Ci ∩ C∈D−{Ci } C = min≺ (Ci ) for either i = 1 or i = 2. Let us assume, say, that i = 1. Then bc≺ (C1 ) = C1 − min≺ (C1 ) = C1 − [ (C1 ∩C) ⊆ C (D). C∈D−{C1 } Consider the following two cases:  S Case 1: C2 ∩ C∈D−{C2 } C = min≺ (C2 ). Then we also have bc≺ (C2 ) ⊆ C (D) as above. Since bc≺ (C1 ) ∩ bc≺ (C2 ) = 0, / it follows that min≺ (C (D)) 6∈ bc≺ (C1 ) or min≺ (C (D)) 6∈ bc≺ (C2 ). Hence, we get either bc (C ) ⊆ bc (C (D)) or bc≺ (C2 ) ⊆ bc≺ (C (D)). S ≺ 1  ≺ Case 2: C2 ∩ C∈D−{C2 } C 6= min≺ (C2 ). Then min≺ (C2 ) ∈ C (D). Let D1 D2 . . . Ds be a path in the intersection graph G (D) which connects C1 and C2 (C1 = D1 ,C2 = Ds ). Note that min≺ (Ds ) 6= Ds−1 ∩ Ds because min≺ (Ds ) = min≺ (C2 ) ∈ C (D). Hence, Ds−1 ∩ Ds = min≺ (Ds−1 ). Consequently, Di ∩Di+1 = min≺ (Di ) for i = 1, . . . , s−1 since any three distinct elements of D have empty intersection, by Lemma 4.2(ii). From this we get min≺ (C2 ) = min≺ (Ds ) < min≺ (Ds−1 ) < · · · < min≺ (D1 ) = min≺ (C1 ). Thus min≺ (C (D)), which is not greater than min≺ (C2 ), does not belong to bc≺ (C1 ). This yields bc≺ (C1 ) ⊆ bc≺ (C (D)).  We are now ready to prove Theorem 4.1. Proof of Theorem 4.1. (i)⇒(ii): Assume I≺ (M) is a complete intersection. Then I≺ (M) = (u1 , . . . , uh ), where u1 , . . . , uh are pairwise coprime monomials. Let C1 , . . . ,Ch be circuits of M such that xbc≺ (Ci ) = ui for i = 1, . . . , h. Then the broken circuits bc≺ (Ci ) are pairwise disjoint. We need to show that if C ∈ C(M) and bc≺ (C) is a minimal broken circuit of M then C = C j for some 1 ≤ j ≤ h. Indeed, one checks that {bc≺ (Ci ) : i = 1, . . . , h} is the set of minimal broken circuits of M, so bc≺ (C) = bc≺ (C j ) for some 1 ≤ j ≤ h. If C 6= C j , then by Theorem 2.1, there exists a circuit C′ of M with C′ ⊆ C ∪C j − {e} = bc≺ (C j ) ∪ min≺ (C j ) ∪ min≺ (C) − {e}, where e ∈ bc≺ (C j ). Observe that one has either bc≺ (C′ ) ⊆ C − {e} or bc≺ (C′ ) ⊆ C j − {e}. From this it easily follows that bc≺ (Ci ) * bc≺ (C′ ) for all i = 1, . . . , h, which is a contradiction. (ii)⇒(iii): Let D be the subset of C(M) such that {bc≺ (C) : C ∈ D} is the set of minimal broken circuits of M. Then D is simple because the minimal broken circuits of M are pairwise disjoint. Since D is a generating set of C, it follows from Lemma 4.5 that C(M) ⊆ {C (D′ ) : D′ ⊆ D is a tree}. Now let D′ ⊆ D be a tree. By Lemma 4.4(i), there exists a circuit C ∈ C(M) such that C ⊆ C (D′ ). As we have just seen, C = C (D′′ ) for some tree D′′ ⊆ D. It then follows from Lemma 4.4(iii) that C (D′ ) = C (D′′ ) = C ∈ C(M). Therefore, C(M) = {C (D′ ) : D′ ⊆ D is a tree}. 14 LE VAN DINH AND TIM RÖMER (iii)⇒(i): Since D is simple, the monomials xbc≺ (C) for C ∈ D are pairwise coprime. Thus it suffices to show that I≺ (M) = (xbc≺ (C) : C ∈ D), or in other words, D is a generating set of C(M). The latter fact is, however, merely a consequence of Lemma 4.6.  Example 4.7. Let G be the graph in Figure 4.1, with the given numbering of the edges. Let M = M(G) be the cycle matroid of G. We have  C(M) = {1, 2, 8}, {3, 4, 9}, {5, 6, 10}, {7, 8, 9, 10}, {1, 2, 9, 10, 7}, {3, 4, 10, 7, 8}, {5, 6, 7, 8, 9}, {1, 2, 3, 4, 10, 7}, {3, 4, 5, 6, 7, 8}, {1, 2, 9, 5, 6, 7}, {1, 2, 3, 4, 5, 6, 7} . With the ordinary ordering of {1, . . . , 10}, the minimal broken circuits of M are not pairwise disjoint (e.g., {2, 8} and {8, 9, 10}). However, this can be the case for other orderings. Consider, say, the ordering 10 ≺ 9 ≺ · · · ≺ 1. In this case, the minimal broken circuits of M are {1, 2}, {3, 4}, {5, 6}, {7, 8, 9}, and the ideal I≺ (M) = (x1 x2 , x3 x4 , x5 x6 , x7 x8 x9 ) is a complete intersection. 1 2 3 8 9 7 10 6 4 5 Figure 4.1 The above example illustrates a somewhat more general fact which holds for arbitrary triangulations of simple polygons. Recall that a simple polygon can always be partitioned into triangles by its diagonals; see, e.g., [25, Theorem 1.2.3]. Corollary 4.8. Let G be a triangulation of a simple polygon. Denote by M(G) the cycle matroid of G. Then there exists an ordering ≺ of the edges of G such that the minimal broken circuits of the ordered matroid (M(G), ≺) are pairwise disjoint. Proof. Denote by C the set of circuits of M(G). Let D be the subset of C consisting of circuits which are boundaries of triangles of G. Then the intersection graph G (D) of D is a tree; see [25, Lemma 1.2.6]. So by Remark 4.3, D is a simple subset of C with respect to a suitable ordering ≺ of the edges of G. It is then clear that C can be described as in Theorem 4.1, i.e., C = {C (D′ ) : D′ ⊆ D is a tree}. Thus the minimal broken circuits of (M(G), ≺), which are the broken circuits of the elements of D, are pairwise disjoint.  In the following theorem, we verify Conjecture 1.2 for ordered matroids with disjoint minimal broken circuits. A formula for the Poincaré polynomials of the Orlik-Solomon algebras of those matroids is also derived. It can be considered as a generalization of a formula for the chromatic polynomials of the graphs that admit a broken circuit complex with disjoint minimal broken circuits obtained by Wilf in [37]. BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 15 Theorem 4.9. Let (M, ≺) be an ordered simple matroid on [n]. Assume that the minimal broken circuits of M are pairwise disjoint. Then we have the following formula for the Poincaré polynomial of the Orlik-Solomon algebra of M: h  h π (A(M),t) = (t + 1)n−∑i=1 qi ∏ (t + 1)qi − t qi , i=1 where q1 , . . . , qh are the sizes of the minimal broken circuits. Moreover, the following conditions are equivalent: (i) π (A(M),t) factors completely over Z; (ii) qi = 2 for all i = 1, . . . , h; (iii) M is supersolvable; (iv) A(M) is Koszul. Note that the formula for the Poincaré polynomial can also be deduced from [7] since the underlying simplicial complex can be seen as an iterated join of boundaries of simplices. Then the corresponding characteristic polynomial factors nicely and one concludes by applying, e.g., [3, Corollary 7.10.3]. Proof. Let C1 , . . . ,Ch be the circuits of M such that {bc≺ (Ci ) : i = 1, . . . , h} is the set of minimal broken circuits of M. Then I≺ (M) = (xbc≺ (Ci ) : i = 1, . . . , h) is a complete intersection. In this case, the Hilbert series of the ring S/I≺ (M) is easily computable: HS/I≺ (M) (t) = ∏hi=1 (1 − t qi ) . (1 − t)n Proposition 2.4 now yields π (A(M),t) = HS/I≺ (M)  t  h  h = (t + 1)n−∑i=1 qi ∏ (t + 1)qi − t qi . t +1 i=1 i Since (t + 1)qi − t qi = ∏qj=1 (t + 1 − ζ j t), where ζ is a primitive qi th root of unity, it follows from the above equation that π (A(M),t) factors completely over Z if and only if qi = 2 for all i = 1, . . . , h (note that qi ≥ 2 as M is simple). This proves (i)⇔(ii). The implication (ii)⇒(iii) is true for all simple matroids; see [4, Theorem 2.8]. It is well-known that if M is supersolvable, then the Orlik-Solomon ideal J(M) has a quadratic Gröbner basis; see [3, Theorem 7.10.2] and [4, Theorem 2.8]. So the implication (iii)⇒(iv), which now follows from a result due to Fröberg (see [17]), is also true in general. Finally, in order to prove the implication (iv)⇒(ii), recall that the Koszulness of A(M) implies the quadraticity of the Orlik-Solomon ideal J(M), it suffices to show that ∂ eCi are minimal generators of J(M) for i = 1, . . . , h. From the description of C(M) in Theorem 4.1 we easily get J(M) = (∂ eCi : i = 1, . . . , h) (this can also be seen from a result of Björner [3, Theorem 7.10.2] that {∂ eCi : i = 1, . . . , h} is a Gröbner basis of J(M) with respect to the lexicographical order). Thus if ∂ eCi is not a minimal generator of J(M), then ∂ eCi = ∑ a j ∂ eC j , a j ∈ E. j6=i It follows that there must be some j 6= i and some e ∈ C j such that C j − {e} ⊆ bc≺ (Ci ). But this is impossible because bc≺ (Ci ) ∩ bc≺ (C j ) = 0. / The theorem has been proved.  Example 4.10. Let G be a triangulation of a simple polygon of ℓ vertices. Then G has 2ℓ − 3 edges and consists of ℓ − 2 triangles; see, e.g., [25, Theorem 1.2.3 and Lemma 1.2.4]. By Corollary 4.8, there exists an ordering ≺ of the edges of G such that the minimal broken circuits of the matroid (M(G), ≺) are pairwise disjoint. Note that all these minimal broken circuits have cardinality 2 16 LE VAN DINH AND TIM RÖMER since they come from triangles of G. So by Corollary 2.5 and Theorem 4.9 we obtain a known formula for the chromatic polynomial of G: χ (G,t) = t ℓ π (A(M(G)), −t −1 ) = t ℓ (−t −1 + 1)2ℓ−3−2(ℓ−2) (2(−t)−1 + 1)ℓ−2 = t(t − 1)(t − 2)ℓ−2 . We now improve Wilf’s upper bounds on the coefficients of the chromatic polynomial of a maximal planar graph in [37, Theorem 4]. Recall that a planar graph G is called maximal if one cannot add a new edge (on the given vertex set of G) to form another planar graph. It is wellknown that a maximal planar graph G with ℓ ≥ 3 vertices has 2ℓ − 4 faces, and every face of G (including the outer face) is bounded by a triangle. As a key step in proving [37, Theorem 4], Wilf showed that for a maximal planar graph G with ℓ ≥ 3 vertices, there exists an ordering of the edges of G so that the cycle matroid M(G) has at least ℓ − 2 pairwise disjoint broken circuits, cf. [37, Theorem 3]. This can be sharpen as follows. Proposition 4.11. Let G be a maximal planar graph with ℓ ≥ 3 vertices. Then there exists an ordering of the edges of G so that the number of pairwise disjoint broken circuits of M(G) with respect to this ordering is bounded below by ℓ − 2 + ⌊ℓ/4⌋. Moreover, if the dual graph of G contains no triangles, then the lower bound can be improved to ℓ − 3 + ⌈ℓ/3⌉. Proof. Denote by C the set of circuits of M(G). Let D be the subset of C consisting of circuits which are boundaries of faces of G. Observe that the intersection graph G (D) is isomorphic to the dual graph of G. So G (D) is a cubic graph of 2ℓ − 4 vertices. We will assume that ℓ > 4 as the cases ℓ = 3 and ℓ = 4 can be easily checked (of course, one may also apply [37, Theorem 3] to these cases). Then by [5, Theorem 4 and Theorem 5], there is a forest D′ ⊂ D with the cardinality at least  (a) 5(2ℓ − 4) − 2/8 = ℓ − 2 + (ℓ − 3)/4 in the general case, and (b) 2(2ℓ − 4) − 1 /3 = ℓ − 3 + ℓ/3 in the case G (D) has no triangles. Now by Remark 4.3, D′ is a simple subset of C with respect to a suitable ordering of the edges of G. Since the broken circuits of the circuits in D′ are then pairwise disjoint, the proposition follows.  The above proposition yields the following improvement of [37, Theorem 4]. p ℓ−p be the chromatic polynomial of a maximal Theorem 4.12. Let χ (G,t) = t ℓ + ∑ℓ−1 p=1 (−1) a p t planar graph G. Then the coefficients of χ (G,t) are dominated by the corresponding coefficients of the function Q(t) = t −ℓ+4+⌊ℓ/4⌋(t + 1)ℓ−2−2⌊ℓ/4⌋(t + 2)ℓ−2+⌊ℓ/4⌋, or explicitly, ap ≤ min{p,ℓ−2+⌊ℓ/4⌋}  ∑ k=0   ℓ − 2 − 2⌊ℓ/4⌋ ℓ − 2 + ⌊ℓ/4⌋ k 2, p−k k p = 1, . . . , ℓ − 1. In the case when the dual graph of G has no triangles, the function Q(t) can be replaced by R(t) = t −ℓ+3+⌈ℓ/3⌉(t + 1)ℓ−2⌈ℓ/3⌉ (t + 2)ℓ−3+⌈ℓ/3⌉, and we have ap ≤ min{p,ℓ−3+⌈ℓ/3⌉}  ∑ k=0   ℓ − 2⌈ℓ/3⌉ ℓ − 3 + ⌈ℓ/3⌉ k 2, p−k k p = 1, . . . , ℓ − 1. BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 17 Proof. One only needs to replace [37, Theorem 3] by Proposition 4.11 in the proof of [37, Theorem 4].  We end this subsection with an examination of 3-codimensional Stanley-Reisner ideals of broken circuit complexes. We show that for those ideals, Gorensteiness is equivalent to be a complete intersection. Gorenstein ideals of codimension 3 were classified in Buchsbaum-Eisenbud’s structure theorem [10, Theorem 2.1]. Bruns-Herzog [8, Theorem 6.1] and Kamoi [20, Theorem 0.1] then independently refined this classification for monomial ideals. They showed that if I ⊂ S = K[x1 , . . . , xn ] is a monomial Gorenstein ideal of codimension 3 with m minimal generators (m is odd by [10, Theorem 2.1]), then there are m pairwise coprime monomials u1 , . . . , um of S such that I is generated by the monomials vi = ui ui+1 · · · ui+s−1 , i = 1, . . . , m, where s = (m − 1)/2 and u j = u j−m for j > m. Proposition 4.13. Let (M, ≺) be an ordered simple matroid on [n] and let I≺ (M) ⊂ S be the Stanley-Reisner ideal of the broken circuit complex of M. Assume that codim I≺ (M) ≤ 3. Then I≺ (M) is Gorenstein if and only if it is a complete intersection. Proof. The proposition is true for all ideals of codimension 1 and codimension 2; see [14, Corollary 21.10]. Therefore, it suffices to prove that I≺ (M) is a complete intersection when it is a Gorenstein ideal of codimension 3. Let m be the number of minimal generators of I≺ (M). Set s = (m − 1)/2 and let u1 , . . . , um be pairwise coprime monomials such that I = (v1 , . . . , vm ), where vi = ui ui+1 · · · ui+s−1 for i = 1, . . . , m (u j = u j−m if j > m). We need to show that m = 3. Suppose on the contrary that m > 3. Put min≺ (ui ) = min≺ { j : x j | ui } for i = 1, . . . , m. We may assume t := min≺ (u1 ) = min≺ {min≺ (ui ) : i = 1, . . . , m}. Let Ci be the circuits of M such that vi = xbc≺ (Ci ) for i = 1, . . . , m. Note that u1 | vm since s > 1. So the above assumption yields    t = min≺ bc≺ (C1 ) = min≺ bc≺ (Cm ) = min≺ {min≺ bc≺ (Ci ) : i = 1, . . . , m}. Hence we can find p, q ≺ t such that C1 = bc≺ (C1 ) ∪ {p} and Cm = bc≺ (Cm ) ∪ {q}. By Theorem 2.1, there exists a circuit C of M with C ⊆ C1 ∪ Cm − {t}. Since xbc≺ (C) ∈ I≺ (M), it follows that xC1 ∪Cm −{t} ∈ I≺ (M). We have u1 xC1 ∪Cm −{t} = u2 · · · us−1 us um x p xq . xt As m > s + 1 and (vi , x p xq ) = 1 for i = 1, . . . , m, it is easy to check that vi ∤ xC1 ∪Cm −{t} for all i = 1, . . . , m. This implies xC1 ∪Cm −{t} 6∈ I≺ (M), a contradiction.  4.2. Orlik-Terao ideals. In the following we will characterize arrangements whose Orlik-Terao ideal is a complete intersection and show that Conjecture 1.2 holds for those arrangements. We begin with a simple lemma. It is known, but due to the lack of reference we present a proof here. Lemma 4.14. Let I ⊂ S = K[x1 , . . . , xn ] be a graded prime ideal which is minimally generated by homogeneous polynomials u1 , . . . , uh . Then the following conditions are equivalent: (i) I is a complete intersection; (ii) Every subset of u1 , . . . , uh generates a prime ideal. Proof. (i)⇒(ii): Let R be a quotient ring of S by a graded ideal. By descending induction it is enough to show that if there is a homogeneous regular element u ∈ R such that (u) is a prime ideal, then R is a domain. Indeed, let P ⊂ (u) be a minimal prime ideal of R. Then for each v ∈ P we 18 LE VAN DINH AND TIM RÖMER have v = uw with w ∈ R. Since u 6∈ P, w is an element of P. It follows that P = uP, and hence P = 0 by Nakayama’s lemma. Therefore, R is a domain. (ii)⇒(i): Let I j = (u1 , . . . , u j ) for j = 1, . . . , h. Then we have a chain of prime ideals: 0 ⊂ I1 ⊂ · · · ⊂ Ih = I. This chain is strict because of the minimality of the set of generators {u1 , . . . , uh }. Hence codim I = h, from which follows that I is a complete intersection.  As before, let A be an essential central arrangement of n hyperplanes in a vector space V over a field K. Let M(A ) be the underlying matroid and I(A ) ⊂ S = K[x1 , . . . , xn ] the Orlik-Terao ideal  of A . Denote by C = C M(A ) the set of circuits of M(A ). Recall that each circuit C of M(A ) corresponds to a unique (up to a scalar multiple) relation rC in the relation space F(A ). The ideal I(A ) is then generated by the polynomials {∂ rC : C ∈ C}; see Theorem 2.3. In the following we will sometimes make use of the fact that I(A ) is a prime ideal (see [33, Proposition 2.1]) without mentioning it explicitly. Lemma 4.15. Assume that I(A ) is a complete intersection. Let D be a subset of C such that {∂ rC ,C ∈ D} is a minimal system of generators of I(A ). Then for every subset D′ of D, if a relation r belongs to the subspace of F(A ) generated by {rC ,C ∈ D′ }, then ∂ r is an element of the ideal of R generated by {∂ rC ,C ∈ D′ }. Proof. For each relation r = ∑ni=1 ai xi ∈ F(A ), set Λr = {i ∈ [n] : ai 6= 0}. Assume now that r = ∑C∈D′ aC rC , aC ∈ K. Substituting (1/x1 , . . . , 1/xn ) in this equation we get aC ∂ rC ∂r . = ∑ xΛr C∈D′ xC It follows that x[n]−Λr ∂ r = ∑ aC x[n]−C ∂ rC ∈ (∂ rC : C ∈ D′ ). C∈D′ By Lemma 4.14, ID′ = (∂ rC : C ∈ D′ ) is a prime ideal. Since ID′ is generated in degree ≥ 2, x[n]−Λr 6∈ ID′ . Hence, ∂ r ∈ ID′ .  We are now in a position to prove the following characterizations of the complete intersection property of the Orlik-Terao ideal. Theorem 4.16. Let A be an essential central arrangement of n hyperplanes. The following conditions are equivalent: (i) I(A ) is a complete intersection; (ii) There is an ordering ≺ of [n], with an arbitrary induced monomial order on R, such that in≺ (I(A )) is a complete intersection; (iii) There is an ordering ≺ of [n] such that the minimal broken circuits of (M(A ), ≺) are pairwise disjoint; (iv) There is an ordering ≺ of [n] and a subset D of C which is simple with respect to ≺ such that C = {C (D′ ) : D′ ⊆ D is a tree}. Proof. By Theorem 2.3 and Theorem 4.1, we only need to prove the implication (i)⇒(ii). Assume that I(A ) is a complete intersection. Let D be a subset of C such that {∂ rC ,C ∈ D} is a minimal system of generators of I(A ). We will show that there is an ordering of [n] so that D is simple with respect to this ordering. By Remark 4.3, this will be done after the following two claims have been proved. Claim 1. |C ∩C′ | ≤ 1 for all C,C′ ∈ D. BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 19 If this is not the case, then there are distinct elements p, q ∈ C1 ∩ C2 for some C1 ,C2 ∈ D. We may assume rCi = x p + ∑ j∈Ci −{p} a ji x j for i = 1, 2. Then the relation r = rC1 − rC2 does not involve x p . By Lemma 4.15, ∂ r = f1 ∂ rC1 + f2 ∂ rC2 for some polynomials f1 , f2 ∈ S. Write fi = gi + x p hi with gi , hi ∈ S and gi does not involve x p . We have ∂ r = f1 ∂ rC1 + f2 ∂ rC2 = (g1 + x p h1 )(xC1 −{p} + x p k1 ) + (g2 + x p h2 )(xC2 −{p} + x p k2 ) (k1 , k2 ∈ S) = g1 xC1 −{p} + g2 xC2 −{p} + x p l (l ∈ S). This yields ∂ r = g1 xC1 −{p} + g2 xC2 −{p} since ∂ r does not involve x p . It follows that xq | ∂ r. But this is impossible by the definition of ∂ r. Claim 2. The intersection graph G (D) does not have a cycle with pairwise distinct edge labels, i.e., a cycle C1 . . .Cm with Ci ∩Ci+1 6= C j ∩C j+1 whenever i 6= j. We use a similar argument as in the proof of Claim 1. Suppose that G (D) contains cycles with pairwise distinct edge labels. Let C1 . . .Cm be such a cycle with shortest length. Then it is easily seen that Ci ∩C j = 0/ for i = 1, . . . , m and j 6= i − 1, i + 1 (Cm+1 = C1 ). Let Ci ∩Ci+1 = {pi } for i = 1, . . . , m. Recall that the relations rCi are determined up to a scalar multiple. So we may choose these relations such that the relation r = ∑m i=1 rCi does not involve x p1 , . . . , x pm−1 . By Lemma f ∂ r for some f ∈ S. Let P be the ideal of S generated by x p1 , . . . , x pm−1 . Write 4.15, ∂ r = ∑m i i=1 i Ci fi = gi + hi with hi ∈ P and gi does not involve x p1 , . . . , x pm−1 for i = 1, m. Note that ∂ rCi ∈ P for i = 2, . . . , m − 1. We have ∂ r = f1 ∂ rC1 + fm ∂ rCm + m−1 ∑ fi ∂ rCi i=2 = (g1 + h1 )(xC1 −{p1 } + x p1 k) + (gm + hm )(xCm −{pm−1 } + x pm−1 k′ ) m−1 + ∑ fi ∂ rCi (k, k′ ∈ S) i=2 = g1 xC1 −{p1 } + gm xCm −{pm−1 } + l (l ∈ P). Similarly as in the proof of Claim 1, this implies ∂ r = g1 xC1 −{p1 } + gm xCm −{pm−1 } , and hence x pm | ∂ r, which is impossible. Now assume that D is a simple subset of C with respect to an ordering ≺ of [n]. We denote an induced monomial order of ≺ on S by the same notation. Then the monomials in≺ (∂ rC ) are pairwise coprime for all C ∈ D. It follows that {∂ rC : C ∈ D} is a Gröbner basis of I(A ); see, e.g., [18, Corollary 2.3.4]. Hence in≺ (I(A )) = (in≺ (∂ rC ) : C ∈ D) is a complete intersection.  The following corollary follows immediately from the above theorem and [12, Proposition 1.1]. Corollary 4.17. Let A be an essential central arrangement of n hyperplanes. Assume that I(A ) is a complete intersection. Then there exists an ordering ≺ of [n] (with an arbitrary induced order on S) such that in≺ (I(A )i ) = in≺ (I(A ))i for all i ≥ 1. Finally, we verify Conjecture 1.2 for arrangements with complete intersection Orlik-Terao ideal. For those arrangements several properties coincide. Recall that the arrangement A is said to be 2-formal if the relation space F(A ) is spanned by relations corresponding to 3-element circuits; see [16]. 20 LE VAN DINH AND TIM RÖMER Corollary 4.18. Let A be an essential central arrangement of n hyperplanes. Assume that the Orlik-Terao ideal I(A ) of A is a complete intersection. Let q1 , . . . , qh be the degree sequence of a minimal system of homogeneous generators of I(A ). Then the Poincaré polynomial of the Orlik-Solomon algebra of A is h  h π (A(A ),t) = (t + 1)n−∑i=1 qi ∏ (t + 1)qi − t qi . i=1 Moreover, the following conditions are equivalent: (i) π (A(A ),t) factors completely over Z; (ii) qi = 2 for all i = 1, . . . , h; (iii) A is supersolvable; (iv) A is free; (v) A is 2-formal; (vi) A(A ) is Koszul; (vii) C(A ) is Koszul. Proof. Let C1 , . . . ,Ch be circuits of M(A ) such that {∂ rCi : i = 1, . . . , h} is a minimal set of generators of I(A ). It follows from the proof of Theorem 4.16 that for a suitable ordering ≺ of [n] the ideal in≺ (I(A )) is a complete intersection and is minimally generated by {in≺ (∂ rCi ) : i = 1, . . . , h}. In particular, the minimal broken circuits of the matroid (M(A ), ≺) are pairwise disjoint and have the sizes q1 , . . . , qh . The formula for the Poincaré polynomial and the equivalence of conditions (i), (ii), (iii), (vi) then follow from Theorem 4.9. For the equivalence of (ii) and (vii), one only needs to notice that q1 , . . . , qh is the degree sequence of a minimal system of homogeneous generators of both I(A ) and in≺ (I(A )); see [17]. It is well-known that the implications (iii)⇒(iv)⇒(i) and (iv)⇒(v) are true in general; see [23, Theorem 4.58, Theorem 4.137] and [38, Corollary 2.5]. To complete the proof, we will show (v)⇒(ii). Assume that D = {C1 , . . . ,Cm } (m ≤ h) is the subset of {C1 , . . . ,Ch } consisting of 3-element circuits. Let ID = (∂ rCi : i = 1, . . . , m). This ideal is prime by Lemma 4.14. One easily sees that ∂ rC ∈ ID for every 3-element circuit C of M(A ). Since A is 2-formal, for any relation r ∈ F(A ) we have r = ∑C∈D′ aC rC , where aC ∈ K and D′ is a set of 3-element circuits. It follows from the proof of Lemma 4.15, with the notation used there, that x[n]−Λr ∂ r ∈ (∂ rC : C ∈ D′ ). Hence x[n]−Λr ∂ r ∈ ID . This implies ∂ r ∈ ID since ID is a prime ideal generated in degree ≥ 2. Therefore, I(A ) = (∂ r : r ∈ F(A )) = ID , or, in other words, D = {C1 , . . . ,Ch }. So we obtain qi = 2 for all i = 1, . . . , h, as desired.  Remark 4.19. Denham, Garrousian and Tohaneanu have independently proved the equivalence of conditions (ii), (iii), (v), (vii) in Corollary 4.18 by a different method; see [13, Corollary 5.12]. R EFERENCES [1] A. Aramova, L.L. Avramov and J. Herzog, Resolutions of monomial ideals and cohomology over exterior algebras. Trans. Amer. Math. Soc. 352 (2000), no. 2, 579–594. [2] D. S. Asche, Minimal dependent sets. J. Austral. Math. Soc. 6 (1966), 259–262. [3] A. Björner, The homology and shellability of matroids and geometric lattices. In Matroid Applications, ed. Neil White, 226–283, Cambridge Univ. Press, Cambridge, 1992. [4] A. Björner and G. Ziegler, Broken circuit complexes: factorizations and generalizations. J. Combin. Theory, Series B 51 (1991), no. 1, 96–126. [5] J. A. Bondy, G. Hopkins and W. Staton, Lower bounds for induced forests in cubic graphs. Canad. Math. Bull. 30 (2) (1987), 193–199. [6] J. A. Bondy and U. S. R. Murty, Graph Theory. Graduate Texts in Mathematics, vol. 244, Springer, 2008. [7] T. Brylawski and J. Oxley, The broken-circuit complex: its structure and factorizations. European J. Combin. 2 (1981), no. 2, 107–121. [8] W. Bruns and J. Herzog, On multigraded resolutions. Math. Proc. Cambridge Philos. Soc. 118 (1995), 245–257. BROKEN CIRCUIT COMPLEXES AND HYPERPLANE ARRANGEMENTS 21 [9] W. Bruns and J. Herzog, Cohen-Macaulay rings, Revised edition. Cambridge University Press, 1998. [10] D. A. Buchsbaum and D. Eisenbud, Algebra structures for finite free resolutions, and some structure theorems for ideals in codimension 3. Amer. J. Math. 99 (1977), 447–485. [11] M. Cavalière, M. Rossi and G. Valla, On short graded algebras. Lecture Notes in Math., vol. 1430, SpringerVerlag, Berlin, 1990, 21–31. [12] A. Conca, Gröbner bases of powers of ideals of maximal minors. J. Pure and Appl. Alg. 121 (1997), 223–231. [13] G. Denham, M. Garrousian and S. Tohaneanu, Modular decomposition of the Orlik-Terao algebra of a hyperplane arrangement. arXiv:1211.4562, 2012. [14] D. Eisenbud, Commutative algebra with a view toward algebraic geometry. Spinger-Verlag, New York, 1995. [15] D. Eisenbud, S. Popescu and S. Yuzvinsky, Hyperplane arrangement cohomology and monomials in the exterior algebra. Trans. Amer. Math. Soc. 355 (2003), 4365–4383. [16] M. Falk and R. Randell, On the homotopy theory of arrangements II. Adv. Stud. Pure. Math. 27 (2000), 93–125. [17] R. Fröberg, Koszul algebras. Advances in commutative ring theory (Fez, 1997), 337-350, Lecture Notes in Pure and Appl. Math., vol. 205, Dekker, New York, 1999. [18] J. Herzog and T. Hibi, Monomial ideals. Graduate Texts in Mathematics, vol. 260, Springer-Verlag, 2011. [19] M. M. Jambu and S. Papadima, A generalization of fiber-type arrangements and a new deformation method. Topology 37 (1998), 1135–1164. [20] Y. Kamoi, On Gorenstein monomial ideals of codimension three. Rocky Mountain J. Math. 25 (1995), no. 4, 1385–1393. [21] G. Kämpf and T. Römer, Homological properties of Orlik-Solomon algebras. Manuscripta Math. 129 (2009), 181–210. [22] P. Orlik and L. Solomon, Combinatorics and topology of complements of hyperplanes. Invent. Math. 56 (1980), 167–189. [23] P. Orlik and H. Terao, Arrangements of Hyperplanes. Grundlehren Math. Wiss., Bd. 300, Springer-Verlag, BerlinHeidelberg-New York, 1992. [24] P. Orlik and H. Terao, Commutative algebras for arrangements. Nagoya Math. J. 134 (1994), 65–73. [25] J. O’Rourke, Computational Geometry in C, 2nd edition. Cambridge University Press, 1998. [26] J. Oxley, Matroid theory. Oxford Graduate Texts in Mathematics, vol. 3, Oxford University Press, London, 2006. [27] I. Peeva, Graded syzygies. Algebra and Applications, vol. 14, Springer-Verlag London, 2011. [28] J. S. Provan, Decompositions, shellings, and diameters of simplicial complexes and convex polyhedra. Thesis, Cornell Univ., Ithaca, NY, 1977. [29] N. Proudfoot and D. Speyer, A broken circuit ring. Beiträge Algebra Geom. 47 (2006), 161–166. [30] C. Renteria and R. Villarreal, Koszul homology of Cohen-Macaulay rings with linear resolutions. Proc. Amer. Math. Soc. 115 (1992), 51–58. [31] H. Schenck, Hyperplane Arrangements: Computations and Conjectures. arXiv:1101.0356, 2012. [32] H. Schenck and A. Suciu, Lower central series and free resolutions of hyperplane arrangements. Trans. Amer. Math. Soc. 354 (2002), 3409–3433. [33] H. Schenck and S. Tohaneanu, The Orlik-Terao algebra and 2-formality. Math. Res. Lett. 16 (2009), 171–182. [34] B. Shelton and S. Yuzvinsky, Koszul algebras from graphs and hyperplane arrangements. J. London Math. Soc. (2) 56 (1997), 477–490. [35] H. Terao, Algebras generated by reciprocals of linear forms. J. Algebra 250 (2002), 549–558. [36] H.Whitney, A logical expansion in mathematics. Bull. Amer. Math. Soc. 38 (1932), 572–579. [37] H. Wilf, Which polynomials are chromatic?. Proc. 1973 Rome International Colloq. Combinatorial Theory I, pp. 247-257, Accademia Nazionale dei Lincei, Rome, 1976. [38] S. Yuzvinsky, First two obstructions to the freeness of arrangements. Trans. Amer. Math. Soc. 335 (1993), 231– 244. [39] S. Yuzvinsky, Orlik-Solomon algebras in algebra and topology. Russ. Math. Surveys 56 (2001), 293–364. U NIVERSIT ÄT O SNABR ÜCK , I NSTITUT F ÜR M ATHEMATIK , 49069 O SNABR ÜCK , G ERMANY E-mail address: [email protected] U NIVERSIT ÄT O SNABR ÜCK , I NSTITUT F ÜR M ATHEMATIK , 49069 O SNABR ÜCK , G ERMANY E-mail address: [email protected]
0math.AC
S OFT ACTOR -C RITIC : O FF -P OLICY M AXIMUM E NTROPY D EEP R EINFORCEMENT L EARNING WITH A S TOCHASTIC ACTOR Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, Sergey Levine Department of Electrical Engineering and Computer Sciences University of California, Berkeley arXiv:1801.01290v1 [cs.LG] 4 Jan 2018 A BSTRACT Model-free deep reinforcement learning (RL) algorithms have been demonstrated on a range of challenging decision making and control tasks. However, these methods typically suffer from two major challenges: very high sample complexity and brittle convergence properties, which necessitate meticulous hyperparameter tuning. Both of these challenges severely limit the applicability of such methods to complex, real-world domains. In this paper, we propose soft actor-critic, an offpolicy actor-critic deep RL algorithm based on the maximum entropy reinforcement learning framework. In this framework, the actor aims to maximize expected reward while also maximizing entropy—that is, succeed at the task while acting as randomly as possible. Prior deep RL methods based on this framework have been formulated as Q-learning methods. By combining off-policy updates with a stable stochastic actor-critic formulation, our method achieves state-of-the-art performance on a range of continuous control benchmark tasks, outperforming prior on-policy and off-policy methods. Furthermore, we demonstrate that, in contrast to other off-policy algorithms, our approach is very stable, achieving very similar performance across different random seeds. 1 I NTRODUCTION Model-free deep reinforcement learning (RL) algorithms have been applied in a range of challenging domains, from games (Mnih et al., 2013; Silver et al., 2016) to robotic control (Schulman et al., 2015). The combination of RL and high-capacity function approximators such as neural networks holds the promise of automating a wide range of decision making and control tasks, but widespread adoption of these methods in real-world domains has been hampered by two major challenges. First, model-free deep RL methods are notoriously expensive in terms of their sample complexity. Even relatively simple tasks can require millions of steps of data collection, and complex behaviors with high-dimensional observations might need substantially more. Second, these methods are often brittle with respect to their hyperparameters: learning rates, exploration constants, and other settings must be set carefully for different problem settings to achieve good results. Both of these challenges severely limit the applicability of model-free deep RL to real-world tasks. One cause for the poor sample efficiency of deep RL methods is on-policy learning: some of the most commonly used deep RL algorithms, such as TRPO (Schulman et al., 2015) or A3C (Mnih et al., 2016), require new samples to be collected for each gradient step on the policy. This quickly becomes extravagantly expensive, as the number of gradient steps to learn an effective policy increases with task complexity. Off-policy algorithms instead aim to reuse past experience. This is not directly feasible with conventional policy gradient formulations (Schulman et al., 2015; Mnih et al., 2016), but is relatively straightforward for Q-learning based methods (Mnih et al., 2015). Unfortunately, the combination of off-policy learning and high-dimensional, nonlinear function approximation with neural networks presents a major challenge for stability and convergence (Bhatnagar et al., 2009). This challenge is further exacerbated in continuous state and action spaces, where a separate actor network is typically required to perform the maximization in Q-learning. A commonly used algorithm in such settings, deep deterministic policy gradient (DDPG) (Lillicrap et al., 2015), provides for sample-efficient learning, but is notoriously challenging to use due to its extreme brittleness and hyperparameter sensitivity (Duan et al., 2016; Henderson et al., 2017). 1 We explore how to design an efficient and stable model-free deep RL algorithm for continuous state and action spaces. To that end, we draw on the maximum entropy framework, which augments the standard maximum reward reinforcement learning objective with an entropy maximization term (Ziebart et al., 2008; Toussaint, 2009; Rawlik et al., 2012; Fox et al., 2016; Haarnoja et al., 2017). Maximum entropy reinforcement learning alters the RL objective, though the original objective can be recovered by using a temperature parameter (Haarnoja et al., 2017). More importantly, the maximum entropy formulation provides a substantial improvement in exploration and robustness: as discussed by Ziebart (2010), maximum entropy policies are robust in the face of modeling and estimation errors, and as demonstrated by Haarnoja et al. (2017), they improve exploration by acquiring diverse behaviors. Prior work has proposed model-free deep RL algorithms that perform on-policy learning with entropy maximization (O’Donoghue et al., 2016), as well as off-policy methods based on soft Q-learning and its variants (Schulman et al., 2017; Nachum et al., 2017a; Haarnoja et al., 2017). However, the on-policy variants suffer from poor sample complexity for the reasons discussed above, while the off-policy variants require complex approximate inference procedures in continuous action spaces. In this paper, we demonstrate that we can devise an off-policy maximum entropy actor-critic algorithm, which we call soft actor-critic, which provides for both sample-efficient learning and stability. This algorithm extends readily to very complex, high-dimensional tasks, such as the 21-DoF Humanoid benchmark (Duan et al., 2016), where off-policy methods such as DDPG typically struggle to obtain good results (Gu et al., 2016), while avoiding the complexity and potential instability associated with approximate inference in prior off-policy maximum entropy algorithms based on soft Q-learning (Haarnoja et al., 2017). In particular, we present a novel convergence proof for policy iteration in the maximum entropy framework. We then introduce a new algorithm based on an approximation to this procedure that can be practically implemented with deep neural networks, which we call soft actor-critic. We present empirical results that show that soft actor-critic attains a substantial improvement in both performance and sample efficiency over both off-policy and on-policy prior methods. 2 R ELATED W ORK Our soft actor-critic algorithm incorporates three key ingredients: an actor-critic architecture with separate policy and value function networks, an off-policy formulation that enables reuse of previously collected data for efficiency, and entropy maximization to enable stability and exploration. We review prior works that draw on some of these ideas in this section. Actor-critic algorithms are typically derived starting from policy iteration, which alternates between policy evaluation—computing the value function for a policy—and policy improvement—using the value function to obtain a better policy (Barto et al., 1983; Sutton & Barto, 1998). In large-scale reinforcement learning problems, it is typically impractical to run either of these steps to convergence, and instead the value function and policy are optimized jointly. In this case, the policy is referred to as the actor, and the value function as the critic. Many actor-critic algorithms build on the standard, on-policy policy gradient formulation to update the actor (Peters & Schaal, 2008), and many of them also consider the entropy of the policy, but instead of maximizing the entropy, they use it as an regularizer (Schulman et al., 2015; Mnih et al., 2016; Gruslys et al., 2017). This tends to improve stability, but results in very poor sample complexity. There have been efforts to increase the sample efficiency while retaining the robustness properties by incorporating off-policy samples and by using higher order variance reduction techniques (O’Donoghue et al., 2016; Gu et al., 2016). However, fully off-policy algorithms still attain better efficiency. A particularly popular off-policy actor-critic method, DDPG Lillicrap et al. (2015), which is a deep variant of the deterministic policy gradient (Silver et al., 2014) algorithm, uses a Q-function estimator to enable off-policy learning, and a deterministic actor that maximizes this Q-function. As such, this method can be viewed both as a deterministic actor-critic algorithm and an approximate Q-learning algorithm. Unfortunately, the interplay between the deterministic actor network and the Q-function typically makes DDPG extremely difficult to stabilize and brittle to hyperparameter settings (Duan et al., 2016; Henderson et al., 2017). As a consequence, it is difficult to extend DDPG to very complex, high-dimensional tasks, and on-policy policy gradient methods still tend to produce the best results in such settings (Gu et al., 2016). Our method instead combines off-policy actor-critic training with a stochastic actor, and further aims to maximize the entropy of this actor with an entropy maximization objective. We find that this actually results in 2 a substantially more stable and scalable algorithm that, in practice, exceeds both the efficiency and final performance of DDPG. Maximum entropy reinforcement learning optimizes policies to maximize both the expected return and the expected entropy of the policy. This framework has been used in many contexts, from inverse reinforcement learning (Ziebart et al., 2008) to optimal control (Todorov, 2008; Toussaint, 2009; Rawlik et al., 2012). In guided policy search (Levine & Koltun, 2013), maximum entropy distribution is used to guide policy learning towards high-reward regions. More recently, several papers have noted the connection between Q-learning and policy gradient methods in the framework of maximum entropy learning (O’Donoghue et al., 2016; Haarnoja et al., 2017; Nachum et al., 2017a; Schulman et al., 2017). While most of the prior works assume a discrete action space, Nachum et al. (2017b) approximate the maximum entropy distribution with a Gaussian and Haarnoja et al. (2017) with a sampling network trained to draw samples from the optimal policy. Although the soft Q-learning algorithm proposed by Haarnoja et al. (2017) has a value function and actor network, it is not a true actor-critic algorithm: the Q-function is estimating the optimal Q-function, and the actor does not directly affect the Q-function except through the data distribution. Hence, Haarnoja et al. (2017) motivates the actor network as an approximate sampler, rather than the actor in an actor-critic algorithm. Crucially, the convergence of this method hinges on how well this sampler approximates the true posterior. In contrast, we prove that our method converges to the optimal policy from a given policy class, regardless of the policy parameterization. Furthermore, these previously proposed maximum entropy methods generally do not exceed the performance of state-of-the-art off-policy algorithms, such as DDPG, when learning from scratch, though they may have other benefits, such as improved exploration and ease of finetuning. In our experiments, we demonstrate that our soft actor-critic algorithm does in fact exceed the performance of state-of-theart off-policy deep RL methods by a wide margin. 3 P RELIMINARIES In this section, we introduce notation and summarize the standard and maximum entropy reinforcement learning frameworks. 3.1 N OTATION We address policy learning in continuous action spaces. To that end, we consider infinite-horizon Markov decision processes (MDP), defined by the tuple (S, A, ps , r), where the state space S and the action space A are assumed to be continuous, and the unknown state transition probability ps : S × S × A → [0, ∞) represents the probability density of the next state st+1 ∈ S given the current state st ∈ S and action at ∈ A. The environment emits a bounded reward r : S × A → [rmin , rmax ] on each transition, which we will abbreviate as rt , r(st , at ) to simplify notation. We will also use ρπ (st ) and ρπ (st , at ) to denote the state and state-action marginals of the trajectory distribution induced by a policy π(at |st ). 3.2 M AXIMUM E NTROPY R EINFORCEMENT L EARNING The P standard objective used in reinforcement learning is to maximize the expected sum of rewards t E(st ,at )∼ρπ [rt ]. We will consider a more general maximum entropy objective (see e.g. (Ziebart, 2010)), which favors stochastic policies by augmenting the objective with the expected entropy of the policy over ρπ (st ): J(π) = T −1 X E(st ,at )∼ρπ [r(st , at ) + αH(π( · |st ))] . (1) t=0 The temperature parameter α determines the relative importance of the entropy term against the reward, and thus controls the stochasticity of the optimal policy. The maximum entropy objective differs from the standard maximum expected reward objective used in conventional reinforcement learning, though the conventional objective can be recovered in the limit as α → 0. For the rest of this paper, we will omit writing the temperature explicitly, as it can always be subsumed into the reward by scaling it by α−1 . The maximum entropy objective has a number of conceptual and practical advantages. First, the policy is incentivized to explore more widely, while giving up on clearly unpromising avenues. Second, the policy can capture multiple modes of near-optimal 3 behavior. In particular, in problem settings where multiple actions seem equally attractive, the policy will commit equal probability mass to those actions. Lastly, prior work has observed substantially improved exploration from this objective (Haarnoja et al., 2017; Schulman et al., 2017), and in our experiments, we observe that it considerably improves learning speed over state-of-art methods that optimize the conventional objective function. We can extend the objective to infinite horizon problems by introducing a discount factor γ to ensure that the sum of expected rewards and entropies is finite. Writing down the precise maximum entropy objective for the infinite horizon discounted case is more involved (Thomas, 2014) and is deferred to Appendix A. Prior methods have proposed directly solving for the optimal Q-function, from which the optimal policy can be recovered (Ziebart et al., 2008; Fox et al., 2016; Haarnoja et al., 2017). In the next section, we will discuss how we can devise a soft actor-critic algorithm through a policy iteration formulation, where we instead evaluate the Q-function of the current policy and update the policy through an off-policy gradient update. Though such algorithms have previously been proposed for conventional reinforcement learning, our method is, to our knowledge, the first off-policy actor-critic method in the maximum entropy reinforcement learning framework. 4 F ROM S OFT P OLICY I TERATION TO S OFT ACTOR -C RITIC Our off-policy soft actor-critic algorithm can be derived starting from a novel maximum entropy variant of the policy iteration method. In this section, we will first present this derivation, verify that the corresponding algorithm converges to the optimal policy from its density class, and then present a practical deep reinforcement learning algorithm based on this theory. 4.1 D ERIVATION OF S OFT P OLICY I TERATION We will begin by deriving soft policy iteration, a general algorithm for learning optimal maximum entropy policies that alternates between policy evaluation and policy improvement in the maximum entropy framework. Our derivation is based on a tabular setting, to enable theoretical analysis and convergence guarantees, and we extend this method into the general continuous setting in the next section. We will show that soft policy iteration converges to the optimal policy within a set of policies which might correspond, for instance, to a set of parameterized densities. In the policy evaluation step of soft policy iteration, we wish to compute the value of a policy π according to the maximum entropy objective in Equation 1. For a fixed policy, the soft Q-value can be computed iteratively, by starting from any function Q : S × A → R and iteratively applying a modified version of the Bellman backup operator T π defined by T π Q , r(st , at ) + γ Est+1 ∼ps [V (st+1 )] , (2) where V (st ) = Eat ∼π [Q(st , at ) − log π(at |st )] (3) is the soft state value function. We can find the soft value of an arbitrary policy π by repeatingly applying T π as formalized in Lemma 1. Lemma 1 (Soft Policy Evaluation). Consider the soft Bellman backup operator T π in Equation 2 and a mapping Q0 : S × A → R, and define Qk+1 = T π Qk . Then the sequence Qk will converge to the soft Q-value of π as k → ∞. Proof. See Appendix B.1. In the policy improvement step, we update the policy towards the exponential of the new Q-function. This particular choice of update can be guaranteed to result into an improved policy in terms of its soft value, as we show in this section. Since in practice we prefer policies that are tractable, we will additionally restrict the policy to some set of policies Π, which can correspond, for example, to a parameterized family of distributions such as Gaussians. To account for the constraint that π ∈ Π, we project the improved policy into the desired set of policies. While in principle we could choose any projection, it will turn out to be convenient to use the information projection defined in terms of the Kullback-Leibler divergence. In the other words, in the policy improvement step, for each state, we update the policy according to πnew = arg min DKL (π 0 ( · |st ) k exp (Qπold (st , · ) − log Z πold (st ))) . (4) 0 π ∈Π 4 The partition function Z πold (st ) normalizes the second KL argument, and while it is intractable in general, it does not contribute to the gradient with respect to the new policy and can thus be ignored as noted in the next section. For this choice of projection, we can show that the new, projected policy has a higher value than the old policy with respect to the objective in Equation 1. We formalize this result in Lemma 2. Lemma 2 (Soft Policy Improvement). Let πold ∈ Π and let πnew be the optimizer of the minimization problem defined in Equation 4. Then Qπnew (st , at ) ≥ Qπold (st , at ) for all (st , at ) ∈ S × A. Proof. See Appendix B.2. The full soft policy iteration algorithm alternates between the soft policy evaluation and the soft policy improvement steps, and it will provably converge to the optimal maximum entropy policy among the policies in Π (Theorem 1). Although this algorithm will provably find the optimal solution, we can perform it in its exact form only in the tabular case. Therefore, we will next approximate the algorithm for continuous domains, where we need to rely on a function approximator to represent the Q-values, and running the two steps until convergence would be computationally too expensive. The approximation gives rise to a new practical algorithm, called soft actor-critic. Theorem 1 (Soft Policy Iteration). Repeated application of soft policy evaluation and soft policy ∗ improvement to any π ∈ Π converges to a policy π ∗ ( · |st ) such that Qπ (st , at ) > Qπ (st , at ) for all π ∈ Π, π 6= π ∗ and for all (st , at ) ∈ S × A. Proof. See Appendix B.3. 4.2 S OFT ACTOR -C RITIC As discussed above, large, continuous domains require us to derive a practical approximation to soft policy iteration. To that end, we will use function approximators for both the Q-function and policy, and instead of running evaluation and improvement to convergence, alternate between optimizing both networks with stochastic gradient descent. For the remainder of this paper, we will consider a parameterized state value function Vψ (st ), soft Q-function Qθ (st , at ), and a tractable policy πφ (at |st ). The parameters of these networks are ψ, θ, and φ. In the following, we will derive update rules for these parameter vectors. The state value function approximates the soft value. There is no need in principle to include a separate function approximator for the state value, since it is related to the Q-function and policy according to Equation 3. This quantity can be estimated from a single action sample from the current policy without introducing a bias, but in practice, including a separate function approximator for the soft value can stabilize training—and as discussed later, can be used as a state-dependent baseline for learning the policy—and is convenient to train simultaneously with the other networks. The soft value function is trained to minimize the squared residual error   2 1 Vψ (st ) − Eat ∼πφ [Qθ (st , at ) − log πφ (at |st )] , (5) JV (ψ) = Est ∼D 2 where D is the distribution of previously sampled states and actions, or a replay buffer. The gradient of Equation 5 can be estimated with an unbiased estimator ˆ ψ JV (ψ) = ∇ψ Vψ (st ) (Vψ (st ) − Qθ (st , at ) + log πφ (at |st )) , ∇ (6) where the actions are sampled according to the current policy, instead of the replay buffer. The soft Q-function parameters can be trained to minimize the soft Bellman residual    2 1 JQ (θ) = E(st ,at )∼D Qθ (st , at ) − r(st , at ) + γ Est+1 ∼ps Vψ̄ (st+1 ) , (7) 2 which again can be optimized with stochastic unbiased gradients  ˆ θ JQ (θ) = ∇θ Qθ (at , st ) Qθ (st , at ) − r(st , at ) − γVψ̄ (st+1 ) . ∇ (8) The update makes use of a target value network Vψ̄ where ψ̄ is an exponentially moving average of the value network weights, which has been shown to stabilize training (Mnih et al., 2015), although 5 we found soft actor-critic to be able to learn robustly also in the absense of a target network. Finally, the policy parameters can be learned by directly minimizing the KL-divergence in Equation 4, which we reproduce here in parametrized form for completeness Jπ (φ) = DKL (πφ ( · |st ) k exp (Qθ (st , · ) − log Zθ (st ))) . (9) There are several options for minimizing Jπ , depending on the choice of the policy class. For simple distributions, such as Gaussians, we can use the reparametrization trick, which allows us to backpropagate the gradient from the critic network and leads to a DDPG-style estimator. However, if the policy depends on discrete latent variables, such as is the case for mixture models, the reparametrization trick cannot be used. We therefore propose to use a likelihood ratio gradient estimator: ∇φ Jπ (φ) = Eat ∼πφ [∇φ log πφ (at |st ) (log πφ (at |st )+1−Qθ (st , at )+log Zθ (st )+b(st ))] , (10) where b(st ) is a state-dependent baseline (Peters & Schaal, 2008). We can approximately center the learning signal and eliminate the intractable log-partition function by choosing b(st ) = Vψ (st ) − log Zθ (st ) − 1, which yields the final gradient estimator ˆ φ Jπ (φ) = ∇φ log πφ (at |st ) (log πφ (at |st ) − Qθ (st , at ) + Vψ (st )) . ∇ The complete algorithm is described in Algorithm 1. The method alternates between collecting experience from the environment with the current policy and updating the function approximators using the stochastic gradients on batches sampled from a replay buffer. In practice we found a combination of a single environment step and multiple gradient steps to work best (see Appendix E). Using off-policy data from a replay buffer is feasible because both value estimators and the policy can be trained entirely on offpolicy data. The algorithm is agnostic to the parameterization of the policy, as long as it can be evaluated for any arbitrary state-action tuple. We will next suggest a practical parameterization for the policy, based on Gaussian mixtures. 4.3 (11) Algorithm 1: Soft Actor-Critic 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Initialize parameter vectors ψ, ψ̄, θ, φ. for each iteration do for each environment step do at ∼ πφ (at |st ) st+1 ∼ ps (st+1 |st , at ) D ← D∪{(st , at , r(st , at ), st+1 )} . end for each gradient step do ˆ ψ JV (ψ) ψ ← ψ − λV ∇ ˆ θ JQ (θ) θ ← θ − λQ ∇ ˆ φ Jπ (φ) φ ← φ − λπ ∇ ψ̄ ← τ ψ + (1 − τ )ψ̄ end end S OFT ACTOR -C RITIC WITH G AUSSIAN M IXTURES Although we could use a simple policy represented by a Gaussian, as is common in prior work, the maximum entropy framework aims to maximize the randomness of the learned policy. Therefore, a more expressive but still tractable distribution can endow our method with more effective exploration and robustness, which are the typically cited benefits of entropy maximization (Ziebart, 2010). To that end, we propose a practical multimodal representation based on a mixture of K Gaussians. This can approximate any distribution to arbitrary precision as K → ∞, but even for practical numbers of mixture elements, it can provide a very expressive distribution in medium-dimensional action spaces. Although the complexity of evaluating or sampling from the resulting distribution scales linearly in K, our experiments indicates that a relatively small number of mixture components, typically just two or four, is sufficient to achieve high performance, thus making the algorithm scalable to complex domains with high-dimensional action spaces. We define the policy as πφ (at |st ) = P 1 K X φ i wi i=1   wiφ (st )N at ; µφi (st ), Σφi (st ) , (12) where wiφ , µφi , Σφi are the unnormalized mixture weights, means, and covariances, respectively, which all can depend on st in complex ways if expressed as neural networks. We also apply a squashing function to limit the actions to a bounded interval as explained in Appendix C. Note that, in contrast to soft Q-learning (Haarnoja et al., 2017), our algorithm does not assume that the policy can accurately approximate the optimal exponentiated Q-function distribution. The convergence result for soft policy iteration holds even for policies that are restricted to a policy class, in contrast to prior methods of this type. 6 (a) Swimmer (rllab) Swimmer (rllab) (b) Hopper-v1 Hopper-v1 200 100 50 total return total return total return 10000 2500 150 2000 1500 1000 0.0 0.1 0.2 0.3 million steps 0.4 0 0.5 (d) Walker2d-v1 Walker2d-v1 1.0 million steps 1.5 1000 0 (e) Ant-v1 Ant-v1 1000 500 2 3 million steps 4 5 6 8 10 1500 1000 500 0 500 1 4 million steps DDPG TRPO SQL SAC 2000 1500 2 (f) Humanoid (rllab) Humanoid (rllab) 2500 0 0 4000 2.0 total return total return total return 2000 0 0.5 2000 3000 6000 0 0.0 2500 4000 8000 2000 500 0 (c) HalfCheetah-v1 HalfCheetah-v1 12000 3000 0 2 4 6 million steps 8 10 0 5 10 million steps 15 20 Figure 1: Training curves on continuous control benchmarks. Note that SAC performs consistently across all tasks attaining the highest score compared to both on-policy and off-policy methods in all benchmark tasks. 5 E XPERIMENTS The goal of our experimental evaluation is to understand how the sample complexity and stability of our method compares with prior off-policy and on-policy deep reinforcement learning algorithms. To that end, we evaluate on a range of challenging continuous control tasks from the OpenAI gym benchmark suite (Brockman et al., 2016). For the Swimmer and Humanoid environments, we use the rllab implementations (Duan et al., 2016), which have more well-behaved observation spaces. Although the easier tasks in this benchmark suite can be solved by a wide range of different algorithms, the more complex benchmarks, such as the 21-dimensional Humanoid, are exceptionally difficult to solve with off-policy algorithms (Duan et al., 2016). The stability of the algorithm also plays a large role in performance: easier tasks make it more practical to tune hyperparameters to achieve good results, while the already narrow basins of effective hyperparameters become prohibitively small for the more sensitive algorithms on the most high-dimensional benchmarks, leading to poor performance (Gu et al., 2016). The source code of our SAC implementation is available online1 . In our comparisons, we compare to trust region policy optimization (TRPO) (Schulman et al., 2015), a stable and effective on-policy policy gradient algorithm; deep deterministic policy gradient (DDGP) (Lillicrap et al., 2015), an algorithm that is regarded as one of the more efficient off-policy deep RL methods (Duan et al., 2016); as well as soft Q-learning (SQL) (Haarnoja et al., 2017), an off-policy algorithm for learning maximum entropy policies. Although DDPG is very efficient, it is also known to be more sensitive to hyperparameter settings, which limits its effectiveness on complex tasks (Gu et al., 2016; Henderson et al., 2017). Figure 1 shows the total average reward of evaluation rollouts during training for the various methods. Exploration noise was turned off for evaluation for DDPG and TRPO. For maximum entropy algorithms, which do not explicitly inject exploration noise, we either evaluated with the exploration noise (SQL) or approximate the maximum a posteriori action by choosing the mean of the mixture component that achieves the highest Q-value (SAC). 5.1 C OMPARATIVE E VALUATION Performance across tasks. The results show that, overall, SAC substantially outperforms DDPG on all of the benchmark tasks in terms of final performance, and learns faster than any of the baselines in most environments. The only exceptions are Swimmer, where DDPG is slightly faster, and Ant-v1, where SQL is initially faster, but plateaus at a lower final performance. On the hardest tasks, Ant-v1 and Humanoid (rllab), DDPG is unable to make any progress, a result that is corroborated by prior work (Gu et al., 2016; Duan et al., 2016). SAC still learns substantially faster than TRPO on these tasks, likely as a consequence of improved stability. Poor stability is exacerbated by highdimensional and complex tasks. Even though TRPO does not make perceivable progress for some tasks within the range depicted in the figures, it will eventually solve all of them after substantially 1 Code: github.com/haarnoja/sac. 7 more iterations. The quantitative results attained by SAC in our experiments also compare very favorably to results reported by other methods in prior work (Duan et al., 2016; Gu et al., 2016; Henderson et al., 2017), indicating that both the sample efficiency and final performance of SAC on these benchmark tasks exceeds the state of the art. All hyperparameters used in this experiment for SAC are listed in Appendix E. total return HalfCheetah-v1 Sensitivity to random seeds. In Figure 2, we 12000 show the performance for multiple individual seeds DDPG 10000 TRPO on the HalfCheetah-v1 benchmark of DDPG, TRPO, SAC and SAC (Figure 1 shows the average over seeds). 8000 The individual seeds attain much more consistent 6000 performance with SAC, while DDPG exhibits very 4000 high variability across seeds, indicating substantially worse stability. TRPO is unable to make progress 2000 within the first 1000 episodes. For SAC, we per0 formed 16 gradient steps between each environment step, which becomes prohibitively slow in terms of 0 200 400 600 800 1000 episodes wall clock time for longer experiments (in Figure 1 Figure 2: Performance of individual random we used we used 4 gradient steps). seeds on the HalfCheetah-v1 benchmark. 5.2 A BLATION S TUDY The results in the previous section suggest that algorithms based on the maximum entropy principle can outperform conventional RL methods on challenging tasks such as the Ant and Humanoid. In this section, we further examine which particular components of SAC are important for good performance. To that end, we consider several ablations to pinpoint the most essential differences between our method and standard RL methods that do not maximize entropy. We use DDPG as the representative non-entropy-maximizing algorithm, since it is the most structurally similar to SAC. This section examines specific algorithm components, while a study of the sensitivity to hyperparameter settings—most importantly the reward scale and the number of gradient steps per environment step—is deferred to Appendix D. Importance of entropy maximization. The main difference of SAC and DDPG is the inclusion of entropy maximization in the objective. The entropy appears in both the policy and value function. In the policy, it prevents premature convergence of the policy variance (Equation 9). In the value function, it encourages exploration by increase the value of regions of state space that lead to highentropy behavior (Equation 5). Figure 3a compares how inclusion of this term in the policy and value updates affects the performance, by removing the entropy from each one in turn. As evident from the figure, including the entropy in the policy objective is crucial, while maximizing the entropy as part of the value function is less important, and can even hinder learning in the beginning of training. Exploration noise. Another difference is the exploration noise: the maximum entropy framework naturally gives rise to Boltzmann exploration for SAC, whereas DDPG uses external OU noise (Uhlenbeck & Ornstein, 1930; Lillicrap et al., 2015). For the next experiment, we used a policy (a) Entropy (b) Exploration Noise (c) Value Function Figure 3: We tested the importance of entropy maximization, Boltzmann exploration, and the separate value network. (a) The label of each curve denotes which entropy terms (KL divergence and/or value function update) were included in the policy and value objectives. (b) The blue curve corresponds to the unaltered SAC with Boltzmann exploration, the green and red curves were obtained by using OU exploration noise with the given parameters. (c) Contribution of a separate value function target network in the TD updates and as a policy gradient baseline. 8 with single mixture component and compared Boltzmann exploration to exploration via external OU noise (Figure 3b). We repeated the experiment with the OU noise parameters that we used with DDPG (θ = 0.15, σ = 0.3), and parameters that we found worked best for SAC without Boltzmann exploration (θ = 1, σ = 0.3). The results indicate that Boltzmann exploration outperforms external OU noise. Separate value network. Our method also differs from DDPG in that it uses a separate network to predict the state values, in addition to the Q-values. The value network serves two purposes: it is used to bootstrap the TD updates for learning the Q-function (Equation 7), and it serves as a baseline to reduce variance of the policy gradients (Equation 11). The results in Figure 3c indicates that the value network has an important role in the policy gradient, but only has a minor effect on the TD updates. Nevertheless, the best performance is achieved when the value network is employed for both purposes. From SAC to DDPG. Soft actor-critic closely resembles DDPG with a stochastic actor. To study which of the components that differs between the two algorithms are most important, we evaluated a range of SAC variants by swapping components of SAC with their DDPG counterparts. In Figure 4 we evaluate four versions obtained through incremental modifications: 1) original SAC, 2) replaced likelihood ratio policy gradient estimator with an estimator obtained through the reparametrization trick, 3) replaced the stochastic policy with a deterministic policy and Boltzmann exploration with OU noise, and 4) eliminated the separate value network by using directly the Q-function evaluated at the mean Figure 4: We modified the SAC implementation action. The figure suggests two interesting points: to make it identical to DDPG by applying a seFirst, the reparametrization trick yields somewhat quence of incremental modifications. faster and more stable learning compared to the use of likelihood policy gradient estimator, though this precludes the use of multimodal mixtures of Gaussians. Second, use of a deterministic policy degrades performance substantially in terms of both average return (thick line) and variance across random seeds (shaded region). This observation indicates that entropy maximization, and particularly the use of a stochastic policy, can make offpolicy deep RL significantly more robust and efficient compared to algorithms that maximizes the expected return, especially with deterministic policies. 6 C ONCLUSION We presented soft actor-critic (SAC), an off-policy maximum entropy deep reinforcement learning algorithm that provides sample-efficient learning while retaining the benefits of entropy maximization and stability. Our theoretical results derive soft policy iteration, which we show to converge to the optimal policy. From this result, we can formulate a soft actor-critic algorithm, and we empirically show that it outperforms state-of-the-art model-free deep RL methods, including the off-policy DDPG algorithm and the on-policy TRPO algorithm. In fact, the sample efficiency of this approach actually exceeds that of DDPG by a substantial margin. Our results suggest that stochastic, entropy maximizing reinforcement learning algorithms can provide a promising avenue for improved robustness and stability, and further exploration of maximum entropy methods, including methods that incorporate second order information (e.g., trust regions (Schulman et al., 2015)) or more expressive policy classes is an exciting avenue for future work. ACKNOWLEDGMENTS We thank Vitchyr Pong for his help in implementing SAC and providing the DDPG baseline code. This work was supported by Siemens and Berkeley DeepDrive. 9 R EFERENCES A. G. Barto, R. S. Sutton, and C. W. Anderson. Neuronlike adaptive elements that can solve difficult learning control problems. IEEE transactions on systems, man, and cybernetics, (5):834–846, 1983. S. Bhatnagar, D. Precup, D. Silver, R. S Sutton, H. R Maei, and C. Szepesvári. Convergent temporaldifference learning with arbitrary smooth function approximation. In Advances in Neural Information Processing Systems, pp. 1204–1212, 2009. G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. OpenAI gym. arXiv preprint arXiv:1606.01540, 2016. Y. Duan, R. Chen, X. Houthooft, J. Schulman, and P. Abbeel. Benchmarking deep reinforcement learning for continuous control. In Proceedings of the 33rd International Conference on Machine Learning (ICML), 2016. R. Fox, A. Pakman, and N. Tishby. Taming the noise in reinforcement learning via soft updates. In Conf. on Uncertainty in Artificial Intelligence, 2016. A. Gruslys, M. G. Azar, M. G. Bellemare, and R. Munos. The reactor: A sample-efficient actor-critic architecture. arXiv preprint arXiv:1704.04651, 2017. S. Gu, T. Lillicrap, Z. Ghahramani, R. E. Turner, and S. Levine. Q-prop: Sample-efficient policy gradient with an off-policy critic. arXiv preprint arXiv:1611.02247, 2016. S. Gu, E. Holly, T. Lillicrap, and S. Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 3389–3396. IEEE, 2017. T. Haarnoja, H. Tang, P. Abbeel, and S. Levine. Reinforcement learning with deep energy-based policies. arXiv preprint arXiv:1702.08165, 2017. P. Henderson, R. Islam, P. Bachman, J. Pineau, D. Precup, and D. Meger. Deep reinforcement learning that matters. arXiv preprint arXiv:1709.06560, 2017. S. Levine and V. Koltun. Guided policy search. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pp. 1–9, 2013. T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. V. Mnih, K. Kavukcuoglu, D. Silver, A. A Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. P. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In Int. Conf. on Machine Learning, 2016. O. Nachum, M. Norouzi, K. Xu, and D. Schuurmans. Bridging the gap between value and policy based reinforcement learning. arXiv preprint arXiv:1702.08892, 2017a. O. Nachum, M. Norouzi, K. Xu, and D. Schuurmans. Trust-PCL: An off-policy trust region method for continuous control. arXiv preprint arXiv:1707.01891, 2017b. B. O’Donoghue, R. Munos, K. Kavukcuoglu, and V. Mnih. PGQ: Combining policy gradient and Q-learning. arXiv preprint arXiv:1611.01626, 2016. J. Peters and S. Schaal. Reinforcement learning of motor skills with policy gradients. Neural networks, 21(4):682–697, 2008. 10 I. Popov, N. Heess, T. Lillicrap, R. Hafner, G. Barth-Maron, M. Vecerik, T. Lampe, Y. Tassa, T. Erez, and M. Riedmiller. Data-efficient deep reinforcement learning for dexterous manipulation. arXiv preprint arXiv:1704.03073, 2017. K. Rawlik, M. Toussaint, and S. Vijayakumar. On stochastic optimal control and reinforcement learning by approximate inference. Proceedings of Robotics: Science and Systems VIII, 2012. J. Schulman, S. Levine, P. Abbeel, M. I. Jordan, and P. Moritz. Trust region policy optimization. In Int. Conf on Machine Learning, pp. 1889–1897, 2015. J. Schulman, P. Abbeel, and X. Chen. Equivalence between policy gradients and soft Q-learning. arXiv preprint arXiv:1704.06440, 2017. D. Silver, G. Lever, N. Heess, T. Degris, D. Wierstra, and M. Riedmiller. Deterministic policy gradient algorithms. In Int. Conf on Machine Learning, 2014. D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. van den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, S. Dieleman, D. Grewe, J. Nham, N. Kalchbrenner, I. Sutskever, T. Lillicrap, M. Leach, K. Kavukcuoglu, T. Graepel, and D. Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, Jan 2016. ISSN 0028-0836. Article. R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998. P. Thomas. Bias in natural actor-critic algorithms. In Int. Conf. on Machine Learning, pp. 441–448, 2014. E. Todorov. General duality between optimal control and estimation. In IEEE Conf. on Decision and Control, pp. 4286–4292. IEEE, 2008. M. Toussaint. Robot trajectory optimization using approximate inference. In Int. Conf. on Machine Learning, pp. 1049–1056. ACM, 2009. G. E. Uhlenbeck and L. S. Ornstein. On the theory of the Brownian motion. Physical review, 36(5): 823, 1930. B. D. Ziebart. Modeling purposeful adaptive behavior with the principle of maximum causal entropy. PhD thesis, 2010. B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey. Maximum entropy inverse reinforcement learning. In AAAI Conference on Artificial Intelligence, pp. 1433–1438, 2008. 11 A M AXIMUM E NTROPY O BJECTIVE The exact definition of the discounted maximum entropy objective is complicated by the fact that, when using a discount factor for policy gradient methods, we typically do not discount the state distribution, only the rewards. In that sense, discounted policy gradients typically do not optimize the true discounted objective. Instead, they optimize average reward, with the discount serving to reduce variance, as discussed by Thomas (2014). However, we can define the objective that is optimized under a discount factor as "∞ # ∞ X X l−t J(π) = E(st ,at )∼ρπ γ Esl ∼ps ,al ∼π [r(st , at ) + αH(π( · |st ))|st , at ] . (13) t=0 l=t This objective corresponds to maximizing the discounted expected reward and entropy for future states originating from every state-action tuple (st , at ) weighted by its probability ρπ under the current policy. B B.1 P ROOFS L EMMA 1 Lemma 1 (Soft Policy Evaluation). Consider the soft Bellman backup operator T π in Equation 2 and a mapping Q0 : S × A → R, and define Qk+1 = T π Qk . Then the sequence Qk will converge to the soft Q-value of π as k → ∞. Proof. Define the entropy augmented reward as rπ (st , at ) , r(st , at ) + Est+1 ∼ps [H (π( · |st+1 ))] and rewrite the update rule as Q(st , at ) ← rπ (st , at ) + γ Est+1 ∼ps ,at+1 ∼π [Q(st+1 , at+1 )] (14) and apply the standard convergence results for policy evaluation (Sutton & Barto, 1998). B.2 L EMMA 2 Lemma 2 (Soft Policy Improvement). Let πold ∈ Π and let πnew be the optimizer of the minimization problem defined in Equation 4. Then Qπnew (st , at ) ≥ Qπold (st , at ) for all (st , at ) ∈ S × A. Proof. Let πold ∈ Π and let Qπold and V πold be the corresponding soft state-action value and soft state value, and let πnew be defined as πnew ( · |st ) = arg min DKL (π 0 ( · |st ) k exp (Qπold (st , · ) − log Z πold (st ))) 0 π ∈Π = arg min Jπold (π 0 ( · |st )). 0 π ∈Π (15) It must be the case that Jπold (πnew ( · |st )) ≤ Jπold (πold ( · |st )), since we can always choose πnew = πold ∈ Π. Hence Eat ∼πnew [log πnew (at |st ) − Qπold (st , at ) + log Z πold (st )] ≤ Eat ∼πold [log πold (at |st ) − Qπold (st , at ) + log Z πold (st )], (16) and since partition function Z πold depends only on the state, the inequality reduces to Eat ∼πnew [Qπold (st , at ) − log πnew (at |st )] ≥ V πold (st ). (17) Next, consider the soft Bellman equation: Qπold (st , at ) = r(st , at ) + γ Est+1 ∼ps [V πold (st+1 )]   ≤ r(st , at ) + γ Est+1 ∼ps Eat+1 ∼πnew [Qπold (st+1 , at+1 ) − log πnew (at+1 |st+1 )] .. . ≤ Qπnew (st , at ), (18) where we have repeatedly expanded Qπold on the RHS by applying the soft Bellman equation and the bound in Equation 17. Convergence to Qπnew follows from Lemma 1. 12 B.3 T HEOREM 1 Theorem 1 (Soft Policy Iteration). Repeated application of soft policy evaluation and soft policy ∗ improvement to any π ∈ Π converges to a policy π ∗ ( · |st ) such that Qπ (st , at ) > Qπ (st , at ) for all π ∈ Π, π 6= π ∗ and for all (st , at ) ∈ S × A. Proof. Let πi be the policy at iteration i. By Lemma 2, the sequence Qπi is monotonically increasing. Since Qπ is bounded above for π ∈ Π (both the reward and entropy are bounded), the sequence converges to some π ∗ . We will still need to show that π ∗ is indeed optimal. At convergence, it must be case that Jπ∗ (π ∗ ( · |st )) < Jπ∗ (π( · |st )) for all π ∈ Π, π 6= π ∗ . Using the same iterative ∗ argument as in the proof of Lemma 2, we get Qπ (st , at ) > Qπ (st , at ) for all (st , at ) ∈ S × A, that is, the soft value of any other policy in Π is lower than that of the converged policy. Hence π ∗ is optimal in Π. C E NFORCING ACTION B OUNDS We use an unbounded GMM as the action distribution. However, in practice, the actions needs to be bounded to a finite interval. To that end, we apply an invertible squashing function (tanh) to the GMM samples, and employ the change of variables formula to compute the likelihoods of the bounded actions. In the other words, let u ∈ RD be a random variable and µ(u|s) the corresponding density with infinite support. Then a = tanh(u), where tanh is applied elementwise, is a random variable with support in (−1, 1) with a density given by  π(a|s) = µ(u|s) det da du  −1 . (19) Since the Jacobian da/du = diag(1 − tanh2 (u)) is diagonal, the log-likelihood has a simple form log π(a|s) = log µ(u|s) − D X  log 1 − tanh2 (ui ) , (20) i=1 where ui is the ith element of u. D S ENSITIVITY TO H YPERPARAMETERS This section discusses the sensitivity to hyperparameters. All of the following experiments are on the HalfCheetah-v1 benchmark, and although we found these results to be representative in most cases, they may differ between the environments. For other environments, we only swept over the reward scale only. Reward scale. Soft actor-critic is particularly sensitive to the reward magnitude, because it serves the role of the temperature of the energy-based optimal policy and thus controls its stochasticity. Figure 5a shows how learning performance changes when the reward scale is varied: For small reward magnitudes, the policy becomes nearly uniform, and consequently the fails to exploit the reward signal, resulting in substantial degradation of performance. For large reward magnitudes, the model learns quickly at first, but the policy quickly becomes nearly deterministic, leading to poor exploration and subsequent failure due to lack of adequate exploration. With the right reward magnitude, the model balances exploration and exploitation, leading to fast and stable learning. In practice, we found reward scale to be the only hyperparameter that requires substantial tuning, and since this parameter has a natural interpretation in the maximum entropy framework, this provides good intuition for how to adjust this parameter. Mixture components. We experimented with different numbers of mixture components in the Gaussian mixture policy (Figure 5b). We found that the number of components did not affect the learning performance very much, though larger numbers of components consistently attained somewhat better results. 13 (a) Reward Scale (b) Mixture Components (c) Policy Evaluation 12000 SAC test SAC training total return 10000 8000 6000 4000 2000 0 0 (d) Target Update (e) Replay Buffer Size 2 4 6 million steps 8 10 (f) Gradient Steps Figure 5: Sensitivity of soft actor-critic to selected hyperparameters in the HalfCheetah-v1 task. See Appendix D for more detailed analysis. Policy evaluation. Since SAC converges to stochastic policies, it is generally beneficial to make the final policy deterministic at the end for best performance. For evaluation, we approximate the maximum a posteriori action by choosing the action that maximizes the Q-function among the mixture component means. Figure 5c compares training returns to test returns obtained with this strategy. The test returns are substantially better. It should be noted that all of the training curves depict the sum of rewards, which is different from the objective optimized by SAC and SQL which both maximize also the entropy. Target network update. In Figure 5d we varied the smoothing constant, τ , for the target value network updates. A value of one corresponds to a hard update where the weights are copied directly at every iteration, and values close to zero correspond to exponentially moving average of the network weights. Interestingly, SAC is relatively insensitive to the smoothing constant: smaller τ tends to yield higher performance at the end with the cost of marginally slower progress in the beginning, but the difference is small. In prior work, the main use of the target network was to stabilize training (Mnih et al., 2015; Lillicrap et al., 2015), but interestingly, SAC is able to learn stably also when effectively no separate target network is used, but instead the weights are copied directly (τ = 1), although at the cost of minor degradation of performance. Replay buffer size. Next, we experimented with the size of the experience replay buffer (Figure 5e), which we found to be important for environments where the optimal policy becomes nearly deterministic at convergence, such as HalfCheetah-v1. For such environments, the exploration noise becomes negligible at the end, making the content of the replay buffer less diverse and resulting in overfitting and instability. Use of a higher capacity buffer solves this problem by allowing the method to remember the failures from the beginning of learning, but slows down learning by allocating some of the network capacity to modeling the suboptimal initial experience. Note that a return of just 4800 is considered as the threshold level for solving this benchmark task and that the performance in all cases is well beyond the threshold. We used a buffer size of 10 million samples for HalfCheetah-v1, and 1 million samples for the other environments. Gradient steps per time step. Finally, we experimented with the number of actor and critic gradient steps per time step of the algorithm (Figure 5f). Prior work has observed that increasing the number of gradient steps for DDPG tends to improve sample efficiency (Gu et al., 2017; Popov et al., 2017), but only up to a point. We found 4 gradient updates per time step to be optimal for DDPG, before we saw degradation of performance. SAC is able to effectively benefit from substantially larger numbers of gradient updates in most environments, with performance increasing steadily until 16 gradient updates per step. In some environments, such as Humanoid, we did not observe as much benefit. The ability to take multiple gradient steps without negatively affecting the algorithm is important especially for learning in the real world, where experience collection is the bottleneck, 14 and it is typical to run the learning script asynchronously in a separate thread. In this experiment, we used a replay buffer size of 1 million samples, and therefore the performance suddenly drops after reaching a return of approximately 10 thousand due to the reason discussed in the previous section. E H YPERPARAMETERS Table 1 lists the common SAC parameters used in the comparative evaluation in Figure 1, and Table 2 lists the parameters that varied across the environments. Table 1: Shared Parameters Parameter learning rate discount target smoothing coefficient number of mixture components number of layers (3 networks) number of hidden units per layer Symbol γ τ K Value 3 · 10−4 0.99 0.01 4 2 128 Table 2: Environment Specific Parameters Environment Swimmer (rllab) Hopper-v1 HalfCheetah-v1 Walker2d-v1 Ant-v1 Humanoid (rllab) DoFs 2 3 6 6 8 21 Reward Scale 100 1 1 3 3 3 15 Gradient Steps 4 4 4 4 1 1 Replay Pool Size 106 106 107 106 106 106
2cs.AI
On Polymorphic Sessions and Functions A Tale of Two (Fully Abstract) Encodings arXiv:1711.00878v2 [cs.LO] 25 Jan 2018 Bernardo Toninho and Nobuko Yoshida Department of Computing, Imperial College London, United Kingdom Abstract. This work exploits the logical foundation of session types to determine what kind of type discipline for the π-calculus can exactly capture, and is captured by, λ-calculus behaviours. Leveraging the proof theoretic content of the soundness and completeness of sequent calculus and natural deduction presentations of linear logic, we develop the first mutually inverse and fully abstract processes-as-functions and functionsas-processes encodings between a polymorphic session π-calculus and a linear formulation of System F. We are then able to derive results of the session calculus from the theory of the λ-calculus: (1) we obtain a characterisation of inductive and coinductive session types via their algebraic representations in System F; and (2) we extend our results to account for value and process passing, entailing strong normalisation. 1 Introduction Dating back to Milner’s seminal work [29], encodings of λ-calculus into π-calculus are seen as essential benchmarks to examine expressiveness of various extensions of the π-calculus. Milner’s original motivation was to demonstrate the power of link mobility by decomposing higher-order computations into pure name passing. Another goal was to analyse functional behaviours in a broad computational universe of concurrency and non-determinism. While operationally correct encodings of many higher-order constructs exist, it is challenging to obtain encodings that are precise wrt behavioural equivalence: the semantic distance between the λ-calculus and the π-calculus typically requires either restricting process behaviours [45] (e.g. via typed equivalences [5]) or enriching the λ-calculus with constants that allow for a suitable characterisation of the term equivalence induced by the behavioural equivalence on processes [43]. Encodings in π-calculi also gave rise to new typing disciplines: Session types [20,22], a typing system that is able to ensure deadlock-freedom for communication protocols between two or more parties [23], were originally motivated “from process encodings of various data structures in an asynchronous version of the π-calculus” [21]. Recently, a propositions-as-types correspondence between linear logic and session types [8,9,54] has produced several new developments and logically-motivated techniques [49,54,7,26] to augment both the theory and practice of session-based message-passing concurrency. Notably, parametric session polymorphism [7] (in the sense of Reynolds [41]) has been proposed and a corresponding abstraction theorem has been shown. 2 Our work expands upon the proof theoretic consequences of this propositions-as-types correspondence to address the problem of how to exactly match the behaviours induced by session π-calculus encodings of the λ-calculus with those of the λ-calculus. We develop mutually inverse and fully abstract encodings (up to typed observational congruences) between a polymorphic session-typed π-calculus and the polymorphic λ-calculus. The encodings arise from the proof theoretic content of the equivalence between sequent calculus (i.e. the session calculus) and natural deduction (i.e. the λ-calculus) for second-order intuitionistic linear logic, greatly generalising [49]. While fully abstract encodings between λ-calculi and π-calculi have been proposed (e.g. [5,43]), our work is the first to consider a two-way, both mutually inverse and fully abstract embedding between the two calculi by crucially exploiting the linear logic-based session discipline. This also sheds some definitive light on the nature of concurrency in the (logical) session calculi, which exhibit “don’t care” forms of non-determinism (e.g. processes may race on stateless replicated servers) rather than “don’t know” non-determinism (which requires less harmonious logical features [2]). In the spirit of Gentzen [14], we use our encodings as a tool to study nontrivial properties of the session calculus, deriving them from results in the λcalculus: We show the existence of inductive and coinductive sessions in the polymorphic session calculus by considering the representation of initial F -algebras and final F -coalgebras [28] in the polymorphic λ-calculus [1,19] (in a linear setting [6]). By appealing to full abstraction, we are able to derive processes that satisfy the necessary algebraic properties and thus form adequate uniform representations of inductive and coinductive session types. The derived algebraic properties enable us to reason about standard data structure examples, providing a logical justification to typed variations of the representations in [30]. We systematically extend our results to a session calculus with λ-term and process passing (the latter being the core calculus of [50], inspired by Benton’s LNL [4]). By showing that our encodings naturally adapt to this setting, we prove that it is possible to encode higher-order process passing in the firstorder session calculus fully abstractly, providing a typed and proof-theoretically justified re-envisioning of Sangiorgi’s encodings of higher-order π-calculus [46]. In addition, the encoding instantly provides a strong normalisation property of the higher-order session calculus. Contributions and the outline of our paper are as follows: § 3.1 develops a functions-as-processes encoding of a linear formulation of System F, Linear-F, using a logically motivated polymorphic session π-calculus, Polyπ, and shows that the encoding is operationally sound and complete. § 3.2 develops a processes-as-functions encoding of Polyπ into Linear-F, arising from the completeness of the sequent calculus wrt natural deduction, also operationally sound and complete. § 3.3 studies the relationship between the two encodings, establishing they are mutually inverse and fully abstract wrt typed congruence, the first two-way embedding satisfying both properties. 3 § 4 develops a faithful representation of inductive and coinductive session types in Polyπ via the encoding of initial and final (co)algebras in the polymorphic λ-calculus. We demonstrate a use of these algebraic properties via examples. § 4.2,4.3 study term-passing and process-passing session calculi, extending our encodings to provide embeddings into the first-order session calculus. We show full abstraction and mutual inversion results, and derive strong normalisation of the higher-order session calculus from the encoding. In order to introduce our encodings, we first overview Polyπ, its typing system and behavioural equivalence (§ 2). We discuss related work and conclude with future work (§ 5). Detailed proofs can be found in [52]. 2 Polymorphic Session π-Calculus This section summarises the polymorphic session π-calculus [7], dubbed Polyπ, arising as a process assignment to second-order linear logic [15], its typing system and behavioural equivalences. 2.1 Processes and Typing Syntax. Given an infinite set Λ of names x, y, z, u, v, the grammar of processes P, Q, R and session types A, B, C is defined by: P, Q, R ::= xhyi.P | x(y).P | P | Q | (νy)P | [x ↔ y] |0 | xhAi.P | x(Y ).P | x.inl; P | x.inr; P | x.case(P, Q) | !x(y).P A, B ::= 1 | A ⊸ B | A ⊗ B | A & B | A ⊕ B | !A | ∀X.A | ∃X.A | X xhyi.P denotes the output of channel y on x with continuation process P ; x(y).P denotes an input along x, bound to y in P ; P | Q denotes parallel composition; (νy)P denotes the restriction of name y to the scope of P ; 0 denotes the inactive process; [x ↔ y] denotes the linking of the two channels x and y (implemented as renaming); xhAi.P and x(Y ).P denote the sending and receiving of a type A along x bound to Y in P of the receiver process; x.inl; P and x.inr; P denote the emission of a selection between the left or right branch of a receiver x.case(P, Q) process; !x(y).P denotes an input-guarded replication, that spawns replicas upon receiving an input along x. We often abbreviate (νy)xhyi.P to xhyi.P and omit trailing 0 processes. By convention, we range over linear channels with x, y, z and shared channels with u, v, w. The syntax of session types is that of (intuitionistic) linear logic propositions which are assigned to channels according to their usages in processes: 1 denotes the type of a channel along which no further behaviour occurs; A ⊸ B denotes a session that waits to receive a channel of type A and will then proceed as a session of type B; dually, A ⊗ B denotes a session that sends a channel of type A and continues as B; A & B denotes a session that offers a choice between proceeding as behaviours A or B; A ⊕ B denotes a session that internally chooses to continue as either A or B, signalling appropriately to the communicating 4 (out) (outT) (in) xhyi xhyi.P −−−→ P x(z) (inT) x(B) xhAi x(y).P − −−→ P {z /y} xhAi.P −−−→ P (lout) x(Y ).P −−−→ P {B /Y } (id) (open) τ (νx)([x ↔ y] | P ) − → P {y/x} x.inl x.inl; P −−→ P xhyi P −−−→ Q (rep) (lin) !x(y).P − −−→ P {z /y} |!x(y).P (close) ′ x(y) P −−−−−→ P Q −−−→ Q τ ′ ′ P |Q− → (νy)(P | Q ) ′ (νy)P −−−−−→ Q (com) (par) (νy)xhyi (νy)xhyi x(z) x.inl x.case(P, Q) −−→ P α P − →Q α P |R− →Q|R (res) α α → P′ Q − → Q′ P − τ ′ P |Q− →P |Q ′ α P − →Q α (νy)P − → (νy)Q Fig. 1. Labelled Transition System. partner; !A denotes a session offering an unbounded (but finite) number of behaviours of type A; ∀X.A denotes a polymorphic session that receives a type B and behaves uniformly as A{B/X}; dually, ∃X.A denotes an existentially typed session, which emits a type B and behaves as A{B/X}. Operational Semantics. The operational semantics of our calculus is presented as a standard labelled transition system (Fig. 1) in the style of the early system for the π-calculus [46]. In the remainder of this work we write ≡ for a standard π-calculus structural congruence extended with the clause [x ↔ y] ≡ [y ↔ x]. In order to streamline the presentation of observational equivalence [36,7], we write ≡! for structural congruence extended with the so-called sharpened replication axioms [46], which capture basic equivalences of replicated processes (and are present in the proof α dynamics of the exponential of linear logic). A transition P −−→ Q denotes that P may evolve to Q by performing the action represented by label α. An action α (α) requires a matching α (α) in the environment to enable progress. Labels include: the silent internal action τ , output and bound output actions (xhyi and (νz)xhzi); input action x(y); the binary choice actions (x.inl, x.inl, x.inr, and x.inr); and output and input actions of types (xhAi and x(A)). The labelled transition relation is defined by the rules in Fig. 1, subject to the side conditions: in rule (res), we require y 6∈ fn(α); in rule (par), we require bn(α) ∩ fn(R) = ∅; in rule (close), we require y 6∈ fn(Q). We omit the symmetric versions of (par), (com), (lout), (lin), (close) and closure under α-conversion. We τ write ρ1 ρ2 for the composition of relations ρ1 , ρ2 . We write − → to stand for − →≡. Weak transitions are defined as usual: we write =⇒ for the reflexive, transitive τ τ α closure of − → and − →+ for the transitive closure of − →. Given α 6= τ , notation =⇒ α τ stands for =⇒− →=⇒ and =⇒ stands for =⇒. Typing System. The typing rules of Polyπ are given in Fig. 2, following [7]. The rules define the judgment Ω; Γ ; ∆ ⊢ P :: z:A, denoting that process P offers a session of type A along channel z, using the linear sessions in ∆, (potentially) using the unrestricted or shared sessions in Γ , with polymorphic type variables maintained in Ω. We use a well-formedness judgment Ω ⊢ A type which states that A is well-formed wrt the type variable environment Ω (i.e. fv (A) ⊆ Ω). We often write T for the right-hand side typing z:A, · for the empty context 5 (⊸R) (∀R) (∃R) (id) Ω; Γ ; ∆, x:A ⊢ P :: z:B Ω; Γ ; ∆ ⊢ z(x).P :: z:A ⊸ B Ω, X; Γ ; ∆ ⊢ P :: z:A Ω; Γ ; ∆ ⊢ z(X).P :: z:∀X.A Ω ⊢ B type (⊗R) (∀L) Ω; Γ ; ∆1 ⊢ P :: y:A Ω ⊢ B type Ω; Γ ; ∆ ⊢ P :: z:A{B/X} Ω; Γ ; ∆ ⊢ zhBi.P :: z:∃X.A Ω; Γ ; x:A ⊢ [x ↔ z] :: z:A (cut) Ω; Γ ; ∆2 ⊢ Q :: z:B Ω; Γ ; ∆1 , ∆2 ⊢ (νx)zhyi.(P | Q) :: z:A ⊗ B Ω; Γ ; ∆, x:A{B/X} ⊢ P :: z:C Ω; Γ ; ∆, x:∀X.A ⊢ xhBi.P :: z:C (∃L) Ω, X; Γ ; ∆, x:A ⊢ P :: z:C Ω; Γ ; ∆, x:∃X.A ⊢ x(X).P :: z:C Ω; Γ ; ∆1 ⊢ P :: x:A Ω; Γ ; ∆2 , x:A ⊢ Q :: z:C Ω; Γ ; ∆1 , ∆2 ⊢ (νx)(P | Q) :: z:C Fig. 2. Typing Rules (Abridged – See [52] for all rules). and ∆, ∆′ for the union of contexts ∆ and ∆′ , only defined when ∆ and ∆′ are disjoint. We write · ⊢ P :: T for ·; ·; · ⊢ P :: T . As in [8,9,36,54], the typing discipline enforces that channel outputs always have as object a fresh name, in the style of the internal mobility π-calculus [44]. We clarify a few of the key rules: Rule ∀R defines the meaning of (impredicative) universal quantification over session types, stating that a session of type ∀X.A inputs a type and then behaves uniformly as A; dually, to use such a session (rule ∀L), a process must output a type B which then warrants the use of the session as type A{B/X}. Rule ⊸R captures session input, where a session of type A ⊸ B expects to receive a session of type A which will then be used to produce a session of type B. Dually, session output (rule ⊗R) is achieved by producing a fresh session of type A (that uses a disjoint set of sessions to those of the continuation) and outputting the fresh session along z, which is then a session of type B. Linear composition is captured by rule cut which enables a process that offers a session x:A (using linear sessions in ∆1 ) to be composed with a process that uses that session (amongst others in ∆2 ) to offer z:C. As shown in [7], typing entails Subject Reduction, Global Progress, and Termination. Observational Equivalences. We briefly summarise the typed congruence and logical equivalence with polymorphism, giving rise to a suitable notion of relational parametricity in the sense of Reynolds [41], defined as a contextual logical relation on typed processes [7]. The logical relation is reminiscent of a typed bisimulation. However, extra care is needed to ensure well-foundedness due to impredicative type instantiation. As a consequence, the logical relation allows us to reason about process equivalences where type variables are not instantiated with the same, but rather related types. ∼ Typed Barbed Congruence (=). We use the typed contextual congruence from [7], which preserves observable actions, called barbs. Formally, barbed congruence, noted ∼ =, is the largest equivalence on well-typed processes that is τ -closed, barb preserving, and contextually closed under typed contexts; see [7] and [52] for the full definition. 6 Logical Equivalence (≈L ). The definition of logical equivalence is no more than a typed contextual bisimulation with the following intuitive reading: given two open processes P and Q (i.e. processes with non-empty left-hand side typings), we define their equivalence by inductively closing out the context, composing with equivalent processes offering appropriately typed sessions. When processes are closed, we have a single distinguished session channel along which we can perform observations, and proceed inductively on the structure of the offered session type. We can then show that such an equivalence satisfies the necessary fundamental properties (Theorem 2.3). The logical relation is defined using the candidates technique of Girard [16]. In this setting, an equivalence candidate is a relation on typed processes satisfying basic closure conditions: an equivalence candidate must be compatible with barbed congruence and closed under forward and converse reduction. Definition 2.1 (Equivalence Candidate). An equivalence candidate R at z:A and z:B, noted R :: z:A⇔B, is a binary relation on processes such that, for every (P, Q) ∈ R :: z:A⇔B both · ⊢ P :: z:A and · ⊢ Q :: z:B hold, together with the following (we often write (P, Q) ∈ R :: z:A⇔B as P R Q :: z:A⇔B): 1. If (P, Q) ∈ R :: z:A⇔B, · ⊢ P ∼ = Q′ :: z:B then = P ′ :: z:A, and · ⊢ Q ∼ ′ ′ (P , Q ) ∈ R :: z:A⇔B. 2. If (P, Q) ∈ R :: z:A⇔B then, for all P0 such that · ⊢ P0 :: z:A and P0 =⇒ P , we have (P0 , Q) ∈ R :: z:A⇔B. Symmetrically for Q. To define the logical relation we rely on some auxiliary notation, pertaining to the treatment of type variables arising due to impredicative polymorphism. We write ω : Ω to denote a mapping ω that assigns a closed type to the type variables in Ω. We write ω(X) for the type mapped by ω to variable X. Given two mappings ω : Ω and ω ′ : Ω, we define an equivalence candidate assignment η between ω and ω ′ as a mapping of equivalence candidate η(X) :: −:ω(X)⇔ω ′ (X) to the type variables in Ω, where the particular choice of a distinguished right-hand side channel is delayed (i.e. to be instantiated later on). We write η(X)(z) for the instantiation of the (delayed) candidate with the name z. We write η : ω⇔ω ′ to denote that η is a candidate assignment between ω and ω ′ ; and ω̂(P ) to denote the application of mapping ω to P . We define a sequent-indexed family of process relations, that is, a set of pairs of processes (P, Q), written Γ ; ∆ ⊢ P ≈L Q :: T [η : ω⇔ω ′ ], satisfying some conditions, typed under Ω; Γ ; ∆ ⊢ T , with ω : Ω, ω ′ : Ω and η : ω⇔ω ′ . Logical equivalence is defined inductively on the size of the typing contexts and then on the structure of the right-hand side type. We show only select cases (see [52] for the full definition). Definition 2.2 (Logical Equivalence). (Base Case) Given a type A and mappings ω, ω ′ , η, we define logical equivalence, noted P ≈L Q :: z:A[η : ω⇔ω ′ ], as the smallest symmetric binary relation containing all pairs of processes (P, Q) such that (i) · ⊢ ω̂(P ) :: z:ω̂(A); (ii) · ⊢ ω̂ ′ (Q) :: z:ω̂ ′ (A); and (iii) satisfies the conditions given below: 7 – P ≈L Q :: z:X[η : ω⇔ω ′ ] iff (P, Q) ∈ η(X)(z) z(y) z(y) – P ≈L Q :: z:A ⊸ B[η : ω⇔ω ′ ] iff ∀P ′ , y. (P − −− → P ′ ) ⇒ ∃Q′ .Q =⇒ Q′ s.t. ∀R1 , R2 .R1 ≈L R2 :: y:A[η : ω⇔ω ′ ](νy)(P ′ | R1 ) ≈L (νy)(Q′ | R2 ) :: z:B[η : ω⇔ω ′ ] (νy)zhyi (νy)zhyi – P ≈L Q :: z:A ⊗ B[η : ω⇔ω ′ ] iff ∀P ′ , y. (P −−−−−→ P ′ ) ⇒ ∃Q′ .Q =⇒ Q′ s.t. ∃P1 , P2 , Q1 , Q2 . P ′ ≡! P1 | P2 ∧ Q′ ≡! Q1 | Q2 ∧ P1 ≈L Q1 :: y:A[η : ω⇔ω ′ ] ∧ P2 ≈L Q2 :: z:B[η : ω⇔ω ′ ] z(B1 ) – P ≈L Q :: z:∀X.A[η : ω⇔ω ′ ] iff ∀B1 , B2 , P ′ , R :: −:B1 ⇔B2 . (P − −−−→ P ′ ) implies z(B2 ) ∃Q′ .Q =⇒ Q′ , P ′ ≈L Q′ :: z:A[η[X 7→ R] : ω[X 7→ B1 ]⇔ω ′ [X 7→ B2 ]] (Inductive Case) Let Γ, ∆ be non empty. Given Ω; Γ ; ∆ ⊢ P :: T and Ω; Γ ; ∆ ⊢ Q :: T , the binary relation on processes Γ ; ∆ ⊢ P ≈L Q :: T [η : ω⇔ω ′ ] (with ω, ω ′ : Ω and η : ω⇔ω ′ ) is inductively defined as: Γ ; ∆, y : A ⊢ P ≈L Q :: T [η : ω⇔ω ′ ] iff ∀R1 , R2 . s.t. R1 ≈L R2 :: y:A[η : ω⇔ω ′ ], Γ ; ∆ ⊢ (νy)(ω̂(P ) | ω̂(R1 )) ≈L (νy)(ω̂ ′ (Q) | ω̂ ′ (R2 )) :: T [η : ω⇔ω ′ ] Γ, u : A; ∆ ⊢ P ≈L Q :: T [η : ω⇔ω ′ ] iff ∀R1 , R2 . s.t. R1 ≈L R2 :: y:A[η : ω⇔ω ′ ], Γ ; ∆ ⊢ (νu)(ω̂(P ) |!u(y).ω̂(R1 )) ≈L (νu)(ω̂ ′ (Q) |!u(y).ω̂ ′ (R2 )) :: T [η : ω⇔ω ′ ] For the sake of readability we often omit the η : ω⇔ω ′ portion of ≈L , which is henceforth implicitly universally quantified. Thus, we write Ω; Γ ; ∆ ⊢ P ≈L Q :: z:A (or P ≈L Q) iff the two given processes are logically equivalent for all consistent instantiations of its type variables. It is instructive to inspect the clause for type input (∀X.A): the two processes must be able to match inputs of any pair of related types (i.e. types related by a candidate), such that the continuations are related at the open type A with the appropriate type variable instantiations, following Girard [16]. The power of this style of logical relation arises from a combination of the extensional flavour of the equivalence and the fact that polymorphic equivalences do not require the same type to be instantiated in both processes, but rather that the types are related (via a suitable equivalence candidate relation). Theorem 2.3 (Properties of Logical Equivalence [7]). Parametricity: If Ω; Γ ; ∆ ⊢ P :: z:A then, for all ω, ω ′ : Ω and η : ω⇔ω ′ , we have Γ ; ∆ ⊢ ω̂(P ) ≈L ω̂ ′ (P ) :: z:A[η : ω⇔ω ′ ]. Soundness: If Ω; Γ ; ∆ ⊢ P ≈L Q :: z:A then C[P ] ∼ = C[Q] :: z:A, for any closing C[−]. Completeness: If Ω; Γ ; ∆ ⊢ P ∼ = Q :: z:A then Ω; Γ ; ∆ ⊢ P ≈L Q :: z:A. 3 To Linear-F and Back We now develop our mutually inverse and fully abstract encodings between Polyπ and a linear polymorphic λ-calculus [55] that we dub Linear-F. We first introduce the syntax and typing of the linear λ-calculus and then proceed to detail our encodings and their properties (we omit typing ascriptions from the existential polymorphism constructs for readability). 8 Definition 3.1 (Linear-F). The syntax of terms M, N and types A, B of Linear-F is given below. M, N ::= λx:A.M | M N | hM ⊗ N i | let x ⊗ y = M in N | !M | let !u = M in N | ΛX.M | M [A] | pack A with M | let (X, y) = M in N | let 1 = M in N | hi | T | F A, B ::= A ⊸ B | A ⊗ B | !A | ∀X.A | ∃X.A | X | 1 | 2 The syntax of types is that of the multiplicative and exponential fragments of second-order intuitionistic linear logic: λx:A.M denotes linear λ-abstractions; M N denotes the application; hM ⊗ N i denotes the multiplicative pairing of M and N , as reflected in its elimination form let x ⊗ y = M in N which simultaneously deconstructs the pair M , binding its first and second projection to x and y in N , respectively; !M denotes a term M that does not use any linear variables and so may be used an arbitrary number of times; let !u = M in N binds the underlying exponential term of M as u in N ; ΛX.M is the type abstraction former; M [A] stands for type application; pack A with M is the existential type introduction form, where M is a term where the existentially typed variable is instantiated with A; let (X, y) = M in N unpacks an existential package M , binding the representation type to X and the underlying term to y in N ; the multiplicative unit 1 has as introduction form the nullary pair hi and is eliminated by the construct let 1 = M in N , where M is a term of type 1. Booleans (type 2 with values T and F) are the basic observable. The typing judgment in Linear-F is given as Ω; Γ ; ∆ ⊢ M : A, following the DILL formulation of linear logic [3], stating that term M has type A in a linear context ∆ (i.e. bindings for linear variables x:B), intuitionistic context Γ (i.e. binding for intuitionistic variables u:B) and type variable context Ω. The typing rules are standard [7]. The operational semantics of the calculus are the expected call-by-name semantics with commuting conversions [27]. We write ⇓ for the evaluation relation. We write ∼ = for the largest typed congruence that is consistent with the observables of type 2 (i.e. a so-called Morris-style equivalence as in [5]). 3.1 Encoding Linear-F into Session π-Calculus We define a translation from Linear-F to Polyπ generalising the one from [49], accounting for polymorphism and multiplicative pairs. We translate typing derivations of λ-terms to those of π-calculus terms (we omit the full typing derivation for the sake of readability). Proof theoretically, the λ-calculus corresponds to a proof term assignment for natural deduction presentations of logic, whereas the session π-calculus from § 2 corresponds to a proof term assignment for sequent calculus. Thus, we obtain a translation from λ-calculus to the session π-calculus by considering the proof theoretic content of the constructive proof of soundness of the sequent calculus wrt natural deduction. Following Gentzen [14], the translation from natural deduction to sequent calculus maps introduction rules to the corresponding right 9 rules and elimination rules to a combination of the corresponding left rule, cut and/or identity. Since typing in the session calculus identifies a distinguished channel along which a process offers a session, the translation of λ-terms is parameterised by a “result” channel along which the behaviour of the λ-term is implemented. Given a λ-term M , the process JM Kz encodes the behaviour of M along the session channel z. We enforce that the type 2 of booleans and its two constructors are consistently translated to their polymorphic Church encodings before applying the translation to Polyπ. Thus, type 2 is first translated to ∀X.!X⊸ !X⊸X, the value T to ΛX.λu:!X.λv:!X.let !x = u in let !y = v in x and the value F to ΛX.λu:!X.λv:!X.let !x = u in let !y = v in y. Such representations of the booleans are adequate up to parametricity [6] and suitable for our purposes of relating the session calculus (which has no primitive notion of value or result type) with the λ-calculus precisely due to the tight correspondence between the two calculi. Definition 3.2 (From Linear-F to Polyπ). JΩK; JΓ K; J∆K ⊢ JM Kz :: z:A denotes the translation of contexts, types and terms from Linear-F to the polymorphic session calculus. The translations on contexts and types are the identity function. Booleans and their values are first translated to their Church encodings as specified above. The translation on λ-terms is given below: JxKz JuKz Jλx:A.M Kz J!M Kz JΛX.M Kz Jpack A with M Kz JhiKz , , , , , , , [x ↔ z] (νx)uhxi.[x ↔ z] z(x).JM Kz !z(x).JM Kx z(X).JM Kz zhAi.JM Kz 0 JM N Kz , (νx)(JM Kx | (νy)xhyi.(JN Ky | [x ↔ z])) Jlet !u = M in N Kz , (νx)(JM Kx | JN Kz {x/u}) JhM ⊗ N iKz , (νy)zhyi.(JM Ky | JN Kz ) Jlet x ⊗ y = M in N Kz , (νw)(JM Ky | y(x).JN Kz ) JM [A]Kz , (νx)(JM Kx | xhAi.[x ↔ z]) Jlet (X, y) = M in N Kz , (νx)(JM Ky | y(X).JN Kz ) Jlet 1 = M in N Kz , (νx)(JM Kx | JN Kz ) To translate a (linear) λ-abstraction λx:A.M , which corresponds to the proof term for the introduction rule for ⊸, we map it to the corresponding ⊸R rule, thus obtaining a process z(x).JM Kz that inputs along the result channel z a channel x which will be used in JM Kz to access the function argument. To encode the application M N , we compose (i.e. cut) JM Kx , where x is a fresh name, with a process that provides the (encoded) function argument by outputting along x a channel y which offers the behaviour of JN Ky . After the output is performed, the type of x is now that of the function’s codomain and thus we conclude by forwarding (i.e. the id rule) between x and the result channel z. The encoding for polymorphism follows a similar pattern: To encode the abstraction ΛX.M , we receive along the result channel a type that is bound to X and proceed inductively. To encode type application M [A] we encode the abstraction M in parallel with a process that sends A to it, and forwards accordingly. Finally, the encoding of the existential package pack A with M maps to an output of the type A followed by the behaviour JM Kz , with the encoding of the elimination form let (X, y) = M in N composing the translation of the term of existential type M with a process performing the appropriate type input and proceeding as JN Kz . 10 Example 3.3 (Encoding of Linear-F). Consider the following λ-term corresponding to a polymorphic pairing function (recall that we write zhwi.P for (νw)zhwi.P ): M , ΛX.ΛY.λx:X.λy:Y.hx ⊗ yi and N , ((M [A][B] M1 ) M2 ) Then we have, with x̃ = x1 x2 x3 x4 : JN Kz ≡ (ν x̃)(JM Kx1 | x1 hAi.[x1 ↔ x2 ] | x2 hBi.[x2 ↔ x3 ] | x3 hxi.(JM1 Kx | [x3 ↔ x4 ]) | x4 hyi.(JM2 Ky | [x4 ↔ z])) ≡ (ν x̃)(x1 (X).x1 (Y ).x1 (x).x1 (y).x1 hwi.([x ↔ w] | [y ↔ x1 ]) | x1 hAi.[x1 ↔ x2 ] | x2 hBi.[x2 ↔ x3 ] | x3 hxi.(JM1 Kx | [x3 ↔ x4 ]) | x4 hyi.(JM2 Ky | [x4 ↔ z])) We can observe that N − →+ (((λx:A.λy:B.hx ⊗ yi) M1 ) M2 ) − →+ hM1 ⊗ M2 i. At the process level, each reduction corresponding to the redex of type application is simulated by two reductions, obtaining: JN Kz → − + (νx3 , x4 )(x3 (x).x3 (y).x3 hwi.([x ↔ w] | [y ↔ x3 ]) | x3 hxi.(JM1 Kx | [x3 ↔ x4 ]) | x4 hyi.(JM2 Ky | [x4 ↔ z])) = P The reductions corresponding to the β-redexes clarify the way in which the encoding represents substitution of terms for variables via fine-grained name passing. Consider JhM1 ⊗ M2 iKz , zhwi.(JM1 Kw | JM2 Kz ) and P → − + (νx, y)(JM1 Kx | JM2 Ky | zhwi.([x ↔ w] | [y ↔ z])) The encoding of the pairing of M1 and M2 outputs a fresh name w which will denote the behaviour of (the encoding of) M1 , and then the behaviour of the encoding of M2 is offered on z. The reduct of P outputs a fresh name w which is then identified with x and thus denotes the behaviour of JM1 Kw . The channel z is identified with y and thus denotes the behaviour of JM2 Kz , making the two processes listed above equivalent. This informal reasoning exposes the insights that justify the operational correspondence of the encoding. Proof-theoretically, these equivalences simply map to commuting conversions which push the processes JM1 Kx and JM2 Kz under the output on z. Theorem 3.4 (Operational Correspondence). – If Ω; Γ ; ∆ ⊢ M : A and M − → N then JM Kz =⇒ P such that JN Kz ≈L P – If JM Kz − → P then M − →+ N and JN Kz ≈L P 3.2 Encoding Session π-calculus to Linear-F Just as the proof theoretic content of the soundness of sequent calculus wrt natural deduction induces a translation from λ-terms to session-typed processes, the completeness of the sequent calculus wrt natural deduction induces a translation from the session calculus to the λ-calculus. This mapping identifies sequent calculus right rules with the introduction rules of natural deduction and left rules with elimination rules combined with (type-preserving) substitution. Crucially, the mapping is defined on typing derivations, enabling us to consistently identify when a process uses a session (i.e. left rules) or, dually, when a process offers a session (i.e. right rules). 11 L L (⊸R) ∆, x:A ⊢ P :: z:B M ∆ ⊢ z(x).P :: z:A ⊸ B , (⊸L) ∆1 ⊢ P :: y:A (⊸ I) ∆, x:A ⊢ LP M∆,x:A⊢z:B : B ∆ ⊢ λx:A.LP M∆,x:A⊢z:B : A ⊸ B ∆2 , x:B ⊢ Q :: z:C ∆1 , ∆2 , x:A ⊸ B ⊢ (νy)xhyi.(P | Q) :: z:C M , (subst) ∆2 , x:B ⊢ LQM∆2 ,x:B⊢z:C : C (⊸ E) x:A ⊸ B ⊢ x:A ⊸ B ∆1 ⊢ LP M∆1 ⊢y:A : B ∆1 , x:A ⊸ B ⊢ x LP M∆1 ⊢y:A : B ∆1 , ∆2 , x:A ⊸ B ⊢ LQM∆2 ,x:B⊢z:C {(x LP M∆1 ⊢y:A )/x} : C Fig. 3. Translation on Typing Derivations (Excerpt – See [52]) Definition 3.5 (From Polyπ to Linear-F). We write LΩM; LΓ M; L∆M ⊢ LP M : A for the translation from typing derivations in Polyπ to derivations in Linear-F. The translations on types and contexts are the identity function. The translation on processes is given below, where the leftmost column indicates the typing rule at the root of the derivation (see Fig. 3 for an excerpt of the translation on typing derivations, where we write LP MΩ;Γ ;∆⊢z:A to denote the translation of Ω; Γ ; ∆ ⊢ P :: z:A. We omit Ω and Γ when unchanged). (1R) (id) (1L) (!R) (!L) (∀R) (∃R) (cut) L0M , L[x ↔ y]M , LP M , L!z(x).P M , LP {u/x}M , Lz(X).P M , LzhBi.P M , L(νx)(P | Q)M , hi x let 1 = x in LP M !LP M let !u = x in LP M ΛX.LP M pack B with LP M LQM{LP M/x} (⊸L) (⊸R) (⊗R) (⊗L) (copy) (∀L) (∃L) (cut! ) L(νy)xhyi.(P | Q)M , Lz(x).P M , L(νx)zhxi.(P | Q)M , Lx(y).P M , L(νx)uhxi.P M , LxhBi.P M , Lx(Y ).P M , L(νu)(!u(x).P | Q)M , LQM{(x LP M)/x} λx:A.LP M hLP M ⊗ LQMi let x ⊗ y = x in LP M LP M{u/x} LP M{(x[B])/x} let (Y, x) = x in LP M LQM{LP M/u} For instance, the encoding of a process z(x).P :: z:A ⊸ B, typed by rule ⊸R, results in the corresponding ⊸ I introduction rule in the λ-calculus and thus is λx:A.LP M. To encode the process (νy)xhyi.(P | Q), typed by rule ⊸L, we make use of substitution: Given that the sub-process Q is typed as Ω; Γ ; ∆′ , x:B ⊢ Q :: z:C, the encoding of the full process is given by LQM{(x LP M)/x}. The term x LP M consists of the application of x (of function type) to the argument LP M, thus ensuring that the term resulting from the substitution is of the appropriate type. We note that, for instance, the encoding of rule ⊗L does not need to appeal to substitution – the λ-calculus let style rules can be mapped directly. Similarly, rule ∀R is mapped to type abstraction, whereas rule ∀L which types a process of the form xhBi.P maps to a substitution of the type application x[B] for x in LP M. The encoding of existential polymorphism is simpler due to the let-style elimination. We also highlight the encoding of the cut rule which 12 embodies parallel composition of two processes sharing a linear name, which clarifies the use/offer duality of the intuitionistic calculus – the process that offers P is encoded and substituted into the encoded user Q. Theorem 3.6. If Ω; Γ ; ∆ ⊢ P :: z:A then LΩM; LΓ M; L∆M ⊢ LP M : A. Example 3.7 (Encoding of Polyπ). Consider the following processes P , z(X).z(Y ).z(x).z(y).zhwi.([x ↔ w] | [y ↔ z]) Q , zh1i.zh1i.zhxi.zhyi.z(w).[w ↔ r] with ⊢ P :: z:∀X.∀Y.X ⊸ Y ⊸ X ⊗ Y and z:∀X.∀Y.X ⊸ Y ⊸ X ⊗ Y ⊢ Q :: r:1. Then: LP M = ΛX.ΛY.λx:X.λy:Y.hx ⊗ yi LQM = let x ⊗ y = z[1][1] hi hi in let 1 = y in x L(νz)(P | Q)M = let x ⊗ y = (ΛX.ΛY.λx:X.λy:Y.hx ⊗ yi)[1][1] hi hi in let 1 = y in x By the behaviour of (νz)(P | Q), which consists of a sequence of cuts, and its encoding, we have that L(νz)(P | Q)M − →+ hi and (νz)(P | Q) − →+ 0 = LhiM. In general, the translation of Def. 3.5 can introduce some distance between the immediate operational behaviour of a process and its corresponding λ-term, insofar as the translations of cuts (and left rules to non let-form elimination rules) make use of substitutions that can take place deep within the resulting term. Consider the process at the root of the following typing judgment ∆1 , ∆2 , ∆3 ⊢ (νx)(x(y).P1 | (νy)xhyi.(P2 | w(z).0)) :: w:1 ⊸ 1, derivable through a cut on session x between instances of ⊸R and ⊸L, where the continuation process w(z).0 offers a session w:1 ⊸ 1 (and so must use rule 1L on x). We have that: (νx)(x(y).P1 | (νy)xhyi.(P2 | w(z).0)) − → (νx, y)(P1 | P2 | w(z).0). However, the translation of the process above results in the term λz:1.let 1 = ((λy:A.LP1 M) LP2 M) in let 1 = z in hi, where the redex that corresponds to the process reduction is present but hidden under the binder for z (corresponding to the input along w). Thus, to establish operational completeness we consider full β-reduction, denoted by − →β , i.e. enabling β-reductions under binders. Theorem 3.8 (Operational Completeness). P − → Q then LP M − →∗β LQM. Let Ω; Γ ; ∆ ⊢ P :: z:A. If In order to study the soundness direction it is instructive to consider typed process x:1 ⊸ 1 ⊢ xhyi.(νz)(z(w).0 | zhwi.0) :: v:1 and its translation: Lxhyi.(νz)(z(w).0 | zhwi.0)M = L(νz)(z(w).0 | zhwi.0)M{(x hi)/x} = let 1 = (λw:1.let 1 = w in hi) hi in let 1 = x hi in hi The process above cannot reduce due to the output prefix on x, which cannot synchronise with a corresponding input action since there is no provider for x (i.e. the channel is in the left-hand side context). However, its encoding can exhibit the β-redex corresponding to the synchronisation along z, hidden by the prefix on x. The corresponding reductions hidden under prefixes in the encoding can be soundly exposed in the session calculus by appealing to the commuting conversions of linear logic (e.g. in the process above, the instance of rule ⊸L corresponding to the output on x can be commuted with the cut on z). 13 As shown in [36], commuting conversions are sound wrt observational equivalence, and thus we formulate operational soundness through a notion of extended process reduction, which extends process reduction with the reductions that are induced by commuting conversions. Such a relation was also used for similar purposes in [5] and in [26], in a classical linear logic setting. For conciseness, we define extended reduction as a relation on typed processes modulo ≡. Definition 3.9 (Extended Reduction [5]). We define 7→ as the type preserving relations on typed processes modulo ≡ generated by: 1. C[(νy)xhyi.P ] | x(y).Q 7→ C[(νy)(P | Q)]; 2. C[(νy)xhyi.P ] | !x(y).Q 7→ C[(νy)(P | Q)] | !x(y).Q; and (3) (νx)(!x(y).Q) 7→ 0 where C is a (typed) process context which does not capture the bound name y. Theorem 3.10 (Operational Soundness). Let Ω; Γ ; ∆ ⊢ P :: z:A and LP M − → M , there exists Q such that P 7→∗ Q and LQM =α M . 3.3 Inversion and Full Abstraction Having established the operational preciseness of the encodings to-and-from Polyπ and Linear-F, we establish our main results for the encodings. Specifically, we show that the encodings are mutually inverse up-to behavioural equivalence (with fullness as its corollary), which then enables us to establish full abstraction for both encodings. Theorem 3.11 (Inverse). If Ω; Γ ; ∆ ⊢ M : A then Ω; Γ ; ∆ ⊢ LJM Kz M ∼ =M : A. Also, if Ω; Γ ; ∆ ⊢ P :: z:A then Ω; Γ ; ∆ ⊢ JLP MKz ≈L P :: z:A Corollary 3.12 (Fullness). Let Ω; Γ ; ∆ ⊢ P :: z:A. ∃M s.t. Ω; Γ ; ∆ ⊢ M : A and Ω; Γ ; ∆ ⊢ JM Kz ≈L P :: z:A Also, let Ω; Γ ; ∆ ⊢ M : A. ∃P s.t. Ω; Γ ; ∆ ⊢ P :: z:A and Ω; Γ ; ∆ ⊢ LP M ∼ =M :A We now state our full abstraction results. Given two Linear-F terms of the same type, equivalence in the image of the J−Kz translation can be used as a proof technique for contextual equivalence in Linear-F. This is called the soundness direction of full abstraction in the literature [18] and proved by showing the relation generated by JM Kz ≈L JN Kz forms ∼ =; we then establish the completeness direction by contradiction, using fullness. Theorem 3.13 (Full Abstraction). Ω; Γ ; ∆ ⊢ M ∼ = N : A iff Ω; Γ ; ∆ ⊢ JM Kz ≈L JN Kz :: z:A. We can straightforwardly combine the above full abstraction with Theorem 3.11 to obtain full abstraction of the L−M translation. Theorem 3.14 (Full Abstraction). Ω; Γ ; ∆ ⊢ P ≈L Q :: z:A iff Ω; Γ ; ∆ ⊢ LP M ∼ = LQM : A. 14 4 Applications of the Encodings In this section we develop applications of the encodings of the previous sections. Taking advantage of full abstraction and mutual inversion, we apply non-trivial properties from the theory of the λ-calculus to our session-typed process setting. In § 4.1 we study inductive and coinductive sessions, arising through encodings of initial F -algebras and final F -coalgebras in the polymorphic λ-calculus. In § 4.2 we study encodings for an extension of the core session calculus with term passing, where terms are derived from a simply-typed λ-calculus. Using the development of § 4.2 as a stepping stone, we generalise the encodings to a higher-order session calculus (§ 4.3), where processes can send, receive and execute other processes.We show full abstraction and mutual inversion theorems for the encodings from higher-order to first-order. As a consequence, we can straightforwardly derive a strong normalisation property for the higher-order process-passing calculus. 4.1 Inductive and Coinductive Session Types The study of polymorphism in the λ-calculus [1,19,40,6] has shown that parametric polymorphism is expressive enough to encode both inductive and coinductive types in a precise way, through a faithful representation of initial and final (co)algebras [28], without extending the language of terms nor the semantics of the calculus, giving a logical justification to the Church encodings of inductive datatypes such as lists and natural numbers. The polymorphic session calculus can express fairly intricate communication behaviours, including generic protocols through both existential and universal polymorphism (i.e. protocols that are parametric in their sub-protocols). Using our fully abstract encodings between the two calculi, we show that session polymorphism is expressive enough to encode inductive and coinductive sessions, “importing” the results for the λcalculus, which may then be instantiated to provide a session-typed formulation of the encodings of data structures in the π-calculus of [30]. Inductive and Coinductive Types in System F. Exploring an algebraic interpretation of polymorphism where types are interpreted as functors, it can be shown that given a type F with a free variable X that occurs only positively (i.e. occurrences of X are on the left-hand side of an even number of function arrows), the polymorphic type ∀X.((F (X) → X) → X) forms an initial F -algebra [42,1] (we write F (X) to denote that X occurs in F ). This enables the representation of inductively defined structures using an algebraic or categorical justification. For instance, the natural numbers can be seen as the initial F -algebra of F (X) = 1+ X (where 1 is the unit type and + is the coproduct), and are thus already present in System F, in a precise sense, as the type ∀X.((1 + X) → X) → X (noting that both 1 and + can also be encoded in System F). A similar story can be told for coinductively defined structures, which correspond to final F -coalgebras and are representable with the polymorphic type ∃X.(X → F (X)) × X, where × is a product type. In the remainder of this section we assume the positivity requirement on F mentioned above. 15 F (Ti ) F (fold[A](f )) f in ❄ Ti A ✲ F (A) fold[A](f ) (a) ❄ ✲ A unfold[A](f ) ✲ Tf f out ❄ F (A) ❄ ✲ F (Tf ) F (unfold[A](f )) (b) Fig. 4. Diagrams for Initial F -algebras and Final F -coalgebras While the complete formal development of the representation of inductive and coinductive types in System F would lead us to far astray, we summarise here the key concepts as they apply to the λ-calculus (the interested reader can refer to [19] for the full categorical details). To show that the polymorphic type Ti , ∀X.((F (X) → X) → X) is an initial F -algebra, one exhibits a pair of λ-terms, often dubbed fold and in, such that the diagram in Fig. 4(a) commutes (for any A, where F (f ), where f is a λ-term, denotes the functorial action of F applied to f ), and, crucially, that fold is unique. When these conditions hold, we are justified in saying that Ti is a least fixed point of F . Through a fairly simple calculation, it is easy to see that: fold , ΛX.λx:F (X) → X.λt:Ti .t[X](x) in , λx:F (Ti ).ΛX.λy:F (X) → X.y (F (fold[X](x))(x)) satisfy the necessary equalities. To show uniqueness one appeals to parametricity, which allows us to prove that any function of the appropriate type is equivalent to fold. This property is often dubbed initiality or universality. The construction of final F -coalgebras and their justification as greatest fixed points is dual. Assuming products in the calculus and taking Tf , ∃X.(X → F (X)) × X, we produce the λ-terms unfold , ΛX.λf :X → F (X).λx:Tf .pack X with (f, x) out , λt : Tf .let (X, (f, x)) = t in F (unfold[X](f )) (f (x)) such that the diagram in Fig. 4(b) commutes and unfold is unique (again, up to parametricity). While the argument above applies to System F, a similar development can be made in Linear-F [6] by considering Ti , ∀X.!(F (X) ⊸ X) ⊸ X and Tf , ∃X.!(X ⊸ F (X)) ⊗ X. Reusing the same names for the sake of conciseness, the associated linear λ-terms are: fold in unfold out , , , , ΛX.λu:!(F (X) ⊸ X).λy:Ti .(y[X] u) : ∀X.!(F (X) ⊸ X) ⊸ Ti ⊸ X λx:F (Ti ).ΛX.λy:!(F (X) ⊸ X).let !u = y in k (F (fold[X](!u))(x)) : F (Ti ) ⊸ Ti ΛX.λu:!(X ⊸ F (X)).λx:X.pack X with hu ⊗ xi : ∀X.!(X ⊸ F (X)) ⊸ X ⊸ Tf λt : Tf .let (X, (u, x)) = t in let !f = u in F (unfold[X](!f )) (f (x)) : Tf ⊸ F (Tf ) Inductive and Coinductive Sessions for Free. As a consequence of full abstraction we may appeal to the J−Kz encoding to derive representations of fold 16 and unfold that satisfy the necessary algebraic properties. The derived processes are (recall that we write xhyi.P for (νy)xhyi.P ): JfoldKz , z(X).z(u).z(y).(νw)((νx)([y ↔ x] | xhXi.[x ↔ w]) | whvi.([u ↔ v] | [w ↔ z])) JunfoldKz , z(X).z(u).z(x).zhXi.zhyi.([u ↔ y] | [x ↔ z]) We can then show universality of the two constructions. We write Px,y to single out that x and y are free in P and Pz,w to denote the result of employing capture-avoiding substitution on P , substituting x and y by z and w. Let: foldP(A)y1 ,y2 , (νx)(JfoldKx | xhAi.xhvi.(uhyi.[y ↔ v] | xhzi.([z ↔ y1 ] | [x ↔ y2 ]))) unfoldP(A)y1 ,y2 , (νx)(JunfoldKx | xhAi.xhvi.(uhyi.[y ↔ v] | xhzi.([z ↔ y1 ] | [x ↔ y2 ]))) where foldP(A)y1 ,y2 corresponds to the application of fold to an F -algebra A with the associated morphism F (A) ⊸ A available on the shared channel u, consuming an ambient session y1 :Ti and offering y2 :A. Similarly, unfoldP(A)y1 ,y2 corresponds to the application of unfold to an F -coalgebra A with the associated morphism A ⊸ F (A) available on the shared channel u, consuming an ambient session y1 :A and offering y2 :Tf . Theorem 4.1 (Universality of foldP). ∀Q such that X; u:F (X) ⊸ X; y1 :Ti ⊢ Q :: y2 :X we have X; u:F (X) ⊸ X; y1 :Ti ⊢ Q ≈L foldP(X)y1 ,y2 :: y2 :X Theorem 4.2 (Universality of unfoldP). ∀Q and F -coalgebra A s.t ·; ·; y1 :A ⊢ Q :: y2 :Tf we have that ·; u:F (A) ⊸ A; y1 :A ⊢ Q ≈L unfoldP(A)y1 ,y2 :: y2 :: Tf . Example 4.3 (Natural Numbers). We show how to represent the natural numbers as an inductive session type using F (X) = 1 ⊕ X, making use of in: zerox , (νz)(z.inl; 0 | Jin(z)Kx ) succy,x , (νs)(s.inr; [y ↔ s] | Jin(s)Kx ) with Nat , ∀X.!((1 ⊕ X) ⊸ X) ⊸ X where ⊢ zerox :: x:Nat and y:Nat ⊢ succy,x :: x:Nat encode the representation of 0 and successor, respectively. The natural 1 would thus be represented by onex , (νy)(zeroy | succy,x ). The behaviour of type Nat can be seen as a that of a sequence of internal choices of arbitrary (but finite) length. We can then observe that the foldP process acts as a recursor. For instance consider: stepDecd , d(n).n.case(zerod , [n ↔ d]) decx,z , (νu)(!u(d).stepDecd | foldP(Nat)x,z ) with stepDecd :: d:(1 ⊕ Nat) ⊸ Nat and x:Nat ⊢ decx,z :: z:Nat, where dec decrements a given natural number session on channel x. We have that: (νx)(onex | decx,z ) ≡ (νx, y.u)(zeroy | succy,x !u(d).stepDecd | foldP(Nat)x,z ) ≈L zeroz We note that the resulting encoding is reminiscent of the encoding of lists of [30] (where zero is the empty list and succ the cons cell). The main differences in the encodings arise due to our primitive notions of labels and forwarding, as well as due to the generic nature of in and fold. 17 Example 4.4 (Streams). We build on Example 4.3 by representing streams of natural numbers as a coinductive session type. We encode infinite streams of naturals with F (X) = Nat ⊗ X. Thus: NatStream , ∃X.!(X ⊸ (Nat ⊗ X)) ⊗ X. The behaviour of a session of type NatStream amounts to an infinite sequence of outputs of channels of type Nat. Such an encoding enables us to construct the stream of all naturals nats (and the stream of all non-zero naturals oneNats): genHdNextz , z(n).zhyi.(nhn′ i.[n′ ↔ y] | !z(w).nhn′ i.succn′ ,w ) natsy , (νx, u)(zerox | !u(z).genHdNextz | unfoldP(!Nat)x,y ) oneNatsy , (νx, u)(onex | !u(z).genHdNext z | unfoldP(!Nat)x,y ) with genHdNextz :: z:!Nat ⊸ Nat⊗!Nat and both natsy and oneNats :: y:NatStream. genHdNextz consists of a helper that generates the current head of a stream and the next element. As expected, the following process implements a session that “unrolls” the stream once, providing the head of the stream and then behaving as the rest of the stream (recall that out : Tf ⊸ F (Tf )). (νx)(natsx | Jout(x)Ky ) :: y:Nat ⊗ NatStream We note a peculiarity of the interaction of linearity with the stream encoding: a process that begins to deconstruct a stream has no way of “bottoming out” and stopping. One cannot, for instance, extract the first element of a stream of naturals and stop unrolling the stream in a well-typed way. We can, however, easily encode a “terminating” stream of all natural numbers via F (X) = (Nat⊗!X) by replacing the genHdNextz with the generator given as: genHdNextTerz , z(n).zhyi.(nhn′ i.[n′ ↔ y] | !z(w).!w(w′ ).nhn′ i.succn′ ,w′ ) It is then easy to see that a usage of Jout(x)Ky results in a session of type Nat⊗!NatStream, enabling us to discard the stream as needed. One can replay this argument with the operator F (X) = (!Nat ⊗ X) to enable discarding of stream elements. Assuming such modifications, we can then show: (νy)((νx)(natsx | Jout(x)Ky ) | y(n).[y ↔ z]) ≈L oneNatsz :: z:NatStream 4.2 Communicating Values – Sessπλ We now consider a session calculus extended with a data layer obtained from a λ-calculus (whose terms are ranged over by M, N and types by τ, σ). We dub this calculus Sessπλ. P, Q ::= · · · | xhM i.P | x(y).P M, N ::= λx:τ.M | M N | x A, B ::= · · · | τ ∧ A | τ ⊃ A τ, σ ::= · · · | τ → σ Without loss of generality, we consider the data layer to be simply-typed, with a call-by-name semantics, satisfying the usual type safety properties. The typing judgment for this calculus is Ψ ⊢ M : τ . We omit session polymorphism for the sake of conciseness, restricting processes to communication of data and (session) channels. The typing judgment for processes is thus modified to Ψ ; Γ ; ∆ ⊢ P :: 18 z:A, where Ψ is an intuitionistic context that accounts for variables in the data layer. The rules for the relevant process constructs are (all other rules simply propagate the Ψ context from conclusion to premises): Ψ ⊢ M : τ Ψ ; Γ ; ∆ ⊢ P :: z:A (∧R) Ψ ; Γ ; ∆ ⊢ zhM i.P :: z:τ ∧ A Ψ, x:τ ; Γ ; ∆ ⊢ P :: z:A (⊃R) Ψ ; Γ ; ∆ ⊢ z(x).P :: z:τ ⊃ A Ψ, y:τ ; Γ ; ∆, x:A ⊢ Q :: z:C (∧L) Ψ ; Γ ; ∆, x:τ ∧ A ⊢ x(y).Q :: z:C Ψ ⊢ M : τ Ψ ; Γ ; ∆, x:A ⊢ Q :: z:C (⊃L) Ψ ; Γ ; ∆, x:τ ⊃ A ⊢ xhM i.Q :: z:C With the reduction rule given by:1 xhM i.P | x(y).Q − → P | Q{M/y}. With a simple extension to our encodings we may eliminate the data layer by encoding the data objects as processes, showing that from an expressiveness point of view, data communication is orthogonal to the framework. We note that the data language we are considering is not linear, and the usage discipline of data in processes is itself also not linear. To First-Order Processes We now introduce our encoding for Sessπλ, defined inductively on session types, processes, types and λ-terms (we omit the purely inductive cases on session types and processes for conciseness). As before, the encoding on processes is defined on typing derivations, where we indicate the typing rule at the root of the typing derivation. Jτ ∧ AK ,!Jτ K ⊗ JAK Jτ ⊃ AK ,!Jτ K ⊸ JAK (∧R) JzhM i.P K , zhxi.(!x(y).JM Ky | JP K) (⊃R) Jz(x).P K , z(x).JP K Jτ → σK ,!Jτ K ⊸ JσK (∧L) Jx(y).P K , x(y).JP K (⊃L) JxhM i.P K , xhyi.(!y(w).JM Kw | JP K) Jλx:τ.M Kz , z(x).JM Kz JxKz , xhyi.[y ↔ z] JM N Kz , (νy)(JM Ky | yhxi.(!x(w).JN Kw | [y ↔ z])) The encoding addresses the non-linear usage of data elements in processes by encoding the types τ ∧ A and τ ⊃ A as !Jτ K ⊗ JAK and !Jτ K ⊸ JAK, respectively. Thus, sending and receiving of data is codified as the sending and receiving of channels of type !, which therefore can be used non-linearly. Moreover, since data terms are themselves non-linear, the τ → σ type is encoded as !Jτ K ⊸ JσK, following Girard’s embedding of intuitionistic logic in linear logic [15]. At the level of processes, offering a session of type τ ∧ A (i.e. a process of the form zhM i.P ) is encoded according to the translation of the type: we first send a fresh name x which will be used to access the encoding of the term M . Since M can be used an arbitrary number of times by the receiver, we guard the encoding of M with a replicated input, proceeding with the encoding of P accordingly. Using a session of type τ ⊃ A follows the same principle. The input cases (and the rest of the process constructs) are completely homomorphic. The encoding of λ-terms follows Girard’s decomposition of the intuitionistic function space [49]. The λ-abstraction is translated as input. Since variables in a λ-abstraction may be used non-linearly, the case for variables and application 1 For simplicity, in this section, we define the process semantics through a reduction relation. 19 is slightly more intricate: to encode the application M N we compose M in parallel with a process that will send the “reference” to the function argument N which will be encoded using replication, in order to handle the potential for 0 or more usages of variables in a function body. Respectively, a variable is encoded by performing an output to trigger the replication and forwarding accordingly. Without loss of generality, we assume variable names and their corresponding replicated counterparts match, which can be achieved through αconversion before applying the translation. We exemplify our encoding as follows: Jz(x).zhxi.zh(λy:σ.x)i.0K = z(x).zhwi.(!w(u).JxKu | zhvi.(!v(i).Jλy:σ.xKi | 0)) = z(x).zhwi.(!w(u).xhyi.[y ↔ u] | zhvi.(!v(i).i(y).xhti.[t ↔ i] | 0)) Properties of the Encoding. We discuss the correctness of our encoding. We can straightforwardly establish that the encoding preserves typing. To show that our encoding is operationally sound and complete, we capture the interaction between substitution on λ-terms and the encoding into processes through logical equivalence. Consider the following reduction of a process: (νz)(z(x).zhxi.zh(λy:σ.x)i.0 | zhλw:τ0 .wi.P ) → (νz)(zhλw:τ0 .wi.zh(λy:σ.λw:τ0 .w)i.0 | P ) − (1) Given that substitution in the target session π-calculus amounts to renaming, whereas in the λ-calculus we replace a variable for a term, the relationship between the encoding of a substitution M {N/x} and the encodings of M and N corresponds to the composition of the encoding of M with that of N , but where the encoding of N is guarded by a replication, codifying a form of explicit non-linear substitution. Lemma 4.5 (Compositionality). Let Ψ, x:τ ⊢ M : σ and Ψ ⊢ N : τ . We have that JM {N/x}Kz ≈L (νx)(JM Kz |!x(y).JN Ky ) Revisiting the process to the left of the arrow in Equation 1 we have: J(νz)(z(x).zhxi.zh(λy:σ.x)i.0 | zhλw:τ0 .wi.P )K = (νz)(Jz(x).zhxi.zh(λy:σ.x)i.0Kz | zhxi.(!x(b).Jλw:τ0 .wKb | JP K)) → (νz, x)(zhwi.(!w(u).xhyi.[y ↔ u] | zhvi.(!v(i).Jλy:σ.xKi | 0) | !x(b).Jλw:τ0 .wKb | JP K)) − whereas the process to the right of the arrow is encoded as: J(νz)(zhλw:τ0 .wi.zh(λy:σ.λw:τ0 .w)i.0 | P )K = (νz)(zhwi.(!w(u).Jλw:τ0 .wKu | zhvi.(!v(i).Jλy:σ.λw:τ0 .wKi | JP K))) While the reduction of the encoded process and the encoding of the reduct differ syntactically, they are observationally equivalent – the latter inlines the replicated process behaviour that is accessible in the former on x. Having characterised substitution, we establish operational correspondence for the encoding. Theorem 4.6 (Operational Correspondence). 1. If Ψ ⊢ M : τ and JM Kz − → Q then M → − + N such that JN Kz ≈L Q 20 2. If Ψ ; Γ ; ∆ ⊢ P :: z:A and JP K − → Q then P − →+ P ′ such that JP ′ K ≈L Q 3. If Ψ ⊢ M : τ and M − → N then JM Kz =⇒ P such that P ≈L JN Kz 4. If Ψ ; Γ ; ∆ ⊢ P :: z:A and P − → Q then JP K − →+ R with R ≈L JQK The process equivalence in Theorem 4.6 above need not be extended to account for data (although it would be relatively simple to do so), since the processes in the image of the encoding are fully erased of any data elements. Back to λ-Terms. We extend our encoding of processes to λ-terms to Sessπλ. Our extended translation maps processes to linear λ-terms, with the session type τ ∧ A interpreted as a pair type where the first component is replicated. Dually, τ ⊃ A is interpreted as a function type where the domain type is replicated. The remaining session constructs are translated as in § 3.2. Lτ ∧ AM , !Lτ M ⊗ LAM Lτ ⊃ AM , !Lτ M ⊸ LAM Lτ → σM , !Lτ M ⊸ LσM (∧L) Lx(y).P M , let y ⊗ x = x in let !y = y in LP M (∧R) LzhM i.P M , h!LM M ⊗ LP Mi (⊃R) Lx(y).P M , λx:!Lτ M.let !x = x in LP M (⊃L) LxhM i.P M , LP M{(x !LM M)/x} Lλx:τ.M M , λx:!Lτ M.let !x = x in LM M LM N M , LM M !LN M LxM , x The treatment of non-linear components of processes is identical to our previous encoding: non-linear functions τ → σ are translated to linear functions of type !τ ⊸ σ; a process offering a session of type τ ∧ A (i.e. a process of the form zhM i.P , typed by rule ∧R) is translated to a pair where the first component is the encoding of M prefixed with ! so that it may be used non-linearly, and the second is the encoding of P . Non-linear variables are handled at the respective binding sites: a process using a session of type τ ∧ A is encoded using the elimination form for the pair and the elimination form for the exponential; similarly, a process offering a session of type τ ⊃ A is encoded as a λ-abstraction where the bound variable is of type !Lτ M. Thus, we use the elimination form for the exponential, ensuring that the typing is correct. We illustrate our encoding: Lz(x).zhxi.zh(λy:σ.x)i.0M = λx:!Lτ M.let !x = x in h!x ⊗ h!Lλy:σ.xM ⊗ hiii = λx:!Lτ M.let !x = x in h!x ⊗ h!(λy:!LσM.let !y = y in x) ⊗ hiii Properties of the Encoding. Unsurprisingly due to the logical correspondence between natural deduction and sequent calculus presentations of logic, our encoding satisfies both type soundness and operational correspondence (c.f. Theorems 3.6, 3.8, and 3.10). The full development can be found in [52]. Relating the Two Encodings. We prove the two encodings are mutually inverse and preserve the full abstraction properties (we write =β and =βη for βand βη-equivalence, respectively). Theorem 4.7 (Inverse). If Ψ ; Γ ; ∆ ⊢ P :: z:A then JLP MKz ≈L JP K. Also, if Ψ ⊢ M : τ then LJM Kz M =β LM M. 21 The equivalences above are formulated between the composition of the encodings applied to P (resp. M ) and the process (resp. λ-term) after applying the translation embedding the non-linear components into their linear counterparts. This formulation matches more closely that of § 3.3, which applies to linear calculi for which the target languages of this section are a strict subset (and avoids the formalisation of process equivalence with terms). We also note that in this setting, observational equivalence and βη-equivalence coincide [3,31]. Moreover, the extensional flavour of ≈L includes η-like principles at the process level. Theorem 4.8. Let · ⊢ M : τ and · ⊢ N : τ . LM M =βη LN M iff JM Kz ≈L JN Kz . Also, let · ⊢ P :: z:A and · ⊢ Q :: z:A. We have that JP K ≈L JQK iff LP M =βη LQM. We establish full abstraction for the encoding of λ-terms into processes (Theorem 4.8) in two steps: The completeness direction (i.e. from left-to-right) follows from operational completeness and strong normalisation of the λ-calculus. The soundness direction uses operational soundness. The proof of Theorem 4.8 uses the same strategy of Theorem 3.14, appealing to the inverse theorems. 4.3 Higher-Order Session Processes – Sessπλ+ We extend the value-passing framework of the previous section, accounting for process-passing (i.e. the higher-order) in a session-typed setting. As shown in [50], we achieve this by adding to the data layer a contextual monad that encapsulates (open) session-typed processes as data values, with a corresponding elimination form in the process layer. We dub this calculus Sessπλ+ . P, Q ::= · · · | x ← M ← yi ; Q τ, σ ::= · · · | {xj :Aj ⊢ z:A} M.N ::= · · · | {x ← P ← yi :Ai } The type {xj :Aj ⊢ z:A} is the type of a term which encapsulates an open process that uses the linear channels xj :Aj and offers A along channel z. This formulation has the added benefit of formalising the integration of session-typed processes in a functional language and forms the basis for the concurrent programming language SILL [37,50]. The typing rules for the new constructs are (for simplicity we assume no shared channels in process monads): Ψ ; ·; xi :Ai ⊢ P :: z:A Ψ ⊢ {z ← P ← xi :Ai } : {xi :Ai ⊢ z:A} {}I Ψ ⊢ M : {xi :Ai ⊢ x:A} ∆1 = yi :Ai Ψ ; Γ ; ∆2 , x:A ⊢ Q :: z:C {}E Ψ ; Γ ; ∆1 , ∆2 ⊢ x ← M ← yi ; Q :: z:C Rule {}I embeds processes in the term language by essentially quoting an open process that is well-typed according to the type specification in the monadic type. Dually, rule {}E allows for processes to use monadic values through composition that consumes some of the ambient channels in order to provide the monadic term with the necessary context (according to its type). These constructs are discussed in substantial detail in [50]. The reduction semantics of the 22 process construct is given by (we tacitly assume that the names y and c do not occur in P and omit the congruence case): (c ← {z ← P ← xi :Ai } ← yi ; Q) − → (νc)(P {y/xi {c/z}} | Q) The semantics allows for the underlying monadic term M to evaluate to a (quoted) process P . The process P is then executed in parallel with the continuation Q, sharing the linear channel c for subsequent interactions. We illustrate the higher-order extension with following typed process (we write {x ← P } when P does not depend on any linear channels and assume ⊢ Q :: d:Nat ∧ 1): P , (νc)(ch{d ← Q}i.c(x).0 | c(y).d ← y; d(n).chni.0) (2) Process P above gives an abstract view of a communication idiom where a process (the left-hand side of the parallel composition) sends another process Q which potentially encapsulates some complex computation. The receiver then spawns the execution of the received process and inputs from it a result value that is sent back to the original sender. An execution of P is given by: P − → (νc)(c(x).0 | d ← {d ← Q}; d(n).chni.0) → − (νc)(c(x).0 | (νd)(Q | d(n).chni.0)) →+ (νc)(c(x).0 | ch42i.0) − − →0 Given the seminal work of Sangiorgi [46], such a representation naturally begs the question of whether or not we can develop a typed encoding of higher-order processes into the first-order setting. Indeed, we can achieve such an encoding with a fairly simple extension of the encoding of § 4.2 to Sessπλ+ by observing that monadic values are processes that need to be potentially provided with extra sessions in order to be executed correctly. For instance, a term of type {x:A ⊢ y:B} denotes a process that given a session x of type A will then offer y:B. Exploiting this observation we encode this type as the session A ⊸ B, ensuring subsequent usages of such a term are consistent with this interpretation. J{xj :Aj ⊢ z:A}K , JAj K ⊸ JAK J{x ← P → yi }Kz , z(y0 ). . . . .z(yn ).JP {z/x}K (z 6∈ fn(P )) Jx ← M ← yi ; QK , (νx)(JM Kx | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JQK) . . . )) To encode the monadic type {xj :Aj ⊢ z:A}, denoting the type of process P that is typed by xj :Aj ⊢ P :: z:A, we require that the session in the image of the translation specifies a sequence of channel inputs with behaviours Aj that make up the linear context. After the contextual aspects of the type are encoded, the session will then offer the (encoded) behaviour of A. Thus, the encoding of the monadic type is JA0 K ⊸ . . . ⊸ JAn K ⊸ JAK, which we write as JAj K ⊸ JAK. The encoding of monadic expressions adheres to this behaviour, first performing the necessary sequence of inputs and then proceeding inductively. Finally, the encoding of the elimination form for monadic expressions behaves dually, composing the encoding of the monadic expression with a sequence of outputs that instantiate the consumed names accordingly (via forwarding). The encoding of process P from Equation 2 is thus: JP K = (νc)(Jch{d ← Q}i.c(x).0K | Jc(y).d ← y; d(n).chni.0K) = (νc)(chwi.(!w(d).JQK | c(x).0)c(y).(νd)(yhbi.[b ↔ d] | d(n).chmi.(nhei.[e ↔ m] | 0))) 23 Properties of the Encoding. As in our previous development, we can show that our encoding for Sessπλ+ is type sound and satisfies operational correspondence. The full development is omitted but can be found in [52]. We encode Sessπλ+ into λ-terms, extending § 4.2 with: L{xi :Ai ⊢ z:A}M , LAi M ⊸ LAM Lx ← M ← yi ; QM , LQM{(LM M yi )/x} L{x ← P ← wi }M , λw0 . . . . .λwn .LP M The encoding translates the monadic type {xi :Ai ⊢ z:A} as a linear function LAi M ⊸ LAM, which captures the fact that the underlying value must be provided with terms satisfying the requirements of the linear context. At the level of terms, the encoding for the monadic term constructor follows its type specification, generating a nesting of λ-abstractions that closes the term and proceeding inductively. For the process encoding, we translate the monadic application construct analogously to the translation of a linear cut, but applying the appropriate variables to the translated monadic term (which is of function type). We remark the similarity between our encoding and that of the previous section, where monadic terms are translated to a sequence of inputs (here a nesting of λ-abstractions). Our encoding satisfies type soundness and operational correspondence, as usual. Further showcasing the applications of our development, we obtain a novel strong normalisation result for this higher-order session-calculus “for free”, through encoding to the λ-calculus. Theorem 4.9 (Strong Normalisation). Let Ψ ; Γ ; ∆ ⊢ P :: z:A. There is no infinite reduction sequence starting from P . Theorem 4.10 (Inverse Encodings). If Ψ ; Γ ; ∆ ⊢ P :: z:A then JLP MKz ≈L JP K. Also, if Ψ ⊢ M : τ then LJM Kz M =β LM M. Theorem 4.11. Let ⊢ M : τ , ⊢ N : τ , ⊢ P :: z:A and ⊢ Q :: z:A. LM M =βη LN M iff JM Kz ≈L JN Kz and JP K ≈L JQK iff LP M =βη LQM. 5 Related Work and Concluding Remarks Process Encodings of Functions. Toninho et al. [49] study encodings of the simply-typed λ-calculus in a logically motivated session π-calculus, via encodings to the linear λ-calculus. Our work differs since they do not study polymorphism nor reverse encodings; and we provide deeper insights through applications of the encodings. Full abstraction or inverse properties are not studied. Sangiorgi [43] uses a fully abstract compilation from the higher-order πcalculus (HOπ) to the π-calculus to study full abstraction for Milner’s encodings of the λ-calculus. The work shows that Milner’s encoding of the lazy λ-calculus can be recovered by restricting the semantic domain of processes (the so-called restrictive approach) or by enriching the λ-calculus with suitable constants. This work was later refined in [45], which does not use HOπ and considers an operational equivalence on λ-terms called open applicative bisimulation which coincides with Lévy-Longo tree equality. The work [47] studies general conditions 24 under which encodings of the λ-calculus in the π-calculus are fully abstract wrt Lévy-Longo and Böhm Trees, which are then applied to several encodings of (call-by-name) λ-calculus. The works above deal with untyped calculi, and so reverse encodings are unfeasible. In a broader sense, our approach takes the restrictive approach using linear logic-based session typing and the induced observational equivalence. We use a λ-calculus with booleans as observables and reason with a Morris-style equivalence instead of tree equalities. It would be an interesting future work to apply the conditions in [47] in our typed setting. Wadler [54] shows a correspondence between a linear functional language with session types GV and a session-typed process calculus with polymorphism based on classical linear logic CP. Along the lines of this work, Lindley and Morris [26], in an exploration of inductive and coinductive session types through the addition of least and greatest fixed points to CP and GV, develop an encoding from a linear λ-calculus with session primitives (Concurrent µGV) to a pure linear λ-calculus (Functional µGV) via a CPS transformation. They also develop translations between µCP and Concurrent µGV, extending [25]. Mapping to the terminology used in our work [17], their encodings are shown to be operationally complete, but no results are shown for the operational soundness directions and neither full abstraction nor inverse properties are studied. In addition, their operational characterisations do not compose across encodings. For instance, while strong normalisation of Functional µGV implies the same property for Concurrent µGV through their operationally complete encoding, the encoding from µCP to µGV does not necessarily preserve this property. Types for π-calculi delineate sequential behaviours by restricting composition and name usages, limiting the contexts in which processes can interact. Therefore typed equivalences offer a coarser semantics than untyped semantics. Berger et al. [5] study an encoding of System F in a polymorphic linear π-calculus, showing it to be fully abstract based on game semantics techniques. Their typing system and proofs are more complex due to the fine-grained constraints from game semantics. Moreover, they do not study a reverse encoding. Orchard and Yoshida [33] develop embeddings to-and-from PCF with parallel effects and a session-typed π-calculus, but only develop operational correspondence and semantic soundness results, leaving the full abstraction problem open. Polymorphism and Typed Behavioural Semantics. The work of [7] studies parametric session polymorphism for the intuitionistic setting, developing a behavioural equivalence that captures parametricity, which is used (denoted as ≈L ) in our paper. The work [39] introduces a typed bisimilarity for polymorphism in the π-calculus. Their bisimilarity is of an intensional flavour, whereas the one used in our work follows the extensional style of Reynolds [41]. Their typing discipline (originally from [53], which also develops type-preserving encodings of polymorphic λ-calculus into polymorphic π-calculus) differs significantly from the linear logic-based session typing of our work (e.g. theirs does not ensure deadlock-freedom). A key observation in their work is the coarser nature of typed equivalences with polymorphism (in analogy to those for IO-subtyping [38]) and 25 their interaction with channel aliasing, suggesting a use of typed semantics and encodings of the π-calculus for fine-grained analyses of program behaviour. F-Algebras and Linear-F. The use of initial and final (co)algebras to give a semantics to inductive and coinductive types dates back to Mendler [28], with their strong definability in System F appearing in [1] and [19]. The definability of inductive and coinductive types using parametricity also appears in [40] in the context of a logic for parametric polymorphism and later in [6] in a linear variant of such a logic. The work of [55] studies parametricity for the polymorphic linear λ-calculus of this work, developing encodings of a few inductive types but not the initial (or final) algebraic encodings in their full generality. Inductive and coinductive session types in a logical process setting appear in [51] and [26]. Both works consider a calculus with built-in recursion – the former in an intuitionistic setting where a process that offers a (co)inductive protocol is composed with another that consumes the (co)inductive protocol and the latter in a classical framework where composed recursive session types are dual each other. Conclusion and Future Work. This work answers the question of what kind of type discipline of the π-calculus can exactly capture and is captured by λcalculus behaviours. Our answer is given by showing the first mutually inverse and fully abstract encodings between two calculi with polymorphism, one being the Polyπ session calculus based on intuitionistic linear logic, and the other (a linear) System F. This further demonstrates that the linear logic-based articulation of name-passing interactions originally proposed by [8] (and studied extensively thereafter e.g. [50,51,36,9,54,7,25]) provides a clear and applicable tool for message-passing concurrency. By exploiting the proof theoretic equivalences between natural deduction and sequent calculus we develop mutually inverse and fully abstract encodings, which naturally extend to more intricate settings such as process passing (in the sense of HOπ). Our encodings also enable us to derive properties of the π-calculi “for free”. Specifically, we show how to obtain adequate representations of least and greatest fixed points in Polyπ through the encoding of initial and final (co)algebras in the λ-calculus. We also straightforwardly derive a strong normalisation result for the higher-order session calculus, which otherwise involves non-trivial proof techniques [13,12,36,7,5]. Future work includes extensions to the classical linear logic-based framework, including multiparty session types [10,11]. Encodings of session π-calculi to the λ-calculus have been used to implement session primitives in functional languages such as Haskell (see a recent survey [32]), OCaml [34,35,24] and Scala [48]. Following this line of work, we plan to develop encoding-based implementations of this work as embedded DSLs. This would potentially enable an exploration of algebraic constructs beyond initial and final co-algebras in a session programming setting. In particular, we wish to further study the meaning of functors, natural transformations and related constructions in a session-typed setting, both from a more fundamental viewpoint but also in terms of programming patterns. Acknowledgements. The authors would like to thank the reviewers for their comments, suggestions and pointers to related works. This work is partially supported by EPSRC EP/K034413/1, EP/K011715/1, EP/L00058X/1, EP/N027833/1 and EP/N028201/1. 26 References 1. Bainbridge, E.S., Freyd, P.J., Scedrov, A., Scott, P.J.: Functorial polymorphism. Theor. Comput. Sci. 70(1), 35–64 (1990) 2. Balzer, S., Pfenning, F.: Manifest sharing with session types. In: ICFP (2017) 3. Barber, A.: Dual intuitionistic linear logic. Tech. Rep. ECS-LFCS-96-347, School of Informatics, University of Edinburgh (1996) 4. Benton, N.: A mixed linear and non-linear logic: Proofs, terms and models (extended abstract). In: CSL. pp. 121–135 (1994) 5. Berger, M., Honda, K., Yoshida, N.: Genericity and the pi-calculus. Acta Inf. 42(23), 83–141 (2005) 6. Birkedal, L., Møgelberg, R.E., Petersen, R.L.: Linear Abadi and Plotkin Logic. Logical Methods in Computer Science 2(5) (2006) 7. Caires, L., Pérez, J.A., Pfenning, F., Toninho, B.: Behavioral polymorphism and parametricity in session-based communication. In: ESOP 2013. pp. 330–349 (2013) 8. Caires, L., Pfenning, F.: Session types as intuitionistic linear propositions. In: CONCUR 2010. pp. 222–236 (2010) 9. Caires, L., Pfenning, F., Toninho, B.: Linear logic propositions as session types. Mathematical Structures in Computer Science 26(3), 367–423 (2016) 10. Carbone, M., Lindley, S., Montesi, F., Schuermann, C., Wadler, P.: Coherence generalises duality: a logical explanation of multiparty session types. In: CONCUR’16. vol. 59, pp. 33:1–33:15. Sch. Dag. (2016) 11. Carbone, M., Montesi, F., Schurmann, C., Yoshida, N.: Multiparty session types as coherence proofs. In: CONCUR 2015. vol. 42, pp. 412–426. Sch. Dag. (2015) 12. Demangeon, R., Hirschkoff, D., Sangiorgi, D.: Mobile processes and termination. In: Semantics and Algebraic Specification. pp. 250–273 (2009) 13. Demangeon, R., Hirschkoff, D., Sangiorgi, D.: Termination in higher-order concurrent calculi. J. Log. Algebr. Program. 79(7), 550–577 (2010) 14. Gentzen, G.: Untersuchungen über das logische schließen. Mathematische Zeitschrift 39, 176–210 (1935) 15. Girard, J.: Linear logic. Theor. Comput. Sci. 50, 1–102 (1987) 16. Girard, J., Lafont, Y., Taylor, P.: Proofs and Types. C. U. P. (1989) 17. Gorla, D.: Towards a unified approach to encodability and separation results for process calculi. Inf. Comput. 208(9), 1031–1053 (2010) 18. Gorla, D., Nestmann, U.: Full abstraction for expressiveness: history, myths and facts. Mathematical Structures in Computer Science 26(4), 639–654 (2016) 19. Hasegawa, R.: Categorical data types in parametric polymorphism. Mathematical Structures in Computer Science 4(1), 71–109 (1994) 20. Honda, K.: Types for dyadic interaction. In: CONCUR’93. pp. 509–523 (1993) 21. Honda, K.: Session types and distributed computing. In: ICALP (2012) 22. Honda, K., Vasconcelos, V.T., Kubo, M.: Language primitives and type disciplines for structured communication-based programming. In: ESOP’98. pp. 22–138 (1998) 23. Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: POPL’08. pp. 273–284 (2008) 24. Imai, K., Yoshida, N., Yuen, S.: Session-ocaml: a session-based library with polarities and lenses . In: COORDINATION. LNCS, vol. 10319, pp. 99–118 (2017) 25. Lindley, S., Morris, J.G.: A semantics for propositions as sessions. In: ESOP’15. pp. 560–584 (2015) 26. Lindley, S., Morris, J.G.: Talking bananas: structural recursion for session types. In: ICFP 2016. pp. 434–447 (2016) 27 27. Maraist, J., Odersky, M., Turner, D.N., Wadler, P.: Call-by-name, call-by-value, call-by-need and the linear lambda calculus. T. C. S. 228(1-2), 175–210 (1999) 28. Mendler, N.P.: Recursive types and type constraints in second-order lambda calculus. In: LICS’87. pp. 30–36 (1987) 29. Milner, R.: Functions as processes. Math. Struct. in C.S. 2(2), 119–141 (1992) 30. Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes, I and II. Inf. Comput. 100(1), 1–77 (1992) 31. Ohta, Y., Hasegawa, M.: A terminating and confluent linear lambda calculus. In: RTA’06. pp. 166–180 (2006) 32. Orchard, D., Yoshida, N.: Session types with linearity in Haskell. In: Behavioural Types: from Theory to Tools. River Publishers (2017) 33. Orchard, D.A., Yoshida, N.: Effects as sessions, sessions as effects. In: POPL 2016. pp. 568–581 (2016) 34. Padovani, L.: A Simple Library Implementation of Binary Sessions. JFP 27 (2016) 35. Padovani, L.: Context-Free Session Type Inference. In: ESOP 2017 (2017) 36. Pérez, J.A., Caires, L., Pfenning, F., Toninho, B.: Linear logical relations for session-based concurrency. In: ESOP. pp. 539–558 (2012) 37. Pfenning, F., Griffith, D.: Polarized substructural session types. In: FoSSaCS. pp. 3–22 (2015) 38. Pierce, B.C., Sangiorgi, D.: Typing and subtyping for mobile processes. Mathematical Structures in Computer Science 6(5), 409–453 (1996) 39. Pierce, B.C., Sangiorgi, D.: Behavioral equivalence in the polymorphic pi-calculus. J. ACM 47(3), 531–584 (2000) 40. Plotkin, G.D., Abadi, M.: A logic for parametric polymorphism. In: TLCA ’93. pp. 361–375 (1993) 41. Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: IFIP Congress. pp. 513–523 (1983) 42. Reynolds, J.C., Plotkin, G.D.: On functors expressible in the polymorphic typed lambda calculus. Inf. Comput. 105(1), 1–29 (1993) 43. Sangiorgi, D.: An investigation into functions as processes. In: MFPS (1993) 44. Sangiorgi, D.: Pi-calculus, internal mobility, and agent-passing calculi. Theor. Comput. Sci. 167(1&2), 235–274 (1996) 45. Sangiorgi, D.: Lazy functions and mobile processes. In: Proof, Language, and Interaction, Essays in Honour of Robin Milner. pp. 691–720 (2000) 46. Sangiorgi, D., Walker, D.: The pi-calculus: A theory of mobile processes (2001) 47. Sangiorgi, D., Xu, X.: Trees from functions as processes. In: CONCUR (2014) 48. Scalas, A., Dardha, O., Hu, R., Yoshida, N.: A Linear Decomposition of Multiparty Sessions for Safe Distributed Programming. In: ECOOP’17 (2017) 49. Toninho, B., Caires, L., Pfenning, F.: Functions as session-typed processes. In: FOSSACS 2012. pp. 346–360 (2012) 50. Toninho, B., Caires, L., Pfenning, F.: Higher-order processes, functions, and sessions: A monadic integration. In: ESOP. pp. 350–369 (2013) 51. Toninho, B., Caires, L., Pfenning, F.: Corecursion and non-divergence in sessiontyped processes. In: TGC 2014. pp. 159–175 (2014) 52. Toninho, B., Yoshida, N.: On polymorphic sessions and functions: A tale of two (fully abstract) encodings (long version). CoRR abs/1711.00878 (2017) 53. Turner, D.: The polymorphic pi-calculus: Theory and implementation. Tech. Rep. ECS-LFCS-96-345, School of Informatics, University of Edinburgh (1996) 54. Wadler, P.: Propositions as sessions. J. Funct. Program. 24(2-3), 384–418 (2014) 55. Zhao, J., Zhang, Q., Zdancewic, S.: Relational parametricity for a polymorphic linear lambda calculus. In: APLAS. pp. 344–359 (2010) 28 Appendix On Polymorphic Sessions and Functions A Tale of Two (Fully Abstract) Encodings Additional definitions and proofs of the main materials. 29 A A.1 Appendix Additional Definitions for § 2 – Structural Congruence Definition A.1 (Structural congruence). is the least congruence relation generated by the following laws: P | 0 ≡ P ; P ≡α Q ⇒ P ≡ Q; P | Q ≡ Q | P; P | (Q | R) ≡ (P | Q) | R; (νx)(νy)P ≡ (νy)(νx)P ; x 6∈ fn(P ) ⇒ P | (νx)Q ≡ (νx)(P | Q); (νx)0 ≡ 0; and [x ↔ y] ≡ [y ↔ x]. Definition A.2 (Extended Structural Congruence). We write ≡! for the least congruence relation on processes which results from extending structural congruence ≡ (Def. A.1) with the following axioms, dubbed the Sharpened Replication Axioms [46]: 1. (νu)(!u(z).P | (νy)(Q | R)) ≡! (νy)((νu)(!u(z).P | Q) | (νu)(!u(z).P | R)) 2. (νu)(!u(y).P | (νv)(!v(z).Q | R)) ≡! (νv)((!v(z).(νu)(!u(y).P | Q)) | (νu)(!u(y).P | R)) 3. (νu)(!u(y).Q | P ) ≡! P if u 6∈ fn(P ) Axioms (1) and (2) represent principles for the distribution of shared servers among processes, while (3) formalises the garbage collection of shared servers which cannot be invoked by any process. The axioms embody distributivity, contraction and weakening of shared resources and are sound wrt (typed) observational equivalence [36]. A.2 Additional Definitions for § 2 – Typing Rules Below we list the typing rules for the calculus of section § 2. We note that the judgment Ω ⊢ B type simply requires that free variables in B be in Ω. Moreover, typing treats processes quotiented by structural congruence – given a well-typed process Ω; Γ ; ∆ ⊢ P :: T , subject reduction ensures that for all τ possible reductions P − → P ′ , there exists a process Q where P ′ ≡ Q such that α Ω; Γ ; ∆ ⊢ Q :: T . Related properties hold wrt general transitions P − → P ′ . We refer the reader to [9,8] for additional details on this matter. 30 (id) (⊸R) Ω; Γ ; x:A ⊢ [x ↔ z] :: z:A Ω; Γ ; ∆, x:A ⊢ P :: z:B Ω; Γ ; ∆ ⊢ z(x).P :: z:A ⊸ B (⊗R) (⊸L) (1L) Ω; Γ ; ∆ ⊢ P :: z:C Ω; Γ ; ∆, x:1 ⊢ P :: z:C Ω; Γ ; ∆1 ⊢ P :: y:A Ω; Γ ; ∆2 , x:B ⊢ Q :: z:C Ω; Γ ; ∆1 , ∆2 , x:A ⊸ B ⊢ (νy)xhyi.(P | Q) :: z:C (⊗L) Ω; Γ ; ∆, y:A, x:B ⊢ P :: z:C Ω; Γ ; ∆, x:A ⊗ B ⊢ x(y).P :: z:C Ω; Γ ; ∆ ⊢ P :: z:A Ω; Γ ; ∆ ⊢ Q :: z:B Ω; Γ ; ∆ ⊢ z.case(P, Q) :: z:A & B (&L1 ) Ω; Γ ; ∆, x:A ⊢ P :: z:C Ω; Γ ; ∆, x:A & B ⊢ x.inl; P :: z:C Ω; Γ ; ∆, x:A ⊢ P :: z:C Ω; Γ ; ∆, x:A & B ⊢ x.inr; P :: z:C (⊕R1 ) Ω; Γ ; ∆ ⊢ P :: z:A Ω; Γ ; ∆ ⊢ z.inl; P :: z:A ⊕ B (&L2 ) (⊕R2 ) Ω; Γ ; · ⊢ 0 :: z:1 Ω; Γ ; ∆1 ⊢ P :: y:A Ω; Γ ; ∆2 ⊢ Q :: z:B Ω; Γ ; ∆1 , ∆2 ⊢ (νx)zhyi.(P | Q) :: z:A ⊗ B (&R) Ω; Γ ; ∆ ⊢ P :: z:B Ω; Γ ; ∆ ⊢ z.inr; P :: z:A ⊕ B (!R) (⊕L) Ω; Γ ; ∆, x:A ⊢ P :: z:C Ω; Γ ; ∆, x:B ⊢ Q :: z:C Ω; Γ ; ∆, x:A ⊕ B ⊢ x.case(P, Q) :: z:C Ω; Γ ; · ⊢ P :: x:A Ω; Γ ; · ⊢!z(x).P :: z:!A (copy) (!L) Ω; Γ, u:A; ∆ ⊢ P :: z:C Ω; Γ ; ∆, x:!A ⊢ P {x/u} :: z:C Ω; Γ, u:A; ∆, y:A ⊢ P :: z:C Ω; Γ, u:A; ∆ ⊢ (νy)uhyi.P :: z:C (∀R) Ω, X; Γ ; ∆ ⊢ P :: z:A Ω; Γ ; ∆ ⊢ z(X).P :: z:∀X.A (∃R) Ω ⊢ B type Ω; Γ ; ∆ ⊢ P :: z:A{B/X} Ω; Γ ; ∆ ⊢ zhBi.P :: z:∃X.A (cut) (∀L) Ω ⊢ B type Ω; Γ ; ∆, x:A{B/X} ⊢ P :: z:C Ω; Γ ; ∆, x:∀X.A ⊢ xhBi.P :: z:C (∃L) Ω, X; Γ ; ∆, x:A ⊢ P :: z:C Ω; Γ ; ∆, x:∃X.A ⊢ x(X).P :: z:C Ω; Γ ; ∆1 ⊢ P :: x:A Ω; Γ ; ∆2 , x:A ⊢ Q :: z:C Ω; Γ ; ∆1 , ∆2 ⊢ (νx)(P | Q) :: z:C (cut! ) A.3 (1R) Ω; Γ ; · ⊢ P :: x:A Ω; Γ, u:A; ∆ ⊢ Q :: z:C Ω; Γ ; ∆ ⊢ (νu)(!u(x).P | Q) :: z:C Additional Definitions for § 2 – Typed Barbed Congruence Definition A.3 (Type-respecting Relations [7]). A type-respecting relation over processes, written {RS }S is defined as a family of relations over processes indexed by S. We often write R to refer to the whole family, and write Ω; Γ ; ∆ ⊢ P RQ :: T to denote Ω; Γ ; ∆ ⊢ P, Q :: T and (P, Q) ∈ RΩ;Γ ;∆⊢T . 31 We say that a type-respecting relation is an equivalence if it satisfies the usual properties of reflexivity, transitivity and symmetry. In the remainder of this development we often omit “type-respecting”. Definition A.4 (τ -closed [7]). Relation R is τ -closed if Ω; Γ ; ∆ ⊢ P RQ :: T and P − → P ′ imply there exists a Q′ such that Q =⇒ Q′ and Ω; Γ ; ∆ ⊢ P ′ RQ′ :: T. Our definition of basic observable on processes, or barb, is given below. Definition A.5 (Barbs [7]). Let Ox = {x, x, x.inl, x.inr, x.inl, x.inr} be the set of basic observables under name x. Given a well-typed process P , we write: (νy)xhyi xhAi (i) barb(P, x), if P −−−−−→ P ′ ; (ii) barb(P, x), if P −−−→ P ′ , for some A, P ′ ; x(A) x(y) (iii) barb(P, x), if P −−−→ P ′ , for some A, P ′ ; (iv) barb(P, x), if P −−−→ P ′ , α for some y, P ′ ; (v) barb(P, α), if P −→ P ′ , for some P ′ and α ∈ Ox \ {x, x}. Given some o ∈ Ox , we write wbarb(P, o) if there exists a P ′ such that P =⇒ P ′ and barb(P ′ , o) holds. Definition A.6 (Barb preserving relation). Relation R is a barb preserving if, for every name x, Ω; Γ ; ∆ ⊢ P RQ :: T and barb(P, o) imply wbarb(Q, o), for any o ∈ Ox . Definition A.7 (Contextuality). A relation R is contextual if Ω; Γ ; ∆ ⊢ P RQ :: T implies Ω; Γ ; ∆′ ⊢ C[P ]RC[Q] :: T ′ , for every ∆′ T ′ and typed context C. Definition A.8 (Barbed Congruence). Barbed congruence, noted ∼ =, is the largest equivalence on well-typed processes symmetric type-respecting relation that is τ -closed, barb preserving, and contextual. 32 A.4 Additional Definitions for § 2 – Logical Equivalence The full definition for the base case of logical equivalence is given below: P ≈L Q :: z:X[η : ω⇔ω ′ ] iff (P, Q) ∈ η(X)(z) P ≈L Q :: z:1[η : ω⇔ω ′ ] iff ∀P ′ , Q′ . (P =⇒ P ′ ∧ P ′ 6−−→ ∧Q =⇒ Q′ ∧ Q′ 6−−→) ⇒ (P ′ ≡! 0 ∧ Q′ ≡! 0) z(y) z(y) P ≈L Q :: z:A ⊸ B[η : ω⇔ω ′ ] iff ∀P ′ , y. (P −−→ P ′ ) ⇒ ∃Q′ .Q =⇒ Q′ s.t. ∀R1 , R2 . R1 ≈L R2 :: y:A[η : ω⇔ω ′ ] (νy)(P ′ | R1 ) ≈L (νy)(Q′ | R2 ) :: z:B[η : ω⇔ω ′ ] (νy)zhyi (νy)zhyi P ≈L Q :: z:A ⊗ B[η : ω⇔ω ′ ] iff ∀P ′ , y. (P −−−−−→ P ′ ) ⇒ ∃Q′ .Q =⇒ Q′ s.t. ∃P1 , P2 , Q1 , Q2 .P ′ ≡! P1 | P2 ∧ Q′ ≡! Q1 | Q2 P1 ≈L Q1 :: y:A[η : ω⇔ω ′ ] ∧ P2 ≈L Q2 :: z:B[η : ω⇔ω ′ ] z(y) z(y) P ≈L Q :: z:!A[η : ω⇔ω ′ ] iff ∀P ′ . (P −−→ P ′ ) ⇒ ∃Q′ .Q =⇒ Q′ ∧ P ′ ≈L Q′ :: y:A[η : ω⇔ω ′ ] P ≈L Q :: z:A & B[η : ω⇔ω ′ ] iff z.inl z.inl z.inr z.inr (∀P ′ .(P −−→ P ′ ) ⇒ ∃Q′ .(Q =⇒ Q′ ∧ P ′ ≈L Q′ :: z:A[η : ω⇔ω ′ ]))∧ (∀P ′ .(P −−−→ P ′ ) ⇒ ∃Q′ .(Q =⇒ Q′ ∧ P ′ ≈L Q′ :: z:B[η : ω⇔ω ′ ])) P ≈L Q :: z:A ⊕ B[η : ω⇔ω ′ ] iff z.inl z.inl z.inr z.inr (∀P ′ .(P −−−→ P ′ ) ⇒ ∃Q′ .(Q =⇒ Q′ ∧ P ′ ≈L Q′ :: z:A[η : ω⇔ω ′ ]))∧ (∀P ′ .(P −−−→ P ′ ) ⇒ ∃Q′ .(Q =⇒ Q′ ∧ P ′ ≈L Q′ :: z:B[η : ω⇔ω ′ ])) z(B1 ) P ≈L Q :: z:∀X.A[η : ω⇔ω ′ ] iff ∀B1 , B2 , P ′ , R :: −:B1 ⇔B2 . (P −−−−→ P ′ ) implies z(B2 ) ∃Q′ .Q =⇒ Q′ , P ′ ≈L Q′ :: z:A[η[X 7→ R] : ω[X 7→ B1 ]⇔ω ′ [X 7→ B2 ]] zhB1 i P ≈L Q :: z:∃X.A[η : ω⇔ω ′ ] iff ∃B1 , B2 , R :: −:B1 ⇔B2 . (P −−−−→ P ′ ) implies zhB2 i ∃Q′ .Q =⇒ Q′ , P ′ ≈L Q′ :: z:A[η[X 7→ R] : ω[X 7→ B1 ]⇔ω ′ [X 7→ B2 ]] 33 A.5 Typing Rules for Linear-F (⊸ I) Ω; Γ ; ∆, x:A ⊢ M : B (var) (⊸ E) Ω; Γ ; ∆ ⊢ M : A ⊸ B Ω; Γ ; ∆′ ⊢ N : A Ω; Γ ; x:A ⊢ x:A Ω; Γ ; ∆ ⊢ λx:A.M : A ⊸ B Ω; Γ ; ∆, ∆′ ⊢ M N : B (⊗I) (⊗E) Ω; Γ ; ∆ ⊢ M : A Ω; Γ ; ∆′ ⊢ N : B Ω; Γ ; ∆ ⊢ M : A ⊗ B Ω; Γ ; ∆, x:A, y:B ⊢ N : B ′ Ω; Γ ; ∆, ∆′ ⊢ hM ⊗ N i : A ⊗ B (!I) (!E) Ω; Γ ; · ⊢ M : A Ω; Γ ; ∆ ⊢ M :!A Ω; Γ ; ∆, ∆′ ⊢ let x ⊗ y = M in N : B ′ (uvar) Ω; Γ, u:A; ∆′ ⊢ N : B Ω; Γ ; · ⊢!M :!A Ω; Γ ; ∆, ∆′ ⊢ let !u = M in N : B Ω; Γ, u:A; · ⊢ u:A (∀E) (∀I) Ω ⊢ A type Ω; Γ ; ∆ ⊢ M : ∀X.B Ω, X; Γ ; ∆ ⊢ M : A (∃I) Ω ⊢ A type Ω; Γ ; ∆ ⊢ ΛX.M : ∀X.A Ω; Γ ; ∆ ⊢ M [A] : B{A/X} (∃E) Ω; Γ ; ∆ ⊢ M : B{A/X} Ω; Γ ; ∆ ⊢ M : ∃X.A Ω, X; Γ ; ∆, y:A ⊢ N : B Ω; Γ ; ∆ ⊢ pack A with M : ∃X.B (1I) (1E) Ω; Γ ; ∆ ⊢ M : 1 Ω; Γ ; · ⊢ hi : 1 A.6 Ω; Γ ; ∆, ∆′ ⊢ let 1 = M in N : C Ω; Γ ; · ⊢ T : 2 Ω; Γ ; · ⊢ F : 2 Operational Correspondence for J−Kz The results follow from a straightforward extension to the development in [49]. Lemma A.9. 1. Let Ω; Γ ; ∆1 , x:A ⊢ M : B and Ω; Γ ; ∆2 ⊢ N : A. We have that Ω; Γ ; ∆1 , ∆2 ⊢ JM {N/x}Kz ≈L (νx)(JM Kz | JN Kx ) :: z:B. 2. Let Ω; Γ, u:A; ∆ ⊢ M : B and Ω; Γ ; · ⊢ N : A. we have that Ω; Γ ; ∆ ⊢ JM {N/u}Kz ≈L (νu)(JM Kz |!u(x).JN Kx ) :: z:B. Proof. By induction on the structure of M , exploiting the fact that commuting conversions and ≡! are sound ≈L equivalences. See Lemma 4.5 for further details. A.7 Additional Definitions for § 3.2 – Encoding on Typing Derivations The encoding on typing derivations is given in Figures 5 and 6 (for readability purposes, the processes are highlighted in blue). The encoding makes use of the two admissible substitution principles denoted by the following rules: (subst) Ω; Γ ; ∆1 , x:B ⊢ M : A Ω; Γ ; ∆2 ⊢ N : B Ω; Γ ; ∆1 , ∆2 ⊢ M {N/x} : A Ω ⊢ B type Ω; Γ ; ∆ ⊢ let (X, y) = M in N : B (2I1 ) (2I2 ) Ω; Γ ; ∆′ ⊢ N : C (subst! ) Ω; Γ, u:B; ∆ ⊢ M : A Ω; Γ ; · ⊢ N : B Ω; Γ ; ∆ ⊢ M {N/u} : A 34 A.8 Proofs for § 3.2 – Encoding from Polyπ to Linear-F Theorem 3.6. If Ω; Γ ; ∆ ⊢ P :: z:A then LΩM; LΓ M; L∆M ⊢ LP M : A. Proof. Straightforward induction. Theorem 3.8 (Operational Completeness). Let Ω; Γ ; ∆ ⊢ P :: z:A. If P − → Q then LP M − →∗β LQM. Proof. Induction on typing and case analysis on the possibility of reduction. Case: (cut) Ω; Γ ; ∆1 ⊢ P1 :: x:A Ω; Γ ; ∆2 , x:A ⊢ P2 :: z:C Ω; Γ ; ∆1 , ∆2 ⊢ (νx)(P1 | P2 ) :: z:C where P1 − → P1′ or P2 − → P2′ . L(νx)(P1 | P2 )M = LP2 M{LP1 M/x} Subcase: P1 − → P1′ (νx)(P1 | P2 ) − → (νx)(P1′ | P2 ) ∗ ′ LP1 M →β LP1 M LP2 M{LP1 M/x} →∗β LP2 M{LP1′ M/x} L(νx)(P1′ | P2 )M = LP2 M{LP1′ M/x} Subcase: P2 − → P2′ (νx)(P1 | P2 ) − → (νx)(P1 | P2′ ) ∗ ′ LP2 M →β LP2 M LP2 M{LP1 M/x} →∗β LP2′ M{LP1 M/x} L(νx)(P1 | P2′ )M = LP2′ M{LP1 M/x} by definition by i.h. by definition by definition by i.h. by definition by definition Case: (cut) Ω; Γ ; ∆1 ⊢ x(y).P1 :: x:A ⊸ B Ω; Γ ; ∆2 , x:A ⊸ B ⊢ (νy)xhyi.(Q1 | Q2 ) :: z:C Ω; Γ ; ∆1 , ∆2 ⊢ (νx)(x(y).P1 | (νy)xhyi.(Q1 | Q2 )) :: z:C (νx)(x(y).P1 | (νy)xhyi.(Q1 | Q2 )) − → (νx)((νy)(Q1 | P1 ) | Q2 ) by reduction L(νx)(x(y).P1 | (νy)xhyi.(Q1 | Q2 ))M = (LQ2 M{(x LQ1 M)/x}){(λy.LP1 M)/x} by definition (LQ2 M{(x LQ1 M)/x}){(λy.LP1 M)/x} = LQ2 M{((λy.LP1 M) LQ1 M)/x} L(νx)((νy)(Q1 | P1 ) | Q2 )M = LQ2 M{(LP1 M{LQ1 M/y})/x} by definition LQ2 M{((λy.LP1 M) LQ1 M)/x} →β LQ2 M{(LP1 M{LQ1 M/y})/x} redex L(νx)((νy)(Q1 | P1 ) | Q2 ) →∗β LQ2 M{(LP1 M{LQ1 M/y})/x} by definition Case: (cut) Ω; Γ ; ∆1 ⊢ (νy)xhyi.(P1 | P2 ) :: x:A ⊗ B Ω; Γ ; ∆2 , x:A ⊗ B ⊢ x(y).Q1 :: z:C Ω; Γ ; ∆1 , ∆2 ⊢ (νx)((νy)xhyi.(P1 | P2 ) | x(y).Q1 ) :: z:C (νx)((νy)xhyi.(P1 | P2 ) | x(y).Q1 ) − → (νx)(P2 | (νy)(P1 | Q1 )) by reduction L(νx)((νy)xhyi.(P1 | P2 ) | x(y).Q1 )M = let x ⊗ y = hLP2 M ⊗ LP1 Mi in LQ1 M L(νx)(P2 | (νy)(P1 | Q1 ))M = LQ1 M{LP2 M/x}{LP1 M/y} by def. let x ⊗ y = hLP2 M ⊗ LP1 Mi in LQ1 M − → LQ1 M{LP2 M/x}{LP1 M/y} 35 Case: (cut! ) Ω; Γ ; · ⊢ P1 :: x:A Ω; Γ, u:A; ∆ ⊢ (νx)uhxi.Q1 :: z:C Ω; Γ ; ∆ ⊢ (νu)(!u(x).P1 | (νx)uhxi.Q1 ) :: z:C (νu)(!u(x).P1 | (νx)uhxi.Q1 ) − → (νu)(!u(x).P1 | (νx)(P1 | Q1 )) by reduction L(νu)(!u(x).P1 | (νx)uhxi.Q1 )M = LQ1 M{u/x}{LP1 M/u} = LQ1 M{LP1 M/x, LP1 M/u} by def. L(νu)(!u(x).P1 | (νx)(P1 | Q1 ))M = (LQ1 M{LP1 M/x}){LP1 M/u} Case: (cut) Ω; Γ ; ∆1 ⊢ x(Y ).P1 :: x:∀Y.A Ω; Γ ; ∆2 , x:∀Y.A ⊢ xhBi.Q1 :: z:C Ω; Γ ; ∆1 , ∆2 ⊢ (νx)(x(Y ).P1 | xhBi.Q1 ) :: z:C (νx)(x(Y ).P1 | xhBi.Q1 ) − → (νx)(P1 {B1 /Y } | Q1 ) L(νx)(x(Y ).P1 | xhBi.Q1 )M = (LQ1 M{x[B]/x}){(ΛY.LP1 M)/x} = LQ1 M{(ΛY.LP1 M[B])/x} →β LQ1 M{LP1 M{B1 /Y }/x} L(νx)(P1 {B1 /Y } | Q1 )M = LQ1 M{LP1 M{B1 /Y }/x} by reduction by definition Case: (cut) Ω; Γ ; ∆1 ⊢ xhBi.P1 :: x:∃Y.A Ω; Γ ; ∆2 , x:∃Y.A ⊢ x(Y ).Q1 :: z:C Ω; Γ ; ∆1 , ∆2 ⊢ (νx)(xhBi.P1 | x(Y ).Q1 ) :: z:C (νx)(xhBi.P1 | x(Y ).Q1 ) − → (νx)(P1 | Q1 {B/Y }) by reduction L(νx)(xhBi.P1 | x(Y ).Q1 )M = let (Y, x) = pack B with LP1 M in LQ1 M by def. (pack B with LP1 MLQ1 M →β LQ1 M{LP1 M/x, B/Y } L(νx)(P1 | Q1 {B/Y })M = LQ1 M{B/Y }){LP1 M/x} Theorem 3.10 (Operational Soundness). Let Ω; Γ ; ∆ ⊢ P :: z:A and LP M − → M , there exists Q such that P 7→∗ Q and LQM =α M . Proof. By induction on typing. Case: (⊸L) Ω; Γ ; ∆1 ⊢ P1 :: y:A Ω; Γ ; ∆2 , x:B ⊢ P2 :: z:C Ω; Γ ; ∆1 , ∆2 , x:A ⊸ B ⊢ (νy)xhyi.(P1 | P2 ) :: z:C L(νy)xhyi.(P1 | P2 )M = LP2 M{(x LP1 M)/x} with LP2 M{(x LP1 M)/x} = M − → M′ by assumption Subcase: M − → M ′ due to redex in LP1 M LP1 M − → M0 by assumption ∃Q0 such that P1 7→∗ Q0 and LQ0 M ≡α M0 by i.h. (νy)xhyi.(P1 | P2 ) 7→∗ (νy)xhyi.(Q0 | P2 ) by compatibility of 7→ L(νy)xhyi.(Q0 | P2 )M = LP2 M{(x LQ0 M)/x} = LP2 M{(x M0 )/x} Subcase: M − → M ′ due to redex in LP2 M LP2 M − → M0 by assumption ∃Q0 such that P2 7→∗ Q0 and LQ0 M = M0 by i.h (νy)xhyi.(P1 | P2 ) 7→∗ (νy)xhyi.(P1 | Q0 ) by compatibility of 7→ L(νy)xhyi.(P1 | Q0 )M = LQ0 M{(x LP1 M)/x} = M0 {x LP1 M)/x} 36 Case: (copy) Ω; Γ, u:A; ∆, x:A ⊢ P1 :: z:C Ω; Γ, u:A; ∆ ⊢ (νx)uhxi.P1 :: z:C L(νx)uhxi.P1 M = LP1 M{u/x} = M − → M′ LP1 M − → M0 ∃Q0 such that P1 7→∗ Q0 and LQ0 M =α M0 (νx)uhxi.P1 7→∗ (νx)uhxi.Q0 L(νx)uhxi.Q0 M = LQ0 M{u/x} = M0 {u/x} by assumption by inversion on − → by i.h. by compatibility Case: (∀L) Ω ⊢ B type Ω; Γ ; ∆, x:A{B/X} ⊢ P1 :: z:C Ω; Γ ; ∆, x:∀X.A ⊢ xhBi.P1 :: z:C LxhBi.P1 M = LP1 M{x[B]/x} with LP1 M{x[B]/x} − →M LP1 M − → M0 ∃Q0 such that P1 7→∗ Q0 and LQ0 M =α M0 xhBi.P1 7→∗ xhBi.Q0 LxhBi.Q0 M = LQ0 M{x[B]/x} = M0 {x[B]/x} by assumption by inversion by i.h. by compatibility Case: (cut) Ω; Γ ; ∆1 ⊢ P1 :: x:A Ω; Γ ; ∆2 , x:A ⊢ P2 :: z:C Ω; Γ ; ∆1 , ∆2 ⊢ (νx)(P1 | P2 ) :: z:C L(νx)(P1 | P2 )M = LP2 M{LP1 M/x} with LP2 M{LP1 M/x} = M − → M ′ by assumption Subcase: M − → M ′ due to redex in LP1 M LP1 M − → M0 by assumption ∃Q0 such that P1 7→∗ Q0 and LQ0 M =α M0 by i.h. (νx)(P1 | P2 ) 7→∗ (νx)(Q0 | P2 ) by reduction L(νx)(Q0 | P2 )M = LP2 M{LQ0 M/x} = LP2 M{M0 /x} Subcase: M − → M ′ due to redex in LP2 M LP2 M − → M0 by assumption ∃Q0 such that P2 7→∗ Q0 and LQ0 M = M0 by i.h. (νx)(P1 | P2 ) 7→∗ (νx)(Q0 | P2 ) by compatibility L(νx)(P1 | Q0 )M = LQ0 M{LP1 M/x} = M0 {LP1 M/x} Subcase: M − → M ′ where the redex arises due to the substitution of LP1 M for x Subsubcase: Last rule of deriv. of P2 is a left rule on x: In all cases except !L, a top-level process reduction is exposed (viz. Theorem 3.8). If last rule is !L, then either x does not occur in P2 and we conclude by 7→. Subsubcase: Last rule of deriv. of P2 is not a left rule on x: For rule (id) we have a process reduction immediately. In all other cases either there is no possible β-redex or we can conclude via compatibility of 7→. Case: (cut! ) Ω; Γ ; · ⊢ P1 :: x:A Ω; Γ, u:A; ∆ ⊢ P2 :: z:C Ω; Γ ; ∆ ⊢ (νu)(!u(x).P1 | P2 ) :: z:C 37 L(νu)(!u(x).P1 | P2 )M = LP2 M{LP1 M/u} with LP2 M{LP1 M/u} − → M by assumption Subcase: M − → M ′ due to redex in LP1 M LP1 M − → M0 by assumption ∃Q0 such that P1 7→∗ Q0 and LQ0 M =α M0 by i.h. (νu)(!u(x).P1 | P2 ) 7→∗ (νu)(!u(x).Q0 | P2 ) by compatibility L(νu)(!u(x).Q0 | P2 )M = LP2 M{LQ0 M/u} = LP2 M{M0 /u} Subcase: M − → M ′ due to redex in LP2 M LP2 M − → M0 by assumption ∃Q0 such that P2 7→∗ Q0 and LQ0 M = M0 by i.h. (νu)(!u(x).P1 | P2 ) 7→∗ (νu)(!u(x).P1 | Q0 ) by compatibility L(νu)(!u(x).P1 | Q0 )M = LQ0 M{LP1 M/u} = M0 {LP1 M/u} Subcase: M − → M ′ where the redex arises due to the substitution of LP1 M for u If last rule in deriv. of P2 is copy then we have = terms in 0 process reductions. Otherwise, the result follows by compatibility of 7→. In all other cases the λ-term in the image of the translation does not reduce. A.9 Proofs for § 3.3 – Inversion and Full Abstraction The proofs below rely on the fact that all commuting conversions of linear logic are sound observational equivalences in the sense of ≈L . Theorem 3.11 (Inverse). If Ω; Γ ; ∆ ⊢ M : A then Ω; Γ ; ∆ ⊢ LJM Kz M ∼ =M : A. Also, if Ω; Γ ; ∆ ⊢ P :: z:A then Ω; Γ ; ∆ ⊢ JLP MKz ≈L P :: z:A We prove (1) and (2) above separately. Theorem A.10. If Ω; Γ ; ∆ ⊢ M : A then Ω; Γ ; ∆ ⊢ LJM Kz M ∼ =M :A Proof. By induction on the given typing derivation. Case: Linear variable LJxKz M = x ∼ =x Case: Unrestricted variable JuKz = (νx)uhxi.[x ↔ z] L(νx)(uhxi.[x ↔ z])M = u ∼ =u by def. Case: λ-abstraction Jλx.M Kz = z(x).JM Kz Lz(x).JM Kz M = λx.LJM Kz M ∼ = λx.M Case: Application by def. by i.h. and congruence 38 JM N Kz = (νx)(JM Kx | (νy)xhyi.(JN Ky | [x ↔ z])) by def. L(νx)(JM Kx | (νy)xhyi.(JN Ky | [x ↔ z]))M = LJM Kx M LJN Ky M by def. by i.h. and congruence LJM Kx M LJN Ky M ∼ =MN Case: Exponential J!M Kz =!z(x).JM Kx L!z(x).JM Kx M =!LJM Kx M ∼ = LJ!M Kz M by def. by def, i.h. and congruence Case: Exponential elim. Jlet !u = M in N Kz = (νx)(JM Kx | JN Kz {x/u}) by def. L(νx)(JM Kx | JN Kz {x/u})M = let !u = LJM Kx M in LJN Kz M by def. let !u = LJM Kx M in LJN Kz M ∼ by congruence and i.h. = let !u = M in N Case: Multiplicative Pairing JhM ⊗ N iKz = (νy)zhyi.(JM Ky | JN Kz ) L(νy)zhyi.(JM Ky | JN Kz )M = hLJM Ky M ⊗ LJN Kz Mi hLJM Ky M ⊗ LJN Kz Mi ∼ = hM ⊗ N i by def. by def. by i.h. and congruence Case: Mult. Pairing Elimination Jlet x ⊗ y = M in N Kz = (νy)(JM Kx | x(y).JN Kz ) by def. L(νy)(JM Kx | x(y).JN Kz )M = let x ⊗ y = LJM Kx M in LJN Kz M by def. by i.h. and congruence let x ⊗ y = LJM Kx M in LJN Kz M ∼ = let x ⊗ y = M in N Case: Λ-abstraction LJΛX.M Kz M = ΛX.LJM Kz M ∼ = ΛX.M by i.h. and congruence Case: Type application LJM [A]Kz M = LJM Kz M[A] ∼ = M [A] by i.h. and congruence Case: Existential Intro. LJpack A with M Kz M = pack A with LJM Kz M ∼ = pack A with M by i.h. and congruence Case: Existential Elim. LJlet (X, y) = M in N Kz M = let (X, y) = LJM Kx M in LJN Kz M ∼ = let (X, y) = M in N by i.h. and congruence 39 Theorem A.11. If Ω; Γ ; ∆ ⊢ P :: z:A then Ω; Γ ; ∆ ⊢ JLP MKz ≈L P :: z:A Proof. By induction on the given typing derivation. Case: (id) or any right rule Immediate by definition in the case of (id) and by i.h. and congruence in all other cases. Case: ⊸L L(νy)xhyi.(P | Q)M = LQM{(x LP M)/x} by def. JLQM{(x LP M))/x}Kz ≈L (νa)(J(x LP M)Ka | JLQMKz {a/x}) by Lemma A.9, with a fresh = (νa)((νw)([x ↔ w] | (νy)whyi.(JLP MKy | [w ↔ a])) | JLQMKz {a/x}) by def. → (νa)((νy)xhyi.(JLP MKy | [x ↔ a]) | JLQMKz {a/x}) − by reduction ≈L (νy)xhyi.(JLP MKy | JLQMKz ) commuting conversion + reduction ≈L (νy)xhyi.(P | Q) by i.h. + congruence Case: ⊗L Lx(y).P M = let x ⊗ y = x in LP M by def. Jlet x ⊗ y = x in LP MKz = (νw)([x ↔ w] | w(y).JLP MKz ) by def. → x(y).JLP MKz ≈L x(y).P − by i.h. and congruence Case: !L LP {x/u}M = let !u = x in LP M Jlet !u = x in LP MKz = (νw)([x ↔ w] | JLP MKz {w/u}) → JLP MKz {x/u} ≈L P {x/u} − by def. by def. by i.h. Case: copy L(νx)uhxi.P M = LP M{u/x} by def. by Lemma A.9 JLP M{u/x}Kz ≈L (νx)(uhwi.[w ↔ x] | JLP MKz ) ≈L (νx)(uhwi.[w ↔ x] | P ) by i.h. and congruence ≈L (νx)uhxi.P by definition of ≈L for open processes (i.e. closing for u:A and observing that no actions on z are blocked) Case: ∀L LxhBi.P M = LP M{(x[B])/x} by def. JLP M{(x[B])/x}Kz ≈L (νa)(Jx[B]Ka | JLP MKz {a/x}) by Lemma A.9, with a fresh (νa)((νw)([x ↔ w] | whBi.[w ↔ a]) | JLP MKz {a/x}) by def. → (νa)(xhBi.[x ↔ a] | JLP MKz {a/x}) − ≈L xhBi.JLP MKz commuting conversion + reduction ≈L xhBi.P by i.h. + congruence Case: ∃L 40 Lx(Y ).P M = let (Y, x) = x in LP M Jlet (Y, x) = x in LP MKz = (νy)([x ↔ y] | y(Y ).JLP MKz ) → x(Y ).JLP MKz {y/x}) − ≈L x(Y ).P by def. by def. by reduction by i.h. + congruence Case: cut L(νx)(P | Q)M = LQM{LP M/x} by definition JLQM{LP M/x}Kz ≈L (νy)(JLP MKy | JLQMKz {y/x}) by Lemma A.9, with y fresh ≡ (νx)(P | Q) by i.h. + congruence and ≡α Case: cut! #((νu)(!u(x).P | Q)) = LQM{LP M/u} by definition JLQM{LP M/u}Kz ≈L (νu)(!u(x).JLP MKx | JLQMKz {v/u}) by Lemma A.9 ≈L (νu)(!u(x).P | Q) by i.h. + congruence and ≡α Lemma A.12. M ⇓ T iff JM Kz ≈L JTKz :: z:2 Proof. By operational correspondence. Theorem 3.13 (Full Abstraction). Ω; Γ ; ∆ ⊢ M ∼ = N : A iff Ω; Γ ; ∆ ⊢ JM Kz ≈L JN Kz :: z:A. Proof. (Soundness, ⇐) Since ∼ = is the largest consistent congruence compatible with the booleans, let M RN iff JM Kz ≈L JN Kz . We show that R is one such relation. 1. (Congruence) Since ≈L is a congruence, R is a congruence. 2. (Reduction-closed) Let M − → M ′ and JM Kz ≈L JN Kz . Then we have by operational correspondence (Theorem 3.4) that JM Kz − →∗ P such that M ′ ≪ ′ ′ P and we have that P ≈L JM Kz hence JM Kz ≈L JN Kz , thus R is reduction closed. 3. (Compatible with the booleans) Follows from Lemma A.12. ∼ N : A and JM Kz 6≈L (Completeness, ⇒) Assume to the contrary that M = JN Kz :: z:A. This means we can find a distinguishing context R such that (νz, x̃)(JM Kz | R) ≈L JTKy :: y:J2K and (νz, x̃)(JN Kz | R) ≈L JFKy :: y:J2K. By Fullness (Theorem 3.12), we have that there exists some L such that JLKy ≈L R, thus: (νz, x̃)(JM Kz | JLKy ) ≈L JTKy :: y:J2K and (νz, x̃)(JN Kz | JLKy ) ≈L JFKy :: y:J2K. By Theorem 3.13 (Soundness), we have that L[M ] ∼ = T and L[N ] ∼ = F and thus ∼ L[M ] 6∼ L[N ] which contradicts M N : A. = = Theorem 3.14 (Full Abstraction). Ω; Γ ; ∆ ⊢ P ≈L Q :: z:A iff Ω; Γ ; ∆ ⊢ LP M ∼ = LQM : A. 41 Proof. (Soundness, ⇐) Let M = LP M and N = LQM. By Theorem 3.13 (Completeness) we have JM Kz ≈L JN Kz . Thus by Theorem 3.11 we have: JM Kz = JLP MKz ≈L P and JN Kz = JLQMKz ≈L Q. By compatibility with observational equivalence we have P ≈L Q :: z:A. (Completeness, ⇒) From P ≈L Q :: z:A, Theorem 3.11 and compatibility with observational equivalence we have JLP MKz ≈L JLQMKz :: z:A. Let LP M = M and LQM = N . We have by Theorem 3.13 (Soundness) that M ∼ = N : A and thus LP M ≈L LQM : A. A.10 Proofs for § 4.2 – Communicating Values Lemma A.13 (Type Soundness of Encoding). 1. If Ψ ⊢ M : τ then JΨ K; · ⊢ JM Kz :: z:Jτ K 2. If Ψ ; Γ ; ∆ ⊢ P :: z:A then JΨ K, JΓ K; J∆K ⊢ JP K :: z:JAK Proof. Straightforward induction. Lemma 4.5 (Compositionality). Let Ψ, x:τ ⊢ M : σ and Ψ ⊢ N : τ . We have that JM {N/x}Kz ≈L (νx)(JM Kz |!x(y).JN Ky ) Proof. By induction on the typing for M . We make use of the fact that ≈L includes ≡! . Case: M = y with y = x JM {N/x}Kz = JN Kz by definition (νx)(JM Kz |!x(y).JN Ky ) = (νx)(xhyi.[y ↔ z] |!x(y).JN Ky ) →+ (νx)(JN Kz |!x(y).JN Ky ) − by the reduction semantics ≈L JN Kz by ≡! , since x 6∈ fn(JN Kz ) Case: M = y with y 6= x JM {N/x}Kz = JyKz = yhwi.[w ↔ z] (νx)(JM K |!x(y).JN Ky ) = (νx)(yhwi.[w ↔ z] |!x(y).JN Ky ) ≈L yhwi.[w ↔ z] by definition by ≡! Case: M = M1 M2 JM1 M2 {N/x}Kz = JM1 {N/x} M2 {N/x}Kz = (νy)(JM1 {N/x}Ky | yhui.(!u(w).JM2 {N/x}Kw | [y ↔ z]) by definition (νx)(JM1 M2 Kz |!x(y).JN Ky ) = (νx)((νy)(JM1 Ky | yhui.(!u(w).JM2 Kw | [y ↔ z]) |!x(y).JN Ky )) by definition JM1 {N/x}Ky ≈L (νx)(JM1 Ky |!x(a).JN Ka ) by i.h. JM2 {N/x}Kw ≈L (νx)(JM2 Kw |!x(a).JN Ka ) by i.h. JM1 M2 {N/x}Kz ≈L (νy)((νx)(JM1 Ky |!x(a).JN Ka ) | yhui.(!u(w).JM2 {N/x}Kw | [y ↔ z])) by congruence ≈L (νy)((νx)(JM1 Ky |!x(a).JN Ka ) | yhui.(!u(w).(νx)(JM2 Kw |!x(a).JN Ka ) | [y ↔ z])) by congruence by ≡! ≈L (νx)(νy)(JM1 Ky | yhui.(!u(w).JM Kw | [y ↔ z] |!x(a).JN Ka )) 42 Case: M = λy:τ0 .M ′ Jλy:τ0 .M ′ {N/x}Kz = z(y).JM ′ {N/x}Kz (νx)(JM Kz |!x(y).JN Ky ) = (νx)(z(y).JM ′ Kz |!x(y).JN Ky ) by definition JM ′ {N/x}Kz ≈L (νx)(JM Kz |!x(w).JN Kw ) by i.h. Jλy:τ0 .M ′ {N/x}Kz ≈L z(y).(νx)(JM ′ Kz |!x(w).JN Kw ) by congruence ≈L (νx)(z(y).JM ′ Kz |!x(w).JN Kw ) by commuting conversion Theorem A.14 (Operational Completeness). 1. If Ψ ⊢ M : τ and M − → N then JM Kz =⇒ P such that P ≈L JN Kz 2. If Ψ ; Γ ; ∆ ⊢ P :: z:A and P − → Q then JP K − →+ R with R ≈L JQK Proof. We proceed by induction on the given derivation and case analysis on the reduction. Case: M = (λx:τ.M ′ ) N ′ with M − → M ′ {N ′ /x} JM Kz = (νy)(Jλx:τ.M ′ Ky | yhxi.(!x(w).JN ′ Kw | [y ↔ z]) = by definition of J−K (νy)(y(x).JM ′ Ky | yhxi.(!x(w).JN ′ Kw | [y ↔ z]) →+ (νx)(JM ′ Kz | !x(w).JN ′ Kw ) − by the reduction semantics ≈L JM ′ {N ′ /x}Kz by Lemma 4.5 Case: M = M1 M2 with M − → M1′ M2 by M1 − → M1′ by definition JM1 M2 Kz = (νy)(JM1 Ky | yhxi.(!x(w).JM2 Kw | [y ↔ z]) JM1′ M2 Kz = (νy)(JM1′ Ky | yhxi.(!x(w).JM2 Kw | [y ↔ z]) by definition JM1 Ky =⇒ P1′ such that P1′ ≈L JM1′ Ky by i.h. JM1 M2 Kz =⇒ (νy)(P1′ | yhxi.(!x(w).JM2 Kw | [y ↔ z]) by reduction semantics ≈L (νy)(JM1′ Ky | yhxi.(!x(w).JM2 Kw | [y ↔ z]) by congruence Case: P = (νx)(xhM i.P ′ | x(y).Q′ ) with P − → (νx)(P ′ | Q′ {M/y}) by definition JP K = (νx)(xhyi.(!y(w).JM Kw | JP ′ K) | x(y).JQ′ K) JP K − → (νx, y)(!y(w).JM Kw | JP ′ K | JQ′ K) by the reduction semantics J(νx)(P ′ | Q′ {M/y})K = (νx)(JP ′ K | JQ′ {M/y}K) by definition ≈L (νx, y)(JP ′ K | JQ′ K |!y(w).JM Kw ) by Lemma 4.5 and congruence All remaining cases follow straightforwardly by induction. Theorem A.15 (Operational Soundness). 1. If Ψ ⊢ M : τ and JM Kz − → Q then M − →+ N such that JN Kz ≈L Q 2. If Ψ ; Γ ; ∆ ⊢ P :: z:A and JP K − → Q then P − →+ P ′ such that JP ′ K ≈L Q Proof. By induction on the given derivation and case analysis on the reduction step. Case: M = M1 M2 with JM1 Ky − →R 43 by definition JM1 M2 Kz = (νy)(JM1 Ky | yhxi.(!x(w).JM2 Kw | [y ↔ z])) − (νy)(R | yhxi.(!x(w).JM2 Kw | [y ↔ z])) → by reduction semantics M1 − →+ M1′ with JM1′ Ky ≈L R by i.h. M1 M2 − →+ M1′ M2 by the operational semantics JM1′ M2 Kz = (νy)(JM1′ Ky | yhxi.(!x(w).JM2 Kw | [y ↔ z])) by definition by congruence ≈L (νy)(R | yhxi.(!x(w).JM2 Kw | [y ↔ z])) → (νy, x)(R | Case: M = M1 M2 with (νy)(JM1 Ky | yhxi.(!x(w).JM2 Kw | [y ↔ z])) − !x(w).JM2 Kw | [y ↔ z]) JM1 Ky ≡ (νa)(y(x).R1 | R2 ) by the reduction semantics, for some R1 , R2 and a Ψ ⊢ M1 : τ0 → τ1 by inversion Subcase: M1 = y, for some y ∈ Ψ Impossible reduction. Subcase: M1 = λx:τ0 .M1′ (λx:τ0 .M1′ ) M2 − → M1′ {M2 /x} by operational semantics ′ JM1 {M2 /x}Kz ≈L (νx)(JM1′ Kz |!x(w).JM2 Kw ) by Lemma 4.5 J(λx:τ0 .M1′ ) M2 Kz = (νy)(y(x).JM1′ Ky | yhxi.(!x(w).JM2 Kw | [y ↔ z])) by definition R = JM1′ Ky by inversion (νy, x)(R |!x(w).JM2 Kw | [y ↔ z]) ≈L (νx)(JM1′ Kz |!x(w).JM2 Kw ) by reduction closure Subcase: M1 = N1 N2 , for some N1 and N2 by definition JN1 N2 Ky = (νa)(JN1 Ka | ahbi.(!b(d).JN2 Kd | [a ↔ y])) Impossible reduction. Case: P = (νx)(xhM i.P1 | x(y).P2 ) JP K = (νx)(xhyi.(!y(w).JM Kw | JP1 K) | x(y).JP2 K) by definition JP K − → (νx, y)(!y(w).JM Kw | JP1 K | JP2 K) by reduction semantics P − → (νx)(P1 | P2 {M/y}) by reduction semantics J(νx)(P1 | P2 {M/y})K ≈L (νx, y)(JP1 K | JP2 K |!y(w).JM Kw ) by Lemma 4.5 and congruence Case: P = (νx)(xhM i.P1 | P2 ) JP K = (νx)(xhyi.(!y(w).JM Kw | JP1 K) | JP2 K) by definition JP K − → (νx)(xhyi.(!y(w).JM Kw | JP1 K) | R) assumption, with JP2 K − →R P2 − →+ P2′ with JP2′ K ≈L R by i.h. P − →+ (νx)(xhM i.P1 | P2′ ) by reduction semantics J(νx)(xhM i.P1 | P2′ )K = (νx)(xhyi.(!y(w).JM Kw | JP1 K) | JP2′ K) by definition ≈L (νx)(xhyi.(!y(w).JM Kw | JP1 K) | R) by congruence All other process reductions follow straightforwardly from the inductive hypothesis. Lemma A.16 (Type Soundness of Encoding). 1. If Ψ ; Γ ; ∆ ⊢ P :: z:A then LΨ M, LΓ M; L∆M ⊢ LP M : LAM 2. If Ψ ⊢ M : τ then LΨ M; · ⊢ LM M : Lτ M 44 Proof. Straightforward induction. Lemma A.17 (Compositionality). 1. If Ψ, x:τ ; Γ ; ∆ ⊢ P :: z:B and and Ψ ⊢ M : τ then LP {M/x}M =α LP M{LM M/x} 2. If Ψ, x:τ ⊢ M : σ and Ψ ⊢ N : τ then LM {N/x}M =α LM M{LN M/x} Proof. Straightforward induction. Theorem A.18 (Operational Soundness). 1. If Ψ ; Γ ; ∆ ⊢ P :: z:A and LP M − → M then P 7→∗ Q such that M =α LQM ′ ′ 2. If Ψ ⊢ M : τ and LM M − → N then M →+ β M such that N =α LM M Proof. We proceed by induction on the given reduction and case analysis on typing. Case: LP0 M{(x !LM0 M)/x} − →M LP0 M{(x !LM0 M)/x} − → M ′ {(x !LM0 M)/x} ′ ′ P0 7→ P0 with P0 =β M ′ xhM0 i.P0 7→ xhM0 i.P0′ LxhM0 i.P0′ M = LP0′ M{(x !LM0 M)/x} =α M ′ {(x !LM0 M)/x} by operational semantics by i.h. by extended reduction by definition by congruence The other cases are covered by our previous result for the reverse encoding of processes. Case: LM0 M !LM1 M − → M0′ !LM1 M LM0 M − → M0′ ′′ ′ ′′ M0 − →+ β M0 such that M0 =α LM0 M + M0 M1 − →β M0′′ M1 ′′ LM0 M1 M = LM0′′ M !LM1 M =α M0′ !LM1 M by inversion by i.h. by operational semantics by definition and by congruence Case: (λx:!Lτ0 M.let !x = x in LM0 M) !LM1 M − → let !x =!LM1 M in LM0 M (λx:τ0 .M0 ) M1 − → M0 {M1 /x} by inversion and operational semantics let !x =!LM1 M in LM0 M − → LM0 M{LM1 M/x} by operational semantics =α LM0 {M1 /x}M by Lemma A.17 Theorem A.19 (Operational Completeness). 1. If Ψ ; Γ ; ∆ ⊢ P :: z:A and P − → Q then LP M − →∗β LQM + 2. If Ψ ⊢ M : τ and M − → N then LM M − → LN M. Proof. We proceed by induction on the given reduction. Case: (νx)(xhM i.P1 | x(y).P2 ) − → (νx)(P1 | P2 {M/x}) with P typed via cut of ∧R and ∧L 45 LP M = let y ⊗ x = h!LM M ⊗ LP1 Mi in let !y = y in LP2 M by definition − let !y =!LM M in LP2 M{LP1 M/x} → by operational semantics → LP2 M{LP1 M/x}{LM M/x} − by operational semantics L(νx)(P1 | P2 {M/x})M = LP2 {M/x}M{LP1 M/x} by definition =α LP2 M{LP1 M/x}{LM M/x} by Lemma A.17 Case: (νx)(x(y).P1 | xhM i.P2 ) − → (νx)(P1 {M/x} | P2 ) with P typed via cut of ⊃R and ⊃L LP M = LP2 M{(λx:!Lτ0 M.let !x = x in LP1 M) !LM M/x} −+ → β LP2 M{(LP1 M{LM M/x})/x} L(νx)(P1 {M/x} | P2 )M = LP2 M{LP1 {M/x}M/x} =α LP2 M{(LP1 M{LM M/x})/x} by definition by β conversion by definition by Lemma A.17 The remaining process cases follow by induction. Case: (λx:τ0 .M0 ) M1 − → M0 {M1 /x} LM M = (λx:!Lτ0 M.let !x = x in LM0 M) !LM1 M by definition − + LM0 M{LM1 M/x} =α LM0 {M1 /x}M by operational semantics and Lemma A.17 → Case: M0 M1 − → M0′ M1 by M0 − → M0′ LM0 M1 M = LM0 M !LM1 M LM0′ M1 M = LM0′ M !LM1 M LM0 − →+ LM0′ M LM0 M !LM1 M − →+ LM0′ M !LM1 M by definition by definition by i.h. by operational semantics Theorem 4.7 (Inverse). If Ψ ; Γ ; ∆ ⊢ P :: z:A then JLP MKz ≈L JP K. Also, if Ψ ⊢ M : τ then LJM Kz M =β LM M. We establish the proofs of the two statements separately: Theorem A.20 (Inverse Encodings – Processes). If Ψ ; Γ ; ∆ ⊢ P :: z:A then JLP MKz ≈L JP K Proof. By induction on typing. Case: ∧R P = zhM i.P0 LP M = h!LM M ⊗ LP0 Mi Jh!LM M ⊗ LP0 MiKz = zhxi.(!x(u).JLM MKu | JLP0 MKz ) JzhM i.P0 K = zhxi.(!x(u).JM Ku | JP0 K) ≈L zhxi.(!x(u).JLM MKu | JLP0 MKz ) Case: ∧L by assumption by definition by definition by definition by i.h. and congruence 46 P = x(y).P0 LP M = let y ⊗ x = x in let !y = y in LP0 M Jlet y ⊗ x = x in let !y = y in LP0 MKz = x(y).JLP0 MKz Jx(y).P0 K = x(y).JP0 K ≈L x(y).JLP0 MKz by assumption by definition by definition by definition by i.h. and congruence Case: ⊃R P = x(y).P0 LP M = λx:!Lτ M.let !x = x in LP0 M Jλx:!Lτ M.let !x = x in LP0 MKz = x(y).JLP0 MKz Jx(y).P0 K = x(y).JP0 K ≈L x(y).JLP0 MKz by assumption by definition by definition by definition by i.h. and congruence Case: ⊃L P = xhM i.P0 by assumption LP M = LP0 M{(x !LM M)/x} by definition JLP0 M{(x !LM M)/x}Kz = (νa)(Jx !LM MKa | JLP0 MKz {a/x}) by Lemma A.9 = (νa)((νb)(JxKb | bhci.(J!LM MKc | [b ↔ a]) | JLP0 MKz {a/x}) by definition = (νa)((νb)([x ↔ b] | bhci.(!c(w).JLM MKw | [b ↔ a]) | JLP0 MKz {a/x})) by definition → (νa)(xhci.(!c(w).JLM MKw | [x ↔ a]) | JLP0 MKz {a/x}) by reduction semantics − ≈L xhci.(!c(w).JLM MKw | JLP0 MKz ) by commuting conversion and reduction ≈L JP K = xhyi.(!y(u).JM Ku | JP0 K) by i.h. and congruence Theorem A.21 (Inverse Encodings – λ-terms). If Ψ ⊢ M : τ then LJM Kz M =β LM M Proof. By induction on typing. Case: Variable JM Kz = xhyi.[y ↔ z] Lxhyi.[y ↔ z]M = x by definition by definition Case: λ-abstraction Jλx:τ0 .M0 Kz = z(x).JM0 Kz Lz(x).JM0 Kz M = λx:!Lτ0 M.let !x = x in LJM0 Kz M =β Lλx:τ0 .M0 M = λx:!Lτ0 M.let !x = x in LM0 M by definition by definition by i.h. and congruence Case: Application by definition JM0 M1 Kz = (νy)(JM0 Ky | yhxi.(!x(w).JM1 Kw | [y ↔ z]) L(νy)(JM0 Ky | yhxi.(!x(w).JM1 Kw | [y ↔ z])M = Lyhxi.(!x(w).JM1 Kw | [y ↔ z])M{LJM0 Ky M/y} by definition = LJM0 Ky M !LKM1 Kw M by definition =β LM0 M1 M = LM0 M !LM1 M by i.h. and congruence 47 Lemma A.22. Let · ⊢ M : τ and · ⊢ V : τ with V 6 − →βη . JM Kz ≈L JV Kz iff LM M − →∗βη LV M Proof. (⇐) LM M − →∗βη LV M by assumption If LM M = LV M then JV Kz ≈L JV Kz by reflexivity If LM M − →+ LV M then JM K =⇒ P ≈ JV K by Lemma A.14 z L z βη JM Kz ≈L JV Kz by closure under reduction (⇒) V =α λx:τ0 .V0 by inversion LV M = λx:!Lτ0 M.let !x = x in LV0 M by definition JV Kz = z(x).JV0 Kz by definition M : τ0 → τ1 by inversion LM M − →∗βη V ′ 6− → by strong normalisation We proceed by induction on the length n of the (strong) reduction: Subcase: n = 0 LM M = λx:τ0 .M0 by inversion M0 = V0 by uniqueness of normal forms Subcase: n = n′ + 1 LM M − →βη M ′ by assumption JM Kz =⇒ P ≈L JM ′ Kz by Lemma A.14 JM ′ Kz ≈L JV Kz by closure under reduction by i.h. LM ′ M − →∗βη LV M by transitive closure LM M − →∗βη LV M Theorem 4.8. Let · ⊢ M : τ and · ⊢ N : τ . LM M =βη LN M iff JM Kz ≈L JN Kz . Also, let · ⊢ P :: z:A and · ⊢ Q :: z:A. We have that JP K ≈L JQK iff LP M =βη LQM. We establish the proof of the two statements separately. Theorem A.23. Let · ⊢ M : τ and · ⊢ N : τ . We have that LM M =βη LN M iff JM Kz ≈L JN Kz Proof. Completeness (⇒) LM M =βη LN M iff ∃S.LM M − →∗βη S and LN M − →∗βη S ∗ Assume − → is of length 0, then: LM M =α LN M, JM Kz ≡ JN Kz and thus JM K ≈L JN Kz Assume − →+ is of some length > 0: LM M − →+ →+ by assumption βη S and LN M − βη S, for some S + JM Kz − → P ≈L JSKz and JN Kz − →+ Q ≈L JSKz by Lemma A.14 JM Kz ≈L JSKz and JN Kz ≈L JSKz by closure under reduction JM Kz ≈L JN Kz by transitivity Soundness (⇐) JM Kz ≈L JN Kz by assumption Suffices to show: ∃S.LM M − →∗βη S and LN M − →∗βη S 48 LN M − →∗βη S ′ 6− → by strong normalisation We proceed by induction on the length n of the reduction: Subcase: n = 0 JM Kz ≈L JS ′ Kz by assumption LM M − →∗βη LN M by Lemma A.22 Subcase: n = n′ + 1 LN M − →βη S ′ by assumption JN Kz − → P ≈L JS ′ Kz by Theorem A.14 JM Kz ≈L JS ′ Kz by closure under reduction LM M =βη LS ′ M by i.h. LM M =βη LN M by transitivity Theorem A.24. Let · ⊢ P :: z:A and · ⊢ Q :: z:A. We have that JP K ≈L JQK iff LP M =βη LQM Proof. (⇐) Let M = LP M and N = LQM: JM Kz ≈L JN Kz by Theorem 4.8 (Completeness) JM Kz = JLP MKz ≈L JP K and JN Kz = JLQMKz ≈L JQK by Theorem 4.7 JP K ≈L JQK by compatibility of logical equivalence (⇒) JLP MKz ≈L JLQMKz by Theorem 4.7 and compatibility of logical equivalence LP M =βη LQM by Theorem 4.8 (Soundness) A.11 Proofs for § 4.3 – Higher-Order Session Processes Theorem A.25 (Operational Soundness). 1. If Ψ ⊢ M : τ and JM Kz − → Q then M − →+ N such that JN Kz ≈L Q 2. If Ψ ; Γ ; ∆ ⊢ P :: z:A and JP K − → Q then P − →+ P ′ such that JP ′ K ≈L Q Proof. By induction on the given reduction. → (νx)(P0′ | Case: (νx)(P0 | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | P1 ) . . . )) − xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | P1 ) . . . )) P = x ← M0 ← yi ; P2 with JM0 Kx = P0 and JP1 K = P2 by inversion M0 − →+ M0′ with JM0′ Kx ≈L P0′ by i.h. (x ← M0 ← yi ; P2 ) − →+ (x ← M0′ ← yi ; P2 ) by reduction semantics Jx ← M0′ ← y; P2 K = (νx)(JM0 Kx | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | P1 ) . . . )) by definition ≈L (νx)(P0′ | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | P1 ) by congruence Case: (νx)(x(a0 ). . . . .x(an ).P0 | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | P1 ) − → (νx, a0 )(x(a1 ). . . . .x(an ).P0 | [a0 ↔ y0 ] | xha1 i.([a1 ↔ y1 ] | · · · | xhan i.([an ↔ yn ] | P1 ) = Q 49 P = x ← {x ← P2 ← ai } ← yi ; P3 with JP3 K = P1 and JP2 K = P0 by inversion x ← {x ← P2 ← ai } ← yi ; P3 − → (νx)(P2 {yi /ai } | P3 ) by reduction semantics Q− →+ (νx)(P0 {yi /ai } | P1 ) = (νx)(JP2 K{yi /ai } | JP3 K) by reduction semantics and definition Theorem A.26 (Operational Completeness). 1. If Ψ ⊢ M : τ and M − → N then JM Kz =⇒ P such that P ≈L JN Kz 2. If Ψ ; Γ ; ∆ ⊢ P :: z:A and P − → Q then JP K − →+ R with R ≈L JQK Proof. By induction on the reduction semantics. Case: x ← M ← yi ; Q − → x ← M ′ ← yi ; Q from M − → M′ Jx ← M ← yi ; QK = (νx)(JM Kx | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JQK) . . . )) by definition JM Kx =⇒ R0 with R0 ≈L JM ′ Kx by i.h. Jx ← M ← yi ; QK =⇒ (νx)(R0 | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JQK) . . . )) by reduction semantics ≈L Jx ← M ← yi ; QK = (νx)(JM Kx | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JQK) . . . )) by congruence → (νx)(P0 {yi /wi } | Q) Case: x ← {x ← P0 ← wi } ← yi ; Q − Jx ← {x ← P0 ← wi } ← yi ; QK = (νx)(x(w0 ). . . . .x(wn ).JP0 K | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JQK) . . . )) by definition →+ (νx)(JP0 K{yi /wi } | JQK) − by reduction semantics ≈L (νx)(JP0 {yi /wi }K | JQK) Theorem A.27 (Operational Soundness). 1. If Ψ ; Γ ; ∆ ⊢ P :: z:A and LP M − → M then P 7→∗ Q such that M =α LQM ′ ′ 2. If Ψ ⊢ M : τ and LM M − → N then M − →+ β M such that N =α LM M Proof. By induction on the given reduction. → N {(LM M yi )/x} Case: LP0 M{(LM M yi )/x} − P = x ← M ← yi ; P0 P0 7→∗ R with N =α LRM P 7→∗ x ← M ← yi ; R Lx ← M ← yi ; RM = LRM{(LM M yi )/x} =α N {(LM M yi )/x} → LP0 M{M ′ /x} Case: LP0 M{(LM M yi )/x} − by inversion by i.h. by definition of 7→ by definition by congruence 50 P = x ← M ← yi ; P0 Subcase: LM M yi − → N yi ′′ M− →+ M with N =α LM ′′ M β + ′′ P 7→ x ← M ← yi ; P0 Lx ← M ′′ ← yi ; P0 M = LP0 M{(LM ′′ M yi )/x} =α LP0 M{M ′ /x} → (λy1 . . . . .yn .M0 ) y1 . . . yn Subcase: LM M yi − M = {x ← Q ← yi } with LQM = M0 P = x ← {x ← Q ← yi } ← yi ; P0 P − → (νx)(Q | P0 ) L(νx)(Q | P0 )M = LP0 M{LQM/x} (λy1 . . . . .yn .M0 ) y1 . . . yn − →+ M0 by inversion by i.h. by reduction semantics by definition by congruence by inversion by inversion by reduction semantics by definition by operational semantics Theorem A.28 (Operational Completeness). 1. If Ψ ; Γ ; ∆ ⊢ P :: z:A and P − → Q then LP M − →∗β LQM + 2. If Ψ ⊢ M : τ and M − → N then LM M − → LN M Proof. By induction on the given reduction → (x ← M ′ ← yi ; P0 ) with M − → M′ Case: (x ← M ← yi ; P0 ) − Lx ← M ← yi ; P0 M = LP0 M{LM M yi /x} LM M − →∗ LM ′ M Lx ← M ′ ← yi ; P0 M = LP0 M{LM ′ M yi /x} LP0 M{LM M yi /x} − →∗β LP0 M{LM ′ M yi /x} by definition by i.h. by definition by congruence Case: (x ← {x ← Q ← yi } ← yi ; P0 ) − → (νx)(Q | P0 ) Lx ← {x ← Q ← yi } ← yi ; P0 M = LP0 M{((λy0 . . . . .λyn .LQM) y0 . . . yn )/x} by definition →+ − by congruence and transitivity β LP0 M{LQM/x} L(νx)(Q | P0 )M = LP0 M{LQM/x} by definition Theorem 4.10 (Inverse Encodings). If Ψ ; Γ ; ∆ ⊢ P :: z:A then JLP MKz ≈L JP K. Also, if Ψ ⊢ M : τ then LJM Kz M =β LM M. We prove each case as a separate theorem. Theorem A.29 (Inverse Encodings – Processes). If Ψ ; Γ ; ∆ ⊢ P :: z:A then JLP MKz ≈L JP K Proof. By induction on the given typing derivation. We show the new cases. Case: Rule {}E 51 by inversion P = x ← M ← y; Q LP M = LQM{(LM M y)/x} by definition JLQM{(LM M y)/x}Kz = (νa)(JLM M yKa | JLQMKz {a/x}) by Lemma A.9 = (νa, x)(JLM MKx | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JLQMK{a/x}) . . . )) by definition ≡ (νx)(JLM MKx | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JLQMK) . . . )) JP K = (νx)(JM Kx | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JQK) . . . )) by definition ≈L (νx)(JLM MKx | xha0 i.([a0 ↔ y0 ] | · · · | xhan i.([an ↔ yn ] | JLQMK) . . . )) by i.h. Theorem A.30 (Inverse Encodings – λ-terms). If Ψ ⊢ M : τ then LJM Kz M =β LM M Proof. By induction on the given typing derivation. We show the new cases. Case: Rule {}I M = {x ← P ← yi } JM Kz = z(y0 ). . . . .z(yn ).JP {z/x}K Lz(y0 ). . . . .z(yn ).JP {z/x}KM = λy0 . . . . .λyn .LJP {z/x}KM JM K = λy0 . . . . .λyn .LP M =β λy0 . . . . .λyn .LJP {z/x}KM A.12 by inversion by definition by definition by definition by i.h. Strong Normalisation for Higher-Order Sessions We modify the encoding from processes to λ-terms by considering the encoding of derivations ending with the copy rule as follows (we write L−M+ for this revised encoding): L(νx)uhxi.P M+ , let 1 = hi in LP M+ {u/x} All other cases are as before. It is immediate that the revised encoding preserves typing. We now revisit operational completeness as: Lemma A.31 (Operational Completeness). If Ψ ; Γ ; ∆ ⊢ P :: z:A and P − → + Q then LP M+ − →+ β LQM Proof. → (νu)(!u(x).P0 | (νx)(P0 | P1 )) Case: (νu)(!u(x).P0 | uhxi.P1 ) − L(νu)(!u(x).P0 | uhxi.P1 )M+ = let 1 = hi in LP1 M+ {u/x}{LP0 M+ /u} = let 1 = hi in LP1 M+ {LP0 M+ /x}{LP0 M+ /u} by definition → LP1 M+ {LP0 M+ /x}{LP0 M+ /u} − by operational semantics L(νu)(!u(x).P0 | (νx)(P0 | P1 ))M+ = LP1 M+ {LP0 M+ /x}{LP0 M+ /u} by definition Other cases are unchanged. We remark that with this revised encoding, operational soundness becomes: Lemma A.32. If Ψ ; Γ ; ∆ ⊢ P :: z:A and LP M+ − → M then P 7→∗ Q such that ∗ LQM − → M. 52 Proof. Case: LP M+ = let 1 = hi in LP0 M+ {u/x} with LP M+ − → LP0 M+ {u/x} LP M+ = let 1 = hi in LP0 M+ {u/x} − → LP0 M+ {u/x} by operational semantics, as needed. Remaining cases are fundamentally unchanged. The revised encoding remains mutually inverse with the J−Kz encoding. We show only the relevant new cases. Lemma A.33. If Ψ ; Γ ; ∆ ⊢ P :: z:A then JLP M+ Kz ≈L JP K Proof. Case: copy rule LP M+ = let 1 = hi in LP0 M+ {u/x} by definition Jlet 1 = hi in LP0 M+ {u/x}Kz = (νy)(0 | JLP0 M+ {u/x}Kz ) by definition ≡ JLP0 M+ {u/x}Kz by structural congruence ≈L (νx)(uhwi.[w ↔ x] | JLP0 M+ Kz ) by compositionality ≈L JP K by i.h. + congruence + definition of ≈L for open processes Lemma A.34. If Ψ ⊢ M : τ then LJM Kz M+ =β LM M+ Proof. Case: uvar rule JuKz = (νx)uhxi.[x ↔ z] L(νx)uhxi.[x ↔ z]M+ = let 1 = hi in u =β u by definition Theorem 4.9 (Strong Normalisation). Let Ψ ; Γ ; ∆ ⊢ P :: z:A. There is no infinite reduction sequence starting from P . Proof. The result follows from the operational completeness result above (Lemma A.31), which requires every process reduction to be matched with one or more reductions in the λ-calculus. We can thus prove our result via strong normalisation of − →β : Assume an infinite reduction sequence P − → P′ − → P ′′ − → ..., by completeness this implies that there must exist an infinite sequence LP M − →+ β + + ′ ′′ LP M − →β LP M − →β . . . , deriving a contradiction. 53 (1I) L (1R) L (1L) Ω; Γ ; ∆ ⊢ P :: z:C L (id) L (!R) Ω; Γ ; · ⊢ P :: x:A L L Ω; Γ ; · ⊢ 0 :: z:1 M , Ω; Γ ; · ⊢ hi : 1 Ω; Γ ; ∆, x:1 ⊢ P :: z:C M , Ω; Γ ; x:A ⊢ [x ↔ z] :: z:A Ω; Γ ; · ⊢ !z(x).P :: z:!A (⊸R) M M , (1E) Ω; Γ ; x:1 ⊢ x : 1 Ω; Γ ; ∆, x:1 ⊢ let 1 = x in LP MΩ;Γ ;∆⊢z:C : C , (var) Ω; Γ ; x:A ⊢ x:A (!I) Ω; Γ ; · ⊢ LP MΩ;Γ ;·⊢x:A : A Ω; Γ ; · ⊢ !LP MΩ;Γ ;·⊢z:!A :!A M Ω; Γ ; ∆, x:A ⊢ P :: z:B Ω; Γ ; ∆ ⊢ z(x).P :: z:A ⊸ B , (⊸L) Ω; Γ ; ∆1 ⊢ P :: y:A Ω; Γ ; ∆ ⊢ LP MΩ;Γ ;∆⊢z:C : C (⊸ I) Ω; Γ ; ∆, x:A ⊢ LP MΩ,Γ ;∆,x:A⊢z:B : B Ω; Γ ; ∆ ⊢ λx:A.LP MΩ,Γ ;∆,x:A⊢z:B : A ⊸ B Ω; Γ ; ∆2 , x:B ⊢ Q :: z:C Ω; Γ ; ∆1 , ∆2 , x:A ⊸ B ⊢ (νy)xhyi.(P | Q) :: z:C M , (subst) Ω; Γ ; ∆2 , x:B ⊢ LQMΩ;Γ ;∆2 ,x:B⊢z:C : C (⊸ E) Ω; Γ ; x:A ⊸ B ⊢ x:A ⊸ B Ω; Γ ; ∆1 ⊢ LP MΩ;Γ ;∆1 ⊢y:A : B Ω; Γ ; ∆1 , x:A ⊸ B ⊢ x LP MΩ;Γ ;∆1 ⊢y:A : B Ω; Γ ; ∆1 , ∆2 , x:A ⊸ B ⊢ LQMΩ;Γ ;∆2 ,x:B⊢z:C {(x LP MΩ;Γ ;∆1 ⊢y:A )/x} : C L L (⊗R) Ω; Γ ; ∆1 ⊢ P :: x:A Ω; Γ ; ∆2 ⊢ Q :: z:B Ω; Γ ; ∆1 , ∆2 ⊢ (νx)zhxi.(P | Q) :: z:A ⊗ B (⊗L) Ω; Γ ; ∆, y:A.x:B ⊢ P :: z:C Ω; Γ ; ∆, x:A ⊗ B ⊢ x(y).P :: z:C M , M , (⊗I) Ω; Γ ; ∆1 ⊢ LP MΩ;Γ ;∆1 ⊢x:A : A Ω; Γ ; ∆1 ⊢ LQMΩ;Γ ;∆2 ⊢z:B : B Ω; Γ ; ∆1 , ∆2 ⊢ hLP MΩ;Γ ;∆1 ⊢x:A ⊗LQMΩ;Γ ;∆2 ⊢z:B i : A ⊗ B (⊗E) Ω; Γ ; x:A ⊗ B ⊢ x : A ⊗ B Ω; Γ ; ∆, y:A, x:B ⊢ LP MΩ;Γ ;∆,y:A.x:B⊢z:C : C Ω; Γ ; ∆1 , x:A ⊗ B ⊢ let x ⊗ y = x in LP MΩ;Γ ;∆,y:A.x:B⊢z:C : C Fig. 5. Translation on Typing Derivations from Polyπ to Linear-F (Part 1) 54 L (!L) L (copy) L (∀R) L (∀L) Ω; Γ ; x:!A ⊢ x :!A (!E) Ω; Γ, u:A; ∆ ⊢ (νx)uhxi.P :: z:C , Ω; Γ, u:A; ∆, x:A ⊢ LP MΩ;Γ,u:A;∆,x:A⊢z:C : C M Ω; Γ ; ∆ ⊢ z(X).P :: z:∀X.A , (∀I) Ω, X; Γ ; ∆ ⊢ LP MΩ,X;Γ ;∆⊢z:A : A Ω; Γ ; ∆ ⊢ ΛX.LP MΩ,X;Γ ;∆⊢z:A : ∀X.A Ω; Γ ; ∆, x:A{B/X} ⊢ P :: z:C Ω; Γ ; ∆, x:∀X.A ⊢ xhBi.P :: z:C (subst) (∃R) L (∃L) Ω; Γ, u:A; · ⊢ u:A Ω; Γ, u:A; ∆ ⊢ LP MΩ;Γ,u:A;∆,x:A⊢z:C {u/x} : C Ω, X; Γ ; ∆ ⊢ P :: z:A Ω ⊢ B type L Ω; Γ, u:A; ∆ ⊢ LP MΩ;Γ,u:A;∆⊢z:C : C Ω; Γ ; ∆, x:!A ⊢ let !u = x in LP MΩ;Γ,u:A;∆⊢z:C : C M Ω; Γ, u:A; ∆, x:A ⊢ P :: z:C (subst) M , Ω; Γ ; ∆, x:A{B/X} ⊢ LP MΩ;Γ ;∆,x:A{B/X}⊢z:C : C (∀E) Ω; Γ, x:∀X.A ⊢ x:∀X.A Ω ⊢ B type Ω; Γ ; x:∀X.A ⊢ x[B] : A{B/X} Ω; Γ ; ∆, x:∀X.A ⊢ LP MΩ;Γ ;∆,x:A{B/X}⊢z:C {(x[B]/x)} : C Ω ⊢ B type Ω; Γ ; ∆ ⊢ P :: z:A{B/X} Ω; Γ ; ∆ ⊢ zhBi.P :: z:∃X.A Ω, Y ; Γ ; ∆, x:A ⊢ P :: z:C M , (∃I) Ω ⊢ B type Ω; Γ ; ∆ ⊢ LP MΩ;Γ ;∆⊢z:A{B/X} : A{B/X} Ω; Γ ; ∆ ⊢ pack B with LP MΩ;Γ ;∆⊢z:A{B/X} : ∃X.A M Ω; Γ ; ∆, x:∃X.A ⊢ x(Y ).P :: z:C , (∃E) L M Ω; Γ, u:A; ∆ ⊢ P :: z:C Ω; Γ ; ∆, x:!A ⊢ P {u/x} :: z:C , Ω; Γ ; x:∃Y.A ⊢ x:∃Y.A Ω, Y ; Γ ; ∆, x:A ⊢ LP MΩ,Y ;Γ ;∆,x:A⊢z:C : C Ω; Γ ; ∆, x:∃Y.A ⊢ let (Y, x) = x in LP MΩ,Y ;Γ ;∆,x:A⊢z:C : C (cut) Ω; Γ ; ∆1 ⊢ P :: x:A Ω; Γ ; ∆2 , x:A ⊢ Q :: z:C M , Ω; Γ ; ∆1 , ∆2 ⊢ (νx)(P | Q) :: z:C (subst) Ω; Γ ; ∆2 , x:A ⊢ LQMΩ;Γ ;∆2 ,x:A⊢z:C : C Ω; Γ ; ∆1 ⊢ LP MΩ;Γ ;∆1 ⊢x:A : A Ω; Γ ; ∆1 , ∆2 ⊢ LQMΩ;Γ ;∆2 ,x:A⊢z:C {LP MΩ;Γ ;∆1 ⊢x:A /x} : C L (cut! ) Ω; Γ ; · ⊢ P :: x:A Ω; Γ, u:A; ∆ ⊢ Q :: z:C Ω; Γ ; ∆ ⊢ (νu)(!u(x).P | Q) :: z:C M , (subst! ) Ω; Γ, u:A; ∆ ⊢ LQMΩ;Γ,u:A;∆⊢z:C : C Ω; Γ ; · ⊢ LP MΩ;Γ ;∆1 ⊢x:A : A Ω; Γ ; ∆ ⊢ LQMΩ;Γ,u:A;∆⊢z:C {LP MΩ;Γ ;·⊢x:A /u} Fig. 6. Translation on Typing Derivations from Polyπ to Linear-F (Part 2)
6cs.PL
IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X 1 An Interactive Many Objective Evolutionary Algorithm with Cascade Clustering and Reference Point Incremental Learning arXiv:1803.01097v1 [cs.AI] 3 Mar 2018 Hongwei Ge, Mingde Zhao, Student Member, IEEE, Liang Sun, Zhen Wang, Guozhen Tan, Qiang Zhang, C.L. Philip Chen, Fellow, IEEE Abstract—Researches have shown difficulties in obtaining proximity while maintaining diversity for solving manyobjective optimization problems (MaOPs). The complexities of the true Pareto Front (PF) also pose serious challenges for the pervasive algorithms for their insufficient ability to adapt to the characteristics of the true PF with no priori. This paper proposes a cascade Clustering and reference point incremental Learning based Interactive Algorithm (CLIA) for many-objective optimization. In the cascade clustering process, using reference lines provided by the learning process, individuals are clustered and intraclassly sorted in a bi-level cascade style for better proximity and diversity. In the reference point incremental learning process, using the feedbacks from the clustering process, the proper generation of reference points is gradually obtained by incremental learning and the reference lines are accordingly repositioned. The advantages of the proposed interactive algorithm CLIA lie not only in the proximity obtainment and diversity maintenance but also in the versatility for the diverse PFs which uses only the interactions between the two processes without incurring extra evaluations. The experimental studies on the CEC’2018 MaOP benchmark functions have shown that the proposed algorithm CLIA has satisfactory covering of the true PFs, and is competitive, stable and efficient compared with the state-of-the-art algorithms. Index Terms—Many-objective optimization, interactive evolutionary algorithm, incremental machine learning, clustering, decomposition. I. I NTRODUCTION M ANY real-world problems involve conflicting objectives to be optimized simultaneously [1]–[3]. With the population based features, multi-objective evolutionary algorithms (MOEAs) have shown promising performance in tackling multi-objective optimization problems with two or three objectives in a reasonable runtime by simultaneously approximating various parts of the true Pareto Front (PF) within one run [4]. Aiming to find a representative subset of the Pareto optimal solutions Set (PS), MOEAs pursue two basic goals - obtaining proximity and maintaining diversity, H. Ge, M. Zhao, L. Sun, G. Tan and Q. Zhang are with the College of Computer Science and Technology, Dalian University of Technology, Dalian 116023, China (email: [email protected]). Z. Wang is with the School of Mathematical Sciences, Dalian University of Technology, Dalian 116023, China. C. L. P. Chen is with the Department of Computer and Information Science, University of Macau, Macau 999078, China. where proximity ensures that the subset is close to the true PF in the objective space and diversity ensures that the finite individuals in the subset can well represent the distribution of the true PF in the entire extent. The way to carry out the two tasks has a crucial impact on MOEAs’ optimization performance [5]. The traditional Pareto dominance-based algorithms for multi-objective optimization problems, such as NSGA-II [6], SPEA2 [7] and PESA-II [8], work well with two or three objectives. However, their performance noticeably deteriorates when four or more objectives are involved [9], [10], as the traditional Pareto dominance based strategies lose their effectiveness in many-objective problems (MaOPs). This deterioration in performance greatly motivates researchers to develop new methods and techniques to tackle the MaOPs [11]–[14], especially for real-world applications with many-objectives to be optimized that appear widely in the domains of industrial and engineering design [15]–[18]. When dealing with MaOPs, experimental and analytical results have demonstrated that there are some remaining drawbacks in the current MOEAs [9], [19]. It is hard for most traditional algorithms to perform well on both proximity and diversity. Some algorithms achieve high performance on diversity but low performance on proximity or vice versa. This phenomenon is widely addressed as the “conflict between the proximity and diversity”. Though proximity and diversity are not actually conflicting, the problem is aggravated in the existing algorithms with the increase of the number of objectives. The theoretical research of Teytaud has also shown that when dealing with MaOPs, the difficulties making the MOEAs diverge away from the PF [9], can cause their performance of the traditional Pareto dominance based MOEAs designed for few objectives to degrade to no better than random search for problems with 10 or more objectives involved [20], as the traditional Pareto dominance based strategies lose their effectiveness in highdimensional objective spaces although it works well in low-dimensional objective spaces. This phenomenon is widely regarded as “dominance resistance”. As the proportion of non-dominated solutions increases substantially with the number of objectives, the traditional Pareto dominance fails to distinguish the desired indi- IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X viduals. Thus, insufficient evolution selection pressure is provided on the individuals, causing deterioration on the performance of proximity. Also, in higher-dimensional objective spaces, it is more difficult for the strategies used in traditional MOEAs to maintain the diversity of the population during the evolution process. In this paper, we propose a cascade Clustering and reference point incremental Learning based Interactive Algorithm (CLIA) to address these problems of proximity and diversity appeared in the MaOPs. The rest of this paper is organized as follows: Section II gives the background of researches on the MaOPs including the related works, the remaining drawbacks of them, and also explains the motivations of this paper. Section III gives the details of the proposed algorithm with focus on two interacting crucial processes. Section IV presents the experimental studies of the proposed algorithm CLIA, which include investigating the characteristics and comparing the results with other stateof-the-art algorithms on standard benchmark functions. Section V concludes the paper. II. B ACKGROUND AND M OTIVATIONS A. Related Works and Remaining Drawbacks Confronted by the new difficulties in MaOPs, the major approaches to address them can be summarized into the three following strategies: enhancing dominance, employing indicators and decomposition. Generally, the algorithms that employ the strategy of enhancing dominance try to increase the evolution selection pressure which cannot be sufficiently supplied using only the traditional Pareto dominance based mechanisms in MaOPs by modification and/or combination with new ranking mechanisms. The attempts for modification, including relaxing or controlling the Pareto dominance relation such as ǫ-dominance [19], [21], [22], αdominance [23], θ-dominance [24], ǫ-box dominance [25], dominance area control [26], k-optimality [27], etc., have been conducted. However, the way to determine the proper relaxation degree remains as an open issue [28]. The efforts for developing new ranking criteria including average ranking [29], L-optimality [21], fuzzy-based Pareto dominance [30], [31], preference order rank [32]– [34], grid-based rank [35], distance-based rank [36], [37], rank-dominance [38], and density adjustment strategies [39], [40], clustering-ranking [41], etc., have also been made to combine with the dominance relation. However, researches have shown that these different dominance based approaches focus evolution toward one or several subspaces and fail to produce solutions along the entire extent of the PF [40], [42]. The algorithms that employ the indicator strategy utilize indicators to evaluate the quality of the individuals instead of enhancing Pareto dominance. The ideas of indicator-based MOEAs were early introduced by Zitzler et. al. [43] and Beume et. al. [44], who used the performance indicators to guide evolutionary process. Break- 2 ing away from employing the dominance based strategies, the indicator-based algorithms convert the convergence and diversity of the individuals into designed performance indicators, such as the Hyper Volume (HV) [45]–[47], hyper area ratio [48] and R2-indicator [49], [50], the IGD-NS indicator [51] etc.. However, on one hand, researches have shown that the extensive computation for the indicators in MaOPs still remains as a bottleneck [52], though contributions such as [11], [53], [54] have been made to alleviate the computational burden. On the other hand, the performance of the indicators cannot be guaranteed, as it is hard to design indicators capable of representing the degrees of both proximity and diversity with many-objectives, as many indicators, just like the Pareto dominance, may lose their effectiveness as the number of objectives increases. The algorithms that employ the decomposition strategy aim to simplify the original MaOPs by downsizing their objective spaces. Some decomposition-based algorithms use reference lines1 as weight vectors to decompose the original MaOP into a bunch of scalar problems. The objective function of each sub-problem is an aggregation of all the objective functions that assigns a weight to each objective [56]. The most popular aggregation approaches include the Tchebycheff, the weighted sum and the boundary intersection methods [56] or newly proposed scalarizing functions [57], etc.. The diversity is maintained by specifying a set of well-distributed reference lines to guide the process of the evolution [11]. The representative algorithm in this category is MOEA/D [56], which converts multiobjective problems into several single objective scalar sub-problems and sub-problems are optimized collaboratively. Some researchers have tried to improve the MOEA/D by focusing on neighborhood structures [9], [19], self-adaptation mechanisms [19], etc.. Other decomposition based algorithms use reference lines or neighborhoods to segment the original objective space into a bunch of subspaces and deal with the subproblems separately and/or cooperatively in the subspaces. In the representative algorithm NSGA-III [55], the population diversity is maintained by reference lines and the proximity is controlled by Pareto dominance. In GrEA [35], grids are employed to decompose the original objective space into subspaces. Overall, despite the MOEAs based on decomposition achieve encouraging performance and fast runtime, limitations for most algorithms in this category are obvious in that the decomposition based strategies rely on the uniformity of reference lines to maintain the diversity during the evolution of the population. To assure such uniformity, decomposition based algorithms such as [55], [56], [58] often employ a predefined set of uniformly distributed reference points generated on a unit hyperplane in the objective space that represent the directions of the reference lines as the objective space 1 In this paper, “reference lines” have identical meanings to the ones in [55], referring to the quivers from the origin to the reference points generated for decomposition. IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X 1 overall performance. Though still haunted by the inherent disadvantages of the strategies such as insufficient evolution selection pressure and sensitivity to reference lines etc., the comprehensive methods have brought competitive performance and versatility. true PF effective areas unit hyperplane useful reference lines useful reference points useless reference lines useless reference points 0.9 0.8 0.7 3 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Fig. 1. Demonstration for the central projection of the true PF covering only parts of the unit hyperplane is in a way decomposed into several evenly segmented subspaces. This method of reference point generation is proposed with the assumption that the reference lines that intersect with the unit hyperplane uniformly can also intersect with the true PF uniformly. In reality, this is hardly the case for the following two reasons. (1). The difference in curvature: The true PF may be irregular in shape, e. g. convex, concave or more complicated, so even if the reference lines intersect with the unit hyperplane uniformly, the intersection points with the true PF are not uniformly distributed for the difference in curvature [51], [58]. Since the shape of the true PF is not a known priori, researches have been conducted into the solutions of reference line adaptation [58]–[60]. However, as pointed out, though achieving significantly better performance on the problems with irregularly shaped PFs, their performance deteriorates when applied on the regular PFs, as the adaptation disturbs the uniformity of reference points [51]. (2). Partial PF: The central projection of the true PF from the origin to the unit hyperplane may cover only a part of the unit hyperplane regular hyper polygon (for convenience, the area is abbreviated as “the unit hyperplane”, this type of PF is recognized as “partial PFs”), as demonstrated in Fig. 1. The reference lines corresponding to the reference points generated outside the projection areas on the unit hyperplane hardly guide the evolution of nondominated solutions near the true PF, since they do not intersect with the true PF. Thus, the number of useful reference lines is less than expected. This phenomenon can be observed vastly when the decomposition strategy is applied in the problems with discontinuous PFs where the uniformity is decreased due to the insufficiency of the intersection points of reference lines with the true PF. For this situation, reference points should be generated only inside the projection area on the unit hyperplane with density of expectation, so that the decomposition could be carried out properly. Algorithms such as NSGA-III [55] and GrEA [35] employ more than one strategy above to enhance the B. Motivations Confronted by the mentioned difficulties, it is desirable to design an algorithm which embodies an efficient mechanism that could address problems in obtaining proximity and maintaining diversity with manyobjectives, as well as a versatile mechanism that could handle various characteristics of diverse PFs. In this paper, we propose a comprehensive algorithm CLIA that employs the strategy of enhancing dominance as well as the strategy of decomposition, with two interactive processes, the cascade clustering process and reference point incremental learning process, aiming to address the aforementioned problems with enhancements on both strategies. In cascade clustering, using reference lines, solutions in the population are clustered and selected to obtain proximity and maintain diversity. The process is separately performed on the elite non-dominated solutions and other solutions in a cascade style, in which the cluster centers of elite non-dominated solutions guide the clustering of dominated solutions. Then intraclass ranking schemes are parallelly executed in each cluster. Picking only the elite non-dominated solutions as well as adopting the intraclass ranking could address the timeconsumption. Finally, the round-robin picking maintain the proximity and diversity of the population. In general. if the reference lines are appropriately distributed, the proposed clustering process can effectively obtain proximity and maintain diversity within fair runtime. The quality of reference lines, as we discussed above, has key impact on the performance of decomposition based algorithms. Employing an incremental learning classifier, the projection areas of the true PF on the unit hyperplane (the effective areas of reference point generation) are gradually estimated with the feedbacks from the clustering process. By increasing the density of reference point generation in the effective areas on the unit hyperplane, the reference points will be more properly generated, and the problem brought by the difference in curvature can be relieved since nearer intersection points over the true PF have smaller overall differences in curvature and the problem of partial PFs can be naturally solved. Addressing the sensitivity of the reference lines in the decomposition strategy, the proposed learning process ensures the performance of the cascade clustering. Using reference lines that correspond to the more properly generated reference points from the reference point incremental learning process and providing feedbacks, the cascade clustering process interacts with the reference point incremental learning process as the algorithm proceeds. IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X f1 4 f1 f1 N1 N1 N2 N3 N2 F1 F1 N4 F1 F4 F4 N3 N4 F4 N5 N5 F2 F2 F2 F5 F5 F5 F3 F3 (a) F3 f2 f2 (b) (c) Fig. 2. Demonstration for the cascade clustering process: (a). Frontier solution identification. The identification segments the population into 2 parts: frontier solutions (F1 to F5) and non-frontier solutions (N1 to N5); (b). Cluster and sort the frontier solutions, locate the cluster centers (F1, F2 and F3). The frontier solutions attached to a mutual reference line are clustered and sorted using their PDM; (c). Cluster and sort the non-frontier solutions, create selection queues. The non-frontier solutions are attached to the existing clusters and sorted using their distances to the centers. III. P ROPOSED A LGORITHM CLIA In this section, we will firstly introduce the basics of many-objective optimization problems and the key processes for multi or many-objective evolutionary algorithms. Then, the proposed algorithm CLIA will be explained with focus on the two crucial interactive processes. The first process is the selection operator based on cascade clustering, employed to guide the evolution of the individuals using the reference lines provided by the second process. The second is the reference point incremental learning process, employed to generate properly distributed reference lines using the feedbacks from the first process. A. Basics Given the objective function to be optimized is f (x) = [ f 1 (x), f 2 (x), · · · , f M (x)] T , where M is the number of objectives. x is a solution individual and [ f 1 (x), f 2 (x), · · · , f M (x)] T is the objective value of solution x. Suppose x1 , x2 are two solutions for the given problem, x1 dominates x2 iff ∀i ∈ {1, · · · , M }, f i (x1 ) ≤ f i (x2 ) and ∃ j ∈ {1, · · · , M }, f j (x1 ) < f j (x2 ). A solution x∗ is Pareto optimal if no solution in the feasible solution space S dominates it. Due to the conflicting nature of this kind of problems, often there is not only one optimal solution. The collection of all Pareto optimal solutions is called the Pareto Set (PS). The objective values of solutions in the PS constitute the true Pareto Front (PF), which is the limit of the evolutions of all solutions, as the objective value of no feasible point from the solution space dominates the points on the true PF. The goal of MOEAs is to find a finite solution set X ∗ such that using the limited number of individuals, the objective values of them could be both a proximate and a diverse representative of the true PF. The key processes of MOEAs include population initialization, population evolution and population selection. After the population is initialized as N uniformly distributed random points in the solution space, an evolution operator is applied on the population, creating an offspring population with the size of N. Together they constitute a potential population with a size of 2N. Then the potential population is handed to the selection process to pick out the population of the next generation with the size of N. The evolution and selection processes cycle until the termination criteria are met. B. Cascade Clustering 1) Frontier Solution Selection: Instead of using the traditional costly non-dominated sorting based on Pareto dominance relation for objective values of all solutions in every front, a frontier solution identification mechanism is employed, which only picks out the non-dominated solutions in the first front. For convenience, these solutions are called the frontier solutions, for they are the elite and the desirable solutions in the population. 2) Bi-level Clustering and Intraclass Sorting: Each frontier solution is attached to its nearest reference line by calculating DM, the sine values of the included angle of the objective value of the solution and all reference lines. Reference lines with frontier solutions attached are recognized as active reference lines. The frontier solutions belonging to the same active reference line are intraclassly sorted using the proposed proximity and diversity metric (PDM) in ascending order. PDM (o,r ) = PM (o)+ DM (o,r ) = mean(o)+sin(o,r ) (1) DM (o, r ) = sin(o, r ) is the calculated sine value of the angle between the objective value of the frontier solution o and the assigned active reference line r (the vector from the origin to the reference point representing the direction for the reference line), representing the IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X Algorithm 1: Cascade Clustering Input: R (reference points representing the reference lines), Pold (potential population), N (population size for the next generation) Output: P (population for the next generation) //Frontier Solution Identification [ F, NF ] ← FS Identification(Pold); //Bi-level Clustering and Intraclass Sorting for each frontier solution fi ∈ F do attach to reference line with smallest sin(rj , fi ); PDM (fi ) ← mean(fi ) + sin(rj , fi ); for each active reference line ar i ∈ AR do Create a cluster ci with all attached frontier solutions; ci .F ← sort(ci .F, PDM (ci.F ), ascend); Pick out ci . f j with the smallest PDM as ci .center; for each non-frontier solution n f i ∈ NF do attach to cluster with the nearest center; for each cluster ci ∈ C do ci .NF ← sort(ci .NF, d(ci .NF, ci .center ), ascend); Create selection queue ci .S ← hci .F, ci .NF i; //Round-robin Picking i ← 1; C ← shuffle(C); P ← ∅; while | P| < N do P ← P ∪ Pop(ci.S); i ← mod(i, |C |) + 1; distribution error between the reference line r and the objective value of the frontier solution o. The smaller the overall DM, the closer the objective values of frontier solutions are to the reference lines. So, by using properly distributed reference lines, DM directs the evolution of individuals toward a better diversity. PM (o) is a metric calculating the mean value of all components of the objective value vector, representing the proximity for the solution o. The smaller the overall PM (o), the closer the frontier solutions are to the true PF. Similar to PBI in [56], PDM is also a metric and a decomposition approach to evaluate a preferred individual using the nearest reference line. The proximity term for PBI guides the evolution of individuals towards the origin, while PDM guides the evolution of individuals in a direction perpendicular to the unit hyperplane. The two directions both have the similar effect of pushing the objective values of solutions towards the true PF. However, the evolution direction of the proximity term of PDM is more even for the irregular PFs with long tails or sharp heads as the guiding directions are parallel towards the unit hyperplane. Also, the calculation of PDM is faster, that only mean values needs to be additionally calculated. For each active reference line, the attached frontier solutions are gathered as a cluster. Also, the frontier 5 solution with the best PDM is taken as the center of the corresponding cluster. Each non-frontier solution is assigned to the clusters with the nearest cluster center. For each cluster, the non-frontier solutions are sorted by their Euclidean distances to the corresponding cluster centers in ascending orders. In this way, the objective values of the nearest frontier solutions are used to guide the evolution of the non-frontier solutions. By employing a criterion that does not select the solutions outside the first front as guiding solutions, a more intense pressure on evolution selection is obtained towards better proximity and better guidance for proximity is provided for the whole population. After these operations, clusters are created with two intraclassly sorted queues: the sorted frontier solution queue and the sorted non-frontier solution queue. The operations are graphically demonstrated in Fig. 2. 3) Round-robin Selection: For the proximity and the diversity brought by the desired frontier solutions and to enhance covering in the objective space by increasing the chance of selecting non-frontier solutions into the next generation, a round-robin picking method is employed. In each cluster, the selection queue is obtained by concatenating the sorted non-frontier solution queue after the sorted frontier solution queue. In each round, in a shuffled sequence, the head of each selection queue is popped out and added to the next generation until the size of the next generation reaches N. It should be noticed that, unless the clusters are more than N or replaced by better frontier solutions, i. e. new centers, all cluster centers are kept. This picking method ensures the inheritance of the desired frontier solutions as well as the diversity of picking the non-frontier solutions. With M objectives and N individuals, frontier solutions are picked out in O( MN 2), as O( MN 2) is also costed on other operations including the bi-level clustering and intraclass sorting. Thus the overall runtime complexity for the process of cascade clustering is O( MN 2 ), which is less costly compared to the non-dominated sorting based algorithms with O( MN 3 ) costs [61]. The pseudo code of the cascade clustering process can be found in Algorithm 1. Instead of being discarded, the attributes (active or not) of reference lines are gathered and handed to the reference point incremental learning process. C. Reference Point Incremental Learning Traditionally, reference points are evenly generated inside a hyper-polygon bounded with the points with unit intercepts on each objective over the unit hyperplane in the objective space with the expectation that the reference lines that go from the origin towards these points could intersect with the true PF uniformly. As discussed above, the central projection of the true PF (the effective areas for reference generation) from the origin to the hyperplane may cover just a part of reference points, i. e. the problem has a partial PF. When solutions IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X 6 5 5 5 f3 6 f3 6 f3 6 4 4 4 3 3 0 0 0.2 0.2 0.4 0.4 0 0.2 0.2 0.4 0.4 0.6 0.6 f2 3 0 0.8 0.8 f1 0 0.2 0.2 0.4 0.4 0.6 0.6 f2 0 0.8 (a) (b) 0.8 f1 0.6 f2 0.6 0.8 0.8 f1 (c) Fig. 3. Demonstration for the impact of the number of reference lines: (a). less reference lines than needed, some reference lines are overcrowded; (b). appropriate number of reference lines; (c). more reference lines than needed, only a part of reference lines are active. evolve to be proximate to the true PF, the reference lines that intersect with the true PF are more likely to be the nearest to the solutions than the ones that do not intersect the true PF. When N reference points are uniformly generated on the unit hyperplane, the goal of cascade clustering is to select individuals out of N clusters with at least one solution assigned to one reference line. However, this cannot be done since less than N reference lines are actually properly distributed, i. e., intersect with the true PF. Thus, a viable solution is to reduce the useless reference lines and increase the number of reference lines that intersect with the true PF, i. e., to increase the reference points generated inside the effective areas on the unit hyperplane and reduce the outsiders that hardly make contributions. An example is given in Fig. 1. When the reference points are evenly generated on the unit hyperplane, the reference lines are generated as lines that intersect with the origin and the reference points. However, as the example problem has a partial true PF, only a part of reference lines can intersect with the true PF, as shown in Fig. 1 where the reference lines intersecting with the true PF are in blue while others are in red. Thus, by a central projection from the origin, the true PF is projected on the unit hyperplane as the effective areas for the reference points. As it is shown in Fig. 1, the blue reference points are generated inside the central projection of the true PF from the origin on the unit hyperplane, while the red ones are not. On one hand, if this is the case, that the density of reference lines is low and less than N reference lines go through the true PF, there will be less than N reference lines guiding the evolution of population. After selection, there will always be a reference line with more solutions than it is expected to attach. On the other hand, if the density of the reference points is too dense and the effective areas of the unit hyperplane are overcrowded with more reference points than needed, the solutions may unevenly attach to only a part of reference lines that go through only a part of true PF. To conclude, we should appropriately generate the reference points in the effective areas. The three situations are shown in Fig. 3. In Fig. 3 (a), where insufficient reference points are generated in the effective areas of the unit hyperplane, it can be observed that though appropriately distributed, after selection, many reference lines are overcrowded with more than one solution. In Fig. 3 (b), where the reference points are appropriately distributed, it can be observed that the distribution of the solutions is relatively even in the true PF, which is the ideal case. In Fig. 3 (c), where too many reference points are generated, it can be observed that only a random part of reference lines are attached with solutions, causing a partial distribution of solutions near the true PF. Generating more evenly distributed reference lines that could intersect with the true PF can both relieve the problems of brought by the differences in curvature of the true PF as well as the problems of insufficient useful reference lines brought by the partial PFs. Since the characteristics of the true PF is not a known priori, it can be imagined that it is hard to locate such effective areas on the unit hyperplane to generate reference points. However, since the individuals outnumber the active reference lines under such circumstance, the reference lines that intersect with the true PF are more likely to be attached with frontier solutions, i. e. the points corresponding to the active reference lines are more likely to be in the effective areas. This motivates us to use the attributes of the reference points to gradually estimate the distribution of the effective areas. However, since the shape of projection of the true PF on the unit hyperplane could be irregular, a definitive model for the boundaries should not be adopted for such complexities. Thus, the task should be finished with an implicit approach. This task is carried out by a learning mechanism with a status sampler and a support vector machine. Whenever the distribution of active reference lines is stable, which means that in a period of cycles the active reference lines do not change, the sampler records and analyzes the attributes of all reference lines. If only a part of reference lines are active and the number of active reference lines is smaller than N, which means insufficient useful reference lines are generated, the reference points corresponding to the reference lines IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X 7 active reference points inactive potential reference points inactive reference points active reference points inactive potential reference points inactive reference points active reference points inactive potential reference points inactive reference points active reference points inactive potential reference points inactive reference points 1 1 1 1 0.8 0.8 0.8 0.8 0.6 0.6 0.6 0.6 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0 0 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 (a) 1 0 0 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 (b) 0.2 0 0 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 (c) 1 0 0 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 (d) Fig. 4. Demonstration for the interactions of cascade clustering and reference point incremental learning: (a). Initial stage: N reference points are uniformly generated on the unit hyperplane; (b). Reference points are more densely generated and the low-scored ones are reduced using the scoring of the classifier whose knowledge is learnt from (a); (c). The process repeats: the number of active reference points gradually increases and the number of inactive reference points decreases; (d). The final status for reference point distribution: sufficient reference points are generated in the effective area. will be marked with their attributes and be fed to a classifier for learning. Then the generation density for reference points is increased to generate more reference points and the old ones will be discarded. By employing Platt scaling [62], the output of the incremental learning classifier predicting whether a certain reference point is in the effective area or not can be converted into p, a score of probability distribution over classes. If p > 0.5, the reference point is considered as useful and vice versa. However, the learning may be inaccurate for many reasons. Thus, a threshold δ, δ < 0.5, is employed to pick out the additional potential reference points whose δ ≤ p < 0.5. As it is discussed, the learning process may be initiated more than once. The old information of reference points is worthy of using, and the new attributes of reference points should also be learned. It is costly to archive all the old data and retrain the classifier for each learning process initiated, which is the exact case that incremental machine learning should be applied. So, we employ the incremental SVM for the situation. The pseudo code for the redistribution process is in Algorithm 2. Increasing the generation density of reference points in the effective areas ensures the versatility on the MaOPs with partial PFs and relieves the problems brought by the difference in curvature. It should be noticed as well that we do not have to use a definitive model for the boundaries of the projection of the true PF, an incremental learning classifier is used to gradually estimate the boundary of the effective area with no extra burden on the fitness evaluation of the population, as the information of learning comes from the feedbacks of the clustering process. D. Demonstration for Clustering-Learning Interactions Take a run of CLIA on the benchmark problem f 1 of the CEC’2018 MaOP competition [63] for the demonstration of the interactions of the two processes. At first, N reference points are uniformly generated on the unit hyperplane using the traditional generation Algorithm 2: Reference Point Incremental Learning Input: ARP (active reference points), IRP (inactive reference points), S (sampler status), D (old reference point generation density), M (number of objectives), N (population size), δ (potential threshold), B (bases of hyper projection) Output: new reference points RP, new generation density D if isStable(S) and | ARP| < N then //Incremental learning after hyper projection Classifier = IncrementalLearn(Classifier, HP(ARP), HP(IRP)); //Generate denser reference points D = D + 1; RP = generateReferencePoints(D, M); //pick the points with p ≥ δ RP = ClassifierPick(Classifier, HP(RP), δ); method identical to [55] and their corresponding reference lines are handed to cascade clustering for population selection. Then, the selection operator additionally returns the attributes of the reference lines. The active reference points corresponding to the active reference lines (the reference lines with frontier solutions attached) are marked in green, while the other reference points are inactive, as it is shown in Fig. 4 (a). If the sampler considers this status stable, when the attributes of reference points are relatively reliable for learning, the attributes of all current reference points will be sent to the classifier for incremental learning. However, since the reference points are all located on the unit hyperplane, which is one dimension lower than the objective space, a hyper projection is firstly applied on the coordinates of the reference points to decrease their dimensionality. At the initialization phase of the algorithm, the projection bases for the hyper projection process are firstly calculated and saved for the later processes using the center and the vertices of the regular hyper polygon on the unit hyperplane by the orthogonalization process of Jorge IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X Gram and Erhard Schmidt [64]. After the learning is complete, using the Platt scaling scoring scheme [62], the incremental learning classifier is able to identify the potential of a reference point (actually the projection of the reference point using the aforementioned bases) by scoring it. In Fig. 4 (a)(b)(c)(d), the blue points are the potential inactive reference points located in the potentially effective area of the unit hyperplane with scores greater or equal to δ. Considering that there are not enough active reference lines, more reference points are generated using a higher generation density. By applying the classifier on the newly generated reference points, the points with lower score than threshold, the ones not likely to be active, are reduced. Only the points with scores higher than or equal to δ are kept for the next clustering process. In Fig. 4 (b), as it is demonstrated, the reference points located at the tails of the triangle area are reduced for their low scores, only the reference points with scores greater than or equal to δ are participating the clustering process. Whenever the sampler considers the status of reference lines stable and the number of current active reference points is below N, the above process repeats, as it is demonstrated in Fig. 4 (c)(d). As the process repeats, more accurate boundaries for classification can be obtained, since the population is getting nearer to the true PF and the intermediate areas on the unit hyperplane are filled with denser data points. If the clustering process reports that the number of active reference lines is almost or above N, the reference point incremental learning process including the sampler, the incremental learning classifier and the reference point generator is disabled. 8 START Population Initialization Reference Line Initialization Population Evolution Using an Optimizer Frontier Solution Identification Bi-level Clustering and Intraclass Sorting Round-robin Picking Termination? YES NO NO Active Reference Lines Sufficient? NO Sampler Gathering Active Reference Lines Stable? YES YES Incremental Learning for the Classifier Generate Reference Points with Higher Density Pick Potential Reference Points E. Proposed Framework The framework of the proposed algorithm is formulated as the flowchart in Fig. 5. First, to initialize, N individual solutions are randomly generated in the solution space S and N reference points are uniformly generated on the unit hyperplane in the objective space O representing the direction for N reference lines. Then, the main loop cycles until the criteria of termination are satisfied: evolve to get the offsprings using the N solutions in the population and obtain the potential population with a size of 2N. Then, out of the potential population, using the selection operator based on cascade clustering, the new population with the size of N is picked out. Then the information of feedbacks of the clustering process is additionally used. If the number of active reference lines are not enough, an incremental classifier will learn from the stable status and locate the potential areas for the newly denser generated reference points. The algorithm proceeds along with interactions of the cascade clustering process and the reference point incremental learning. END Fig. 5. The Framework of the Proposed Algorithm CLIA IV. E XPERIMENTAL S TUDIES A. Experimental Settings To demonstrate the effectiveness of CLIA, the benchmark suite for CEC’2018 MaOP competition is chosen, which is designed for understanding the strengths and weaknesses of MOEAs with benchmark functions of diverse characteristics [63]. In the technical report for CEC’2018 MaOP competition, 15 many-objective benchmark functions (MaF) are provided with box constrains in the solution space. For each of the 15 benchmark functions, there are three separate test cases, M = 5, M = 10 and M = 15, constituting 45 different test cases. With official standards including using the default simulated binary crossover and polynomial mutation optimizer with default parameters and the population 9 1 10 0.8 0.8 0.8 8 0.6 0.4 0.2 0.6 0.4 0.2 0 2 3 4 Objectives (a) f 1 5 0.6 0.4 2 3 4 5 Objectives 1 2 3 4 Objectives (b) f 3 4 0 0 1 6 2 0.2 0 1 Objective Value 1 Objective Value 1 Objective Value Objective Value IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X (c) f 6 5 1 2 3 4 5 Objectives (d) f 11 Fig. 6. Demonstration for the covering of the final population on the true PF on 5 benchmark functions size of N = 240 and the designated number of fitness evaluations, all data of each algorithm given in this section is averaged over 20 independent runs for each test case on PlatEMO [65]. The settings of the experimental studies in this paper are identical to the standard for CEC’2018 MaOP competition, which can be found in [63], together with the details of the benchmark functions. An incremental learning SVM with a Gaussian kernel, kernel scale of 0.56 and the soft-margin regularization parameter of C = 10 is adopted. The details of its parameter settings can be found in [66]. In our implementation, threshold δ is dynamically set to be the score of reference point with the min( R, 2N )-th highest score, i. e., when the number of active reference lines is below N, after a denser generation of reference points with totally R in number, at least min( R, 2N ) reference points will be kept. Thus, at least min( R, 2N ) reference points are continuously redistributed to the potential areas unless the disabling criteria are met. All data obtained is run on a computer with a quad core 3.5 GHz 8-Gen Core i7 CPU and 16.0GB of memory on MATLAB R2017b. The source code of CLIA is implemented using the open source PlatEMO [65] with compatibilities for MATLAB R2017b2. B. Performance Metrics The two prevailing metrics to evaluate the quality of a solution population are IGD and HV. Originally used in [67], IGD, short for Inverted Generational Distance, is a comprehensive measure of both proximity and diversity of a population. Let P∗ be a set of evenly distributed sample points over the true PF and P be the current population, the n-order IGD from P to P∗ can be formulated as: IGD ( P, P∗, n) = (∑v ∈ P∗ dn (v, P))1/n | P∗ | (2) where d(v, P) is the minimum Euclidean distance between a sample point v on the true PF and the solutions in P. Originally, when IGD is first used in evaluating the performance of MOEAs [68], [69], n is taken as 2, i. e., 2 The MATLAB source code can be found in Mingde Zhao’s github: https://github.com/PwnerHarry/ the 2-order IGD is adopted. In the recently papers, n is widely chosen as 1 as it is in [51]. In this paper, to concur with the metrics of the CEC’2018 MaOP competition [63], n is also taken as 1. When | P∗ | is large enough, IGD ( P, P∗, 1) can measure both the diversity and the proximity of P. The smaller the IGD, the better the proximity and diversity. Calculating the volume of the objective space between the obtained solution population and a reference point, HV, short for HyperVolume, can give the set a comprehensive assessment in terms of proximity and diversity [70]. For clarity and the consistency with the CEC’2018 MaOP competition, the normalized HV (NHV) [63] is adopted to normalize the hypervolume to the interval [0, 1]. The higher the NHV, the better the size of the space covered, the better proximity and diversity. C. Characteristic Studies 1) Covering of the true PF: In Fig. 6, the objective values of all individuals for 5 test cases are plotted in parallel coordinates, with the Y-axis representing the objective values on each objective and the X-axis representing the specified objectives. Also, in the bottom layer of the subfigures, the objective values of the sampled true PFs are plotted in a lighter color. These graphs in Fig. 6 provide an intuitive demonstration for the performance of an MOEA on the covering of the true PF. With the limited size of population, the ideal performance is to find the solutions whose objective values are evenly distributed over the true PF in each objective in the parallel coordinates. However, though showing satisfactory covering, it can be observed that the objective values of individuals found by CLIA is not ideal since they are distributed over the PF in a messy way and some objectives are outside the PF area showing unsatisfactory proximity. It can be observed from Fig. 6 that some representative individuals with extreme objective values on certain objectives are missed by the proposed algorithm CLIA. This can be ascribed to the fuzzy boundaries of the effective areas on the unit hyperplane, since the results of the process of reference point incremental learning are not completely accurate. The inaccurate scoring on the boundaries of the potential effective areas may lead IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X to the loss of some useful reference points, causing the aforementioned problems. TABLE I T HE COMPARED ALGORITHMS AND THE CORRESPONDING STRATEGIES Dominance CLIA AR-MOEA NSGA-III NSGA-II IBEA GrEA KnEA MOEA/D RVEA Indicator Y Decomposition Y Y Y Y Y Y Y Y Y Y Y D. Comparative Studies 1) Data on CEC’2018 MaOP Benchmark Suite: The obtained data of IGD and NHV on each test case are compared with the corresponding data of the highlighted state-of-the-art algorithms in the PlatEMO platform including the AR-MOEA [51], NSGA-III [55], NSGA-II [6], IBEA [43], GrEA [35], KnEA [12], MOEA/D [56] and RVEA [58]. The characteristics of the compared algorithms are presented in Table I. The IGD and NHV results on CEC’2018 MaOP benchmark of CLIA and the 8 compared algorithms averaged over 20 independent runs are presented in Table II and Table III, respectively. For each test case, the result of with the best performance is barked in bold. Friedman tests are also respectively conducted on the IGD results and the NHV results, the rankings and the detailed results are also presented in Table II and Table III. On IGD, χ2 = 68.81 and p = 8.48 × 10−12. On NHV, χ2 = 54.92 and p = 4.58 × 10−9. With the significance level of α = 0.05, the Friedman test shows that the two respective rankings are effective since the differences of the results among the 9 algorithms are statistically significant. With the significant statistical differences, the proposed algorithm CLIA achieves the highest performance by obtaining the top overall ranking in both IGD and NHV considering all 45 individual test cases. The rankings with the best performance (lowest mean values of IGD, highest mean values of NHV) are marked in bold. Two-sample t-tests are also conducted on the 8 pairs of algorithms, each pair is the proposed algorithm CLIA and one compared state-of-the-art algorithm. The results of the t-tests are provided as “l/u/g”, where l represents the mean value of the proposed algorithm, for a certain test case, is significantly less than the compared algorithm, g represents a greater result, and u represents that it is uncertain to say whether the mean value of the proposed algorithm CLIA is greater or less than the compared algorithm. The t-test results where proposed algorithm CLIA performed better in number of test cases are marked in bold. 10 E. Categorized Performance Comparison and Analysis With M = 5, the proposed algorithm CLIA outperforms other algorithms by ranking the 1st in 13 benchmark functions out of 15 with IGD and the 1st in 7 functions with NHV. Though still achieving competitive overall performance with M = 10 and M = 15, the deterioration for the performance of CLIA can be observed. The interval of performance rankings provided by Friedman test shrinks, showing that all compared algorithms still cannot fully address the problems with such number of objectives. For proposed algorithm CLIA, this may be resulted by the sparse distribution of the reference points in the high-dimensional objective space which is insufficient for the classifier to obtain the correct boundaries for the effective area over the unit hyperplane. When dealing with the 8 functions with partial PFs whose projections do not fully cover the unit hyperplane ( f 1 , f 2 , f 4 , f 6 , f 7 , f 8 , f 9 and f 15 ), CLIA obtains the best overall performance in both IGD and NHV with three different numbers of objectives, demonstrating that the process of reference point incremental learning has brought versatility for the diverse PFs. On problems with PF projection fully covering the unit hyperplane ( f 3 , f 10 , f 11 , f 12 , f 13 and f 14 ), CLIA obtains the best overall performance on IGD and the second best on NHV on test cases of M = 5, M = 10 and M = 15, demonstrating the effectiveness of the selection operator based on cascade clustering. On the large-scale problems ( f 14 and f 15 ), where the dimensionality of the solution space is relatively high, CLIA also achieves the highest overall performance with respect to the two metrics considering all test cases comprehensively. Fig. 7 presents two radar diagrams specifying the rankings of the performance on each type of functions of the compared algorithms with the metrics of IGD and NHV respectively. In the IGD radar diagram Fig. 7 (a), the values of the dimensions are the reciprocal rankings of obtained by the Friedman tests on each category of functions. In the NHV radar diagram Fig. 7 (b), the values of the dimensions are the rankings of obtained by the Friedman tests on each category of functions. For the category “M5”, “M10” and “M15”, the results of the test cases of all 15 benchmark functions of M = 5, M = 10 and M = 15 respectively are analyzed by the Friedman mean ranking process. For the functions of a certain category, the data of those functions under M = 5, M = 10 and M = 15 are all taken to Friedman tests. The rankings for “M5”, “M10” and “M15” can be found in Table II and Table III. F. Runtime Comparison and Analysis Table IV provides the runtime of all the compared algorithms as well as ratios of their runtime to the runtime of the proposed CLIA. In the table, the “runtime” is all averaged over 20 independent runs as the total runtime needed for running all 15 benchmark functions IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X 11 TABLE II S TATISTICS FOR IGD: M EAN , S TD , F RIEDMAN MEAN RANKS AND t- TESTS OF 9 ALGORITHMS AVERAGED USING 20 INDEPENDENT RUNS CLIA f1 f2 f3 f4 f5 f6 f7 f8 f9 f 10 f 11 f 12 f 13 f 14 f 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 Rank 15 all 5 10 t-test 15 all Mean 1.12e-1 3.10e-1 3.19e-1 9.60e-2 1.95e-1 2.98e-1 7.11e-2 8.28e-2 8.91e-2 2.02e0 8.50e+1 3.71e+3 2.10e0 8.67e+1 2.34e+3 5.76e-3 4.62e-2 6.28e-2 2.87e-1 9.79e-1 2.72e0 8.82e-2 4.49e-1 8.53e-1 8.37e-2 5.10e-1 6.45e-1 4.48e-1 1.04e0 1.75e0 6.67e-1 2.23e0 7.95e0 1.07e0 4.64e0 7.45e0 1.09e-1 2.39e-1 3.32e-1 3.56e-1 5.98e-1 6.36e-1 4.72e-1 9.52e-1 1.03e0 Std 2.54e-4 2.11e-3 3.43e-3 1.55e-3 1.10e-2 1.32e-2 8.28e-3 7.23e-3 9.77e-4 1.04e-1 6.46e0 1.82e+2 3.92e-1 1.33e+1 4.85e+2 2.72e-4 2.30e-3 6.70e-2 3.32e-2 9.83e-2 3.40e-1 3.12e-3 1.24e-1 7.94e-2 4.65e-3 9.74e-3 1.04e-1 1.60e-2 4.56e-2 3.38e-1 1.53e-2 2.24e0 3.20e0 5.65e-2 1.98e-1 6.82e-1 1.07e-2 3.28e-2 1.53e-1 6.24e-3 5.46e-2 6.69e-2 4.57e-2 3.95e-2 3.85e-2 1.20 3.40 3.73 2.78 AR-MOEA Mean 1.41e-1 2.52e-1 2.88e-1 1.11e-1 2.06e-1 2.26e-1 9.71e-2 4.08e0 5.48e+1 2.45e0 9.68e+1 4.01e+3 2.39e0 9.87e+1 3.31e+3 4.22e-3 1.08e-1 2.38e-1 3.29e-1 1.57e0 4.06e0 1.29e-1 1.37e-1 1.73e-1 1.27e-1 1.77e-1 1.51e-1 4.71e-1 1.20e0 1.96e0 8.25e-1 2.56e0 4.68e-1 1.12e0 4.69e0 7.62e0 1.30e-1 1.22e-1 1.50e-1 3.85e-1 6.76e-1 6.04e-1 6.13e-1 8.52e-1 1.35e0 Std 1.89e-3 1.29e-3 1.25e-2 1.03e-3 8.73e-3 1.02e-2 1.74e-3 1.18e+1 1.51e+2 9.25e-2 6.42e0 5.26e+2 8.01e-1 4.11e0 4.44e+2 5.63e-5 1.40e-1 1.25e-1 7.55e-3 9.55e-2 6.97e-1 4.45e-3 4.17e-3 6.24e-3 8.24e-3 8.20e-3 5.40e-3 1.09e-2 5.94e-2 8.53e-2 1.72e-2 4.39e-1 6.22e-1 7.95e-3 1.44e-2 1.66e-1 6.74e-3 7.21e-3 9.25e-3 4.24e-2 8.35e-2 6.46e-2 2.57e-2 5.04e-2 7.91e-2 NSGA-III Mean 1.97e-1 2.67e-1 3.17e-1 1.29e-1 2.41e-1 2.08e-1 1.08e-1 2.66e+2 1.88e-1 3.21e0 9.73e+1 4.17e+3 2.21e0 8.81e+1 2.59e+3 4.40e-2 2.16e-1 3.17e-1 3.28e-1 1.02e0 4.74e0 2.35e-1 3.37e-1 4.02e-1 4.36e-1 7.10e-1 3.75e-1 4.57e-1 1.07e0 1.55e0 8.25e-1 4.97e0 1.04e+1 1.12e0 4.59e0 7.92e0 2.59e-1 2.18e-1 3.10e-1 1.49e0 2.54e0 1.33e0 1.18e0 1.24e0 3.37e0 Std 1.42e-2 5.64e-3 2.24e-3 2.31e-3 4.40e-2 7.50e-3 2.38e-2 1.21e+2 7.14e-2 3.43e-1 9.12e0 2.07e+2 1.75e-3 6.82e-1 1.73e+2 1.49e-2 8.80e-2 4.27e-2 1.12e-2 6.51e-2 1.13e0 1.81e-2 7.04e-2 5.38e-2 1.69e-1 1.16e-1 6.34e-2 1.33e-2 6.83e-2 4.11e-2 1.11e-2 1.64e0 2.84e0 6.14e-3 1.58e-2 3.37e-1 2.50e-2 2.61e-2 7.77e-2 1.03e0 2.23e0 8.57e-2 4.46e-2 2.85e-1 7.25e-1 NSGA-II Mean 1.73e-1 2.92e0 3.37e-1 1.43e-1 1.63e-1 1.75e-1 2.86e-1 2.37e+6 2.47e+6 2.23e0 5.94e+1 1.62e+3 2.29e0 9.53e+1 1.72e+3 4.66e-3 3.85e-1 6.20e-1 3.59e-1 1.82e0 3.26e0 1.52e-1 1.56e-1 1.54e-1 5.74e-1 7.11e+1 8.82e-1 9.34e-1 1.75e0 2.02e0 8.92e-1 2.01e0 8.80e-1 1.32e0 4.92e0 8.23e0 1.71e-1 1.29e-1 1.06e-1 1.01e0 6.74e0 3.71e0 1.97e+1 9.37e+1 1.07e+2 Std 2.15e-3 1.03e-2 1.01e-2 3.02e-3 2.31e-3 3.91e-3 7.70e-3 1.31e+6 1.07e+6 9.26e-2 4.35e0 1.13e+2 3.21e-2 4.15e0 6.39e+1 2.70e-4 3.28e-2 3.65e-1 6.95e-3 1.57e-1 3.46e-1 7.69e-3 5.68e-3 4.77e-3 3.17e-1 8.76e+1 2.81e-1 6.26e-2 8.52e-2 2.96e-2 1.17e-1 2.30e-1 3.24e-1 4.26e-2 7.22e-2 1.49e-1 2.12e-2 1.62e-2 2.80e-3 1.23e-1 4.47e0 4.86e0 3.82e0 1.39e+1 1.42e+1 IBEA Mean 1.45e-1 2.74e-1 3.16e-1 1.09e-1 1.90e-1 2.96e-1 5.83e-1 3.46e-1 2.65e-1 5.81e0 1.65e+2 4.51e+3 2.34e0 5.88e+1 1.32e+3 6.07e-2 1.65e-1 3.92e-1 3.07e-1 9.04e-1 2.47e0 9.20e-1 1.02e0 1.03e0 9.95e-1 1.05e0 3.17e0 5.56e-1 1.09e0 1.49e0 1.30e0 5.81e0 9.99e0 1.16e0 4.11e0 6.70e0 7.65e-1 1.11e0 1.47e0 1.65e0 1.08e0 1.16e0 8.57e-1 7.65e-1 1.31e0 Std 5.44e-3 5.82e-3 1.89e-3 1.22e-3 1.33e-2 7.83e-3 3.29e-1 6.27e-2 6.06e-2 6.66e-1 1.02e+1 1.81e+2 3.20e-1 2.75e0 4.97e+1 2.04e-2 1.62e-1 7.97e-2 1.41e-2 1.10e-1 5.92e-1 6.36e-2 8.24e-2 2.41e-2 1.53e-2 1.21e-1 4.71e0 1.73e-2 3.43e-2 2.25e-2 3.19e-2 1.71e-1 1.29e0 1.25e-2 4.39e-2 8.06e-2 2.31e-2 1.77e-1 1.92e-1 9.10e-1 2.17e-1 7.51e-2 5.14e-2 1.85e-1 7.08e-3 GrEA Mean 1.35e-1 2.49e-1 3.38e-1 1.13e-1 4.02e-1 3.69e-1 7.13e-1 4.59e+2 6.52e+2 2.20e0 1.61e+2 5.00e+3 2.13e0 4.82e+1 1.09e+3 3.75e-2 3.93e-1 1.29e0 2.65e-1 2.49e0 6.82e0 1.51e-1 1.47e-1 1.56e-1 1.45e0 1.40e0 5.86e0 6.13e-1 1.25e0 2.15e0 1.24e0 2.77e0 5.73e0 1.09e0 4.20e0 6.86e0 3.51e-1 3.18e-1 5.81e-1 7.33e-1 2.00e0 7.57e0 1.01e0 7.60e-1 1.30e0 Std 1.35e-3 8.79e-3 1.96e-2 1.54e-3 1.31e-2 6.38e-3 2.62e-1 6.07e+2 6.04e+2 1.12e-1 1.64e+1 1.75e+3 1.28e-1 1.45e0 5.02e+1 1.33e-3 8.53e-2 8.32e-1 3.00e-3 1.15e-1 9.20e-2 6.35e-3 3.33e-3 2.00e-3 3.06e-1 4.90e-2 5.65e0 4.19e-2 5.03e-2 1.57e-1 1.94e-1 2.05e-1 9.13e-1 5.62e-3 2.37e-2 4.03e-2 1.86e-1 9.29e-2 5.87e-2 2.18e-1 1.91e0 1.31e+1 7.63e-2 5.90e-2 3.77e-3 KnEA Mean 1.24e-1 2.31e-1 2.76e-1 1.29e-1 1.56e-1 1.79e-1 1.53e-1 1.67e+8 1.28e+9 3.07e0 7.59e+1 1.80e+3 2.48e0 7.63e+1 1.71e+3 8.09e-3 9.78e0 2.53e+1 2.90e-1 8.67e-1 2.54e0 2.59e-1 1.66e-1 1.37e-1 8.25e-1 2.46e+1 3.71e-1 5.21e-1 1.22e0 1.62e0 6.75e-1 2.22e0 5.81e0 1.17e0 4.57e0 6.53e0 2.24e-1 1.45e-1 1.12e-1 5.46e-1 9.66e0 1.11e+1 4.15e0 7.02e0 1.03e+2 Std 2.44e-3 1.56e-3 3.27e-3 3.65e-3 2.21e-3 8.30e-3 4.01e-2 3.44e+8 1.55e+9 3.86e-1 8.38e0 3.18e+2 9.56e-2 1.15e+1 1.31e+2 3.73e-3 4.60e0 2.63e+1 1.45e-2 1.45e-2 3.56e-1 1.04e-1 2.46e-2 5.97e-3 5.36e-1 2.31e+1 2.45e-1 8.75e-3 8.35e-2 1.43e-1 4.02e-2 4.20e-1 1.46e0 1.96e-2 3.01e-2 9.93e-2 2.55e-2 1.23e-2 9.66e-3 5.58e-2 2.34e0 2.54e0 1.94e0 8.52e0 5.96e+1 MOEA/D Mean 2.34e-1 4.68e-1 5.77e-1 1.24e-1 3.24e-1 3.63e-1 1.25e-1 1.45e-1 1.31e-1 9.66e0 4.45e+2 1.90e+4 9.23e0 3.01e+2 7.32e+3 9.59e-2 1.23e-1 1.85e-1 1.08e0 2.00e0 4.09e0 2.95e-1 9.40e-1 1.37e0 1.42e-1 1.06e0 3.09e0 1.22e0 2.62e0 3.13e0 5.13e0 1.67e+1 2.73e+1 1.56e0 8.89e0 1.50e+1 1.74e-1 9.97e-1 1.47e0 7.67e-1 5.55e-1 9.46e-1 5.80e-1 9.77e-1 1.07e0 Std 1.84e-2 4.35e-4 3.83e-3 5.38e-4 1.78e-3 3.47e-4 2.27e-3 1.14e-3 3.15e-4 3.08e-1 1.55e+1 6.18e+2 9.82e-1 1.72e0 4.42e-1 1.58e-1 2.06e-1 1.03e-1 2.27e-2 2.51e-1 6.85e-1 9.11e-3 2.08e-2 1.11e-2 5.09e-3 1.54e0 4.75e0 3.47e-3 9.16e-2 1.47e-1 2.96e-2 3.10e-2 9.79e-2 4.08e-2 2.90e-1 1.51e0 6.19e-3 1.09e-1 1.79e-1 2.44e-1 2.65e-1 1.44e-1 2.14e-2 2.34e-2 2.36e-2 RVEA Mean 3.07e-1 6.76e-1 6.89e-1 1.29e-1 2.36e-1 6.84e-1 8.37e-2 8.51e-2 1.21e-1 4.88e0 2.34e+2 7.23e+3 2.94e0 1.03e+2 2.94e+3 8.15e-2 1.37e-1 1.20e-1 4.49e-1 2.96e0 3.95e0 4.56e-1 8.00e-1 1.21e0 4.61e-1 8.41e-1 1.23e0 4.67e-1 1.27e0 1.83e0 1.70e0 6.93e0 1.80e+1 1.12e0 4.52e0 7.17e0 6.85e-1 8.95e-1 1.11e0 7.92e-1 6.36e-1 7.72e-1 5.88e-1 9.76e-1 1.18e0 Std 3.81e-2 7.00e-2 8.79e-2 2.42e-3 9.08e-3 2.38e-1 7.15e-3 2.87e-3 2.50e-2 9.44e-1 2.69e+1 1.00e+3 1.64e0 6.63e0 2.04e+2 2.45e-2 1.67e-2 2.37e-2 1.01e-3 3.53e-1 9.74e-1 2.47e-2 8.70e-2 1.58e-1 1.29e-1 3.00e-1 2.78e-1 5.74e-2 7.76e-2 6.70e-2 5.31e-1 2.55e0 3.81e0 2.23e-3 4.28e-2 2.19e-1 1.82e-1 1.88e-1 4.23e-1 1.82e-1 4.41e-2 1.51e-1 5.21e-20 5.86e-2 3.13e-2 3.37 3.73 4.13 3.74 5.17 5.07 5.07 5.10 5.87 5.80 4.80 5.49 6.53 4.60 4.70 5.28 4.67 5.07 6.07 5.27 5.13 4.60 3.87 4.53 6.80 6.80 6.90 6.83 6.27 5.93 5.73 5.98 14/0/1 7/3/5 6/3/6 25/7/13 13/2/0 10/2/3 8/4/3 26/11/8 14/0/1 10/1/4 9/0/6 32/1/12 15/0/0 8/2/5 8/4/3 31/2/12 12/2/1 8/2/5 11/1/3 31/3/11 14/1/0 6/1/8 4/1/10 21/6/18 15/0/0 12/3/0 14/1/0 40/3/2 14/1/0 12/2/1 13/1/1 38/3/4 with a certain number of objectives. Also, the ratios are calculated as the ratio of the “runtime” of the compared algorithm to the proposed algorithm CLIA in the corresponding cases. From the table, we can observe that the proposed algorithm CLIA has intermediate level of overall runtime consumption compared with the state-of-the-arts. Combining the result obtained in previous subsections, the efficiency of the proposed algorithm can be highlighted, as CLIA obtains high performance in fair runtime. A pattern can also be noticed that generally the ratios of a certain algorithm increases as the number of objectives increases, demonstrating that the runtime of the proposed algorithm CLIA is less sensitive to the number of objectives than the compared algorithms. G. Stability and Convergence Analyses using IGD Curves This sub-section aims to analyze the convergence patterns of the compared algorithms and demonstrate the stability and of CLIA. In each sub-figures in Fig. 8, the changes in IGD along one independent run of all compared algorithms are plotted real-time. It can be observed that the IGD curves of some algorithms fluctuate violently, showing the states of continuous instability. Besides, some algorithms have unexpected spring-backs in IGD as they proceed, which are not desired characteristics. Compared with the algorithms, the IGD curves of the proposed algorithm have IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X 12 TABLE III S TATISTICS FOR NHV: M EAN , S TD , F RIEDMAN MEAN RANKS AND t- TESTS OF 9 ALGORITHMS AVERAGED USING 20 INDEPENDENT RUNS CLIA f1 f2 f3 f4 f5 f6 f7 f8 f9 f 10 f 11 f 12 f 13 f 14 f 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 5 10 15 Mean 1.26e-2 4.41e-7 1.12e-11 1.96e-1 1.97e-1 2.13e-1 1.00e0 1.00e0 1.00e0 9.03e-2 8.54e-7 4.84e-12 7.98e-1 9.62e-1 9.77e-1 1.29e-1 9.80e-2 9.28e-2 2.58e-1 1.82e-1 4.78e-2 1.25e-1 5.40e-3 2.77e-4 3.21e-1 5.96e-3 4.77e-4 9.76e-1 9.98e-1 9.97e-1 9.95e-1 9.96e-1 9.99e-1 7.17e-1 8.07e-1 6.56e-1 2.73e-1 8.93e-2 5.51e-2 5.52e-1 5.44e-1 5.38e-1 2.87e-2 6.00e-6 1.49e-11 5 10 Rank 15 all Std 8.83e-5 5.84e-9 3.38e-13 9.04e-4 1.67e-2 1.41e-3 1.65e-3 1.29e-3 3.13e-4 3.77e-3 1.22e-7 3.53e-13 3.55e-2 1.56e-2 4.33e-2 3.20e-4 4.96e-4 1.12e-3 5.37e-3 1.75e-2 3.27e-2 5.99e-4 2.20e-3 4.86e-5 3.08e-3 2.28e-4 6.06e-5 3.43e-2 4.33e-4 1.37e-3 5.83e-4 1.96e-3 7.88e-2 2.53e-2 3.17e-2 6.24e-2 7.20e-3 1.03e-2 7.68e-3 7.20e-3 1.03e-2 7.68e-3 9.35e-3 1.07e-8 1.08e-11 7.87 5.90 6.20 6.66 5 10 t-test 15 all AR-MOEA Mean 8.82e-3 7.00e-7 0.00e0 1.67e-1 2.17e-1 1.48e-1 9.99e-1 6.77e-1 4.94e-1 7.13e-2 2.80e-6 3.84e-11 7.75e-1 9.64e-1 9.26e-1 1.29e-1 9.08e-2 7.12e-2 2.37e-1 1.56e-1 5.01e-2 1.16e-1 1.06e-2 6.16e-4 2.97e-1 1.57e-2 1.26e-3 9.98e-1 9.99e-1 9.99e-1 9.96e-1 9.96e-1 9.96e-1 7.13e-1 8.55e-1 8.72e-1 2.53e-1 1.35e-1 9.22e-2 5.30e-1 5.07e-1 6.14e-1 1.96e-2 3.93e-6 3.15e-17 Std 2.27e-4 9.23e-7 0.00e0 2.72e-3 1.91e-3 8.51e-3 1.79e-4 4.57e-1 4.87e-1 5.42e-3 8.52e-7 3.67e-11 1.96e-2 2.12e-3 3.42e-2 2.17e-4 1.34e-2 2.32e-2 1.96e-3 1.00e-2 3.05e-2 9.92e-4 9.07e-5 1.84e-5 4.02e-3 2.95e-4 3.17e-5 7.67e-5 6.14e-4 4.21e-4 4.21e-4 1.27e-3 1.35e-3 2.99e-2 2.08e-2 2.79e-2 4.10e-3 2.93e-3 1.47e-3 3.18e-2 1.45e-1 9.45e-2 3.69e-3 3.00e-6 1.41e-16 NSGA-III Mean 5.31e-3 4.89e-7 6.04e-12 1.55e-1 2.16e-1 1.43e-1 9.94e-1 0.00e0 9.53e-1 6.39e-2 2.05e-4 1.88e-7 7.80e-1 9.68e-1 9.90e-1 1.26e-1 8.24e-2 6.50e-2 2.37e-1 1.77e-1 1.06e-1 9.22e-2 8.81e-3 5.08e-4 1.92e-1 7.21e-3 8.21e-4 9.98e-1 9.83e-1 1.00e0 9.96e-1 9.97e-1 9.94e-1 7.15e-1 8.95e-1 8.53e-1 2.00e-1 1.16e-1 4.03e-2 1.17e-1 4.50e-2 0.00e0 7.07e-6 0.00e0 0.00e0 Std 4.93e-4 4.24e-8 7.08e-13 4.78e-3 1.11e-2 1.71e-2 9.87e-3 0.00e0 1.03e-1 8.46e-3 1.73e-5 6.04e-9 3.19e-4 1.75e-4 1.97e-3 4.30e-4 7.84e-3 1.96e-2 3.48e-3 4.91e-3 4.05e-2 4.90e-3 5.26e-4 2.19e-5 4.63e-2 1.81e-3 1.40e-4 7.50e-5 3.51e-2 8.94e-5 7.86e-4 7.56e-4 4.12e-3 1.35e-2 5.46e-3 9.44e-2 7.12e-3 5.34e-3 2.98e-2 1.55e-1 1.01e-1 0.00e0 1.58e-5 0.00e0 0.00e0 NSGA-II Mean 6.32e-3 0.00e0 0.00e0 1.52e-1 1.87e-1 1.08e-1 8.99e-1 0.00e0 0.00e0 7.86e-2 3.04e-5 0.00e0 6.51e-1 0.00e0 0.00e0 1.29e-1 2.84e-2 8.27e-3 1.91e-1 2.82e-6 9.55e-10 1.06e-1 8.89e-3 5.18e-4 1.63e-1 2.33e-5 3.13e-4 9.65e-1 9.96e-1 1.00e0 9.81e-1 9.97e-1 9.98e-1 5.53e-1 6.22e-1 6.35e-1 2.24e-1 1.21e-1 8.51e-2 1.63e-2 0.00e0 1.62e-2 0.00e0 0.00e0 0.00e0 Std 1.82e-4 0.00e0 0.00e0 2.50e-3 6.78e-3 1.01e-2 6.24e-3 0.00e0 0.00e0 3.53e-3 1.21e-5 0.00e0 1.23e-2 0.00e0 0.00e0 1.38e-4 3.89e-2 1.85e-2 4.73e-3 5.04e-6 2.13e-9 2.35e-3 2.10e-4 1.91e-5 5.41e-2 5.21e-5 8.68e-5 7.22e-3 1.63e-3 1.97e-4 5.32e-3 1.29e-3 5.42e-4 4.23e-2 3.83e-2 2.69e-2 1.09e-2 5.32e-3 1.47e-3 1.82e-2 0.00e0 3.62e-2 0.00e0 0.00e0 0.00e0 IBEA Mean 9.78e-3 4.41e-7 7.04e-12 1.87e-1 2.17e-1 2.17e-1 5.58e-1 8.81e-1 9.55e-1 6.76e-3 2.51e-8 6.07e-14 7.76e-1 9.73e-1 9.96e-1 1.14e-1 9.28e-2 4.46e-2 2.63e-1 1.97e-1 1.62e-1 5.67e-3 6.92e-5 2.62e-7 4.78e-2 8.14e-4 2.40e-5 9.86e-1 9.93e-1 9.96e-1 9.75e-1 9.86e-1 9.91e-1 7.34e-1 8.88e-1 9.12e-1 2.54e-3 2.30e-5 6.33e-9 6.75e-3 8.73e-2 2.00e-2 1.25e-3 2.92e-5 6.13e-16 Std 1.34e-4 3.02e-8 5.21e-13 4.98e-4 4.67e-3 9.26e-4 4.09e-1 5.36e-2 5.27e-2 1.41e-3 5.61e-8 1.36e-13 3.43e-2 3.55e-4 1.51e-4 6.83e-3 1.81e-3 4.09e-2 8.51e-3 5.82e-3 1.19e-2 6.72e-4 1.30e-5 5.87e-7 2.96e-3 1.21e-4 1.46e-5 3.31e-3 9.08e-4 1.09e-3 6.24e-3 2.81e-3 2.01e-3 1.13e-2 3.49e-3 8.22e-3 6.69e-4 4.91e-5 1.42e-8 1.51e-2 1.23e-1 3.20e-2 7.21e-4 2.92e-5 6.07e-16 GrEA Mean 9.94e-3 6.22e-7 0.00e0 1.95e-1 2.43e-1 2.15e-1 3.77e-1 0.00e0 0.00e0 1.19e-1 4.56e-4 5.63e-7 7.71e-1 9.70e-1 9.93e-1 1.18e-1 1.99e-2 2.50e-3 2.59e-1 2.18e-1 1.88e-1 1.11e-1 9.78e-3 5.61e-4 3.83e-2 2.62e-3 7.18e-5 9.71e-1 9.85e-1 9.93e-1 9.71e-1 9.80e-1 9.73e-1 7.48e-1 9.00e-1 9.19e-1 1.53e-1 6.99e-2 3.93e-4 3.05e-1 8.09e-2 5.72e-2 1.04e-3 3.00e-5 1.07e-15 KnEA Std 1.13e-4 4.82e-7 0.00e0 1.20e-3 1.03e-3 1.78e-3 3.07e-1 0.00e0 0.00e0 1.47e-3 2.73e-5 2.96e-7 4.28e-2 2.45e-4 1.05e-4 2.97e-4 3.02e-2 5.58e-3 2.34e-3 2.26e-3 8.40e-4 2.46e-3 9.92e-5 1.68e-5 2.68e-2 3.53e-4 6.74e-5 8.63e-3 4.62e-3 1.38e-3 2.77e-3 3.93e-3 4.09e-3 3.08e-3 2.00e-3 3.36e-3 8.40e-2 4.68e-2 3.35e-4 2.56e-1 1.03e-1 1.28e-1 1.43e-3 3.41e-5 3.92e-16 Mean 1.06e-2 4.11e-7 0.00e0 1.89e-1 1.69e-1 1.10e-1 9.68e-1 0.00e0 0.00e0 1.08e-1 1.16e-4 6.83e-9 7.75e-1 9.54e-1 9.94e-1 1.28e-1 0.00e0 0.00e0 2.56e-1 8.57e-2 5.37e-6 1.02e-1 1.01e-2 6.24e-4 1.29e-1 3.88e-4 8.93e-4 9.88e-1 9.98e-1 9.98e-1 9.91e-1 9.94e-1 9.94e-1 7.49e-1 9.13e-1 9.35e-1 2.06e-1 1.12e-1 8.39e-2 4.23e-1 0.00e0 0.00e0 2.84e-8 0.00e0 0.00e0 Std 9.42e-5 1.28e-7 0.00e0 1.56e-3 3.56e-3 1.89e-2 2.99e-2 0.00e0 0.00e0 4.80e-3 2.59e-5 1.26e-8 2.56e-3 6.58e-3 9.25e-5 5.83e-4 0.00e0 0.00e0 3.46e-3 2.77e-2 1.20e-5 1.60e-2 2.62e-4 2.95e-5 7.49e-2 8.67e-4 3.92e-4 8.96e-4 6.40e-4 5.95e-4 9.90e-4 6.66e-4 3.53e-4 4.98e-3 2.41e-3 8.89e-3 2.16e-2 7.31e-3 2.30e-3 9.84e-2 0.00e0 0.00e0 6.35e-8 0.00e0 0.00e0 MOEA/D Mean 5.58e-3 3.51e-8 9.16e-14 1.62e-1 2.09e-1 1.81e-1 9.84e-1 9.67e-1 9.67e-1 1.66e-2 3.17e-8 9.87e-14 4.41e-1 4.33e-1 3.10e-1 1.23e-1 8.54e-2 4.00e-2 8.19e-3 3.17e-4 6.19e-8 1.04e-1 6.52e-3 3.17e-4 2.85e-1 1.12e-2 6.14e-4 9.40e-1 5.39e-1 5.87e-1 9.53e-1 9.37e-1 9.42e-1 6.05e-1 3.35e-1 2.69e-1 2.31e-1 5.49e-2 3.48e-2 1.87e-1 7.54e-1 1.71e-1 3.86e-2 2.92e-6 2.19e-10 Std 4.39e-4 1.76e-10 2.81e-15 7.23e-4 3.30e-4 9.92e-4 1.93e-3 1.53e-3 7.17e-4 5.49e-3 9.70e-9 9.08e-15 1.14e-1 1.41e-2 5.50e-2 2.38e-3 3.25e-2 4.99e-2 2.76e-3 3.88e-4 8.95e-8 9.08e-4 9.68e-5 5.15e-6 3.35e-3 6.28e-3 3.43e-4 1.35e-2 1.10e-1 1.82e-1 3.29e-3 2.82e-3 8.84e-4 1.93e-2 1.27e-1 7.77e-2 1.21e-2 3.62e-2 2.48e-2 2.13e-1 3.73e-1 1.20e-1 4.90e-3 1.29e-6 2.08e-10 RVEA Mean 2.29e-3 4.95e-9 3.23e-14 1.52e-1 1.86e-1 5.30e-2 9.96e-1 9.99e-1 9.97e-1 9.35e-3 6.23e-8 2.18e-13 7.61e-1 9.54e-1 9.44e-1 1.14e-1 8.97e-2 9.20e-2 2.15e-1 1.50e-1 1.10e-1 7.65e-2 4.97e-3 1.57e-4 1.69e-1 4.25e-3 2.52e-4 9.96e-1 9.97e-1 9.99e-1 9.89e-1 9.88e-1 9.72e-1 7.40e-1 8.89e-1 8.36e-1 1.53e-1 7.91e-2 5.64e-2 2.05e-1 6.65e-1 3.90e-1 2.34e-2 1.81e-6 1.85e-13 Std 6.22e-4 3.41e-9 2.04e-14 3.41e-3 4.67e-3 2.11e-2 1.49e-3 1.02e-3 4.37e-3 6.57e-3 2.49e-8 1.19e-13 4.10e-2 1.96e-3 1.10e-2 1.09e-3 5.66e-3 9.11e-4 2.99e-4 1.42e-2 5.55e-2 4.23e-3 6.55e-4 4.12e-5 3.12e-2 1.59e-3 7.47e-5 1.99e-3 5.29e-4 4.89e-4 1.39e-3 3.21e-3 5.67e-3 4.57e-3 9.90e-3 3.39e-2 1.54e-2 2.21e-2 8.96e-3 1.97e-1 7.15e-2 1.97e-1 4.54e-3 1.21e-6 1.07e-13 6.60 6.87 6.07 6.51 4.83 5.47 5.37 5.22 3.50 3.43 3.60 3.51 3.77 5.00 4.87 4.54 4.90 5.83 4.97 3.23 5.67 4.20 4.90 4.96 3.80 3.80 4.07 3.89 3.97 4.50 4.97 4.48 1/3/11 7/4/4 7/2/6 15/12/18 1/2/12 7/1/7 6/3/6 17/7/21 0/1/14 3/2/10 3/1/11 7/4/34 2/2/11 5/1/9 4/2/9 9/5/31 2/3/10 6/3/6 5/2/8 12/7/26 3/1/11 4/2/9 6/2/7 13/7/25 1/0/14 3/1/11 3/0/12 8/0/37 1/1/13 2/1/12 3/1/11 7/5/33 TABLE IV R UNTIME AVERAGED FROM 20 INDEPENDENT RUNS OF ALL COMPARED ALGORITHMS CLIA Objectives M5/Min M10/Min M15/Min All/H ARMOEA NSGA-III NSGA-II IBEA GrEA KnEA MOEAD RVEA Time Time Ratio Time Ratio Time Ratio Time Ratio Time Ratio Time Ratio Time Ratio Time Ratio 11.25 39.95 3.55x 4.28 0.38x 2.15 0.19x 18.49 1.64x 20.59 1.83x 5.74 0.51x 36.73 3.26x 2.35 0.21x 12.23 288.67 23.60x 8.45 0.69x 4.97 0.41x 58.45 4.78x 99.03 8.10x 20.81 1.70x 77.98 6.38x 4.49 0.37x 20.60 507.74 24.65x 14.81 0.72x 11.16 0.54x 157.10 7.63x 292.66 14.21x 47.01 2.28x 137.39 6.67x 4.99 0.24x 0.73 13.94 18.97x 0.46 0.62x 0.30 0.41x 3.90 5.31x 6.87 9.35x 1.23 1.67x 4.20 5.72x 0.20 0.27x shown relatively fast convergence and relatively stable trend, which could in a way show its stability. V. C ONCLUSION To address the problems in the existing MOEAs for MaOPs, this paper proposes a Pareto dominance relation and decomposition based interactive MOEA (CLIA) with the mechanisms of cascade clustering and reference IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X CLIA ARMOEA NSGA-III NSGA-II GrEA KnEA MOEAD M5 RVEA IBEA 13 CLIA ARMOEA NSGA-III NSGA-II GrEA KnEA MOEAD M5 RVEA IBEA full PF M10 full PF M10 partial PF M15 partial PF M15 large-scale large-scale (a) IGD (b) NHV Fig. 7. The radar diagrams for the specified performance on each category of benchmark functions using the metrics of IGD and NHV respectively 101 101 Proposed Algorithm AR-MOEA GrEA IBEA KnEA MOEA/D NSGA-II NSGA-III RVEA 100 101 Proposed Algorithm AR-MOEA GrEA IBEA KnEA MOEA/D NSGA-II NSGA-III RVEA Proposed Algorithm AR-MOEA GrEA IBEA KnEA MOEA/D NSGA-II NSGA-III RVEA 100 100 10-1 10-1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 (a) f 8 , M = 5 0.3 0.4 0.5 0.6 0.7 0.8 0.9 101 Proposed Algorithm AR-MOEA GrEA IBEA KnEA MOEA/D NSGA-II NSGA-III RVEA Proposed Algorithm AR-MOEA GrEA IBEA KnEA MOEA/D NSGA-II NSGA-III RVEA 108 0.2 0.3 0.4 0.5 0.6 0.2 0.7 0.8 0.9 106 1 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Proposed Algorithm AR-MOEA GrEA IBEA KnEA MOEA/D NSGA-II NSGA-III RVEA 108 106 104 102 102 100 100 100 0.1 0.1 (c) f 14 , M = 5 104 0 0 1 (b) f 9 , M = 5 0 0.1 0.2 (d) f 15 , M = 5 0.3 0.4 0.5 0.6 (e) f 3 , M = 10 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 (f) f 3 , M = 15 Fig. 8. IGD curves of all compared algorithms for six test cases point incremental learning. In CLIA, a cascade clustering mechanism functions as the selection operator, ensuring the proximity and diversity of the population using the reference lines provided by the learning process. To provide the clustering process with properly distributed reference lines, CLIA is also integrated with the reference point incremental learning process, where the proper generation of reference points are gradually estimated using the feedbacks from the clustering process. In characteristic studies, analyses have shown that the covering of the true PF by the population is relatively satisfactory. Comparative experimental results with the state-of-theart algorithms also show that CLIA obtains competitive results on the CEC’2018 many-objective benchmark func- IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X tions. Moreover, we have compared, analyzed and discussed that the proposed algorithm CLIA has relatively high efficiency and stable convergence patterns. It can be concluded that the proposed algorithm CLIA is effective, efficient and stable in dealing with the MaOPs and in addressing some of the existing problems in MOEAs. A CKNOWLEDGMENT The authors are thankful to the creators of the MATLAB platform PlatEMO for bringing the convenience to researchers’ experiments. The authors are grateful to the support of the National Natural Science Foundation of China (61572104, 61103146, 61425002, 61751203) , the Fundamental Research Funds for the Central Universities (DUT17JC04), and the Project of the Key Laboratory of Symbolic Computation and Knowledge Engineering of Ministry of Education, Jilin University (93K172017K03). R EFERENCES [1] H. Louafi, S. Coulombe, and M. Cheriet, “Multi-objective optimization in dynamic content adaptation of slide documents,” IEEE Transactions on Services Computing, vol. 10, no. 2, pp. 231– 243, 2017. [2] L. Li, L. Jiao, J. Zhao, R. Shang, and M. Gong, “Quantum-behaved discrete multi-objective particle swarm optimization for complex network clustering,” Pattern Recognition, vol. 63, pp. 1 – 14, 2017. [3] A. C. Ferreira, M. L. Nunes, J. C. Teixeira, L. A. Martins, S. F. Teixeira, and S. A. Nebra, “Design of a solar dish stirling cogeneration system: Application of a multi-objective optimization approach,” Applied Thermal Engineering, vol. 123, pp. 646 – 657, 2017. [4] A. Zhou, B.-Y. Qu, H. Li, S.-Z. Zhao, P. N. Suganthan, and Q. Zhang, “Multiobjective evolutionary algorithms: A survey of the state of the art,” Swarm and Evolutionary Computation, vol. 1, no. 1, pp. 32 – 49, 2011. [5] M. Li, S. Yang, and X. Liu, “Bi-goal evolution for many-objective optimization problems,” Artificial Intelligence, vol. 228, no. Supplement C, pp. 45 – 65, 2015. [6] K. Deb, A. Pratap, S. Agarwal, and T. Meyarivan, “A fast and elitist multiobjective genetic algorithm: NSGA-II,” IEEE Transactions on Evolutionary Computation, vol. 6, no. 2, pp. 182–197, 2002. [7] M. Kim, T. Hiroyasu, M. Miki, and S. Watanabe, SPEA2+: Improving the Performance of the Strength Pareto Evolutionary Algorithm 2. Berlin, Heidelberg: Springer Berlin Heidelberg, 2004, pp. 742–751. [8] D. W. Corne, N. R. Jerram, J. D. Knowles, and M. J. Oates, “PESA-II: Region-based selection in evolutionary multiobjective optimization,” in Proceedings of the 3rd Annual Conference on Genetic and Evolutionary Computation, 2001, pp. 283–290. [9] R. C. Purshouse and P. J. Fleming, “On the evolutionary optimization of many conflicting objectives,” IEEE Transactions on Evolutionary Computation, vol. 11, no. 6, pp. 770–784, 2007. [10] H. Wang, Y. Jin, and X. Yao, “Diversity assessment in manyobjective optimization,” IEEE Transactions on Cybernetics, vol. 47, no. 6, pp. 1510–1522, 2017. [11] K. Bringmann, T. Friedrich, C. Igel, and T. VoB, “Speeding up many-objective optimization by monte carlo approximations,” Artificial Intelligence, vol. 204, pp. 22 – 29, 2013. [12] X. Zhang, Y. Tian, and Y. Jin, “A knee point-driven evolutionary algorithm for many-objective optimization,” IEEE Transactions on Evolutionary Computation, vol. 19, no. 6, pp. 761–776, 2015. [13] W. Hu, G. G. Yen, and G. Luo, “Many-objective particle swarm optimization using two-stage strategy and parallel cell coordinate system,” IEEE Transactions on Cybernetics, vol. 47, no. 6, pp. 1446– 1459, 2017. [14] D. Brockhoff, T. Friedrich, N. Hebbinghaus, C. Klein, F. Neumann, and E. Zitzler, “On the effects of adding objectives to plateau functions,” IEEE Transactions on Evolutionary Computation, vol. 13, no. 3, pp. 591–603, 2009. 14 [15] Y. N. Kou, J. H. Zheng, Z. Li, and Q. H. Wu, “Many-objective optimization for coordinated operation of integrated electricity and gas network,” Journal of Modern Power Systems and Clean Energy, vol. 5, no. 3, pp. 350–363, 2017. [16] B. D. Raja, R. Jhala, and V. Patel, “Many-objective optimization of cross-flow plate-fin heat exchanger,” International Journal of Thermal Sciences, vol. 118, pp. 320 – 339, 2017. [17] R. Cheng, T. Rodemann, M. Fischer, M. Olhofer, and Y. Jin, “Evolutionary many-objective optimization of hybrid electric vehicle control: From general optimization to preference articulation,” IEEE Transactions on Emerging Topics in Computational Intelligence, vol. 1, no. 2, pp. 97–111, 2017. [18] D. Hadka and P. Reed, “Diagnostic assessment of search controls and failure modes in many-objective evolutionary optimization,” Evolutionary Computation, vol. 20, no. 3, pp. 423–452, 2012. [19] ——, “Borg: An auto-adaptive many-objective evolutionary computing framework,” Evolutionary Computation, vol. 21, no. 2, pp. 231–259, 2013. [20] O. Teytaud, “On the hardness of offline multi-objective optimization,” Evolutionary Computation, vol. 15, no. 4, pp. 475–491, 2007. [21] X. Zou, Y. Chen, M. Liu, and L. Kang, “A new evolutionary algorithm for solving many-objective optimization problems,” IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), vol. 38, no. 5, pp. 1402–1412, 2008. [22] K. Deb, M. Mohan, and S. Mishra, “Evaluating the ǫ-domination based multi-objective evolutionary algorithm for a quick computation of pareto-optimal solutions,” Evolutionary Computation, vol. 13, no. 4, pp. 501–525, 2005. [23] C. Dai, Y. Wang, and L. Hu, “An improved α-dominance strategy for many-objective optimization problems,” Soft Computation, vol. 20, no. 3, pp. 1105–1111, 2016. [24] Y. Yuan, H. Xu, and B. Wang, “An improved NSGA-III procedure for evolutionary many-objective optimization,” in Proceedings of the 2014 Annual Conference on Genetic and Evolutionary Computation, 2014, pp. 661–668. [25] N. Kowatari, A. Oyama, H. E. Aguirre, and K. Tanaka, A Study on Large Population MOEA Using Adaptive ǫ-Box Dominance and Neighborhood Recombination for Many-Objective Optimization. Berlin, Heidelberg: Springer Berlin Heidelberg, 2012, pp. 86–100. [26] H. Sato, H. E. Aguirre, and K. Tanaka, Controlling Dominance Area of Solutions and Its Impact on the Performance of MOEAs. Berlin, Heidelberg: Springer Berlin Heidelberg, 2007, pp. 5–20. [27] M. Farina and P. Amato, “A fuzzy definition of ”optimality” for many-criteria optimization problems,” IEEE Transactions on Systems, Man, and Cybernetics - Part A: Systems and Humans, vol. 34, no. 3, pp. 315–326, 2004. [28] M. Li, S. Yang, X. Liu, and R. Shen, A Comparative Study on Evolutionary Algorithms for Many-Objective Optimization. Berlin, Heidelberg: Springer Berlin Heidelberg, 2013, pp. 261–275. [29] M. Li, J. Zheng, K. Li, Q. Yuan, and R. Shen, Enhancing Diversity for Average Ranking Method in Evolutionary Many-Objective Optimization. Berlin, Heidelberg: Springer Berlin Heidelberg, 2010, pp. 647–656. [30] Z. He and G. G. Yen, “A new fitness evaluation method based on fuzzy logic in multiobjective evolutionary algorithms,” in 2012 IEEE Congress on Evolutionary Computation, June 2012, pp. 1–8. [31] Z. He, G. G. Yen, and J. Zhang, “Fuzzy-based pareto optimality for many-objective evolutionary algorithms,” IEEE Transactions on Evolutionary Computation, vol. 18, no. 2, pp. 269–285, 2014. [32] R. Wang, R. C. Purshouse, and P. J. Fleming, “On finding well-spread pareto optimal solutions by preference-inspired coevolutionary algorithm,” in Proceedings of the 15th Annual Conference on Genetic and Evolutionary Computation, 2013, pp. 695–702. [33] ——, “Preference-inspired coevolutionary algorithms for manyobjective optimization,” IEEE Transactions on Evolutionary Computation, vol. 17, no. 4, pp. 474–494, 2013. [34] F. di Pierro, S. T. Khu, and D. A. Savic, “An investigation on preference order ranking scheme for multiobjective evolutionary optimization,” IEEE Transactions on Evolutionary Computation, vol. 11, no. 1, pp. 17–45, 2007. [35] S. Yang, M. Li, X. Liu, and J. Zheng, “A grid-based evolutionary algorithm for many-objective optimization,” IEEE Transactions on Evolutionary Computation, vol. 17, no. 5, pp. 721–736, 2013. [36] U. K. Wickramasinghe and X. Li, “Using a distance metric to guide PSO algorithms for many-objective optimization,” in Proceedings of the 11th Annual Conference on Genetic and Evolutionary Computation, 2009, pp. 667–674. IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. XX, NO. XX, XXXXXX 201X [37] M. Garza-Fabre, G. Toscano-Pulido, and C. A. C. Coello, “Two novel approaches for many-objective optimization,” in IEEE Congress on Evolutionary Computation, July 2010, pp. 1–8. [38] S. Kukkonen and J. Lampinen, “Ranking-dominance and manyobjective optimization,” in 2007 IEEE Congress on Evolutionary Computation, Sept 2007, pp. 3983–3990. [39] S. F. Adra and P. J. Fleming, “Diversity management in evolutionary many-objective optimization,” IEEE Transactions on Evolutionary Computation, vol. 15, no. 2, pp. 183–195, 2011. [40] M. Li, S. Yang, and X. Liu, “Diversity comparison of pareto front approximations in many-objective optimization,” IEEE Transactions on Cybernetics, vol. 44, no. 12, pp. 2568–2584, 2014. [41] L. Cai, S. Qu, Y. Yuan, and X. Yao, “A clustering-ranking method for many-objective optimization,” Applied Soft Computing, vol. 35, pp. 681 – 694, 2015. [42] H. K. Singh, A. Isaacs, and T. Ray, “A pareto corner search evolutionary algorithm and dimensionality reduction in manyobjective optimization problems,” IEEE Transactions on Evolutionary Computation, vol. 15, no. 4, pp. 539–556, 2011. [43] E. Zitzler and S. Künzli, Indicator-Based Selection in Multiobjective Search. Springer Berlin Heidelberg, 2004, pp. 832–842. [44] N. Beume, B. Naujoks, and M. Emmerich, “SMS-EMOA: Multiobjective selection based on dominated hypervolume,” European Journal of Operational Research, vol. 181, no. 3, pp. 1653 – 1669, 2007. [45] S. Rostami and F. Neri, “A fast hypervolume driven selection mechanism for many-objective optimisation problems,” Swarm and Evolutionary Computation, vol. 34, pp. 50 – 67, 2017. [46] K. Bringmann and T. Friedrich, “An efficient algorithm for computing hypervolume contributions,” Evolutionary Computation, vol. 18, no. 3, pp. 383–402, 2010. [47] S. Jiang, J. Zhang, Y. S. Ong, A. N. Zhang, and P. S. Tan, “A simple and fast hypervolume indicator-based multiobjective evolutionary algorithm,” IEEE Transactions on Cybernetics, vol. 45, no. 10, pp. 2202–2213, 2015. [48] O. Schutze, X. Esquivel, A. Lara, and C. A. C. Coello, “Using the averaged hausdorff distance as a performance measure in evolutionary multiobjective optimization,” IEEE Transactions on Evolutionary Computation, vol. 16, no. 4, pp. 504–522, 2012. [49] R. Hernández Gómez and C. A. Coello Coello, “Improved metaheuristic based on the R2 indicator for many-objective optimization,” in Proceedings of the 2015 Annual Conference on Genetic and Evolutionary Computation, 2015, pp. 679–686. [50] H. Trautmann, T. Wagner, and D. Brockhoff, R2-EMOA: Focused Multiobjective Search Using R2-Indicator-Based Selection. Berlin, Heidelberg: Springer Berlin Heidelberg, 2013, pp. 70–74. [51] Y. Tian, R. Cheng, X. Zhang, F. Cheng, and Y. Jin, “An indicator based multi-objective evolutionary algorithm with reference point adaptation for better versatility,” IEEE Transactions on Evolutionary Computation, vol. PP, no. 99, pp. 1–1, 2017. [52] K. Bringmann and T. Friedrich, “Approximating the volume of unions and intersections of high-dimensional geometric objects,” Computational Geometry, vol. 43, no. 6, pp. 601 – 610, 2010. [53] Y. Sun, G. G. Yen, and Z. Yi, “IGD indicator-based evolutionary algorithm for many-objective optimization problems,” IEEE Transactions on Evolutionary Computation, vol. PP, no. 99, pp. 1–1, 2018. [54] J. Bader and E. Zitzler, “HypE: An algorithm for fast hypervolume-based many-objective optimization,” Evolutionary Computation, vol. 19, no. 1, pp. 45–76, 2011. [55] K. Deb and H. Jain, “An evolutionary many-objective optimization algorithm using reference-point-based nondominated sorting approach, part I: Solving problems with box constraints,” IEEE Transactions on Evolutionary Computation, vol. 18, no. 4, pp. 577– 601, 2014. [56] Q. Zhang and H. Li, “MOEA/D: A multiobjective evolutionary algorithm based on decomposition,” IEEE Transactions on Evolutionary Computation, vol. 11, no. 6, pp. 712–731, 2007. [57] S. Jiang, S. Yang, Y. Wang, and X. Liu, “Scalarizing functions in decomposition-based multiobjective evolutionary algorithms,” IEEE Transactions on Evolutionary Computation, vol. PP, no. 99, pp. 1–1, 2017. [58] R. Cheng, Y. Jin, M. Olhofer, and B. Sendhoff, “A reference vector guided evolutionary algorithm for many-objective optimization,” IEEE Transactions on Evolutionary Computation, vol. 20, no. 5, pp. 773–791, 2016. 15 [59] Y. Qi, X. Ma, F. Liu, L. Jiao, J. Sun, and J. Wu, “MOEA/D with adaptive weight adjustment,” Evolutionary Computation, vol. 22, no. 2, pp. 231–264, 2014. [60] H. Jain and K. Deb, “An evolutionary many-objective optimization algorithm using reference-point based nondominated sorting approach, part II: Handling constraints and extending to an adaptive approach,” IEEE Transactions on Evolutionary Computation, vol. 18, no. 4, pp. 602–622, 2014. [61] F.-A. Fortin, S. Grenier, and M. Parizeau, “Generalizing the improved run-time complexity algorithm for non-dominated sorting,” in Proceedings of the 15th Annual Conference on Genetic and Evolutionary Computation, 2013, pp. 615–622. [62] J. C. Platt, “Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods,” in Advances in Large Margin Classifiers. MIT Press, 1999, pp. 61–74. [63] R. Cheng, M. Li, Y. Tian, X. Xiang, X. Zhang, S. Yang, Y. Jin, and X. Yao, “Benchmark functions for CEC’2018 competition on manyobjective optimization,” CERCIA, School of Computer Science, University of Birmingham Edgbaston, Birmingham B15 2TT, U.K., School of Computer Science and Technology, Anhui University Hefei 230039, China, School of Computer Science and Informatics, De Montfort University Leicester, LE1 9BH, U.K., Department of Computer Science, University of Surrey Guildford, Surrey, GU2 7XH, U.K., Tech. Rep., 2017. [64] E. Cheney and D. Kincaid, The Gram-Schmidt Process. Jones and Bartlett Learning, 2008, pp. 544–550. [65] Y. Tian, R. Cheng, X. Zhang, and Y. Jin, “PlatEMO: A MATLAB platform for evolutionary multi-objective optimization [educational forum],” IEEE Computational Intelligence Magazine, vol. 12, no. 4, pp. 73–87, 2017. [66] C. P. Diehl and G. Cauwenberghs, “SVM incremental learning, adaptation and optimization,” in Proceedings of the International Joint Conference on Neural Networks, vol. 4, July 2003, pp. 2685– 2690. [67] P. Czyzżak and A. Jaszkiewicz, “Pareto simulated annealing: A metaheuristic technique for multiple-objective combinatorial optimization,” Journal of Multi-Criteria Decision Analysis, vol. 7, no. 1, pp. 34–47, 1998. [68] C. A. Coello Coello and M. Reyes Sierra, A Study of the Parallelization of a Coevolutionary Multi-objective Evolutionary Algorithm. Springer Berlin Heidelberg, 2004, pp. 688–697. [69] M. Reyes-Sierra and C. Coello, “A new multi-objective particle swarm optimizer with improved selection and diversity mechanisms,” Technical Report EVOCINV-05-2004, Sección de Computación, Depto. de Ingenierı́a Eléctrica, CINVESTAV-IPN, México, Tech. Rep., 2004. [70] E. Zitzler and L. Thiele, “Multiobjective evolutionary algorithms: A comparative case study and the strength pareto approach,” IEEE Transactions on Evolutionary Computation, vol. 3, no. 4, pp. 257–271, 1999.
2cs.AI
Unbounded Software Model Checking with Incremental SAT-Solving ? arXiv:1802.04174v1 [cs.SC] 12 Feb 2018 Marko Kleine Büning, Tomas Balyo, Carsten Sinz Karlsruhe Institute of Technology (KIT), Germany [email protected] {tomas.balyo,carsten.sinz}@kit.edu Abstract. This paper describes a novel unbounded software model checking approach to find errors in programs written in the C language based on incremental SAT-solving. Instead of using the traditional assumption based API to incremental SAT solvers we use the DimSpec format that is used in SAT based automated planning. A DimSpec formula consists of four CNF formulas representing the initial, goal and intermediate states and the relations between each pair of neighboring states of a transition system. We present a new tool called LLUMC which encodes the presence of certain errors in a C program into a DimSpec formula, which can be solved by either an incremental SAT-based DimSpec solver or the IC3 algorithm for invariant checking. We evaluate the approach in the context of SAT-based model checking for both the incremental SAT-solving and the IC3 algorithm. We show that our encoding expands the functionality of bounded model checkers by also covering large and infinite loops, while still maintaining a feasible time performance. Furthermore, we demonstrate that our approach offers the opportunity to generate runtime-optimizations by utilizing parallel SAT-solving. 1 Introduction Software has become an important part of almost all modern technical devices, such as cars, airplanes, household appliances, therapy machines, and many more. The cars of tomorrow will drive on their own but will be controlled by software. As shown by serious accidents like the rocket crash of Ariane flight 501 [25], the massive overdoses of radiation generated by the therapy machine Therac25 [24] or the car crash of the Toyota Camry in 2005 [23] software is never perfect, it almost always contains errors and bugs. While testing of software can only cover a limited number of program executions, software verification can guarantee a much higher coverage while producing proofs for the existence or absence of errors. There exist several different software verification approaches, as for instance symbolic execution [21] and bounded model checking [13]. Bounded model checking inlines function calls and unrolls loops a finite number of times, say k-times, where k is called the bound of the program. This unrolling ? This work was supported by Baden-Württemberg Stiftung project HIVES reduces the complexity of the problem to a feasible level, though it limits the coverage and precision of these approaches. By means of extending the functionality of bounded model checkers, we developed a novel unbounded model checking approach. To this end, we removed the bound that limits all bounded model checkers and created a transition system that is traversed by an incremental SAT-solver or an invariant checking algorithm. We focus on sequential programs written in C and use the low-level code representation of the compiler framework LLVM as an intermediate language. Based on this representation we derived an encoding of the program verification task into a DimSpec formula. A DimSpec formula uses four CNF formulas to specify a transition system and is often used in SAT based automated planning. We first encode the program into an SMT formula and, subsequently, we generate the SAT-problem in DimSpec format. The resulting DimSpec formula is then solved by either an incremental SAT-solver that unrolls the transition system to find a transition path to the error state or an invariant checking algorithm that refines an over-approximation of a transition path to the error state. Our verification system uses Clang and LLVM version 3.7.1 to compile Ccode into the LLVM intermediate language. Then our new tool LLUMC (LowLevel-Unbounded-Model-Checker) generates DimSpec formulas representing the presence of certain errors in the program. To solve the generated formulas [18] we either use the incremental SAT-solver IncPlan [7] or the invariant checking algorithm implemented in the solver MinireachIC3 [8]. LLUMC was inspired by the bounded model checker LLBMC [27] but runs independently. Our evaluation is based on the Software Verification Competition (SV-Comp) and shows the correctness and feasibility of our approach. LLUMC is available online at [3]. 2 Preliminaries We assume the reader is familiar with propositional logic, first-order-logic and SAT and use definitions and notations standard in SAT. This section will introduce incremental SAT-solving and describe the theory of bit-vectors in the context of SMT-solving. Furthermore, the software bounded model checking approach is briefly described. Incremental SAT-Solving In the assumption based interface [16], two methods are used: add(C) and solve(A), where C is a clause and A a set of literals called assumptions. All clauses can be added with the add method and their conjunction can then be solved under the condition that all literals in A are true by solve(A). To add a removable clause C, we add (C ∨ a), where a is an unused variable. The clause is only relevant, if we add the literal ¬a (called activation literal) to the assumptions A. If the activation literal is not added to the assumptions C is essentially removed from the set clauses. DimSpec Formulas A DimSpec formula represents a transition system with states t0 , t1 , . . . , tk , where each state is a full truth assignment on n Boolean variables x1 , . . . , xn . It consists of four CNF formulas: I, U, G and T , where I 2 are the initial clauses, i.e., clauses satisfied by t0 , G are goal clauses satisfied by final state tk , the U clauses are satisfied by each individual state ti and finally the transitional clauses T are satisfied by each pair of consecutive states ti , ti+1 . The clause sets I, U, G contain the variables x1 , . . . , xn and T contains x1 , . . . , x2n . Testing whether the goal state is reachable from the initial state within k steps is equivalent to checking whether the following formula Fk is satisfiable. ! k−1 ^  Fk = I(0) ∧ U(i) ∧ T (i, i + 1) ∧ U(k) ∧ G(k) , i=0 where I(i), G(i), U(i) and T (i, i + 1) denote the respective formulas where each variable xj is replaced by xj+i∗n . One way to find the smallest number of steps to reach the goal state from initial state is to solve F1 , F2 , . . . until a satisfiable formula is reached. An efficient way to implement this is to use an incremental SAT solver with the assumption based interface via the following steps. step(0) : add(I(0) ∧ (a0 ∨ G(0)) ∧ U(0)) solve(assumptions = {¬a0 }) step(k) : add(T (k − 1, k) ∧ (ak ∨ G(k)) ∧ U(k)) solve(assumptions = {¬ak }) . This algorithm works only if the goal state is reachable from the initial state, otherwise it does not terminate. A more sophisticated approach that can detect unreachability is described next. IC3 algorithm A different approach to solve a transition system reachability is described in [14] and implemented in the tool IC3 (Incremental Construction of Inductive Clauses for Indubitable Correctness). Given a transition system S and a safety property P the algorithm can prove that P is S − invariant, meaning that regarding S the property P is true in all reachable states or produces a counterexample. IC3 incrementally refines a sequence of formulas F0 , F1 , ..., Fk that are over-approximations of the set of states reachable in at most k steps. It can extend the formula sequence in major steps that increase k by one. In minor steps the algorithm refines the approximations Fi with 0 ≤ i ≤ k by conjoining clauses to F0 , . . . , Fj with 0 ≤ j ≤ k. Given a finite transition system S and a safety property P , the IC3 algorithm terminates and returns true, iff P is true in all reachable states of S [14]. The IC3 algorithm was implemented and adjusted1 to the DimSpec format in the tool MinireachIC3 by Suda [8]. Satisfiability Modulo Theories (SMT) Due to quantifiers, first-order-logic is generally undecidable but there are numerous decidable subsets. The problem of solving those subsets or theories is called satisfiability modulo theories or SMT. There is a lot of research on various theories, there are for example the 1 The clause sets I, U, T represent the transition system S and G represents the negation of the invariant property P . 3 theory of arrays, bit-vectors, floating points, heaps, linear arithmetic and many more. These theories can be seen as restrictions on possible models of firstorder-logic formulas [26]. In this paper, we will restrict ourselves to the theory of bit-vectors. SMT was standardized by the SMT-LIB initiative [9]. We will use the same notations, especially when referring to SMT functions defined in the different theories. Such an SMT-LIB function could for example be bvadd(b1 , b2 ), describing the addition of two bit-vectors b1 and b2 . A more complex function is called if-then-else (ite) and is defined by: ∀c, x, y, z (x = ite(c, y, z) ⇔ c ∧ x = y ∨ ¬c ∧ x = z) . (1) We refer to the theory of fixed-size bit-vectors defined by the SMT-LIB standard in [9]. The theory of bit-vectors models finite bit-vectors of length n and operations on these vectors into first-order-logic. The set of function symbols contain standard operations on bit-vectors as for example the addition, multiplication, unsigned division, bit-wise and, bit-wise or, bit-wise exclusive or, left shift, right shift, concatenation, and extraction of bit-vectors. Software Bounded Model Checking The general idea of bounded model checking (BMC) is to encode the states of a system and the transition between them. Furthermore, you unroll any loop and function calls k-times. The number k is called the bound and is the reason for the decidability of bounded model checking but also for its limitations. After the unrolling and encoding of the program, a formula that represents the negation of a desired property is added and the formula is solved with a SMT or SAT-solver. If the solver finds a model for the formula, the approach has found an error and the model can be used as a counterexample. The loop-bound can be increased step by step until a fixed bound k is reached. Thus, the counterexample is always minimal and easier to comprehend for a user. The question to which bound the loop should be unrolled is complex and further discussed for example by Biere et al. [13]. Bounded model checking is implemented for example in the tool LLBMC (Low-Level-Bounded-Model-Checker). It was developed at the research group "Verification meets Algorithm Engineering" at the KIT with the aim to verify safety-critical embedded systems [26]. To support large parts of the C and C++ languages it uses the compiler framework LLVM as it’s foundation. With it’s algorithm LLBMC is able to create very positive results and earned a number of gold, silver and bronze medals in the Software Verification Competition (SVComp), which we will describe and refer to in our evaluation in Section 4. We will use LLBMC as a state-of-the-art reference to compare it to our approach. LLVM Representation LLVM is an open source compiler framework project that consist of a "collection of modular and reusable compiler and tool-chain technologies" [1]. It supports compilation for a wide range of languages and is known for its research friendliness and good documentation. To work directly on C-code is very complex and it is nearly impossible to support all features and 4 libraries. Thus, we use the intermediate language of LLVM, which describes the statements more directly and provides a number of optimizations and simplifications. We define a LLVM-module bottom up. The smallest executable unit is called an instruction. An instruction is an atomic unit of execution that performs a single operation. A basic block is a linear sequence of program instructions having one entry point and one exit point. It may have many predecessors and many successors and may be its own successor. The last instruction of every basic block is called terminator. Every basic block is part of a function. A function (n, B, e) is a tuple of a name n, a sequence of basic blocks B = (b0 , b1 , ..., bm ), and an entry block e ∈ B. Hereinafter, we will denote the main function of every program with fmain . A module m = (Fm , Gm ) is a pair of a set of function symbols Fm and a set of global variable symbols Gm . To optimize our encoding, we run some predefined optimization passes from LLVM and LLBMC on the generated LLVM-module. Among other things, these optimizations remove undefined behavior in C-code, promote memory references to register references and inline the program into one main function. These optimizations are described in more detail in [22]. The resulting LLVM-module is then used as input for our encoding. 3 LLUMC Encoding A bug or error in a software program is a well-known notion but there exists no universal definition. A general concept is that a program has an error, if it does not act according to its specification. For our approach this definition is not specific enough. We will not cover all possible errors but concentrate on two main properties. One of them is the occurrence of an undefined overflow for the signed arithmetic operations addition, subtraction, multiplication and division. We define undefined overflows independent from the variable type and thus independent of the bit-vector length representing the variable. Let v be a variable in two’s complement and let ` be the bit-length of v, then maxv returns the maximal value for v: 2`−1 − 1 and minv returns the minimal value −2`−1 . In the C language unsigned overflows are defined by a wrap around. The addition of two unsigned integers hxiuI and hyiuI is e.g. defined modulo max_int: hxiuI + hyiuI = x + y mod max_int + 1 . Thus, we can consider undefined overflows solely on signed variables. Definition 1 (Undefined Overflow). Let hxisl , hyisl be signed variables of length `, then an undefined overflow occurs, if 1. 2. 3. 4. hxis` + hyis` > max` , hxis` − hyis` < min` , hxis` · hyis` > max` or hxis` · hyis` < min` , hxis` ÷ hyis` with hxis` = min` and hyis` = −1. 5 The other property for our error definition, regards calls to assume and assert. A program acts according to its specification, if the assert statements are true under the condition that the assume conditions are met. If the assume condition is not met, the further run of the program is not specified and thus no errors can occur. With these two properties in mind, we can define the term error for our approach. Definition 2 (Program Error in LLUMC). Let p be a program. Then there exists an error in p, if all calls to assume that are prior to an assert statement or possible overflow are true and one of the following holds. 1. An assertion is false: a call to assert with the parameter false. 2. The occurrence of an undefined overflow for an arithmetic operation. Of course, there are other errors that can happen during a program execution like irregular bit-shifting, non-termination and many more. These errors can be regarded in future work and for the remainder of this paper the expression "error" is equated with the above definition. To find these errors we regard an LLVM-module as stated in Section 2. After inlining all function calls, we can concentrate on just the main function. Every basic block together with its variable assignment can be seen as a state. We then add a special error state and try to find a path from the entry state, defined by the entry block of the main function, to the error state. Therefore, we first define the state space of our encoding. State Space Transition from one state to the next state will always represent the transition from one basic block to the next with respect to its current variable assignment. Often this kind of encoding is called small block encoding [11]. According to the theory of bit-vectors, we define every state variable as a bit-vector of length n. The number of bit-vectors in the state, including the bit-vectors representing the current and previous basic block, define the number of SMT variables that are needed to encode the state and the number of bits in total represent the number of CNF variables needed. The focus on the theory of bit-vectors, allows us to ignore the state of the main memory and concentrate on the immediate LLVM-module2 . First of all, every state has to save the current basic block. Hereinafter |B| denotes the number of basic blocks of the main function. For our encoding we need two additional blocks. The ok block represents a safe state from which on, no more errors can occur. This block is reached when the program terminates with the output 0 or when an assume condition is not met. The second block is called error and is our goal state, representing that an error occurred. With the function enc(bb) : BasicBlock → N we uniquely map every basic block to a natural number. If there are |B| basic blocks in main, then the bit-vector needs to have the length dlog2 (|B|+2)e to encode the current basic block. We call this variable:  curr = curr1 , curr2 , ..., currdlog2 (|B|+2)e , for Boolean variables curri . 2 Generally, encoding the state of the main memory is not easily realized and to integrate a main memory model in our approach requires further research. 6 In LLVM the value of a register can depend on the previous basic block and must thus also be encoded:  pred = pred1 , pred2 , ..., preddlog2 (|B|+2)e , for Boolean variables predi . Furthermore, we need to save the current variable assignment. We do not need the assignment of all variables, but should concentrate on those that will be accessed later on and cannot be optimized away. Those variables can be classified by two properties and we call the set of those variables V : 1. Variables that are used in more than one basic block and 2. variables that are read before written in the same basic block, which is part of a loop. It is enough to add only those variables to the state space, because all other variables are included during the encoding of the entailing basic block and their value is not directly used for a transition step. The length of the variables depends on their type. The standard integer in C has a width of 32 bits, long has 64 and Boolean values have a width of 1. There are other types but their lengths is always specified by LLVM and can thus be easily extracted. Definition 3 (State). The state space is the set of bit-vector variables: StateSpace = {curr, pred} ∪ V . Every variable of the state space has a fixed bitlength ` and can take on concrete bit-vectors of length ` as values. For a specific time point k the state state(k) is the assignment of concrete bit-vectors to every variable. Encoding to SMT Our aim is to develop an encoding for an LLVM-module defined in Section 2 that fits the DimSpec format. Therefore, we must define the four CNF formulas {I, G, U, T } in such a way that if there exists a transition from I to G defined by T and restricted by U then there exists an error in the given program code. The initial formula I can be created by encoding the entry block of the LLVM-module. Due to the restriction on the theory of bit-vectors global variables are not regarded, because they always include a memory access. The encoding has to represent the state that we are currently at the first basic block and that there were no prior actions. We declare the entry block itself as the predecessor to exclude any prior actions. The initial formula is thereby time-independent, because the entry block is the same for every time step. The rest of the variable assignment is arbitrary at this point and can be left undeclared. Definition 4 (Encoding of Initial Formula). Let entry be the name of the first block, then the initial formula I(k) for the LLVM-module and for k ∈ N is defined as: curr = enc(entry) pred = enc(entry) . 7 ∧ The encoding of the goal formula G is also time-independent and can be defined accordingly. Definition 5 (Encoding of Goal Formula). Let error be the name of the error block, then the goal formula G(k) for the LLVM-module and for k ∈ N is defined as: curr = enc(error) . The universal formula consists of constraints that have to be true in all states. In our case, that are boundaries for the variables curr and pred. In the previous section, the number of bits needed to encode the current and previous basic block were defined as |B| + 2. In most cases |B| + 2 is not a power of two and thus bigger numbers can be represented. These numbers must be excluded at all times in the universal formula U. Definition 6 (Encoding of Universal Formula). Let |B| be the number of basic blocks in the LLVM-module, then the universal formula U(k) for k ∈ N is defined as: curr ≤ (|B| + 2) ∧ pred ≤ (|B| + 2) . At last, we have to define the transition formula. It represents the transition between state k and state k + 1. It is important to notice that the transition formula has twice as much variables as the other formulas. To distinguish between the variables in time-point k and k +1 every variable v of our state space is called v 0 at time-point k + 1. Otherwise, every transition formula would be evaluated to false and thus no transition step could ever be taken. In general, the encoding of one transition has the form: state(k) ⇒ state(k + 1) . (2) We call state(k) antecedent and state(k + 1) consequent. For each state(k) that is reachable from our initial state, a transition must be defined. An undefined transition leads to an undefined state(k + 1) with arbitrary values. Thus, if there is a reachable, undefined transition all goal states can be reached. For the same reason, we determine that for each state(k) the transition must be explicit. Variables that are not important for the transition should not be declared in the antecedent but should be specified in the consequent to avoid undefined values. We will use the auxiliary function same(bb) : Basic Block → SMT-formula to encode that variables which are not modified in a basic block maintain their current value. The function same(bb) returns the conjunction of all var = var0 , for all variables in our state space, that have not been modified in the transition of our basic block bb. 8 To encode the transition between steps, we take a closer look at the current basic block, further denoted as bb and customize Equation 2 for different branching possibilities. We divide basic blocks into three groups and distinguish them by means of their terminator. Afterwards, we will have a special look at the function calls of assume, assert and exit. These function calls together with the possibility of overflows will extend the encoding. The three different types of terminator instructions are called unconditional branching, conditional branching and return. Unconditional branching (br %bb2): Branches to the basic block with the label bb2 and creates a transition from the current basic block to bb2. If the current basic block has no other instructions, only the change of basic block and the saving of the predecessor have to be encoded. Furthermore, we have to state that no variables have changed during this transition: curr = enc(bb) ⇒ curr0 = enc(bb2) ∧ pred0 = enc(bb) ∧ same(∅) . (3) This encoding is rarely complete, because it does not regard all other instructions in the basic block bb. Let rlbb be the ordered list of instructions from bottom to top in bb. Then we iterate over rlbb and regard all instructions that (1) are part of our state, (2) have not been visited before and (3) are not the terminator instruction. The instruction is encoded according to its type and its operands. When an instruction like %tmp3 = add i32 10, %tmp2 is encoded, the algorithm checks the operands first. When regarding the value %tmp2, the algorithm checks whether it is a variable that is part of our state or a value calculated by an instruction, which the algorithm has to encode recursively. The stop criterion is always the occurrence of a state variable, a constant like for example 10 or a call to assert, assume or error. For the add instruction the encoding would result in tmp30 = bvadd (10, tmp2). This generated SMT formula is then conjuncted with the consequent of equation 3. For arithmetic operations an additional overflow check formula, which is described later on, is inserted. The algorithm continues by iterating further through the list rlbb until there are no instructions left. Conditional branching (br %cond, %bb1, %bb2): Creates a transition to bb1 with the condition cond = 1 and a transition to bb2 with the condition cond = 0. Every conditional branch has a branching condition represented as a variable (cond). We can extract that condition by visiting and encoding the variable representing the branching condition. In LLVM the branching condition is a Boolean value that is assigned by the so called icmp -instruction. This instruction returns a Boolean value based on the comparison of two values and it supports equality, unsigned and signed comparison. The icmp-instruction is then encoded recursively by visiting its two operands with the same approach as described for the unconditional branching. The result could for example be the condition tmp2 > 10. Based on this condition, the algorithm creates two 9 separate transitions. curr = enc(bb) ∧ visitInst(cond) ⇒ curr0 = enc(bb1) ∧ pred0 = enc(bb) ∧ same(∅) . curr = enc(bb) ∧ ¬(visitInst(cond)) ⇒ curr0 = enc(bb2) ∧ pred0 = enc(bb) ∧ same(∅) . Return value (ret val): The value val can be an arbitrary integer and represents the return value of the program as usual. This terminator creates a transition to ok. In an extended and already implemented version, another check is inserted verifying that the result value of a correct program is 0 and if this does not hold a transition to error is created. Now we have to look at the calls to assume, assert, error and the possibility of overflows. During the instruction iteration of a basic block, we regard these instructions differently because they lead to a split of our transitions. Method calls (error, assume, assert): If the error-method, which is used to specify program errors in C-code, is called inside a basic block, we do not have to regard any other instructions and thus delete all other transitions from this basic block. We produce a single transition: curr = enc(bb) ⇒ curr0 = enc(error) ∧ same(∅) . The other three possibilities lead to a split of our transitions similar to the conditional branching. A call of assume(var) divides the set of current transitions for our basic block. The condition is var = 0 and leads to a transition to the ok state with s0 = enc(ok). The call to assert(var) is similar only with the transition to s0 = enc(error) if var = 0 holds true. In both cases, the encoding continues normally with the next instruction if the conditions are not met. Overflow Checks: While calls to error, assume and assert are explicit calls in the LLVM-module, we have to recognize possible overflows while still encoding the operations correctly. Therefore, an overflow check is always inserted when visitInst(I) is called on an arithmetic operation with the flag nsw. In this case, we know that there is a signed operation with no defined wrap around. If the condition condov for an overflow is true, we transition to the error state. We will give the formula for the signed addition, the formulas for subtraction, multiplication and division are similar and comply with the undefined overflow in Definition 1. Addition: The result of adding up two positive numbers must always be positive and the addition of two negative values must always result in a negative value. Whether the result is positive or negative can be seen by the sign-bit. Starting with 0, we will refer to a single bit at position i of a bit-vector b by b[i]. The position of the sign-bit has the special index sb. Let res be the result of adding the two bit-vectors a1 and a2 , then the condition condov for an undefined overflow is defined by:  1 = ¬res[sb] ∧ a1 [sb] ∧ a2 [sb]) ∨ (res[sb] ∧ ¬(a1 [sb] ∧ a2 [sb]) . 10 All components of the transition formula have now been discussed. To obtain the complete transition formula the algorithm has to iterate over all basic blocks of the main function. Depending on their terminator instruction, every basic block has do be encoded according to the definitions above. To predict which transition is taken in which step would be equal to solving the whole formula. Thus, the transition formula is time independent and the transition possibilities for all time steps are part of the formula. Definition 7 (Encoding of the Transition Formula). Let BB be the set of all basic blocks of fmain and let encode(b) with b ∈ BB be the encoding as shown above, then the transition formula T (k, k + 1) for k ∈ N is defined by: ^ encode(b) . (4) b∈BB Claim. There exist an error as defined in Definition 2 for the program p, iff 1. p is transformed into a LLVM-module ` as described in Section 2 and 2. there exists a transition path in ` from the initial state to the goal state while the universal formula holds in all states. Proof idea: We forego on a formal proof, because it would require a structural induction over huge sets of C-Code and the LLVM-language. Instead, we present short arguments and references for our claim. (1): Using LLVM as a representation for C-code is widely accepted and used in research and industry. We assume that the transformation from C-code into a LLVM-module does not remove or add any errors based on the high number of research papers [4,6,10] and tools like LLBMC [26] and SeaHorn [19]. (2): The error node has three types of incoming edges: from an assert statement, from an overflow check and an edge from the error node itself. We disregard the edge that points to itself and are left with the two options that match the properties defined in 2. If the encoding of the variables is, as we claim, correct and our state space is closed under T and U we can assume that the a transition path from the initial state to the error state complies with an error in the LLVMmodule. From SMT to SAT formula The encoding of the LLVM-module gives us four SMT formulas. These formulas have to be translated into CNFs. The most widespread approach to transform SMT to CNF formulas is called bit-blasting. We have taken one approach implemented in STP [17] and the ABC-library [20] and modified these algorithms to correspond to some technical requirements of the DimSpec format. Finally, a CNF in the DimSpec format is created that can be used as input for a number of SAT-solvers. 4 Experimental Results The LLUMC-approach is implemented as a tool-chain. First, the input file in Ccode is compiled with Clang (version 3.7.1) and then optimized with LLVM and 11 LLBMC passes. This optimized LLVM-module serves as input for the program LLUMC, which performs the encoding as described above. To transform the created SMT formulas into CNF formulas in DimSpec format, the tool STP was modified. The final renaming and aggregation is implemented directly in LLUMC. Thus, the tool produces a single CNF file in DimSpec format. We tested two different approaches to solve the generated DimSpec/CNF formulas. The tool IncPlan [18] was developed at KIT and implements the incremental SAT-solving described in Section 2. It can be used with every SAT-solver that accepts the Re-entrant Incremental Satisfiability Application Program Interface (IPASIR). We have tested IncPlan with a number of SAT-solvers including Minisat [28], abcdSat [15], Glucose [5] and Picosat [12]. While Glucose and Minisat produced good results for some benchmarks, they crashed for a number of benchmarks and thus we concentrated on the usage of abcdSat and PicoSat. The IC3 algorithm was implemented and adjusted to the DimSpec format in the tool MinireachIC3 by Balyo and Suda [8]. The safety property P expresses that the error state should not be reachable and thus P is given by ¬G. Thus, we are not only able to prove the existence of errors but also their nonexistence. 4.1 Benchmarks We evaluated our approach using benchmarks from the Software Verification Competition (SV-COMP) [10]. The SV-Comp is an annual competition for academic software verification tools, with the aim to compare software verifiers. The competition is conduced every year since 2012. The verification tasks are divided in different topics and verification tasks are contributed by a number of research and development groups. While we were not able to participate in the competition, the collected benchmarks serve as an excellent evaluation basis for every verifier. All benchmarks are available at [2] and we regarded the sub-folder c with programs written in the language C. We screened these benchmarks for tasks that match our theory of bit-vectors. We excluded all benchmarks that do not match our theory and removed benchmarks that include memory accesses or floating point arithmetic. Furthermore, we checked that all instructions used in the examples were implemented in LLUMC. It is notable, that nearly all instructions were implemented and only the truncate instruction, which cuts the length of values, restricts the usable benchmarks. The truncate instruction is not included in most theories of bitvectors e.g in tools like LLBMC, because on a programming level there is not enough (signedness) information about the bit-vector to truncate it easily. Lastly, we excluded recursive and concurrent tasks due to the inlining in our approach. We evaluated our approach on 14 incorrect and 10 correct programs. Our approach creates a CNF formula representing the problem of finding a transition path to the error state. Thus, the desired result of our approach should be sat in case there exists an error and unsat if there is none. Whereby most benchmarks are smaller and have the purpose of demonstrating the correctness of our approach, we were also able to evaluate our approach for some larger problems. The benchmarks vary between 14 and 646 lines of code (LoC) and 151 to 116777 12 number of clauses. The evaluation was performed on a system with 64 CPUs with 2.4GHz from which, for our sequential approach, only one was used and 483 GB memory. Each benchmark had a time limit of 600 seconds and a memory limit of 8 GB. The time needed to generate the CNF formula and to read and write CNF formulas in and out of files is negligible for larger problems. Thus, we decided to measure only the CPU time needed to solve the generated CNF formulas. Table 3 displays the result of solving the generated DimSpec/CNF formulas both with the tool IncPlan and MinireachIC3. The results of running IncPlan with the SAT-solver abcdSat were most stable and are thus displayed. One can see, that our approach generates correct encodings of the C-code and that IncPlan is able to find a satisfying model representing a transition path to the error state for erroneous programs. We also recognize that for small problems the time and memory needed is insignificant and for larger problems it is still manageable. For programs without an error we are not able to prove anything, but the timeouts indicate the correctness of our encoding. The jain benchmarks show that the number of iterations the SAT-solvers are able to perform in the given time depends on the complexity of the individual basic block and varies for all benchmarks. no error error Table 1. Runtime data for Benchmarks from the SV-Comp run with IncPlan and MinireachIC3, where the column Its stands for the number of incremental solving steps (Iterations) performed by the SAT-solver, ans is the result (TO meaning timeout) and T and M represent the runtime in seconds and memory consumption in megabytes. Benchmark diamond false unreach call2 implicitunsignedconversion false unreach call jain 1 false no overflow jain 2 false no overflow jain 4 false no overflow jain 5 false no overflow jain 6 false no overflow jain 7 false no overflow signextension2 false-unreach-call overflow false unreach call1 overflow false unreach call1 smaller overflow false unreach call1 smaller2 s3 clnt 1 false unreach call true no overflow.BV.c.cil s3 clnt 2 false unreach call true no overflow.BV.c.cil ans sat sat sat sat sat sat sat sat sat TO sat sat sat sat implicitunsignedconversion true unreach call jain 1 true-unreach-call true-no-overflow jain 2 true-unreach-call true-no-overflow jain 4 true-unreach-call true-no-overflow jain 5 true-unreach-call true-no-overflow jain 6 true-unreach-call true-no-overflow jain 7 true-unreach-call true-no-overflow signextension2 true-unreach-call gcd 4 true unreach call true no overflow s3 srvr 1 true alt true-no-overflow.BV.c.cil TO TO TO TO TO TO TO TO TO TO 13 abcdSAT T M 3.95 130 ≤0.01 ≤0.1 ≤0.01 ≤0.1 ≤0.01 ≤0.1 ≤0.01 ≤0.1 ≤0.01 ≤0.1 ≤0.01 ≤0.1 ≤0.01 ≤0.1 ≤0.01 ≤0.1 600 899.0 11.34 113.0 20.28 234.7 198.93 940.5 0.79 57.4 600 600 600 600 600 600 600 600 600 600 300.4 1458.1 2386.7 2795.9 955.2 2447.0 1760.7 504.3 2045 1182.5 Its 27 4 3 3 3 3 3 3 7 / 507 720 68 4 13089 5595 4230 3273 3083 2827 2731 11995 2249 93 MinireachIC3 ans T M Its TO 600 241.2 / sat 0.001 0.0 4 sat 0.007 0.0 3 sat 0.019 0.0 3 sat 0.023 0.0 3 sat 0.009 0.0 3 sat 0.024 0.0 3 sat 0.021 0.0 3 sat 0.002 0.0 7 TO 600 366.3 / sat 0.83 25.5 502 TO 600 686.3 / TO 600 377 / sat 0.628 33.6 4 unsat unsat unsat unsat unsat unsat unsat unsat unsat TO 0.002 0.0 4 0.008 0.0 4 0.030 0.0 6 0.047 0.0 6 0.046 0.0 7 0.052 0.0 6 0.531 0.0 6 0.002 0.0 6 6.853 25.7 11 600 446.5 / 1000 abcdSat MinireachIC3 llbmc10 llbmc100 llbmc1000 Time in seconds 100 10 1 0.1 0.01 0.001 0 2 4 6 8 10 12 14 16 18 20 Problems Fig. 1. Comparison of LLUMC and LLBMC. The x-axis represents the number of problems the solvers were able to solve and the y-axis the time they needed. MinireachIC3 in comparison is not only able to prove the existence of errors but is also able to prove their non-existence. For erroneous programs the time difference between IncPlan and IC3 is negligible for smaller benchmarks. For some of the larger benchmarks the algorithm produces a timeout. In general it is harder to prove the absence of errors than to prove their existence. To prove the existence of an error, the solver only needs to find a valid transition path to the error label, while needing to exclude all possible transition paths to the error label for proving the absence of an error. This complexity is displayed in Table 3. The "jain false" and "jain true" benchmarks only differ in a slightly changed assert statement but to prove the absence of an error always takes more time than to prove its existence. In the case of "jain 7" even 25 times longer. After evaluating the feasibility of our approach Figure 1 shows the comparison between the LLUMC-approach with the state-of-the-art bounded model checker LLBMC. When comparing an unbounded model checker like LLUMC with a bounded model checker, we have to determine a bound until which the bounded model checker unrolls the program. When setting the bound too small, LLBMC runs very fast but has a high chance of producing incorrect results but if we set the bound to high, LLBMC needs a long time to encode and solve the formula. We tested LLBMC with the bounds of 10, 100 and 1000 and compared it with our results generated by IncPlan and MinireachIC3. Looking at Figure 1, we can recognize the time difference depending on the defined bound. Setting the bound to 10 leads to a really fast solving process but it can solve fewer problems compared to the bound of 100. Setting the bound to 1000 results in timeouts for more complex benchmarks and thus regresses the number of solved problems. After some overhead for smaller problems, solving 14 the benchmarks with IncPlan and abcdSat leads to good results but due to its restriction of only finding errors and not disproving them, it can not solve as many benchmarks as MinireachIC3. The IC3 algorithm can solve 20 out of 24 benchmarks and has a performance advantage compared to all other approaches. The experimental evaluation illustrates the correctness of our approach for a wide variety of problems. Furthermore, it indicates that the time needed for most problems is reasonable. For model checking in general, the scalability for large programs is always a challenge. 5 Conclusion and Future Work We introduced a novel unbounded model checking approach to find errors in software or prove their non-existence by using the DimSpec format. We have developed a new encoding from C-code to a CNF formula in the DimSpec format. Using the intermediate language LLVM, we are able to transform the existence of an error in C-code into four SMT formulas representing the problem of finding a transition path from the initial state of the program to a defined error label. By means of an AIG-supported bit-blasting algorithm, the four SMT formulas are then transformed and added into one CNF in DimSpec format. The encoding has been implemented in the tool LLUMC and we have evaluated this encoding using both the incremental SAT-solving algorithm implemented in the tool IncPlan and the invariant checking algorithm implemented in MinireachIC3. Based on benchmarks from the SV-Comp, the evaluation shows that we extended the functionality of current solvers for infinite-loops while providing correct results and are also comparable to the state-of-the-art solvers regarding solving-time. Transforming C-code and the existence of errors into CNF formulas in DimSpec format results in a wide range of possibilities to solve the given problem. While we tested incremental SAT-solving and the invariant checking algorithm of IC3, there is also the chance of utilizing advances in parallel SAT-solving for our approach. IncPlan can be run with parallel SAT-solvers as back-end tools, and IC3 was designed to fit both sequential and parallel SAT-solving. In addition to parallel solving, the performance of the LLUMC approach can also be improved by enlarging the incremental steps of the solver. A first evaluation shows that merging basic blocks in LLVM leads to performance improvements, indicating that a large block encoding could be advantageous. Furthermore, the functionality of the approach can be extended. As a next step, an implementation of other theories like the theory of arrays would make LLUMC usable on a greater range of programs. References 1. The llvm compiler infrastructure, http://llvm.org/, accessed on November 1, 2017 2. Sv-benchmarks, https://github.com/sosy-lab/sv-benchmarks/, accessed on October 12, 2017 15 3. Llumc (low level unbounded model checker (2017), https: //github.com/MarkoKleineBuening/llumc, [revision hash: 94e93beecdc7d82bdf6366aef92a7cc7b3ee89a3] 4. Albarghouthi, A., Li, Y., Gurfinkel, A., Chechik, M.: Ufo: A framework for abstraction-and interpolation-based software verification. In: Computer Aided Verification. pp. 672–678. Springer (2012) 5. Audemard, G., Simon, L.: Glucose in the sat 2014 competition. SAT COMPETITION 2014 p. 31 (2014) 6. Babic, D., Hu, A.J.: Structural abstraction of software verification conditions. In: CAV. pp. 366–378. Springer (2007) 7. Balyo, T., Gocht, S.: Accelerating sat based planning with incremental sat solving (2017) 8. Balyo, T., Suda, M.: Reachlunch entering the unsolvability ipc 2016. Unsolvability IPC: planner abstracts pp. 3–5 (2016) 9. Barrett, C., Stump, A., Tinelli, C., et al.: The smt-lib standard: Version 2.0. In: Proceedings of the 8th International Workshop on Satisfiability Modulo Theories (Edinburgh, England). vol. 13, p. 14 (2010) 10. Beyer, D.: Second competition on software verification-(summary of sv-comp 2013). In: TACAS. vol. 7795, pp. 594–609. Springer (2013) 11. Beyer, D., Cimatti, A., Griggio, A., Keremoglu, M.E., Sebastiani, R.: Software model checking via large-block encoding. In: Formal Methods in Computer-Aided Design, 2009. FMCAD 2009. pp. 25–32. IEEE (2009) 12. Biere, A.: Picosat essentials. Journal on Satisfiability, Boolean Modeling and Computation 4, 75–97 (2008) 13. Biere, A., Cimatti, A., Clarke, E.M., Strichman, O., Zhu, Y.: Bounded model checking. Advances in computers 58, 117–148 (2003) 14. Bradley, A.R.: Sat-based model checking without unrolling. In: Vmcai. vol. 6538, pp. 70–87. Springer (2011) 15. Chen, J.: Minisat bcd and abcdsat: Solvers based on blocked clause decomposition. SAT RACE (2015) 16. Eén, N., Sörensson, N.: An extensible sat-solver. In: International conference on theory and applications of satisfiability testing. pp. 502–518. Springer (2003) 17. Ganesh, V., Dill, D.L.: A decision procedure for bit-vectors and arrays. In: CAV. vol. 4590, pp. 519–531. Springer (2007) 18. Gocht, S.: Incremental sat solving for sat based planning (2017) 19. Gurfinkel, A., Kahsai, T., Navas, J.A.: Seahorn: A framework for verifying c programs (competition contribution). In: TACAS. pp. 447–450 (2015) 20. Jha, S., Limaye, R., Seshia, S.: Beaver: Engineering an efficient smt solver for bitvector arithmetic. In: Computer Aided Verification. pp. 668–674. Springer (2009) 21. Khurshid, S., Păsăreanu, C.S., Visser, W.: Generalized symbolic execution for model checking and testing. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems. pp. 553–568. Springer (2003) 22. Kleine Büning, M.: Unbounded software model checking with incremental satsolving (2017) 23. Koopman, P.: A case study of toyota unintended acceleration and software safety. Presentation. Sept (2014) 24. Leveson, N.G., Turner, C.S.: An investigation of the therac-25 accidents. Computer 26(7), 18–41 (1993) 25. Lions, J.L., et al.: Ariane 5 flight 501 failure (1996) 16 26. Merz, F.: Theory and Implementation of Software Bounded Model Checking. Ph.D. thesis, Dissertation, Karlsruhe, Karlsruher Institut für Technologie (KIT), 2016 (2016) 27. Merz, F., Falke, S., Sinz, C.: Llbmc: Bounded model checking of c and c++ programs using a compiler ir. Verified Software: Theories, Tools, Experiments pp. 146–161 (2012) 28. Sorensson, N., Een, N.: Minisat v1. 13-a sat-solver with conflict-clause minimization. SAT 2005(53), 1–2 (2005) Appendix 5.1 Running Example To illustrate the transformation from C-code into a LLVM-module and later on into a CNF formula, we demonstrate the encoding on an example. The example was taken out of the benchmark verification tasks of the competition on software verification (SV-Comp). It can be found under the category bitvectorloops. Example 1 iterates through a while-loop until x is smaller then 10. In every loop the value 2 is added to the even number x. At the first glance, the loop will never terminate but after a high number of iterations an overflow occurs and the value x becomes smaller then 10, while still being an even number. The maximal value of an unsigned integer (max_uint) is the uneven number 4294967295. After a high number of loop iterations the value x would be max_uint − 1. The addition with 2 mod (max_uint + 1) would then result in x = max_uint−1+2−(max_uint+1) = 0 and thus the assert condition (x%2) will fail, because x is still an even number. This example shows the limitations of bounded model checkers, because they would only unroll the loop to a specific bound that often is not high enough to find errors like these. Example 1 (C-Code). 1 2 3 4 5 6 7 int main(void) { unsigned int x = 4294967295-101; while (x >= 10) { x += 2; } __VERIFIER_assert(x % 2); } The LLUMC-approach takes this c-Code file and transforms it into an LLVMmodule. Example 2 (LLVM-module before optimizations). We regard only the main function of the LLVM-module. This function consists of four basic blocks. Variables are marked by an %, representing register variables. The first basic block assigns the constant 4294967194 to the variable %x. It first allocates the needed space before storing the value into the register variable. The second basic block 17 represents the if-condition of Example 1. It loads the value of x into a register variable and the instruction icmp checks whether it is greater or equal (uge) then 10. Depending on the output, the branching instruction (br ) jumps to the third or fourth basic block. The third basic block, representing the body of the if-statement, adds the constant 2 to x. The fourth basic block checks the assert condition (x%2) by first extracting the remainder of the unsigned division of x with 2 (urem) and then calling the method __V ERIF IER_assert with the result as a parameter. 1 2 3 4 5 6 define i32 @main() #0 { %1 = alloca i32, align 4 %x = alloca i32, align 4 unsigned x = 4294967295 - 101; store i32 0, i32* %1 store i32 4294967194, i32* %x, align 4 br label %2 7 8 9 10 11 ; <label>:2 %3 = load i32, i32* %x, align 4 ; preds = %5, %0 %4 = icmp uge i32 %3, 10 br i1 %4, label %5, label %8 while(x >= 10) 12 13 14 15 16 17 ; <label>:5 %6 = load i32, i32* %x, align 4 %7 = add i32 %6, 2 store i32 %7, i32* %x, align 4 br label %2 ; preds = %2 ; <label>:8 %9 = load i32, i32* %x, align 4 ; preds = %2 x += 2; 18 19 20 21 22 23 24 25 %10 = urem i32 %9, 2 VERIFIER assert(x % 2); call void @__VERIFIER_assert(i32 %10) %11 = load i32, i32* %1 ret i32 %11 } In theory one could work on this LLVM-module, but it is more efficient and easier to first run some predefined optimization passes from LLVM and LLBMC. In the first step, we remove undefined values in LLVM. Furthermore, the optimization mem2reg promotes memory references to be register references. The pass called inline tries to inline all functions bottom-up into the main function. Afterwards the two passes instnamer and simplifycfg simplify the program. After running these optimizations on our Example 2 we get the following LLVMmodule function as input for the LLUMC-approach. Example 3 (Optimized LLVM-module). We can see the results of running the LLVM-passes when comparing the resulting main function with the earlier Example 2. The result of running the instname pass is obvious when looking at the 18 naming of basic blocks and variables. The mem2reg pass replaced all allocate, store and load instructions with the phi instruction. Hence, the value of %x.0 is set either to 4294967194 when coming from the entry block or to the earlier calculated %x + 2. The inlining pass inlined the function __V ERIF IER_assert and checks in line 15 whether the assert condition was true(1) or false(0). 3 define i32 @main() #0 entry: %tmp = icmp uge i32 4294967194, 10 4 br i1 %tmp, label %bb1, label %return 1 2 unsigned x = 4294967295 - 101; 5 bb1: ; preds = %entry, %bb1 %x.0 = phi i32 [ %tmp2, %bb1 ], [ 4294967194, %entry ] 6 7 %tmp2 = add i32 %x.0, 2 %tmp3 = icmp uge i32 %tmp2, 10 br i1 %tmp3, label %bb1, label %return 8 9 10 while(x >= 10){ x+=2 } 11 return: ; preds = %bb1, %entry %x.1 = phi i32 [ 4294967194, %entry ], [ %tmp2, %bb1 ] 12 13 %tmp4 = urem i32 %x.1, 2 VERIFIER assert(x % 2); %tmp.i = icmp ne i32 %tmp4, 0 br i1 %tmp.i, label %__VERIFIER_assert.exit, label %bb1.i 14 15 16 17 bb1.i: ; preds = %return call void bitcast (void (...)* @__VERIFIER_error to void ()*)() #3 unreachable assert is false 18 19 20 21 __VERIFIER_assert.exit: ret i32 0 22 23 5.2 ; preds = %return assert is true Encoding of the example as described in the paper The state space of this example consists of the two variables curr and pred with a bit-length of four. Furthermore, the variable tmp2 with a bit-length of 32 is added to the state space, because it occurs in the basic block bb1 and also in return. The SMT function bvmod represents the modulo calculation and the function enc(bb) assigns values to the basic block as following: 5, (entry → 1, bb1.lr.ph → 2, bb1 → 3, bb.return_crit_edge → 4, return → bb.1 → 6, __V ERIF IER_assert_exist → 7, ok → 8, error → 9). The encoding algorithm iterates over all basic blocks of the LLVM-module and encodes them as described in the paper. The encoding of the example leads to the following formulas, which are then transformed to CNF-formulas by an AIG-based approach. 19 Initial Formula: curr = 1 ∧ pred = 1 . Goal Formula: curr = 9 . Universal Formula: curr ≤ 9 ∧ pred ≤ 9 . Transition Formula: (curr = 1 ∧ pred = 1 ⇒ curr0 = 9 ∧ pred0 = 9 ∧ tmp20 = tmp2) ∧ (curr = 2 ⇒ curr0 = 3 ∧ pred0 = 2 ∧ tmp20 = tmp2) ∧ (curr = 3 ∧ 10 ≤ (2 + ite(pred = 2, 10, tmp2)) ⇒ curr0 = 3 ∧ pred0 = 3 ∧ tmp20 = (2 + ite(pred = 2, 10, tmp2))) ∧ (curr = 3 ∧ 10 > (2 + ite(pred = 2, 10, tmp2)) ⇒ curr0 = 4 ∧ pred0 = 3 ∧ tmp20 = (2 + ite(pred = 2, 10, tmp2))) ∧ (curr = 4 ⇒ curr0 = 5 ∧ pred0 = 4 ∧ tmp20 = tmp2) ∧ (curr = 5 ∧ 0 6= bvmod(ite(pred = 4, tmp2, 10), 2) ⇒ curr0 = 7 ∧ pred0 = 5 ∧ tmp20 = tmp2) ∧ (curr = 5 ∧ 0 = bvmod(ite(pred = 4, tmp2, 10), 2) ⇒ curr0 = 6 ∧ pred0 = 5 ∧ tmp20 = tmp2) ∧ (curr = 6 ⇒ curr0 = 9 ∧ pred0 = 6 ∧ tmp20 = tmp2) ∧ (curr = 7 ⇒ curr0 = 8 ∧ pred0 = 7 ∧ tmp20 = tmp2) ∧ (curr = 8 ⇒ curr0 = 8 ∧ pred0 = 8 ∧ tmp20 = tmp2) ∧ (curr = 9 ⇒ curr0 = 9 ∧ pred0 = 7 ∧ tmp20 = tmp2) 5.3 Details from the Experimental Evaluation Details about the benchmarks used for the experimental evaluation are given in table format. Furthermore, detailed evaluation results are displayed. 20 Benchmark Desired Result diamond false unreach call2 sat implicitunsignedconversion false unreach call sat jain 1 false no overflow sat jain 2 false no overflow sat jain 4 false no overflow sat jain 5 false no overflow sat jain 6 false no overflow sat jain 7 false no overflow sat signextension2 false-unreach-call sat overflow false unreach call1 sat overflow false unreach call1 smaller sat overflow false unreach call1 smaller2 sat s3 clnt 1 false unreach call true-no-overflow.BV.c.cil sat s3 clnt 2 false unreach call true-no-overflow.BV.c.cil sat implicitunsignedconversion true unreach call unsat jain 1 true-unreach-call true-no-overflow unsat jain 2 true-unreach-call true-no-overflow unsat jain 4 true-unreach-call true-no-overflow unsat jain 5 true-unreach-call true-no-overflow unsat jain 6 true-unreach-call true-no-overflow unsat jain 7 true-unreach-call true-no-overflow unsat signextension2 true-unreach-call unsat gcd 4 true unreach call true no overflow unsat s3 srvr 1 true alt true-no-overflow.BV.c.cil unsat LoC #Basic Blocks #Variables #Bits #Clauses 48 37 34 1036 35788 14 4 2 6 151 25 5 3 38 2179 26 5 4 70 5125 27 5 5 102 8022 27 5 4 70 3415 27 5 5 102 7999 27 5 5 102 7171 19 7 2 8 263 18 7 3 40 1652 18 7 3 40 1652 18 7 3 40 1637 646 227 93 2928 116777 624 227 95 2992 94826 14 4 2 6 151 25 5 3 38 2128 26 5 4 70 4999 27 5 5 102 7738 27 5 4 70 3370 27 5 5 102 7672 27 5 5 102 6148 19 7 2 8 263 46 12 8 200 21862 696 256 99 3122 102932 Table 2. Selected Benchmarks, where the column LoC stands for the lines of code, #Variables presents the number of SMT variables, #Bits displays the number of SAT variables and #Clauses the number of clauses generated by our approach. error no error 21 Benchmark diamond false unreach call2 implicitunsignedconversion false unreach call jain 1 false no overflow jain 2 false no overflow jain 4 false no overflow jain 5 false no overflow jain 6 false no overflow jain 7 false no overflow signextension2 false-unreach-call overflow false unreach call1 overflow false unreach call1 smaller overflow false unreach call1 smaller2 s3 clnt 1 false unreach call true no overflow.BV.c.cil s3 clnt 2 false unreach call true no overflow.BV.c.cil implicitunsignedconversion true unreach call jain 1 true-unreach-call true-no-overflow jain 2 true-unreach-call true-no-overflow jain 4 true-unreach-call true-no-overflow jain 5 true-unreach-call true-no-overflow jain 6 true-unreach-call true-no-overflow jain 7 true-unreach-call true-no-overflow signextension2 true-unreach-call gcd 4 true unreach call true no overflow s3 srvr 1 true alt true-no-overflow.BV.c.cil Result sat sat sat sat sat sat sat sat sat timeout sat sat sat sat timeout timeout timeout timeout timeout timeout timeout timeout timeout timeout abcdSAT PicoSat Time/s Memory/MB Iterations Result Time/s Memory/MB Iterations 3.95 130 27 sat 4.02 69.5 27 ≤0.01 ≤0.1 4 sat ≤0.01 ≤0.1 4 ≤0.01 ≤0.1 3 sat ≤0.01 ≤0.1 3 ≤0.01 ≤0.1 3 sat ≤0.01 ≤0.1 3 ≤0.01 ≤0.1 3 sat ≤0.01 ≤0.1 3 ≤0.01 ≤0.1 3 sat ≤0.01 ≤0.1 3 ≤0.01 ≤0.1 3 sat ≤0.01 ≤0.1 3 ≤0.01 ≤0.1 3 sat ≤0.01 ≤0.1 3 ≤0.01 ≤0.1 7 sat ≤0.01 ≤0.1 7 600 899.0 / timeout 600 483.3 / 11.34 113.0 507 sat 10.08 69.1 507 20.28 234.7 720 sat 24.35 194.3 720 198.93 940.5 68 sat 421.57 530.6 68 0.79 57.4 4 sat 0.8 42.4 4 600 300.4 13089 timeout 600 281.7 17076 600 1458.1 5595 timeout 600 704.2 5477 600 2386.7 4230 timeout 600 1072.7 3731 600 2795.9 3273 timeout 600 1246.3 2832 600 955.2 3083 timeout 600 497.4 2617 600 2447.0 2827 timeout 600 1252.6 2844 600 1760.7 2731 timeout 600 784.4 1406 600 504.3 11995 timeout 600 496.0 16901 600 2045 2249 SEG 104.03 3750.8 2103 600 1182.5 93 timeout 600 495.7 78 Table 3. Runtime data for Benchmarks from the SV-Comp run with IncPlan, where the column Iterations stands for the number of incremental solving steps performed by the SAT-solver and the result SEG shows the occurrence of an segmentation fault. 22 error no error no error error Table 4. Runtime data for Benchmarks from the SV-Comp run with MinireachIC3, where the column Phases represents the number of major steps performed by the solver. Benchmark diamond false unreach call2 implicitunsignedconversion false unreach call jain 1 false no overflow jain 2 false no overflow jain 4 false no overflow jain 5 false no overflow jain 6 false no overflow jain 7 false no overflow signextension2 false-unreach-call overflow false unreach call1 overflow false unreach call1 smaller overflow false unreach call1 smaller2 s3 clnt 1 false unreach call true no overflow.BV.c.cil s3 clnt 2 false unreach call true no overflow.BV.c.cil implicitunsignedconversion true unreach call jain 1 true-unreach-call true-no-overflow jain 2 true-unreach-call true-no-overflow jain 4 true-unreach-call true-no-overflow jain 5 true-unreach-call true-no-overflow jain 6 true-unreach-call true-no-overflow jain 7 true-unreach-call true-no-overflow signextension2 true-unreach-call gcd 4 true unreach call true no overflow s3 srvr 1 true alt true-no-overflow.BV.c.cil 23 Result Time/s Memory/MB Phases timeout 600 241.2 / sat 0.001 0.0 3 sat 0.007 0.0 2 sat 0.019 0.0 2 sat 0.023 0.0 2 sat 0.009 0.0 2 sat 0.024 0.0 2 sat 0.021 0.0 2 sat 0.002 0.0 5 timeout 600 366.3 / sat 0.83 25.5 502 timeout 600 686.3 / timeout 600 377 / sat 0.628 33.6 3 unsat 0.002 0.0 3 unsat 0.008 0.0 5 unsat 0.030 0.0 5 unsat 0.047 0.0 5 unsat 0.046 0.0 6 unsat 0.052 0.0 5 unsat 0.531 0.0 5 unsat 0.002 0.0 5 unsat 6.853 25.7 10 timeout 600 446.5 / LLBMC LLUMC Benchmark Bound 10 Time/s Bound 100 Time/s Bound 1000 Time/s abcdSat Time/s MinireachIC3 Time/s diamond false unreach call2 sat 0.017 sat 0.112 sat 1.194 sat 0.1 sat 0.1 implicitunsignedconversion false unreach call sat 0.002 sat 0.002 sat 0.002 sat 0.01 sat 0.001 jain 1 false no overflow i.b. 0.008 i.b. 0.031 i.b. 0.237 sat 0.01 sat 0.007 jain 2 false no overflow i.b. 0.009 i.b. 0.038 i.b. 0.316 sat 0.01 sat 0.019 jain 4 false no overflow i.b. 0.010 i.b. 0.044 i.b. 0.381 sat 0.01 sat 0.023 jain 5 false no overflow i.b. 0.005 i.b. 0.019 i.b. 0.134 sat 0.01 sat 0.009 jain 6 false no overflow i.b. 0.012 i.b. 0.051 i.b. 0.429 sat 0.01 sat 0.024 jain 7 false no overflow i.b. 0.008 i.b. 0.054 i.b. 0.449 sat 0.01 sat 0.021 signextension2 false-unreach-call sat 0.002 sat 0.002 sat 0.003 sat 0.01 sat 0.002 overflow false unreach call1 sat 0.007 sat 0.007 sat 0.007 timeout 600 timeout 600 overflow false unreach call1 smaller sat 0.027 sat 0.029 sat 0.030 sat 11.34 sat 0.83 overflow false unreach call1 smaller2 sat 0.249 sat 0.264 sat 0.260 sat 20.28 timeout 600 s3 clnt 1 false unreach call true no overflow.BV.c.cil i.b. 0.338 sat 8.347 timeout 600 sat 198.93 timeout 600 s3 clnt 2 false unreach call true no overflow.BV.c.cil i.b. 0.295 sat 5.336 sat 222.414 sat 0.79 sat 0.628 implicitunsignedconversion true unreach call no error 0.002 no error 0.002 no error 0.002 timeout 600 unsat 0.002 jain 1 true-unreach-call true-no-overflow i.b. 0.008 i.b. 0.031 i.b. 0.239 timeout 600 unsat 0.008 jain 2 true-unreach-call true-no-overflow i.b. 0.009 i.b. 0.039 i.b. 0.316 timeout 600 unsat 0.030 jain 4 true-unreach-call true-no-overflow i.b. 0.011 i.b. 0.045 i.b. 0.370 timeout 600 unsat 0.047 jain 5 true-unreach-call true-no-overflow i.b. 0.005 i.b. 0.020 i.b. 0.128 timeout 600 unsat 0.046 jain 6 true-unreach-call true-no-overflow i.b. 0.010 i.b. 0.051 i.b. 0.407 timeout 600 unsat 0.052 jain 7 true-unreach-call true-no-overflow i.b. 0.013 i.b. 0.054 i.b. 0.451 timeout 600 unsat 0.531 signextension2 true-unreach-call no error 0.002 no error 0.002 no error 0.002 timeout 600 unsat 0.002 gcd 4 true unreach call true no overflow no error 0.006 no error 0.020 no error 0.132 timeout 600 unsat 6.853 s3 srvr 1 true alt true-no-overflow.BV.c.cil i.b. 1.802 i.b. 266.09 i.b. 600 timeout 600 timeout 600 Table 5. Comparison between LLUMC and LLBMC. 24 error no error
6cs.PL
Multi-objective LQR with Optimum Weight Selection to Design FOPID Controllers for Delayed Fractional Order Processes Saptarshi Dasa,b *, Indranil Panb,c, and Shantanu Dasd a) School of Electronics and Computer Science, University of Southampton, Southampton SO17 1BJ, United Kingdom. b) Department of Power Engineering, Jadavpur University, Salt Lake Campus, LB-8, Sector 3, Kolkata-700098, India. c) Department of Earth Science and Engineering, Imperial College London, Exhibition Road, London SW7 2AZ, United Kingdom. d) Reactor Control Division, Bhabha Atomic Research Centre, Mumbai-400085, India. Authors’ Emails: [email protected], [email protected] (S. Das*) [email protected], [email protected] (I. Pan) [email protected] (Sh. Das) Corresponding author’s phone number: +44(0)7448572598 Abstract: An optimal trade-off design for fractional order (FO)-PID controller is proposed in this paper with a Linear Quadratic Regulator (LQR) based technique using two conflicting time domain control objectives. The deviation of the state trajectories and control signal are automatically enforced by the LQR. A class of delayed FO systems with single non-integer order element has been controlled here which exhibit both sluggish and oscillatory open loop responses. The FO time delay processes are controlled within a multi-objective optimization (MOO) formulation of LQR based FOPID design. The time delays in the FO models are handled by two analytical formulations of designing optimal quadratic regulator for delayed systems. A comparison is made between the two approaches of LQR design for the stabilization of time-delay systems in the context of FOPID controller tuning. The MOO control design methodology yields the Pareto optimal trade-off solutions between the tracking performance for unit set-point change and total variation (TV) of the control signal. Numerical simulations are provided to compare the merits of the two delay handling techniques in the multiobjective LQR-FOPID design, while also showing the capability of load disturbance suppression using these optimal controllers. Tuning rules are then formed for the optimal LQR-FOPID controller knobs, using the median of the non-dominated Pareto solution to handle delays FO processes. Index Terms: Fractional order PID controller; integral performance index; multi-objective control; LQR weighting matrices; Non-Integer Order Plus Time Delay (NIOPTD) process 1 1. Introduction Modern optimal control theory has a rich set of analytical tools to design control strategies satisfying desirable characteristics of the excursion of the system states according to the designer’s specifications in an optimal manner [1]. The LQR is one such design methodology whereby quadratic performance indices involving the control signal and the state variables are minimized in an optimal fashion. Historically, in the area of industrial process control, PID controllers are tuned by minimizing a suitably chosen performance index for the control loop error function, which has yielded several thousands of tuning rules [2], in order to get an optimal PID setting. The tuning of PID controller uses the knowledge of the process model (mostly integer order models) like the gain (K), time-constant or lag (T) and time-delay (L). In spite of the huge advancements in the theoretical aspects of optimal control, successful integration of modern optimal control techniques in practical PID control problems was not there for decades due to several hidden heuristics in the design. For example, an effective choice of the weighting matrices (Q and R) in the optimal state feedback (LQR) design which is often impossible to know a priori, especially for the control of large industrial processes [3]. There have been some previous efforts to merge the PID controller tuning problem with LQR theory as described in [4], [5], considering the error and integral of error as the state variables. The LQR technique has also been extended for tuning PID controllers for sluggish over-damped second order processes in [5] by cancelling one of the real system poles with one of the zeros of PID controller. Thus, the approach, presented in [5] does not give the flexibility of tuning oscillatory processes by selecting the optimal controller gains via LQR for the three state variables i.e. error, its rate and integral. In the present paper, this concept is extended by simultaneously considering all the three state as the proportional, integral and derivative action of the controller and finding a synergism of the fractional calculus based enhancements of PID controllers [6] to circumvent the afore-said problems. The goal of the paper is to find out an answer to the following research questions – 1) how to optimally choose LQR weights, keeping in mind the final closed loop performance of a sluggish/oscillatory higher order process in FO template, 2) how to handle the time delay terms, especially large delays in LQR formulation, while preserving both the stability and performance, 3) which time delay handling technique yields a better trade-off control design in terms of Pareto non-dominance for oscillatory and sluggish higher order processes with varying level of lag and delay. The rest of the paper is organized as follows. In section 2 we briefly introduce the background of FO multi-objective control and FO optimal control, thereby highlighting the motivation of the current research. Section 3 discusses about the optimal state feedback approach of PIλDµ controller tuning and the methodology for the selection of LQR weighting matrices to handle FO systems with time delay. Section 4 presents the simulation studies of the proposed controller with an oscillatory and a sluggish process having small time delay, followed by test of its robustness and then verifying the methodology on lag/delay dominant and balanced lag-delay FO processes. The paper ends with the conclusions as section 5, followed by the references. 2. Background and motivation 2.1. FOPID controller and NIOPTD process Fractional calculus, although being an age old topic in mathematics, has only recently flourished within the domain of systems and control theory [7], [8]. The FOPID or PIλDµ controller, proposed by Podlubny [6] is an extension of conventional PID controller and is gradually getting importance in various industrial process control applications. Due to its higher degrees of freedom, the fractional order PIλDµ controller has better ability to enforce several conflicting control objectives 2 than the conventional integer order PID controllers. However, the performance of such controller greatly depends on its tuning methodology [9]. Several tuning philosophies have been proposed to design PIλDµ controllers e.g. analytical rule based [10], [11], stabilization based [12], time domain [9] and frequency domain [13], [12] methods, to name a few amongst other available techniques [14]. In this paper, the LQR formulation is used for tuning FOPID controllers to handle a class of FO processes with one non-integer order element (α) as also studied in [12][15], with an additional inclusion of a time delay term along with the fractional dynamics. The reason behind the consideration of this particular FO template is that it has been shown in [9], [14], [16–18] that many higher order systems can be reduced to the Non-Integer Order Plus Time Delay (NIOPTD) template which is capable of faithfully capturing the oscillatory or sluggish higher order process dynamics with only four process parameters (K, L, T and α), thus enabling a compact representation of higher order processes. 2.2. Determination of LQR weights in PID/FOPID controller design It is also well-known that an optimal state feedback regulator (LQR) automatically minimizes the variation in the state trajectories but it does not always show acceptable closed loop response and might often include high overshoot, oscillations etc. for a bad choice of the weighting matrices. In order to achieve efficient tracking for a set-point change, the weighting matrices should be chosen in such a manner that it meets some additional time domain optimality criteria in terms of overshoot, rise and settling time etc. He et al. [5] proposed the technique to find out the LQR weights from closed loop damping and frequency specifications. In this paper, this concept is extended with an MOO based approach to find out the optimum set of weighting matrices for the optimal regulator design, as also studied in [19], [20], [21] for the standard PID controller. Poodeh et al. [22] used genetic algorithm to find weighting matrices by the minimization of a custom cost function of steady-state error, maximum percentage of overshoot, rise time and settling time. Here, these concepts are extended with an LQR based framework for fractional systems with delay where the LQR weights (Q and R) that determines FOPID gains (Kp, Ki, Kd) and the integro-differential orders (λ, µ) of the FOPID controller both have been taken as the decision variables of the Non-dominated Sorting Genetic algorithm-II (NSGA-II) algorithm. The multi-objective design makes an optimal choice of the LQR parameters and the fractional order elements of the controller using an optimal design trade-off between two time domain performance indices, i.e. the Integral of Time Multiplied Squared Error (ITSE) and total variation of control signal which is measured as the Integral of Squared Deviation of Control Output (ISDCO) [15]. 2.3. Optimal control to LQR in the context of fractional order systems Similar to the conventional integer order scenario, optimal control theory has been extended for FO systems by Agrawal [23], for the Euler-Lagrange equation and boundary value problems (BVPs) with FO ordinary differential equations (ODEs). Shafieezadeh et al. [24] have investigated the effect of adding fractional derivatives of the state variables along with the conventional optimal state feedback law using LQR. Tricaud and Chen [25], Agrawal [26], Biswas and Sen [27] formulated the fractional optimal control problem with a finite horizon quadratic performance index involving the states and control action. The formulation has been extended by Biswas and Sen [28] for free final time optimal control problems. Tangpong and Agrawal [29], Biswas and Sen [30], and Ding et al. [31] also proposed similar finite horizon performance index for fractional optimal control problems and derived the optimality condition for the Euler-Lagrange equations. There have been other extensions as well e.g. optimal control theory for FO discrete time systems using the GrunwaldLetnikov approach [32], [33], optimal control of distributed systems [34], [35] and derivation of the 3 necessary condition for optimality [36]. In spite of a large number of works on Euler-Lagrange equation, variational calculus and two point boundary value problems, there have been very few works on solving infinite horizon LQR problems and derivation of Riccati equation for FO systems. The fractional LQR was first proposed by Li and Chen [37], using the Riccati differential equation, as compared to an algebraic Riccati equation (ARE) for integer order systems. In Sierociuk and Vinagre [38] for infinite horizon LQR problems, the standard Riccati equation like solutions are obtained under some assumptions, which has also been adopted in this paper. There are also few attempts of using the concepts of optimal control, especially LQR theory, to tune FOPID controllers. For example, Saha et al. [39] studied LQR equivalence of dominant pole placement problem with FOPID controllers and then used a conformal mapping based approach to approximate FOPID zeros in the primary Riemann sheet with that of a PID controller. Das et al. [19] studied a single objective optimization based optimum weight selection of discrete time LQR to tune digital PID controllers using FO integral performance index. Das et al. [40] extended this concept to design an LQR-FOPID to handle FO systems with a single FO term but without time delay. In this paper, a time delayed FO system (in a structure NIOPTD) has been considered and the two different LQR theories for handling time delay systems are applied. This is because the classical LQR theory and the resulting optimal state feedback controller, obtained by solving the Riccati equation are likely to give unstable response in the presence of process delay. The present paper also extends the state-ofthe-art techniques by coupling the LQR theory with MOO based determination of weighting matrix (Q) and weighting factor (R) of the Continuous Algebraic Riccati Equation (CARE) for time delay systems. The optimum weight selection approach is then applied to tune the FOPID gains as the optimal state feedback gains along with integro-differential orders using an incommensurate FO state space formulation, while also keeping the flexibility of choosing FOPID orders independently unlike the approaches reported in [41], [39]. 2.4. Motivation of the present approach The motivation of this work is to bridge the gap between the linear quadratic optimal control theory for time delay systems and FO process control using PIλDµ structure to handle a generalized FO template with time delay – NIOPTD [9], [14–18]. This NIOPTD template is capable of capturing the higher order dynamics of a wide variety of self-regulating processes [2] compared to the conventional integer order process models like First Order Plus Time Delay (FOPTD) or Second Order Plus Time Delay (SOPTD) and is also capable of capturing both sluggish and oscillatory dynamics. These compact FO models has the capability of explaining a more generalized power law decaying envelope and Mittag-Leffler oscillation, instead of an exponential envelope and sinusoidal oscillation, commonly encountered in impulse response of integer order ODEs [42]. The present LQR based FOPID controller design first converts the problem in an incommensurate FO state space framework by considering the error signal and the two FO integro-differential orders of the loop error as the state variables. In the present approach, the diagonal elements of the weighting matrix (Q) and weighting factor (R) are chosen as the decision variables along with the FOPID integro-differential orders (λ, µ) using the NSGA-II multi-objective optimizer [43]. The optimal state-feedback gains (here the PIλDµ controller gains) associated with the three state variables are then obtained by solving the CARE for each stable solution in the MOO framework. Integral performance indices – ITSE and ISDCO are used here to show that there is a design trade-off between these two conflicting objectives i.e. the set-point tracking performance and required controller effort [15]. These two conflicting objective functions are simultaneously minimized using the multi-objective NSGA-II algorithm to get the Pareto optimal fronts showing the bound of control performance achieved using the two timedelay handling formulation of LQR-FOPID. We also report exhaustive simulation results for 4 oscillatory and sluggish higher order processes with lag-dominant, delay dominant and balanced lagdelay dynamical characteristics in the delayed FO template, using two different delay handling techniques within the LQR framework. This has been translated then to simple FOPID tuning rules for obtaining five controller parameters using the knowledge of the process parameters. 3. Theoretical formulation for optimal fractional order controller design 3.1. Lyapunov stability to optimal LQR regulator design for fractional order systems The classical optimal state-feedback controller or LQR minimizes the infinite horizon quadratic cost function (1) involving the state variables (x) and control actions (u). ∞ J = ∫  xT (t )Qx (t ) + u T (t ) Ru (t )  dt (1) 0 Here, {Q, R} are the symmetric positive semi-definite weighting matrix and the positive weighting factor respectively, which balance the penalty on the excursion of state variables and control action. Minimization of the integral performance index (1) yields the continuous time algebraic Riccati equation given by (2) which can be used to devise the optimal state-feedback control law (3). AT P + PA − PBR−1BT P + Q = 0 (2) u(t ) = −R−1BT Px(t ) (3) where, { A, B} are the system matrices of the standard integer order system structure xɺ = Ax + Bu and P is the symmetric positive definite solution of the algebraic Riccati equation (2). It is well-known that minimization of the infinite-horizon cost-function given by (1) leads to the standard Riccati equation in (2) for integer order systems. Now the question arises whether a similar framework holds for fractional order systems or not. Using Lyapunov stability theory to find out the optimal state-feedback control law for integer order systems is an age-old topic in the area of optimal control which involves two steps – (i) formulating the infinite horizon cost function (ii) deriving the ARE using the Lyapunov stability equation. The extension of Lyapunov stability analysis for FO time varying and nonlinear systems has been proposed by Aguila-Camacho et al. [44]. Whereas, a different approach of has been adopted by Trigeassou et al. [45] which led to a new concepts of the Lyapunov stability analysis for FO systems like sufficiency of quadratic cost function, possible choice of fractional derivative of the energy function [46], generalization for commensurate and incommensurate FO system etc. The Lyapunov stability based Linear Matrix Inequality (LMI) stabilization schemes for FO systems have been discussed in [47], [48]. Sierociuk and Vinagre [38] revisited the earlier works on fractional LQR [37] starting from Euler-Lagrange equation to Riccati differential equation and gave two formulations by considering that the control process is close to the final time (Tf) or the half-time (Tf/2). By introducing the Riesz potential, the work reported in [38] has shown that the same Riccati equation can be obtained similar to the integer order system with two additional assumptions - (i) the system is around the middle of the control process t = Tf/2 and (ii) the time varying matrix P(t) converges to a constant value as t→∞. Under these assumptions an FO system having structure C0 Dtγ x = Ax + Bu will also produce the same Riccati equation and optimal control law as in (2)-(3). The goal here is to develop a trade-off design 5 using the existing theoretical knowledge of LQR for FO systems [42], [43] which will finally yield optimal FOPID controller parameters to handle FO time delay processes. Here, the C0 Dtγ denotes the Caputo fractional derivative [7][8] with zero initial condition of order γ and is given by (4). C 0 Dtγ f ( t ) = I m −γ D m f ( t ) = m t D f (τ ) 1 dτ , m = γ  , m ∈ ℤ, γ ∈ ℝ Γ ( m − γ ) ∫0 ( t − τ )γ − m +1 (4) where, ‘C’ stands for Caputo definition, ‘I’ stands for integral and ‘D’ stands for derivative and f(t) represents the function in time domain which undergoes fractional derivative operation. 3.2. State-feedback approach of FOPID controller tuning to handle fractional order systems Classical PID controller can be designed using the LQR technique, satisfying the quadratic cost function (1) where the state feedback gains can be considered as the PID controller gains [5], [19], [39] if the control loop error, its derivative and integral are considered as the three state variables. Similarly, the concept could be extended as an efficient tuning technique for FOPID controllers using the FO version of LQR [38], if the error and its fractional differ-integrals are considered as the state variables [40]. The formulation of the LQR based FOPID controller for controlling a class of fractional order plant in NIOPTD structure has been shown in Figure 1, where the FO differ-integrated error signals have been considered as the state variables. Here, the class of FO systems is considered to have a NIOPTD template, since most of the higher order oscillatory or sluggish processes can be compactly represented by this structure Ke − Ls (Tsα + 1) , in terms of the pseudo time-constant, dc gain, time delay and compact system order i.e. {T , K , L,α } respectively. Here, the task is to design an optimal state feedback regulator based FOPID controller that can handle this typical class of FO systems with time delay. In the design of a FOPID controller for delay free systems, the controller gains can be obtained from LQR satisfying the Riccati equation in (2) to produce the control action given by (3). Now the performance of the FOPID control loop could be manipulated in two different ways – (i) the state variables x(t) in (3) could be manipulated by the choice of fractional order integral and derivative operators {λ , µ} , (ii) choice of LQR weights affects the state feedback gains which in turn affects the overall closed loop performance. Figure 1: The feedback control system comprising of a NIOPTD plant and PIλDµ controller. 6 In fact, the choice of weighting matrices (Q and R) and also the integro-differential orders of fractional state variables of the PIλDµ controller (λ and µ) does not affect the optimal regulator formulation given by (1)-(3) for systems with no delay ( L = 0 ). For each choice of {Q, R} it is possible to find out a Riccati solution (P) and the associated controller gains {K p , Ki , K d } by solving the CARE in (2). It is obvious that the closed loop performance changes a lot with variation in all the key parameters {Q, R, λ , µ} . So, the objective is to find out an optimal set of parameters having the best closed loop tracking performance among all the optimal controllers that could be designed via LQR. In order to achieve this, the optimal regulator’s weight selection has been improved with other time domain optimality criteria like ITSE and ISDCO (discussed in the next subsection). The ITSE criterion is chosen since it minimizes the overshoot and increases the speed of transient response, while the ISDCO criterion reduces the total variation of the control signal or violent perturbation of the manipulated variable [15]. In Figure 1, if the system is excited with an external input r (t ) to have a FO control input u (t ) and process output y (t ) , then the state variables can be considered as (5). x1 (t ) = d −λ dµ  e t  , x ( t ) = e t , x ( t ) = e ( t )  ( ) ( ) 3  2 dt −λ  dt µ  (5) where, differ-integral operator D = d dt and e (t ) is the control loop error. Therefore, dλ dµ  x t  = x t ,  x2 ( t )  = x3 ( t ) 1 ( ) 2( ) dt λ  dt µ  (6) It is shown by He et al. [5] that in the case of such output feedback control design, the external set-point does not affect the optimal regulator design so that the external set-point change could be considered zero i.e. r = 0 . Thus the closed loop output feedback problem is reduced to a state-feedback regulator problem. Clearly, for set-point r = 0 , the error signal becomes e = r − y = − y . Thus, the output signal y = −e = − x2 . Now, the FO process in [15][12] with a time delay term is given by (7). Y ( s ) Ke − Ls = U ( s ) Tsα + 1 ⇒ − E ( s ) Ke − Ls = U ( s ) Tsα + 1 (7) ⇒ TDα [ x2 (t ) ] + x2 (t ) = − Ku (t − L) Assuming zero initial condition for fractional derivative composition rule, (7) reduces to (8). TDα − µ x3 (t ) + x2 (t ) = − Ku (t − L) ⇒ Dα − µ x3 (t ) = − 1 K x2 (t ) − u (t − L) T T From (6)-(8) we get (9). 7 (8)  D λ x1 ( t )   0 1  µ   0  D x2 ( t )  =  0  Dα − µ x3 ( t )   0 −1 T   0   x1 (t )   0  1   x2 (t )  +  0  u (t − L) 0   x3 (t )   − K T  (9) This is the representation of the above dynamical system with the FOPID controller in a generalized incommensurate FO state-space template, i.e. d q x (t ) dt q dq  dλ Here, q =  λ dt  dt dµ dt µ = Ax ( t ) + Bu ( t − L )  d −λ e (t ) d α −µ  T and x t =  x t x t x t  = e (t ) ( ) ( ) ( ) ( )   2 3 −λ  1  dt α − µ   dt T (10) d µ e (t )   . dt µ  T The FO system matrices are given by (11). 1 0  A = 0 0  0 −1 T 0  0   1  ; B =  0   − K T  0  (11) Since the augmented state space framework (9) has different fractional orders, with a scope of independently choosing the systems and controller orders, the system can be viewed as an incommensurate FO linear dynamical system. If the system is delay free ( L = 0 ), the fractional state space reduces to the following simple form (12) which is similar to the quadratic optimal control problems often referred in the literatures of analogous integer order systems. d q x(t ) = Ax(t ) + Bu(t ) dt q (12) Equation (11) represents the open loop system combing both the system and the controller in a generalized incommensurate FO state-space model. The stability criteria for such FO system is not the same as that of the integer order system. Even the right-half plane poles or eigenvalues of the closed loop matrix ( Ac = A − BF ) can be stable since the instability region is squeezed from [ −π 2, π 2] to [ −qπ 2, qπ 2] , if it is assumed that state space representation is in commensurate form with order q, as a special case of the incommensurate augmented FO system. In addition, the open loop system in (11) should not be judged alone for stability since the LQR formulation with proper weight selection inside the optimization routine calculates the state feedback gains (F) which again enforces the stability of the closed loop system using ITSE vs. ISDCO criteria. It is also important to emphasize that the general solution of the FO systems converges to the classical integer order Riccati equation only under the assumption that the system is around middle of the control process and the time varying Riccati differential equation has a steady-state solution [38]. Q1 0 0   P11 P12 P13    Along with these two assumptions, let Q =  0 Q2 0  and P =  P12 P22 P23  which are used to  0 0 Q3   P13 P23 P33  solve the CARE in (2). For a guess value of the weighting matrix Q and R, the elements of the 8 positive definite Riccati solution matrix i.e. { P11 , P22 , P33 , P12 , P13 , P23 } can be obtained using MATLAB function lqr(). Therefore, the state feedback gain matrix (F) is obtained as:  P11 1 K  F = R B P = 0 0 −   P12 R T  P13 −1 P12 P22 P23 T P13  P23  P33   K   K   K  = R −1  − P13   − P23   − P33     T   T   T =  − Ki −K p (13) − K d  Since the state variables are chosen in such a way that it represents the error signal and its fractional differ-integrals, the design of the optimal state feedback regulator yields the PIλDµ controller gains as the optimal state feedback gain matrix (F). The corresponding optimal control law is given by (14). u (t ) = − Fx(t ) = − R −1 BT Px(t )  d − λ e(t ) = −  − Ki − K p − K d   e(t ) −λ  dt d µ e(t ) = K p e(t ) + Ki ∫⋯ ∫ e(t )dt + K d dt µ d µ e(t )   dt µ  T (14) λ − fold 3.3. Modification of LQR formulation for time delay systems It is well known that the LQR framework cannot lead to a guaranteed stabilizing controller if the system has inherent time delay. In standard process control problems, suitable control algorithms like Smith predictors, dead-time compensator, model predictive control etc. are commonly employed for handling large process delays [49]. Optimization based time domain and frequency domain FOPID controller design in industrial process control having large time-delay are discussed in [7][9][14]. Since, the task here is to design an optimal state feedback regulator based FOPID controller, the LQR framework needs to be suitably modified that can stabilize the large process delay without the loss of the optimality condition. We here adopt two such design frameworks which preserves the optimality of state-feedback regulator even for a time-delay system viz. (i) by fusing the time delay in the system matrices, proposed by Cai et al. [50] and (ii) multiplying nominal delay-free state-feedback gain with an exponential term by He et al. [5]. 3.3.1. Fusion of time delay with system matrices Cai et al. [50] derived an algorithm to handle systems with time delay using optimum LQR controllers by modifying the system matrices. In this approach, it is shown that the continuous time linear time invariant (LTI) system with delay (L) of the structure xɺ ( t ) = Ax ( t ) + Bu ( t − L ) can be modified using suitable transformations to produce an LQR framework similar to a delay-free system where the modified system matrices capture the effect of the explicit time delay term. In such a case, the CARE is derived with the augmented system matrices as in (15). AT P + PA − P  B ( A )  R −1  B ( A )  P + Q = 0 T 9 (15) where, the modified input matrix for the time delay systems is represented by (16) and the time delay (L) appears within the modified input matrix  B ( A)  as an exponential term containing the product of stability matrix A and the process delay L. B ( A) = e− AL B (16) It is clear that equation (15) is given by the same algebraic Riccati equation (2) except the original input matrix (B) is replaced by the modified input matrix  B ( A )  to handle the explicit time delay term in the state equation. It has been shown in [50] that in steady state (by neglecting transients of a time varying control term), the control signal is obtained as (17) where P is the symmetric positive definite solution of equation (15). u (t ) = − F x (t ) = − R −1  B ( A )  Px (t ) = − R −1 B T  e − AL  Px (t ) T T (17) In addition, the weighting matrices for the LQR i.e. {Q, R} and integro-differential orders {λ , µ} are chosen using multi-objective NSGA-II algorithm while minimizing the ITSE representing good set-point tracking and ISDCO representing minimum variation of the manipulated variable to obtain the trade-off between them. With the assumptions of the process being in the middle of the final control time and with a steady state Riccati solution P , the delayed FO model in (10) can now be reduced to the standard delay free FO state-space (12) with modified input matrix (16). The optimal state-feedback controllers can now be obtained using the standard Riccati equation but with the modified input matrix  B ( A )  , as shown in (15). 3.3.2. Multiplying nominal state-feedback gains with an exponential term containing the product of closed loop matrix and delay He et al. [5] developed a method where the controller gains are initially time varying. Finally as the transient response crosses the system delay (L) after a set-point change, the controller gains become constant. The steady state controller gains that stabilize a similar state space model with time delay, has been derived from the LQR theory which results in an additional exponential term along with the traditional state feedback gains F in (13). The steady state control signal for He’s method [5] of handling time delay systems with LQR formulation and steady state value of the time varying PID controller gains are given by (18). u ( t ) = − R −1 BT Pe ( A− BR −1 T ) B P L x(t ) , t ≥ L = − Fe( A− BF ) L x(t ) = − Fe Ac L x(t ) (18) Here, the closed loop matrix Ac = A − BF , where F refers to the optimal state feedback gains for the delay free system in (12). Therefore, a second formulation is obtained to handle the time delay term within the LQR design. The similarity between these two formulations is that both of them ignores the transient dynamics of the controller which is implemented as a small time varying term within the interval t < L and both of them contains an exponential term involving the time delay of the process. The difference between the control actions in (17) and (18) is that the Riccati solution of Cai’s method [50] is based on the modified CARE (15) i.e. P involving modified input matrix  B ( A )  but in He’s 10 method [5] the same Riccati solution (P) and state feedback gains (F) are used along with some additional terms. This paper compares which formulation among these two is capable of producing a non-dominated Pareto front indicating better control performance. 3.4. Optimum selection of weighting matrices of LQR using two conflicting time-domain control objectives The above two LQR formulations are optimal for a specific choice of the weighting matrices Q and R. Indeed, the time domain performance is heavily affected for any arbitrary choice of the LQR weights, although in each case the state optimality is preserved from (1). This is logical since the choice of weighting matrices determine the state feedback gains (PIλDµ controller gains in this case) that directly affect the performance of the closed loop system. In order to handle this problem, a MOO technique is employed by minimizing two conflicting time domain performance indices J1 and J 2 (19) as also studied in [15]. This tunes the elements of the diagonal elements of the weighting matrix and weighting factor i.e. {Q1 , Q2 , Q3 , R} [19] and integro-differential orders of the FOPID controller i.e. {λ , µ} [40]. ∞ J1ITSE = ∫ te 2 (t )dt , 0 ∞ ( u (t ) − uss ) 0 J 2ISDCO = ∫ 2 dt (19) Such a choice of control objectives has been reported to have a design trade-off since higher speed of tracking for the process variable needs large perturbation of the manipulated variable or the control signal [15], [14]. Thus instead of focusing on a particular controller minimizing a single objective function as weighted sum of two objectives ITSE and ISDCO [14], a set of controllers that lie on the Pareto front is sought, since optimal choice of such weights of the two parts of the cost function are often heuristic and largely depends on the controller and the system under control [15]. Thus some of the solutions may give good performance in terms of one objective at the cost of deterioration in the others, while for other solutions on the Pareto front it would be vice-versa. Hence the set of non-dominated solutions obtained on the Pareto front give the limits of the controller performance. Thus the controller solutions lying on the Pareto front cannot perform better in one control objective without a corresponding deterioration in the performance of the other. The rationale for using these specific integral performance indices in (19) is to get a good time domain response and at the same time to limit the deviation in the controller output to avoid actuator saturation and integral wind-up [3]. Instead of the ITSE criterion for set-point tracking, other criterion like Integral of Time multiplied Absolute Error (ITAE) or Integral of Absolute Error (IAE) could have been used which would have resulted in smaller penalty for high oscillations at later stages [9][2]. The deviation of the control signal is also minimized in the form a performance index known as ISDCO to limit violent perturbation of the manipulated variable. At a first glance this might seem as a redundant criteria since the LQR methodology already gives optimal values of the controller gains with the lowest cost. However, this is actually obtained for a fixed value of the weighting matrices. When Q and R are varied, for each choice of weighting matrices, the LQR would give an optimal gain with the lowest possible cost, but that does not necessarily imply a good time domain performance [4], [19], [21], [22] with the LQR cost function (1). Also, for an optimal choice of weighting matrices (Q and R) and differ-integral orders (λ and µ), the FOPID tuning problem becomes optimal due to the introduction of time domain performance indices (19) as well as the classical optimal regulator (LQR) based approach (1), involving the fractional states. 11 3.5. Multi-objective optimization framework for tuning LQR weights and FOPID orders A generalized multi-objective optimization framework can be defined as follows: Minimize F ( x) = ( f1 ( x), f 2 ( x),..., f m ( x)) subject to : gi ( x ) ≤ 0, ∀ i ∈ [1, p ] , (20) h j ( x ) = 0, ∀ j ∈ [1, q ] such that x ∈Ω . m where, Ω is the decision space, ℝ m is the objective space, F : Ω → ℝ consists of m real valued objective functions and gi ( i ) and h j ( i ) are the optional p number of inequality and q number of equality constraints on the problem respectively. Let, u = {u1 ,..., um } ∈ℝm and v = {v1 ,..., vm } ∈ ℝm be two vectors and u is said to dominate v if ui < vi ∀ i ∈{1,2,..., m} and u ≠ v . A point x* ∈Ω is called Pareto optimal if ∃x | x ∈Ω such that * F ( x) dominates F ( x ) . The set of all Pareto optimal points, denoted by PS is called the Pareto set. The set of all Pareto objective vectors, PF = {F ( x) ∈ ℝ m , x ∈ PS } , is called the Pareto Front. This implies that no other feasible objective vector exists which can improve one objective function without simultaneous worsening some other objective function. The NSGA-II algorithm [43] converts m diverse objectives into one single fitness function by creating a number of different fronts. The solutions on these fronts are refined iteratively based on their distance with their neighbours (crowding distance) and their level of non-domination. The NSGA-II algorithm ensures that the solutions found are close to the original Pareto front and are diverse enough to find the whole length of the Pareto front. For the present simulation study, the population size is taken as 100 and the number of generations as 100. The elite count represents the number of fittest individuals which are directly copied over to the next generation. The Pareto fraction in this study is considered as 0.7. An intermediate crossover scheme is adopted which produces off-springs by random weighted average of the parents. The mutation scheme adds a random number at an arbitrary point in the individual. The variables that constitute the search space for the LQR based FOPID design are {Q1 , Q2 , Q3 , R, λ , µ} . The intervals of the search space for these variables are {Q1 , Q2 , Q3 , R} ∈ [ 0,100] and {λ , µ} ∈ [ 0,2] . In fact, with this search interval, the number of state variables remains always three in the state space formulation (9) even though the integral and differential orders may take values higher than unity, representing faster time response and better loop stability respectively. The MOO algorithm is terminated when the average change in the Pareto spread of the generation is not significant. It is also possible to encounter local minima in the objective function space within the MOO. In order to ensure that a true global minima has been found, we ran the algorithm multiple times and report here the best result with the most non-dominated Pareto front. Also, in the present design scenario, the LQR weights does not need any particular initialization as they are chosen with an MOO algorithm which automatically takes random initial guess values every time. The initialization of LQR weights is an important issue when the optimization is a deterministic one like any gradient-descent algorithm and the application is intended for online implementation for example in [51]. 12 Also unstable response within the optimization routine shows high values of the chosen cost functions – ITSE and ISDCO and are therefore automatically rejected if a bad random guess is encountered. This way the MOO evolves over the iterations to yield better solutions by simultaneously minimizing both the design objectives – finally giving the optimal Pareto front on which all the solutions are not only stable but also represent the best possible trade-off between the two conflicting objectives. 4. Illustrative examples The FO plants that have been considered here, show heavily oscillatory and sluggish open loop response as shown in Figure 2. The process parameters of the two test plants in NIOPTD structure have been chosen from the study by Ruszewski [52]. Figure 2 also shows that the FO processes (7) exhibit sluggish and oscillatory open loop dynamics for (α < 1) and (α > 1) respectively which is also evident from the sharp increase in the system H∞ norm for (α > 1) . It is observed that the system shows oscillatory ( 2 > α > 1 ) and sluggish ( 1 > α > 0 ) open loop response, even with the simple first order plus time delay (FOPTD) like FO template due to the presence of higher order dynamics of the plant which can be easily and compactly modelled as a FO transfer function with delay. The present simulation studies are reported using the FOMCON toolbox [53] and the performance measures are calculated on a finite time horizon of 100 sec. Figure 2: Open loop step response and Bode magnitude diagram of NIOPTD plant (7) with K=1, L=0.5, T=2 with change in α, exhibiting sluggish and oscillatory dynamics. 4.1. Oscillatory fractional order process with time delay The oscillatory system under consideration is represented by the following lag-dominant ( T > L ) transfer function [52]: G1 ( s ) = 1e−0.5 s 2s1.5 + 1 13 (21) Figure 3 shows the obtained Pareto fronts for the NIOPTD process using both Cai’s method [50] and He’s method [5]. It is observed that both the methods can handle time delays and give a set of nondominated solutions on the Pareto front. For the set of solutions obtained with Cai’s method, lower values of ITSE are obtained at the cost of higher values of ISDCO. On the other hand, for He’s method, the Pareto optimal solution set contains lower values of ISDCO at the expense of higher values of ITSE. However, in He’s method, the solutions lie on the convex side of those with Cai’s method. This implies that the solution obtained using He’s method are better (non-dominated with respect to Cai’s method). Next, three representative solutions are chosen on the Pareto front with He’s method i.e. { A1 , B1 , C1} and the corresponding time domain simulations are shown as well. These solutions are the ones at the extreme end and the median solution on the Pareto front. Figure 4 show the time domain evolution of the process output, controller output and states for the three representative solutions on the Pareto front {A1, B1, C1} using the non-dominated He’s method of LQR-FOPID. A load disturbance is applied at the later stages of settling down the oscillation for set-point change and the disturbance rejection properties of the obtained controller are also investigated. As can be inferred from the Pareto front and also the time domain simulations, the solution C1 has the highest overshoot and settling time than the solution A1, whereas the solution B1 lies in between. However it is the other way round for the control signal. Solution A1 has the highest deviation in control signal and C1 has the lowest. Hence the simulation results verifies our proposition that the set point tracking and the control signal are conflicting objectives. Solution A1 gives the best load disturbance rejection over B1 and C1. However, the load disturbance rejection was not explicitly taken into the optimization framework unlike [14] since its integration within an LQR framework is not very popular. The simulation studies show that the solutions would work in a practical setting as well, as physical processes must be able to reject load disturbances to a sufficient level for effective functioning. Since the LQR based method also minimizes the deviation in the state trajectories, the state variables i.e. the loop error and their fractional differ-integrals have also been shown in Figure 4. Figure 3: Pareto fronts of NIOPTD plant with FOPID controller using two methods of handling time delay in LQR: (left) oscillatory process (21) (right) sluggish process (22). 14 Figure 4: Time response, controller output and state trajectories of oscillatory NIOPTD plant (21) with LQR based FOPID controller for solution A1 4.2. Sluggish fractional order process with time delay A sluggish process is considered next having the lag-dominant ( T > L ) transfer function (22), similar to that studied in [52]. G2 ( s ) = 1e−0.5s 2s0.5 + 1 (22) Figure 3 shows the Pareto fronts for the sluggish NIOPTD processes with both the Cai’s method [50] and He’s method [5] for handling the time delay in an LQR framework. As can be seen in this case, the Pareto front obtained using Cai’s method has a larger spread, i.e. has got more diverse nondominated LQR-FOPID solutions. Therefore, three representative solutions (A2, B2, C2) are chosen on this Pareto front and the time domain responses are plotted for each of the cases in Figure 3 respectively. As can be seen from the Pareto front and also from the time domain simulations, the Solution A2 has the fastest settling time (within 20 seconds), while it is longer for solutions B2 (settling time within 40 seconds) and solution C2 (settling time within 100 seconds). However an investigation into the time domain evolution of the control signals would show that solution A2 has a much higher control signal than solutions B2 and C2. This again reaffirms the proposition that better time domain performance can only be obtained at the expense of increased control cost [14]. The load disturbance rejection performances for the three solutions show that A2 performs the best in this category, followed by B2 and lastly C2. Table 1 and Table 2 report the numerical values of the representative solutions on the Pareto fronts which are obtained after multi-objective optimization. Table 1 shows the three representative solutions as the LQR weighting matrices and FOPID integro-differential orders from each of the best Pareto fronts for time delay handling i.e. using He’s and Cai’s method to control the oscillatory and sluggish NIOPTD plants respectively. From the LQR weights given in Table 1, the FOPID gains can 15 be calculated by solving the matrix Riccati equations, corresponding to two different methods discussed for time delay handling and have been reported in Table 2. Table 1: Representative solutions on the Pareto front showing the LQR matrices for lag-dominant processes using different delay handling methods Type of Process Oscillatory lag dominant (α = 1.5) Sluggish lag dominant (α = 0.5) Time delay handling in LQR formulation He’s method [5] Cai’s method [50] Solution Q1 Q2 Q3 R λ µ A1 0.970396 0.040181 0.022387 0.204583 1.071069 0.716467 B1 0.643793 0.02965 0.062444 0.34342 1.133782 0.449655 C1 0.086837 0.023281 0.095594 0.992322 1.382362 0.035294 A2 0.605858 0.080236 0.057087 0.946696 0.995725 0.026867 B2 0.061832 0.033902 0.09303 0.873642 0.891239 0.026349 C2 0.049785 0.026213 0.098279 0.918109 0.754981 0.026134 From the above simulations, apparently it may appear that He’s method of LQR-FOPID for oscillatory NIOPTD plants and Cai’s method of LQR-FOPID for sluggish NIOPTD plants yields better non-dominated Pareto fronts using ITSE and ISDCO criteria. However, consistent winning of one method over the other for a class of FO process needs to be verified for varying level of dominance between the time delay and time constant (lag), along with variation in the characteristics exponent (α) of the FO process which are reported in the following sub-sections. Table 2: Representative solutions of tuned controller parameters on the Pareto front along with objective function values for the lag-dominant processes Type of Process Oscillatory lag dominant Sluggish lag dominant Solution on the nondominated Pareto front ITSE ISDCO Kp Ki Kd λ µ A1 0.515799 32.10448 0.6718 0.9327 2.053 1.071069 0.716467 B1 0.816633 8.217709 0.5692 0.7092 1.8411 1.133782 0.449655 C1 3.116587 1.434095 0.2182 0.0903 0.9434 1.382362 0.035294 A2 0.772218 8.874867 0.8 0.9186 2.6498 0.995725 0.026867 B2 8.720682 1.452479 0.266 0.119 1.1945 0.891239 0.026349 C2 17.32365 1.067778 0.2329 0.0791 1.0728 0.754981 0.026134 Now, the robustness property of the median solutions of the FOPID controller (with the parameters give in Table 2) on the Pareto front are explored in Figure 6, for the two chosen plants with oscillatory (B1) and sluggish (B2) open loop dynamics. The purpose here is to show how the closed loop performance changes with variation in the time constant (T) and delay (L), while the FOPID controller parameters are kept fixed. The parametric robustness in Figure 6 is shown in terms of increase in both the ITSE and ISDCO measures for the best delay handling scheme reported in 16 Table 1 and Table 2. As expected, for the oscillatory process (α = 1.5), both the performance measures deteriorates much faster than that of the sluggish process (α = 0.5). The decrease in the closed loop performance is inevitable while considering a significant deviation from the nominal process parameters which were used for tuning the controller. Figure 6 shows that the ITSE and ISDCO measures does not blow up and is still capable of stabilizing the process as well as keeping the deterioration of closed loop performances within allowable limits. Figure 5: Time response, controller output and state trajectories of sluggish NIOPTD plant with LQR based FOPID controller for solution A2 Figure 6: Robustness of the Pareto median solution against variation in process delay and lag. 17 4.3. Multi-objective control of lag dominant, balanced lag delay and delay dominant plants Figure 7: Comparison of the Pareto fronts for the oscillatory NIOPTD processes (α>1). Figure 7 shows the comparison of the Pareto fronts with the two delay handling techniques (Cai’s and He’s method) for different values of α that determines the oscillatory and sluggish behavior of the open loop system as shown in Figure 2. We here explore which method has yielded a nondominated Pareto front for the three different class of NIOPTD processes viz. lag-dominant ( T > L ), balanced lag and delay ( T ≈ L ) and delay dominant ( T < L ) processes. From Figure 7, it is evident that for the balanced lag-delay processes the Cai’s method and for the delay dominant processes the He’s method gives a better non-dominant Pareto front, although the length of the Pareto front may vary, depending on the oscillatory nature (α) of the open loop process. Whereas for the lag-dominant processes the Pareto fronts are comparable and as such there is no clear winner. It is evident that for lag-dominant processes Cai’s method keeps the ITSE low but cannot restrict an increase in ISDCO whereas the observation is just the reverse with He’s method resulting in low ISDCO but increased ITSE. In some cases, two Pareto front cuts each other which indicates a weak Pareto dominance, as such one controller is better only in a particular regime. A mixed response is observed for the sluggish NIOPTD processes in Figure 8, especially in the balanced lag-delay and delay dominant processes where the He’s method outperforms the Cai’s method in providing non-dominated Pareto fronts. But for α = 0.6 and α = 0.8, Cai’s method is slightly better. For these two values of α, the lag-dominant processes show comparable results with both the methods. For highly sluggish lag-dominant NIOPTD processes (α = 0.2), He’s method keeps the ISDCO low and Cai’s method yields low ITSE, whereas for moderately sluggish (α = 0.4) lagdominant process, He’s method clearly outperforms the other. Also, in both Figure 7 and Figure 8, some of the Pareto fronts are discontinuous indicating forbidden regimes in the MOO space. This discontinuity in the Pareto fronts could be a result of partitioning in the dynamical characteristics for FO elements below and above one, using the rational approximation, or could be an effect of the process itself which does not yield any stabilizing FOPID controller to operate in that particular regime. These discontinuity in the Pareto fronts needs to be investigated in future studies. 18 Figure 8: Comparison of the Pareto fronts for the sluggish NIOPTD processes (α<1). Table 3: Summary of the non-dominated Pareto fronts for different NIOPTD process order and dominant characteristics Process characteristics NIOPTD process order Lag dominant α = 0.2 He’s method He’s method He’s method α = 0.4 He’s method weak dominance He’s method α = 0.6 He’s method Cai’s method He’s method α = 0.8 weak dominance Cai’s method He’s method α = 1.2 weak dominance Cai’s method He’s method α = 1.4 weak dominance Cai’s method He’s method α = 1.6 weak dominance Cai’s method He’s method α = 1.8 weak dominance Cai’s method He’s method Balanced lag and delay Delay dominant Comparing the results obtained in section 4.1-4.3, we can conclude that the non-dominated Pareto front between the two delay handling methods not only depend on the process characteristics but also on the nature of its open loop dynamics, characterized by its order α. As shown in Table 3, for delay dominant plants, He’s method is consistently better. For balanced lag-delay processes, in most of the cases Cai’s method is better. For lag-dominant processes, both the methods give good result and are comparable to each other which produces a weak dominance between the two methods. 19 Especially in industrial control with very high order process dynamics (modelled by the NIOPTD process) and large time delay, the results reported in Figure 8 could be useful in selecting the delay handling methodology with an optimal FOPID controller. It has been shown in [9], [14] that very high order process models can be compactly represented as FO transfer function template NIOPTD. The model reduction results has been established on the higher-order test bench plants, available in contemporary literature [14][9]. Therefore, our results are based on the assumption that the higher order process dynamics could be faithfully represented in the NIOPTD template and we here focus on the results of LQR based FOPID controller to handle such FO processes. 4.4. Summary of the proposed approach and translating LQR trade-off design in FOPID tuning rules for NIOPTD plants The steps of the proposed LQR-FOPID design algorithm is summarized below: Step 1: Reduce higher order oscillatory/sluggish process dynamics in NIOPTD template (7). Step 2: Run MOO algorithm to select LQR weights {Q, R} and FOPID orders {λ, µ} using ITSE and ISDCO as the two conflicting objectives (19). Step 3: Select the transformation by Cai’s method (17) and He’s method (18) for time delay handling within LQR. Step 4: Solve the associated CARE within the MOO to calculate FOPID gains {Kp, Ki, Kd} and obtain the Pareto front. Step 5: Select the non-dominated Pareto front between Cai’s and He’s method. Step 6: Select the median solution on the non-dominated Pareto front as a trade-off design. Step 7: Check for the robustness of the FOPID controller settings by varying the process parameters. Also, similar to the rule based PID gains selection, recent studies have also suggested using tuning rules to select integro-differential orders {λ, µ} of the FOPID controller. Most results have been reported for integer order plants [11], [10], but the counterpart for FO processes have not been investigated yet. However none of the above tuning rules consider the multi-objective LQR formalism and report design trade-offs between conflicting objectives. Also, any such tuning rule to select either the FOPID gains or orders will not give the design trade-offs between the two chosen objectives which is the prime focus of this paper. Rather a specific tuning rule will give a single point on the chosen objective function space. Therefore, the integro-differential orders are selected along with the LQR weights using an MOO algorithm which evolves over the generations yielding a non-dominated Pareto optimal front that can be considered as the achievable optimal trade-off design [15], [54], using a particular controller structure. Next, the analytical expressions of the five FOPID parameters are to be formulated (including the integro-differential operators) as functions of the FO process parameters {L, T, α} – showing both sluggish and oscillatory open loop dynamics. The tuning rules are useful for easy calculation of the FOPID parameters to control the FO plant without running the optimization to get the trade-offs. The tuning rules are also optimum since it balances both the conflicting objectives, as their median solution on the Pareto front. On the other hand, the LQR optimality of the FOPID controller is already enforced within the problem formulation while also efficiently handling the time delays. The median values are selected from the non-dominated Pareto front (between He’s and Cai’s method) and are 20 reported in the supplementary material. Using the data reported in the supplementary material, the tuning rules are now generated for the FOPID controller tuning knobs, as a function of two significant NIOPTD process parameters – delay to lag ratio (L/T) and order of the process (α). The goodness of fit measures are also computed for the tuning rules as a test of true representation of the data used to construct the rules as shown in Figure 9: Fitted tuning rule surface and contours for the five FOPID parameters. . The fitted surface and contour plots of the tuning rules for five FOPID parameters are depicted in Figure 9. One outlier in Kp and Kd are removed before fitting the tuning rule using polynomial regression. In the tuning rule generation process, the orders of both (L/T) and α have been varied from one to four and the best model was selected with highest adjusted coefficient of determination (adjusted R2). Here the adjusted R2 is chosen as the deciding statistical measure for model selection since it penalizes more complex models unlike R2, thus reducing the chance of overfitting. The adjusted R2 also does not capture the effect of different scales of the independent variables similar to the Root Mean Squared Error (RMSE). Therefore, although more complex models could have been yielded a better fit and push the R2 near one, the adjusted R2 provides a safe-guard against complex rule generation (using only R2) [11]. It also avoids the discrepancy due to difference in scaling of the two input variables (L/T) and α (using only RMSE). The tuning rules for the median non-dominated LQR-FOPID controllers are given in (23) as a polynomial model in (L/T) and α, of the order of 2 and 4 respectively and the associated coefficients of the polynomial models for all these five parameters are reported in Table 5. {K p , K i , K d } =  f ( L T , α )  K , {λ , µ} = f ( L T ,α ) f ( L T , α ) = p00 + p10 ( L T ) + p01α + p20 ( L T ) + p11 ( L T ) α + p02α 2 2 + p21 ( L T ) α + p12 ( L T )α 2 + p03α 3 + p22 ( L T ) α 2 + p13 ( L T )α 3 + p04α 4 2 2 21 (23) Figure 9: Fitted tuning rule surface and contours for the five FOPID parameters. 4.5. Discussions on achievements, assumptions and limitations The contribution of this paper, can be considered as the successful integration of LQR theory for the design of optimal FOPID controllers for FO processes with time delay within an MOO framework. As in many other design problems of LQR, the system has been considered to be linear and noise free. The main emphasis is to show that an LQR based FOPID controller could be designed for a class of FO systems – NIOPTD, exhibiting both oscillatory and sluggish open loop dynamics. The design methodology would help to enjoy the state optimality of LQR technique even in the presence of process delay along with the externally imposed Pareto optimality between ITSE and ISDCO by obtaining the best set of trade-off values for the LQR weights and FOPID differ-integral orders. Table 4: Goodness of fit for the regression model in the tuning rules of five FOPID parameters FOPID parameter Order of (L/T) Order of α Adjusted R2 R2 RMSE 0.104 Kp 2 4 0.7875 0.8937 Ki 2 4 0.7328 0.8606 0.06512 Kd 2 4 0.9837 0.9919 0.09768 λ 2 4 0.9535 0.9758 0.05212 µ 2 4 0.899 0.8065 0.1268 Table 5: Coefficients of the regression model (23) for the tuning rules of five FOPID parameters Coefficients Kp Ki Kd 22 λ µ p00 0.4225 0.001375 3.39 0.5972 0.06535 p10 -0.3738 1.002 -3.976 -0.1805 0.1732 p01 -0.8846 0.7251 -8.749 -0.3615 -0.2331 p20 0.08037 -0.2251 0.8184 0.04781 0.1506 p11 2.079 -1.216 7.177 -0.3342 -0.2898 p02 0.05753 -1.36 12.95 2.808 0.3122 p21 -0.4099 0.3161 -1.484 0.08372 0.3712 p12 -1.245 0.09725 -3.758 0.03983 0.01343 p03 0.935 1.389 -7.427 -2.304 -0.05011 p22 0.1884 -0.07726 0.6184 -0.05261 -0.1479 p13 0.1266 0.07146 0.3642 0.08205 0.04369 p04 -0.3623 -0.4156 1.508 0.5399 -0.01218 Although our work uses the methodology described by Cai et al. [50] and He et al. [5] for handling time delay within LQR, these two design philosophies were discussed for integer order systems. Also, in the original literatures there were no guidelines to optimally choose the LQR weighting matrices. Here we extend these concepts to the context of FO time delay systems with sluggish and oscillatory dynamics using an incommensurate FO state space framework. In addition, a multi-objective trade-off design is proposed to select LQR weighting matrices and the FOPID integrodifferential orders and show how this affects two conflicting closed-loop performance objectives. Also, there have been exhaustive studies on directly tuning the FOPID controller parameters using single or multi-objective optimization algorithms [54]. In Das et al. [40], the advantage of weight optimized LQR-FOPID design has been shown over the direct parameter optimized FOPID design. In particular, due to the introduction of the LQR design in the present method, the optimality of state and control trajectories are automatically enforced which is not guaranteed with direct gain and order selection of FOPID controller with a global optimization algorithm [14]. Although the state vs. control optimality hold for a particular choice of Q and R due to LQR, yet it is not sufficient from the perspective of traditional time domain performance measures of the control system like set-point tracking, disturbance rejection etc. The dynamic characteristics of the closed loop system keeps on changing with different choice of the LQR weighting matrices. Also, the analytical state vs. control optimality is only valid for a particular choice of the weights which motivates the MOO based indirect approach of tuning the LQR weights along with FOPID orders in order to finally obtain the optimal FOPID gains. In the present study, the design has been restricted considering no change in set-point (r = 0) to develop the optimal state feedback stabilization scheme for the incommensurate FO system using LQR. Then a unit step change in the set-point was applied to select the LQR weights and FOPID orders through MOO and the disturbance rejection performances are also found satisfactory. In general LQR theory cannot automatically enforce a disturbance rejection criteria, although in process 23 control it is considered as an essential criterion. Our design is mainly based on LQR to preserve the state optimality of the FOPID control loop and in addition the tracking and control effort were optimized for a unit set-point change. The disturbance rejection performance was not optimized, since with such a criterion the resulting controller parameters would have been totally different and it may not always produce good set-point tracking and low controller effort [54]. The reported simulation study for both the oscillatory and sluggish FO plants show that with the proposed method apart from the considered objectives – ITSE and ISDCO, also a good disturbance rejection performance is achieved. Earlier literatures like [15], [54] reported FOPID design considering both tracking and disturbance inputs but without the consideration of LQR optimality. Bridging the disturbance rejection criteria with the LQR framework for FOPID design needs further investigation and we leave it as the scope of future research. 5. Conclusion An LQR based improved fractional order PIλDµ controller tuning has been proposed in this paper with optimal selection of weighting matrices for handling FO process with time delay, in a compact NIOPTD template. The optimal choice of the weighting matrices along with the FO differintegrals of the PIλDµ controller have been obtained through multi-objective NSGA-II algorithm, based on simultaneous minimization of two conflicting time domain integral performance indices – ITSE and ISDCO. Thus, the proposed method preserves the state optimality of LQR and at the same time gives a low error index in the closed loop time response while also ensuring stability and efficiently handling the time delay terms of FO process. These improvements enable the control designer to obtain satisfactory closed loop response while also enjoying the benefits of LQR in the optimal PIλDµ controller tuning. The MOO results in a range of controller parameters lying on the Pareto front as opposed to a single controller obtained by commonly adopting single-objective optimization framework, by satisfying different conflicting time domain objectives. It is shown that there exists a trade-off between the two time domain objectives and an improvement in one performance index would invariably result in a deterioration of the other. Thus the designer can choose a controller according to the specific requirements of his control problem. Our simulation results show that the proposed techniques works well even for a highly oscillatory and a highly sluggish FO system with time delay yielding a range of solutions on the Pareto front. For delay dominant plants our simulation shows He’s method and for balanced lag and delay plants Cai’s method perform better, whereas for lag-dominant systems the solutions are comparable. Tuning rules for the five optimal LQR-FOPID knobs have been provided as a function of process parameter – delay to lag ratio (L/T) and fractional exponent of the process (α). Future scope of work may include multi-objective LQR based FOPID controller tuning for unstable and integrating fractional order systems with time delay and extending the concept of FO-LQR to noisy processes using FO Kalman filter and Linear Quadratic Gaussian (LQG) technique. Appendix Median solutions of the non-dominated Pareto fronts for all the processes under investigation have been reported in the supplementary material. This data has been used for the tuning rule generation. Reference [1] B. Anderson and J. B. Moore, Optimal control: linear quadratic methods. Prentice-Hall, Inc., 1990. 24 [2] A. O’Dwyer, Handbook of PI and PID controller tuning rules, vol. 2. World Scientific, 2009. [3] R. Vilanova and A. Visioli, PID Control in the Third Millennium, Advances in Industrial Control. Springer, New York, 2012. [4] G.-R. Yu and R.-C. Hwang, “Optimal PID speed control of brush less DC motors using LQR approach,” in Systems, Man and Cybernetics, 2004 IEEE International Conference on, vol. 1, 2004, pp. 473–478. [5] J.-B. He, Q.-G. Wang, and T.-H. Lee, “PI/PID controller tuning via LQR approach,” Chemical Engineering Science, vol. 55, no. 13, pp. 2429–2439, 2000. [6] I. Podlubny, “Fractional-order systems and PIλDµ-controllers,” Automatic Control, IEEE Transactions on, vol. 44, no. 1, pp. 208–214, 1999. [7] C. A. Monje, Y. Chen, B. M. Vinagre, D. Xue, and V. Feliu, Fractional-order Systems and Controls: Fundamentals and Applications. London: Springer-Verlag London, 2010. [8] S. Das, Functional fractional calculus. Springer, 2011. [9] S. Das, S. Saha, S. Das, and A. Gupta, “On the selection of tuning methodology of FOPID controllers for the control of higher order processes,” ISA Transactions, vol. 50, no. 3, pp. 376– 388, 2011. [10] D. Valerio and J. S. Da Costa, An introduction to fractional control, vol. 91. IET, 2013. [11] S. Das, I. Pan, S. Das, and A. Gupta, “Improved model reduction and tuning of fractional-order PIλDµ controllers for analytical rule extraction with genetic programming,” ISA Transactions, vol. 51, no. 2, pp. 237–261, 2012. [12] Y. Luo and Y. Chen, Fractional Order Motion Controls. John Wiley & Sons, 2012. [13] I. Pan and S. Das, “Frequency domain design of fractional order PID controller for AVR system using chaotic multi-objective optimization,” International Journal of Electrical Power & Energy Systems, vol. 51, pp. 106–118, 2013. [14] I. Pan and S. Das, Intelligent fractional order systems and control. Springer, 2013. [15] S. Das, I. Pan, and S. Das, “Performance comparison of optimal fractional order hybrid fuzzy PID controllers for handling oscillatory fractional order processes with dead time,” ISA Transactions, vol. 52, no. 4, pp. 550–566, 2013. [16] S. Das, A. Gupta, and S. Das, “Generalized frequency domain robust tuning of a family of fractional order PI/PID controllers to handle higher order process dynamics,” Advanced Materials Research, vol. 403, pp. 4859–4866, 2012. [17] S. Das, N.-D. Molla, I. Pan, A. Pakhira, and A. Gupta, “Online identification of fractional order models with time delay: An experimental study,” in Communication and Industrial Application (ICCIA), 2011 International Conference on, 2011, pp. 1–5. [18] S. Das, S. Das, and A. Gupta, “Fractional order modeling of a PHWR under step-back condition and control of its global power with a robust PIλDµ controller,” Nuclear Science, IEEE Transactions on, vol. 58, no. 5, pp. 2431–2441, 2011. 25 [19] S. Das, I. Pan, K. Halder, S. Das, and A. Gupta, “LQR based improved discrete PID controller design via optimum selection of weighting matrices using fractional order integral performance index,” Applied Mathematical Modelling, vol. 37, no. 6, pp. 4253–4268, 2013. [20] T. Wang, Q. Wang, Y. Hou, and C. Dong, “Suboptimal controller design for flexible launch vehicle based on genetic algorithm: selection of the weighting matrices Q and R,” in Intelligent Computing and Intelligent Systems, 2009. ICIS 2009. IEEE International Conference on, vol. 2, 2009, pp. 720–724. [21] J. Liu and Y. Wang, “Design approach of weighting matrices for LQR based on multi-objective evolution algorithm,” in Information and Automation, 2008. ICIA 2008. International Conference on, 2008, pp. 1188–1192. [22] M. B. Poodeh, S. Eshtehardiha, A. Kiyoumarsi, and M. Ataei, “Optimizing LQR and pole placement to control buck converter by genetic algorithm,” in Control, Automation and Systems, 2007. ICCAS’07. International Conference on, 2007, pp. 2195–2200. [23] O. P. Agrawal, “A general formulation and solution scheme for fractional optimal control problems,” Nonlinear Dynamics, vol. 38, no. 1–4, pp. 323–337, 2004. [24] A. Shafieezadeh, Y. Chen, and K. Ryan, “Fractional order filter enhanced LQR for seismic protection of civil structures,” Journal of Computational and Nonlinear Dynamics, vol. 3, no. 2, p. 021404, 2008. [25] C. Tricaud and Y. Chen, “An approximate method for numerically solving fractional order optimal control problems of general form,” Computers & Mathematics with Applications, vol. 59, no. 5, pp. 1644–1655, 2010. [26] O. P. Agrawal, “A quadratic numerical scheme for fractional optimal control problems,” Journal of Dynamic Systems, Measurement, and Control, vol. 130, no. 1, p. 011010, 2008. [27] R. K. Biswas and S. Sen, “Fractional optimal control problems with specified final time,” Journal of Computational and Nonlinear Dynamics, vol. 6, no. 2, p. 021009, 2011. [28] R. K. Biswas and S. Sen, “Free final time fractional optimal control problems,” Journal of the Franklin Institute, vol. 351, no. 2, pp. 941–951, 2014. [29] X. W. Tangpong and O. P. Agrawal, “Fractional optimal control of continuum systems,” Journal of Vibration and Acoustics, vol. 131, no. 2, p. 021012, 2009. [30] R. K. Biswas and S. Sen, “Fractional optimal control problems: a pseudo-state-space approach,” Journal of Vibration and Control, vol. 17, no. 7, pp. 1034–1041, 2011. [31] Y. Ding, Z. Wang, and H. Ye, “Optimal control of a fractional-order HIV-immune system with memory,” Control Systems Technology, IEEE Transactions on, vol. 20, no. 3, pp. 763–769, 2012. [32] P. M. Czyronis, “Dynamic Programming Problem for Fractional Discrete-Time Dynamic Systems. Quadratic Index of Performance Case,” Circuits, Systems, and Signal Processing, pp. 1–19, 2014. [33] A. Dzielinski and P. Czyronis, “Fixed final time and free final state optimal control problem for fractional dynamic systems-linear quadratic discrete-time case,” Bulletin of the Polish Academy of Sciences: Technical Sciences, vol. 61, no. 3, pp. 681–690, 2013. 26 [34] N. Özdemir, O. P. Agrawal, B. B. Iskender, and D. Karadeniz, “Fractional optimal control of a 2-dimensional distributed system using eigenfunctions,” Nonlinear Dynamics, vol. 55, no. 3, pp. 251–260, 2009. [35] M. M. Hasan, X. W. Tangpong, and O. P. Agrawal, “Fractional optimal control of distributed systems in spherical and cylindrical coordinates,” Journal of Vibration and Control, vol. 18, no. 10, pp. 1506–1525, 2012. [36] T. L. Guo, “The Necessary Conditions of Fractional Optimal Control in the Sense of Caputo,” Journal of Optimization Theory and Applications, vol. 156, no. 1, pp. 115–126, 2013. [37] Y. Li and Y. Chen, “Fractional order linear quadratic regulator,” in Mechtronic and Embedded Systems and Applications, 2008. MESA 2008. IEEE/ASME International Conference on, 2008, pp. 363–368. [38] D. Sierociuk and B. M. Vinagre, “Infinite horizon state-feedback LQR controller for fractional systems,” in Decision and Control (CDC), 2010 49th IEEE Conference on, 2010, pp. 6674– 6679. [39] S. Saha, S. Das, S. Das, and A. Gupta, “A conformal mapping based fractional order approach for sub-optimal tuning of PID controllers with guaranteed dominant pole placement,” Communications in Nonlinear Science and Numerical Simulation, vol. 17, no. 9, pp. 3628– 3642, 2012. [40] S. Das, I. Pan, K. Halder, S. Das, and A. Gupta, “Optimum weight selection based LQR formulation for the design of fractional order PIλDµ controllers to handle a class of fractional order systems,” in Computer Communication and Informatics (ICCCI), 2013 International Conference on, 2013, pp. 1–6. [41] R. Caponetto, G. Dongola, L. Fortuna, and A. Gallo, “New results on the synthesis of FO-PID controllers,” Communications in Nonlinear Science and Numerical Simulation, vol. 15, no. 4, pp. 997–1007, 2010. [42] S. Das, I. Pan, and K. Sur, “Artificial neural network based prediction of optimal pseudodamping and meta-damping in oscillatory fractional order dynamical systems,” in Advances in Engineering, Science and Management (ICAESM), 2012 International Conference on, 2012, pp. 350–356. [43] K. Deb, Multi-objective optimization using evolutionary algorithms, vol. 16. John Wiley & Sons, 2001. [44] N. Aguila-Camacho, M. A. Duarte-Mermoud, and J. A. Gallegos, “Lyapunov functions for fractional order systems,” Communications in Nonlinear Science and Numerical Simulation, vol. 19, no. 1, pp. 2951–2957, 2014. [45] J.-C. Trigeassou, N. Maamri, J. Sabatier, and A. Oustaloup, “A Lyapunov approach to the stability of fractional differential equations,” Signal Processing, vol. 91, no. 3, pp. 437–445, 2011. [46] J.-C. Trigeassou, N. Maamri, and A. Oustaloup, “Lyapunov Stability of Linear Fractional Systems: Part 1—Definition of Fractional Energy,” in ASME 2013 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, 2013, pp. V004T08A025–V004T08A025. 27 [47] J. Sabatier, M. Moze, and C. Farges, “LMI stability conditions for fractional order systems,” Computers & Mathematics with Applications, vol. 59, no. 5, pp. 1594–1609, 2010. [48] M. Moze, J. Sabatier, and A. Oustaloup, “LMI tools for stability analysis of fractional systems,” in ASME 2005 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, 2005, pp. 1611–1619. [49] J. E. Normey-Rico and E. F. Camacho, Control of dead-time processes. Springer, 2007. [50] G.-P. Cai, J.-Z. Huang, and S. X. Yang, “An optimal control method for linear systems with time delay,” Computers & Structures, vol. 81, no. 15, pp. 1539–1546, 2003. [51] B. Basu and S. Nagarajaiah, “A wavelet-based time-varying adaptive LQR algorithm for structural control,” Engineering Structures, vol. 30, no. 9, pp. 2470–2477, 2008. [52] A. Ruszewski, “Stability regions of closed loop system with time delay inertial plant of fractional order and fractional order PI controller,” Bulletin of the Polish Academy of Sciences, Technical Sciences, vol. 56, no. 4, pp. 329–332, 2008. [53] A. Tepljakov, E. Petlenkov, and J. Belikov, “FOMCON: a MATLAB toolbox for fractionalorder system identification and control,” International Journal of Microelectronics and Computer Science, vol. 2, no. 2, pp. 51–62, 2011. [54] S. Das and I. Pan, “On the Mixed H2/H∞ Loop Shaping Trade-offs in Fractional Order Control of the AVR System,” Industrial Informatics, IEEE Transactions on, vol. 10, no. 4, pp. 1982 – 1991 , 2014. 28 16T Supplementary Material Table 1: Median solutions on the non-dominated Pareto front Process Type Lag dominant Balanced lag and delay Delay dominant Kp Ki Kd λ μ L/T α 0.2742 0.2952 1.4643 0.5908 0.0287 0.25 0.2 0.1368 0.2376 1.1798 0.6866 0.0138 0.25 0.4 0.1630 0.2653 1.0717 0.8634 0.0284 0.25 0.6 0.3392 0.3684 1.4124 0.9979 0.0206 0.25 0.8 0.2218 0.3013 1.7505 1.3476 0.0152 0.25 1.2 0.7017 0.5316 1.9313 1.2673 0.2538 0.25 1.4 0.7197 0.5679 1.8582 1.2067 0.5152 0.25 1.6 0.6429 0.5225 1.8176 1.2340 0.6094 0.25 1.8 0.2271 0.6640 0.0095 0.4276 0.9472 1 0.2 0.4045 0.6957 0.0333 0.4963 0.2792 1 0.4 2.3864 0.3661 3.1882 0.7451 0.0311 1 0.6 0.4247 0.3243 1.2120 0.9049 0.1082 1 0.8 0.8149 0.3449 1.6216 0.9846 0.1507 1 1.2 0.7910 0.3327 1.5229 1.0294 0.1728 1 1.4 0.7075 0.3045 1.3405 1.0799 0.2139 1 1.6 0.7338 0.2744 1.2289 1.1583 0.2126 1 1.8 0.3317 0.5251 0.0461 0.6242 0.4754 4 0.2 0.3264 0.5035 0.0558 0.7560 0.6224 4 0.4 0.3046 0.4583 0.0496 0.8389 0.6297 4 0.6 0.2921 0.4352 0.0494 0.8956 0.4760 4 0.8 0.2625 0.3784 0.0442 0.9515 0.6183 4 1.2 0.2528 0.3572 0.0416 0.9759 0.6438 4 1.4 0.2398 0.3373 0.0402 0.9949 0.6949 4 1.6 0.2111 0.3280 0.0406 0.9985 0.7702 4 1.8 R R R 1
3cs.SY
1 Some Theorems for Feed Forward Neural Networks arXiv:1509.05177v4 [cs.NE] 15 Oct 2015 K.Eswaran, Member IEEE and Vishwajeet Singh Abstract—In this paper we introduce a new method which employs the concept of “Orientation Vectors” to train a feed forward neural network. It is shown that this method is suitable for problems where large dimensions are involved and the clusters are characteristically sparse. For such cases, the new method is not NP hard as the problem size increases. We ‘derive’ the present technique by starting from Kolmogrov’s method and then relax some of the stringent conditions. It is shown that for most classification problems three layers are sufficient and the number of processing elements in the first layer depends on the number of clusters in the feature space. We explicitly demonstrate that for large dimension space as the number of clusters increase from N to N+dN the number of processing elements in the first layer only increases by d(logN), and as the number of classes increase, the processing elements increase only proportionately, thus demonstrating that the method is not NP hard with increase in problem size. Many examples have been explicitly solved and it has been demonstrated through them that the method of Orientation Vectors requires much less computational effort than Radial Basis Function methods and other techniques wherein distance computations are required, in fact the present method increases logarithmically with problem size compared to the Radial Basis Function method and the other methods which depend on distance computations e.g statistical methods where probabilistic distances are calculated. A practical method of applying the concept of Occum’s razor to choose between two architectures which solve the same classification problem has been described. The ramifications of the above findings on the field of Deep Learning have also been briefly investigated and we have found that it directly leads to the existence of certain types of NN architectures which can be used as a “mapping engine”, which has the property of “invertibility”, thus improving the prospect of their deployment for solving problems involving Deep Learning and hierarchical classification. The latter possibility has a lot of future scope in the areas of machine learning and cloud computing. Index Terms—Neural Networks, Neural Architecture, I. I NTRODUCTION typical classification or pattern recognition problem involves a multi-dimensional feature space. Features are variables: they can be, for example in a medical data, blood pressure, cholesterol, sugar content etc. of a patient, so each data point in feature space represents a patient. Data points will be normally grouped into various clusters in feature space, each cluster will belong to a particular class (disease), the problem is further complicated by the fact that more than one cluster may belong to the same class (disease). The problem in pattern recognition is how to make a computer recognize patterns and classify them. Such tasks in the real world can A This paper has been sent for publication. K. Eswaran is with the Department of Computer Science and Engineering, Sreenidhi Institute of Science and Technology, Jawaharlal Nehru University, Yamnampet, Ghatkesar, Hyderabad, Telangana, 501301 INDIA e-mail: [email protected]; Vishwajeet Singh is with Altech Power and Energy Systems, Villa Springs, Kowkur Bolarum Secunderabad,500010 INDIA e-mail: [email protected] be extremely complex as there may be thousands of clusters and hundreds of classes in a space of a hundred or more dimensions, therefore computers are used to detect patterns in such data and recognize classes for decision making. The trend in the last 25 years is to use an artificial neural network (ANN) architecture to solve such problems with the aid of computers. One of the great difficulties that researchers have been working with and enduring, is that there was no known method of obtaining a suitable architecture for a given problem and therefore various configurations of artificial neurons aligned in different arrays were tried out and after a great deal of trials one particular architecture which suited the present problem was finally chosen and used for pattern recognition and classification. However, it must be reiterated here that the theoretical basis of a feed forward neural network, was first provided by Kolmogorov(1957) ([1]), who first showed that a continuous function of n variables: f (x1 , x2 , ..xn ) can be mapped to a single function of one variable v(u). His monumental discovery was improved and perfected by others (Lorentz, Sprecher and Hect-Nielsen) ([2]-[6]) to demonstrate that his proof proved an existence of a three layer network for every pattern recognition problem that was classifiable. However, though his theorem proved the existence of a neural architecture, there was no easy way of actually constructing the mapping for a given practical problem ([7]-[12]). To quote Hect-Nielsen, “The proof of the theorem is not constructive, so it does not tell us how to determine these quantities. It is strictly an existence theorem. 1 It tells us that such a three layer mapping network must exist, but it doesn’t tell us how to find it” ([13]-[15]). Subsequently, Rumelhart, Hinton and Williams (1986) used the error minimization method to implement and popularize the Back Propagation (BP) algorithm which was discovered and developed by many researchers from Bryson; Kelley; Ho; Dreyfus; Linnainmaa; Werbos and Speelpeening during a 22 year period 1960-82 (see the comprehensive review by J. Schmidhuber [18] for precise historical details and references cited therein). The B.P. can be used for training artificial neural networks (ANN) consisting of multilayered processing elements (perceptrons) for solving general types of classification problems. Ever since then ANNs have been used over a very wide area of AI problems and currently in Deep Learning.Though these developments were wide and varied there was no good method of obtaining an optimal Architecture for an ANN for any particular problem. For a given problem and for a given data set, various number of processing elements and very many layers were tried out before arriving at a particular architecture which 1 Then he goes on to say “Unfortunately,there does does not appear too much hope that a method for finding the Kolmogorov network will be developed soon” 2 Figure 1. Cluster Problem for Classification suits the problem. However, this said, it was however well known that a three layer architecture is sufficient for any classification problem involving many samples which form clusters in feature space(Lippmamm, 1987, see Fig 14 in p.14 and Fig 15 p. 16 in [27]). The idea was that any group of clusters can be separated from the others by confining each cluster inside a polygon (or polytope ) by well defined lines or planes which form the convex hull of each cluster. See figure 2 below. sample points at the boundary of each cluster, leading to the so called Support Vector Machines which was introduced by Cortes and Vapnik [20], but even these could not get over the NP hard problem as was soon realized. (It will be seen later, how by adopting a new approach and the use of the concept of ’Orientation Vectors‘, [29]-[30] the problems of separability and outliers are tackled, see Fig. 4 ). In this paper we describe a method to dodge the problem; we show that it is really not necessary to find the convex hull of each cluster: all we require is that somehow we must be able to separate each cluster from the other by a single plane, if this is done, then the classification problem is much reduced and it can be performed by using a transformation from feature space (X-space) to another S-space in such a manner that each cluster finds itself, after transformation, in an unique quadrant in S-space and thus each cluster is easily classified needing much less planes. See figure 3, where only 4 planes are necessary compared to 43 planes in figure 2. Figure 3. Figure 2. Cluster Problem for Classification solved in conventional way A classifier can then easily be constructed to discover if any point (sample) lies within any particular polytope (cluster), all the classifier has to do is to check if the particular point lies within the bounding planes which circumscribe the polygon. For example, if the polygon is a triangle, then the classifier can find out if a particular point is within the triangle by verifying that it is within the three sides (planes) of the triangle. If there are many polygons then each of them can be represented by its bounding planes (convex hull), a classifier using ANNs can be built. By this means a three layer ANN network wherein the first layer consists of as many processing elements as the number of planes needed (in figure 2 we need 43) to form the convex hulls of all the polytopes in the sample space[27]. However, this procedure though correct was not practically feasible, and will probably never be, because finding the convex hull of a given region, let alone a number of regions, is a NP hard Problem and especially so in n-dimension feature space where the number of clusters are many and the number of planes involved would exponentially increase. It is appropriate to mention here that around 20 years ago there were attempts to define the convex hull of a cluster by using Cluster Problem for Classification solved by present method The purpose of this paper is to show that this can always be done for problems where the clusters are separable, that is if clusters belonging to different classes do not overlap in feature space (of course if there is an over lap there is no method which can work without adding new features in the study - thus essentially enlarging the dimension of the feature space). In very high dimension problems the clusters, in practical cases, will almost always be sparse 2 and this transformation from X-space to S-space performed in such a manner that the codomains are always within one quadrant in S-space is not only feasible but becomes a very powerful tool for classification, actually all the methods and results in this paper has been fashioned from this tool. We introduce the concept of “Orientation” vectors [29]-[30] to keep track of the clusters in feature space and solve the problem. The theorem determines, almost precisely, the number of processing elements which are needed for each layer to arrive at a “minimalistic” architecture which completely solves the classification problem. We further prove that this method of classification is NOT NP hard by showing that if the number of clusters, N, is increased then the number of 2 If there is an image involving 30 x 30 pixels, this means we are dealing with a 900 dimensions feature space, such a space will have 2900 ≈ 10270 quadrants; it will be hard to fill up this space even with one image per quadrant. Thus we see that the sample points are very sparsely distributed in feature space. 3 Figure 4. Cluster Problem for Classification with outliers are so devised that the “minimalistic” architecture 3 for each of them is known we can compare the various approximate with the exact solution. This study therefore gives an insight into how one may solve practical problems when the number of clusters are not known and the number of partitioning planes (half spaces) are not known but have to be guessed at. Section 5 is an application section where some suggestions as to how one may “guess” the number of clusters and the number of partitioning planes so that we can arrive at an approximation to the ’minimalistic‘ architecture. In section 6 we show that the present method is not NP hard. We end with a brief discussion on applications on Deep Learning and a Conclusion. 7 is the conclusion. II. A PPROACHES TO THE PROBLEM In this section we will detail our two approaches. processing elements in this minimalistic architecture, at worst increases linearly with N and at best increases by ∆(log(N )). There are two approaches that can be followed to develop the ideas given in the previous paragraph, but eventually it so turns out that they arrive at the same architecture, these are as follows: (i) We follow Kolmogorov’s approach but give up on the effort of exactly trying to map the exact geometrical domain of the functions, and do not try to obtain a continuous function that maps the exact geometrical domains of each cluster. Instead we use piece wise continuous functions. Further, we only make sure that we can choose planes that can separate one domain (cluster) from another, but assume that on each of these domains a single piece wise constant function is defined. (ii) We give up on the idea of solving the complex hull problem for each cluster (which is NP hard) or even on the idea of trying to confine each cluster within planes (Lippmann 1987) which will form a polygon (or polytope), so that all points that belong to the cluster are inside the polytope. Instead, we just try to look for planes which separate each cluster from another cluster by planes (half space), see figures 1 and 2. We show that if this is done then we can solve the classification problem with much less number of planes figure 3. For the purposes of completeness and also to underline the fact that the ANN method is also a mapping technique and is thus related to the Kolmogorov technique, we describe both methods (i) and (ii) in fair detail in Section 2, though they lead to the same architecture. In section 3, we provide a geometrical constructive proof, that under the conditions put forth in the theorem, which demonstrates how such a three layer network can be had if we are given the details of the piece wise function as described above. This is one of the theorems that we prove. In section 4 we construct example problems wherein we use our methods. These examples have been deliberately constructed with the intent to not only best illustrate the method but also to show how approximations to the classification problem can be made by assuming different ANN architectures and employ the BP algorithm to solve it. Since these examples A. The Kolmogorov approach As aforesaid, in this paper we solve a more restricted mapping problem which is suitable for most classification tasks. We do not require the general continuous functions of n variables f (x1 , x2 , ..xn ), but only require that our functions be “piece wise constant”, meaning that the functionf (x1 , x2 , ..xn ) take on some constant value in a closed set (region) (ie inside and on the boundary of a particular cluster), therefore the function is continuous for every point of a closed set. For example in figure 3: f (x1 , x2 , ..xn ) can take on some constant value c11 in the region 11 and some other constant value c43 in the region 43 , etc. in fact there is no loss of generality if we assume that c11 equals the class number 1 of the particular cluster 11 ie we may define c11 = 1, similarly we may define c43 = 3, 3 being the class number of cluster 43 . We further assume that the domain of each function is separable from other domains by planes (ie they are separable). This assumption allows us to immediately exploit the idea of finding the minimal number of planes that can separate the domains, thus if we know how a point (belonging to a domain) is “oriented” with respect to all the planes then we can quickly find out as to which domain the point belongs to. To draw a parallel with the work of Kolmogrov, we have found a way to map a “piece wise constant” function defined in n-dimension space to a function defined in discrete 1dimension space. A “piece wise constant”’ function in ndimension space f (x1 , x2 , ..xn ) (which takes input as points in the n-dimensional feature space and outputs the class number of that point) is mapped to an equivalent 1-dimensional function (v(u)) which takes input as the cluster number to which the point in n-dimensional feature space belongs and outputs the corresponding class number. The function (v(u)) takes as input one among a discrete set of values (cluster number) and its set of all output values also forms a discrete 3 The term ‘minimalistic’ that we use should be interpreted with caution, it generally means an architecture with the minimal number of processing elements in the 1st layer, this too is a bit imprecise: what we mean is the number of layers when we use a sigmoid function si = tanh(βyi ) with β large, say, β > 5. With smaller values of β it is possible to arrive at an architecture which has a few processing elements less than the this ‘minimalistic’ value, a point which becomes clear later on. 4 set (class number). Our construction also shows a unique way to map points in the n-dimensional feature space to their corresponding cluster number. By this method we use planes S1 ,S2 , S3 to separate the domains and perform the mapping. We will see that these planes are the same planes that are used in the second approach (next subsection), to separate the clusters in such a manner that no two clusters are in the same side of all the planes. B. Orientation Vector approach In this approach we use the concept of an ‘orientation vector’ to provide a geometrical constructive proof, under the conditions put forth in the theorem, which demonstrates how such a three layer network can be had if we are given the details of the piece wise function as described above. The proof also provides a method which would overcome some of the difficulties in arriving at a suitable architecture for a given data in a classification problem. It is shown that given a data set of clusters in feature space there exists an artificial neural network architecture which can classify the data with near 100 percent accuracy (provided the data is consistent and the train samples describe a convex hull of each cluster). Further, it is shown how by using the concept of an “orientation vector” for each cluster, an optimal architecture is arrived at. It is also shown that the weights of the second hidden layers are related to the orientation vector thus making the classification easily possible. We give 3 examples on the method each of increasing complexity. The purpose of these examples is to show how once the architecture of the network is fixed, the weights of the network can be easily obtained by using the Back Propagation algorithm to a feed forward network. III. S TATEMENT OF T HEOREM AND P ROOF Suppose there are m clusters of points in n dimensional feature space, figure 5 is a typical depiction, such that each cluster of points belongs to one of k distinct classes, and further if there exist q distinct n−dimensional planes which separate each cluster from its neighbors in such a manner that no two clusters are “on the same side” of all the planes, then it is possible to classify all the clusters by means of a feed forward neural network consisting of three hidden layers which has an architecture indicated as: q − m − k. That is the the neural network will have q processing elements in the first hidden layer, m processing elements in the second layer, and k processing elements in the last layer. The input to this neural net work will be n−dimensional, that is it will be the coordinates of a data point in n−dimensional space whose membership to a particular class will be ascertained uniquely by this neural network. The out put of this network will be k binary numbers, out of which only one of them will be 1 and the rest will be zero. In the k-dimensional output vector if the the first component is 1 then it means the input vector belongs to the first class, or if the second component is 1 it means that the input vector belongs to the second class ....and so on to the last (kth class ). In some notations which include Figure 5. Cluster of sample points in n-dimensional space the number of inputs, then the architecture would be denoted as: n − q − m − k. In the figure 5, we have chosen: q=5, m=8 and k=3, there are 8 clusters number 1 to 8, the suffix indicates the class assignment, for example cluster number 4 is denoted with a suffix 3 ie as 43 this just indicates that the points in this cluster belong to class 3, it may be noticed that there are other points in cluster number 8 which also belong to class 3. NOTE A: It is assumed that the q planes do not intersect any cluster dividing it into two parts, if there happens to be a particular cluster which is so divided i.e. if there is a plane which cuts a particular cluster into two contiguous parts, then the part which is on one side of this plane will be counted as a different cluster from the one which is on the other side : that is the number of clusters will be nominally increased by one : m to m + 1. NOTE B: It may be noticed that we assume that all points in a cluster belong to a single class (though the same class may be spread to many clusters, this assumption is necessary else it means that the n-features are not enough to separate the classes and one would require more features. Example suppose there is a sample point R which actually belongs to class 2 inside the cluster 43 , this means class 2 and class 3 are indistinguishable in our n-dimensional feature space and there should be more features added, thus increasing n. The proof of the theorem of course assumes that the dimension, n, of the selected feature space is sufficient to distinguish all the k classes. NOTE C: Perhaps it is superfluous to caution that figure 5 is a pictorial representation of n-dimensional space and a plane which is merely indicated as a single line is actually of n-1 dimensions and the arrow representing the normal (out of the plane) is perpendicular to all these n-1 dimensions. We prove our theorem by explicit construction. To fix our notation we have provided a diagram which shows the architecture of a typical neural network shown in the figure 6, whose architecture is chosen for classifying the clusters given in figure 5. However before proceeding to the proof we need a few definitions: We first define what is meant by the terms “positive side” and “negative side” of a plane. We indicate by an arrow the normal direction of each plane S1 , S2 , ...Sq (in the figure we 5 we have similar formulae for all the processing elements, Sj , j = 1, 2, ...q in the first layer, the last q th being: sq = tanh(βyq ) where yq = wq0 + wq1 x1 + wq2 x2 + .... + wqn xn Figure 6. Neural network architecture proposed in this paper have taken q = 5). It may be noticed from figure 5 that all the points in the particular cluster indicated by 11 is on the side of the arrow direction of plane S1 , hence we say that 11 lies on the “positive side” of plane S1 ,or as “+ve side” of plane S1 , points on the other side of this plane is defined to lie on the “negative side” of plane S1 or as “-ve side”. So we see each cluster will be either on the positive side or on the negative side of each plane, because by assumption no plane cuts through a cluster, (See Note A). Now we define a “orientation vector” of a cluster as follows: Let us take the cluster indicated by 11 we see that this cluster is on the +ve side of S1 , +ve side of S2 , -ve side of S3 , +ve side of S4 and +ve side of S5 , this situation is indicated by the array (1, 1, −1, 1, 1). We thus introduce the concept of a orientation vector of the cluster 11 as a vector which has q components and is defined as d(11 ) = (1, 1, −1, 1, 1). To take another example, let us take the cluster 43 its orientation vector is d(43 ) = (−1, −1, −1, 1, 1) as can be ascertained from the figure. So we can, in general denote the orientation vector of any cluster b as db = (db1 , db2 , ...dbr , ..dbq ); where dbr = +1 or -1 according as cluster b is on the +ve or -ve side resp. of plane r. It should be noted that the orientation vector of each cluster is unique and will not be exactly equal to the orientation vector of another cluster; this will always happen if the orientation vectors for each cluster are properly defined. Thus the dot product db .dc of the orientation vectors vectors of two different clusters b and c will always be less than q: db .dc = q , if b = c and db .dc < q , if b 6= c actually it is because of the above property and the uniqueness of each orientation vector, that we are able to build the architecture for any given problem. The out put of the first processing element in the first layer denoted by S1 in the figure is: s1 = tanh(y1 ) s1 = tanh(βy1 ) where we arbitrarily choose β = 5 y1 = w10 + w11 x1 + w12 x2 + .... + w1n xn it may be noted that the formula w10 + w11 x1 + w12 x2 + .... + w1n xn = 0 corresponds to the equation of the plane S1 of figure 6. where wq0 + wq1 x1 + wq2 x2 + .... + wqn xn = 0 is the equation to the plane Sq of figure 6. Since the planes S1 , S2 , ..Sq are assumed to be given, the coefficients (weights) wij of all the processing elements in the first layer are all known. NOTE D: Now we wish to make a very important observation, which has a bearing on the many things that we will be dealing with. It may be noticed that the immediate out put of the first layer viz (y1 , y2 , .., yq ) passes through the sigmoid functions tanh(βyi ) (with β large, say, β = 5)and then produces a vector (s1 , s2 , .., sq ). But since the sigmoid function si = tanh(βyi ) maps almost all the points yi (which are bit far away from yi = 0) to a point close to either si = −1 or si = +1, we see that as a consequence that every input sample (x1 , y2 , .., xn ) maps to (s1 , s2 , .., sq ) where (s1 ≈ ±1, s2 ≈ ±1, .., si ≈ ±1, .., sq ≈ ±1) that is the image point in S-space is always close to some q-dimensional Hamming vector which is (±1, ±1, .., ±1) . Definition of the “Center” of a Quadrant in S-space: Suppose a point Q has a coordinates which can be expressed as a Hamming Vector say (1, −1, 1, .., 1), then we consider Q as the “Center” of that quadrant of the space whose points are having coordinates: (s1 > 0, s2 < 0, s3 > 0, .., sq > 0). Eg (i) The point Q’ whose coordinates are (1, 1, .., 1) is the “Center” of the “first” quadrant whose points are having coordinates: (s1 > 0, s2 > 0, s3 > 0, .., sq > 0), similarly Eg. (ii)the point Q” whose coordinates are: (−1, −1, −1, .., −1) is the “Center” of the last” quadrant whose points are having coordinates: (s1 < 0, s2 < 0, s3 < 0, .., sq < 0) . since, we are in qdimensional space there are 2q quadrants, this provides an upper limit to the number of clusters that can be separated by q planes viz. 2q . So a worthwhile observation to make is that the images of all the points which are not near any dividing plane Si will be points close the Center of some quadrant in S -space. Further, all points belonging to a particular cluster get mapped to a region very close to the center of a particular quadrant, in other words all the images of one particular cluster will be found near the center of its own quadrant in S-space. (We will see later that this last property makes it easy to employ a further mapping if we wish). Since all points belonging to a single cluster gets mapped to its unique quadrant in S-space, (uniqueness certainly follows because of the uniqueness of each orientation vector, that is when the planes are well chosen) and the we can easily classify them by “collecting” the points in each quadrant. This is done by writing down the appropriate weights of the processing elements in the second layer, which we call the “Collection Layer”, because of its function. Let us start with the first one which is shown as 11 in the figure 6. 6 The output u1 = tanh(βz1 ) where 0 0 0 0 z1 = w10 + w11 s1 + w12 s2 + .... + w1q sq Now since we wish the the first processing element to output u1 = +1 if the input n-dimensional vector x1 , x2 , ..., xn belongs to the cluster 11 and to out put u1 = −1 if it belongs to any other cluster, we see that this condition will be adequately satisfied if we choose: 0 0 0 0 (w11 , w12 , w13 , ..., w1q ) = (d111 , d121 , d131 , .., d1q 1 ) which we write in short hand as: w0 1 = d11 0 and the constant term: w10 = 12 − q . It can be easily seen that if the sample point x1 , x2 , ..., xn belongs to the cluster 11 then z1 = 1/2 and hence the out put u1 = tanh(βz1 ) becomes very close to +1, else the out put becomes very close to -1. Similarly the second processing element indicated as 22 will output u2 = tanh(βz2 ) where 0 0 0 0 z2 = w20 + w21 s1 + w22 s2 + .... + w2q sq and if we choose 0 0 0 0 (w21 , w22 , w23 , ..., w2q ) = (d212 , d222 , d232 , .., d2q 2 ) ie. w0 2 = d22 0 and the constant term: w20 = 12 − q We can now write down the general term viz the output of the ith processing element belonging to the jth class: ui = tanh(βzi ) where 0 0 0 0 zi = wi0 + wi1 s1 + wi2 s2 + .... + wiq sq and if we choose i i i 0 0 0 0 (wi1 , wi2 , wi3 , ..., wiq ) = (d1j , d2j , d3j , .., diqj ) ie. w0 i = dij 0 and the constant term: wi0 = 12 − q It can be easily seen that if the sample point x1 , x2 , ..., xn belongs to the cluster ij then zi = 1/2. This is easy to do, we choose the connection weight between the processing element in the second layer say ij and processing element l of the last layer as equal to the Kronecker delta δjl ;(by definition δjl = 1,if j = l else δjl = 0 ). Thus we explicitly write vl = pl0 + pl1 u1 + pl2 u2 + .. + pli ui + .. + plm um where we now define pl0 = 0 and we choose pli = 1 if the cluster ij belongs to class l, that is j = l, else we define pli = 0 With the above choices all the weights in the network are now known, thus completely defining the Neural Network which can classify all the data. To demonstrate why it works let us consider, in figure 6,the connection weight between the processing element 11 and the processing element 1 (in the last layer)p11 = 1, but the connection weight to 2 p21 = 0. Similarly, the connection weight between the processing element indicated as 62 and 1 p16 = 0, the connection weight between 62 and 2, p26 = 1 and the connection weight between 62 and 3, p36 = 0; thus ensuring that if the input point (x1 , x2 , .., xn ) belongs to the cluster 62 then it will be classified as class 2. We thus see that the neural network will out put a point belonging to a cluster ij to the class j as required, since the jth processing element outputs vj a number which is equal to 1 as the final output; the other vk , k 6= j will out put 0. QED. B. Four layer problem We have seen that the out put of the first layer maps all points onto S-space; and since each cluster is mapped to its “own quadrant” in this space the problem has already become separable. It was only necessary to identify the particular quadrant that a sample had got mapped to, in order that it can be classified; a task undertaken by the collection layer. Though the above section shows that the number of layers (three) is sufficient, it is sometime better to make one more transformation from the S space to h space by using orientation vectors in this space (see figure 7) this could lead to a network with with less processing elements in the layer. A. Use of Unit Step Function Now to simplify the proof we will use the Unit Step Function instead of the activation tanh function in the second layer, ie. instead of defining ui = tanh(βzi ) as above, we use the unit step function U sf (z), which we define as:U sf (z) = 1 if z > 0 else U sf (z) = 0. The output ui = U sf (βzi ) becomes 1 or 0 (binary). This we do only to demonstrate the proof, but in actuality in practical cases the original tanh function would suffice with some appropriate changes in the equations below. Now we come to the last layer: Figure 7. Cluster within a cone 7 (That is if there are clusters belonging to the same class in one half space then it is not necessary to separate these clusters individually since anyway they belong to the same class, we can save on the number of planes if we group such clusters as belonging to a single region.) The figures, show how such regions, containing “clusters of clusters” belonging to the same class can be separated by planes. In this section we show how all this can be done by introducing another layer before the “Collection Layer”. Also the Collection Layer in this case collects samples belonging to one region which has samples belonging to possibly more than one cluster but all belonging to the same class. This becomes apparent in the figures which depict the orientation vectors H, in the s-space. Figure 8. Clusters in conical pencils The above diagram shows that there are several places where clusters belonging to the same class can be grouped as one region containing a“cluster of clusters”, these regions can then be separated by fewer planes (the figure 8 shows 4 planes and to prevent clutter the cone containing Region 222 in the negative side of H1 and separated by the positive side of H2 has not been drawn). The Architecture for such a situation can be easily arrived at by introducing the orientation vectors H as another layer . We than have the architecture shown in figure 9. Figure 9. IV. EXAMPLES We now, for the purpose of illustration, solve a few problems and show that for a given classification problem if a neural network architecture is chosen as per the above theorem then the classification is guaranteed to be 100% correct, provided the data satisfies all the conditions of the theorem. A NOTE On Choice of Examples: These examples , were purposely constructed because we need to know exactly the geometrical configuration of each cluster and the number of points involved and how the clusters are nested one within an another. So even though the example may seem artificial and the first one seems to be a "toy" example, they were purposely constructed so that we can theoretically calculate the minimum number of planes require to separate the clusters. This latter information is very important to us otherwise there is no way of comparing our results with the "exact" result. However, the examples become increasingly complex in Sec IV E we have r-levels of nested clusters one within another in n-dimensions, and yet they are so constructed that we know the number of planes that will separate them! First the 3 layer architecture is chosen as per the configuration dictated by the theorem, then the Back Propagation algorithm is used to show that in each of the 3 example problems the classification is 100%. Secondly, we introduce a fourth layer; since we cannot know the number of processing elements in the second and third layers, different configurations were tried. This is just to show that even if we do not know the exact number of clusters we can by a judicious guesses choose processing elements in the second and third layer in such a manner that the classification is done 100% or near 100%. The 3 Examples (below) are constructed in such a way that we know the number of clusters, the number of classes and also which cluster belongs to which class. For convenience we assume the shape of all the clusters, in the examples, to be spherical. In all the examples we generate the coordinates of sample points within clusters and coordinates of test points by using random number generators. We then use the backpropagation method after choosing the appropriate architecture as dictated by the above theorem for the 3 layer case and a variety of architectures for the 4 layer case. (Later, in sections V(B) and V(D), we give techniques of choosing a suitable architecture). The 3 examples are: (A) The 3D cube, (B) The 4D cube and (C) The 4D nested cubes. We then generalize in para (D) the nested cubes to n dimensions and in para (E) consider r levels of nestings in n-dimensions and give a minimalistic architecture for these and draw interesting comparisons with Radial Basis Function classifiers. TEST RESULTS ON EXAMPLES: Neural network architecture of a four layer network A. Three Dimensional Cube In the example problems below, we did not use the Unit Step function but rather used the Tanh function to enable the use of Back propagation algorithm ([16]). So the outputs will be in the range [−1, +1], and all positive points are treated as +1 and all the negative points are treated as 0. This is a 3-d problem involving a cube which is centered at origin and whose neighboring vertices at a distance of 2 apart from each other. There are 8 clusters, centered at each of the vertices, we assume that each cluster has a radius of 0.3. The symmetrically opposite vertices of the cube belong to the same class, and hence there are a total of 4 classes. For 8 example, the symmetrically opposite vertex of (1, -1, 1) is (-1, 1, -1). We use the same definition of symmetrically opposite vertices in the remaining examples in this paper. For instance, in example IV-B, the symmetrically opposite vertex of (-1, 1, -1, 1) is (1, -1, 1, -1). Therefore the points belonging to the clusters around these vertices belong to the same class. We have drawn samples from these clusters to formulate the train data set, these are 100 sample points randomly generated within each spherical cluster (100 samples per cluster) and test data set (50 samples per cluster). A feed-forward neural network was then trained to classify the training data set. The architecture of the network is as follows: dimension of the input layer is 3, dimension of the first hidden layer is 8 (equals the assumed number of planes required to split the clusters, though for this simple case the 3 coordinate planes are sufficient to split the clusters we do not use this information),dimension of the second hidden layer is 8 (equals the number of clusters) and the dimension of the output layer is 4 (equals the number of classes). Therefore by using the network architecture: 3-8-8-4 The feed forward neural network was trained using Back propagation algorithm and it gave 100% classification accuracy on both the training and test data sets. B. Four Dimensional Cube This is a 4-d problem involving a hypercube which is centered at the origin and whose neighboring vertices at a distance of 2 apart from each other. For convenience we assume the shape of the clusters in this and the next problem to be that of a 4d sphere. There are thus 16 spherical clusters, centered at each of the vertices, and having a radius of 0.3. The symmetrically opposite clusters of the 4-d cube belong to the same class, (i.e. if the cluster centered at the coordinate (1,1,1,1) belongs to class 1, then the cluster whose center is situated at (-1,-1,-1,-1) also belongs to class 1. Hence, there are a total of 8 classes. As in the above experiment, we have drawn samples from these clusters to formulate the train data set (100 samples per cluster) and test data set (50 samples per cluster). A feed-forward neural network was then trained to classify the training data set. (i) Using the 3 layers of processing elements in the architecture: The architecture of the network is as follows: dimension of the input layer is 4, dimension of the first hidden layer is 16 (equals the assumed number of planes required to split the clusters), dimension of the second hidden layer is 16 (equals the number of clusters) and the dimension of the output layer is 8 (equals the number of classes). (a) Using: 4-16-16-8 architecture, the Back propagation algorithm produced 100% classification accuracy on both the training and test data sets. (b) Actually for this problem we can show that just 4 planes are sufficient to separate the cluster, these are the 4 coordinate planes: x= 0; y=0; z=0; t=0; ii) Using the 4 layers of processing elements in the architecture: (a) 4-16-2-8 (b) 4-15-5-8 (c) 4-9-9-8 The feed forward neural network was trained using Back propagation algorithm and it gave 100% classification accuracy on both the training and test data sets. C. Nested Four Dimensional Cubes Here we consider a 4-d problem of a big hypercube which has smaller hypercubes centered at each of its 16 vertices. That is each smaller hypercube has its center at one of the vertices of the larger hypercube. Thus a total of 256 spherical clusters belonging to 8 classes. The neighboring vertices of the bigger hypercube are at a distance of 4 apart from each other. The vertices of this bigger 4-d cube form the center of the smaller 4-d cube. The neighboring vertices of the smaller hypercube are at a distance of 2 apart from each other. Hence there are 256 (16x16) clusters having a radius of 0.7 (there are no clusters at the vertices of the bigger hypercube) Now we classify each cluster as follows. As in the example IV-B, each small hypercube will have 16 clusters and clusters symmetrically opposite will belong to the same class, thus there are 8 classes for each small hypercube. As there are 16 small hypercubes there will be 256 clusters belonging to 8 classes. Note we have imposed a symmetry to our problem by placing all the cubes in such a manner that the edges of each of the cubes are parallel to one of the coordinate axis. This symmetry has been imposed on this and all the subsequent examples considered in this paper. (i) Three layer of Processing elements: As in the above experiment, we have drawn samples from these clusters to formulate the train data set (100 samples per cluster) and test data set (50 samples per cluster). A feed-forward neural network was then trained to classify the training data set. The architecture of the network is as follows: dimension of the input layer is 4, dimension of the first hidden layer is 256 (equals the number of planes, which was purposely chosen very high and equal to the number of clusters), dimension of the second hidden layer is 256 (equals the number of clusters) and the dimension of the output layer is 8 (equals the number of classes). Thus the architectures tried out is: (a) 4-256-2568, The feed forward neural network was trained using BP algorithm, which converged in less than 500 epochs, and it gave 100% classification accuracy on both the training and test data sets.We have chosen the number of planes as 256 (equal to the number of clusters), which is sufficient to distinguish all the clusters from one another by a 256 dimension orientation vector. Actually, it would not have mattered even if we had chosen more planes than 256. However, it may be noticed that because of the symmetry of the configuration, only 12 planes are actually required to separate all 256 clusters, these planes are: x= 0; y=0; z=0; t=0; x= 1; y=1; z=1; t=1; x= -1; y= -1; z= -1; t= -1; so an architecture of the type 4-12-256-8 is theoretically sufficient for this problem, therefore by using various architectures we got results as per this table: (a) 4-12-256-8 : 99.852% train & 99.672% test (b) 4-13-256-8: 99.191% train & 99.117% test (c) 4-14-256-8: 99.891% train & 99.641% test 9 (d) 4-18-256-8 :100% train & 99.969% test (ii) Architectures with Four layers of Processing elements which also worked are: (e) 4-12-40-300-8 (f) 4-12-100-150-8 (g) 4-12-120-80-8 (h) 4-12-50-50-8 D. Generalization of Nested Cube Problem to n dimensions The problem 3 which has clusters of smaller cubes placed at corners of larger cubes can be generalized to n− dimensions. There will be a large n-dimension cube with smaller ndimensional cubes at the corners: so we have 22n clusters and if each pair of “diagonally opposite” clusters in the smaller cube belong to the same class then there will be 2n−1 classes. We require only 3n planes to separate the clusters so the minimal neural network architecture will be : n − 3n − 22n − 2n−1 . This problem is interesting because a Radial Basis Function method would involve 22n distance measurements to classify a single sample, where as by this method there are only 3n linear equations to be evaluated to obtain the unique Hamming vector which identifies the same sample. E. Generalization to sequence of nested cubes one inside the other In fact we can still further generalize the n dimensional example given in the previous section. Suppose we define the previous example as level-2 nesting: that is we take a large n-dimensional cube and place smaller n-dimensional cubes at the vertices, each of these small cubes have a cluster at its vertex. Now we can consider such level-2 structures placed at the vertices of a still larger n-dimensional cube we get a level3 structure (ie level-2 nested cubes at the vertices of another large cube). So we can go on to get a level-r nested structure. This level-r nested structure will have 2rn clusters belonging to 2n−1 classes. It can be shown that such a cluster can be distinguished by using (2r − 1)n planes and thus we will have a NN architecture: n − (2r − 1)n − 2rn − 2n−1 . There are only (2r − 1)n linear equations to be evaluated to obtain the unique Hamming vector which identifies a sample which may belong to any one of the 2rn clusters and finds which of the 2n−1 classes it belongs to. These (2r −1)n linear evaluations may be once again compared with 2rn distance measurements which would be necessary, to classify a single sample, if one uses the Radial Basis Function method. V. A PPLICATION TO C LASSIFICATION P ROBLEMS Now it is probably appropriate to answer the query: What type of patterns and what type of cluster configurations can be easily classified by our method? It would be quite apparent by now that if the patterns are in clear clusters like those given in Example 1 and 2 (Level 1)then the problem is completely classifiable by using the above mentioned neural architecture, the EXAMPLES section clearly illustrate this (in particular problem 1 and 2, viz the 3-d and 4-d cubes). However in some other cases wherein we have clusters within clusters, Level 2, (eg. problem 3; the nested 4-d cube); that is when each large cluster contains sub-clusters, much like a cluster of galaxies each of which is a cluster of stars, some more investigation needs to be done. For these and other cases (cluster configurations of Level-r), it is possible to estimate the number of planes required. However, the precise number of planes would depend on the number of clusters and their geometrical positions in feature space. So we can only make an estimate. This estimate helps determine a possible architecture for the Neural network classifier.Before proceeding to our estimates, we would first need a definition. Malleable cluster: We will define (consider) a cluster as ’malleable’ if (i) a sample point is classifiable to a cluster by just taking its Euclidean distance to the centroid of a cluster, OR (ii) a sample point can be associated to its cluster by a k nearest neighbor algorithm. All clusters will be assumed to be malleable. We further assume that different clusters are separable from one another by planes, if necessary a cluster may be divided into two or more parts to facilitate such a separation (see figure 4). We wish to say without being ad nausea that in cases where clusters belonging to different classes overlap with each other then it is not possible to classify the problem without using probabilistic techniques and we do not consider such situations in the paper. It could also mean that we have not taken enough number of relevant features to solve the problem. ESTIMATION OF NUMBER OF PLANES In the next three subsections, we give methods with heuristic proofs on how to estimate the number planes which can separate Level 1 and Level 2 clusters and also for the case when the clusters are not too sparse. Though our proofs are heuristic, it may be mentioned that our estimates are in concordance with the bounds proved by Ralph P. Boland and Jorge Urrutia [28],1995, who in their work had elegantly exploited the crucial fact: In n-dimension space a single plane, in general, can simultaneously separate n pairs of points(randomly placed, but not all in the same plane), thus if we choose the first pair of 2n points (among N), the first plane thus cuts these 2n points and places them into two sets one on either side of the plane,4 this plane of course divides the other points among N to to either side; after this n new pairs of 2n points are chosen such that each pair is unseparated, a second plane is then chosen which divides the new n pairs and also the space to 4 ’quadrants’ , the next plane gives 8 ‘quadrants‘, the process continues and new planes are added, but must quickly end because all the N points will be soon exhausted.5 The proofs by Boland and Urrutia[28]are involved though rigorous. 4 Another way of looking at this is to think that each pair of points as a line segment which has a midpoint, since there are n pairs, one can always find the n coefficients αi , (i = 1, 2, .., n) of a plane (say) 1 + α1 x1 + α2 x2 + .. + αn xn = 0 which passes through these n midpoints. 5 Another crucial point to note regarding n-dimensional geometry: Every time you add a plane in n-dimensional space you are dividing the space and doubling the number of existing number of ‘quadrants’, but this doubling happens only for the first n planes the (n + 1)th plane will not double the ‘quadrants’ but create a ‘region’ confined by other n planes. Remember we have chosen n large and N < 2n . 10 A. Estimate of number of planes: Clusters of Level 1 We show that for problems, involving large n-dimensional feature space, which has N clusters, N < 2n , sparsely and randomly distributed and configured as Level 1, the number of planes q are O(log2 (N )). As is known a 2d space has 4 quadrants,3d space has 4 quadrants and n dimensional space has 2n quadrants. Suppose the dimension of the feature space is large (say 40), then it is most likely, in practical situations such as face recognition, disease classification etc., that the number of clusters (say 10000), will be far less than the number of quadrants, (as 240 ≈ 1012 ) that is, the number of clusters will be sparsely and randomly distributed. Therefore an interesting question arises: Is it possible to transform the feature space X of n-dimension to another n-dimensional Z space such that each cluster in X space finds itself to be in one quadrant in Z space, such that each cluster is in a different coordinate in this Z space? If this is so then the problem can be tackled in Z space instead of the original feature space, thus making the classification problem trivial. The answer to the question is yes, if the cluster configuration is of type Level-1 In fact, the present problem is closely related to the problem first dealt with by Johnson and Lindenstrauss [21](1984), who showed that if one is given N points in a large n dimensional space then it is possible to map these N points to a lower dimension space k of order k = log2 (N ), in such a manner, that the pairwise distances between these points are approximately preserved, (in fact our requirement is much less stringent we only require that the ‘centroid’ of N clusters, be mapped to a different ‘quadrant’). The transformation is easy: Every point P, in n dimension space, whose coordinate is xP and which belongs to cluster i can be transformed to x0 P another point in n dimension space. This transformation from X space to X 0 space is given by : x0 P = C i +(xP - xi ) Where xi is the centroid of cluster i in the X space; C i is the coordinate of the point to which the centroid of i has been shifted in X 0 space. We can choose C i to be sufficiently far away from the origin such that its distance, from the origin of X 0 space is larger than the radius of the largest cluster (for convenience, we can choose the origin of the X 0 space to be the global centroid of the sample space). Typically, if n = 5 we could choose some point say, C i = D(1, 1, −1, 1, −1) where D is sufficiently large. Thus we see that the problem is classifiable in X 0 space, and a classifier with (say) q planes, q = log2 (N ), exists and since the transformation from X space to X 0 space is essentially linear and the clusters are sparse in X 0 space and can be separated by these q planes, then a similar classifier exists in x space. In X 0 space the centroid of each cluster can be given ‘coordinates’ by measuring the perpendicular distance from each of the q planes to get the ‘coordinates’ (z1, z2, ...zq), ie related to the orientation vector, therefore each cluster will be in a ‘quadrant’ of the q dimensional z space. A situation somewhat similar to Johnson and Lindenstrauss [21]- [22] because q = O(log2 (N )). QED.6 From the above we see that problems involving labeled data in class 1 are always classifiable by transformation into Z space. Thus we see when the number of clusters N are such that N < 2n , n being the dimension of space, then we require only q planes q = log2 (N ). In the example we see that Problem 1 and Problem 2 are problems of class 1 type. further, problem 1 is a cluster in three dimension space involving 8 clusters in this case 8 is equal to 23 , hence we see that the clusters are sparse and hence it can be solved by using only 3 planes the equations of these 3 planes are x=0, y=0, and z=0. Similarly in Problem 2 we have a 4 dimension cube involving 16 clusters which is equal to 24 , here again we need only 4 planes whose equations are x=0,y=0,z=0 and t=0. In problem 3 we have too many clusters (256) which is much more than 24 . Therefore, we will deal with this case later. B. Estimate of number of planes: Clusters of Level 2 Here again we assume that the number of clusters N, N < 2n . In this case, there is a large cluster involving ’regions‘ each of which consists of clusters (analogous to galaxies and stars). We can solve this as follows: we divide the problem into K regions such that each region does not have more than 2n clusters. We can separate these K regions by log2 (K) planes and each of these have a max of N’ ≈ N/K clusters in a region by log2 (N 0 ) planes, thus the total number of planes q, would be O(Klog2 (N/K)) + O(log2 (K)). We can estimate the number of planes by repeatedly using the logic of the previous paragraph for clusters of Level-r. In problem 3 we have too many clusters (256) which is much more than 24 . These are 16 large clusters each containing 16 smaller clusters therefore one would have thought that they would require 16 X 4 + 4 =68 planes, however from the symmetry of the problem we see that we require only 12 planes. Therefore we see that 3, 4, and 12 planes are sufficient to solve problems 1, 2 and 3 respectively; these are the minimal. Now it is interesting to see if the BackPropagation algorithm can discover the weights of the planes if the number of planes are specified, we report that if the cluster sizes are small and if the separation between clusters is large than the algorithm succeeds, else more number of planes are required. Details are provided in the Example section. What happens if we have labeled clusters and if we do not know the number of clusters? We have seen (in the Example section) that we need to approximately guess the number of clusters as m and if the problem is of Level-1 than choose the number of planes to be a little higher than log2 (m). In fact if we choose the number of planes is equal to the number of clusters, the upper limit, the problem is automatically resolved but this is inefficient. In the Example problems, we did start 6 An alternative argument can be had by transforming all the points in Xspace of n dimension to points on the surface of a sphere (radius R) of n+1 dimensional X’-space. After, choosing the origin as the global centroid of all the clusters, we use the transformation x0i = Rxi /A (i = 1, 2, .., n); and x0n+1 = R/A with the choice A = (1 + x21 + x22 + ..x2n )1/2 . The clusters on the sphere can be separated from one another (because they are sparse) by (say) q ‘great circles’, each contained in a plane through the origin. We thus arrive at the same result. 11 with this rather inefficient guess (by assuming the number of planes as equal to the number of clusters) and apply the BP algorithm. We then solved the examples by using a variety of more efficient architectures which were then trained by the Back Propagation algorithm. Architecture 4-12-256-8 4-13-256-8 4-14-256-8 4-18-256-8 4-256-256-8 Train Accuracy 99.852% 99.191% 99.891% 100% 100% Test Accuracy 99.672% 99.117% 99.641% 99.969% 100% KCR 18.81 17.95 17.16 14.52 1.48 PEW 18.74 17.79 17.10 14.51 1.48 C. Problems when the number of clusters are not sparse We had assumed that the number of clusters are sparse. What happens if the number of clusters are not smaller than 2n ? In this case we use the method previously try to divide the total number of clusters as belonging to different regions. Choose K regions, such that each of the K regions does not have more than 2n clusters. Of course the final answer will depend on the geometrical distribution of the clusters. See ref [28] for further details on this subject. D. Some points for implementation in practical classification problems For the sake of completeness, we briefly suggest a means of implementation of the method of classification described in this paper for practical cases. (i) Choosing an Architecture The procedure for software implementation could be as follows: When data is first given, a suitable nearest neighbor clustering algorithm may be applied (may be done after suitable dimension reduction). This will give the number of clusters as shown in figure 5. The number of separating planes will be ascertained or estimated. Normally for sparsely distributed, N, clusters in high n-dimensional space, the number of planes will be O(log2 (N ), in practical cases the number of planes can be taken to be 30% or 40% more than log2 (N ), the exact number of planes are not necessary because an over specification does not matter, the number of layers of processing elements will be three, thus the architecture of the ANN is known as the number of classes is known for a supervised problem. Then the well-known back propagation (BP) algorithm could be employed using this chosen architecture to solve the classification problem just as what was demonstrated in section IV. (ii) Evaluating a chosen Architecture Suppose we have two Architectures, which give equally good predictions,how do we say which is better? One way is to use the concept of Occum’s Razor, in order to do this we could use the following two ratios: (i) the ratio of the ‘number of equations’7 fitted (while training) to the total number of weights used in the neural architecture, we may call this the knowledge content ratio per weight (KCR),(ii) the second ratio is nothing but the first multiplied by the fraction of correct predictions (fcp)on unseen test samples, this would give the prediction efficiency per unit weight (PEW), P EW = KCR.f cp It is best to use that architecture which has the highest possible KCR or PEW. The Table shown above gives the values of KCR and PEW for problem 3 (the nested 4 d clusters), for a variety of architectures which were trained using BP. 7 We define the ‘number of equations’ as the total number of conditions imposed while training.This is equal to number of training samples multiplied by the number of processing elements in the last layer. VI. T HE METHOD OF ORIENTATION VECTORS IN NOT NP HARD Suppose we have arrived at our so called “Minimalistic” architecture by using the method of Orientation vectors for solving a particular problem involving N clusters and k classes. (It is assumed that in this section we are dealing with large dimension space with sparse cluster). Now what happens if we increase the number of clusters by ∆(N ) and the number of classes from k to k+1? By this time, we have covered enough ground to be able to answer this question. Suppose we a have a certain number of clusters say N = Nf , in a large n dimension space, how do we begin to separate them by planes? We will now describe such a process. We start with a certain number of clusters in an initial set (say) N = N0 , belonging to the actual configuration of N = Nf clusters and then choose an initial set of planes q = q0 , to separate these N0 , as a start 8 we will assume N0 << 2q0 . We will then include more clusters into this set and at the same time choosing an additional plane (or planes) to separate the new arrivals of clusters from one another and from those which are already in this set. This study will help us to understand that as we increase the number of clusters, the number of planes needs to be increased at a far, far lesser rate, thus demonstrating that our method is not NP hard. We will then arrive at N = Nf and q = qf = O(log2 (Nf )) . Suppose that at some intermediate stage of our process, we have arrived at a situation where the clusters are as shown in figure 5 and this stage (say) we have N = N in our set which are all separated by q planes. Now suppose we include a new cluster from the configurations thus increasing the number of clusters in our collection by one,N to N+1, this new cluster has to appear some where in the diagram. If it is far away from the entire figure say ‘above’ all the rest then it can be separated from the others by introducing just one ’horizontal‘ plane. Now if the new cluster appears inside the figure, then it will have, at most, one neighboring cluster from which it is not separated by a plane. This is because if it has (say) two neighbors not separated by a plane, then this implies that there is no plane separating the other two clusters an impossibility: since all the other clusters have already been separated from each other.(We ignore, the rare case when the new cluster will happen to cut by a plane, since the clusters are sparsely distributed). Let us say that this new cluster has a neighbor 43 , then in this case adding a new plane, q → q + 1, separates this new cluster from 43 and automatically isolates the new cluster from all the others. It is worthwhile to investigate a little further: What happens 8 Perhaps a good way to visualize a particular situation, is to assume that n = 50; Nf = 10000 and starting values: N0 = 10 and q0 = 10, this satisfies N0 << 2q0 . 12 Figure 10. Cluster of sample points in n-dimensional space if we now add one more cluster to our set the (N + 2)nd cluster? The answer to this is not too easy especially if we are dealing with crowded clusters in low dimension spaces. Surprisingly as is shown in Ref [30], it is easier to separate points by planes in a large n-dimension space, rather than clusters. This is because cluster shapes vary - they may be filamentary, dragon like or amoeba like objects and to define the shape of a cluster requires more parameters than to define the coefficients of a plane! In large dimension space the many degrees of freedom available allows one to separate innumerable points with comparatively fewer planes. However for sparse clusters this question will be answered by following the methods of Ref[30], but with some what modified arguments because here, we are dealing with separation of sparse clusters by planes rather than separation of points by planes as was done in [30].It will be clear that most of the time we need not add one more plane, the new plane can be adjusted so that it can separate both the cluster number N+1 and the cluster number N+2 at the same time. Now if the (N + 2)nd cluster falls in an empty quadrant among all the 2q+1 current quadrants then it is already separated from the others and we don’t need to do anything (no need to add a plane); but if it falls in the a quadrant where say one of the existing clusters (say) 71 resides then we do as follows: we find the centroid of the 71 and join it to the centroid of this N+2 cluster, these two centroids can be thought of as the ends of a line segment, similarly the centroids of the N+1 and 43 can be thought of as the ends of another line segment - we now modify the q + 1 plane so that it passes through the “mid points” of these two segments thus separating the N + 1 and N + 2 from all the others and themselves. (Remember N + 1 and N + 2 are already separated from each other because it is assumed that they are in different quadrants). If the next n clusters do not fall in empty quadrants, then we can actually add a total of N + n clusters into our set and in all probability the (q + 1)st will take care of all of them. Only when we have cluster number N +n+1 do we may need to add the (q +2)nd plane. Actually this addition of a new plane maynot even be needed as soon as cluster number (N + n + 1) because many of the n new clusters which are added will likely fall on empty quadrants so there is no need to immediately account for them by adjusting the (q + 1)st plane or adding the(q + 2)nd plane. (In this para we have extended the logic enunciated in para preceding section V A). The logic will fail if the any of the n new clusters happen to fall in the same quadrant or two of them sharing the same quadrant space with an existing cluster say 43 , then of course we must introduce the (q +2)nd as soon as this happens. But the chance of two new (given) clusters falling in the same quadrant has a probability of 1/2q+1 which is very rare indeed! (And if this rare event happens, there is no real problem: we simply add a new plane at this point and start counting the clusters from here on).9 But we have already shown that the number of planes for sparse clusters is log2 (N ), we thus have proved the following: The present method of classification using ‘Orientation Vectors’, is NOT NP hard for the type of problems we are dealing with.10 If the number of clusters is increased from N to N + ∆N , then the number of planes increase at worst linearly by ∆N and at best only logarithmically ∆(log(N )). Increasing the number of classes from k to k+1 only increases a processing elements by one. QED A NOTE : Regarding Algorithm It is perhaps quite obvious that the above process of including clusters and determining planes can be the basis of an algorithm, the details of the algorithm is available in [29 b],[30] as applied to separation of points by planes, the methods of which can be modified to separation of sparse clusters by planes. The results of this study will be reported subsequently. A. Dimension reduction Dimension reduction is done by using auto encoders or by MNN’s , which are nothing but neural networks with many layers and a converging diverging type of architecture. See figure The task of the auto encoder is to reduce the dimensionality of input data and they are trained in such a way that the output just reproduces, “mirrors”, the input. Since an auto encoder first reduces the data from an initial dimension say n to a lower dimension say m and then increases it back to n, albeit in stages, we can think of an auto encoder (or MNN) as a mapping engine which uses a NN architecture of a special type. There is an alternative way of training an auto encoder ie. is by considering it as a Boltzmann machine (with binary units), however we will not consider this here primarily because a Boltzmann machine is stochastic and non-deterministic and secondly its binary nature makes applications more difficult. So we will consider an auto encoder (or MNN) as a mapping 9 Having arrived at N clusters and q planes we have added the (q + 1)st plane, we now have 2q+1 quadrants from the present 2q ; it is interesting to conjecture how many clusters can we accomodate before we fill up the 2q+1 quadrants, or before we need the (q + 2)nd plane? The above logic seems to indicate that if our starting q was much larger than the required that is if N < 2q , it is reasonable to expect that this must be of O(N ) clusters , see Ref[30] for more details. Another problem is when the new plane cuts across some existing cluster if this happens (an event not likely for sparse clusters)the resulting cluster needs to be treated as two separate clusters - the clusters need to be renumbered. 10 It will probably be appreciated by those who have followed our logic, closely till now, that the situation is far from NP Hard, in fact, the relationship q = O(log2 (N )) greatly underlines the efficiency of the present method. 13 engine which uses a NN having a special converging-diverging type of architecture. The purpose of the auto encoder is to reduce the dimension of the data: If all the samples belong to an n-dimensional Xspace, it is assumed that each sample uses more number of dimensions to describe an exemplar then strictly necessary: hence all the n-components of an input vector (sample) are not really all independent and it is hypothesized that the data really can be described by saym variables Therefore for every input sample (x1, x2, .., xn ) in X-space there exists some m dimensional vector say (y1, y2, .., ym ) in Y-space, which describes the input vector. If such an equivalence between every vector in X-space and some vector in Y-space exists for all exemplars in the entire data set in X-space, then we can conclude that all the data can be described by using only m-dimensions. We can then say that every sample in X-space is a function of m−variables in Y-space and we can think of the components of m-variables in Y-space as independent variables and the n-components of the X-space vectors are actually not independent but dependent on these m variables. The function of an auto encoder (MNN) is to capture this functional dependence between X and Y, and a neural architecture is used for approximately capturing this functional dependence. The weights of the processing elements are determined by imposing the condition that it should “mirror” each input sample in the data set. The figure below shows a sequence of transformations X-space to S-space to T-space then to Y-space then to R-space to U-space and back to X-space (since the condition V=X is imposed). These can be thought of as a sequence of mappings (functions of functions etc.) which reduces the data from n-dimension Xspace to m-dimension Y-space and back to n-dimension Xspace (V-space), in stages: n > k > i > m < j < l < n . The variables (y1, y2, .., ym ) can be considered as the reduced “independent” variables 11 and the input data as n-dimensional dependent variables in x space. Figure 11. A Typical Configuration of an Auto encoder (MNN) The purpose of this section is just to demonstrate only two facts: (i) That the mapping performed by a fully trained auto encoder (MNN) is such that each cluster starting from a cluster 11 Think of a sample vector (point) in X space as a large sized photograph involving n pixels and its reduced sized photograph of m pixels as a vector in Y space representing the same photograph, m < n, in addition we may have to think of m as a measure of the smallest sized photograph (the smallest number m), which can be used to distinguish the photographs in the input set one from another. in an input layer is mapped to a unique cluster in the next layer,and this is true from layer to layer. To prove this we take a simpler MNN shown below: Figure 12. A Simple Auto encoder (MNN) The mappings made by the above architecture are shown pictorially below: Figure 13. Mapping Property of Auto encoder (MNN) It is clear that since we want the MNN to “mirror” each vector this property of the mapping moving from one cluster to another is correctly depicted for points 1 and 2 as shown above. The case of points 3 and 4 which start from different clusters and land in the same cluster cannot happen, because if the points 3 and 4 land up in the same cluster (as shown for e.g. in Y-space), the network cannot “mirror” the input thus the input vector cannot be recovered. This property is important because it leads to an important Theorem which shows that such MNN architectures can be used for hierarchical classifiers where classes can be further sub classified to subclasses.See Ref. [24]-[25]. (ii) The second fact is with regard to the activation function introduced after each processing element. Going back to Fig 2, we have defined s1 = tanh(βy1 ), now if β is large say β = 5 then the output s1 becomes either close to +1 or -1 , hence if we choose such a β for all the processing elements in the network, then all the clusters will be mapped near the center of each quadrant in each space. Such a situation makes the training of a MNN difficult, so if one chooses the activation functions such that β ≈ 0.5 or smaller than the mapping will take place in such a manner that the image points fill up the quadrant space and not just crowd around its ‘center’, this situation makes the training easier and it makes the functioning of the architecture more flexible and a suitable configuration that reduces the input data can be found more easily. Many 14 researchers in Deep Learning have found this to be the case in their numerical experiments. VII. C ONCLUSION To conclude, we have made the following contributions in this paper: • We have introduced the method of Orientation Vectors to show that the classification problem using neural networks can be solved in a manner which is NOT NP hard. • We have shown a correspondence between our method of Orientation Vectors and the Kolmogorov technique provided some stringent conditions in the latter are relaxed. • We have shown proved that a classification problem wherein each cluster is distinguishable from the other, is always solvable (classifiable) with a suitable feed forward neural network architecture containing three hidden layers. • The number of processing elements solely depends on the number of clusters in the feature space, • Further, we have shown when the feature space is of largen dimension and the number of clusters, N , are sparse s.t. N < 2n , then the processing elements in the first layer are O(log2 (N )). • When the problem size increases that is if the number of clusters is increased from N to N + ∆N , then the number of planes increase at worst, linearly by ∆N , and at best, only logarithmically by ∆(log(N )). Increasing the number of classes from k to k + 1 only increases the processing elements by one. • Many examples have been explicitly solved and it has been demonstrated through them that the method of Orientation Vectors requires much less computational effort than Radial Basis Function methods and other techniques wherein distance computations are required (e.g. statistical). • A practical method of applying the concept of Occum’s razor to choose between two architectures which solves the same classification problem has been illustrated. • The ramifications of the above findings on the field of Deep Learning have also been briefly investigated and we have found that it directly leads to the existence of certain types of NN architectures which can be used as a “mapping engine”, which has the property of “invertibility”, thus improving the prospect of their deployment for solving problems involving Deep Learning and hierarchical classification. The latter possibility has a lot of future scope. As a future work to this paper, we would focus on finding methods to apply these methods on practical data sets which occur in the areas of Deep Learning ([17] - [19]), [31] on cloud computing platforms. VIII. ACKNOWLEDGEMENTS The authors thank C Chaitanya of Ozonetel for the many technical discussions that we had with him. We thank the management of SNIST and ALPES for their encouragement. IX. DEDICATION This paper is dedicated to the memory of D.S.M. Vishnu, (1925-2015), Chief Research Engineer, Corporate Research Division BHEL, Vikasnagar Hyderabad. X. R EFERENCES [1] A. N. Kolmogorov: On the representation of continuous functions of many variables by superpositions of continuous functions of one variable and addition. Doklay Akademii Nauk USSR, 14(5):953 - 956, (1957). Translated in: Amer. Math Soc. Transl. 28, 55-59 (1963). [2] G.G. Lorentz: Approximation of functions. Athena Series, Selected Topics in Mathematics. Holt, Rinehart, Winston, Inc., New York (1966). [3] G.G. Lorentz: The 13th Problem of Hilbert, In Mathematical Developments arising out of Hilberts Problems, F.E. Browder (ed), Proc. of Symp. AMS 28, 419-430 (1976). [4] G. Lorentz, M. Golitschek, and Y. Makovoz: Constructive Approximation: Advanced Problems. Springer (1996). [5] D. A. Sprecher: On the structure of continuous functions of several variables. Transactions Amer. Math. Soc, 115(3):340 - 355 (1965). [6] D. A. Sprecher: An improvement in the superposition theorem of Kolmogorov. Journal of Mathematical Analysis and Applications, 38:208 - 213 (1972). [7] Bunpei Irie and Sei Miyake: Capabilities of Threelayered Perceptrons, IEEE International Conference on Neural Networks , pp641-648, Vol 1.24-27-July, (1988). [8] D. A. Sprecher: A numerical implementation of Kolmogorov’s superpositions. Neural Networks, 9(5):765 - 772 (1996). [9] D. A. Sprecher: A numerical implementation of Kolmogorov’s superpositions II. Neural Networks, 10(3):447 - 457 (1997). [10] Paul C. Kainen and V·era Kurkova: An Integral Upper Bound for Neural Network Approximation, Neural Computation, 21, 2970-2989 (2009). [11] Jürgen Braun, Michael Griebel: On a Constructive Proof of Kolmogorov’s Superposition Theorem, Constructive Approximation,Volume 30, Issue 3, pp 653-675 (2009). [12] David Sprecher: On computational algorithms for realvalued continuous functions of several variables, Neural Networks 59, 16-22(2014). [13] Vasco Brattka : From Hilbert’s 13th Problem to the theory of neural networks: constructive aspects of Kolmogorov’s Superposition Theorem, Kolmogrov’s Heritage in Mathematics, pp 273-274, Springer (2007). [14] Hecht-Nielsen, R.: Neurocomputing. Addison-Wesley, Reading (1990). [15] Hecht-Nielsen, R.: Kolmogorov’s mapping neural network existence theorem. In Proceedings IEEE International Conference On Neural Networks, volume II, pages 11-13, New York,IEEE Press (1987). [16] Rumelhart, D. E., Hinton, G. E., and R. J. Williams: Learning representations by back-propagating errors. Nature, 323, 533–536 (1986). 15 [17] Yoshua Bengio: Learning Deep Architectures for AI. Foundations and Trends in Machine Learning: Vol. 2: No. 1, pp 1-127 (2009). [18] J. Schmidhuber: Deep Learning in Neural Networks: An Overview. 75 pages, http:/ arxiv.org/abs/1404.7828,(2014). [19] D. George and J.C. Hawkins: Trainable hierarchical memory system and method, January 24 2012. URL https:/ www.google.com patents US8103603. US Patent 8,103,603. [20] Corrinna Cortes and Vladmir Vapnik: Support-Vector Networks, Machine Learning, 20, 273-297 (1995) [21] William B. Johnson and Joram Lindenstrauss: Extensions of Lipschitz mappings on to a Hilbert Space, Contemporary Mathematics, 26, pp 189-206 (1984) [22]Sanjoy Dasgupta and Anupam Gupta: An Elementary Proof of a Theorem of Johnson and Lindenstrauss, Random Struct.Alg., 22: 60–65, 2002 Wiley Periodicals. [23] G.E. Hinton and R.R. Salkhutdinov: Reducing the Dimensionality with Neural Networks,v 313, Science, pp 504507 (2006) [24] Dasika Ratna Deepthi and K. Eswaran: A mirroring theorem and its application to a new method of unsupervised hierarchical pattern classification. International Journal of Computer Science and Information Security, pp. 016-025, vol 6, 2009. [25] Dasika Ratna Deepthi and K. Eswaran: Pattern recognition and memory mapping using mirroring neural networks. International Journal of Computer Applications 1(12):88-96, February 2010. [26] K Eswaran: Numenta lightning talk on dimension reduction and unsupervised learning. In Numenta HTM Workshop, Jun, pages 23-24, 2008a. [27] R.P. Lippmann: An introduction to computing with neural nets, IEEE,ASSP magazine, pp 4-22 (1987) [28] Ralph P. Boland and Jorge Urrutia: Separating Collection of points in Euclidean Spaces, Information Processing Letters, vol 53, no.4, pp, 177-183 (1995) [29] K.Eswaran:A system and method of classification etc. Patents filed IPO No.(a) 1256/CHE July 2006 and (b) 2669/CHE June 2015 [30] K.Eswaran: A non iterative method of separation of points by planes and its application, Sent for publ. (2015) http://arxiv.org/abs/1509.08742 [31] K.Eswaran and C. Chaitanya: Cloud based unsupervised learning architecture, Recent researches In AI and and Knowledge Engg. Data Bases, WSEAS Conf. at Cambridge Univ. U.K. ISBN 978-960-474-273-8, 2011.
9cs.NE
Fuzzy-Based Dialectical Non-Supervised Image arXiv:1712.01694v1 [cs.CV] 3 Dec 2017 Classification and Clustering∗ Wellington P. dos Santos, Francisco M. de Assis, Ricardo E. de Souza, Priscilla B. Mendes, Henrique S. S. Monteiro, and Havana D. Alves December 6, 2017 Abstract The materialist dialectical method is a philosophical investigative method to analyze aspects of reality. These aspects are viewed as complex processes composed by basic units named poles, which interact with each other. Dialectics has experienced considerable progress in the 19th century, with Hegel’s dialectics and, in the 20th century, with the works of Marx, Engels, and Gramsci, in Philosophy and Economics. The movement of poles through their contradictions is viewed as a dynamic process with intertwined phases of evolution and revolutionary crisis. In order to build a computational process based on dialectics, the interaction between poles can be modeled using fuzzy membership functions. Based on this assumption, we introduce the Objective Dialectical Classifier (ODC), a non-supervised map for classification based on materialist dialectics and designed as an extension of fuzzy c-means classifier. As a case study, we used ODC to classify 181 magnetic resonance synthetic multispectral images composed by proton density, T1 - and T2 -weighted synthetic brain images. Comparing ODC to k-means, fuzzy c-means, and Kohonen’s self-organized maps, concerning with image fidelity indexes as estimatives of quantization distortion, we proved that ODC can reach almost the same quantization performance as optimal non-supervised classifiers like Kohonen’s self-organized maps. W. P. dos Santos (corresponding author) is with Departamento de Engenharia Elétrica, Universidade Federal de Campina Grande, Campina Grande, PB, Brazil, and with Escola Politécnica de Pernambuco, Universidade de Pernambuco, Recife, PE, Brazil (email: [email protected]); F. M. de Assis is with Departamento de Engenharia Elétrica, Universidade Federal de Campina Grande, Campina Grande, PB, Brazil ([email protected]); Ricardo E. de Souza is with Departamento de Física, Universidade Federal de Pernambuco, Recife, PE, Brazil; Priscilla B. Mendes, Henrique S. S. Monteiro, and Havana D. Alves are with Escola Politécnica de Pernambuco, Universidade de Pernambuco, Recife, PE, Brazil. ∗ 1 1 Introduction The dialectical conception of reality conceives all aspects of reality as complex processes composed by basic units called poles. Dialectics has its very roots in philosophical developments of the ancient civilizations of Greece, China and India, specially related to theories of Heraclite, Plato, and the philosophies of Confucianism, Buddhism, and Zen. As a universal method of analysis, dialectics has experienced considerable progress related to the development of German Philosophy in the 19th century, with Hegel’s dialectics and the posterior works of Marx and Engels and, in the 20th century, the works of Gramsci and the Frankfurt School, in Philosophy and Economics. All those philosophers produced seminal works on the dynamics of contradictions in class-based societies, giving rise to the philosophical school of Historical Materialism [1, 2, 3, 4]. The dialectical method of Historical Materialism was also proposed as a tool to study natural and social systems by regarding the dynamics of contradictions between their integrating poles. This movement of poles through their contradictions is viewed as a dynamic process with intertwined phases of evolution and revolutionary crisis. This was the principal inspiration to us to conceive a kind of evolutionary method for classification able to solve pattern recognition problems, mainly clustering and non-supervised classification. Each of the most common paradigms of Computational Intelligence, namely neural networks, evolutionary computing, and culture-inspired algorithms, has its basis in a kind of theory intended to be of general application, but in fact very incomplete; e.g. the neural networks approach is based on a certain model of the brain; evolutionary computing is based on Darwin’s theory; and cultural-inspired algorithms are based on the study of populations, such as those of ant colonies. Nevertheless, it is important to note that it is not necessarily the case, and indeed it may be impossible, that the theories an algorithm are based on have to be complete. In fact, it is utopy. For example, neural networks utilize a well-known incomplete model of the neurons, but useful to be applied for learning strategies. Furthermore, evolutionary algorithms are simplified mathematical models of natural evolution, but adequate to solve optimization problems. Consequently, there is a strong reason for investigating the use of Philosophy as a source of inspiration for developing computational intelligent methods and models to apply in several areas: dialectics and their features derived from the properties of unity, causality and conflict of opposites could be inter2 esting to construct self-adaptative clustering methods where the number of clusters vary. These properties could be useful in areas such as pattern recognition [5]. The works of Thornley and Gibb discussed the application of the dialectical method to comprehend more clearly the paradoxical and conceptually contradictory discipline of information retrieval [6], while works of Rosser Jr. attempted to use several concepts of dialectics in nonlinear dynamics, making comparisons between aspects of Marx and Engel’s dialectical method and concepts of Catastrophe Theory, Emergent Dynamics Complexity and Chaos Theory [7]. Despite such theoretical efforts, there exist just a very few works concerned in composing mathematical approaches to rebuild the fundamental concepts of dialectics as mathematically useful tools to construct computational methods [5]. Santos et al. introduced the Objective Dialectical Classifier (ODC), an evolutionary computational method that operates as a non-supervised self-organized map dedicated to classification [5]. ODC is based on the dynamics of contradictions between dialectical poles. For classification, each class is considered as a dialectical pole. These poles interact with each other. This interaction is called pole struggle and is modeled using fuzzy membership functions. These poles are also affected by revolutionary crises, when some poles may disappear or be absorbed by other ones. New poles can emerge from periods of revolutionary crisis. The process of pole struggle and revolutionary crisis tends to a stable system, e.g. a system corresponding to the clustering of the original data, as our experiments are going to show. In this work, as a case study, we used ODC to classify magnetic resonance (MR) synthetic multispectral images composed by proton density, T1 - and T2 -weighted synthetic images of 181 slices with 1 mm, spatial resolution1 of 1 mm3, for a normal brain and a noiseless MR tomographic system without field inhomogeneities, amounting a total of 543 images, generated by the simulator BrainWeb [8]. Our principal target here is comparing ODC with other non-supervised classifiers, namely k-means, classical fuzzy c-means, and Kohonen’s self-organized maps, concerned with image fidelity indexes as estimatives of quantization distortion. This work is organized as follows: section 2 exhibits general and specific definitions of ODC; section 4 shows image fidelity expressions, parameters of non-supervised image classification methods, and synthetic brain MR images used in this work; quantitative and qualitative experimental results for image 1 Dealing with MR, Positron Emission Tomography (PET), Single Photon Emission Computed Tomography (SPECT), and X-ray computerized tomography images, it is common to express spatial resolution using volume units. 3 quantization are presented in section 5, where in section 6 some discussion on experimental results is performed; finally, conclusions are presented in section 7. 2 The Objective Dialectical Method The Objective Dialectical Method (ODM) is an evolvable method designed to model dynamic systems and to perform tasks of classification, pattern recognition, intelligent search and optimization. It is based on the following features: a dialectical system is composed by several basic units, called poles. These poles interact with each other and are influenced by external conditions (inputs). These conditions are modeled as vectors of weights. The dialectical method is organized in phases of evolution (also called historical phases) and phases of revolutionary crisis. In phases of evolution, the weights of the poles are adjusted according to the inputs and the weights of the other poles, in an iterative process. Each pole is associated to a determined measure of force, representing a performance evaluation. Such a measure of force can be both a degree of similarity, as it is common in clustering and pattern recognition applications, and the evaluation of an objective function in optimization problems. The stronger the pole, i.e. the better the performance of a determined pole, the greater the influence of this pole on the adjustment of the weights of the other poles according to its vectorial direction. At the end of each phase of evolution, the dialectical system is submitted to crises, i.e. the poles whose forces are under a determined threshold are eliminated; the similar poles (lower contradictions between each other) are fused; the most different poles (larger contradictions between each other) are used to generate new poles2 . After this process, some noise is added to the weights of the poles before a new historical phase starts. Therefore, important input parameters are: the number of historical phases, the duration of each historical phase, and the initial number of poles. The following steps present more details on the description of the dialectical algorithm: 1. System inputs must be represented as a vector of conditions representing the main features of the problem; 2. The user has to provide the initial parameters: the initial number of poles (corresponding to clusters or classes in problems of unsupervised classification) that compose the system, the number of 2 It is important to notice that, in Dialectics, contradiction is a concept opposed to similarity: the greater the contradiction between two vectors, the smaller the similarity between them. 4 historical phases, and duration of each historical phase. The number of historical phases and their duration can also be randomly defined, depending on the application; 3. Each dialectical pole is associated with: (i) a vector of weights, with the same size as the vector of conditions; (ii) a similarity function, and (iii) a measure of force. The initial vectors of weights can be randomly defined or chosen from the set of vectors of conditions; 4. The historical phases consist of two stages: (a) Evolution: The poles compete with each other as we described above. In Dialectics, this competition process is also called pole struggle. A similarity function associated with each pole is evaluated and, given a vector of conditions, the winner pole, which is the pole with greatest degree of similarity according to a determined vector of conditions, has its parameters (weights and measure of force) incremented. This process continues until the end of the historical phase is reached; (b) Revolutionary crisis: This starts at the end of the historical phase. At this point the following steps are performed: i. The measures of force are compared, i.e. all the poles with a measure of force less than a minimum force are marked; ii. The contradictions between the integrating poles are also evaluated. This evaluation is performed using the similarity functions as described in the next paragraphs. If a contradiction between two poles is less than a given minimum contradiction, one of the two poles is selected or marked as such. Here the minimum contradiction plays the role of a threshold; iii. From the evaluated contradictions computed in the previous items, the overall maximum contradiction is calculated. This is the main contradiction of the system. From the pair of poles involved in the main contradiction, a new pole is generated, i.e. a synthesis of previous pairs of poles, whose vectors of weights are calculated from the vector of weights of such pairs; iv. All the marked poles are eliminated and a new set of poles is generated; 5 v. The vectors of weights of all poles of the new set of poles are randomly modified, representing the impact of the revolutionary crisis on both the survivors and the new poles. From the previous general definition it is possible to generate several specific definitions. A proposal inspired in fuzzy c-means maps based on the Principle of Maximum Entropy [9] is the following: Let x = (x1 , x2 , . . . , xn )T be a vector with n conditions influencing the dialectical system with nC (t) poles at instant t, since Ω(t) = {C1 , C2 , . . . , CnC (t) } is the set of poles of a determined system, where each pole Ck is associated to a fuzzy membership function, i.e. a similarity function gk : R → [0, 1] and a vector of weights wk , defined as following: exp(− nC1(t) ||x − wk (t)||) gk (x) = Pn (t) , C 1 ||x − w (t)||) exp(− l l=1 nC (t) (1) wk = (wk,1, wk,2, . . . , wk,n)T , (2) for 1 ≤ k ≤ nC (t), where this way of implementation was chosen to model the influence of the winner pole over the other poles considering force and similarity, as we described above. The index t indicates the iteration (or time). Notice that gk (x) expresses the similarity between the vector of conditions x and the vector of weights of the k-th pole. The expression of these membership functions is based on Gibb’s distribution [10], as it was proved by Chen and Zhao, and obtained by the application of the Principle of Maximum Entropy to modify the classical fuzzy c-means clustering method, changing probabilities by membership function values, to improve the ability of the algorithm to find new cluster centroids by the maximization of fuzzy-based entropy [9]. The similarity functions are also used to evaluate the contradictions between the poles: gi (wj ) = gj (wi ) indicate the degree of similarity between poles Ci and Cj ; alternatively, the contradiction between poles Ci and Cj are given by δi,j = δj,i , where δi,j = 1 − gi (wj ) and 1 ≤ i, j ≤ nC (t). Let nP be the maximum number of historical phases, nH (t) be the duration of each historical phase, and η(t) be the step size, where 0 < η(t) < 1, the algorithms runs until a determined number of poles is reached or a determined cost function is minimized. The step size η(t) develops herein this work the same role as the learning rate in neural networks. 6 The stage of evolution or pole struggle can be implemented as follows: wi,j (t + 1) =    wi,j (t) + ∆wi,j (t), i = k(t)   wi,j (t), , (3) i 6= k(t) ∆wi,j (t) = η(t)gi2(x)(xj (t) − wi,j (t)),    fi (t) + 1, i = k(t) , fi (t + 1) =   fi (t), i 6= k(t) (4) (5) for 1 ≤ i ≤ nC (t) and 1 ≤ j ≤ n, where fi is the measure of force associated to pole Ci , and k is the index of the winner pole: k(t) = arg max{g1 (x), g2 (x), . . . , gnC (t) (x)}. (6) In the stage of revolutionary crisis, a determined binary vector of marks is defined as following: m = (m1 , m2 , . . . , mnC (t) )T , where mi = 1 when pole Ci is absorbed by other pole or simply eliminated, and mi = 0 on the contrary, for 1 ≤ i ≤ nC (t). This vector is initially null. It is important to notice that such a vector is represented just to help our explanation, because its use is not computationally efficient, once marked poles can be eliminated without such a vector definition. In the stage of revolutionary crisis, the measures of force are evaluated first. These measures are normalized as following: f¯i (t) = fi (t) n (t) C max{fl (t)}l=1 , (7) for 1 ≤ i ≤ nC (t). If a determined normalized measure of force is less than the minimum measure of force necessary for the associated pole to survive after pole struggle, fmin , that is, f¯i (t) < fmin , we will have mi = 1. After evaluating forces of each pole, the contradictions among them are evaluated. The contradiction between poles Ci and Cj , represented by δi,j , is determined by δi,j = 1 − gi (wj ), where 1 ≤ i, j ≤ nC (t). 7 If the contradiction is less than the minimum contradiction, δmin , that is, δi,j < δmin , poles Ci and Cj are considered effectively the same pole, and one of the poles is marked. In case pole Ci is marked, mi = 1. Obviously, these expressions are also dependant on t. However, we decided to ommit this fact, to get a simpler expression. Once contradictions are evaluated, the partial set of integrating poles of the new dialectical system is generated, Ω′ (t), as following: mi (t) = 0 ⇔ Ci ∈ Ω′ (t), (8) for 1 ≤ i ≤ nC (t). The search for the main contradictions, or principal contradictions, is performed by putting the set of the contradictions δi,j (notice δi,j = δj,i , for i 6= j and mi = mj = 0, and then taking the p ≥ 1 greatest values. From the poles involved in principal contradictions we generate new poles Ck , where k > nC (t). This process is closely related to the dialectical concept of praxis regarding the generation of new poles. The vector of weights associated to the new poles Ck , wk , can be calculated from the following process, inspired in crossover operators of genetic algorithms:    wp,r (t + 1), r mod 2 = 1 wk,r (t + 1) = ,   wq,r (t + 1), r mod 2 = 0 (9) where 1 ≤ r ≤ n, while wp and wq are the vectors of weights of poles Cp and Cq , respectively, involved in principal contradictions, i.e. δp,q = max{δi,j }, for 1 ≤ i, j ≤ nC (t) and i 6= j. These new poles, Ck , compose the set of new poles, Ω′′ (t). Therefore, the set of new poles, Ω′′′ (t), is obtained from the following expression: Ω′′′ (t) = Ω′ (t) ∪ Ω′′ (t). (10) The qualitative influence of the revolutionary crisis over new and reminiscent poles is modeled by the function of crisis, χ(t), defined by: χ(t) = χmax (t)G(0, 1), (11) where χmax (t) is a parameter called maximum crisis, and G(0, 1) is a random number distributed according 8 to the distribution of Gauss, with expectance 0 and variance 1. Therefore, the new set of poles is Ω(t + 1) = {C1 (t + 1), C2 (t + 1), . . . , CnC (t+1) (t + 1)}, (12) Ck (t + 1) = Ck (t) ∈ Ω′′′ (t), (13) wk,i (t + 1) = wk,i (t) + χ(t), (14) where and for 1 ≤ k ≤ nC (t + 1) and 1 ≤ i ≤ n. This function of crisis is just a mathematical way to model the influence of crisis in dialectical transitions by adding determined levels of random noise. The stage of revolutionary crisis and, consequently, the historical phase, come to an end. A new historical phase begins, continuing while the maximum number of historical phases is not reached. 3 Objective Dialectical Classifiers Objective Dialectical Classifiers are an adaptation of ODM to tasks of classification. This means that the feature vectors are mounted and considered as vectors of conditions. Specifically, once they are applied to the inputs of the dialectical system, their coordinates will affect the dynamics of the contradictions among the integrating dialectical poles. Hence, the integrating poles model the recognized classes at the task of non-supervised classification [5]. In order to guarantee the convergence of the dialectical classifier, we have removed the operator of pole generation, present at the revolutionary crises. Therefore we can guarantee that the number of poles at the end of the iterations is minor or equal to the initial number of poles [5, 11, 12, 13, 14, 15, 16, 17]. Consequently, an objective dialectical classifier is in fact an evolvable non-supervised classifier where, instead of supposing a predetermined number of classes, we can set an initial number of classes (i.e. dialectical poles) and, as the historical phases happen as a result of pole struggles and revolutionary crises, classes are eliminated or absorbed, whilst new classes are generated. After the end of the training process, the dialectical system presents a number of statistically significant classes present in the training set and, 9 therefore, a feasible classifier associated to the final state of the dialectical system [5, 18]. Once the training process is complete, objective dialectical classifier behavior occurs in the same way as any non-supervised classification method. This is clear if we analyze the training process when nP = nH = 1. This transforms the dialectical classifier into the fuzzy c-means classifier based on the Principle of Maximum Entropy [9]. The non-supervised classification process is performed as the following described manner: given a set of input conditions x = (x1 , x2 , . . . , xn )T , (15) if the learning process reached stabilization with Ω = {C1 , C2 , . . . , CnC }, (16) the classification rule is defined as following: k = arg max{g1 (x), g2 (x), . . . , gnC (x)} ⇒ x ∈ Ck . (17) 4 Materials and Methods 4.1 MR Images In this work we adopted the following case study: we used magnetic resonance (MR) synthetic multispectral images composed by proton density, T1 - and T2 -weighted synthetic sagital images of 181 slices with 1 mm, resolution of 1 mm3, for a normal brain and a noiseless MR tomographic system without field inhomogeneities, amounting a total of 543 images, generated by MR image simulator BrainWeb [19, 8]. These images can have a maximum amount of 13 anatomical elements. Therefore, the number of classes present in each image can reach 13 classes. Consequently, each class is associated to a determined output of the classifiers we used to perform this study. Figures 1 (band 0), 2 (band 1) and 3 (band 2) show PD- (proton density), T1 - and T2 -weighted MR images of the 97th slice, while figure 4 shows the R0-G1-B2 colored composition of the same slice. 10 Figure 1: PD-weighted MR image of the 97th slice Figure 2: T1 -weighted MR image of the 97th slice Figure 3: T2 -weighted MR image of the 97th slice 11 Figure 4: R0-G1-B2 colored composition of PD-, T1 -, and T2 -weighted MR images of the 97th slice 4.2 Image Fidelity Indexes The distortion error for all non-supervised classification methods was indirectly measured using the following global pixel-by-pixel fidelity indexes: the maximum error (ME), the mean absolute error (MAE), the mean square error (MSE), the root mean square error (RMSE), and the peak signal to noise ratio (PSNR), described as following [20]: ǫME = max{||f (u) − f ′ (u)||}u∈S , (18) ǫMAE = 1 X ||f (u) − f ′ (u)||, #S u∈S (19) ǫMSE = 1 X ||f (u) − f ′ (u)||2 , #S u∈S (20) ǫRMSE = √ ǫMSE , ǫPSNR = 20 log10 Lmax , ǫRMSE (21) (22) for W = {0, 1, . . . , Lmax }, considering a n-band multispectral image f : S → W n and its reference image f ′ : S → W n . For normalized multispectral images, f : S → [0, 1]n , we have Lmax = 1. Obviously, there are other important and useful image fidelity indexes, like Wang and Bovik’s index [21]. However, in this work we are interested in using image fidelity indexes as an indirect measure of the mean quantization distortion associated to non-supervised classification methods. Therefore, we are just interested in indexes based on pixel-by-pixel differences, once Wang and Bovik’s index and other similar 12 indexes are focused in comparisons based on image global statistics [21, 20]. This justifies our preference by simple and classical pixel-by-pixel fidelity indexes. 4.3 Non-Supervised Image Classification Methods The synthetic multispectral images obtained by colored compositions R0-G1-B2 were classified using the following methods, also used to evaluate vector quantization performance: 1. Kohonen self-organized map classifier (KO): 3 inputs, 13 outputs, maximum of 200 iterations, initial learning rate η0 = 0.1, Gaussian function of distance; 2. Fuzzy c-means classifier (CM): 3 inputs, 13 outputs, maximum of 200 iterations, initial learning rate η0 = 0.1; 3. K-means classifier (KM): 3 inputs, 13 outputs, maximum of 200 iterations, initial learning rate η0 = 0.1. 4. Objective dialectical classifier (ODC): 14 initial poles, 2 historical phases of 150 iterations each phase, initial historical step η0 = 0.1, minimum force of 5%, minimum contradiction of 1%, maximum contradiction of 98%, maximum crisis of 35%, until 12 poles. After all historical phases, the training process was finished with 13 poles. 5 Experimental Results Figures 5, 6, 7 and 8 show classification results, whilst figures 9, 10, 11 and 12 exhibit quantization results for the image of the 97th slice, figure 4, using methods KO, CM, KM and ODC, respectively. Image quantization is the procedure of constraining a determined image from its complete set of pixels to a smaller set of vectors with same dimensions feasible to represent the original image with a smaller gamute, according to a given fidelity measure. Herein this work we built quantization images just by changing the original pixels for the vectors of weights related to the classification results, i.e. the centroids of the unsupervised classification methods. 13 Figure 5: Classification results of the 97th slice using KO method Figure 6: Classification results of the 97th slice using CM method Figure 7: Classification results of the 97th slice using KM method 14 Figure 8: Classification results of the 97th slice using ODC method Figure 9: Quantization results of the 97th slice using KO method Figure 10: Quantization results of the 97th slice using CM method 15 Figure 11: Quantization results of the 97th slice using KM method Figure 12: Quantization results of the 97th slice using ODC method 16 Table 1 shows the results of the evaluation of the non-supervised classification methods with respect to vector quantization, using fidelity indexes ǫME , ǫMAE , ǫMSE , ǫRMSE and ǫPSNR , considering all 181 slices with 3 bands (DP, T1 and T2 ), for KO, CM, KM and ODC methods. Table 2 shows one-by-one comparisons of pairs of sample mean and mean deviation of ǫME , ǫMAE , ǫMSE , ǫRMSE and ǫPSNR for methods KO, CM, KM and ODC, according to the null-hypothesis test F, whilst table 3 shows global comparisons between ODC method and KO, CM and KM methods, using test χ2 to measure the statistical adherence of results generated by ODC and results generated by the others methods; the sequences of observed values were build using the sample mean and the mean deviation of ǫME , ǫMAE , ǫRMSE and ǫPSNR . Both tests were performed taking into account 95% of confidence. ǫME ǫMAE ǫMSE ǫRMSE ǫPSNR KO 50 ± 5 10 ± 3 186 ± 52 13 ± 2 26 ± 2 CM 106 ± 15 10 ± 2 258 ± 81 16 ± 31 24 ± 2 KM 84 ± 22 13 ± 4 347 ± 261 18 ± 5 24 ± 3 ODC 50 ± 3 12 ± 2 249 ± 60 15 ± 2 25 ± 1 Table 1: Quantization results concerning image fidelity indexes ODC-KO ODC-CM ODC-KM µ(ǫME ) 0.99 0.61 0.83 µ(ǫMAE ) 0.86 0.86 0.86 µ(ǫRMSE ) 0.89 0.89 0.89 µ(ǫPSNR ) 1.00 1.00 1.00 Table 2: Degrees of similarity of experimental results of each classification method according to nullhypothesis test F, for each similarity index ODC-KO 0.96 ODC-CM 0.00 ODC-KM 0.00 Table 3: Degrees of global similarity of experimental results of each classification method according to test χ2 6 Discussion Table 1 shows statistics of the fidelity indexes measured for each 3-band slice of the studied synthetic brain volume. From these results, regarding just sample means, we can see that ODC and KO got apparently the best results for ǫME , ǫMAE and ǫRMSE , respectively 46, 10 and 169 (ODC), against 50, 10, 186 (KO), 106, 17 10, 258 (CM), and 84, 13 and 347 (KM). However, concerning just sample means again, it is possible to see that these results were almost identical to the results obtained by KO and CM, considering ǫRMSE and ǫPSNR , respectively 15 and 25 (ODC), 13 and 26 (KO), against 16 and 24 (CM), and 18 and 24 (KM). Such results point to an apparent little advantage of Kohonen’s SOM classifier, once it is an optimal method taking into account vector quantization [22]. Herein this work we decided to use the null-hypothesis test F with 95% of confidence, to make comparisons considering the sample means and the respective mean deviations of fidelity indexes. Table 2 shows these results, where we can see that, according to test F, there is a degree of similarity of 0.99 between ODC and KO, regarding ǫME , against 0.61 and 0.83 for CM and KM, respectively. However, considering the other fidelity indexes, ODC is apparently very similar to the others: similarities of 0.86, 0.89 and 1.00, regarding indexes MAE, RMSE and PSNR, respectively, which means that ODC is practically equal to the other three methods, concercing PSNR. These results show that, concerning also table 1 and one-by-one comparisons, although KO is obviously superior to the other methods, ODC method is reasonably close to KO. We also decided to employ the adherence test χ2 with 95% of confidence to get a global evaluation of ODC related to KO, CM and KM. Table 3 shows the results of the application of test χ2 to the following pairs of sequences: ODC-KO, ODC-CM and ODC-KM. These sequences are composed by sample means of fidelity indexes ǫME , ǫMAE , ǫRMSE and ǫPSNR , and their respective mean deviations. The test results show that ODC results are similar to KO’s, with similarity of 0.96. 7 Conclusion From the results we presented above we could conclude that the objective dialectical classifier is a good clustering method concerning quantization distorsion, able to get results almost as good as those results obtained by the optimal clustering method based on Kohonen self-organized maps. Table 1 shows that KO is slightly better than ODC. However, we claim that ODC is a completely new algorithmic concept, having still a lot of unexplored design options, which could lead us to generate other forms and implementations for the dialectical method feasible to be used in other applications of pattern recognition and clustering. As future works, we propose the elaboration of new optimization and supervised classification-based methods 18 using the dialectical analogies we presented in this work. Therefore we can perceive that it is possible to construct feasible non-supervised classification and clustering methods based on philosophical heuristic and mimics approaches, taking into account more complex models than those biologically-inspired models commonly used in Computational Intelligence: models based on Philosophy and its investigative structural methods, refined by the use of the Principle of Maximum Entropy and the power of fuzzy membership functions to model non-probabilistic uncertainty. References [1] K. Marx. Critique of Hegel’s dialectics and philosophy. In Economic and Philosophic Manuscripts of 1844. International Publishers, 1980. [2] A. Gramsci. Introduction to the Study of Philosophy and Historical Materialism. In Prison Notebooks. Columbia University, 1992. [3] A. Gramsci. Some Problems in the Study of the Philosophy of Praxis. In Prison Notebooks. Columbia University, 1992. [4] N. Bobbio. Saggi su Gramsci. Feltrinelli, Milano, 1990. [5] W. P. Santos, R. E. Souza, P. B. Santos Filho, F. B. Lima Neto, and F. M. Assis. A Dialectical Approach for Classification of DW-MR Alzheimer’s Images. In IEEE World Congress on Computational Intelligence (WCCI 2008), pages 1728–1735, Hong Kong, China, 2008. CIS-IEEE. [6] C. Thornley and F. Gibb. A dialectical approach to information retrieval. Journal of Documentation, 63(5):755–764, 2007. [7] J. B. Rosser Jr. Aspects of dialectics and nonlinear dynamics. Cambridge Journal of Economics, 24(3):311–324, 2000. [8] D. L. Collins, A. P. Zijdenbos, V. Kollokian, J. G. Sled, N. J. Kabani, C. J. Holmes, and A. C. Evans. Design and Construction of a Realistic Digital Brain Phantom. IEEE Transactions on Medical Imaging, 17(3):463–468, 1998. 19 [9] D. Chen and C. Zhao. Data-driven fuzzy clustering based on maximum entropy principle and PSO. Expert Systems with Applications, 36:625–633, 2009. [10] E. T. Jaynes. Information Theory and Statistical Mechanics I. The Physical Review, 106(4):620–630, 1957. [11] W. P. Santos, F. M. Assis, R. E. Souza, P. B. Mendes, H. S. S. Monteiro, and H. D. Alves. Dialectical Non-Supervised Image Classification. In IEEE Congress on Evolutionary Computation (CEC 2009), pages 2480–2487, Trondheim, 2009. CIS-IEEE. [12] W. P. Santos, F. M. Assis, R. E. Souza, and P. B. Santos Filho. Dialectical Classification of MR Images for the Evaluation of Alzheimer’s Disease. In G. R. Naik, editor, Recent Advances in Biomedical Engineering, pages 241–250, Vukovar, 2009. In-Teh. [13] W. P. Santos, F. M. Assis, R. E. Souza, P. B. Mendes, H. S. S. Monteiro, and H. D. Alves. A Dialectical Method to Classify Alzheimer’s Magnetic Resonance Images. In W. P. Santos, editor, Evolutionary Computation, pages 473–486, Vukovar, 2009. In-Teh. [14] W. P. Santos, F. M. Assis, R. E. Souza, A. C. T. C. Albuquerque, and M. L. B. Simas. A Monospectral Approach for fMRI Analysis using Kohonen Self-Organized Networks and Objective Dialectical Classifiers. International Journal of Innovative Computing and Applications, 1(4):260–273, 2008. [15] W. P. Santos, F. M. Assis, R. E. Souza P. B. Santos Filho, and F. B. Lima Neto. Dialectical Multispectral Classification of Diffusion-Weighted Magnetic Resonance Images as an Alternative to Apparent Diffusion Coefficients Maps to Perform Anatomical Analysis. Computerized Medical Imaging and Graphics, 33(6):442–460, 2009. [16] W. P. Santos, F. M. Assis, P. B. Mendes, H. S. S. Monteiro, and H. D. Alves. An Object-Oriented Approach to Design Dialectical Systems. In T. S. Clary, editor, Horizons in Computer Science Research, New York, 2009. Nova Science. [17] W. P. Santos, F. M. Assis, and R. E. Souza. MRI Segmentation using Dialectical Optimization. In 31st Annual International Conference of the IEEE Engineering in Medicine and Biology Society, pages 5752–5755, Minneapolis, USA, 2009. EMBS-IEEE. 20 [18] W. P. Santos, F. M. Assis, R. E. Souza, and P. B. Santos Filho. Evaluation of Alzheimer’s Disease by Analysis of MR Images using Objective Dialectical Classifiers as an Alternative to ADC Maps. In 30th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, pages 5506–5509, Vancouver, Canada, 2008. EMBS-IEEE. [19] R. K. S. Kwan, A. C. Evans, and G. B. Pike. MRI simulation-based evaluation of image-processing and classification methods. IEEE Transactions on Medical Imaging, 18(11):1085–1097, 1999. [20] H. Pedrini and W. R. Schwartz. Análise de Imagens Digitais: Princípios, Algoritmos e Aplicações. Thomson, São Paulo, 2008. [21] Z. Wang and A. C. Bovik. A universal image quality index. IEEE Signal Processing Letters, 9, 2002. [22] S. Haykin. Redes Neurais: Princípios e Prática. Bookman, Porto Alegre, 2001. 21 This figure "97_class_normal_pn0_rf0_CM.PNG" is available in "PNG" format from http://arxiv.org/ps/1712.01694v1 This figure "97_class_normal_pn0_rf0_DLT.PNG" is available in "PNG" format from http://arxiv.org/ps/1712.01694v1 This figure "97_class_normal_pn0_rf0_DLTPME.PNG" is available in "PNG" forma http://arxiv.org/ps/1712.01694v1 This figure "97_class_normal_pn0_rf0_KM.PNG" is available in "PNG" format from http://arxiv.org/ps/1712.01694v1 This figure "97_class_normal_pn0_rf0_KO.PNG" is available in "PNG" format from: http://arxiv.org/ps/1712.01694v1 This figure "97_normal_pn0_rf0.PNG" is available in "PNG" format from: http://arxiv.org/ps/1712.01694v1 This figure "97_normal_pn0_rf0_pd.PNG" is available in "PNG" format from: http://arxiv.org/ps/1712.01694v1 This figure "97_quant_normal_pn0_rf0_CM.PNG" is available in "PNG" format from http://arxiv.org/ps/1712.01694v1 This figure "97_quant_normal_pn0_rf0_DLT.PNG" is available in "PNG" format from http://arxiv.org/ps/1712.01694v1 This figure "97_quant_normal_pn0_rf0_DLTPME.PNG" is available in "PNG" forma http://arxiv.org/ps/1712.01694v1 This figure "97_quant_normal_pn0_rf0_KM.PNG" is available in "PNG" format from http://arxiv.org/ps/1712.01694v1 This figure "97_quant_normal_pn0_rf0_KO.PNG" is available in "PNG" format from http://arxiv.org/ps/1712.01694v1 This figure "97_class_normal_pn0_rf0_DLTPME__1_.PNG" is available in "PNG" fo http://arxiv.org/ps/1712.01694v1 This figure "97_class_normal_pn0_rf0_KM__1_.PNG" is available in "PNG" format http://arxiv.org/ps/1712.01694v1 This figure "97_class_normal_pn0_rf0_KO__1_.PNG" is available in "PNG" format http://arxiv.org/ps/1712.01694v1 This figure "97_normal_pn0_rf0_t1.PNG" is available in "PNG" format from: http://arxiv.org/ps/1712.01694v1 This figure "97_quant_normal_pn0_rf0_DLT__1_.PNG" is available in "PNG" forma http://arxiv.org/ps/1712.01694v1 This figure "97_quant_normal_pn0_rf0_KM__1_.PNG" is available in "PNG" format http://arxiv.org/ps/1712.01694v1 This figure "97_normal_pn0_rf0_t2.PNG" is available in "PNG" format from: http://arxiv.org/ps/1712.01694v1
9cs.NE
On the Existence of Densities for Functional Data and their Link to Statistical Privacy arXiv:1711.06660v1 [math.ST] 17 Nov 2017 Ardalan Mirshani Matthew Reimherr∗ Aleksandra Slavković Abstract In statistical privacy (or statistical disclosure control) the goal is to minimize the potential for identification of individual records or sensitive characteristics while at the same time ensuring that the released information provides accurate and valid statistical inference. Differential Privacy, DP, has emerged as a mathematically rigorous definition of risk and more broadly as a framework for releasing privacy enhanced versions of a statistical summary. This work develops an extensive theory for achieving DP with functional data or function valued parameters more generally. Functional data analysis, FDA, as well as other branches of statistics and machine learning often deal with function valued parameters. Functional data and/or functional parameters may contain unexpectedly large amounts of personally identifying information, and thus developing a privacy framework for these areas is critical in the era of big data. Our theoretical framework is based on densities over function spaces, which is of independent interest to FDA researchers, as densities have proven to be challenging to define and utilize for FDA models. Of particular interest to researchers working in statistical disclosure control, we demonstrate how even small amounts of over smoothing or regularizing can produce releases with substantially improved utility. We carry out extensive simulations to examine the utility of privacy enhanced releases and consider an application to Multiple Sclerosis and Diffusion Tensor Imaging. KEYWORDS: Differential Privacy, Functional Data, Hilbert Space, Density Estimation, Reproducing Kernel Hilbert Space 1 Introduction New studies, surveys, and technologies are resulting in ever richer and more informative data sets. Data being collected as part of the “big data revolution” occurring in the sciences have dramatically expanded the pace of scientific progress over the last several decades, but often ∗ Address for correspondence: Matthew Reimherr, Department of Statistics, Pennsylvania State University, 411 Thomas Building, University Park, PA 16802, USA. E-mail: [email protected] 1 contain a significant amount of personal or subject level information. These data and their corresponding analyses present substantial challenges for preserving subjects’ privacy as researchers attempt to understand what information can be publicly released without impeding scientific advancement and policy making (Lane et al., 2014). One type of big data that has been heavily researched in the statistics community over the last two decades is functional data, with the corresponding branch of statistics called functional data analysis, FDA. FDA is concerned with conducting statistical inference on samples of functions, trajectories, surfaces, and other similar objects. Such tools have become increasingly necessary as our data gathering technologies become more sophisticated. FDA methods have proven very useful in a wide variety of fields including economics, finance, genetics, geoscience, anthropology, and kinesiology, to name only a few (Ramsay and Silverman, 2002, 2005; Ferraty and Romain, 2011; Horváth and Kokoszka, 2012; Kokoszka and Reimherr, 2017). Indeed, nearly any data rich area of science will eventually come across applications that are amenable to FDA techniques. However, functional data are also a rich source of potentially personally identifiable information (e.g., genomic data, including genomic sequences Erlich and Narayanan (2014); Schadt et al. (2012), biomedical imaging Kulynych (2002), etc.). To date, there has been very little work concerning FDA and statistical data privacy, that is, statistical disclosure control (SDC) or statistical disclosure limitation (SDL), the branch of statistics concerned with limiting identifying information in released data and summaries while maintaining their utility for valid statistical inference. SDC has a rich history for both methodological developments and applications for “safe” release of altered (or masked) microdata and tabular data, e.g., (Dalenius, 1977; Rubin, 1993; Willenborg and De Waal, 1996; Fienberg and Slavković, 2010; Hundepool et al., 2012), for general review of the area and the related methodology. Hall et al. (2013) provide the most substantial contribution to privacy of FDA data to date, where the authors are primarily interested in nonparametric smoothing, releasing pointwise evaluations of functions with a particular focus on kernel density estimators. They work within the framework of Differential Privacy, DP, that has emerged from theoretical computer science with a goal of designing privacy mechanisms with mathematically provable disclosure 2 risk (Dwork, 2006; Dwork et al., 2006b). One of the major findings of Hall et al. (2013) is the connection between DP and Reproducing Kernel Hilbert Spaces. This connection will be explored here with even greater depth. Recently Aldà and Rubinstein (2017) extended this work by considering a Laplace (instead of a Gaussian) mechanism and focused on releasing an approximation based on Bernstein polynomials, exploiting their close connection to point-wise evaluation on a grid or mesh. In this work, we move beyond Hall et al. (2013) by establishing DP for functional data more broadly. We propose a mechanism for achieving DP for releasing any set of linear functionals of a functional object, which include point-wise releases as a special case. We will show that this mechanism also protects against any nonlinear functions of the functional object or even a full function release. To establish the necessary probabilistic bounds for DP we utilize functional densities. This represents a major step for FDA as densities for functional data are sometimes thought not to exist (Delaigle and Hall, 2010). Lastly, we demonstrate these tools by estimating the mean function via RKHS smoothing. One of the major findings of this work is the interesting connection between regularization and privacy. In particular, we show that by slightly over smoothing, one can achieve DP with substantially less noise, thus better preserving the utility of the release. It turns out that a great deal of personal information can reside in the “higher frequencies” of a functional parameter estimate. To more fully illustrate this point, we demonstrate how a cross-validation for choosing smoothing parameters can be dramatically improved when the cross-validation incorporates the function to be released.Previous works concerning DP and regularization have primarily focused on performing shrinkage regression in a DP manner (e.g., Kifer et al. (2012); Chaudhuri et al. (2011)), but not using the smoothing to recover some utility as we propose here. The remainder of the paper is organized as follows. In Section 2 we present the necessary background material for DP and FDA. In Section 3 we present our primary results concerning releasing a finite number of linear functionals followed by full function and nonlinear releases. We also present our work related to densities for FDA, which is of independent interest. In Section 4 we present an application to RKHS smoothing, which is especially amenable to our privacy 3 mechanism. In Section 5 we present simulations to highlight the role of different parameters, while in Section 6 we present an application to Diffusion Tensor Imaging of Multiple Sclerosis patients. In Section 7 we discuss our results and present concluding remarks. All mathematical proofs and derivations can be found in the Appendix. 2 Background 2.1 Differential Privacy Let D be a countable (potentially infinite) population of records, and denote by D the collection of all n-dimensional subsets of D. Throughout we let D and D0 denote elements of D. Notationally, we omit the dependence on n for ease of exposition. Differntial Privacy, DP, was first introduced by Dwork (2006); Dwork et al. (2006b) as a criteria for evaluating the efficacy of a privacy mechanism. In this work we use a form called (α, β)−DP (also commonly referred to as (, δ)−DP), where α and β are privacy parameters with smaller values indicating stronger privacy. DP is a property of the privacy mechanism applied to the data summary, in this case fD := f (D), prior to release. For simplicity, we will denote the application of this mechanism using a tilde; so f˜D := f˜(D) is the privacy enhanced version of fD . Probabilistically, we view f˜D as a random variable indexed by D (which is not treated as random). This criteria can be define for any probability space. Definition 1. Let f : D → Ω, where Ω is some metric space. Let f˜D be random variables, indexed by D, taking values in Ω and representing the privacy mechanism. The privacy mechanism is said to achieve (α, β)−DP if for any two datasets, D and D0 , which differ in only one record, we have P (f˜D ∈ A) ≤ P (f˜D0 ∈ A)eα + β, for any measurable set A. The most common setting is when Ω = R, i.e., the summary is real valued. In Section 3.1 we take Ω = RN , corresponding to releasing N functionals of a functional object, while in 3.2 4 we will consider the case when Ω = H, a real separable Hilbert space. At a high level, achieving (α, β)−DP means that the object to be released changes relatively little if the sample on which it is based is perturbed slightly. This change is related to what Dwork (2006) called “Sensitivity”. Another nice feature is that if f˜D achieves DP, then so does any measurable transformation of it; see Dwork et al. (2006a,b) for the orginal results, Wasserman and Zhou (2010) for its statistical framework, and Dwork and Roth (2014) for a more recent detailed review of relevant DP results. For convenience, we restate the lemma and its proof with respect to our notation in Appendix A. 2.2 Functional Data Analysis Here we provide a few details concerning FDA that will be important later on. Throughout we let H denote a real separable Hilbert space, i.e., a complete inner product space that admits a countable basis. The most commonly encountered space in FDA is L2 [0, 1], though many other spaces are becoming of increasing interest. For example, multivariate or panel functional data, functional data over multidimensional domains (such as space-time), as well as spaces which incorporate more structure on the functions, such as Sobolev spaces and Reproducing Kernel Hilbert Spaces. Throughout, we will let θ : D → H denote the particular summary of interest and for notational ease, we define θD := θ(D). In Section 3.1 we consider the case where we want to release a finite number of continuous linear functionals of θD , where as in Section 3.2 we consider releasing a privacy enhanced version of the entire function or some nonlinear transformation of it (such as a norm). The backbone of our privacy mechansim is the same as in Hall et al. (2013), and is used extensively across the DP literature. In particular, we will add Gaussian noise to the summary and show how the noise can be calibrated to achieve DP. We say Z is a Gaussian process in H if hZ, hiH is Gaussian in R, for any h ∈ H. Every Gaussian process in H is uniquely parametrized by a mean function, µ ∈ H, and a covariance operator (which is symmetric, nonnegative definite, 5 and nuclear) C : H → H (Laha and Rohatgi, 1979, Page 488). One then has that hZ, hiH ∼ N (hµ, hiH , hC(h), hiH ), for any h ∈ H. We use the short hand notation N to denote the Gaussian distribution over R, but include subscripts for any other space, e.g., NH for H. Let K be a symmetric, positive definite, bounded linear operator over H, that admits a spectral decomposition given by K= (1) ∞ X λ i vi ⊗ vi , i=1 where ⊗ denotes the tensor product between two elements of H, the result of which is an operator, (x ⊗ y)(h) := hy, hiH x. The λi and vi denote the eigenvalues and eigenfunctions, respectively, of K. Without loss of generality, one can assume that the vi form an orthonormal basis of H. The operator K can be used to define a subspace of H that is also a Hilbert space. In particular, ( (2) K := h∈H: ∞ X hh, vi i2 i=1 λi ) <∞ . It is usually assumed that λi 6= 0, however, the case where λi = 0 for some i is readily included with the convention 0/0 = 0 in the above summation. In that case, it is understood that if λi = 0 then hh, vi i = 0 for all h ∈ K. For example, if only a finite number of λi were nonzero then K would be finite dimensional. The space K is a Hilbert space when equipped with the P −1 inner product hx, yiK = λi hx, vi ihy, vi i. When H = L2 [0, 1] and K is an integral operator with kernel k(t, s), then K is also a Reproducing Kernel Hilbert Space, RKHS (Berlinet and Thomas-Agnan, 2011). 6 3 Privacy Enhanced Functional Data In this section we present our main results. The mechanism we use for guaranteeing differential privacy is to add a Gaussian noise before releasing θD . In other words, our releases will be based on a private version θ̃D , where θ̃D = θD + δZ. However, it turns out that not just any Gaussian noise, Z, can be used. In particular, the options for choosing Z depend heavily on the summary θD . This is made explicit in the following definition. Definition 2. We say that the summary θD is compatible with a Gaussian noise, Z ∼ NH (0, C), if θD ∈ K for any D ∈ D, where K is defined in (2) with kernel K = C. In other words, for a particular noise to be viable for the privacy mechanism, it must be the case that the summary resides in the weighted subspace derived from the covariance operator of the noise. Recall that every covariance operator is compact, symmetric, and positive definite and thus admits the expansion (1). Our next definition comes from Hall et al. (2013), but we state it here more generally. Definition 3. The global sensitivity of a summary θD , with respect to a Gaussian noise Z ∼ NH (0, C) is given by ∆2 = sup kθD − θD0 k2K , D0 ∼D where D0 ∼ D means the two sets differ at one record only. The space, K, is defined in (2) with kernel K = C The global sensitivity (GS) is a central quantity in the theory of DP. In particular, the amount of noise, δZ, depends directly on the global sensitivity. It should be noted that there are other notions of “sensitivity” in the DP literature, such as local sensitivity, but here our focus is on the global sensitivity that typically leads to the worst case definition of risk under DP; for a detailed review of DP theory and concepts, see Dwork and Roth (2014). If a summary is not compatible with a noise, then it is possible to make the global sensitivity infinite, in which case, no finite amount of noise would be able to preserve privacy in the sense of satisfying DP. We present a simple example below to help illustrate this point. We show that if θD does not 7 lie in K, then no level of noise can be added that guarantees scalar DP holds uniformly across hθD , hi for any h. Example 1. Let Z be Brownian motion over [0, 1], which means that the kernel of C is given by c(t, s) = min{t, s} t, s ∈ [0, 1]. The kernel, c, admits the following spectral decomposition: c(t, s) = ∞ X j=1 λj = 2 sin((j − 1/2)πt) sin((j − 1/2)πs), (j − 1/2)2 π 2 1 , (j − 1/2)2 π 2 and vj (t) = √ 2 sin((j − 1/2)πt). Let D consist of the N iid realizations of the following process Xi (t) = Yi ∞ X j=1 √ 2 sin((j − 1/2)πt), (j − 1/2)3/4 π i = 1, . . . , N, where Yi are iid standard normal. Then we have that kXi k2H = Yi2 ∞ X j=1 1 <∞ (j − 1/2)3/2 π 2 but kXi k2K = Yi2 ∞ X (j − 1/2)2 = ∞. (j − 1/2)3/2 j=1 So the Xi are not in the RKHS, K defined using the kernel c(t, s). Now suppose that θD = X is a single element of D, and we aim to release a privacy enhance version of fD := hθD , vi i. Using classic results from univariate DP (e.g. Dwork et al., 2006a), a private version would be hX, vj iH + δhZ, vj iH , where δj2 = 2 log(2/β) 2 ∆j α2 ∆2j = sup and i,k 8 hXi − Xk , vj i2H . hC(vj ), vj iH Here ∆j denotes the scalar global sensitivity of hX, vj i with respect to hZ, vj i. We can express sup i,k hXi − Xk , vj i2H (j − 1/2)2 = (j − 1/2)0/5 sup(Yi − Yk )2 . = sup(Yi − Yk )2 3/2 hC(vj ), vj iH (j − 1/2) i,k i,k However, this quantity goes to infinity as j → ∞. Therefore, there is no level of noise, δ, we can add to fD which would guarantee (α, β)-DP uniformly across the choice of h. 3.1 Releasing Finite Projections We begin with the simpler task of releasing a finite vector of continuous linear functionals of θD . By the Riesz Representation Theorem, every continuous linear functional, T (·), over H is of the form T (·) = h·, hiH . Thus, equivalently, we aim to release a private version of {hθD , h1 iH , . . . , hθD , hN iH } for some finite number N , and fixed {hi ∈ H}N i=1 . Theorem 1. Assume θD is compatible with Z ∼ N (0, C), and define θ̃D = θD + δZ with δ= 2 log(2/β) 2 ∆ . α2 ˜ Now define f : D → RN as fD := {hθD , hi i} and f˜D := {hθ̃D , hi i}, for {hi ∈ H}N i=1 . Then fD achieves (α, β)-DP for any finite choice of N and any hi ∈ H. Theorem 1 can be viewed as an extension of Hall et al. (2013) who allow for point-wise releases only. If the Hilbert space H is also taken to be an RKHS, then Theorem 1 implies pointwise releases are protected as well, since in an RKHS point-wise evaluations are also continuous linear functionals. However, this theorem allows the release of any functional. Additionally, notice that while fD must lie in K, the hi can be any functions in H, which dramatically increases the release options as compared to Hall et al. (2013) or Aldà and Rubinstein (2017). 3.2 Full Function and Nonlinear Releases While Section 3.1 covers a number of important cases, it does not cover all releases of potential interest. In particular, full function releases are not protected and neither are nonlinear releases, 9 such as norms or derivatives. To guarantee privacy for these types of releases, we need to establish (α, β)-DP for the entire function, not just finite projections. This means that in Definition 1, the metric space is taken to be H which is infinite dimensional. In previous works (e.g. Dwork et al., 2014; Hall et al., 2013) to establish the probability inequalities like in Definition 1, bounds based on multivariate normal densities were used. This presents a serious problem for FDA as there is nearly no work in the literature of FDA which employs densities. This is due to the great difficulty in defining them for Hilbert space processes. For example, Delaigle and Hall (2010) are one of the few to tackle this problem, but get around it by defining a density only for finite “directions” of functional objects. Another example is Bongiorno and Goia (2015) who define psuedo-densities by carefully controlling “small ball” probabilities. Both works claim that for a functional object the density “generally does not exist.” However, this turns out to be a technically incorrect claim, while still often being true in spirit. The correct statement is that, in general, it is difficult to define a useful density for functional data. In particular, to work with likelihood methods, a family of probability measures should all have a density with respect to the same base measure, which, at present, does not appear to be possible in general for functional data. The concept of defining densities over function spaces has a very deep history. Given its potential importance in FDA, we will attempt to reference some of the major works. These results have been used extensively in areas such as mathematical finance and spatial statistics. Recall that a density is a Radon-Nikodym derivative (RND) of one measure with respect to another (herein called the base measure). For probability models, the base measure is typically Lebesgue or counting measure for continuous and discrete random variables respectively. RNDs were first introduced in the works of Radon (1913) and Nikodym (1930). The existence of RNDs depends on the absolute continuity of measures and thus a great deal of work that followed focused on determining when infinite dimensional measures were equivalent or orthogonal; for example, see Cameron and Martin (1944, 1945, 1947); Kakutani (1948); Grenander (1950); Baxter (1956); Feldman (1958); Girsanov (1960); Varberg (1961); Rozanov (1964); Shepp (1964); Varberg (1964, 1967). In addition, once two measures are equivalent, then the question becomes, 10 what is the density of one with respect to the other? This also has a very rich body of literature including Rozanov (1962); Rao and Varadarajan (1963); Shepp (1966) and Skorohod (1967). In the early 1970s Black and Scholes published their landmark paper on option pricing (Black and Scholes, 1973), which utilized much of this theory, while Ibragimov and Rozanov published a book (Ibragimov and Rozanov, 1978) summarizing much of the discussed work, especially as it related to stationary Gaussian processes. Thereafter, much of the work has been focused more on specific areas of application as the bulk of the foundational theory had been established. Our goal in using densities is relatively straightforward. We aim to define densities (with respect to the same base measure) for the family of probability measures induced by {f (D)+δZ : D ∈ Dn }, where Z is a mean zero Gaussian process in H with covariance operator C. It turns out that this is in fact possible because we are adding the exact same type of noise to each element. We give the following theorem, which can be viewed as a slight generalization and reformulation of Theorem 6.1 from Rao and Varadarajan (1963). Theorem 2. Assume that the summary θD is compatible with a noise Z. Denote by Q the probability measure over H induced by δZ, and by {PD : D ∈ D} the family of probability measures over H induced by θD + δZ. Then every measure PD has a density over H with respect to Q, and the density is given by    dPD 1 2 (h) = exp − 2 kfD kK − 2hh, fD iK , dQ 2δ Q almost everywhere. This density is unique up to a set of Q measure zero. Theorem 2 implies that, for any measurable set A ⊂ H we have Z PD (A) = A dPD (h) dQ(h). dQ To see why the density should be of the form given in Theorem 2, consider the density of XJ = {hθD + δZ, vj i}Jj=1 , where vj is the jth eigenfunction of the covariance operator of Z. This is a vector of independent normal random variables with means {hθD , vj i}Jj=1 and variances 11 {δ 2 λj }Jj=1 , which are the corresponding eigenvalues. While one typically defines the density of XJ with respect to Lebesgue measure, we can instead define it with respect to another normal, namely ZJ = {hδZ, vj i}Jj=1 , which has the same distribution as XJ except with zero mean. To define this density, we need only take the ratio of their densities with respect to Lebesgue measure. This gives n P o (xj −hfD ,vj i)2 exp − 2 fXJ (x) 2δ λj   = P x2 fZJ (x) exp − 2δ2jλj    J  1 2 X hfD , vj i − 2xj hfD , vj i   . = exp − 2   2δ λj −1 −1/2 j=1 δ λj Q −1/2 (2π)−J/2 Jj=1 δ −1 λj (2π)−J/2 QJ j=1 Now we see that if we were to take xj = hh, vj i then we could take limits of the above quantity, with respect to J, and, by Parceval’s identity, we would obtain the expression in Theorem 2. While a rigorous proof can be found in the appendix, this provides some intuition as to why the final density would take such a form. Now that we have a well defined density we can establish differential privacy for entire functions. Theorem 3. Let fD := θD , and assume that it is compatible with a noise Z, then f˜D := fD +δZ achieves (α, β)-DP over H, where δ is defined in Theorem 1. We also have the following corollary. Corollary 1. Let f be compatible with a noise Z, and let T be any measurable transformation from H → S, where S is a metric space. Then T (fD + δZ) achieves (α, β)-DP over S, where δ is defined in Theorem 1. Together, Theorem 3 and Corollary 1 imply that the Guassian mechanism first introduced by Hall et al. (2013) and expanded here, gives very broad privacy protection for functional data, as nearly any transformation or manipulation of the privacy enhanced release is guaranteed to maintain DP; this is known as a postporocessing property (e.g., see Dwork and Roth (2014)). All the proofs can be found in Appendix A. 12 4 Global Sensitivity Bounds for RKHS Smoothing In Sections 5 and 6 we illustrate how to produce private releases of mean function estimates based on RKHS smoothing. Here we derive a corresponding bound on the global sensitivity to be used generating the privacy enhanced estimates. There are of course a multitude of methods for estimating smooth functions, however an RKHS approach is especially amenable to our privacy mechanism. In this case we can define an RKHS smoother by using the kernel of the noise, C, to define the space K, i.e., K = C. The RKHS estimate of the mean µ is then defined as µ̂ = argmin g(M ) where M ∈K N 1 X g(M ) = kXi − M k2H + φkM k2K , N i=1 where the φ is called penalty parameter. Here, we can see the advantage of an RKHS approach as it forces the estimate to lie in the space K which means that the compatibility condition is satisfied. A kernel different from the noise could be used, but one must be careful to make sure that the the compatibility condition is met. If (λj , vj ) are the eigenvalue/function pairs of the P kernel K and {Xi = ∞ j=1 xij vj : i = 1, . . . , N }, with xij = hXi , vj i, then the estimate can be expressed as (3) µ̂ = N ∞ 1 X X λj xij vj , N λj + φ i=1 j=1 see Appendix B for details. We then have the following result. Theorem 4. If the H norm of all elements of the population is bounded by a constant 0 < τ < ∞ then the GS for RKHS estimation is bounded by ∆2n ≤ ∞ λj 4τ 2 X . 2 N (λj + φ)2 j=1 The resulting bound is practically very useful. One can rescale the data so that their H bound is, for example, 1, and then the remaining quantities are all tied to the noise/RKHS that is used. Thus, the bound can be practically computed and releases that are guaranteed to 13 achieve DP can be constructed. 5 Empirical Study In this section we present simulations with H = L2 [0, 1] to explore the impact of different quantities on the utility of privacy enhanced releases. This exploration will occur via the problem of estimating the mean function from a random sample of functional observations using RKHS smoothing, as discussed in Section 4. The quantities we will explore include the kernel function K(t, s), used to define K, the privacy parameters, (α, β), and the penalty parameter, φ, that (combined with K) controls the level of smoothing. For the RKHS, K, we consider four popular kernels:  −|t − s|2 K1 (t, s) = exp ρ ! ( √ ) √ 5|t − s| 5(t − s)2 − 5|t − s| K2 (t, s) = 1 + + exp ρ 3ρ2 ρ ! ( √ ) √ 3|t − s| − 3|t − s| exp K3 (t, s) = 1 + ρ ρ   −|t − s| . K4 (t, s) = exp ρ  (4) Each kernel is from the Matérn family of covariances (Stein, 2012), though the first is also known as the Gaussian or squared exponential kernel and the last is also known as the exponential, Laplacian, or Ornstein-Uhlenbeck kernel. We simulate data using the Karhunen-Loeve expansion, a common approach in FDA simulation studies. In particular we take (5) Xi (t) = µ(t) + m X j −p/2 Uij uj (t) t ∈ [0, 1], j=1 where the scores, Uij , are drawn uniformly between (−0.4, 0.4) in all scenarios. The functions, uj (t), are taken as the eigenfunctions of K1 (though each of the kernels lead to very similar 14 eigenfunctions) and m was taken as the largest value such that λm was numerically different than zero in R (usually about m = 50). The remaining parameters will be fixed in all scenarios, except for the one where they are explicitly varied to consider their effect. • The penalty parameter we take to be φ = 0.001, except in Scenario 1. • The range parameter for the kernel used to define K we take to be ρ = 0.001, except in Scenario 2. • The covariance function for the noise will be K1 with ρ = 0.2, except in Scenario 3. In all settings the RKHS kernel and the noise kernel will be taken to be the same. • The smoothness parameter for the data will be taken as p = 4, except in Scenario 4. • The DP parameters will be set at α = 1 and β = 0.1, except in Scenario 5. • The sample size will be taken as N = 25, except in Scenario 6. • The mean function will be taken as µ(t) = 0.1 sin(πt), except Scenario 7. All of the curves are generated on an equally spaced grid between 0 and 1, with 100 points. In all of these settings the risk is fixed by choosing the α and β in the definition of DP. We thus focus on the utility of the privacy enhanced curves by comparing them graphically to the original estimates and the data. Ideally, the original estimate will be close to the truth and the privacy enhanced version will close to the original estimate. What we will see is that by compromising slightly on the former, one can makes substantial gains in the latter. Scenario 1: Varying penalty term φ In this setting all of the previously discussed defaults are used except the penalty, φ, that varies from 10−6 to 1. In Figure 1 we plot all of the generated curves in grey, the RKHS smoothed mean in green, and the privacy enhanced version in red. We can see that as the penalty increases, both estimates shrink towards each other and to zero. There is a clear “sweet spot” in terms of utility, where the smoothing has helped reduce the amount of noise one has to add to the estimate while not over smoothing. This concept will be explored more in Section 6. 15 φ=0.001 0.15 0.15 φ=10−6 0.05 sample functions original summary private summary −0.05 0.0 0.2 0.4 0.6 0.8 −0.15 −0.15 −0.05 0.05 sample functions original summary private summary 1.0 0.0 0.2 0.4 1.0 0.15 0.05 sample functions original summary private summary 0.0 0.2 0.4 0.6 0.8 −0.15 −0.05 0.05 sample functions original summary private summary −0.05 −0.15 0.8 φ=1 0.15 φ=0.1 0.6 1.0 0.0 0.2 0.4 0.6 0.8 1.0 Figure 1: Original and private RKHS smoothing mean with Gaussian Kernel (K1 ) for different values of penalty parameter φ Scenario 2: Varying kernel range parameter ρ Here all defaults are used except the range parameter for the noise and RKHS (which are taken to be the same in all settings) that ranges from 0.002 to 2. The results are presented in Figure 2. We see very similar patterns to Scenario 1, where increasing ρ increases the smoothing of both the estimate and its privacy enhanced version. However, increasing ρ smooths more than it shrinks the estimates and there is still a non-negligible difference between the two estimates for larger values. Practically, both ρ and φ should be chosen together for the best performance, which we will explore further in Section 6. Scenario 3: Varying the kernel function k(t, s) Here we consider the four different kernels given in (4) for both the noise and RKHS kernel (which are taken to be the same). The results are summarized in Figure 3. All kernels give 16 ρ=0.02 0.15 0.15 ρ=0.002 0.0 0.2 0.4 0.6 0.8 0.05 −0.15 −0.05 −0.15 sample functions original summary private summary −0.05 0.05 sample functions original summary private summary 1.0 0.0 0.2 0.4 1.0 0.05 sample functions original summary private summary 0.0 0.2 0.4 0.6 0.8 −0.15 −0.05 0.05 sample functions original summary private summary −0.05 −0.15 0.8 ρ=2 0.15 0.15 ρ=0.2 0.6 1.0 0.0 0.2 0.4 0.6 0.8 1.0 Figure 2: Original and private RKHS smoothing mean with Gaussian Kernel (K1 ) for different values of kernel range parameter ρ roughly the same pattern, however, K1 produces curves which are infinitely differentiable, while the exponential kernel produces curves that are nowhere differentiable (they follow an OrnsteinUhlenbeck process). The two Matérn covariances give paths that have either one (K3 ) or two (K2 ) derivatives. Since the underlying function to be estimated is already very smooth, the kernel does not have a substantial impact. However, for more irregular shapes, this choice can play a substantial role on the efficiency of the resulting RKHS estimate. Scenario 4: Varying the smoothing parameter of samples p In this setting we vary p from 1.1 to 4, which determines the smoothness of the data, Xn (t). Figure 4 summarizes these results. As we can see, the smoothness of the curves has a smaller impact on the utility of the privacy enchanced versions as compared to other parameters. However, the roughness does influence the global sensitivity as given in Theorem 4, which can be 17 0.05 sample functions original summary private summary −0.05 0.2 0.4 0.6 0.8 −0.15 0.0 1.0 0.2 0.4 0.6 0.8 1.0 Exponential (K4) sample functions original summary private summary 0.0 0.2 0.4 0.6 0.8 −0.15 −0.05 0.05 sample functions original summary private summary 0.05 0.0 0.15 Matern 3/2 (K3) 0.15 −0.15 −0.05 0.05 sample functions original summary private summary −0.05 −0.15 Matern 5/2 (K2) 0.15 0.15 Gaussian (K1) 1.0 0.0 0.2 0.4 0.6 0.8 Figure 3: Original and private RKHS smoothing mean for different kernels seen. As the curves become smoother, the global sensitivity decreases implying the need for less noise being added in order to maintain the desired privacy level, and thus resulting in a higher utility for the privacy enhanced curves. However, the smoothness, in terms of derivatives, of the estimates is not affected, as this is determined by the kernel. Scenario 5: Varying the privacy parameters (α, β) In this setting we vary the privacy parameters, α and β. Figure 5 present the effects of varying α from 5 to 0.1 while in Figure 6 we vary β from 0.1 to 10−6 . As we decrease the parameters, we are requiring a stricter form of privacy, which is reflected in the plots; recall that β = 0 will give us the stricter form of DP, α-DP. As we decrease these values, the overall noise added increases, and we expect larger deviation of the privacy enhanced curve from the mean. As expected, there is less sensitivity in the output to changes in β than to α. However, as with the previous scenario these parameters play no role in the overall smoothness, in terms of derivatives, of the 18 1.0 0.15 p=2 0.2 p=1.1 sample functions original summary private summary −0.15 −0.2 −0.1 −0.05 0.0 0.05 0.1 sample functions original summary private summary 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 p=3 0.8 1.0 p=4 0.10 sample functions original summary private summary 0.00 0.05 sample functions original summary private summary −0.10 −0.05 −0.15 0.6 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 Figure 4: Original and private RKHS smoothing mean with Gaussian Kernel (K1 ) for different values of smoothing parameter of samples p resulting estimates. Scenario 6: Varying sample size N In Figure 7 we vary the sample size from 5 to 100. The results are very similar to changing β and α, as the sample size does not influence the smoothness of the curves (in terms of derivatives), but the accuracy of the estimate (green curve) gets much better and so does the utility of the privacy enhanced version. 19 0.05 sample functions original summary private summary −0.05 0.2 0.4 0.6 0.8 −0.15 0.0 1.0 0.0 0.2 0.6 0.8 1.0 α=0.1 sample functions original summary private summary −0.05 0.05 sample functions original summary private summary 0.05 0.4 0.15 α=0.5 0.15 −0.15 −0.05 0.05 sample functions original summary private summary 0.0 0.2 0.4 0.6 0.8 −0.20 −0.05 −0.15 α=1 0.15 0.15 α=5 1.0 0.0 0.2 0.4 0.6 0.8 1.0 Figure 5: Original and private RKHS smoothing mean with Gaussian Kernel (K1 ) for different values of privacy level parameter α when β = 1 Scenario 7: Different underlying mean function µ Lastly, in Figure 8 we consider three additional mean functions. Overall, the actual function being estimated does not influence the utility of the privacy enhanced version, only the accuracy of the original estimate. This is because the noise to be added is computed from the different smoothing parameters as well as the range of the L2 norm of the data, not the underlying estimate itself. 6 Application: Diffusion Tensor Imaging Regression with Functional Data or refund (Huang et al., 2016) is an R package that includes a variety of tools related to both linear and nonlinear regression for functional data. DTI or Diffusion Tensor Imaging is a data set in refund that gives fractional anisotropy (FA) tract 20 β=0.01 0.15 0.15 β=0.1 0.05 sample functions original summary private summary −0.05 0.0 0.2 0.4 0.6 0.8 −0.15 −0.15 −0.05 0.05 sample functions original summary private summary 1.0 0.0 0.2 0.15 0.15 0.8 1.0 0.05 sample functions original summary private summary 0.0 0.2 0.4 0.6 0.8 −0.15 −0.05 0.05 −0.05 −0.15 0.6 β=10−6 β=0.001 sample functions original summary private summary 0.4 1.0 0.0 0.2 0.4 0.6 0.8 1.0 Figure 6: Original and private RKHS smoothing mean with Gaussian Kernel (K1 ) for different values of privacy level parameter β when α = 1 profiles for the corpus callosum (CCA) and the right corticospinal tract (RCST) for patients with Multiple Sclerosis as well as controls. This type of imaging data is becoming more and more common and the privacy concerns can be substantial. For example, one would be concerned with releasing the image of a face from a study, but images of the brain or other major organs might also be sensitive, especially if the study is related to some complex disease such as cancer, HIV, etc. Thus it is useful to illustrate how to produce privacy enhanced versions of statistics such as mean functions. We focus on the cca data, which includes 382 patients measured at 93 equally spaced locations along the CCA, and use them to illustrate our proposed methodology. Our aim is to release a privacy enhanced RKHS smoothing estimate of the mean function. We consider only the kernels K1 , K3 and K4 which correspond to the Gaussian kernel, Matérn kernel 3 with ν = , and the Exponential kernel, respectively. In all settings we take (α, β) = (1, 0.1) 2 and select the penalty, φ, and range parameter, ρ, according to two different approaches. The 21 N=5 N=10 0.05 sample functions original summary private summary −0.05 0.0 0.2 0.4 0.6 0.8 −0.15 −0.15 −0.05 0.05 sample functions original summary private summary 1.0 0.0 0.2 0.8 1.0 0.15 0.05 sample functions original summary private summary −0.05 0.05 sample functions original summary private summary 0.0 0.2 0.4 0.6 0.8 −0.15 −0.05 −0.15 0.6 N=100 0.15 N=25 0.4 1.0 0.0 0.2 0.4 0.6 0.8 1.0 Figure 7: Original and private RKHS smoothing mean with Gaussian Kernel (K1 ) for different sample sizes N first is regular Cross Validation, CV, and the second we call Private Cross Validation, PCV. In CV we fix φ and then take the ρ that gives the minimum 10-fold cross validation score. We do not select φ based on cross validation because, based on our observations, the minimum score is always obtained at the minimum φ for this data. In PCV we take nearly the same approach, however, when computing the CV score we take the expected difference between our privacy enhanced estimate and the data from the left out fold. This expected difference is computed using a Monte-Carlo approximation, with 1000 draws from the distribution of the privacy enhanced estimate. We then find both the φ and ρ which give the optimal PCV score based on a grid search. We begin by presenting the results for CV. For each of the kernels, we fixed a value for φ ∈ {0.0001, 0.001, 0.01, 0.03} and then vary the ρ between [0.01, 2]. Table 1 shows the optimal parameters, based on CV, for each kernel. For each kernel, we used the parameter values in 22 0.1sin(πt) 0.15 0.15 0.1sin(2πt) −0.15 0.00 −0.05 0.05 0.05 0.10 sample functions original summary private summary 0.0 0.2 0.4 0.6 0.8 1.0 sample functions original summary private summary 0.0 0.2 0.6 0.8 1.0 0.8 1.0 (t−0.5)2 0.25 0.1t sample functions original summary private summary sample functions original summary private summary −0.05 0.00 0.05 0.05 0.15 0.10 0.4 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 Figure 8: Original and private RKHS smoothing mean with Gaussian Kernel (K1 ) for different initial mean functions µ Table 1 to produce privacy enhanced estimates. The results are given in Figures 9, 10 and 11, for exponential, Matern, and Gaussian, respectively. In each case, we see that the utility of the privacy enhanced versions increases as φ increases, however, the largest values of φ produce estimates that are over smoothed. There is a good trade-off between privacy and utility with φ = 0.01 and K3 or K1 (see figures 10 and 11), while K4 is a bit rougher and doesn’t perform as well (e.g., Figure 9). Turning to PCV, Table 2 shows the range we varied the (φ, ρ) and also the optimums which give the minimum PCV. We use the optimal parameters to generate privacy enhanced estimates, given in Figure 12. Here we see that the utility of the privacy enhanced estimates is excellent, especially for K1 . Using PCV tends to over smooth the original estimates (green lines), however, by slightly over smoothing we make substantial gains in utility as we add less noise. 23 1 2 3 4 Exp. Kernel optimum ρ 0.25 0.20 0.30 0.80 φ 0.0001 0.001 0.01 0.03 Mat3/2 Kernel optimum ρ 0.25 0.20 0.30 0.80 Gau. Kernel optimum ρ 0.01 0.01 0.03 0.05 φ=0.03 heights of girls mean function private mean heights of girls mean function private mean heights of girls mean function private mean heights of girls mean function private mean 0.7 0.3 0.4 0.5 cca 0.6 0.7 0.6 cca 0.5 0.3 0.4 0.2 0.3 0.4 0.5 cca 0.6 0.8 cca 0.6 0.4 0.8 φ=0.01 0.8 φ=0.001 0.8 φ=10−4 0.7 1.0 Table 1: Optimum kernel range parameters ρ for different kernels with using CV for each fixed penalty parameter φ in DTI dataset 0.0 0.2 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 time 0.8 Figure 9: Mean estimate for CCA and its private release with Exponential kernel (K4 ) using CV. 7 Conclusions In this work we have provided a mechanism for achieving (α, β)-DP for a wide range of summaries related to functional parameter estimates. This work expands dramatically upon the work of Hall et al. (2013), who explored this topic in the context of point-wise releases of functions. Our work covers theirs as a special case, but also includes full function releases and nonlinear releases, that have not been considered before in statistical privacy literature. In general, we assume functional data to be highly identifiable. In biomedical setting, for example, 24 1.0 heights of girls mean function private mean heights of girls mean function private mean heights of girls mean function private mean heights of girls mean function private mean 0.7 0.5 cca 0.6 0.7 0.5 cca 0.6 0.7 0.4 0.4 0.3 0.3 0.2 0.3 0.3 0.4 0.4 0.5 cca 0.6 0.6 cca 0.5 0.8 φ=0.03 0.8 φ=0.01 0.8 φ=0.001 0.7 0.8 φ=10−4 0.0 0.2 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 time 0.8 1.0 φ=0.03 heights of girls mean function private mean heights of girls mean function private mean heights of girls mean function private mean heights of girls mean function private mean 0.2 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 time 0.8 1.0 0.7 0.3 0.4 0.5 cca 0.6 0.7 0.3 0.4 0.5 cca 0.6 0.7 0.6 0.3 0.4 0.5 cca 0.6 cca 0.5 0.4 0.3 0.0 0.8 φ=0.01 0.8 φ=0.001 0.8 φ=10−4 0.7 0.8 Figure 10: Mean estimate for CCA and its private release using Matérn(3/2) kernel (K3 ) with CV. 0.0 0.2 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 time 0.8 Figure 11: Mean estimate for cca and its private release using Gaussian kernel (K1 ) with CV. 25 1.0 Kernel range φ K4 [10−4 , 0.1] K3 [10−4 , 0.1] K1 [10−4 , 0.1] range ρ optimum φ [0.2, 1] 0.01 [0.05, 0.5] 0.01 [0.01, 0.1] 0.005 optimum ρ 0.466 0.450 0.030 Table 2: Optimum penalty and range parameters (φ, ρ) for different kernels with PCV in CCA application. K3 K4 0.0 0.2 0.4 0.6 0.8 1.0 0.4 0.5 cca 0.6 0.7 0.8 heights of girls mean function private mean 0.3 0.4 0.5 cca 0.6 0.7 0.8 heights of girls mean function private mean 0.3 0.3 0.4 0.5 cca 0.6 0.7 0.8 heights of girls mean function private mean K1 0.0 0.2 time 0.4 0.6 time 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 time Figure 12: Mean estimate of CCA and its private release for Exponential (K4 ), Matérn(3/2) (K3 ) and Gaussian kernels (K1 ) using PCV. a study may collect and analyze many pieces of information such as genomic sequence data, biomarker data, biomedical images, which all alone or if linked and/or combined with each other or other demographic information, lead to greater disclosure risk albeit one that still requires thorough understanding itself; for a most recent example of potential identification risks related to functional data, see (Lippert et al., 2017) The heart of our work utilizes densities for functional data in a way that has not yet been explored in the literature. Previously, densities for functional data were thought not to exist (Delaigle and Hall, 2010) and researchers instead relied on various approximations to densities. Here we show that densities do in fact exist and we utilize them in our theoretical results. However, it is still unclear how extensively these densities can be used for FDA problems. At 26 the heart of this issue is the orthogonality of probability measures; in infinite dimensional spaces dealing with the orthogonality of measures becomes a major issue, which has a direct impact on the utility of density based methods for FDA. The literature on privacy for scalar and multivariate data is quite extensive, while there has been very little work done for FDA. Therefore, there are many opportunities for developing additional theory and methods for functional data and estimates. One issue that we believe will be especially important is the role of smoothing and regularization in preserving the utility of privacy enhanced releases. As we have seen, a bit of extra smoothing can go a long way in terms of maintaining privacy. References F. Aldà and B. I. Rubinstein. The bernstein mechanism: Function release under differential privacy. In AAAI, pages 1705–1711, 2017. G. Baxter. A strong limit theorem for gaussian processes. Proceedings of the American Mathematical Society, 7(3):522–527, 1956. A. Berlinet and C. Thomas-Agnan. Reproducing kernel Hilbert spaces in probability and statistics. Springer Science & Business Media, 2011. F. Black and M. Scholes. The pricing of options and corporate liabilities. The journal of political economy, pages 637–654, 1973. E. Bongiorno and A. Goia. Classification methods for hilbert data based on surrogate density. arXiv preprint arXiv:1506.03571, 2015. R. Cameron and W. Martin. Transformations of wiener integrals under a general class of linear transformations. Transactions of the American Mathematical Society, 58(2):184–219, 1945. R. H. Cameron and W. T. Martin. Transformations of weiner integrals under translations. Annals of Mathematics, pages 386–396, 1944. R. H. Cameron and W. T. Martin. The behavior of measure and measurability under change of scale in wiener space. Bulletin of the American Mathematical Society, 53(2):130–137, 1947. K. Chaudhuri, C. Monteleoni, and D. Sarwate. Differentially private empirical risk minimization. In Journal of Machine Learning Research, volume 12, pages 1069–1109, 2011. T. Dalenius. Statistik Tidskrift, 15:429–444, 1977. A. Delaigle and P. Hall. Defining probability density for a distribution of random functions. The Annals of Statistics, 38:1171–1193, 2010. 27 C. Dwork. Differential privacy. In 33rd International Colloquium on Automata, Languages and Programming, part II (ICALP 2006), volume 4052, pages 1–12, Venice, Italy, July 2006. Springer Verlag. ISBN 3-540-35907-9. URL https://www.microsoft.com/en-us/research/ publication/differential-privacy/. C. Dwork and A. Roth. The algorithmic foundations of differential privacy. Found. Trends Theor. Comput. Sci., 9(3&#8211;4):211–407, Aug. 2014. ISSN 1551-305X. doi: 10.1561/ 0400000042. URL http://dx.doi.org/10.1561/0400000042. C. Dwork, K. Kenthapadi, F. McSherry, I. Mironov, and M. Naor. Our data, ourselves: Privacy via distributed noise generation. In Proceedings of the 24th Annual International Conference on The Theory and Applications of Cryptographic Techniques, EUROCRYPT’06, pages 486– 503, Berlin, Heidelberg, 2006a. Springer-Verlag. ISBN 3-540-34546-9, 978-3-540-34546-6. doi: 10.1007/11761679 29. URL http://dx.doi.org/10.1007/11761679_29. C. Dwork, F. McSherry, K. Nissim, and A. Smith. Calibrating Noise to Sensitivity in Private Data Analysis, pages 265–284. Springer Berlin Heidelberg, Berlin, Heidelberg, 2006b. ISBN 978-3-540-32732-5. doi: 10.1007/11681878 14. URL https://doi.org/10.1007/11681878_ 14. C. Dwork, A. Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends® in Theoretical Computer Science, 9(3–4):211–407, 2014. Y. Erlich and A. Narayanan. Routes for breaching and protecting genetic privacy. Nature Reviews Genetics, 15(6):409–421, 2014. J. Feldman. Equivalence and perpendicularity of gaussian processes. Pacific J. Math, 8(4): 699–708, 1958. F. Ferraty and Y. Romain. The Oxford Handbook of Functional Data Analaysis. Oxford University Press, 2011. S. Fienberg and A. Slavković. Data Privacy and Confidentiality, pages 342–345. International Encyclopedia of Statistical Science. Springer-Verlag, 2010. I. V. Girsanov. On transforming a certain class of stochastic processes by absolutely continuous substitution of measures. Theory of Probability & Its Applications, 5(3):285–301, 1960. U. Grenander. Stochastic processes and statistical inference. Arkiv för matematik, 1(3):195–277, 1950. R. Hall, A. Rinaldo, and L. Wasserman. Differential privacy for functions and functional data. The Journal of Machine Learning Research, 14(1):703–727, 2013. L. Horváth and P. Kokoszka. Inference for functional data with applications, volume 200. Springer Science & Business Media, 2012. L. Huang, F. Scheipl, J. Goldsmith, J. Gellar, J. Harezlak, M. W. McLean, B. Swihart, L. Xiao, C. Crainiceanu, and P. Reiss. refund: Regression with Functional Data, 2016. URL https: //CRAN.R-project.org/package=refund. R package version 0.1-14. A. Hundepool, J. Domingo-Ferrer, L. Franconi, S. Giessing, E. S. Nordholt, K. Spicer, and P.-P. de Wolf. Statistical Disclosure Control. Wiley, 2012. 28 I. A. Ibragimov and Y. A. Rozanov. Gaussian random processes, volume 9. Springer Science & Business Media, 1978. S. Kakutani. On equivalence of infinite product measures. Annals of Mathematics, pages 214– 224, 1948. D. Kifer, A. Smith, and A. Thakurta. Private convex empirical risk minimization and highdimensional regression. In S. Mannor, N. Srebro, and R. C. Williamson, editors, Proceedings of the 25th Annual Conference on Learning Theory, volume 23 of Proceedings of Machine Learning Research, pages 25.1–25.40, Edinburgh, Scotland, 25–27 Jun 2012. PMLR. URL http://proceedings.mlr.press/v23/kifer12.html. P. Kokoszka and M. Reimherr. Introduction to functional data analysis. CRC Press, 2017. J. Kulynych. Legal and ethical issues in neuroimaging research: human subjects protection, medical privacy, and the public communication of research results. Brain and cognition, 50 (3):345–357, 2002. R. Laha and V. Rohatgi. Probability Theory. Wiley, New York, 1979. J. Lane, V. Stodden, S. Bender, and H. Nissenbaum. Privacy, big data, and the public good: Frameworks for engagement. Cambridge University Press, 2014. C. Lippert, R. Sabatini, M. C. Maher, E. Y. Kang, S. Lee, O. Arikan, A. Harley, A. Bernal, P. Garst, V. Lavrenko, K. Yocum, T. Wong, M. Zhu, W.-Y. Yang, C. Chang, T. Lu, C. W. H. Lee, B. Hicks, S. Ramakrishnan, H. Tang, C. Xie, J. Piper, S. Brewerton, Y. Turpaz, A. Telenti, R. K. Roby, F. J. Och, and J. C. Venter. Identification of individuals by trait prediction using whole-genome sequencing data. Proceedings of the National Academy of Sciences, 114(38):10166–10171, 2017. doi: 10.1073/pnas.1711125114. URL http://www.pnas.org/content/114/38/10166.abstract. O. Nikodym. Sur une généralisation des intégrales de mj radon. Fundamenta Mathematicae, 15 (1):131–179, 1930. J. Radon. Theorie und anwendungen der absolut-additiven mengenfunktionen. Sitzungsberichte der mathematisch-naturwissenschaftlichen Klasse der Kaiserlichen Akademie der Wissenschaften, 122:1295–1438, 1913. J. O. Ramsay and B. W. Silverman. Applied functional data analysis: methods and case studies, volume 77. Springer New York, 2002. J. O. Ramsay and B. W. Silverman. Functional data analysis. Springer New York, 2005. C. R. Rao and V. Varadarajan. Discrimination of gaussian processes. Sankhyā: The Indian Journal of Statistics, Series A, pages 303–330, 1963. Y. A. Rozanov. On the density of one gaussian measure with respect to another. Theory of Probability & Its Applications, 7(1):82–87, 1962. Y. A. Rozanov. On probability measures in functional spaces corresponding to stationary gaussian processes. Theory of Probability & Its Applications, 9(3):404–420, 1964. D. B. Rubin. Statistical disclosure limitation. Journal of official Statistics, 9(2):461–468, 1993. 29 E. E. Schadt, S. Woo, and K. Hao. Bayesian method to predict individual snp genotypes from gene expression data. Nature genetics, 44(5):603–608, 2012. L. Shepp. The singularity of gaussian measures in function space. Proceedings of the National Academy of Sciences, 52(2):430–433, 1964. L. Shepp. Radon-nikodym derivatives of gaussian measures. The Annals of Mathematical Statistics, pages 321–354, 1966. A. Skorohod. On the densities of probability measures in functional spaces. Proc. Fifth Berkeley Sympos. Math. Statist. and Probability (Berkeley, Calif., 1965/66) Vol. II: Contributions to Probability Theory, 1:163–182, 1967. M. L. Stein. Interpolation of spatial data: some theory for kriging. Springer Science & Business Media, 2012. D. Varberg. On equivalence of gaussian measures. Pacific Journal of Mathematics, 11(2): 751–762, 1961. D. E. Varberg. On gaussian measures equivalent to wiener measure. Transactions of the American Mathematical Society, 113(2):262–273, 1964. D. E. Varberg. On gaussian measures equivalent to wiener measure ii. Mathematica Scandinavica, 18(2):143–160, 1967. L. Wasserman and S. Zhou. A statistical framework for differential privacy. Journal of the American Statistical Association, 105(489):375–389, 2010. doi: 10.1198/jasa.2009.tm08651. URL http://dx.doi.org/10.1198/jasa.2009.tm08651. L. Willenborg and T. De Waal. Statistical disclosure control in practice. Number 111. Springer Science & Business Media, 1996. A Proofs Lemma 1. If the privacy mechanism, f˜D , achieves (α, β)-DP, then so does any measurable transformation of it. Proof. Let T : Ω → Ω0 be a measurable transformation between two metric spaces (say with respect to the Borel σ-algebra). Then we have P (T (f˜D ) ∈ A) = P (f˜D ∈ T −1 (A)) ≤ eα P (f˜D0 ∈ T −1 (A)) + β = eα P (T (f˜D0 ) ∈ A) + β, thus proving the claim.  30 Proof of Theorem 1. The result will follow if we can show that  (6) hfD − fD0 , h1 iH >  hfD − fD0 , h1 iH           hfD − fD0 , h2 iH   hfD − fD0 , h2 iH      sup kfD − fD0 k2K ≥ sup sup   K−1   . .    .. .. D∼D0 D∼D0 h1 ,...,hN          hfD − fD0 , hN iH hfD − fD0 , hN iH where K = {Kij } is the covariance matrix of {hZ, h1 iH , . . . , hZ, hN iH }. The elements of this matrix can be expressed using the covariance operator C, namely, Kij = E[hZ, hi iH hZ, hj iH ] = hC(hi ), hj iH . To get a better handle on (6) we define two operators. The first operator, P1 : H → span{h1 , . . . , hN }, we define as P1 (x) = N X i=1 hi N X (K −1 )ij hhj , xiH j=1 and the second, P : H → span{C(h1 ), . . . , C(hN )}, as P (x) = C(P1 (x)) = N X N X C(hi ) (K −1 )ij hhj , xiH . i=1 j=1 Notice that while P1 maps elements of H back to H, P maps elements of H into K. One then has by direct verification that  hfD − fD0 , h1 iH >  hfD − fD0 , h1 iH           hfD − fD0 , h2 iH   hfD − fD0 , h2 iH       = hfD − fD0 , P1 (fD − fD0 )iH .   K−1  . .     .. ..         hfD − fD0 , hN iH hfD − fD0 , hN iH 31 We can then swap from the inner product over H to one over K: hfD − fD0 , P1 (fD − fD0 )iH = hfD − fD0 , C(P1 (fD − fD0 ))iK = hfD − fD0 , P (fD − fD0 )iK . If we show that P is a projection operator, i.e., symmetric and idempotent, we will have the desired bound: hfD − fD0 , P (fD − fD0 )iK ≤ kfD − fD0 k2K . First, P is idempotent because 2 P = = = N X C(hi ) N X i=1 j=1 N X N X C(hi ) i=1 j=1 N X N X i=1 C(hi ) * (K −1 )ij hj , N X N X C(hk ) (K −1 )kl hhl , .iH k=1 (K −1 )ij l=1 H N X N X k=1 l=1 hC(hk ), hj iH (K −1 )il hhl , .iH = P. l=1 32 + (K −1 )kl hhl , .iH Second, P is symmetric with respect with the K inner product since hP (x), yiK = *N X N X C(hi ) (K −1 )ij hhj , xiH , y i=1 = N X j=1 hC(hi ), yiK i=1 = *N X K N X = + N X −1 hC(hi ), yiK (K )ij hj , x j=1 hhi , yiH i=1 = *N X hj j=1 N X N X C(hj ) j=1 H + (K −1 )ji hhi , yiH , x H hj j=1 = H + (K −1 )ij hj , x i=1 C *N X N X j=1 *  = (K −1 )ij hhj , xiH j=1 i=1 *N X + N X  + (K −1 )ji hhi , yiH  , x i=1 N X i=1 K + (K −1 )ji hhi , yiH , x K = hP (y), xiK Hence P is a projection operator from H to K, and the claim of the theorem holds.     1 2 − 2hf , hi D (h) = exp − kf k is the Proof of Theorem 2. We aim to prove that dP D D K dQ 2δ 2  K   1 density of f˜D wrt Q. Define g(x) = exp − 2 kfD k2K − 2hfD , xiK and the measure PD? (A) = 2δ R ? A g(x)dQ(x). Then our goal can equivalently be stated as aiming to show that PD and PD are the same probability measure. We will accomplish this by showing that both have the same moment generating functional. Since Z is a Gaussian noise with mean zero and covariance operator C, f˜D is a Gaussian process with mean fD and covariance operator δ 2 C. The moment generating functional of f˜D is then given by   δ2 MD (h) = EPD [exp{hX, hiH }] = exp hfD , hiH + hC(h), hiH . 2 33 On the other hand, the moment generating functional of P ? is M?D (h) = EPD? [exp{hX, hiH }] = EPQ [g(X) exp{hX, hiH }]    1 2 = EPQ exp hX, hiH − 2 (−2hX, fD iK + kfD kK ) 2δ      −1 = exp kfD k2K EPQ exp hX, h + δ −2 C −1 (fD )iH 2 2δ    2  −1 δ 2 −2 −1 −2 −1 = exp kfD kK exp C(h + δ C (fD )), h + δ C (fD ) H 2δ 2 2   2    δ −1 2 −2 −4 2 kfD kK exp hC(h), hiH + 2δ hfD , hiH + δ kfD kK = exp 2δ 2 2   δ2 = exp hfD , hiH + hC(h), hiH . 2 So both have the same moment generating functional and are thus the same measure, which proves the claim.  Proof of Theorem 3. We aim to show that for any measurable subset A ⊂ H we have PD (A) ≤ eα PD0 (A) + β. Recall the global sensitivity for the functional case is ∆2 = sup kfD − fD0 k2K . D∼D0 The density of f˜D wrt δZ is   1 exp − 2 (kfD k2K − 2hfD , xiK ) . 2δ We equivalently aim to show that Z PD (A) = Z dPD (x) = A A dPD (x)dPD0 (x) ≤ eα dPD0 34 Z dPD0 (x) + β. A We can express dPD dPD dPD0 (x) = (x)/ (x) dPD0 dQ dQ   1 2 2 0 0 = exp − 2 (kfD kK − kfD kK − 2hfD − fD , xiK ) . 2δ Expand kfD0 k2K = kfD0 − fD + fD k2K = kfD0 − fD k2K + kfD k2K − 2hfD − fD0 , fD iK . So we have   1 dPD 2 (x) = exp − 2 (−kfD − fD0 kK − 2hfD − fD0 , x − fD iK ) dPD0 2δ . Decompose H = K1 dPD dPD0 (x) S dPD dPD0 (x) K2 where for x ∈ K1 we have ≤ eα and for x ∈ K2 we have > eα . Then trivially we have that PD (A) = PD (A ∩ K1 ) + PD (A ∩ K2 ). Using the definition of K1 we have that Z PD (A ∩ K1 ) = A∩K1 dPD dPD0 (x) (x) dQ(x) ≤ eα dPD0 dQ Z A∩K1 dPD0 (x) dQ(x) ≤ eα PD0 (A). dQ The proof will be complete if we can show that PD (A ∩ K2 ) ≤ β. This is equivalent to showing that  P 1 − 2 (−kfD − fD0 k2K − 2hfD − fD0 , X − fD iK ) ≥ α 2δ 35  ≤ β, where X ∼ N (0, δ 2 C). This can equivalently be stated as 1 (−kfD − fD0 k2K − 2hfD − fD0 , X − fD iK ) ≥ α 2δ 2   1 2 2 ⇔hfD − fD0 , XiK ≥ δ α − 2 kfD0 − fD kK 2δ   1 −1 2 2 0 0 ⇔hC (fD − fD ), XiH ≥ δ α − 2 kfD − fD kK . 2δ − However hX, C −1 (fD − fD0 )iH is a normal random variable with mean zero and covariance δ 2 hC(C −1 (fD0 − fD )), C −1 (fD0 − fD )iH = δ 2 kfD0 − fD kK ≤ δ 2 ∆2 . So, if Z ∼ N (0, 1) then we have that   1 2 P − 2 (−kfD − fD0 kK − 2hfD − fD0 , X − fD iK ) ≥ α 2δ    1 2 2 ≤ P δ∆Z ≥ δ α − 2 kfD − fD0 kK 2δ    2 δ ∆ ≤P Z≥ α− 2 ∆ 2δ ! p α = P Z ≥ 2 log(2/β) − p 2 2 log(2/β) ! p 1 ≤β ≤ P Z ≥ 2 log(2/β) − p 2 2 log(2/β) as long as α ≤ 1 (Hall et al., 2013).  36 Proof of Theorem 4. The upper bound for ∆2n is derived as following: ∆2n = sup kµ̂D − µ̂D0 k2K D∼D0 = sup k D∼D0 = sup m λj 1 X (x1j − x10 j )vj (t)k2K N (λj + φ) j=1 m X λ j h N1 (λj +φ) (x1j − x01j )vj (t), vj (t)i2H λj D∼D0 j=1 m = X λj 1 kX1 − X10 k2H sup 2 N D∼D0 (λj + φ)2 j=1 ≤ ≤ = 1 sup N 2 D∼D0 1 sup N 2 D∼D0 ∞ 4τ 2 X N2 j=1 m X j=1 m X j=1 λj (kX1 kH + kX10 kH )2 (λj + φ)2 λj (2τ )2 (λj + φ)2 λj . (λj + φ)2  B Derivation of RKHS Estimate Recall that g(M ) = N 1 X kXn − M k2H + φkM k2K . N n=1 We can express g as N 1 X g(M ) = hC(Xn − M ), Xn − M iK + φhM, M iK . N n=1 We then have that N 1 X g(M ) = hC(Xn ), Xn iK − 2hC(X̄), M iK + hC(M ), M iK + φhM, M iK . N n=1 We now introduce a lemma concerning derivatives. 37 Lemma 2. Let h and M be elements of a real separable Hilbert space H. Then we have that 1. ∂ ∂M hh, M iH 2. ∂ ∂M hA(M ), M iH = h. = 2A(M ), where A is a symmetric bounded linear operator. We then have that ∂g(M ) = −2C(X̄) + 2C(M ) + 2φM. ∂M Setting the above equal to zero we have that (7) C(X̄) = C(µ̂) + φM. or µ̂ = (C + φI)−1 C(X̄). In addition, µ̂ can be written as µ̂(t) = P∞ j=1 hµ̂, vj iH vj (t). So the properties (7) and hC(h1 ), h2 iK = hh1 , h2 iH imply that hC(X̄), vj iK = hC(µ̂), vj iK + φhµ̂, vj iK hX̄, vj iH = hµ̂, vj iH + φhµ̂, vj iH λj And eventually hµ̂, vj iH = λj hX̄(t), vj (t)iH λj + φ Now if (λj , vj ) are the eigenvalues/eigenfunctions of C and Xi (t) = 38 P∞ j=1 xij vj (t) then we have µ̂(t) = = ∞ X j=1 ∞ X j=1 hµ̂(t), vj (t)iH vj (t) λj hX̄(t), vj (t)iH vj (t) λj + φ N ∞ 1 X X λj = xij vj (t) N λj + φ i=1 j=1 39
10math.ST
Dream Formulations and Deep Neural Networks: Humanistic Themes in the Iconology of the Machine-Learned Image Emily L. Spratt 1,2* 1Department of Art and Archaeology, Princeton University, Princeton, NJ Department, The Frick Collection, New York, NY *Correspondence should be addressed to [email protected] 2Research Abstract: This paper addresses the interpretability of deep learning-enabled image recognition processes in computer vision science in relation to theories in art history and cognitive psychology on the vision-related perceptual capabilities of humans. Examination of what is determinable about the machine-learned image in comparison to humanistic theories of visual perception, particularly in regard to art historian Erwin Panofsky’s methodology for image analysis and psychologist Eleanor Rosch’s theory of graded categorization according to prototypes, finds that there are surprising similarities between the two that suggest that researchers in the arts and the sciences would have much to benefit from closer collaborations. Utilizing the examples of Google’s DeepDream and the Machine Learning and Perception Lab at Georgia Tech’s Grad-CAM: Gradient-weighted Class Activation Mapping programs, this study suggests that a revival of art historical research in iconography and formalism in the age of AI is essential for shaping the future navigation and interpretation of all machine-learned images, given the rapid developments in image recognition technologies. N.B. This paper is published in the art historical journal Kunsttexte.de. In 2015, Google released a computer vision program that aids our understanding of the mechanisms at work in machine-based image classification. 1 Entitled DeepDream for its association with a type of artificial intelligence called deep learning, and also a reference to the unconscious processes that allow the brain to create dreams, the program produces a visualization of the image-recognition process (fig. 1). Given the remarkably vivid visual effects that the program generates, DeepDream has quickly been adopted for use as an artistic tool to augment existing images, a phenomenon that has furthered the algorithm’s popularization, yet !1 also has contributed to the media’s misinterpretation of its original function.2 In this paper, the use of this program, among others, as a tool to better understand image recognition––as it was initially intended––will be examined in relation to theories on the vision-related perceptual capabilities of humans and machines. Computer scientists often employ anthropomorphizing metaphors such as “deep dream” in their research, misleadingly projecting the possibilities and limitations of the human condition onto the mechanisms that empower the computational abilities of machines. 3 Although nothing on the programming level of the DeepDream algorithm actually replicates neurobiological processes, this term and others like it are indicative of the development of artificial intelligence to emulate aspects of human perception.4 Vision technology, in particular, can be directed in ways that interpret the world analogously to humans. 5 It is a burgeoning area of research that is not only transforming computer science and robotics, but is offering interesting possibilities for the augmentation of human visual perception, our understanding of the underlying mechanisms at work in machine-guided image recognition, the creation of new tools for artists, and the ability to produce imagery. 6 Given these astonishing developments in computer vision science that challenge our traditional understanding of both human- and machine-based visual perception and their creative potential to produce visual content, this area is ripe for philosophical investigation. Google’s DeepDream project exemplifies the remarkable growth of computer vision science in the last few years, and advances in image-recognition technology at large have already led to results that are comparable to the performative aspects of the interpretation of visual information through human sight itself.7 Indeed, the more computer vision technology is able to mimic human visual processes, the better its real-world applications can be guided, and this is !2 particularly the case with image recognition and retrieval tools. While research in this area is often sequestered to the fields of computer science and business development in the technology sector, I aim to demonstrate how the analysis of images with deep-learning techniques can engage the humanities, complement existing sociocultural theories, and offer the possibility of new methodologies for image analysis that take cognitive psychology into consideration.8 Let us therefore begin our analysis of the development of DeepDream as a part of the larger turn toward deep-learning techniques in computer vision science in order to examine some ways in which images are processed by machines in comparison to humans. In essence, let us consider the iconology of the digital image vis-à-vis deep neural networks, what I have termed the machinelearned image. 9 As a part of the 2014 ImageNet Large-Scale Visual Recognition Challenge, a deep convolutional neural network architecture was created by a team of computer scientists from Google, the University of North Carolina at Chapel Hill, the University of Michigan at Ann Arbor, and Magic Leap Incorporated.10 The goal of this competition was to improve the classification of images and the detection of their contents. The success of this research group’s network was based on its computational efficiency and enhanced ability to analyze images through multiple wide layers of coding. Applied to the interpretation of two-dimensional digital images, this branch of machine learning, based on neural networks, more commonly known as deep learning, can be imagined as a complex data filtration system that processes information layer by linear- and non-linear-algorithmic layer. Like a water filtration system that distills liquid by outputting only what has already been filtered to each subsequent level, a convolutional neural network has the capacity to filter information according to multiple parameters, the size of !3 its constituent parts being just one component of the system. In both examples, there are many steps in between the input and output, which allows for increased complexity in the final analysis. While the traditional programming model is based on breaking down large problems into smaller solvable tasks, deep learning allows the computer to find its own solutions to presented problems through multiple interlaced layers. Although the programmer sets the initial parameters and provides the visual training set that a computer will utilize to detect certain images and their constituent parts, how this is actually achieved remains rather mysterious to the computer scientist.11 Consider the development of facial recognition programs, such as the one created by Facebook: a system can learn to detect a face and compare it to other faces through layers of convolutional neural networks if a large and coded dataset from which the computer is trained is available. Untangling what the computer finds to be most predictive in facial recognition out of the many strengthened neural pathways that are found in the image-recognition process, however, is not always possible.12 This unknown dimension, when the computer essentially becomes autodidactic, is called the “black box” of computer learning. Determining what the computer has created to optimize efficiency in its recognition of labeled and unlabeled images is a current trend in computer vision science, and reverse engineering what the computer has come up with is no easy task. DeepDream is one attempt to uncover what occurs in the black box through visualization. Led by Google engineer Alexander Mordvintsev, the DeepDream team harnessed aspects of the deep neural network architecture developed by the 2014 Image Challenge research group and visualized what was going on in the network as it processed information.13 Recognizing that !4 neural networks trained to discriminate between different types of images also have the information needed to generate them, the Google team aimed to use visualization as one way to determine whether the network had correctly learned the right features of an image by displaying their associations in the classification process. For example, a neural network designed to recognize dumbbells seemed to be doing so correctly, but was in fact inaccurately making the classification. Since the computer was trained with numerous images of weightlifters holding dumbbells (fig. 2), the neural net determined that the weightlifter’s arm was an essential part of the classification of the object since the majority of online images of dumbbells include an arm curling them.14 For this reason, the DeepDream algorithm generated a visualization of dumbbells with an attached arm (fig. 3)! DeepDream thus gives us visual information that can not only correct these types of training errors, but can also tell us more about the classification process. Another research project, developed as an open-source cloud platform at the Machine Learning and Perception Lab at Georgia Tech and entitled “Grad-CAM: Gradient-weighted Class Activation Mapping,” allows us to see what convolutional neural networks determine to be the most predictive locations in an image to identify its content, and creates text labels of its findings that classify the image’s content, or captions that describe the image in further detail. 15 Like DeepDream and other programs, Grad-CAM allows us to peak into the black box of machine learning with visualization techniques that reveal components of the image-recognition process, yet adds semantic descriptions to its finding. Both projects are significant across academic fields and have particular value for the museum and cultural heritage management world, as this research provides much insight on ways to improve machine-based image classification. The Frick Collection is one museum where this type of technology is sought, and plans there are !5 under way to begin collaborations with computer scientists for its development for application to art historical materials.16 While Grad-CAM’s program demo highlights its use with images of contemporary life that are mostly open-source and randomly generated, media-focused photography, I applied the program for use in art history and ran a selection of images from the collection of the Metropolitan Museum of Art through it.17 In complex images such as El Greco’s Christ Healing the Blind, the program labeled the image as a carousel and identified places on the picture field outside of the central scene of Christ’s performance of the miracle as the locations that were significant for identification (fig. 4). By contrast, an image of a thirteenth-century icon depicting the Madonna and Child is labeled by Grad-CAM as a “book jacket” and highlights the Virgin’s face and the surrounding area, but does not emphasize Christ. 18 Late Antique parchment leaves from Egypt displaying Greek text were identified as “honeycomb,” and the program selected seemingly random locations including the background mat on which the artifact rests as significant for its content.19 Not surprisingly, a photograph of Georgia O’Keeffe clutching her coat collar, by Alfred Stieglitz, performed somewhat better with the program (fig. 5). It recognized the hands on the garment as the significant part of the image when generating a caption, but the text describes the image as “a man is holding a cell phone in his hand.”20 Like DeepDream, Grad-CAM’s results are highly biased according to its data training set, and the results of its analysis for types of images that it is not familiar with reflect this. The input of images reflecting different types of media erroneously produce the suggestion that a different object type is being analyzed, rather than picking up on the displayed formal content, as if all images are photographs of things found in the contemporary word. The flatness of the icon !6 suggests the advertisement-like nature of a book cover, the El Greco painting’s multiple eclipsing scenes is classified as a carousel, parchment betraying its deterioration over time is seen as honeycomb, and a photo from 1918 is given a caption that assumes the invention of communications technology used today. In future research it would be interesting to train the program using art historical images with additional parameters and to compare the results. Both the DeepDream and the Grad-CAM program demonstrate how machine-based image classification can be compared to the human perception of an object through one’s association of it with known examples of its type. Generally stated, the machine, not unlike a human, learns to recognize a given image because it has seen it or something close to it before. If based on a training set that has multiple contemporary images of people with their mobile phones, the program assumes that grasping hands would hold a phone, just as a child who did not know a world before such devices might assume they are in photographs of historical persons. For both the machine and the human, we don’t know the precise mechanisms at work when an image is being translated into its higher-level meanings and associations, but we are certain that what has been seen and interpreted before plays a role in our visual understanding of newly presented things.21 A major problem in image recognition for both machines and humans is the ability to accurately generalize and specify categories of objects.22 Let’s first consider this problem for machines. Since the internet is full of images of animals, they are overly represented in machinelearning training sets and are the usual examples that computer scientists employ to discuss classification issues. In the case of dogs, vision technology easily interprets a picture of a Golden Retriever as a dog but may incorrectly classify a Bedlington Terrier as a lamb or a Bichon Frise !7 as a polar bear cub, since those breeds do not at first glance appear to be canine (fig. 6). It is important to note, however, that the probability of vision technology programs correctly interpreting dog breeds is higher than it would be for a category of objects such as medieval encolpia, since most available datasets are overrepresented in categories like dogs rather than in religious artifacts. In either case, how a machine can make these designations is even more difficult than it is for humans. At a basic level the computer differentiates one image from the next according to the images it has been trained to recognize. One way it does this is by isolating the optimal and measurable geometric features of each object in the picture and then comparing them to the object measurements found in the labeled dataset. From this training, the machine develops a distribution of probabilities for each pixel of an image to indicate the most likely locations in the picture plane where the object will appear. As already exemplified with Grad-CAM, with knowledge of the likely locations of pixels in the representation of a given object, it is possible to make maps based on the training data to see the relative probabilities of pixels falling into the locations we associate with a certain object and then assigning a percentage-based evaluation of the likelihood a given object is a certain type of dog. In essence, this is the naïve Bayes method of classification and is but one type of image-recognition solution. How we can interpret objects presented in an image at any angle with any background is quite complex, but is an essential classification problem that affects all forms of image-recognition techniques. If we can algorithmically distinguish dog breeds using methods beyond Bayes’s model in neural networks, we have the ability to train a neural network to recognize any class of objects. The more these pathways are enforced by using the network, the more accurate these predictions !8 become. Machine-learning techniques are therefore incredibly useful for image recognition, but require large amounts of data to train upon in order to function with precision, and these analyses are limited in their formalistic interpretation of the data, whether it is labeled or not. It cannot be stressed enough how critical the dataset that the program is trained on is for the process of image recognition, and a large and vetted dataset that is specified for the image-recognition task at hand is usually not easily available. These computer-recognition issues have some similarities to theories regarding the underlying mechanisms of human visual perception. While there is a long history of theories on human visual perception, development of the ability to categorize objects is one area of research that was of particular interest to psychologists in the last century.23 In the 1970s, cognitive scientist Eleanor Rosch and others devised a theory of graded categorization according to prototypes in place of the Aristotelian, definition-based model of object categorization and in revision of Jean Piaget’s pioneering work on cognitive development in children.24 According to this theory, some components of a category are more significant than others. Thus, recognizing the similarity of an object to one’s notion of its prototype is what cognitively leads to its identification. In this respect, a Golden Retriever really is a better example of a dog than a Bedlington Terrier or a Bichon Frise, or, to use the classic examples from Rosch’s study, a robin is a more exemplary bird than a penguin, and a chair is more closely associated with the category furniture than is an ottoman.25 Our willingness to accept these assessments relies on the inherent biases we have in interpreting the relationships that types of things have with their prototypes.26 According to prototype theory, these relationships are even measurable according to the response time required !9 to recognize the image at hand.27 Not surprisingly, non-prototypical things require more time to register than objects that seem to organically represent their type. The theory is also tied to developmental psychology, as children explore the boundaries of prototypes by over-identifying them, such as their description of all four-legged creatures as dogs.28 Nonetheless, the extensive labeling of things in relation to their perceived prototype is likely an important part of the cognitive formation of different types within the category as well. More than sixty years after the first developments in machine learning, computer scientists still consider image-based AI to be loosely analogous to a child’s developmental state. In the case of general versus specific image classification issues, this really does seem to be the case, even if so only superficially. Since DeepDream was trained using an online image set that consists of an overly represented number of animals, the network biased the classification of all the objects it analyzed as animals, especially as dogs, and thus visually manifested them (fig. 7). The Google team also observed other tendencies in the classification process, such as the appearance of towers and pagodas on horizon lines.29 This phenomenon may be interpreted like the example of the dumbbell with the attached arm. Since the images that trained the network included landscapes, which more often than not featured a building on the horizon line, the computer created its classification of a horizon line to include an architectural structure punctuating it (fig. 1). This information tells us that much work remains to be done in general versus specific machine-based image classification vis-à-vis the DeepDream program. It also demonstrates the power of visualizing the image-recognition process to understand it better, and the inherent visual relationships between the images from the training dataset with the analyzed image. !10 Computer vision science reminds us that our own visual abilities in identifying images are also the result of training and are rarely unbiased. How we perceive an object, classify it, and interpret it (in relation to other objects and other images) is a complex question that may not be trendy to ask in art history today, but has everything to do with the origins of the discipline, and has particular relevance to the way art historians in pre-Modern fields often approach the objects they study. It was this very question that drove Erwin Panofsky to make a science of identification for art history that is still used today.30 In order to achieve a higher-level understanding of Renaissance art, Panofsky posited three formal and empirically based stages of analysis that themselves progress from part to whole and then back again. This methodology was greatly elaborated in Studies in Iconology: Humanistic Themes in the Art of the Renaissance, which was first published almost eight decades ago.31 What the DeepDream algorithm and programs like Grad-CAM reveal about the nature of image classification using neural networks applies to Panofsky’s iconographic schema and fits within the stage of analysis he termed “primary” or “pre-iconographic.” Nodding to Heinrich Wölfflin, Panofsky called this stage “pseudo-formal analysis” and elaborated on the mechanisms at work in a visual description. He theorized that familiarity with previously experienced objects and events was the mental equipment necessary for interpretation at this level and that insight into the history of style could be used to control this sort of analysis. Seemingly ahead of his time as far as cognitive psychology is concerned, Panofsky was actually importing the bridge already built by Ernst Cassirer between the study of human perception and issues in classification to the field of art history.32 In his research, Panofsky was particularly sensitive to the role that pre-existing biases play in the interpretation of art and how !11 they could be balanced with what he differentiated as the history of style, the history of types, and the history of cultural symbols. In “A Neural Algorithm of Artistic Style,” Leon A. Gatys and others reach an astonishingly similar conclusion in their research on deep neural networks and the ability of algorithms to replicate established artistic styles. They state: “All in all it is truly fascinating that a neural system, which is trained to perform one of the core computational tasks of biological vision, automatically learns image representations that allow the separation of image content from style. The explanation could be that when learning object recognition, the network has to become invariant to all image variations that preserve object identity. . . Thus, our ability to abstract content from style and therefore our ability to create and enjoy art might be primarily a preeminent signature of the powerful inference capabilities of our visual system.” 33 Unfortunately, advances in computer vision science which demonstrate the exploration of deep-learning techniques for image-recognition tasks are typically first encountered by art historians in the mainstream media, which too often inadequately convey the use/value of the development of these new digital tools. In the case of DeepDream, the popular press immediately seized upon the mesmerizing visualizations produced by the algorithm and incorrectly explained them as computer hallucinations or unconscious visual manifestations that could be seized upon by artists. This in turn led to Google’s release of the algorithm so anyone could process their images and receive the visual results, which were later even made customizable. 34 That the visualization would be turned into an augmented paintbrush was an unintended, yet interesting, consequence of the research that shifted the focus of DeepDream away from its purpose of exposing the processes of the neural network during image classification. !12 By spring of 2016, an art cooperative in San Francisco called the Gray Area Foundation was able to hold a moderately successful benefit featuring a group of artists who were using DeepDream for image enhancements. At this point, the algorithm was so misinterpreted that a science editor from the Washington Post, commenting on the DeepDream excitement, was able to comfortably make the suggestion that the auction sales represented the art market’s endorsement of the use of computer science and AI in contemporary art rather than an example of Silicon Valley philanthropy.35 Unfortunately, the kitsch-like quality and mainstream hype about the visualizations have not helped the algorithm to be considered more seriously for its original purpose, nor has it improved the stigma of “computer art” in the art market.36 Fortunately, the initial research intentions of the DeepDream project have continued to be addressed at Google through the research of Chris Olah, Alexander Mordvintsev, and Ludwig Schubert in response to the scientific community’s recognition that neural networks require interpretability to best harness and direct their use/values. 37 While interest in understanding what occurs in the black box has been prevalent, the ability to now directly address this issue in computer vision science truly marks another milestone for artificial intelligence, and has recently led to the development of what some researchers are calling the emergent field of neural network interpretability. Indeed, the developments in computer vision science are occurring so quickly that it is difficult for collaborators from the humanities to plunge into research projects with computer scientists and to stay apace given the different timelines required by each domain in all aspects of the research process.38 This is not surprising given the faster rates in which technological developments occur in science in comparison to the time required for analytical responsiveness to sociocultural phenomena in the arts, and how the corresponding infrastructures !13 that are geared to support knowledge production in each domain end up emphasizing these differences. Unlike the Grad-CAM program, which addresses issues in what computer scientists term the attribution of an image and define as the correspondence between parts of the picture plane to its network activation, the Google project focuses on feature visualization, which they define as the machine’s ability to answer “questions about what a network—or parts of a network—are looking for by generating examples.” In essence, feature visualization is the term we can use to describe both the process and the visual product of DeepDream’s analysis of an image. As discussed above, DeepDream visualizes the network’s interpretive associations of the various components of an image in its overall recognition process. It visualizes an entire layer of the network, yet other components of the network—a single neuron or a network channel, among other options—can also be visualized, giving more precise visual information about the recognition process. All of this can be called feature visualization. On the level of a neuron, this is somewhat comparable to observing how we come to recognize the visual development of one biological cell in a person, instead of the process of beholding that person in the entirety of his or her biological makeup. Although the ramifications for our knowledge of the deep-learning process by using feature visualization is tremendous, its immediate application to art is not. Neither the vivid images produced by DeepDream nor the ability to replicate preexisting styles in painting onto new images have direct interest to art historians in a conventional sense, yet the ability to now do these things, and the implications of these sophisticated capabilities, will no doubt underscore this phase in the relationship of art and artificial intelligence as an historic turning point. It’s !14 unfortunate that the immediate applications of the very research that is actively building the development of advanced image analysis are showcased as a kind of visual entertainment, thus eclipsing the academic community most attuned to image analysis: art historians. Research projects that involve the collaboration of art historians, which include their assistance in the construction of the datasets used for training machines in image recognition and their involvement in how we interpret the image content produced in feature visualization, will help change this. While this may seem simple, what goes into the construction of a useful art historical dataset is not recognized as the major cultural heritage management and diplomatic feat that it should be, and getting art historians interested to study feature visualization is no easy task. Perhaps this collaborative direction would lead to a machine’s analysis of Stieglitz’s photograph as “art” portraying Georgia O’Keeffe, and recognize the compositional strategy of the image as being indicative of the photographer’s work, and date the photo (fig. 8).39 Conceivably, it could even interpret the gesture of the artist holding her collar as giving symbolic meaning to the image in a manner that is sensitive to the cultural period in which it was produced, and bring attention to the other photographs that tie Stieglitz with O’Keeffe. Mostly based just on vision technology, the machine could interpret the clasping hands not as grasps at a mobile phone, but as the unique hands of an artist, informing the interpretation of her portrait. All of these observations could potentially be made without the machine’s understanding of anything other than visual records, and already this would be a significant building block in our art historical understanding of the photograph. In actuality, Alfred Stieglitz took more than three hundred photographs of Georgia O’Keeffe between 1917 and 1937, and famously they shared a !15 romantic relationship.40 It was Stieglitz’s intention to build a large composite portrait of O’Keeffe out of all the images. He believed that portraiture could reflect a person’s life story and that photography captured but a moment from that narrative.41 Panofsky recognized that the immediate impetus to interpret an image upon its viewing is in fact so strong in the act of human visual perception that training is required to separate one’s analysis of its formal characteristics over its subject. His memorable example is of an acquaintance greeting him on the street with the gesture of lifting his hat, and he describes the act of interpretation of this “event” with iconographical analysis that allows one to see how meaning is built into the visual interpretation of the scene. Ultimately, we learn of the “personality” of this acquaintance, a man of the early twentieth century engaging in a polite greeting, yet Panofsky draws attention to the role of inference in making this assessment. He writes in description of the intrinsic meaning of the image: “We could not construct a mental portrait of the man on the basis of this single action, but only by coordinating a large number of similar observations and by interpreting them in connection with our general information as to his period, nationality, class, intellectual traditions and so forth. Yet all the qualities which this mental portrait would show explicitly are implicitly inherent in every single action; so that, conversely, every single action can be interpreted in the light of those qualities.”42 It is not coincidence that it is precisely this paradoxical theory of visual perception that is at the root of machine-based image interpretation using deep-learning techniques. However, if new research in neurobiology and cognitive science determines that the core components of visual perception operate in a less distillable manner than Panofsky suggests, this may be a false paradox. That his theories make notable accommodation for the instinct we have to bring !16 interpretation to an image at the moment of its sighting draws attention to a more fundamental aspect of visual perception than is the focus of his methodology.43 Current studies in synesthesia, the perceptual phenomenon in which the experience of one sense automatically and simultaneously triggers another, already provide compelling proof of the indivisibility of a visual experience with other interpretative processes, at least in some persons.44 The ability of some people to have an auditory, or other sensory, sensation of what they are seeing in conjunction with their visual experience also demonstrates that visual perception is not a uniform human process, and this may have as much to do with the unique biological makeup of individuals as it does with the role of the environment in the shaping of our interpretative powers. Fortunately, research is under way in hearing-motion-related synesthesia, which may further validate the experiences of many noted artists and musicians that have brought attention to this phenomenon recently as well as in the past. 45 In the same vein, computer vision scientists may be independently discovering the unity of form and content through the exploration of their separateness, in a radically different way than even the modernists could have imagined, and questions about the image-recognition process remain. In many ways the idea of discovering the contents of the black box in the recognition process at large is just as elusive as the notion of the uniformity of visual experiences from person to person. If every image-recognition program that utilizes deep neural networks is unique in its formation of its interpretive capabilities, in relation to its training set, how can we continue to construct a general picture of this process without illustrating only different examples of it? One component of this theoretical quandary is addressed by “transfer learning,” an area of research that actively seeks to replicate learned information in new programming conditions.46 !17 Speaking at the Neural Information Processing Systems (NIPS) conference in 2016, Andrew Ng memorably predicted that after supervised learning, transfer learning would be the next driver in machine-learning commercial success. 47 At the 2017 NIPS conference, the growing debate in computer science on the need for there to be more scientific inquiry regarding the mechanisms at work in the deep-learning process was underscored by computer scientist Ali Rahimi in his Test-of-Time Award presentation.48 His criticism that more rigor is required for the study of this material before it is further expanded has already been sharply rebuked by the director of Facebook AI research and professor in the NYU School of Engineering Yann LeCun. 49 Already fostering much debate in the field of computer science, the divisiveness of this issue concerns the process of scientific discovery itself.50 Should innovation in the age of AI be allowed to occur with a build-it-first engineering approach, or should we wait for theories and the rigorous analysis of processing models to guide development? This core question has much resonance with the study of human visual perception and art. Art historians don’t have to utilize Panofsky’s model of iconographical analysis to “do” art history, and many do not, but understanding how it is useful and where it may fail gives us much insight into the act of visual analysis itself. Even though the most advanced AI in the field of vision technology today is mostly operating on what Panofsky termed the “pre-iconographical” level, we must recognize that a functional foundation for much higher-level vision tasks is quickly being built, whether it is fully understandable or not, and this is happening through models that are not replicative of, but analogous to, human visual processes, and by extension, to a basic level of art historical analysis.51 Why not look to the fields within the umbrella category of neuroscience for !18 methodological inspiration in art history, especially given the long history of the relationship between the arts and sciences? If we as a discipline revive research in iconography and formalism in collaboration with computer scientists for use on this new frontier of art and AI, we could help shape the future navigation and interpretation of all digital images, and this would have a profound impact on the course of the history of art history, and visual culture at large. 52 In sum, the development and use of deep neural networks afford us the opportunity to write the next chapter in our “studies in iconology,” iconology in the age of AI. This paper was originally presented as Dream Formulations and Image Recognition: Algorithms for the Study of Renaissance Art, at Critical Approaches to Digital Art History, The Villa I Tatti, The Harvard University Center for Italian Renaissance Studies and The Newberry Center for Renaissance Studies, Renaissance Society of America Annual Meeting, Chicago, 31 March 2017. This paper would not have been possible without the research developments of Google Scientist Alexander Mordvintsev and his colleagues. I am also very grateful for Alexander’s collaboration on this article with me. Additionally, Scott Dexter, Professor of Computer and Information Science at CUNY Graduate Center, provided me with feedback on the public presentationversion of this research, and Denis Cummings and Sharon Herson gave me invaluable help in the editing process. Lastly, I thank Angela Dressen for her organization of the RSA session and her invitation to publish this research. 1 Alexander Mordvintsev, Christopher Olah, and Mike Tyka, Inceptionism: Going Deeper into Neural Networks, in: Google Research Blog, https://research.googleblog.com/2015/06/ inceptionism-going-deeper-into-neural.html, 17-06-2015. 2 The media focused on the use of the algorithm as an artistic tool. See Matt McFarland, Google’s psychedelic ‘paint brush’ raises the oldest question in art, in: The Washington Post, https:// www.washingtonpost.com/news/innovations/wp/2016/03/10/googles-psychedelic-paint-brushraises-the-oldest-question-in-art, 10-03-2016. !19 3 The term “neural networks” is a more popular example of this trend. By contrast, it is culturally significant to note that computerizing metaphors are also now being used to describe the human condition. Max Tegmark has recently categorized the evolution of the human species according to the relationship of our “hardware” and “software” in 1.0-, 2.0-, and 3.0-based versions. See Max Tegmark, Life 3.0: Being Human in the Age of Artificial Intelligence, New York 2017. 4 The program was first named “inceptionism” in reference to Christopher Nolan’s 2010 film Inception. 5 The perceptual capabilities of machines have expanded greatly on account of deep neural networks. See Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton, Imagenet classification with deep convolutional neural networks, in: Proceedings of the 25th International Conference on Neural Information Processing Systems, vol. 1, 2012, p. 1097-1105; Yang Taigman et al., Deepface: Closing the gap to human-level performance in face verification, in: 2014 IEEE Conference on Computer Vision and Pattern Recognition, 2014, p. 1701-1708. 6 Some examples of the uses of deep neural networks to produce artistic imagery are discussed in Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge, A Neural Algorithm of Artistic Style, in: arXiv:1508.06576v2 (cs.CV), https://arxiv.org/abs/1508.06576, 02-09-2015; Ahmed Elgammal et al., CAN: Creative Adversarial Networks Generating ‘Art’ by Learning About Styles and Deviating from Style Norms, arXiv:1706.07068 [cs.AI], https://arxiv.org/abs/1706.07068, 21-06-2017. Also, “Unhuman: Art in the Age of AI” was the first exhibition of wholly algorithmically produced art using deep-learning techniques by the AICAN algorithm. It was curated by the author and was exhibited in Los Angeles, CA, and Frankfurt, Germany, in October 2017. 7 Self-driving cars and automated surgeries exemplify this trend. 8 The observation that developments in computer vision technology have often been sequestered to the fields of specialists, yet the application of research in this area has increasingly been used by artists was already made by Golan Levin in 2006. See Golan Levin, Computer Vision for Artists and Designers: Pedagogic Tools and Techniques for Novice Programmers, in: Journal of Artificial Intelligence and Society, vol. 20, issue 4, September 2006, p. 462–482. 9 This statement is a direct reference to art historian Erwin Panofsky’s pioneering work on the study of iconography, which he terms iconology. The title of this article also makes reference to Panofsky’s contributions to art history in this area. The “machine-learned” image is a reference to the field of machine learning in computer science that is sometimes used synonymously with the term “AI,” although the concept of artificial intelligence lacks definitional precision and has a long and problematic history unrelated to machine learning. 10 Olga Russakovsky et al., ImageNet Large Scale Visual Recognition Challenge, in: International Journal of Computer Vision, vol. 115, issue 3, December 2015, p. 211-252. 11 Aaron M. Borenstein, Is Artificial Intelligence Permanently Inscrutable? in: Nautilus, issue 40, http://nautil.us/issue/40/learning/is-artificial-intelligence-permanently-inscrutable, 01-09-2016. 12 Ibid. 13 Mordvintsev, Olah, and Tyka 2015, Inceptionism: Going Deeper into Neural Networks. 14 Ibid. !20 15 Ramprasaath R. Selvaraju et al., Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization, in: arXiv:1610.02391v3 [cs.CV], https://pdfs.semanticscholar.org/ 5582/bebed97947a41e3ddd9bd1f284b73f1648c2.pdf, 21-03-2017. 16 This is occurring under the auspices of the museum’s Photoarchive department. 17 The program is user friendly and can easily be accessed for experimentation at http:// gradcam.cloudcv.org/classification and http://gradcam.cloudcv.org/captioning. 18 The analyzed image in discussion is the Madonna and Child, attributed to Berlinghiero (active by 1228, died by 1236), tempera on wood, gold ground, at The Metropolitan Museum of Art. 19 The analyzed image in discussion is Manuscript leaves fragment from Byzantine Egypt, 4th– 7th century, ink on parchment, at The Metropolitan Museum of Art. 20 The image was in fact classified differently than its caption would have suggested, recognizing the top of the collar as the significant part of the image and thus predicting the label “neck brace.” 21 It is likely that our understanding of this phenomenon will change in the near future. 22 As specific approaches in AI are improved and may even reach a level that scientists have termed AGI (Artificial General Intelligence), this will no longer be an issue. See Hans Moravec, When Will Computer Hardware Match the Human Brain? in: Journal of Evolution and Technology, vol. 1, 1998. 23 See Rudolf Arnheim, Art and Visual Perception: A Psychology of the Creative Eye, Berkeley 1954; Michael Baxandall, Patterns of Intention: On the Historical Explanation of Pictures, New Haven 1985, (especially chapter 5, p. 70-104). 24 Eleanor H. Rosch, Natural Categories, in: Cognitive Psychology, vol. 4, issue 3, 1973, p. 328-350; Jean Piaget, The Construction of Reality in the Child, New York 1955. 25 Eleanor H. Rosch, Cognitive Reference Points, in: Cognitive Psychology, vol. 7, issue 4, 1975, p. 532-547. 26 In future research it would be interesting to philosophically compare prototype theory to Plato’s theory of forms. I thank Sharon Herson for pointing out this connection. 27 Eleanor H. Rosch, Cognitive Representations of Semantic Categories, in: Journal of Experimental Psychology: General, vol. 104, issue 3, September 1975, p. 192-233. 28 Jean Piaget, The Child’s Conception of the World, London 1929. Also see Susan A. Gelman, The Essential Child: Origins of Essentialism in Everyday Thought, Oxford 2003. 29 Mordvintsev, Olah, and Tyka 2015, Inceptionism: Going Deeper into Neural Networks. 30 Erwin Panofsky, Studies in Iconology: Humanistic Themes in the Art of the Renaissance, New York 1939. 31 Ibid. 32 Michael Ann Holly, Panofsky and the Foundations of Art History, Ithaca, NY, 1985, p. 114-157. 33 Gatys, Ecker, and Bethge 2015, A Neural Algorithm of Artistic Style, p. 9. 34 Alexander Mordvintsev, Christopher Olah, and Mike Tyka, DeepDream - a code example for visualizing Neural Networks, in: Google Research Blog, https://research.googleblog.com/ 2015/07/deepdream-code-example-for-visualizing.html, 01-07-2015. !21 35 On 8 March 2016, Washington Post Innovations editor Matt McFarland made this comment while interviewing the author on the use of the DeepDream algorithm to create art. 36 Grant Taylor, When the Machine Made Art, The Troubled History of Computer Art, New York 2014. 37 Chris Olah, Alexander Mordvintsev, and Ludwig Schubert, Feature Visualization: How neural networks build up their understanding of images, in: Distill, https://distill.pub/2017/featurevisualization, 07-11-2017. 38 Since the presentation of my research in this area at RSA 2017, the advances in computer vision technology have expanded so remarkably that critical additions needed to be added to this publication, as the presentation version of it had already became partially outdated in the publication process. This phenomenon underscores one inherent difficulty in the pursuit of collaborative projects that cross the arts and sciences. 39 Ahmed Elgammal et al. at the Rutgers Art and Artificial Intelligence Laboratory have been able to discriminate images of “art” from other images using deep-learning techniques. See Ahmed Elgammal et al. 2017, CAN: Creative Adversarial Networks Generating ‘Art’ by Learning About Styles and Deviating from Style Norms; Kanako Abe, Babak Saleh, and Ahmed Elgammal, An Early Framework for Determining Artistic Influence, in: New Trends in Image Analysis and Processing – ICIAP 2013, September 2013, p. 198-207. 40 For an overview of Georgia O’Keeffe’s life and her relation with Alfred Steiglitz, see Lisa Messinger. Georgia O’Keeffe (1887–1986), in: Heilbrunn Timeline of Art History. New York: The Metropolitan Museum of Art, http://www.metmuseum.org/toah/hd/geok/hd_geok.htm, 2004. 41 See Daniel Malcolm, Stieglitz, Steichen, Strand: Masterworks from the Metropolitan Museum of Art, New Haven 2010, p. 22. 42 Erwin Panofsky, Iconography and Iconology: An Introduction to The Study of Renaissance Art, in: Meaning in the Visual Arts, Garden City, NY, 1972, p. 26-64. 43 In his example of the man gesturing with his hat, Panofsky calls the automatic interpretation that occurs upon viewing as having “overstepped the limits of purely formal perception and (having) entered a first sphere of subject matter or meaning.” He later critiques “formal analysis,” as developed by Heinrich Wölfflin, as even needing to avoid “expressions as ‘man,’ ‘horse,’ or ‘column,’” which already demonstrate interpretability on the level of the object. Ibid., p. 26 and p. 30. 44 See Richard E. Cytowic, Synesthesia: A Union of the Senses, Cambridge 2002. 45 The doctoral thesis by Christopher Fassnidge, “Exploring the prevalence and underlying mechanisms of Hearing-Motion Synesthesia with psychophysics, EEG, and neurostimulation,” is underway in the Department of Psychology and the Cognitive Neuroscience Research Unit at the City University of London. David Hockney, Wassily Kandinsky, and Duke Ellington are but a few famous synesthetes. 46 For an overview of transfer learning, see Sebastian Ruder, Transfer Learning—Machine Learning’s Next Frontier, in: ruder.io, http://ruder.io/transfer-learning, 21-03-2017. 47 Andrew Y. Ng, Nuts and Bolts of Building Applications using Deep Learning, Thirtieth Annual Conference on Neural Information Processing Systems (NIPS), Barcelona, 5-10 December 2016. !22 48 Ali Rahimi, Test of Time Award Presentation, Thirty-first Annual Conference on Neural Information Processing Systems (NIPS), Long Beach, CA, 4-9 December 2017. 49 Yann LeCun, My take on Ali Rahimi's “Test of Time” award talk at NIPS., in: Facebook, https://www.facebook.com/yann.lecun/posts/10154938130592143, 06-12-2017. 50 I thank Eliezer Bernart, Ph.D. candidate in Computer Science at Federal University of Rio Grande do Sul, for drawing my attention to the debate that has already been generated by Ali Rahimi’s presentation and Yann LeCun’s rebuttal. Ferenc Huszar’s blog post is an example of this discussion. See Ferenc Huszar, Alchemy, Rigour, and Engineering, in: inFERENCe, http:// www.inference.vc/my-thoughts-on-alchemy, 07-12-2017. More debate on this subject is expected. 51 Emily L. Spratt and Ahmed Elgammal, Computational Beauty: Aesthetic Judgment at the Intersection of Art and Science, in: Computer Vision - ECCV 2014 Workshops: Zurich, Switzerland, September 6-7 and 12, 2014, Proceedings, Part I, 2015. 52 To this end, I am organizing with my colleagues Louisa Wood Ruby and Ellen Prokop the symposium Searching Through Seeing: Optimizing Vision Technology for the Arts, which will take place at the Frick Collection in New York on 12-13 April 2018. The aim of the symposium is to better develop image recognition and retrieval technologies for use in art history. !23 Figures ! Fig. 1 DeepDream; Visualization Input (top) and Output (bottom); 2015; Digital Image. (Google Research Blog, with permission from Google) !24 ! Fig. 2 Stock image of weightlifter curling a dumbbell; Digital Image. ! Fig. 3 DeepDream; Visualization of Dumbbells with Attached Arms; 2015; Digital Image. (Google Research Blog, with permission from Google) !25 ! Fig. 4 Grad-CAM demo results for El Greco, Christ Healing the Blind, The Metropolitan Museum of Art, New York. !26 ! Fig. 5 Grad-CAM demo results for Alfred Stieglitz, Georgia O’Keeffe, The Metropolitan Museum of Art, New York. !27 ! Fig. 6 Pumba, Bichon Frise; 2017. (Author’s Photograph) ! Fig. 7 DeepDream; Dog Visualization; 2015; Digital Image. (With permission from Google) !28 ! Fig. 8 Alfred Stieglitz; Georgia O’Keeffe; 1918; Palladium Print, Photograph; 11.7 x 9 cm; The Metropolitan Museum of Art, New York. !29
1cs.CV
arXiv:1408.2873v2 [cs.CL] 8 Dec 2014 First-Pass Large Vocabulary Continuous Speech Recognition using Bi-Directional Recurrent DNNs Awni Y. Hannun Computer Science Department Stanford University Stanford, CA 94305 [email protected] Andrew L. Maas Computer Science Department Stanford University Stanford, CA 94305 [email protected] Daniel Jurafsky Linguistics Department Stanford University Stanford, CA 94305 [email protected] Andrew Y. Ng Computer Science Department Stanford University Stanford, CA 94305 [email protected] Abstract We present a method to perform first-pass large vocabulary continuous speech recognition using only a neural network and language model. Deep neural network acoustic models are now commonplace in HMM-based speech recognition systems, but building such systems is a complex, domain-specific task. Recent work demonstrated the feasibility of discarding the HMM sequence modeling framework by directly predicting transcript text from audio. This paper extends this approach in two ways. First, we demonstrate that a straightforward recurrent neural network architecture can achieve a high level of accuracy. Second, we propose and evaluate a modified prefix-search decoding algorithm. This approach to decoding enables first-pass speech recognition with a language model, completely unaided by the cumbersome infrastructure of HMM-based systems. Experiments on the Wall Street Journal corpus demonstrate fairly competitive word error rates, and the importance of bi-directional network recurrence. 1 Introduction Modern large vocabulary continuous speech recognition (LVCSR) systems are complex and difficult to modify. Much of this complexity stems from the paradigm of modeling words as sequences of sub-phonetic states with hidden Markov models (HMMs). HMM-based systems require carefullydesigned training recipes to construct consecutively more complex HMM recognizers. The overall difficulty of building, understanding, and modifying HMM-based LVCSR systems has limited progress in speech recognition and isolated it from many advances in related fields. Recently Graves & Jaitly (2014) demonstrated an HMM-free approach to training a speech recognizer which uses a neural network to directly predict transcript characters given the audio of an utterance. This approach discards many of the assumptions present in modern HMM-based LVCSR systems in favor of treating speech recognition as a direct sequence transduction problem. The approach trains a neural network using the connectionist temporal classification (CTC) loss function, which amounts to maximizing the likelihood of an output sequence by efficiently summing over all possible input-output sequence alignments. Using CTC the authors were able to train a neural network to predict the character sequence of test utterances with a character error rate (CER) under 10% on the Wall Street Journal LVCSR corpus. While impressive in its own right, these results are not yet 1 competitive with existing HMM-based systems in terms of word error rate (WER). Good word-level performance in speech recognition often depends heavily upon a language model to provide a prior probability over likely word sequences. To integrate language model information during decoding, Graves & Jaitly (2014) use their CTCtrained neural network to rescore a lattice or n-best hypothesis list generated by a state-of-the-art HMM-based system. This introduces a potentially confounding factor because an n-best list constrains the set of possible transcriptions significantly. Additionally, it results in an overall system which still relies on HMM speech recognition infrastructure to achieve the final results. In contrast, we present first-pass decoding results which use a neural network and language model to decode from scratch, rather than re-ranking an existing set of hypotheses. We describe a decoding algorithm which directly integrates a language model with CTC-trained neural networks to search through the space of possible word sequences. Our first-pass decoding algorithm enables CTC-trained models to benefit from a language model without relying on an existing HMM-based system to generate a word lattice. This removes the lingering dependence on HMM-centric speech recognition toolkits and enables us to achieve fairly competitive WER results with only a neural network and n-gram language model. Deep neural networks (DNNs) are the most widely used neural network architecture for speech recognition (Hinton et al., 2012). DNNs are a fairly generic architecture for classification and regression problems. In HMM-based LVCSR systems, DNNs act as acoustic models by predicting the HMM’s hidden state given the acoustic input for a point in time. However, in such HMM-DNN systems the temporal reasoning about an output sequence takes place within the HMM rather than the neural network. CTC training of neural networks forces the network to model output sequence dependencies rather than reasoning about single time frames independently from others. To better handle such temporal dependencies previous work with CTC used long short term memory (LSTM) networks. LSTM is a neural network architecture was originally designed to prevent the vanishing gradient problem of sigmoidal DNNs or temporally recurrent deep neural networks (RDNNs) (Hochreiter & Schmidhuber, 1997). Our work uses RDNNs instead of LSTMs as a neural network architecture. RDNNs are simpler overall, because there are only dense weight matrix connections between subsequent layers. This simpler architecture is more amenable to graphics processing unit (GPU) computing which can significantly reduce training times. Recent work shows that with rectifier nonlinearities DNNs can perform well in DNN-HMM systems without suffering from vanishing gradient problems during optimization (Dahl et al., 2013; Zeiler et al., 2013; Maas et al., 2013). This makes us hopeful that RDNNs with rectifier nonlinearities may be able to perform comparably to LSTMs which are specially engineered to avoid vanishing gradients. 2 Model We train neural networks using the CTC loss function to do maximum likelihood training of letter sequences given acoustic features as input. We consider a single utterance as a training example consisting of an acoustic feature matrix X and word transcription W . The CTC objective function maximizes the log probability log p(W ; X). We reserve a full exposition of the loss function here because our formulation follows exactly the previous work on using CTC to predict the characters of an utterance transcription (Graves & Jaitly, 2014; Graves et al., 2006). 2.1 Deep Neural Networks With the loss function fixed we must next define how we compute p(c|xt ), the predicted distribution over output characters c given the audio features xt at time t. While many function approximators are possible for this task, we choose as our most basic model a DNN. A DNN computes the distribution p(c|xt ) using a series of hidden layers followed by an output layer. Given an input vector xt the first hidden layer activations are a vector computed as, h(1) = σ(W (1)T xt + b(1) ). (1) (1) (1) The matrix W and vector b are the weight matrix and bias vector for the layer. The function σ(·) is a point-wise nonlinearity. We use rectifier nonlinearities and thus choose, σ(z) = max(z, 0). 2 DNNs can have arbitrarily many hidden layers. After the first hidden layer, the hidden activations h(i) for layer i are computed as, h(i) = σ(W (i)T h(i−1) + b(i) ). (2) To obtain a proper distribution over the set of possible characters c the final layer of the network is a softmax output layer of the form, (s)T (s) exp(−(Wk h(i−1) + bk )) , p(c = ck |xt ) = P (s) (s)T (i−1) h + bj )) j exp(−(Wj (s) where Wk (3) (s) is the k’th column of the output weight matrix W (s) and bk is a scalar bias term. We can compute a subgradient for all parameters of the DNN given a training example and thus utilize gradient-based optimization techniques. Note that this same DNN formulation is commonly used in DNN-HMM models to predict a distribution over senones instead of characters. 2.2 Recurrent Deep Neural Networks A transcription W has many temporal dependencies which a DNN may not sufficiently capture. At each timestep t the DNN computes its output using only the input features xt , ignoring previous hidden representations and output distributions. To enable better modeling of the temporal dependencies present in a problem, we use a RDNN. In a RDNN we select one hidden layer j to have a temporally recurrent weight matrix W (f ) and compute the layer’s hidden activations as, (j) ht (j−1) = σ(W (j)T ht (j) + W (f )T ht−1 + b(j) ). (4) (j) Note that we now make the distinction ht for the hidden activation vector of layer j at timestep t since it now depends upon the activation vector of layer j at time t − 1. When working with RDNNs, we found it important to use a modified version of the rectifier nonlinearity. This modified function selects σ(z) = min(max(z, 0), 20) which clips large activations to prevent divergence during network training. Setting the maximum allowed activation to 20 results in the clipped rectifier acting as a normal rectifier function in all but the most extreme cases. Aside from these changes, computations for a RDNN are the same as those in a DNN as described in 2.1. Like the DNN, we can compute a subgradient for a RDNN using a method sometimes called backpropagation through time. In our experiments we always compute the gradient completely through time rather than truncating to obtain an approximate subgradient. 2.3 Bi-Directional Recurrent Deep Neural Networks While forward recurrent connections reflect the temporal nature of the audio input, a perhaps more powerful sequence transduction model is a BRDNN, which maintains state both forwards and backwards in time. Such a model can integrate information from the entire temporal extent of the input features when making each prediction. We extend the RDNN to form a BRDNN by again choosing a temporally recurrent layer j. The BRDNN creates both a forward and backward intermediate hidden (f ) (b) representation which we call ht and ht respectively. We use the temporal weight matrices W (f ) (f ) (b) and W (b) to propagate ht forward in time and ht backward in time respectively. We update the forward and backward components via the equations, (f ) ht (b) (j−1) + W (f )T ht−1 + b(j) ), (f ) (j−1) + W (b)T ht+1 + b(j) ). = σ(W (j)T ht ht = σ(W (j)T ht (b) (5) Note that the recurrent forward and backward hidden representations are computed entirely independently from each other. As with the RDNN we use the modified nonlinearity function 3 (j) σ(z) = min(max(z, 0), 20). To obtain the final representation ht temporally recurrent components, (j) ht (f ) = ht for the layer we sum the two (b) + ht . (6) Aside from this change to the recurrent layer the BRDNN computes its output using the same equations as the RDNN. As for other models, we can compute a subgradient for the BRDNN directly to perform gradient-based optimization. 3 Decoding Assuming an input of length T , the output of the neural network will be p(c; xt ) for t = 1, . . . , T . Again, p(c; xt ) is a distribution over possible characters in the alphabet Σ, which includes the blank symbol, given audio input xt . In order to recover a character string from the output of the neural network, as a first approximation, we take the argmax at each time step. Let S = (s1 , . . . , sT ) be the character sequence where st = arg maxc∈Σ p(c; xt ). The sequence S is mapped to a transcription by collapsing repeat characters and removing blanks. This gives a sequence which can be scored against the reference transcription using both CER and WER. This first approximation lacks the ability to include the constraint of either a lexicon or a language model. We propose a generic algorithm which is capable of incorporating such constraints. Taking X to be the acoustic input of time T , we seek a transcription W which maximizes the probability, pnet (W ; X)plm (W ). (7) Here the overall probability of the transcription is modeled as the product of two factors: pnet given by the network and plm given by a language model prior. In practice the prior plm (W ), when given by an n-gram language model, is too constraining and thus we down-weight it and include a word insertion penalty (or bonus) as pnet (W ; X)plm (W )α |W |β . (8) Alogrithm 1 attempts to find a word string W which maximizes equation 8. The algorithm maintains two separate probabilities for each prefix, pb (ℓ; x1:t ) and pnb (ℓ; x1:t ). Respectively, these are the probability of the prefix ℓ ending in blank or not ending in blank given the first t time steps of the audio input X. The sets Aprev and Anext maintain a list of active prefixes at the previous time step and proposed prefixes at the next time step respectively. Note that the size of Aprev is never larger than the beam width k. The overall probability of a prefix is the product of a word insertion term and the sum of the blank and non-blank ending probabilities, p(ℓ; x1:t ) = (pb (ℓ; x1:t ) + pnb (ℓ; x1:t ))|W (ℓ)|β , (9) where W (ℓ) is the set of words in the sequence ℓ. When taking the k most probable prefixes of Anext , we sort each prefix using the probability given by equation 9. The variable ℓend is the last character in the label sequence ℓ. The function W (·), which converts ℓ into a string of words, segments the sequence ℓ at each space character and truncates any characters trailing the last space. We incorporate a lexicon or language model constraint by including the probability p(W (ℓ+ )|W (ℓ)) whenever the algorithm proposes appending a space character to ℓ. By setting p(W (ℓ+ )|W (ℓ)) to 1 if the last word of W (ℓ+ ) is in the lexicon and 0 otherwise, the probability acts as a constraint forcing all character strings ℓ to consist of only words in the lexicon. Furthermore, p(W (ℓ+ )|W (ℓ)) can represent a n-gram language model by considering only the last n − 1 words in W (ℓ). 4 Experiments We evaluate our approach on the 81 hour Wall Street Journal (WSJ) news article dictation corpus (available in the LDC catalog as LDC94S13B and LDC93S6B). Our training set consists of 81 hours of speech from 37,318 utterances. The basic preparation of transforming the LDC-released corpora 4 Algorithm 1 Prefix Beam Search: The algorithm initializes the previous set of prefixes Aprev to the empty string. For each time step and every prefix ℓ currently in Aprev , we propose adding a character from the alphabet Σ to the prefix. If the character is a blank, we do not extend the prefix. If the character is a space, we incorporate the language model constraint. Otherwise we extend the prefix and incorporate the output of the network. All new active prefixes are added to Anext . We then set Aprev to include only the k most probable prefixes of Anext . The output is the 1 most probable transcript, although the this can easily be extended to return an n-best list. pb (∅; x1:0 ) ← 1, pnb (∅; x1:0 ) ← 0 Aprev ← {∅} for t = 1, . . . , T do Anext ← {} for ℓ in Aprev do for c in Σ do if c = blank then pb (ℓ; x1:t ) ← p(blank; xt )(pb (ℓ; x1:t−1 ) + pnb (ℓ; x1:t−1 )) add ℓ to Anext else ℓ+ ← concatenate ℓ and c if c = ℓend then pnb (ℓ+ ; x1:t ) ← p(c; xt )pb (ℓ; x1:t−1 ) pnb (ℓ; x1:t ) ← p(c; xt )pb (ℓ; x1:t−1 ) else if c = space then pnb (ℓ+ ; x1:t ) ← p(W (ℓ+ )|W (ℓ))α p(c; xt )(pb (ℓ; x1:t−1 ) + pnb (ℓ; x1:t−1 )) else pnb (ℓ+ ; x1:t ) ← p(c; xt )(pb (ℓ; x1:t−1 ) + pnb (ℓ; x1:t−1 )) end if if ℓ+ not in Aprev then pb (ℓ+ ; x1:t ) ← p(blank; xt )(pb (ℓ+ ; x1:t−1 ) + pnb (ℓ+ ; x1:t−1 )) pnb (ℓ+ ; x1:t ) ← p(c; xt )pnb (ℓ+ ; x1:t−1 ) end if add ℓ+ to Anext end if end for end for Aprev ← k most probable prefixes in Anext end for return 1 most probable prefix in Aprev into training and test subsets follows the Kaldi speech recognition toolkit’s s5 recipe (Povey et al., 2011). However, we did not apply much of the text normalization used to prepare transcripts for training an HMM system. Instead we simply drop unnecessary transcript notes like lexical stress, keeping transcribed word fragments and acronym punctuation marks. We can safely discard much of this normalization because our approach does not rely on a lexicon or pronunciation dictionary, which cause problems especially for word fragments. Our language models are the standard models released with the WSJ corpus without lexical expansion. We used the ‘dev93’ evaluation subset as a development set and report final test set performance on the ‘eval92’ evaluation subset. Both subsets use the same 20k word vocabulary. The language model used for decoding is constrained to this same 20k word vocabulary. The input audio was converted into log-Mel filterbank features with 23 frequency bins. A context window of +/- 10 frames were concatenated to form a final input vector of size 483. We did not perform additional feature preprocessing or feature-space speaker adaptation. Our output alphabet consists of 32 classes, namely the blank symbol “ ”, 26 letters, 3 punctuation marks (apostrophe, ., and -) as well as tokens for noise and space. 5 Table 1: Word error rate (WER) and character error rate (CER) results from a BDRNN trained with the CTC loss function. As a baseline (No LM) we decode by choosing the most likely label at each timestep and performing standard collapsing as done in CTC training. We compare this baseline against our modified prefix-search decoder using a dictionary constraint and bigram language model. Model CER WER No LM Dictionary LM Bigram LM 10.0 8.5 5.7 35.8 24.4 14.1 4.1 First-Pass Decoding with a Language Model We trained a BRDNN with 5 hidden layers, all with 1824 hidden units, for a total of 20.9M free parameters. The third hidden layer of the network has recurrent connections. Weights in the network are initialized from a uniform random distribution scaled by the weight matrix’s input and output layer size (Glorot et al., 2011). We use the Nesterov accelerated gradient optimization algorithm as described in Sutskever et al. (2013) with initial learning rate 10−5 , and maximum momentum 0.95. After each full pass through the training set we divide the learning rate by 1.2 to ensure the overall learning rate decreases over time. We train the network for a total of 20 passes over the training set, which takes about 96 hours using our Python GPU implementation. For decoding with prefix search we use a beam size of 200 and cross-validate with a held-out set to find a good setting of the parameters α and β. Table 1 shows word and character error rates for multiple approaches to decoding with this trained BRDNN. Without any sort of language constraint WER is quite high, despite the fairly low CER. This is consistent with our observation that many mistakes at the character level occur when a word appears mostly correct but does not conform to the highly irregular orthography of English. Prefix-search decoding using the 20k word vocabulary as a prior over possible character sequences results in a substantial WER improvement, but changes the CER relatively little. Comparing the CERs of the no LM and dictionary LM approaches again demonstrates that without an LM the characters are mostly correct but are distributed across many words which increases WER. A large relative drop in both CER and WER occur when we decode with a bigram LM. Performance of the bigram LM model demonstrates that CTC-trained systems can attain competitive error rates without relying on a lattice or n-best list generated by an existing speech system. 4.2 The Effect of Recurrent Connections Previous experiments with DNN-HMM systems found minimal benefits from recurrent connections in DNN acoustic models. It is natural to wonder whether recurrence, and especially bi-directional recurrence, is an essential aspect of our architecture. To evaluate the impact of recurrent connections we compare the train and test CERs of DNN, RDNN, and BRDNN models while roughly controlling for the total number of free parameters in the model. Table 2 shows the results for each type of architecture. Both variants of recurrent models show substantial test set CER improvements over the nonrecurrent DNN model. Note that we report performance for a DNN of only 16.8M total parameters which is smaller than the total number of parameters used in both the RDNN and BRDNN models. We found that larger DNNs performed worse on the test set, suggesting that DNNs may be more prone to over-fitting for this task. Although the BRDNN has fewer parameters than the RDNN it performs better on both the training and test sets. Again this suggests that the architecture itself drives improved performance rather than the total number of free parameters. Conversely, because the gap between bi-directional recurrence and single recurrence is small relative to a non-recurrent DNN, on-line speech recognition using a singly recurrent network may be feasible without overly damaging performance. 6 Table 2: Train and test set character error rate (CER) results for a deep neural network (DNN) without recurrence, recurrent deep neural network with forward temporal connections (RDNN), and a bi-directional recurrent deep neural network (BRDNN). All models have 5 hidden layers. The DNN and RDNN both have 2,048 hidden units in each hidden layer while the BRDNN has 1,824 hidden units per hidden layer to keep its total number of free parameters similar to the other models. For all models we choose the most likely character at each timestep and apply CTC collapsing to obtain a character-level transcript hypothesis. Model DNN RDNN BRDNN Parameters (M) Train CER Test CER 16.8 22.0 20.9 3.8 4.2 2.8 22.3 13.5 10.7 5 Conclusion We presented a decoding algorithm which enables first-pass LVCSR with a language model for CTC-trained neural networks. This decoding approach removes the lingering dependence on HMMbased systems found in previous work. Furthermore, first-pass decoding demonstrates the capabilities of a CTC-trained system without the confounding factor of potential effects from pruning the search space via a provided lattice. While our results do not outperform the best HMM-based systems on the WSJ corpus, they demonstrate the promise of CTC-based speech recognition systems. Our experiments with BRDNN further simplify the infrastructure needed to create CTC-based speech recognition systems. The BRDNN is overall a less complex architecture than LSTMs and can relatively easily be made to run on GPUs since large matrix multiplications dominate the computation. However, our experiments suggest that recurrent connections are critical for good performance. Bi-directional recurrence helps beyond single direction recurrence but could be sacrificed in cases that require low-latency, online speech recognition. Taken together with previous work on CTCbased LVCSR, we believe there is an exciting path forward for high quality LVCSR without the complexity of HMM-based infrastructure. References Dahl, G.E., Sainath, T.N., and Hinton, G.E. Improving Deep Neural Networks for LVCSR using Rectified Linear Units and Dropout. In ICASSP, 2013. Glorot, X., Bordes, A., and Bengio, Y. Deep Sparse Rectifier Networks. In AISTATS, pp. 315–323, 2011. Graves, A. and Jaitly, N. Towards End-to-End Speech Recognition with Recurrent Neural Networks. In ICML, 2014. Graves, A., Fernández, S., Gomez, F., and Schmidhuber, J. Connectionist temporal classification: Labelling unsegmented sequence data with recurrent neural networks. In ICML, pp. 369–376. ACM, 2006. Hinton, G.E., Deng, L., Yu, D., Dahl, G.E., Mohamed, A., Jaitly, N., Senior, A., Vanhoucke, V., Nguyen, P., Sainath, T., and Kingsbury, B. Deep Neural Networks for Acoustic Modeling in Speech Recognition. IEEE Signal Processing Magazine, 29(November):82–97, 2012. Hochreiter, S. and Schmidhuber, J. Long short-term memory. Neural Computation, 9:1735–1780, 1997. Maas, A., Hannun, A., and Ng, A. Rectifier Nonlinearities Improve Neural Network Acoustic Models. In ICML Workshop on Deep Learning for Audio, Speech, and Language Processing, 2013. Povey, D., Ghoshal, A., Boulianne, G., Burget, L., Glembek, O., Veselý, K., Goel, N., Hannemann, M., Motlicek, P., Qian, Y., Schwarz, P., Silovsky, J., and Stemmer, G. The kaldi speech recognition toolkit. In ASRU, 2011. Sutskever, I., Martens, J., Dahl, G., and Hinton, G. On the Importance of Momentum and Initialization in Deep Learning. In ICML, 2013. Zeiler, M.D., Ranzato, M., Monga, R., Mao, M., Yang, K., Le, Q.V., Nguyen, P., Senior, A., Vanhoucke, V., Dean, J., and Hinton, G.E. On Rectified Linear Units for Speech Processing. In ICASSP, 2013. 7
9cs.NE
arXiv:1710.08969v1 [cs.SD] 24 Oct 2017 EFFICIENTLY TRAINABLE TEXT-TO-SPEECH SYSTEM BASED ON DEEP CONVOLUTIONAL NETWORKS WITH GUIDED ATTENTION Hideyuki Tachibana, Katsuya Uenoyama Shunsuke Aihara PKSHA Technology, Inc. Bunkyo, Tokyo, Japan [email protected] Independent Researcher Shinjuku, Tokyo, Japan [email protected] ABSTRACT This paper describes a novel text-to-speech (TTS) technique based on deep convolutional neural networks (CNN), without any recurrent units. Recurrent neural network (RNN) has been a standard technique to model sequential data recently, and this technique has been used in some cutting-edge neural TTS techniques. However, training RNN component often requires a very powerful computer, or very long time typically several days or weeks. Recent other studies, on the other hand, have shown that CNN-based sequence synthesis can be much faster than RNN-based techniques, because of high parallelizability. The objective of this paper is to show an alternative neural TTS system, based only on CNN, that can alleviate these economic costs of training. In our experiment, the proposed Deep Convolutional TTS can be sufficiently trained only in a night (15 hours), using an ordinary gaming PC equipped with two GPUs, while the quality of the synthesized speech was almost acceptable. Index Terms— Text-to-speech, deep learning, convolutional neural network, attention, sequence-to-sequence learning. 1. INTRODUCTION Text-to-speech (TTS) is getting more and more common recently, and is getting to be a basic user interface for many systems. To encourage further use of TTS in various systems, it is significant to develop a handy, maintainable, extensible TTS component that is accessible to speech non-specialists, enterprising individuals and small teams who do not have massive computers. Traditional TTS systems, however, are not necessarily friendly for them, as these systems are typically composed of many domainspecific modules. For example, a typical parametric TTS system is an elaborate integration of many modules e.g. a text analyzer, an F0 generator, a spectrum generator, a pause estimator, and a vocoder that synthesize a waveform from these data, etc. Deep learning [1] sometimes can unite these internal building blocks into a single model, and directly connects the input and the output; this type of technique is sometimes called ‘end-toend’ learning. Although such a technique is sometimes criticized as ‘a black box,’ nevertheless, an end-to-end TTS system named Tacotron [2], which directly estimates a spectrogram from an input text, has achieved promising performance recently, without intensively-engineered parametric models based on domain-specific knowledge. Tacotron, however, has a drawback that it exploits many recurrent units, which are quite costly to train, making it almost infeasible for ordinary labs without luxurious machines to study and extend it further. Indeed, some people tried to implement open clones of Tacotron [3, 4, 5, 6], but they are struggling to reproduce the speech of satisfactory quality as clear as the original work. The purpose of this paper is to show Deep Convolutional TTS (DCTTS), a novel, handy neural TTS, which is fully convolutional. The architecture is largely similar to Tacotron [2], but is based on a fully convolutional sequence-to-sequence learning model similar to the literature [7]. We show this handy TTS actually works in a reasonable setting. The contribution of this article is twofold: (1) Propose a fully CNN-based TTS system which can be trained much faster than an RNN-based state-of-the-art neural TTS system, while the sound quality is still acceptable. (2) An idea to rapidly train the attention, which we call ‘guided attention,’ is also shown. 1.1. Related Work 1.1.1. Deep Learning and TTS Recently, deep learning-based TTS systems have been intensively studied, and some of recent studies are achieving surprisingly clear results. The TTS systems based on deep neural networks include Zen’s work in 2013 [8], the studies based on RNN e.g. [9, 10, 11, 12], and recently proposed techniques e.g. WaveNet [13, sec. 3.2], Char2Wav [14], DeepVoice1&2 [15, 16], and Tacotron [2]. Some of them tried to reduce the dependency on hand-engineered internal modules. The most extreme technique in this trend would be Tacotron [2], which depends only on mel and linear spectrograms, and not on any other speech features e.g. F0 . Our method is close to Tacotron in a sense that it depends only on these spectral representations of audio signals. Most of the existing methods above use RNN, a natural technique for time series prediction. An exception is WaveNet, which is fully convolutional. Our method is also based only on CNN but our usage of CNN would be different from WaveNet, as WaveNet is a kind of a vocoder, or a back-end, which synthesizes a waveform from some conditioning information that is given by front-end components. On the other hand, ours is rather a front-end (and most of back-end processing). We use CNN to synthesize a spectrogram, from which a simple vocoder can synthesize a waveform. 1.1.2. Sequence to Sequence (seq2seq) Learning Recently, recurrent neural network (RNN) has been a standard technique to map a sequence into another sequence, especially in the field of natural language processing, e.g. machine translation [17, 18], dialogue system [19, 20], etc. See also [1, sec. 10.4]. RNN-based seq2seq, however, has some disadvantages. One is that a vanilla encode-decoder model cannot encode too long sequence into a fixed-length vector effectively. This problem has been resolved by a mechanism called ‘attention’ [21], and the attention mechanism now has become a standard idea in seq2seq learning techniques; see also [1, sec. 12.4.5.1]. Another problem is that RNN typically requires much time to train, since it is less suitable for parallel computation using GPUs. In order to overcome this problem, several people proposed the use of CNN, instead of RNN, e.g. [22, 23, 24, 25, 26]. Some studies have shown that CNN-based alternative networks can be trained much faster, and can even outperform the RNN-based techniques. Gehring et al. [7] recently united these two improvements of seq2seq learning. They proposed an idea how to use attention mechanism in a CNN-based seq2seq learning model, and showed that the method is quite effective for machine translation. Our proposed method, indeed, is based on the similar idea to the literature [7]. 2. PRELIMINARY 2.1. Basic Knowledge of the Audio Spectrograms An audio waveform can be mutually converted to a complex spec0 0 trogram Z = {Zf,t } ∈ CF ×T by linear maps called STFT and inverse STFT, where F 0 and T 0 denote the number of frequency bins and temporal bins, respectively. It is common to consider only the magnitude |Z| = {|Zf,t |}, since it still has useful information for many purposes, and that |Z| is almost identical to Z in a sense that there exist many phase estimation (∼ waveform synthesis) techniques from magnitude spectrograms, e.g. the famous Griffin&Lim algorithm [27]; see also e.g. [28]. We always use RTISI-LA [29], an online G&L, to synthesize a waveform. In this paper, we always normalize STFT spectrograms as |Z| ← (|Z|/ max(|Z|))γ , and convert back |Z| ← |Z|η/γ when we finally need to synthesize the waveform, where γ, η are pre- and post-emphasis factors. 0 It is also common to consider a mel spectrogram S ∈ RF ×T , (F  F 0 ), by applying a mel filter-bank to |Z|. This is a standard dimension reduction technique in speech processing. In this paper, we also reduce the temporal dimensionality from T 0 to dT 0 /4e =: T by picking up a time frame every four time frames, to accelerate the training of Text2Mel shown below. We also normalize mel spectrograms as S ← (S/ max(S))γ . 2.2. Notation: Convolution and Highway Activation In this paper, we denote 1D convolution layer [30] by a space saving notation Co←i k?δ (X), where i is the sizes of input channel, o is the sizes of output channel, k is the size of kernel, δ is the dilation factor, and an argument X is a tensor having three dimensions (batch, channel, temporal). The stride of convolution is always 1. Convolution layers are preceded by appropriately-sized zero padding, whose size is suitably determined by a simple arithmetic so that the length of the sequence is kept constant. Let us also denote the 1D deconvolution layer as Do←i k?δ (X). The stride of deconvolution is always 2 in this paper. Let us write a layer composition operator as · / ·, and let us write networks like F / ReLU / G(X) := F(ReLU(G(X))), and (F / G)2 (X) := F / G / F / G(X), etc. ReLU is an element-wise activation function defined by ReLU(x) = max(x, 0). Convolution layers are sometimes followed by a Highway Network [31]-like gated activation, which is advantageous in very deep networks: Highway(X; L) = σ(H1 ) H2 + (1 − σ(H1 )) X, where H1 , H2 are properly-sized two matrices, output by a layer L as [H1 , H2 ] = L(X). The operator is the element-wise multiplication, and σ is the element-wise sigmoid function. Hereafter let us 2d←d denote HCd←d k?δ (X) := Highway(X; Ck?δ ). Fig. 1. Network architecture. TextEnc(L) := (HC2d←2d )2 / (HC2d←2d )2 / (HC2d←2d / HC2d←2d / 1?1 3?1 3?27 3?9 2d←2d )2 /C2d←2d /ReLU/C2d←e /CharEmbede-dim (L). HC2d←2d /HC 3?3 3?1 1?1 1?1 d←d )2 /(HCd←d /HCd←d /HCd←d /HCd←d )2 / AudioEnc(S) := (HC3?3 3?27 3?9 3?3 3?1 d←d / ReLU / Cd←F (S). Cd←d / ReLU / C 1?1 1?1 1?1 ←d d←d 3 d←d 2 d←d AudioDec(R0 ) := σ/CF 1?1 /(ReLU/C1?1 ) /(HC3?1 ) /(HC3?27 / d←d / HCd←d ) / Cd←2d (R0 ). HCd←d / HC 3?9 3?3 3?1 1?1 0 0 0 0 0 ←F /(ReLU/CF ←F )2 /CF ←2c /(HC2c←2c )2 / SSRN(Y ) := σ/CF 1?1 1?1 1?1 3?1 c←c / HCc←c / Dc←c )2 / (HCc←c / HCc←c ) / Cc←F (Y ). C2c←c / (HC 1?1 3?3 3?1 2?1 3?3 3?1 1?1 Fig. 2. Details of each component. For notation, see section 2.2. 3. PROPOSED NETWORK Our DCTTS model consists of two networks: (1) Text2Mel, which synthesize a mel spectrogram from an input text, and (2) Spectrogram Super-resolution Network (SSRN), which convert a coarse mel spectrogram to the full STFT spectrogram. Fig. 1 shows the overall architecture of the proposed method. 3.1. Text2Mel: Text to Mel Spectrogram Network We first consider to synthesize a coarse mel spectrogram from a text. This is the main part of the proposed method. This module consists of four submodules: Text Encoder, Audio Encoder, Attention, and Audio Decoder. The network TextEnc first encodes the input sentence L = [l1 , . . . , lN ] ∈ CharN consisting of N characters, into the two matrices K, V ∈ Rd×N . On the other hand, the network AudioEnc encodes the coarse mel spectrogram S(= S1:F,1:T ) ∈ RF ×T , of previously spoken speech, whose length is T , into a matrix Q ∈ Rd×T . (K, V ) = TextEnc(L). Q = AudioEnc(S1:F,1:T ). (1) (2) An attention matrix A ∈ RN ×T , defined as follows, evaluates how strongly the n-th character ln and t-th time frame S1:F,t are related, √ A = softmaxn-axis (K T Q/ d). (3) Ant ∼ 1 implies that the module is looking at n-th character ln at the time frame t, and it will look at ln or ln+1 or characters around them, at the subsequent time frame t + 1. Whatever, let us expect those are encoded in the n-th column of V . Thus a seed R ∈ Rd×T , decoded to the subsequent frames S1:F,2:T +1 , is obtained as R = Att(Q, K, V ) := V A. (Note: matrix product.) (4) The resultant R is concatenated with the encoded audio Q, as R0 = [R, Q], because we found it beneficial in our pilot study. Then, the concatenated matrix R0 ∈ R2d×T is decoded by the Audio Decoder module to synthesize a coarse mel spectrogram, Y1:F,2:T +1 = AudioDec(R0 ). (5) The result Y1:F,2:T +1 is compared with the temporally-shifted ground truth S1:F,2:T +1 , by a loss function Lspec (Y1:F,2:T +1 |S1:F,2:T +1 ), and the error is back-propagated to the network parameters. The loss function was the sum of L1 loss and the binary divergence Dbin , Dbin (Y |S) := Ef t [−Sf t log Yf t − (1 − Sf t ) log(1 − Yf t )] = Ef t [−Sf t Ŷf t + log(1 + exp Ŷf t )], (6) where Ŷf t = logit(Yf t ). Since the binary divergence gives a nonvanishing gradient to the network, ∂Dbin (Y |S)/∂ Ŷf t ∝ Yf t − Sf t , it is advantageous in gradient-based training. It is easily verified that the spectrogram error is non-negative, Lspec (Y |S) = Dbin (Y |S) + E[|Yf t − Sf t |] ≥ 0, and the equality holds iff Y = S. 3.1.1. Details of TextEnc, AudioEnc, and AudioDec Our networks are fully convolutional, and are not dependent on any recurrent units. Instead of RNN, we sometimes take advantages of dilated convolution [32, 13, 24] to take long contextual information into account. The top equation of Fig. 2 is the content of TextEnc. It consists of the character embedding and the stacked 1D non-causal convolution. A previous literature [2] used a heavier RNN-based component named ‘CBHG,’ but we found this simpler network also works well. AudioEnc and AudioDec, shown in Fig. 2, are composed of 1D causal convolution layers with Highway activation. These convolution should be causal because the output of AudioDec is feedbacked to the input of AudioEnc in the synthesis stage. 3.2. Spectrogram Super-resolution Network (SSRN) 0 We finally synthesize a full spectrogram |Z| ∈ RF ×4T , from the obtained coarse mel spectrogram Y ∈ RF ×T , by a spectrogram super-resolution network (SSRN). Upsampling frequency from F to F 0 is rather straightforward. We can achieve that by increasing the convolution channels of 1D convolutional network. Upsampling in temporal direction is not similarly done, but by twice applying deconvolution layers of stride size 2, we can quadruple the length of sequence from T to 4T = T 0 . The bottom equation of Fig. 2 shows SSRN. In this paper, as we do not consider online processing, all convolutions can be non-causal. The loss function was the same as Text2Mel: sum of binary divergence and L1 distance between the synthesized spectrogram SSRN(S) and the ground truth |Z|. 4. GUIDED ATTENTION 4.1. Guided Attention Loss: Motivation, Method and Effects In general, an attention module is quite costly to train. Therefore, if there is some prior knowledge, it may be a help incorporating them into the model to alleviate the heavy training. We show that the simple measure below is helpful to train the attention module. In TTS, the possible attention matrix A lies in the very small subspace of RN ×T . This is because of the rough correspondence of the order of the characters and the audio segments. That is, if one reads a text, it is natural to assume that the text position n progresses nearly linearly to the time t, i.e., n ∼ at, where a ∼ N/T . This is Fig. 3. Comparison of the attention matrix A, trained with and without the guided attention loss Latt (A). (Left) Without, and (Right) with the guided attention. The test text is “icassp stands for the international conference on acoustics, speech, and signal processing.” We did not use the heuristics described in section 4.2. the prominent difference of TTS from other seq2seq learning techniques such as machine translation, in which an attention module should resolve the word alignment between two languages that have very different syntax, e.g. English and Japanese. Based on this idea, we introduce another constraint on the attention matrix A to prompt it to be ‘nearly diagonal,’ Latt (A) = Ent [Ant Wnt ], where Wnt = 1 − exp{−(n/N − t/T )2 /2g 2 }. In this paper, we set g = 0.2. If A is far from diagonal (e.g., reading the characters in the random order), it is strongly penalized by the loss function. This subsidiary loss function is simultaneously optimized with the main loss Lspec with equal weight. Although this measure is based on quite a rough assumption, it improved the training efficiency. In our experiment, if we added the guided attention loss to the objective, the term began decreasing only after ∼100 iterations. After ∼5K iterations, the attention became roughly correct, not only for training data, but also for new input texts. On the other hand, without the guided attention loss, it required much more iterations. It began learning after ∼10K iterations, and it required ∼50K iterations to look at roughly correct positions, but the attention matrix was still vague. Fig. 3 compares the attention matrix, trained with and without guided attention loss. 4.2. Forcibly Incremental Attention in Synthesis Stage In the synthesis stage, the attention matrix A sometimes fails to look at the correct characters. Typical errors we observed were (1) it occasionally skipped several characters, and (2) it repeatedly read a same word twice or more. In order to make the system more robust, we heuristically modify the matrix A to be ‘nearly diagonal,’ by a simple rule as follows. We observed this device sometimes alleviated such misattentions. Let nt be the position of the character to be read at tth time frame; nt = argmaxn An,t . Comparing the current position nt and the previous position nt−1 , unless the difference nt − nt−1 is within the range −1 ≤ nt − nt−1 ≤ 3, the current attention position forcibly set to An,t = δn,nt−1 +1 (Kronecker’s delta), to forcibly make the attention target incremental, i.e., nt − nt−1 = 1. 5. EXPERIMENT 5.1. Experimental Setup To train the networks, we used LJ Speech Dataset [33], a public domain speech dataset consisting of ∼13K pairs of text&speech, ∼24 hours in total, without phoneme-level alignment. These speech are a little reverbed. We preprocessed the texts by spelling out some of Table 1. Parameter Settings. Sampling rate of audio signals STFT window function STFT window length and shift STFT spectrogram size F 0 × 4T Mel spectrogram size F × T Dimension e, d and c ADAM parameters (α, β1 , β2 , ε) Minibatch size Emphasis factors (γ, η) RTISI-LA window and iteration Character set, Char 22050 Hz Hanning 1024 (∼46.4 [ms]), 256 (∼11.6[ms]) 513 × 4T (T depends on audio clip) 80 × T (T depends on audio clip) 128, 256, 512 (2 × 10−4 , 0.5, 0.9, 10−6 ) 16 (0.6, 1.3) 100, 10 a-z,.’- and Space and NULL Table 2. Comparison of MOS (95% confidence interval), training time, and iterations (Text2Mel/SSRN), of an open Tacotron [5] and the proposed method (DCTTS). The digits with * were excerpted from the repository [5]. Method Open Tacotron [5] DCTTS DCTTS DCTTS DCTTS Iteration 877K∗ 20K/ 40K 90K/150K 200K/340K 540K/900K Time 12 days∗ ∼2 hours ∼7 hours ∼15 hours ∼40 hours MOS (95% CI) 2.07 ± 0.62 1.74 ± 0.52 2.63 ± 0.75 2.71 ± 0.66 2.61 ± 0.62 abbreviations and numeric expressions, decapitalizing the capitals, and removing less frequent characters not shown in Table 1, where NULL is a dummy character for zero-padding. We implemented our neural networks using Chainer 2.0 [34]. The models are trained on a household gamine PC equipped with two GPUs. The main memory of the machine was 62GB, which is much larger than the audio dataset. Both GPUs were NVIDIA GeForce GTX 980 Ti, with 6 GB memories. For simplicity, we trained Text2Mel and SSRN independently and asynchronously, using different GPUs. All network parameters are initialized using He’s Gaussian initializer [35]. Both networks were trained by ADAM optimizer [36]. When training SSRN, we randomly extracted short sequences of length T = 64 for each iteration, to save the memory usage. To reduce the frequency of disc access, we only took the snapshot of the parameters, every 5K iterations. Other parameters are shown in Table 1. As it is not easy for us to reproduce the original results of Tacotron, we instead used a ready-to-use model [5] for comparison, which seemed to produce the most reasonable sounds among the open implementations. It is reported that this model was trained using LJ Dataset for 12 days (877K iterations) on a GTX 1080 Ti, newer GPU than ours. Note, this iteration is still much less than the original Tacotron, which was trained for more than 2M iterations. We evaluated mean opinion scores (MOS) for both methods by crowdsourcing on Amazon Mechanical Turk using crowdMOS toolkit [37]. We used 20 sentences from Harvard Sentences List 1&2. We synthesized the audio using 5 methods shown in Table 2. The crowdworkers evaluated these 100 clips, rating them from 1 (Bad) to 5 (Excellent). Each worker is supposed to rate at least 10 clips. To obtain more responses with higher quality, we set a few incentives shown in the literature. The results were statistically processed using the method shown in the literature [37]. Fig. 4. (Top) Attention, (middle) mel, and (bottom) linear STFT spectrogram, synthesized by the proposed method, after 15 hours training. The input is “icassp stands for the international conference on acoustics, speech and signal processing.” shows an example of attention, synthesized mel and full spectrograms, after 15 hours training. It shows that the method can almost correctly look at the correct characters, and can synthesize quite clear spectrograms. More samples will be available at the author’s web page.1 In our crowdsourcing experiment, 31 subjective evaluated our data. After the automatic screening by the toolkit [37], 560 scores by 6 subjective were selected for final statistics calculation. Table 2 compares the performance of our proposed method (DCTTS) and an open Tacotron. Our MOS (95% confidence interval) was 2.71±0.66 (15 hours training) while the Tacotron’s was 2.07 ± 0.62. Although it is not a strict comparison since the frameworks and machines are different, it would be still concluded that our proposed method is quite rapidly trained to the satisfactory level compared to Tacotron. 6. SUMMARY AND FUTURE WORK This paper described a novel text-to-speech (TTS) technique based on deep convolutional neural networks (CNN), as well as a technique to train the attention module rapidly. In our experiment, the proposed Deep Convolutional TTS can be sufficiently trained only in a night (∼15 hours), using an ordinary gaming PC equipped with two GPUs, while the quality of the synthesized speech was almost acceptable. Although the audio quality is far from perfect yet, it may be improved by tuning some hyper-parameters thoroughly, and by applying some techniques developed in deep learning community. We believe this handy method encourages further development of the applications based on speech synthesis. We can expect this simple neural TTS may be extended to other versatile purposes, such as emotional/non-linguistic/personalized speech synthesis, singing voice synthesis, music synthesis, etc., by further studies. In addition, since a neural TTS has become this lightweight, the studies on more integrated speech systems e.g. some multimodal systems, simultaneous training of TTS+ASR, and speech translation, etc., may have become more feasible. These issues should be worked out in the future. 7. ACKNOWLEDGEMENT The authors would like to thank the OSS contributors, and the members and contributors of LibriVox public domain audiobook project, In our setting, the training throughput was ∼3.8 minibatch/s (Text2Mel) and @keithito who created the speech dataset. and ∼6.4 minibatch/s (SSRN). This implies that we can iterate the 1 https://github.com/tachi-hi/tts_samples updating formulae of Text2Mel, 200K times only in 15 hours. Fig. 4 5.2. Result and Discussion 8. REFERENCES [1] I. Goodfellow et al., Deep Learning, MIT Press, 2016, http: //www.deeplearningbook.org. [21] D Bahdanau et al., “Neural machine translation by jointly learning to align and translate,” in Proc. ICLR 2015, arXiv:1409.0473, 2014. [2] Y. Wang et al., “Tacotron: Towards end-to-end speech synthesis,” in Proc. Interspeech, 2017, arXiv:1703.10135. [22] Y. Kim, “Convolutional neural networks for sentence classification,” in Proc. EMNLP, 2014, pp. 1746–1752, arXiv:1408.5882. [3] A. Barron, “Implementation of Google’s Tacotron in TensorFlow,” 2017, Available at GitHub, https://github. com/barronalex/Tacotron (visited Oct. 2017). [23] X. Zhang et al., “Character-level convolutional networks for text classification,” in Proc. NIPS, 2015, arXiv:1509.01626. [4] K. Park, “A TensorFlow implementation of Tacotron: A fully end-to-end text-to-speech synthesis model,” 2017, Available at GitHub, https://github.com/Kyubyong/ tacotron (visited Oct. 2017). [5] K. Ito, “Tacotron speech synthesis implemented in TensorFlow, with samples and a pre-trained model,” 2017, Available at GitHub, https://github.com/keithito/ tacotron (visited Oct. 2017). [6] R. Yamamoto, “PyTorch implementation of Tacotron speech synthesis model,” 2017, Available at GitHub, https:// github.com/r9y9/tacotron_pytorch (visited Oct. 2017). [7] J. Gehring et al., “Convolutional sequence to sequence learning,” in Proc. ICML, 2017, pp. 1243–1252, arXiv:1705.03122. [8] H. Zen et al., “Statistical parametric speech synthesis using deep neural networks,” in Proc. ICASSP, 2013, pp. 7962–7966. [9] Y. Fan et al., “TTS synthesis with bidirectional LSTM based recurrent neural networks,” in Proc. Interspeech, 2014, pp. 1964–1968. [10] H. Zen and H. Sak, “Unidirectional long short-term memory recurrent neural network with recurrent output layer for lowlatency speech synthesis,” in Proc. ICASSP, 2015, pp. 4470– 4474. [11] S. Achanta et al., “An investigation of recurrent neural network architectures for statistical parametric speech synthesis.,” in Proc. Interspeech, 2015, pp. 859–863. [12] Z. Wu and S. King, “Investigating gated recurrent networks for speech synthesis,” in Proc. ICASSP, 2016, pp. 5140–5144. [24] N. Kalchbrenner et al., “Neural machine translation in linear time,” arXiv:1610.10099, 2016. [25] Y. N. Dauphin et al., “Language modeling with gated convolutional networks,” arXiv:1612.08083, 2016. [26] J. Bradbury et al., “Quasi-recurrent neural networks,” in Proc. ICLR 2017, 2016. [27] D. Griffin and J. Lim, “Signal estimation from modified shorttime fourier transform,” IEEE Trans. ASSP, vol. 32, no. 2, pp. 236–243, 1984. [28] P. Mowlee et al., Phase-Aware Signal Processing in Speech Communication: Theory and Practice, Wiley, 2016. [29] X. Zhu et al., “Real-time signal estimation from modified short-time fourier transform magnitude spectra,” IEEE Trans. ASLP, vol. 15, no. 5, 2007. [30] Y. LeCun and Y. Bengio, “The handbook of brain theory and neural networks,” chapter Convolutional Networks for Images, Speech, and Time Series, pp. 255–258. MIT Press, 1998. [31] R. K. Srivastava et al., “Training very deep networks,” in Proc. NIPS, 2015, pp. 2377–2385. [32] F. Yu and V. Koltun, “Multi-scale context aggregation by dilated convolutions,” in Proc. ICLR, 2016. [33] K. Ito, “The LJ speech dataset,” 2017, Available at https:// keithito.com/LJ-Speech-Dataset/ (visited Sep. 2017). [34] S. Tokui et al., “Chainer: A next-generation open source framework for deep learning,” in Proc. Workshop LearningSys, NIPS, 2015. [13] A. van den Oord et al., “WaveNet: A generative model for raw audio,” arXiv:1609.03499, 2016. [35] K. He et al., “Delving deep into rectifiers: Surpassing humanlevel performance on ImageNet classification,” in Proc. ICCV, 2015, pp. 1026–1034, arXiv:1502.01852. [14] J. Sotelo et al., “Char2wav: End-to-end speech synthesis,” in Proc. ICLR, 2017. [36] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” in Proc. ICLR 2015, 2014, arXiv:1412.6980. [15] S. Arik et al., “Deep voice: Real-time neural text-to-speech,” in Proc. ICML, 2017, pp. 195–204, arXiv:1702.07825. [37] F. Ribeiro et al., “CrowdMOS: An approach for crowdsourcing mean opinion score studies,” in Proc ICASSP, 2011, pp. 2416– 2419. [16] S. Arik et al., “Deep voice 2: Multi-speaker neural text-tospeech,” in Proc. NIPS, 2017, arXiv:1705.08947. [17] K. Cho et al., “Learning phrase representations using RNN encoder-decoder for statistical machine translation,” in Proc. EMNLP, 2014, pp. 1724–1734. [18] I. Sutskever et al., “Sequence to sequence learning with neural networks,” in Proc. NIPS, 2014, pp. 3104–3112. [19] O. Vinyals and Q. Le, “A neural conversational model,” in Proc. Deep Learning Workshop, ICML, 2015. [20] I. V. Serban et al., “Building end-to-end dialogue systems using generative hierarchical neural network models.,” in Proc. AAAI, 2016, pp. 3776–3784.
2cs.AI
On Codes over Zp2 and its Covering Radius ∗ arXiv:1711.01803v1 [cs.IT] 6 Nov 2017 N. Annamalai Research Scholar Department of Mathematics Bharathidasan University Tiruchirappalli-620 024, Tamil Nadu, India Email: [email protected] C. Durairajan Assistant Professor Department of Mathematics Bharathidasan University Tiruchirappalli-620024, Tamil Nadu, India Email: [email protected] Proposed running head:On Codes over Zp2 and its Covering Radius The first author would like to thank the Department of Science and Technology (DST), New Delhi, India for their financial support in the form of INSPIRE Fellowship (DST Award Letter No.IF130493/DST/INSPIRE Fellowship / 2013/(362) Dated: 26.07.2013) to carry out this work. ∗ 1 Abstract This paper gives lower and upper bounds on the covering radius of codes over Zp2 with respect to Lee distance. We also determine the covering radius of various Repetition codes over Zp2 . Keywords:Covering radius, Repetition Codes, Gray Map. 2000 Mathematical Subject Classification: Primary: 94B25, Secondary: 11H31 Corresponding author: Dr. C. Durairajan Assistant Professor Department of Mathematics Bharathidasan University Tiruchirappalli-620024, Tamil Nadu, India E-mail: [email protected] 2 1 Introduction In last decade, there has been a burst of research activities in codes over finite rings. In particular, codes over Zps and Z4 received much attention [3], [4], [9],[11], [13], [14], [15] and [16]. One of the important parameter of a code is the covering radius of the code. The covering radius of binary linear codes is a widely studied parameter [6]. Recently, the covering radius of codes over Z4 has been investigated with respect to Lee and Euclidean distances and several upper and lower bounds on the covering radius have been obtained [1] and [17]. A linear code C of length n over a finite ring R is an additive subgroup of Rn . An element of C is called a codeword of C and a generator matrix of C is a matrix whose rows generate C. Two codes are said to be equivalent if one can be obtained from the other by permuting the coordinates and (if necessary) changing the signs of certain coordinates. Code differing by only a permutation of coordinates of the code is called a permutation equivalent. The Hamming weight wH (x) of a vector x in Rn is the number of non-zero coordinates in x. The Lee weight of x ∈ Zp2 is defined by    if 0 ≤ x ≤ p  x wL (x) = p if p + 1 ≤ x ≤ p2 − p    p2 − x if p2 − p + 1 ≤ x < p2 . Let x, y ∈ Rn , then the Hamming distance dH (x, y) and the Lee distances dL (x, y) between two vectors x and y are wH (x − y) and wL (x − y), respectively. The minimum Hamming(Lee) distance dH of a code C is the smallest Hamming(Lee) distance between any two distinct codewords of C. In this paper, we study the covering radius of codes over Zp2 . In section 2 contains some preliminaries and basic results for the covering radius of codes over Zps . In Section 3, we determine the covering radius of different types of repetition codes over Zp2 . 2 Preliminaries Let d be the general distance out of various possible distance such as Hamming distance and Lee distance. The covering radius of a code C over a finite ring R with respect to a general distance d is given by rd (C) = maxn u∈R   min d(u, c) . c∈C It is easy to see that rd (C) is the least non-negative integer rd such that 3 Znps = [ Srd (c) where Srd (u) = {v ∈ Znps | d(u, v) ≤ rd }. c∈C n If C = R , then the covering radius of C is 0. If C = {0}, then the covering radius of C is n. Let C be a linear code, then the translate u + C = {u + c | c ∈ C} is called the coset of C where u ∈ Zps . A minimum weight word in a coset is called a coset leader. The following proposition is straightforward from the definition of covering radius and the coset leader. Proposition 2.1. The covering radius of a linear code C with respect to the general distance d is the largest weight among all coset leaders. In [20], the Gray map φ : Znp2 → Zpn p is the coordinates-wise extension of the function p from Zp2 to Zp defined by 0 → 000 · · · 000 1 → 100 · · · 000 2 → 110 · · · 000 .. . p → 111 · · · 111 p + 1 → 211 · · · 111 .. . 2p → 222 · · · 222 .. . (p − 1)p → (p − 1)(p − 1)(p − 1) · · · (p − 1)(p − 1)(p − 1) (p − 1)p + 1 → 0(p − 1)(p − 1) · · · (p − 1)(p − 1)(p − 1) .. . p2 − 1 → 000 · · · 00(p − 1). The image φ(C) of a linear code C over Zp2 by the Gray map is a p-ary code of length pn. Note that the minimum weight and the minimum distance of C with respect to Lee is the same as the minimum weight and minimum distance of φ(C) with respect to Hamming. Therefore, we have Proposition 2.2. Let C be a code over Zp2 and φ(C) the Gray image of C. Then rL (C) = rH (φ(C)) where φ(C) is the Gray image of C. 4 A code of length n with M codewords and the minimum Hamming distance dH , the is calledan (n, minimum Lee distance dL overZp2 M, dH , dL ) code over Zp2 is said to be dL dL type α (type β) code if dH = dH > . p p The dual code C ⊥ of C is defined as {x ∈ Znp2 | x · y = 0 for all y ∈ C} where n P x·y = xi yi (mod p2 ). i=1 Now, we give a few known lower and upper bounds on the covering radius of codes over Zp2 with respect to Lee weight. The proof of the following Proposition 2.3 and Theorem 2.4 is similar to that of Proposition 3.2 and Theorem 4.5 in [1] and is omitted. Proposition 2.3. For any code C of length n over Zp2 , rL (C)  X pn ppn ≤ . |C| i i=0 Let C be a code over Zp2 and let s(C ⊥ ) = #{i|Ai (C ⊥ ) 6= 0, i 6= 0} where Ai (C ⊥ ) is the number of codewords of Lee weight i in C ⊥ . Theorem 2.4. Let C be a code over Zp2 , then rL (C) ≤ s(C ⊥ ). The following result is generalization of Mattson [6] results of code over a finite field to a finite ring. Theorem 2.5. If C0 and C1 are codes over Zp2 generated by matrices G0 and G1 respectively and if C is the code generated by ! G1 0 , G= G0 A then rd (C) ≤ rd (C0 ) + rd (C1 ) and the covering radius of the concatenation of C0 and C1 is greater than or equal to rd (C0 ) + rd (C1 ) for all distances d over Zp2 . The proof of this is similar to that of Mattson [6] and hence omitted. Theorem 2.6. [6] Let C be the Cartesian product of two codes C1 and C2 , then the covering radius of C is r(C1 ) = r(C2 ) + r(C3 ). 5 3 Repetition Codes A q-ary repetition code C over a finite field Fq = {α0 = 0, α1 = 1, α2 , · · · , αq−1 } is an [n, 1, n] code C = {ᾱ | α ∈ Fq } where ᾱ = αα · · · α ∈ Fnq . The covering radius of C is   n(q − 1) [12]. The block repetition code generated by q  n  n n z }| { z }| { z }| { G = 11 · · · 1 α2 α2 · · · α2 · · · αq−1 αq−1 · · · αq−1 is equivalent to the repetition code of length (q  − 1)n over  Fq . Then by the above, the 2 n(q − 1) covering radius of the code generated by G is . q If we consider the repetition code over a finite ring R, then there are two different types of repetition codes. Let u ∈ R be a unit and let z ∈ R be a zero-divisor, then the   n z }| { code Cu generated by Gu = uuu · · · u is called the unit repetition code and the code  n  z }| { Cz generated by Gz = zz · · · z is called the zero-divisor repetition code. Clearly Cu is an (n, M, n, n) linear code where M is the cardinality of R and Cz is an (n, Mz , n, dL ) linear code where Mz is the order of z. In particular, if we take R = Zp2 , then the unit repetition code Cu is an (n, p2 , n, n) linear code and the zero-divisor repetition code Cz is an (n, m n, pn) linear code because of the order of any zero-divisor in Zp2 is p. lSince m l p, dL dL dH > p , the code Cu is type β code. The code Cz is type α code because dH = p . Theorem 3.1. rL (Cz ) = (p − 1)n. Proof. Let x ∈ Znp2 . Let wi be the number of i coordinates in x for 0 ≤ i ≤ p2 − 1. Let a = aa · · · a} . Consider dL (x, 0) = (w1 + wp2 −1 ) + 2(w2 + wp2−2 ) + · · · + (p − 1)(wp−1 + | {z n times wp2 −(p−1) ) + p(wp + wp+1 + · · · + wp2 −p ). For k = 1, 2, · · · , (p − 1), we have dL (x, kp) = (wkp−1 +wkp+1)+2(wkp−2 +wkp+2)+· · ·+p(w0 +w1 +· · ·+w(k−1)p +w(k+1)p +· · ·+wp2 −1 ). Thus rL (Cz ) ≤ p−1 X dL (x, kp) k=0 p p2 −1 X 1 = p(p − 1) wi p i=0 = (p − 1)n. Therefore, rL (Cz ) ≤ (p − 1)n. On the other hand, choose y ∈ Znp2 such that 6 p−2 X p2 −2p  p − (i + 1) wi + wp2 −i = i=1 or p−2 X  X wp+i i=0 p2 −1   p − (i + 1) wkp+i + wkp−i = i=1 X wi for k = 1, 2, · · · , (p − 1) i=0 i6=kp where wi is the number of i coordinates in y for 0 ≤ i ≤ p2 − 1 and 2 −1 pP wi = n. Then i=0 dL (y, 0) = (w1 + wp2 −1 ) + 2(w2 + wp2−2 ) + · · · + (p − 1)(wp−1 + wp2 −(p−1) ) + p(wp + wp+1 + · · · + wp2 −p ) 2 −2p  pX  p−1 X  i wp+i + wp−i + p = wp+i . i=1 i=0 For k = 1, 2, · · · , (p − 1), we have dL (y, kp) = (wkp−1 + wkp+1) + 2(wkp−2 + wkp+2) + · · · + p(w0 + w1 + · · · + w(k−1)p + w(k+1)p + · · · + wp2 −1 ) 2 −1  pX  p−1 X  i wkp+i + wkp−i + p = wi . i=1 i=0 i6=kp Therefore  dL (y, Cz ) = min dL (y, kp) : 0 ≤ k ≤ (p − 1) ( p2 −2p p−2 X X   = (p − 1)n + min p − (i + 1) wi + wp2 −i , wp+i − i=1 i=0 p2 −1 X i=0 i6=kp p−2 wi − X i=1  p − (i + 1) wkp+i + wkp−i )  = (p − 1)n. Therefore, rL (Cz ) ≥ (p − 1)n and hence rL (Cz ) = (p − 1)n. Theorem 3.2. rL (Cu ) = (p − 1)n. Proof. Let x ∈ Znp2 . Let wi be the number of i coordinates in x for 0 ≤ i ≤ p2 − 1. Then 2 −1 pP wi = n. Consider i=0 7 dL (x, t) = (wt+1 + wt−1 ) + 2(wt+2 + wt−2 ) + · · · + (p − 1)(wt−p+1 + wt+p−1 ) + p(wp+t + · · · + wp2 −p+t ). rL (Cu ) ≤ 2 −1 pP dL (x, t) t=0 p2 = (p − 1)n. Therefore, rL (Cu ) ≤ (p − 1)n. 2 n−(p −1)l l l l   }| { z }| { z }| { z }| { z 2 n 2 2 n Let x = 00...0 11 · · · 1 22 · · · 2 · · · (p − 1)(p − 1) · · · (p − 1) ∈ Zp2 where l = , p2 then dL (x, 0) = n + p2 (p − 2)l, dL (x, 1) = 2n + p2 (p − 3)l, dL (x, 2) = 3n + p2 (p − 4)l. In general, dL (x, i) = (i + 1)n + p2 (p − (i + 2))l for 0 ≤ i ≤ p2 − 2 and dL (x, p2 − 1) = p2 (p − 1)l. Thus rL (Cu ) ≥ dL (x, Cu )   dL (x, i) = min2 0≤i≤p −1   2 dL (x, i), dL (x, p − 1) = min2 0≤i≤p −2   2 2 i + 1)n + p (p − (i + 2))l, p (p − 1)l . = min2 0≤i≤p −2 Since l ≥ n , rL (Cu ) ≥ (p − 1)n. Therefore, rL (Cu ) = (p − 1)n. p2 We define few block repetition codes over Zp2 and find their covering radius. First, let us consider a block repetition code over Zp2 with generator matrix n n n }| { z }| { z }| { z 2 2 2 G = 11 · · · 1 22 · · · 2 · · · (p − 1)(p − 1) · · · (p − 1) .  Let 1 ≤ i < p. Since the subgroup hipi generated by ip is of order p, each element of hipi appears p times in ip{0, 1, 2, · · · , (p2 − 1)}. Therefore, ip(12 · · · (p2 − 1)) contains p − 1 zeros and remaining p2 − 1 − (p − 1) are zero-divisors. Since Lee weight of zero-divisor is p, wtL (ip(12 · · · (p2 − 1))) = (p2 − p)p and hence wtL (ip(12 · · · p2 − 1)) = n(p2 − p)p = np2 (p − 1) where i ∈ Znp2 . If x 6= ip is not a zero-divisor, then x{1, 2, · · · , p2 − 1} = {1, 2, · · · , p2 − 1}, wtL (x(12 · · · (p2 − 1))) = wtL (12 · · · (p2 − 1)) = p2 (p − 1) and hence wtL (x(12 · · · (p2 − 1))) = np2 (p − 1). Therefore, the code is (n(p2 − 1), p2 , np2 (p − 1)) a constant weight code. 8 If we consider the Hamming weight of the code, then the code is two weight code of weights (p2 − p)n and (p2 − 1)n. Thus we have n n  n }| { z }| { z }| { z 2 2 Theorem 3.3. The code generated by G = 11 · · · 1 22 · · · 2 · · · (p − 1) · · · (p − 1) is  a (p2 − 1)n, p2 , p(p − 1)n, p2 (p − 1)n Zp2 -linear code with weight distributions with respect to the Hamming and with respect to the Lee is A0 = 1, A(p2 −p)n = p − 1 and A(p2 −1)n = p2 − p.. (p2 −1)n The above code is called a block repetition code and is denoted by BRp2   dL , this block repetition code is type α code. dH = p (p2 −1)n Theorem 3.4. (p3 − p2 − 1)n ≤ rL (BRp2 (p2 −1)n Proof. Let x = 11 · · · 1 ∈ Zp2 (p2 −1)n (p2 −1)n (p2 −1)n Gray image φ(BRp2 ) ≤ (p3 − p2 )n. , then we have dL (x, BRp2 by definition of covering radius, rL (BRp2 . Since ) = (p3 −p2 −1)n. Hence ) ≥ (p3 − p2 − 1)n. On the other hand, its ) contains a codeword p2 n p2 n p2 n p(p−1)n }| { z }| { z }| { z }| { z y = 11 · · · 1 22 · · · 2 · · · (p − 1)(p − 1) · · · (p − 1) 00 · · · 0 . Let C1 be the code generated by y. Let C2 be the code with generator matrix  p2 n p2 n p2 n }| { z }| { z }| { z G2 = 11 · · · 1 22 · · · 2 · · · (p − 1)(p − 1) · · · (p − 1) p(p−1)n z }| { and let C3 = {00 · · · 0}. Then C1 is the cartesian product C2 × C3 of C2 and C3 . Since 2 2 the code C2 is equivalent  to the repetition code [(p − 1)p n, 1, (p − 1)p n] over Zp , the 2 (p − 1)p n(p − 1) covering radius of C2 is = p(p −1)2 n. By Theorem 2.6, the covering p radius of C1 is p(p − 1)n + p(p − 1)2 n = (p3 − p2 )n.   (p − 1)p2 n(p − 1) + p(p − 1)n rH (C2 × C3 ) ≤ p = p(p − 1)2 n + p(p − 1)n = p(p − 1)((p − 1) + 1)n = (p3 − p2 )n. (p2 −1)n Since C1 ⊂ φ(BRp2 ). This implies that, (p2 −1)n rH (BRp2 ) ≤ rH (C1 ) = rH (C2 × C3 ) = (p3 − p2 )n. 9 (p2 −1)n Therefore rL (BRp2 ) ≤ (p3 − p2 )n. Now, we define another block repetition code over Zp2 . Let n n n }| { z }| { z }| { z 2 2 2 G = 11 · · · 1 22 · · · 2 · · · (p − 2)(p − 2) · · · (p − 2) .  Then the code generated by G is a ((p2 − 2)n, p2 , pn, p2 n) linear code over Zp2 . The following theorem gives an upper and a lower bounds of the covering radius of this block repetition code. (p2 −2)n Theorem 3.5. (p3 − p2 − 2)n ≤ rL (BRp2 ) ≤ (p3 − p2 − 1)n. A proof of this theorem is similar to that of Theorem 3.4 and is omitted. All block repetition codes discussed above are codes with the same length of the block. Now we are going to discuss a block repetition code with different block length. Let n n  m n }| { z }| { z }| { z }| { z G = 11 · · · 1 pp · · · p 2p2p · · · 2p · · · (p − 1)p · · · (p − 1)p . Then the wt(p(1p2p · · · (p − 1)p)) = wt(p0 · · · 0) and hence wtH (C) = m and wtL (C) =  mp. Therefore the code generated by G is a m + (p − 1)n, p2 , m, pm linear code over Zp2 . m+(p−1)n Theorem 3.6. m + (p2 − p − 1)n ≤ rL (BRp2 m ) ≤ m + (p2 − p)n. (p−1)n z }| { z }| { m+(p−1)n m+(p−1)n , then we have dL (x, BRp2 Proof. Let x = 00...0 11 · · · 1 ∈ Zp2 ) = m + (p2 − m+(p−1)n p − 1)n. Hence by definition, rL (BRp2 m+(p−1)n its Gray image φ(BRp2 ) ≥ m + (p2 − p − 1)n. On the other hand, ) is equivalent to p-ary linear code with generator matrix ! A 0 B C where  m+np  np np }| { z z }| { }| { z A= , 11 · · · 1 | 22 · · · 2 | · · · | (p − 1)(p − 1) · · · (p − 1)   m+np np np z }| { B = z }| { z }| { 11 · · · 1000 | 00 · · · 0 | · · · | 00 · · · 0  (p−1)m  and C = z }| { . 111 · · · 11 10 4 Conclusion We have computed lower and upper bounds on the covering radius of codes over Zp2 with respect to Lee distance. We also computed the covering radius of various repetition codes over Zp2 . It would be an interesting future task to find out the exact covering radii of many of these codes and generalize the results for codes over Zps . References [1] T. Aoki, P. Gaborit, M. Harada, M. Ozeki and P. Solé, On the covering radius of Z4 codes and their lattices, IEEE Trans. Inform. Theory, 45 (1999), pp. 2162 - 2168. [2] M. C. Bhandari, M. K. Gupta and A. K. Lal, On Z4 simplex codes and their gray images, Applied Algebra, Algebraic Algorithms and Error-Correcting Codes, AAECC-13, Lecture Notes in Computer Science 1719 (1999), pp. 170 - 180. [3] A. Bonnecaze, P. Solé, C. Bachoc and B. Mourrain, Type II codes over Z4 , IEEE Trans. Inform. Theory 43 (1997), pp. 969 - 976. [4] A. Bonnecaze, P. Solé and A. R. Calderbank, Quaternary quadratic residue codes and unimodular lattices, IEEE Trans. Inform. Theory 41 (1995), pp. 366 - 377. [5] C. Carlet, Z2k -linear codes, IEEE Trans. Inform. Theory, 44 (1998), pp. 1543 - 1547. [6] G. D. Cohen, M. G. Karpovsky, H. F. Mattson and J. R. Schatz, Covering radiusSurvey and recent results, IEEE Trans. Inform. Theory, 31 (1985), pp. 328 - 343. [7] C. J. Colbourn and M. K. Gupta, On quaternary MacDonald codes, Proc. Information Technology:Coding and Computing (ITCC), April (2003), pp. 212 - 215. [8] I. Constantinescu, W. Heise and T. Honold, Monomial extensions of isometrics between codes over Zm , Proc. Workshop ACCT96, Sozopol, Bulgaria, (1996), pp. 98 - 104. [9] S. T. Dougherty, T. A. Gulliver and M. Harada, Type II codes over finite rings and even unimodular lattices, J. Alg. Combin., 9 (1999), pp. 233 - 250. [10] S. T. Dougherty, M. Harada and P. Solé, Self-dual codes over rings and the Chinese Remainder Theorem, Hokkaido Math. J., 28 (1999), pp. 253 - 283. [11] S. T. Dougherty, M. Harada and P. Solé, Shadow codes over Z4 , Finite Fields and Their Appl.,7 (2001), pp. 507 - 529. 11 [12] C. Durairajan, On Covering Codes and Covering Radius of Some Optimal Codes, Ph.D. Thesis, Department of Mathematics, IIT Kanpur 1996. [13] T. A. Gulliver and M. Harada, Double circulant self dual codes over Z2k , 44(1998), pp. 3105 - 3123. [14] A. R. Hammons, P. V. Kumar, A. R. Calderbank, N. J. A. Sloane and P. Solé, A linear construction for certain Kerdock and Preparata codes, Bull Amer. Math. Soc. 29 (1993), pp. 218 - 222. [15] A. R. Hammons, P. V. Kumar, A. R. Calderbank, N. J. A. Sloane and P. Solé, The Z4 -linearity of Kerdock, Preparata, Goethals, and related codes, IEEE Trans. Inform. Theory, 40 (1994), pp. 301 - 319. [16] M. Harada, New extremal Type II codes over Z4 , Designs, Codes and Cryptography. 13 (1998), pp. 271 - 284. [17] M. K. Gupta and C. Durairajan, On the covering radius of some modular codes, Advances in Mathematics of Communications, 8 (2014), pp. 129 - 137. [18] V. Pless and C. W. Huffman, (Eds.) The Handbook of Coding Theory, North-Holland, New York, 1998. [19] V. V. Vazirani, H. Saran and B. SundarRajan, An efficient algorithm for constructing minimal trellises for codes over finite abelian groups, IEEE Trans. Inform. Theory, 42 (1996), pp. 1839 - 1854. [20] B. Yildiz and Odemis Ozger, A generalization of the Lee weight to Zpk , TWMS Journal of Applied and Engineering Mathematics, 2 (2012), pp. 145 - 153. 12
7cs.IT
ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS arXiv:1605.01742v2 [math.GR] 13 Jun 2017 JAIRO BOCHI, RAFAEL POTRIE, AND ANDRÉS SAMBARINO Abstract. We provide a link between Anosov representations introduced by Labourie and dominated splitting of linear cocycles. This allows us to obtain equivalent characterizations for Anosov representations and to recover recent results due to Guéritaud–Guichard–Kassel–Wienhard [GGKW] and Kapovich– Leeb–Porti [KLP2 ] by different methods. We also give characterizations in terms of multicones and cone-types inspired in the work of Avila–Bochi–Yoccoz [ABY] and Bochi–Gourmelon [BG]. Finally we provide a new proof of the higher rank Morse Lemma of Kapovich–Leeb–Porti [KLP2 ]. Contents 1. 2. 3. 4. 5. 6. 7. Introduction Dominated splittings Domination implies word-hyperbolicity Anosov representations and dominated representations Characterizing dominated representations in terms of multicones Analytic variation of limit maps Geometric consequences of Theorem 2.2: A Morse Lemma for PSLpd, Rq’s symmetric space 8. When the target group is a semi-simple Lie group Appendix A. Auxiliary technical results References 1 3 7 17 23 28 30 42 52 62 1. Introduction The aim of this paper is to expose and exploit connections between the following two areas: 1. linear representations of discrete groups; 2. differentiable dynamical systems. More specifically, we show that Anosov representations are closely related to dominated splittings. This relation allows us to reobtain some results about Anosov representations, and to give new characterizations of them. Date: June, 2017 (this version). 2010 Mathematics Subject Classification. 22E40 (primary); 20F67, 37B15, 37D30, 53C35, 53D25 (secondary). J. B. was partially supported by projects Fondecyt 1140202, Anillo ACT1103, and REDES 140138. R. P. was partially supported by CSIC grupo 618. A. S. was partially supported by IFUM and CSIC group 618. 1 2 J. BOCHI, R. POTRIE, AND A. SAMBARINO Anosov representations where introduced by Labourie [Lab] in his study of the Hitchin component ([Hit]). They provide a stable class of discrete faithful representations of word-hyperbolic groups into semi-simple Lie groups, that unifies examples of varying nature. Since then, Anosov representations have become a main object of study, being subject of various deep results (see for example [GW], the surveys [BCS, Wie] and references therein). Recently, new characterizations of Anosov representations have been found by [GGKW, KLP1 , KLP2 , KLP3 ], these characterizations considerably simplify the definition. It is now fairly accepted in the community that Anosov representations are a good generalization of convex co-compact groups to higher rank. In differentiable dynamical systems, the notion of hyperbolicity, as introduced by Anosov and Smale [Sma] plays a central role. Early on, it was noted that weaker forms of hyperbolicity (partial, nonuniform, etc.) should also be studied: see [BDV] for a detailed account. One of these is the the notion of dominated splittings, which can be thought as a projective version of hyperbolicity: see Section 2. As mentioned above, in this paper we benefit from the viewpoint of differentiable dynamics in the study of linear representations. For example, it turns out that a linear representation is Anosov if and only if its associated linear flow has a dominated splitting: see Subsection 4.3 for the precise statements. Let us summarize the contents of this paper. In Section 2 we describe the basic facts about dominated splittings that will be used in the rest of the paper. We present the characterization of dominated splittings given by [BG, Theorem A]. We rely on this theorem in different contexts throughout the paper. In Section 3 we introduce dominated representations ρ of a given finitely generated group Γ into GLpd, Rq. The definition is simple: we require the gap between some consecutive singular values to be exponentially large with respect to the word length of the group element, that is, σp`1 pρpγqq ă Ce´λ|γ| for all γ P Γ, σp pρpγqq for some constants p P t1, . . . , d ´ 1u, C ą 0, and λ ą 0. We show that the existence of dominated representations implies that the group Γ is word-hyperbolic: see Theorem 3.2. Word-hyperbolicity allows us to consider Anosov representations, and in Section 4 we show that they are exactly the same as dominated representations. Many of the results in Sections 3 and 4 are not new, appearing in the recent works of [GGKW] and [KLP1 , KLP2 , KLP3 ] with different terminology. Our proofs are different and make use of the formalism of linear cocycles and most importantly of non-trivial properties of dominated splittings. At the end of Section 4 we pose a few questions where the connection with differentiable dynamics is manifest. In Section 5 we give yet another equivalent condition for a representation to be Anosov, which uses the sofic subshift generated by the cone-types instead of the geodesic flow of the group: see Theorem 5.9. This condition is very much inspired in [ABY, BG] and provides nice ways to understand the variation of the limit maps, as well as a quite direct method to check if a representation is dominated. This criterion is used in Section 6 to reobtain a basic result from [BCLS] on the analyticity of the limit maps for Anosov representations: see Theorem 6.1. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 3 Section 7 shows how [BG, Theorem A] implies a Morse Lemma-type statement for the symmetric space of PSLpd, Rq. That result is contained in the recent work of [KLP2 ], but we provide here a different approach. This section only relies on Section 2. In Section 8 we replace GLpd, Rq with a real-algebraic non-compact semi-simple Lie group. Representation theory of such groups allows one to reduce most of the general statements to the corresponding ones in GLpd, Rq by a fairly standard procedure. Nevertheless, more work is needed to obtain a Morse Lemma for symmetric spaces of non-compact type; this occupies most of Section 8. The sections are largely independent; dependence is indicated in Fig. 1. 2 3.1 3.2 to 3.7 4 7 5 8 6 Figure 1. Dependence between sections. The results of this paper were announced at [EHY]. Acknowledgements. We thank Matı́as Carrasco, Olivier Guichard, Fanny Kassel, and Jean-François Quint for many interesting discussions. We are greatly indebted to the referee and to O. Guichard for several important corrections, including pointing to a faulty proof. Jairo Bochi acknowledges the kind hospitality of Universidad de la República. 2. Dominated splittings In the 1970’s, Mañé introduced the notion of dominated splittings, which played an important role in his solution of Smale’s Stability Conjecture: see [Sam] and references therein. Independently, dominated splittings had been studied in the theory of Ordinary Differential Equations by the Russian school at least since the 1960s, where it is called exponential separation: see [Pa] and references therein. Dominated splittings continue to be an important subject in Dynamical Systems [CP, Sam] and Control Theory [CK]. 2.1. Definition and basic properties of dominated splittings. Let X be a compact metric space. Let T be either Z or R. Consider a continuous action of T on X, that is, a continuous family of homeomorphisms tφt : X Ñ XutPT such that φt`s “ φt ˝ φs . We call tφt u a continuous flow. Let E be a real vector bundle with projection map π : E Ñ X and fibers Ex :“ π ´1 pxq of constant dimension d. We endow E with a Riemannian metric (that is, a continuous choice of an inner product on each fiber). Suppose tψ t : E Ñ EutPT is a continuous action of T on E by automorphisms of the vector bundle that covers tφt u, that is, π ˝ ψ t “ φt ˝ π. So the restriction of ψ t to each fiber Ex is a linear 4 J. BOCHI, R. POTRIE, AND A. SAMBARINO automorphism ψxt onto Eφt pxq . We say that tψ t u is a linear flow which fibers over the continuous flow tφt u. The simplest situation is when T “ Z and the vector bundle is trivial, i.e., E “ X ˆ Rd and πpx, vq “ x; in that case the linear flow tψ t u is called a linear cocycle, and in order to describe it is sufficient to specify the maps φ “ φ1 : X Ñ X and A : X Ñ GLpd, Rq such that ψ 1 px, vq “ pφpxq, Apxqvq. With some abuse of terminology, we sometimes call the pair pφ, Aq a linear cocycle. Suppose that the vector bundle E splits as a direct sum E cu ‘ E cs of continuous1 subbundles of constant dimensions.2 This splitting is called invariant under the linear flow tψ t u if for all x P X and t P T, ψ t pExcu q “ Eφcut pxq , ψ t pExcs q “ Eφcst pxq . Such a splitting is called dominated (with E cu dominating E cs ) if there are constants C ą 0, λ ą 0 such that for all x P X, t ą 0, and unit vectors v P Excs , w P Excu we have: }ψ t pvq} ă Ce´λt . (2.1) }ψ t pwq} Note that this condition is independent of the choice of the Riemannian metric for the bundle. It is actually equivalent to the following condition (see [CK, p. 156]): for all x P X and all unit vectors v P Excs , w P Excu we have: }ψ t pvq} “ 0. tÑ`8 }ψ t pwq} lim (2.2) The bundles of a dominated splitting are unique given their dimensions; more generally: Proposition 2.1. Suppose a linear flow tψ t u has dominated splittings E cu ‘ E cs and F cu ‘ F cs , with E cu (resp. F cu ) dominating E cs (resp. F cs ). If dim E cu ď dim F cs then E cu Ă F cs and E cs Ą E cu . See e.g. [CP] for a proof of this and other properties of dominated splittings. One can also define domination for invariant splittings into more than two bundles. This leads to the concept of finest dominated splitting, whose uniqueness is basically a consequence of Proposition 2.1; see [BDP, CP]. The existence of a dominated splitting can be characterized in terms of cone fields: see e.g. [CP]; we will use these ideas later in Section 5. 2.2. Domination in terms of singular values. Another indirect way to detect the existence of a dominated splitting can be formulated in terms of the “nonconformality” of the linear maps. Results of this kind were obtained in [Yo, Len] for dimension 2, and later in [BG] in more generality.3 Let us explain this characterization. If A is a linear map between two inner product vector spaces of dimension d, then its singular values σ1 pAq ě σ2 pAq ě ¨ ¨ ¨ ě σd pAq 1In fact, continuity of the bundles follows from condition (2.1): see eg. [CP]. 2cu and cs stand for center-unstable and center-stable, respectively. This terminology is usual in differentiable dynamics. 3For a recent generalization to Banach spaces, see [BM]. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 5 ? are the eigenvalues of the positive semidefinite operator A˚ A, repeated according to multiplicity. They equal the semiaxes of the ellipsoid obtained as the A-image of the unit ball; this is easily seen using the singular value decomposition [HJ, § 7.3]. If p P t1, . . . , d ´ 1u and σp pAq ą σp`1 pAq, then we say that A has a gap of index p. In that case, we denote by Up pAq the p-dimensional subspace containing the p biggest ? axes of the ellipsoid tAv : }v} “ 1u. Equivalently, Up pAq is the eigenspace of AA˚ corresponding to the p larger eigenvalues. We also define Sd´p pAq :“ Ud´p pA´1 q. Note that Sd´p pAqK “ A´1 pUp pAqq and Up pAqK “ ApSd´p pAqq. See Fig. 2. Sd´p pAq A Up pAq Figure 2. Spaces associated to a linear map A. The following theorem asserts that the existence of a dominated splitting can be detected in terms of singular values, and also describes the invariant subbundles in these terms: Theorem 2.2 (Bochi–Gourmelon [BG]). Let T “ Z or R. Let tψ t utPT be a linear flow on a vector bundle E, fibering over a continuous flow tφt utPT on a compact metric space X. Then the linear flow tψ t u has a dominated splitting E cu ‘ E cs where the dominating bundle E cu has dimension p if and only if there exist c ą 0, λ ą 0 such that for every x P X and t ě 0 we have σp`1 pψxt q ă ce´λt . σp pψxt q Moreover, the bundles are given by: ` ˘ Excu “ lim Up ψφt ´t pxq , tÑ`8 ` ˘ Excs “ lim Sd´p ψxt , tÑ`8 (2.3) (2.4) and these limits are uniform. (To make sense of the limits above it is necessary to metrize the Grassmann bundle associated to E; the particular way of doing so is irrelevant for the statement.) In the paper [BG], the power of the Multiplicative Ergodic Theorem of Oseledets is used to basically reduce the proof of Theorem 2.2 to some angle estimates. Since we will explicitly need such estimates in other parts of this paper, we will also present a sketch of the proof of Theorem 2.2 in § A.4. Remark 2.3. Consider the case of complex vector spaces, bundles, etc. Dominated splittings can be defined analogously; so can singular values and the subspaces Up , Sd´p . Theorem 2.2 also extends to the complex case; indeed it can be deduced from the real case. 6 J. BOCHI, R. POTRIE, AND A. SAMBARINO 2.3. Domination for sequences of matrices. Next, we describe some consequences of Theorem 2.2 for sequences of d ˆ d matrices.4 Given K ą 1, define the following compact set: ( DpKq :“ A P GLpd, Rq, }A} ď K, }A´1 } ď K . If I is a (possibly infinite) interval in Z, we endow DpKqI with the product topology, which is compact and is induced e.g. by the following metric: ÿ ` ˘ ´1 2´|n| }An ´ Bn } ` }A´1 dppAn q, pBn qq :“ n ´ Bn } . nPI Let p P t1, . . . , d ´ 1u, µ ą 0, c ą 0. For each interval I Ă Z, let DpK, p, µ, c, Iq denote the set of sequences of matrices pAn q P DpKqI such that for all m, n P I with m ě n we have σp`1 pAm ¨ ¨ ¨ An`1 An q ď ce´µpm´n`1q . σp Let us consider the case I “ Z. Let ϑ denote the shift map on the space DpK, p, µ, c, Zq, and let A : DpK, p, µ, c, Zq Ñ GLpd, Rq denote the projection on the zeroth coordinate. The pair pϑ, Aq determines a linear cocycle (in the sense explained in § 2.1). Note that the hypothesis of Theorem 2.2 is automatically satisfied. So we obtain:5 Proposition 2.4. Fix constants K ą 1, p P t1, . . . , d ´ 1u, µ ą 0, c ą 0. Then, for each sequence x “ pAn q P DpK, p, µ, c, Zq, the limits: ` ˘ E cu pxq :“ lim Up A´1 A´2 ¨ ¨ ¨ A´n , nÑ`8 ` ˘ E cs pxq :“ lim Sd´p An´1 An´2 ¨ ¨ ¨ A0 , nÑ`8 exist and are uniform over DpK, p, µ, c, Zq. Moreover, E cu ‘ E cs is a dominated splitting for the linear cocycle pϑ, Aq defined above. By a compactness argument, the theorem above yields information for finite sequences of matrices: Lemma 2.5. Given K ą 1, µ ą 0, and c ą 0, there exist `1 P N and δ ą 0 with the following properties. Suppose that I Ă Z is an interval and pAi qiPI is an element of DpK, p, µ, c, Iq. If n ă k ă m all belong to I and mintk ´ n, m ´ ku ą `1 then: ` ˘ > Up pAk´1 ¨ ¨ ¨ An`1 An q, Sd´p pAm´1 ¨ ¨ ¨ Ak`1 Ak q ą δ . Proof. The proof is by contradiction. Assume that there exist numbers K ą 1, µ ą 0, c ą 0, and sequences `j Ñ 8, δj Ñ 0 such that for each j there exist an ` pjq ˘ interval Ij Ă Z, an element Ai iPIj of DpK, p, µ, c, Ij q, and integers nj ă kj ă mj in Ij such that mintkj ´ nj , mj ´ kj u ą `j and ` pjq pjq pjq ˘ > Up pAkj ´1 ¨ ¨ ¨ Apjq nj q, Sd´p pAmj ´1 ¨ ¨ ¨ Akj q ď δj . Shifting indices, we can assume that kj “ 0 for every j. By a diagonal argument, pjq passing to subsequences we can assume that for each i P Z, the matrices Ai 4We note that similar sequences have been considered in [GGKW], namely sequences that have what they call coarsely linear increments (CLI) in certain Cartan projections. 5For a similar statement with different notation and not relying on Theorem 2.2, see [GGKW, Theorem 5.3]. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 7 (which are defined for sufficiently large j) converge to some matrix Ai as j Ñ 8. The resulting sequence x “ pAi qiPZ belongs to DpK, p, µ, c, Zq. If E cu pxq and E cs pxq are the limit spaces as in Proposition 2.4, then their angle is zero, which contradicts domination.  3. Domination implies word-hyperbolicity In this section, we define dominated linear representations of a finitely generated group, and prove that groups that admit such representations are word-hyperbolic. 3.1. Dominated representations and the word-hyperbolicity theorem. Let Γ be a finitely generated group. Let us fix a symmetric generating set S of Γ. We denote by |γ| the word-length of γ P Γ, i.e. the minimum number of elements of S required to obtain γ as a product of elements of S. The word-metric is defined as: dpγ, ηq :“ |η ´1 γ| . (3.1) Then the action of Γ into itself by left multiplication is isometric. Recall that the group Γ is called word-hyperbolic if it is a Gromov-hyperbolic metric space when endowed with the word-metric (3.1); this does not depend on the choice of the generating set S; see [Gr, CDP, GH, BH]. A representation ρ : Γ Ñ GLpd, Rq is p-dominated if there exist constants C, λ ą 0 such that: σp`1 pρpγqq ď Ce´λ|γ| for all γ P Γ. (3.2) σp pρpγqq It is easy to see that the definition does not depend on the choice of S though the constants C and λ may change. Remark 3.1. Since σi pAq “ σd`1´i pA´1 q´1 for each i, the property |γ ´1 | “ |γ| implies that if a representation ρ is p-dominated, then it is also pd ´ pq-dominated. The purpose of this section is to show: Theorem 3.2. If a group Γ admits a p-dominated representation into GLpd, Rq then Γ is word-hyperbolic. Theorem 3.2 follows from a more general result recently obtained by Kapovich, Leeb, and Porti [KLP2 , Theorem 1.4]. Their result concerns not only dominated representations, but quasi-isometric embeddings of metric spaces satisfying a condition related to domination. Here we use the results from Section 2 to give a direct and more elementary proof. Let us mention that a related but different notion of domination was recently studied by other authors [DT, GKW]. Remark 3.3 (Representations to SLpd, Rq). Given a representation with target group GLpd, Rq, we can always assume that it has its image contained in matrices with determinant ˘1 by composing with the homomorphism A ÞÑ | det A|´1{d A, which does not affect p-domination. Remark 3.4 (Representations to PGLpd, Rq). We can define p-dominated representations on PGLpd, Rq in exactly the same way, since the quotients σp`1 {σp are well-defined in the latter group. Obviously, composing any p-dominated representation on GLpd, Rq with the quotient map π : GLpd, Rq Ñ PGLpd, Rq we obtain 8 J. BOCHI, R. POTRIE, AND A. SAMBARINO a p-dominated representation. Conversely, given any p-dominated representation ρ : Γ Ñ PGLpd, Rq, we can find a group Γ̂, a 2-to-1 homomorphism f : Γ̂ Ñ Γ, and a p-dominated representation ρ̂ : Γ̂ Ñ GLpd, Rq (with determinants ˘1) such that π ˝ ρ̂ “ f ˝ ρ. Theorem 3.2 yields that Γ̂ is word-hyperbolic, and it follows (see [GH, p. 63]) that Γ is word-hyperbolic as well. Remark 3.5 (General semi-simple Lie groups). Using exterior powers, any p-dominated representation on GLpd, Rq induces a 1-dominated representation in GLpk, Rq ` ˘ for k “ dp . In Subsection 8.5 we shall see that every representation ρ : Γ Ñ G, where G is an arbitrary (real-algebraic non-compact) semi-simple Lie group, can be reduced to the case of PGLpd, Rq for some d via a similar construction. Remark 3.6. Given Theorem 3.2, one may wonder whether every hyperbolic group admits a dominated representation. This is far from true, since there exist hyperbolic groups that are nonlinear, i.e. every linear representation of these groups factors through a finite group: see [Kap, Section 8]. On the other hand, one can ask if every linear hyperbolic group admits a dominated representation. 3.2. Criterion for hyperbolicity. In order to show word-hyperbolicity the following sufficient condition will be used: Theorem 3.7 (Bowditch [Bow]). Let Γ be a group which acts by homeomorphisms in a perfect compact metrizable topological space M such that the diagonal action of Γ on the (nonempty) space ( M p3q :“ px1 , x2 , x3 q P M 3 : xi ‰ xj if i ‰ j is properly discontinuous and cocompact. Then Γ is word-hyperbolic. We recall that a continuous action of Γ in a topological space X is: ‚ properly discontinuous if given any compact subset K Ă X there exists n such that if |γ| ą n then γK X K “ H; ‚ cocompact if there exists a compact subset K Ă X such that Γx X K ‰ H for every x P X. Remark 3.8. Theorem 3.7 also gives that the set M is equivariantly homeomorphic to BΓ. Here BΓ denotes the visual boundary of the group Γ, defined as the set of equivalence classes of quasi-geodesic rays (i.e. quasi-geodesic maps from N to Γ) by the equivalence of being at finite Hausdorff distance from each other; see for example [GH, Chapitre 7] or [CDP, Chapitre 2]). The topology in BΓ is given by pointwise convergence of the quasi-geodesic rays with same constants and starting at the same point. In Section 6 we will also comment on the metric structure on the boundary. A group is called elementary if it is finite or virtually cyclic; elementary groups are trivially word-hyperbolic. The converse of Theorem 3.7 applies to non-elementary word-hyperbolic groups. In the proof of Theorem 3.2 we must separate the case where the group is elementary, since elementary groups may admit dominated representations while Theorem 3.7 does not apply to them. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 9 3.3. Some preliminary lemmas for p-dominated representations. The Grassmannian Gp pRd q is the set of all p-dimensional subspaces of Rd . As we explain in detail in the Appendix A, the following formula defines a metric on the Grassmannian: dpP, Qq :“ cos >pP K , Qq ; here K denotes orthogonal complement, and > denotes the smallest angle between pairs of vectors in the respective spaces. Appendix A also contains a number of quantitative linear-algebraic estimates that we use in this section. In particular, in Appendix A there are precise statements and proofs of the following results we will use: ‚ Lemmas A.4 and A.5 estimate the distance of Up pAq with Up pABq and BUp pAq with Up pBAq with respect to the norms of B ˘1 and the gap on the singular values of A. Lemma A.12 is a reinterpretation of these facts in terms of dominated sequences of matrices. ‚ Lemma A.6 shows that if there is a large gap between p-th and p ` 1-the singular values of A then AP will be close to Up pAq for every P which makes a given angle with Sd´p pAq. ‚ Lemma A.10 estimates the dilatation of the action of A in Gp pRd q for subspaces far from the subspace which is mapped to Up pAq. ‚ Corollary A.14 is a consequence of classical properties of dominated splittings in the context of sequences of matrices in DpK, p, µ, c, Nq. Throughout the rest of this section, let ρ : Γ Ñ GLpd, Rq a p-dominated representation with constants C ě 1, λ ą 0 (c.f. relation (3.2)). Let: K :“ max }ρpgq} ě 1 , gPS (3.3) where S is the finite symmetric generating set of Γ fixed before. Also fix `0 P N such that: Ce´λ`0 ă 1 , (3.4) and, in particular (recalling the notation introduced in § 2.2), the spaces Up pρpγqq P Gp pRd q and Sd´p pρpγqq P Gd´p pRd q are well-defined whenever |γ| ě `0 . Suppose that γ, η are large elements in Γ such that the spaces Up pρpγqq and Up pρpηqq are not too close; then the next two lemmas respectively assert that dpγ, ηq is comparable to |γ| ` |η|, and that Up pρpγqq and Sd´p pρpη ´1 qq are transverse. Lemma 3.9. There exist constants ν P p0, 1q, c0 ą 0, c1 ą 0 with the following properties. If γ, η P Γ are such that |γ|, |η| ě `0 (where `0 is as in (3.4)) then: ˇ ` ˘ˇ dpγ, ηq ě νp|γ| ` |η|q ´ c0 ´ c1 ˇlog d Up pρpγqq, Up pρpηqq ˇ . Proof. Consider two elements γ, η P Γ with word-length at least `0 . Assume |γ| ď |η|, the other case being analogous. Applying Lemma A.4 to A “ ρpηq and B “ ρpη ´1 γq, and using (3.2) and (3.3), we obtain: ` ˘ ´1 d Up pρpηqq, Up pρpγqq ď K 2|η γ| Ce´λ|η| , (3.5) or equivalently, dpγ, ηq “ |η ´1 γ| ě ˇ ` ˘ˇ λ|η| ´ log C ´ ˇlog d Up pρpηqq, Up pρpγqq ˇ . 2 log K Using that |η| ě p|γ| ` |η|q{2, we obtain the lemma.  10 J. BOCHI, R. POTRIE, AND A. SAMBARINO Lemma 3.10. For every ε ą 0 there exist `1 ě `0 and δ P p0, π2 q with the following properties: If γ, η P Γ are such that: (i) |γ|, |η| ą `1 , and ` ˘ (ii) the distance d Up pρpγqq, Up pρpηqq ą ε, ` ˘ then it follows that > Up pρpγqq, Sd´p pρpη ´1 qq ą δ. Proof. Consider two elements γ, η P Γ with word-length at least `0 . Let ε ą 0, and suppose the hypothesis (ii) is satisfied. Write γ “ g1 ¨ ¨ ¨ gn with each gi in the symmetric generating set of Γ in such a way that n is minimal, that is, n “ |γ|. Similarly, write η “ h1 ¨ ¨ ¨ hm with each hi in the symmetric generating set of Γ in such a way that |η| “ m. Let γi :“ g1 ¨ ¨ ¨ gi and ηi :“ h1 ¨ ¨ ¨ hi . Note that for j ą i we have dpγi , γj q “ |γi´1 γj | “ |gi`1 ¨ ¨ ¨ gj | “ j ´ i so that the sequence tγi u is a geodesic from id to γ. The same holds for tηi u (but note that tηi´1 u is not necessarily a geodesic). By the domination condition (3.2) and Lemma A.12, we can find `˚ “ `˚ pεq ą `0 such that if n ě i ą `˚ then dpUp pρpγi qq, Up pρpγqqq ă ε{3 , and analogously, if m ě j ą `˚ then dpUp pρpηj qq, Up pρpηqqq ă ε{3. In particular, if both conditions hold then hypothesis (ii) implies that dpUp pρpγi qq, Up pρpηj qq ą ε{3. (3.6) Let ν P p0, 1q, c0 , c1 be given by Lemma 3.9. Let c :“ maxt2`˚ , c0 ` c1 logp3{εqu. We claim that dpγi , ηj q “ |ηj´1 γi | ě νpi ` jq ´ c for all i P t1, . . . , nu, j P t1, . . . , mu. (3.7) To prove this, consider first the case when j ď `˚ . Then dpγi , ηj q ě dpγi , idq ´ dpηj , idq “ i ´ j ě i ` j ´ 2`˚ ě νpi ` jq ´ c , as claimed. The case i ď `˚ is dealt with analogously. The remaining case where i and j are both bigger than `˚ follows from Lemma 3.9 and property (3.6). This proves (3.7). As a consequence of (3.2) and (3.7), we obtain: σp`1 ´1 pηj γi q ď Ĉe´µpi`jq for all i P t1, . . . , nu, j P t1, . . . , mu, (3.8) σp where Ĉ :“ Ceλc and µ :“ λν. Now consider the following sequence of matrices: ` ˘ ` ˘ ´1 ´1 A´n , . . . , A´1 , A0 , A1 , . . . , Am´1 :“ ρpgn q, . . . , ρpg1 q, ρph´1 1 q, ρph2 q, . . . , ρphm q . So A´1 A´2 ¨ ¨ ¨ A´i “ ρpγi q and Aj´1 Aj´2 ¨ ¨ ¨ A0 “ ρpηj´1 q. It follows from (3.2) and (3.8), together with the facts that Ĉ ą C and µ ă λ, that the sequence of matrices defined above belongs to the set DpK, p, µ, Ĉ, Iq, where I :“ t´n, . . . , m ´ 1u and K is defined by equation (3.3). Now let `1 and δ be given by Lemma 2.5. Then ` ˘ > Up pA´1 ¨ ¨ ¨ A´n q, Sd´p pAm´1 ¨ ¨ ¨ A0 q ą δ , provided that |γ| “ n and |η| “ m are both bigger than `1 . This concludes the proof.  ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 11 3.4. Candidate for boundary of Γ. In this subsection we define a candidate for the role of M in Theorem 3.7 using the domination of the representation and show some of the topological properties of M required for applying Theorem 3.7. The set we shall consider is the following: č M :“ tUp pρpγqq : |γ| ě nu Ă Gp pRd q , (3.9) ně`0 where `0 is as in (3.4). This set has been considered before and named limit set by Benoist (see [Be, Section 6]) in the Zariski dense context and extended in [GGKW, Definition 5.1] to a more general setting. The first properties to be established about M are the following ones: Proposition 3.11. The set M is compact, non-empty, and ρpΓq-invariant. Proof. The fact that M is compact and non-empty follows at once since it is a decreasing intersection of non-empty closed subsets of the compact space Gp pRd q. Let us show that M is ρpΓq-invariant. Fix η P Γ and P P M . Choose a sequence pγn q in Γ such that |γn | Ñ 8 and Up pρpγn qq Ñ P . Note that the spaces Up pρpηγn qq are defined for large enough n (namely, whenever |γn | ě `0 ` |η|); moreover, by Lemma A.5 and the domination condition (3.2), we have: ` ˘ d ρpηqUp pρpγn qq, Up pρpηγn qq ď }ρpηq} }ρpηq´1 } C e´λ|γn | Ñ 0 as n Ñ 8. This shows that Up pρpηγn qq Ñ ρpηqP as n Ñ 8, and in particular ρpηqP P M , as we wished to prove.  If one manages to show that M p3q is non-empty then one of the assumptions of Theorem 3.7 is satisfied: Lemma 3.12. If the set M has at least 3 points then it is perfect. We first show the following lemma: Lemma 3.13. Given ε ą 0, ε1 ą 0, there exists ` ą `0 (where `0 is as in (3.4)) with the following properties: If η P Γ is such that |η| ą ` and P P M is such that ` ˘ d P, Up pρpη ´1 qq ą ε , then ` ˘ d ρpηqP, Up pρpηqq ă ε1 . Proof. Let `1 ě `0 and δ ą 0 be given by Lemma 3.10, depending on ε. Let ` ą `1 be such that Ce´λ` ă pε1 sin δq{2, where C and λ are the domination constants, ` ˘ as in (3.2). Now fix η P Γ and P P M such that |η| ą ` and d P, Up pρpη ´1 qq ą ε. Choose a sequence pγn q in Γ such that |γn | Ñ 8 and Up pρpγn qq Ñ P . Without loss of generality, we can assume that for each n we have |γn | ą `1 and ` ˘ d Up pρpγn qq, Up pρpη ´1 qq ą ε. It follows from Lemma 3.10 that ` ˘ > Up pρpγn qq, Sd´p pρpηqq ą δ. Using Lemma A.6 and the domination condition (3.2), we obtain: ´ ¯ ` ˘ ` ˘ 1 ε1 σ d ρpηq Up pρpγn qq , Up pρpηqq ă σp`1 ρpηq ă . p sin δ 2 ` ˘ Letting n Ñ 8 yields d ρpηqP , Up pρpηqq ď ε1 {2.  12 J. BOCHI, R. POTRIE, AND A. SAMBARINO Proof of Lemma 3.12. Let P1 , P2 , P3 be three distinct points in M , and let ε1 ą 0. We will show that the 2ε1 -neighborhood of P1 contains another element of M . Let ε :“ 21 mini‰j dpPi , Pj q. Let ` ą `0 be given ` by Lemma˘ 3.13, depending on ε and ε1 . Choose η P Γ such that |η| ą ` and d Up pρpηqq, P1 ă ε1 . Consider the space Up pρpη ´1 qq; it can be ε-close to at most one of the spaces P1 , P2 , P3 . In other words, there are different indices i1 , i2 P t1, 2, 3u such that for each j P t1, 2u we have: ` ˘ d Pij , Up pρpη ´1 qq ą ε In particular, by Lemma 3.13, ` ˘ ` ˘ d ρpηqPij , P1 ď d ρpηqPij , Up pρpηqq ` ε1 ă 2ε1 . By Proposition 3.11, the spaces ρpηqPi1 and ρpηqPi2 belong to M . Since at most one of these can be equal to P1 , we conclude that the 2ε1 -neighborhood of P1 contains another element of M , as we wished to prove.  So we would like to ensure that M has at least 3 points (provided Γ is nonelementary). This requires some preliminaries. First, we show the following estimate: Lemma 3.14. M has at least 2 elements. Proof. Using Lemma 2.5 we can find `1 P N and δ ą 0 such that if γ, η P Γ have lengths both bigger than `1 , and satisfy |ηγ| “ |η| ` |γ|, then ` ˘ > Up pρpγqq, Sd´p pρpηqq ą δ. (3.10) We already know that M is nonempty, so assume by contradiction that it is a singleton tP u.˘ Take n ą `1 such that if an element γ P Γ has length |γ| ą n then ` lengths both d Up pρpγqq, P ă 21 sin δ. Now fix arbitrary elements ` γ, η P Γ with´1 ˘ bigger than `1 such that |ηγ| “ |η| ` |γ|. Then d Up pρpγqq, Up pρpη qq ă sin δ. The space Up pρpη ´1 qq either contains or is contained in Ud´p pρpη ´1 qq “ Sd´p pρpηqq. Using the trivial bound (A.4), we contradict (3.10).  Recalling Remark 3.3, let us assume for convenience for the remainder of this subsection that | det ρpγq| “ 1 for every γ P Γ . Let jacp¨q denote the jacobian of a linear map, i.e., the product of its singular values. The next step is to prove the expansion property expressed by the following lemma: Lemma 3.15. There exists a constant ` P N such that for every γ P Γ with length |γ| ě ` there exists P P M such that jacpρpγq|P q ě 2. Proof. As a rephrasing of Lemma 3.14, there exists ε ą 0 such that for each Q P M there exists P P M such that dpP, Qq ą 2ε. Let `1 ě `0 and δ P p0, π2 q be given by Lemma 3.10, depending on ε. Let ( δ 1 :“ min 12 ε, 1 ´ cos δ . ( Let `2 ě `1 be such that the sets M and Up pρpγqq : γ P Γ, |γ| ě ` are each contained in the δ 1 -neighborhood of the other. Fix a large ` ě `2 ; how large it needs to be will be clear at the end. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 13 ` ˘ Now fix γ P Γ with length |γ| ě `. Take Q P M such that d Q, Up pρpγ ´1 qq ă δ 1 . Let ` P P M ˘be such that dpP, Qq ą 2ε. Let η P Γ be such that |η| ě ` and d P, Up pρpηqq ă δ 1 . Then ` ˘ ` ˘ ` ˘ d Up pρpηqq, Up pρpγ ´1 qq ě dpP, Qq ´ d Up pρpηqq, P ´ d Q, Up pρpγ ´1 qq ą 2ε ´ 2δ 1 ą ε. Therefore Lemma 3.10 guarantees that ` ˘ > Up pρpηqq, Sd´p pρpγqq ą δ. So, using identity (A.8), ˘ ` ˘ ` cos > P, Sd´p pρpγqq “ d P, Sd´p pρpγqqK ` ˘ ` ˘ ď d P, Up pρpηqq ` d Up pρpηqq, Sd´p pρpγqqK ` ˘ ` ˘ “ d P, Up pρpηqq ` cos > Up pρpηqq, Sd´p pρpγqq ď δ 1 ` cos δ ă 1. Write A – ρpγq for simplicity. We must estimate the jacobian of A|P . We will use some facts about exterior powers: see Subsection A.5. Let ιpP q P G1 pΛp Rd q be the image of P under the Plücker embedding, and take a nonzero w P ιpP q. Then: jacpA|P q “ }pΛp Aqw} }w} (by (A.16)) ´ ¯ (by (A.11)) ě σ1 pΛp Aq sin > w, Spdq´1 pΛp Aq p ´ ¯ ` ˘K “ σ1 pAq ¨ ¨ ¨ σp pAq sin > ιpP q, ιpSd´p pAqK q (by (A.19) and (A.22)) “ ‰mintp,d´pu ě σ1 pAq ¨ ¨ ¨ σp pAq sin >pP, Sd´p pAq (by (A.18)) The sine can be bounded from below by a positive constant. On the other hand, since the product of the singular values of A is | det A| “ 1, we have: “ ‰ d´p  ppd´pq „ d σ1 pAq ¨ ¨ ¨ σp pAq d σp pAq σ1 pAq ¨ ¨ ¨ σp pAq “ “ , ‰ pd ě σ pAq p`1 σp`1 pAq ¨ ¨ ¨ σd pAq which is exponentially large with respect to |γ| ě `. We conclude that jacpA|P q ě 2 if ` is large enough.  As a last digression, we show that virtually abelian groups cannot have a dominated representation unless they are virtually cyclic. Lemma 3.16. Let ρ : Γ Ñ GLpd, Rq be a p-dominated representation. Let Γ1 be a finite-index subgroup of Γ, and let m ě 2. Then there exists no surjective homomorphism ϕ : Γ1 Ñ Zm with finite kernel. Proof. Assume for a contradiction that Γ contains a subgroup Γ1 which admits a homomorphism ϕ onto Zm with finite kernel, where m ě 2. Let Z be the standard symmetric generating set for Zm , with cardinality 2m; then ϕ´1 pZq is a finite symmetric generating set for Γ1 . Since Γ1 is a finite-index subgroup of Γ, the inclusion Γ1 ãÑ Γ is a quasi-isometry (using e.g. the Svarc–Milnor lemma [BH, 14 J. BOCHI, R. POTRIE, AND A. SAMBARINO Proposition I.8.19]), and therefore the restriction of ρ to Γ1 is p-dominated. For simplicity of notation, we assume that Γ “ Γ1 , with generating set S “ ϕ´1 pZq. Fix the constants C, λ, K, and `0 satisfying (3.2), (3.3), and (3.4). Fix g P Γ such that ϕpgq is an element of Z, say p1, 0, . . . , 0q. Since the representation is p-dominated and pg n qnPZ is a geodesic in Γ, it follows from Lemma 2.5 that there exist `1 ą `0 and δ ą 0 such that ` ˘ > Up pρpg n qq, Sd´p pρpg n qq ą δ for all n ą `1 . The space Sd´p pρpg n qq “ Ud´p pρpg ´n qq either contains or is contained in Up pρpg ´n qq; so the trivial bound (A.4) yields: ` ˘ d Up pρpg n qq, Up pρpg ´n qq ě sin δ for all n ą `1 . (3.11) Fix n ą `1 . Since m ě 2, we can find γ0 , γ1 , . . . , γ4n P Γ with the following properties: ´1 γ0 “ g n , γ4n “ g ´n , |γi`1 γi | “ 1, |γi | ě n. Indeed, we can take a preimage under ϕ of an appropriate path in Zm , sketched in Fig. 3 for the case m “ 2. p´n, 0q pn, 0q Figure 3. A path in Z2 . Now we estimate: ÿ ` ` ˘ 4n´1 ˘ d Up pρpg n qq, Up pρpg ´n qq ď d Up pρpγi qq, Up pρpγi`1 qq i“0 ď 4n´1 ÿ ´1 K 2|γi`1 γi | C e´λ|γi | (by estimate (3.5)) i“0 ď 4nK 2 Ce´λn . Taking n large enough, we contradict (3.11). This proves the lemma.  Now we are ready to obtain the topological property of M required by Theorem 3.7. (Later we will have to check the hypotheses about the action on M p3q .) Recall that Γ is elementary if it is finite or virtually cyclic (i.e. virtually Z). Proposition 3.17. If Γ is non-elementary then the set M is perfect. Proof. By Lemma 3.12, it is enough to show that M is infinite. Recall that M is non-empty. We assume by contradiction that M is finite, say M “ tP1 , . . . , Pk u. By Proposition 3.11, the set M is ρpΓq-invariant. Consider the set Γ1 Ă Γ of those elements such that ρpγqPi “ Pi for all i. Then Γ1 is a finite-index subgroup of Γ. Consider the map ϕ : Γ1 Ñ Rk defined by: γ P Γ1 ÞÑ plog jacpρpγq|Pi qqi“1,...,k . ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 15 Invariance of the subspaces Pi implies that the jacobian is multiplicative and so ϕ is a homomorphism. By Lemma 3.15, the kernel of ϕ is finite. On the other hand, the image of ϕ is a subgroup of Rk and therefore is abelian, without torsion, and finitely generated (since so is Γ1 ); therefore this image is isomorphic to some Zm . Lemma 3.16 now yields that m “ 1, and it follows that Γ is elementary. This contradiction concludes the proof.  3.5. Proper discontinuity. Given a triple T “ pP1 , P2 , P3 q P M p3q , let us denote |T | :“ min dpPi , Pj q . (3.12) i‰j ( Note that for any δ ą 0, the set T P M p3q : |T | ě δ is a compact subset of M p3q ; conversely, every compact subset of M p3q is contained in a subset of that form. Proposition 3.18. For every δ ą 0 there exists ` P N such that if T P M p3q satisfies |T | ą δ and η P Γ satisfies |η| ą `, then we have |ρpηqT | ă δ. Proof. Given δ ą 0, let ` be given by Lemma 3.13 with ε “ ε1 consider pP1 , P2 , P3 q P M p3q such that |T | ą δ and η P Γ such that that dpUp pη ´1 q, Pi q ą δ{2` for at least two˘of the spaces P1 , P2 , P3 P`2 . Lemma 3.13˘yields d ρpηqPi , Up pρpηqq ă δ{2 for each i “ 1, 2. d ρpηqP1 , ρpηqP2 ă δ and so |ρpηqT | ă δ, as we wanted to show. “ δ{2. Now |η| ą `. Note – say, P1 and In particular,  3.6. Cocompactness. The purpose of this subsection is to prove the following proposition which will complete the proof of Theorem 3.2. Recall notation (3.12). Proposition 3.19. There exists ε ą 0 such that for every T P M p3q there exists γ P Γ such that |ρpγqT | ě ε. We need some preliminaries. Recall that a geodesic ray from the identity is a sequence pηj qjě0 such that η0 “ id, ηj “ g1 ¨ ¨ ¨ gj where each gj belongs to S (the fixed symmetric generating set of Γ), and |ηj | “ j. Then we have the following characterization of M : Lemma 3.20. For every P P M there exists a geodesic ray pηj qjě0 from the identity such that Up pρpηj qq Ñ P as j Ñ 8. Proof. Fix P P M . By definition, there exists a sequence pγi q in Γ with ni :“ |γi | Ñ 8 such that Up pρpγi qq Ñ P . We can assume that n1 ă n2 ă ¨ ¨ ¨ . Write each γi as piq piq piq a product of elements of S, say γi “ g1 g2 ¨ ¨ ¨ gni . By a diagonal argument, we piq can assume that each of the sequences pgj qi stabilizes; more precisely, for every piq j ě 1 there exists gj P S and kj such that nkj ě j and gj “ gj for every i ě kj . Consider the geodesic ray pηj q defined by ηj :“ g1 ¨ ¨ ¨ gj . Let ij :“ maxtk1 , . . . , kj u. We will prove that: ` ˘ d Up pρpηj qq, Up pρpγij qq Ñ 0 , (3.13) which has the desired property Up pρpηj qq Ñ P as a consequence. piq rjs piq piq Consider the truncated products γi :“ g1 g2 ¨ ¨ ¨ gj . Using Lemma A.4 and the fact that the representation ρ is p-dominated (or, equivalently, using ` rjs rj`1s ˘ estimate (3.5)), we see that d Up pρpγi qq, Up pρpγi qq can be bounded by a quantity exponentially small with respect to j and independent of i. Therefore ` ˘ rjs d Up pρpγi qq, Up pρpγi qq is also exponentially small with respect to j. Applying this to i “ ij , we obtain (3.13).  16 J. BOCHI, R. POTRIE, AND A. SAMBARINO Lemma 3.21 (Expansivity). There exist constants δ ą 0 and ` P N with the following properties. For every P P M there exists γ P Γ with |γ| ď ` such that if P 1 , P 2 belong to the δ-neighborhood of P in Gp pRd q then dpρpγqP 1 , ρpγqP 2 q ě 2dpP 1 , P 2 q . Proof. By compactness of M , it is sufficient to prove that for every P P M there exists γ P Γ such that if P 1 , P 2 belong to a sufficiently small neighborhood of P in Gp pRd q then dpρpγqP 1 , ρpγqP 2 q ě 2dpP 1 , P 2 q. Given P P M , by Lemma 3.20 there exists a geodesic ray pηn q such that Up pρpηn qq Ñ P . Write ηn “ g1 ¨ ¨ ¨ gn , where each gn P S. Consider the sequence of ´1 matrices pA0 , A1 , . . . q given by An :“ ρpgn´1 q By the domination condition (3.2), the sequence belongs to some Dpµ, c, K, d ´ p, Nq. Note that Sp pAn´1 . . . A0 q equals Up pρpηn qq and thererfore converges to P . Applying Corollary A.14 to the sequence of matrices, we find P̃ P Gd´p pRd q such that, for all n ě 0, ` ˘ > ρpηn´1 qP̃ , ρpηn´1 qP ě α , }ρpηn´1 q|P } ă c̃e´µ̃n , mpρpηn´1 q|P̃ q where α, c̃, µ̃ are positive constants that do not depend on P . Let b ą 0 be given by Lemma A.10, depending on α. Fix k such that bc̃´1 eµ̃k ą 2, and let γ :“ ηk´1 . Applying Lemma A.10 to A :“ ρpγq, we conclude that for all P 1 , P 2 in a sufficiently small neighborhood of P in Gp pRd q we have as we wanted to show. dpρpγqP 1 , ρpγqP 2 q ě 2dpP 1 , P 2 q ,  Proof of Proposition 3.19. Let δ and ` be given by Lemma 3.21. Let ! ` ˘ δ) ε :“ inf d ρpγqP, ρpγqP 1 : γ P Γ, |γ| ď `, P, P 1 P Gp pRd q, dpP, P 1 q ě . 2 So 0 ă ε ď δ{2. We claim that @T P M p3q Dγ P Γ such that |ρpγqT | ě mint2|T |, εu . (3.14) p3q Indeed, given T “ pP1 , P2 , P3 q P M , we can suppose that |T | ă ε, otherwise we simply take γ “ id. Permuting indices if necessary we can assume that dpP1 , P2 q “ |T |. We apply Lemma 3.21 and find γ P Γ such that the action of ρpγq on Nδ pP1 q (the δ-neighborhood of P1 ) expands distances by a factor of at least 2. Since ε ď δ{2, for each pair ti ‰ ju Ă t1, 2, 3u we have δ . 2 So dpρpγqPi , ρpγqPj q ě mint2|T |, εu, thus proving the claim (3.14). Now the proposition follows by an obvious recursive argument.  tPi , Pj u Ă Nδ pP1 q or dpPi , Pj q ě 3.7. Conclusion. Now we join the pieces and obtain the main result of this section: Proof of Theorem 3.2. Consider a p-dominated representation ρ : Γ Ñ GLpd, Rq. If Γ is an elementary group then it is word-hyperbolic and there is nothing to prove. So assume that Γ is non-elementary. Using the representation ρ, we define an action of Γ on Gp pRd q. Consider the set M Ă Gp pRd q defined by (3.9), which is perfect (by Proposition 3.17) and invariant under the action of Γ (by Proposition 3.11). ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 17 The diagonal action of Γ on M p3q is properly discontinuous (by Proposition 3.18) and cocompact (by Proposition 3.19). Therefore Theorem 3.7 assures that Γ is word-hyperbolic.  4. Anosov representations and dominated representations The main goal of this section is to show that being p-dominated (c.f. condition (3.2)) and satisfying the Anosov condition as defined by Labourie [Lab] (and extended by Guichard-Wienhard [GW] to arbitrary hyperbolic groups) are equivalent. That equivalence (among others) is contained in the results of [KLP1 , KLP2 , KLP3 ]. Our approach also yields a slightly different characterization directly related to dominated splittings (see Proposition 4.6). In the final subsection we discuss relations with characterizations of [GGKW], and pose some questions. We first introduce the notion of Anosov representations into GLpd, Rq which requires introducing the geodesic flow of a hyperbolic group. 4.1. The geodesic flow. In order to define the Anosov property for a representation of a hyperbolic group, we need to recall the Gromov geodesic flow of Γ. Given a word-hyperbolic group Γ we can define its visual boundary BΓ (c.f. Remark 3.8). Denote B p2q Γ :“ tpx, yq P BΓ ˆ BΓ : x ‰ yu. We define a flow on the space UĂΓ :“ B p2q Γ ˆ R, called the lifted geodesic flow by the formula φ̃t px, y, sq :“ px, y, s ` tq. A function c : Γ ˆ B p2q Γ Ñ R such that cpγ0 γ1 , x, yq “ cpγ0 , γ1 px, yqq ` cpγ1 , x, yq for any γ0 , γ1 P Γ and px, yq P B p2q Γ is called a cocycle. Recall that every infinite order element γ P Γ acts on BΓ leaving only two fixed points, an attractor γ ` and a repeller γ ´ . Let us say that a cocycle c is positive if cpγ, γ ´ , γ ` q ą 0 for every such γ. Given a cocycle, we can define an action of Γ on UĂΓ by γ ¨ px, y, sq “ pγ ¨ x, γ ¨ y, s ´ cpx, y, γqq, which obviously commutes with the lifted geodesic flow. Gromov [Gr] (see also [Mat, Ch, Mi]) proved that there exists a positive cocycle such that the latter action is properly discontinuous and cocompact. This allows to define the geodesic flow φt of Γ on U Γ :“ UĂΓ{Γ, the unit tangent bundle of Γ. There is a metric on UĂΓ, well-defined up to Hölder equivalence, so that Γ acts by isometries, the lifted geodesic flow acts by bi-Lipschitz homeomorphisms, and its flow lines are quasi-geodesics. Remark 4.1. If Γ “ π1 pM q is the fundamental group of a negatively curved closed manifold M then the geodesic flow on the unit tangent bundle U M is hyperbolic and equivalent to the abstract geodesic flow defined above. In that case, the unit tangent bundle of the universal cover M̃ is homeomorphic to UĂΓ by means of the Hopf parametrization. For details, see [Led]. Lemma 4.2. For any compact set K Ă UĂΓ, there exist a ą 0 and κ ą 1 such that if t P R and γ P Γ satisfy φ̃t pKq X γpKq ‰ H then κ´1 |t| ´ a ď |γ| ď κ|t| ` a . 18 J. BOCHI, R. POTRIE, AND A. SAMBARINO Proof. Take a ball Bpu0 , rq containing K. From the construction (see e.g. [Mat, Theorem IV.1 (ii)] or [Mi]) of the metric in UĂΓ one has that the map γ P Γ ÞÑ γu0 P UĂΓ is a quasi-isometry, so there exist κ ą 1, b ą 0 such that for all γ1 , γ2 P Γ we have κ´1 dpγ1 , γ2 q ´ b ď dpγ1 u0 , γ2 u0 q ď κdpγ1 , γ2 q ` b In particular, κ´1 |γ| ´ b ď dpγu0 , u0 q ď κ|γ| ` b . Now assume that t and γ satisfy φ̃t pKq X γpKq ‰ H, that is, there exist u1 , u2 P K such that φ̃t u1 “ γu2 . So6 # ď dpγu0 , u0 q ` 2r ˚ t |t| “ dpφ̃ u1 , u1 q “ dpγu2 , u1 q ě dpγu0 , u0 q ´ 2r The desired inequalities follow.  4.2. Equivariant maps and the definition of Anosov representations. Let ρ : Γ Ñ GLpd, Rq be a representation of a word-hyperbolic group Γ. The definitions here can be adapted for representations into general semisimple Lie groups and the results are equivalent. In order to be able to present our results in a more elementary manner, we have deferred the introduction of the general context to section 8. We say that the representation ρ is p-convex if there exist continuous maps ξ : BΓ Ñ Gp pRd q and θ : BΓ Ñ Gd´p pRd q such that: ‚ (transversality:) for every x ‰ y P BΓ we have ξpxq ‘ θpyq “ Rd , ‚ (equivariance:) for every γ P Γ we have ξpγ ¨ xq “ ρpγqξpxq and θpγ ¨ xq “ ρpγqθpxq. Using the representation ρ, it is possible to construct a linear flow ψ t over the geodesic flow φt of Γ as follows. Consider the lifted geodesic flow φ̃t on UĂΓ, and define a linear flow on Ẽ :“ UĂΓ ˆ Rd by: ψ̃ t ppx, y, sq, vq :“ pφ̃t px, y, sq, vq, Now consider the action of Γ on Ẽ given by: γ ¨ ppx, y, sq, vq :“ pγ ¨ px, y, sq, ρpγqvq where the action of Γ in UĂΓ is the one explained in Subsection 4.1. It follows that ψ̃ t induces in Eρ :“ Ẽ{Γ (which is a vector bundle over U Γ) a linear flow ψ t which covers φt . See Fig. 4. When the representation ρ is p-convex, by equivariance there exists a ψ t -invariant splitting of the form Eρ “ Ξ ‘ Θ; it is obtained taking the quotient of the bundles Ξ̃px, y, sq :“ ξpxq and Θ̃px, y, sq :“ θpyq with respect with the Γ-action. We say that a p-convex representation ρ is p-Anosov if the splitting Eρ “ Ξ ‘ Θ is a dominated splitting for the linear bundle automorphism ψ t , with Ξ dominating Θ. This is equivalent to the fact that the bundle HompΘ, Ξq is uniformly contracted by the flow induced by ψ t (see [BCLS]). Conversely, dominated splittings for the linear flow ψ t must be of the form Ξ ‘ Θ as above: see Propositions 4.6 and 4.9 below. 6To get exact equality in p˚q we need the construction in [Mi], for which orbits of the flow are geodesics. If instead we use [Ch] or [Mat], the orbits of the flow are quasi-geodesics, so the equality p˚q is only approximate, which is sufficient for our purpose. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS ψ̃ t Ẽ Eρ Ẽ ψt φ̃t UĂΓ 19 UΓ Eρ UĂΓ φt UΓ Figure 4. A commutative diagram. The Ó arrows are vector bundle projections. The Œ arrows are quotient maps w.r.t. the corresponding actions of Γ. The Ñ arrows are the flow actions, as indicated. Let us mention that by [GW, Theorem 1.5], if the image of the representation ρ is Zariski dense, being p-Anosov is a direct consequence of being p-convex. Remark 4.3. As before, it is possible to use exterior powers to transform a p-Anosov representation into a 1-Anosov one. The latter are called projective Anosov and are discussed in Section 8 as it is shown that any Anosov representation to an arbitrary semisimple Lie group can be transformed into a projective Anosov one. See also [BCLS, Section 2.3]. 4.3. Equivalence between the definitions. We will show that a representation ρ : Γ Ñ GLpd, Rq is p-dominated if and only if it is p-Anosov. Note that the definition of p-Anosov representation requires the group to be word-hyperbolic. On the other hand, we have shown in Section 3 that if ρ is p-dominated then the group Γ is automatically word-hyperbolic. So we can assume in what follows that Γ is word hyperbolic. Let us first show the following: Lemma 4.4. Endow Eρ with a Riemannian metric7. Then there exist constants κ ą 1, a ą 0, and C ą 1 with the following properties: (i) For every z P U Γ and t P R, there exists γ P Γ such that: κ´1 |t| ´ a ď C ´1 σp pψzt q |γ| ď κ|t| ` a ď σp pρpγqq ď Cσp pψzt q and (4.1) for every p “ 1, . . . , d ´ 1. (4.2) (ii) Conversely, for every γ P Γ there exist z P U Γ and t P R such that (4.1) and (4.2) hold. Proof. Using the covering map Ẽ Ñ Eρ , we lift the fixed Riemannian metric on Eρ , obtaining a Riemannian metric }¨}˚ on Ẽ with respect to which the action of Γ is isometric. On the other hand, since the vector bundle Ẽ is trivial, we can also endow it with the euclidian metric }¨} on the fibers. Let K Ă UĂΓ be a compact set intersecting every Γ-orbit. Then there exists CK ą 1 such that, for every v P Ẽ 7The Riemannian metric allows us to consider singular values for the linear maps ψ t . x 20 that projects on K, J. BOCHI, R. POTRIE, AND A. SAMBARINO ´1 CK }v} ď }v}˚ ď CK }v} . By Lemma A.2, a bounded change of inner product has a bounded effect on the singular values. It follows that for all z̃ P K, t P R, and γ P Γ such that φ̃t pz̃q P γpKq, 2 if z is the projection of z̃ in U Γ, inequality (4.2) holds for C “ CK . The rest of the proof of part (i) follows directly from Lemma 4.2. Now let us prove part (ii). Consider the action of Γ on the compact metric space BΓ. Fix a positive δ ă 14 diam BΓ. Claim. For every γ P Γ there exists x, y P BΓ such that dpx, yq ě δ and dpγ ´1 x, γ ´1 yq ě δ. Proof. Fix x1 , x2 P BΓ such that dpx1 , x2 q ą 3δ. We can assume that dpγ ´1 x1 , γ ´1 x2 q ă δ, because otherwise we would take px, yq :“ px1 , x2 q. It follows that there exists i P t1, 2u such that dpxi , γ ´1 x1 q and dpxi , γ ´1 x2 q are both bigger than δ. Analogously, we can assume that dpγx1 , γx2 q ă δ, because otherwise we would take px, yq :“ pγx1 , γx2 q. It follows that there exists j P t1, 2u such that dpxj , γx1 q and dpxj , γx2 q are both bigger than δ. Therefore the pair px, yq :“ pxj , γxi q has the desired properties.  Let K :“ tpx, y, 0q : x, y P BΓ, dpx, yq ě δu; this is a compact subset of UĂΓ. Therefore, letting z̃ :“ px, y, 0q and t :“ cpx, y, γq, we conclude with the same arguments as above.  Now let us prove the equivalence between p-dominated and p-Anosov representations. We first show: Proposition 4.5. Let ρ : Γ Ñ GLpd, Rq be a p-Anosov representation. Then ρ is p-dominated. Proof. Since ρ is a p-Anosov representation, Theorem 2.2 implies that there exists C, λ ą 0 such that for every z P U Γ and t ą 0 we have: σp`1 pψzt q ă Ce´λt . σp pψzt q Using part (i) of Lemma 4.4, we can find constants C 1 , λ1 ą 0 so that for every γ P Γ we have: 1 σp`1 pρpγqq ă C 1 e´λ |γ| . σp pρpγqq This means that ρ is p-dominated.  Note that the proof above only uses the fact that the linear flow ψ t has a dominated splitting, so we obtain: Proposition 4.6. If the linear flow ψ t on Eρ has a dominated splitting with dominating bundle of dimension p then ρ is p-dominated. To prove that p-domination implies the p-Anosov property, we shall first show the existence of the equivariant maps ξ, θ. This is a relatively easy consequence of what is done in Section 3 (see Remark 3.8). The equivariant maps exist under an even weaker hypothesis, as shown in [GGKW, Theorem 5.2]. We provide here a proof for completeness. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 21 Recall that a pa, bq-quasi-geodesic in Γ is a sequence tγn u so that a´1 |n ´ m| ´ b ă dpγn , γm q ă a|n ´ m| ` b . We denote by Qid pa,bq the set of pa, bq-quasi-geodesics such that γ0 “ id. Lemma 4.7. Let ρ : Γ Ñ GLpd, Rq be a representation such that for some a, b ą 0 we have: ÿ σp`1 pρpγn qq sup ÝÝÝÝÑ 0 . (4.3) σp pρpγn qq n0 Ñ8 γn PQid něn pa,bq 0 Then there exists an equivariant continuous map ξ : BΓ Ñ Gp pRd q defined by ξpxq :“ lim Up pρpγn qq, n where tγn u is any pa, bq-quasi-geodesic ray representing x P BΓ. Proof. For each x P BΓ, choose tγnx u P Qid pa,bq representing x. We define ξpxq :“ lim Up pρpγnx qq . n To see that this limit exists, let C0 be an upper bound of }ρpgq}}ρpg ´1 q} for g P S a finite generating set of Γ and use Lemma A.4 to see that x dpγn ,γn´1 q σp`1 pρpγn´1 qq x σp pρpγn´1 qq x dpUp pρpγnx qq, Up pρpγn´1 qqq ď C0 This implies that Up pρpγnx qq is a Cauchy sequence and therefore has a limit. The fact that the limit does not depend on the chosen pa, bq-quasi-geodesic follows directly from a similar estimate using Lemma A.4. Since the estimates are uniform, this becomes a uniform limit as one changes x P BΓ, providing continuity of the maps (recall the topology in BΓ introduced in Remark 3.8). Equivariance follows from Lemma A.5.  Remark 4.8. If ρ is p-dominated then it satisfies the hypothesis of Lemma 4.7, since the terms in the sum of (4.3) are uniformly exponentially small. Proposition 4.9. Let ρ : Γ Ñ GLpd, Rq be a p-dominated representation. Then ρ is p-Anosov. Proof. If a representation is p-dominated, then it is also pd ´ pq-dominated (see Remark 3.1). Lemma 4.7 then provides two equivariant continuous maps ξ : BΓ Ñ Gp pRd q and θ : BΓ Ñ Gd´p pRd q. The fact that ξpxq ‘ θpyq “ Rd for x ‰ y P BΓ is a direct consequence of Lemma 3.10 and the definition of the maps ξ and θ given by Lemma 4.7. Using part (ii) of Lemma 4.4, we obtain an exponential gap in the singular values of ψ t , and by Theorem 2.2, the splitting ξ ‘ θ is dominated. Therefore the representation ρ is p-Anosov.  4.4. Some questions. Given a matrix A P GLpd, Rq, let χ1 pAq ě χ2 pAq ě ¨ ¨ ¨ ě χd pAq denote the absolute values of its eigenvalues, repeated according to multiplicity. Given a finitely generated group, let `pηq :“ inf |η ´1 γη| “ inf dpγη, ηq η η 22 J. BOCHI, R. POTRIE, AND A. SAMBARINO (i.e., the translation length). If Γ is word-hyperbolic then there exists a constant a ą 0 such that for every γ P Γ we have: |γ n | ď `pγq ; nÑ8 n `pγq ´ a ď lim (4.4) see [CDP, p. 119]. Note that if ρ : Γ Ñ GLpd, Rq is a p-dominated representation then there exists constants C 1 ą 0, λ ą 0 such that for all γ P Γ we have: 1 χp`1 pρpγqq ă C 1 e´λ `pγq . χp pρpγqq (4.5) Indeed, if the domination condition (3.2) holds then the group Γ is word-hyperbolic by Theorem 3.2 and, using (4.4), we obtain: ˆ ˙1{n ´ ¯1{n n σp`1 pρpγ n qq χp`1 pρpγqq ď C 1 e´λ`pγq , “ lim ď lim Ce´λ|γ | n nÑ8 nÑ8 χp pρpγqq σp pρpγ qq for C 1 :“ eaλ . Condition (4.5) is invariant under conjugacies, while condition (3.2) does not enjoy this property. It is natural to pose the following question: Question 4.10. Let ρ : Γ Ñ GLpd, Rq be a representation of a finitely generated group Γ. Suppose that there exists constants p P t1, . . . , d ´ 1u, C 1 ą 0, λ ą 0 such that relation (4.5) holds. Does it follow that ρ is p-dominated? Guéritaud, Guichard, Kassel, and Wienhard have shown that for p-convex representations, the question above has a positive answer, even relaxing condition (4.5): see [GGKW, Theorem 1.6].8 In terms of the linear flow tψ t u, condition (4.5) means that for every periodic orbit O of tφt u, say of period `pOq, there exists a gap between the p-th and p ` 1th moduli of the eigenvalues of ψ `pOq which is exponentially large with respect to `pOq. Question 4.10 can be reformulated in the general context of linear flows over hyperbolic dynamics; however, that question has a negative answer: see for example [Go]. Therefore a positive answer to Question 4.10 would require a finer use of the fact that the linear flow comes from a representation. The following important result was obtained by Bonatti, Dı́az, and Pujals [BDP]: if a diffeomorphism f of a compact manifold has that property that all sufficiently small C 1 -perturbations have dense orbits, then the derivative cocycle Df admits a dominated splitting. This is an example of a general principle in Differentiable Dynamics, tracing back to Palis–Smale Stability Conjecture: robust dynamical properties often imply some uniform property for the derivative. Coming back to the context of linear representations, one can try to apply the same principle. For example, if a representation ρ of a hyperbolic group is robustly faithful and discrete (or robustly quasi-isometric), does it follow that ρ is p-dominated for some p? 8Kassel has informed us that techniques similar to those in [GGKW] allow one to give a positive answer to Question 4.10 for certain word hyperbolic groups, including free groups and surface groups. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 23 5. Characterizing dominated representations in terms of multicones The main result of this section is Theorem 5.9, which gives another characterization of dominated representations. Related results have been obtained in [ABY, BG]. In dimension two, such results have been used to study how domination can break along a deformation: see [ABY, § 4]. As a consequence of Theorem 5.9, domination obeys a “local-to-global” principle, a fact that was first shown in [KLP1 ] by different methods. 5.1. Sofic linear cocycles and a general multicone theorem. In this subsection we introduce a special class of linear cocycles called sofic. Then we state a necessary and sufficient condition for the existence of a dominated splitting for these cocycles, generalizing the “multicone theorems” of [ABY, BG]. Let G be a graph, or more precisely, a finite directed multigraph. This means that we are given finite sets V and E whose elements are called respectively vertices and edges, and that each edge has two (not necessarily different) associated vertices, called its tail and its head. A bi-infinite walk on G is a two-sided sequence of edges pen qnPZ such that for each n P Z, the head of en equals the tail of en`1 . The graph G is called labeled if in addition each edge has an associated label, taking values in some finite set L. Let pen qnPZ be a bi-infinite walk on G; then its label sequence is defined as p`n qnPZ where each `n is the label of the edge en . Let Λ be the set of all label sequences; this is a closed, shift-invariant subset of LZ . Let T : Λ Ñ Λ denote the restriction of the shift map. Then T is called a sofic shift, and the labeled graph from which it originates is called a presentation of T . We refer the reader to [LM] for examples, properties, and alternative characterizations of sofic shifts. Let us just remark that every subshift of finite type is a sofic shift, and every sofic shift is a factor of a subshift of finite type. Let us say that a graph is recurrent if it is a union of directed cycles. Given a (labeled) graph G, let G˚ denote the maximal recurrent (labeled) subgraph, or equivalently, the subgraph containing all the bi-infinite walks on G. Note that the sofic shifts presented by G and G˚ are exactly the same. Therefore we may always assume that G is recurrent, if necessary. Fix a sofic shift T and a presentation G as above. Let d ě 2 be an integer. Given a family of matrices pA` q`PL in GLpd, Rq, consider the map A : Λ Ñ GLpd, Rq defined by App`n qnPZ q :“ A`0 . We call the pair pT, Aq a sofic linear cocycle. We are interested in the existence of dominated splitting for such cocycles. A multicone of index p is an open subset of the projective space PpRd q “ G1 pRd q that contains the projectivization of some p-plane and does not intersect the projectivization of some pd ´ pq-plane. Such a multicone is called tame if it has finitely many connected components, and these components have disjoint closures. Suppose that for each vertex v of the graph G it is given a multicone Mv Ă PpRd q of index p; then we say that pMv qvPV is a family of multicones of index p. We say that this family is strictly invariant (with respect to the sofic linear cocycle) if for each edge e P E we have9 A` pMv0 q Ť Mv1 , where ` is the label of e, v0 is the tail of e, and v1 is the head of e. 9X Ť Y denotes that the closure of X is contained in the interior of Y . 24 J. BOCHI, R. POTRIE, AND A. SAMBARINO Theorem 5.1. Let T be a sofic shift with a fixed presentation. Consider a sofic linear cocycle pT, Aq. The following statements are equivalent: (a) the cocycle pT, Aq has a dominated splitting E cu ‘E cs where the dominating bundle E cu has dimension p; (b) there exists a strictly invariant family of multicones of index p. Moreover, in (b) we can always choose a family composed of tame multicones. Remark 5.2. It is not always possible to choose connected multicones in (b). Let us sketch the simplest example, referring the reader to [ABY] for more information. 2. Let T be the full shift on two symbols 1, 2, presented by the graph 1 ‚ Let A1 , A2 be matrices in SLp2, Rq whose unstable and stable directions in PpR2 q can be cyclically ordered as: E u pA1 q ă E s pA1 q ă E u pA2 q ă E s pA2 q . If the eigenvalues are sufficiently away from 1 then the sofic cocycle pT, Aq has a dominated splitting. A strictly invariant family of multicones consists on a single element, since the graph has a single vertex. It is possible to chose a multicone M Ă PpR2 q with two connected components. But M cannot be chosen connected, since it must contain tE u pA1 q, E u pA2 qu and it cannot intersect tE s pA1 q, E s pA2 qu. Theorem 5.1 implies, for example, [ABY, Theorem 2.2]; to see this, note that the full shift on N symbols can be presented by the graph with a single vertex and self-loops labeled 1, . . . , N . Theorem 5.1 also extends [ABY, Theorem 2.3] and [BG, Theorem B] (in the case of finite sets of matrices). One can prove Theorem 5.1 by minor adaptation of the proof of [BG, Theorem B]; for the convenience of the reader we provide details in Subsection 5.2. As a complement to Theorem 5.1, let us explain how to obtain the dominating bundle E cu in terms of the multicones: Proposition 5.3. Consider a sofic linear cocycle pT, Aq with a dominated splitting E cu ‘ E cs where the dominating bundle E cu has dimension p. Let tMv uv be a strictly invariant family of multicones. Consider an element x “ p`n qnPZ P Λ, that is, the label sequence of a bi-infinite walk pen qnPZ . Let vn be the tail of the edge en . Let pPn qnPZ be a sequence in Gp pRd q such that for each n, the projectivization of Pn is contained in the multicone Mvn . Then E cu pxq “ lim A`´1 A`´2 ¨ ¨ ¨ A`´n pP´n q . nÑ`8 Moreover, the speed of convergence is exponential and can be estimated independently of x, pen q, and pPn q, and is the same for all nearby sofic linear cocycles pT, Ãq. 5.2. How to prove Theorem 5.1 and Proposition 5.3. The implication (b) ñ (a) in Theorem 5.1 and Proposition 5.3 actually hold in much greater generality: Proposition 5.4. If a linear cocycle pT, Aq 10 admits a strictly invariant continuous field C of multicones of index p. Then the cocycle admits a dominated splitting E cu ‘ E cs where the dominating bundle E cu has dimension p. Moreover, ` ˘ E cu pxq P Cpxq and inf > P, E cs pxq ą 0 for every x. (5.1) P PCpxq 10or, more generally, a linear flow in the context of Subsection 2.1 ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 25 The proposition can be shown by straightforward adaptation of the proof of [CP, Theorem 2.6], and we skip the details. Proposition 5.3 follows from the angle bound in (5.1) combined with Lemma A.10. We now prove the implication (a) ñ (b) in Theorem 5.1. Suppose that the sofic cocycle pT, Aq admits a dominated splitting E cu ‘ E cs . For each vertex v of the graph G, let Λv be the (compact) set of label sequences x “ p`n q in Λ for which the tail of `0 is v. The space E cu pxq depends only on the past of the sequence (i.e. on p`n qnă0 ) while the space E cs pxq depends only on its future (i.e. on p`n qně0 ); this follows from the characterizations (2.3) and (2.4). cu For each vertex v, the set Kcu v consisting of the spaces E pxq with x P Λv is a d compact subset of the Grassmannian Gp pR q. Analogously we define a compact set d Kcs v Ă Gd´p pR q. We claim that these two sets are transverse in the sense that any cu cu E pxq in Kv is transverse to any E cu pyq in Kcs v . Indeed, consider the sequence z formed by concatenation of the past of x with the future of y. Note that this is indeed the label sequence of a bi-infinite path (i.e. admissible sequence of edges) in the graph, also obtained by concatenation. By a previous remark, E cu pzq “ E cu pxq and E cu pzq “ E cu pyq, and so these two spaces are transverse. be the open subset of Gp pRd q formed by the p-planes that are transverse Let K&cs v cu to Kv . Define a metric dv on K&cs as follows: v dv pP, Qq :“ 8 ÿ ` ˘ sup d A`N ´1 ¨ ¨ ¨ A`0 pP q, A`N ´1 ¨ ¨ ¨ A`0 pQq ; N “0 p`n qPΛv the convergence is exponential as a consequence of Lemma A.10. This family of metrics is adapted in the sense that they are contracted by a single iteration of the cocycle. More precisely, if an edge e P E has tail v, head w, and label ` then: dw pA` pP q, A` pQqq ă dv pP, Qq for all P, Q P K&cs v . So, fixing ε ą 0 and letting Mv˚ denote the ε-neighborhood of Kcu v with respect to the metric dv , we have the invariance property A` pMv˚ q Ă Mw˚ . Let Mv Ă PpRd q be the union of lines contained in elements of Mv˚ ; then tMv uv is an invariant family of multicones. Moreover, by the same argument as in [BG, p. 288], for an appropriate choice of ε the multicones are tame and strictly invariant. 5.3. Cone types for word-hyperbolic groups. Cone types were originally introduced by Cannon [Ca] for groups of hyperbolic isometries. Let Γ be a finitely generated group with a fixed finite symmetric generating set S. Let |¨| and dp¨, ¨q denote word-length and the word-metric, respectively. The cone type of an element γ P Γ is defined as: ( C ` pγq :“ η P Γ : |ηγ| “ |η| ` |γ| . For example, C ` pγq “ Γ if and only if γ “ id. Remark 5.5. Actually the usual definition is different: ( C ´ pγq :“ η P Γ : |γη| “ |η| ` |γ| . But working with one definition is essentially equivalent to working with the other, because C ´ pγq “ rC ` pγ ´1 qs´1 . If we need to distinguish between the two, we shall call them positive and negative cone types. 26 J. BOCHI, R. POTRIE, AND A. SAMBARINO A fundamental fact is that word-hyperbolic groups have only finitely many cone types: see [BH, p. 455] or [CDP, p. 145]. In fact, there is a constant k (depending only on the hyperbolicity constant of the group) such that for any γ P Γ, the cone type C ` pγq is uniquely determined by the k-prefix11 of a shortest word representation of γ. Given a cone type C and a P S X C, we can define a cone type aC :“ C ` paγq, where γ P Γ is such that C ` pγq “ C. Lemma 5.6. aC is well-defined. Though the lemma is contained in [CDP, p. 147, Lemme 4.3], let us provide a proof for the reader’s convenience: Proof. Suppose that C ` pγq “ C ` pγ 1 q “ C and a P S X C; we need to prove that C ` paγq Ă C ` paγ 1 q. Take η P C ` paγq, so |ηaγ| “ |η| ` |aγ| “ |η| ` 1 ` |γ|. In follows that |ηa| “ |η| ` 1 and so |ηaγ| “ |ηa| ` |γ|, that is ηa P C. In particular |ηaγ 1 | “ |ηa| ` |γ 1 | “ |η| ` |aγ|, proving that η P C ` paγ 1 q.  We associate to pΓ, Sq a labeled graph G (in the sense of § 5.1) called the geodesic automaton and defined as follows: ‚ the vertices are the cone types of Γ; a ‚ there is an edge C1 Ý Ñ C2 from vertex C1 to vertex C2 , labeled by a generator a P S, iff a P C1 and C2 “ aC1 . Remark 5.7. Replacing each vertex C by C ´1 (a negative cone type) and each a´1 edge C1 Ý Ñ C2 by C1´1 ÝÝÑ C2´1 , we obtain the graph described in [BH, p. 456]. a Let us explain the relation with geodesics. Consider a geodesic segment pγ0 , γ1 , . . . , γ` q that is, a sequence of elements of Γ such that dpγn , γm q “ |n ´ m|, and assume that γ0 “ id. Then, there are a0 , . . . a`´1 in a generating set S such that γn “ a0 a1 ¨ ¨ ¨ an´1 . Note that for each n, the following is an edge of the geodesic automaton graph G: a´1 n ´1 C ` pγn´1 q ÝÝ Ñ C ` pγn`1 q Thus we obtain a (finite) walk on G starting from the vertex C ` pidq. Conversely, for each such walk we may associate a geodesic segment starting at the identity. Let us define also the recurrent geodesic automaton as the maximal recurrent subgraph G˚ of G; its vertices are called recurrent cone types. Similarly to what was explained above, for each two-sided geodesic on Γ passing through the identity element we can associate a bi-infinite walk on G˚ , and vice-versa. Using the fact that the geodesic automation is a finite graph, it is simple to obtain the following property:12 Lemma 5.8. Let Γ be an infinite word-hyperbolic group, with a fixed set of generators. Let Γ˚ be the union of all two-sided geodesics passing through the identity element. Then for some finite c, the set Γ˚ is c-dense on Γ, that is, for every γ P Γ there exists η P Γ˚ such that dpη, γq ď c. 11Or k-suffix in the case of negative cone types. 12Alternatively, one can deduce the lemma from the “bounded dead-end depth” property [Bog]. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 27 5.4. Multicones for dominated representations. Let Γ be a word-hyperbolic group (with a fixed finite symmetric generating set), and let ρ : Γ Ñ GLpd, Rq be a representation. Recall from § 5.1 that a multicone of index p is an open subset of PpRd q that contains the projectivization of some p-plane and does not intersect the projectivization of some pd ´ pq-plane. If for each recurrent cone type C it is given a multicone M pCq of index p, then we say that tM pCquC is a family of multicones for Γ. We say that this family g is strictly invariant with respect to ρ if for each edge C1 Ý Ñ C2 of the geodesic automaton graph, we have: ρpgqpM pC1 qq Ť M pC2 q . Theorem 5.9. A representation of a word-hyperbolic group is p-dominated if and only if it has a strictly invariant family of multicones of index p. Moreover, we can always choose a family composed of tame multicones. Proof. Fix a word-hyperbolic group Γ. We can assume that Γ is infinite, otherwise the theorem is vacuously true. Fix a finite symmetric generating set S. Consider the associated recurrent geodesic automaton G˚ , and the sofic shift T : Λ Ñ Λ presented by this labeled graph. Then a sequence pan q in S Z belongs to Λ if and only if the sequence pγn qnPZ defined by: $ ´1 ´1 ´1 ’ if n ą 0, &a0 a1 ¨ ¨ ¨ an´1 γn :“ id if n “ 0, ’ % a´1 a´2 ¨ ¨ ¨ an if n ă 0, is a geodesic on Γ. The union of (the traces of) all such geodesics is a set Γ˚ Ă Γ which by Lemma 5.8 is c-dense in Γ for some finite c. Let ρ : Γ Ñ GLpd, Rq be a representation. Consider the family of matrices pρpaqqaPS , and let pT, Aq be the induced sofic linear cocyle. Then, for each x “ pan q P X, if pγn q is the geodesic defined above then ApT n´1 xq ¨ ¨ ¨ Apxq “ ρpγn´1 q for every positive n. By Remark 3.1, ρ is p-dominated iff it is pd ´ pq-dominated. Since the set Γ˚ is c-dense, ρ is pd ´ pq-dominated iff: σp`1 DC ą 0 Dλ ą 0 @γ P Γ˚ we have pρpγ ´1 qq ď Ce´λ|γ| . σp Note that this condition holds iff the sofic linear cocycle pT, Aq has a dominated splitting with a dominating bundle of dimension p; this follows from Theorem 2.2 and the previous observations. Also note that a strictly invariant family of multicones for the sofic linear cocycle pT, Aq is exactly the same as a strictly invariant family of multicones for the representation ρ. Therefore Theorem 5.1 allows us to conclude.  Theorem 5.9 also has the following well-known consequence (see [GW, Lab]). Corollary 5.10. Among representations Γ Ñ GLpd, Rq, the p-dominated ones form an open set. Proof. Given a p-dominated representation, take a strictly invariant family of multicones. Then the same family is also strictly invariant under all nearby representations.  28 J. BOCHI, R. POTRIE, AND A. SAMBARINO As a complement to Theorem 5.9, let us explain how to determine the equivariant map ξ : BΓ Ñ Gp pRd q (defined in Section 4) in terms of multicones. Proposition 5.11. Consider a p-dominated representation ρ : Γ Ñ GLpd, Rq, and let tM pCquC be a strictly invariant family of multicones. Consider any geodesic ray pγn qnPN with γ0 “ id, and let x P BΓ be the associated boundary point. Let pPn qně1 be a sequence in Gp pRd q such that for each n, the projectivization of Pn is contained in the multicone M pC ` pγn qq. Then ξpxq “ lim ρpγn´1 qPn . (5.2) nÑ8 Moreover, the speed of convergence can be estimated independently of x, pγn q, and pPn q, and is the same for all nearby representations. Proof. It suffices to translate Proposition 5.3 to the context of representations.  Remark 5.12. Recall from Remark 3.4 that it also makes sense to define p-dominated representations into PGLpd, Rq. All that was said in this subsection applies verbatim to that case, since PGLpd, Rq also acts on PpRd q. 5.5. An example. Consider the free product Γ :“ pZ{3Zq ˚ pZ{3Zq (which is isomorphic to PGLp2, Zq) with a presentation: @ D Γ “ a, b | a3 “ b2 “ id . Then there are only 2 recurrent cone types, namely C ` paq and C ` pbq, and the recurrent geodesic automaton is: a´1 C ` paq b C ` pbq a Fix λ ą 1. Consider the following pair of matrices in SLp2, Rq: A :“ D´1 Rπ{3 D where: D :“ ˆ λ 0 0 λ´1 ˙ and B :“ Rπ{2 , and Rθ :“ ˆ cos θ sin θ ´ sin θ cos θ ˙ . Since A3 “ B 2 “ ´Id, we can define a representation ρ : Γ Ñ PSLp2, Rq by ? setting ρpaq :“ A, ρpbq :“ B. We claim that if λ is sufficiently large (namely, λ ą 4 2) then this representation is dominated. Indeed, it is possible to find a strictly invariant family of multicones as in Fig. 5. 6. Analytic variation of limit maps The purpose of this section is to give another proof of a theorem from [BCLS], which establishes that the equivariant limit maps ξ, η (defined in Section 4) depend analytically on the representation. This fact is useful to show that some quantities such as entropy vary analytically with respect to the representation, which in turn is important to obtain certain rigidity results (see [BCLS, PS]). While the original approach of [BCLS] used the formalism of [HPS], we present here a more direct proof, based on the tools discussed in the previous section. We remark that an alternative approach using the implicit function theorem and ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 29 A´1 pIq ApIq J I BpJq Figure 5. A strictly invariant multicone for the representation ρ : pZ{3Zq ˚ pZ{2Zq Ñ PSLp2, Rq. We have ApIq Ť J, A´1 pIq Ť J, BpJq Ť I. avoiding complexification can be found in [Ru], though the context is different and the results are not exactly the same. A family of representations tρu uuPD of a word-hyperbolic group Γ into GLpd, Rq is called real analytic if the parameter space is a real analytic manifold, and for each γ P Γ, the map u P D ÞÑ ρu pγq P GLpd, Rq is real analytic. (Of course, it suffices to check the later condition for a set of generators.) The boundary BΓ of the group Γ admits a distance function within a “canonical” Hölder class ([CDP, Chapitre 11]). For a fixed metric in this class, the geodesic flow defined previously is Lipschitz. The limit maps ξρ : BΓ Ñ Gp pRd q and θρ : BΓ Ñ Gd´p pRd q of a p-dominated representations are well known to be Hölder continuous (see Theorem A.15). One can endow the space C α pBΓ, Gp pRd qq of α-Hölder maps with a Banach manifold structure; so analyticity of a map from an analytic manifold to C α pBΓ, Gp pRd qq makes sense. ( Theorem 6.1 (Theorem 6.1 of [BCLS]). Let ρu : Γ Ñ GLpd, Rq uPD be a real analytic family of representations. Suppose that 0 P D and ρ0 is p-dominated. Then there exists a neighborhood D1 Ă D of 0 such that for every u P D1 , the representation ρu is p-dominated, and moreover u ÞÑ ξρu defines a real-analytic map from D1 to C α pBΓ, Gp pRd qq, for some α ą 0. Let us provide a proof. Corollary 5.10 ensures that for every u sufficiently close to 0, the representation ρu is also p-dominated. As in [BCLS] (see also [Hub, Proposition A.5.9]), it is enough to show transverse real analyticity. More precisely, we need to show that the map F : D1 ˆBΓ Ñ Gp pRd q given by F pu, xq :“ ξρu pxq has the following properties: (i) it is α-Hölder continuous; (ii) for every x P BΓ, the map F p¨, xq : D1 Ñ Gp pRd q is real analytic. Hölder continuity is a standard property of dominated splittings (see for example [CP, Section 4.4]), and is independent of the analyticity of the family. For completeness, and since we could not find the specific statement in the literature, we included a sketch of the proof in the appendix: see Corollary A.16. In the case at 30 J. BOCHI, R. POTRIE, AND A. SAMBARINO hand, it follows that property (i) above is satisfied, for some neighborhood D1 Q 0 and some uniform Hölder exponent α ą 0. So we are left to prove the analyticity property (ii). To proceed further, we consider the complexification of the representations. We can assume without loss of generality that D1 is a neighborhood of 0 in some Rk . Let tg1 , . . . , gm u be a finite generating set of Γ. For each i, the Taylor expansion of u ÞÑ ρu pgi q around 0 converges on a polydisk D̂i in Ck centered atŞ0; we keep the same symbol for the extended map. Take a smaller polydisk D Ă i D̂i also centered at 0 such that for u P D, the complex matrix ρu pgi q is invertible. Since these maps are analytic, and every relation of Γ is obeyed when u is real, the same happens for all u P D̂. So we have constructed a complex analytic family of representations ρu : Γ Ñ GLpd, Cq, where u takes values in a neighborhood D̂ of 0 in Ck . Recall from Remark 2.3 that dominated splittings make sense in the complex case; so do dominated representations, with the exact same definition (3.2). Actually, if ι denotes the usual homomorphism that embeds GLpd, Cq into GLp2d, Rq, then a representation ρ : Γ Ñ GLpd, Cq is p-dominated in the complex sense iff ι ˝ ρ is 2p-dominated in the real sense. In particular, the openness property of Corollary 5.10 also holds in the complex case. So, reducing D̂ if necessary, we assume that each ρu is p-dominated. Proposition 6.2. For each x P BΓ, the map u ÞÑ ξu pxq from D̂ to Gp pCd q is complex analytic. Proof. It suffices to check analyticity around u “ 0. For each x P BΓ, choose a geodesic ray pγnx qnPN in Γ starting at the identity element and converging to x. We consider the sequence of maps from D̂ to Gp pCd q defined as follows: ϕxn puq :“ ρu pγnx q´1 pξ0 pγnx pxqqq . Each of these maps is complex analytic, since so is u ÞÑ ρu pγnx q. We claim that for each x P BΓ, convergence ϕxn puq Ñ ξu pxq holds uniformly in a neighborhood of 0. Since Gp pCd q may be considered as a closed subset of G2p pR2d q, it is sufficient to check convergence in the latter set. This convergence follows from Proposition 5.11 and the fact that for u in a small neighborhood V of 0, the representations are still dominated, and with the same multicones (see Corollary 5.10). Note that ξ0 always belongs to the corresponding multicone because the multicones remain unchanged. Being a uniform limit of complex-analytic maps, the map u ÞÑ ξu pxq is complex analytic on V (see for example [Hö, Corollary 2.2.4]).  Restricting to the real parameters, the proposition yields the property (ii) that we were left to check. So the proof of Theorem 6.1 is complete. 7. Geometric consequences of Theorem 2.2: A Morse Lemma for PSLpd, Rq’s symmetric space In this section we explain why Theorem 2.2 (and more precisely Proposition 2.4) has a deep geometric meaning for the symmetric space of PSLpd, Rq. This is a version of the Morse Lemma recently proved by [KLP2 ]. Because of this application, one is tempted to call Theorem 2.2 a twisted Morse Lemma 13. 13Lenz [Len], who previously obtained a weaker version of Theorem 2.2 for SLp2, Rq, had already noted that his result was related to the classical Morse Lemma for the hyperbolic plane. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 31 The exposition is purposely pedestrian for two reasons: (1) it is intended for the reader unfamiliar with symmetric spaces; (2) it mimics, in the case of PSLpd, Rq, the general structure theory of semi-simple Lie groups, in order to ease the way to Section 8. The reader familiar with semi-simple Lie groups should jump to subsection 7.12, or even Section 8, for a proof of the Morse Lemma due to [KLP2 ], for symmetric spaces of non-compact type, using dominated splittings. Specific references for subsections 7.1–7.11 are, for example, [Ebe], [GJT], [Hel], [Lang]. This section is independent of sections 3–6. 7.1. A Cartan subalgebra. Fix an inner product x¨, ¨y on Rd and denote by o its homothety class, i.e. x¨, ¨y up to positive scalars. One has then the adjoint involution T ÞÑ T t defined by xT v, wy “ xv, T t wy (note that t only depends on o). This involution splits the vector space slpd, Rq of traceless d ˆ d matrices as slpd, Rq “ po ‘ ko where po “ tT P slpd, Rq : T t “ T u and ko “ tT P slpd, Rq : T t “ ´T u. The subspace ko is a Lie algebra so we can consider its associated Lie group K o “ exp ko , consisting on (the projectivisation of) determinant 1 matrices preserving the class o. The subspace po , of traceless matrices diagonalizable on a o-orthogonal basis, is not a Lie algebra. Fix then a o-orthogonal set of d lines E and denote by a Ă po those matrices diagonalizable in the chosen set E. This is an abelian algebra, called a Cartan subalgebra of slpd, Rq; its associated Lie group exp a consists on (the projectivisation of) determinant 1 matrices diagonalizable on E with positive eigenvalues. For a P a and u P E, we will denote by λu paq the eigenvalue for a associated to the eigenline u. Note that λu is linear on a and hence an element of the dual space a˚ of a. 7.2. The action of a on slpd, Rq. The action of a on slpd, Rq given by pa, T q ÞÑ ra, T s “ aT ´ T a is also diagonalizable. Indeed, the set of (projective) traceless transformations tεuv , φuv : u ‰ v P Eu defined by εuv pvq “ u and εuv |E ´ tvu “ 0, and φuv |u “ t id, φuv |v “ ´t id, and φuv |E ´ tu, vu “ 0, contains a linearly independent set of eigenlines of ra, ¨s, specifically ra, φuv s “ 0 and ra, εuv s “ αuv paqεuv “ pλu paq ´ λv paqqεuv . 14 The set of functionals Σ “ tαuv P a˚ : u ‰ v P Eu is called a root system (or simply the roots) of a. For α P Σ Y t0u, one usually denotes by slpd, Rqα the eigenspace associated to α, that is, slpd, Rqα “ tT P slpd, Rq : ra, T s “ αpaqT, @a P au, 14Redundancy only appears in the set tφ uv : u ‰ v P Eu. 32 J. BOCHI, R. POTRIE, AND A. SAMBARINO and one has15 slpd, Rq “ à αPΣYt0u slpd, Rqα “ a ‘ à slpd, Rqα . (7.1) αPΣ 7.3. Expansion/contraction. The closure of a connected component of ď ker α a´ αPΣ is called a closed Weyl chamber. Fix a closed Weyl chamber and denote it by a` ; this is not a canonical choice: it is equivalent to choosing an order on the set E. Indeed, consider the subset of positive roots defined by a` : Σ` “ tα P Σ : α|a` ě 0u, then one can set u ą v if αuv P Σ` .16 Let n` be the Lie algebra defined by à à εuv . n` “ slpd, Rqα “ αPΣ` uąv By definition, a ‘ n` is the subspace of slpd, Rq which is non-expanded by Ad exp a, for a P a` . 7.4. Simple roots. Observe that the order on E defined in subsection 7.3 is a total order; indeed, the kernel of every α P Σ has empty intersection with the interior of a` , so given distinct u, v P E, either αuv P Σ` or αvu “ ´αuv P Σ` . Consider pairwise distinct u, v, w P E such that u ą v ą w. Note that if a P a` X ker αuw necessarily a P ker αuv X ker αvw . A positive root α such that ker α X a` has maximal co-dimension is called a simple root associated to a` . This corresponds to choosing two successive elements of E. The set of simple roots is denoted by Π. Note that this is a basis of a˚ . From now on we will denote by E “ tu1 , . . . , ud u with up ą up`1 . Then n` can be interpreted as the space of upper triangular matrices on E (with 0’s in the diagonal), and denoting by ai “ λui paq one has a` “ ta P a : a1 ě ¨ ¨ ¨ ě ad u. We will use λui to introduce coordinates in a : if pa1 , . . . , ad q P Rd are such that a1 `¨ ¨ ¨`ad “ 0 then pa1 , . . . , ad q will denote the element a P a such that λui paq “ ai . Finally, given p P t1, . . . , d ´ 1u we will denote by αp the simple root αp paq “ αup up`1 paq “ ap ´ ap`1 . 15The fact that slpd, Rq “ a is particular of split real algebras, such as slpd, Rq. 0 16In the case of PSLpd, Rq one usually applies the inverse procedure: ‘let te , . . . , e u be the 1 d canonical basis of Rd and let a` be the set of (determinant one) diagonal matrices with decreasing eigenvalues’. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 33 7.5. Flags. Denote by N “ exp n` and by M the centralizer of exp a in K o . The group M consists of (the projectivisation of) diagonal matrices w.r.t. E with eigenvalues 1’s and ´1’s. The group P “ M exp a N is called a Borel subgroup of PSLpd, Rq and N is called its unipotent radical. Recall that a complete flag on Rd is a collection of subspaces E “ tEp ud´1 such 1 that Ep Ă Ep`1 and dim Ep “ p. The spaces of complete flags is denoted by F . Observe that PSLpd, Rq acts transitively (i.e. has only one orbit) on F and that the group P is the stabilizer of tu1 ‘ ¨ ¨ ¨ ‘ up ud´1 p“1 ; thus we obtain an equivariant identification F “ PSLpd, Rq{P . Two complete flags E and F are in general position if for all p “ 1, . . . , d ´ 1 one has Ep X Fd´p “ t0u. Denote by F p2q the space of pairs of flags in general position. The same procedure applied to the Weyl chamber ´a` , provides the group P̌ that stabilizes the complete flag d´1 tud ‘ ¨ ¨ ¨ ‘ ud´p`1 up“1 . d´1 Observe that the flags tu1 ‘ ¨ ¨ ¨ ‘ up up“1 and tud ‘ ¨ ¨ ¨ ‘ ud´p`1 ud´1 p“1 are in general position and that the stabilizer in PSLpd, Rq of the pair is the group M exp a “ P X P̌ . 7.6. Flags and singular value decomposition. If x¨, ¨y P o is an inner product with induced norm }¨} on Rd , note that the operator norm of g P GLpd, Rq, * " }gv} d o : v P R ´ t0u , σ1 pgq “ }g}o “ sup }v} only depends on the homothety class o. The same holds for the other singular values, defined in subsection 2.2. Throughout this section, the choice of the class o is important, so we will stress the fact that the singular values depend on o by denoting them as σio pgq. The singular value decomposition provides a map a : PSLpd, Rq Ñ a` , called the Cartan projection, such that for every g P PSLpd, Rq there exist kg , lg P K o such that g “ kg exppapgqqlg . More precisely, one has apgq “ plog σ1o pgq, . . . , log σdo pgqq. o Recall from Section 2.2 that g has a gap of index p if σpo pgq ą σp`1 pgq. If this is the case then Upo pgq “ kg pu1 ‘ ¨ ¨ ¨ ‘ up q, (7.2) (note again the dependence on o). Given αp P Π denote by K o ptαp uq the stabilizer in K o of the vector space u1 ‘ ¨ ¨ ¨ ‘ up . Moreover, given a subset θ Ă Π, denote by č K o pθq “ K o ptαp uq. αp Pθ 34 J. BOCHI, R. POTRIE, AND A. SAMBARINO If for some p P t1, . . . , du and g P PSLpd, Rq one has a1 pgq “ ap pgq ą ap`1 pgq, then any element of kg K o ptαp uq can be chosen in a Cartan decomposition of g. If all the gaps of g are indexed on a subset θ Ă Π, then kg is only defined modulo K o pθq and one has the partial flag U o pgq “ tUpo pgq : αp P θu. Note that the Cartan projection of g ´1 is simply apg ´1 q “ p´ad pgq, . . . , ´a1 pgqq. The linear transformation i : a Ñ a defined by ipa1 , . . . , ad q “ p´ad , . . . , ´a1 q is called the opposition involution. If g has gaps indexed by θ then g ´1 has gaps indexed by i θ “ tα ˝ i : α P θu. Denote by S o pgq “ U o pg ´1 q. 7.7. The symmetric space. Recall that fixing a class o defines a splitting slpd, Rq “ po ‘ ko . This splitting is orthogonal with respect to the Killing form, the symmetric bilinear form κ on slpd, Rq defined by κpA, Bq “ 2d TracepABq. This linear form is related to adjoint involution t in the following sense: the linear form κp¨, ¨t q is positive definite. Since po consists on fixed point for t , the restriction of κ to po , denoted by p¨, ¨qo : po ˆ po Ñ R, is positive definite. Explicitly, if v P po then v is diagonalizable and |v|2o :“ pv, vqo equals the sum of squared eigenvalues of v. The space Xd “ tinner products on Rd u{R` is a contractible PSLpd, Rq-homogenous space, the action being given by g ¨ x¨, ¨y “ x¨, ¨y1 where xv, vy1 “ xg ´1 v, g ´1 wy. The stabilizer of o is the group K o and thus the orbit map pg, oq ÞÑ g ¨ o identifies the tangent space To Xd with the vector space po . A direct computation shows that the Riemannian metric o ÞÑ p¨, ¨qo is PSLpd, Rq-invariant. The space pXd , p¨, ¨qo q is, by definition, the symmetric space of PSLpd, Rq. 7.8. Maximal flats. A direct computation shows that the orbit exp a ¨ o Ă Xd is isometric to pa, p¨, ¨qo q. Moreover, one can show that exp a ¨ o is a maximal totally geodesic flat (flat as in “isometric to a Euclidean space”, maximal with respect to dimension; see for example [Lang, Section XII.3]). For every g P PSLpd, Rq one has dÿ plog σio pgqq2 , (7.3) dXd po, g ¨ oq “ dXd po, exp apgq ¨ oq “ |apgq|o “ i where dXd is the distance on Xd induced by the Riemannian metric p¨, ¨qo . The translated orbit g exp a ¨ o is again a maximal totally geodesic flat (through g ¨ o) and hence, all geodesics of Xd are of the form t ÞÑ g expptaq ¨ o for a given g P PSLpd, Rq and a P a` . ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 35 In other words, a maximal flat in Xd consists on fixing a set L of d lines that span Rd and considering the space of inner products, up to homothety, that make L an orthogonal set. The following lemma is simple but extremely useful for estimations: Lemma 7.1. Consider ϕ P a˚ such that ϕ|a` ´ t0u ą 0. Then there exists c ą 1 such that for all g P PSLpd, Rq one has 1 ϕpapgqq ď dXd po, g ¨ oq ď cϕpapgqq. c Proof. Since a` is closed and ker ϕ X a` “ t0u the function a ÞÑ |a|o ϕpaq is invariant under multiplication by scalars and bounded on a` ´ t0u. Equation (7.3) completes the proof.  For example, log σ1o pgq and ´ log σdo pgq are comparable to dXd po, g ¨ oq. 7.9. The Furstenberg boundary and parallel sets. A parametrized flat is a function f : a Ñ Xd of the form fpaq “ g exp a ¨ o for some g P PSLpd, Rq. A maximal flat is thus a subset of the form fpaq Ă Xd for some parametrized flat f. Observe that PSLpd, Rq acts transitively on the set of parametrized flats and that the stabilizer of f0 : a ÞÑ exp a ¨ o is the group M . We will hence identify the space of parametrized flats with PSLpd, Rq{M . Two parametrized flats f, g are equivalent if the function a Ñ R defined by ` a ÞÑ dXd pfpaq, gpaqq is bounded on a . The Furstenberg boundary of Xd is the space of equivalence classes of parametrized flats. Note that, by definition of N “ exp n` one has that the distance function a ÞÑ dXd pn exp a ¨ o, exp a ¨ oq ` is bounded on a P a only if n P M exp a N “ P 17. Thus, the equivalence class of the flat f0 is P ¨ f0 . Hence, the Furstenberg boundary is PSLpd, Rq-equivariantly identified with the space of complete flags F “ PSLpd, Rq{P . Given a parametrized flat f denote by Zpfq P F its equivalence class in the Furstenberg boundary. Also, denote by Žpfq P F the class of the parametrized flat18 a ÞÑ fp´aq. This last identification can be seen directly: a parametrized flat f consists in fixing an ordered 19 set t`1 , . . . , `d u of d lines that span Rd and considering all inner products (up to homothety) that make this set an orthogonal set, and the choice of 17The ij entry on E of expp´taqn expptaq is expptpa ´ a qqn . In order to have this entry j i ij bounded for all t ą 0 one must have nij “ 0 for all j ă i. 18This is still a parametrized flat. 19Recall a` is fixed beforehand. 36 J. BOCHI, R. POTRIE, AND A. SAMBARINO one of these inner products. The associated point “at infinity” in the Furstenberg boundary of this parametrized flat is the complete flag Zpfqp “ `1 ‘ ¨ ¨ ¨ ‘ `p . Moreover, Žpfqp “ `d ‘ ¨ ¨ ¨ ‘ `d´p`1 . One easily concludes the following properties: - Given x P Xd and a complete flag F there exists a unique maximal flat fpaq containing x such that Zpfq “ F : apply the Gram-Schmidt process to flag F and any inner product in the class x. - Given two flags in general position pE, F q P F p2q there exists a unique maximal flat fpaq such that Zpfq “ E and Žpfq “ F : it suffices to consider the ordered set `p “ Ep X Fd´p`1 . Recalling that M exp a “ P X P̌ , observe that the maps Ž and Z are exactly the canonical quotient projections pŽ, Zq : PSLpd, Rq{M Ñ F p2q “ PSLpd, Rq{M exp a. Given subsets θ1 Ă θ Ă Π, denote by Fθ the space of partial flags of type θ and 1 given E P Fθ denote by E θ P Fθ1 the partial flag of type θ1 consisting on forgetting the irrelevant subspaces of E. Denote by Zθ pfq “ Zpfqθ and by Žθ “ Zi θ . Given a pair of partial flags in general position E P Fθ and F P Fi θ and a point x P Xd , we define: - The Weyl cone V px, Eq determined by x and E is ď fpa` q, f where the union is indexed on all parametrized flats f with fp0q “ x and Zθ pfq “ E. - The parallel set P pF, Eq determined by F and E is ď fpaq, f where the union is indexed on all parametrized flats f with Žθ pfq “ F and Zθ pfq “ E. 7.10. Parametrized flats through o and g ¨ o. Consider g P PSLpd, Rq and g “ kg exp apgqlg a Cartan decomposition of g. Observe that the set of d lines kg E “ tkg u1 , . . . , kg ud u is simultaneously o-orthogonal and g ¨ o-orthogonal. The set of classes of inner products that make this set orthogonal is hence a maximal flat through o and g ¨ o. If g has gaps of certain indices, indexed by θ Ă Π, then every element of kg Ko pθq can be chosen in a Cartan decomposition of g. Thus, the set of maximal flats through o and g ¨ o is the translated Ko pθq-orbit kg Ko pθqE. All parametrized flats f with fp0q “ o such that g ¨ o P fpa` q, have the flag U o pgq as a partial subflag of their corresponding flag at infinity Zpfq (recall equation (7.2)), see Fig. 6. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS g¨o o P Xd 37 U o pgq Fθ Figure 6. All flats through o and g ¨ o have U o pgq as a partial flag at infinity. 7.11. a` -valued distance. Recall that Xd is PSLpd, Rq-homogeneous and consider the map a : Xd ˆ Xd Ñ a` defined by apg ¨ o, h ¨ oq “ apg ´1 hq. Note that a is PSLpd, Rq-invariant for the diagonal action of PSLpd, Rq on Xd ˆ Xd , that dXd px, yq “ |apx, yq|o , (7.4) (this is due to equation (7.3)) and that ipapx, yqq “ apy, xq. Consider the subset of simple roots defined by θpx, yq “ tα P Π : αpapx, yqq ‰ 0u and consider the partial flag U px, yq “ tgUαo pg ´1 hquαPθpx,yq , where px, yq “ pg ¨ o, h ¨ oq. Given θ Ă θpx, yq, let the Weyl cone of type θ from x to y be denoted by Vθ px, yq and defined by ď Vθ px, yq “ fpa` q, f where the union is indexed on all parametrized flats f with fp0q “ x and Zθ pfq “ U px, yqθ . Finally, the diamond of type θ between x and y is the subset ♦θ px, yq “ Vθ px, yq X Vi θ py, xq. This diamond is contained in the parallel set P pU px, yqθ , Spx, yqi θ q, where Spx, yq “ hS o pg ´1 hq. For example, consider x “ o. Any y P Xd can be written as y “ g exp a ¨ o with a “ apo, yq P a` and g ¨ o “ o. If a P int a` then θpo, yq “ Π and VΠ po, yq “ tg exp v ¨ o : v P a` u, ♦Π po, yq “ tg exp v ¨ o : v P a` X pa ´ a` qu. 38 J. BOCHI, R. POTRIE, AND A. SAMBARINO 7.12. Angles and distances to parallel sets. The purpose of this subsection and the next one is to relate the distance from a given point o to a parallel set P pE, F q, for two partial flags in general position, with the angle between E and F for an inner product in the class o (Proposition 7.2). Fix an inner product x¨, ¨y P o and denote by }¨} the induced norm on Rd . The oangle between non-zero vectors v, w P Rd is defined as the unique number >o pv, wq in r0, πs whose cosine is xv, wy{p}v} }w}q. If E, F Ă Rd are nonzero subspaces then we define their o-angle as: >o pE, F q :“ min min >o pv, wq , vPE ˆ wPF ˆ (7.5) where E ˆ :“ E rt0u. We also write >o pv, F q instead of >o pRv, F q, if v is a nonzero vector. Observe that >o p¨, ¨q is independent on x¨, ¨y P o. We haven’t found a precise reference for the following proposition, we will hence provide a proof. See Fig. 7. Proposition 7.2. Given θ Ă Π there exist c ą 1 and c1 ą 0, only depending on θ p2q and the group PSLpd, Rq, such that if pE, F q P Fθ , then ´1 log sin min >o pEp , Fd´p q ď dXd po, P pF, Eqq ď c1 ´ c log sin min >o pEp , Fd´p q. αp Pθ αp Pθ c E P Fθ P pF, Eq F P Fi θ o dXd po, P pF, Eqq — ´ log min tsin >o pEp , Fd´p qu αp Pθ Figure 7. The statement of Proposition 7.2 Proof. Without loss of generality, we may assume that for all αp P θ one has Fd´p “ ud´p ‘ ¨ ¨ ¨ ‘ ud . Denote by GE pE, F q the set of elements g P PSLpd, Rq such that for all αp P θ one has gpu1 ‘ ¨ ¨ ¨ ‘ up q “ Ep and gpFd´p q “ Fd´p . Then, the parallel set P pF, Eq “ tg ¨ o : g P GE pE, F qu. Let us prove the first inequality. Consider arbitrary p with αp P θ and arbitrary nonzero vectors v P Ep and w P Fd´p Let w̃ be the orthogonal projection of v on the line spanned by w. Consider arbitrary g P GE pE, F q. Then g ´1 v and g ´1 w are orthogonal, which allows us to estimate: 1 }w̃} σ o pgq}g ´1 w̃} σ o pgq “ ď o 1 ´1 ď 1o . ´1 sin >o pv, wq }v ´ w̃} σd pgq}g v ´ g w̃} σd pgq ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 39 By Lemma 7.1, the logarithm of the right-hand side is comparable to dXd po, g ¨ oq. So we obtain the first inequality in the proposition. Next, let us prove first the second inequality. Write the set tp : αp P θu Y t0, du as t0 “ p0 ă p1 ă p2 ă ¨ ¨ ¨ ă pk “ du. Denote by Hi0 “ upi´1 ‘ ¨ ¨ ¨ ‘ upi . Denote by Hi “ Epi X Fd´pi`1 . For all i P t1, . . . , ku one has dim H10 ‘ ¨ ¨ ¨ ‘ Hi0 “ dim H1 ‘ ¨ ¨ ¨ ‘ Hi . If g P PSLpd, Rq is such that gpHi0 q “ Hi then g P GE pE, F q and hence g ¨ o P P pF, Eq. We will define a suited such g and estimate its operator norm for the class o. Consider g as the unique element of PSLpd, Rq such that, for each i “ 1, . . . , k, the restriction of g ´1 to Hi coincides with the orthogonal projection on Hi0 . We proceed to estimate }g}. Given v P Rd , write it as v “ v1 ` ¨ ¨ ¨ ` vk with vi P Hi0 . Then }gv} ď k ÿ i“1 }gvi } “ k ÿ }vi } 0 q . sin >o pgpvi q, H10 ‘ ¨ ¨ ¨ ‘ Hi´1 i“1 For each i, orthogonality yields }vi } ď }v}; moreover, 0 >o pgpvi q, H10 ‘ ¨ ¨ ¨ ‘ Hi´1 q 0 ě >o pHi ‘ ¨ ¨ ¨ ‘ Hd , H10 ‘ ¨ ¨ ¨ ‘ Hi´1 q “ >o pEpi , Fd´pi q ě min >o pEp , Fd´p q . αp Pθ Therefore we obtain }g} ď d . sin min >o pEp , Fd´p q αp Pθ Taking log, Lemma 7.1 yields the second inequality.  7.13. Regular quasi-geodesics and the Morse Lemma of Kapovich–Leeb– Porti. Let I Ă Z be an interval and let µ, c be positive numbers. A pµ, cq-quasigeodesic is a map x : I Ñ Xd (also denoted by txn unPI ) such that for all n, m P I one has 1 |n ´ m| ´ c ď dXd pxn , xm q ď µ|n ´ m| ` c. µ Let C Ă a` be a closed cone. Following [KLP2 ] we will say that a quasi-geodesic segment txn u is C -regular if for all n ă m P I one has apxn , xm q P C . Denote by θC “ tα P Π : ker α X C “ t0uu. We state the following version of the Morse Lemma [KLP2 , Theorem 1.3], specialized to the symmetric space of PSLpd, Rq: Theorem 7.3 (Kapovich–Leeb–Porti [KLP2 ]). Let µ, c be positive numbers and C Ă a` a closed cone. Then there exists C ą 0 such that if txn unPI is a C -regular pµ, cq-quasi-geodesic segment, then - If I is finite then txn u is at distance at most C from the diamond ♦θC pxmin I , xmax I q. 40 J. BOCHI, R. POTRIE, AND A. SAMBARINO - If I “ N then there exists F P FθC such that txn u is contained in a Cneighborhood from the Weyl cone V pxmin I , F q. p2q - If I “ Z then there exists pE, F q P FθC such that txn u is contained in a C-neighborhood from the union V pz, Eq Y V pz, F q for some z P P pE, F q at uniform distance from txn u. Proof. We can assume that 0 P I and that x0 “ o. Consider then a sequence thn unPI Ă PSLpd, Rq such that hn ¨ o “ xn . Since txn u is a quasi-geodesic, equation 7.4 implies |aph´1 n`1 hn q|o “ |aphn ¨ o, hn`1 ¨ oq|o “ dXd pxn , xn`1 q ď µ ` c. If we denote by gn “ h´1 n`1 hn , then the last equation implies that tgn u lies in a compact subset of PGLpd, Rq. Moreover, if m ě n then apgm ¨ ¨ ¨ gn q “ aph´1 m`1 hn q “ apxm`1 , xn q P i C . One has the following: 1. The sequence tgn unPI is i α-dominated for all α P θC : indeed, since C is closed and does not intersect ker α ´ t0u, one has i C X ker i α “ t0u and hence there exists δ ą 0 such that for all a P i C ´ t0u and α P θC one has Thus, one concludes that i αpaq ą δ|a|o . αpapgm ¨ ¨ ¨ gn qq “ αpapxm`1 , xn qq ą δ|apxm`1 , xn q|o ą pδ{µq|n ´ m| ´ δc. This is to say, the sequence tgn unPI belongs to the space Dpµ ` c, d ´ p, δ{µ, e´cδ , Iq for all p such that αp P θC , using the operator norm } }o associated to o. 2. Subsection 7.10 implies that the (partial) flag at infinity associated to the Weyl cone VθC po, xm`1 q is: - U po, xm`1 qθC “ ´1 tUαo phm`1 quαPθC “ tUαo pg0´1 ¨ ¨ ¨ gm quαPθC “ tSioα pgm . . . g0 quαPθC for m ě 0, - U po, x´m qi θC “ tUioα ph´m quαPθC “ tUioα pg0 ¨ ¨ ¨ g´m quαPθC for m ě 0. Consider `1 given simultaneously by Lemmas 2.5 and A.12 for all p such that αp P θC and constants µ ` c, δ{µ, and e´cδ . Assume that the interval of integers r´`1 , `1 s Ă I (i.e. I is long enough). Item 2 and Lemma 2.5 imply the existence of δ0 such that for all m and ´n in I with m, n ě `1 one has >o pU po, xm qθC , U po, x´n qi θC q ą δ0 . Moreover, by Lemma A.12 one has >o pU po, x`1 qθC , U po, xm qθC q ă ε and the same occurs with U po, x´`1 qi θC and U po, x´n qi θC . Proposition 7.2 implies thus that for all m, ´n P I with n, m ě `1 the distance between o and the parallel set P pU po, xm qθC , U po, x´n qi θC q is bounded above by a number C, depending on µ, c, the cone C and a priori the point o, but independent of the quasi-geodesic through o. Since Xd is PSLpd, Rq-homogeneous and this action is by isometries, one concludes that for any k such that rk ´ `1 , k ` `1 s Ă I, one has dXd pxk , P pU pxk , xm qθC , U pxk , x´n qi θC qq ă C, (7.6) ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 41 provided m ě k ` `1 and ´n ď k ´ `1 . U po, xm q “ S o pgm´1 ¨ ¨ ¨ g0 q xm xm´1 ď c1 ´ c log mintsin >o pU o pg0 ¨ ¨ ¨ g´n q, S o pgm´1 ¨ ¨ ¨ g0 qqu x0 “ o x´n U po, x´n q “ U o pg0 ¨ ¨ ¨ g´n q Figure 8. The flag at infinity associated to the Weyl cone VθC po, xm q (resp. Vi θC po, xm q) corresponds to the S o flag of a dominated sequence for m ě 0, resp. to the U o flag when m ď 0. We now split between the three cases of the statement, in increasing difficulty. If I “ Z, denote by F “ E cu ptgi uq “ lim U po, x´n qi θC nÑ8 and by E “ E cs ptgi uq “ lim U po, xm qθC . mÑ8 Recall that E ‘ E is a dominated splitting for the cocycle ϑ (recall subsection 2.3), in particular it is equivariant. Hence, if k ą 0 then cu cs cu cu h´1 k F “ gk ¨ ¨ ¨ g0 E ptgi uiPZ q “ E ptgi´k uiPZ q cs and h´1 k E “ gk ¨ ¨ ¨ g0 E ptgi´k uiPZ q. Consequently, the angle ´1 >o ph´1 k F, hk Eq ą δ. Thus ´1 dphk ¨ o, P pE, F qq “ dpo, P ph´1 k F, hk Eqq ă C. The same argument works for k ă 0 and we have thus shown that txi uiPZ is at Hausdorff distance at most C from the parallel set P pF, Eq. If I “ N. Let us assume for simplicity that I “ r´`1 , 8qXZ. The flag U po, xm qθC is convergent as m Ñ 8, to a flag E P FθC . We have to show that, for all k ą 0 the xk angle >xk pU pxk , oqi θC , Eq is bounded below by a constant independent of k. As before, we know that if k ě `1 and m ě k ` `1 then >xk pU pxk , oqi θC , U pxk , xm qθC q ą δ. For a homothety class x P Xd denote by` dx the distance on FθC˘ induced by an inner product in x. We will show that dxk U pxk , xm qθC , U po, xm qθC goes to zero as m Ñ 8, and thus the angle >xk pU pxk , oqi θC , Eq will be bounded below uniformly. 42 J. BOCHI, R. POTRIE, AND A. SAMBARINO θC Recall that, by definition U pxk , xm qθC “ hk U o ph´1 hence k hm q θC o θC dxk pU pxk , xm qθC , U po, xm qθC q “ dhk ¨o phk U o ph´1 k hm q , U phm q q ´1 o θC θC “ do pU o ph´1 k hm q , hk U phm q q. ´1 o θC θC Since k is fixed, Lemma A.5 implies that do pU o ph´1 k hm q , hk U phm q q Ñ 0 as m Ñ 8. Let us now show that given ε ą 0 there exists L P N (depending on the quasigeodesic constants and C ) such that if k ě L one has ` ˘ dxk U pxk , x´`1 qi θC , U po, x´`1 qi θC ă ε, this will conclude the proof in this case since every txi uiPN will be at bounded distance from a Weyl cone pointing to E in the parallel set P pU po, x´`1 qi θC , Eq. One has ` ˘ ` ˘ i θC dxk U pxk , x´`1 qi θC , U po, x´`1 qi θC “ dhk ¨o hk U o ph´1 , U o ph´`1 qi θC k h´`1 q ` ˘ i θC o i θC “ do U o ph´1 , h´1 . k h´`1 q k U ph´`1 q Since i θC >o pU o ph´`1 qi θC , S o ph´1 q “ >o pU o ph´`1 qi θC , U o phk qθC q ą δ, k q Lemmas A.6 and A.9 imply the desired conclusion. If I is finite, notice that in the last paragraph we proved the following: given ε ą 0 there exists L P N such that for all k P I with k ´ L ě min I one has ` ˘ dxk U pxk , xmin I qi θC , U pxmin I`L , xmin I qi θC ă ε. Analogously, for every k P I with k ` L ď max I one has ` ˘ dxk U pxk , xmax I qθC , U pxmax I´L , xmax I qθC ă ε. Hence, for every k with min I ` L ă k ă max I ´ L one has ˘ ` >xk U pxmin I`L , xmin I qi θC , U pxmax I´L , xmax I qθC ` ˘ ě >xk U pxk , xmin I qi θC , U pxk , xmax I qθC ´ 2ε ą δ ´ 2ε. Choosing ε such that δ ´ 2ε ą 0 completes the proof.  8. When the target group is a semi-simple Lie group The purpose of this section is to extend the main results in the previous sections to the situation where the target group is a real-algebraic semi-simple Lie group without compact factors. We will begin by recalling the general structure theory of these groups, needed to define concepts such as domination, Anosov representation, regular quasi-geodesic . . . This basic structure theory can be found in [Hum1 ], [Ebe], [Hel]. We will then explain how the representation theory of these groups is used to reduce the general case to the PSLpd, Rq case, for a well chosen d. Section 7 mimics, for PSLpd, Rq, the general structure presented here. The first main goal is subsection 8.5, where Theorem 3.2 and Proposition 4.9 are extended to the general setting. This general case is reduced to the actual statement of 3.2 and 4.9 using Tits representations. The remainder of the section is devoted to a new proof of the Morse Lemma of [KLP2 ] for symmetric spaces of non-compact type. In contrast with subsection ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 43 8.5, a simple reduction to the PSLpd, Rq-case is not sufficient, one needs to have a finer control of distances to parallel sets when embedding symmetric spaces. This is achieved in Corollary 8.8. If G is a Lie group with Lie algebra g, the Killing form of g is the symmetric bilinear form defined by κpv, wq “ Tracepadv adw q. The group G is semi-simple if κ is non-degenerate. We will assume from now on that G is a semi-simple, real-algebraic (i.e. defined by polynomial equations with real coefficients) Lie group, without compact factors (i.e. there is no normal subgroup H of G such that G{H is compact). 8.1. Root system. A Cartan involution of g is a Lie algebra morphism o : g Ñ g with o2 “ 1 and such that the bilinear form pv, wq ÞÑ ´κpv, opwqq is positive definite. The fixed point set ko “ tv P g : ov “ vu is the Lie algebra of a maximal compact subgroup K o . Consider po “ tv P g : ov “ ´vu and note that g “ ko ‘ po . A computation shows that rpo , po s Ă ko and hence any subalgebra of po is necessarily abelian. Let a Ă po be a maximal abelian subalgebra. Denote by Σ the set of restricted roots of a on g. By definition, Σ “ tα P a˚ ´ t0u : gα ‰ 0u where gα “ tw P g : ra, ws “ αpaqw @a P au. The closure of a connected component of ď a´ ker α αPΣ is called a closed Weyl chamber. Fix a closed Weyl chamber a` and let Σ` “ tα P Σ : α|a` ě 0u be the set of positive roots associated to a` . The set Σ` contains a subset Π that verifies - Π is a basis of a as a vector space, - every element of Σ` has non-negative coefficients in the basis Π. The set Π is called the set of simple (restricted) roots determined by Σ` , the sets ker α X a` for α P Π, are the walls of the chamber a` . The Weyl group W of Σ is defined as the group generated by the orthogonal reflections on the subspaces tker α : α P Σu. The reflections associated to elements of Π span W . With respect to the wordlength on this generating set, there exists a unique longest element in W , denoted by u0 : a Ñ a. This is the unique element in W that sends a` to ´a` . The opposition involution i : a Ñ a is defined by i “ ´u0 . If we denote by p¨, ¨q the bilinear form on a˚ dual to the Killing form, define xχ, ψy “ 2pχ, ψq pψ, ψq 44 J. BOCHI, R. POTRIE, AND A. SAMBARINO for χ, ψ P a˚ , and let tωα uαPΠ be the dual basis of Π, i.e. xωα , βy “ δαβ . The linear form ωα is the fundamental weight associated to α. Note that for every χ P a˚ one has ÿ xχ, αy ωα . (8.1) χ“ αPΠ Denote by a “ aG : G Ñ a` the Cartan projection of G. By definition, for every g P G one has g P K o exp apgq K o and apg ´1 q “ i apgq. 8.2. Parabolic subgroups. À Denote by M the centralizer of exp a in K and by N “ exp n` where n` “ αPΣ` gα . The group PΠ “ M exp a N is called a minimal parabolic subgroup and its Lie algebra is pΠ “ g0 ‘ n` . A parabolic subgroup of G is a subgroup that contains a conjugate of PΠ . Two parabolic subgroups are opposite if their intersection is a reductive group.20 To each subset θ of Π one associates two opposite parabolic subgroups of G, Pθ and Pˇθ , whose Lie algebras are, by definition, à à pθ “ g0 ‘ gα ‘ g´α , αPΣ` and p̌θ “ g0 ‘ à αPΣ` αPxΠ´θy g´α ‘ à gα , αPxΠ´θy where xθy is the set of positive roots generated by θ. Every pair of opposite parabolic subgroups of G is conjugate to pPθ , P̌θ q for a unique θ, and every opposite parabolic subgroup of Pθ is conjugate to Pi θ : the parabolic group associated to i θ “ tα ˝ i : α P θu. The quotient space F “ FΠ “ G{PΠ is called the flag space of G and if θ Ă Π then Fθ “ G{Pθ is called a partial flag space of G. Note that if θ Ă θ1 Ă Π one has Pθ1 Ă Pθ and there is hence a canonical projection Fθ1 Ñ Fθ , denoted by x ÞÑ xθ . p2q Finally, denote by Fθ Ă Fθ ˆ Fi θ the space of pairs of opposite parabolic subgroups (of type θ), this is the unique open G-orbit on Fθ ˆ Fi θ . 8.3. Representations of G. Let Λ : G Ñ PSLpV q be a finite dimensional rational21 irreducible representation and denote by φΛ : g Ñ slpV q the Lie algebra homomorphism associated to Λ. Then χ P a˚ is a restricted weight of Λ if the vector space Vχ “ tv P V : φΛ paqv “ χpaqv @a P au is non zero. Theorem 7.2 of Tits [Ti] states that the set of weights has a unique maximal element with respect to the order χ ě ψ if χ ´ ψ is positive on a` . This is called the highest weight of Λ and denoted by χΛ . Note that if χ is a restricted weight and v P Vχ then, for n P gα with α P Σ one has that φΛ pnqv is an eigenvector of φΛ paq of eigenvalue χ`α, 22 unless φΛ pnqv “ 0. Since for all β P Σ` one has χΛ ` β ě χΛ and χΛ is maximal, one concludes that χΛ ` β is not a weight, i.e. for all n P gβ and v P VχΛ one has φΛ pnqv “ 0. Let θΛ Ă Π be the set of simple roots α such that χΛ ´ α is still a weight of Λ. 20Recall that a Lie group is reductive if its Lie algebra splits as a semi-simple algebra and an abelian algebra. 21i.e. a rational map between algebraic varieties. 22Indeed, this follows from φ pra, nsqv “ αpaqφ pnqv. Λ Λ ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 45 Remark 8.1. The subset θΛ is the smallest subset of simple roots such that the following holds. Consider α P Σ` , n P g´α and v P VχΛ , then φΛ pnqv “ 0 if and only if α P xΠ ´ θΛ y. Equivalently, the smallest parabolic subgroup P of G stabilizing VχΛ is of type θΛ . Remark 8.2. Since V is irreducible, the φΛ paq-eigenspaces `ź ˘ φΛ pniαα q VχΛ αPΠ span V and thus any other weight of Λ is of the form ÿ kα α, χΛ ´ (8.2) αPΠ where kα ě 0 and neously vanish). ř αPθΛ kα ‰ 0 (i.e. the numbers kα , for α P θΛ , do not simulta- Consider an inner product on V invariant under ΛK o such that Λ exp a is symmetric, and denote by Λo its homothety class. For the Euclidean norm } } induced by this scalar product, one has log }Λg} “ χΛ papgqq. (8.3) If g “ kpexp apgqql with k, l P K o , then for all v P l´1 VχΛ one has }Λgpvq} “ }Λg}}v}. If we denote by ` “ dim VχΛ then Remark 8.2 implies that for all g P G one has α` papΛgqq “ a` pΛgq ´ a``1 pΛgq “ βpapgqq (8.4) for some β P θΛ (depending on g). Denote by WχΛ the Λpexp aq-invariant complement of VχΛ . The space WχΛ is Λo-orthogonal to VχΛ . Its stabilizer (in G) is opposite to P , and hence conjugated to Pi θΛ . Thus, one has a map of flag spaces p2q p2q ˚ pξΛ , ξΛ q : FθΛ Ñ Ftαp u . (8.5) This is a proper embedding which is a homeomorphism onto its image. 8.4. A set of representations defined by Tits. One has the following proposition by Tits (see also Humphreys [Hum2 , Chapter XI]). Proposition 8.3 (Tits [Ti]). For each α P Π there exists a finite dimensional rational irreducible representation Λα : G Ñ PSLpVα q, such that χΛα is an integer multiple of the fundamental weight ωα and dim VχΛα “ 1. Such a set of representations is not necessarily unique but will be fixed from now on, also we will say that Λα is the Tits representation of G associated to α. Observe that equation (8.4) implies that for all g P G one has a1 pΛα gq ´ a2 pΛα gq “ αpapgqq. (8.6) 46 J. BOCHI, R. POTRIE, AND A. SAMBARINO 8.5. Dominated representations: reduction to the GLpd, Rq case. A representation ρ : Γ Ñ G is θ-dominated if there exist positive constants µ and c such that for all α P θ and γ P Γ one has αpapργqq ě µ|γ| ´ c. Assume that ρ is a θ-dominated representation. Then for all α P θ, the representation Λα ρ : Γ Ñ PSLpVα q is 1-dominated in the sense of Subsection 3.1. Indeed, equation (8.6) implies that log σ1 pΛα ρpγqq ´ log σ2 pΛα ρpγqq “ αpapργqq ě µ|γ| ´ c, or equivalently σ2 pΛα ρpγqq ď ec e´µ|γ| . σ1 pΛα ρpγqq Thus, Theorem 3.2 implies that Γ is word-hyperbolic. Moreover, Proposition 4.9, together with Guichard-Wienhard [GW, Proposition 4.3], imply that ρ is Pθ Anosov23. Thus, Theorem 3.2, Proposition 4.9 together with [GW, Proposition 4.3] and Tits representations 8.3 prove the following. Theorem 8.4. Let ρ : Γ Ñ G be a θ-dominated representation, then Γ is wordhyperbolic and ρ is Pθ -Anosov. 8.6. A Plücker representation. Given θ Ă Π one can construct a rational irreducible representation of G such that Pθ is the stabilizer of a line, and hence P̌θ will be the stabilizer of a hyperplane.24 More precisely, one has the following result from representation theory (see Guichard-Wienhard [GW, §4]). Proposition 8.5. Given θ Ă Π, there exists a finite dimensional rational irreducible representation Λ : G Ñ PSLpV q and ` P PpV q such that Pθ “ tg P G : Λ gp`q “ `u. Such a representation can be defined as follows: if we denote by k “ dim pθ then the composition Λk Ad : G Ñ PSLpΛk gq verifies the desired conditions, except (maybe) irreducibility, this is fixed by considering the vector space V spanned by the G-orbit of the line ` “ Λk pθ , V “ xΛk Ad G ¨ `y, and considering the restriction of Λk Ad G to V . A representation verifying the statement of Proposition 8.5 will be called a Plücker representation of G associated to θ. For such a representation one has p2q a continuous equivariant map pξ, ξ ˚ q : Fθ Ñ Pp2q pV q which is a homeomorphism onto its image. 23See [Lab] or [GW] for a precise definition. 24There are actually infinitely many such representations. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 47 8.7. The symmetric space. The symmetric space of G is the space of Cartan involutions on g, and is denoted by X. This a G-homogeneous space, and the stabilizer of o P X is the compact group K o , whose lie algebra is ko . The tangent space To X is hence identified with po . The G-invariant Riemannian metric on X is the restriction of the Killing form κ to po ˆ po . If dX is the distance on X induced by κ|po ˆ po , then the Euclidean norm } }o induced on a is invariant under the Weyl group, and for all a P a one has dX po, pexp aq ¨ oq “ }a}o . The Cartan decomposition of G implies hence that for all g P G one has dX po, g ¨ oq “ }apgq}o . Consider the map a : X ˆ X Ñ a` defined by apg ¨ o, h ¨ oq “ apg ´1 hq. Note that a is G-invariant for the diagonal action of G on X ˆ X, that and that ipapp, qqq “ apq, pq. dX pp, qq “ }app, qq}o (8.7) 8.8. Flats. A parametrized flat is a map f : a Ñ X of the form fpvq “ g exppvq¨o for some g P G. Observe that G acts transitively on the set of parametrized flats and that the stabilizer of f0 : v ÞÑ exppvq ¨ o is the group M of elements in K commuting with exppaq. We will hence identify the space of parametrized flats with G{M . Two parametrized flats f, g are equivalent if the function a Ñ R, defined by ` v ÞÑ dX pfpvq, gpvqq, is bounded on a . The Furstenberg boundary of X is the space of equivalence classes of parametrized flats. It is a standard fact that this space is G-equivariantly identified with F “ G{PΠ , thus the Furstenberg boundary will also be denoted by F . Denote by Z : tparametrized flatsu Ñ F the canonical projection and by Žpfq “ Zpf ˝ iq. The pair pŽpfq, Zpfqq belongs to F p2q . The following proposition is standard. Proposition 8.6 (see [GJT, Chapter III]). (i) A pair pp, xq P X ˆ F determines a unique parametrized flat f such that fp0q “ p and Zpfq “ x. (ii) A point px, yq P F p2q determines a unique maximal flat fxy paq such that Žpfxy q “ x and Zpfxy q “ y. Given a subset of simple roots θ Ă Π and a pair of partial flags in general position p2q px, yq P Fθ the parallel set P px, yq from x to y is ď fpaq, f where the union is indexed on all parametrized flats f with Žpfqθ “ x and Zpfqi θ “ y. 8.9. Representations and distances to parallel sets. The purpose of this Subsection are the following proposition and corollary. Only the statement of Corollary 8.8 will be needed in the sequel. If Λ : G Ñ PSLpV q is a finite dimensional rational irreducible representation, denote by Λ : X Ñ XV the induced map between symmetric spaces and DΛ : TX Ñ TXV be its differential mapping. The map Dp Λ is φΛ |pp : pp Ñ pΛp . 48 J. BOCHI, R. POTRIE, AND A. SAMBARINO Proposition 8.7. Let Λ : G Ñ PSLpV q be a finite dimensional rational irreducible p2q representation. Then, there exists a constant δ ą 0 such that if px, yq P FθΛ and p P P px, yq then ˘ ˘ ` ` ˚ yq ą δ, > Dp Λ pTp P px, yqqK , TΛp P pξΛ x, ξΛ where > denotes the angle on TΛp XV . Corollary 8.8. Let Λ : G Ñ PSLpV q be an injective finite dimensional irreducible p2q representation. Then there exists c ą 0 such that if o P X and px, yq P FθΛ , then 1 ˚ ˚ yqq. yqq ď dX po, P px, yqq ď cdXV pΛo, P pξΛ x, ξΛ dX pΛo, P pξΛ x, ξΛ c V Let us show how Proposition 8.7 implies the corollary. Proof. Since G has no compact factors X is non-positively curved. Hence, since P px, yq is totally geodesic, the distance from o to P px, yq is attained at a unique point p P P px, yq. Moreover, the geodesic segment σ : I Ñ X, from p to o is orthogonal to P px, yq at p, i.e. σp0q 9 P Tp P px, yqK . Similarly, the distance from Λo ˚ to P pξΛ x, ξΛ yq is also attained at a unique point q and the geodesic segment from ˚ yq. q to Λo is perpendicular to P pξΛ x, ξΛ Since ΛX is totally geodesic in XV , we can estimate the angle at the vertex Λp of the geodesic triangle tΛo, Λp, qu. Indeed, Proposition 8.7 implies that this angle is bounded below by δ ą 0, independently of o and px, yq. Since the angle at the vertex q is π{2, a CAT(0) argument completes the proof.  The remainder of the subsection is devoted to the proof of Proposition 8.7. p2q Proof. Let Lpx, yq be the stabilizer in G of px, yq P FθΛ and let l be its Lie algebra. ˚ ˚ yq and l1 Ă slpV q yq be the stabilizer in PSLpV q of pξΛ x, ξΛ Moreover, let LpξΛ x, ξΛ its Lie algebra. If lK denotes the orthogonal of l with respect to the Killing form κ, then we will show that φΛ plK q X l1 “ t0u. (8.8) p This will imply the proposition since if p P P px, yq then Tp P px, yq “ p X l, its orthogonal in Tp X is hence pp X lK and given q P P px, yq there exists g P Lpx, yq such that gp “ q, thus the angle >ppΛp X φΛ plK q, pΛp X l1 q ě >pφΛ ppp X lK q, pΛp X l1 q is independent of p in P px, yq. We will hence show that equation (8.8) holds. Note that, by homogeneity, we can assume that the stabilizer of x is PθΛ and that the stabilizer of y is P̌θΛ . The parallel set P px, yq is hence the orbit LθΛ ¨ o, where LθΛ is the Levi group Pθ X P̌θ . An explicit computation shows that for α, β P Σ, the eigenspaces gα and gβ (recall Subsection 7.1) are orthogonal with respect to the Killing form κ, whenever α ‰ ´β. If we denote by gtα,´αu “ gα ‘ g´α then the decomposition à g “ g0 ‘ gtα,´αu αPΣ` is orthogonal with respect to κ. Note that the Cartan involution o sends gα to g´α and hence gtα,´αu is oinvariant. Since ´κp¨, op¨qq is positive definite and κ|gα “ 0 one concludes that ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 49 po X gtα,´αu ‰ t0u. One finds then a orthogonal decomposition of the tangent space to X at o, à o To X “ po “ a ‘ p X gtα,´αu . (8.9) αPΣ` The Lie algebra of LθΛ is lθΛ “ g0 ‘ and hence the decomposition g “ lθΛ ‘ à αPxΠ´θΛ y à gtα,´αu αPΣ` ´xΠ´θΛ y gtα,´αu is orthogonal with respect to κ. This is to say à lK gtα,´αu . θΛ “ (8.10) αPΣ` ´xΠ´θΛ y Denote by ` “ dim VχΛ and note that l1 is the Lie algebra of the stabilizer of p2q pVχΛ , WχΛ q P Ftα` u . Choose a Cartan algebra aE of slpV q and a Weyl chamber a` E such that25 (recall section 8.2): - the Lie algebra ptα` u is the Lie algebra of the parabolic group stabilizing V χΛ , - the Lie algebra p̌tα` u is the Lie algebra of the parabolic group stabilizing W χΛ . 1 The Lie algebra l1 is thus ptα` u X p̌tα` u . In order to show that φΛ plK θΛ q X l “ t0u the following lemma is sufficient. ˜ ¸ à Lemma 8.9. The subspace φΛ g´α has trivial intersection with αPΣ` ´xΠ´θΛ y ptα` u . Proof. Recall that ptαp u “ aE ‘ à βPΣ` V slpV qβ ‘ à βPxΠV ´tαl uy slpV q´β , where Σ` V and ΠV are the set of positive, resp. simple, roots associated to the choice of a` . E Consider then α P Σ` ´ xΠ ´ θΛ y and n P g´α . Remark 8.1 implies that if v P VχΛ then φΛ pnqv ‰ 0, Hence, à à φΛ pnq R aE ‘ slpV qβ ‘ slpV q´β . βPΣ` V βPxΠV ´tαl uy Let tγi uk1 Ă Σ` ´ xΠ ´ θΛ y be pairwise distinct and consider nγi P g´γi ´ t0u. Then φΛ pnγi qv is a non-zero eigenvector of a of eigenvalue χ ´ γi , hence φΛ pnγ1 ` ¨ ¨ ¨ ` nγk qv “ φΛ pnγ1 qv ` ¨ ¨ ¨ ` φΛ pnγk qv ‰ 0. This proves the lemma. 25It suffices to choose a Λo-orthogonal set of dim V lines E such that E Ă V χΛ Y WχΛ .  50 J. BOCHI, R. POTRIE, AND A. SAMBARINO As an example, consider the irreducible representation (unique up to conjugation) Λ : PSLp2, Rq Ñ PSLp3, Rq. Explicitly Λ is the action of PSLp2, Rq on the symmetric power S2 pR2 q, which is a 3-dimensional space spanned by te1 b e1 , e1 b e2 , e2 b e2 u, where e1 “ p1, 0q and e2 “ p0, 1q. ` 0 ˘ The group Lpxe1 y, xe2 yq has Lie algebra l “ a “ x 10 ´1 y, its orthogonal with respect to the Killing form of PSLp2, Rq is aK “ xp 00 10 q , p 01 00 qy. The group Lpxe1 b e1 y, xe1 b e2 , e2 b e2 yq has Lie algebra A´ 1 0 0 ¯ ´ 1 0 0 ¯ ´ 0 0 0 ¯ ´ 0 0 0 ¯ ´ 0 0 0 ¯E 0 ´1 0 , 0 0 0 l1 “ , 01 0 , 001 , 000 . 0 0 ´1 0 0 0 1 0 0 ´1 000 010 The orthogonal complement of l with respect to the Killing form of PSLp3, Rq is A´ 0 1 0 ¯ ´ 0 0 1 ¯ ´ 0 0 0 ¯ ´ 0 0 0 ¯E 000 , 000 , 100 , 000 . l1K “ 100 000 000 000 ´ ¯ 1 t t2 An explicit computation shows that Λ p 10 1t q “ 0 1 t , hence 00 1 ´0 1 0¯ 0 1 φΛ p 0 0 q “ 0 0 1 000 1K which does not belong to l . Nevertheless, it does not belong to l1 either, which gives the definite angle of Proposition 8.7. 8.10. Gromov product and representations. Consider θ Ă Π and denote by č aθ “ ker α αPΠ´θ the Lie algebra of the center of the reductive group Lθ “ Pθ X P̌θ . Recall from [Sa] that the Gromov product 26 based on o P X is the map p2q p¨|¨qo : Fθ Ñ aθ defined by the unique vector px|yqo P aθ such that ˚ ωα ppx|yqo q “ ´ log sin >Λα o pξΛα x, ξΛ yq “ ´ log α |ϕpvq| }ϕ}Λα o }v}Λα o for all α P θ, where ωα is the fundamental weight of Λα , v P ξΛα x ´ t0u and ˚ ker ϕ “ ξΛ y. α Remark 8.10. Note that ˚ max ωα ppx|yqo q “ ´ log min sin >Λα o pξΛα x, ξΛ yq. α αPθ αPθ (8.11) Note also that, since tωα |aθ uαPθ is a basis of aθ , the right hand side of equation (8.11) is comparable to the norm }px|yqo }o . As suggested by the notation, the Gromov product is independent on the choice of Tits’s representations of G, moreover, it keeps track of Gromov products for all irreducible representations of G. Indeed one has the following consequence of equation (8.3). 26This is the opposite of the one defined in [Sa]. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 51 Remark 8.11. Let Λ : G Ñ PSLpV q be a finite dimensional rational irreducible p2q representation with dim VχΛ “ 1. If px, yq P FθΛ then27 ÿ ˚ yqΛo “ χΛ ppx|yqo q “ xχΛ , αy ωα ppx|yqo q. pξΛ x|ξΛ αPθΛ Note that, by definition of θΛ (recall Subsection 8.3), the coefficients in the last equation are all strictly positive. 8.11. Gromov product and distances to parallel sets. The aim of this subsection is to prove the following. Proposition 8.12. Given θ Ă Π there exist c ą 1 and c1 ą 0 only depending on G p2q such that for all px, yq P Fθ one has 1 }px|yqo }o ď dX po, P px, yqq ď c}px|yqo }o ` c1 . c Proof. As for PSLpd, Rq, the first inequality follows easily. Let us show the second one. Let Λ : G Ñ PSLpV q be a Plücker representation of G associated to the set θ, (recall Subsection 8.6). Corollary 8.8 implies that there exists c0 such that for all p2q o P X and px, yq P FθΛ one has ˚ dX po, P px, yqq ď c0 dXV pΛo, P pξΛ x, ξΛ yqq. ˚ Note that ξΛ x P PpV q and that ξΛ y P PpV ˚ q, Proposition 7.2 applied to the set tα1 u Ă ΠV implies that ˚ ˚ dXV pΛo, P pξΛ x, ξΛ yqq ď cpξΛ x|ξΛ yqΛo ` c1 . Finally, Remark 8.11 states that ˚ pξΛ x|ξΛ yqΛo “ ÿ αPθ xχΛ , αy ωα ppx|yqo q, where xχΛ , αy ą 0 for all α P θ, thus, this last quantity is comparable to }px|yqo }. This completes the proof.  8.12. The Morse Lemma of Kapovich–Leeb–Porti. Let us begin with some p2q definitions. Consider p, q P X, θ Ă Π and px, yq P Fθ . Ť - The Weyl cone V pp, xq through p and x is f fpa` q, where the union is indexed on all parametrized flats f with fp0q “ p and Zpfqθ “ x. - Let θpp, qq “ tα P Π : αpapp, qqq ‰ 0u and let U pp, qq P Fθpp,qq be the flag determined by Zpfqθpp,qq “ U pp, qq for every parametrized flat with fp0q “ p and q P fpa` q. - If θ Ă θpp,qq the Weyl cone Vθ pp, qq through p and q (in that order) is ď fpa` q, f where the union is indexed on all parametrized flats f with fp0q “ p, and Zpfqθ “ U pp, qqθ . - Finally, if θ Ă θpp,qq the θ-diamond between p and q is the subset ♦θ pp, qq “ Vθ pp, qq X Vi θ pq, pq. 27We have identified a tα1 u with R via ωα1 . 52 J. BOCHI, R. POTRIE, AND A. SAMBARINO If C Ă a` is a closed cone, consider the subset θC “ tα P Π : ker α X C “ t0uu. Let I Ă Z be an interval. Following [KLP2 ] we will say that a quasi-geodesic segment tpn uI Ă X is C -regular if for all n ă m one has appn , pm q P C . One has the following version of the Morse Lemma. Theorem 8.13 ([KLP2 , Theorem 1.3]). Let µ, c be positive numbers and C Ă a` a closed cone, then there exists C ą 0 such that if tpn unPI is a C -regular pµ, cqquasi-geodesic segment, then - If I is finite then tpn u is at distance at most C from the diamond ♦θC ppmin I , pmax I q. - If I “ N then there exists x P FθC such that tpn u is contained in a Cneighborhood from the Weyl cone VθC ppmin I , xq. p2q - If I “ Z then there exist two partial flags in general position px, yq P FθC such that tpn u is contained in a C-neighborhood from the union VθC pz, xq Y Vi θC pz, yq for some z P P px, yq at uniform distance from tpn u. Proof. Let Λ : G Ñ PSLpV q be a Plücker representation associated to θC . If tpn u is a C -regular quasi geodesic then tΛpn u is a ΛC -regular quasi-geodesic. Moreover, equation (8.4) implies that the cone ΛC does not intersect the wall ker α1 . The proof now follows the same lines as the proof of Theorem 7.3, provided Proposition 8.12.  Appendix A. Auxiliary technical results In this appendix we collect a number of lemmas that are used elsewhere in the paper. These lemmas are either quantitative linear-algebraic facts or properties of dominated splittings. Certainly many of these results are known, but they do not necessarily appear in the literature in the exact form or setting that we need; therefore we include proofs for the reader’s convenience. A.1. Angles, Grassmannians. The angle between non-zero vectors v, w P Rd is defined as the unique number >pv, wq in r0, πs whose cosine is xv, wy{p}v} }w}q. If P , Q Ă Rd are nonzero subspaces then we define their angle as: >pP, Qq :“ min min >pv, wq , vPP ˆ wPQˆ (A.1) where P ˆ :“ P r t0u. We also write >pv, Qq instead of >pRv, Qq, if v is a nonzero vector. Given integers 1 ď p ă d, we let Gp pRd q be the Grassmaniann formed by the p-dimensional subspaces of Rd . Let us metrize Gp pRd q in a convenient way. If p “ 1, the sine of the angle defines a distance. (We leave for the reader to check the triangle inequality.) In general, we may regard each element of Gp pRd q as a compact subset of G1 pRd q, and then use the Hausdorff metric induced by the distance on G1 pRd q. In other words, we define, for P , Q P Gp pRd q: " * :“ dpP, Qq max max min sin >pv, wq, max min sin >pv, wq . (A.2) vPP ˆ wPQˆ wPQˆ vPP ˆ Note the following trivial bound: dpP, Qq ě sin >pP, Qq . (A.3) ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 53 In fact, the following stronger fact holds: for any subspace Q̃ Ă Rd (not necessarily of dimension p), Q̃ X Q ‰ t0u ñ dpP, Qq ě sin >pP, Q̃q . (A.4) Actually the two quantities between curly brackets in the formula (A.2) coincide, that is, (A.5) dpP, Qq “ max min sin >pv, wq “ max sin >pw, P q . wPQˆ wPQˆ vPP ˆ This follows from the existence of a isometry of Rd that interchanges P and Q (see [Wo, Theorem 2]). As the reader can easily check, relation (A.5) can be rewritten in the following ways: dpP, Qq “ max max cos >pu, wq , wPQˆ uPpP K qˆ “ max min wPQˆ vPP }v ´ w} , }w} (A.6) (A.7) where P K denotes the orthogonal complement of P . As a consequence of (A.1) and (A.6), we have: dpP, Qq “ cos >pP K , Qq . (A.8) Another expression for the distance dpP, Qq is given below in (A.26). A finer description of the relative position of a pair of elements in the Grassmannian is given by the next proposition: Proposition A.1 (Canonical angles between a pair of spaces). Let P , Q P Gp pRd q. Then there exist: ‚ numbers β1 ě β2 ě ¨ ¨ ¨ ě βp P r0, π{2s, called canonical angles, and ‚ orthonormal bases tv1 , . . . , vp u and tw1 , . . . , wp u of P and Q respectively, such that, for every i, j P t1, . . . , pu, # βi if i “ j, >pvi , wj q “ π{2 if i ‰ j, and moreover: ‚ if p ą d{2 then βd´p`1 “ βd´p`2 “ ¨ ¨ ¨ “ βp “ 0; ‚ dpP, Qq “ sin β1 . The proof of the proposition is a simple application of the singular value decomposition: see [Ste, p.73]. A.2. More about singular values. If A : E Ñ F is a linear map between two inner product vector spaces then we define its norm and its conorm (or mininorm) by: }Av} }Av} }A} :“ max , mpAq :“ min . vPE ˆ }v} vPE ˆ }v} The following properties hold whenever they make sense: }AB} ď }A} }B} , mpABq ě mpAq mpBq , mpAq “ }A´1 }´1 . In terms of singular values, we have }A} “ σ1 pAq and mpAq “ σd pAq, where d “ dim E. 54 J. BOCHI, R. POTRIE, AND A. SAMBARINO For convenience, let us assume that A is a linear map from Rd to Rd . We have the following useful “minimax” characterization of the singular values: σp pAq “ σp`1 pAq “ max mpA|P q , (A.9) }A|Q } ; (A.10) P PGp pRd q min QPGd´p pRd q see [Ste, Corol. 4.30]. Moreover, if A has a gap of index p (that is, σp pAq ą σp`1 pAq) then the maximum and the minimum above are respectively attained (uniquely) at the spaces P “ Sd´p pAqK and Q “ Sd´p pAq (defined at § 2.2). A.3. Linear-algebraic lemmas. In this subsection we collect a number of estimates that will be useful later. Fix integers 1 ď p ď d. Lemma A.2. Let A, B P GLpd, Rq. Then: ( ( max mpAqσp pBq, σp pAqmpBq ď σp pABq ď min }A}σp pBq, σp pAq}B} . Proof. The two inequalities follow from (A.9) and (A.10), respectively.  Lemma A.3. Let A P GLpd, Rq have a gap of index p. Then, for all unit vectors v, w P Rd , we have: }A }Av} ě σp pAq sin >pv, Sd´p pAqq , ´1 ´1 w} ě σp`1 pAq sin >pw, Up pAqq . (A.11) (A.12) Also, for all Q P Gd´p pRd q and P P Gp pRd q, we have: }A|Q } ě σp pAq dpQ, Sd´p pAqq , }A ´1 ´1 |P } ě σp`1 pAq dpP, Up pAqq . (A.13) (A.14) Proof. Given a unit vector v P Rd , decompose it as v “ s ` u where s P Sd´p pAq and u P Sd´p pAqK ; Then }u} “ sin >pv, Sd´p pAqq. Moroever, since As and Au are orthogonal, we have }Av} ě }Au} ě σp pAq}u}. This proves (A.11), from which (A.13) follows. Inequalities (A.12) and (A.14) follow from the previous ones applied to the matrix A´1 , which has a gap of index d ´ p.  The next three lemmas should be thought of as follows: if A has a strong gap of index p and }B ˘1 } are not too large, then then Up pABq is close to Up pAq, and Up pBAq is close to BpUp pAqq; moreover, ApP q is close to Up pAq for any P P Gp pRd q whose angle with Sd´p pAq is not too small.28 Lemma A.4. Let A, B P GLpd, Rq. If A and AB have gaps of index p then: dpUp pAq, Up pABqq ď }B} }B ´1 } σp`1 pAq . σp pAq For another way to estimate the distance of Up pAq and Up pABq that does not rely on “smallness” of B, see Lemma A.9 below. 28We remark that angle estimates of this flavor appear in the usual proofs os Oseledets theorem; see e.g. [Sim, p. 141–142]. We also note that [GGKW, Lemma 5.8] contains a generalization of Lemmas A.4 and A.6 to more general Lie groups. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 55 Proof of Lemma A.4. We have: dpUp pABq, Up pAqq ď σp`1 pAq }A´1 |Up pABq } (by (A.14)) ď σp`1 pAq }B} }B ´1 A´1 |Up pABq } “ σp`1 pAq }B} σp pABq´1 ď σp`1 pAq }B} }B ´1 } σp pAq´1 (by Lemma A.2).  Lemma A.5. Let A, B P GLpd, Rq. If A and BA have gaps of index p then: ` ˘ σp`1 pAq d BpUp pAqq, Up pBAq ď }B} }B ´1 } . σp pAq Proof. We have: dpBpUp pAqq, Up pBAqq ď σp`1 pBAq }A´1 B ´1 |BpUp pAqq } ď }B} σp`1 pAq }A ´1 |Up pAq } }B ´1 “ }B} σp`1 pAq σp pAq }B ´1 ´1 }. (by (A.14)) } (by Lemma A.2)  Lemma A.6. Let A P GLpd, Rq have a gap of index p. Then, for all P P Gp pRd q transverse to Sd´p pAq we have: dpApP q, Up pAqq ď 1 σp`1 pAq . σp pAq sin >pP, Sd´p pAqq Proof. By (A.14), dpApP q, Up pAqq ď σp`1 pAq }A´1 |ApP q } “ σp`1 pAq . mpA|P q By (A.11), mpA|P q ě σp pAq sin >pP, Sd´p pAqq, so the lemma is proved.  The next lemma implies that the singular values of a product of matrices are approximately the products of the singular values, provided that certain angles are not too small: Lemma A.7. Rq. Suppose that A and AB have gaps of index p. ` Let A, B P GLpd, ˘ Let α :“ > Up pBq, Sd´p pAq . Then: σp pABq ě psin αq σp pAq σp pBq , σp`1 pABq ď psin αq´1 σp`1 pAq σp`1 pBq . Proof. By (A.9) we have: σp pABq ě mpAB|B ´1 pUp pBqq q ě mpA|Up pBq q mpB|B ´1 pUp pBqq q “ mpA|Up pBq q σp pBq . On the other hand, inequality (A.11) yields mpA|Up pBq q ě psin αq σp pAq, and so we obtain the first inequality in the lemma. The second inequality follows from the first one, using the fact that σp`1 pA´1 q “ 1{σd´p pAq.  56 J. BOCHI, R. POTRIE, AND A. SAMBARINO A.4. A sketch of the proof of Theorem 2.2. Note that due to the uniqueness property of dominated splittings (Proposition 2.1), it is sufficient to prove the theorem in the case T “ Z, which is done in [BG]. For the convenience of the reader, let us include here a summary of this proof, using some lemmas that we have already proved in § A.3. The “only if” part of the theorem is not difficult, so let us consider the “if” part. So assume that the gap between the p-th and the pp ` 1q-th singular values of ψxn increases uniformly `exponentially with time n. Fix any x P X, and consider ˘ the sequence of spaces Up ψφn´n pxq in Gp pEx q. Using Lemma A.4, we see that the distance between consecutive elements of the sequence decreases exponentially fast, and in particular the sequence has a limit Excu . Uniform control on the speed of convergence yields that E cu is a continuous subbundle of E. Lemma A.5 implies that this subbundle is invariant.29 Analogously we obtain the subbundle E cs . To conclude the proof, we need to show that the bundles E cu and E cs are transverse, and that the resulting splitting is indeed dominated. Here, [BG] uses an ergodic-theoretical argument: The gap between singular values implies that for any Lyapunov regular point x, the difference λp pxq ´ λp`1 pxq between the p-th and the pp ` 1q-th Lyapunov exponents is bigger than some constant 2ε ą 0. Moreover, Oseledets theorem implies that Excu and Excs are sums of Oseledets spaces, corresponding to Lyapunov exponents ě λp pxq and ď λp`1 pxq, respectively. Bearing these facts in mind, assume for a contradiction that E cu does not dominate E cs . Then there exist points xi P X, unit vectors vi P Excsi and wi P Excui , and times ni Ñ 8 such that }ψ ni pvi q} ą e´εni . }ψ ni pwi q} It follows from a Krylov–Bogoliubov argument30 (making use of the continuity of the subbundles; see [BG] for details) that there exists a Lyapunov regular point x such that λp pxq ´ λp`1 pxq ď ε. This contradiction establishes domination. A.5. Exterior powers and applications. We recall quantitative facts about exterior powers; all the necessary information can be found in [Ar, § 3.2.3]. The space Λp Rd is endowed with the inner product defined on decomposable p-vectors as: ` ˘ xv1 ^ ¨ ¨ ¨ ^ vp , w1 ^ ¨ ¨ ¨ ^ wp y – det xvi , wj y i,j“1,...,p (A.15) Geometrically (see [Ga, § IX.5]), }v1 ^¨ ¨ ¨^vp } is the p-volume of the parallelepiped with edges v1 , . . . , vp . Therefore, if those vectors span a p-dimensional space P Ă Rd then, for any A P GLpd, Rq, }pΛp Aqpv1 ^ ¨ ¨ ¨ ^ vp q} “ jacpA|P q, }v1 ^ ¨ ¨ ¨ ^ vp } (A.16) where jacp¨q denotes the jacobian of a linear map, i.e., the product of its singular values. The Plücker embedding is the map ι : Gp pRd q Ñ G1 pΛp Rd q such if P is spanned by vectors v1 , . . . , vp P Rd then ιpP q is spanned by the vector v1 ^ ¨ ¨ ¨ ^ vp P Λp Rd . We metrize G1 pΛp Rd q in the way described in Subsection A.1. 29This step is missing in [BG]. 30i.e. convergence (in the weak star topology) of measures supported in long segments of orbits to an invariant measure. ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 57 Lemma A.8. For all P , Q P Gp pRd q we have: dpιpP q, ιpQqq ě dpP, Qq , ˘ sin > ιpP q, pιpQqqK ě rsin >pP, QK qsmintp,d´pu . (A.17) ` (A.18) Proof. Let β, β̂ P r0, π{2s be such that: sin β “ dpP, Qq and sin β̂ “ dpιpP q, ιpQqq “ >pιpP q, ιpQqq . Recalling (A.8), we have: cos β “ >pP, QK q and cos β̂ “ >pιpP q, ιpQqK q . Associated to the pair P , Q, Proposition A.1 provides canonical angles β1 ě ¨ ¨ ¨ ě βp , where β1 “ β, and canonical orthonormal bases tv1 , . . . , vp u and tw1 , . . . , wp u for P and Q, respectively. Using (A.15) we compute: cos β̂ “ cos >pιpP q, ιpQqq “ xv1 ^ ¨ ¨ ¨ ^ vp , w1 ^ ¨ ¨ ¨ ^ wp y “ p ź cos βi . i“1 Then, on one hand, cos β̂ ď cos β, that is, sin β̂ ě sin β, which is estimate (A.17). On the other hand, since at most n :“ mintp, d ´ pu canonical angles are nonzero, we have cos β̂ ě pcos βqn , which is estimate (A.18).  Given A P GLpd, Rq, the singular values of Λp A are the numbers pσi1 pAq ¨ ¨ ¨ σip pAqq, where 1 ď i1 ă ¨ ¨ ¨ ă ip ď d; in particular, σ1 pΛp Aq “ σ1 pAq ¨ ¨ ¨ σp´1 pAqσp pAq , p σ2 pΛ Aq “ σ1 pAq ¨ ¨ ¨ σp´1 pAqσp`1 pAq . (A.19) (A.20) p So A has a gap of index p if and only if Λ A has a gap of index 1. In this case, the corresponding singular spaces are related via the Plücker embedding ι : Gp pRd q Ñ G1 pΛp Rd q as follows: U1 pΛp Aq “ ιpUp pAqq , ` ˘K Spdq´1 pΛp Aq “ ιpSd´p pAqK q . p (A.21) (A.22) The following result is used in the end of Section 7; it should be compared to Lemma A.4. Lemma A.9. Suppose that A, B, and AB P GLpd, Rq have gaps of index p, and that the spaces Sd´p pAq and Up pBq are transverse. Then: ` ˘‰´ mintp,d´pu ` ˘ σp`1 pAq “ sin > Up pBq, Sd´p pAq . d Up pABq, Up pAq ď σp pAq Proof. First we consider the case p “ 1. Let v and w be unit vectors spanning the spaces B ´1 A´1 U1 pABq and B ´1 U1 pBq, respectively. By inequality (A.11), }ABw} ě σ1 pAq sin >pBw, Sd´1 pAqq , }Bw} while by inequality (A.12), }Bv} }A´1 ABv} “ ě σ2 pAq´1 sin >pABv, U1 pBqq . }ABv} }ABv} 58 J. BOCHI, R. POTRIE, AND A. SAMBARINO Multiplying the two inequalities, we have: σ1 pAq }ABw} }Bv} dpU1 pABq, U1 pBqq sin >pU1 pBq, Sd´1 pAqq ď ˆ ď 1 ˆ 1 “ 1, σ2 pAq }ABv} }Bw} which is the desired inequality in the case p “ 1. Now consider arbitrary p. If A, B, and AB have gaps of index p then the corresponding exterior powers have gaps of index 1, and by the previous case we have: ` ˘‰´1 ` ˘ σ2 pΛp Aq “ sin > U1 pΛp Bq, Spdq´1 pΛp Aq d U1 pΛp pABqq, Up pΛp Aq ď p p σ1 pΛ Aq By (A.19) and (A.20), we have: σ2 pΛp Aq σp`1 pAq “ . p σ1 pΛ Aq σp pAq By (A.21) and (A.17), we have: ` ˘ ` ˘ ` ˘ d U1 pΛp pABqq, Up pΛp Aq “ d ιpUp pABqq, ιpUp pAqq ě d Up pABq, Up pAq , On the other hand, by (A.21), (A.22), and (A.18), we have: ´ ` ˘ ` ˘K ¯ sin > U1 pΛp Bq, Spdq´1 pΛp Aq “ sin > ιpUp pBqq, ιpSd´p pAqK q p “ ` ˘‰mintp,d´pu . ě sin > Up pBq, Sd´p pAq Combining the facts above we obtain the lemma.  A.6. Expansion on the Grassmannian. The aim of this subsection is to prove the following lemma, which is used in Subsection 3.6. Lemma A.10. Given α ą 0, there exists b ą 0 with the following properties. Let A P GLpd, Rq. Suppose that P P Gp pRd q and Q P Gd´p pRd q satisfy mint>pP, Qq, >pAP, AQqu ě α . (A.23) Then there exists δ ą 0 such that if P1 , P2 P Gp pR q are δ-close to P then d dpApP1 q, ApP2 qq ě b mpA|Q q dpP1 , P2 q . }A|P } (A.24) Before proving this lemma, we need still another characterization of the distance (A.5) on the Grassmannian. Suppose that P , Q P Gp pRd q satisfy dpP, Qq ă 1. Then Q X P K “ t0u, and so there exists a unique linear map ( LQ,P : P Ñ P K such that Q “ v ` LQ,P pvq : v P P . (A.25) We have: dpP, Qq ; (A.26) 1 ´ dpP, Qq2 indeed, letting θ P r0, π{2q be such that sin θ “ dpP, Qq, using (A.7) we conclude that }LQ,P } “ tan θ. }LQ,P } “ a Lemma A.11. Let P , P1 , P2 P Gp pRd q. For each i “ 1, 2, assume that dpPi , P q ă ? 1{ 2, and let Li “ LPi ,P . Then: dpP1 , P2 q ď }L1 ´ L2 } ď 4dpP1 , P2 q . ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 59 Proof. Consider an arbitrary u1 P P1ˆ , and write it as u1 “ v ` L1 v for some v P P ˆ . By orthogonality, }u1 } ě }v}. Letting u2 :“ v ` L2 v, we have: }u1 ´ u2 } }L1 v ´ L2 v} ď ď }L1 ´ L2 }. }u1 } }v} Using (A.7) we conclude that dpP1 , P2 q ď }L1 ´ L2 }, which is the first announced inequality. For each i “ 1, 2, we ? have }Li } ď 1, as a consequence of (A.26) and the hypothesis dpPi , P q ă 1{ 2. Consider an arbitrary unit vector v1 P P . Let w1 :“ v1 ` L1 v1 , so }w1 } ď 2. By (A.7), there exists w2 P P2ˆ such that }w2 ´ w1 } ď dpP1 , P2 q . }w1 } Let v2 P P be such that w2 “ v2 ` L2 v2 . By orthogonality, so }w1 ´ w2 } ě maxt}v1 ´ v2 }, }L1 v1 ´ L2 v2 }u , }L1 v1 ´ L2 v1 } ď }L1 v1 ´ L2 v2 } ` }L2 v2 ´ L2 v1 } ď }L1 v1 ´ L2 v2 } ` }v2 ´ v1 } ď 2}w1 ´ w2 } ď 2}w1 }dpP1 , P2 q ď 4dpP1 , P2 q . Taking sup over unit vectors v1 P P1 we obtain }L1 ´ L2 } ď 4dpP1 , P2 q.  Proof of Lemma A.10. First consider the case α “ π{2, so (A.23) means that Q “ P K and AQ “ pAP qK . Assume that P1 , P2 are δ-close to P , for some small δ ą 0 to be chosen later. Recall notation (A.25) and, for each i “ 1, 2, consider the linear maps Li :“ LPi ,P and Mi :“ LAPi ,AP , which are well-defined since δ ă 1 guarantees that Pi X Q “ t0u. These maps are related by Li “ pA´1 |AQ q ˝ Mi ˝ pA|P q. As a consequence, › › }A|P } }M1 ´ M2 } . }L1 ´ L2 } “ ›pA´1 |AQ q ˝ pM1 ´ M2 q ˝ pA|P q› ď mpA|Q q Lemma A.11 entails: }L1 ´ L2 } ě dpP1 , P2 q . On the other hand, by (A.26) we have }Li } ď dpPi , P q ă δ, and therefore }Mi } ď }A´1 } }Li } }A} ă 1, provided δ is chosen sufficiently ? small (depending on A). Using (A.26) again we guarantee that dpAPi , AP q ă 1{ 2. This allows us to apply Lemma A.11 and obtain: 1 }M1 ´ M2 } ě dpAP1 , AP2 q . 4 Putting these three estimates together, we conclude that the lemma holds with b “ 1{4, provided α “ π{2. The general case can be reduced to the previous one by changes of inner products, whose effect on all involved quantities can be bounded by a factor depending only on α.  A.7. Additional lemmas about dominated splittings. 60 J. BOCHI, R. POTRIE, AND A. SAMBARINO A.7.1. More about domination of sequences of matrices. Recall from § 2.3 the definition of the sets DpK, p, µ, c, Iq. Lemma A.12. Given K ą 1, µ ą 0, and c ą 0, there exists ` P N and c̃ ą c such that if I Ă Z is an interval and pAi qiPI is an element of DpK, p, µ, c, Iq, then the following properties hold: (i) If n1 ă n ă k all belong to I and k ´ n ě ` then: ` ˘ d Up pAk´1 ¨ ¨ ¨ An`1 An q, Up pAk´1 ¨ ¨ ¨ An1 `1 An1 q ă c̃e´µpk´nq . (ii) If k ă m ă m1 all belong to I and m ´ k ě ` then: ` ˘ d Sd´p pAm´1 ¨ ¨ ¨ Ak`1 Ak q, Sd´p pAm1 ´1 ¨ ¨ ¨ Ak`1 Ak q ă c̃e´µpm´kq . Proof. Given K, µ, and c, let ` P N be such that ce´µ` ă 1. Fix pAn qnPI P DpK, p, µ, c, Iq and k P I. If n P I satisfies n ď k ´ ` then the space Pn :“ Up pAk´1 ¨ ¨ ¨ An`1 An q is well-defined. If n ´ 1 P I then it follows from Lemma A.4 that dpPn , Pn´1 q ď K 2 ce´µpk´nq . Therefore, if n1 ă n belongs to I then dpPn , Pn1 q ď dpPn , Pn´1 q ` dpPn´1 , Pn´2 q ` ¨ ¨ ¨ ` dpPn1 `1 , Pn1 q ď c̃e´µpk´nq . where c̃ :“ K 2 c{p1´e´µ q. This proves part (i) of the lemma. The argument applied to A´1 yields part (ii).  The following “extension lemma” is useful to deduce one-sided results from twosided ones. Let N denote the set of nonnegative integers. Lemma A.13. Given K ą 1, µ ą 0, and c ą 0, there exists c1 ě c such that every one-sided sequence pAn qnPN in DpK, p, µ, c, Nq can be extended to a two-sided sequence pAn qnPZ in DpK, p, µ, c1 , Zq. ` Proof. Fix pAn qnPN in DpK, p, µ, c, Nq. Let Qn :“ Sd´p An´1 An´2 ¨ ¨ ¨ A0 q, which is defined for sufficiently large n. By Lemma A.12, the spaces Qn converge to some Q P Gp pRd q; moreover, we can find some n0 depending only on the constants K, µ, c (and not on the sequence of matrices) with the property that for all n ě n0 we ? have dpQn , Qq ă 1{ 2 or equivalently, by (A.8), >pQn , QK q ă π{4. Let B be a matrix satisfying the following conditions: σp`1 }B ˘1 } ď K , pBq ă e´µ , BpQq “ Q “ Sd´p pBq , BpQK q “ QK “ Up pBq . σp σ In particular, for all m ě 0 we have σp`1 pB m q ă e´µm . Then, for all n ě n0 , p Lemma A.7 yields: σp`1 pAn´1 ¨ ¨ ¨ A0 B m q ď 2ce´µpn`mq . σp As a consequence of Lemma A.2, a similar estimate holds for 0 ď n ă n0 with another constant replacing 2c. So if we set An “ B for all n ă 0 then the extended sequence pAn qnPZ belongs to DpK, p, µ, c1 , Zq for some suitable c1 depending only on µ, c, and n0 .  Combining the previous lemma with Proposition 2.4, we obtain: ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS 61 Corollary A.14. Given K ą 1, µ ą 0, and c ą 0, there exist c̃ ą 0, µ̃ ą 0, and α ą 0 with the following properties. For every one-sided sequence pAn qnPN in DpK, p, µ, c, Nq, the following limit exists: Q “ lim Sd´p pAn´1 ¨ ¨ ¨ A0 q , nÑ8 and moreover there exists Q̃ P Gp pRd q such that for every n ě 0 we have: ` ˘ > An´1 ¨ ¨ ¨ A0 pQ̃q, An´1 ¨ ¨ ¨ A0 pQq ě α , }An´1 ¨ ¨ ¨ A0 |Q } ă c̃e´µ̃n . mpAn´1 ¨ ¨ ¨ A0 |Q̃ q A.7.2. Hölder continuity of the bundles. Theorem A.15. Let φt : X Ñ X a Lipschitz flow on a compact metric space X with t P T and E a vector bundle over X. Consider ψ t a be a β-Hölder linear flows over φt which admits a dominated splitting with constants C, λ ą 0. Then, if α ă β and e´λ K α ă 1 where K is a Lipschitz constant for φ1 and φ´1 , then the maps x ÞÑ E cu pxq and x ÞÑ E cs pxq are α-Hölder. Sketch of the proof. Choose Lipschitz approximations Ê cs and Ê cu of E cs and E cu respectively. One can define then the bundle E over X corresponding to the linear maps from Ê cu pxq to Ê cs pxq, that is Epxq “ HompÊ cu pxq, Ê cs pxqq . Let T Ă E given as T “ tpx, Lq P E : }L} ď 1u. We consider the standard graph transform H : T Ñ E given as: Hpx, Lq “ pφ1 pxq, Hx pLqq defined so that if pw, vq P Ê cs pxq ‘ Ê cu pxq is in the graph of L (i.e. w “ Lv) then one has that pψ 1 w, ψ 1 vq is in the graph of Hx pLq. It follows that the map H is β-Hölder and a standard computation shows that some iterate leaves invariant the set T. Given two sections σ0 and σ1 of E such that σi pxq P T for every x P X, one shows that the α-Hölder distance of H ˝ σ0 and H ˝ σ1 is uniformly contracted31 1 pxq,φ1 pyqq if α ă β and e´λ k ´α ă 1 where k :“ min dpφ dpx,yq . Indeed, the graphs are x‰y getting contracted at a rate similar to λ while points cannot approach faster than k which gives that the α-Hölder distance contracts32. As a consequence, one obtains that there is a unique H-invariant section σ of this bundle which, moreover, it is α-Hölder. It is direct to show that this section corresponds to the bundle E cu . A symmetric argument shows that E cs is α-Hölder, proving the result.  Corollary A.16. If u ÞÑ ψut is a β-Hölder family of linear flows over φt a Lipschitz flow and ψ0t admits a dominated splitting, then there exists a neighborhood D of 0 such that the maps pu, xq ÞÑ Eucs pxq and pu, xq ÞÑ Eucu pxq are α-Hölder. 31To show that this metric is contracted, one needs to assume that the constant C appearing in the dominated splitting is equal to 1. Otherwise, one can argue for an iterate and the same will hold. 32The need for α ă β is evident, since the section cannot be more regular than the cocycle. In the computation this appears because an error term of the form dpx, yqβ´α appears which will then be negligible as dpx, yq Ñ 0 and gives the desired statement. See [CP, Section 4.4] for a similar computation. 62 J. BOCHI, R. POTRIE, AND A. SAMBARINO Proof. Fix α as in the previous theorem. There exists a neighborhood D of 0 for which λK α ă 1 (here λ denotes the strength of the domination for ψut with u P D). Now one applies the previous theorem to the linear flow ψ̂ t over φt ˆid : X ˆD Ñ X ˆ D. Note that the Lipschitz constants of φ1 ˆ id and φ´1 ˆ id are the same as the ones of φ1 and φ´1 . The result follows.  References [Ar] [ABY] [Be] [BM] [BG] [Bog] [BDV] [BDP] [Bow] [BCS] [BCLS] L. Arnold. Random dynamical systems. Springer Monographs in Mathematics. Springer-Verlag, Berlin, 1998. (Cited on page 56.) A. Avila, J. Bochi, J.-C. Yoccoz. Uniformly hyperbolic finite-valued SLp2, Rqcocycles. Comment. Math. Helv. 85 (2010), 813–884. (Cited on pages 1, 2, 23, and 24.) Y. Benoist. Sous-groupes discrets des groupes de Lie. European Summer School in Group Theory, Luminy, 1997. (Cited on page 11.) A. Blumenthal, I.D. Morris. Characterization of dominated splittings for operator cocycles acting on Banach spaces. Preprint arXiv:1512.07602 (Cited on page 4.) J. Bochi, N. Gourmelon. Some characterizations of domination. Math. Z. 263 (2009), 221–231. (Cited on pages 1, 2, 3, 4, 5, 23, 24, 25, and 56.) O. Bogopolski. Infinite commensurable hyperbolic groups are bi-Lipschitz equivalent. Algebra and Logic 36 (1997), no. 3, 155–163. (Cited on page 26.) C. Bonatti, L.J. Dı́az, M. Viana. Dynamics beyond uniform hyperbolicity: a global geometric and probabilistic perspective. Encyclopaedia of Mathematical Sciences, 102. Mathematical Physics, III. Springer-Verlag, Berlin, 2005. (Cited on page 2.) C. Bonatti, L.J. Dı́az, E. Pujals. A C 1 -generic dichotomy for diffeomorphisms: weak forms of hyperbolicity or infinitely many sinks or sources. Ann. of Math. 158 (2003), no. 2, 355–418. (Cited on pages 4 and 22.) B.H. Bowditch. A topological characterisation of hyperbolic groups. J. Amer. Math. Soc. 11 (1998), 643–667. (Cited on page 8.) M. Bridgeman, R. Canary, A. Sambarino. An introduction to pressure metrics on higher Teichmüller spaces. to appear in Ergodic Theory Dynam. Systems Preprint arXiv:1507.03894. (Cited on page 2.) M. Bridgeman, R. Canary, F. Labourie, A. Sambarino. The pressure metric for Anosov representations. Geom. Funct. Anal. 25 (2015), 1089–1179. (Cited on pages 2, 18, 19, 28, and 29.) [BH] M.R. Bridson, A. Haefliger. Metric spaces of non-positive curvature. Grundlehren der Mathematischen Wissenschaften, 319. Springer-Verlag, Berlin, 1999. (Cited on pages 7, 14, and 26.) [Ca] [Ch] [CK] [CDP] [CP] [DT] [Ebe] [EHY] J.W. Cannon. The combinatorial structure of cocompact discrete hyperbolic groups. Geom. Dedicata 16 (1984), no. 2, 123–148. (Cited on page 25.) C. Champetier. Petite simplification dans les groupes hyperboliques. Ann. Fac. Sci. Toulouse Math. (6) 3 (1994), no. 2, 161–221. (Cited on pages 17 and 18.) F. Colonius, W. Kliemann. The dynamics of control. Birkhäuser Boston, Inc., Boston, MA, 2000. (Cited on pages 3 and 4.) M. Coornaert, T. Delzant, A. Papadopoulos. Géométrie et théorie des groupes: Les groupes hyperboliques de Gromov. Lecture Notes in Mathematics, 1441. SpringerVerlag, Berlin, 1990. (Cited on pages 7, 8, 22, 26, and 29.) S. Crovisier, R. Potrie. Introduction to partially hyperbolic dynamics. School on Dynamical Systems, ICTP, Trieste, 2015. (Cited on pages 3, 4, 25, 29, and 61.) B. Deroin, N. Tholozan. Dominating surface group representations by Fuchsian ones. Int. Math. Res. Not. 2016, no. 13, 4145–4166. (Cited on page 7.) P. Eberlein. Geometry of nonpositevly curved manifolds. Chicago Lectures in Mathematics. The University of Chicago Press, 1996. (Cited on pages 31 and 42.) H. Eliasson, H. Hofer and J.-C. Yoccoz (organizers). Dynamische Systeme. Abstracts from the workshop held July 19–25, 2015. Oberwolfach Rep. 12 (2015), no. 3, 1945–1948. (Cited on page 3.) ANOSOV REPRESENTATIONS AND DOMINATED SPLITTINGS [Ga] [GH] 63 F.R. Gantmacher. The theory of matrices. Vol. 1. Translated from the Russian by K.A. Hirsch. Reprint of the 1959 translation. AMS Chelsea Publishing, Providence, RI, 1998. (Cited on page 56.) E. Ghys, P. de la Harpe (editors). Sur les groupes hyperboliques d’après Mikhael Gromov. Papers from the Swiss Seminar on Hyperbolic Groups held in Bern, 1988. Progress in Mathematics, 83. Birkhäuser Boston, Inc., Boston, MA, 1990. (Cited on pages 7 and 8.) [Go] A. Gogolev. Diffeomorphisms Hölder conjugate to Anosov diffeomorphisms. Ergodic Theory Dynam. Systems 30 (2010), no. 2, 441–456. (Cited on page 22.) [Gr] M. Gromov. “Hyperbolic groups,” in Essays in Group Theory, MSRI Publ. 8 (1987), 75–263. (Cited on pages 7 and 17.) [GGKW] F. Guéritaud, O. Guichard, F. Kassel, A. Wienhard. Anosov representations and proper actions. Geom. Topol. 21 (2017), no. 1, 485–584. (Cited on pages 1, 2, 6, 11, 17, 20, 22, and 54.) [GKW] F. Guéritaud, F. Kassel, M. Wolff. Compact anti-de Sitter 3-manifolds and folded hyperbolic structures on surfaces. Pacific J. Math. 275 (2015), no. 2, 325–359. (Cited on page 7.) [GW] [GJT] [Hel] [HPS] [Hit] O. Guichard, A. Wienhard. Anosov representations: domains of discontinuity and applications. Invent. Math. 190 (2012), 357–438. (Cited on pages 2, 17, 19, 27, and 46.) Y. Guivarc’h, L. Ji, J.C. Taylor. Compactifications of symmetric spaces, Progress in Mathematics, 156 (1998), Birkhäuser, Boston, MA. (Cited on pages 31 and 47.) S. Helgason. Differential geometry and symmetric spaces. Academic Press, New York– London, 1962. (Cited on pages 31 and 42.) M. Hirsch, C. Pugh, M. Shub. Invariant manifolds. Lecture Notes in Mathematics, Vol. 583. Springer-Verlag, Berlin-New York, 1977. (Cited on page 28.) N.J. Hitchin. Lie groups and Teichmüller space. Topology 31 (1992), no. 3, 449–473. (Cited on page 2.) [Hö] [HJ] [Hub] [Hum1 ] L. Hörmander. An introduction to complex analysis in several variables. 3rd ed. NorthHolland Publishing Co., Amsterdam, 1990. (Cited on page 30.) R.A. Horn, C.R. Johnson. Matrix analysis. 2nd ed. Cambridge University Press, Cambridge, 2013. (Cited on page 5.) J. Hubbard. Teichmüller theory. Matrix Editions, Ithaca, NY, 2006. (Cited on page 29.) J. Humphreys. Introduction to Lie algebras and representation theory. 2nd printing, revised. Graduate Texts in Mathematics, 9. Springer-Verlag, New York–Berlin, 1978. (Cited on page 42.) [Hum2 ] [Kap] [KLP1 ] [KLP2 ] J. Humphreys. Linear algebraic groups. Graduate Texts in Mathematics, 21. SpringerVerlag, New York–Heidelberg, 1975. (Cited on page 45.) M. Kapovich. Representations of polygons of finite groups. Geom. Topol. 9 (2005), 1915–1951. (Cited on page 8.) M. Kapovich, B. Leeb, J. Porti. Morse actions of discrete groups on symmetric space. Preprint arXiv:1403.7671 (Cited on pages 2, 17, and 23.) M. Kapovich, B. Leeb, J. Porti. A Morse Lemma for quasigeodesics in symmetric spaces and euclidean buildings. Preprint arXiv:1411.4176 (Cited on pages 1, 2, 3, 7, 17, 30, 31, 39, 42, and 52.) [KLP3 ] [Lab] [Lang] [Led] M. Kapovich, B. Leeb, J. Porti. Some recent results on Anosov representations. Transform. Groups 21 (2016), no. 4, 1105–1121. (Cited on pages 2 and 17.) F. Labourie. Anosov flows, surface groups and curves in projective space. Invent. Math. 165 (2006), 51–114. (Cited on pages 2, 17, 27, and 46.) S. Lang. Fundamentals of Differential Geometry. Graduate Texts in Mathematics,191. Springer, New Haven, 1999. (Cited on pages 31 and 34.) F. Ledrappier. Structure au bord des variétés à courbure négative. Sémin. Théor. Spectr. Géom., 13, 97–122. Univ. Grenoble I, Saint-Martin-d’Hères, 1995. (Cited on page 17.) [Len] [LM] D. Lenz. Existence of non-uniform cocycles on uniquely ergodic systems. Ann. Inst. H. Poincaré Probab. Statist. 40 (2004), no. 2, 197–206. (Cited on pages 4 and 30.) D. Lind, R. Marcus. An introduction to symbolic dynamics and coding. Cambridge University Press, Cambridge, 1995. (Cited on page 23.) 64 [Mat] J. BOCHI, R. POTRIE, AND A. SAMBARINO F. Mathéus. Flot géodésique et groupes hyperboliques d’après M. Gromov. Sémin. Théor. Spectr. Géom., 9, 67–87. Univ. Grenoble I, Saint-Martin-d’Hères, 1991. (Cited on pages 17 and 18.) [Mi] I. Mineyev. Flows and joins of metric spaces. Geom. Topol. 9 (2005), 403–482. (Cited on pages 17 and 18.) [Pa] K.J. Palmer. Exponential separation, exponential dichotomy and spectral theory for linear systems of ordinary differential equations. J. Differ. Eq. 46 (1982), no. 3, 324–345. (Cited on page 3.) [PS] R. Potrie, A. Sambarino. Eigenvalues and entropy of a Hitchin representation. to appear in Inventiones Math. Preprint arXiv:1411.5405. doi:10.1007/s00222-017-0721-9 (Cited on page 28.) [Ru] [Sa] [Sam] D. Ruelle. Analyticity properties of the characteristic exponents of random matrix products. Adv. Math. 32 (1979), no. 1, 68–80. (Cited on page 29.) A. Sambarino. The orbital counting problem for hyperconvex representations. Ann. Inst. Fourier 65 (2015), no. 4, 1755–1797. (Cited on page 50.) M. Sambarino. A (short) survey on dominated splittings. Mathematical Congress of the Americas, 149–183. Contemp. Math. 656, Amer. Math. Soc., Providence, RI, 2016. (Cited on page 3.) [Sim] [Sma] B. Simon. A Comprehensive Course in Analysis, Part 3: Harmonic analysis. AMS, Providence, RI, 2015. (Cited on page 54.) S. Smale. Differentiable dynamical systems. Bull. Amer. Math. Soc. 73 (1967), 747–817. (Cited on page 2.) [Ste] [Ti] [Wie] G.W. Stewart. Matrix algorithms. Vol. I: Basic decompositions. SIAM, Philadelphia, PA, 1998. (Cited on pages 53 and 54.) J. Tits. Représentations linéaires irréductibles d’un groupe réductif sur un corps quelconque. J. reine angew. Math. 247 (1971), 196–220. (Cited on pages 44 and 45.) A. Wienhard. Representations and geometric structures. Preprint arXiv:1602.03480. (Cited on page 2.) [Wo] [Yo] Y.-C. Wong. Differential geometry of Grassmann manifolds. Proc. Nat. Acad. Sci. U.S.A. 57 (1967), 589–594. (Cited on page 53.) J.-C. Yoccoz. Some questions and remarks about SLp2, Rq cocycles. Modern dynamical systems and applications, 447–458, Cambridge Univ. Press, Cambridge, 2004. (Cited on page 4.) Jairo Bochi Facultad de Matemáticas Pontificia Universidad Católica de Chile Av. Vicuña Mackenna 4860 Santiago Chile [email protected] Rafael Potrie CMAT Facultad de Ciencias Universidad de la República Iguá 4225 Montevideo Uruguay [email protected] Andrés Sambarino IMJ-PRG (CNRS UMR 7586) Université Pierre et Marie Curie (Paris VI) 4 place Jussieu 75005 Paris France [email protected]
4math.GR
1 Estimation Efficiency Under Privacy Constraints Shahab Asoodeh, Mario Diaz, Fady Alajaji, and Tamás Linder Department of Mathematics and Statistics Queen’s University Kingston, Ontario K7L 3N6, Canada arXiv:1707.02409v1 [cs.IT] 8 Jul 2017 {asoodehshahab, 13madt, fady, linder}@mast.queensu.ca Abstract We investigate the problem of estimating a random variable Y ∈ Y under a privacy constraint dictated by another correlated random variable X ∈ X , where estimation efficiency and privacy are assessed in terms of two different loss functions. In the discrete case, we use the Hamming loss function and express the corresponding utility-privacy tradeoff in terms of the privacy-constrained guessing probability h(PXY , ε), the maximum probability Pc (Y |Z) of correctly guessing Y given an auxiliary random variable Z ∈ Z, where the maximization is taken over all PZ|Y ensuring that Pc (X|Z) ≤ ε for a given privacy threshold ε ≥ 0. We prove that h(PXY , ·) is concave and piecewise linear, which allows us to derive its expression in closed for any ε when X and Y are binary. In the non-binary case, we derive h(PXY , ε) in the high utility regime (i.e., for sufficiently large, but nontrivial, values of ε) under the assumption that Z takes values in Y. We also analyze the privacy-constrained guessing probability for two binary vector scenarios. When X and Y are continuous random variables, we use the squared-error loss function and express the corresponding utility-privacy tradeoff in terms of sENSR(PXY , ε), which is the smallest normalized minimum mean squared-error (mmse) incurred in estimating Y from its Gaussian perturbation Z, such that the mmse of f (X) given Z is within ε of the variance of f (X) for any non-constant real-valued function f . We derive tight upper and lower bounds for sENSR when Y is Gaussian. We also obtain a tight lower bound for sENSR(PXY , ε) for general absolutely continuous random variables when ε is sufficiently small. Index Terms Data privacy, utility-privacy tradeoff, Hamming and squared-error loss functions, guessing probability, Rényi’s entropy, Arimoto’s mutual information, maximal correlation, Gaussian additive privacy filters. This work was supported in part by NSERC of Canada. Parts of the results in this paper were presented at the International Symposium on Information Theory in 2016 and 2017 [1], [2]. 2 I. I NTRODUCTION We consider the following constrained estimation problem: given two correlated random variables X and Y , how accurately can Y be estimated from another correlated random variable Z, while ensuring that the "information leakage" about X is limited? More precisely, we seek to design a randomized mechanism M which maps Y to an auxiliary random variable Z ∈ Z such that the information leakage from X to Z is limited, and the "estimation efficiency" of Y given Z is maximal. This basic question arises often in data privacy problems, where Alice wishes to disclose non-private information Y to Bob as accurately as possible in order to receive a payoff, but in such a way that her private information X is revealed to Bob as little as possible. Given the joint distribution PXY , Alice chooses a random mapping M given by PZ|Y , a so-called privacy filter, to generate the displayed data Z, such that Bob can guess Y from Z as accurately as possible while being unable to use Z for efficiently guessing X. The system block diagram of this model is depicted in Fig. 1. local randomness X Alice Y Bob Z M Fig. 1. The system block diagram. Any answer to this problem requires: (i) an appropriate measure L of information leakage and (ii) an optimal privacy-preserving mechanism M. A quantitative and operationally well-justified measure of information leakage has been long sought after as it can be used to assess the performance of different mechanisms used in practice. We first consider a general definition of information leakage. Using a decision rule ψ : Z → X̂ , a decision maker, say Bob, takes x̂ = ψ(z) as a prediction of the target variable X whenever Z = z. In this context, a loss function ℓ : X × X̂ → R+ quantifies through ℓ(x, x̂) the loss incurred by Bob when the true value of X is x but he used x̂ as an estimate of X. The Bayes map for loss function ℓ is an optimal decision rule, i.e., a map ψ that minimizes the expected loss. When no side information Z is available, the loss corresponding to the Bayes map is inf x̂∈X̂ E[ℓ(X, x̂)], where E denotes expectation, and when side information Z is available, the corresponding loss is inf E[ℓ(X, ψ(Z))] = ψ:Z→X̂ inf −Z⊸− −X̂ PX̂|Z :X⊸− E[ℓ(X, X̂)], 3 where X ⊸− − Z ⊸− − X̂ means that X, Z, and X̂ form a Markov chain in this order, i.e., X and X̂ are conditionally independent given Z. In this context, we propose the difference between the log-losses with and without side information Z as a measure of the information leakage from X to Z. Definition 1. For a given loss function ℓ : X × Xˆ → R+ , the information leakage from X to Z is given by Lℓ (X → Z) := sup log inf x̂∈X̂ E[ℓ(X, x̂)] PX̂|Z :X⊸− −Z⊸− −X̂ E[ℓ(X, X̂)] . Since side information can only improve the performance, Lℓ (X → Z) ≥ 0, where equality holds if X is independent of Z (denoted by X⊥ ⊥Z). In this work, we consider two widely used loss functions: the Hamming loss function (denoted by H) when X and Y are discrete and the squared-error loss function (denoted by MS) when X and Y are continuous. Example 1. (Hamming loss function) Let X̂ = X = {1, 2, . . . , M} and ℓH (x, x̂) = 1{x6=x̂} , where 1{·} is the indicator function. Then, the associated information leakage LH (X → Z) is given by LH (X → Z) = log 1 − Pc (X) 1 − 2−H∞ (X) = log , 1 − Pc (X|Z) 1 − 2−H∞ (X|Z) where Pc (X|Z) = X z∈Z PZ (z) max PX|Z (x|z) = x∈X X z∈Z max PX (x)PZ|X (z|x), x∈X (1) is the probability of correctly guessing of X ∈ X given Z ∈ Z, and Pc (X) := maxx∈X PX (x) is the probability of correctly guessing X in the absence of any side information. Also, H∞ (X) := − log Pc (X) and H∞ (X|Z) := − log Pc (X|Z) are the Rényi entropy of order ∞ and its conditional version [3]. Note that if X ∼ Bernoulli(p) with p ∈ [ 12 , 1] and PZ|X = BSC(α) with α ∈ [0, 21 ] (the binary symmetric channel with crossover probability α), then Pc (X) = p and Pc (X|Z) = pᾱ + max{p̄ᾱ, αp}, where ā = 1 − a. In this case, it is straightforward to verify that LH (X → Z) = 0 if and only if p ≥ ᾱ. Therefore, if 1 2 < ᾱ ≤ p < 1 then LH (X → Z) = 0 even though Z is not independent of X. This example shows that, in general, Lℓ (X → Z) = 0 does not imply X⊥ ⊥Z. This contrasts with other notions of information leakage, for example the ones studied in [4]–[7], where zero leakage is equivalent to independence. Example 2. (Squared-error loss function) Let X = X̂ = R and ℓMS (x, x̂) = (x − x̂)2 . The corresponding 4 information leakage LMS(X → Z) is given by LMS (X → Z) = log var(X) , mmse(X|Z) where var(X) denotes the variance of X and mmse(X|Z) := E[(X − E[X|Z])2 ] = E[var(X|Z)]. Now returning to the setup of Fig. 1, recall that Alice observes Y and, in order to receive a utility, she has to disclose it to Bob. In general, Y might be correlated with her private information, represented by X. To maintain her privacy, Alice needs to design a randomized mechanism M : Y → Z whose output Z = M(Y ), on the one hand, maximizes the utility, and on the other hand, preserves the privacy of X. From an estimation theoretic point of view, it is reasonable to measure the utility in terms of the efficiency of Bob in estimating Y . One way to measure this estimation efficiency is by the expectation of the reward function associated to the loss function ℓ. In this case, for a given Z, Bob seeks to maximize −E[ℓ(Y, Ŷ (Z))] over all estimators Ŷ : Z → Ŷ. Since such a maximum is in a one-toone correspondence with Lℓ (Y → Z), we choose the latter as a utility measure. Similarly, we choose Lℓ′ (X → Z) as a measure of privacy, where ℓ′ : X × Xˆ → R+ is also a loss function. In the following, we assume that ℓ and ℓ′ are the Hamming loss function in the discrete case and the squared-error loss function in the continuous case. It is therefore natural to quantify the tradeoff between Lℓ (Y → Z) and Lℓ′ (X → Z) in terms of the constrained optimization problems sup X⊸− −Y ⊸− −Z LH (X→Z)≤ε LH (Y → Z), (2) LMS (Y → Z), (3) in the discrete case and sup X⊸− −Y ⊸− −Z LMS (X→Z)≤ε in the continuous case for a given privacy threshold ε ≥ 0. It is clear from Example 1 that LH (X → Z) and LH (Y → Z) are functions of H∞ (X|Z) and H∞ (Y |Z), respectively. Similarly, Example 2 implies that LMS(X → Z) and LMS(Y → Z) are functions of mmse(X|Z) and mmse(Y |Z), respectively. Therefore, we introduce the utility-privacy function and the estimation noise-to-signal ratio (ENSR) to study the optimization problems in (2) and (3). Definition 2. Let (X, Y ) be a pair of random variables with joint distribution PXY . We define the 5 utility-privacy function g ∞ (PXY , · ) : R+ → R+ by g ∞ (PXY , ε) := sup I∞ (Y ; Z), X⊸− −Y ⊸− −Z I∞ (X;Z)≤ε where I∞ (X; Z) := H∞ (X) − H∞ (X|Z) is Arimoto’s mutual information of order ∞ [8]–[10]. If X⊥ ⊥Z, then I∞ (X; Z) = 0 and therefore g ∞ (PXY , ε) is well defined. It is straightforward to verify that sup X⊸− −Y ⊸− −Z LH (X→Z)≤ε LH (Y → Z) = log 1 − 2−H∞ (Y ) 1 − 2−[H∞ (Y )−g∞ (PXY ,ν(ε))] , (4)   where ν(ε) = log 2H∞ (X) 1 − 2−ε + 2−ε . This shows that the optimization problem in (2) can be evaluated using the utility-privacy function g ∞ . In order to have a tractable model for the continuous case, we assume that the displayed data Z is a √ Gaussian perturbation of Y , i.e., Z = Zγ := γY + NG , where γ ≥ 0 and NG ∼ N (0, 1) is independent of (X, Y ). For reasons to become clear in Section IV, we will consider a stronger privacy guarantee than the one that appeared in (3): we require that LMS(f (X) → Z) ≤ ε for every (measurable) non-constant real-valued function f of X. Definition 3. Let (X, Y ) be a pair of real-valued continuous random variables with joint density PXY . We define the strong estimation noise-to-signal ratio sENSR(PXY , · ) : R+ → R+ by sENSR(PXY , ε) := inf γ≥0, mmse(f (X)|Zγ )≥(1−ε)var(f (X)) mmse(Y |Zγ ) , var(Y ) for every function f : X → R with 0 < var(f (X)) < ∞. It is worth mentioning that the above strong privacy guarantee is related to semantic security [11] in the cryptographic literature. An encryption mechanism is said to be semantically secure if the adversary’s advantage for correctly guessing any function of the private data given an observation of the mechanism’s output (i.e., the ciphertext) is required to be negligible. It can be shown that sup γ≥0 LMS (f (X)→Zγ )≤ε LMS (Y → Zγ ) = − log sENSR(PXY , 1 − 2−ε ), and consequently, the optimization problem in (3) can be evaluated using sENSR. 6 A. Main Contributions In order to evaluate g ∞ , we investigate in Section II the privacy-constrained guessing probability h(PXY , · ) : [0, 1] → [0, 1] given by h(PXY , ε) := sup PZ|Y :X⊸− −Y ⊸− −Z Pc (Y |Z). (5) Pc (X|Z)≤ε It is straightforward to show that ∞ g (PXY , ε) = log h(PXY , 2ε Pc (X)) Pc (Y ) . (6) The above functional relation allows us to translate results for h into results for g ∞ and thus for the optimization problem in (2). For technical convenience, we will focus on the study of h in Section II. When there is no risk of confusion, we will omit PXY in h(PXY , ε). In Theorem 1, we show that the map h(PXY , ·) is piecewise linear (Fig. 2). The proof relies on a geometric reformulation of h and a careful study of the directional derivatives in the space of stochastic matrices. As a byproduct of Theorem 1, a formula for the derivative of h at Pc (X|Y ) is established in (34). This formula, along with the concavity of h, permits us to obtain a tight upper bound for h. In particular, when |X | = |Y| = 2, these properties allow us to derive a closed form expression for h (Theorem 2). Moreover, it is shown that either a Z-channel or a reverse Z-channel (Fig. 3) achieves h(PXY , ε) for any ε depending on the backward channel PX|Y . Motivated by practical purposes, we next consider a variant quantity h which we define analogously to h except that Z is required to be supported over Y. In this case, h may not be concave and consequently the proof technique developed for h does not apply. Nonetheless, we derive in Theorem 3 a closed form expression for h in the high utility regime (i.e., for sufficiently large ε). We then specialize Theorem 3 to the binary vector case. Here, Z n is revealed publicly and the goal is to guess Y n under the privacy constraint Pc (X n |Z n ) ≤ εn . We consider two models for the pair of random vectors (X n , Y n ). In the first model (Theorem 4), we assume that X n consists of n independent and identically distributed (i.i.d.) Bernoulli(p) samples with p ∈ [ 21 , 1). In the second model (Theorem 5), we assume that X n comprises the first n samples of a first-order homogeneous Markov process having a simple symmetric transition matrix. We assume that in both cases Yk , k = 1, . . . , n is the output of a BSC(α), with α ∈ [0, 21 ), when Xk is the input. We also study in detail the problem of learning 7 from a private distribution, which corresponds to the special case X1 = · · · = Xn of the second model (Proposition 3). In the continuous case, we first show that the strong privacy guarantee LMS (f (X) → Z) ≤ ε for every non-constant real-valued function f is equivalent to a condition on the maximal correlation (also referred to as the Hirschfeld-Gebelein-Rényi maximal correlation [12]–[14]) between X and Z. We then derive the value of sENSR for the Gaussian case (Example 3) and obtain sharp lower and upper bounds for general X and Gaussian Y in Theorem 7. Finally, we establish a tight lower bound on sENSR(PXY , ε) for general (X, Y ) and sufficiently small ε in Lemma 2. B. Related Work There have been several choices proposed for an appropriate measure L of information leakage in the information theory and computer science literature. Shannon’s mutual information I(X; Z) (or equivalently the conditional entropy H(X|Z)), while an intuitively reasonable choice, does not lead to an arguably "operational" privacy guarantee and thus may not satisfactorily serve as an appropriate information leakage function, see [15] and [16]. Smith [15] discussed that the guessing entropy [17] (defined as the expected number of guesses required to guess X from Z) cannot be adopted as an information leakage function and then proposed Arimoto’s mutual information of order ∞ as an appropriate notion of information leakage. Operationally, I∞ (X; Z) ≤ ε for sufficiently small ε implies that it is nearly as hard for an adversary observing Z to guess X as it is without Z. Braun et al. [18] proposed to measure information leakage by Pc (X|Z) − Pc (X). Barthe and Köpf [19] studied the case where the prior PX is not known and then proposed the maximal information leakage max I∞ (X; Z), where the maximization is taken over all priors PX . We refer the readers to [20] for a complete list of existing information leakage measures. s Issa et al. [5] recently proposed I∞ (X; Z), Sibson’s mutual information of order ∞ [10], [21], as a s measure of information leakage and they showed that the requirement I∞ (X; Z) ≤ ε is equivalent to I∞ (U; Z) ≤ ε for all auxiliary random variables U satisfying U ⊸− − X ⊸− − Z. Consequently, this guarantees that no randomized function of X can be efficiently estimated from Z, which leads to a strong privacy guarantee. In contrast, the privacy requirement I∞ (X; Z) ≤ ε guarantees to keep X itself private. To see the difference between these two approaches, consider the following example. Suppose Alice observes Y ∈ {0, 1} which is correlated with private data X ∈ {0, 1}. Assume that Alice wishes 8 to reveal absolutely no information about X (i.e., perfect privacy) when answering a question regarding Y . This, according to the privacy constraint dictated by Sibson’s mutual information, requires Z to be statistically independent of both Y and X and thus perfect privacy results in trivial utility. However, as shown in Theorem 2, a non-trivial utility might be achieved, depending on the channel from Y to X, when imposing perfect privacy by the requirement I∞ (X; Z) = 0. There exist other estimation-theoretic measures of information leakage in the literature. For example, Makhdoumi and Fawaz [22] proposed to use the maximal correlation ρm as a measure of information leakage without giving an operational interpretation. However, Calmon et al. [23, Theorem 9] showed Pc (f (X)|Z) − Pc (f (X)) ≤ ρm (X, Z) for discrete X and Z and any non-constant function f , thus providing an interesting operational interpretation for maximal correlation as a measure of information leakage. Analogously, we show that ρ2m (X, Z) ≤ ε is equivalent to mmse(f (X)|Z) ≥ (1 − ε)var(f (X)) for any measurable non-constant real-valued function f . This then provides an operational interpretation for the privacy guarantee ρ2m (X, Z) ≤ ε that we study in Section IV, where X and Y are assumed to be absolutely continuous random variables. The study of the utility-privacy tradeoff was initiated by Yamamoto [24] from an information theoretic point of view and further explored in [4], [6], [25]–[30]. In particular, the rate-privacy function g(PXY , ε) was introduced in [4] as the maximum I(Y ; Z) over all privacy filters PZ|Y such that I(X; Z) ≤ ε (note that the “privacy funnel” studied in [25] is a dual representation of g(PXY , ε)). Motivated by [7], a better justified rate-privacy function g̃(PXY , ε) was introduced in [4] where the privacy guarantee I(X; Z) ≤ ε is replaced by ρ2m (X, Z) ≤ ε and it was shown that g(PXY , ε) can bound g̃(PXY , ε) from above. C. Notation Throughout, we use capital letters, e.g., X, to denote random variables and lowercase letters, e.g., x, to denote their realizations. We use X n to denote the vector (X1 , X2 , . . . , Xn ). We let Z(β) denote the Z-channel with crossover probability β. For any a ∈ [0, 1], we write ā for 1 − a. As already mentioned, we let BSC(α) denote the binary symmetric channel with crossover probability α; we also use X⊥ ⊥Z to indicate the independence of random variables X and Z and we write X ⊸− − Y ⊸− − Z when X and Z are conditionally independent given Y (i.e., when X, Y, and Z form a Markov chain in this order). 9 D. Organization The rest of the paper is organized as follows. In Section II, we focus on the Hamming loss function for discrete X and Y and determine g ∞ in the binary case (by deriving h) and obtain a tight bound for g ∞ in the high utility regime for general discrete X and Y (by studying h). We also identify optimal privacy filters in these cases. In Section III, we study h for n-tuples (X n , Y n ) when |X | = |Y| = 2. In Section IV, we focus on absolutely continuous X and Y and obtain sharp bounds on sENSR. II. D ISCRETE S CALAR C ASE In this section, we assume that X and Y are finite-alphabet random variables taking values in X = {1, . . . , M} and Y = {1, . . . , N}, respectively. Let P (x, y) with x ∈ X and y ∈ Y be their joint distribution and pX and qY the marginal distributions. The goal here is to maximize the information leakage from Y to Z (i.e., utility) while ensuring that the information leakage from X to Z (i.e., privacy leakage) is negligible. As stated earlier, to quantify the tradeoff between utility and privacy, it suffices to study h, defined in (5). A. Geometric Properties of h First, note that Pc (X|Y, Z) ≥ Pc (X|Z) ≥ Pc (X) for jointly distributed random variables X, Y and Z. Therefore, from (5) we have Pc (Y ) ≤ h(ε) ≤ 1, and h(ε) = 1 if and only if ε ≥ Pc (X|Y ). Thus it is enough to study h on the interval [Pc (X), Pc (X|Y )]. An application of the Support Lemma [31, Lemma 15.4] shows that it is enough to consider random variables Z supported on Z = {1, . . . , N + 1}. Thus, the privacy filter PZ|Y can be realized by an N × (N + 1) stochastic matrix F ∈ MN ×(N +1) , where MN ×M denotes the set of all real-valued N × M matrices. Let F be the set of all such matrices. Then both utility U(P, F ) = Pc (Y |Z) and privacy P(P, F ) = Pc (X|Z) are functions of F ∈ F and can be written as P(P, F ) := N +1 X z=1 max 1≤x≤M N X P (x, y)F (y, z), y=1 U(P, F ) := N +1 X z=1 max q(y)F (y, z). 1≤y≤N (7) In particular, we can express h(ε) as h(ε) = sup U(P, F ). F ∈F , P(P,F )≤ε (8) 10 1 0.9 0.8 h(ε) 0.7 0.6 0.5 0.4 0 0.2 Pc (X) 0.4 0.6 ε 0.8 1 Pc (X|Y ) Fig. 2. Typical h and its trivial lower bound, the chord connecting (Pc (X), h(Pc (X))) and (Pc (X|Y ), 1). As before, consider P fixed and omit it in U(P, F ) and P(P, F ) when there is no risk of confusion. It is straightforward to verify that P and U are continuous and convex on F . As a consequence, for every ε ∈ [Pc (X), Pc (X|Y )], there exists G ∈ F such that P(G) = ε and U(G) = h(ε). It is then direct to show that h is continuous on [Pc (X), Pc(X|Y )]. Using a proof technique similar to [32, Theorem 2.3], it can also be shown that the graph of h is the upper boundary of the two-dimensional convex set {(P(F ), U(F )) : F ∈ F } and thus h is concave and strictly increasing. The following theorem, which is the most important and technically difficult result of this paper, states that h is a piecewise linear function, as illustrated in Fig. 2. Theorem 1. The function h : [Pc (X), Pc (X|Y )] → R+ is piecewise linear, i.e., there exist K ≥ 1 and thresholds Pc (X) = ε0 ≤ ε1 ≤ . . . ≤ εK = Pc (X|Y ) such that h is linear on [εi−1 , εi ] for all i = 1, . . . , K. The proof of this theorem, which is given in Appendix A, relies on the geometrical formulation of h. In particular, it is proved that P and U, are piecewise linear functions on F . Using this fact, we establish the existence of a piecewise linear path of optimal filters in F . The proof technique allows us to derive the slope of h on [εi−1 , εi ], given the family of optimal filters at a single point ε ∈ [εi−1 , εi ]. For example, since the family of optimal filters at ε = Pc (X|Y ) is easily obtainable, it is possible to compute h on the last interval. We utilize this observation in Section II-C to prove that in the binary case h is indeed linear. 11 B. Perfect Privacy When ε = Pc (X), observing Z does not increase the probability of guessing X. In this case we say that perfect privacy holds. An interesting problem is to characterize when non-trivial utility can be obtained under perfect privacy, that is, to characterize when h(Pc (X)) > Pc (Y ) holds. To the best of our knowledge, a general necessary and sufficient condition for this requirement is unknown. Notice that h(Pc (X)) > Pc (Y ) is equivalent to g ∞ (0) > 0. As opposed to the Shannon mutual information, I∞ (X; Z) = 0 does not necessarily imply that X⊥ ⊥Z. In particular, the weak independence arguments from [4, Lemma 10] (see also [6]) cannot be applied for g ∞ . However, we have the following. Proposition 1. Let (X, Z) be a pair of random variables with X uniformly distributed. If I∞ (X; Z) = 0, then X⊥ ⊥Z. Proof. Note that we have !  X Pc (X|Z) = log M + log PZ (z) max PX|Z (x|z) I∞ (X; Z) = log x∈X Pc (X) z∈Z X  ≥ log M + PZ (z) max log PX|Z (x|z)  x∈X z∈Z ≥ log M + = I(X; Z), X PZ (z) z∈Z X PX|Z (x|z) log PX|Z (x|z) x∈X where the first inequality follows from Jensen’s inequality. Hence, I∞ (X; Z) = 0 implies that I(X; Z) = 0 and thus X⊥ ⊥Z. As a consequence of Proposition 1, when X and Y are uniformly distributed, one can apply the weak independence arguments from [4, Lemma 10] to obtain the following. Corollary 1. If X and Y are uniformly distributed, then g ∞ (0) > 0 if and only if X is weakly independent of Y . When X is uniform, the privacy requirement I∞ (X; Z) ≤ ε guarantees that an adversary observing Z cannot efficiently estimate any arbitrary randomized function of X. To see this, consider a random variable U which satisfies U ⊸− − X ⊸− − Z. Then we have Pc (U|Z) = X z∈Z max u∈U X x∈X PU X (u, x)PZ|X (z|x) 12  X X ≤ max PZ|X (z|x) max PU X (u, x) z∈Z x∈X u∈U x∈X ! Pc (X|Z)Pc (U) , = Pc (X) which can be rearranged to yield I∞ (U; Z) ≤ I∞ (X; Z). It is worth mentioning that the data processing inequality for I∞ [3] states that I∞ (Z; U) ≤ I∞ (Z; X). However, I∞ (Z; U) is not necessarily equal to I∞ (U; Z). C. Binary Case A channel W is called a binary input binary output channel with crossover probabilities α and β, denoted by BIBO(α, β), if W(·|0) = (ᾱ, α) and W(·|1) = (β, β̄). Notice that if X ∼ Bernoulli(p) with p ∈ [ 21 , 1) and PY |X = BIBO(α, β) with α, β ∈ [0, 21 ), then Pc (X) = p and Pc (X|Y ) = max{ᾱp̄, βp} + β̄p. In this case, if ᾱp̄ ≤ βp then Pc (X|Y ) = p = Pc (X) and hence h(p) = 1. The following theorem, whose proof is given in Appendix B, establishes the linear behavior of h in the non-trivial case ᾱp̄ > βp. Theorem 2. Let X ∼ Bernoulli(p) with p ∈ [ 12 , 1) and PY |X = BIBO(α, β) with α, β ∈ [0, 21 ) such that ᾱp̄ > βp. Then, for any ε ∈ [p, ᾱp̄ + β̄p] = [Pc (X), Pc (X|Y )], h(ε) = where q := qY (1) = αp̄ + β̄p, ζ(ε) :=   1 − ζ(ε)q, αᾱp̄2 < β β̄p2 ,  1 − ζ̃(ε)q̄, ᾱp̄ + β̄p − ε , β̄p − αp̄ αᾱp̄2 ≥ β β̄p2 , and ζ̃(ε) := ᾱp̄ + β̄p − ε . ᾱp̄ − βp (9) Furthermore, the Z-channel Z(ζ(ε)) and the reverse Z-channel Z̃(ζ̃(ε)) achieve h(ε) when αᾱp̄2 < β β̄p2 and αᾱp̄2 ≥ β β̄p2 , respectively. The optimal privacy filters are depicted in Fig. 3. Note that the condition αᾱp̄2 < β β̄p2 can be equivalently written as PX|Y (1|1) > PX|Y (0|0), and hence, intuitively speaking, the event Y = 1 reveals more information about X than Y = 0. Consequently, in order to preserve privacy the mechanism M needs to distort the event Y = 1. Under the hypotheses of Theorem 2, there exists a Z-channel for every ε ∈ [Pc (X), Pc (X|Y )] that achieves h(ε). A minor modification to the proof of Theorem 2 shows that the Z-channel is the only 13 0 0 0 α X ζ( Y 0 1 1 − ζ̃(ε) α ε) Z X β 1 0 ζ˜( ε ) Z β 1 1-ζ(ε) Y 0 1 (a) αᾱp̄2 < β β̄p2 . 1 1 (b) αᾱp̄2 ≥ β β̄p2 . Fig. 3. Optimal privacy mechanisms in Theorem 2. binary privacy filter with this property for p ∈ ( 21 , 1). It is worth mentioning that in the symmetric case (i.e., α = β) with uniform input (i.e., p = 21 ), the channel BSC(0.5ζ(ε)) can be shown to achieve h(ε). It is straightforward to show that 1 − ζ(p)q > q̄ if and only if p ∈ ( 21 , 1), and 1 − ζ(p)q > q if and only if αᾱp̄2 < β β̄p2 . In particular, we have the following necessary and sufficient condition for the non-trivial utility under perfect privacy. Corollary 2. Let X ∼ Bernoulli(p) with p ∈ [ 12 , 1) and PY |X = BIBO(α, β) with α, β ∈ [0, 12 ) such that ᾱp̄ > βp. Then g ∞ (0) > 0 if and only if αᾱp̄2 < β β̄p2 and p ∈ ( 21 , 1). D. A variant of h Thus far, we studied the privacy-constrained guessing probability h where no constraint on the cardinality of the displayed data Z is imposed (other than being finite). Nevertheless, it was shown that it is sufficient to consider Z with cardinality |Y|+1 = N +1. However, this condition may be practically inconvenient. Moreover, for the scalar binary case examined in the last section we showed that a binary Z was sufficient to achieve h(ε) for any ε ∈ [Pc (X), Pc (X|Y )]. Hence to simplify the constrained optimization problem, it is natural to require that |Z| = |Y| = N, which leads to the following variant quantity of h, denoted by h. Definition 4. For arbitrary discrete random variables X and Y supported on X and Y respectively, let h : [Pc (X), Pc (X|Y )] → R+ be defined by h(ε) := sup Pc (Y |Z), PZ|Y ∈Dε  − Y ⊸− − Z, Pc (X|Z) ≤ ε . where Dε := PZ|Y : Z = Y, X ⊸− 14 Unlike h, the definition of h requires Z = Y. This difference makes the tools from [32] unavailable. In particular, the concavity and hence the piecewise linearity of h do not carry over to h. However, we have the following theorem for h whose proof is given in Appendix C. For notational convenience, we adopt the convention x 0 = +∞ for x > 0. For (y0 , z0 ) ∈ Y × Y, a channel W is said to be an N-ary Z-channel with crossover probability γ from y0 to z0 , denoted by Zy0 ,z0 (γ), if the input and output alphabets are Y and W(y|y) = 1 for y 6= y0 , W(z0 |y0) = γ, and W(y0 |y0 ) = γ̄. We also let h′ (Pc (X|Y )) denote the left derivative of h(·) evaluated at ε = Pc (X|Y ). Theorem 3. Let X and Y be discrete random variables. If Pc (X) < Pc (X|Y ), then there exists εL < Pc (X|Y ) such that h is linear on [εL , Pc (X|Y )]. In particular, for every ε ∈ [εL , Pc (X|Y )], h(ε) = 1 − (Pc (X|Y ) − ε)h′ (Pc (X|Y )). (10) Moreover, if qY (y) > 0 for all y ∈ Y and if there exists (a unique) xy ∈ X for each y ∈ Y such that PX|Y (xy |y) > PX|Y (x|y) for all x 6= xy , then h′ (Pc (X|Y )) = min (y,z)∈Y×Y qY (y) . PXY (xy , y) − PXY (xz , y) (11) In addition, if (y0, z0 ) ∈ Y × Y attains the minimum in (11), then there exists εyL0 ,z0 < Pc (X|Y ) such that Zy0 ,z0 (ζ y0 ,z0 (ε)) achieves h(ε) for every ε ∈ [εLy0 ,z0 , Pc (X|Y )], where ζ y0 ,z0 (ε) = Pc (X|Y ) − ε . PXY (xy0 , y0) − PXY (xz0 , y0 ) Although (10) establishes the linear behavior of h over [εL , Pc (X|Y )] for general X and Y , a priori it is not clear how to obtain h′ (Pc (X|Y )). Under the assumptions of Theorem 3, (11) expresses h′ (Pc (X|Y )) as the minimum of finitely many numbers, and a suitable Z-channel achieves h for ε close to Pc (X|Y ). As we will see in the following section, these assumptions are rather general and allow us to derive a closed form expression for h for a pair of binary random vectors (X n , Y n ) with X n , Y n ∈ {0, 1}n . III. B INARY V ECTOR C ASE We next study privacy aware guessing for a pair of binary random vectors (X n , Y n ). First note that since having more side information only improves the probability of correct guessing, one can write 15 Pc (X n ) ≤ Pc (X n |Z n ) ≤ Pc (X n |Y n , Z n ) = Pc (X n |Y n ) for X n ⊸− − Y n ⊸− − Z n and thus, we can restrict εn in the following definition to [Pc (X n ), Pc (X n |Y n ))]. 1/n 1/n Definition 5. For a given pair of binary random vectors (X n , Y n ), let hn : [Pc (X n ), Pc (X n |Y n )] → R+ be defined as hn (ε) := sup PZ n |Y n ∈Dn,ε n n P1/n c (Y |Z ) (12) n n − Y n ⊸− − Z n , P1/n where Dn,ε = {PZ n |Y n : Z n = {0, 1}n , X n ⊸− c (X |Z ) ≤ ε}. Notice that this definition does not make any assumption about the privacy filters PZ n|Y n apart from Z n = {0, 1}n . Nonetheless, this restriction makes the functional properties of hn different from those of h. In order to study hn , we consider the following two scenarios for (X n , Y n ): (a1 ) X1 , . . . , Xn are i.i.d. samples drawn from Bernoulli(p), (a2 ) X1 ∼ Bernoulli(p) and Xk = Xk−1 ⊕ Uk for k = 2, . . . , n, where U2 , . . . , Un are i.i.d. samples drawn from Bernoulli(r) and independent of X1 , where ⊕ denotes mod 2 addition, and in both cases, we assume that (b) Yk = Xk ⊕ Vk for k = 1, . . . , n, where V1 , . . . , Vn are i.i.d. samples drawn from Bernoulli(α) and independent of X n . We study hn for (X n , Y n ) satisfying the assumptions (a1 ) and (b) in Section III-A and for (X n , Y n ) satisfying the assumptions (a2 ) and (b) in Section III-B. We study hn in the special case r = 0 in more detail. A. I.I.D. Case Here, we assume that (X n , Y n ) satisfy (a1 ) and (b) and apply Theorem 3 to derive a closed form expression for hn (ε) for ε close to Pc (X n |Y n ). Additionally, we determine an optimal filter in the same regime. We begin by identifying the domain [Pc (X n ), Pc (X n |Y n )] of h in the following lemma, whose proof follows directly from the definition of Pc . 16 00 00 00 01 01 01 10 10 10 11 11 1-ζ2 (ε) 11 Fig. 4. The optimal filter for h2 (ε) for ε ∈ [εL , ᾱ]. Lemma 1. Assume that (X1 , Z1 ), . . . , (Xn , Zn ) are independent pairs of random variables. Then Pc (X n |Z n ) = n Y k=1 Pc (Xk |Zk ). Thus, according to this lemma, if p ∈ [ 21 , 1) and α ∈ [0, 12 ) then Pc (X n ) = pn and Pc (X n |Y n ) = ᾱn . The following proposition, whose proof is given in Appendix D, is a straightforward consequence of Theorem 3. A channel W is said to be a 2n -ary Z-channel with crossover probability γ, denoted by Zn (γ), if its input and output alphabets are {0, 1}n and it is Z1,0(γ), where 0 = (0, 0, . . . , 0) and 1 = (1, 1, . . . , 1). Theorem 4. Assume that (X n , Y n ) satisfy (a1 ) and (b) with p ∈ [ 21 , 1) and α ∈ [0, 21 ) such that ᾱ > p. Then there exists εL < ᾱ such that, for all ε ∈ [εL , ᾱ], hnn(ε) = 1 − ζn(ε)q n where q = αp̄ + ᾱp and ζn (ε) := ᾱn − εn . (ᾱp)n − (αp̄)n Moreover, the 2n -ary Z-channel Zn (ζn (ε)) achieves hn (ε) in this interval. The optimal privacy filter achieving h2 (ε) is depicted in Fig. 4. From an implementation point of view, the simplest privacy filter is a memoryless filter such that Zk is a noisy version of Yk for each k = 1, . . . , n. This privacy mechanism generates Zk , given Yk , using a single BIBO channel W, and 17 thus n n PZ n |Y n (z |y ) = n Y k=1 W(zk |yk ). (13) 1/n Now, let hni (ε) = sup Pc (Y n |Z n ), where the supremum is taken over all PZ n |Y n satisfying (13) 1/n 1/n 1/n and Pc (X n |Z n ) ≤ ε. Clearly, hni (ε) ≤ hn (ε) for all ε ∈ [Pc (X n ), Pc (X n |Y n )]. The following proposition shows that if we restrict the privacy filter PZ n |Y n to be memoryless, then the optimal filter coincides with the optimal filter in the scalar case, which in this case is Z(ζ(ε)), defined in Theorem 2. Proposition 2. Assume that (X n , Y n ) satisfy (a1 ) and (b) with p ∈ [ 21 , 1) and α ∈ [0, 12 ) such that ᾱ > p. Then, for all ε ∈ [p, ᾱ], hni (ε) = h(ε) = 1 − ζ(ε)q, where q = αp̄ + ᾱp and ζ(ε) = ᾱp̄ + ᾱp − ε . ᾱp − αp̄ Proof. For any privacy filter satisfying (13), (X n , Z n ) and (Y n , Z n ) are i.i.d. By Lemma 1, we have Pc (X n |Z n ) = (Pc (X|Z))n and Pc (Y n |Z n ) = (Pc (Y |Z))n where (X, Y, Z) has the common distribution of {(Xk , Yk , Zk )}nk=1. In particular, hni (ε) = sup 1/n Pc (X n |Z n )≤ε n n P1/n c (Y |Z ) = sup Pc (X|Z)≤ε Pc (Y |Z), where the first supremum assumes (13) and the second supremum is implicitly constrained to Z = {0, 1}. The result then follows from Theorem 2. It must be noted that, despite the fact that (X n , Y n ) is i.i.d., the memoryless privacy filter associated to hni (ε) is not optimal, as hn (ε) is a function of n while hni (ε) is not. The following corollary, whose proof is given in Appendix E, bounds the loss resulting from using a memoryless filter instead of an optimal one for ε ∈ [εL , ᾱ]. Clearly, for n = 1, there is no gap as h1 (ε) = h(ε) = h1i (ε). Corollary 3. Let (X n , Y n ) satisfy (a1 ) and (b) with p ∈ [ 21 , 1) and α ∈ [0, 21 ) such that ᾱ > p. Let εL be as in Theorem 4. If p > 1 2 and α > 0, then for ε ∈ [εL , ᾱ] and sufficiently large n hn (ε) − hni (ε) ≥ (ᾱ − ε)[Φ(1) − Φ(n)], (14) 18 1 0.9 0.8 0.7 ε εL ᾱ i Fig. 5. The graphs of h10 (ε) (green solid curve), h2 (ε) (red dashed curve), and h2i (ε) = h10 (ε) (blue dotted line) given n n in Proposition 2 and Theorem 4 for i.i.d. (X , Y ) with X ∼ Bernoulli(0.6) and PY |X = BSC(0.2). where q = αp̄ + ᾱp and Φ(n) := q n ᾱn−1 . (ᾱp)n − (αp̄)n If p = 21 , then hni (ε) ≤ hn(ε) ≤ hni (ε) + α , 2ᾱ (15) for every n ≥ 1 and ε ∈ [εL , ᾱ]. Note that Φ(n) ↓ 0 as n → ∞. Thus (14) implies that, as expected, the gap between the performance of the optimal privacy filter and that of the optimal memoryless privacy filter increases as n increases. This observation is numerically illustrated in Fig. 5, where hn (ε) is plotted as a function of ε for n = 2 and n = 10. Moreover, (15) implies that when p = 1 2 and α is small, hn (ε) can be approximated by hni (ε). Thus, we can approximate the optimal filter Zn (ζn(ε)) with a simple memoryless filter given by Zk = Yk ⊕ Wk , where W1 , . . . , Wn are i.i.d. Bernoulli(0.5ζ(ε)) random variables that are independent of (X n , Y n ). B. Markov Private Data In this section, we assume that X n comprises the first n samples of a homogeneous first-order Markov process having a symmetric transition matrix; i.e., (X n , Y n ) satisfy (a2 ) and (b). In practice, this may account for data that follows a pattern, such as a password. 19 It is easy to see that under assumptions (a2 ) and (b), n n Pr(X = x ) = p̄r̄ In particular, if r < 1 2 n−1  x1 Y n   r xk ⊕xk−1 p . p̄ r̄ k=2 ≤ p, then a direct computation shows that Pc (X n ) = pr̄ n−1. The values of Pc (X n |Y n ) for odd and even n are slightly different. For simplicity, in what follows we assume that n is odd. In this case, as shown in equation (68) in Appendix F, n n n n−1 Pc (X |Y ) = ᾱ r̄ (n−1)/2  X k=0  n  α k . ᾱ k (16) Theorem 3 established the optimality of a Z-channel Zy0 ,z0 for some y0 , z0 ∈ {0, 1}n . In order to find a closed form expression for hn , it is necessary to find (y0 , z0 ) which in principle depends on the parameters (p, α, r). The following theorem, whose proof is given in Appendix F, bounds hn for different values of (p, α, r). Theorem 5. Assume that n ∈ N is odd and (X n , Y n ) satisfy (a2 ) and (b) with p ∈ [ 21 , 1), α ∈ (0, 12 ), r  α n−1 n n n ᾱp̄ > αp and Pc (X ) < Pc (X |Y ). If < , then there exists εL < Pc (X n |Y n ) such that r̄ ᾱ 1 − ζn (ε) Pr(Y n = 1) ≤ hnn (ε) ≤ 1 − ζn (ε)αn , for every ε ∈ [εL , Pc (X n |Y n )], where ζn (ε) := r̄ Pc (X n |Y n ) − εn . p(ᾱr̄)n − p̄(αr̄)n Furthermore, the 2n -ary Z-channel Zn (ζn (ε)) achieves the lower bound in this interval. The special case of r = 0 is of particular interest. Note that when r = 0, then (a2 ) corresponds to X1 = · · · = Xn = θ ∈ {0, 1}. Here, Y n ∈ {0, 1}n are i.i.d. copies drawn from PY |θ = Bernoulli(ᾱθ αθ̄ ). The prior distribution of the parameter θ is Bernoulli(p). The parameter θ is considered to be private and Y n must be guessed as accurately as possible. This problem can be viewed as a reverse version of privacy-aware learning studied in [33]. The following proposition, whose proof is given in Appendix G, provides a closed form expression for hn in the low privacy regime. Note that in this case, Pc (θ) = p and the value of Pc (θ|Y n ) is obtained from (16) by setting r = 0. Proposition 3. Assume that n is odd. Let θ ∼ Bernoulli(p) with p ∈ [ 12 , 1) and Y n be n i.i.d. 20 Bernoulli(ᾱθ αθ̄ ) samples with α ∈ (0, 21 ), ᾱp̄ > αp and p < Pc (θ|Y n ). Then, there exists εL < Pc (θ|Y n ) such that max PZ n |Y n :Z n ={0,1}n , Pc (θ|Z n )≤εn Pc (Y n |Z n ) = 1 − ζn (ε)(pᾱn + p̄αn ), for every ε ∈ [εL , Pc (θ|Y n )] where Pc (θ|Y n ) − εn . pᾱn − p̄αn ζn (ε) = Moreover, the 2n -ary Z-channel Zn (ζn (ε)) achieves hn (ε) in this interval. IV. C ONTINUOUS C ASE In this section, we assume that X and Y are real-valued random variables having a joint density PXY and the filter PZ|Y is realized by an independent additive Gaussian noise random variable. In particular, the privacy filter’s output is Zγ = √ γY + NG , for some γ ≥ 0, where NG ∼ N (0, 1) is independent of (X, Y ). The goal of this section is to study sENSR, defined in Definition 3. To make the notation simpler, we define the following. Definition 6. Given a pair of absolutely continuous random variables (X, Y ) with distribution PXY and ε ≥ 0, we say that Zγ satisfies ε-strong estimation privacy, denoted as Zγ ∈ Γ(PXY , ε), if 1−ε≤ mmse(f (X)|Zγ ) ≤ 1, var(f (X)) (17) holds for every measurable function f : R → R with 0 < var(f (X)) < ∞. Similarly, Zγ is said to satisfy ε-weak estimation privacy, denoted by Zγ ∈ ∂Γ(PXY , ε), if (17) holds for identity function, i.e., f (x) = x. Similar to privacy, the utility between Y and Zγ will be measured in terms of LMS (Y → Zγ ). Since maximizing LMS (Y → Zγ ) amounts to minimizing mmse(Y |Zγ ), sENSR (Definition 3) quantifies the tradeoff between utility and privacy. In fact, sENSR can be equivalently written as sENSR(PXY , ε) = mmse(Y |Zγ ) . γ:Zγ ∈Γ(PXY ,ε) var(Y ) inf 21 We can analogously define the weak estimation noise-to-signal ratio as wENSR(PXY , ε) := mmse(Y |Zγ ) . γ:Zγ ∈∂Γ(PXY ,ε) var(Y ) inf Note that sENSR and wENSR are non-increasing since Γ(PXY , ε) ⊆ Γ(PXY , ε′ ) and ∂Γ(PXY , ε) ⊆ ∂Γ(PXY , ε′) if ε ≤ ε′ . For the sake of brevity, we omit PXY in Γ(PXY , ε), ∂Γ(PXY , ε), sENSR(PXY , ε), and wENSR(P, ε) when there is no risk of confusion. In what follows we derive equivalent conditions for Zγ ∈ Γ(ε) and Zγ ∈ ∂Γ(ε), respectively. Recall that the (Pearson) correlation coefficient of the random variables U and V is defined as ρ(U, V ) = p cov(U, V ) var(U)var(V ) provided that 0 < var(U), var(V ) < ∞. For a random variable U, let SU be the set of all measurable functions f : R → R such that 0 < var(f (U)) < ∞. Consider the following. Definition 7 ([14], [34]). Let U and V be a pair of random variables. i) The maximal correlation of U and V , denoted by ρm (U, V ), is defined as ρm (U, V ) := sup ρ(f (U), g(V )), (f,g)∈SU ×SV provided that 0 < var(U), var(V ) < ∞. If either SU × SV is empty (which happens precisely when either U or V is constant almost surely), then we set ρm (U, V ) = 0. ii) The one-sided maximal correlation1 between U and V , denoted by ηV (U), is defined as ηV (U) := sup ρ(U, g(V )), g∈SV provided that 0 < var(U) < ∞. If SV is empty, then we set ηV (U) = 0. It can be shown using the Cauchy-Schwarz inequality that ηV2 (U) = var(E[U |V ]) . var(U ) Therefore, the law of total variance implies mmse(U|V ) E[var(U|V )] var(E[U|V ]) = = 1− = 1 − ηV2 (U). var(U) var(U) var(U) (18) It can also be shown that 0 ≤ ρm (U, V ) ≤ 1, where the lower bound is achieved if and only if U 1 This name is taken from [35, Def. 7.4]. Originally, Rényi named this quantity as the "correlation ratio" of U on V [14, eq. (6)]. 22 and V are independent, and the upper bound is achieved if and only if there exists a pair of functions (f, g) ∈ SU × SV such that f (U) = g(V ) almost surely [14]. It is well known that if (XG , YG ) is a pair of jointly Gaussian random variables with correlation coefficient ρ, then ρ2m (XG , YG) = ρ2 (XG , YG ), see [13] or [36] for a more recent proof. Rényi [14] derived an equivalent characterization of maximal correlation as ρ2m (U; V ) = sup ηV2 (f (U)). (19) f ∈SU The following theorem provides an equivalent characterization of ε-strong estimation privacy Zγ ∈ Γ(ε). Theorem 6. Let U and V be non-degenerate random variables and ε ∈ [0, 1]. Then mmse(f (U)|V ) ≥ (1 − ε)var(f (U)), for all f ∈ SU if and only if ρ2m (U, V ) ≤ ε. In particular, Zγ ∈ Γ(ε) if and only if ρ2m (X, Zγ ) ≤ ε. Proof. From (18) and (19) we obtain that inf f ∈SU mmse(f (U)|V ) = 1 − sup ηV2 (f (U)) = 1 − ρ2m (U, V ). var(f (U)) f ∈SU From the previous equation it is clear that ρ2m (U, V ) ≤ ε if and only if mmse(f (U)|V ) ≥ (1 − ε)var(f (U)), for all f ∈ SU . By (17), we obtain Zγ ∈ Γ(ε) if and only if ρ2m (X, Zγ ) ≤ ε. From this theorem and (18), we can equivalently express sENSR(ε) and wENSR(ε) as sENSR(ε) = 1 − wENSR(ε) = 1 − sup γ≥0: ρ2m (X,Zγ )≤ε sup γ≥0: 2 (X)≤ε ηZ γ ηZ2 γ (Y ), ηZ2 γ (Y ). It is known that both η and ρm satisfy the data processing inequality (see e.g., [7] and [37]) and hence ηZγ (X) ≤ ηY (X) and ρm (X, Zγ ) ≤ ρm (X, Y ). Therefore, we can restrict ε in the definition of wENSR(ε) and sENSR(ε) to the intervals [0, ηY2 (X)] and [0, ρ2m (X, Y )], respectively. Unlike the discrete case, it is clear that perfect privacy ε = 0 implies γ = 0. Thus perfect privacy yields trivial utility; i.e., sENSR(0) = 1 and wENSR(0) = 1. 23 Note that γ 7→ mmse(Y |Zγ ) is continuous and decreasing on (0, ∞) [38] and γ 7→ ρ2m (X, Zγ ) is left-continuous and increasing on (0, ∞) [39, Theorem 2]. Thus we can define γε∗ := max{γ ≥ 0 : mmse(Y |Zγε∗ ) ρ2m (X, Zγ ) ≤ ε} for which we have sENSR(ε) = . The left-continuity of γ 7→ ρ2m (X, Zγ ) var(Y ) implies that ε 7→ γε∗ is right-continuous, and thus ε 7→ sENSR(ε) is right-continuous on (0, ρ2m (X, Y )). Example 3. Let (XG , YG) be jointly Gaussian random variables with mean zero and correlation coeffi√ cient ρ and let Zγ = γYG + NG . Since ρ2m (XG , Zγ ) = ρ2 (XG , Zγ ), we have that ρ2m (XG , Zγ ) = ρ2 γvar(YG) , 1 + γvar(YG ) and hence the mapping γ 7→ ρ2m (XG , Zγ ) is strictly increasing. As a consequence, for 0 ≤ ε ≤ ρ2 , the equation ρ2m (XG , Zγ ) = ε has a unique solution γε := ε , var(YG )(ρ2 − ε) and ρ2m (XG , Zγ ) ≤ ε if and only if γ ≤ γε . On the other hand, mmse(YG |Zγ ) = var(YG) , 1 + γvar(YG ) which shows that the map γ 7→ mmse(YG |Zγ ) is strictly decreasing. Therefore, sENSR(ε) = mmse(YG |Zγε ) ε = 1 − 2. var(YG ) ρ (20) Clearly, for jointly Gaussian XG and YG , we have ηZ2 γ (XG ) = ρ2m (XG , Zγ ) for any γ ≥ 0. Consequently, Γ(ε) = ∂Γ(ε) and, for 0 ≤ ε ≤ ρ2 , sENSR(ε) = wENSR(ε) = 1 − ε . ρ2 (21) Next, we obtain bounds on sENSR(ε) for the special case of Gaussian non-private data YG. Theorem 7. Let X be jointly distributed with Gaussian YG . Then, 1− ε ρ2 (X, Y G) ≤ sENSR(PXYG , ε) ≤ 1 − ε ρ2m (X, YG ) , 24 Proof. Without loss of generality, assume E(X) = E(YG ) = 0. Since YG is Gaussian, (18) implies that sENSR(ε) = inf γ:ρ2m (X,Zγ )≤ε mmse(YG |Zγ ) =1− sup ρ2m (YG ; Zγ ). var(YG ) γ:ρ2m (X,Zγ )≤ε (22) A straightforward computation leads to ρ2m (YG, Zγ ) = ρ2 (YG , Zγ ) = γvar(YG) , 1 + γvar(YG ) (23) ρ2m (X, Zγ ) ≥ ρ2 (X, Zγ ) = ρ2 (X, YG )ρ2m (YG, Zγ ). The preceding inequality and (22) imply sENSR(ε) ≥ 1 − ρ2m (X, Zγ ) ε ≥1− 2 , 2 ρ (X, YG ) γ:ρ2m (X,Zγ )≤ε ρ (X, YG ) sup which proves the lower bound. The strong data processing inequality for maximal correlation [4, Lemma 6] states that ρ2m (X, Zγ ) ≤ ε ρ2m (X, YG )ρ2m (YG, Zγ ). In particular, if ρ2m (YG , Zγ ) ≤ 2 , then ρ2m (X, Zγ ) ≤ ε. Therefore, (22) ρm (X, Y ) implies ε ρ2m (YG ; Zγ ) = 1 − 2 sENSR(ε) ≤ 1 − sup , ρm (X, YG ) γ:ρ2m (YG ,Zγ )≤ 2 ε ρm (X,YG ) where the last equality follows from the continuity of γ 7→ ρ2m (YG , Zγ ), established in (23), finishing the proof of the upper bound. Combined with (21), this theorem shows that for a Gaussian Y , a Gaussian XG minimizes sENSR(ε) among all continuous random variables X having identical ρ(X, YG ) and maximizes sENSR(ε) among all continuous random variables X having identical ρm (X, YG ). These observations establish another extremal property of Gaussian distribution over AWGN channels, see e.g., [40, Theorem 12] for another example. This theorem also implies that  1 1 − 2 sENSR(PXG YG , ε) − sENSR(PXYG , ε) ≤ ε 2 ρ (X, YG ) ρm (X, YG )  for Gaussian XG which satisfies ρ2m (XG , YG ) = ρ2m (X, YG). This demonstrates that if the difference ρ2m (X, YG ) − ρ2 (X, YG ) is small, then sENSR(PXYG , ε) is very close to sENSR(PXG YG , ε). As stated before, for any given joint density PXY , perfect privacy results in trivial utility, i.e., sENSR(0) = 1. Therefore, it is interesting to study the approximation of sENSR(ε) for sufficiently 25 small ε, i.e., in the almost perfect privacy regime. The next result provides such an approximation and also shows that the lower bound in Theorem 7 holds for general Y for ε in the almost perfect privacy regime. Lemma 2. We have for ε → 0 sENSR(ε) ≥ 1 − ε ρ2 (X, Y ) + o(ε). Proof. Let γε∗ := max{γ ≥ 0 : ρ2m (XG , Zγ ) ≤ ε}. (24) Recall that ρ2m (X, Zγ ) ≥ ρ2 (X, Zγ ) = γρ2 (X, Y )var(Y ) . 1 + γvar(Y ) (25) Since ε → 0, we can assume that ε < ρ2 (X, Y ). Thus, from (25) we obtain γε∗ ≤ ε var(Y )(ρ2 (X, Y ) − ε) . (26) In particular, γε∗ → 0 as ε → 0. Since γ 7→ mmse(Y |Zγ ) is decreasing, we have that sENSR(ε) = mmse(Y |Zγε∗ ). Therefore, the first-order approximation of sENSR(·) around zero yields sENSR(ε) = 1 + γε∗ d mmse(Y |Zγε∗ ) var(Y ) dγε∗ ε=0 + o(γε∗ ) (a) = 1 − var(Y )γε∗ + o(γε∗ ) (b) ≥ 1− where (a) follows from the fact that ε ρ2 (X, Y d mmse(Y dγ ) + o(ε) |Zγ ) = −E[var2 (Y |Zγ )] [38, Prop. 9] and (b) follows from (26). V. C ONCLUSION In this paper, we studied the problem of displaying Y under a privacy constraint with respect to X for a given pair of random variables (X, Y ) ∼ PXY , where utility and privacy are measured in terms of two loss functions. In the discrete case, we considered the Hamming loss function and introduced the privacy-constrained guessing probability h(PXY , ·) to quantify the utility-privacy tradeoff. We proved that h(PXY , ·) is piecewise linear which allowed us to obtain a closed form expression for h(PXY , ε) 26 for any ε for binary X and Y . As a natural lower bound for h, we defined h analogously to h with an additional assumption that Z ∈ Y, and derived a closed form expression for h(PXY , ε) in the high utility regime (i.e., for sufficiently large, but nontrivial, values of ε). We then specialized this result to the vector case, where {(Xi , Yi )}ni=1 are n samples of a pair of binary random vectors (drawn from either i.i.d. or a Markov distribution PX n Y n ). In the continuous case, we employed the squared-error loss function to define the so-called estimationnoise-to-signal ratio function, denoted by sENSR(PXY , ·), as a utility-privacy tradeoff with a clear operational meaning. In the special case of additive Gaussian privacy filters, we showed that if Y is Gaussian, then a Gaussian X minimizes sENSR(PXY , ·) among all (X, Y ) with identical correlation coefficient and maximizes sENSR(PXY , ·) among all (X, Y ) with identical maximal correlation. We also obtained a tight lower bound for sENSR(PXY , ε) for general absolutely continuous random variables when ε is sufficiently small. A PPENDIX A P ROOF OF T HEOREM 1 Before proving Theorem 1, we need to establish some technical facts. Consider the map H : F → [0, 1] × [0, 1] given by H(F ) = (P(F ), U(F )),  with P(F ) and U(F ) defined in (7). For ease of notation, let D = D ∈ MN ×(N +1) : kDk = 1 where || · || denotes the Euclidean norm in MN ×(N +1) ≡ RN (N +1) . For G ∈ F , let D(G) = {D ∈ D : G + tD ∈ F for some t > 0} . In graphical terms, D is the set of all possible directions in MN ×(N +1) and D(G) is the set of directions that make t 7→ G + tD (t ≥ 0) stay locally in F . Lemma 3. For every G ∈ F , the set D(G) is compact. Proof. Let A = {(y, z) : Gy,z = 0} and B = {(y, z) : Gy,z = 1}. It is straightforward to verify that D(G) = A ∩ B ∩ C ∩ D, 27 where A= B= C= \  D ∈ MN,(N +1) : Dy,z ≥ 0 , (y,z)∈A \  D ∈ MN,(N +1) : Dy,z ≤ 0 , (y,z)∈B ( D ∈ MN,(N +1) : N +1 X ) Dy,z = 0, y = 1, . . . , n . z=1 Observe that since sets A, B, C and D are closed, so is D(G). Since D is bounded, we have that D(G) is bounded as well. In particular, D(G) is closed and bounded and thus compact. The following lemma shows the local linear nature of the mapping H. Let [G1 , G2 ] = {λG1 + (1 − λ)G2 : λ ∈ [0, 1]}. Lemma 4. For every G ∈ F , there exists δ > 0 such that F 7→ H(F ) is linear on [G, G + δD] for every D ∈ D(G). Proof. Let P = [P (x, y)]x∈X ,y∈Y be the joint probability matrix of X and Y , and Q the diagonal matrix with q1 , . . . , qN as diagonal entries where qy = Pr(Y = y) for y ∈ Y. For G ∈ F fixed, consider the function τ : D(G) → R given by τ (D) = sup{t ≥ 0 | G + tD ∈ F }. Using the fact that F is a convex polytope, it can be shown that τ is continuous. The definition of D(G) clearly implies that τ (D) > 0 for all D ∈ D(G). For x ∈ X , z ∈ Z, and D ∈ D(G), consider (D) the function fx,z : R → R given by (D) fx,z (t) := [P G](x, z) + t[P D](x, z), (27) where P G (resp., P D) is the product of matrices P and G (resp., P and D). Note that P(G + tD) = X (D) max fx,z (t) for all t ∈ [0, τ (D)] (see (7)). Let z∈Z x∈X az = max[P G](x, z), x∈X Let t(D) x,z := − Mz = {x ∈ X : [P G](x, z) = az }, az − [P G](x, z) (D) bz − [P D](x, z) (D) and b(D) = max [P D](x, z). z x∈Mz (D) (28) whenever [P D](x, z) 6= bz , and tx,z = ∞ otherwise. Notice that 28 (D) f4,z (D) fx,z (D) f3,z (D) f2,z (D) f1,z (D) 0 t τ (D) t1,z (D) Fig. 6. Typical functions fx,z (x = {1, 2, 3, 4}) for a given z ∈ Z and D ∈ D(G). In this example, we have Mz = {3, 4} (D) (D) (D) (D) (D) and az + tbz = f4,z (t). Notice that t2,z = ∞ and t3,z = t4,z = 0. (D) (D) (D) (D) (D) fx,z (tx,z ) = az + tx,z bz . Since tx,z 6= 0 for all x ∈ / Mz , t(D) := min min min{|t(D) x,z |, τ (D)} > 0. z∈Z x∈M / z (D) It is easy to see that az + tb(D) = max fx,z (t) for all t ∈ [0, t(D) ]. In particular, z x∈X P(G + tD) = N +1 X (D) max fx,z (t) = z=1 x∈X N +1 X az + t z=1 for every D ∈ D(G) and t ∈ [0, t(D) ], where b(D) := N +1 X z=1 PN +1 z=1 b(D) = P(G) + tb(D) , z (29) (D) bz . Consequently, P is linear on [G, G + (D) t(D) D]. Since τ : D(G) → R is continuous and bounded, it follows that the map D 7→ min{|tx,z |, τ (D)} (x ∈ / Mz ) is also continuous. In particular, the map D 7→ t(D) is continuous. By compactness of D(G) established in Lemma 3, we conclude that δP := min t(D) > 0. Thus, P is linear on [G, G + δP D] D∈D(G) for every D ∈ D(G). (D) For y ∈ Y, z ∈ Z, and D ∈ D(G), consider the function gy,z : R → R given by (D) gy,z (t) = [QG](y, z) + t[QD](y, z). Observe that U(G + tD) = αz = max[QG](y, z), y∈Y X z∈Z (D) max gy,z (t) for all t ∈ [0, τ (D)] (see (7)). Similarly to (28), let y∈Y Nz = {y ∈ Y : [QG](y, z) = αz }, and βz(D) = max[QD](y, z). y∈Nz 29 Using a similar argument that resulted in (29), it can be shown that there exists δU > 0 such that U(G + tD) = N +1 X z=1 gy(D) (t) z ,z = N +1 X αz + t z=1 for every D ∈ D(G) and t ∈ [0, δU ], where β (D) := N +1 X z=1 PN +1 z=1 βz(D) = U(G) + tβ (D) , (30) (D) βz . Consequently, U is linear on [G, G + δU D] for every D ∈ D(G). Therefore, F 7→ H(F ) = (P(F ), U(F )) is linear on [G, G + δD] for every D ∈ D(G), where δ = min(δP , δU ). We say that a filter F ∈ F is optimal if U(F ) = h(P(F )). If F is an optimal filter and P(F ) = ε, we say that F is optimal at ε. The following result is a straightforward application of the concavity of h, and thus its proof is omitted. Lemma 5. For G ∈ F , let δ > 0 be as in Lemma 4. If there exist D ∈ D(G) and 0 < t1 < t2 ≤ δ such that G, G + t1 D and G + t2 D are optimal filters, then G + tD is an optimal filter for each t ∈ [0, δ]. A function [Pc (X), Pc (X|Y )] ∋ ε 7→ Fε ∈ F is called a path of optimal filters if P(Fε ) = ε and U(Fε ) = h(ε) for every ε ∈ [Pc (X), Pc (X|Y )]. As mentioned in Section II-A, for every ε there exists Fε such that P(Fε ) = ε and U(Fε ) = h(ε), i.e., a path of optimal filters always exists. In the rest of this section we establish the existence of a piecewise linear path of optimal filters. Lemma 6. For every ε ∈ [Pc (X), Pc (X|Y )), there exists Fε ∈ F and D ∈ D(Fε ) such that Fε is an optimal filter at ε, P(Fε + δD) > ε, and Fε + tD is an optimal filter for each t ∈ [0, δ] with δ > 0 as in Lemma 4 for Fε . Proof. Let K = 2(Pc (X|Y ) − ε)−1 . For every n, m > K, let Gn,m be an optimal filter at ε + 1 n + 1 . m For every n > K, the set {Gn,m : m > K} is an infinite set. Since F is compact, {Gn,m : m > K} has at least one accumulation point, say Gn . Let (Gn,mk )k≥1 ⊂ {Gn,m : m > K} be a subsequence with limk Gn,mk = Gn . By continuity of P, U, and h, we have that P(Gn ) = lim P(Gn,mk ) = ε + k→∞ 1 , n U(Gn ) = lim U(Gn,mk ) = lim h(P(Gn,mk )) = h(P(Gn )), k→∞ k→∞ i.e., Gn is an optimal filter at ε + n1 . By the same arguments as before, the set {Gn : n > K} has at least one accumulation point, say Fε , and this accumulation point is an optimal filter at ε. Let δ > 0 30 be as in Lemma 4 for Fε . By construction of Fε , there exists n1 > K such that kGn1 − Fε k < 2δ . The filter Gn1 can be written as Gn1 = Fε + t1 D1 with t1 ∈ (0, 2δ ) and D1 ∈ D(Fε ). Recall that, by (29) and (30), for every D ∈ D(Fε ) and t ∈ [0, δ], P(Fε + tD) = ε + tb(D) and U(Fε + tD) = h(ε) + tβ (D) . Notice that the maps D 7→ b(D) and D 7→ β (D) are continuous. Since P(Gn1 ) = ε+ n11 > ε, we conclude that b(D1 ) > 0 and, in particular, P(Fε + δD1 ) > ε. Let (Gn1 ,mk )k≥1 ⊂ {Gn1 ,m : m > K} be such that limk Gn1 ,mk = Gn1 . For k large enough, we can write Gn1 ,mk = Fε + θk Ek with θk ∈ [0, δ] and Ek ∈ D(Fε ). Since θk → t1 and Ek → D1 as k → ∞, there exists n2 > K such that θn2 < Clearly, t2 < δ 2 δ 2 and |b(En2 ) − b(D1 ) | < b(D1 ) . 2 Let t2 := θn2 and D2 := En2 . and 21 b(D1 ) < b(D2 ) < 2b(D1 ) . These inequalities yield P(Fε + δD1 ) > P(Fε + t2 D2 ) and P(Fε + δD2 ) > P(Fε + t1 D1 ). Thus, there exist s1 , s2 ∈ [0, δ] such that P(Fε + t2 D2 ) = P(Fε + s1 D1 ) and P(Fε + t1 D1 ) = P(Fε + s2 D2 ). In particular, ε + t2 b(D2 ) = ε + s1 b(D1 ) and ε + t1 b(D1 ) = ε + s2 b(D2 ) . (31) By the optimality of Gn1 = Fε + t1 D1 and Gn1 ,mn2 = Fε + t2 D2 , U(Fε + t2 D2 ) = h(ε) + t2 β (D2 ) ≥ h(ε) + s1 β (D1 ) = U(Fε + s1 D1 ), U(Fε + t1 D1 ) = h(ε) + t1 β (D1 ) ≥ h(ε) + s2 β (D2 ) = U(Fε + s2 D2 ). By the equations in (31), the above inequalities are in fact equalities. In particular, Fε , Fε + t1 D1 and Fε + s1 D1 are optimal filters. Invoking Lemma 5, we conclude that Fε + tD1 is an optimal filter for all t ∈ [0, δ]. Using an analogous proof, we can also prove the following lemma. Lemma 7. For every ε ∈ (Pc (X), Pc(X|Y )], there exists Fε ∈ F and D ∈ D(Fε ) such that Fε is an optimal filter at ε, P(Fε + δD) < ε, and Fε + tD is an optimal filter for each t ∈ [0, δ] with δ > 0 as in Lemma 4 for Fε . We are in position to prove Theorem 1. Proof of Theorem 1. For notational simplicity, we define S := Pc (X) and T := Pc (X|Y ). In light of 31 Lemmas 6 and 7, for every ε ∈ (S, T ) there exist optimal filters Fε and Gε at ε, δε > 0, Dε ∈ D(Fε ), and Eε ∈ D(Gε ) such that Fε +tDε and Gε +tEε are optimal filters for each t ∈ [0, δε ], and P(Gε +δε Eε ) < ε < P(Fε + δε Dε ). Note that δε = min{δFε , δGε }, where δFε and δGε are the constants obtained in Lemma 4 for filters Fε and Gε , respectively. For every ε ∈ (S, T ), let Vε = (P(Fε +δε Eε ), P(Gε +δε Dε )). Similarly, there exist a) an optimal filter FS at S, δS > 0, and DS ∈ D(FS ) such that FS + tDS is an optimal filter for each t ∈ [0, δS ] and P(FS + δS DS ) > S; b) an optimal filter GT at T , δT > 0, and ET ∈ D(GT ) such that GT + tET is an optimal filter for each t ∈ [0, δT ] and P(GT + δT ET ) < T . Let VS = [S, P(FS + δS DS )) and VT = (P(GT + δT ET ), T ]. The family {Vε : ε ∈ [S, T ]} forms an open cover of [S, T ] (in the subspace topology). By compactness, there exist S = ε0 < · · · < εl = T such that {Vε0 , . . . , Vεl } forms an open cover for [S, T ]. For each i ∈ {0, . . . , l − 1}, the mapping [εi , P(Fεi + δεi Dεi )) ∋ ε 7→ Fεi + ε − εi Dε ∈ F , b(Dεi ) i (32) is clearly linear. Similarly, for each i ∈ {1, . . . , l}, the mapping ε − εi Eε ∈ F , (33) b(Eεi ) i     ε − εi ε − εi is also linear. Notice that P Fεi + (Dε ) Dεi = ε = P Gεi + (Eε ) Eεi . Since {Vε0 , . . . , Vεl } b i b i forms an open cover for [S, T ], the mappings in (32) and (33) implement a piecewise linear path of (P(Gεi + δεi Eεi ), εi ] ∋ ε 7→ Gεi + optimal filters. The proof provided in this appendix establishes the existence of δ∗ > 0, an optimal filter F∗ at T := Pc (X|Y ), and D∗ ∈ D(F∗ ) such that P(F∗ + δ∗ D∗ ) < T (or equivalently b(D∗ ) < 0) and h(ε) = 1 + (ε − T ) β (D∗ ) , b(D∗ ) for every ε ∈ [T + δ∗ b(D∗ ) , T ]. This then implies that h′ (T ) = min F ∈F min D∈D(F ) P(F )=T b(D) <0 β (D) . b(D) (34) 32 A PPENDIX B P ROOF OF T HEOREM 2 We first note that since h is concave on [Pc (X), Pc (X|Y )], its right derivative exists at ε = Pc (X|Y ). Therefore, we have by concavity h(ε) ≤ 1 − (Pc (X|Y ) − ε)h′(Pc (X|Y )), (35) for all ε ∈ [p, Pc (X|Y )]. In Lemma 8 below, we show that h′(Pc (X|Y )) = q̄ q 1{αᾱp̄2 <β β̄p2 } + 1 2 2 . ᾱp̄ − βp {αᾱp̄ ≥β β̄p } β̄p − αp̄ Thus, (35) becomes h(ε) ≤   1 − ζ(ε)q, αᾱp̄2 < β β̄p2 ,  1 − ζ̃(ε)q̄, 2 (36) 2 αᾱp̄ ≥ β β̄p . To finish the proof of Theorem 2 we show that the Z-channel Z(ζ(ε)) and the reverse Z-channel Z̃(ζ̃(ε)) 2 2 achieve (35) and (36), when αᾱp̄2 < β β̄p2 and α  ᾱp̄ ≥ β β̄p , respectively. 1 0 . Notice that For αᾱp̄2 < β β̄p2 , consider the filter PZ|Y =  ζ(ε) 1 − ζ(ε) PXZ  p̄(ᾱ + αζ(ε)) p̄α(1 − ζ(ε))  = p(β + β̄ζ(ε)) pβ̄(1 − ζ(ε))  and   q̄ 0 . PY Z =  qζ(ε) q(1 − ζ(ε)) (37) It is straightforward to verify that p̄(ᾱ + αζ(ε)) ≥ p(β + β̄ζ(ε)). As a consequence, Pc (X|Z) = ε. Since q̄ αᾱp̄2 < β β̄p2 , we have that > ζ(ε). Thus, Pc (Y |Z) = 1 − ζ(ε)q. q   1 − ζ̃(ε) ζ̃(ε) . Notice that For αᾱp̄2 ≥ β β̄p2 , consider the filter PZ|Y =  0 1 PXZ  p̄ᾱ(1 − ζ̃(ε)) p̄(α + ᾱζ̃(ε))  = pβ(1 − ζ̃(ε)) p(β̄ + β ζ̃(ε))  and PY Z   q̄(1 − ζ̃(ε)) q̄ ζ̃(ε) . = 0 q (38) Recall that ᾱp̄ > βp and also observe that p(β̄+β ζ̃(ε)) ≥ p̄(α+ᾱζ̃(ε)). As a consequence, Pc (X|Z) = ε. The fact that αᾱp̄2 ≥ β β̄p2 implies q ≥ q̄ ζ̃(ε). Therefore, Pc (Y |Z) = 1 − ζ̃(ε)q̄. 33 Lemma 8. Let X ∼ Bernoulli(p) with p ∈ [ 21 , 1) and PY |X ∼ BIBO(α, β) with α, β ∈ [0, 21 ) such that q̄ q 1{αᾱp̄2 <β β̄p2 } + ᾱp̄ > βp. Then h′ (Pc (X|Y )) = 1 2 2 . ᾱp̄ − βp {αᾱp̄ ≥β β̄p } β̄p − αp̄ Proof. As before, let T := Pc (X|Y ). We begin the proof by noticing that the Z-channels defined in (37) and (38) provide a lower bound on h(ε) as follows: h(ε) ≥ 1 − ζ(ε)q1{αᾱp̄2 <β β̄p2 } − ζ̃(ε)q̄1{αᾱp̄2 ≥β β̄p2 } . (39) By concavity of h, this inequality implies h′ (T ) ≤ q q̄ 1 2 1αᾱp̄2 <β β̄p2 + 2. ᾱp̄ − βp αᾱp̄ ≥β β̄p β̄p − αp̄ The rest of the proof is devoted to establishing the reverse inequality. To this end, we use the variational formula for h′(T ) given in (34). Let P = [P (x, y)]x,y∈{0,1} be the joint probability matrix of X and Y . Without loss of generality we can assume Z = {z1 , z2 , z3 }. It follows from (29) and (30) that for every F ∈ F ⊂ M2×3 there exists δ > 0 such that P(F + tD) = P(F ) + tb(D) (D) for every t ∈ [0, δ] and D ∈ D(F ), where b with n = and 3 X i=1 U(F + tD) = U(F ) + tβ (D) , max [P D](x, zi ) and β x∈Mzi (D) = 3 X i=1 (40) max q(y)D(y, zi) y∈Nzi o Mzi = x ∈ {0, 1} : (P F )(x, zi ) = ′max (P F )(x , zi ) , n ′ x ∈{0,1} ′ ′ o Nzi = y ∈ {0, 1} : q(y)F (y, zi) = ′max q(y )F (y , zi ) . y ∈{0,1} Up to permutation of columns, which corresponds to permuting the elements of Z, the set of filters F ∈ F such that P(F ) = T equals          1 0 0      [ [ 0 u v 1 0 0 : 0<v≤u  : 0<v≤u   .   0 u v u + v = 1  1 0 0 u + v = 1  0 1 0  (41) To compute h′ (T ) using formula (34) we need to compute β (D) and b(D) for each D ∈ D(F ) with F of the form described in (41). 34  Let F =  1 0 0 0 u v   for some 0 < v ≤ u and u + v = 1. A direct computation shows that  ᾱp̄ uαp̄ vαp̄ . PF =  βp uβ̄p v β̄p  (42) In particular, Mz1 = {0}, Mz2 = {1}, and Mz3 = {1}. For every D ∈ D(F ),  PD =  ᾱp̄D11 + αp̄D21 ᾱp̄D12 + αp̄D22 ᾱp̄D13 + αp̄D23 βpD11 + β̄pD21 βpD12 + β̄pD22 βpD13 + β̄pD23  , and hence b(D) = ᾱp̄D11 + αp̄D21 + βpD12 + β̄pD22 + βpD13 + β̄pD23 . Notice that, for 1 ≤ i ≤ 3, we have that Di1 + Di2 + Di3 = 0. In particular, b(D) = (ᾱp̄ − βp)D11 + (αp̄ − β̄p)D21 . Consider the matrices,  q̄ 0   q̄ 0 0   F =   0 qu qv 0 q and   q̄ 0 0 q   D =  q̄D11 q̄D12 q̄D13 qD21 qD22 qD33  , from which we obtain Nz1 = {0}, Nz2 = {1}, Nz3 = {1}, and therefore, β (D) = q̄D11 + qD22 + qD23 = na o ax + y ≥ min , 1 for a, b > 0 and q̄D11 − qD21 . In what follows we use the simple fact that bx + y b x, y ≥ 0 with x + y > 0. For notational simplicity, let η := qq̄ and ζ := ζ(p), where ζ(·) is defined in (9). From the form of F , it is clear that −D11 ≥ 0 and D21 ≥ 0. If b(D) < 0, then D11 and D21 cannot be simultaneously zero, and hence β (D) η(−D11 ) + D21 q q min = ≥ (D) b β̄p − αp̄ ζ(−D11 ) + D21 β̄p − αp̄ In particular, we obtain that  η ,1 ζ  =          The case F =  0 u v 1 0 0  q , β̄p−αp̄ αᾱp̄2 < β β̄p2 , q̄ , ᾱp̄−βp αᾱp̄2 ≥ β β̄p2 . q , αᾱp̄2 < β β̄p2 , β (D) β̄p−αp̄ ≥ min D∈D(F ) b(D)   q̄ , αᾱp̄2 ≥ β β̄p2 . (D) b <0 ᾱp̄−βp  for 0 < v ≤ u and u + v = 1 is analogous. (43) 35   1 0 0 . By (42) with u = 1 and v = 0, we obtain that Mz1 = {0}, Mz2 = {1}, Now, let F =  0 1 0 and Mz3 = {0, 1}. In a similar way, Nz1 = {0}, Nz2 = {1}, and Nz3 = {0, 1}. Hence b(D) = ᾱp̄D11 + αp̄D21 + βpD12 + β̄pD22 + max{ᾱp̄D13 + αp̄D23 , βpD13 + β̄pD23 }, β (D) = q̄D11 + qD22 + max{q̄D13 , qD23 }. We therefore need to consider the following cases: Case I: ᾱp̄D13 + αp̄D23 ≤ βpD13 23 and q̄D13 ≤ qD23 . The computation in this case reduces  + β̄pD 1 0 0 . to the computation for F =  0 u v Case II: ᾱp̄D13 + αp̄D23 ≤ βpD13 + β̄pD23 and q̄D13 > qD23 . Notice that these conditions imply that ζD13 ≤ D23 < ηD13 , and therefore this case requires ζ < η (or equivalently, αᾱp̄2 < β β̄p2 ). This yields b(D) = (ᾱp̄ − βp)D11 + (αp̄ − β̄p)D21 and β (D) = qD22 − q̄D12 . Hence, we have q D22 − ηD12 β (D) = . (D) b β̄p − αp̄ ζD11 − D21 By the form of F , we have that −D11 , D12 , D21 ≥ 0. The inequalities ζ < η and ζD13 ≤ D23 D22 − ηD12 ≥ 1, and hence imply that ζD11 − D21 β (D) q ≥ 1{αᾱp̄2 <β β̄p2 } . (D) b β̄p − αp̄ (44) Case III: ᾱp̄D13 + αp̄D23 > βpD13 + β̄pD23 and q̄D13 ≤ qD23 . Notice that these conditions imply that ηD13 ≤ D23 < ζD13 , and hence this case requires ζ > η (or equivalently, αᾱp̄2 > β β̄p2 ). In this case, we have b(D) = (βp − ᾱp̄)D12 + (β̄p − αp̄)D22 and β (D) = q̄D11 − qD21 . Therefore, q̄ D11 − η −1 D21 β (D) . = b(D) ᾱp̄ − βp −D12 + ζ −1 D22 By the form of F , we have that −D22 , D12 , D21 ≥ 0. The inequalities ζ −1 < η −1 and ζD13 > D23 36 imply that D11 − η −1 D21 > 1, and hence −D12 + ζ −1 D22 q̄ β (D) > 1 2 2 . (D) b ᾱp̄ − βp {αᾱp̄ >β β̄p } (45) Case IV: ᾱp̄D13 +αp̄D23 > βpD13 + β̄pD23 and q̄D13 > qD23 . Notice that these two inequalities imply that D23 < min{ζ, η}D13. For this case we have that b(D) = (βp − ᾱp̄)D12 + (β̄p − αp̄)D22 β (D) = qD22 − q̄D12 . and Hence, we have β (D) q ηD12 − D22 = . (D) b β̄p − αp̄ ζD12 − D22 By the form of F , we have that −D22 , D12 ≥ 0. As before, we conclude that q β (D) ≥ min b(D) β̄p − αp̄  η ,1 ζ  =   Combining (43), (44), (45), and (46), we obtain       q , β (D) β̄p−αp̄ min min (D) ≥ F ∈F D∈D(F ) b   q̄ , P(F )=T b(D) <0 as desired. q , β̄p−αp̄ q̄ , ᾱp̄−βp αᾱp̄2 < β β̄p2 , (46) 2 2 αᾱp̄ ≥ β β̄p . αᾱp̄2 < β β̄p2 , αᾱp̄2 ≥ β β̄p2 , ᾱp̄−βp A PPENDIX C P ROOF OF T HEOREM 3 Recall that X = {1, . . . , M} and Y = Z = {1, . . . , N}, P = [P (x, y)](x,y)∈X ×Y is the joint probability matrix of X and Y , and the marginals are pX (x) = Pr(X = x) and qY (y) = Pr(Y = y) for every x ∈ X and y ∈ Y. Similar to h, the function h admits the alternative formulation h(ε) = sup F ∈F: P(F )≤ε U(F ), where F is the set of all stochastic matrices F ∈ MN ×N , P(F ) = X z∈Z max(P F )(x, z), x∈X and U(F ) = X z∈Z max qY (y)F (y, z). y∈Y 37 We let D = {D ∈ MN ×N : kDk = 1} and, for each F ∈ F, we define D(F ) := {D ∈ D : F + tD ∈ F for some t > 0} . Before proving Theorem 3, we need to establish some technical lemmas. Notice that the proofs of Lemmas 3 and 4 do not depend on the alphabets X , Y, and Z. Therefore, D(F ) is compact for any F ∈ F and also we obtain the following lemma. Lemma 9. Let H : F → [0, 1] × [0, 1] be the mapping given by H(F ) = (P(F ), U(F )). For every F ∈ F, there exists δ > 0 such that H is linear on [F, F + δD] for every D ∈ D(F ). The convex analysis tools used to study h heavily rely on the fact that |Z| = |Y| + 1. Hence, they are unavailable in this case, and thus we need an alternative approach to establish the desired functional properties of h. Lemma 10. If Pc (X) < Pc (X|Y ), then h is continuous at Pc (X|Y ). Proof. Without loss of generality, we will assume that qY (1) > 0. Let D∗ ∈ D(IN ) be given by   0 0 0 ···  λ −λ 0 · · ·   D∗ =  λ 0 −λ · · ·  .. .. .. .. . . . .  λ 0 0 ··· 0 0 0 .. .     ,     −λ where λ = (2(N − 1))−1/2 . As in the proof of Lemma 4, one can show that there exist δ1 > 0 and (xz )z∈Z ⊂ X such that for every t ∈ [0, δ1 ], P(IN + tD∗ ) = X z∈Z max(P (IN + tD∗ ))(x, z) = x∈X X (P (IN + tD∗ ))(xz , z). z∈Z In this case, we have that P(IN + tD∗ ) = P (x1 , 1) + tλ = X z∈Z N X z=2 P (xz , z) − tλ P (x1 , z) + (1 − tλ) X z∈Z N X z=2 P (xz , z) ! P (xz , z) − P (x1 , z) . (47) 38 Note that Pc (X|Y ) = P(IN ) = P z∈Z P (xz , z). Hence, P(IN + tD∗ ) = Pc (X|Y ) − tλσ, where σ = X z∈Z (48) (P (xz , z) − P (x1 , z)). Setting t = 0 in (47), we have that P (xz , z) ≥ P (x, z) for all (x, z) ∈ X × Z. If P (xz , z) = P (x1 , z) for all z ≥ 1, then Pc (X|Y ) = X z∈Z P (x1 , z) = pX (x1 ) ≤ Pc (X), which contradicts the hypothesis of the lemma. Therefore, there exists z ∈ Z such that P (xz , z) > P (x1 , z) and hence σ > 0. Similarly, there exists δ2 > 0 such that for every t ∈ [0, δ2 ], U(IN + tD∗ ) = qY (1) + (1 − tλ) N X z=2 qY (z) = 1 − tλ(1 − qY (1)). (49) Let δ = min(δ1 , δ2 ). From (48) and (49), we have for every t ∈ [0, δ] 1 − tλ(1 − qY (1)) ≤ h(Pc (X|Y ) − tλσ) ≤ 1. (50) In particular, lim ε→Pc (X|Y ) h(ε) = lim h(Pc (X|Y ) − tλσ) = 1 = h(Pc (X|Y )), t→0 i.e., h is continuous at Pc (X|Y ). We say that F ∈ F is an optimal filter at ε if U(F ) = h(ε) and P(F ) ≤ ε. As opposed to h, the concavity of h is unknown and hence the existence of an optimal filter at ε with P(F ) = ε is not immediate. Nonetheless, since P and U are continuous functions, there exists an optimal filter F at ε (with P(F ) ≤ ε) for every ε ∈ [Pc (X), Pc (X|Y )]. For any F ∈ F and δ > 0, let B(F, δ) = {G ∈ F : kG − F k < δ}. Lemma 11. Let δ > 0 be as in Lemma 9 for IN , i.e., U and P are linear on [IN , IN + δD] for every D ∈ D(IN ). If Pc (X) < Pc (X|Y ) and qY (y) > 0 for all y ∈ Y, then there exists εL < Pc (X|Y ) such that for every ε ∈ [εL , Pc (X|Y )] there exists an optimal filter Fε at ε with Fε ∈ B(IN , δ). Proof. Let F 1 = {F ∈ F : U(F ) = 1} and let B = claim. [ F ∈F B(F, δ). The proof is based on the following 1 39 Claim. There exists εL < Pc (X|Y ) such that if F is an optimal filter at ε with ε ≥ εL , then F ∈ B. Proof of the claim. The proof is by contradiction. Assume that for every ε < Pc (X|Y ) there exists / B. Since h is a non-decreasing function, an optimal filter Gε′ at ε′ ∈ [ε, Pc (X|Y )) with Gε′ ∈ we have that U(Gε′ ) = h(ε′ ) ≥ h(ε). Let K := (Pc (X|Y ) − Pc (X))−1 . For each n > K, let Fn = GPc (X|Y )−1/n . Since F \B is compact, there exist {n1 < n2 < · · · } and F ∈ F \B such that Fnk → F as k → ∞. By continuity of U and h at Pc (X|Y ), established in the Lemma 10, we have 1 ≥ U(F ) = lim U (Fnk ) ≥ lim h(Pc (X|Y ) − n−1 k ) = h(Pc (X|Y )) = 1. k→∞ k→∞ In particular, we have that F ∈ F 1 ⊂ B, which contradicts the fact that F ∈ F \B. The assumption qY (y) > 0 for every y ∈ Y implies that F ∈ F 1 if and only if F is a permutation matrix, i.e., F can be obtained by permuting the columns of IN . In particular, the mapping G 7→ GF −1 is a bijection between B(F, δ) and B(IN , δ) which preserves P and U , i.e., P(G) = P(GF −1 ) and U(G) = U (GF −1 ) for every G ∈ B(F, δ). As mentioned earlier, there exists an optimal filter Fε at ε for every ε ∈ [Pc (X), Pc (X|Y )]. By the claim, Fε , for ε ≥ εL , belongs to B and, in particular, Fε ∈ B(F, δ) for some F ∈ F 1 . By the aforementioned properties of the bijection G 7→ GF −1 , the filter Fε F −1 is an optimal filter at ε with Fε F −1 ∈ B(IN , δ). Now we are in position to prove Theorem 3. Proof of Theorem 3. If qY (y) = 0 for some y ∈ Y, the effective cardinality of the alphabet of Y is |Y| − 1 and thus h(ε) equals h(ε) for every ε ∈ [Pc (X), Pc (X|Y )]. In this case, h is piecewise linear and (10) follows trivially by Theorem 1. In what follows, we assume that qY (y) > 0 for all y ∈ Y. Let δ > 0 and ε′L < Pc (X|Y ) be as in Lemma 11. For each ε ∈ [ε′L , Pc (X|Y )), let Gε be an optimal filter at ε with Gε ∈ B(IN , δ) whose existence was established in Lemma 11. Let tε ∈ [0, δ] and Dε ∈ D(IN ) be such that Gε = IN + tε Dε for every ε ∈ [ε′L , Pc (X|Y )). As in (29) and (30) in the proof of Lemma 4, for every t ∈ [0, δ] and D ∈ D(IN ), P(IN + tD) = Pc (X|Y ) + tb(D) and U(IN + tD) = 1 + tβ (D) , (51) where b(D) = X z∈Z max (P D)(x, z) x∈Mz and β (D) = X z∈Z q(z)D(z, z), (52) 40 where Mz = {x ∈ X : P (x, z) ≥ P (x′ , z) for all x′ ∈ X }. Since P(F ) ≤ Pc (X|Y ) for all F ∈ F , it is immediate that b(D) ≤ 0 for every D ∈ D(IN ). Moreover, since P(Gε ) ≤ ε, we have that b(Dε ) < 0 for all ε ∈ [ε′L , Pc (X|Y )). By definition of D(IN ), it is clear that if D ∈ D(IN ), then we have D(y, y) ≤ 0 for all y ∈ Y, which together with the fact that kDk = 1 for all D ∈ D(IN ), implies that β (D) < 0 for all D ∈ D(IN ). We first establish the following intuitive claim. Claim. Let ε′L < Pc (X|Y ) be as defined in Lemma 11. Then, there exists an optimal filter Gε at ε for each ε ∈ [ε′L , Pc (X|Y )] such that P(Gε ) = ε and U (Gε ) = h(ε). Proof of Claim. The filter Gε = IN + tε Dε is optimal at ε for every ε ∈ [ε′L , Pc (X|Y )). To reach contradiction, assume that there exists ε0 < ε such that P(Gε ) = ε0 . According to (51), we obtain Pc (X|Y ) + tε b(Dε ) = ε0 < ε and hence tε > Pc (X|Y ) − ε =: t′ . (D ) ε −b Now consider the filter IN + t′ Dε . Since t′ ≤ δ, we have from (51) that P(IN + t′ Dε ) = ε and (b) (a) h(ε) = 1 + tε β (Dε ) < U(IN + t′ Dε ) = 1 + t′ β (Dε ) , where (a) is due to the optimality of Gε and (b) follows from the negativity of β (Dε ) . The above inequality contradicts the maximality of h(ε). This implies that P(Gε ) = ε which, according to (51), yields h(ε) = 1 − (Pc (X|Y ) − ε) β (Dε) , b(Dε ) (53) for all ε ∈ [ε′L , Pc (X|Y )). Now fix ε′ ∈ [ε′L , Pc (X|Y )] with ε ≤ ε′ . On the one hand, according to (53), we know that β (Dε′ ) h(ε ) = 1 − (Pc (X|Y ) − ε ) (D ′ ) . b ε ′ On the other hand, we obtain from (51) that 0 ≤ ′ Pc (X|Y )−ε′ −b(Dε ) (54) ≤ tε and hence   Pc (X|Y ) − ε′ Dε = ε ′ , P IN + (D ) ε −b   (Dε ) Pc (X|Y ) − ε′ ′ β D = 1 − (P (X|Y ) − ε ) . U IN + ε c −b(Dε ) b(Dε ) (55) (56) 41 Comparing (54) and (56), we conclude that (Dε ) β (Dε′ ) ′ ′ β 1 − (Pc (X|Y ) − ε ) (D ′ ) = h(ε ) ≥ 1 − (Pc (X|Y ) − ε ) (Dε ) , b ε b ′ β (Dε ) β (Dε ) ′ and hence the function ε 7→ (Dε ) is non-increasing over [εL , Pc (X|Y )). Therefore, since (Dε ) > 0, b b β (Dε ) =: A exists. the limit lim ε→Pc (X|Y )− b(Dε ) Let K = (Pc (X|Y ) − ε′L )−1 . For each n > K, let Fn = GPc (X|Y )− 1 . Write Fn = IN + tn Dn with n tn ∈ [0, δ] and Dn ∈ D(IN ). Since D(IN ) is compact, there exist {n1 < n2 < · · · } and D ∗ ∈ D(IN ) such that Dnk → D ∗ as k → ∞. By continuity of the mappings D 7→ b(D) and D 7→ β (D) , we have that b(Dnk ) → b(D ∗) and β (Dnk ) → β (D ∗) as k → ∞. ∗ β (D ) Claim. We have that b < 0 and, in particular, A = (D∗ ) . b Proof of Claim. Recall that F ∈ F 1 if and only if F is a permutation matrix. In particular, F 1 is finite β (Dnk ) ∗ ∗ with |F 1 | = N!. Recall that b(D ) ≤ 0. Assume that b(D ) = 0. Since (Dn ) → A ∈ [0, ∞) and b k (Dnk ) (Dnk ) (D ∗ ) (D ∗ ) b →b = 0 as k → ∞, we have that β → 0 and hence β = 0. This implies that (D ∗ ) U (IN + tD ∗ ) = 1 for all t ∈ [0, δ], i.e., IN + tD ∗ ∈ F 1 for all t ∈ [0, δ]. This contradicts the fact that F 1 is finite. ∗ The claim implies that for ε ∈ [Pc (X|Y ) + δb(D ) , Pc (X|Y )],  Pc (X|Y ) − ε ∗ P IN + D = ε, −b(D∗ )   Pc (X|Y ) − ε ∗ U IN + D = 1 − (Pc (X|Y ) − ε)A. −b(D∗ )  ∗ Recall that β (Dε ) β (D ) ∗ = A ≤ for all ε ∈ [ε′L , Pc (X|Y )). Let εL := max{ε′L , Pc (X|Y ) + δb(D ) }. Then b(D∗ ) b(Dε ) ∗ h(ε) ≥ 1 − (Pc (X|Y ) − ε) β (Dε ) (a) β (D ) = h(ε), ≥ 1 − (P (X|Y ) − ε) c b(D∗ ) b(Dε ) (57) for all ε ∈ [εL , Pc (X|Y )], where the equality in (a) follows from (53). This proves that h is linear on ε ∈ [εL , Pc (X|Y )]. Recall that β (D) < 0 for all D ∈ D(IN ). Clearly, (57) implies that β (D) . D∈D(IN ) b(D) h′ (Pc (X|Y )) = min If b(D) = 0 for some D ∈ D(IN ), the term (58) β (D) is defined to be +∞. Notice that this convention agrees b(D) 42 with the fact that if b(D) = 0 then D cannot be an optimal direction. Furthermore, for every D ′ ∈ D(IN ) such that h′ (Pc (X|Y )) = ′ β (D ) ′ , b(D ) there exists εL < Pc (X|Y ) (depending on D ′ ) such that IN + Pc (X|Y ) − ε ′ D −b(D′ ) (59) achieves h(ε) for every ε ∈ [εL , Pc (X|Y )]. In addition, assume that for each y ∈ Y there exists (a unique) xy ∈ X such that PX|Y (xy |y) > PX|Y (x|y), for all x 6= xy . In particular, Mz = {xz } for every z ∈ Z and hence (52) becomes b(D) = X (P D)(xz , z) and β (D) = z∈Z for every D ∈ D(IN ). Using the fact that b(D) = − XX y∈Y z6=y X qY (z)D(z, z), z∈Z X z∈Z D(y, z) = 0 for all y ∈ Y, we obtain (P (xy , y) − P (xz , y))D(y, z) and β (D) = − XX qY (y)D(y, z). y∈Y z6=y Therefore, for every D ∈ D(IN ), P P β (D) y∈Y z6=y qY (y)D(y, z) P P = . b(D) y∈Y z6=y (P (xy , y) − P (xz , y))D(y, z) (60) P P ak xk ak for ak > 0 and bk , xk ≥ 0 with k xk > 0, we obtain from (60) that for ≥ min Since Pk k bk k bk xk every D ∈ D(IN ) qY (y) β (D) ≥ min . (D) (y,z)∈Y×Z P (xy , y) − P (xz , y) b Equation (58) implies that h′ (Pc (X|Y )) ≥ min (y,z)∈Y×Z qY (y) . P (xy , y) − P (xz , y) Assume that (y0 , z0 ) attains the above minimum. We note that one can easily show from (50) that P 0 ≤ h′ (ε) ≤ 1−qσY (1) < ∞, where σ := z∈Z (P (xz , z) − P (x1 , z)) > 0. Hence, we have y0 6= z0 . 43 Now, consider the direction D∗ such that    λ,     D∗ (y, z) = −λ,      0, y = y0 , z = z0 y = z = y0 otherwise, where λ = 2−1/2 . Equation (60) implies then that β (D∗ ) qY (y0 ) = , (D ) ∗ b P (xy0 , y0 ) − P (xz0 , y0 ) and hence h′ (Pc (X|Y )) ≤ qY (y) qY (y0 ) = min . P (xy0 , y0 ) − P (xz0 , y0 ) (y,z)∈Y×Z P (xy , y) − P (xz , y) As a consequence, h′ (Pc (X|Y )) = min (y,z)∈Y×Z qY (y) . P (xy , y) − P (xz , y) Moreover, (59) implies that there exists εyL0 ,z0 < Pc (X|Y ) such that IN + h(ε) for every ε ∈ [εLy0 ,z0 , Pc (X|Y )]. Note that IN + where ζ y0 ,z0 (ε) = Pc (X|Y ) − ε D∗ achieves −b(D∗ ) Pc (X|Y ) − ε D∗ = Zy0 ,z0 (ζ y0 ,z0 (ε)), −b(D∗ ) Pc (X|Y ) − ε . P (xy0 , y0 ) − P (xz0 , y0 ) A PPENDIX D P ROOF OF T HEOREM 4 Let P = [P (xn , y n )]xn ,yn ∈{0,1}n denotes the joint probability matrix of X n and Y n and q(y n ) = Pr(Y n = y n ) for y n ∈ {0, 1}n . Let 0 = (0, 0, . . . , 0) and 1 = (1, 1, . . . , 1). We will show that (X n , Y n ) satisfies the hypotheses of Theorem 3 with y0 = 1 and z0 = 0. Under the assumptions (a1 ) and (b), it is straightforward to verify that n n P (x , y ) = (ᾱp̄) n n  xk   Y p α xk ⊕yk k=1 p̄ ᾱ , (61) 44 for every xn , y n ∈ {0, 1}n . By assumption, Pc (X n ) = pn < ᾱn = Pc (X n |Y n ). It is also straightforward to verify that q(y n ) > 0 for all y ∈ {0, 1}n . Since ᾱp̄ > αp, we have from (61) that Pr(X n = z n , Y n = z n ) > Pr(X n = xn , Y n = z n ), for all xn 6= z n . In the notation of Theorem 3, xnzn = z n for all z n ∈ {0, 1}n . Note that q(y n ) q(y n ) = min . n , y n) P (xnyn , y n ) − P (xnzn , y n ) yn ∈{0,1}n P (y n, y n ) − min P (z n n min n y n ,z ∈{0,1}n z 6=y n n It is easy to show that min P (z , y ) = (αp) n n n z 6=y k=1 z n = (ȳ1 , ȳ2 , . . . , ȳn ). As a consequence, min n y n ,z ∈{0,1}n q(y n ) = min P (xnyn , y n ) − P (xnzn , y n ) yn ∈{0,1}n = 1 2 min y n ∈{0,1}n n   yk Y p p̄ P and that the minimum is attained by n  xk −yk Q p p̄ xn ∈{0,1}n k=1 1−  pα p̄ᾱ n Π−2 yn  α xk ⊕yk ᾱ i n h Q ( pp̄ )−yk ( αᾱ )yk + ( pp̄ )1−yk ( ᾱα )1−yk k=1  n , pα −2 1 − p̄ᾱ Πyn . Observe that the denominator is maximized when y n = 1. Using the fact that p̄ k=1 ≥ p̄, one can show that the numerator is minimized when y n = 1. In particular, where Πyn = p≥ n  −yk Y p min n y n ,z ∈{0,1}n q(y n ) (αp̄ + ᾱp)n = , P (xnyn , y n ) − P (xnzn , y n ) (ᾱp)n − (αp̄)n and the minimum is attained by (y0n , z0n ) = (1, 0). Therefore (X n , Y n ) satisfies the hypotheses of Theorem 3 with (y0n , z0n ) = (1, 0). Thus, there exists ε′L < ᾱn such that for every ε ∈ [ε′L , ᾱn ] h(ε) = 1 − ᾱn − ε qn. (ᾱp)n − (αp̄)n Moreover, Z1,0 (ζ y0,z0 (ε)) achieves h(ε) for every ε ∈ [ε′L , ᾱn ], where ζ y0 ,z0 (ε) = ᾱn − ε . (ᾱp)n − (αp̄)n Recall that h(ε) = hnn (ε1/n ) and let εL = (ε′L )1/n . Therefore, hnn (ε) = 1 − ζn (ε)q n for all ε ∈ [εL , ᾱ] 45 which is attained by the Z-channel Zn (ζn (ε)), where ζn (ε) := ζ y0 ,z0 (εn ). A PPENDIX E P ROOF OF C OROLLARY 3 Assume that p > 12 . By Theorem 4, for every ε ∈ [εL , ᾱ] we have hn (ε) = [An εn + Bn ]1/n , where ᾱn q n qn and B = 1 − . In particular, An = n (ᾱp)n − (αp̄)n (ᾱp)n − (αp̄)n n−1 ′′ n (ε) An Bn = (n − 1) n+1 hn (ε) h 1 2 ε hn (ε) = An h Since p >  ′ n (ε) ,  (62) ε hn (ε) n−2 . and α > 0, we have Bn → 1 as n → ∞. Let N0 ≥ 1 be such that Bn ≥ 0 for all n ≥ N0 . In this case, we have that h′′n (ε) ≥ 0 for all ε ∈ [εL , ᾱ] and n ≥ N0 . In particular, hn is convex on [εL , ᾱ]. As a consequence, for all ε ∈ [εL , ᾱ] and n ≥ N0 hn (ε) ≥ 1 − (ᾱ − ε)h′n (ᾱ). Since hni (ε) = h1 (ε) = 1 − (ᾱ − ε) h′1 (ᾱ) for all ε ∈ [p, ᾱ], the above inequality implies that hn (ε) − hni (ε) ≥ (ᾱ − ε)(h′1 (ᾱ) − h′n (ᾱ)) for all ε ∈ [εL , ᾱ] and n ≥ N0 . The result follows from (62). Now, assume that p = 21 . In this case, we have for all ε ∈ [εL , ᾱ] hn (ε) =  εn − α n ᾱn − αn 1/n and hni (ε) = ε−α . ᾱ − α Let Ξn : [ 12 , ᾱ] → R be given by Ξn (ε) = hn (ε) − hni (ε). Claim. The function Ξn is decreasing on [ 21 , ᾱ]. Proof of Claim. We shall show that Ξ′n (ε) ≤ 0 for all ε ∈ [ 12 , ᾱ]. A straightforward computation shows that Ξ′n (ε) =  1 1−   α n (n−1)/n ε [ᾱn 1 1 − . n 1/n −α ] ᾱ − α 46 This function is clearly decreasing, and so it is enough to show that Ξ′n ( 12 ) ≤ 0. Note that Ξ′n ( 21 ) ≤ 0 if and only if Observe that 1− 1− that (63) holds.  α n ᾱ  α n ᾱ n 1 − αᾱ n ≤ [1 − (2α)n ]n−1 . 1 − αᾱ (63)  α n−1 ≤ 1− . Using the fact that 4αᾱ ≤ 1, it is straightforward to verify ᾱ Since Ξn is decreasing over [ 12 , ᾱ], we obtain for all ε ∈ [εL , ᾱ] " #    n 1/n 1 1 − (2α) 1 = −1 . 0 ≤ hn (ε) − hni (ε) ≤ Ξn 2 2 ᾱn − αn  α n , ᾱ Since 1 − (2α)n ≤ 1 − it is straightforward to show that Ξn 1 2  ≤ α , 2ᾱ which completes the proof. A PPENDIX F P ROOF OF T HEOREM 5 As before, let P = [P (xn , y n )]xn ,yn ∈{0,1}n denote the joint probability matrix of X n and Y n and let q(y n) = Pr(Y n = y n ) for y n ∈ {0, 1}n . We first show that (X n , Y n ) satisfies the hypotheses of Theorem 3, and thus we can use (11) to obtain bounds on h′ (Pc (X n |Y n )). Assumptions (a2 ) and (b) imply that, for all xn , y n ∈ {0, 1}n   x1   n α x1 ⊕y1 Y  r xk ⊕xk−1  α xk ⊕yk p P (x , y ) = (ᾱr̄) , r̄ p̄ ᾱ r̄ ᾱ n n n p̄ (64) k=2 where the product equals one if n = 1. Since α > 0, it is clear that q(y n ) > 0 for all y n ∈ {0, 1}n . Let N0 (z n ) = |{1 ≤ k ≤ n : zk = 0}| and N1 (z n ) = |{1 ≤ k ≤ n : zk = 1}| for any binary vector z n ∈ {0, 1}n . Recall that n is odd, so either N0 (z n ) < N1 (z n ) or N0 (z n ) > N1 (z n ). The following lemma shows that for every y n ∈ {0, 1}n there exists (a unique) xnyn ∈ {0, 1}n such that P (xnyn , y n ) > P (xn , y n) for all xn 6= xnyn . Lemma 12. Let (X n , Y n ) be as in the hypothesis of Theorem 5. Then, we have for any y n ∈ {0, 1}n n n P (x , y ) ≤   P (0, y n) = (ᾱr̄)n p̄ r̄  P (1, y n) = (ᾱr̄)n p r̄ n  α N1 (y ) ᾱ n  α N0 (y ) ᾱ , if N0 (y n ) > N1 (y n ), , if N0 (y n ) < N1 (y n ), for all xn ∈ {0, 1}n with equality if and only if xn = 0 or xn = 1, respectively. 47 To prove this lemma, we will make use of the following fact. Claim. Let y n ∈ {0, 1}n be given. If xn ∈ {0, 1}n maximizes P (xn , y n ), then x1 = x2 = · · · = xn . Proof of Claim. We prove the result using backward induction. To do so, we assume that the maximizer xn satisfies xn = xn−1 = · · · = xl for 2 ≤ l ≤ n. It is sufficient to show that xn = · · · = xl = xl−1 . In light of (64), we have n n P (x , y ) = Al−1 where2 Al−1 n    r xl ⊕xl−1 Y α xl ⊕yk r̄ k=l ᾱ , (65)  x1   l−1 α x1 ⊕y1 Y  r xk ⊕xk−1  α xk ⊕yk p := (ᾱr̄) . r̄ p̄ ᾱ r̄ ᾱ n p̄ k=2 Notice that Al−1 depends only on x1 , . . . , xl−1 . By the induction hypothesis, we have xl = · · · = xn . In particular, xn equals either x̃n := {x1 , . . . , xl−1 , x̄l−1 , . . . , x̄l−1 } or {z } | n−l+1 By (65), we have that x̂n := {x1 , . . . , xl−1 , xl−1 , . . . , xl−1 }. | {z } n−l+1 n P (x̃n , y n ) = Al−1 r Y  α 1−xl−1 ⊕yk r̄ ᾱ P (x̂n , y n ) = Al−1 and n   Y α xl−1 ⊕yk k=l k=l ᾱ . By the assumptions on r and α, we have n n r Y  α 1−xl−1 ⊕yk r  α n−1  α n−l+1 Y  α xl−1 ⊕yk ≤ < , ≤ ≤ r̄ k=l ᾱ r̄ ᾱ ᾱ ᾱ k=l which shows that P (x̃n , y n ) < P (x̂n , y n ) and hence xn = x̂n . In other words, xl−1 = xl = · · · = xn . This completes the induction step. Proof of Lemma 12. By the above claim, for any given y n ∈ {0, 1}n , the maximizer xn ∈ {0, 1}n of P (xn , y n ) is either xn = 0 or xn = 1, for which we have p̄  α N1 (yn ) , r̄ ᾱ p  α N0 (yn ) . P (1, y n) = (ᾱr̄)n r̄ ᾱ P (0, y n) = (ᾱr̄)n 2 When l ≤ 3, we use the convention that Ql−1 k=2  r xk ⊕xk−1 r̄  α xk ⊕yk ᾱ = 1. (66) (67) 48 Assume N0 (y n ) > N1 (y n ) and recall that αp < ᾱp̄. In this case, p  α N0 (yn )  α N1 (yn ) αp  α N1 (yn ) ≤ < p̄ , ᾱ ᾱ ᾱ ᾱ which implies P (0, y n ) > P (1, y n), and hence xn = 0 is the only maximizer. If N0 (y n ) < N1 (y n ), N (yn ) N (yn ) then ᾱα 0 > αᾱ 1 . Since p ≥ p̄, we conclude that p  α N0 (yn ) ᾱ > p̄  α N1 (yn ) ᾱ . Consequently, P (1, y n ) > P (0, y n) and hence xn = 1 is the only maximizer. Note that Pc (X n |Y n ) = (a) X max P (xn , y n ) y n ∈{0,1}n xn ∈{0,1}n X = P (0, y n) + y n :N0 (y n )>N1 (y n ) (b) n n−1 = ᾱ r̄ k=0 P (1, y n) y n :N0 (y n )<N1 (y n ) (n−1)/2  X X  n  α k , k ᾱ (68) where (a) is due to Lemma 12 and (b) comes from (66) and (67). Now that all the hypotheses of Theorem 3 are shown to be satisfied, we can use (11) to study h′ (Pc (X n |Y n )). The following lemma is important in bounding h′ (Pc (X n |Y n )). Lemma 13. Let (X n , Y n ) be as in the hypothesis of Theorem 5. Then, for all y n ∈ {0, 1}n , q(y n ) ≥ αn . Proof. From (64), we have  x1   n α x1 ⊕y1 Y  r xk ⊕xk−1  α xk ⊕yk p P (x , y ) = (ᾱr̄) r̄ p̄ ᾱ r̄ ᾱ k=2  x1 Y n    α n r xk ⊕xk−1 p n p̄ ≥ (ᾱr̄) ᾱ r̄ p̄ r̄ k=2  x1 Y n   p r xk ⊕xk−1 n n p̄ = α r̄ . r̄ p̄ r̄ n n n p̄ k=2 49 Summing over all xn ∈ {0, 1}n , we obtain n n n−1 q(y ) ≥ α r̄ p̄  x1 Y n   r xk ⊕xk−1 . p p̄ r̄ n k=2 X (69) xn ∈{0,1} On the other hand, it is straightforward to verify that X 1= n n Pr(X = x ) = r̄ n−1 X p̄  x1 Y n   p r xk ⊕xk−1 . p̄ r̄ n k=2 (70) xn ∈{0,1} x∈{0,1}n Plugging (70) into (69), the result follows. By (11) and the previous lemma, ′ n n h (Pc (X |Y )) ≥ min min y n ∈{0,1}n z n ∈{0,1}n αn . P (xnyn , y n) − P (xnzn , y n ) Since both xnyn and xnzn are either 0 or 1, we have to maximize ϑ :=   (ᾱr̄)n p̄ r̄  (ᾱr̄)n p r̄ n  α N1 (y ) ᾱ n  α N0 (y ) ᾱ − (ᾱr̄)n pr̄ − (ᾱr̄)n p̄r̄ Clearly, ϑ is maximized when y n = 1 and thus h′ (Pc (X n |Y n )) ≥ n  α N0 (y ) ᾱ n  α N1 (y ) ᾱ , if N0 (y n ) > N1 (y n ), , if N0 (y n ) < N1 (y n ). r̄αn . p(ᾱr̄)n − p̄(αr̄)n By (10) and the fact that hnn (ε) = h(εn ), n n (ε) h Pc (X n |Y n ) − εn n α , ≤ 1 − r̄ p(ᾱr̄)n − p̄(αr̄)n where Pc (X n |Y n ) is computed in (68). The lower bound follows from considering the direction D̃ ∈ D(I2n ), whose entries are all zero except D̃(1, 0) = λ and D̃(1, 1) = −λ for λ = 2−1/2 . In particular, plugging D̃ into (60), we obtain an upper bound for h′ (Pc (X n |Y n )) and thus a lower bound for h(ε) for the desired range of ε. Note that the filter I2n + ζn (ε)D̃ corresponds to the 2n -ary Z-channel Zn (ζn (ε)). 50 A PPENDIX G P ROOF OF P ROPOSITION 3 Since r = 0, the joint distribution PθY n can be equivalently written as the joint probability matrix P = [P (xn , y n)]xn ,yn ∈{0,1}n with x1 = x2 = · · · = xn = θ. As in the proof of Theorem 5, the hypotheses of Theorem 3 are fulfilled. In particular, h′ (Pc (θ|Y n )) = min n min n y ∈{0,1}n z ∈{0,1}n q(y n ) . P (xnyn , y n ) − P (xnzn , y n) (71) In this case, (64) becomes n P (0, y ) = p̄ᾱ n  α N1 (yn ) and ᾱ In particular, ′ h (Pc (θ|Y n )) = min min y n ∈{0,1}n z n ∈{0,1}n n P (1, y ) = pᾱ n  α N0 (yn ) ᾱ . N (yn ) N (yn ) pᾱn αᾱ 0 + p̄ᾱn αᾱ 1 . P (xnyn , y n ) − P (xnzn , y n) Lemma 12 implies that both xnyn and xnzn are either 0 or 1. If N0 (y n ) > N1 (y n ), then N0 (yn ) N1 (yn ) pᾱn pᾱn ᾱα + p̄ᾱn αᾱ ≥ P (xnyn , y n ) − P (xnzn , y n ) p̄ᾱn n  α N0 (y ) ᾱ  n α N1 (y ) ᾱ + p̄ᾱn − pᾱn with equality if and only if N1 (z n ) > N0 (z n ). It is not hard to show that pᾱn p̄ᾱn n  α N0 (y ) ᾱ  n α N1 (y ) ᾱ + p̄ᾱn − pᾱn n  α N1 (y ) ᾱ  n α N0 (y ) ᾱ ≥ p̄ + p p̄ − p n  α N1 (y ) ᾱ  n , α N0 (y ) ᾱ  α n ᾱ  , α n ᾱ (72) with equality if and only if y n = 0. Similarly, if N1 (y n ) > N0 (y n ), then N (yn ) N (yn ) pᾱn pᾱn ᾱα 0 + p̄ᾱn αᾱ 1 ≥ P (xnyn , y n ) − P (xnzn , y n ) pᾱn with equality if and only if N0 (z n ) > N1 (z n ). As before, pᾱn p̄ᾱn n  α N0 (y ) ᾱ  n α N1 (y ) ᾱ + p̄ᾱn − pᾱn n  α N0 (y ) ᾱ  n α N0 (y ) ᾱ n  α N1 (y ) ᾱ  n α N0 (y ) ᾱ ≥ + p̄ᾱn − p̄ᾱn p + p̄ p − p̄  α n ᾱ  , α n ᾱ with equality if and only if y n = 1. From (72) and (73), we conclude that n p + p̄ ᾱα pᾱn + p̄αn ′ n  , h (Pc (θ|Y )) = = n pᾱn − p̄αn p − p̄ ᾱα n  α N1 (y ) ᾱ  n , α N1 (y ) ᾱ (73) 51 and y0 = 1 and z0 = 0 achieve the minimum in (71). From the last part of Theorem 3 the optimality of the 2n -ary Z-channel Zn (ζn (ε)) is evident. ACKNOWLEDGMENT The first author would like to acknowledge useful discussions with M. Médard and F. P. Calmon. R EFERENCES [1] S. Asoodeh, F. Alajaji, and T. Linder, “Privacy-aware MMSE estimation,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), July 2016, pp. 1989–1993. [2] S. Asoodeh, M. Diaz, F. Alajaji, and T. Linder, “Privacy-aware guessing efficiency,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), June 2017. [3] S. Fehr and S. Berens, “On the conditional Rényi entropy,” IEEE Trans. Inf. Theory, vol. 60, no. 11, pp. 6801–6810, Nov. 2014. [4] S. Asoodeh, M. Diaz, F. Alajaji, and T. Linder, “Information extraction under privacy constraints,” Information, vol. 7, 2016. [Online]. Available: http://www.mdpi.com/2078-2489/7/1/15 [5] I. Issa, S. Kamath, and A. B. Wagner, “An operational measure of information leakage,” in Proc. Annual Conference on Information Science and Systems (CISS), March 2016, pp. 234–239. [6] F. P. Calmon, A. Makhdoumi, and M. Médard, “Fundamental limits of perfect privacy,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), 2015, pp. 1796–1800. [7] F. P. Calmon, M. Varia, M. Médard, M. M. Christiansen, K. R. Duffy, and S. Tessaro, “Bounds on inference,” in Proc. 51st Annual Allerton Conference on Communication, Control, and Computing, Oct 2013, pp. 567–574. [8] S. Arimoto, “Information measures and capacity of order α for discrete memoryless channels,” in Topics in Information Theory, Coll. Math. Soc. J. Bolyai (I. Csiszár and P. Elias Eds.), vol. 16. North-Holland, Amsterdam, 1977, pp. 41–52. [9] I. Csiszár, “Generalized cutoff rates and Rényi’s information measures,” IEEE Trans. Inf. Theory, vol. 41, no. 1, pp. 26–34, Jan. 1995. [10] S. Verdú, “α-mutual information,” in Proc. Information Theory and Applications Workshop (ITA), 2015, Feb. 2015, pp. 1–6. [11] S. Goldwasser and S. Micali, “Probabilistic encryption,” Journal of Computer and System Sciences, vol. 28, no. 2, pp. 270 – 299, 1984. [12] H. O. Hirschfeld, “A connection between correlation and contingency,” Cambridge Philosophical Soc., vol. 31, pp. 520–524, 1935. [13] H. Gebelein, “Das statistische problem der korrelation als variations- und eigenwert-problem und sein zusammenhang mit der ausgleichungsrechnung,” Zeitschrift f ur angew. Math. und Mech., no. 21, pp. 364–379, 1941. [14] A. Rényi, “On measures of dependence,” Acta Mathematica Academiae Scientiarum Hungarica, vol. 10, no. 3, pp. 441–451, 1959. [15] G. Smith, “On the foundations of quantitative information flow,” in Proc. of the 12th Int. Conf. on Foundations of Software Science and Computational Structures, ser. FOSSACS ’09. Berlin, Heidelberg: Springer-Verlag, 2009. [16] A. V. Evfimievski, J. Gehrke, and R. Srikant, “Limiting privacy breaches in privacy preserving data mining,” in Proc. of the TwentySecond Symposium on Principles of Database Systems, 2003, pp. 211–222. [17] J. L. Massey, “Guessing and entropy,” in Proc. IEEE Int. Symp. Inf. Theory, June 1994, pp. 204–205. [18] C. Braun, K. Chatzikokolakis, and C. Palamidessi, “Quantitative notions of leakage for one-try attacks,” Electronic Notes in Theoretical Computer Science, vol. 249, pp. 75 – 91, 2009. 52 [19] G. Barthe and B. Kopf, “Information-theoretic bounds for differentially private mechanisms,” in Proc. IEEE 24th Computer Security Foundations Symposium, June 2011, pp. 191–204. [20] I. Wagner and D. Eckhoff, “Technical Privacy Metrics: a Systematic Survey,” ArXiv e-prints, Dec. 2015. [Online]. Available: http://arxiv.org/abs/1512.00327 [21] R. Sibson, “Information radius,” Z. Wahrscheinlichkeitsth. Verw. Geb., vol. 14, pp. 149–161, 1969. [22] A. Makhdoumi and N. Fawaz, “Privacy-utility tradeoff under statistical uncertainty,” in Proc. 51st Allerton Conference on Communication, Control, and Computing, Oct 2013, pp. 1627–1634. [23] F. P. Calmon, A. Makhdoumi, M. Médard, M. Varia, M. Christiansen, and K. R. Duffy, “Principal inertia components and applications,” ArXiv e-prints, April 2017. [Online]. Available: https://arxiv.org/abs/1704.00820v1 [24] H. Yamamoto, “A source coding problem for sources with additional outputs to keep secret from the receiver or wiretappers,” IEEE Trans. Inf. Theory, vol. 29, no. 6, pp. 918–923, Nov. 1983. [25] A. Makhdoumi, S. Salamatian, N. Fawaz, and M. Médard, “From the information bottleneck to the privacy funnel,” in Proc. IEEE Inf. Theory Workshop (ITW), 2014, pp. 501–505. [26] L. Sankar, S. Rajagopalan, and H. Poor, “Utility-privacy tradeoffs in databases: An information-theoretic approach,” IEEE Trans. Inform. Forensics Security,, vol. 8, no. 6, pp. 838–852, June 2013. [27] S. Asoodeh, F. Alajaji, and T. Linder, “Notes on information-theoretic privacy,” in Proc. 52nd Annual Allerton Conference on Communication, Control, and Computing, Sept. 2014, pp. 1272–1278. [28] L. Sankar, S. R. Rajagopalan, and S. Mohajer, “Smart meter privacy: A theoretical framework,” IEEE Trans. on Smart Grid, vol. 4, no. 2, pp. 837–846, June 2013. [29] J. Liao, L. Sankar, F. P. Calmon, and V. Y. Tan, “Hypothesis testing under maximal leakage privacy constraints,” in Proc. IEEE Int. Sym. on Inf. Theory (ISIT), June 2017. [30] J. Liao, L. Sankar, V. Y. Tan, and F. P. Calmon, “Hypothesis testing under mutual information privacy constraints in the high privacy regime,” ArXiv e-prints, April 2017. [Online]. Available: https://arxiv.org/abs/1704.08347 [31] I. Csiszár and J. Körner, Information Theory: Coding Theorems for Discrete Memoryless Systems. Cambridge University Press, 2011. [32] H. Witsenhausen and A. Wyner, “A conditional entropy bound for a pair of discrete random variables,” IEEE Trans. Inf. Theory, vol. 21, no. 5, pp. 493–501, Sep. 1975. [33] J. C. Duchi, M. I. Jordan, and M. J. Wainwright, “Privacy aware learning,” Journal of the Association for Computing Machinery (ACM), vol. 61, no. 6, Dec. 2014. [34] O. Sarmanov, “The maximum correlation coefficient (nonsymmetric case),” Dokl. Akad. Nauk SSSR, vol. 120, no. 4, pp. 715–718, 1958. [35] F. P. Calmon, “Information-theoretic metrics for security and privacy,” Ph.D. dissertation, MIT, Sep. 2015. [36] N. Papadatos and T. Xifara, “A simple method for obtaining the maximal correlation coefficient and related characterizations,” Journal of Multivariate Analysis, vol. 118, pp. 102–114, 2013. [37] W. Kang and S. Ulukus, “A new data processing inequality and its applications in distributed source and channel coding,” IEEE Trans. Inf. Theory, vol. 57, no. 1, pp. 56–69, Jan. 2011. [38] D. Guo, Y. Wu, S. Shamai, and S. Verdú, “Estimation in Gaussian noise: properties of the minimum mean-square error,” IEEE Trans. Inf. Theory, vol. 57, no. 4, pp. 2371–2385, April 2011. 53 [39] W. Bryc, A. Dembo, and A. Kagan, “On the maximum correlation coefficient,” Theory Probab. Appl., vol. 49, no. 1, pp. 132–138, Mar. 2005. [40] Y. Wu and S. Verdú, “Functional properties of minimum mean-square error and mutual information,” IEEE Trans. Inf. Theory,, vol. 58, no. 3, pp. 1289–1301, March 2012.
10math.ST
Distance-preserving Subgraphs of Interval Graphs Kshitij Gajjar∗ and Jaikumar Radhakrishnan† Tata Institute of Fundamental Research, Mumbai arXiv:1708.03081v1 [cs.DS] 10 Aug 2017 August 11, 2017 Abstract We consider the problem of finding small distance-preserving subgraphs of undirected, unweighted interval graphs with k terminal vertices. We prove the following results. 1. Finding an optimal distance-preserving subgraph is NP-hard for general graphs. 2. Every interval graph admits a subgraph with O(k) branching vertices that approximates pairwise terminal distances up to an additive term of +1. 3. There exists an interval graph Gint for which the +1 approximation is necessary to obtain the O(k) upper bound on the number of branching vertices. In particular, any distance-preserving subgraph of Gint has Ω(k log k) branching vertices. 4. Every interval graph admits a distance-preserving subgraph with O(k log k) branching vertices, i.e. the Ω(k log k) lower bound for interval graphs is tight. 5. There exists an interval graph such that every optimal distance-preserving subgraph of it has O(k) branching vertices and Ω(k log k) branching edges, thereby providing a separation between branching vertices and branching edges. The O(k) bound for distance-approximating subgraphs follows from a naı̈ve analysis of shortest paths in interval graphs. Gint is constructed using bit-reversal permutation matrices. The O(k log k) bound for distance-preserving subgraphs uses a divide-and-conquer approach. Finally, the separation between branching vertices and branching edges employs Hansel’s lemma [Han64] for graph covering. 1 Introduction We consider the following problem. Given an undirected, unweighted graph G with k vertices designated as terminals, our goal is to construct a small subgraph H of G. Our notion of smallness is non-standard: we compare solutions based on the number of vertices of degree three or more. We have the following definition. Definition 1. Given an undirected, unweighted graph G = (V, E) and a set R ⊆ V (the terminals), we say that a subgraph H(V, E ′ ) of G is distance-preserving for (G, R) if for all terminals u, v ∈ R, dG (u, v) = dH (u, v), where dG and dH denote the distances in G and H respectively. Let deg≥3 (H) denote the number of vertices in H with degree at least three (referred to as branching vertices). Let B(G, R) = min deg≥3 (H), H where H ranges over all subgraphs of G that are distance-preserving for (G, R). For a family of graphs F (such as planar graphs, trees, interval graphs), let BF (k) = max B(G, R), G where G ranges over all graphs in F , and R ranges over all subsets of V (G) of size k. ∗ [email protected][email protected] 1 ♦ In this work, we obtain essentially tight upper and lower bounds on BI (k), where I is the class of interval graphs. An interval graph is the intersection graph of a family of intervals on the real line. (See Definition 9 for a more detailed description.) Theorem 2 (Main result). Let I denote the class of interval graphs. (a) (Upper bound) BI (k) = O(k log k). (b) (Lower bound) There exists a constant c such that for each k, a positive power of two, there exists an interval graph Gint with |R| = k terminals such that B(Gint , R) ≥ c k log k. This implies that BI (k) = Ω(k log k). Parts (a) and (b) imply that BI (k) = Θ(k log k). Remark (i). Part (a) is constructive. Our proof of the upper bound can be turned into an efficient algorithm that, given an interval graph G on n vertices, produces the required distance-preserving subgraph H of G in running time polynomial in n. Remark (ii). Our interval graphs are unweighted. If we consider the family of interval graphs with non-negative weights on their edges (Iw ), then using [KNZ14, Section 5], it is easy to prove that BIw (k) = Θ(k 4 ) (see Corollary 8 (b)). 1.1 Motivation and Related Work The problem of constructing small distance-preserving subgraphs bears close resemblance to several wellstudied problems in graph algorithms: graph compression [FM95], graph spanners [PS89, CE06], Steiner point removal [Gup01, KKN15], graph homeomorphisms [FHW80, LR80], graph contractions [DDK+ 17], etc. We emphasize two motivations for studying distance-preserving subgraphs, while basing the measure of efficiency on the number of branching vertices. First, this problem is closely related to the notion of distance-preserving minors introduced by Krauthgamer and Zondiner [KZ12]. Second, although the problem restricted to interval graphs is interesting in its own right, it can be seen to arise naturally in contexts where intervals represent time periods for tasks. Let us now elaborate on our first motivation. Later, we elaborate on the second. Definition 3. Let G(V, E, w) be an undirected graph with weight function w : E → R≥0 and a set of terminals R ⊆ V . Then, H(V ′ , E ′ , w′ ) with R ⊆ V ′ ⊆ V and weight function w′ : E ′ → R≥0 is a distance-preserving minor of G if: (i) H is a minor of G, and (ii) dH (u, v) = dG (u, v) ∀u, v ∈ R. ♦ 4 Subsequent work by Krauthgamer, Nguyên and Zondiner [KZ12, KNZ14] implies that BG (k) = Θ(k ), where G is the family of all undirected graphs (see Corollary 8 (a)). In this work, we prove that it is NP-hard to determine if B(G, R) ≤ m, when given a general graph G ∈ G, a set of terminals R ⊆ V (G), and a positive integer m. A reduction from the set cover problem is described in Theorem 6. Following the work of Krauthgamer and Zondiner [KZ12], Cheung et al. [CGH16] introduced the notion of distance-approximating minors. Definition 4. Let G(V, E, w) be an undirected graph with weight function w : E → R≥0 and a set of terminals R ⊆ V . Then, H(V ′ , E ′ , w′ ) with R ⊆ V ′ ⊆ V and weight function w′ : E ′ → R≥0 is an αdistance-approximating minor (α-DAM) of G if: (i) H is a minor of G, and (ii) dG (u, v) ≤ dH (u, v) ≤ α · dG (u, v) ∀u, v ∈ V . ♦ In analogy with distance-approximating minors one may ask if interval graphs admit distance-approximating subgraphs with a small number of branching vertices. Theorem 5. Every interval graph G with k terminals admits a subgraph H with O(k) branching vertices such that for all terminals u and v of G dG (u, v) ≤ dH (u, v) ≤ dG (u, v) + 1. We later provide a proof of Theorem 5 (see the proof of Theorem 15). We now elaborate on our second motivation. The following example1 illustrates the relevance of distance-preserving (-approximating) subgraphs for interval graphs. 1 This is not a real-life problem, though we learnt that minimizing the number of branching vertices in shipping schedules is logistically desirable. 2 1.2 The Shipping Problem The port of Bandarport is a busy seaport. Apart from ships with routes originating or terminating at Bandarport, there are many ships that dock at Bandarport en route to their final destination. Thus, Bandarport can be considered a hub for many ships from all over the world. Consider the following shipping problem. A cargo ship starts from some port X, and has Bandarport somewhere on its route plan. The ship needs to deliver a freight container to another port Y , which is not on its route plan. The container can be dropped off at Bandarport and transferred through a series of ships arriving there until it is finally picked up by a ship that is destined for port Y . Thus, the container is transferred from X to Y via some “intermediate” ships at Bandarport2 . However, there is a cost associated with transferring a container from one ship to another. This is because each transfer operation requires considerable manpower and resources. Thus, the number of ship-to-ship transfers that a container undergoes should be as small as possible. Furthermore, there is an added cost if an intermediate ship receives containers from multiple ships, or sends containers to multiple ships. This is mainly because of the bookkeeping overhead involved in maintaining which container goes to which ship. If a ship is receiving all its containers from just one ship and sending all those containers to just one other ship, then the cost associated with this transfer is zero (since a container cannot be directed to a wrong ship if there is only one option), and this cost increases as the number of to and from ships increases. Thus, given the docking times of ships at Bandarport, and a small subset of these ships that require a transfer of containers between each other, our goal is to devise a transfer strategy that meets the following objectives. • Minimize the number of transfers for each container. • Minimize the number of ships that have to deal with multiple transfers. Representing each ship’s visit to the port as an interval on the time line, this problem can be modelled using distance-preserving (-approximating) subgraphs of interval graphs. In this setting, a shortest path from an earlier interval to a later interval corresponds to a valid sequence of transfers across ships that moves forward in time. The first objective corresponds to minimizing pairwise distances between terminals; the second objective corresponds to minimizing the number of branching vertices. Let us now quantify this. Suppose that there are a total of n ships that dock at the port of Bandarport. Out of these, there are k ships that require a transfer of containers between each other (typically k ≪ n). Our results for interval graphs imply the following. 1. If we must make no more than the minimum number of transfers required for each container, then there is a transfer strategy in which the number of ships that have to deal with multiple transfers is O(k log k). 2. If we are allowed to make one more than the minimum number of transfers required for each container, then there is a transfer strategy in which the number of ships that have to deal with multiple transfers is O(k). 3. Neither bound can be improved, i.e. there exist scheduling configurations in which Ω(k log k) and Ω(k) ships, respectively, have to deal with multiple transfers. 1.3 Our Techniques The linear upper bound mentioned in Theorem 5 is easy to prove (see Theorem 15). However, if we require that distances be preserved exactly, then the problem becomes non-trivial. We now present a broad overview of the techniques involved in proving our main result. The Upper Bound: We may restrict attention to interval graphs that have interval representations where the terminals are intervals of length 0 (their left and right end points are the same) and the non-terminals are intervals of length 1. It is well-known that shortest paths in interval graphs can be constructed using a simple greedy algorithm. We build a subgraph consisting of such shortest paths 2 The container cannot be left at the warehouse/storage unit of Bandarport itself beyond a certain limited period of time. 3 U S U1 S1 U2 t0 S2 .. . .. . t1 Sm Um+1 Figure 1: The graph Gset that solves the set cover problem. Each Ui is a copy of U . Thus, U has n(m + 1) vertices and S has m vertices. t0 is connected to all vertices of U, and t1 is connected to all vertices of S. Vertex (u, i) of Ui has an edge to vertex Sj if and only if u ∈ Sj . starting at different terminals and add edges to it so that all inter-terminal shortest paths become available in the subgraph. We use a divide-and-conquer strategy, repeatedly “cutting” the graph down the middle into smaller interval graphs. Then we glue the solutions to the two smaller problems together. For this, we need a key observation (which appears to be applicable specifically to interval graphs) that allows one shortest path to “hop” onto another. In this, our upper bound method is significantly different from methods used previously for other families of graphs. The Lower Bound: We construct an interval graph and arrange its vertices on a two-dimensional grid instead of the more natural one-dimensional number line. We then show that this grid can be thought of as a matrix, in particular, the bit-reversal permutation matrix (where the ones corresponding to terminals and the zeros to non-terminals). The bit-reversal permutation matrix has seen many applications, most notably in the celebrated Cooley-Tukey algorithm for Fast Fourier Transform [CT65]. Prior to our work too, it has been used to devise lower bounds (e.g. [FL87, PD06]). Examining the routes available for shortest paths in our interval graph (constructed using the bit-reversal permutation matrix) requires (i) an analysis of common prefixes of binary sequences, and (ii) building a correspondence between branching vertices and the k log k/2 edges of a (log k)-dimensional Boolean hypercube. 2 Distance-preserving Subgraphs for General Graphs In this section, we first analyze the problem of finding optimal distance-preserving subgraphs of general graphs, and then study distance-preserving subgraphs for weighted graphs (including weighted interval graphs). 2.1 Finding Optimal Distance-preserving Subgraphs of General Graphs In this section, we show that the algorithmic task of finding an optimal distance-preserving subgraph of a general graph is NP-hard. Consider the following task. Input: An undirected, unweighted graph G, a set of terminals R ⊆ V (G), and a positive integer ℓ. Output: Yes, if (G, R) admits a distance-preserving subgraph with at most ℓ branching vertices; No, otherwise. Theorem 6. The above decision problem is NP-complete. 4 Proof. It is easy to see that the problem is in NP. To show that it is NP-hard, we reduce the set cover problem to the above problem. Consider an instance of the set cover problem on a universe U of size n, and subsets S1 , S2 , . . . , Sm ⊆ U . Using this instance of the set cover problem, we construct Gset , a graph on n(m + 1) + m + 2 vertices with n(m + 1) + 2 terminal vertices (Figure 1). Let U1 , U2 , . . . , Um+1 be m + 1 copies of U . Ui = {(u, i) : u ∈ U }. S Let U = i Ui . Let S = {S1 , S2 , . . . , Sm }. The vertex set of Gset is U ∪ S ∪ {t0 , t1 }. The edge set of Gset is E0 ∪ E1 ∪ E2 , where E0 = {(t0 , (u, i)) : (u, i) ∈ U}; E1 = {((u, i), Sj ) : u ∈ Sj ∈ S}; E2 = {(Sj , t1 ) : Sj ∈ S}. The set of terminals is U ∪ {t0 , t1 }. We claim that Gset has a distance-preserving subgraph with at most ℓ non-terminal branching vertices if and only if the set cover instance has a cover of size at most ℓ. The if direction is straightforward. Simply fix a set cover of size at most ℓ and consider the subgraph induced by it and the terminals. For the only if direction, suppose there is a distance-preserving subgraph H of Gset that has at most ℓ branching vertices. Clearly, in the distance-preserving subgraph H, each (u, i) and t1 have a common neighbour. If a vertex in S has degree at most 2 in H, then it can have a neighbour in at most one Ui . Since there are only m vertices in S but m + 1 sets Ui , there is an i0 , such that each vertex of the form (u, i0 ) ∈ Ui0 is a neighbour of a branching vertex in S. Thus, the (at most ℓ) branching vertices in S form a set cover of U . 2.2 Weighted Graphs In this section, we show that BGw (k) = Θ(k 4 ), where Gw is the family of all undirected graphs. This also implies results for unweighted graphs and weighted interval graphs. Theorem 7. If Gw is the family of all undirected, weighted graphs, then BGw (k) = Θ(k 4 ). Proof. Both the upper bound proof and the lower bound proof for BGw (k) follow directly from earlier work of Krauthgamer, Nguyên and Zondiner [KNZ14]. First, we prove that BGw (k) = O(k 4 ). In [KNZ14, Section 2.1], they show that every undirected graph on k terminals has a distance-preserving minor with at most O(k 4 ) vertices. They prove this by pointing out that distance-preserving minors can be constructed by first constructing distance-preserving subgraphs, and then replacing the two edges incident on a vertex of degree two by a single new edge3 . The number of vertices in the resulting minor is exactly the number of branching vertices in the distancepreserving subgraph. Thus, BGw (k) = O(k 4 ). Next, we prove that BGw (k) = Ω(k 4 ). The weighted planar graph (on O(k) terminal vertices and Ω(k 4 ) vertices in total) exhibited in [KNZ14, Section 5] has only one distance-preserving subgraph, namely the graph itself. Thus, BPw (k) = Ω(k 4 ), where Pw is the family of all undirected, weighted planar graphs. This implies that BGw (k) = Ω(k 4 ). Corollary 8. (Corollaries of Theorem 7). (a) If G is the family of all undirected, unweighted graphs, then BG (k) = Θ(k 4 ). (b) If Iw is the family of weighted interval graphs, then BIw (k) = Θ(k 4 ). Proof. Since G and Iw are both sub-families of Gw , the O(k 4 ) upper bound is straightforward. We now show the lower bound for both the cases. Proof of (a): It is easy to see that the weighted planar graph of [KNZ14, Section 5] can be made unweighted (by subdividing the edges) so that every distance-preserving subgraph has Ω(k 4 ) branching vertices. 3 Suppose x is a degree two vertex, and u and v are its two neighbours. Then, (u, x) and (x, v) are deleted from the minor, (u, v) is added to the minor (if it does not already exist in the minor), and w((u, v)) = d(u, v). 5 Proof of (b): Theorem 7 implies that there exists a weighted graph G such that every distancepreserving subgraph of G has Ω(k 4 ) branching vertices. Let |V (G)| = n. Add edges of infinte (or very high) weight to G so that the resulting graph is Kn , the complete graph on n vertices. Since Kn is an interval graph, this completes the proof. 3 Interval Graphs We work with the following definition of interval graphs. Definition 9. An interval graph is an undirected graph G(V, E, left, right) with vertex set V , edge set E, and real-valued functions left : V → R and right : V → R such that: • left(x) ≤ right(x) ∀x ∈ V ; • (u, v) ∈ E ⇔ [left(u), right(u)] ∩ [left(v), right(v)] 6= ∅. We order the vertices of the interval graph according to the end points of their corresponding intervals. For simplicity, we assume that all the end points of the intervals have distinct values. Define relations “” and “≺” on the set of vertices V as follows. u  v ⇔ right(u) ≤ right(v) ∀u, v ∈ V. u ≺ v ⇔ right(u) < right(v) ∀u, v ∈ V. ♦ Note that if u ≺ v, then u 6= v. 3.1 Shortest Paths in Interval Graphs In this section, we state some basic properties of shortest paths in interval graphs. It is well-known that one method of constructing shortest paths in interval graphs is the following greedy algorithm. Suppose we need to construct a shortest path from interval u to interval v (assume u ≺ v). The greedy algorithm starts at u. In each step it chooses the next interval that intersects the current interval and reaches farthest to the right. It stops as soon as the current interval intersects v. Let PGgr (u, v) be the shortest path produced by this greedy algorithm between u and v (u ≺ v). We now outline some elementary facts about greedy shortest paths, more generally about shortest paths in interval graphs. All of these facts are easy to prove. Fact 10. Given an interval graph G and a shortest path (not necessarily a greedy shortest path) PG (v1 , vr ) = (v1 , v2 , . . . , vr ) in G, if v1 ≺ vr , then vi ≺ vi+1 for each 1 ≤ i < r − 1. Fact 11. Given an interval graph G and three vertices x, y, z ∈ V (G), if x  y  z, then dG (x, z) ≥ dG (y, z). Fact 12. Given an interval graph G, a greedy shortest path PGgr (v1 , vr ) = (v1 , v2 , . . . , vr ) in G, and a point a ∈ R, let Ba = {vi ∈ PGgr (v1 , vr ) : left(vi ) ≤ a ≤ right(vi )}. Then, |Ba | ≤ 2. Fact 13. Given an interval graph G, and a shortest path (not necessarily a greedy shortest path) PG (v1 , vr ) = (v1 , v2 , . . . , vr ) in G, and a vertex x ∈ V (G), let Bx = {vi ∈ PG (v1 , vr ) : (x, vi ) ∈ E(G)}. Then, |Bx | ≤ 3. Fact 14. Given an interval graph G, a greedy shortest path PGgr (v1 , vr ) = (v1 , v2 , . . . , vr ) in G, and two vertices x, y ∈ V (G) such that left(x) < left(y) and right(x) > right(y). Then, y ∈ PGgr (v1 , vr ) if and only if v1 = y or vr = y. We now proceed to prove the O(k) upper bound for distance-approximating subgraphs (with an additive distortion of +1) of interval graphs. 6 3.2 Distance-approximating Subgraphs of Interval Graphs In this section, we show that a simple greedy technique yields a linear-sized distance-approximating subgraph for any interval graph. Let us restate Theorem 5. Theorem 15. If I is the family of all interval graphs, then there exists a subgraph H of G such that deg≥3 (H) = O(k) and for all terminals u and v, we have dG (u, v) ≤ dH (u, v) ≤ 1 + dG (u, v). Let G(V, E, left, right) be an interval graph on k terminals indexed by the set [k]. For any two vertices u  v of G, let PGgr (u, v) = Next-Farthest-Right(G, u, v) be the greedy shortest path between u and v. For each 1 ≤ i < k, define the tree Ti as follows. [ Ti = PGgr (i, j) i<j≤k Thus, T1 is a shortest-path tree rooted at terminal 1. We are now set to define H1 . This is the distance-approximating subgraph of G. H1 = T1 ∪ {(v, i) ∈ E(G) : 1 < i < k, v ∈ V (T1 )} Assume that vlast = k. Then, H1 may alternatively be defined as follows. H1 = PGgr (1, k) ∪ {(v, i) ∈ E(G) : 1 < i < k, v ∈ V (T1 )} It is easy to check that both these definitions are equivalent. The following theorem proves that H1 approximates terminal distances in G up to an additive distortion of +1. Lemma 16. dG (i, j) ≤ dH1 (i, j) ≤ dG (i, j) + 1 ∀ 1 ≤ i < j ≤ k. Proof. For i = 1, dG (1, j) = dH1 (1, j) since T1 ⊆ H1 . Also when (i, j) ∈ E(G), it is easily verifiable that dH1 (i, j) ≤ 2. Now suppose i 6= 1. We show that for any j such that i < j ≤ k and (i, j) ∈ / E(G), dH1 (i, j) ≤ gr dG (i, j) + 1. Let PH (i, k) be the greedy shortest path from i to k in H . For integer p ≥ 1, let vG (i, p) be 1 1 the p-th vertex on the path PGgr (i, k) (i itself being the 0-th vertex). vH1 (i, p) is similarly defined. Note that right(vG (i, p)) ≥ right(vH1 (i, p)), with equality occurring when vG (i, p) = vH1 (i, p). Suppose dG (i, j) = p. Then, (vG (i, p − 1), j) ∈ E(G). Using Claim 17, we know that either vG (i, p − 1) = vH1 (i, p − 1) or (vG (i, p − 1), vH1 (i, p − 1)) ∈ E(G). In the first case, dG (i, j) = dH1 (i, j) = p and we are done. In the second case, there is a path of length at most 2 from vH1 (i, p − 1) to j. Thus, dH1 (i, j) ≤ (p − 1) + 2 = p + 1. This completes the proof. Claim 17. Let vG (i, p) and vH1 (i, p) be as defined in the proof of Lemma 16. Then for all p ≥ 1, either vG (i, p) = vH1 (i, p) or (vG (i, p), vH1 (i, p)) ∈ E(G). Proof. We prove this claim by inducting on p. For p = 1, the claim is trivially true. Our goal is to prove that the claim is true for p = r + 1, assuming that the claim is true for p = r. Thus, our induction hypothesis is that either vG (i, r) = vH1 (i, r) or (vG (i, r), vH1 (i, r)) ∈ E(G). In the first case, we have vG (i, r + 1) = vH1 (i, r + 1), and we are done. In the second case, assume that (vG (i, r), vH1 (i, r)) ∈ E(G). Then, we have the following. vG (i, r + 1) = argmax{right(x) | x ∈ V (G), (vG (i, r), x) ∈ E(G)} vH1 (i, r + 1) = argmax{right(x) | x ∈ V (H1 ), (vH1 (i, r), x) ∈ E(H1 )} If vG (i, r + 1) = vH1 (i, r + 1), then we are done. Otherwise, left(vH1 (i, r + 1)) < right(vH1 (i, r)) < right(vG (i, r)) ≤ right(vH1 (i, r+1)). Thus, the point right(vG (i, r)) is present in the interval corresponding to vH1 (i, r + 1) as well as in the interval corresponding to vG (i, r + 1), which implies that (vG (i, r + 1), vH1 (i, r + 1)) ∈ E(G). This completes the proof of the claim. Thus, H1 approximates terminal distances in G up to an additive term of +1. We now prove that the number of branching vertices in H1 is linear in k. Lemma 18. H1 has O(k) branching vertices. 7 Proof. For i ∈ [k], let B(1)i = {v ∈ PGgr (1, k) | (i, v) ∈ E(G)}. Then by Fact 13, |B(1)i | ≤ 3. In other words, each terminal can contribute at most 3 branching vertices to H1 . Summing over all terminals, k X |B(1)i | ≤ 3k i=1 PGgr (1, k) is a simple path and thus gr PG (1, k) ∪ {(v, i) ∈ E(G) : 1 < i < k, v contributes no branching vertices of its own to H1 . Since H1 = ∈ V (T1 )}, H1 has at most 3k branching vertices, completing the proof. Lemma 16 and Lemma 18 together complete the proof of Theorem 15. Finally, we prove that this upper bound is tight by providing a matching lower bound. Lemma 19. For every positive integer k, there exists an interval graph Ghard on k terminals such that k hard if H1 is a subgraph of Ghard and H approximates distances in G up to an additive distortion of +1, 1 k k then H1 has Ω(k) branching vertices. Proof. Let us describe the construction of Ghard (V, E, left, right). Fix ǫ = 0.01. Ghard has 2k − 2 nonk k terminal vertices {v1 , v2 , . . . , v2k−2 } and k terminals vertices indexed by the set [k]. left(vi ) = i − ǫ, left(j) = 2j − 1.5, right(vi ) = i + ǫ + 1 right(j) = 2j − 0.5 ∀ 1 ≤ i ≤ 2k − 2. ∀ j ∈ [k]. Suppose H1 approximates distances in Ghard up to an additive distortion of +1. For odd i, (vi , vi+1 ) ∈ k V (H1 ) (otherwise the terminals become disconnected in H1 ). For even i, define the set S as follows (let j = i/2). S = {(v2j , v2j+1 ) : 1 ≤ j ≤ k − 2, (v2j , v2j+1 ) ∈ E(H1 )} Thus, |S| ≤ k−2. Consider any (v2j , v2j+1 ) ∈ S. Then either (v2j , j+1) ∈ E(H1 ) or (j+1, v2j+1 ) ∈ E(H1 ) (otherwise j + 1 becomes isolated in H1 ). Since (v2j−1 , v2j ) ∈ E(H1 ) and (v2j+1 , v2j+2 ) ∈ E(H1 ), either v2j or v2j+1 must be a branching vertex in H1 . Thus, for every edge in S, at least one of its end points must be a branching vertex. Using Claim 20, |S| ≥ k − 3. Combined with the fact that all the edges of S are vertex disjoint, this means that H1 has at least k − 3 branching vertices, completing the proof. Claim 20. Let S be as defined in the proof of Lemma 19. Then |S| ≥ k − 3. Proof. Suppose |S| < k − 3. Then, there exist terminal vertices j1 , j2 such that 1 ≤ j1 < j2 ≤ k − 2 / E(H1 ). This means that dH1 (v2j1 , v2j1 +1 ) = 2 = 1 + / E(H1 ), (v2j2 , v2j2 +1 ) ∈ and (v2j1 , v2j1 +1 ) ∈ dGhard (v 2j 1 , v2j1 +1 ) and dH1 (v2j2 , v2j2 +1 ) = 2 = 1+dGhard (v2j2 , v2j2 +1 ). Thus, dH1 (1, k) ≥ 2+dGhard (1, k), k k k and H1 does not approximate distances in Ghard up to an additive distortion of +1, which is a contrak diction. This completes the proof of the claim. Note that our proof of the O(k) upper bound naturally translates into an algorithm. In other words, given an interval graph G on n vertices, it produces a distance-approximating subgraph H of G in running time polynomial in n. We now move on to distance-preserving subgraphs of interval graphs. 4 Proof of the Upper Bound In this section, we show that any interval graph G with k terminals has a distance-preserving subgraph with O(k log k) branching vertices, which is simply Theorem 2 (a), restated here for completeness. Theorem 21. If I is the family of all interval graphs, then BI (k) = O(k log k). The following notation will be used in our proof. Given real numbers a, b ∈ R such that a ≤ b, let G[a, b] be the induced subgraph on those vertices v of G such that [left(v), right(v)] ∩ [a, b] 6= ∅. Similarly, let G[a, b) be the induced subgraph on those vertices v of G such that [left(v), right(v)] ∩ [a, b) 6= ∅. We first prove the upper bound for a special case of interval graphs, and later show that the same upper bound holds (up to constants) for all interval graphs. 8 HB HA R1 a R2 x R3 x+1 b Hright Hleft Figure 2: The interval graph G[a, b] has 2ℓ terminals and is “cut” into three regions, R1 , R2 and R3 . By induction, Hleft preserves distances when both terminals lie in R1 , and Hright preserves distances when both terminals lie in R2 ∪ R3 . In addition, HA preserves distances when one terminal lies in R1 and the other in R2 (by introducing at most O(ℓ) additional branching vertices in R2 ), and HB preserves distances when one terminal lies in R1 and the other in R3 (by introducing at most O(ℓ) additional branching vertices in R3 ). 4.1 Interval Graphs with Point Terminals and Unit Non-terminals Let G be an interval graph on k terminals such that all terminals in G are zero-length intervals or point intervals and all non-terminals are unit intervals. Our goal is to obtain a distance-preserving subgraph H of G with O(k log k) branching vertices. Note that the H that we obtain is not necessarily an interval graph. This is because H need not be an induced subgraph of G. Consider the greedy path PGgr (ti , tk ) (i < k), where tk is the rightmost terminal. Our distancepreserving subgraph includes greedy paths from ti to tk for all 1 ≤ i < k. Let [ H0 = PGgr (i, k). (22) 1≤i<k Now, H0 already provides for shortest paths from each terminal ti to tk . In fact, it can be viewed as a shortest path tree with root tk , but constructed backwards. Thus, the total number of branching vertices in H0 is O(k). We still need to arrange for shortest paths between other pairs of terminals (ti , tj ). The path PGgr (ti , tj ) (for i < j < k) is either entirely contained in PGgr (ti , tk ), or it follows PGgr (ti , tk ) until it reaches a neighbour of tj and then branches off to connect to tj . We can consider including all paths of the form PGgr (ti , tj ) in H0 . That is, we need to link each such tj to vertices from H0 so that each path PGgr (ti , tj ) becomes available. If this is done without additional care, we might end up introducing Ω(k) additional branching vertices per terminal, and Ω(k 2 ) branching vertices in all, far more than we claimed. The crucial idea for overcoming this difficulty is contained in the following lemma. Lemma 23. Suppose v ≺ w and d(v, w) = 1. Let (v, v1 , v2 , . . . , vℓ ) and (w, w1 , w2 , . . . , wℓ′ ) be greedy shortest paths starting from v and w respectively. Suppose right(vℓ ) < right(wℓ′ ). Then, ℓ ≤ ℓ′ . Proof. Since d(v, w) = 1, the greedy strategy reaches at least as far in j + 1 steps from v as it does in j steps from w. Suppose for contradiction that ℓ > ℓ′ (that is ℓ ≥ ℓ′ + 1). Then, we have right(wℓ′ ) ≤ right(vℓ′ +1 ) ≤ right(vℓ ), contradicting our assumption that right(vℓ ) < right(wℓ′ ). The above lemma is crucial for the construction of our subgraph H. For example, suppose ti and tj both need to reach tr via a shortest path. Suppose (wi , tr ) is the last edge of PGgr (ti , tr ) and (wj , tr ) is the last edge of PGgr (tj , tr ). We claim that it is sufficient to include only one of these edges in H. If right(wj ) < right(wi ), then it is enough to include the edge (wj , tr ) in H; as long as ti has a shortest path to wj , this edge serves for shortest paths to tr from both ti and tj . In the construction below, we add links to the greedy paths of H0 so that we need to provide only one such edge per terminal. This idea forms the basis of the divide-and-conquer strategy which we present below. Suppose G has 2ℓ terminals. We find a point x so that both Gleft = G[−∞, x] and Gright = G[x, ∞] have ℓ terminals. By induction, we find distance-preserving subgraphs Hleft and Hright of Gleft and 9 Gright with at most f (ℓ) branching vertices each. The union of Hleft and Hright has just 2f (ℓ) branching vertices, but it does not yet guarantee shortest paths from terminals in Hleft to terminals in Hright . Using Lemma 23 and the discussion above, we connect each terminal tj in Hright to only one of the greedy shortest paths of terminals from Hleft , and ensure that shortest paths to tj are preserved from all terminals ti in Hleft . This creates O(ℓ) additional branching vertices and give us a recurrence of the form f (2ℓ) ≤ 2f (ℓ) + O(ℓ), and the desired upper bound of O(k log k). Unfortunately, there are technical difficulties in implementing the above strategy as stated. It is therefore helpful to augment H0 by adding all greedy paths PGgr (ti , tj ), where d(i, j) ≤ 4. As a result, for each terminal ti , the first three vertices on PGgr (ti , tk ) might become branching vertices. In all, this adds a one-time cost of O(k) branching vertices to our subgraph. We now present the argument formally. For each (a, b), let f (a, b) be the minimum number of non-terminals in a subgraph H ∗ of G[a, b] such that H0 ∪ H ∗ preserves all inter-terminal distances in G[a, b]; let f (ℓ) = max f (a, b), (a,b) where (a, b) ranges over all pairs such that G[a, b] has at most ℓ terminals. The following lemma is the basis of our induction. Lemma 24. (i) f (1) = 0; (ii) f (2ℓ) ≤ 2f (ℓ) + O(ℓ). Proof. Part (i) is trivial. For part (ii), fix a pair (a, b) such that G[a, b] has at most 2ℓ terminals. If b − a ≤ 1, H0 already preserves distances between every two terminals in G[a, b]. So, we may take H ∗ to be empty. Now assume that b − a > 1. Pick x ∈ [a, b] as large as possible such that (i) b − x ≥ 1, and (ii) G[x, b] has at least ℓ terminals. Let Gleft = G[a, x) and Gright = G[x, b]. Since Gright has at least ℓ terminals, Gleft has at most ℓ terminals. So, we obtain (by induction) a subgraph Hleft of G[a, b] with at most f (ℓ) non-terminals, such that H0 ∪ Hleft preserves all inter-terminal distances in Gleft . If b − x > 1, then Gright has exactly ℓ terminals, and we obtain by induction a subgraph Hright of G[a, b] with at most f (ℓ) non-terminals such that H0 ∪ Hright preserves all inter-terminal distances in G[x, b]. If b − x = 1, then we may take Hright to be empty (for H0 already preserves inter-terminal distances in G[x, b]). Our final subgraph H ∗ shall be of the form Hleft ∪ Hright ∪ HA ∪ HB , where HA and HB are defined as follows. Refer to Figure 2. Let us first define HA . Let Pleft be the set of greedy paths from the terminals in Hleft to the terminal tk . Let VA be the set of all non-terminal intervals of Pleft that intersect with the interval [x, x + 1]. It is easy to see that any path in Pleft contributes at most 4 non-terminals to VA . So, |VA | ≤ 4ℓ. Let HA be the subgraph of G[a, b] induced by VA and the terminals in G[x, x + 1]. Note that H0 ∪ Hleft ∪ Hright ∪ HA preserves all inter-terminal distances in G[a, x + 1] as well as all inter-terminal distances in G[x + 1, b]. In fact, it does more. For each terminal ti in G[a, x), let vi be the last vertex on the greedy path PGgr (ti , tk ) that is in VA . Then, the above graph contains the greedy shortest path from every terminal tj in G[a, x] to vi . Now, it only remains to ensure that distances between terminals in G[a, x) and terminals in G[x+1, b] are preserved. Let us now define HB . For each terminal tj in G[x + 1, b], let v be the earliest interval (with respect to ≺) of Pleft that contains tj . Then, we include the edge (v, tj ) in HB . Thus, HB contains at most one non-terminal per vertex in G[x+1, b], that is, at most 2ℓ non-terminals in all. This completes the description of HA and HB . The final subgraph is H ∗ = Hleft ∪ Hright ∪ HA ∪ HB . Claim 25. Let ti be a terminal in G[a, x) and tr be a terminal in G[x, b]. Then, H = H0 ∪ H ∗ preserves the distance between terminal ti and tr . Proof of Claim 25. Let v be the vertex that we attached to tr in HB . If v is on PGgr (ti , tk ), then it follows that PGgr (ti , tr ) is in H, and we are done. So we assume that v is not on PGgr (ti , tk ). Then, let j 6= i be such that v ∈ PGgr (tj , tk ). Then, we have paths PG (ti , tr ) = (ti , w1 , w2 , . . . , wp , wp+1 , . . . , wℓ′ , tr ); PH (ti , tr ) = (ti , w1 , w2 , . . . , wp , vq+1 , . . . , vℓ = v, tr ), 10 where vq+1 is the last vertex on PGgr (tj , tk ) in G[x, x + 1], and wp is the first vertex on PGgr (ti , tr ) such that (wp , vq+1 ) ∈ E(G). From the construction of HA , (wp , vq+1 ) ∈ E(H). Following vq , (vq+1 , . . . , vℓ = v, tr ) are the subsequent vertices on PGgr (tj , tr ). Note that: (i) vq+1 ≺ wp+1 (otherwise v is on PGgr (ti , tk )), (ii) d(vq+1 , wp+1 ) = 1 (both intervals contain right(wp )), and (iii) right(vℓ ) < right(wℓ′ ) (since v is the earliest interval of Pleft that contains tj ). By Lemma 23, ℓ − q − 1 ≤ ℓ′ − p − 1. Thus, PH (ti , tr ) is no longer than PGgr (ti , tr ). We can now complete the proof of the upper bound. By Lemma 24, there is a subgraph H ∗ of G such that H = H0 ∪ H ∗ preserves all inter-terminal distances in G, H0 has O(k) branching vertices and H ∗ has O(k log k) non-terminals. It follows that H has O(k log k) branching vertices. 4.2 Generalising to all Interval Graphs In this section, we prove the upper bound for general interval graphs. In particular, we show that any interval graph can be reduced to the special case of the previous section. Given an interval graph G on k terminals, we produce a slightly modified interval graph G′ on 2k terminals, such that G′ has point terminals and unit non-terminals. 1. Initially, G′ = G. 2. For each terminal t ∈ V (G), add two vertices tleft and tright to V (G′ ) such that left(tleft ) = right(tleft ) = left(t), left(tright ) = right(tright ) = right(t). Thus, tleft and tright are point intervals, or intervals of length zero. 3. Designate tleft and tright as terminals, and t as a non-terminal. Thus, G′ now has 2k terminals. 4. For each non-terminal x ∈ V (G′ ), if there exists y ∈ V (G′ ) such that left(y) < left(x) and right(y) > right(x), then delete x from G′ . Thus, after this pre-processing, the non-terminals of G′ have the following property: for any pair of non-terminals u and v, left(u) ≤ left(v) ⇔ right(u) ≤ right(v). Gardi [Gar07] shows that an interval graph that possesses this property can be equivalently represented by a unit interval graph. Thus, the induced subgraph on the non-terminals of G′ has a unit interval representation. It is easy to see that the (zero-length) terminals can also be placed in this unit interval representation such that it represents G′ . The final G′ is an interval graph (not necessarily a unit interval graph) such that all terminal intervals of G′ have length 0, and all non-terminal intervals of G′ have length 1. Thus, G′ now possesses the structure required for the construction of a distance-preserving subgraph H ′ with O(k log k) branching vertices, as described in the proof of Theorem 21 in the previous section. We now construct H from H ′ , such that H is a distance-preserving subgraph of G. 1. Initially, H = H ′ . 2. For each terminal t ∈ V (G), if t ∈ / V (H), then add t to V (H). 3. For each terminal t ∈ V (H), modify the neighbourhood of t in H as follows. nbhdH (t) = nbhdH (tleft ) ∪ nbhdH (tright ) ∪ nbhdH (t). 4. For each terminal t ∈ V (H), delete tleft and tright from H. 5. For terminal pairs t1 and t2 such that dG (t1 , t2 ) = 1, if (t1 , t2 ) ∈ / E(H), then add (t1 , t2 ) to E(H). It is easy to see that the number of branching vertices in H at most O(k) more than the number of branching vertices in H ′ . Also, for terminal pairs u and v such that dG (u, v) > 1 (assume u ≺ v), a shortest path from uright to vleft is a shortest path from u to v. Thus, H is a distance-preserving subgraph of G with O(k log k) branching vertices, completing the proof of Theorem 21. 11 5 Proof of the Lower Bound In this section, we show that there exists an interval graph Gint such that any distance-preserving subgraph of Gint has Ω(k log k) branching vertices, which is simply Theorem 2 (b), restated here for completeness. Theorem 26. If I is the family of all interval graphs, then BI (k) = Ω(k log k). 5.1 Preliminaries We first set up some terminology that we use in this section. Let k = 2γ , where γ is a positive integer. We identify the numbers in the set {0, 1, . . . , k − 1} with elements of {0, 1}γ using their γ-bit binary representation. We index the bits of the binary strings from left to right using integers i = 1, 2, . . . , γ. Thus, x[i] denotes the i-th bit of x (from the left); we use x[i, j] to denote the string x[i] x[i + 1] . . . x[j] of length j − i + 1 (here i, j satisfy 1 ≤ i ≤ j ≤ γ). For a string of bits a, we use revγ (a) to represent the reverse of a, that is, the binary string obtained by writing the bits of a in the reverse order (e.g., revγ (00010) = 01000). We may arrange binary strings in a binary tree. Refer to Figure 3 for an example. The root is the empty string; the left child of a vertex x is the vertex x 0, and its right child is the vertex x 1. In particular, the string y is a descendant of the string x if y is obtained by concatenating x with some (possibly empty) string z, that is, y = x z. Consider the binary tree of depth γ, whose leaves correspond to elements of {0, 1}γ . For distinct elements x, y ∈ {0, 1}γ , let lca(x, y) be the lowest common ancestor of x and y defined as follows: lca(x, y) = x[1, ℓ − 1] = y[1, ℓ − 1], where ℓ = min {i ∈ [γ] : x[i] 6= y[i]} . For example, lca(0100111, 0101010) = 010. Let ⌊lca(x, y)⌋ be the floor of lca(x, y), and ⌈lca(x, y)⌉ be the ceiling of lca(x, y) defined as follows: ⌊lca(x, y)⌋ = lca(x, y) 0 1γ−ℓ ⌈lca(x, y)⌉ = lca(x, y) 1 0γ−ℓ Since ⌊lca(x, y)⌋, ⌈lca(x, y)⌉ ∈ {0, 1}γ , we may regard ⌊lca(x, y)⌋ and ⌈lca(x, y)⌉ as numbers in the set {0, 1, . . . , k − 1}. Note that ⌊lca(x, y)⌋ = ⌈lca(x, y)⌉ − 1, and if x < y, then ⌊lca(x, y)⌋ ∈ [x, y) and ⌈lca(x, y)⌉ ∈ (x, y]4 . Strings in {0, 1}γ can also be viewed as vertices of an γ-dimensional hypercube, with edge set Hγ = {(x, x′ ) : x, x′ ∈ {0, 1}γ and x < x′ and Ham(x, x′ ) = 1}, where Ham(x, x′ ) is the Hamming distance between x and x′ . Thus, if (x, x′ ) ∈ Hγ , then x and x′ differ at a unique location where x has a zero and x′ a one. Claim 27. Suppose (x, x′ ) and (y, y ′ ) are distinct edges of Hγ . (a) If lca(x, x′ ) = lca(y, y ′ ), then [revγ (x), rev γ (x′ )] ∩ [revγ (y), revγ (y ′ )] = ∅. (b) If {⌊lca(x, x′ )⌋ , ⌊lca(y, y ′ )⌋} ⊆ [x, x′ ) ∩ [y, y ′ ), then [revγ (x), rev γ (x′ )] ∩ [revγ (y), revγ (y ′ )] = ∅. Proof. Although part (b) implies part (a), it is easier to show part (a) first, and then derive part (b) from it. For part (a), let |lca(x, x′ )| = |lca(y, y ′ )| = ℓ − 1. Let a, b ∈ {0, 1}γ−ℓ be such that a = x[ℓ + 1, γ] = x′ [ℓ + 1, γ] 6= y[ℓ + 1, γ] = y ′ [ℓ + 1, γ] = b. In particular, we have a 6= b (implying revγ−ℓ (a) 6= revγ−ℓ (b)). Note that revγ (a) represents the γ − ℓ most significant bits of revγ (x) and revγ (x′ ); similarly, revγ (b) represents the γ − ℓ most significant bits of revγ (y) and revγ (y ′ ). If revγ−ℓ (a) < revγ−ℓ (b) then revγ (x′ ) < revγ (y); and if revγ−ℓ (b) < revγ−ℓ (a) then revγ (y ′ ) < revγ (x). In either case, [revγ (x), rev γ (x′ )] and [revγ (y), revγ (y ′ )] are disjoint, proving part (a). Next, consider part (b). Suppose ⌊lca(x, x)⌋ , ⌊lca(y, y ′ )⌋ ∈ [x, x′ ) ∩ [y, y ′ ). Since every p ∈ [x, x′ ) is a descendant of lca(x, x′ ), we conclude that lca(y, y ′ ) is a descendant of lca(x, x′ ). Similarly, lca(x, x′ ) is a descendant of lca(y, y ′ ). But then lca(x, x′ ) = lca(y, y ′ ), and part (b) follows from part (a). 4 [x, y] , {x, x + 1, x + 2, . . . , y} and [x, y) , {x, x + 1, x + 2, . . . , y − 1}. 12 0 1 lca(x, y) 1 0 0 1 height=γ 0 0 0 1 1 0 1 1 0 1 0 1 0 1 y x ⌊lca(x, y)⌋ ⌈lca(x, y)⌉ Figure 3: A complete binary tree of height γ having k = 2γ leaves. In this example, γ = 5, x = 01001 and y = 01101. Thus, Ham(x, y) = 1 and |lca(x, y)| = 2. 5.2 Manhattan Graphs In this section, we describe a directed grid graph Gbit k (which we refer to as the Manhattan graph) with 3k terminals. We show that any distance-preserving subgraph of Gbit k has Ω(k log k) branching vertices. The graph has k 2 + 2k vertices arranged in a square grid. The vertices and edges of Gbit k are defined as follows. (Figure 4 makes this definition easier to understand.) 1. V (Gbit k ) = {0, 1, 2, . . . , k − 1} × {−1, 0, 1, . . . , k}. 2. There are three kinds of edges: horizontal, upward and downward; the edge set is given by E(Gbit k ) = Ehor ∪ Eup ∪ Edown , where Ehor = {((i, j), (i, j + 1)) : i = 0, 1, . . . , k − 1 and j = −1, 0, . . . , k − 1}; Eup = {((i1 , j), (i2 , j)) : 0 ≤ i2 < i1 ≤ k − 1 and j = −1, 0, . . . , k}; Edown = {((i1 , j), (i2 , j)) : 0 ≤ i1 < i2 ≤ k − 1 and j = −1, 0, . . . , k}. 3. The edge weights are given by the function w : E(Gbit k ) → {0, 1}, defined as follows: w(e) = 1 if e ∈ Ehor ∪ Eup , and w(e) = 0 if e ∈ Edown . The set of terminals are of the form T = Tleft ∪ Tmid ∪ Tright , where Tleft = {0, 1, . . . , k − 1} × {−1}, Tright = {0, 1, . . . , k − 1} × {k}; Tmid = {(revγ (i), i) : i = 0, 1, . . . , k − 1}. This completes the definition of Gbit k . bit Fix an optimal distance-preserving subgraph Hkbit of Gbit has Ω(k log k) k . We shall show that Hk vertices of degree at least 3. bit Lemma 28. V (Hkbit ) = V (Gbit k ) and Ehor ⊆ E(Hk ). 13 1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Figure 4: The bit-reversal permutation matrix for k = 16. Each cell represents a vertex: the blue cells represent the terminal vertices of Tmid ; all the other vertices are non-terminals. Edges are named horizontal, upward and downward in the natural way. Proof. For any i ∈ {0, 1, . . . , k − 1}, note that the unique shortest path between the terminals (i, −1) and (i, k) is precisely ((i, −1), (i, 0), . . . , (i, k)). Thus, all vertices and all horizontal edges in the i-th row bit of Gbit k must be part of Hk . It follows from Lemma 28 that every non-terminal vertex in Hkbit has degree at least two, namely the two horizontal edges incident on it. From now on, we rely solely on the fact that Hkbit is distance-preserving for every pair of terminals in Tmid , i.e. we prove the stronger statement that just preserving terminal distances in Tmid requires Ω(k log k) branching vertices. Order the vertices in Tmid as t0 , t1 , . . . , tk−1 , where ti = (revγ (i), i). Note that these terminals appear in different rows and columns. Consider the following pairs of terminals. Ttwins = {(ti , tj ) : (i, j) ∈ Hγ }. For each twin (ti , tj ), fix P (i, j), a path of minimum distance between ti and tj in Hkbit . We are now set to formally define special edges. Definition 29. Let spcl(i, j) = ((rij , ⌊lca(i, j)⌋), (rij , ⌈lca(i, j)⌉)) be an edge of P (i, j), where revγ (i) ≤ rij ≤ revγ (j). (By Lemma 30, such an edge exists.) Let spcl = {spcl(i, j) : (ti , tj ) ∈ Ttwins }. ♦ Lemma 30. Let (ti , tj ) ∈ Ttwins ; let ℓ = ⌊lca(i, j)⌋. Then, there is an rij ∈ [revγ (i), revγ (j)] such that P (i, j) contains the edge ((rij , ℓ), (rij , ℓ + 1)). Proof. We have i < j, ti = (revγ (i), i) and tj = (revγ (j), j). Also note that since (i, j) ∈ Hγ , revγ (i) < revγ (j). Thus, d(i, j) = j − i, and the shortest path P (ti , tj ) goes from column i to column j and never skips a column. Since ℓ ∈ [i, j), there must be an edge in P (i, j) of the form ((rij , ℓ), (rij , ℓ + 1)) (say, the edge of P (i, j) that leaves column ℓ for the last time). We claim that rij ∈ [revγ (i), revγ (j)]. For otherwise, P (i, j) would contain an edge in Eup . Then, apart from the j − i edges from Ehor , P (i, j) would contain an additional edge from Eup of weight 1; that is, the length of P (i, j) would be at least j − i + 1—contradicting the fact that d(i, j) = j − i. Lemma 31 (Key lemma). Suppose (tx , tx′ ) and (ty , ty′ ) are distinct pairs in Ttwins such that their special edges are in the same row r, that is, spcl(x, x′ ) = ((r, α), (r, α + 1)) spcl(y, y ′ ) = ((r, β), (r, β + 1)), 14 where α = ⌊lca(x, x′ )⌋ and β = ⌊lca(y, y ′ )⌋. (a) Then, α 6= β. In particular, spcl(x, x′ ) 6= spcl(y, y ′ ). (b) Suppose α < β. Then, there exists an ℓ ∈ [α + 1, β] such that (r, ℓ) is either a branching vertex or a terminal in Hkbit . Proof. Part (a) follows from Claim 27 (a). Consider part (b). By our definition of special edge, r ∈ [revγ (x), rev γ (x′ )] and r ∈ [revγ (y), revγ (y ′ )]. So, [revγ (x), rev γ (x′ )] ∩ [revγ (y), revγ (y ′ )] 6= ∅, and / [y, y ′ ) or β ∈ / [x, x′ ). If α ∈ / [y, y ′ ), spcl(x, x′ ) is not by Claim 27 (b) (in the contrapositive) either α ∈ ′ ′ on P (y, y ). The first vertex in row r that is part of P (y, y ) is in a column ℓ ∈ [α + 1, β]. Then, (r, ℓ) is either a branching vertex or the terminal ty . On the other hand, if β ∈ / [x, x′ ), then the last vertex of P (tx , tx′ ) in row r lies in a column ℓ ∈ [α + 1, β], so (r, ℓ) is either a branching vertex or the terminal tx ′ . Corollary 32. (Corollaries of Lemma 31). (a) |spcl| = |Ttwins | = k log k/2 (since |Ttwins | = |Hγ | = k log k/2). (b) If two edges in spcl fall in the same row, then there is a branching vertex or a terminal separating them. Theorem 33. Hkbit has Ω(k log k) branching vertices. Proof. For each i ∈ {0, 1, . . . , k − 1}, let δi be the number of distinct edges in spcl in row i. Then, by Corollary 32 (a), we have   k−1 X k log k . δi = |spcl| = 2 i=0 Furthermore, Corollary 32 (b) implies that there are at least δi − 2 many branching vertices of the form (i, x) in Hkbit , where 0 ≤ x ≤ k − 1. Thus, the total number of branching vertices in Hkbit is at least (δ0 − 2) + (δ1 − 2) + · · · + (δk−1 − 2) = k−1 X i=0 δi ! − 2k =  k log k 2  − 2k. Since this quantity is Ω(k log k), this completes the proof. 5.3 Translating the Lower Bound to Interval Graphs In this section, we present an interval graph Gint with O(k) terminals, for which every distance-preserving subgraph has Ω(k log k) branching vertices. Our lower bound relies on the lower bound for the Manhattan graph shown in the previous section. Figure 5 can be helpful to navigate through this proof. Let us describe the interval graph. Let J be the set of intervals. J = {[x, x + 1] : x = −1, −1 + 1/k, . . . , −1/k, 0, . . . , k, k + 1/k, . . . , k + 1 − 1/k}. Thus, we have unit intervals starting at all integral multiples of 1/k in the range [−1, k + 1 − 1/k]; in all we have k(k + 2) intervals in J . These intervals naturally define an interval graph. Furthermore, the edges of Gint are directed as follows. Orient the edges of Gint from an earlier interval to a later interval, i.e. ([x, x + 1], [y, y + 1]) is a directed edge from [x, x + 1] to [y, y + 1] if and only if x < y ≤ x + 1. Note that this orientation does not affect shortest paths. Any shortest path from [i, i + 1] to [j, j + 1] (where i < j) in the undirected interval graph is also a valid directed shortest path in Gint . Also, Gint has k 2 + 2k vertices, which (surprisingly?) is the number of vertices in the Manhattan graph of the previous section. In fact, the connection is deeper. Let us arrange the intervals in a two-dimensional array A = hai,j : i = 0, . . . , k − 1 and j = −1, 0, . . . , ki, where aij corresponds to the interval [j + (k − 1 − i)/k, j + 1 + (k − 1 − i)/k]. Thus, the first k intervals of J occupy the left most column of the array A (from bottom to top); the next k intervals occupy the 15 k k k 1 The 2d array A The set of intervals J HMH k 1 0 k Figure 5: The transformation: (i) The set of intervals J (represented by their starting points) is divided into groups of size k each. (ii) Then, each group is placed in a column of the 2d array A from bottom to top. (iii) Finally, each slanting edge (weight 1) is replaced by a downward edge (weight 0) to obtain HMH . Note that the distance between the pair of blue vertices is 1 in all three graphs. In J and A, they are connected by a single edge of weight 1. In HMH , the gray vertex has a weight 1 edge to the blue vertex in its adjacent row. next column (again from bottom to top), and so on. It is easy to check that, after this arrangement, the directed edges of Gint are of three types: horizontal, upward and slanting. Ehor (Gint ) = {(ai,j , ai,j+1 ) : 0 ≤ i ≤ k − 1 and − 1 ≤ j ≤ k − 1}; Eup (Gint ) = {(ai,j , ai′ ,j ) : 1 ≤ i ≤ k − 1 and 0 ≤ i′ < i and − 1 ≤ j ≤ k }; Eslant (Gint ) = {(ai,j , ai′ ,j+1 ) : 0 ≤ i ≤ k − 2 and i < i′ ≤ k − 1 and − 1 ≤ j ≤ k − 1}. Thus, E(Gint ) = Ehor (Gint ) ∪ Eup (Gint ) ∪ Eslant (Gint ). All edges in E(Gint ) have weight 1. This 2d array can be viewed as a k × (k + 2) grid, and we place terminals in this graph at the same 3k locations as in the Manhattan graph. This completes the description of Gint . Let Hint be a distance-preserving subgraph of Gint . Note that the terminals in the first and last column ensure that all horizontal edges must be part of Hint . So, both end points of every slanting edge and every upward edge included in Hint are branching vertices. Our proof strategy is as follows. We obtain from Hint a distance-preserving subgraph HMH of the Manhattan graph with nearly the same number of branching vertices. Since HMH requires Ω(k log k) branching vertices, the number of branching vertices in Gint is Ω(k log k). The transformation (Figure 5): We retain all corresponding vertices and all upward and horizontal edges of Hint in HMH . Now, Hint might include slanting edges of the form (ai,j , ai′ ,j+1 ) (where i < i′ ), but the pair p = ((i, j), (i′ , j + 1)) 6∈ E(Gbit k ). So, we accommodate such slanting edges in HMH by providing a path of weight 1 between its end points. We replace each slanting edge (ai,j , ai′ ,j+1 ) in E(Hint ) with the 0-weight edge ((i, j), (i′ , j)) (a downward edge of weight zero) in E(HMH ). Note, that the edge ((i′ , j), (i′ , j + 1)) is a horizontal edge and is already retained in E(HMH ). Thus, HMH has a path of total weight 1, namely (i, j) → (i′ , j) → (i′ , j + 1), that connects the end points of the pair p. Let Ehor (Hint ), Eup (Hint ) and Eslant (Hint ) be the horizontal, upward and slanting edges of Gint that are 16 -5 -4 -3 -2 -1 0 1 2 3 4 5 Figure 6: The interval graph Gzero for k = 5. Each non-terminal covers k + 1 = 6 terminals. part of Hint . Then, E(HMH ) = Ehor (HMH ) ∪ Eup (HMH ) ∪ Edown (HMH ), where Ehor (HMH ) = {((i, j), (i, j + 1)) : (ai,j , ai,j+1 ) ∈ Ehor (Hint )}; Eup (HMH ) = {((i1 , j), (i2 , j)) : (ai1 ,j , ai2 ,j ) ∈ Eup (Hint )}; (34) (35) Edown (HMH ) = {((i1 , j), (i2 , j)) : (ai1 ,j , ai2 ,j+1 ) ∈ Eslant (Hint )}. (36) It is straightforward to verify that HMH preserves distances between all pairs of terminals in Gbit k . However, for each slanting edge we replace, we might create a new branching vertex (for example, the vertex (i2 , j) created in Equation 36 might be a branching vertex in HMH with no corresponding branching vertex in Hint ). The number of such vertices is at most the number of slanting edges, which in turn is at most the number of branching vertices in Hint . Thus, the total number of branching vertices in HMH is at most twice the number of branching vertices in Hint (plus O(k) to account for downward edges in the last column). Using Theorem 33, the number of branching vertices in Hint is Ω(k log k), completing the proof of Theorem 26. 6 Branching Vertices versus Branching Edges In our formulation, we count the number of branching vertices (vertices with degree ≥ 3). It is also reasonable to consider the number of edges incident on non-terminal branching vertices (we refer to such edges as branching edges) as the measure of complexity. Our Ω(k log k) lower bound (Theorem 26) is clearly applicable to the number of branching edges as well. In this section, we show a separation between the number of branching vertices and the number of branching edges. In particular, we present an interval graph Gzero with k terminals, each of length zero, such that the total number of branching edges in any distance-preserving subgraph of Gzero must be Ω(k log k). However, Gzero admits a distance-preserving subgraph with O(k) branching vertices. Let us now describe Gzero . The interval representation of Gzero has k + 1 non-terminals of unit length each, and k terminals of zero length each. Let the intervals corresponding to non-terminal vertices of Gzero be {[x, x + k] : x = −k, −k + 1, . . . , 0}, Let the intervals corresponding to terminal vertices of Gzero be {[x, x] : x = −k, −k + 1, . . . , 0, 1, . . . , k} See Figure 6 for an instance of Gzero . Theorem 37. Every distance-preserving subgraph of Gzero has at least Ω(k log k) branching edges and at most O(k) branching vertices. Proof. Since the total number of vertices in Gzero is O(k), every distance-preserving subgraph of Gzero has O(k) branching vertices. Now we prove that every distance-preserving subgraph of Gzero has Ω(k log k) branching edges. 17 Fix a distance-preserving subgraph H of Gzero . Consider pairs of terminals in the set {tx : x = −k, −k + 1, . . . , −1} × {ty : y = 0, 1, . . . , k − 1}, and restrict attention to those pairs that are at distance two in Gzero , that is, covered by a common interval in I. Indeed, for every pair of integers i, j where 0 ≤ i < j ≤ k, the pair (tj−k , ti ) is at distance two in Gzero . Build an auxiliary graph P on the vertex set {1, 2, . . . , k}, where the pair (i, j) is an edge if (tj−k−1 , ti ) is at distance two. Clearly, P is a complete graph on k vertices. For every interval I ∈ I, let BI be the subgraph of P with vertex set {1, 2, . . . , k} and edge set E(BI ) = {(i, j) : (tj−k−1 , I) ∈ E(H) and (ti , I) ∈ E(H)}. One can verify that BI is a bipartite graph, and the number of non-isolated vertices in BI is at most the degree of the vertex I in H. By a result of Hansel [Han64] stated below (see also [KS67, Pip77]), the total number of isolated vertices in all BI put together is at least k log k. Thus, the total number of edges in Gzero is at least k log k. Since Gzero has only O(k) vertices, at most O(k) of these edges of H can be incident on vertices of degree at most two. It follows that H has Ω(k log k) branching edges. Lemma 38 (Hansel [Han64]). Let Kn , the complete graph on n-vertices. Let B1 , B2 , . . . , Br be bipartite S graphs on vertex set {1, 2, . . . , n}, such that i E(Bi ) = E(Kn ). Suppose the number of non-isolated vertices in Bi is ni . Then n1 + n2 + . . . + nr ≥ k log k. Acknowledgments We are grateful to Nithin Varma and Rakesh Venkat for introducing us to the problem and helping with the initial analysis of shortest paths in interval graphs, and for their comments at various stages of this work. We would also like to thank the anonymous reviewers of this paper for their helpful suggestions and comments. References [CE06] Don Coppersmith and Michael Elkin. Sparse sourcewise and pairwise distance preservers. SIAM Journal on Discrete Mathematics, 20(2):463–501, 2006. [CGH16] Yun Kuen Cheung, Gramoz Goranci, and Monika Henzinger. Graph Minors for Preserving Terminal Distances Approximately - Lower and Upper Bounds. In 43rd International Colloquium on Automata, Languages, and Programming (ICALP 2016), volume 55 of Leibniz International Proceedings in Informatics (LIPIcs), pages 131:1–131:14, Dagstuhl, Germany, 2016. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik. [CT65] James W Cooley and John W Tukey. An algorithm for the machine calculation of complex fourier series. Mathematics of computation, 19(90):297–301, 1965. [DDK+ 17] Karl Däubel, Yann Disser, Max Klimm, Torsten Mütze, and Frieder Smolny. Distancepreserving graph contractions. CoRR, abs/1705.04544, 2017. [FHW80] Steven Fortune, John Hopcroft, and James Wyllie. The directed subgraph homeomorphism problem. Theoretical Computer Science, 10(2):111–121, 1980. [FL87] Greg N Frederickson and Nancy A Lynch. Electing a leader in a synchronous ring. Journal of the ACM (JACM), 34(1):98–115, 1987. [FM95] Tomás Feder and Rajeev Motwani. Clique partitions, graph compression and speeding-up algorithms. J. Comput. System Sci., 51(2):261–272, 1995. [Gar07] Frédéric Gardi. The Roberts characterization of proper and unit interval graphs. Discrete Mathematics, 307(22):2906 – 2908, 2007. [Gup01] Anupam Gupta. Steiner points in tree metrics don’t (really) help. In Proceedings of the twelfth annual ACM-SIAM symposium on Discrete algorithms, pages 220–227. Society for Industrial and Applied Mathematics, 2001. 18 [Han64] Georges Hansel. Nombre minimal de contacts de fermature n ecessaires pour r aliser une fonction bool eenne sym etrique de n variables. CR Acad. Sci. Paris, 258(25):6037–6040, 1964. [KKN15] Lior Kamma, Robert Krauthgamer, and Huy L Nguyên. Cutting corners cheaply, or how to remove steiner points. SIAM Journal on Computing, 44(4):975–995, 2015. [KNZ14] Robert Krauthgamer, Huy Nguyên, and Tamar Zondiner. Preserving terminal distances using minors. SIAM Journal on Discrete Mathematics, 28(1):127–141, 2014. [KS67] Gyula Katona and Endre Szemerédi. On a problem of graph theory. Studia Scientiarum Mathematicarum Hungarica, 2:23–28, 1967. [KZ12] Robert Krauthgamer and Tamar Zondiner. Preserving terminal distances using minors. In Automata, Languages, and Programming, volume 7391 of Lecture Notes in Computer Science, pages 594–605. Springer Berlin Heidelberg, 2012. [LR80] Andrea S LaPaugh and Ronald L Rivest. The subgraph homeomorphism problem. Journal of Computer and System Sciences, 20(2):133–149, 1980. [PD06] Mihai Pǎtraşcu and Erik D Demaine. Logarithmic lower bounds in the cell-probe model. SIAM Journal on Computing, 35(4):932–963, 2006. [Pip77] Nicholas Pippenger. An information-theoretic method in combinatorial theory. Journal of Combinatorial Theory, Series A, 23(1):99–104, 1977. [PS89] David Peleg and Alejandro A. Schäffer. Graph spanners. Journal of Graph Theory, 13(1):99– 116, 1989. 19
8cs.DS