Functional Decomposition of Symbolic

Stephen M. Watt Ontario Research Centre for Department of Computer Science, University of Western Ontario London Ontario, CANADA N6A 5B7 [email protected]

Abstract In earlier work we have observed that there is an impor- tant gap between the current worlds of computer algebra Earlier work has presented algorithms to factor and and symbolic computation [23]. We have shown that un- compute GCDs of symbolic Laurent polynomials, that is der certain conditions symbolic polynomials form a unique multivariate polynomials whose exponents are themselves factorization domain and have given algorithms to compute integer-valued polynomials. This article extends the no- their factorizations and GCDs [23, 25]. We have explored tion of univariate decomposition to symbolic the question of how t make these algorithms more efficient polynomials and presents an algorithm to compute these when the exponents of the symbolic polynomials are them- decompositions. For example, the symbolic polynomial selves sparse [12, 13, 24]. In related work, we have exam- 2 2 2 f(X) = 2Xn +n − 4Xn + 2Xn −n + 1 can be de- ined how to perform arithmetic on matrices with blocks of composed as f = g ◦ h where g(X) = 2X2 + 1 and symbolic size [21]. We are interested in results that are valid 2 2 h(X) = Xn /2+n/2 − Xn /2−n/2. for all values of the symbolic parameters, e.g. for all values of n. This notion of symbolic polynomial is related to ex- ponential polynomials [3, 5, 6, 19, 20] and to parametric families of polynomials [16, 27, 28]. 1. Introduction This paper is organized as follows: Section 2 gives the It often arises that the general form of a polynomial is preliminaries necessary to phrase our problem precisely. known, but the particular values for the exponents are un- Section 3 then states the decomposition problem. Sections 4 known. For example, we may know a polynomial is of the and 5 provide the necessary theory on which symbolic poly- n2+1 2n form 3X − X + 2, where n is an integer-valued pa- nomial decomposition depends. Section 4 gives theorems rameter. We call this a “symbolic polynomial”—a notion about the existence and uniqueness of symbolic polynomial we define more precisely later—and ask what computations composition and Section 5 shows that complete decompo- we can perform on such values. sitions exist, the form they must take and how different de- Computer algebra systems are very good at performing compositions must be related. Section 6 presents our algo- arithmetic in particular algebraic domains, such as polyno- rithm for finding symbolic polynomial decompositions and mials with coefficients from a particular ring or matrices of Section 7 concludes the paper. a given size with elements from a known ring. They do not do very well in other settings, however, when certain quan- tities are not known in advance. For example, when the co- 2. Preliminaries efficient ring, the dimension of a matrix or the is not known. In this case, a person can perform Our model of symbolic polynomials is one where expo- arithmetic by hand where a will nents are expressed as integer-valued functions of param- abandon knowledge of algebraic algorithms and fall back eters. We model the exponents using integer-valued poly- on general term-rewriting techniques. It is a significant gap nomials. It would be possible to model exponents using in the field of symbolic mathematical computation that al- a larger class of functions, but integer-valued polynomials gorithms for polynomials or matrices with symbolic degrees have been sufficient for our purposes. or sizes remain largely unexplored. In this section, present the notion of integer-valued poly- In the current work, we show how the notion of polyno- nomials and define symbolic polynomials in terms of them. mial decomposition may be extended to symbolic polyno- We also present some basic facts that are used later in the mials and how such decompositions may be computed. article. Integer-Valued Polynomials Symbolic polynomials are isomorphic to the group ring v R[Int ( ) ], taking Int ( ) as an abelian Definition 1 (Integer-valued polynomial). For an integral [n1,...,np] Z [n1,...np] Z group under addition and making the identification domain D with quotient field K, the (univariate) integer- v valued polynomials over D, denoted Int(D), are defined as e1 e2 ev ∼  X1 X2 ··· Xv = (e1, . . . , ev) ∈ Int[n1,...,np](Z) Int(D) = {f | f ∈ K[X] and f(a) ∈ D, for all a ∈ D}. We note that 1 1 For example, n2 − n ∈ Int(Z) because if n ∈ Z, either 2 2 ∼ −1 −1 n or n − 1 is even. Integer-valued polynomials have been R[; X1, ..., Xv] = R[X1, ..., Xv,X1 , ..., Xv ]. studied for many years, with classic papers dating back 90 years [14, 17]. We make the obvious generalization to mul- Definition 5 (Base variables, Exponent variables). In the tivariate polynomials. ring of symbolic polynomials R[n1, ..., np; X1, ..., Xv], we call X1, ..., Xv the base variables and n1, ..., np the expo- Definition 2 (Multivariate integer-valued polynomial). For nent variables. an integral domain D with quotient field K, the (mul- tivariate) integer-valued polynomials over D in variables In a ring of symbolic polynomials, the sets of base and exponent variables need not be disjoint. Indeed, when con- X1,...,Xn, denoted Int[X1,...,Xn](D), are defined as sidering differentiation of symbolic polynomials it is useful

Int[X1,...,Xn](D) = to have the exponent variables to be a subset of the base n {f | f ∈ K[X1,...,Xn] and f(a) ∈ D, for all a ∈ D }. variables. It is possible to define symbolic polynomials some- For consistency we will use the notation Int[X](D) for uni- what more generally, with integer-valued polynomials also variate integer-valued polynomials. as exponents on the coefficients in R, as discussed else- If a polynomial is integer-valued, then there may be a where [23, 25]. We call these extended symbolic polyno- non-trivial common divisor of all its integer evaluations. mials, but do not consider them in this article. Definition 3 (Fixed divisor). A fixed divisor of an integer- valued polynomial f ∈ Int(D) is a value q ∈ D such that Evaluation Homomorphisms q|f(a) for all a ∈ D. When D is totally ordered, the largest fixed divisor is called the fixed divisor. We may evaluate any of the ni at integer val- ues. Such a map evaluates R[n1, ..., np; X1, ..., Xv] → When written in the binomial basis, integer-valued polyno- R[n1, ..., ni−1, ni+1, ..., np; X1, ..., Xv](Z) as a ring homo- mials have the following useful property: morphism. A set of evaluation maps for {ni1 , ..., nik } with distinct i1, ..., ik is associative and commutative. We may Property 1. If f ∈ Int[n1,...,np](Z) ⊂ Q[n1, ...np], then when f is written using basis elements n1 ··· np its co- therefore apply a set of evaluations at once, without regard i1 ip efficients are integers. to the order in which the variables are evaluated. All exponent variables may be evaluated to give The following result tells how to compute the largest fixed −1 −1 divisor of a multivariate integer-valued polynomial. φ : R[n1, ..., np; X1, ..., Xv] → R[X1, ..., Xv,X1 , ..., Xv ]. Property 2. If f ∈ Int ( ), then the fixed divisor of [n1,...,np] Z That is, φ evaluates symbolic polynomials to Laurent poly- f may be computed as the gcd of the coefficients of f when nomials. It would be possible to construct a model for written in the binomial basis. symbolic polynomials that under evaluation had no negative variable exponents. That would, however, require keeping Symbolic Polynomials track of cumbersome domain restrictions on the exponent Definition 4 (Symbolic polynomial). The ring of symbolic variables. polynomials in X1, ..., Xv with exponents in n1, ..., np over the coefficient ring R is the ring consisting of finite sums of Algebraic Structure the form X By definition, symbolic polynomials have a ring structure c Xei1 Xei2 ··· Xein i 1 2 n and algorithms to add and multiply them can be obtained i straightforwardly from the definition. Symbolic polynomi- where c ∈ R and e ∈ Int ( ). Multiplication i ij [n1,n2,...,np] Z als also have a useful multiplicative structure. is defined by

e1 en f1 fn e1+f1 en+fn Theorem 1 (Symbolic polynomial unique factorization). bX1 ··· Xn × cX1 ··· Xn = bc X1 ··· Xn . The ring R[n1, ...np; X1, ...Xv] is a UFD if and only if the We denote this ring R[n1, ..., np; X1, ..., Xv]. ring R[X1, ..., Xk] is a UFD. In previous articles [23, 25] we have shown how to com- Symbolic Polynomial Decomposition pute GCDs and factorizations of symbolic polynomials. Unlike polynomial rings, symbolic polynomial rings are These algorithms fall into two families: extension methods, not closed under functional composition. For example, based on the algebraic independence of variables to differ- n n n2 if g(X) = X and h(X) = X + 1 then g(h(X)) = ent powers (e.g. x, x , x ,...), and homomor- n P nXi cannot be expressed in finite terms of group phism methods, based on the evaluation and interpolation i=0 i ring operations. We therefore make the following defini- of exponent polynomials. tion. Both these methods become costly if multivariate expo- nent polynomials are treated as dense [12, 13]. This was Definition 6 (Univariate composition of symbolic polyno- a problem in particular for extension methods because the mials). Let g, h ∈ R[n1, ..., np; X]. A composition of g P ei first algorithms converted exponent polynomials to a bino- and h is a finite sum f = i fiX ∈ R[n1, ..., np; X] mial basis to handle fixed divisors, thus making exponent such that under all evaluation maps, φ : {n1, ..., np} → Z, polynomials dense. A transformation for efficient sparse φf = φg ◦ φh. exponents eliminates this problem [24]. For brevity, we make the use the following definition. Theorem 2 (Integer exponent coefficients). Definition 7 (Trivial symbolic polynomial). A symbolic If f ∈ R[n1, ..., np; X1, ..., Xv] with exponents in d!p polynomial f ∈ R[n1, ..., np; X] is trivial if f = c1X + Int[n1,...,np](Z), then the substitution σ : Xi 7→ Xi −1 −1 c0 ∈ R[X] or f = c−1X ∈ R[X,X ]. gives σf ∈ R[n1, ..., np; X1, ..., Xv] with exponents in Z[n1, ...np]. We may now state the problems we wish to solve. First we have the basic question. 3. The Problem Problem 2. Let f ∈ P = R[n1, . . . , np; X]. Determine whether there exist two non-trivial symbolic polynomials Polynomial Decomposition g, h ∈ P such that f(X) = g(h(X)) and, if so, find such a If a univariate polynomial is regarded as a function of pair. its variable, then we may ask whether the polynomial is More generally, we have: the composition of two polynomial functions of lower de- gree. This can be useful in simplifying expressions, solv- Problem 3. Let f ∈ P = R[n1, . . . , np; X]. Determine ing polynomial equations exactly or determining the dimen- whether there exist T non-trivial indecomposable symbolic sion of a system. Polynomial decomposition has been stud- polynomials g1, . . . , gT ∈ P such that f = g1 ◦ · · · ◦ gT ied for quite some time, with early work by Ritt and oth- and, if so, find such a decomposition. ers [1, 2, 10, 18]. Algorithms for polynomial decomposition Can there be more than one such decomposition? We ask: have been proposed and refined for use in computer algebra systems. Problem 4. Determine what forms can decompositions f = The univariate polynomial decomposition problem may g1 ◦ · · · ◦ gT can take. be stated as: This article answers these questions. Problem 1. Let f ∈ R[X]. Determine whether there exist two polynomials g, h ∈ R[X] of degrees greater than 1 such 4. Composition Theorems that f(X) = g(h(X)) and, if so, find them.

If g and h are further decomposed, then we may find f = We now present theorems on the uniqueness and exis- tence of symbolic polynomial compositions. We first show g1 ◦ · · · ◦ gk. Ritt showed that (over a field of characteris- tic zero) this full decomposition is unique up to the equiva- uniqueness. m n n m lences X ◦X = X ◦X and Tn ◦Tm = Tm ◦Tn, where Theorem 3 (Composition uniqueness). If a composition of Tn(X) is the Chebyshev polynomial cos(n arccos X). two symbolic polynomials exists, then it is unique. Generalizations of this problem include decomposi- tion of multivariate polynomials [4, 22], rational func- Proof. Let g, h ∈ R[n1, ..., np; X]. Suppose there are two tions [30], algebraic functions [11] and Laurent polynomi- compositions p and q of g and h. Then, under any evalua- als [15, 29]. The relationship between polynomial composi- tion map φ for n1, ..., np, we must have φp = φq. Since the tion and polynomial systems has also been studied [7, 8, 9]. exponents of p are all distinct polynomials in Q[n1, ..., np], Here we generalize the problem to the decomposition of and likewise for the exponents of q, we may find an infi- symbolic polynomials. nite number of evaluations which keep all exponents of p distinct and all exponents of q distinct. As there are only If Condition 3 holds, then a finite number of ways to put the terms of p into corre- spondence with the terms of q, this means there is at least R  S pi X X qj one correspondence of terms for which the exponents agree g(h(x)) = gi hjX on an unbounded number of distinct evaluations for each i=1 j=1 R p variable ni. Since the exponents are polynomials of fixed i  p  X X i q1 j1 qS jS degree this implies there is a correspondence equating the = gi (h1X ) ··· (hSX ) j1, ..., jS terms of p and terms of q, and hence p = q. i=1 j1+···+jS =0 R pi   S ! X X pi Y j PS We denote this unique composition, if it exists, as g ◦ h or k k=1 jkqk = gi hk X . g(h(X)). j1, ..., jS i=1 j1+···+jS =0 k=1 We now restrict our attention to the case where the coef- ficient ring is the field of complex numbers. This allows the Because each pi ∈ N0, this is a finite sum with coeffi- case where roots of unity are required and avoids technical- cients in C and powers of X in Int[n1,...,np](Z). Therefore ities arising when the characteristic of the coefficient field g(h(X)) ∈ C[n1, ..., np; X]. divides the degree of g. This so-called “wild” case is less important with symbolic polynomials because degrees are If g(h(X))∈P, then one of the conditions must hold (⇐) not always fixed values. We consider three disjoint and exhaustive cases: Theorem 4 (Composition existence). Let • Case A, where h is a monomial,

R S • Case B, where h is not a monomial and asymptotically X pi X qi g(X) = giX h(X) = hiX all pi ≥ 0, i=1 i=1 • Case C, where h is not a monomial and asymptotically be symbolic polynomials in P = C[n1, ..., np; X], with some pi < 0. gi 6= 0, hi 6= 0, and with the pi all distinct and the qi all distinct. The functional composition g(h(X)) exists in P if and only if at least one of the following conditions hold: Case A: h is a monomial

Condition 1. h is a monomial and g ∈ C[X,X−1], We have th R Condition 2. h is a monomial with coefficient h1 a d root X g(h(x)) = g(h Xq1 ) = g hpi Xpi+q1 of unity, where d is a fixed divisor of all pi, 1 i 1 i=1 Condition 3. g ∈ [X]. C pi If all pi ∈ Z, then h1 ∈ C and Condition 1 is satisfied. Proof. Otherwise there exists at least one i0 for which pi0 6∈ Z.

Then pi0 is a polynomial in n1, ..., np that takes on some If any of the conditions hold, then g(h(X)) ∈ P (⇒) number of distinct integer values, m1, m2, .... We must m m −m have hmi = h j so so h i j = 1. Since m 6= m if If Condition 1 holds, then 1 1 1 i j i 6= j, h1 must be a root of unity. For each pair (i, j) there R R exist q, r ∈ Z, 0 ≤ r < |mj| such that mi = qmj + r X q1 pi X pi q1+pi mi mj q r r g(h(X)) = gi(h1X ) = gih1 X so h1 = (h1 ) h1 = h1 = 1. Repeating this gives i=1 i=1 gcd(mi,mj ) th h1 = 1 and we have shown h1 must be a d root pi of unity for some fixed divisor d of pi . Likewise h1 must Since pi ∈ Z, we have h1 ∈ C and g(h(X)) ∈ 0 be a dth root of unity for some fixed divisor d for each other C[n1, ..., np; X]. i i d pi. Therefore Condition 2 is satisfied. If Condition 2 holds, then there is a d ∈ Z such that h1 = 1 0 0 and pi = dpi for some pi ∈ Int[n1,...,np](Z). We then have Case B: h not a monomial and asymptotically all pi ≥ 0 R R p0 X q1 pi X d i q1+pi g(h(X)) = gi (h1X ) = gi h1 X We assume that g(h(X)) ∈ P with some exponent pi 6∈ i=1 i=1 N0 and show this leads to a contradiction and therefore that R Condition 3 must hold. X q1+pi = giX ∈ C[n1, ..., np; X]. We consider two sub-cases depending on whether q1 is i=1 asymptotically positive or negative. In both cases, choose q2 2 one of the variables ni and call it n. Evaluate the other ni at Expanding the quadratic terms (h2X + η) , we have integer points that do not make pi constant if it contains n. We show the contradiction with these univariate exponents. g(h(X)) =

p1 A1 p1−1 A2 p1−1 A3 g1h1 X + g1p1h1 h2X + g1p1h1 X η   p1 + g hp1−2h2XA4 1 2 1 2 Case B.1: q > 0 1     p1 p1 + 2g hp1−2h XA5 η + g hp1−2XA6 η2 1 2 1 2 1 2 1 We consider the case where all pi and q1 remain positive as + g1L1 n grows. In this case, there exists NB such that for n > NB we have pi ≥ 0, q1 > 0, all the pi are distinct and p2 B1 p2−1 B2 p2−1 B3 + g2h X + g2p2h h2X + g2p1h X η retain their relative order and likewise for the qi. Label the 1 1 1 p  exponent polynomials such that p1 > p2 > ··· > pR and 2 p2−2 2 B4 + g2 h1 h2X q1 > q2 > ··· > qR. 2     p2 p2 We have + 2g hp2−2h XB5 η + g hp2−2XB6 η2 2 2 1 2 2 2 1

+ g2L2 R S X X qj pi g(h(X)) = gi( hjX ) + L∗ i=1 j=1

Let where

q1 q2 h(X) = h1X + h2X + η A1 = q1p1 B1 = q1p2 A2 = q1(p1 − 1) + q2 B2 = q1(p2 − 1) + q2 A = q (p − 1) B = q (p − 1) q3 qS 3 1 1 3 1 2 where η = h3X + ··· + hSX . A4 = q1(p1 − 2) + 2q2 B4 = q1(p2 − 2) + 2q2 Since p1 > p2 ≥ 0, we may write binomial expansions A5 = q1(p1 − 2) + q2 B5 = q1(p2 − 2) + q2 of the terms h(X)p1 and h(X)p2 . A6 = q1(p1 − 2) B6 = q1(p2 − 2)

R X q1 q2 pi g(h(X)) = gi(h1X + h2X + η) We adopt the conventions deg 0 = −∞, p3 = −∞ if i=1 R = 2, and q3 = −∞ if S = 2. The argument can be made  more precise by dividing into cases where various terms are q1 p1 q1 p1−1 q2 = g1 (h1X ) + p1(h1X ) (h2X + η) zero, thereby avoiding degrees of −∞. We then have    p1 + (h Xq1 )p1−2(h Xq2 + η)2 + L 2 1 2 1 deg L ≤ q (p − 3) + 3q  1 1 1 2 q1 p2 q1 p2−1 q2 + g2 (h1X ) + p2(h1X ) (h2X + η) deg L2 ≤ q1(p2 − 3) + 3q2 deg L ≤ q p p   ∗ 1 3 2 q1 p2−2 q2 2 + (h1X ) (h2X + η) + L2 deg η ≤ q 2 3

+ L∗, with equality whenever the quantities are non-zero. where one or more of η, L1, L2 and L∗ may be zero. If Examining the degrees of each term of our expansion, R = 1 then the g2 term and L∗ are zero and the argument we observe that the terms with A1 and A2 are distinct from specializes. each other and from all the rest involving Ai, L1 and L∗. We have The possible situations are:

A1 > A2 > B1 ≥ all the rest involving Ai,Bi,Li,L∗, A1 > A2 since A1 = q1p1 = q1(p1 − 1) + q1 A1 > B1 = A2 > all the rest involving Ai,Bi,Li,L∗, > q1(p1 − 1) + q2 = A2. A1 > B1 > A2 > all the rest involving Ai,Bi,Li,L∗. A2 > A3 + deg η since A2 = q1(p1 − 1) + q2 If A2 6= B1, we have > q1(p1 − 1) + q3 p1 p1q1 p1−1 (p1−1)q1+q2 = A3 + deg η. g(h(X)) =g1h1 X + g1p1h1 h2X

A2 > A4 since A2 = q1(p1 − 1) + q2 + lower order terms.

= q1(p1 − 2) + q1 + q2 If A2 = B1, we have > q1(p1 − 2) + 2q2 = A4. p1 p1q1 p1−1 p2  q1p2 A4 > A5 + deg η since A4 = q1(p1 − 2) + 2q2 g(h(X)) =g1h1 X + g1p1h1 h2 + g2h1 X

> q1(p1 − 2) + q2 + q3 + lower order terms.

= A5 + deg η. In all situations p1 appears in a coefficient so it must be A5 + deg η constant. Since the pi are integer-valued polynomials, and > A6 + 2deg η since A5 + deg η since pi ≥ 0, we now have that all pi are non-negative inte- gers, contradicting our hypothesis that at least one of them = q1(p1 − 2) + q2 + q3 was non-constant. Therefore Condition 3 must be satisfied. > q1(p1 − 2) + 2q3

= A6 + 2deg η Case B.2: q1 ≤ 0 A2 > deg L1 since A2 = q1(p1 − 1) + q2 0 0 −1 Let qi = −qi and h (X) = h(X ). Then = q1(p1 − 3) + 2q1 + q2 S S > q (p − 3) + 3q 0 1 1 2 0 −1 X −qi X q h (X) = h(X ) = hiX = hiX i . ≥ deg L1 i=0 i=0 A2 > deg L∗ since A2 = q1(p1 − 1) + q2 0 Note that q1 = 0 ≥ q2 + 1 so q2 < 0 and q2 > 0. Re- > q1(p1 − 1) − q1 0 0 labeling the qi to reverse their order gives g ◦ h satisfying = q1(p1 − 2) the conditions of Case B.1. Therefore Condition 3 must be satisfied. ≥ q1p3 ≥ deg L∗

Case C: h not a monomial and asymptotically ∃pi < 0

In the last inequality we have used the fact that pi ≥ pi+1+1 Again, label the pi and qi so that asymptotically p1 > p2 > and q1 > 0. Likewise, we observe that the terms with B1 ··· > pR and q1 > q2 > ··· > qS. In this case not all and B2 are distinct from each other and from all the rest of the pi will be asymptotically non-negative. Let i0 be the involving Bi, L2 and L∗. smallest i such that as n → ∞ we have pi < 0. There then exists a value NC such that for all n > NC we have pi ≥ 0 for i < i0 and pi < 0 for i ≥ i0. B1 >B2 > B3 + deg η We may write B2 > B4 > B5 + deg η > B6 + 2deg η g(h(X)) = A + B, where B2 > deg L2 i0−1 S 1 B2 > deg L∗ X pi X A = gih(X) B = gi . h(X)−pi i=1 i=i0 The terms involving A and B are related by the inequali- i i For n > N , the exponent polynomials p are non-negative ties C i in A and the −pi are non-negative in B. We may put the sum B over a common denominator. A > B since A = q p > q p = B , 1 1 1 1 1 1 2 1 PS QS −pj i −1 g h(X) 0 i=i0 i j=i0 A2 > B2 since A2 = q1(p1 − 1) + q2 X pi j6=i g(h(X)) = gih(X) + S . Q h(X)−pj > q1(p2 − 1) + q2 = B2. i=1 j=i0 For each n > NC , we have A ∈ Z[X] and B ∈ Z(X) Proof. By Theorem 4, f may be a composition in one of with numerator degree strictly less than denominator de- only three ways. The decomposition factors may them- gree. Since h(X) is not a monomial and since the powers selves be decomposed only in the same ways, etc. Induction in the denominator of B are non-zero, the denominator of on the number of composition operators and associativity of B will have poles other than at 0 and infinity. Therefore, for functional composition gives the result. B to be a Laurent polynomial its numerator must be identi- cally zero. To examine this case, let Theorem 6 (Complete decomposition existence). For every f ∈ P = [n1, ..., np; X] there is a number N S C X such that every decomposition of f has at most N decom- p˜ = −p , for i ≥ i . i j 0 position factors. j=i0 j6=i Proof. If f is trivial or is not the composition of two non- Then the numerator of B is trivial symbolic polynomials, then f = g1 is a complete de- composition and N = 1. If f is non-trivial and f = h ◦ h S 1 2 X p˜i for non-trivial h1, h2 ∈ P, it may be possible to decompose g˜(h(X)) = gih(X) h1 or h2 further non-trivially and then to decompose the de- i=i 0 composition factors non-trivially, and so on. We show this

Note that all p˜i > 0 for n > NC . We have already shown process must terminate. that for g˜(h(X)) to exist in P under these conditions we Choose an asymptotic ordering of terms, ≺, and let must have g˜(X) ∈ Z[X]. Therefore for to have g˜(h(X)) = deg p and ldeg p be the exponents of the leading and trail- 0 we must have g˜(X) = 0. That is, we must have gi = 0 ing terms of p with respect to that order. Let deg f = for i ≥ i0, contradicts the conditions regarding g. ae1 × · · · × eQ be the complete factorization of deg f in Therefore there can be no compositions in P in Case C. Q[n1, ..., np] with ei =e ˜i/di, where e˜i ∈ Z[n1, ..., np] is primitive and di is the fixed divisor of e˜i. Then ei is integer- valued with fixed divisor 1 and a ∈ Z because deg f is 5. Decomposition Theorems integer-valued. Let the factorization of a into integer primes be a = u × a1 × · · · × aW , with u = ±1. This means there can be at most Q + W decomposition factors with deg A symbolic polynomial may be a composition in more other than ±1. A similar bound exists for ldeg . than one way. We address the question of how such decom- It remains to show that there cannot be an unbounded positions are related. We begin by introducing the notion of number of composition factors with both deg and ldeg a complete decomposition. equal to ±1. We have stipulated that none of the decom- Definition 8 (Decomposition, decomposition factor, com- position factors may be trivial, so if deg hik = 1 then ldeg h ≤ −1, and if deg h = −1 then ldeg h ≤ −2. plete and partial decomposition). If f = g1 ◦ · · · ◦ gT , ik ik ik We can have a bounded number of decomposition factors g1, . . . , gt ∈ P = R[n1, ..., np; X], and no gi is trivial un- not of the form c X + c + c X−1 with c , c 6= 0 and less T = 1, then the list (g1, . . . , gt) is a decomposition 1 0 −1 1 −1 by Theorem 5 we can have at most one of these. of f. Each of the gi is a decomposition factor of f. If no gi = h1 ◦ h2 for non-trivial h1, h2 ∈ P, then (g1, ..., gT ) is a complete decomposition and otherwise it is a partial de- We now turn turn to the question of how distinct compo- composition. sitions can be related. From Theorem 5 we see that we will need to consider distinct decompositions of polynomials, of We may write the list (g1, ..., gT ) as g1 ◦ · · · ◦ gT when no symbolic and of a polynomial with a Laurent confusion will arise. polynomial or indecomposable symbolic polynomial. It has been well understood since the early work by Ritt Theorem 5 (Decomposition shape). how distinct polynomial decompositions are related: any Let f ∈ P = [n , ..., n ; X]. Then any decomposition of C 1 p complete decomposition of a polynomial in [X] may be f is of the form C obtained from any other by use of the identities f = p ◦ · · · ◦ p ◦ S ◦ U ◦ · · · ◦ U ,N ≥ 0,M ≥ 0, 1 N 1 M (aX + b) ◦ (1/aX − b/a) = x

ei n m n m n n where pi ∈ C[X], Ui = uiX ∈ P is a monomial whose X ◦ X p(X ) = X p(X) ◦ X coefficients must be certain roots of unity, either S ∈ P or Tn(X) ◦ Tm(X) = Tm(X) ◦ Tn(X) S = ` ◦ H where ` ∈ C[X,X−1] and H = αXν ∈ P is a monomial with no conditions on its coefficient. where p(X) ∈ C[X] and Tn,Tm Chebyshev polynomials. Decompositions involving a polynomial left decompo- Condition 1. S, R ∈ C[X] and either decomposition may sition factor and a Laurent polynomial left decomposition be obtained from the other by successive application factor have been characterized by Zieve. of the identities

Theorem 7 (Zieve [29] 5.6). (aX + b) ◦ (1/aX − b/a) = x −1 n m n m n n Let g1, g2 ∈ C[X]\C and h1, h2 ∈ C[X,X ]\C satisfy X ◦ X p(X ) = X p(X) ◦ X (1) g1 ◦ h1 = g2 ◦ h2. Then, perhaps after switching (g1, g2) Dn(X) ◦ Dm(X) = Dm(X) ◦ Dn(X) and (h1, h2), we have between decomposition factors left of S or R and of g1 = G ◦ G1 ◦ µ1 the identity g = G ◦ G ◦ µ 2 2 2 (aXs) ◦ (bXt) = absXst (2) −1 h1 = µ1 ◦ H1 ◦ H −1 between decomposition factors right of S or R; h2 = µ2 ◦ H2 ◦ H Condition 2. S = S1 ◦ H, R = R1 ◦ H, S, S1,R,R1 ∈ for some G ∈ C[X], some H ∈ C(X), and some linear C[X,X−1]\C[X], H ∈ C(X), and either decompo- µ1, µ2 ∈ C[X], where (G1,G2) satisfy one of sition may be obtained from the other by successive application of the identities (1) and (1) (Xn,Xrp(X)n) where 0 ≤ r < n and gcd(r, n) = 1; X2 ◦ (X − 1/X)p(X + 1/X) = (2) (X2, (X2 − 4)p(X)2); (X2 − 4)p(X)2 ◦ (X + 1/X) (3) (D (X),D (X)); m n 1 1 (X2/3 − 1)3 ◦ (X2 + 2X + − ) (4) ((X2/3 − 1)3, 3X4 − 4X3); 2 X 4X (3) 4 3 1 1 3 (5) (Ddm(X), −Ddn(X)), where d > 1 (3X − 4X ) ◦ ((X + 1 − ) + 4) 3 2X n n and (H1,H2) is the corresponding pair below: (X + 1/X ) ◦ Ddm(X) = m m (ζX) + 1/(ζX) ) ◦ −Ddn(X) (1) (Xrp(Xn),Xn); between decomposition factors to the left of H or the (2) ((X − 1/X)p(X + 1/X),X + 1/X); identity (2) to the right of H; (3) (Dn(X),Dm(X)); Condition 3. S, R ∈ P\ [X,X−1] and either decompo- 2 1 1 1 1 3 C (4) (X + 2X + X − 4X2 , 3 ((X + 1 − 2X ) + 4)); sition may be obtained from the other by successive (5) (Xn+1/Xn, (ζX)m+1/(ζX)m), where ζdmn = −1. application of the identities (1) to the left of S or R or the identity (2) to the right of S or R. Here p(n) ∈ [X] and D is the Dickson polynomial de- C n Here n, m ∈ , s, t ∈ , a, b, ζ ∈ , p(X) ∈ [X] and fined by D (x + 1/x) = xn + 1/xn, related to the Cheby- N Z C C n ζdnm = 1. chev polynomials via Dn(x) = 2Tn(x/2). Cases 1 and 3 correspond to the polynomial setting and the others are new Proof. That the complete decompositions must be of the for Laurent polynomials. form specified is guaranteed by Theorem 5. We are now in a position to make a statement about the For both decompositions we can extract the greatest de- relationship between complete decompositions of symbolic gree monomial right composition factor with respect to a polynomials. particular asymptotic term order. As this decomposition must exist for all particular evaluations of the exponent vari- Theorem 8 (Complete decomposition equivalence). ables, this left composition factor will be unique for any par- Let f ∈ P = C[n1, ..., np; X] be a non-trivial symbolic ticular asymptotic order. The decomposition of symbolic polynomial. If f has two complete decompositions, they monomials is straightforwardly related to the factorization must be of the form of the exponents. As in the proof of Theorem 6, we can split the exponent of the maximal right monomial compo- f = p1 ◦ · · · pN ◦ S ◦ U1 ◦ · · · ◦ UM sition factor into the product of a polynomial part with no = q1 ◦ · · · qN ◦ R ◦ V1 ◦ · · · ◦ VM , fixed divisor and an integer. Both of these can be factored separately and each permutation of these factors gives a dis- with N,M ≥ 0, pi, qi ∈ C[X] and Ui,Vi ∈ P monomials tinct decomposition. Conditions 1 and 2 are then provided and one of the following conditions must hold: by Theorem 7. Algorithm 1 (Symbolic polynomial decomposition). We now consider the situation where g1◦h1 = g2◦h2 and −1 g1, g2 ∈ C[X], h1, h2 ∈ P = C[n1, ..., np; X]\C[X,X ] PT ei INPUT: f = fiX ∈ P = C[n1, ..., np; X] with no right monomial composition factor. The only non- i=1 trivial decompositions hi can have all give a left decompo- OUTPUT: If there exists a decomposition f = g ◦ h, g, h ∈ sition factor in C[X]. We may therefore associate this with P not of the form c1X + c0 ∈ C[X], then output true, ˜ gi and restrict our attention to the case where hi ∈ P are not g and h. Otherwise output false. monomials and have no further non-trivial decomposition. Now, under any evaluation of the exponent variables in Step 1. Handle the case of monomial h. Let q := primitive part of gcd(e1, ..., eT ), k := hi, Theorem 7 must apply. In each of cases (1)–(5), how- gcd(max fixed divisor e1,..., max fixed divisor eT ). ever, the minimum and maximum degrees of G1 and G2 are T determined by g , g ∈ [X] and these determine the de- P ei/(kq) kq 1 2 C If kq 6= 1, let g = i=1 fiX and h = X . grees of termsH1 and H2 (in the notation of Theorem 7). Return (true, g, h) Therefore, under each evaluation the decomposition factors H1 and H2 are the same so all the symbolic exponents must Step 2. Remove fractional coefficients that occur in f. lie in H, which is the same for both decompositions. As we Let L be smallest integer such that Le1, ..., LeT ∈ 0 have excluded the case where H is a monomial, we must Z[n1, ..., np]. Construct f = ρf ∈ P, using the sub- stitution ρ : X 7→ XL. have G ◦ Gi ◦ Hi ∈ C[X] so H is a polynomial under any evaluation and is therefore a symbolic polynomial. Step 3. Convert to multivariate problem. Construct f 00 = 0 γf ∈ C[X0...0, ..., Xd...d], using the correspondence i1 ip n1 ···np γ : X 7→ Xi1...ip . 6. Computing Decompositions Step 4. Determine possible degrees. Let D be the total de- gree of f 00. The possible degrees of the decomposition To find a decomposition f = g◦h we consider two cases: factors are the integers that divide D. h being a monomial (Conditions 1 and 2) and g being an ordinary polynomial (Condition 3). Step 5. Try uni-multivariate decompositions. For each in- teger divisor r of D, from largest to smallest until a de- composition is found or there are no more divisors, try When h is a monomial a uni-multivariate Laurent polynomial decomposition q1 00 00 If h = h1x is a symbolic monomial, then q1 will be a f = g◦h where g has degree r. If no decomposition common factor of the exponents of x in f. The co-factors is found, try again with L = d!p. If no decomposition of q1 in the exponents of x in f will give the exponents pi if found, return false. of g. Step 6. Compute h. Invert the substitutions to obtain h = ρ−1γ−1h00. When g is an ordinary polynomial Step 7. Return (true, g, h). n n2 n If g ∈ R[X] then we may substitute X 1 , X 1 , X 2 , Xn1n2 , etc with new variables to obtain a multivariate Lau- Figure 1. rent polynomial. We may then perform a uni-multivariate Symbolic Polynomial Decomposition Laurent polynomial decomposition, as described in [26]. In order to ensure that the coefficients of the expo- nent polynomials are integers, we first make the substitu- tion X 7→ XL where L is the smallest integer such that Lp1, ..., Lpr ∈ Z[n1, ..., np]. Then, with all integer coeffi- Symbolic Polynomial Decomposition Algorithm cients in the exponents, we able to transform XP to a prod- uct of new variables raised to integer powers. For example, We can now give our algorithm for symbolic polynomial ni nj if p = 2 we can introduce the new variables Xij = X 1 2 decomposition. This is shown in Figure 1. This algorithm 2 3n1−4n2 3 −4 and the term cX becomes cX20X01 . This choice may be applied repeatedly to obtain a complete decompo- of L does not make explicit all fixed divisors of the expo- sition. It may be possible to further decompose g and h. nent polynomials. If no decomposition is obtained with this If g ∈ C[X], the standard polynomial decomposition al- L, then try again with L = d!p, where d is the maximum de- gorithms may be applied. If h = Xa×b, then h may be a b gree of any ni in any exponent in f. This will be sufficient decomposed as X ◦ X . Note the lower first value for L is to detect any fixed divisor of exponent polynomials [24]. for efficiency only. 7. Conclusions [13] M. Malenfant and S. M. Watt. Sparse exponents in symbolic polynomials. In Proc. Symposium on Algebraic Geometry We have extended the notion of functional decomposi- and Its Applications: in honor of the 60th birthday of Gilles Lachaud, (SAGA 2007) tion of polynomials to the domain of symbolic polynomi- , Papeete, Tahiti, 2007. [14] A. Ostrowski. Uber¨ ganzwertige Polynome in algebraischen als and have shown that if such a decomposition exists ei- Zahlkopern.¨ J. Reine Angew. Math., 149:117–124, 1919. ther the inner decomposition factor must be a monomial or [15] F. Pakovich. Prime and composite Laurent polynomials, the outer decomposition factor must be an ordinary polyno- 2008. Preprint: arXiv.org:0710.3860v3. mial. We have also shown that maximal decompositions ex- [16] W. Pan and D. Wang. Uniform grobner¨ bases for ideals gen- ist and how they are related. Finally, we have presented an erated by polynomials with parametric exponents. In Proc. algorithm to compute these decompositions based on uni- ISSAC 2006, pages 269–276. ACM Press, 2006. multivariate Laurent decomposition. [17] G. Polya.´ Uber¨ ganzwertige Polynome in algebraischen Some interesting problems remain open to future inves- Zahlkopern.¨ J. Reine Angew. Math., 149:97–116, 1919. [18] J. Ritt. Prime and composite polynomials. Trans. American tigation: One is to decompose symbolic polynomials over Math. Society, 23(1):51–66, 1922. fields of finite characteristic. Another is to compute the Pn αix [19] J. Ritt. A factorization theory for functions i=1 aie . functional decomposition of extended symbolic polynomi- Trans. American Math. Society, 29(3):584–596, 1927. als, where elements of the coefficient ring may have sym- [20] J. Ritt. Algebraic combinations of exponentials. Trans. bolic exponents. American Math. Society, 31(4):654–679, 1929. [21] A. P. Sexton, V. Sorge, and S. M. Watt. Abstract matrix References arithmetic. Technical Report TR 713, University of Western Ontario, Dept of Computer Science, 2007. [22] J. von zur Gathen, J. Gutierrez, and R. Rubio. Multivariate [1] D. R. Barton and R. E. Zippel. A polynomial decomposition polynomial decomposition. Applied Algebra in Engineer- algorithm. In Proc. 1976 ACM Symposium on Symbolic and ing, Communication and Computing, 14:11–31, 2003. Algebraic Computation , pages 356–358. ACM Press, 1976. [23] S. M. Watt. Making computer algebra more symbolic. [2] T. Crampton and G. Whaples. Additive polynomials ii. In Proc. Transgressive Computing 2006: A conference in Trans. American Math. Society, 78(1):239–252, 1955. [3] B. G. R. de Prony. Essai experimental´ et analytique: sur honor of Jean Della Dora, pages 43–49, 2006. les lois de la dilatabilite´ de fluides elastique´ et sur celles [24] S. M. Watt. Symbolic polynomials with sparse exponents. Proc. Milestones in Computer Algebra 2008: A confer- de la force expansive de la vapeur de l’alkool, a` differentes´ In ence in honour of Keith Geddes’ 60th birthday temperatures.´ Journal de l’Ecole´ Polytechnique, 1(22):24– , pages 91– 76, 1795. 97, Stonehaven Bay, Trinidad and Tobago, 2007. University [4] M. T. Dickerson. The Functional Decomposition of Polyno- of Western Ontario. ISBN 978-0-7714-2682-7. mials. PhD thesis, Cornell University, 1989. [25] S. M. Watt. Two families of algorithms for symbolic poly- [5] G. Everest and A. V. D. Poorten. Factorisation in the ring nomials. In I. Kotsireas and E. Zima, editors, Computer Al- of exponential polynomials. Proc. American Math. Society, gebra 2006: Latest Advances in Symbolic Algorithms – Pro- 125(5):1293–1298, 1997. ceedings of the Waterloo Workshop, pages 193–210. World [6] C. Henson, L. Rubel, and M. Singer. Algebraic properties Scientific, 2007. of the ring of general exponential polynomials. Complex [26] S. M. Watt. Functional decomposition of Laurent polynomi- Variables Theory and Applications, 13:1–20, 1989. als. Technical Report ORCCA TR 08-02, Ontario Research [7] H. Hong. Groebner basis under composition II. In Interna- Centre for Computer Algebra, University of Western On- tional Symposium on Symbolic and Algebraic Computation, tario, London Ontario, 2008. pages 79–85, 1996. [27] V. Weispfenning. Grobner¨ bases for binomials with para- [8] H. Hong. Subresultants under composition. J. Symbolic metric exponents. Technical report, Universitat¨ Passau, Ger- Computation, 23:355–365, 1997. many, 2004. [9] H. Hong. Groebner basis under composition I. J. Symbolic [28] K. Yokoyama. On systems of algebraic equations with para- Computation, 25:643–663, 1998. metric exponents. In Proc. ISSAC 2004, pages 312–319. [10] D. Kozen and S. Landau. Polynomial decomposition algo- ACM Press, 2004. rithms. J. Symbolic Computation, 22:445–456, 1989. [29] M. E. Zieve. Decompositions of Laurent polynomials, 2007. [11] D. Kozen, S. Landau, and R. Zippel. Decomposition of al- Preprint: arXiv.org:0710.1902v1. gebraic functions. J. Symbolic Computation, 22(3):235–246, [30] R. E. Zippel. Rational function decomposition. In Proc. 1996. ISSAC 2001, pages 1–6. ACM Press, 1991. [12] M. Malenfant. A comparison of two families of algorithms for symbolic polynomials. Master’s thesis, Dept of Com- puter Science, University of Western Ontario, December 2007.