A simple, polynomial-time algorithm for the matrix torsion problem
The Matrix Torsion Problem (MTP) is: given a square matrix M with rational entries, decide whether two distinct powers of M are equal. It has been shown by Cassaigne and the author that the MTP reduces to the Matrix Power Problem (MPP) in polynomial …
Authors: Francois Nicolas
A simple, p olynomial-time algorithm for the matrix torsion problem F ran¸ cois Nicola s Octob er 30 , 2018 Abstract The Matrix T orsion Problem (MTP) is: given a square matrix M with ratio nal en tries, decide whether t w o distinct pow e rs of M are equal. It has b een sho wn b y Cassaigne and the author th at the MTP reduces to the Matrix Po w er Problem (MPP) in p olynomial time [1]: giv en t w o squ are matrices A and B with rational en tries, the MTP is to decide whether B is a pow er of A . Since the MPP is decidable in p olynomial time [3], it is also the case of the MTP . Ho w ever, the algorithm for MPP is highly non-trivial. The aim of this note is to present a simple, direct, p olynomial- time algorithm for the MTP . 1 In tro ductio n As usual N , Q and C denote the semiring of non-negative in tegers, t he field of rational n umbers and the field of comple x n umbers, resp ectiv ely . Definition 1 (T orsion) . L et M b e a squar e matrix over C . We say that M is torsion if it satisfies the fol lowing thr e e e quival e nt assertions. ( i ) . Ther e ex ist p , q ∈ N such that p 6 = q and M p = M q . ( ii ) . The m ultiplic ative semigr o up { M , M 2 , M 3 , M 4 , . . . } has finite c a r din ality. ( iii ) . The se quenc e ( M , M 2 , M 3 , M 4 , . . . ) is eventual ly p erio dic. The aim of this no t e is to presen t a p olynomial-time algo rithm for the fo llowing decision problem: Definition 2. The Matrix T orsion Problem ( MTP) is: given as input a squar e matrix M over Q , de c ide whether M is torsion. F or ev ery square matrix M o v er Q , the size of M is defined as the order of M p lus t he sum of the lengths of the binary e nco dings o v er all en tries of M . 1 Previous w ork. The Matrix Po w er Problem (MPP) is : giv en tw o square matrices A and B o v er Q decide whether there exists n ∈ N such t ha t such t ha t A n = B . Kannan and Lipton sho w ed that the MPP is decidable in p olynomial time [3 ]. It is rather easy to pro v e that the MTP is decidable in p olynomial time b y reduction to the MPP (see Section 4). Ho wev er, the original algorithm for the MPP is highly non- t r ivial. Hence, a simple, direct algorithm is s till in teresting. 2 Generaliti e s Throughout this paper, z denotes an indeterminate. The next result is w ell-know n and pla ys a crucial role in the pap er. Prop osition 1 (Multiple ro ot elimination) . F or every p olynomial ν ( z ) over C , the p o ly- nomial π ( z ) : = ν ( z ) gcd( ν ′ ( z ) , ν ( z )) satisfies the fol lowing two pr op erties: • ν ( z ) and π ( z ) ha v e the sam e c omplex r o ots, an d • π ( z ) has n o multiple r o ots. The set of all p ositive in tegers is denoted N ∗ . F or every n ∈ N ∗ , the n th cyclotomic p olyno m ial is denoted γ n ( z ): γ n ( z ) = Q ( z − u ) where t he pro duct is o v er all primitive n th ro ots o f unity u ∈ C . It is w ell-known t hat γ n ( z ) is a monic in t eger p olynomial and that the follo wing three prop erties hold [4]: Prop erty 1. F or every m ∈ N ∗ , z m − 1 = Q n ∈ D m γ n ( z ) , wher e D m denotes the set of al l p o sitive divisors o f m . Prop erty 2. F or every n ∈ N ∗ , γ n ( z ) is irr e ducibl e over Q . Euler’s totient function is denoted φ : fo r ev ery n ∈ N ∗ , φ ( n ) equals the num b er o f k ∈ { 1 , 2 , . . . , n } suc h that gcd( k , n ) = 1. Prop erty 3. F or every n ∈ N ∗ , γ n ( z ) is of de gr e e φ ( n ) . The next low er b ound f or Euler’s totien t function is fa r from optimal. Ho wev er, it is sufficien t fo r our purp ose. Prop osition 2. F or every n ∈ N ∗ , φ ( n ) is gr e ater than or e qual to p n / 2 . A pro of of Prop osition 2 can b e found in app endix. Notew ort h y is that φ ( n ) ln ln n n con ve rges to a positive , finite limit as n tends to ∞ . [2]. 2 3 The n e w algo rithm Definition 3. F or every n ∈ N ∗ , let π n ( z ) : = n Y j = 1 γ j ( z ) . T o prov e that the MT P is decidable in p olynomial time, w e prov e that • a d -b y- d matrix o v er Q is torsion if and o nly if it annihilates z d π 2 d 2 ( z ), and that • z d π 2 d 2 ( z ) is computable from d in p oly( d ) time. Prop osition 3. L et d , n ∈ N ∗ b e such that for e very inte g e r m gr e ater than n , φ ( m ) is gr e ater than d . F or ev e ry d -by- d m a trix M over Q the fol lowing thr e e assertions ar e e q uiva lent. ( i ) . M is torsion . ( ii ) . M annihilates z d π n ( z ) . ( iii ) . M satisfies M n !+ d = M d . Pr o of. The implication ( iii ) = ⇒ ( i ) is clear. Moreov er, it follo ws from Property 1 that π n ( z ) divides z n ! − 1, a nd th us z d π n ( z ) divides z n !+ d − z d . Therefore, ( ii ) = ⇒ ( iii ) holds. Let us no w sho w ( i ) = ⇒ ( ii ). Assume that M is torsion. L et p , q ∈ N b e suc h that p < q and M p = M q . Let µ ( z ) denote the minimal p olynomial of M o v er Q . Since M q − M p is a zero matrix, µ ( z ) divides z q − z p . By Prop erty 1, z q − z p can b e factorized in the form z q − z p = z p Q j ∈ D q − p γ j ( z ); b y Prop ert y 2 all factors are irreducible ov er Q . Hence, µ ( z ) can b e written in the for m µ ( z ) = z k Q j ∈ J γ j ( z ) for some in teger k satisfying 0 ≤ k ≤ p and some J ⊆ D q − p . Besides, the Cayle y-Hamilton theorem implies that µ ( z ) divides the c haracteristic p olynomial of M whic h is of de gree d . Therefore, d is not smaller than the degree of µ ( z ). Since the degree of µ ( z ) equals k + P j ∈ J φ ( j ) by Prop ert y 3 , w e ha v e k ≤ d and max J ≤ n . Hence, µ ( z ) divides z d π n ( z ). Com bining Propositions 2 and 3, w e obta in that for ev ery d ∈ N ∗ , a d -by - d matrix ov er Q is torsion if and only if it annihilates the polynomial z d π 2 d 2 ( z ). T o conclude the pap er, it remains to explain how to compute π n ( z ) in p oly( n ) time fr o m an y n ∈ N ∗ tak en as input. The idea is to rely on Prop osition 1. Definition 4. F or every n ∈ N ∗ , let ν n ( z ) : = n Y j = 1 ( z j − 1) . Let n ∈ N ∗ . Clearly , ν n ( z ) is computable in p o ly( n ) time. Moreo v er, it follo ws from Prop ert y 1 that ν n ( z ) = n Y j = 1 ( γ j ( z )) ⌊ n/j ⌋ , 3 and th us ν n ( z ) and π n ( z ) ha v e the same ro ots. Since π n ( z ) has no m ultiple ro ots, Prop o- sition 1 y ields a w a y to compute π n ( z ) from ν n ( z ) in p olynomial time: Prop osition 4. F or every n ∈ N ∗ , π n ( z ) : = ν n ( z ) gcd( ν ′ n ( z ) , ν n ( z )) . 4 Commen ts The failure of the naiv e approac h. Com bining Prop ositions 2 and 3, we obtain: Corollary 1 (Mandel and Simon [5, Lemma 4.1]) . L et d ∈ N ∗ . Every d -by- d torsion matrix M over Q satisfies M (2 d 2 )!+ d = M d . It follo ws from Prop osition 1 that t he MTP is decidable. Ho w ev er, such an appro ac h do es not y ield a polynomial- time algorithm for the MTP: Prop osition 5. L et t : N ∗ → N ∗ b e a function such that fo r e ach d ∈ N ∗ , every d -by- d torsion m a trix M over Q satisfies M t ( d )+ d = M d . T h en, t ha s exp onential gr owth. Pr o of. F or eve ry n ∈ N ∗ , let ℓ ( n ) denote the least common m ultiple of all p ositiv e in tegers less than or equal to n : ℓ (3) = 6, ℓ (4) = 12, ℓ (5) = ℓ (6) = 60, etc . It is w ell-know n that ℓ has exponential gro wth: fo r ev ery n ∈ N ∗ , ℓ (2 n ) ≥ 2 n n ≥ 2 n [2]. F or e v ery d -b y- d non-singular matrix M o v er Q , M t ( d ) is the iden tit y matrix. Besides, for ev ery in teger k with 1 ≤ k ≤ d , there exists a d - b y- d permutation mat rix that g enerates a cyc lic group of order k , and th us k divides t ( d ). It follo ws that ℓ ( d ) divides t ( d ). Reducing the MTP to the MPP . F or t he sak e of completeness , let us describ e the reduction from the MTP to the MPP . Let d ∈ N ∗ and let M b e a d -b y- d matrix o ve r Q . Let N 2 : = 0 1 0 0 , A : = M d O O N 2 , O 2 : = 0 0 0 0 and B : = M d O O O 2 where O denotes b oth the d -b y-tw o zero matrix and its transpose. It is clear that A and B are t w o ( d + 2)- b y-( d + 2) matrices o ve r Q . Moreov er, there exists n ∈ N s uc h that A n = B if and only if M is torsion [1]. 5 Op e n question Let d ∈ N ∗ . It follow s fr om Corollary 1 tha t for ev ery d -b y- d torsion matrix M o v er Q , the s equence ( M d , M d +1 , M d +2 , M d +3 , . . . ) is (purely) p erio dic with p erio d a t most (2 d 2 )!. Hence, the maxim um cardinality of { M d , M d +1 , M d +2 , M d +3 , . . . } , o v er all d -b y- d torsion matrices M ov er Q , is w ell-defined. T o our kno wledge, it s asymptotic b eha vior as d go es to infinit y is unkno wn. 4 References [1] J. Cassaigne a nd F. Nicolas. On the decidabilit y of semigroup f reeness . Submitted, 2008. [2] G. H. Hardy and E. M. W righ t. An intr o duction to the the o ry of numb ers . Oxford, at the Clarendon P ress, fourth edition, 1979. [3] R. Kanna n a nd R. J. Lipton. Polynomial-time alg orithm for the orbit problem. Journal of the Asso ciation f o r Computing Machinery , 33(4):808–821, 1986. [4] S. Lang. A lgeb r a , v o lume 2 1 1 of Gr aduate T exts in Mathematics . Springer-V erlag, revised third edition, 2 002. [5] A. Mandel and I. Simon. On finite semigroups of matrices. The or etic a l Com puter Scienc e , 5(2):101–111, 1977. Pro o f of Prop osit ion 2 The follo wing t wo prop erties of Euler’s totient function are w ell- kno wn. Prop erty 4. F or every prime numb er p and every v ∈ N ∗ , φ ( p v ) = p v − 1 ( p − 1) . Pr o of. F or ev ery integer k , gcd( k , p v ) is distinc t from one if and only if p divid es k . F rom that w e deduce the eq ualit y { k ∈ { 1 , 2 , . . . , p v } : gcd( k , p v ) 6 = 1 } = pq : q ∈ { 1 , 2 , . . . , p v − 1 } . (1) Besides, it is easy to see that the left-hand side o f Eq uation (1) has cardinalit y p v − φ ( p v ) while its righ t-hand side has cardinalit y p v − 1 . Prop erty 5. F or every m , n ∈ N ∗ , φ ( mn ) = φ ( m ) φ ( n ) whenever g cd( m, n ) = 1 . Prop ert y 5 is consequenc e of t he Chinese remainde r theorem. It states that φ is mult i- plic ative . Lemma 1. F or every r e al numb er x ≥ 3 , √ x i s less than x − 1 . Pr o of. The t w o ro ots of the quadratic p olynomial z 2 − z − 1 are 1+ √ 5 2 ≈ 1 . 6 18 and 1 − √ 5 2 ≈ − 0 . 618; they are b oth smaller than √ 3 ≈ 1 . 732. Therefore, y 2 − y − 1 is p ositiv e for ev ery real n umber y ≥ √ 3. Since for every real n umber x ≥ 3, √ x is not less t ha n √ 3, ( x − 1) − √ x = ( √ x ) 2 − √ x − 1 is p o sitiv e. Lemma 2. L et p and v b e two inte gers w i th p ≥ 2 and v ≥ 1 . I ne q uality p v/ 2 ≤ p v − 1 ( p − 1) holds if and only if ( p, v ) 6 = (2 , 1 ) . 5 Pr o of. If ( p, v ) = (2 , 1) then p v/ 2 = √ 2 is greater t ha n 1 = p v − 1 ( p − 1). If v ≥ 2 then v / 2 ≤ v − 1, and t hus p v/ 2 ≤ p v − 1 ≤ p v − 1 ( p − 1) follo ws. If v = 1 and p ≥ 3 then p v/ 2 = √ p is less than p − 1 = p v − 1 ( p − 1) according to Lemma 1. Lemma 3. L et n ∈ N ∗ . If n is o dd or if four divide s n then φ ( n ) is gr e ater than or e qual to √ n . Pr o of. It is clear that φ (1) = 1 = √ 1. Let n b e an in teger greater than one. W rite n in the form n = r Y i =1 p v i i where r , v 1 , v 2 , . . . , v r are p ositiv e in tegers and where p 1 , p 2 , . . . , p r are pairwise distinct prime n um b ers. Prop erties 4 and 5 yie ld: φ ( n ) = r Y i =1 φ ( p v i i ) = r Y i =1 p v i − 1 i ( p i − 1) . Assume either that n is odd or that four divides n . Then, for each index i with 1 ≤ i ≤ r , ( p i , v i ) is distinct from (2 , 1) and th us inequalit y p v i / 2 i ≤ p v i − 1 i ( p i − 1) holds. F rom that w e deduce φ ( n ) ≥ r Y i =1 p v i / 2 i = √ n . Pr o of of Pr op osition 2. If n is o dd or if f our divides n then Lemma 3 ensures φ ( n ) ≥ √ n ≥ p n/ 2. Con ve rsely , assume tha t n is ev en and that four do es not divide n : there ex ists an o dd in teger n ′ suc h that n = 2 n ′ . W e ha ve • φ ( n ) = φ (2) φ ( n ′ ) = φ ( n ′ ) according to P rop ert y 5, a nd • φ ( n ′ ) ≥ √ n ′ = p n/ 2 b y Lemma 3. F rom tha t w e deduce φ ( n ) ≥ p n/ 2. 6
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment