Factorization of {\mathbb{Z}}-homogeneous Polynomials in the First (q-)Weyl Algebra

# Factorization of Z-homogeneous Polynomials in the First (q-)Weyl Algebra

Albert Heinle and Viktor Levandovskyy Cheriton School of Computer Science, 200 University Ave. West, Waterloo, N2L 3G1, Ontario, Canada. Email: aheinle@uwaterloo.ca
Lehrstuhl D für Mathematik, RWTH Aachen University, Templergraben 64, 52062 Aachen, Germany. Email: viktor.levandovskyy@math.rwth-aachen.de
###### Abstract

We present algorithms to factorize weighted homogeneous elements in the polynomial first Weyl algebra and -Weyl algebra, which are both viewed as -graded rings. We show that factorization of homogeneous polynomials can be almost completely reduced to commutative univariate factorization over the same base field with some additional uncomplicated combinatorial steps. This allows to deduce the complexity of our algorithms in detail. Furthermore, we will show for homogeneous polynomials that irreducibility in the polynomial first Weyl algebra also implies irreducibility in the rational one, which is of interest for practical reasons. We report on our implementation in the computer algebra system Singular. For homogeneous polynomials, it outperforms currently available implementations for factoring in the first Weyl algebra – in speed as well as in elegancy of the results.

###### Keywords:
Factorization, (-)Weyl Algebra, Noncommutative, Ore Algebra, Complexity
\spn@wtheorem

factFact

## 1 Introduction

Algebras of operators, such as the -Weyl and the Weyl algebras, are important objects to study since, among other things, one can derive properties of the solution spaces of their associated systems of equations one wants to solve. Especially concerning the problem of finding the solutions of a linear ordinary (-)differential equation, the preconditioning step of factorizing this operator may come in helpful.

But often algebras of operators are noncommutative polynomial rings, and a factorization of an element in those algebras is neither unique in the classical sense (i.e. unique up to multiplication by a unit), nor easy to compute at all in general.

Nevertheless, a lot has been done in this field in the past. Tsarev has studied the form, number and the properties of the factors of a linear differential operator in Tsarev (1994) and Tsarev (1996), where he uses and extends the work presented in Loewy (1903) and Loewy (1906).

A very general approach to noncommutative algebras and their properties, including factorization, is also done by Bueso, Gomez-Torrecillas and Verschoren in (Bueso et al. (2003)). They provide several algorithms and introduce various points of views when dealing with noncommutative polynomial algebras.

In his dissertation van Hoeij developed an algorithm to factorize a linear differential operator (van Hoeij (1996)). There were several papers following that dissertation using and extending those techniques (e.g. van Hoeij (1997a), van Hoeij (1997b) and van Hoeij and Yuan (2010)), and nowadays this algorithm is implemented in the DETools package of Maple (Monagan et al. (2008)) as the standard algorithm for factorization of those operators.

For the finite field case, Giesbrecht and Zhang have developed a polynomial time algorithm to factor polynomials in (Giesbrecht and Zhang (2003)). This includes the Weyl algebras with rational function coefficients over a finite field. The applied methodology extends the results in Giesbrecht (1998).

From a more algebraic point of view and dealing only with strictly polynomial noncommutative algebras, i.e. all units are in the center of the algebra, Melenk and Apel developed a package for the computer algebra system REDUCE (Melenk and Apel (1994)). This package provides tools to deal with noncommutative polynomial algebras and also contains a factorization algorithm for the supported algebras.

In the computer algebra system ALLTYPES (Schwarz (2009)), which is based on REDUCE and solely accessible as a web-service, Schwarz and Grigoriev have implemented the algorithm for factoring differential operators they introduced in Grigoriev and Schwarz (2004).

Beals and Kartashova (Beals and Kartashova (2005)) consider the problem of finding a first-order left hand factor of an element from the second Weyl algebra over a computable differential field, where they are able to deduce parametric factors. Similarly, Shemyakova studied factorization properties of linear partial differential operators in Shemyakova (2007), Shemyakova (2009) and Shemyakova (2010).

Concerning special classes of polynomials in algebras of operators, the paper Foupouagnigni et al. (2004) deals with factorization of fourth-order differential equations satisfied by certain Laguerre-Hahn orthogonal polynomials (Nikiforov and Uvarov (1988)).

