<<

arXiv:1601.05002v2 [cs.DM] 15 May 2016 ne h supinta h matrices deci the but that general, assumption in the undecidable is under problem this that show We uhthat such ecnie otnosaaou f(aa ta.19)san matri 1996)’s multiplicative al. solving et of Given (Babai tions. problem of 2000)’s analogue al. et continuous (Cai a consider We Abstract e fdcdn hte hr xs o-eaiereals non-negative exist there the whether examine deciding we of algebraic, lem real are entries whose dimension, O:http://dx.doi.org/10.1145/2933575.2934538 DOI: IS’16 LICS third-par for Copyrights or page. profit first for the on distributed thi citation or of full made all the or not part are of copies copies that hard provided or digital make to Permission ‡ † ∗ Copyright c fcmuig[ computing of ics Descriptors Subject [ and Categories automata hybrid matrices, commuting rithms, Keywords Problem. Tenth Hilbert’s from reduction logarit undeci by shown our hand, is other result triangular the On upper matrices. unitriangular strictly ab upper result knowledge) of our of uniqueness best the Min the (to new the a including and theorem Weyl use results, some linear-algebraic as and well as geometric Masser, and t Lindemann, notably Kronecker, most Baker, theory, number transcendental and algebraic lin for problems automata. reachability to applications have results qain;Mteaiso optn [ computing of equations; ubrtertccomputations Number-theoretic otc h Owner/Author. the contact oeso Computation of Models upre yteECgatAGM (321171). ALGAME grant ERC the by Supported (648701). AVS-ISS grant ERC the by Supported upre yteEPSRC. the by Supported u eiaiiypofrle nanme fterm from theorems of number a on relies proof decidability Our

c uy0-8 06 e ok Y USA NY, York, New 2016, 05-08, July 06AM98140-3161/7 $15.00 . . 978-1-4503-4391-6/16/07. ACM 2016 Jo¨el Ouaknine nvriyo Oxford of University xoeta arcs arxrahblt,mti loga- matrix reachability, matrix matrices, exponential k [email protected] 1 + qaematrices square ahmtclAnalysis Mathematical ovblt fMti-xoeta Equations Matrix-Exponential of Solvability i Y =1 k :Tmdadhbi oes Mathemat- models; hybrid and Timed ]: exp( † ∗ ycmoet fti okms ehnrd o l te uses other all For honored. be must work this of components ty A okfrproa rcasomuei rne ihu fee without granted is use classroom or personal for work s i omrilavnaeadta oisba hsntc and notice this bear copies that and advantage commercial t A i = ) 1 A , . . . , A C. hoyo Computation of Theory 1 ahmtclAnalysis Mathematical A , . . . , :Odnr differential Ordinary ]: k C , k l ftesame the of all , omt.Our commute. [email protected] a hybrid ear t 1 kowski- t , . . . , dability equa- x m of hms oeof hose nvriyo Oxford of University nvriyo Oxford of University muyPouly Amaury ae Worrell James dable prob- [email protected] out ful ]: k d , rpit ieso.A swl-nw,i ahlcto the location solution each in form well-known, is As dimension. propriate xoeta ersnaino h form the of representation exponential ytm ste r sdi h hsclsine n enginee 2015). and sciences (Alur physical e.g., the see, in cyber-phy used and are contin they systems as automata, dynamical systems hybrid linear linear chains, Markov including time models, the of in arise range objects a such continuously equations; evolve differential that linear to systems o paper, from this originates In machines. tivation Turing exampl for best-known Problem Halting the the of ing one verification, and theoreti science of staple puter fundamental a are problems Reachability Introduction 1. 1 etro otnosvrals and variables, continuous of vector osm ierdfeeta qaino h form ac the location of equation each differential linear in some evolve to interest prope of the variables having states), continuous control (or locations discrete of eeso h otnosvralswe rniinn betw transitioning when variables continuous the of resets fasse vle hog eisof a through evolves system a if matrix iwda iertasomto on transformation linear a as viewed feto h nta otnoscngrto sgvnb th by given is configuration continuous initial the on effect k osdrtefloigpolm,wihcnb ena discre paper. this as in seen with deal be we can question the which of problems, analogues following the Consider Work Related 1.1 by achieved be thus can bein ar transformations systems. then data linear questions of relevant Natural kinds location. only what each the in spent immaterial, on time th is visited total which are times) in they several order whether the indeed or that (or show visited can are one locations cases, such in commute; ilctv eiru eeae by generated semigroup tiplicative hs nre r leri,de h matrix the does algebraic, are entries whose D nti oiaigeape eaeasmn htteeaeno are there that assuming are we example, motivating this In EFINITION 1 + oepeiey osdrasse ossigo nt numb finite a of consisting system a consider precisely, More atclryitrsigstainaie hntematri the when arises situation interesting particularly A ⋆ † qaematrices square A i n pnigtime spending and , Mti eiru ebrhpProblem). Membership Semigroup (Matrix 1 x ( t ) otedfeeta qainamt matrix- a admits equation differential the to A 1 i Y =1 A , . . . , k exp( t i Jo˜ao Sousa-Pinto ≥ k A nvriyo Oxford of University [email protected] A A C , i 0 x t 1 sasur rt’mti fap- of matrix ‘rate’ square a is i A , . . . , nec oain h overall the location, each in x l ftesm dimension, same the of all , (0) ) k , ( t oain,ec ihrate with each locations, . exp( = ) 1 C k x ˙ ? eogt h mul- the to belong = e locations. een A At x ⋆ ) here ; x nlssof analysis t htthe that rty ‡ (0) a com- cal matrix e s sto as ise cording yonce ly subject discrete ces rmo- ur Given ring— closed Thus . sbe- es uous- x the g sical such sa is A er te e i DEFINITION 2 (Solvability of Multiplicative Matrix Equations). DEFINITION 5. An instance of the Linear-Exponential Problem Given k + 1 square matrices A1,...,Ak,C, all of the same di- (LEP) consists of a system of equations mension, whose entries are algebraic, does the equation (j) k exp λi ti = cj exp(dj ) (j ∈ J), (2) n i i∈I ! Ai = C X i=1 (j) Y where I and J are finite index sets, the λi , cj and dj are complex admit any solution n1,...,nk ∈ N? algebraic constants, and the ti are complex variables, together with a polyhedron P ⊆ R2k that is specified by a system of In general, both problems have been shown to be undecid- linear inequalities with algebraic coefficients. The problem asks to able, in (Paterson 1970) and (Bell et al. 2008), by reductions from determine whether there exist t ,...,tk ∈ C that satisfy the system Post’s Correspondence Problem and Hilbert’s Tenth Problem, re- 1 (2) and such that (Re(t1),..., Re(tk), Im(t1),..., Im(tk)) lies spectively. in P. When the matrices A1,...,Ak commute, these problems are identical, and known to be decidable, as shown in (Babai et al. To establish decidability of the Linear-Exponential Problem, we 1996), generalising the solution of the matrix powering problem, reduce it to the following Algebraic-Logarithmic Integer Program- shown to be decidable in (Kannan and Lipton 1986), and the case ming problem. Here a linear form in of algebraic num- with two commuting matrices, shown to be decidable in (Cai et al. bers is a number of the form β0 + β1 log(α1)+ · · · + βm log(αm), 2000). where β0, α1, β1,...,αm, βm are algebraic numbers and log de- See (Halava 1997) for a relevant survey, and (Choffrut and Karhum¨aki notes a fixed branch of the complex function. 2005) for some interesting related problems. The following continuous analogue of (Kannan and Lipton DEFINITION 6. An instance of the Algebraic-Logarithmic Integer 1986)’s Orbit Problem was shown to be decidable in (Hainry 2008): Programming Problem (ALIP) consists of a finite system of equa- tions of the form DEFINITION 3 (Continuous Orbit Problem). Given an n × n ma- 1 trix with algebraic entries and two -dimensional vectors x y Ax ≤ b A n , π with algebraic coordinates, does there exist a non-negative real t such that exp(At)x = y? where A is an m × n matrix with real algebraic entries and where the coordinates of b are real linear forms in logarithms of algebraic The paper (Chen et al. 2015) simplifies the argument of (Hainry numbers. The problem asks to determine whether such a system n 2008) and shows polynomial-time decidability. Moreover, a con- admits a solution x ∈ Z . tinuous version of the Skolem-Pisot problem was dealt with in (Bell et al. 2010), where a decidability result is presented for some 1.3 Paper Outline instances of the problem. After introducing the main mathematical techniques that are used As mentioned earlier, an important motivation for our work in the paper, we present a reduction from the Generalised Ma- comes from the analysis of hybrid automata. In addition to (Alur trix Exponential Problem with commuting matrices to the Linear- 2015), excellent background references on the topic are (Henzinger et al. Exponential Problem, as well as a reduction from the Linear- 1995; Henzinger 1996). Exponential Problem to the Algebraic-Logarithmic Integer Pro- gramming Problem, before finally showing that the Algebraic- 1.2 Decision Problems Logarithmic Integer Programming Problem is decidable. By way We start by defining three decision problems that will be the main of hardness, we will prove that the Matrix-Exponential Problem object of study in this paper: the Matrix-Exponential Problem, is undecidable (in the non-commutative case), by reduction from the Linear-Exponential Problem, and the Algebraic-Logarithmic Hilbert’s Tenth Problem. Integer Programming problem. 2. Mathematical Background DEFINITION 4. An instance of the Matrix-Exponential Problem 2.1 Number Theory and Diophantine Approximation (MEP) consists of square matrices A1,...,Ak and C, all of the same dimension, whose entries are real algebraic numbers. A number α ∈ C is said to be algebraic if there exists a non-zero The problem asks to determine whether there exist real numbers polynomial p ∈ Q[x] for which p(α) = 0. A that t1,...,tk ≥ 0 such that is not algebraic is said to be transcendental. The monic polynomial k p ∈ Q[x] of smallest degree for which p(α) = 0 is said to be the minimal polynomial of α. The set of algebraic numbers, exp(Aiti)= C . (1) denoted by Q, forms a field. Note that the complex conjugate i=1 Y of an algebraic number is also algebraic, with the same minimal polynomial. It is possible to represent and manipulate algebraic We will also consider a generalised version of this problem, numbers effectively, by storing their minimal polynomial and a called the Generalised MEP, in which the matrices A1,...,Ak sufficiently precise numerical approximation. An excellent course and C are allowed to have complex algebraic entries and in which (and reference) in computational algebraic number theory can be the input to the problem also mentions a polyhedron P ⊆ R2k that found in (Cohen 1993). Efficient algorithms for approximating is specified by linear inequalities with real algebraic coefficients. In algebraic numbers were presented in (Pan 1996). m the generalised problem we seek t1,...,tk ∈ C that satisfy (1) and Given a vector λ ∈ Q , its of multiplicative relations is such that the vector (Re(t1),..., Re(tk), Im(t1),..., Im(tk)) defined as lies in P. m v L(λ)= {v ∈ Z : λ = 1}. In the case of commuting matrices, the Generalised Matrix- Exponential Problem can be analysed block-wise, which leads us Moreover, letting log represent a fixed branch of the complex to the following problem: logarithm function, note that log(α1),..., log(αm) are linearly independent over Q if and only if 2.2 Lattices r×d r L(α1,...,αm)= {0}. Consider a non- K ∈ Q and vector k ∈ Q . The following proposition shows how to compute a representation of Being a subgroup of the free finitely generated abelian group the affine lattice {x ∈ Zd : Kx = k}. Further information Zm, the group λ is also free and admits a finite basis. L( ) about lattices can be found in (Micciancio and Goldwasser 2002) The following theorem, due to David Masser, allows us to and (Cohen 1993). effectively determine L(λ), and in particular decide whether it is d d×s equal to {0}. This result can be found in (Masser 1988). PROPOSITION 1. There exist x0 ∈ Z and M ∈ Z , where s

2. σ(Ai ↾Vλ )= {λi}. solving linear programming, before more efficient procedures such n 3. C = Vλ. as the simplex algorithm were discovered. The procedure consists λ∈Σ in isolating one variable at a time and matching all its lower and L upper bounds. Note that this method preserves the set of solutions Proof. We show, by induction on k, that the subspaces Vλ satisfy on the remaining variables, so a solution of the reduced system can the properties above. always be extended to a solution of the original one. When k = 1, the result follows from the existence of Jor- dan Canonical Forms. When k > 1, suppose that σ(Ak) = THEOREM 11. By using Fourier-Motzkin elimination, it is decid- n n {µ1,...,µm}, and let Uj = ker(Ak −µj I) , for j ∈ {1,...,m}. able whether a given convex polyhedron P = {x ∈ R : πAx < Again, it follows from the existence of Jordan Canonical Forms that b}, where the entries of A are all real algebraic numbers and those m of b are real linear forms in logarithms of algebraic numbers, is n C = Um. empty. Moreover, if P is non-empty one can effectively find a ratio- j=1 nal vector q ∈P. M In what follows, i ∈ {1,...,k − 1} and j ∈ {1,...,m}. Now, as Proof. When using Fourier-Motzkin elimination, isolate each Ak and Ai commute, so do (Ak − µj I) and Ai. Therefore, for all term πxi, instead of just isolating the variable xi. Note that the n n v ∈Uj , (Ak − µj I) Aiv = Ai(A − µj I) v = 0, so Aiv ∈Uj , coefficients of the terms πxi will always be algebraic, and the loose constants will always be linear forms in logarithms of alge- By Theorem 6 we can write Cn as a direct sum of subspaces n b braic numbers, which are closed under multiplication by algebraic C = ⊕j=1Vj such that for every subspace Vj and matrix Ai, Vj numbers, and which can be effectively compared by using Baker’s is an invariant subspace of Ai on which Ai has a single eigenvalue Theorem.  (j) λi . Define a matrix Q by picking an algebraic basis for each Vj and 3. Example successively taking the vectors of each basis to be the columns of −1 ¯ Q. Then, each matrix Q AiQ is block-diagonal, where the j-th Let λ1,λ2 ∈ R ∩ Q such that λ1 >λ2 and consider the following (j) commuting matrices R Q¯ 2×2: block is a matrix Bi that represents Ai ↾ Vj , j = 1,...,b. A1,A2 ∈ ( ∩ ) (j) (j) Fixing j ∈ {1,...,b}, note that the matrices B1 ,...,Bk all commute. Thus we may apply Theorem 7 to obtain an algebraic λi 1 −1 (j) Ai = , i ∈ {1, 2}. matrix j such that each matrix j is upper triangular, 0 λi M Mj Bi M   i = 1,...,k. Thus we can write One can easily see that −1 (j) (j) (j) Mj Bi Mj = λi I + Ni exp(Aiti) = exp(λitiI) exp(ti(Ai − λiI)) (j) 0 ti for some strictly upper triangular matrix Ni . = exp(λiti)exp 0 0 We define M to be the block- with blocks −1   M1,...,Mb. Letting P = QM, it is then the case that P AiP 1 ti (j) (j) = exp(λiti) , i ∈ {1, 2}. 0 1 is block-diagonal, with the j-th block being λi I + Ni for   j = 1,...,b. Now ¯ Let c1, c2 ∈ R ∩ Q such that c1, c2 > 0, and let k k −1 −1 c c exp(Aiti)= C ⇔ exp(P AiPti)= P CP. (3) C = 1 2 . 0 c1 i=1 i=1   Y Y We would like to determine whether there exists a solution If P −1CP is not block-diagonal, with each block being up- t1,t2 ∈ R, t1,t2 ≥ 0 to per triangular and with the same entries along the diagonal, then Equation (3) has no solution and the problem instance must be exp(A t )exp(A t )= C 1 1 2 2 negative. Otherwise, denoting the blocks P −1CP by D(j) for This amounts to solving the following system of equations: j ∈ {1,...,b}, our problem amounts to simultaneously solving the system of matrix equations exp(λ1t1 + λ2t2)= c1 ⇔ k ((t1 + t2) exp(λ1t1 + λ2t2)= c2 (j) (j) (j) exp λi I + Ni ti = D , j ∈ {1,...,b} (4) c2 exp(t1(λ1 − λ2)+ λ2)= c1 i=1 c1 ⇔ Y   t = c2 − t with one equation for each block. ( 2 c1 1 (j) c2 log(c1)− λ2 For each fixed j, the matrices Ni inherit commutativity from c1 (j) t1 = λ1−λ2 the matrices B , so we have c2 i λ1−log(c1)  c1 k k t2 = λ1−λ2  (j) (j) (j) (j) exp((λi I + Ni )ti) = exp (λi I + Ni )ti Then t1,t2 ≥ 0 holds if and only if  i=1 i=1 c1 Y X  λ2 ≤ log(c1) ≤ λ1. k k c2 (j) (j) = exp λi ti · exp Ni ti . Whether these inequalities hold amounts to comparing linear i=1 i=1 forms in logarithms of algebraic numbers. X  X  Hence the system (4) is equivalent to

k k 4. Decidability in the Commutative Case (j) (j) (j) exp λi ti · exp Ni ti = D (5) We start this section by reducing the Generalised MEP with com- i=1 i=1 muting matrices to LEP. The intuition behind it is quite simple: X  X  for . perform a change of basis so that the matrices A ,...,Ak, as well j = 1,...,b 1 (j) as C, become block-diagonal matrices, with each block being up- By assumption, the diagonal entries of each matrix D are j per triangular; we can then separate the problem into several sub- equal to a unique value, say c( ). Since the diagonal entries of instances, corresponding to the diagonal blocks, and finally make k (j) exp i=1 N ti are all 1, the equation system (5) is equivalent use of our uniqueness result concerning strictly upper triangular to: logarithms of upper unitriangular matrices. P  k k (j) (j) (j) 1 (j) THEOREM 12. The Generalised MEP with commuting matrices exp λ ti = c and exp N ti = D i i c(j) reduces to LEP. i=1 i=1 X  X  Proof. Consider an instance of the generalised MEP, as given in for j = 1,...,b. Applying Theorem 5, the above system can equivalently be Definition 4, with commuting n×n matrices A ,...,A and target 1 k written matrix C. We first show how to define a matrix P such that each matrix k k −1 (j) (j) (j) (j) P AiP is block diagonal, i = 1,...,k, with each block being exp λi ti = c and Ni ti = S moreover upper triangular. i=1 i=1 X  X for some effectively computable matrix S(j) with algebraic entries, appearing therein, using Masser’s Theorem. For example, suppose j = 1,...,b. that Except for the additional linear equations, this has the form of bi = r + r log(s )+ · · · + r log(s ),r ,r ,s ,...,r ,s ∈ Q. an instance of LEP. However we can eliminate the linear equations 0 1 1 k k 0 1 1 k k by performing a linear change of variables, i.e., by computing the Due to Baker’s theorem, there exists a non-trivial linear relation solution of the system in parametric form. Thus we finally arrive at with algebraic coefficients amongs log(−1), log(s1),..., log(sk) an instance of LEP.  if and only if there is one with integer coefficients. But such rela- In the following result, we essentially solve the system of equa- tions can be computed, since tions 2, reducing it to the simpler problem that really lies at its n log(−1) + n log(s )+ · · · + n log(s ) = 0 ⇔ heart. 0 1 1 k k n0 n1 nk (−1) s1 · · · sk = 1 THEOREM 13. LEP reduces to ALIP. and since the group of multiplicative relations L(−1,s1,...,sk) Proof. Consider an instance of LEP, comprising a system of can be effectively computed. Whenever it contains a non-zero vec- equations tor, we use it to eliminate an unnecessary log(si) term, although k never eliminating log(−1). When this process is over, we can see (j) whether each term bi/π is algebraic or transcendental: it is alge- exp λ tℓ = cj exp(dj ) j = 1,...,b, (6) ℓ braic if Q, and transcendental otherwise. ℓ=1 ! bi = α log(−1), α ∈ X Now, when x ∈ Zd, Ax is a vector with algebraic coefficients, R2k and polyhedron P ⊆ , as described in Definition 5. so whenever bi/π is transcendental we may alter P by replacing ≤ Throughout this proof, let log denote a fixed logarithm branch by < in the i-th inequality, preserving its intersection with Zd. On that is defined on all the numbers cj , exp(dj ) appearing above, and the other hand, whenever bi/π is algebraic, we split our problem for which log(−1) = iπ. Note that if any cj = 0 for some j then into two: in the first one, P is altered to force equality on the i-th (6) has no solution. Otherwise, by applying log to each equation in constraint (that is, replacing ≤ by =), and in the second we force (6), we get: strict inequality (that is, replacing ≤ by <). We do this for all i, so k that no ≤ is left in any problem instance, leaving us with finitely (j) λℓ tℓ = dj + log(cj ) + 2iπnj j = 1,...,b, (7) many polyhedra, each defined by equations of the form ℓ=1 d X Kx = k (k ∈ Q 1 ) where nj ∈ Z. d2 The system of equations (7) can be written in matrix form as Mx < m (m ∈ Q ) d3 At ∈ d + log(c) + 2iπZb , F x < f (f ∈ R \ Q ) (j) where K,M,F are matrices with algebraic entries. Before pro- where A is the b × k matrix with Aj,ℓ = λℓ and log is applied pointwise to vectors. Now, defining the convex polyhedron Q ⊆ ceeding, we eliminate all such empty polyhedra; note that empti- R2b by ness can be decided via Fourier-Motzkin elimination, as shown in Theorem 11. k Q = {(Re(Ay), Im(Ay)) : y ∈ C , (Re(y), Im(y)) ∈ P} , The idea of the next step is to reduce the dimension of all the problem instances at hand until we are left with a number it suffices to decide whether the affine lattice d + log(c) + 2iπZb of new instances with full-dimensional open convex polyhedra, intersects x Cb x x . { ∈ : (Re( ), Im( )) ∈ Q} of the same form as the original one, apart from the fact that all Define f : Rb → Cb by f(v)= d + log(c) + 2iπv, and define b inequalities in their definitions will be strict. To do that, we use a convex polyhedron T ⊆ R by the equations Kx = k to eliminate variables: note that, whenever T = {v ∈ Rb : (Re(f(v)), Im(f(v))) ∈ Q} . there is an integer solution, d The problem then amounts to deciding whether the convex Kx = k, x ∈ Z ⇔ x = x0 + Mz, polyhedron T intersects contains an integer point. Crucially, the where M is a matrix with integer entries, x0 is an integer vector description of the convex polyhedron T is of the form πBx ≤ b, and z ranges over integer vectors over a smaller dimension space, for some matrix B and vector b such that the entries of B are wherein we also define the polyhedron real algebraic and the components of b are real linear forms in logarithms of algebraic numbers. But this is the form of an instance Q = {y : x0 + My ∈ P}. of ALIP.  Having now eliminated all equality constraints, we are left with We are left with the task of showing that ALIP is decidable. The a finite set of polyhedra of the form P = {x ∈ Rd : πAx < b} argument essentially consists of reducing to a lower-dimensional that are either empty or full-dimensional and open, and wish to de- instance whenever possible, and eventually either using the fact that cide whether they intersect the integer lattice of the corresponding the polyhedron is bounded to test whether it intersects the integer space (different instances may lie in spaces of different dimensions, lattice or using Kronecker’s theorem to show that, by a density of course). Note that, when P is non-empty, we can use Fourier- argument, it must intersect the integer lattice. d Motzkin elimination to find a vector q ∈ Q in its interior, and THEOREM 14. ALIP is decidable. ε > 0 such that the l1 closed ball of radius ε and centre q, which we call B, is contained in P. Proof. We are given a convex polyhedron P = {x ∈ Rd : The next step is to consider the Minkowski-Weyl decomposition πAx ≤ b}, where the coordinates b are linear forms in logarithms of P, namely P = H + C, where H is the convex hull of finitely of algebraic numbers, and need to decide whether this polyhedron many points of P (which we need not compute) and C = {x ∈ intersects Zd. Throughout this proof, log denotes the logarithm Rd : Ax ≤ 0} is a cone with an algebraic description. Note that branch picked at the beginning of the proof of Theorem 13. We P is bounded if and only if C = {0}, in which case the problem start by eliminating linear dependencies between the logarithms at hand is simple: consider the polyhedron Q with an algebraic description obtained by rounding up each coordinate of b/π, which A class of constraints E ⊆EπZ ∪E+ ∪E× induces a generali- has the same conic part as P and which contains P, and therefore sation of the MEP problem as follows: is bounded; finally, compute a bound on Q (such a bound can be DEFINITION 9 (MEP with Constraints). Given a class of con- defined in the first-order theory of reals), which is also a bound on straints E ⊆E Z ∪E ∪E , the problem MEP(E) is as follows. P, and test the integer points within that bound for membership in π + × An instance consists of real algebraic matrices A ,...,A ,C and P. Otherwise, 1 k a finite set of constraints E ⊆ E on real variables t1,...,tk. C = {λ1c1 + · · · + λkck : λ1,...,λk ≥ 0}, The question is whether there exist non-negative real values for k Aiti d t1,...,tk such that i=1 e = C and the constraints E are all where c1,..., ck ∈ Q are the extremal rays of C. Note that satisfied. q + C⊆P and that B + C⊆P. Q Now we consider a variation of an argument which appears in Note that in the above definition of MEP(E) the set of con- (Khachiyan and Porkolab 1997). Consider the computable set straints E only mentions real variables t1,...,tk appearing in the matrix equation k eAiti = C. However, without loss of gen- k i=1 ⊥ d erality, we can allow constraints to mention fresh variables ti, for L = C ∩ Z = A(ci), i>k, since we canQ always define a corresponding matrix Ai = 0 i=1 A t \ for such variables for then e i i = I has no effect on the matrix where A(v) denotes the group of additive relations of v. product. In other words, we effectively have constraints in E with If L = {0} then due to Kronecker’s theorem on simultaneous existentially quantified variables. In particular, we have the follow- Diophantine approximation it must be the case that there exists a ing useful observations: k vector (n1,...,nk) ∈ N such that • We can express inequality constraints of the form ti 6= α in k by using fresh variables . Indeed is d E+ ∪ E× tj ,tℓ ti 6= α dist q + nici, Z ≤ ε, satisfied whenever there exist values of tj and tℓ such that i=1 ! X ti = tj + α and tj tℓ = 1. d and we know that P ∩ Z 6= ∅ from the fact that the l1 closed ball • By using fresh variables, E+ ∪ E× can express polynomial B of radius ε and centre q is contained in P. constraints of the form P (t1,...,tn) = t for P a polynomial On the other hand, if L 6= {0}, let z ∈L\{0}. Since H is a with integer coefficients. bounded subset of Rn, the set We illustrate the above two observations in an example. {zT x : x ∈ P} = {zT x : x ∈ H} EXAMPLE 1. Consider the problem, given matrices A1,A2 and C, is a bounded subset of R. Therefore there exist a,b ∈ Z such that to decide whether there exist t1,t2 ≥ 0 such that T A1t1 A2t2 2 ∀x ∈P,a ≤ z x ≤ b, e e = C and t1 − 1= t2,t2 6= 0 . so we can reduce our problem to b − a + 1 smaller-dimensional This is equivalent to the following instance of MEP(E+ ∪ E×): T instances by finding the integer points of {x ∈P : z x = i}, for decide whether there exist t1,...,t5 ≥ 0 such that i ∈ {a,...,b}. Note that we have seen earlier in the proof how to 5 reduce the dimension of the ambient space when the polyhedron P Aiti e = C and t1t1 = t3,t3 − 1= t2,t2t4 = t5,t5 = 1  is contained in an affine hyperplane. i=1 Y where A1,A2 and C are as above and A3 = A4 = A5 = 0. 5. Undecidability of the Non-Commutative Case We will make heavy use of the following proposition to combine In this section we show that the Matrix-Exponential Problem is several instances of the constrained MEP into a single instance by undecidable in the case of non-commuting matrices. We show combining matrices block-wise. undecidability for the most fundamental variant of the problem, as PROPOSITION 2. Given real algebraic matrices A1,...,Ak,C given in Definition 4, in which the matrices have real entries and ′ ′ ′ ′′ ′′ and A1,...,Ak,C , there exist real algebraic matrices A1 ,...,Ak , the variables ti range over the non-negative reals. Recall that this ′′ problem is decidable in the commutative case by the results of the C such that for all t1,...,tk: previous section. k k k ′′ ′ eAi ti = C′′ ⇔ eAiti = C ∧ eAiti = C′. 5.1 Matrix-Exponential Problem with Constraints i=1 i=1 i=1 Y Y Y The proof of undecidability in the non-commutative case is by reduction from Hilbert’s Tenth Problem. The reduction proceeds Proof. Define for any i ∈ {1,...,k}: via several intermediate problems. These problems are obtained by ′′ Ai 0 ′′ C 0 augmenting MEP with various classes of arithmetic constraints on Ai = ′ , C = ′ . 0 Ai 0 C the real variables that appear in the statement of the problem.     The result follows because the matrix exponential can be computed DEFINITION 8. We consider the following three classes of arith- block-wise (as is clear from its definition): metic constraints over real variables t1,t2,...: k k A t k A t ′′ e i i 0 e i i 0 • Z Z Ai ti i=1 Eπ comprises constraints of the form ti ∈ α + βπ , where α e = A′ t = k ′ . −1 0 e i i 0 eAiti and β 6= 0 are real-valued constants such that cos(2αβ ), β i=1 i=1   Q i=1  are both algebraic numbers. Y Y Q  • E+ comprises linear equations of the form α1t1 +. . .+αntn = We remark that in the statement of Proposition 2 the two ma- α0, for α0,...,αn real algebraic constants. trix equations that are combined are over the same set of variables. • E× comprises equations of the form tℓ = titj . However, we can clearly combine any two matrix equations for which the common variables appear in the same order in the re- for matrices spective products. 0 0 −1 0 0 0 The core of the reduction is to show that the constraints in B1 = 0 0 0 B2 = 0 0 −1 EπZ, E+ and E× do not make the MEP problem harder: one can 0 0 0  0 0 0  always encode them using the matrix product equation.  0 1 0   0 0 0  PROPOSITION 3. MEP(EπZ ∪E+ ∪E×) reduces to MEP(E+ ∪E×). B3 = 0 0 0 B4 = 0 0 1 0 0 0 0 0 0

Proof. Let A1,...,Ak,C be real algebraic matrices and E ⊆ 0 −1 0   B5 = 0 0 0 EπZ ∪E+ ∪E× a finite set of constraints on t1,...,tk. Since E is   finite it suffices to show how to eliminate from E each constraint 0 0 0 in EπZ. Thus the constraint xy = z can be expressed as Z Z Let tj ∈ α + βπ be a constraint in E. By definition of Eπ we ′ ′ have that cos(2αβ−1), sin(2αβ−1) and β 6= 0 are real algebraic. eB1zeB2y eB3xeB4yeB5z = I . (8) Now define the following extra matrices: Again, we can apply Proposition 2 to combine the equation (8) 0 2β−1 cos(2αβ−1) sin(2αβ−1) with the matrix equation from the original problem instance and A′ = ,C′ = . j −2β−1 0 − sin(2αβ−1) cos(2αβ−1) thus encode the constraint x = yz.     ′ ′  Our assumptions ensure that Aj and C are both real algebraic. We now have the following chain of equivalences: PROPOSITION 5. MEP(E+) reduces to MEP. ′ −1 −1 Aj tj ′ cos(2tj β ) sin(2tj β ) ′ e = C ⇔ −1 −1 = C Proof. Let A1,...,Ak,C be real algebraic matrices and E ⊆ − sin(2tj β ) cos(2tj β )   E+ a set of constraints. We proceed as above, showing how to −1 −1 ⇔ cos(2tj β ) = cos(2αβ ) eliminate each constraint from E that lies in E+, while preserving −1 −1 the set of solutions of the instance. ∧ sin(2tj β ) = sin(2αβ ) k Let β + i=1 αiti = 0 be an equation in E. Recall that −1 −1 ′ ′ ⇔ 2β tj = 2αβ mod 2π β, α1,...,αk are real algebraic. Define the extra matrices A1,...,Ak and C′ as follows:P ⇔ tj ∈ α + βπZ. ′ ′ 0 αi ′ 1 −β Aj tj ′ A = , C = . Thus the additional matrix equation e = C is equivalent to i 0 0 0 1 the constraint tj ∈ α + βπZ. Applying Proposition 2 we can thus     ′ ′ ′ eliminate this constraint.  Our assumptions ensure that A1,...,Ak and C are all real alge- braic. Furthermore, the following extra product equation becomes: PROPOSITION 4. MEP(E+ ∪E×) reduces to MEP(E+). k k A′ t 1 αiti 1 −β Proof. Let A1,...,Ak,C be real algebraic matrices and E ⊆ e i i = C ⇔ = 0 1 0 1 E+ ∪E× a finite set of constraints on variables t1,...,tk. We pro- i=1 i=1 Y Y     ceed as above, showing how to remove from E each constraint from k . In so doing we potentially increase the number of matrices and E× ⇔ αiti = −β . add new constraints from E+. i=1 Let tl = titj be an equation in E. To eliminate this equation X ′ ′  the first step is to introduce fresh variables x,x ,y,y ,z and add the constraints Combining Propositions 3, 4, and 5 we have: ti = x, tj = y, tℓ = z, PROPOSITION 6. MEP(EπZ ∪E+ ∪E×) reduces to MEP. which are all in E+. We now add a new matrix equation over the fresh variables x,x′,y,y′,z that is equivalent to the constraint 5.2 Reduction from Hilbert's Tenth Problem xy = z. Since this matrix equation involves a new set of variables THEOREM 15. MEP is undecidable in the non-commutative case. we are free to the set the order of the matrix products, which is crucial to express the desired constraint. Proof. We have seen in the previous section that the problem The key gadget is the following matrix product equation, which MEP(EπZ ∪E+ ∪E×) reduces to MEP without constraints. Thus it ′ ′ holds for any x,x ,y,y ,z > 0: suffices to reduce Hilbert’s Tenth Problem to MEP(EπZ ∪E+ ∪E×). In fact the matrix equation will not play a role in the target of this 1 0 −z 1 0 0 1 x 0 reduction, only the additional constraints. 0 1 0 0 1 −y′ 0 1 0       Let P be a polynomial of total degree d in k variables with 0 0 1 0 0 1 0 0 1 integer coefficients. From P we build a homogeneous polynomial  1 0 0 1 −x′  0 1 x − x′ z − xy Q, by adding a new variable λ: ′ × 0 1 y 0 1 0 = 0 1 y − y . d x1 xk       Q(x,λ)= λ P ,..., . 0 0 1 0 0 1 0 0 1 λ λ   Notice that each of the matrices on the left-hand side of the Note that Q still has integer coefficients. Furthermore, we have the above equation has a single non-zero off-diagonal entry. Crucially relationship each matrix of this form can be expressed as an exponential. Indeed Q(x, 1) = P (x). we can write the above equation as a matrix-exponential product As we have seen previously, it is easy to encode Q with con- ′ straints, in the sense that we can compute a finite set of constraints ′ ′ 1 x − x z − xy B1z B2y B3x B4y B5x ′ e e e e e = 0 1 y − y EQ ⊆ E+ ∪E× mentioning variables t0,...,tm,λ such that E   0 0 1 is satisfied if and only if t0 = Q(t1,...,tk,λ). Note that EQ   may need to mention variables other than t1,...,tk to do that. An- A. Baker. Transcendental Number Theory. Camb. Univ. Press, 1975. other finite set of equations EπZ ⊆ EπZ is used to encode that A. Baker and G. W¨ustholz. Logarithmic forms and group varieties. Jour. t1,...,tk,λ ∈ πZ. Finally, E= ⊆ E+ ∪ E× is used to encode Reine Angew. Math., 442, 1993. t0 = 0 and 1 6 λ 6 4. The latter is done by adding the polynomial S. Basu, R. Pollack, and M.-F. Roy. Algorithms in Real Algebraic Geome- 2 2 equations λ =1+ α and λ = 4 − β for some α and β. Finally try. Springer, 2nd edition, 2006. we have the following chain of equivalences: P. Bell, V. Halava, T. Harju, J. Karhum¨aki, and I. Potapov. Matrix equations ∃t0,...,λ > 0 s.t. EQ ∪ EπZ ∪ E= is satisfied and Hilbert’s Tenth Problem. IJAC, 18(8):1231–1241, 2008. P. C. Bell, J. Delvenne, R. M. Jungers, and V. D. Blondel. The continuous ⇔∃t1,...,λ > 0 s.t. 0= Q(t1,...,tk,λ) Skolem-Pisot problem. Theor. Comput. Sci., 411(40-42):3625–3634, ∧ t1,...,tk,λ ∈ πZ ∧ 1 6 λ 6 4 2010.

⇔∃n1,...,nk ∈ N s.t. 0= Q(πn1,...,πnk,π) J.-Y. Cai, R. J. Lipton, and Y. Zalcstein. The complexity of the A B C d problem. SIAM J. Comput., 29(6), 2000. ⇔∃n1,...,nk ∈ N s.t. 0= π Q(n1,...,nk, 1) J. W. S. Cassels. An introduction to Diophantine approximation. Camb. ⇔∃n1,...,nk ∈ N s.t. 0= P (n1,...,nk). Univ. Pr., 1965. T. Chen, N. Yu, and T. Han. Continuous-time orbit problems are decidable in polynomial-time. Inf. Process. Lett., 115(1):11–14, 2015.  C. Choffrut and J. Karhum¨aki. Some decision problems on integer matrices. ITA, 39(1):125–131, 2005. 6. Conclusion H. Cohen. A Course in Computational Algebraic Number Theory. Springer- We have shown that the Matrix-Exponential Problem is undecid- Verlag, 1993. able in general, but decidable when the matrices A1,...,Ak com- W. J. Culver. On the existence and uniqueness of the real logarithm of a mute. This is analogous to what was known for the discrete version matrix. Proc. Amer. Math. Soc., 17:1146–1151, 1966. At of this problem, in which the matrix exponentials e are replaced E. Hainry. Reachability in linear dynamical systems. In Logic and Theory by matrix powers An. of Algorithms, 4th Conference on Computability in Europe, CiE 2008, A natural variant of this problem is the following: Athens, Greece, June 15-20, 2008, Proceedings, pages 241–250, 2008. DEFINITION 10 (Matrix-Exponential Semigroup Problem). Given V. Halava. Decidable and undecidable problems in matrix theory. 1997. square matrices A1,...,Ak and C, all of the same dimension and G. H. Hardy and E. M. Wright. An Introduction to the Theory of Numbers. all with real algebraic entries, is C a member of the matrix semi- Oxford University Press, 1938. group generated by B. W. Helton. Logarithms of matrices. Proc. Amer. Math. Soc., 19:733–738, 1968. {exp(Aiti) : ti ≥ 0, i = 1,...,k}? T. A. Henzinger. The theory of hybrid automata. In Proceedings, 11th An- When the matrices A1,...,Ak all commute, the above problem nual IEEE Symposium on Logic in Computer Science, New Brunswick, is equivalent to the Matrix-Exponential Problem, and therefore New Jersey, USA, July 27-30, 1996, pages 278–292, 1996. decidable. In the non-commutative case, the following result holds: T. A. Henzinger, P. W. Kopke, A. Puri, and P. Varaiya. What’s decidable about hybrid automata? In Proceedings of the Twenty-Seventh Annual ACM Symposium on Theory of Computing, 29 May-1 June 1995, Las THEOREM 16. The Matrix-Exponential Semigroup Problem is un- Vegas, Nevada, USA, pages 373–382, 1995. decidable. R. Kannan and R. J. Lipton. Polynomial-time algorithm for the orbit A proof will appear in a future journal version of this paper. This problem. J. ACM, 33(4):808–821, 1986. can be done by reduction from the Matrix-Exponential Problem, L. Khachiyan and L. Porkolab. Computing integral points in convex semi- using a set of gadgets to force a desired order in the multiplication algebraic sets. In FOCS, pages 162–171, 1997. of the matrix exponentials. D. W. Masser. Linear relations on algebraic groups. In New Advances in It would also be interesting to look at possibly decidable re- Transcendence Theory. Camb. Univ. Press, 1988. strictions of the MEP/MESP, for example the case where k = 2 Y. Matiyasevich. Hilbert’s 10th Problem. MIT Press, 1993. with a non-commuting pair of matrices, which was shown to be D. Micciancio and S. Goldwasser. Complexity of Lattice Problems: a cryp- decidable for the discrete analogue of this problem in (Bell et al. tographic perspective, volume 671 of The Kluwer International Series 2008). Bounding the dimension of the ambient vector space could in Engineering and Computer Science. Kluwer Academic Publishers, also yield decidability, which has been partly accomplished in Boston, Massachusetts, 2002. the discrete case in (Choffrut and Karhum¨aki 2005). Finally, upper M. Newman. Two classical theorems on commuting matrices. Journal bounding the complexity of our decision procedure for the commu- of research of the National Bureau of Standards - B. Mathematics and tative case would also be a worthwhile task. Mathematical Physics, 71 B(2, 3), 1967. V. Pan. Optimal and nearly optimal algorithms for approximating polyno- Acknowledgments mial zeros. Computers & Mathematics with Applications, 31(12), 1996. The author Jo˜ao Sousa-Pinto would like to thank Andrew Kaan M. S. Paterson. Undecidability in 3 by 3 matrices. J. of Math. and Physics, Balin for a productive discussion during the early stages of this 1970. work. J. Renegar. On the computational complexity and geometry of the first- order theory of the reals. J. Symb. Comp., 1992. References A. Tarski. A Decision Method for Elementary Algebra and Geometry. University of California Press, 1951. R. Alur. Principles of Cyber-Physical Systems. MIT Press, 2015. E. Wermuth. Two remarks on matrix exponentials. Linear Algebra and its L. Babai, R. Beals, J. Cai, G. Ivanyos, and E. M. Luks. Multiplicative Applications, 117:127–132, 1989. equations over commuting matrices. In Proceedings of the Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, 28-30 January 1996, Atlanta, Georgia., pages 498–507, 1996.