On the Positivity Problem for Simple Linear Recurrence Sequences
aa r X i v : . [ c s . D M ] A p r On the Positivity Problem forSimple Linear Recurrence Sequences ⋆ Jo¨el Ouaknine and James Worrell
Department of Computer Science, Oxford University, UK
Abstract.
Given a linear recurrence sequence (LRS) over the integers,the
Positivity Problem asks whether all terms of the sequence are posi-tive. We show that, for simple LRS (those whose characteristic polyno-mial has no repeated roots) of order 9 or less, Positivity is decidable,with complexity in the Counting Hierarchy.
A (real) linear recurrence sequence (LRS) is an infinite sequence u = h u , u , u , . . . i of real numbers having the following property: there exist con-stants b , b , . . . , b k (with b k = 0) such that, for all n ≥ u n + k = b u n + k − + b u n + k − + . . . + b k u n . (1)If the initial values u , . . . , u k − of the sequence are provided, the recurrencerelation defines the rest of the sequence uniquely. Such a sequence is said tohave order k . The best-known example of an LRS was given by Leonardo of Pisa in the12th century: the Fibonacci sequence h , , , , , , , , . . . i , which satisfies therecurrence relation u n +2 = u n +1 + u n . Leonardo of Pisa introduced this sequenceas a means to model the growth of an idealised population of rabbits. Not onlyhas the Fibonacci sequence been extensively studied since, but LRS now forma vast subject in their own right, with numerous applications in mathematicsand other sciences. A deep and extensive treatise on the mathematical aspectsof recurrence sequences is the monograph of Everest et al. [15].Given an LRS u satisfying the recurrence relation (1), the characteristicpolynomial of u is p ( x ) = x k − b x k − − . . . − b k − x − b k . (2)An LRS is said to be simple if its characteristic polynomial has no repeatedroots. Simple LRS, such as the Fibonacci sequence, possess a number of desirable ⋆ This research was partially supported by EPSRC. We are also grateful to Matt Dawsfor considerable assistance in the initial stages of this work. Some authors define the order of an LRS as the least k such that the LRS obeys sucha recurrence relation. The definition we have chosen allows for a simpler presentationof our results and is algorithmically more convenient. Jo¨el Ouaknine and James Worrell properties which considerably simplify their analysis—see, e.g., [15, 16, 2, 3, 31].They constitute a large and well-studied class of sequences, and correspond to diagonalisable matrices in the matricial formulation of LRS—see Sec. 2.In this paper, we focus on the Positivity Problem for simple LRS over theintegers (or equivalently, for our purposes, the rationals): given a simple LRS,are all of its terms positive? As detailed in [30], the Positivity Problem (and assorted variants) has ap-plications in a wide array of scientific areas, including theoretical biology, eco-nomics, software verification, probabilistic model checking, quantum computing,discrete linear dynamical systems, combinatorics, formal languages, statisticalphysics, generating functions, etc. Positivity also bears an important relation-ship to the well-known
Skolem Problem : does a given LRS have a zero? Thedecidability of the Skolem Problem is generally considered to have been opensince the 1930s (notwithstanding the fact that algorithmic decision issues hadnot at the time acquired the importance that they have today—see [20] for adiscussion on this subject; see also [38, p. 258] and [23], in which this state ofaffairs—the enduring openness of decidability for the Skolem Problem—is de-scribed as “faintly outrageous” by Tao and a “mathematical embarrassment” byLipton). A breakthrough occurred in the mid-1980s, when Mignotte et al. [27]and Vereshchagin [41] independently showed decidability for LRS of order 4 orless. These deep results make essential use of Baker’s theorem on linear formsin logarithms (which earned Baker the Fields Medal in 1970), as well as a p -adic analogue of Baker’s theorem due to van der Poorten. Unfortunately, littleprogress on that front has since been recorded. It is considered folklore that the decidability of Positivity (for arbitrary LRS)would entail that of the Skolem Problem [30], noting however that the reductionincreases the order of LRS quadratically. Nevertheless, the earliest explicit ref-erences in the literature to the Positivity Problem that we have found are fromthe 1970s (see, e.g., [36, 35, 7]). In [36], the Skolem and Positivity Problems aredescribed as “very difficult”, whereas in [34], the authors assert that the Skolemand Positivity Problems are “generally conjectured [to be] decidable”. Positivityis again stated as an open problem in [19, 6, 22, 24, 39, 30], among others.Unsurprisingly, progress on the Positivity Problem over the last few decadeshas been fairly slow. In the early 1980s, Burke and Webb [11] showed thatthe closely related problem of
Ultimate Positivity (are all but finitely many In the measure-theoretic sense, almost all LRS are simple
LRS. In keeping with established terminology, ‘positive’ here is taken to mean ‘non-negative’. A proof of decidability of the Skolem Problem for LRS of order 5 was announcedin [20]. However, as pointed out in [29], the proof seems to have a serious gap. It is worth noting that, under this reduction, the decidability of the Positivity Prob-lem for simple LRS of order at most 14 would entail the decidability of the SkolemProblem for simple LRS of order 5, which is open and from which the general case ofthe Skolem Problem at order 5 would follow, based on the work carried out in [20];see also [29], which identifies the last unresolved critical case for the Skolem Problemat order 5, involving simple LRS.n the Positivity Problem for Simple Linear Recurrence Sequences 3 terms of a given LRS positive?) is decidable for LRS of order 2, and nine yearslater Nagasaka and Shiue [28] showed the same for LRS of order 3 that haverepeated characteristic roots. Much more recently, Halava et al. [19] showedthat Positivity is decidable for LRS of order 2, and subsequently Laohakosol andTangsupphathawat [22] proved that Positivity is decidable for LRS of order 3. In2012, an article purporting to show decidability of Positivity for LRS of order 4was published [37], with the authors noting they were unable to tackle the case oforder 5. Unfortunately, as pointed out in [30] and acknowledged by the authorsthemselves [21], that paper contains a major error, invalidating the order-4 claim.Very recently, Positivity was nevertheless shown decidable for arbitrary integerLRS of order 5 or less [30], with complexity in the Counting Hierarchy; moreover,the same paper shows by way of hardness that the decidability of Positivity forinteger LRS of order 6 would entail major breakthroughs in analytic numbertheory (certain longstanding Diophantine-approximation open problems wouldbecome solvable). Finally, in [31], the authors show that Ultimate Positivity forsimple integer LRS of unrestricted order is decidable within PSPACE, and inpolynomial time if the order is fixed.
Main Result.
The main result of this paper is that the Positivity Problem forsimple integer LRS of order 9 or less is decidable. An analysis of the decisionprocedure shows that its complexity lies in coNP PP PPPP , i.e., within the fourthlevel of the Counting Hierarchy (itself contained in PSPACE). Comparison with Related Work.
It is important to note the fundamentaldifference between the above result and those of [31]: in the latter, UltimatePositivity is shown to be decidable for simple LRS of all orders, but in a non-constructive sense: a given LRS may be certified ultimately positive, yet noindex threshold is provided beyond which all terms of the LRS are positive. Atthe time of writing, this appears to be a fundamental difficulty: for simple LRS ofany given order, the ability to compute such index thresholds would immediatelyenable one to decide Positivity. Yet as noted earlier, the decidability of Positivityfor simple LRS of order at most 14 would in turn entail the decidability of theSkolem Problem for arbitrary LRS of order 5, a longstanding and major openproblem.We recall and summarise some standard material on linear recurrence se-quences in Sec. 2. We also recall in App. A the statements of various mathemat-ical tools needed in our development, notably Baker’s theorem on linear formsin logarithms, Masser’s results on multiplicative relationships among algebraicnumbers, Kronecker’s theorem on simultaneous Diophantine approximation, andRenegar’s work on the fine-grained complexity of quantifier elimination in thefirst-order theory of the reals. The complexity is as a function of the bit length of the standard representation ofinteger LRS; for an LRS of order k as defined by Eq. (1), this representation consistsof the 2 k -tuple ( b , . . . , b k , u , . . . , u k − ) of integers. Jo¨el Ouaknine and James Worrell Our overall approach is similar to that followed in [30], attacking the problemvia the exponential polynomial solution of LRS using sophisticated tools fromanalytic and algebraic number theory, Diophantine geometry and approximation,and real algebraic geometry. However the present paper makes vastly greater anddeeper use of real algebraic geometry, particularly in the form of Lemmas 10,11, and 12 (which serve to establish the key fact that certain varieties are zero-dimensional, enabling our application of Baker’s theorem in higher dimensions),and throughout the whole of Sec. 3.2, which handles what is by far the mostdifficult and complex critical case in our analysis. Lemmas 10–12 (which can befound in App. B), as well as the development of Sec. 3.2, are entirely new.The present paper also markedly differs from [31]. In fact, aside from sharingstandard material on LRS, the non-constructive approach of [31] eschews mostof the real algebraic geometry of the present paper, as well as Baker’s theo-rem, and is underpinned instead by non-constructive lower bounds on sums of S -units, which in turn follow from deep results in Diophantine approximation(Schlickewei’s p -adic generalisation of Schmidt’s Subspace theorem).We present a high-level overview of our proof strategy—split in two parts—within Sec. 3, and also briefly discuss why the present approach does not seemextendable beyond order 9. As noted earlier, establishing the decidability ofPositivity for simple LRS of order 14 would entail a major advance, namely thedecidability of the Skolem Problem for arbitrary LRS of order 5. It is an openproblem whether similar ‘hardness’ results can be established for simple LRS oforders 10–13.In terms of complexity, it is shown in [31] that the Positivity Problem forsimple integer LRS of arbitrary order is hard for co ∃ R , the class of problemswhose complements are solvable in the existential theory of the reals, and whichis known to contain coNP. However, no lower bounds are known when the orderis fixed or bounded, as is the case in the present paper. Either establishing non-trivial lower bounds or improving the Counting-Hierarchy complexity of thepresent procedure also appear to be challenging open problems. We recall some fundamental properties of (simple) linear recurrence sequences.Results are stated without proof, and we refer the reader to [15, 20] for details.Let u = h u n i ∞ n =0 be an LRS of order k over the reals satisfying the recurrencerelation u n + k = b u n + k − + . . . + b k u n , where b k = 0. We denote by || u || thebit length of its representation as a 2 k -tuple of integers, as discussed in the pre-vious section. The characteristic roots of u are the roots of its characteristicpolynomial (cf. Eq. (2)), and the dominant roots are the roots of maximummodulus. The characteristic roots can be computed in time polynomial in || u || —see App. A for further details on algebraic-number manipulations.The characteristic roots divide naturally into real and non-real ones. Sincethe characteristic polynomial has real coefficients, non-real roots always arise in n the Positivity Problem for Simple Linear Recurrence Sequences 5 conjugate pairs. Thus we may write { ρ , . . . , ρ ℓ , γ , γ , . . . , γ m , γ m } to representthe set of characteristic roots of u , where each ρ i ∈ R and each γ j ∈ C \ R . If u is a simple LRS, there are algebraic constants a , . . . , a ℓ ∈ R and c , . . . , c m such that, for all n ≥ u n = ℓ X i =1 a i ρ ni + m X j =1 (cid:0) c j γ nj + c j γ jn (cid:1) . (3)This expression is referred to as the exponential polynomial solution of u .For fixed k , all constants a i and c j can be computed in time polynomial in || u || ,since they can be obtained by solving a system of linear equations involving thefirst k instances of Eq. (3).An LRS is said to be non-degenerate if it does not have two distinct char-acteristic roots whose quotient is a root of unity. As pointed out in [15], thestudy of arbitrary LRS can effectively be reduced to that of non-degenerateLRS, by partitioning the original LRS into finitely many subsequences, each ofwhich is non-degenerate. In general, such a reduction will require exponentialtime. However, when restricting to LRS of bounded order (in our case, of orderat most 9), the reduction can be carried out in polynomial time. In particular,any LRS of order 9 or less can be partitioned in polynomial time into at most3 . · non-degenerate LRS of the same order or less. Note that if the originalLRS is simple, this process will yield a collection of simple non-degenerate sub-sequences. In the rest of this paper, we shall therefore assume that all LRS weare given are non-degenerate.Any LRS u of order k can alternately be given in matrix form, in the sensethat there is a square matrix M of dimension k × k , together with k -dimensionalcolumn vectors v and w , such that, for all n ≥ u n = v T M n w . It suffices to take M to be the transpose of the companion matrix of the characteristic polynomialof u , let v be the vector ( u k − , . . . , u ) of initial terms of u in reverse order,and take w to be the vector whose first k − k th entryis 1. It is worth noting that the characteristic roots of u correspond preciselyto the eigenvalues of M , and that if u is simple then M is diagonalisable. Thistranslation is instrumental in Sec. 3 to place the Positivity Problem for simpleLRS of order at most 9 within the Counting Hierarchy.Conversely, given any square matrix M of dimension k × k , and any k -dimensional vectors v and w , let u n = v T M n w . Then h v T M n w i ∞ n = k is an LRSof order at most k whose characteristic polynomial divides that of M , as canbe seen by applying the Cayley-Hamilton Theorem. When M is diagonalisable,the resulting LRS is simple. We obtained this value using a bespoke enumeration procedure for order 9. A boundof e √ · ≤ . · can be obtained from Cor. 3.3 of [42]. In fact, if none of the eigenvalues of M are zero, it is easy to see that the full sequence h v T M n w i ∞ n =0 is an LRS (of order at most k ). Jo¨el Ouaknine and James Worrell Let u = h u n i ∞ n =0 be an integer LRS of order k . As discussed in the Introduction,we assume that u is presented as a 2 k -tuple of integers ( b , . . . , b k , u , . . . , u k − ) ∈ Z k , such that for all n ≥ u n + k = b u n + k − + . . . + b k u n . (4)The Positivity Problem asks, given such an LRS u , whether for all n ≥ u n ≥
0. When this holds, we say that u is positive .In this section, we establish the following: Theorem 1.
The Positivity Problem for simple integer LRS of order or lessis decidable in coNP PP PPPP . Note that deciding whether the characteristic roots are simple can easily bedone in polynomial time; cf. App. A.Observe also that Thm. 1 immediately carries over to rational LRS. Tosee this, consider a rational LRS u obeying the recurrence relation (4). Let ℓ be the least common multiple of the denominators of the rational numbers b , . . . , b k , u , . . . , u k − , and define an integer sequence v = h v n i ∞ n =0 by setting v n = ℓ n +1 u n for all n ≥
0. It is easily seen that v is an integer LRS of the sameorder as u , and that for all n , v n ≥ u n ≥
0. Moreover, v is simple iff u issimple. High-Level Synopsis (I).
At a high level, the algorithm upon which Thm. 1rests proceeds as follows. Given an LRS u , we first decide whether or not u is ultimately positive by studying its exponential polynomial solution—furtherdetails on this task are provided shortly. As we prove in this paper, whenever u is an ultimately positive simple LRS of order 9 or less, there is a polynomial-time computable threshold N of at most exponential magnitude such that allterms of u beyond N are positive. Clearly u cannot be positive unless it isultimately positive. Now in order to assert that an ultimately positive LRS u is not positive, we use a guess-and-check procedure: find n ≤ N such that u n < u n = v T M n w , for some square integer matrix M and vectors v and w (cf. Sec. 2), we can decide whether u n < via iterative squaring,which yields an NP PosSLP procedure for non-Positivity. Thanks to the work ofAllender et al. [1], which asserts that PosSLP ⊆ P PP PPPP , we obtain the requiredcoNP PP PPPP algorithm for deciding Positivity.The following is an old result concerning LRS; proofs can be found in [18,Thm. 7.1.1] and [6, Thm. 2]. It also follows easily and directly from either Pring-sheim’s theorem or from [10, Lem. 4]. It plays an important role in our approach A sequence is ultimately positive if all but finitely many of its terms are positive. Recall that PosSLP is the problem of determining whether an arithmetic circuit,with addition, multiplication, and subtraction gates, evaluates to a positive integer.n the Positivity Problem for Simple Linear Recurrence Sequences 7 by enabling us to significantly cut down on the number of subcases that mustbe considered, avoiding the sort of quagmire alluded to in [28].
Proposition 2.
Let h u n i ∞ n =0 be an LRS with no real positive dominant charac-teristic root. Then there are infinitely many n such that u n < and infinitelymany n such that u n > . By Prop. 2, it suffices to restrict our attention to LRS whose dominant char-acteristic roots include one real positive value. Given an integer LRS u , notethat determining whether the latter holds is easily done in time polynomial in || u || (cf. App. A).Thus let u be a non-degenerate simple integer LRS of order k ≤ ρ >
0. Note that u cannot have a realnegative dominant characteristic root (which would be − ρ ), since otherwise thequotient − ρ/ρ = − { ρ, γ , γ , . . . , γ m , γ m }∪{ γ m +1 , γ m +2 , . . . , γ ℓ } ,where we assume that the roots in the first set all have common modulus ρ ,whereas the roots in the second set all have modulus strictly smaller than ρ .Let λ i = γ i /ρ for 1 ≤ i ≤ ℓ . We can then write u n ρ n = a + m X j =1 (cid:16) c j λ nj + c j λ j n (cid:17) + r ( n ) , (5)for some real algebraic constant a and complex algebraic constants c , . . . , c m ,where r ( n ) is a term tending to zero exponentially fast.Note that none of λ , . . . , λ m , all of which have modulus 1, can be a rootof unity, as each λ i is a quotient of characteristic roots and u is assumed to benon-degenerate. Likewise, for i = j , λ i /λ j and λ i /λ j cannot be roots of unity.For i ∈ { , . . . , ℓ } , observe also that as each λ i is a quotient of two rootsof the same polynomial of degree k , it has degree at most k ( k − || λ i || = || u || O (1) , || a || = || u || O (1) , and || c i || = || u || O (1) (cf.App. A).Finally, we place bounds on the rate of convergence of r ( n ). We have r ( n ) = c m +1 λ nm +1 + . . . + c ℓ λ nℓ . Combining our estimates on the height and degree of each λ i together with theroot-separation bound given by Eq. (15) in App. A, we get −| λ i | = 2 || u || O (1) ,for m + 1 ≤ i ≤ ℓ . Thanks also to the bounds on the height and degree of theconstants c i , it follows that we can find ε ∈ (0 ,
1) and N ∈ N such that:1 /ε = 2 || u || O (1) (6) N = 2 || u || O (1) (7)For all n > N, | r ( n ) | < (1 − ε ) n . (8)We can compute such ε and N in time polynomial in || u || , since all relevantcalculations on algebraic numbers only require polynomial time (cf. App. A). Jo¨el Ouaknine and James Worrell
We now seek to answer positivity and ultimate positivity questions for theLRS u = h u n i ∞ n =0 by studying the same for h u n /ρ n i ∞ n =0 .In what follows, we assume that u is as above, i.e., u is a non-degeneratesimple integer LRS having a real positive dominant characteristic root ρ > High-Level Synopsis (II).
Before launching into technical details, let us pro-vide a high-level overview of our proof strategy for deciding whether u is ulti-mately positive, and when that is the case, for computing an index threshold N beyond which all of its terms are positive. Let us rewrite Eq. (5) as u n ρ n = a + h ( λ n , . . . , λ nm ) + r ( n ) , (9)where h : C m → R is a continuous function. In general, there will be inte-ger multiplicative relationships among the λ , . . . , λ m , forming a free abeliangroup L for which we can compute a basis thanks to Thm. 3 in App. A. Thesemultiplicative relationships define a torus T ⊆ C m on which the joint iterates { ( λ n , . . . , λ nm ) : n ∈ N } are dense, as per Kronecker’s theorem (in the form ofCor. 6 in App. A).Now the critical case arises when a + min h ↾ T = 0, where h ↾ T denotes thefunction h restricted to the torus T . Provided that h ↾ T achieves its minimum − a at only finitely many points, we can use Baker’s theorem (in the form ofCor. 8 in App. A) to bound the iterates ( λ n , . . . , λ nm ) away from these points byan inverse polynomial in n . By combining Renegar’s results (Thm. 4 in App. A)with techniques from real algebraic geometry, we then argue that h ( λ n , . . . , λ nm )is itself eventually bounded away from the minimum − a by a (different) inversepolynomial in n , and since r ( n ) decays to zero exponentially fast, we are ableto conclude that u n /ρ n is ultimately positive, and can compute a threshold N after which all terms u n (for n > N ) are positive.Note in the above that a key component is the requirement that h ↾ T achieveits minimum at finitely many points. Lemmas 10–12 in App. B show that this isthe case provided that L , the free abelian group of multiplicative relationshipsamong the λ , . . . , λ m , has rank 0, 1, m −
1, or m . In fact, simple counterexamplescan be manufactured in the other instances, which seems to preclude the use ofBaker’s theorem. Since non-real characteristic roots always arise in conjugatepairs, the earliest appearance of this vexing state of affairs is at order 10: onereal dominant root, m = 4 pairs of complex dominant roots, one non-dominantroot ensuring that the term r ( n ) is not identically 0, and a free abelian group L of rank 2. The difficulty encountered there is highly reminiscent of (if technicallydifferent from) that of the critical unresolved case for the Skolem Problem atorder 5, as described in [29].We now proceed with the formalisation of the above. Recall that u is assumed tobe a non-degenerate simple LRS of order at most 9, with a real positive dominantcharacteristic root ρ > γ , γ , . . . , γ m , γ m ∈ C \ R .We write λ j = γ j /ρ for 1 ≤ j ≤ m . n the Positivity Problem for Simple Linear Recurrence Sequences 9 Since the number of dominant roots is odd and at most 9, we divide ouranalysis into two cases, there being exactly 9 dominant roots (Sec. 3.1), andthere being 7 or fewer dominant roots (Sec. 3.2). Our starting point is Eq. (5).Let L = { ( v , . . . , v m ) ∈ Z m : λ v . . . λ v m m = 1 } have rank p (as a free abeliangroup), and let { ℓ , . . . , ℓ p } be a basis for L . Write ℓ q = ( ℓ q, , . . . , ℓ q,m ) for1 ≤ q ≤ p . Recall from Thm. 3 in App. A that such a basis may be computed inpolynomial time, and moreover that each ℓ q,j may be assumed to have magnitudepolynomial in || u || . If u has 9 dominant roots, then m = 4 and r ( n ) is identically 0 in Eq. (5); thelatter greatly simplifies our analysis.Write T = { z ∈ C : | z | = 1 } for the unit circle in the complex plane, and let T = { ( z , . . . , z ) ∈ T : for each q ∈ { , . . . , p } , z ℓ q, . . . z ℓ q, = 1 } . Define h : T → R by h ( z , . . . , z ) = P j =1 ( c j z j + c j z j ), so that for all n , u n ρ n = a + h ( λ n , . . . , λ n ) . By Cor. 6 in App. A, the set { ( λ n , . . . , λ n ) : n ∈ N } is a dense subset of T . Since h is continuous, we then have that inf { u n /ρ n : n ∈ N } = a + min h ↾ T . It followsthat u is ultimately positive iff u is positive iff min h ↾ T ≥ − a iff ∀ ( z , z , z , z ) ∈ T, h ( z , z , z , z ) ≥ − a . (10)We now show how to rewrite Assertion (10) as a sentence in the first-ordertheory of the reals, i.e., involving only real-valued variables and first-order quan-tifiers, Boolean connectives, and integer constants together with the arithmeticoperations of addition, subtraction, multiplication, and division. The idea isto separately represent the real and imaginary parts of each complex quantityappearing in Assertion (10), and combine them using real arithmetic so as tomimic the effect of complex arithmetic operations.To this end, we use two real variables x j and y j to represent each of the z j : intuitively, z j = x j + iy j . Since the real constant a is algebraic, there is aformula σ a ( x ) which is true over the reals precisely for x = a . Likewise, the realand imaginary parts Re( c j ) and Im( c j ) of the complex algebraic constants c j are themselves real algebraic, and can be represented as formulas in the first-order theory of the reals. All such formulas can readily be shown to have sizepolynomial in || u || .Terms of the form z ℓ q,j j are simply expanded: for example, if ℓ q,j is posi-tive, then z ℓ q,j j = ( x j + iy j ) ℓ q,j = A q,j ( x j ) + iB q,j ( y j ), where A q,j and B q,j are In App. A, we do not have division as an allowable operation in the first-order theoryof the reals; however instances of division can always be removed in linear time atthe cost of introducing a linear number of existentially quantified fresh variables.0 Jo¨el Ouaknine and James Worrell polynomials with integer coefficients. Note that since the magnitude of ℓ q,j ispolynomial in || u || , so are || A q,j || and || B q,j || . The case in which ℓ q,j is negativeis handled similarly, with the additional use of a division operation.Combining everything, we obtain a sentence τ of the first-order theory ofthe reals with division which is true iff Assertion (10) holds. τ makes use of atmost 17 real variables: two for each of z , . . . , z , one for a , and one for each ofRe( c ) , Im( c ) , . . . , Re( c ) , Im( c ). In removing divisions from τ , the number ofvariables potentially swells to 29. Finally, the size of τ is polynomial in || u || . Wecan therefore invoke Thm. 4 in App. A to conclude that Assertion (10)—andtherefore the positivity of u —can be decided in time polynomial in || u || . We now turn to the main case, i.e., the situation in which u has 7 dominantroots, so that m = 3 in Eq. (5). The cases of 1, 3, and 5 dominant roots are verysimilar—if slightly simpler—and are therefore omitted.As before, we let T = { z ∈ C : | z | = 1 } , and write T = { ( z , z , z ) ∈ T : for each q ∈ { , . . . , p } , z ℓ q, z ℓ q, z ℓ q, = 1 } . Define h : T → R by h ( z , z , z ) = P j =1 ( c j z j + c j z j ), so that for all n , u n ρ n = a + h ( λ n , λ n , λ n ) + r ( n ) . (11)By Cor. 6 in App. A, the set { ( λ n , λ n , λ n ) : n ∈ N } is a dense subset of T . Since h is continuous, we have inf { h ( λ n , λ n , λ n ) : n ∈ N } = min h ↾ T = µ , for some µ ∈ R .We can represent µ via the following formula τ ( y ): ∃ ( ζ , ζ , ζ ) ∈ T : ( h ( ζ , ζ , ζ ) = y ∧ ∀ ( z , z , z ) ∈ T, y ≤ h ( z , z , z )) . Similarly to the translation carried out in Sec. 3.1, we can construct an equivalentformula τ ′ ( y ) in the first-order theory of the reals, over a bounded number ofreal variables, with || τ ′ ( y ) || = || u || O (1) . According to Thm. 4 in App. A, we canthen compute in polynomial time an equivalent quantifier-free formula χ ( y ) = I _ i =1 J i ^ j =1 h i,j ( y ) ∼ i,j . Recall that each ∼ i,j is either > or =. Now χ ( y ) must have a satisfiabledisjunct, and since the satisfying assignment to y is unique (namely y = µ ), thisdisjunct must comprise at least one equality predicate. Since Thm. 4 guaranteesthat the degree and height of each h i,j are bounded by || u || O (1) and 2 || u || O (1) re-spectively, we immediately conclude that µ is an algebraic number and moreoverthat || µ || = || u || O (1) . n the Positivity Problem for Simple Linear Recurrence Sequences 11 Returning to Eq. (11), we see that if a + µ <
0, then u is neither positivenor ultimately positive, whereas if a + µ > u is ultimately positive. Inthe latter case, thanks to our bounds on || µ || , together with the root-separationbound given by Eq. (15) in App. A, we have a + µ = 2 || u || O (1) . The latter, togetherwith Eqs. (6)–(8), implies an exponential upper bound on the index of possibleviolations of positivity. The actual positivity of u can then be decided via acoNP procedure that invokes a PosSLP oracle as outlined earlier.It remains to analyse the case in which µ = − a . To this end, let λ j = e iθ j for 1 ≤ j ≤
3. From Eq. (5), we have: u n ρ n = a + X j =1 | c j | cos( nθ j + ϕ j ) + r ( n ) . In the above, c j = | c j | e iϕ j for 1 ≤ j ≤
3. We make the further assumption thateach c j is non-zero; note that if this did not hold, we could simply recast ouranalysis in a lower dimension.Let Z = { ( ζ , ζ , ζ ) ∈ T : h ( ζ , ζ , ζ ) = µ } be the set of points of T at which h achieves its minimum µ . By Lem. 12 in App. B, Z is finite. We concentrateon the set Z of first coordinates of Z . Write τ ( x ) = ∃ z : (Re( z ) = x ∧ z ∈ Z ) τ ( y ) = ∃ z : (Im( z ) = y ∧ z ∈ Z ) . Similarly to our earlier constructions, τ ( x ) is equivalent to a formula τ ′ ( x ) inthe first-order theory of the reals, over a bounded number of real variables, with || τ ′ ( x ) || = || u || O (1) . Thanks to Thm. 4 in App. A, we then obtain an equivalentquantifier-free formula χ ( x ) = I _ i =1 J i ^ j =1 h i,j ( x ) ∼ i,j . Note that since there can only be finitely many ˆ x ∈ R such that χ (ˆ x ) holds,each disjunct of χ ( x ) must comprise at least one equality predicate, or canotherwise be entirely discarded as having no solution.A similar exercise can be carried out with τ ( y ), yielding χ ( y ). The boundson the degree and height of each h i,j in χ ( x ) and χ ( y ) then enable us toconclude that any ζ = ˆ x + i ˆ y ∈ Z is algebraic, and moreover satisfies || ζ || = || u || O (1) . In addition, bounds on I and J i guarantee that the cardinality of Z is at most polynomial in || u || .Since λ is not a root of unity, for each ζ ∈ Z there is at most one value of n such that λ n = ζ . Thm. 3 in App. A then entails that this value (if it exists)is at most M = || u || O (1) , which we can take to be uniform across all ζ ∈ Z .We can now invoke Cor. 8 in App. A to conclude that, for n > M , and for all ζ ∈ Z , we have | λ n − ζ | > n || u || D , (12) where D ∈ N is some absolute constant.Let b > { z ∈ C : | z | = 1 and, for all ζ ∈ Z , | z − ζ | ≥ b } is non-empty. Thanks to our bounds on the cardinality of Z , we can use thefirst-order theory of the reals, together with Thm. 4 in App. A, to conclude that b is algebraic and || b || = || u || O (1) .Define the function g : [ b, ∞ ) → R as follows: g ( x ) = min { h ( z , z , z ) − µ : ( z , z , z ) ∈ T and, for all ζ ∈ Z , | z − ζ | ≥ x } . It is clear that g is continuous and g ( x ) > x ∈ [ b, ∞ ). Moreover, asbefore, g can be rewritten as a function in the first-order theory of the reals overa bounded number of variables, with || g || = u O (1) . It follows from Prop. 2.6.2of [8] (invoked with the function 1 /g ) that there is a polynomial P ∈ Z [ x ] suchthat, for all x ∈ [ b, ∞ ), g ( x ) ≥ P ( x ) . (13)Moreover, an examination of the proof of [8, Prop. 2.6.2] reveals that P is ob-tained through a process which hinges on quantifier elimination. Combining thiswith Thm. 4 in App. A, we are therefore able to conclude that || P || = || u || O (1) ,a fact which relies among others on our upper bounds for || b || .By Eqs. (6)–(8), we can find ε ∈ (0 ,
1) and N = 2 || u || O (1) such that for all n > N , we have | r ( n ) | < (1 − ε ) n , and moreover 1 /ε = 2 || u || O (1) . Moreover, byProp. 9 in App. A, there is N ′ = 2 || u || O (1) such that1 P ( n || u || D ) > (1 − ε ) n (14)for all n ≥ N ′ .Combining Eqs. (11)–(14), we get u n ρ n = a + h ( λ n , λ n , λ n ) + r ( n ) ≥ − µ + h ( λ n , λ n , λ n ) − (1 − ε ) n ≥ g ( n || u || D ) − (1 − ε ) n ≥ P ( n || u || D ) − (1 − ε ) n ≥ , provided n > max { M, N, N ′ } , which establishes ultimate positivity of u andprovides an exponential upper bound on the index of possible violations of posi-tivity, as required. We can then decide the actual positivity of u via a coNP PosSLP procedure as detailed earlier.This completes the proof of Thm. 1. n the Positivity Problem for Simple Linear Recurrence Sequences 13
A Mathematical Tools
In this appendix we summarise the main technical tools used in this paper.For p ∈ Z [ x , . . . , x m ] a polynomial with integer coefficients, let us denote by || p || the bit length of its representation as a list of coefficients encoded in binary.Note that the degree of p is at most || p || , and the height of p —i.e., the maximumof the absolute values of its coefficients—is at most 2 || p || .We begin by recalling some basic facts about algebraic numbers and their(efficient) manipulation. The main references include [13, 5, 33].A complex number α is algebraic if it is a root of a single-variable polynomialwith integer coefficients. The defining polynomial of α , denoted p α , is theunique polynomial of least degree, and whose coefficients do not have commonfactors, which vanishes at α . The degree and height of α are respectively thoseof p α .A standard representation for algebraic numbers is to encode α as a tuplecomprising its defining polynomial together with rational approximations of itsreal and imaginary parts of sufficient precision to distinguish α from the otherroots of p α . More precisely, α can be represented by ( p α , a, b, r ) ∈ Z [ x ] × Q provided that α is the unique root of p α inside the circle in C of radius r centredat a + bi . A separation bound due to Mignotte [26] asserts that for roots α = β of a polynomial p ∈ Z [ x ], we have | α − β | > √ d ( d +1) / H d − , (15)where d and H are respectively the degree and height of p . Thus if r is requiredto be less than a quarter of the root-separation bound, the representation iswell-defined and allows for equality checking. Given a polynomial p ∈ Z [ x ],it is well-known how to compute standard representations of each of its rootsin time polynomial in || p || [32, 13, 5]. Thus given α an algebraic number forwhich we have (or wish to compute) a standard representation, we write || α || to denote the bit length of this representation. From now on, when referring tocomputations on algebraic numbers, we always implicitly refer to their standardrepresentations.Note that Eq. (15) can be used more generally to separate arbitrary alge-braic numbers: indeed, two algebraic numbers α and β are always roots of thepolynomial p α p β of degree at most the sum of the degrees of α and β , and ofheight at most the product of the heights of α and β .Given algebraic numbers α and β , one can compute α + β , αβ , 1 /α (fornon-zero α ), α , and | α | , all of which are algebraic, in time polynomial in || α || + || β || . Likewise, it is straightforward to check whether α = β . Moreover, if α ∈ R , deciding whether α > || α || . Efficientalgorithms for all these tasks can be found in [13, 5].Remarkably, integer multiplicative relationships among a fixed number ofalgebraic numbers can be elicited systematically in polynomial time: Note that this representation is not unique.4 Jo¨el Ouaknine and James Worrell
Theorem 3.
Let m be fixed, and let λ , . . . , λ m be complex algebraic numbersof modulus . Consider the free abelian group L under addition given by L = { ( v , . . . , v m ) ∈ Z m : λ v . . . λ v m m = 1 } .L has a basis { ℓ , . . . , ℓ p } ⊆ Z m (with p ≤ m ), where the entries of each ofthe ℓ j are all polynomially bounded in || λ || + . . . + || λ m || . Moreover, such a basiscan be computed in time polynomial in || λ || + . . . + || λ m || . Note in the above that the bound is on the magnitude of the vectors ℓ j (rather than the bit length of their representation), which follows from a deepresult of Masser [25]. For a proof of Thm. 3, see also [17, 12].We now turn to the first-order theory of the reals. Let x = ( x , . . . , x m )and y = ( y , . . . , y r ) be tuples of real-valued variables, and let σ ( x , y ) be aBoolean combination of atomic predicates of the form g ( x , y ) ∼
0, where each g ( x , y ) ∈ Z [ x , y ] is a polynomial with integer coefficients over these variables,and ∼ is either > or =. A formula of the first-order theory of the reals isof the form Q x . . . Q m x m σ ( x , y ) , (16)where each Q i is one of the quantifiers ∃ or ∀ . Let us denote the above formulaby τ ( y ), whose free variables are contained in y . When τ has no free variables,we refer to it as a sentence . Naturally, || τ ( y ) || denotes the bit length of thesyntactic representation of the formula, and the degree and height of τ ( y )refer to the maximum degree and height of the polynomials g ( x , y ) appearingin τ ( y ).Tarski [40] famously showed that the first-order theory of the reals admits quantifier elimination : that is, given τ ( y ) as above, there is a quantifier-freeformula χ ( y ) that is equivalent to τ : for any tuple ˆ y = (ˆ y , . . . , ˆ y r ) ∈ R r of realnumbers, τ ( ˆ y ) holds iff χ ( ˆ y ) holds. An immediate corollary is that the first-ordertheory of the reals is decidable.Tarski’s procedure, however, has non-elementary complexity. Many substan-tial improvements followed over the years, starting with Collins’s technique ofcylindrical algebraic decomposition [14]. For our purposes, we require bounds notonly on the computation time, but also on the degree and height of the resultingequivalent quantifier-free formula, as well as on the number of atomic predicatesit comprises. Such bounds are available thanks to the work of Renegar [33]. Inthis paper, we focus exclusively on the situation in which the number of variablesis uniformly bounded. Theorem 4 (Renegar).
Let M ∈ N be fixed. Let τ ( y ) be of the form (16)above. Assume that the number of (free and bound) variables in τ ( y ) is boundedby M (i.e., m + r ≤ M ). Denote the degree of τ ( y ) by d and the number ofatomic predicates in τ ( y ) by n .Then there is a procedure which computes an equivalent quantifier-free for-mula χ ( y ) = I _ i =1 J i ^ j =1 h i,j ( y ) ∼ i,j n the Positivity Problem for Simple Linear Recurrence Sequences 15 in disjunctive normal form, where each ∼ i,j is either > or = , with the followingproperties:1. Each of I and J i (for ≤ i ≤ I ) is bounded by ( nd ) O (1) ;2. The degree of χ ( y ) is bounded by ( nd ) O (1) ;3. The height of χ ( y ) is bounded by || τ ( y ) || ( nd ) O (1) .Moreover, this procedure runs in time polynomial in || τ ( y ) || . Note in particular that, when τ is a sentence, its truth value can be deter-mined in polynomial time.Thm. 4 follows immediately from Thm. 1.1 (for the case in which τ is asentence) and Thm. 1.2 of [33].Our next result is a special case of Kronecker’s famous theorem on simulta-neous Diophantine approximation, a statement and proof of which can be foundin [9, Chap. 7, Sec. 1.3, Prop. 7].For x ∈ R , write [ x ] π to denote the distance from x to the closest integermultiple of 2 π : [ x ] π = min {| x − πj | : j ∈ Z } . Theorem 5 (Kronecker).
Let t , . . . , t m , x , . . . , x m ∈ [0 , π ) . The followingare equivalent:1. For any ε > , there exists n ∈ Z such that, for ≤ j ≤ m , we have [ nt j − x j ] π ≤ ε .2. For every tuple ( v , . . . , v m ) of integers such that v t + . . . + v m t m ∈ π Z ,we have v x + . . . + v m x m ∈ π Z . We can strengthen Thm. 5 by requiring that n ∈ N in the first assertion.Indeed, suppose that in a given instance, we find that n <
0. A straightforwardpigeonhole argument shows that there exist arbitrarily large positive integers g such that [ gt j ] π ≤ ε for 1 ≤ j ≤ m . It follows that [( g + n ) t j − x j ] π ≤ ε , whichestablishes the claim for sufficiently large g (noting that ε is arbitrary).Let λ , . . . , λ m be complex algebraic numbers of modulus 1. For each j ∈{ , . . . , m } , write λ j = e iθ j for some θ j ∈ [0 , π ). Let L = { ( v , . . . , v m ) ∈ Z m : λ v . . . λ v m m = 1 } = { ( v , . . . , v m ) ∈ Z m : v θ + . . . + v m θ m ∈ π Z } . Recall from Thm. 3 that L is a free abelian group under addition with basis { ℓ , . . . , ℓ p } ⊆ Z m , where p ≤ m .For each j ∈ { , . . . , p } , let ℓ j = ( ℓ j, , . . . , ℓ j,m ). Write R = { x = ( x , . . . , x m ) ∈ [0 , π ) m : ℓ j · x ∈ π Z for 1 ≤ j ≤ p } . By Thm. 5, for an arbitrary tuple ( x , . . . , x m ) ∈ [0 , π ) m , it is the case that,for all ε >
0, there exists n ∈ N such that, for j ∈ { , . . . , m } , [ nθ j − x j ] π ≤ ε iff ( x , . . . , x m ) ∈ R . Write T = { z ∈ C : | z | = 1 } , and observe that ( x , . . . , x m ) ∈ R iff( e ix , . . . , e ix m ) ∈ T , where T = { ( z , . . . , z m ) ∈ T m : for each j ∈ { , . . . , p } , z ℓ j, . . . z ℓ j,m m = 1 } . Since e inθ j = λ nj , we immediately have the following: Corollary 6.
Let λ , . . . , λ m and T be as above. Then { ( λ n , . . . , λ nm ) : n ∈ N } is a dense subset of T . Finally, we give a version of Baker’s deep theorem on linear forms in loga-rithms. The particular statement we have chosen is a sharp formulation due toBaker and W¨ustholz [4].In what follows, log refers to the principal value of the complex logarithmfunction given by log z = log | z | + i arg z , where − π < arg z ≤ π . Theorem 7 (Baker and W¨ustholz).
Let α , . . . , α m ∈ C be algebraic num-bers different from or , and let b , . . . , b m ∈ Z be integers. Write Λ = b log α + . . . + b m log α m . Let A , . . . , A m , B ≥ e be real numbers such that, for each j ∈ { , . . . , m } , A j isan upper bound for the height of α j , and B is an upper bound for | b j | . Let d bethe degree of the extension field Q ( α , . . . , α m ) over Q .If Λ = 0 , then log | Λ | > − (16 md ) m +2) log A . . . log A m log B . Corollary 8.
There exists D ∈ N such that, for any algebraic numbers λ, ζ ∈ C of modulus , and for all n ≥ , whenever λ n = ζ , then | λ n − ζ | > n ( || λ || + || ζ || ) D . Proof.
We can clearly assume that λ = 1, otherwise the result follows immedi-ately from Eq. (15). Likewise, the case ζ = 1 is easily handled along the samelines as the proof below, so we assume ζ = 1.Let θ = arg λ and ϕ = arg ζ . Then for all n ∈ N , there is j ∈ Z with | j | ≤ n such that | λ n − ζ | > | nθ − ϕ − jπ | = 12 | n log λ − log ζ − j log( − | . Let H ≥ e be an upper bound for the heights of λ and ζ , and let d be thelargest of the degrees of λ and ζ . Notice that the degree of Q ( λ, ζ ) over Q is atmost d . Applying Thm. 7 to the right-hand side of the above equation, we get | λ n − ζ | >
12 exp (cid:0) − (48 d ) log H log(2 n + 1) (cid:1) = 12(2 n + 1) (log H )(48 d ) . for n ≥
1, provided λ n = ζ .The required result follows by noting that log H ≤ || λ || + || ζ || and d ≤|| λ || + || ζ || . ⊓⊔ n the Positivity Problem for Simple Linear Recurrence Sequences 17 Finally, we record the following fact, whose straightforward proof is left tothe reader.
Proposition 9.
Let a ≥ and ε ∈ (0 , be real numbers. Let B ∈ Z [ x ] havedegree at most a D and height at most a D , and assume that /ε ≤ a D , forsome D , D , D ∈ N . Then there is D ∈ N depending only on D , D , D suchthat, for all n ≥ a D , B ( n ) > (1 − ε ) n . B Zero-Dimensionality Lemmas
We present the key results enabling our application of Baker’s theorem to thediscrete orbit { ( λ n , . . . , λ nm ) : n ∈ N } in two or three complex dimensions. In theterminology of Sec. 3, Lem. 12 shows that the function h achieves its minimumover the torus T at finitely many points. To do so, it relies on Lem. 10 to handlethe case in which L , the free abelian group of multiplicative relationships among λ , . . . , λ m , has rank 1 or 0, and invokes Lem. 11 to do the same when L hasrank m − Lemma 10.
Let a , . . . , a m ∈ R and ϕ , . . . , ϕ m ∈ R be two collections of realnumbers, with each of the a i non-zero, and let ℓ , . . . , ℓ m ∈ Z be m integers.Define f, g : R m → R by setting f ( x , . . . , x m ) = m X i =1 a i cos( x i + ϕ i ) and g ( x , . . . , x m ) = m X i =1 ℓ i x i . Assume that g ( x , . . . , x m ) is not of the form ℓ ( x i ± x j ) , for some non-zero ℓ ∈ Z and indices i = j . Let ψ ∈ R , and let µ ∈ R be the minimum achieved by thefunction f subject to the constraint g ( x , . . . , x m ) = ψ .Then f , subject to g ( x , . . . , x m ) = ψ , achieves µ at only finitely many pointsover the domain [0 , π ) m .Proof. We will establish the slightly stronger statement that f , subject to theconstraint g = ψ , achieves its minimum over R m only finitely often modulo 2 π .Note that by performing the substitutions x ′ i = x i + ϕ i (for 1 ≤ i ≤ m )and ψ ′ = ψ + P mi =1 ℓ i ϕ i , and rephrasing the statement in terms of the primedvariables and constant ψ ′ , we see that we may assume without loss of generalitythat each ϕ i = 0.Observe that if each ℓ i = 0 (corresponding to there being no constraint),the result is immediate: f is minimised when each x i is either an odd or evenmultiple of π , depending on the sign of a i . Without loss of generality, let ustherefore assume that ℓ is non-zero. The case of m = 1 is also immediate, sincethe constraint then reduces the domain of the unique variable x to a singleton.Let us therefore assume that m ≥ f subject to theconstraint g = ψ must satisfy ∇ f = λ ∇ g for some λ ∈ R , i.e., − a i sin x i = λℓ i ,for 1 ≤ i ≤ m . Note that λ must satisfy | λ | ≤ | a i || ℓ i | for all 1 ≤ i ≤ m . Observealso that each choice of λ gives rise to only finitely many choices of x , . . . , x m (modulo 2 π ) which satisfy these equations.From − a i sin x i = λℓ i , it follows that cos x i = 1 − λ ℓ i a i . Taking square rootsgives us 2 m choices of signs, and for each choice let us write˜ f ( λ ) = m X i =1 ± a i s − λ ℓ i a i . n the Positivity Problem for Simple Linear Recurrence Sequences 19 Suppose that there are infinitely many values of ( x , . . . , x m ) (modulo 2 π )such that g ( x , . . . , x m ) = ψ and f ( x , . . . , x m ) = µ . It then follows that, forsome fixed choice of signs, there must be infinitely many values of λ such that˜ f ( λ ) = µ .Assume without loss of generality that | a || ℓ | ≤ | a i || ℓ i | for 2 ≤ i ≤ m . Notice that˜ f ( λ ) is analytic (equal to its Taylor power series) on ( −| a || ℓ | , | a || ℓ | ). Now if the setof λ such that ˜ f ( λ ) = µ has an accumulation point in ( −| a || ℓ | , | a || ℓ | ), then ˜ f isidentically equal to µ on [ −| a || ℓ | , | a || ℓ | ]. Thus in any case the set of λ such that˜ f ( λ ) = µ must have an accumulation point at | a || ℓ | .Observe that if | a || ℓ | < | a i || ℓ i | for all 2 ≤ i ≤ m , then a contradiction is reachedas ˜ f cannot infinitely often take on the constant value µ as λ approaches | a || ℓ | . Tosee this, examine the derivative of each term of the form q − λ ℓ i a i : it remainsbounded for i = 1, but tends to −∞ for i = 1.Let I be the set of indices i ∈ { , . . . , m } such that | a i || ℓ i | = | a || ℓ | . By the sameargument as above, for the given choice of signs in ˜ f , we must have X i ∈ I ± a i = 0,and therefore for all λ ∈ [ −| a || ℓ | , | a || ℓ | ],˜ f ( λ ) = X i/ ∈ I ± a i s − λ ℓ i a i . (17)Observe that | I | ≥
2. Two cases now arise, according to whether (i) | I | ≥ | I | = 2. In both cases, we derive a contradiction by showing that f subjectto g = ψ can achieve a value strictly lower than µ .(i) Suppose without loss of generality that I = { , , . . . , p } , where p ≥
3, and that | a p | ≤ | a i | for 1 ≤ i ≤ p −
1. Pick ˆ x , . . . , ˆ x m ∈ R such that f (ˆ x , . . . , ˆ x m ) = µ and g (ˆ x , . . . , ˆ x m ) = ψ . There is some value ˆ λ ∈ [ −| a || ℓ | , | a || ℓ | ]such that − a i sin ˆ x i = ˆ λℓ i , for 1 ≤ i ≤ m . Now for the given choice of signs in ˜ f , p X i =1 ± a i s − ˆ λ ℓ i a i = 0 and m X i = p +1 ± a i s − ˆ λ ℓ i a i = µ , or equivalently, p X i =1 a i cos ˆ x i = 0 and m X i = p +1 a i cos ˆ x i = µ . (18)In order to make f assume a value strictly smaller than µ , pick ˇ x , . . . , ˇ x p − to be π or 0 depending respectively on the signs of a , . . . , a p − , and pick ˇ x p sothat g (ˇ x , . . . , ˇ x p , ˆ x p +1 , . . . , ˆ x m ) = ψ (noting that ℓ p = 0 since p ∈ I ). Then p X i =1 a i cos ˇ x i ≤ − p − X i =1 | a i | ! + | a p | < , where the strict inequality follows from the fact that p ≥ | a p | ≤ | a i | for1 ≤ i ≤ p − f (ˇ x , . . . , ˇ x p , ˆ x p +1 , . . . , ˆ x m ) < µ , concluding Case (i).(ii) Without loss of generality, let us have I = { , } , so that | a | = | a | and | ℓ | = | ℓ | . Note that we then cannot have ℓ , . . . , ℓ m all zero, otherwise g wouldbe of the form ℓ ( x ± x ), violating one of our hypotheses. It therefore alsofollows that m ≥ ℓ is non-zero, and fur-thermore that | a || ℓ | ≤ | a i || ℓ i | for 4 ≤ i ≤ m . From Eq. (17), we see that ˜ f can beanalytically extended to the larger domain ( −| a || ℓ | , | a || ℓ | ), and by a similar line ofreasoning as earlier, we can then conclude that there must be a non-empty set J ⊆ { , . . . , m } such that, for all j ∈ J , | a j || ℓ j | = | a || ℓ | and moreover X j ∈ J ± a j = 0for the given choice of signs in ˜ f . We can therefore write˜ f ( λ ) = X i/ ∈ I ∪ J ± a i s − λ ℓ i a i . But this situation is entirely similar to Case (i) since | I ∪ J | ≥
3, whichconcludes Case (ii) and the proof of Lem. 10. ⊓⊔ Lemma 11.
Let u be a non-degenerate simple LRS, with dominant character-istic roots ρ ∈ R and γ , γ , . . . , γ m , γ m ∈ C \ R . Write λ i = γ i /ρ for ≤ i ≤ m ,and assume the free abelian group L = { ( v , . . . , v m ) ∈ Z m : λ v . . . λ v m m = 1 } hasrank m − . Let { ℓ , . . . , ℓ m − } be a basis for L , and write ℓ j = ( ℓ j, , . . . , ℓ j,m ) for ≤ j ≤ m − . Let M = ℓ , ℓ , . . . ℓ ,m − ℓ ,m ℓ , ℓ , . . . ℓ ,m − ℓ ,m ... ... . . . ... ... ℓ m − , ℓ m − , . . . ℓ m − ,m − ℓ m − ,m . Let a , . . . , a m ∈ R and ϕ , . . . , ϕ m ∈ R be two collections of m real numbers,with each of the a i non-zero, and define f : R m → R , by setting f ( x , . . . , x m ) = m X i =1 a i cos( x i + ϕ i ) . Let q = ( q , . . . , q m − ) ∈ Z m − be a column vector of m − integers, and denoteby x the column vector of variables ( x , . . . , x m ) . Let µ ∈ R be the minimumachieved by the function f subject to the constraint M x = 2 π q .Then f , subject to M x = 2 π q , achieves µ at only finitely many points overthe domain [0 , π ) m . n the Positivity Problem for Simple Linear Recurrence Sequences 21 Proof.
By repeatedly making use of the following row operations:1. Swapping two rows,2. Multiplying any row by a non-zero integer, and3. Adding to any row any integer linear combination of any of the other rows,we can transform the augmented matrix ( M | q ) into an integer matrix( N | p ) = n , . . . . . . . . . . . . . b n , . . . . . . . . . . b ... . . . . . . . . . ... ...0 . . . n m − ,m − b m − . . . . . . . n m − ,m − b m − (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) p p ... p m − p m − . Without loss of generality (relabelling variables and constants if necessary),we can assume that this was achieved without the need for any row-swappingoperations.Note that the rows of N remain in L (though need no longer form a basis).Hence for each i ∈ { , . . . , m − } , the λ , . . . , λ m satisfy the equation λ n i,i i λ b i m =1. Since M has rank m −
1, and N is obtained from M by elementary rowoperations, no row of N can be . From this and the fact that the LRS u isnon-degenerate we may conclude that no n i,i can be zero (otherwise λ m wouldbe a root of unity), and likewise no b i can be zero (otherwise λ i would be a rootof unity). Furthermore, we can never have n i,i = − b i (otherwise λ i /λ m would bea root of unity) nor can we have n i,i = b i (otherwise λ i /λ m would be a root ofunity). In other words, we always have n i,i = b i . Finally, for i = j , b i n i,i = b j n j,j :indeed, since λ n i,i i λ b i m = 1, we have λ n i,i b j i λ b i b j m = 1, and likewise λ n j,j b i j λ b i b j m = 1,from which we deduce that λ n i,i b j i = λ n j,j b i j . But if we had b i n i,i = b j n j,j , it wouldfollow that λ i /λ j is a root of unity. Similarly, by noting that λ jn j,j = λ − n j,j j andrepeating the calculation, we deduce that b i n i,i = − b j n j,j for i = j . Combining thelast two disequalities, we have that b i n i,i = b j n j,j for i = j .It is clear that the equations M x = 2 π q and N x = 2 π p are equivalent (asconstraints over the vector of real-valued variables x ). From the latter, we maywrite x i = p i n i,i − b i n i,i x m for 1 ≤ i ≤ m −
1. For ease of notation, let us set d i = − b i n i,i for 1 ≤ i ≤ m −
1, and d m = 1 ; ν i = p i n i,i + ϕ i for 1 ≤ i ≤ m −
1, and ν m = ϕ m . From our earlier observations, let us record that:1. Each d i is non-zero, and2. For 1 ≤ i < j ≤ m , we have d i = d j . Indeed, we have already seen that the second assertion holds when j ≤ m − n i,i = b i , for 1 ≤ i ≤ m − d i = 1 = d m .Substituting into f yields˜ f ( x m ) = m X i =1 a i cos( d i x m + ν i ) , where ˜ f is now unconstrained. Since any value of x m in [0 , π ) such that ˜ f ( x m ) = µ yields at most one point x in [0 , π ) m satisfying M x = 2 π q and such that f ( x ) = µ , it remains to show that ˜ f can achieve µ only finitely often over [0 , π ).Thus suppose, to the contrary, that ˜ f achieves µ at infinitely many points in[0 , π ). These points must accumulate, and since ˜ f is analytic over R , ˜ f must beidentically equal to µ all over the reals. It follows that derivatives of all ordersmust vanish everywhere. Now for j ≥
1, the (2 j − f is givenby f (2 j − ( x m ) = m X i =1 ( − j d j − i a i sin( d i x m + ν i ) . Writing D = . . . . . . . − d − d . . . . . . . − d m d d . . . . . . . d m ... ... ... ...( − m − d m − ( − m − d m − . . . ( − m − d m − m , we therefore have that f (1) ( x m ) f (3) ( x m )... f (2 m − ( x m ) = D − d a sin( d x m + ν ) − d a sin( d x m + ν )... − d m a m sin( d m x m + ν m ) = must hold for all x m ∈ R .But this is a contradiction since D is a Vandermonde matrix which is invert-ible (given that for i = j , we have − d i = − d j ) and the vector − d a sin( d x m + ν ) − d a sin( d x m + ν )... − d m a m sin( d m x m + ν m ) clearly cannot be identically . ⊓⊔ Lemma 12.
Following the notation of Sec. 3, let u be a non-degenerate sim-ple LRS with a real positive dominant characteristic root ρ > and complexdominant roots γ , γ , γ , γ , γ , γ ∈ C \ R . Write λ j = γ j /ρ for ≤ j ≤ . n the Positivity Problem for Simple Linear Recurrence Sequences 23 Let L = { ( v , v , v ) ∈ Z : λ v λ v λ v = 1 } have rank p (as a free abeliangroup), and let { ℓ , . . . , ℓ p } be a basis for L . Write ℓ q = ( ℓ q, , ℓ q, , ℓ q, ) for ≤ q ≤ p .Let T = { ( z , z , z ) ∈ T : for each q ∈ { , . . . , p } , z ℓ q, z ℓ q, z ℓ q, = 1 } , where T = { z ∈ C : | z | = 1 } .Define h : T → R by setting h ( z , z , z ) = P j =1 ( c j z j + c j z j ) .Then h achieves its minimum µ at only finitely many points over T .Proof. (i) We first consider the case in which L has rank 1, and handle the caseof rank 0 immediately afterwards. Let ℓ = ( ℓ , , ℓ , , ℓ , ) ∈ Z span L . Write R = { ( x , x , x ) ∈ [0 , π ) : ℓ , x + ℓ , x + ℓ , x ∈ π Z } . Clearly, for any ( x , x , x ) ∈ [0 , π ) , we have ( x , x , x ) ∈ R iff ( e ix , e ix , e ix ) ∈ T . Define f : R → R by setting f ( x , x , x ) = X j =1 | c j | cos( x j + ϕ j ) . Plainly, for all ( x , x , x ) ∈ R , we have f ( x , x , x ) = h ( e ix , e ix , e ix ), andtherefore the minima of f over R are in one-to-one correspondence with thoseof h over T .Define g : R → R by setting g ( x , x , x ) = ℓ , x + ℓ , x + ℓ , x . Note that g ( x , x , x ) cannot be of the form ℓ ( x i − x j ), for non-zero ℓ ∈ Z and i = j , otherwise (by definition of ℓ ) λ ℓi λ − ℓj = 1, i.e., λ i /λ j would be a root ofunity, contradicting the non-degeneracy of u . Likewise, g cannot be of the form ℓ ( x i + x j ), otherwise λ i /λ j would be a root of unity.Finally, observe that for ( x , x , x ) ∈ [0 , π ) , we have ( x , x , x ) ∈ R iff ℓ , x + ℓ , x + ℓ , x = 2 πq , for some q ∈ Z with | q | ≤ | ℓ , | + | ℓ , | + | ℓ , | . Foreach of these finitely many q , we can invoke Lem. 10 with f , g , and ψ = 2 πq ,to conclude that f achieves its minimum µ at finitely many points over R , andtherefore that h achieves the same minimum at finitely many points over T .The case of L having rank 0, i.e., when there are no non-trivial integer multi-plicative relationships among λ , λ , λ , is now a special case of the above, wherewe have ℓ , = ℓ , = ℓ , = 0.(ii) We now turn to the case of L having rank 2. We have ℓ = ( ℓ , , ℓ , , ℓ , ) ∈ Z and ℓ = ( ℓ , , ℓ , , ℓ , ) ∈ Z spanning L . Let x denote the column vector( x , x , x ), and write R = { ( x , x , x ) ∈ [0 , π ) : ℓ · x ∈ π Z and ℓ · x ∈ π Z } . Define f : R → R by setting f ( x , x , x ) = X j =1 | c j | cos( x j + ϕ j ). As before, theminima of f over R are in one-to-one correspondence with those of h over T . For ( x , x , x ) ∈ [0 , π ) , we have ℓ · x ∈ π Z and ℓ · x ∈ π Z iff there exist q , q ∈ Z , with | q | ≤ | ℓ , | + | ℓ , | + | ℓ , | and | q | ≤ | ℓ , | + | ℓ , | + | ℓ , | , suchthat ℓ · x = 2 πq and ℓ · x = 2 πq . For each of these finitely many q = ( q , q ),we can invoke Lem. 11 with f , M = (cid:18) ℓ , ℓ , ℓ , ℓ , ℓ , ℓ , (cid:19) , and q , to conclude that f achieves its minimum µ at finitely many points over R , and therefore that h achieves the same minimum at finitely many points over T .(iii) Finally, observe that L cannot have rank 3, since this would immediatelyentail that every λ j is a root of unity (contradicting the non-degeneracy of u ),following a row-reduction procedure similar to the one presented in the firststages of the proof of Lem. 11. ⊓⊔ n the Positivity Problem for Simple Linear Recurrence Sequences 25 References [1] E. Allender, P. B¨urgisser, J. Kjeldgaard-Pedersen, and P. B. Miltersen. On thecomplexity of numerical analysis.
SIAM J. Comput. , 38(5), 2009.[2] F. Amoroso and E. Viada. Small points on subvarieties of a torus.
Duke Mathe-matical Journal , 150(3), 2009.[3] F. Amoroso and E. Viada. On the zeros of linear recurrence sequences.
ActaArithmetica , 147(4), 2011.[4] A. Baker and G. W¨ustholz. Logarithmic forms and group varieties.
Jour. ReineAngew. Math. , 442, 1993.[5] S. Basu, R. Pollack, and M.-F. Roy.
Algorithms in Real Algebraic Geometry .Springer, 2nd edition, 2006.[6] J. P. Bell and S. Gerhold. On the positivity set of a linear recurrence.
Israel Jour.Math. , 57, 2007.[7] J. Berstel and M. Mignotte. Deux propri´et´es d´ecidables des suites r´ecurrenteslin´eaires.
Bull. Soc. Math. France , 104, 1976.[8] J. Bochnak, M. Coste, and M.-F. Roy.
Real Algebraic Geometry . Springer, 1998.[9] N. Bourbaki.
Elements of Mathematics: General Topology (Part 2) . Addison-Wesley, 1966.[10] M. Braverman. Termination of integer linear programs. In
Proc. Intern. Conf.on Computer Aided Verification (CAV) , volume 4144 of
LNCS . Springer, 2006.[11] J. R. Burke and W. A. Webb. Asymptotic behavior of linear recurrences.
Fib.Quart. , 19(4), 1981.[12] J.-Y. Cai, R. J. Lipton, and Y. Zalcstein. The complexity of the A B C problem.
SIAM J. Comput. , 29(6), 2000.[13] H. Cohen.
A Course in Computational Algebraic Number Theory . Springer-Verlag,1993.[14] G. E. Collins. Quantifier elimination for real closed fields by cylindrical algebraicdecomposition. In
Proc. 2nd GI Conf. Automata Theory and Formal Languages .Springer-Verlag, 1975.[15] G. Everest, A. van der Poorten, I. Shparlinski, and T. Ward.
Recurrence Se-quences . American Mathematical Society, 2003.[16] J.-H. Evertse, H. P. Schlickewei, and W. M. Schmidt. Linear equations in variableswhich lie in a multiplicative group.
Ann. Math. , 155(3), 2002.[17] G. Ge.
Algorithms Related to Multiplicative Representations of Algebraic Numbers .PhD thesis, U.C. Berkeley, 1993.[18] I. Gyori and G. Ladas.
Oscillation Theory of Delay Differential Equations . OxfordMathematical Monographs. Oxford University Press, 1991.[19] V. Halava, T. Harju, and M. Hirvensalo. Positivity of second order linear recurrentsequences.
Discrete Appl. Math. , 154(3), 2006.[20] V. Halava, T. Harju, M. Hirvensalo, and J. Karhum¨aki. Skolem’s problem — onthe border between decidability and undecidability. Technical Report 683, TurkuCentre for Computer Science, 2005.[21] V. Laohakosol. Personal communication, July 2013.[22] V. Laohakosol and P. Tangsupphathawat. Positivity of third order linear recur-rence sequences.
Discrete Appl. Math. , 157(15), 2009.[23] R. J. Lipton. Mathematical embarrassments.
Blog entry , December 2009. http://rjlipton.wordpress.com/2009/12/26/mathematical-embarrassments/ .[24] L. L. Liu. Positivity of three-term recurrence sequences.
Electr. J. Comb. , 17(1),2010.6 Jo¨el Ouaknine and James Worrell[25] D. W. Masser. Linear relations on algebraic groups. In
New Advances in Tran-scendence Theory . Cambridge University Press, 1988.[26] M. Mignotte. Some useful bounds. In
Computer Algebra , 1982.[27] M. Mignotte, T. N. Shorey, and R. Tijdeman. The distance between terms of analgebraic recurrence sequence.
Journal f¨ur die reine und angewandte Mathematik ,349, 1984.[28] K. Nagasaka and J.-S. Shiue. Asymptotic positiveness of linear recurrence se-quences.
Fib. Quart. , 28(4), 1990.[29] J. Ouaknine and J. Worrell. Decision problems for linear recurrence sequences. In
Proc. Intern. Workshop on Reachability Problems (RP) , volume 7550 of
LNCS .Springer, 2012.[30] J. Ouaknine and J. Worrell. Positivity problems for low-order linear recurrencesequences. In
Proc. Symp. on Discrete Algorithms (SODA) . ACM-SIAM, 2014.[31] J. Ouaknine and J. Worrell. Ultimate Positivity is decidable for simple linearrecurrence sequences. In
Proc. Intern. Colloq. on Automata, Languages and Pro-gramming (ICALP) , LNCS. Springer, 2014. Full version as arXiv:1309.1914.[32] V. Pan. Optimal and nearly optimal algorithms for approximating polynomialzeros.
Computers & Mathematics with Applications , 31(12), 1996.[33] J. Renegar. On the computational complexity and geometry of the first-ordertheory of the reals. Part I: Introduction. Preliminaries. The geometry of semi-algebraic sets. The decision problem for the existential theory of the reals.
J.Symb. Comp. , 1992.[34] G. Rozenberg and A. Salomaa.
Cornerstones of Undecidability . Prentice Hall,1994.[35] A. Salomaa. Growth functions of Lindenmayer systems: Some new approaches. InA. Lindenmayer and G. Rozenberg, editors,
Automata, Languages, Development .North-Holland, 1976.[36] M. Soittola. On D0L synthesis problem. In A. Lindenmayer and G. Rozenberg,editors,
Automata, Languages, Development . North-Holland, 1976.[37] P. Tangsupphathawat, N. Punnim, and V. Laohakosol. The positivity problemfor fourth order linear recurrence sequences is decidable.
Colloq. Math. , 128(1),2012.[38] T. Tao.
Structure and Randomness . American Mathematical Society, 2008.[39] S. P. Tarasov and M. N. Vyalyi. Orbits of linear maps and regular languages. In
Proc. Intern. Comp. Sci. Symp. in Russia (CSR) , volume 6651 of
LNCS . Springer,2011.[40] A. Tarski.
A Decision Method for Elementary Algebra and Geometry . Universityof California Press, 1951.[41] N. K. Vereshchagin. The problem of appearance of a zero in a linear recurrencesequence (in Russian).
Mat. Zametki , 38(2), 1985.[42] K. Yokoyama, Z. Li, and I. Nemes. Finding roots of unity among quotients of theroots of an integral polynomial. In