Those algorithms and implementations are very well written and they are able to factorize a large number of polynomials we give them as input. Nonetheless, as we will see in this paper, there exists a large class of polynomials that seem to form the worst case for the mentioned algorithms. One can use a different approach to obtain a factorization of such polynomials very quickly, and we will prove that this factorization into irreducible elements is also irreducible in the rational first (-)Weyl algebra. This approach extends the one developed in Heinle (2010). In this work we deal with this class of polynomials by describing our methods in detail and providing a complexity estimate for the factorization in the case, where the underlying field is computable. A very recent algorithm for factoring general polynomials, which is based on the results presented here, is given in Giesbrecht et al. (2014). We state another main result in Theorem 2.1. There, we prove that irreducible homogeneous polynomials in the polynomial first Weyl algebra stay irreducible when considering them as elements in the rational first Weyl algebra. This is rather unexpected, as this statement is not true for general, i.e. inhomogeneous, polynomials.

Our algorithms are implemented in the computer algebra system Singular (Decker et al. (2012), Greuel and Pfister (2007), Levandovskyy et al. (2010)), and since version 3-1-3 they became part of the distribution as the library ncfactor.lib.

### 1.1 Preliminaries

We will start by introducing the first -Weyl algebra and the first Weyl algebra. By , we always denote an arbitrary field. All algebras are unital associative -algebras. For the complexity discussions, we assume that

• is computable and its arithmetics have polynomial costs with respect to the bit-size of the elements in .

• There exists a norm . The representation size in bits for an element is bounded by .

The role of the invertible parameter can be different: from to being transcendental over . We use the unified notation for all these cases. Moreover, for we denote by the set .

###### Definition 1

The polynomial first -Weyl algebra is defined as

 Q1:=K(q)⟨x,∂|∂x=qx∂+1⟩.

For the special case where we have the polynomial first Weyl algebra, which is denoted by .

###### Remark 1

The first -Weyl algebra can be viewed as an algebra associated to the operator

 ∂q:f(x)↦f(qx)−f(x)(q−1)x,

also known as the -derivative, where is a univariate function in (cf. Kac and Cheung (2002)).

For , the operator is still well defined. This can be seen in the following way. Let , where and . Then

 f(qx)−f(x)=n∑i=0ai(qx)i−n∑i=0aixi=n∑i=0aixi(qi−1).

The expression is clearly a divisor of for all , and we obtain

 f(qx)−f(x)(q−1)x=n∑i=1aixi−1(i−1∑j=0qj).

The first (-)Weyl algebra possesses a nontrivial -grading – introduced by M. Kashiwara and B. Malgrange in a broader context of the so-called -filtration in 1983 (Kashiwara (1983), Malgrange (1983)) – using the weight vector for non-zero on the tuple . For simplicity, we will choose . In what follows, denotes the degree induced by this weight vector. We will write and for the degree of a polynomial in resp. with respect to and . From now on, we mean by homogeneous or graded a polynomial, which is homogeneous with respect to the weight vector .

###### Example 1

We have . Another homogeneous polynomial is

 x∂2+x4∂5+∂=(x∂+x4∂4+1)∂,

which is of degree one.

For , the th graded part (cf. 1 for more detailed description) of and analogously the th graded part of is given by

 Q(n)1:={∑j−i=nri,jxi∂j|i,j∈N0,ri,j∈K},

i.e. the degree of a monomial is determined by the difference of its powers in and .

Concerning this choice of degree, the so called Euler operator

 θ:=x∂,

which is homogeneous of degree 0, will play an important role as we will see soon.

First of all, let us investigate some commutation rules the Euler operator has with and . For , in order to abbreviate the size of our formulas, we introduce the so called -bracket.

###### Definition 2

For , we define the -bracket by

 [n]q:=1−qn1−q=n−1∑i=0qi.
###### Lemma 1 (Compare with Saito et al. (2000))

In , the following commutation rules do hold for :

 θxn = xn(θ+n) θ∂n = ∂n(θ−n).

More generally, in the following commutation rules do hold for :

 θxn = xn(qnθ+[n]q) θ∂n = ∂nq(θ−1qn−1−q−n+2−q1−q).

Those rules follow via induction on .

###### Remark 2

If the characteristic of is some prime number , the elements (resp. ) for all commute with in .

###### Remark 3

With the help of the Lemma above one can also easily see that the so called polynomial first shift algebra

 K⟨n,s|sn=(n+1)s⟩

is a subalgebra of the first Weyl algebra . An embedding of a polynomial from the shift algebra, where , into the first Weyl algebra is done via the following homomorphism of -algebras:

 ι:K⟨n,s|sn=(n+1)s⟩→A1,n∑i=0pi(n)sn↦n∑i=0pi(θ)∂n.

Therefore, the factorization techniques developed here can also be applied to the first shift algebra.

The commutation rules in Lemma 1 can of course be extended to arbitrary polynomials in .

###### Corollary 1

Consider . Then, in , for all we have

 f(θ)xn = xnf(qnθ+[n]q), f(θ)∂n = ∂nf(1q(θ−1qn−1−q−n+2−q1−q)),

whereas in we have

 f(θ)xn = xnf(θ+n), f(θ)∂n = ∂nf(θ−n).

Those are the basic tools we need to explain our approach for factoring homogeneous polynomials in the first Weyl and the first -Weyl algebra.

For the complexity discussion, let us define some constants we will utilize in order to estimate the operations needed to perform our methods.

###### Definition 3

Let us denote by , for , the number of bit operations that an algorithm for factoring a polynomial of degree in a univariate polynomial ring over , where each coefficient has at most bit-size , needs to perform.

We denote for by the number of bit operations needed to multiply two polynomials in a univariate polynomial ring over , where each polynomial has degree at most and where is the maximal bit size of each coefficient in the two polynomials.

We will write , , , for the number of bit operations needed for computing for a polynomial in of degree , where is an indeterminate and transcendental over and each coefficient of has at most bit-size .

If we deal with the case , we will omit writing the subscript.

For a detailed complexity discussion, we need to specify the expected output of our factorization algorithms.

###### Definition 4

Let be a polynomial algebra over a field and be a polynomial. For a fixed totally ordered monomial -basis of , the leading coefficient of is uniquely defined. A nontrivial factorization of is a tuple , where , are monic (i.e. they satisfy ) and

By a slight abuse of notation, we may omit the first element in the tuple if .

The following lemma will provide a complexity estimate of the cost of testing whether a polynomial in resp. is homogeneous.

###### Lemma 2

In order to determine whether a polynomial resp. is homogeneous, it requires integer additions and comparisons.

###### Proof

A polynomial is homogeneous with respect to our definition if and only if in every term the difference between the degree in and the degree in is the same. Hence our statement follows.

Graded elements enjoy numerous nice properties, in particular regarding factorizations.

###### Lemma 3

Let be a monoid, totally ordered by , such that for all . Moreover, let be a domain over a field , nontrivially graded by , that is for -vector spaces and holds .

Consider . If there is and , such that , then is -graded if and only if are -graded.

###### Proof

The direction follows by the definition of grading, so it remains to prove the direction. For an element , let us denote by resp. by the degree of the highest resp. the lowest nonzero graded part of . Note, that . Thus and, moreover, is graded if and only if .

Suppose , where and . Then is the graded decomposition of , and since is a domain. Analogously . Since is graded one has thus , that is . Together with this delivers and , proving the claim.

## 2 A New Approach for Factoring Homogeneous Polynomials in the First (q-)Weyl Algebra

The main idea of our factorization technique lies in the reduction to a commutative univariate polynomial subring of resp. , namely . We will show that there are only two monic irreducible elements in , that are reducible in resp. . Hence, factoring graded elements in (which have a representation as modules) can be reduced to factoring in , identifying these two elements in a given list of factors, and interchanging using commutation rules.

We will start with discussing how to find one factorization of a given homogeneous polynomial, which, in the process, also leads us to the answer of the question how to find all possible factorizations.

### 2.1 Factoring homogeneous polynomials of degree zero

The following lemma shows that we can rewrite every homogeneous polynomial of degree zero in resp. as a polynomial in .

###### Lemma 4 (Compare with Saito et al. (2000), Lemma 1.3.1)

In , we have the following identity for :

 xn∂n=n−1∏i=0(θ−i).

In , one can rewrite as element in and it is equal to

where denotes the th triangular number for all .

Therefore the factorization of a homogeneous polynomial of degree zero can be done by rewriting as element in and factor it in , which is for practical choices of well implemented in every computer algebra system.

Of course, this would not be a complete factorization, as there are still elements irreducible in , but reducible in resp. . An obvious example is itself. Fortunately, there are only two monic polynomials irreducible in , but reducible in resp. . This is shown by Lemma 5, which requires the following proposition for its proof.

###### Proposition 1

resp. is a -algebra, generated by the element . The graded direct summands resp. are cyclic resp. bi-modules generated by the element , if , or by , if .

###### Proof

The first statement can be seen using Lemma 4, as we can identify resp. with .

For the second statement recall that being homogeneous of degree for a polynomial resp. means, that every monomial is – for a certain – of the form , if , or of the form , if . Since we can transform into an expression in via Lemma 4 and use the commutation rules in Lemma 1, we can move resp. to the right and the left and hence obtain the desired bi-module structure.

###### Lemma 5

The polynomials and are the only irreducible monic elements in that are reducible in . For , the polynomials and are the only irreducible monic elements in that are reducible in .

###### Proof

We will only consider the proof for , as the proof for is done in an analogue way. Let be a monic polynomial. Assume that it is irreducible in , but reducible in . Let be elements in with . Then and are homogeneous and for a . As for the case where is negative a similar argument is applicable, we assume without loss of generality that is positive.

Due to Proposition 1, we have for some

 φ=~φ(θ)xk,ψ=~ψ(θ)∂k.

Using Corollary 1, we obtain

 f=~φ(θ)xk~ψ(θ)∂k=~φ(θ)xk∂k~ψ(1q(θ−1qn−1−q−n+2−q1−q)).

As we know from Lemma 1 the equation

 xk∂k=1qTk−1k−1∏i=0(θ−i−1∑j=0qj)

holds.

Thus, because we assumed to be irreducible in , we must have and due to Lemma 1. Because is monic, we must also have .

As a result, the only possible is . If we originally had chosen to be negative, the only possibility for would be . This completes the proof.

Therefore, we have a procedure for factoring a homogeneous polynomial (resp. ) of degree zero in . It is done using the following steps.

1. Rewrite as an element in ;

2. Factorize in using commutative methods, i.e. obtain a list , , , where .

3. For every , , that is equal to or (resp. ), remove from the list and insert into position and the elements resp. .

4. Replace for every element in the list from the previous step by . Return the resulting list.

Let us consider the complexity of the above steps to factor a homogeneous element of degree zero in .

Ad step 1: The polynomial has, due to the assumption of being homogeneous of degree zero, the form

 p=n∑i=0pixi∂i,n∈N,pi∈K (resp. K(q)). (2.1)

In order to transform it into an element in , we have to apply the rewriting rule stated in Lemma 4 for every term in . For that, one makes use of the identity

 xn+1∂n+1=xn∂n⋅(θ−n).

Thus, in order to perform step 1, we need to perform for every a multiplication of a polynomial in of degree with a polynomial of degree .

Ad step 2: Unfortunately, the factorization problem even in the univariate case does not have polynomial complexity in general. One might face exponential complexity with respect to the bit-length of the coefficients in or it might even be undecidable, depending on the choice of .

An example for a polynomial-time complexity with respect to the bit-length of the coefficients would be , due to the famous LLL algorithm by Lenstra, Lenstra, Lovasz developed in 1982 (Lenstra et al. (1982)). For certain classes of fields, including algebraic ones, polynomial time algorithms have been discovered in Chistov (1986) and Grigoriev (1984). For further readings on the complexity of the factorization problem we also recommend Kaltofen (1982) and von zur Gathen and Gerhard (2013). As given in Definition 3, we simply write resp. for the amount of bit operations needed for factoring a univariate polynomial of degree .

Ad step 3: In order to find and identify the polynomials, it does not require any operations on the polynomials other than comparisons.

Ad step 4: For each monomial in each factor that has degree zero, we need to replace by and bring it into normal form, i.e. each monomial in the end must have the form for . This can be calculated, up to a constant factor, with the same number of operations as performed for step 1, since we only need to reverse the mapping outlined there.

Thus, we can formulate the following corollary.

###### Corollary 2

Given as in (2.1), and let be the maximal coefficient in with respect to its bit-size. In order to obtain one factorization of over , it requires

 O(n⋅ρq(n,⌈log|n!|⌉)+ωq(n,⌈log|b⋅n!|⌉)) (2.2)

bit operations.

###### Example 2

Let and

 p:=x3∂3+4x2∂2+3x∂∈A1.

Clearly is homogeneous of degree zero; rewritten in , one obtains

 p=θ3+θ2+θ.

This polynomial factorizes in to , which further factorizes as is reducible to . To get more (in fact, as we will see in the next subsection, all) possible factorizations of , we apply the commutation rules with resp. and obtain the following other factorizations:

 (θ2+θ+1)⋅x⋅∂, x⋅(θ2+3θ+3)⋅∂.

### 2.2 Factoring homogeneous polynomials of arbitrary degree

Fortunately, the hard work is already done and factoring of homogeneous polynomials of arbitrary degree is just a small further step.

The reason is Proposition 1, which leads to the following steps to obtain one factorization of a homogeneous polynomial resp. of degree .

1. Represent as resp. , where in , written as polynomial in . We need , where and denotes the maximal coefficient in with respect to the bit-size, operations to obtain this . Afterwards, if , one additional application of a -shift to is required.

2. Factorize – which is homogeneous of degree zero – using the steps shown in the previous subsection.

Now we have everything we need to formulate an algorithm to find one factorization of a homogeneous element in resp. , namely Algorithm 1 which can be found below.

The next corollary states a complexity estimate Algorithm 1. The proof is straightforward and left to the reader.

###### Corollary 3

Let be homogeneous of degree , and let all the coefficients in have at most bit size . Then, due to Proposition 1, can be written in the form , where is a polynomial of degree in and . Obtaining one factorization in of requires

 O(n⋅ρq(n,⌈log|n!|⌉)+ωq(n,⌈log|b⋅n!|)+Sq(n,k,⌈log|b⋅n!|⌉,σ))

bit operations, where if , and otherwise.

We also would like to address the topic how to obtain all possible factorizations of a homogeneous polynomial. As mentioned before, the factorization of a polynomial in a noncommutative ring is generally not unique in the classical sense, i.e. up to multiplication by units or up to interchanging factors. Thus several different factorizations can occur. For the homogeneous case, they can fortunately be easily characterized by the commutation rules from Lemma 1 and the identities from Lemma 5. This is proven by the following Lemma.

###### Lemma 6

Let and , resp. , is monic. Suppose, that one factorization of has been constructed following Proposition 1 and has the form , where

• , , is a product of irreducible factors in , which are reducible in , resp. ,

• is the product of irreducible factors in both and (resp. , and

• , if , and otherwise.

Let for be another nontrivial factorization of . Then this factorization can be derived from by using two operations, namely (i) “swapping”, that is interchanging two adjacent factors according to the commutation rules and (ii) “rewriting” of occurring resp. ( in the -Weyl case) by resp. .

###### Proof

Since is homogeneous, all for are homogeneous. Thus each of them can be written in the form , where , and , if and otherwise. With respect to the commutation rules as stated in Corollary 1, we can swap the to the left for any . Note that it is possible for them to be transformed to the form resp. ( in the -Weyl case), after performing these swapping steps. I.e., we have commuting factors, both belonging to , as well as to at the left. Our resulting product is thus , where the factors in , resp. , contain a subset of the factors of resp. . By our assumption of having degree , we are able to swap to the right in , i.e., for . This step may involve combining and to resp. ( in the -Weyl case). Afterwards, this is also done to the remaining factors in that are not yet polynomials in using the swapping operation. These polynomials are the remaining factors that belong to , resp. , and can be swapped commutatively to their respective positions. Since reverse engineering of those steps is possible, we can derive the factorization from as claimed.

With the help of the above lemma, we are also able to formulate an algorithm to find all factorizations of a given homogeneous polynomial in , namely Algorithm 2 as stated below.

In order to discuss the complexity of finding all factorizations of a homogeneous element in resp. , we need an upper bound on the number of possible factorizations.

###### Lemma 7

Let be a homogeneous polynomial in resp. , where , and . Furthermore let . Then the number of different factorizations of is at most

 n⋅n!⋅(n+kk).
###### Proof

Let us assume that decomposes in into factors, where . As all of these factors commute, there are up to different possibilities to rearrange them. For every such arrangement of the factors of , we can place the available at any position (with applied shift to the respective factors of ), which leads to possibilities each time. Finally, due to Lemma 5, the linear factors of might split into resp. . This would add for each instance at most new distinct factorizations. As factors at most into linear factors, we can assume and obtain the stated upper bound.

###### Remark 4

In (Bell et al. (2014)) we prove that in the case of the polynomial th (-)Weyl algebra, a nonzero polynomial has only finitely many different factorizations. In yet another recent paper (Giesbrecht et al. (2014)) we have developed an algorithm for computing all factorizations of a given polynomial in the th (-)Weyl algebra.

The termination of Algorithms 1 and 2 is clear, as we only iterate over finite sets. The correctness follows by our preliminary work.

###### Corollary 4

Given the denotations as in Corollary 3 By Lemma 7, the number of different factorizations of is bounded by

 n⋅n!⋅(n+|k||k|).

In order to obtain all these different factorizations, it would require

 O( n⋅ρq(n,⌈log|n!|⌉)+ωq(n,b+⌈log|n!|⌉) +(n2+n⋅n!⋅(n+|k||k|))Sq(n,1,⌈log|b⋅n!|⌉,σ))

bit operations, where if , and otherwise.

### 2.3 Application to the Rational First Weyl Algebra

In practice, one is often interested in ordinary differential equations over the field of rational functions in the indeterminate . We refer to the corresponding algebra of operators as the first rational Weyl algebra and denote it as . The commutation rules over are extended from those in , that is for .

Unlike in the polynomial Weyl algebra, an infinite number of nontrivial factorizations of an element is possible. The easiest example is the polynomial , having except a family of nontrivial factorizations for all over ; the only factorization in is . Thus, at first glance, the factorization problem in both the rational and the polynomial Weyl algebras seems to be distinct in general. But there are still many things in common.

The formalism of the Ore localization of a ring (cf. e. g.  Bueso et al. (2003)) can be briefly recalled as follows. Let be a domain and be a multiplicatively closed Ore set in , i. e. the Ore condition holds for and (the condition will appear below). Then there exists a localized ring, denoted by together with the classical embedding , such that becomes invertible. Note, that the presentation of a left fraction via the tuple is by no means unique, but defines an equivalence class.

Rational Weyl algebras can be recognized as Ore localizations of polynomial Weyl algebras with respect to the multiplicatively closed set , which can be proven to be an Ore set in . Let us clarify the connection between factorizations in an algebra and in its Ore localization.

###### Lemma 8

Let be a domain and be an Ore set in . Moreover, let be an element in . Suppose, that , , for . Then there exists and , such that

###### Proof

Suppose that for . Then by the Ore condition such that . Thus and for and one has . The rest follows by induction.

Thus we can lift any factorization from the ring to a factorization in by a left multiplication with an element of .

###### Example 3

As it was mentioned before, in the first rational Weyl algebra one has for all . Let us fix and analyze the lifting.

 (∂+(x+c)−1)(∂−(x+c)−1)=(x+c)−1⋅((x+c)∂+1)⋅(x+c)−1⋅((x+c)∂−1)

Since , one has and thus

 ∂2=(x+c)−1⋅∂⋅((x+c)∂−1),

from which we read off the corresponding factorization in the polynomial first Weyl algebra

 (x+c)⋅∂2=∂⋅((x+c)∂−1).

In the notation of the preceding Lemma . In particular, the infinite family of factorizations we started with does not propagate to the polynomial case: as we see, the parameter is present in the lifted polynomial . By our approach we can prove, that are the only factorizations of in for any .

###### Proposition 2

Let is invertible . Then 1. .
2. If in , to any factorization of a fraction we can associate a factorization of into elements of .
3. Let be an irreducible element in . Then in any factorization , where one has or , i. e  in general is not irreducible in .
4. If is irreducible in , in general is not irreducible in .

Surprisingly, irreducible -homogeneous polynomials remain irreducible in the rational Weyl algebra, as the following Theorem shows.

###### Theorem 2.1

Let be an irreducible -homogeneous polynomial in . Then, in the first rational Weyl algebra , is irreducible up to an invertible multiple.

###### Proof

The following monic homogeneous polynomials are irreducible in :