151
UNIVERSIT ¨ AT LINZ JOHANNES KEPLER JKU Technisch-Naturwissenschaftliche Fakult¨ at Advanced Applications of the Holonomic Systems Approach DISSERTATION zur Erlangung des akademischen Grades Doktor im Doktoratsstudium der Technischen Wissenschaften Eingereicht von: Christoph Koutschan Angefertigt am: Institut f¨ ur Symbolisches Rechnen Beurteilung: Univ.-Prof. Dr. Peter Paule Prof. Dr. Marko Petkovˇ sek Linz, September, 2009

UNIVERSIT AT LINZ JKU - Koutschan

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: UNIVERSIT AT LINZ JKU - Koutschan

UNIVERSITAT LINZJOHANNES KEPLER JKU

Technisch-NaturwissenschaftlicheFakultat

Advanced Applications

of the

Holonomic Systems Approach

DISSERTATION

zur Erlangung des akademischen Grades

Doktor

im Doktoratsstudium der

Technischen Wissenschaften

Eingereicht von:

Christoph Koutschan

Angefertigt am:

Institut fur Symbolisches Rechnen

Beurteilung:

Univ.-Prof. Dr. Peter PauleProf. Dr. Marko Petkovsek

Linz, September, 2009

Page 2: UNIVERSIT AT LINZ JKU - Koutschan
Page 3: UNIVERSIT AT LINZ JKU - Koutschan

Christoph Koutschan

Advanced Applications

of the

Holonomic Systems Approach

Doctoral Thesis

Research Institute for Symbolic ComputationJohannes Kepler University Linz

Advisor: Univ.-Prof. Dr. Peter Paule

Examiners:Univ.-Prof. Dr. Peter PauleProf. Dr. Marko Petkovsek

This work has been supported by the FWF grants F013 and P20162.

Page 4: UNIVERSIT AT LINZ JKU - Koutschan
Page 5: UNIVERSIT AT LINZ JKU - Koutschan

Eidesstattliche Erklarung

Ich erklare an Eides statt, dass ich die vorliegende Dissertation selbststandigund ohne fremde Hilfe verfasst, andere als die angegebenen Quellen undHilfsmittel nicht benutzt bzw. die wortlich oder sinngemaß entnommenenStellen als solche kenntlich gemacht habe.

Linz, September 2009 Christoph Koutschan

Page 6: UNIVERSIT AT LINZ JKU - Koutschan
Page 7: UNIVERSIT AT LINZ JKU - Koutschan

Abstract

The holonomic systems approach was proposed in the early 1990s by DoronZeilberger. It laid a foundation for the algorithmic treatment of holonomicfunction identities. Frederic Chyzak later extended this framework by intro-ducing the closely related notion of ∂-finite functions and by placing theirmanipulation on solid algorithmic grounds. For practical purposes it is con-venient to take advantage of both concepts which is not too much of a re-striction: The class of functions that are holonomic and ∂-finite containsmany elementary functions (such as rational functions, algebraic functions,logarithms, exponentials, sine function, etc.) as well as a multitude of spe-cial functions (like classical orthogonal polynomials, elliptic integrals, Airy,Bessel, and Kelvin functions, etc.). In short, it is composed of functionsthat can be characterized by sufficiently many partial differential and differ-ence equations, both linear and with polynomial coefficients. An importantingredient is the ability to execute closure properties algorithmically, for ex-ample addition, multiplication, and certain substitutions. But the centraltechnique is called creative telescoping which allows to deal with summationand integration problems in a completely automatized fashion.

Part of this thesis is our Mathematica package HolonomicFunctions inwhich the above mentioned algorithms are implemented, including more basicfunctionality such as noncommutative operator algebras, the computationof Grobner bases in them, and finding rational solutions of parameterizedsystems of linear differential or difference equations.

Besides standard applications like proving special function identities, thefocus of this thesis is on three advanced applications that are interesting intheir own right as well as for their computational challenge. First, we con-tributed to translating Takayama’s algorithm into a new context, in order toapply it to an until then open problem, the proof of Ira Gessel’s lattice pathconjecture. The computations that completed the proof were of a nontrivialsize and have been performed with our software. Second, investigating ba-sis functions in finite element methods, we were able to extend the existingalgorithms in a way that allowed us to derive various relations which gen-erated a considerable speed-up in the subsequent numerical simulations, inthis case of the propagation of electromagnetic waves. The third applicationconcerns a computer proof of the enumeration formula for totally symmetricplane partitions, also known as Stembridge’s theorem. To make the under-lying computations feasible we employed a new approach for finding creativetelescoping operators.

Page 8: UNIVERSIT AT LINZ JKU - Koutschan

KurzzusammenfassungIn den fruhen 1990er Jahren beschrieb Doron Zeilberger den

”holonomic sys-

tems approach“, der eine Grundlage fur das algorithmische Beweisen vonIdentitaten holonomer Funktionen bildete. Dies wurde spater von FredericChyzak um den eng verwandten Begriff der ∂-finiten Funktionen erweitert,deren Handhabung er auf eine solide algorithmische Basis stellte. In der Pra-xis ist es von Vorteil, sich beider Konzepte gleichzeitig zu bedienen, wasauch keine allzu große Einschrankung bedeutet: Die Klasse der Funktionen,die holonom und ∂-finit sind, umfasst viele elementare Funktionen (z.B. ra-tionale und algebraische Funktionen, Logarithmen, Exponentialfunktionen,Sinus, etc.) ebenso wie eine Vielzahl von Speziellen Funktionen (z.B. klassi-sche orthogonale Polynome, elliptische Integrale, Airy-, Bessel- und Kelvin-Funktionen, etc.). Grob gesagt sind dies Funktionen, die durch eine ausrei-chende Anzahl von partiellen Differential- und Differenzengleichungen (linearund mit Polynomkoeffizienten) charakterisiert werden konnen. Ein wichtigerAspekt besteht in der Moglichkeit, Abschlusseigenschaften wie zum BeispielAddition, Multiplikation und bestimmte Substitutionen algorithmisch aus-zufuhren. Das zentrale Verfahren ist jedoch das

”creative telescoping“, mit

welchem Summations- und Integrationsprobleme vollkommen automatisiertbehandelt werden konnen.

Als Teil dieser Arbeit haben wir besagte Algorithmen in unserem Mathe-matica-Paket HolonomicFunctions implementiert sowie einige Basisfunk-tionalitaten, darunter nichtkommutative Operatoralgebren, Grobnerbasen-berechnung in diesen und das Auffinden von rationalen Losungen parametri-sierter Systeme von linearen Differential- bzw. Differenzengleichungen.

Neben Standardanwendungen, wie dem Beweisen von Formeln fur Spe-zielle Funktionen, liegt das Hauptaugenmerk dieser Arbeit auf drei neuar-tigen Anwendungen, die, obschon fur sich interessant, auch aufgrund ihrerRechenintensitat eine Herausforderung darstellten. In der ersten wurde derAlgorithmus von Takayama so umformuliert, dass er auf ein bis dato offenesProblem, Ira Gessels Gitterpfad-Vermutung, angewendet werden konnte. Diezum Beweis notwendigen Rechnungen waren sehr aufwandig und wurden mitunserer Software durchgefuhrt. Zweitens erweiterten wir bekannte Verfahren,um Beziehungen fur die Basisfunktionen in Finite-Elemente-Methoden herzu-leiten. Diese erbrachten eine beachtliche Beschleunigung der numerischen Si-mulationen, in diesem Fall von der Ausbreitung elektromagnetischer Wellen.Die dritte Anwendung besteht aus einem Computerbeweis der Abzahlformelfur totalsymmetrische plane partitions, auch bekannt als das Theorem vonStembridge. Um die notigen Berechnungen zu ermoglichen, verwendeten wireinen neuen Ansatz zum Auffinden von

”creative telescoping“-Operatoren.

Page 9: UNIVERSIT AT LINZ JKU - Koutschan

Acknowledgments

“The direction in which education starts a man will determine his futurelife” (Plato). In this sense I would like to thank my teachers Achim Schmidt,Hans Grabmuller, and Volker Strehl, who induced the successful end of myPhD studies, and possibly much more, by providing me with a well-foundededucation in mathematics.

The best education is rather useless if you cannot exchange with otherpeople: for answering my questions and for putting me up to new ideas, Ithank Clemens Bruschek, Herwig Hauser, Ralf Hemmecke, Guenter Lands-mann, Viktor Levandovskyy, Victor Moll, Brian Moore, Georg Regensburger,Markus Rosenkranz, Joachim Schoberl, Hans Schonemann, and BurkhardZimmermann.

Special thanks go to Doron Zeilberger who stimulated my motivation withhis enthusiasm and several prizes, and with whom to collaborate I enjoyedgreatly. Frederic Chyzak was so kind to facilitate my two visits to INRIA-Rocquencourt where I profited a lot from many inspiring discussions for whichhe reserved all his available time. I am deeply grateful to Marko Petkovsekfor inviting me to Ljubljana and for agreeing to serve as my second advisor;his detailed comments were of great help! I also want to acknowledge thefinancial support of the Austrian Science Fund FWF, namely the grants F013and P20162.

Two among my many colleagues deserve particular mention. Since weshare the same office it is needless to say that they helped in all kinds ofproblems and questions, quickly and at any time. Veronika Pillwein didan excellent job in drawing my attention to numerous special function ap-plications in numerical analysis. Manuel Kauers was so generous to let meparticipate in his mathematical knowledge and insight; by means of our dailydiscussions he contributed considerably to my work.

I would like to express my gratitude to my advisor Peter Paule whoaccepted me at RISC and who in the first place made my PhD studies possibleby reliably arranging sufficient financial support. I highly enjoyed his vividlectures and every minute of his scarce time that he spent on advising me.He wisely suggested the perfect thesis topic and infected me with his energyagain and again.

Finally I would like to thank my parents and my girlfriend Martina fortheir unconditional support (thanks for all the cake!) and for their under-standing and appreciation of my work (in spite of not understanding thesubject).

Page 10: UNIVERSIT AT LINZ JKU - Koutschan
Page 11: UNIVERSIT AT LINZ JKU - Koutschan

Contents

1 Introduction 13

1.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.2 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.3 Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2 Holonomic and ∂-finite functions 17

2.1 Basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.2 Holonomic functions . . . . . . . . . . . . . . . . . . . . . . . 19

2.3 ∂-finite functions . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.4 Holonomic versus ∂-finite . . . . . . . . . . . . . . . . . . . . . 37

2.5 Univariate versus multivariate . . . . . . . . . . . . . . . . . . 41

2.6 Non-holonomic functions . . . . . . . . . . . . . . . . . . . . . 43

3 Algorithms for Summation and Integration 45

3.1 Zeilberger’s slow algorithm . . . . . . . . . . . . . . . . . . . . 47

3.2 Takayama’s algorithm . . . . . . . . . . . . . . . . . . . . . . 51

3.3 Chyzak’s algorithm . . . . . . . . . . . . . . . . . . . . . . . . 55

3.4 Polynomial ansatz . . . . . . . . . . . . . . . . . . . . . . . . . 59

3.5 Concluding example . . . . . . . . . . . . . . . . . . . . . . . 61

4 The HolonomicFunctions Package 65

4.1 Arithmetic with Ore polynomials . . . . . . . . . . . . . . . . 67

4.2 Noncommutative Grobner bases . . . . . . . . . . . . . . . . . 72

4.3 ∂-finite closure properties . . . . . . . . . . . . . . . . . . . . . 75

4.4 Finding relations by ansatz . . . . . . . . . . . . . . . . . . . . 80

4.5 Rational solutions . . . . . . . . . . . . . . . . . . . . . . . . . 82

4.6 Summation and Integration . . . . . . . . . . . . . . . . . . . 86

4.7 q-Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

4.8 Interface to Singular/Plural . . . . . . . . . . . . . . . . . . . 99

11

Page 12: UNIVERSIT AT LINZ JKU - Koutschan

12 Contents

5 Proof of Gessel’s Lattice Path Conjecture 1015.1 Gessel walks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015.2 Transfer to the holonomic world . . . . . . . . . . . . . . . . . 1025.3 The quasi-holonomic ansatz . . . . . . . . . . . . . . . . . . . 1045.4 Takayama’s algorithm adapted . . . . . . . . . . . . . . . . . . 1055.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065.6 Related conjectures . . . . . . . . . . . . . . . . . . . . . . . . 107

6 Applications in Numerics 1096.1 Small examples . . . . . . . . . . . . . . . . . . . . . . . . . . 1106.2 Simulation of electromagnetic waves . . . . . . . . . . . . . . . 1126.3 Relations for the basis functions . . . . . . . . . . . . . . . . . 1136.4 Extension of the holonomic framework . . . . . . . . . . . . . 116

7 A fully algorithmic proof of Stembridge’s TSPP theorem 1217.1 Totally symmetric plane partitions . . . . . . . . . . . . . . . 1227.2 How to prove determinant evaluations . . . . . . . . . . . . . 1247.3 The computer proof . . . . . . . . . . . . . . . . . . . . . . . . 1257.4 Outlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

Page 13: UNIVERSIT AT LINZ JKU - Koutschan

Chapter 1

Introduction

1.1 Objectives

Based on Zeilberger’s holonomic systems approach, Frederic Chyzak did agreat job in putting the treatment of holonomic functions on solid algorithmicgrounds [24, 25, 28]. But we think that from the applications point of view,his work did not yet receive the attention that it deserves. The reasonsfor that could be that his thesis is written in French, or that his Mapleimplementation Mgfun suffered from certain weaknesses, and only since veryrecently the work on this package has been restarted. However, one objectiveof this thesis is to provide a new implementation (in Mathematica) of therelated algorithms, which in any case is very desirable for several reasons:to enable interaction with many other Mathematica packages of the RISCcombinatorics group, and to make comparison of results possible. Last butnot least it served to increase our understanding of these algorithms.

We have put some effort to design a user-friendly software that may helpmathematicians and other scientists in performing various tasks: the mostnatural application consists in proving identities, in particular those involv-ing special functions. A large amount of identities that can be found involuminous standard tables and books [74, 6, 9, 42] lies in the scope of ourpackage. Besides proving that a given evaluation is correct, the software canalso assist in finding a closed form for a sum or integral, by delivering a re-currence or differential equation for it, which then can possibly be solved byother means. Furthermore, in many applications like numerical analysis orparticle physics, one is interested in certain relations for a given expression(like a combination of special functions or an integral); also in such cases

13

Page 14: UNIVERSIT AT LINZ JKU - Koutschan

14 Chapter 1. Introduction

our package can be of great help. Some applications forced us to approachthe limit of what today’s computers can accomplish, which lead us to opti-mize the package again and again, and which is mirrored in the title by theattribute “advanced”.

The plan of this thesis is as follows. Chapter 2 introduces the notions ofholonomic and ∂-finite functions, and investigates their qualities and closureproperties (in particular two kinds of substitutions that are not described ex-plicitly in Chyzak’s work). Chapter 3 is dedicated to diverse summation andintegration algorithms for holonomic and ∂-finite functions, all of them mak-ing use of the method of creative telescoping. Chapter 4 gives an overview ofthe functionality of our package HolonomicFunctions and many exampleshow this software may typically be applied. In Chapters 5, 6, and 7 threeadvanced applications of our software are presented, each of which requiredslight modifications and extensions of the classical algorithms of Zeilbergerand Chyzak, in addition to considerable amounts of computing time.

Our software HolonomicFunctions is freely available from the RISC com-binatorics software page

http://www.risc.uni-linz.ac.at/research/combinat/software/

1.2 Preliminaries

We assume that the reader is familiar with the theory of Grobner basesdeveloped by Bruno Buchberger in the 1960s [22]. This theory has beenadapted to noncommutative polynomial rings, in a very general and theoreticfashion in [15], and more algorithmically but less general in [44]. For ourpurposes the latter suffices where a Grobner basis theory for rings of solvabletype is developed. We do not want to reproduce it here, but only mentiona central property of such rings. If (R, 0, 1,+,−, ∗) with R = K[X1, . . . , Xd]and ∗ : R2 → R is a ring of solvable type, then (by definition) there exist0 6= cij ∈ K and pij ∈ R such that

Xj ∗Xi = cijXiXj + pij (1.1)

for all 1 ≤ i ≤ j ≤ d. Moreover, R is noetherian with respect to a termorder≺, if pij ≺ XiXj for all 1 ≤ i ≤ j ≤ d. In this situation the computationof Grobner bases is possible. In noncommutative polynomial rings we willmostly deal with left ideals and left Grobner bases. Nice introductions intothe theory of Gobner bases are given in [31, 14].

Page 15: UNIVERSIT AT LINZ JKU - Koutschan

1.3. Notations 15

1.3 Notations

This part (how could it be different) starts with the well-known mathemati-cian’s joke “let K be a field”. In addition, we tacitly assume that K is com-putable, commutative and has characteristic 0, or in other wordsQ ⊆ K. Weuse bold letters for multivariables and multiindices, i.e., the polynomial ringK[x1, . . . , xd] in several variables may be abbreviated by K[x], as well as thepower product xα1

1 . . . xαdd that we often will write as xα. We refer to sucha power product as a monomial . By α ≤ β for two multiindices α,β ∈ Nd

we mean that α1 ≤ β1, . . . , αd ≤ βd. When speaking about the support of apolynomial, we refer to the finite set of power products (monomials) whosecoefficients are nonzero.

We use the notation R〈G1, . . . , Gr〉 to refer to the left ideal in R that isgenerated by G1, . . . , Gd, in symbols

R〈G1, . . . , Gr〉 := R1G1 + · · ·+RrGr | Ri ∈ R

(and similarly 〈G1, . . . , Gr〉R for right ideals).Since we will work with operators all the time let us introduce the fol-

lowing notation: The bullet symbol • is used for operator application, i.e.,P • f = P (f) means that the operator P is applied to f (where f can bea function, for example). The multiplication inside the operator algebra isdenoted by the usual dot (which we sometimes omit): P · Q = PQ. Weintroduce some operator symbols that will be used throughout.

• Differential operator : We will use the symbol Dx to denote the opera-tor “partial derivative with respect to x”, in other words, Dx • f = ∂f

∂x.

Often in the literature this operator is referred to by ∂x, but fol-lowing Chyzak we would like to use the symbol ∂ in a more gen-eral sense (see below). Using the differential operator we can repre-sent differential equations in a convenient way: Consider the Hermitepolynomials Hn(x) that fulfill the second-order differential equationH ′′n(x)− 2xH ′n(x) + 2nHn(x) = 0. In operator notation it translates toD2x − 2xDx + 2n.

• Shift operator : By Sn we denote the shift operator with respect to n,this means that Sn •f(n) = f(n+1). We will use the operator notationfor expressing and manipulating recurrence relations. For example, theFibonacci recurrence Fn+2 = Fn+1 + Fn translates to S2

n − Sn − 1.

• Forward difference: The symbol ∆n denotes the forward differenceoperator (which is the discrete analogue of the differential operator):∆n • f(n) = f(n+ 1)− f(n).

Page 16: UNIVERSIT AT LINZ JKU - Koutschan

16 Chapter 1. Introduction

• Euler operator : The symbol θx is sometimes used to denote the Euleroperator which is θx = xDx.

• q-shift operator : We denote it by Sx,q and it acts as Sx,q •f(x) = f(qx).

• Generic operator : As a unifying symbol we use ∂ that may stand foran arbitrary Ore operator (see Section 2.3) symbol (in particular anyof the above).

We want to point out that the notion “operator” is occupied with two slightlydifferent meanings: First, the word might refer to an operator symbol as in-troduced above, e.g., by callingDx the “partial differential operator”. Second,it can denote an equation that is given in operator notation, usually beinga polynomial in the previous ones, e.g., the Hermite differential equation orthe Fibonacci recurrence. So, we can speak of the operator S2

n −Sn−1 whichitself is a polynomial in the shift operator Sn. In order to avoid confusion wewant to refer to the latter as “Ore operator” and reserve the general notionfor operators of the first type. We will only deal with linear operators; theseare operators that are expressible as polynomials as exemplified above.

A last word on the notion of variables: When dealing with multivariatefunctions f(v1, . . . , vd), the variables v1, . . . , vd are often of different natures.We call a variable on which we act with the shift or the difference operator(and that is usually supposed to take integer values only), a discrete variable.On the other hand, there are variables on which we act with the differentialor the Euler operator; these variables we call continuous variables and theyare allowed to take real or complex values in general.

Page 17: UNIVERSIT AT LINZ JKU - Koutschan

Chapter 2

Holonomic and ∂-finitefunctions

2.1 Basic concepts

Before we give a formal definition of (multivariate) holonomic functions, wewant to slowly approach this widely used concept. Let us for the momentconsider a univariate formal power series f ∈ KJxK. If the derivatives dif

dxi

of such a power series span a finite-dimensional K(x)-vector space, then fis called D-finite (differentiably finite), a notion that has been introducedby Richard Stanley [79] in the early 1980s. He then proved that f beingD-finite is equivalent to say that it fulfills a linear differential equation withpolynomial coefficients (D-finite differential equation):

pd(x)f (d)(x) + · · ·+ p1(x)f ′(x) + p0(x)f(x) = 0, pi ∈ K[x], pd 6= 0. (2.1)

In operator notation the above equation reads as P • f = 0 where

P = pd(x)Ddx + · · ·+ p1(x)Dx + p0(x) (2.2)

and we will identify both objects with each other.We now want to study the properties of the operator arithmetic. From

the Leibniz law (x · f(x))′ = x · f ′(x) + f(x) we can read off the followingcommutation rule: Dxx = xDx + 1. Hence when dealing with differentialoperators we have to take into account that x does not commute with Dx.Operators of the form (2.2) are usually represented in the Weyl algebra A1

(the index 1 indicates that one variable x and the corresponding differentialoperator Dx are involved). More precisely, the first Weyl algebra A1 is definedas follows:

A1 := A1(K) := K〈x,Dx〉/〈Dxx− xDx − 1〉

17

Page 18: UNIVERSIT AT LINZ JKU - Koutschan

18 Chapter 2. Holonomic and ∂-finite functions

(we omit the field K when it is clear from the context). The angle bracketsdenote the free algebra in x and Dx from which we divide out the commuta-tion relation from above. The standard monomials—those monomials wherethe variable x is on the left and the differential operator Dx is on the right sothat they are of the form xαDβ

x —constitute a basis of A1(K) as a K-vectorspace; it is called the canonical basis. The proof that this is indeed a basiscan be found for example in [30, Chapter 1, Proposition 2.1]. We write ele-ments of the Weyl algebra in canonical form, this means in expanded formas a linear combination of monomials from the canonical basis:∑

(α,β)∈I

cα,βxαDβ

x

where I is a finite index set in N2.It is now natural to consider not only a single operator P as given in (2.2)

but the left ideal

A1〈P 〉 := QP | Q ∈ A1that is generated by this operator. The reason for doing so is obvious: Wecan multiply the relation (2.1) by x and it will still be true, as well as wecan differentiate it, which corresponds to the multiplication Dx ·P . Hence allelements of this left ideal are annihilating operators of f(x). On the otherhand, the left ideal that contains all operators in A1 which send f(x) to zero,is called the annihilator of f(x) and is denoted by

AnnA1(f) := P ∈ A1 | P • f = 0 .

Note that the two left ideals AnnA1(f) and I = A1〈P 〉 need not to be equalfor several reasons. If P is not the minimal differential equation for f(x) withrespect to order, or if it contains a nonconstant polynomial content among itscoefficients, then clearly I does not constitute the whole annihilator of f(x).But there are more subtle reasons as the following example shows.

Example 2.1. Let f(x) = x3; then the homogeneous differential equation ofminimal order and degree is xf ′(x)− 3f(x) = 0, which is represented by theoperator P = xDx − 3. Nevertheless the left ideal A1〈P 〉 does not constitutethe whole annihilator since D4

x (which also annihilates x3) is not containedin it.

In addition Stanley [79] introduced the notion of P-finite (or P-recursive)sequences. These are sequences (a(n))n∈N ∈ KN that fulfill a linear recur-rence with polynomial coefficients (P-finite recurrence)

pd(n)a(n+d)+· · ·+p1(n)a(n+1)+p0(n)a(n) = 0, pi ∈ K[n], pd 6= 0. (2.3)

Page 19: UNIVERSIT AT LINZ JKU - Koutschan

2.2. Holonomic functions 19

In operator notation equation (2.3) reads as P • a = 0 where

P = pd(n)Sdn + · · ·+ p1(n)Sn + p0(n). (2.4)

In order to represent operators like (2.4) we introduce the shift algebra. Itscommutation rule is Snn = (n+ 1)Sn = nSn + Sn and hence the shift algebracan be defined by

K〈n, Sn〉/〈Snn− nSn − Sn〉

as a discrete analogue of the Weyl algebra. It is well known that a P-finiterecurrence can be transformed into a D-finite differential equation for the cor-responding generating function and vice versa. Implementations like Maple’sgfun [77] or the Mathematica package GeneratingFunctions [59] performthese operations. We close this section by a concrete example.

Example 2.2. The error function erf(x) is defined via the probability integral

erf(x) =2√π

∫ x

0

exp(−t2) dt

and a differential equation erf ′′(x) = −2x erf ′(x) is easily derived from thisdefinition. Thus the operator D2

x + 2xDx annihilates erf(x), and since erf(x)can be expanded into a power series in the point x = 0, we can say that itis D-finite. The coefficient sequence of its series expansion is P-finite and isannihilated be the recurrence operator (k2 + 3k + 2)S2

k + 2k.

In the following two sections we will discuss two approaches how D-finiteness and P-finiteness can be generalized to functions and sequences inseveral variables. This will lead to the classes of holonomic and ∂-finitefunctions.

2.2 Holonomic functions

From now on we deal with functions in several, say d continuous variables,or in other words f : Kn → K, (x1, . . . , xd) 7→ f(x1, . . . , xd). The definitionof holonomy for such functions can be quite involved and cumbersome—wetry to keep it as simple as possible. For more elaborated expositions see[93, 23, 24]. Again we will consider operators that annihilate f ; these arenow partial differential equations with respect to the variables x1, . . . , xd. Torepresent such operators we have to introduce the Weyl algebra in d variables:

Ad := Ad(K) := K〈x1, . . . , xd, Dx1 , . . . , Dxd〉

Page 20: UNIVERSIT AT LINZ JKU - Koutschan

20 Chapter 2. Holonomic and ∂-finite functions

modulo the relations

〈Dxixi − xiDxi − 1, xixj − xjxi, DxiDxj −DxjDxi , xiDxj −Dxjxi〉 (i 6= j).

This means that all generators commute except for the pairs xi and Dxi forwhich the commutation relations are Dxixi = xiDxi + 1. Although the Weylalgebra is very close to a commutative polynomial ring, its (left) ideals havequite different properties (see Example 2.5 below).

A multivariate function f(x1, . . . , xd) is called holonomic if there exists aleft ideal of annihilating operators in Ad that has a certain property, namelybeing holonomic. This notion has its origin in D-module theory, where it de-scribes Ad-modules of minimal Bernstein dimension. Informally but sufficientfor our needs, the Bernstein dimension coincides with the notion of dimensionthat is known from commutative algebra and which uses the Hilbert polyno-mial. In the following we will define the Bernstein dimension and holonomicfunctions in more precise fashion.

We want to transport the main ideas without using the heavy algebraicmachinery of filtrations, graded modules, etc. We try to keep this part assimple as possible, but without becoming faulty. The price we pay is thatthe following statements are not as general as they could be. On our wayto holonomy we use two shortcuts: The first shortcut is not to talk aboutmodules but only about ideals. To any left ideal I in Ad we can associatethe left Ad-module Ad/I, so we are only dealing with the special case thatinterests us. The second shortcut consists in leaving away the definitions offiltration, filtered modules, and graded modules, and instead going directlyto the definition of Hilbert polynomial and Bernstein dimension. A shortremark for the algebraists: The Bernstein dimension of an Ad-module is thedimension of the graded associated module with respect to the Bernsteinfiltration (which filters along the total degree of both the xi and Dxi).

Let I be a left ideal in Ad(K). Then analogously to commutative ringsAd/I is isomorphic to a K-vector space whose basis is constituted by themonomials that cannot be reduced by I. Let (Ad/I)≤s denote the (finite-dimensional) K-vector space that has as its basis only monomials with totaldegree less than or equal to s. In other words, (Ad/I)≤s = (Ad/I) ∩ (Ad)≤swhere (Ad)≤s denotes the set of all elements in Ad with total degree at most s.Then we can define the Hilbert function of the left ideal I to be

HFI(s) := dimK(Ad/I)≤s.

It turns out that there exists a polynomial HPI(s) (called the Hilbert poly-nomial of the left ideal I) with the property that

HPI(s) = HFI(s) for all integers s ≥ s0

Page 21: UNIVERSIT AT LINZ JKU - Koutschan

2.2. Holonomic functions 21

for some s0 ∈ N. We want to call the degree of this polynomial the Bernsteindimension of I. Note that classically the Bernstein dimension is defined forleft Ad-modules only, which agrees with our definition by looking at themodule Ad/I.

Example 2.3. Let’s go back to univariate holonomic functions and revisit theleft ideal I = 〈xDx − 3, D4

x 〉 from Example 2.1. Figure 2.3 shows monomialsthat can be reduced by I as solid dots whereas all monomials that cannot bereduced by I and hence form the K-basis of A1/I are depicted as open circles.

x

Dx

Figure 2.1: Shape of the annihilator of x3.

The first values of HFI(s) are listed in the following table:

s 0 1 2 3 4 5 6 . . .HFI(s) 1 3 5 7 8 9 10 . . .

Thus the Hilbert polynomial is s + 4 and it agrees with the Hilbert functionfor s ≥ 3; hence the Bernstein dimension of I is 1. Note that omittingthe second ideal generator D4

x does not change the Bernstein dimension (theHilbert polynomial in this case would be 2s+ 1).

We have now prepared the stage for Joseph Bernstein’s (his name is some-times spelled I. N. Bernshtein) celebrated result.

Theorem 2.4 (Bernstein’s inequality). If I is a proper left ideal in Ad thenthe Bernstein dimension of I is greater than or equal to d.

Page 22: UNIVERSIT AT LINZ JKU - Koutschan

22 Chapter 2. Holonomic and ∂-finite functions

As the definition of Bernstein dimension before, this statement can beformulated in a more general fashion, then addressing finitely generatedleft Ad-modules. The general version and its proof can be found in Bern-stein’s original paper [16, Theorem 1.3] or in the nice introductory book ofCoutinho [30, Chapter 9, Theorem 4.2].

Since they play an important role in our work, we want to investigate inmore detail some properties of left ideals in the Weyl algebra; in particularthe fact that there are no zero-dimensional proper left ideals. This is aconsequence of Bernstein’s inequality (Theorem 2.4). Therefore, instead of arigorous proof, we try to give some intuition about this fact (note also thatExample 2.3 agrees with Theorem 2.4).

Example 2.5. From commutative algebra we are very much used to zero-dimensional ideals, e.g., the maximal ideals in K[x, y] each of which is gen-erated by 〈x− c1, y− c2〉 for some constants c1, c2 ∈ K. If we try to constructsuch an ideal in A1, i.e., I = A1〈x − c1, Dx − c2〉, we find that also 1 will becontained in this ideal and hence it is the whole ring:

Dx · (x− c1)− x · (Dx − c2) = xDx + 1− c1Dx − xDx + c2x

= 1− c1c2 + c2c1 = 1 (mod I)

Or, in other words, we have shown by the above calculation that the givenpolynomials do not form a left Grobner basis since their S-polynomial doesnot reduce to 0. Also observe that the 1 that survives in the end comes exactlyfrom the commutation relation of the Weyl algebra.

This example illustrates that the ideal structure in the Weyl algebra isquite different than in a commutative polynomial ring. Note also that thereare no proper two-sided ideals in the Weyl algebra (in other words Ad issimple).

Definition 2.6. We want to call a left ideal I in the Weyl algebra Ad holo-nomic if I = Ad or if the Bernstein dimension of I equals d, i.e., if theBernstein dimension is as small as possible (Theorem 2.4). A functionf(x1, . . . , xd) (or any “object” on which the Weyl algebra Ad can act) iscalled a holonomic function with respect to the variables x1, . . . , xd if thereexists a holonomic left ideal in Ad that annihilates f .

The notion of holonomic ideal is a slight abuse of mathematical languageand can lead to confusion. The reason is that an ideal in Ad gives rise toan Ad-module in two ways: First we can consider the elements of I as thecarrier set of the module, or second we can take the quotient Ad/I. The

Page 23: UNIVERSIT AT LINZ JKU - Koutschan

2.2. Holonomic functions 23

holonomy of an ideal then coincides with holonomy in the D-module sense ifthe second option is taken.

If one deals with partial differential equations rather than operators, thenoften also the notion holonomic system is used. In this context one speaksof the system as being maximally overdetermined, in the sense that there areas many linear partial differential equations with polynomial coefficients aspossible.

A nice property of holonomic ideals that is crucial for our work is theso-called elimination property . We will later see why it is so important: itjustifies the termination of many algorithms in Chapter 3.

Theorem 2.7. Let I be a holonomic ideal in Ad(K). Then for any subset ofd+ 1 elements among the generators x1, . . . , xd, Dx1 , . . . , Dxd there exists anonzero operator in I that involves only these d+ 1 generators and is free ofthe remaining d− 1 generators (we will also say that we can eliminate thesed− 1 generators).

Proof. We follow the proof given by Zeilberger in [93] to whom it was shownby Bernstein himself. For an arbitrary but fixed (d + 1)-subset of the gen-erators x1, . . . , xd, Dx1 , . . . , Dxd, let A denote the subalgebra of Ad that isgenerated by those. We study the mapping ϕ : A → Ad/I, P 7→ P mod I.From the definition it is clear that dimK(A)≤s =

(s+d+1d+1

)= O(sd+1) because

these are just all exponent vectors α ∈ Nd+1 with |α| ≤ s. On the otherhand the holonomy of I implies that dimK(Ad/I)≤s = O(sd). Hence thereexists an integer t > 0 so that

dimK(A)≤t > dimK(Ad/I)≤t.

So if we restrict ϕ to (A)≤t it will be a linear map from a K-vector space ofhigher dimension to one with a lower dimension. Therefore kerϕ is nontrivialand its elements are the desired operators.

An immediate consequence of Theorem 2.7 is that for a given holonomicideal we can find ordinary differential equations in it, namely for each Dxi wecan eliminate the remaining operators Dxj , j 6= i. From this fact it followsthat a holonomic function can be uniquely defined by giving its holonomicannihilating ideal plus finitely many initial values. Thus only a finite amountof information is needed to completely describe a holonomic function, aspointed out by Zeilberger [93]. In most cases, however, we are interested ineliminating some of the xi as we will see in Chapter 3.

As we pointed out, the attribute holonomic can be used in any classof objects for which the differentiation is explained, e.g., for rational func-tions, formal power series, C∞-functions, analytic functions, and distribu-tions. Moreover we can think of calling also other objects holonomic as soon

Page 24: UNIVERSIT AT LINZ JKU - Koutschan

24 Chapter 2. Holonomic and ∂-finite functions

as we can act on them with the Weyl algebra (this action then has to beexplained). As an example we want to have a look at sequences, and in thefirst place it is not clear how a differential operator should act on a sequence.Let (a(n))n∈Nd ∈ KN

dbe a sequence in the variables n = n1, . . . , nd. We

define the action of an operator of the Weyl algebra Ad by the actions of itsgenerators:

Dxi • a(n) := (ni + 1)a(n1, . . . , ni−1, ni + 1, ni+1, . . . , nd)xi • a(n) := a(n1, . . . , ni−1, ni − 1, ni+1, . . . , nd).

(2.5)

Example 2.8. With this definition we can argue that the operator 4x2Dx −xDx + 2x − 1 ∈ A1 annihilates the univariate sequence of Catalan numbersCn = 1

n+1

(2nn

). Indeed if we apply it to the sequence Cn according to the above

rules we get

4(n− 1)Cn−1 − nCn + 2Cn−1 − Cn = (4n− 2)Cn−1 − (n+ 1)Cn

which is nothing else than the well-known recurrence for the Catalan numbers.

Upon closer inspection of (2.5) we perceive that this definition is not atrandom but mirrors an ulterior motive: The action on a sequence just cor-responds to the action on its (multivariate) generating function

∑a(n)xn.

Therefore we could equivalently define a sequence to be holonomic if andonly if its generating function is holonomic. Since the action of differentialoperators on sequences is not very intuitive it is more convenient to translatethem into the shift algebra via Dxi = (ni+1)Sni and xi = S−1

ni(we can always

get rid of the negative powers of shift operators by multiplying through). Theelimination property carries directly over to the shift algebra by consideringthe Euler operator θxi = xiDxi that translates to θxi = ni. This reasoninggeneralizes to the mixed setting where both discrete and continuous variablesare involved. Finally we want to mention that also for q-holonomic functionsa corresponding theory has been developed [75].

Using the theory of D-modules it can be proven that holonomic func-tions share a couple of nice closure properties. If f and g are two holonomicfunctions then so are f + g and f · g. Furthermore if f(x1, . . . , xd) is a holo-nomic function then also f(x1, . . . , xd−1, c), c ∈ K,

∫f(x1, . . . , xd) dxd, and∫ b

af(x1, . . . , xd) dxd are holonomic functions (if they are defined at all). Sim-

ilar things can be said about the closure properties of holonomic sequenceswith the integral being replaced by the summation quantifier. Unfortunatelyit is not so simple to execute these closure properties algorithmically usingthe representation with holonomic ideals. Instead we will use the ∂-finiterepresentation (see the next section) to execute closure properties on the set

Page 25: UNIVERSIT AT LINZ JKU - Koutschan

2.3. ∂-finite functions 25

of functions that interest us. For that reason we do not want to go into detailhere, in particular we omit all the proofs of the above statements (they canbe found for example in [93]).

A collection of functions and sequences that are holonomic are displayedin Figure 2.3 (see page 41).

2.3 ∂-finite functions

In order to specify the class of functions that we are mostly going to deal within practice, we first have to introduce another kind of noncommutative op-erator algebra, named after the Norwegian mathematician Øystein Ore whostudied noncommutative polynomials [63] of this type. These algebras serveas a unifying framework to represent differential and difference equations aswell as mixed ones (the Weyl algebra is just a special instance of them).Additionally they allow more flexibility in handling the coefficients, for ex-ample for treating differential equations with rational instead of polynomialcoefficients (this allows us to divide out polynomial contents).

Ore algebras

We start with the space of functions that we want to operate on and denoteit by F . Again let K denote the ground field which means that we can see Fas a K-algebra of functions. We assume that F is equipped with certainK-linear endomorphisms whose properties we want to reproduce with thefollowing algebraic construction. If for example the K-linear endomorphismsin question are derivations, i.e., if they are satisfying the Leibniz law, then Fis also called a differential field or differential algebra. In this case we wouldlike to create an algebra of differential operators.

An Ore algebra O is a skew polynomial ring, also called an Ore polynomialring, that is obtained by applying Ore extensions to some base ring. Theelements of O are interpreted as operators that act on the functions in F .In order to specify the coefficients of the skew polynomial ring we first fix aK-algebra A, the base ring, which has to be a subalgebra of F . Since theelements of A will be part of the operator algebra O we have to define theiraction on elements of F ; this is achieved in a natural way by specifying thatan element a ∈ A acts on f ∈ F as the operator “multiplication by a”, i.e.,a • f := af .

Every Ore extension is based on a K-linear map δ : F → F so thatδ(kf + g) = kδ(f) + δ(g) for all f, g ∈ F and k ∈ K. Furthermore, δ hasto be a σ-derivation at the same time which means that it has to fulfill the

Page 26: UNIVERSIT AT LINZ JKU - Koutschan

26 Chapter 2. Holonomic and ∂-finite functions

skew Leibniz law

δ(fg) = σ(f)δ(g) + δ(f)g for all f, g ∈ F (2.6)

where σ is some injective K-linear endomorphism of F (additive and multi-plicative), i.e.,

σ(kf +g) = kσ(f)+σ(g) and σ(fg) = σ(f)σ(g) for all f, g ∈ F , k ∈ K.

An Ore extension adds a new symbol ∂ to the base ring A and henceyields a skew polynomial ring that is denoted by O = A[∂;σ, δ] and whoseelements are polynomials in ∂ with coefficients in A. The addition in O isjust the usual one but the multiplication is defined by associativity via thecommutation rule

∂a = σ(a)∂ + δ(a) for all a ∈ A

(for which to make sense we have to claim that σ and δ can be restrictedto A). Note that in contrast to the Weyl algebra the noncommutativityis now between the “variables” of the polynomial ring and its coefficients(see also Section 4.8). The injectivity of σ ensures the nice property thatdeg∂(pq) = deg∂(p) + deg∂(q) for skew polynomials p, q ∈ O. Further it ispossible to perform right Euclidean division. If additionally σ is invertible,then also left Euclidean division can be done. More details on the propertiesof such skew polynomial rings can be found in the instructive introduction byBronstein and Petkovsek [21]. The process of adding Ore extensions can beiterated to get A[∂1;σ1, δ1][∂2;σ2, δ2] · · · , whereat we assume that ∂i∂j = ∂j∂iand σiδj = δjσi for all i and j.

The last missing step is to define how the new symbol ∂ should act on thefunctions in F . Depending on what operation on F one wants to represent,one defines either ∂ • f := δ(f) or ∂ • f := σ(f) (the latter option is usuallychosen when δ = 0). By means of the action • : O × F → F our functionspace F turns into an O-module.

As examples for making the above abstract definitions clearer, we presentthe two Ore extensions that we will mainly use:

• σ(f) = f and δ(f) = dfdx

: The action of the new symbol ∂ is defined tobe ∂ • f := δ(f) and with A = K[x] we get the first Weyl algebra A1

(where we tacitly assume that the univariate polynomial ring K[x] is asubalgebra of F). In contrast if we set A = K(x) then we get the alge-bra of linear ordinary differential equations with rational coefficients;this can be interpreted as the localization of A1 with respect to K[x].

Page 27: UNIVERSIT AT LINZ JKU - Koutschan

2.3. ∂-finite functions 27

• σ(f) = f |n→n+1 and δ(f) = 0: In this case the action of ∂ is defined tobe ∂ • f := σ(f). With A = K[n] we get the first shift algebra.

Typically A = K(v1, . . . , vj−1)[vj, . . . , vd] where both extreme cases j = 1and j = d may be attained. In these cases we speak of a polynomial orrational Ore algebra respectively.

Definition of ∂-finite functions

The notion of ∂-finiteness is the main ingredient for most of the algorithmsthat will be presented in Chapter 3. Roughly speaking a function is called∂-finite if all its “derivatives” span a finite-dimensional vector space overthe rational functions (in this context we use the term “derivative” with amore general meaning and let it refer to the application of any operator).Whenever dealing with ∂-finite functions we work in rational Ore algebras.

Let O = A[∂;σ, δ] = A[∂1;σ1, δ1] · · · [∂d;σd, δd] be an Ore algebra with Abeing a field (typically a rational function field). A left ideal I ⊆ O is calleda ∂-finite ideal w.r.t. O if dimA(O/I) <∞, i.e. the A-vector space O/I is offinite dimension. A function f is called ∂-finite w.r.t. O if there exists a ∂-finite ideal in O that annihilates f . Often we just speak of f being a ∂-finitefunction meaning that there is an appropriate Ore algebra with respect towhich f is ∂-finite. The ∂ herein is just a generic symbol and does not referto a concrete Ore operator.

Let now I ⊆ O denote an annihilating ∂-finite ideal for the function f .We denote the set of all “derivatives” of f byO•f := P •f | P ∈ O. Due tothe fact that O/I ∼= O• f we can say that f is ∂-finite if all its “derivatives”constitute a finite-dimensional A-vector space. For this statement to makesense we additionally have to make sure that the function f itself can be seenas element of an A-vector space. An instance where this fact shall preventus from declaring a function to be ∂-finite will be given in Example 2.13.For the moment we want to make the idea of ∂-finiteness demonstrative bylooking at a very basic example.

Example 2.9. We consider the function f(x, y) = sin(x+yx−y

)in two continu-

ous variables. It is natural to act with Dx and Dy on that function, e.g.,

D2xDy • sin

(x+ y

x− y

)=

8 (−2xy − y2)

(x− y)5sin

(x+ y

x− y

)+

4 (x3 − 5xy2 + 2y3)

(x− y)6cos

(x+ y

x− y

)

Page 28: UNIVERSIT AT LINZ JKU - Koutschan

28 Chapter 2. Holonomic and ∂-finite functions

It is obvious that all partial derivatives of f with respect to x and y are ofthe form

r1(x, y) sin

(x+ y

x− y

)+ r2(x, y) cos

(x+ y

x− y

)where r1 and r2 are rational functions in Q(x, y). But this means that thederivatives of f span a two-dimensional Q(x, y)-vector space. Hence f is a∂-finite function with respect to the Ore algebra Q(x, y)[Dx; 1, Dx][Dy; 1, Dy].

For holonomic functions we have seen that by Theorem 2.7 there existsan ordinary linear differential equation for each variable. A similar statementholds for ∂-finite ideals.

Proposition 2.10. A left ideal I ⊆ O = A[∂1;σ1, δ1] · · · [∂d;σd, δd] is ∂-finiteif and only if I contains a rectangular system, i.e., P1(∂1), . . . , Pd(∂d) ⊆ I.By that we mean that Pi depends only on the Ore operator ∂i and containsnone of the others.

Proof. One direction is obvious: If we have a rectangular system and con-sider the left ideal I that is generated by its elements, then the dimensiondimAO/I ≤

∏di=1 deg∂i Pi <∞ and hence I is ∂-finite.

On the other hand, assume that I ⊆ O is ∂-finite with dimAO/I = m.We consider the sequence of power products 1, ∂1, ∂

21 , . . . each of which can

be reduced to normal form modulo I. Since these normal forms are elementsin a m-dimensional A-vector space, we find a linear dependence at the latestwhen we go up until ∂m1 . This linear dependence is nothing else but anelement in I that involves only ∂1 and none of the ∂i, i > 1. Doing the samegame for ∂2, . . . , ∂d yields a rectangular system.

The nice thing about ∂-finite functions is that again we have to specifyonly finitely many initial values in order to have a complete description of aconcrete function (viewed as a formal power series). It may however happenthat the leading coefficients of the annihilating operators introduce somesingularities in which case more, possibly infinitely many, initial values haveto be given (see also Section 7.3).

Example 2.11. We want to study the Struve function Hn(z) that is a so-lution of the inhomogeneous second-order Bessel differential equation ([6,12.1.1]):

z2H ′′n(z) + zH ′

n(z) + (z2 − n2)Hn(z) =4(z2

)n+1

√πΓ(n+ 1

2

)

Page 29: UNIVERSIT AT LINZ JKU - Koutschan

2.3. ∂-finite functions 29

We homogenize this equation by first constructing an annihilating operatorzDz − n − 1 for the inhomogeneous part (which is easy since it is hyperex-ponential with respect to z) and by multiplying it to the differential equationz2D2

z + zDz + z2 − n2 from the left:

P1(Dz) = z3D3z − (n− 2)z2D2

z −(n2 + n− z2

)zDz + (n3 + n2 − nz2 + z2)

hence is an annihilating operator for Hn(z). Similarly we can look up aninhomogeneous recurrence [6, 12.1.9] for the Struve function

Hn−1(z) + Hn+1(z) =2n

zHn(z) +

(z2

)n√πΓ(n+ 3

2

)which again can be made homogeneous in the same manner:

P2(Sn) = ((2n+ 5)Sn − z) ·(zS2

n − (2n+ 2)Sn + z)

=

= (2n+ 5)zS3n − (4n2 + 18n+ z2 + 20)S2

n + (4n+ 7)zSn − z2

(we multiplied the original equation by z in order to clear denominators).Now P1 and P2 form a rectangular system which proves that Hn(z) is a ∂-finite function with respect to the Ore algebra O = Q(n, z)[Sn;Sn, 0][Dz; 1, Dz].If we additionally provide 3 · 3 = 9 initial values, this rectangular system de-scribes the Struve function completely. But it is not a Grobner basis (onceagain we have to suppress our intuition from commutative algebra that baseson Buchberger’s product criterion). The Grobner basis for the left ideal gen-erated by P1 and P2 with respect to total degree order is

z2D2z + (−2nz − z)Sn − 2nzDz + n2 + n+ z2,

zSnDz + (n+ 1)Sn − z,(2nz + 3z)S2

n − (4n2 + 10n+ z2 + 6)Sn − z2Dz + 3nz + 3z.

From the leading monomials D2z , SnDz, and S2

n we can read off that thereare 3 monomials 1, Dz, Sn under the staircase. Hence only 3 initial valuessuffice to determine a power series expansion around z = 0 for all n ∈ N ina unique way:

H0(0) = H1(0) = 0 and H ′0(0) =

2

π.

Example 2.12. In contrast to the previous example, Stirling numbers arenot ∂-finite. Although the Stirling numbers of the first kind for example arekilled by the mixed recurrence operator SmSn + mSn − 1, there are no purerecurrences, neither in the first nor in the second parameter, for them. Thismeans they do not possess a rectangular system and hence are not ∂-finite.

Page 30: UNIVERSIT AT LINZ JKU - Koutschan

30 Chapter 2. Holonomic and ∂-finite functions

Let us illustrate why it is so important that any object that we want toconsider to be ∂-finite must be an element of an appropriate vector space.In the previous example, the Stirling numbers are in principal eligible forapplying the definition of ∂-finite, but in the end there are simply not enoughrelations for them (what to do in such cases has recently been describedin [27], see Section 2.6). In contrast to that we will now discuss an examplewhich is not ∂-finite because the definition of ∂-finiteness cannot be applied.

Example 2.13. The Kronecker delta δm,n is defined to be 1 if m = n and 0otherwise. Since m and n are discrete variables we introduce the Ore algebraO = Q(m,n)[Sm;Sm, 0][Sn;Sn, 0]. It is easy to verify that δm,n is annihilatedby (m−n+1)Sm+n−m and (−m+n+1)Sn+n−m. These two operators area rectangular system and hence generate a ∂-finite left ideal in O (they evenform a Grobner basis), so one could be tempted to declare δm,n to be a ∂-finitefunction. Now observe that δm,n is also annihilated by the polynomial m−n,but the left ideal generated by m − n is the whole ring O (we can removea polynomial content in m and n). Hence in the ∂-finite setting we cannotdistinguish between δm,n and the bivariate sequence that is identically 0. Thereason is that we cannot interpret δm,n as an element of a Q(m,n)-vectorspace.

Closure properties

Similar to the holonomic functions, the class of ∂-finite functions shares somenice closure properties. Additionally these can be executed effectively andalgorithmically in a relatively simple manner. The ∂-finite functions areclosed under operator application, sum, product, algebraic substitutions forcontinuous variables, and rational-linear substitutions for discrete variables.In the following we prove that these closure properties indeed hold and wetry to formulate the proofs in a way that gives the corresponding algorithmsat the same time.

The algorithms for performing ∂-finite closure properties follow a similarprinciple as the celebrated FGLM algorithm [33] (named after its inventorsFaugere, Gianni, Lazard, and Mora). For that reason we want to shortlydescribe this algorithm. The FGLM algorithm is designed for transforminga given Grobner basis G1 of a zero-dimensional ideal in K[x] into a Grobnerbasis G2 for the same ideal with respect to a different term order ≺2. Itworks by going systematically through the monomials of K[x] starting withthe set T = x0 = 1: In each step we choose (and afterwards delete) the≺2-minimal monomial xγ from T such that it is not divisible by the leadingmonomial of some element of G2 that we might already have found. It now

Page 31: UNIVERSIT AT LINZ JKU - Koutschan

2.3. ∂-finite functions 31

can be decided whether xγ is the leading monomial of some new elementof G2 or whether it belongs to the set of monomials which cannot be reducedby G2. For this purpose xγ is reduced with G1 to normal form representation(which is an element of the finite-dimensionalK-vector spaceK[x]/〈G1〉) andafterwards it is checked whether there is a linear dependence between thisnormal form and all normal forms that correspond to monomials for whichwe found earlier that they are under the stairs of G2. If they are linearlydependent, this means that xγ is the leading monomial of an element of G2

(which now is given by exactly this linear dependence). On the other handif all these normal forms are linearly independent then this indicates that xγ

cannot be reduced by G2 and hence lies under the staircase of G2. In thiscase we have to continue our search for leading monomials in all directionswhich means that we add the elements x1x

γ , x2xγ , . . . to T . This procedure

is repeated until G2 is complete (which can easily be seen, e.g., by equatingthe vector space dimensions dimKK[x]/〈G1〉 = dimKK[x]/〈G2〉). Havingan idea of how the FGLM algorithm works will make the rest of this sectionmuch better understandable. The algorithm is displayed in Figure 2.2.

Input: Grobner basis G1 ⊂ K[x1, . . . , xd], term order ≺2

Output: Grobner basis G2 of 〈G1〉 with respect to ≺2

T := 1, G2 := , j := 1while T 6= T := T \ t ∈ T | ∃g ∈ G2 such that lm(g) divides ttj := min≺2 TT := T \ tjNFj := normal form of tj with respect to G1

if (NFi | 1 ≤ i ≤ j are linearly dependent) thenlet ci ∈ K (not all zero) with c1NF1 + · · ·+ cjNFj = 0G2 := G2 ∪ c1t1 + · · ·+ cjtj

elseT := T ∪ xitj | 1 ≤ i ≤ dj := j + 1

return G2

Figure 2.2: FGLM Algorithm

Theorem 2.14. Let f be a ∂-finite function with respect to the Ore algebraO = A[∂;σ, δ] = A[∂1;σ1, δ1] · · · [∂d;σd, δd]. Then for any operator P ∈ Oalso g = P • f is a ∂-finite function with respect to O.

Page 32: UNIVERSIT AT LINZ JKU - Koutschan

32 Chapter 2. Holonomic and ∂-finite functions

Proof. Since any “derivative” of g is also a “derivative” of f , or in otherwords O • g = (O · P ) • f ⊆ O • f , it is immediately clear that also g is∂-finite. Moreover given a Grobner basis G ⊂ O for an annihilating ∂-finiteideal of f , a Grobner basis G for an annihilating ideal of g can be computedby an adjusted version of the FGLM algorithm. The monomials ∂γ are testedin the same systematic way, whether they lie under the stairs of G or arethe leading monomial of an element of G. The only change takes place inthe reduction step: instead of reducing the monomial ∂γ one computes thenormal form of P ·∂γ with respect to G.

Example 2.15. We consider the Hankel function of the first kind H(1)n (x);

sometimes it is also called Bessel function of the third kind, because it isa linear combination of Bessel functions of the first and second kind. Wework in the Ore algebra O = Q(n, x)[Sn;Sn, 0][Dx; 1, Dx] and choose a totaldegree order that breaks ties via Sn > Dx. The reduced Grobner basis for theannihilator of H

(1)n (x) is

xSn + xDx − n, x2D2x + xDx + (x2 − n2).

We want to compute the reduced Grobner basis G of an annihilating idealfor H

(1)n+1(x) +H

(1)n (x), thus P = Sn + 1. We start with the monomial 1 and

reduce (Sn + 1) · 1 to

Sn + 1− 1

x(xSn + xDx − n) = −Dx +

n

x+ 1.

Next we add the monomials Sn and Dx to the set of test monomials T . Theminimal element in T is Dx and we reduce (Sn + 1)Dx to 1

x(n + x + 1)Dx −

1x2

(n2 +n−x2). We find that the two normal forms are linearly independent,

hence the monomials 1 and Dx will not be reducible by G. Thus we add themonomials SnDx and D2

x to T . Next we take the smallest monomial Sn andreduce (Sn + 1)Sn to − 1

x(2n + x + 2)Dx + 1

x2(2n2 + nx + 2n − x2). Now the

three normal forms computed so far are linearly dependent:

−(2n2 + 2nx+ 2n+ x)

(−1nx

+ 1

)+ 2x(n+ x+ 1)

(n+x+1

x

−n2+n−x2x2

)+

x(2n+ 2x+ 1)

(−2n+x+2

x2n2+nx+2n−x2

x2

)=

(00

).

Hence x(2n + 2x + 1)Sn + 2x(n + x + 1)Dx − (2n2 + 2nx + 2n + x) is an

element of G. Last we have to care about the monomial D2x from T (SnDx we

will not have to consider since it is a multiple of the leading monomial Sn).

Page 33: UNIVERSIT AT LINZ JKU - Koutschan

2.3. ∂-finite functions 33

We find that there is a linear dependence between the first two normal forms(corresponding to 1 and Dx) and the normal form of (Sn + 1)D2

x . It delivers

the second element of G

x2(2n+ 2x+ 1)D2x + 2x(2n+ x+ 1)Dx − (2n− 2x+ 1)(n+ x)(n+ x+ 1).

which is now a complete Grobner basis.

In the example we observe that the resulting Grobner basis has the samenumber of monomials under its staircase as the input. Analyzing the algo-rithm reveals that the closure property of operator application never increasesthis dimension, but sometimes even reduces it. This is an important pointand one should try to use this closure property whenever it is possible. Ifwe used the closure property sum instead we would have ended up with aGrobner basis of Q(n, x)-dimension 4 under the staircase.

Theorem 2.16. If f and g are ∂-finite functions with respect to some Orealgebra O = A[∂;σ, δ] = A[∂1;σ1, δ1] · · · [∂d;σd, δd], then f + g is ∂-finitewith respect to O as well. If additionally σα(f) ∈ O • f for α ∈ Nd, thenalso f · g is ∂-finite with respect to O.

Proof. Since f is a ∂-finite function we know that we can rewrite any deriva-tive ∂γ • f,γ ∈ Nd as an A-linear combination of ∂α • f | α ∈ U whereU ⊂ Nd is a finite set of exponent vectors representing the monomials underthe staircase of a ∂-finite annihilating ideal for f . Similarly every derivativeof g can be expressed as an A-linear combination of ∂β • g | β ∈ V forsome other finite set V ⊂ Nd.

In order to prove that f + g is ∂-finite we rewrite an arbitrary derivative

∂γ • (f +g) = ∂γ •f +∂γ •g =∑α∈U

aα(∂α •f)+∑β∈V

bβ(∂β •g), aα, bβ ∈ A

from which it is clear that all derivatives of f + g span a finite-dimensionalvector space over A; it is spanned by ∂α • f | α ∈ U ∪ ∂β • f | β ∈ V and hence its dimension is at most |U |+ |V |.

A similar argument applies in the product case; applying the skew Leibnizlaw (2.6), any derivative ∂γ • (f · g),γ ∈ Nd can be rewritten as an A-linearcombination of products of derivatives of f and g:

∂γ • (f · g) =∑

α,β∈Ndcα,β ·

(∂α • f

)·(∂β • g

), cα,β ∈ A. (2.7)

For differential and shift operators this is trivially achieved by

Dx • (f · g) = (Dx • f) · g + f · (Dx • g),

Sn • (f · g) = (Sn • f) · (Sn • g).

Page 34: UNIVERSIT AT LINZ JKU - Koutschan

34 Chapter 2. Holonomic and ∂-finite functions

In the general case we have to distinguish the cases ∂i • f = σi(f) (which isfine) and ∂i • f = δi(f). In the latter we use that σi and δi commute:

∂ni • (f · g) =n∑k=0

(n

k

)δn−ki

(σki (f)

)δki (g).

Equation (2.7) is then established by the condition σki (f) ∈ O • f .But the derivatives of f and the derivatives of g themselves can be ex-

pressed as linear combinations of elements determined by U and V . So finallywe get

∂γ • (f · g) =∑α∈U

∑β∈V

cα,β ·(∂α • f

)·(∂β • g

), cα,β ∈ A.

Again it is now clear that the derivatives of f · g span a finite-dimensionalA-vector space whose dimension is at most |U | · |V |.

From the algorithmic point of view we proceed as follows. The input aretwo Grobner bases for ∂-finite annihilating ideals of f and g in O. Theydetermine the sets U, V ⊂ Nd representing the monomials under the stairsof the respective Grobner basis. We go through the monomials ∂γ in thesame systematic way as in the FGLM algorithm. To each monomial ∂γ wehave to compute a kind of “normal form”. The normal form in the sum casecorresponds to the vector

(aα1 , aα2 , . . . , bβ1 , bβ2 , . . . ) ∈ A|U |+|V |.

In the product case the normal form is constituted by the coefficients cα,β:

(cα1,β1 , cα1,β2 , . . . , cα2,β1 , cα2,β2 , . . . ) ∈ A|U |·|V |.

In order to compute these “normal forms”, in particular in the last rewritingstep, the reduction modulo the input Grobner bases is used. Everything elseis done exactly as in the FGLM algorithm.

The next closure property performs algebraic substitution of continuousvariables. Although it is quite folklore, we want to state a basic fact that isneeded later, in the following lemma.

Lemma 2.17. Let h(z) be a multivariate algebraic function, i.e., there existsa nonzero polynomial p ∈ K[h, z] with p(h(z), z) = 0. Any derivative of h(z)can be expressed as a polynomial in h(z) with degree smaller than the degreeof the minimal polynomial p.

Page 35: UNIVERSIT AT LINZ JKU - Koutschan

2.3. ∂-finite functions 35

Proof. We differentiate the minimal polynomial p with respect to zi:

∂zip(h(z), z) =

∂p

∂h· ∂h∂zi

+∂p

∂zi= 0.

Solving this equation for the derivative of h gives

∂h

∂zi= − ∂p

∂zi·(∂p

∂h

)−1

.

After reducing the expression on the right-hand side modulo the minimalpolynomial p (for the second factor we compute the modular inverse withthe extended Euclidean algorithm we obtain the desired representation forDzi •h(z). Repeating this procedure iteratively, we get such a representationfor arbitrary higher and mixed derivatives of h(z).

Theorem 2.18. Let f(x,w) be a ∂-finite function with respect to the Orealgebra O = K(x,w)[Dx; 1,Dx][∂w;σw, δw] where x = x1, . . . , xd. Let fur-ther h1(z), . . . , hd(z) be algebraic functions in z = z1, . . . , ze which meansthat there are nonzero polynomials p1, . . . , pd ∈ K[h, z1, . . . , ze] such thatpi(hi(z), z1, . . . , ze) = 0. Then the function g(z,w) = f(h1(z), . . . , hd(z),w)is ∂-finite w.r.t. the Ore algebra O′ = K(z,w)[Dz; 1,Dz][∂w;σw, δw].

Proof. We want to study the action of a differential operator on g. For1 ≤ i ≤ e, applying the chain rule we get

Dzi • g(z,w) = (Dx1 • f)(h1(z), . . . , hd(z),w

)· (Dzi • h1(z)) + · · ·+

(Dxd • f)(h1(z), . . . , hd(z),w

)· (Dzi • hd(z)) .

We can rewrite the derivatives of the algebraic functions h1(z), . . . , hd(z) byLemma 2.17 as polynomials in these respective functions. It is not difficultto see that we can throw other differential operators on the previous expres-sion and after doing a similar rewriting plus reduction modulo the minimalpolynomials pi, we obtain an expression that involves some derivatives of fand each hi occurs polynomially with powers smaller than the degree of itsminimal polynomial pi. Since f is ∂-finite we can rewrite all its derivativesas linear combinations of U1 • f, . . . , Um • f (where the Ui are the monomialsunder the staircase of the ∂-finite annihilating ideal of f). Summing up, wecan express any arbitrary derivative of g(w, z) as a linear combination of

(Ui • f)(h1(z), . . . , hd(z),w

)· h1(z)j1 · · ·hd(z)jd

where 1 ≤ i ≤ m and 0 ≤ jl < degh pl for 1 ≤ l ≤ d. Hence g is a ∂-finite function and its derivatives span a K(z,w)-vector space of dimensionat most m

∏dl=1 degh pl.

Page 36: UNIVERSIT AT LINZ JKU - Koutschan

36 Chapter 2. Holonomic and ∂-finite functions

We can execute the algebraic substitution algorithmically by again usingan FGLM-like procedure. Since the output is supposed to be a Grobner basisof some left ideal in O′, we will go through the monomials of O′. For eachmonomial that we have to consider we compute a normal form as described inthe proof. Everything else is done as in the FGLM algorithm. The key pointis to translate the action of an operator inO′ on g to the action of an operatorin O on f . This idea is even more exploited in the last closure property thatwe are going to discuss, the rational-linear substitution of discrete variables.

Theorem 2.19. Let f(k,w) be a ∂-finite function with respect to the Orealgebra O = K(k,w)[Sk;Sk,0][∂w;σw, δw] where k = k1, . . . , kd. Then theresult of the rational-linear substitution

g(n,w) = f(c1 + c1,1n1 + · · ·+ c1,ene, . . . , cd + cd,1n1 + · · ·+ cd,ene,w)

where the ci are arbitrary constants and the ci,j are rational numbers, is again∂-finite with respect to the Ore algebra O′ = K(n,w)[Sn;Sn,0][∂w;σw, δw],provided that the annihilating relations for f(k,w) still hold when k1, . . . , kdtake (potentially non-integral) values implied by the ci and ci,j.

Proof. We study how shifts in the ni translate to shifts in the kj and thereforelet the operator Sa1n1

· · ·Saene ∈ O′ act on the substitution kj = cj + cj,1n1 +

· · ·+ cj,ene. The result will be

cj + cj,1(n1 + a1) + · · ·+ cj,e(ne + ae) = kj +e∑i=1

cj,iai︸ ︷︷ ︸=:sj

.

Let tj be the common denominator of the cj,i, 1 ≤ i ≤ e. The quantity sjthen is a rational number with sjtj ∈ Z. It is now clear that each shift of gtranslates to a shifted version of f of the form f(k + s,w) with s being anelement of the lattice generated by (t1, 0, . . . , 0), . . . , (0, . . . , 0, td). Since fis ∂-finite all instances f(k + s,w) can be reduced to a finite set of suchinstances, its size being bounded by dimK(k,w)(O • f)

∏dj=1 tj <∞. Hence g

is ∂-finite.

We try to enlighten the argument of the above proof by an example. Forsake of simplicity we choose a univariate one.

Example 2.20. Given the ∂-finite function f(k) = k! by its ∂-finite annihi-lating ideal I = O〈Sk − k − 1〉 with O = Q(k)[Sk;Sk, 0], compute the ∂-finiteannihilating ideal for g(n) = f

(n2

)with respect to O′ = Q(n)[Sn;Sn, 0]. A

Page 37: UNIVERSIT AT LINZ JKU - Koutschan

2.4. Holonomic versus ∂-finite 37

monomial San ∈ O′ translates in terms of the original function as f(k + a

2

).

All such instances can be reduced with I to a linear combination of f(k) andf(k + 1

2

). The first two monomials under consideration, S0

n and S1n , translate

to exactly these two basis elements. Finally S2n translates to Sk whose normal

form modulo I is k + 1. At this point we find a linear dependence betweenthe normal forms

(−k − 1)

(10

)+ 0

(01

)+

(k + 1

0

)=

(00

)which delivers (after substituting k = n

2and clearing denominators) as result

the annihilating operator 2S2n − n− 2.

2.4 Holonomic versus ∂-finite

We have now introduced two different classes of functions, namely holonomicand ∂-finite functions. This section gives a comparison of these two classesand answers questions like: what are the differences between holonomic and∂-finite? Which functions lie in the intersection? Why do we need these twonotions at all and why does it not suffice to consider just one of them?

An obvious difference concerns the kind of operators that can be treated.The definition of ∂-finiteness makes sense for all kinds of Ore operatorswhereas holonomy is defined for the differential setting in the first place,but can be extended to the shift setting using the loop way via the generat-ing function and to q-calculus. Since we are basically interested only in thesesettings, the broader generality of ∂-finiteness is not exploited and negligiblein our work.

Univariate functions

For functions in one variable, the definitions of holonomy and ∂-finitenesscoincide provided that they are applicable. We can easily convince our-selves that this is the case: Let f(x) be a ∂-finite function with respectto O = K(x)[Dx; 1, Dx]; then there exists a homogeneous linear differentialequation with coefficients in K(x) for f(x). After clearing denominators wecan consider the left ideal in the Weyl algebra A1 generated by it. The Bern-stein dimension is 1 (there is no other choice—dimension 2 happens only forthe zero ideal) and hence f(x) is holonomic. Conversely assume that f(x) isa holonomic function and that it can be seen as a K(x)-vector space element.Then any operator in the holonomic (and therefore nonzero) ideal for f(x)

Page 38: UNIVERSIT AT LINZ JKU - Koutschan

38 Chapter 2. Holonomic and ∂-finite functions

involves the Ore operator Dx and witnesses that f(x) is ∂-finite: there are noannihilating operators in the subalgebra K[x] because otherwise f(x) couldnot be interpreted as a vector space element. A similar reasoning applies tothe shift and the q-case.

Example 2.21. The Dirac delta δ(x) distribution is a univariate examplewhich is holonomic but not ∂-finite. As it is annihilated by a polynomial viaxδ(x) = 0 it cannot be interpreted as an element in a K(x)-vector space.

If we restrict the functions in question to formal power series then we donot have to care about this subtle difference the notions D-finite, holonomic,and ∂-finite are all equivalent.

Univariate sequences with finite support are trivially annihilated by apolynomial and therefore can not be considered to be ∂-finite. But definitelythey are holonomic and also P-finite. For sequences with infinite support thenotions P-finite, holonomic, and ∂-finite are all equivalent.

Differential setting

After having discussed the univariate situation, we now turn to the multivari-ate setting which we restrict for the moment to differential operators only.Doing so, one finds that holonomy and ∂-finiteness again coincide providedthat the definitions are applicable. This result follows as a corollary from adeep theorem of Masaki Kashiwara [45].

Theorem 2.22. Let Ad be the Weyl algebra in x = x1, . . . , xd and let O bethe rational differential Ore algebra K(x)[Dx; 1,Dx]. A left ideal I ⊆ O is∂-finite if and only if I ∩ Ad (which is a left ideal in Ad) is holonomic.

Proof. The backwards direction is simple to prove: Given a holonomic ideal,by the elimination property (Theorem 2.7) there exists (for all 1 ≤ i ≤ d) anonzero operator that involves only Dxi and none of the remaining differentialoperators Dxj , j 6= i. But these operators form a rectangular system andtherefore generate a ∂-finite left ideal in O (Proposition 2.10).

The other direction in more difficult to show and we will not give theproof here. A proof that is adapted for this special situation and thereforemore elementary than Kashiwara’s, can be found in the appendix of [86].

Shift setting

Unfortunately, when considering multivariate sequences, the relation betweenholonomic and ∂-finite is not as close as in the differential setting. The reason

Page 39: UNIVERSIT AT LINZ JKU - Koutschan

2.4. Holonomic versus ∂-finite 39

is that an analogue of Theorem 2.22 does not exist for the shift case andthere are functions that are ∂-finite but not holonomic. The most prominentexample to illustrate this fact has been given by Wilf and Zeilberger [91].

Example 2.23. The bivariate sequence f(k, n) = 1k2+n2 is easily identified

to be ∂-finite since it is hypergeometric. Therefore it has two annihilatingoperators that generate a zero-dimensional ideal

I = O

⟨(k2 + 2k+ n2 + 1)Sk + (−k2− n2), (k2 + n2 + 2n+ 1)Sn + (−k2− n2)

⟩in O = Q(k, n)[Sk;Sk, 0][Sn;Sn, 0] and the Q(k, n)-vector space dimension ofO/I is 1.

Assume for now that f(k, n) is holonomic; then by the elimination prop-erty there exists a recurrence free of k so that

p1(n)

(k + a1)2 + (n+ b1)2+ · · ·+ pd(n)

(k + ad)2 + (n+ bd)2= 0, aj, bj ∈ N.

For a fixed integer n > 0 for which not all pj(n) are zero, we observe that eachnonzero term introduces two poles ±i(n+bj)−aj. All these poles are pairwisedistinct and they cannot cancel away unless all pj(n) are zero. Therefore nosuch recurrence can exist and f(k, n) is not holonomic.

Conclusion

We have seen that holonomic and ∂-finite functions are closely related (seealso Figure 2.3); in fact most of the “interesting” functions lie in their in-tersection. The reason for not restricting ourselves to just one of these twoclasses is that we need certain properties of either class. We want to makeuse of the fact that ∂-finite functions are much easier to handle: First theclosure properties are are simpler to perform, and second, the base cases, i.e.,the ∂-finite descriptions of basic expressions, are easier to obtain. Let’s givetwo examples:

Example 2.24. We continue with Example 2.1 where we studied annihi-lating ideals for the function f(x) = x3. Treating f as a ∂-finite function,we observe that it is hyperexponential and hence take its first order differ-ential equation xDx − 3. It generates a ∂-finite ideal I in the Ore algebraO = Q(x)[Dx; 1, Dx] and the Q(x)-dimension of O/I is 1. Since it can-not be smaller (only the function that is identically 0 is annihilated by thewhole ring) we know that we have the complete annihilator. Treating f asa holonomic function, we have seen that the first order differential does not

Page 40: UNIVERSIT AT LINZ JKU - Koutschan

40 Chapter 2. Holonomic and ∂-finite functions

generate the whole annihilator, since the annihilating operator D4x is miss-

ing. However, in the ∂-finite ideal it is contained as the following calculationshows:

D4x =

(1

xD3x

)· (xDx − 3) .

This example illustrates a phenomenon that is of importance in practice.Sometimes we would like to determine a holonomic ideal in a polynomialOre algebra from a given ∂-finite ideal in the corresponding rational Orealgebra. More concretely, let I ⊂ Orat be a ∂-finite ideal in some rationalOre algebra Orat = K(v)[∂;σ, δ]. We are interested in the intersectionI ∩Opol,Opol = K[v][∂;σ, δ], which in general is a quite difficult problem.In the pure differential case it is named Weyl closure and has been solvedcompletely by Tsai ([88] for the univariate case, and [87] for the multivariatecase). As soon as shift operators are involved the question is still open.An easy workaround which more or less works in practice is to cancel thedenominators of the generators of I ⊂ Orat in order to use them as generatorsof an ideal in Opol. The pitfall hereby is that the result in general will onlybe a subideal of I ∩Opol (as was demonstrated in Example 2.24). We willrefer to this phenomenon as extension/contraction.

Example 2.25. We want to study annihilating ideals of orthogonal polyno-mials. Their differential equations and recurrence relations are well known.So if we take for example the Gegenbauer polynomials Cm

n (x), we can easilyobtain a ∂-finite description by looking up the corresponding relations andcompute a Grobner basis of them:

(n+ 1)Sn + (1− x2)Dx + (−2mx− nx),2mSm − xDx + (−2m− n),(x2 − 1)D2

x + (2mx+ x)Dx + (−2mn− n2).

The leading monomials being Sn, Sm, and D2x we have just two monomials

under the staircase. But we know that these polynomials are neither hyper-geometric nor hyperexponential (which would leave only one monomial underthe staircase), hence we have indeed found the complete annihilating ideal!In contrast, it would be much more difficult to prove that a given holonomicideal is the complete annihilator of Cm

n (x).

It is a hot topic in D-module theory to compute annihilators in the Weylalgebra. Recently, algorithms for determining the complete annihilator of f s

in Ad, f being a polynomial in K[x1, . . . , xd], have been designed [60, 76] andimplemented [56], but it is still a highly nontrivial task both from theoreticaland implementational point of view. Note that in the ∂-finite setting it is

Page 41: UNIVERSIT AT LINZ JKU - Koutschan

2.5. Univariate versus multivariate 41

rather trivial to get the annihilator of f s, since it is hyperexponential in allthe xi.

So why do we not just forget about holonomicity and deal only with ∂-finite functions? The reason is the following: when justifying that some of thealgorithms to be presented in Chapter 3 indeed terminate, we have to referto the elimination property (Theorem 2.7) which is a property of holonomicideals. In practice therefore we want to deal with functions that are bothholonomic and ∂-finite for the abovely mentioned reasons. Figure 2.3 showsthat this is not too much of a restriction.

holonomic ¶-finite

1

k2 + n2

∆m,n

Factorial

Factorial2

Pochhammer

Binomial

Fibonacci

HarmonicNumber

CatalanNumber

LucasL

HermiteH

LaguerreL

LegendreP

ChebyshevT

ChebyshevU

GegenbauerC

JacobiP

Exp

Log Sqrt

Sin

Cos

ArcSin

ArcCos

ArcTan

ArcCot

ArcSec

ArcCsc

Sinh

Cosh

ArcSinh

ArcCosh

ArcTanh

ArcCoth

ArcSech

ArcCschBesselJ

BesselY

BesselI

BesselK

HankelH1

HankelH2

AiryAi

AiryAiPrimeAiryBi

AiryBiPrime

StruveH

StruveL

KelvinBei

KelvinBer

KelvinKeiKelvinKer

SphericalBesselJ

SphericalBesselY

SphericalHankelH1

SphericalHankelH2

Gamma

GammaRegularized

Subfactorial

PolyGamma

Beta

BetaRegularized

Erf

Erfc

Erfi

FresnelS

FresnelC

ExpIntegralE

ExpIntegralEi

SinIntegral

CosIntegral

SinhIntegral

CoshIntegral

HypergeometricPFQ

EllipticE

EllipticK

EllipticPi

Figure 2.3: Holonomic and ∂-finite functions

2.5 Univariate versus multivariate

The use of univariate recurrences and differential equations is very classical[79, 58, 77, 59], and also the new Mathematica functionality DifferenceRoot

and DifferentialRoot introduced in version 7.0 deals only with univariate

Page 42: UNIVERSIT AT LINZ JKU - Koutschan

42 Chapter 2. Holonomic and ∂-finite functions

such equations. That’s why we want to spend some effort on discussing theessential differences between the usage of univariate and multivariate ∂-finitedescriptions. A multivariate ∂-finite function f(v1, . . . , vd) can always be in-terpreted as a univariate ∂-finite function in one of these variables, say f(v1),treating the remaining variables v2, . . . , vd as parameters. Given a ∂-finiteannihilating ideal of f with respect to the Ore algebra O = K(v)[∂;σ, δ],there exists an annihilating operator that involves only ∂1 which is guaran-teed by the existence of a rectangular system (see Proposition 2.10). Thisoperator then gives rise to the univariate ∂-finite description of f(v1).

First note that summation and integration, using the principle of creativetelescoping (see Chapter 3), is only possible if we consider the input as a mul-tivariate ∂-finite function. Second it is often the case that the multivariatedescription is less involved than the univariate one. In particular when thevector space dimension of O • f is large then it happens that the mixedoperators are of moderate size compared to the ordinary operators of therectangular system whose order usually corresponds to the above mentionedvector space dimension. Just to give some concrete numbers: A mixed anni-hilating ideal of the product of Bessel functions xJ1(ax)I1(ax)Y0(x)K0(x) hasthe leading monomials D3

aDx, D4a , D

2aD

3x , DaD

5x , D

7x which leave 16 monomi-

als under the staircase and the degrees of the coefficients do not exceed 7 in aand x respectively; it easily fits on one page. The ordinary differential equa-tion in x has order 16 (as expected) but coefficients that involve a and x withdegrees up to 68 and 88, respectively; its size is about 700 kB. And third,the handling of the initial values is different: If we deal with multivariate∂-finite descriptions we are usually left with checking finitely many initialvalues, whereas an ordinary operator forces us to check “infinitely” manyinitial values, in the sense that we have to consider initial values with thesymbolic parameters, as the following examples illustrates.

Example 2.26. In their delightful book “Irresistible Integrals” [19], GeorgeBoros and Victor Moll studied the integral∫ ∞

0

dx

(x4 + 2ax2 + 1)m+1=πP

(m+1/2,−m−1/2)m (a)

2m+3/2(a+ 1)m+1/2(2.8)

where P denotes the Jacobi polynomials. Many proofs of how to tackle thisintegral are collected in [8]. We want to sketch how to prove it with computeralgebra and present two strategies. In the first we view both sides as univariate∂-finite functions with respect to Q(a)[Da; 1, Da]. Using closure propertiesand an integration algorithm (see Chapter 3) we derive the same differentialequation

4(a2 − 1)D2a + 4a(2m+ 3)Da + 4m+ 3

Page 43: UNIVERSIT AT LINZ JKU - Koutschan

2.6. Non-holonomic functions 43

for both sides. Hence we have to compare two initial values, but let’s concen-trate on the first one (a = 0). We have to show that∫ ∞

0

dx

(x4 + 1)m+1=πP

(m+1/2,−m−1/2)m (0)

2m+3/2(2.9)

for symbolic m. On the other hand, if we consider (2.8) as an identity ofbivariate ∂-finite functions in a and m, we get an additional operator

(4m+ 4)Sm − 2aDa − 4m− 3 ∈ Q(a,m)[Da; 1, Da][Sm;Sm, 0]

that annihilates either side of (2.8). Now the problem of comparing the firstinitial value (a = 0 and m = 0) reduces to showing∫ ∞

0

dx

(x4 + 1)=πP

(1/2,−1/2)0 (0)

23/2=

π

2√

2

which is much easier than condition (2.9). The same applies to the secondinitial value that has to be compared.

This example also reveals another remarkable aspect: With the first strat-egy we prove that (2.8) holds for all m for which we succeed to prove (2.9),e.g., for all real numbers m > −3

4, whereas in the second approach m is

restricted a priori to be a natural number.

2.6 Non-holonomic functions

So far we have presented an algorithmic framework for ∂-finite functions,which are characterized by a property of their annihilating ideals, namelyhaving only finitely many monomials under the staircase. Hence, in termsof Hilbert dimension, ∂-finite ideals are just the zero-dimensional ideals. Re-cently, Frederic Chyzak, Manuel Kauers, and Bruno Salvy observed [27] thatthe ∂-finite framework can be extended to functions that possess higher-dimensional annihilating ideals. An instance for such a function was alreadyshown in Example 2.12 where the Stirling numbers of the first kind werestudied. In general it can be a very tedious task to prove that some givenfunction is not holonomic, see [38, 35]. The following theorem is an impor-tant result in [27] and it prepares the stage for performing closure propertiesof non-holonomic functions.

Page 44: UNIVERSIT AT LINZ JKU - Koutschan

44 Chapter 2. Holonomic and ∂-finite functions

Theorem 2.27. Let I1, I2 ⊆ O be annihilating left ideals in the Ore algebraO = K(x)[∂x;σx, δx] for f1 and f2, respectively. Then

1. dim AnnO(P • f1) ≤ dim I1 for all P ∈ O,

2. dim AnnO(f1 + f2) ≤ max(dim I1, dim I2),

3. dim AnnO(f1f2) ≤ dim I1 + dim I2, if some technical conditions (as inTheorem 2.16) hold, which is always the case for the Ore algebras ofpractical relevance.

The algorithms for executing the ∂-finite closure properties can be easilyadopted to higher-dimensional annihilating ideals; it basically concerns thetermination condition. The algorithms now stop as soon as an annihilatingideal of the predicted dimension is found. It can well be that the predicteddimension exceeds the number of involved Ore operators in which case norelation at all is expected to exist.

Example 2.28. We focus on Stirling numbers once again, but now on boththe first and the second kind. They are annihilated by SmSn + mSn − 1 andSmSn − (n + 1)Sn − 1, respectively, so that their annihilating ideal have di-mension 1. Theorem 2.27 predicts the existence of a one-dimensional idealfor the sum of these two sequences. Indeed, we can find the recurrence

(m+ n+ 1)(m+ n+ 2)S2mS

2n + (m+ n+ 1)(m2 +m− n2 − 4n− 4)SmS

2n−

2(m+ n+ 2)2SmSn −m(n+ 2)(m+ n+ 1)(m+ n+ 3)S2n−

(m+ n+ 3) (m2 − n2 − 3n− 2)Sn + (m+ n+ 2)(m+ n+ 3).

In contrast, we cannot expect to find a recurrence for the product, since inthis case Theorem 2.27 predicts dimension 2 which corresponds to the zeroideal.

In the following chapter we will explain the method of creative telescoping.We will describe the related algorithms for the holonomic/∂-finite settingonly, but reveal already here that they can be generalized to non-holonomicfunctions as well. This is the main result of [27] and we refer to the originalpaper for further details. Some examples of non-holonomic function identitiescan be found in Section 4.6.

Page 45: UNIVERSIT AT LINZ JKU - Koutschan

Chapter 3

Algorithms for Summation andIntegration

The basic principle that makes all the algorithms of this chapter meaning-ful, is the idea of creative telescoping (we even were tempted to utilize it forentitling the whole chapter). To our knowledge, the first occurrence of thisnotion happened in 1979 in van der Poorten’s report [89] on Apery’s proofof the irrationality of ζ(3). But for sure the principle was known and usedlong before as an ad hoc trick to solve sums and integrals. Just think of thepractice of differentiating under the integral sign, that was made popular byRichard Feynman in his enjoyable book “Surely You’re Joking, Mr. Feyn-man!” [34]. It was Doron Zeilberger who equipped creative telescoping witha concrete well-defined meaning and connected it to an algorithmic method.

The idea of creative telescoping is rather simple and works for summationproblems as well as for integrals. The aim is to get relations (like recurrences,differential equations, etc.) for the expression in question, that may help inevaluating it or that may serve to prove an already given identity.

When we want to do a definite sum of the form∑b

k=a f(k,w) then wesearch for creative telescoping operators that annihilate f and that are of theform

T = P (w,∂w) + ∆kQ(k,w, Sk,∂w) (3.1)

where ∂w stands for some Ore operators that act on the variables w. Theoperator P is called the principal part , and we will refer to Q as the deltapart . With such an operator T we can immediately derive a relation for the

45

Page 46: UNIVERSIT AT LINZ JKU - Koutschan

46 Chapter 3. Algorithms for Summation and Integration

definite sum:

0 =b∑

k=a

T (k,w, Sk,∂w) • f(k,w)

=b∑

k=a

P (w,∂w) • f(k,w) +b∑

k=a

(∆kQ(k,w, Sk,∂w)

)• f(k,w)

= P (w,∂w) •b∑

k=a

f(k,w) +[Q(k,w, Sk,∂w) • f(k,w)

]k=b+1

k=a︸ ︷︷ ︸inhomogeneous part

.

Depending on whether the inhomogeneous part evaluates to zero or not, wehave P as an annihilating operator for the sum, or we get an inhomogeneousrelation for the sum. In the latter case, if one is not happy with that, onecan homogenize the relation by multiplying an annihilating operator for theinhomogeneous part to P from the left. Some of the algorithms in this sectioncan also tackle multiple sums; in that case a telescoping operator of the form

P (w,∂w) + ∆k1Q1(k,w,Sk,∂w) + · · ·+ ∆kjQj(k,w,Sk,∂w) (3.2)

where k = k1, . . . , kj are the summation variables, is desired.Similarly one can derive annihilating operators for a definite integral∫ b

af(x,w) dx. In this case we look for creative telescoping operators that

annihilate f and that are of the form

T = P (w,∂w) +DxQ(x,w, Dx,∂w). (3.3)

Again it is straightforward to deduce a relation for the integral

0 =

∫ b

a

T (x,w, Dx,∂w) • f(x,w) dx

=

∫ b

a

P (w,∂w) • f(x,w) dx+

∫ b

a

(DxQ(x,w, Dx,∂w)

)• f(x,w) dx

= P (w,∂w) •∫ b

a

f(x,w) dx+[Q(x,w, Dx,∂w) • f(x,w)

]x=b

x=a

which may be homogeneous or inhomogeneous. Analogously to the sum-mation case, some algorithms can treat multiple integrals in which case thedesired telescoping operators have the form

P (w,∂w) +Dx1Q1(x,w,Dx,∂w) + · · ·+DxjQj(x,w,Dx,∂w). (3.4)

Page 47: UNIVERSIT AT LINZ JKU - Koutschan

3.1. Zeilberger’s slow algorithm 47

where now x = x1, . . . , xj are the integration variables.In practice it happens very often that the inhomogeneous part vanishes.

The reason for that is because many sums and integrals run over naturalboundaries . This concept is often used, e.g., in Takayama’s algorithm, to ar-gue a priori that there will be no inhomogeneous parts after telescoping. Forthat purpose, we define that

∑bk=a f resp.

∫ baf dx has natural boundaries if

for any arbitrary operator P ∈ O for a suitable Ore algebra O the expression[P •f

]k=b+1

k=aresp.

[P •f

]x=b

x=aevaluates to zero. Typical examples for natural

boundaries are sums with finite support, or integrations over the whole realline that involve something like exp(−x2). Likewise contour integrals alonga closed path do have natural boundaries.

All algorithms that will be presented in the following rely on this principleand their aim is, given an annihilating ideal for the summand/integrand,to compute creative telescoping operators that give rise to an annihilatingideal for the sum/integral. In order to illustrate how the algorithms workwe chose—for sake of clarity—one of the simplest possible examples: thebinomial sum

∑nk=0

(nk

). It is so simple that all computations can be carried

out by hand so that the demonstrations are very instructive. But this shouldnot give the impression that the following algorithms can only solve trivialexamples. At the end of this chapter as well as in Chapter 4 we will giveexamples that are much more involved and hard to solve by hand. As inputwe will always start with the ∂-finite annihilating ideal of the summand

(nk

).

Since it is hypergeometric we find that it is generated by the two operatorsG1 = (n − k + 1)Sn − (n + 1) and G2 = (k + 1)Sk + (k − n) that form aGrobner basis in Q(k, n)[Sk;Sk, 0][Sn;Sn, 0] with respect to total degree order(actually: with respect to any term order!).

3.1 Zeilberger’s slow algorithm

In his seminal paper “A holonomic systems approach to special functionsidentities” [93], Doron Zeilberger proposed a general method for tackling(multiple) integration and summation problems of the form

b1∑v1=a1

· · ·bl∑

vl=al

∫ bl+1

al+1

· · ·∫ bj

aj

f(v,w) dvl+1 . . . dvj (3.5)

where f is a holonomic function in the summation and integration vari-ables v = v1, . . . , vj and in the additional parameters w (which should benonempty). We will act with the difference operators ∆v1 , . . . ,∆vl on thesummation variables (in practice it is more natural and more efficient to work

Page 48: UNIVERSIT AT LINZ JKU - Koutschan

48 Chapter 3. Algorithms for Summation and Integration

with shift operators but for now notation becomes simpler by using delta op-erators). Of course, in the q-case we have to consider q-difference operatorsinstead (we mention this here once and omit this aspect in the following toprevent further confusion). Similarly we want to act with the differentialoperators Dvl+1

, . . . , Dvj on the integration variables. We will use the short-hand notation ∂v to refer to the Ore operators ∆v1 , . . . ,∆vl , Dvl+1

, . . . , Dvj .Finally we denote by ∂w the unspecified Ore operators that act on the vari-ables w (but have to restrict ∂w to the standard Ore operators for which thenotion of holonomy makes sense). For our purposes we have to assume thatthe function f allows us to write the integration and summation quantifiersin any possible order; otherwise creative telescoping would be impractical.Therefore (3.5) represents the most general problem that is in the spirit ofthe holonomic systems approach.

Shortly after [93], Zeilberger came up with the algorithm that nowadaysis known as Zeilberger’s algorithm and which solves the special case of single(and not multiple) sums (and not integrals) of proper hypergeometric (andnot general holonomic) summands. He himself named this the fast algorithm,and in consequence the one that we are discussing now was named by himthe slow algorithm [92, 94, 69].

As input, Zeilberger’s slow algorithm takes a holonomic annihilating idealfor f(v,w). The main step towards a creative telescoping relation consistsin brute-force elimination of the summation/integration variables v. Notethat it is guaranteed by holonomy (see elimination property, Theorem 2.7)that nontrivial v-free operators exist. Once such operators are found theycan be easily transformed into the form (3.2)+(3.4) by successive divisionswith remainder: The principal part will be the last remainder that survivesafter all divisions. Theoretically it could happen that the remainder is zeroin which case the v-free operator is rather useless for our purposes. Assumethat we run into this unlucky case; then it suffices to multiply the v-freeoperator by some suitable power product vα. Of course, the result will notbe v-free any more, but the (now nonzero) principal part will be so (for moredetails see [90]). Hence the original problem has been solved.

So far we have not said how to find v-free operators. Zeilberger in hisoriginal paper suggested Sylvester’s dialytic elimination, which was studiedfurther by Peter Paule [65]. Later Zeilberger admitted that the use of non-commutative Grobner bases might be preferable: By choosing a monomialorder where the variables v1, . . . , vj are lexicographically greater than theother variables w and all the Ore operators ∂v and ∂w, we obtain the de-sired result. Usually a block order with two blocks is chosen to achieve theelimination.

In practice the following problem arises: How can we get a holonomic

Page 49: UNIVERSIT AT LINZ JKU - Koutschan

3.1. Zeilberger’s slow algorithm 49

annihilating ideal for the function f? In Section 2.3 we have only discussedhow to obtain ∂-finite annihilating ideals that, by definition, are part of arational Ore algebra. In the following we want to denote by I ⊆ Orat a givenannihilating ∂-finite ideal for f where

Orat = K(v,w)[∂v;σv, δv][∂w;σw, δw].

But to apply the above method we need an annihilating holonomic ideal inthe polynomial Ore algebra. Unfortunately we do not know in general howto get that. And in fact, it suffices to work in an Ore algebra O where onlythe variables v to be eliminated occur polynomially:

O = K(w)[v][∂v;σv, δv][∂w;σw, δw].

This has the advantage that the computations are much less involved com-pared to the elimination in a purely polynomial Ore algebra. But it stillremains to get an annihilating ideal in the algebra O. In other words weneed to determine I ∩O, which we already mentioned in Section 2.4 to be adifficult problem. Therefore we use the workaround to cancel denominatorsand then use the generators of I for generating an annihilating ideal of fin O (which due to extension/contraction will be only a subideal of I ∩O ingeneral) and to perform the elimination in this ideal.

Example 3.1. Interpreting the two operators G1 and G2 in the Ore alge-bra Q(n)[k][Sk;Sk, 0][Sn;Sn, 0] they are presented as G1 = −kSn+ (n+ 1)Sn−(n + 1) and G2 = kSk + k + Sk − n where we already ordered the terms withrespect to a monomial order that eliminates k. The elimination of k can herebe obtained by hand calculation:

SkG1 + SnG2 = kSn + (n+ 1)SkSn − (n+ 1)Sk − (n+ 1)Sn.

The leading term can be reduced by G1 and after removing the content (n+1)we end up with the k-free operator T = SkSn − Sk − 1 (which is nothing elsebut Pascal’s rule). Note that if we worked in the polynomial Ore algebraQ[k, n][Sk;Sk, 0][Sn;Sn, 0] we would not have found Pascal’s rule but only amultiple of it (which again illustrates the extension/contraction problem).Division with remainder by Sk − 1 rewrites T to a telescoping operator

T = Sn − 2 + (Sk − 1)(Sn − 1).

The sum has natural boundaries (because of finite support), so we can neglectthe delta part. Together with the initial condition

(00

)= 1 the principal part

Sn − 2 gives rise to the solution 2n.

Page 50: UNIVERSIT AT LINZ JKU - Koutschan

50 Chapter 3. Algorithms for Summation and Integration

In order to bypass the extension/contraction problem, we came up witha third method how to eliminate the variables v. It is based on ansatzand coefficient comparison. In our general setting the ansatz with unknowncoefficients has the form ∑

(α,β)∈M

cα,β(w) · ∂αv ∂βw

where M is a finite index set of exponent vectors (structure set). The ansatzis reduced with the Grobner basis of the given ∂-finite ideal I, and the coeffi-cients of the normal form are set to zero. Additionally a coefficient compari-son with respect to all variables v is done to enforce the solutions cα,β to befree of v. It remains to solve a linear system over K(w). Since a priori it isnot known which structure set will indeed deliver a solution, one has to loop,say over the total degree of the ansatz, until a solution is found. This ansatzmethod being a special case of the polynomial ansatz to be described in Sec-tion 3.4, we omit further details (concerning optimizations) here and referto the below extensive description. To complete this section we demonstratethe elimination via ansatz on the binomial sum example.

Example 3.2. To find a k-free recurrence for the binomial coefficient westart with the ansatz ∑

(α,β)∈N2

α+β≤d

cα,β(n)Sαk Sβn

where we loop over the total degree d. To keep things short we omit the firsttwo steps that would deliver no solution. The ansatz for total degree d = 2 is

c00 + c01Sn + c10Sk + c02S2n + c11SkSn + c20S

2k .

The normal form with respect to the Grobner basis G1, G2 is (after clearingdenominators):

(k + 1)(k + 2)(k − n− 2)(k − n− 1)c00 −(k + 1)(k + 2)(n+ 1)(k − n− 2)c01 −(k + 2)(k − n− 2)(k − n− 1)(k − n)c10 +(k + 1)(k + 2)(n+ 1)(n+ 2)c02 +(k + 2)(n+ 1)(k − n− 2)(k − n− 1)c11 +(k − n− 2)(k − n− 1)(k − n)(k − n+ 1)c20.

After coefficient comparison we write the linear system in matrix form. Wecleared the content in each equation, and to make it fit on this page, give the

Page 51: UNIVERSIT AT LINZ JKU - Koutschan

3.2. Takayama’s algorithm 51

transposed matrix:2 −3n2 − 5n n2 − 3n− 5 2n 12 −3n2 − 7n− 4 n2 − 1 n+ 1 0

2n −n3 + 3n2 + 10n+ 4 4− 3n2 −3n− 1 −12 −3n2 − 9n− 6 n2 + 3n+ 2 0 0

2n+ 2 −n3 + 5n+ 4 −2n2 − 3n− 1 −n− 1 0n2 − n 4n3 + 6n2 − 2n− 2 6n2 + 6n− 1 4n+ 2 1

.

The nullspace of the matrix is spanned by the single vector (−1, 0,−1, 0, 1, 0)T

which corresponds to the same k-free recurrence that we found with Grobnerbasis elimination. Although in this example the computations are much moreinvolved compared to Example 3.1, this method is often much faster and givessmaller results (see Example 3.7 and Section 6.3).

3.2 Takayama’s algorithm

When studying Zeilberger’s slow algorithm it turns out that due to the natureof this algorithm also the delta parts are free of the summation and integra-tion variables, in contrast to what is indicated in (3.1) and (3.3). Somehow,as soon as we have eliminated all the variables v we have already done toomuch (we stick to the notation introduced in the previous section because alsoTakayama’s algorithm can do multiple sums and integrals). Gert Almkvistand Doron Zeilberger [7] were the first who observed that the complete elim-ination imposes more restriction than necessary, and that it would not doany harm if the delta parts contained also the variables v. This fact wasthen exploited by Nobuki Takayama who constructed an “infinite dimen-sional analog of Grobner basis” [85, 84]. But he formulated his algorithmonly in the context of the Weyl algebra and in a quite theoretical fashion. Itwere Frederic Chyzak and Bruno Salvy [29] who proposed optimizations thatare important in practice and extended the application domain of the algo-rithm to more general Ore algebras (in particular shift algebras). The ideain short is the following: While in Zeilberger’s slow algorithm, first v1, . . . , vjwere eliminated and then the delta parts were divided out, the order is nowreversed. In Takayama’s algorithm we first reduce modulo the right ide-als ∂v1O, . . . , ∂vjO and then perform the elimination of v. The consequenceis that the delta parts are not computed at all because everything that wouldcontribute to them is thrown away in the first step. Hence we have to assumea priori that the inhomogeneous parts will vanish, i.e., we have to assure nat-ural boundaries. On the other hand this strategy makes the algorithm muchfaster since the division step reduces the size of the data considerably before

Page 52: UNIVERSIT AT LINZ JKU - Koutschan

52 Chapter 3. Algorithms for Summation and Integration

starting with the elimination. Last but not least we can find bigger annihilat-ing ideals with Takayama’s algorithm (i.e., shorter recurrences or differentialequations with lower order) because compared to Zeilberger’s slow algorithmwe allow more freedom in the delta parts.

There is one technical complication in this approach. The fact that weare computing in a noncommutative algebra restricts us in the computationsafter having divided out the right ideals (since we started with a left ideal,there is no ideal structure any more). In particular, we are no longer allowedto multiply by either of the variables v from the left. We can easily convinceourselves that otherwise we would get faulty results: Assume we have writtenan operator in the form P + DviQ. Multiplying it by vi and then reducingit by DviO leads to viP − Q since we have to rewrite viDvi as Dvivi − 1.Because vi does not commute with Dvi we get the additional term −Q in theresult which we lose if we first remove DviQ and then multiply by vi. Similarthings happen in connection with the delta operator.

In order to find a v-free operator one needs an elimination procedurethat avoids multiplication by the variables v. Let now G1, . . . , Gr ⊂ O

be a finite set of operators that annihilate f(v,w), in the Ore algebra thatallows elimination of the summation and integration variables v. Such a setof operators can be obtained for example using the workaround mentionedin the previous section (starting with a ∂-finite ideal in the rational Orealgebra Orat). But usually then G1, . . . , Gr will not constitute a Grobnerbasis in the new algebra O; in some examples it is of advantage to compute aGrobner basis of G1, . . . , Gr ⊂ O as a preprocessing step (option Saturate

in our command Takayama). Let G′1, . . . , G′r ∈ K(w)[v][∂w;σw, δw] denote

the corresponding reductions modulo the right ideals ∂v1O, . . . , ∂vjO. For1 ≤ i ≤ r we can write

G′i(v,w,∂w) =∑α∈Nj

vαGi,α(w,∂w)

where Gi,α ∈ O′ = K(w)[∂w;σw, δw]. Elimination of v now amounts tofinding a linear combination

P1(w,∂w)

G1,α1

G1,α2

G1,α3

...

+ · · ·+ Pr(w,∂w)

Gr,α1

Gr,α2

Gr,α3

...

=

P (w,∂w)

00...

for some operators P1, . . . , Pr ∈ O′. With α1 = (0, . . . , 0) the vector on theright-hand side corresponds to the desired v-free operator. More algebraicallyspeaking, the elimination happens in an O′-module that is generated by the

Page 53: UNIVERSIT AT LINZ JKU - Koutschan

3.2. Takayama’s algorithm 53

above vectors. It is achieved by computing a Grobner basis of this modulewith an ordering that first compares positions in the vectors and then breaksties by some monomial order (“position over term”).

In general, this will not work yet since we cannot expect to succeed inthe elimination without multiplying by v at all. We only have to ensure thatthis multiplication takes place before dividing out the delta parts. Hence weinclude multiples of the Gi by power products of v from the very beginning.By M we denote the module that is generated by the vectors that correspondto the Gi and their v-multiples. Note that the elements of M have infinitedimension and also that (P (w,∂w), 0, . . . )T ∈ M if and only if there existQ1, . . . , Qj ∈ O such that

P + ∂v1Q1 + · · ·+ ∂vjQj (3.6)

is a telescoping relation in the ideal O〈G1, . . . , Gr〉. For practical purposes wehave to truncate the module M by considering only elements up to a certaindimension d, i.e., which have zeros in all positions greater than d. The naturalchoice for d is the determined by the powers of v that appear in G1, . . . , Gr.So in the first run only v-multiples of such Gi are added that do not involvev1, . . . , vj with their highest powers occurring in G1, . . . , Gr. But we are notguaranteed that for any telescoping operator of the form (3.6) the principalpart P is an element of the truncated module. In the unlucky case thatno v-free operator is found, more multiples by power products of v have tobe included and the bound d has to be increased. In the case of multiplesummations and integrations (j > 1) there are several options how to increasethe dimension of the module elements. In the pseudo-code description of thealgorithm (see Figure 3.1) we decided to increase the maximal degree ofeach of the variables v1, . . . , vj by one. But also finer strategies, for exampleincreasing in each step only the degree of one single variable, are possible.A final remark concerns the termination of the algorithm: it is guaranteedprovided that the input is holonomic. Then by the elimination property thereexists a v-free operator and a fortiori an operator of the form (3.6).

Example 3.3. We now want to find a recurrence for the binomial sum withTakayama’s algorithm. Recall that it has natural boundaries and thereforethe algorithm is applicable. We first observe that both G1 and G2 are ofdegree 1 in k. Hence we can start right away with these two, without havingto include certain multiples by powers of k. The next step is to divide outthe delta parts. The first operator G1 = (n− k + 1)Sn − (n+ 1) is free of Skand hence is fine. The second operator rewrites as G2 = (Sk − 1)k + 2k − nwhich gives 2k − n modulo the right ideal generated by Sk − 1. We represent

Page 54: UNIVERSIT AT LINZ JKU - Koutschan

54 Chapter 3. Algorithms for Summation and Integration

these two elements in the module whose positions correspond to the powersof k and find a linear combination between them:

2

((n+ 1)Sn − (n+ 1)

−Sn

)+ Sn

(−n2

)=

((n+ 1)Sn − 2(n+ 1)

0

).

The vector on the right-hand side represents the k-free operator that we havefound. After removing the content we end up with the same principal part aswith Zeilberger’s slow algorithm in Example 3.1.

Input: set of summation and integration variables v1, . . . , vj,G1, . . . , Gr ⊂ O = K(w)[v][∂v;σv, δv][∂w;σw, δw]where ∂vi = ∆vi or ∂vi = Dvi for 1 ≤ i ≤ j

Output: principal parts P1, . . . , Ps of some telescoping operatorswith respect to ∂v1 , . . . , ∂vj in O〈G1, . . . , Gr〉

d := (d1, . . . , dj) :=(

max1≤i≤r degv1 Gi, . . . ,max1≤i≤r degvj Gi

)P := ∅while P = ∅H := ∅for i := 1 to re :=

(degv1 Gi, . . . , degvj Gi

)H := H ∪ vα ·Gi | α ≤ d− e

H ′ :=Hi mod

⟨∂v1 , . . . , ∂vj

⟩O| Hi ∈ H

P := module Grobner basis of H ′ eliminating v1, . . . , vjP := Pi ∈ P | degv Pi = 0d := (d1 + 1, . . . , dj + 1)

return P

Figure 3.1: Takayama’s algorithm

Last but not least we want to mention that Takayama’s algorithm aswe presented it here, can be adapted (then being more in the flavor howTakayama originally presented it) for computing also the delta parts. In thiscase the quotients of the divisions modulo the right ideals are not thrownaway, but kept and propagated through the whole run of the module Grobnerbasis computation. In the end (and also in between) they can be reducedto normal form modulo the input ideal. In our implementation this can beachieved by using Takayama with the option Extended (see also page 93).

Page 55: UNIVERSIT AT LINZ JKU - Koutschan

3.3. Chyzak’s algorithm 55

3.3 Chyzak’s algorithm

In Section 3.5 we will drastically demonstrate that Zeilberger’s slow algo-rithm is usually very inefficient. Takayama’s algorithm has the disadvantagethat natural boundaries have to be assured a priori, which might be the caseor not, and even if so, it can be hard to prove. Chyzak’s algorithm [26]overcomes these handicaps, but suffers from another one: It can only dealwith single sums and single integrals (multiple ones can only be solved byapplying the algorithm recursively). But still, for most summation and inte-gration problems that can be treated in the frame of the holonomic systemsapproach, it is the means of choice.

We will introduce Chyzak’s algorithm, both for indefinite and definitesummation (and integration), as a generalization of classical algorithms dueto Gosper and Zeilberger, which we recall only very briefly for this purpose.For readers who are not familiar with these algorithms we point to the nu-merous excellent expositions [70, 72, 53].

Indefinite problems

For indefinite hypergeometric summation—i.e., given f(k) hypergeometricfind a hypergeometric antidifference g(k) so that f(k) = g(k + 1) − g(k)—there is Gosper’s algorithm [41, 66] which decides whether there exists g(k) ofthe form q(k)f(k) for some rational function q(k), and in the affirmative casecomputes it. The algorithm is a complete decision procedure which eithergives back the desired function g(k) allowing to evaluate the sum expression∑b

k=a f(k) = g(b+1)−g(a) in closed form for arbitrary summation bounds, orproves that no such antidifference exists. There is also a version of Gosper’salgorithm that handles indefinite integrals of hyperexponential functions [7].Gosper’s algorithm has been generalized to ∂-finite functions by FredericChyzak, then dealing both with indefinite sums and indefinite integrals.

In Gosper’s algorithm we look for an antidifference g(k) that is a rationalfunction multiple of the summand. This is equivalent to claiming that g(k)lies in the (one-dimensional) K(k)-vector space that is spanned by all shiftsof the summand f(k). The telescoping equation g(k + 1) − g(k) = f(k) iswritten in operator notation as

∆kq(k)− 1 ∈ AnnO f(k) with O = K(k)[∆k;Sk,∆k]

where q(k) is the rational function to be found.Let f(v,w) from now on denote a ∂-finite function with respect to the Ore

algebra O = K(v,w)[∂v;σv, δv][∂w;σw, δw], characterized by its annihilatingleft ideal that is given by a Grobner basis G ⊂ O. In the case where v

Page 56: UNIVERSIT AT LINZ JKU - Koutschan

56 Chapter 3. Algorithms for Summation and Integration

is a discrete variable and ∂v = ∆v, the goal is to compute the indefinitesum

∑v f(v,w). In the other case when v is a continuous variable and

∂v = Dv, we want to do the indefinite integral∫f(v,w) dv.

Analogously to Gosper’s algorithm, it is natural to search for the anti-difference (resp. antiderivative) in the finite-dimensional vector space that isspanned by the shifts and derivatives of the summand (resp. integrand). Aswe have learned in Section 2.3, each vector space element can be representedas (

q1U1 + · · ·+ qmUm)• f, qi ∈ K(v,w), Ui ∈ O,

where U = U1, . . . , Um denotes the set of O-monomials that lie under thestaircase of G. Hence the telescoping problem for ∂-finite functions is thefollowing: Find rational functions q1, . . . , qm ∈ K(v,w) such that

∂v ·(q1(v,w)U1 + · · ·+ qm(v,w)Um

)− 1 ∈ O〈G〉 ⊆ AnnO f. (3.7)

This operator can be seen as an ansatz for the unknown functions qi. Suf-ficiently many equations for determining them are obtained by using thecondition that (3.7) has to lie in the left ideal generated by G. This is thecase if and only if its normal form modulo G is zero. At this point it isnow clear how the algorithm proceeds: It starts with the ansatz (3.7) andreduces it with the Grobner basis G; a system of equations is obtained byequating the coefficients of the normal form to zero. If this system admitsrational function solutions for the qi then we have found an antidifference(resp. antiderivative), otherwise it does not exist within our search space.The only step that deserves a little more attention is to look at what kindof system appears in the algorithm and how to solve it. The fact that inthe ansatz the Ore operator ∂v is on the left forces some commutations inorder to transform the ansatz to standard representation (i.e., to bring allOre operators to the right). Due to the commutation rules

∆vqi(v,w) = qi(v + 1,w)∆v + qi(v + 1,w)− qi(v,w),

Dvqi(v,w) = qi(v,w)Dv +∂

∂vqi(v,w),

shifts (resp. derivatives) of the unknown rational functions are introduced.Hence we end up with a coupled system of difference (resp. differential)equations. It is not difficult to see that this system will be always linear and offirst order. Fortunately there are algorithms how to find all rational solutionsof such a system: Either by direct methods as proposed by Abramov andBarkatou [3, 11], or by uncoupling the system (by Gaussian elimination orspecial uncoupling algorithms like Zurcher’s algorithm [97] or the algorithmby Abramov and Zima [5], see also [37]) and iteratively solving the scalardifference (resp. differential) equations with Abramov’s algorithm [1, 2, 4].

Page 57: UNIVERSIT AT LINZ JKU - Koutschan

3.3. Chyzak’s algorithm 57

Example 3.4. Let’s use Chyzak’s algorithm for computing the antideriva-tive of the Hermite polynomials

∫Hn(x) dx. A ∂-finite annihilating ideal

for Hn(x) is given by its Grobner basis

G = Dx + Sn − 2x, S2n − 2xSn + 2n+ 2 ⊂ Q(n, x)[Sn;Sn, 0][Dx; 1, Dx]

from which we can read off the monomials under the staircase U = 1, Sn.Consequently we start with the ansatz Dx(q1(x) + q2(x)Sn)− 1 which in stan-dard representation rewrites to q2(x)DxSn + q1(x)Dx + q′2(x)Sn + q′1(x) − 1.Reducing it with G delivers the two equations

q′2(x)− q1(x) = 0,

2nq2(x) + q′1(x) + 2xq1(x) + 2q2(x)− 1 = 0.

Substituting the first one into the second gives a scalar equation that yieldsq2(x) = 1

2(n+1)with Abramov’s algorithm. This gives immediately rise to the

solution ∫Hn(x) dx =

Hn+1(x)

2(n+ 1).

Definite problems

Doron Zeilberger’s celebrated fast algorithm [92, 94, 69] for definite hyper-geometric summation makes essential use of Gosper’s indefinite summationalgorithm. In a similar manner, Chyzak’s indefinite summation (resp. inte-gration) algorithm can be turned into an algorithm for definite summation(resp. integration). Hence it can be viewed as an extension of Zeilberger’sfast algorithm to general ∂-finite functions (and this basically is the title ofChyzak’s paper [26]).

Given a proper hypergeometric (i.e. hypergeometric and holonomic) termf(n, k), Zeilberger’s fast algorithm computes a recurrence for the definite sum∑b

k=a f(n, k). The first step of this algorithm is to execute Gosper’s algo-rithm. If it does not yield a solution, then a linear combination of f andsome of its n-shifts with undetermined coefficients pi(n), e.g., p0(n)f(n, k) +p1(n)f(n+ 1, k), is tried whether it is indefinitely summable with a parame-terized version of Gosper’s algorithm that additionally solves for the pi. Theorder of these n-shifts is increased until a result is obtained (which by theoryis guaranteed to happen finally):

p0(n)f(n, k) + · · ·+ pd(n)f(n+ d, k) = g(n, k + 1)− g(n, k)

for some rational functions pi ∈ Q(n) and g(n, k) = q(n, k)f(n, k) is a ratio-nal function multiple of f(n, k).

Page 58: UNIVERSIT AT LINZ JKU - Koutschan

58 Chapter 3. Algorithms for Summation and Integration

As in the indefinite case, this idea of creative telescoping can be translatedto the ∂-finite setting. As before, let f(v,w) denote a ∂-finite function withrespect to the Ore algebra O = K(v,w)[∂v;σv, δv][∂w;σw, δw]. Analogouslyto Zeilberger’s fast algorithm, the ansatz for a creative telescoping operatorlooks like∑

α∈A

pα(w)∂αw︸ ︷︷ ︸principal part

+ ∂v ·(q1(v,w)U1 + · · ·+ qm(v,w)Um

)︸ ︷︷ ︸

delta part

(3.8)

where A is a finite set of exponent vectors. In each step, indefinite summation(resp. integration) with the algorithm of Section 3.3 is tried. We start withA = (0, . . . , 0) which corresponds exactly to Chyzak’s indefinite algorithm(p0 can be set to 1). If f turns out to be indefinitely summable (resp.integrable) then the algorithm stops otherwise it proceeds with an augmentedset A. In the following steps more parameters pα are involved and we have totake care of these when solving the coupled system. But this is no problemsince all mentioned algorithms for solving coupled systems, generalize toparameterized systems. The set A here plays the same role as the set T =t1, . . . , tj of monomials in the FGLM algorithm (see Figure 2.2) for which alinear dependency between the corresponding normal forms is searched. Andexactly in the same systematic way as in the FGLM algorithm, elements areadded or removed from A. This strategy ensures that the principal partsform a Grobner basis of a ∂-finite ideal in the end (if such an ideal exists atall). The existence is guaranteed provided that f(v,w) is not only ∂-finitebut also holonomic.

It is clear that in the ansatz (3.8) it suffices to restrict the support of thedelta part to the monomials under the staircase: For any telescoping operatorthat exists inside O〈G〉, we can reduce the delta part to normal form by theinput Grobner basis G, obtaining a linear combination with rational functioncoefficients of the monomials U1, . . . , Um.

Example 3.5. Since in our running example the summand is hypergeomet-ric, Chyzak’s algorithm just specializes to Zeilberger’s fast algorithm. Thefirst step reveals that

(nk

)is not definitely summable. In the next step we

start with the ansatz p0 + p1Sn + (Sk − 1)q(k). After reducing it with theGrobner basis G1, G2, we obtain the equation

(k−n−1)((k−n)q(k+1)+(k+1)q(k)

)= (k+1)

((k−n−1)p0− (n+1)p1

)which admits the solution q(k) = ck

n−k+1, p0 = −2c, and p1 = c for an

arbitrary constant c. Once again we have discovered the recurrence Sn − 2.

In Section 4.5 a more advanced (non-hypergeometric) example is givenwhere all steps are displayed in detail.

Page 59: UNIVERSIT AT LINZ JKU - Koutschan

3.4. Polynomial ansatz 59

3.4 Polynomial ansatz

The basic idea of what we propose in this section is very simple: We alsostart with an ansatz in order to find a telescoping operator. But in con-trast to Chyzak’s algorithm we avoid the expensive uncoupling and solvingof difference or differential equations. The method to be presented is ap-plicable to multiple summation and integration problems, so we reuse thenotation introduced in Section 3.1. We start with an ansatz that involvesthe summation and integration variables v polynomially:∑

α∈A

pα(w)∂αw︸ ︷︷ ︸= P (w,∂w)

+ ∂v1 ·∑

(β,γ)∈B

∑µ∈M

qβ,γ,µ(w)vµ∂βv∂γw︸ ︷︷ ︸

=Q1(v,w,∂v ,∂w)

+ . . . (3.9)

where A, B, and M are finite index sets (structure set). The unknown pαand qβ,γ,µ to solve for are rational functions in w and they can be computedusing pure linear algebra. Recall that in Chyzak’s ansatz the unknowns qialso depended on v which causes the system to be first-order and coupled.The prize that we pay now is that the shape of the ansatz is not at allclear from the beginning: The sets A, B, and M need to be fixed, whereasin Chyzak’s algorithm we have to loop only over the support of the prin-cipal part. Our approach is similar to the generalization of Sister CelineFasenmyer’s technique [32, 72] that is used in Kurt Wegschaider’s MultiSumpackage [90, Section 3.5.2] (which can deal with multiple summations of hy-pergeometric terms). We proceed by reducing the ansatz with the Grobnerbasis G of the given ∂-finite ideal for f , obtaining a normal form representa-tion of the ansatz. Since we wish this relation to be in the ideal, the normalform has to be identically zero. Equating the coefficients of the normal formto zero and performing coefficient comparison with respect to v delivers alinear system for all the unknowns that has to be solved over K(w).

Trying out for which structure set A,B,M the ansatz (3.9) delivers anontrivial solution can be a time-consuming tedious task. Additionally, oncea solution is found it still can happen that it does not fit to our needs:It can well happen that all pα are zero in which case the result is useless.Hence the question is: Can we simplify the search for a good ansatz, forexample, by using homomorphic images? Clearly the size of the coefficientscan be reduced by computing modulo a prime number if the ground fieldK admits that, e.g., K = Q. But in practice this does not downsize thecomputational complexity too much—still we have multivariate polynomialsin v and w that can grow dramatically during the reduction process, onwhich we want to focus now. We cannot get rid of the variables v since

Page 60: UNIVERSIT AT LINZ JKU - Koutschan

60 Chapter 3. Algorithms for Summation and Integration

they are needed later for the coefficient comparison. It is also true that wecannot just plug in some concrete integers forw: We would lose the feature ofnoncommutativity that w share with ∂w. And the noncommutativity playsa crucial role during the reduction process, in the sense that omitting it weget a wrong result. Let’s have a closer look what happens and recall how thenormal form computation works (see Figure 3.2).

Input: operator R ∈ O, Grobner basis G = G1, . . . , Gr ⊂ OOutput: normal form of R modulo the left ideal O〈G〉while exists 1 ≤ i ≤ r with lm(Gi) | lm(R)H := (lm(R)/ lm(Gi)) ·Gi

R := R− (lc(R)/ lc(H)) ·Hreturn R

Figure 3.2: Normal form computation (lm and lc denote the leading mono-mial and the leading coefficient of an operator, respectively)

Note that we do the multiplication of the operator that we want to reducewith in two steps: First multiply by the appropriate power product of Oreoperators, and second adjust the leading coefficient. The reason for that isbecause the first step can change the leading coefficient. Note also that Ris never multiplied by anything. This gives rise to a modular version of thenormal form computation that does respect the noncommutativity (see Fig-ure 3.3). We define h : O → O′ with O′ = K′(v)[∂v;σv, δv][∂w;σw, δw] tobe an insertion homomorphism that plugs in some concrete integer values forthe variables w and reduces all coefficients modulo a prime number (if this isappropriate regarding K). Also if there are additional parameters in K, if forexample K = Q(a1, a2, . . . ), these can be replaced by the homomorphism h.Thus most of the computations are done in the homomorphic image and thecoefficient growth is moderate compared to before.

After the modular reduction we have to do coefficient comparison withrespect to the remaining variables v an what we get is a matrix with constantentries (usually from a finite field Zp). Nullspace computation of such matri-ces is very fast and carries no weight in practice. The modular computationscan as well be used to prove that a relation of a certain shape does not exist.

Assume now that we have found a promising structure set by means ofmodular computations. Before starting the real computation we make theansatz as small as possible by leaving away all unknowns that are 0 in themodular solution. With very high probability they will be 0 in the finalsolution too—in the opposite case we will realize this unlikely event since

Page 61: UNIVERSIT AT LINZ JKU - Koutschan

3.5. Concluding example 61

Input: operator R ∈ O, Grobner basis G = G1, . . . , Gr ⊂ O,insertion homomorphism h

Output: modular normal form of R modulo the left ideal O〈G〉R := h(R)while exists 1 ≤ i ≤ r with lm(Gi) | lm(R)H := h((lm(R)/ lm(Gi)) ·Gi)R := R− (lc(R)/ lc(H)) ·H

return R

Figure 3.3: Modular normal form computation

then the system will turn out to be unsolvable. In [90] a method calledVerbaeten’s completion is used in order to recognize superfluous terms in theansatz a priori. We were thinking about a generalization of that, but sincethe modular computation is negligibly short compared to the rest, we don’texpect to gain much and do not investigate this idea further.

Other optimizations concern the way how the reduction is performed.With a big ansatz that involves hundreds of unknowns it is nearly impossibleto do it in the naive way. The only possibility to achieve the result atreasonable cost is to consider each monomial in the support of the ansatzseparately. After having computed the normal forms of all these monomialswe can combine them in order to obtain the normal form of the ansatz. Lastbut not least it pays off to make use of the previously computed normalforms. This means that we sort the monomials that we would like to reduceaccording to the monomial order in which the Grobner basis is given. Thenfor each monomial we have to perform one reduction step and then plug inthe normal forms that we have already (since all monomials that occur inthe support after the reduction step are smaller).

3.5 Concluding example

To conclude this chapter we want to study an example that is not so trivial asthe running example of the previous sections and which shows the differentperformances of the above described algorithms more clearly. In contrast tothe summation example of before we now look at an integration problem thatwas sent to Peter Paule by Gilbert Strang [83]:∫ 1

−1

(P2k+1(x)

x

)2

dx = 2 (3.10)

Page 62: UNIVERSIT AT LINZ JKU - Koutschan

62 Chapter 3. Algorithms for Summation and Integration

where Pk(x) denotes the family of Legendre polynomials. This example some-how closes the circle of our work: It was chosen by Peter Paule in a proposalto prolongate the special research program SFB F013 in Linz which then wasgranted, providing financial support for our work. Additionally this proposalwas one source of inspiration that in the beginning helped us to get familiarwith the topic.

Having a closer look at the integral (3.10) we observe that for fixed inte-ger k the integrand fk(x) = (P2k+1(x)/x)2 is a polynomial that is symmetricaround x = 0. This tells us already that the integral cannot have naturalboundaries: for some derivative we will get that f

(d)k (−1) = −f (d)

k (1) 6= 0.

An easy calculation shows that [f ′1(x)]x=1x=−1 = [5x(5x2 − 3)]

x=1x=−1 = 20 for ex-

ample. Using the ∂-finite closure properties multiplication and substitution,a ∂-finite annihilating ideal for fk(x) is obtained:

4(k + 2)2(2k + 5)2(4k + 5)2S2k + (4k + 5)(4k + 7)(4k + 9)(x− 1)x(x+ 1)

× (16k2x2 − 8k2 + 56kx2 − 28k + 45x2 − 23)Dx −(4k + 7)2 (16k2x2 − 8k2 + 56kx2 − 28k + 45x2 − 23)

2Sk +

2(2k + 3)(4k + 9)(256k4x4 − 256k4x2 + 48k4 + 1664k3x4 − 1696k3x2 +340k3 + 3968k2x4 − 4144k2x2 + 890k2 + 4120kx4 − 4430kx2 + 1018k +1575x4 − 1750x2 + 429),

(4k + 5)(x− 1)x(x+ 1)DxSk + (4k + 5)(x− 1)x(x+ 1)Dx −4(k + 1) (4kx2 − 2k + 5x2 − 2)Sk + 2(2k + 3) (4kx2 − 2k + 5x2 − 3) ,

(4k + 5)2(x− 1)2x2(x+ 1)2D2x +

2(4k + 5)(x− 1)x(x+ 1) (8k2x2 − 4k2 + 30kx2 − 16k + 25x2 − 14)Dx −8(k + 1)2(2k + 3)2Sk +2(2k + 3) (8k3 + 48k2x4 − 56k2x2 + 36k2 + 120kx4 − 142kx2 + 54k +75x4 − 90x2 + 27)

(3.11)

Example 3.6. We want to apply Zeilberger’s slow algorithm to (3.10). Thefirst step consists in finding an element in the ideal (3.11) that is free of theintegration variable x. Let’s follow the classical approach: switch to a (par-tially) polynomial Ore algebra Q(k)[x][Sk;Sk, 0][Dx; 1, Dx] and apply elimina-tion techniques. Although the annihilating ideal looks relatively innocent, theelimination via Grobner bases turns out to be quite hard. It takes severalhours with our implementation OreGroebnerBasis and the result containssome elements of MegaByte-size. In total there are 4 x-free polynomials eachof which can be separated into principal part and delta part. At this pointwe should check whether the inhomogeneous parts that come from integrat-ing over the delta parts evaluate to zero. Since these delta parts are quitehuge, it is a good idea to reduce them with the annihilating ideal (3.11) before

Page 63: UNIVERSIT AT LINZ JKU - Koutschan

3.5. Concluding example 63

applying them to the integrand and evaluating at the boundaries. Altogetherthis is quite a cumbersome work and for more complicated integrands thistask may easily become infeasible. In our example all inhomogeneous partsvanish and we are left with the 4 principal parts as annihilating operators forthe integral. We finally compute their greatest common divisor in order toobtain a recurrence of smaller order (which is 8 in this case, with coefficientsof degree 26 in k).

Example 3.7. Again we want to try (3.10) with Zeilberger’s slow algorithmbut now perform the elimination with the ansatz∑

i+j≤d

ci,j(k)SikDjx

proposed at the end of Section 3.1. Looping over the total degree d onehas to go up to d = 12 until an x-free operator is found (its size is about100 kB and it takes about one minute to compute it with our commandFindRelation). As before the inhomogeneous part evaluates to zero, andthe surviving principal part is of order 7. It is a multiple of the minimalrecurrence Sk − 1. Comparing this result with Example 3.6 we observe theeffect of extension/contraction that prevented us from finding the smallestx-free operator. This example however teaches that the smallest recurrencethat can be found with Zeilberger’s slow algorithm, is of order 7.

The two examples 3.6 and 3.7 have demonstrated that Zeilberger’s orig-inal algorithm is often not favorable in practice. For the relatively simpleintegral (3.10) both versions took quite some while to come up with a resultwhich additionally overshoots the minimal recurrence by far. The reason liesin the restriction of the delta part by eliminating the variable x completely.In the following we apply the algorithms that overcome this deficiency.

Example 3.8. Takayama’s algorithm applied to (3.10) delivers (after 0.2seconds) the second order recurrence operator

(k + 2)2(2k + 5)2(4k + 5)S2k −

(4k + 7) (8k4 + 56k3 + 150k2 + 182k + 83)Sk +(k + 1)2(2k + 3)2(4k + 9).

(3.12)

But this result should not be trusted immediately since the integral does nothave natural boundaries. Using our command Takayama with the additionaloption Extended -> True we can force Takayama’s algorithm to propagatethe delta parts through the whole computation (which is not very efficienthowever: in this instance it takes around ten times longer). Again we don’tget an inhomogeneous part and the final result is the recurrence (3.12).

Page 64: UNIVERSIT AT LINZ JKU - Koutschan

64 Chapter 3. Algorithms for Summation and Integration

Example 3.9. Chyzak’s algorithm is guaranteed to find the smallest recur-rence that exists on the level of the integrand (that need not necessarily co-incide with the shortest recurrence for the whole integral). For (3.10) itcomputes the following creative telescoping operator

1− Sk︸ ︷︷ ︸=P (k,Sk)

+Dx

(x2 − x4

2 (2k2 + 5k + 3)Dx +

x

4k + 5Sk +

−4kx3 + 3kx− 5x3 + 4x

4k2 + 9k + 5

)︸ ︷︷ ︸

=Q(k,x,Sk,Dx)

in about 0.5 seconds with our command CreativeTelescoping. Since nowalso the delta part is relatively small, it is easily verified that [Q • fk(x)]x=1

x=−1

evaluates to zero. Hence the principal part P annihilates the integral, andtogether with the first initial value∫ 1

−1

(P1(x)

x

)2

dx =

∫ 1

−1

1 dx = 2

we have found that Strang’s integral evaluates to 2 for all integers k ≥ 0.

Example 3.10. We use the polynomial ansatz described in Section 3.4 forfinding a telescoping relation for (3.10). We have seen that there is muchfreedom how to choose the structure set of the ansatz. After trying around alittle bit, it turns out that the ansatz

c1(k)Sk + c0(k) + Dx ·

(3∑i=0

2∑j=0

1∑m=0

ci,j,m(k)xiSjkDmx

)delivers a result with nontrivial principal part. The computation time forreducing this ansatz with the given annihilating ideal (3.11) and solving thelinear system is about 1 second and yields the telescoping relation

2(k + 1)(2k + 3)(4k + 5)2(4k + 7)(4k + 9)2(Sk − 1) +

Dx

(−(2k+5)(4k+5)(8k3 − 4k2x2 + 48k2 − 13kx2 + 92k − 9x2 + 55)S2

kDx −4(k + 1)(k + 2)(2k + 5)(4k + 5)(4k + 9)xS2

k +(4k + 7) (4k2 + 14k + 11) (8k2 + 28k + 23)SkDx +(4k + 5)(4k + 7)(4k + 9)x(64k3x2 − 48k3 + 336k2x2 − 240k2 + 572kx2−

388k + 315x2 − 205)Sk −(k + 1)(4k + 9)(16k3 + 8k2x2 + 72k2 + 30kx2 + 100k + 25x2 + 44)Dx −4(k + 1)(k + 2)(2k + 3)(4k + 5)(4k + 9)(8k + 17)x

).

We observe that—up to a polynomial factor—the same principal part as inChyzak’s algorithm (Example 3.9) is obtained. Moreover if this relation issimplified, in particular if the delta part is reduced to normal form with respectto the annihilating ideal of fk(x), then we end up with exactly the sametelescoping relation as it was output by Chyzak’s algorithm.

Page 65: UNIVERSIT AT LINZ JKU - Koutschan

Chapter 4

The HolonomicFunctions

Package

This chapter is dedicated to the presentation of the software developed inthe frame of this thesis. All the algorithms for summation and integrationof ∂-finite functions that have been presented in Chapter 3 have been im-plemented (see their demonstration in Section 4.6). In order to prepare theinput for these algorithms, the package provides commands for executing the∂-finite closure properties, or more generally speaking, for computing anni-hilating ideals for given functions, see Section 4.3. In the core we had toimplement a framework for the (noncommutative) arithmetic of Ore polyno-mials. Section 4.1 shortly describes the concepts and data types that wereintroduced for that purpose. An important ingredient in Chyzak’s algorithmis to find rational solutions of parameterized coupled systems of differentialor difference equations. Since this functionality is not provided by Mathe-matica, it had to be implemented from scratch and is also included in thepackage; the corresponding commands are explained in Section 4.5. Finally,and not only because this thesis evolved from RISC that was founded byBruno Buchberger, noncommutative Grobner bases play a role in the abovementioned algorithms. Section 4.2 describes how they can be computed inOre algebras using our package HolonomicFunctions. A handbook withsystematic descriptions of all available commands is in preparation [54].

Besides demonstrating our software, this chapter has a second intention,namely to present typical examples, applications and tasks in which ourpackage can be of help. Emphasis is put on a set of identities involving Besselfunctions (that is what Chapter BS is about) that was sent to Peter Paule byFrank Olver who is the Mathematics Editor for the DLMF (Digital Libraryof Mathematical Functions) project at the National Institute of Standardsand Technology. In his e-mail [62] he wrote:

65

Page 66: UNIVERSIT AT LINZ JKU - Koutschan

66 Chapter 4. The HolonomicFunctions Package

The writing of DLMF Chapter BS by Leonard Maximon andmyself is now largely complete; however, a problem has arisenin connection with about a dozen formulas from Chapter 10 ofAbramowitz and Stegun for which we have not yet tracked downproofs, and the author of this chapter, Henry Antosiewicz, diedabout a year ago. Since it is the editorial policy for the DLMF notto state formulas without indications of proofs, I am hoping thatyou will be willing to step into the breach and supply verificationsby computer algebra methods. . . I will fax you the formulas latertoday. . .

When this request arrived in 2006, all of Olver’s problems were solved bymembers of Peter Paule’s group, namely Stefan Gerhold, Manuel Kauers,Carsten Schneider, and Burkhard Zimmermann by using computer algebrapackages that were available at that time [39], which was quite some chal-lenge. We will show how this problem set can nowadays be solved with helpof HolonomicFunctions which reduces the work to be done by a human be-ing even more. We concentrate on the computer algebra aspects that arecovered by our package, and allow ourselves to neglect extra arguments (e.g.analytic continuation to the whole complex plane, questions of convergence,etc.). For Olver’s problem set, these arguments can be found in [39].

The presentation is organized in a bottom-up fashion. This structuresometimes has the effect that in Section x a certain result is computed inseveral steps in a somewhat complicated manner, and then in Section x+1 itis described how to get the very same result with a one line command—thishas to be considered when reading the first sections! On the other hand, ifyou are impatient and eager to prove lots of special function identities, youmay immediately jump to Section 4.6 where the most interesting applicationsare exhibited, in a way how these problems should be done.

The chapter contains a whole Mathematica session that runs through-out all sections (sometimes variables that have been assigned a value willbe used later). The inputs are given exactly in the way how you have totype them into Mathematica and the outputs are displayed exactly as Math-ematica gives them back (so do not wonder when stumbling across strangesymbols like i or e—this is Mathematica’s notation for the imaginary unit,respectively the base of the natural logarithm, for example). No computa-tion presented in this chapter takes more than a few seconds. We start thesession by loading the package:

In[1]:= << HolonomicFunctions.m

HolonomicFunctions package by Christoph Koutschan, RISC-Linz,Version 1.0 (25.09.2009) — Type ?HolonomicFunctions for help

Page 67: UNIVERSIT AT LINZ JKU - Koutschan

4.1. Arithmetic with Ore polynomials 67

4.1 Arithmetic with Ore polynomials

Most of the computations that our package performs are based on the non-commutative arithmetic of Ore polynomials. Recently [67] an innocent-looking integral due to Wallis ∫ π

2

0

cos(x)2m dx

has attracted attention. Here it may serve for demonstration since its solu-tion requires some non-standard use of the operator framework which forcesus to work on this low level. But we do not want to conceal that Wallis’s in-tegral can be computed in a more standard way after performing the obvioussubstitution.

Although the integrand is not ∂-finite, this integral can be done by avariant of Takayama’s algorithm. Of course a certain trick has to be applied,which requires some steps to be done by hand. The integration variable isx which means that we have to work with partial derivatives with respectto that variable. There is another parameter, namely m, for which it seemsmore natural to act by shift on it. Let’s prepare the stage for this algebraiccontext.

The package HolonomicFunctions provides the user with the followingOre operators:

• the partial derivativeDx is entered as Der[x] (the command D is alreadyoccupied by Mathematica and D[x] is immediately simplified to x),

• the shift operator Sn is entered as S[n],

• the difference operator ∆n is entered as Delta[n],

• the Euler operator θx = xDx is entered as Euler[x],

• and the q-shift operator Sx,q has to be entered as QS[x,q^n]. Thismeans that a new variable x is introduced that represents the expres-sion qn.

It is recommended to use Der instead of Euler for differential equations, andS instead of Delta for recurrences. But this is only for practical reasons sincemore testing and optimizations were done on this side. We just want to pointout that it is also possible to define other kinds of operators, as long as theycan be introduced as Ore extensions. The commands OreSigma, OreDelta,and OreAction are serving this purpose.

Page 68: UNIVERSIT AT LINZ JKU - Koutschan

68 Chapter 4. The HolonomicFunctions Package

Before being able to write down a single relation in operator notationwe have to address shortly the usage of Ore algebras. They are definedwith the command OreAlgebra, where everything that is supposed to occurpolynomially only is given in the arguments. In the first place this refers tothe Ore operators that a particular Ore algebra is equipped with; of course,it does not make much sense to divide by operators like Dx or S2

m − 1. Let’screate an algebra that contains these two Ore operators, and that could servefor example for expressing recurrences and differential equations related tothe integrand of Wallis’s integral

In[2]:= OreAlgebra[Der[x], S[m]]

Out[2]= K(m,x)[Dx; 1, Dx][Sm;Sm, 0]

The algebra is displayed using the classical notation for Ore extensions intro-duced in Chapter 2. In order to construct Ore extensions of a ring instead ofa field, as it is the case for example in the Weyl algebra, the following syntaxhas to be used:

In[3]:= OreAlgebra[x,Der[x]]

Out[3]= K[x][Dx; 1, Dx]

In other words, what has to be given as arguments to the commandOreAlgebra are exactly the generators of the Ore algebra, viewed as a poly-nomial ring over some coefficient field. Note that the order in which thegenerators are given prescribes the order of the generators in the standardmonomials, and polynomials in the respective algebra will always be con-verted to canonical form, their monomials being displayed in that order.Thus using the command OreAlgebra[Der[x],x], you can work in the Weylalgebra where Dx is always commuted to the left so that its monomials areof the form Dα

x xβ.

The return value of OreAlgebra is of the type OreAlgebraObject, aconstruct that contains information about how to compute with elements ofthis algebra: In the first place this is the set of generators of the algebra, butalso instructions how to treat the coefficients (e.g., whether they should bekept in expanded or factored form) as well as possible algebraic extensions.

Back to Wallis’s integral: Looking at the summand f(m,x) = cos(x)2m

immediately delivers a recurrence in m, namely f(m+1, x) = cos(x)2f(m,x).Differentiating the summand one obtains the simple differential equationcos(x) d

dxf(m,x) = −2m sin(x)f(m,x). Note that the annihilating ideal gen-

erated by these two relations is not ∂-finite in the classical sense: The coef-ficients are not in Q(m,x) (and this is the trick that we mentioned above).We now demonstrate how to express these relations in terms of operatorsand how to manipulate them. The package HolonomicFunctions provides

Page 69: UNIVERSIT AT LINZ JKU - Koutschan

4.1. Arithmetic with Ore polynomials 69

a data type OrePolynomial that makes computations with Ore polynomialsvery convenient. Such an object carries the Ore algebra in which it lives aswell as the monomial order in which its terms are sorted. It is displayed withthe coefficients always being on the left side, the power products orderedaccording to how the generators are given in the algebra, and the termsordered by the given monomial order. An Ore polynomial can be trans-ferred to a different algebra or monomial order by means of the commandsChangeOreAlgebra and ChangeMonomialOrder. There is a simple way toconvert relations that are given in traditional notation into operator formusing the data type OrePolynomial:

In[4]:= wall = ToOrePolynomial[f [m+ 1, x] == Cos[x]2f [m,x],

Cos[x] D[f [m,x], x] == −2mSin[x] f [m,x], f [m,x]

]Out[4]= Sm − Cos[x]2, Cos[x]Dx + 2mSin[x]

When the command ToOrePolynomial is used with the above syntax, therelations will be transformed to Ore polynomials in a rational Ore algebrathat is generated by the involved Ore operators, and where everything elsegoes to the coefficient field. In order to see in which algebra these two Orepolynomials live we type

In[5]:= OreAlgebra[wall]

Out[5]= K(m,x)[Sm;Sm, 0][Dx; 1, Dx]

Note that the coefficients are not investigated further; on display are onlythe variables m and x that correspond to the Ore operators of the algebra.The fact that also sin(x) and cos(x) occurs (or possibly other parameters) issubsumed in the unspecific symbol K.

Alternatively ToOrePolynomial can take relations in operator notationplus (optionally) an explicit Ore algebra and outputs the correspondingOrePolynomial objects. The inverse, i.e., converting an OrePolynomial ob-ject to a standard Mathematica expression being a (commutative) polynomialin the generators of the algebra, can be achieved by using Normal:

In[6]:= ToOrePolynomial[

Cos[x] Der[x] + 2mSin[x], S[m]− Cos[x]2,

OreAlgebra[S[m],Der[x]]]

Out[6]= Cos[x]Dx + 2m Sin[x], Sm − Cos[x]2

In[7]:= Normal /@ %

Out[7]= Cos[x] Der[x] + 2mSin[x], S[m]− Cos[x]2

To verify that these two operators indeed annihilate the integrand, we applythem to cos(x)2m and hope that the result simplifies to zero:

Page 70: UNIVERSIT AT LINZ JKU - Koutschan

70 Chapter 4. The HolonomicFunctions Package

In[8]:= ApplyOreOperator[wall,Cos[x]ˆ(2m)] // Simplify

Out[8]= 0, 0

We now aim at a recurrence relation for Wallis’s integral by applyingTakayama’s technique. Since we want to do integration with respect to x,the delta part (that we are not going to compute) has the form DxQ for someoperator Q and we have to find a principal part that does neither involve xnor Dx. Note that the variable x appears only in sin(x) and cos(x) butnot apart. We now should add certain multiples to the elements of wall inorder to make elimination possible. The highest total degree with respect tosin(x) and cos(x) is 2, hence we want to include multiples of the differentialrelation by sin(x) as well as by cos(x). The commands OrePlus, OreTimes,and OrePower serve for such computations:

In[9]:= OreTimes[Sin[x],wall[[2]]]

Out[9]= Sin[x]Cos[x]Dx + 2mSin[x]2

Note that it is not necessary to convert the first factor to the OrePolynomialdata type; it is automatically transformed into such by using the Ore algebraof the other factor. To make this somewhat cumbersome notation simpler,HolonomicFunctions uses Upvalues for Ore polynomials: This means thatyou can use the symbols +, **, and ^ for doing arithmetic with Ore polyno-mials; note the double star that stands for NonCommutativeMultiply. Usingthe single star * also works, but the result may not be what you want sinceMathematica might reorder the factors before calling OreTimes. Thus weget a new set of annihilating operators by

In[10]:= wall = Join[wall, Sin[x] ∗∗wall[[2]],Cos[x] ∗∗wall[[2]]]Out[10]=

Sm − Cos[x]2, Cos[x]Dx + 2m Sin[x], Sin[x] Cos[x]Dx + 2mSin[x]2,Cos[x]2Dx + 2mSin[x] Cos[x]

The next step consists in reducing these Ore polynomials with the right idealgenerated by Dx. In order to do so, we first commute Dx to the left (whichmeans to include sin(x) and cos(x) to the generators of the algebra):

In[11]:= wall = ChangeOreAlgebra[wall,OreAlgebra[Der[x], Sin[x],Cos[x],S[m]]]

Out[11]=

− Cos[x]2 + Sm, DxCos[x] + (2m+ 1) Sin[x], Dx Sin[x] Cos[x] +(2m+ 1) Sin[x]2 − Cos[x]2, DxCos[x]2 + (2m+ 2) Sin[x] Cos[x]

Next we set Dx to zero. Do not try to use Mathematica’s ReplaceAll. Dueto the special data type that we use this will give faulty results! Instead usethe following command:

Page 71: UNIVERSIT AT LINZ JKU - Koutschan

4.1. Arithmetic with Ore polynomials 71

In[12]:= wall = OrePolynomialSubstitute[wall, Der[x]→ 0]Out[12]=

− Cos[x]2 + Sm, (2m+ 1) Sin[x], (2m+ 1) Sin[x]2 − Cos[x]2,

(2m+ 2) Sin[x] Cos[x]

The above steps somehow let Mathematica forget about the relations betweensin and cos since they are now treated as independent elements of the algebra.Hence we shall not forget to include the Pythagorean identity:

In[13]:= AppendTo[wall,Cos[x]2 + Sin[x]2 − 1

];

Now the task is to combine these Ore polynomials (without multiplying bysin(x) and cos(x) any more) in a way that the result is completely free of x.In this particular example it is so simple that we can achieve the eliminationby hand:

In[14]:= wall[[3]]− (2m+ 1) ∗∗wall[[5]]

Out[14]= (−2m− 2) Cos[x]2 + (2m+ 1)

In[15]:= %− (2m+ 2) ∗∗wall[[1]]

Out[15]= (−2m− 2)Sm + (2m+ 1)

The last line contains the desired recurrence. It is of order 1 and by com-

puting the initial value for m = 0, i.e.,∫ π/2

01 dx = π

2, we can readily read off

the solution: ∫ π2

0

cos(x)2m dx =π

2·(

12

)m

m!.

There is one question left that we have to care about: Does Wallis’s inte-gral have natural boundaries and are we therefore allowed to apply Taka-

yama’s algorithm at all? Does [P • cos(x)2m]π/20 = 0 hold for arbitrary

operators P in our Ore algebra? Clearly not: choose P = 1 and get

[cos(x)2m]π/20 = −1. Fortunately, it is very easy in this example to obtain

the delta part: We just have to carry the delta parts of the input relationsthrough the elimination process. The only relation with nontrivial delta partthat was used is the third element in wall. Hence the delta part of thetelescoping relation is Dx sin(x) cos(x). We could perform exactly the samecomputation as before, only omit the step where we substituted Dx → 0.

Now it is immediately checked that [sin(x) cos(x)2m+1]π/20 = 0.

We want to stress that such strange algebras (with sin(x) and cos(x) forexample) have to be used with caution. If we had tried to solve Wallis’sintegral with Zeilberger’s slow algorithm, we would have encountered theproblem that K[sin(x), cos(x)][Dx; 1, Dx] is not a ring of solvable type whenwe fix an elimination order on the monomials that eliminates sin(x) and

Page 72: UNIVERSIT AT LINZ JKU - Koutschan

72 Chapter 4. The HolonomicFunctions Package

cos(x), e.g., by requiring that these two are lexicographically greater than Dxand by claiming that cos(x) ≺ sin(x). The relation

Dx · cos(x) = cos(x) ·Dx − sin(x)

witnesses that condition (1.1) is not fulfilled. In this situation Buchberger’salgorithm is not guaranteed to terminate.

Without explicit demonstration we want to mention some more com-mands for treating Ore polynomials whose names are quite self-explanatory:NormalizeCoefficients, LeadingCoefficient, LeadingPowerProduct,LeadingTerm, LeadingExponent, OrePolynomialDegree, Support, andOrePolynomialListCoefficients. Some of these commands anyway willbe used later in this chapter. There are some further constructions (Mathe-matica Upvalues) to manipulate Ore polynomials on the coefficient level: thecommands Factor, Expand, and Together act directly on the coefficientsof an Ore polynomial. So if p is an Ore polynomial and you want its co-efficients to be displayed in factored form, just type Factor[p]. In furthercomputations then the coefficients will always be kept in factored form.

4.2 Noncommutative Grobner bases

We have implemented Buchberger’s algorithm [22], incorporating the im-provements suggested in [14, Chapter 5.5] which concern a clever use of thechain criterion (Buchberger’s second criterion). The product criterion (Buch-berger’s first criterion) cannot be applied due to noncommutativity. It is wellknown that the selection strategy for critical pairs can dramatically influencethe runtime of Buchberger’s algorithm. As default we use the sugar strategythat has been proposed in [40] and that is nowadays considered as one ofthe best strategies for critical pair selection. However, in certain instances adifferent strategy may be of advantage; the option Method allows the user tochoose between the following strategies:

• "sugar": the strategy proposed in [40] that mimics the Grobner basiscomputation in a homogeneous ideal.

• "normal": the normal strategy has been proposed by Bruno Buch-berger himself; it takes the pair with the smallest lcm of the leadingmonomials.

• "elimination": a greedy strategy that is designed for eliminationproblems; it prefers pairs where the total degree of the variables tobe eliminated is minimal (in the lcm of the leading monomials).

Page 73: UNIVERSIT AT LINZ JKU - Koutschan

4.2. Noncommutative Grobner bases 73

• "pairsize": pairs of small “size” are treated first; we take as the sizeof a pair the product of the ByteCounts of the two polynomials.

As a simple introductory example we can use our implementation withthe command OreGroebnerBasis in order to confirm our intuition aboutthe non-existence of zero-dimensional ideals in the Weyl algebra that weelaborated in Example 2.5. We can compute the left Grobner basis of Dm

x

and xn for certain integers m and n and always get 1.In[16]:= OreGroebnerBasis

[ Der[x]5, x7

, OreAlgebra[x,Der[x]],

MonomialOrder→ DegreeLexicographic]

Out[16]= 1

To convince ourselves that there is really a combination of D5x and x7 that

gives 1, we can use the option Extended. It additionally computes a ma-trix M that transforms the given input polynomials f1, . . . , fk into theGrobner basis g1, . . . , gm via g1

...gm

= M ·

f1...fk

.

The output in this case is a list whose first element is the Grobner basis andwhose second element is the matrix M .

In[17]:= g,m = OreGroebnerBasis[

Der[x]5, x7, OreAlgebra[x,Der[x]],

Extended→ True]

Out[17]=

1,

− 1

190080x11D6

x −11

28800x10D5

x −55

5184x9D4

x −55

384x8D3

x

− 55

56x7D2

x −77

24x6Dx −

77

20x5,

1

190080x4D11

x −1

43200x3D10

x +1

12960x2D9

x −1

5760xD8

x +1

5040D7x

In[18]:= m[[1, 1]] ∗∗Der[x]5 +m[[1, 2]] ∗∗x7

Out[18]= 1

In most cases we will compute in rational Ore algebras. The followingexample again illustrates that Buchberger’s first criterion (product criterion)is not applicable in noncommutative polynomial rings. We study the anni-hilating ideal for Bessel functions, namely the modified Bessel functions ofthe first kind In(z). The function In(z) represents one of the two solutionsof the modified Bessel differential equation. It is also well known that In(z)

Page 74: UNIVERSIT AT LINZ JKU - Koutschan

74 Chapter 4. The HolonomicFunctions Package

satisfies a recurrence in n of order 2. We convert these two relations to Orepolynomials:

In[19]:= bess = ToOrePolynomial[z2 Der[z]2 + zDer[z]− n2 − z2,

z S[n]2 + (2 + 2n) S[n]− z]

Out[19]= z2D2z + zDz + (−n2 − z2), zS2

n + (2n+ 2)Sn − z

(omitting the second argument, the Ore algebra, HolonomicFunctions auto-matically will determine a suitable algebra in which the given expressions canbe represented). Buchberger’s criterion now would tell us that this is alreadya Grobner basis since the leading power products do not have anything incommon, or in other words whose lcm equals their product:

In[20]:= LeadingPowerProduct /@ bess

Out[20]= D2z , S

2n

But this is actually not a Grobner basis as a quick computation reveals (wedo not have to specify the Ore algebra again, since the input consists alreadyof objects of type OrePolynomial):

In[21]:= bess = OreGroebnerBasis[bess]

Out[21]= −zDz + zSn + n, −zS2n + (−2n− 2)Sn + z

Using the command OreReduce it is easily verified that the differential equa-tion is still contained in the ideal generated by the above two elements.

In[22]:= OreReduce[z2 Der[z]2 + zDer[z]− n2 − z2, bess]

Out[22]= 0

The normal form of the differential equation modulo the Grobner basis is 0which means that it is contained in the left ideal generated by the elementsof bess.

It is also possible to compute Grobner bases in modules (this is for exam-ple needed in Takayama’s algorithm). The elements of a module are given asfollows: Consider a module element of the form (a1, . . . , ak), ai ∈ O for someOre algebra O. The positions 1 through k will be indicated by introducing“position variables”. This can be a set of k extra indeterminates p1, . . . , pkso that the module element is represented by p1a1 + · · ·+pkak. Alternatively(and preferably) it suffices to introduce only one position variable p and markthe positions by powers of this particular variable. In that case the moduleelement translates to a1 + pa2 + · · ·+ pk−1ak. For the Grobner basis compu-tation the positions of these extra variables within the generators of the Orealgebra have to be given by the option ModuleBasis. We again have a lookat Wallis’s integral and this time do the elimination by means of Grobnerbases:

Page 75: UNIVERSIT AT LINZ JKU - Koutschan

4.3. ∂-finite closure properties 75

In[23]:= OreGroebnerBasis[wall, OreAlgebra[Sin[x],Cos[x],S[m]],MonomialOrder→ EliminationOrder[2], ModuleBasis→ 1, 2]

Out[23]= (−2m− 2)Sm + (2m+ 1), Sin[x], (−2m− 2) Cos[x]2 + (2m+ 1),Sin[x] Cos[x], (−2m− 2) Sin[x]2 + 1

The first element of the Grobner basis is the desired x-free recurrence.

For transferring a given Grobner basis of a zero-dimensional ideal intoa Grobner basis with respect to a different monomial order, there is thealgorithm FGLM [33] due to Faugere, Gianni, Lazard, and Mora. Sincea similar idea is behind the algorithms for ∂-finite closure properties, wehave included it in the package. The function call is as follows (the secondargument may be omitted if the Ore algebra for the output does not change):

In[24]:= FGLM[bess, OreAlgebra[S[n],Der[z]], Lexicographic]

Out[24]= z2D2z + zDz + (−n2 − z2), zSn − zDz + n

4.3 ∂-finite closure properties

In Section 2.3 we have seen that the class of ∂-finite functions shares a cou-ple of closure properties: sum and product, linear substitutions for discretevariables, algebraic substitutions for continuous variables, and applicationof an operator. These closure properties can be executed with our pack-age HolonomicFunctions using the commands DFinitePlus, DFiniteTimes,DFiniteSubstitute, and DFiniteOreAction. Although in practice they willnot often be used—for compound expressions the command Annihilator au-tomatically executes the closure properties in the background—we want toshortly introduce them. Note that all these commands, as well as othersthat deal with ∂-finite functions and that will be discussed in the followingsections, can only deal with rational Ore algebras (only Ore operators areadmissible among its generators). We will give some examples while provingone of Olver’s problems, identity (10.2.30) from [6]:

1

zsinh√z2 − 2itz =

∞∑n=0

(−it)n

n!

√π

2zI−n+ 1

2(z). (4.1)

By looking at asymptotic expansions of Bessel functions for large orders(see [6, Section 9.3]) it can be proven that the sum on the right-hand sideconverges only if the condition

2|t| < |z| (4.2)

Page 76: UNIVERSIT AT LINZ JKU - Koutschan

76 Chapter 4. The HolonomicFunctions Package

is fulfilled. We want to point out that Mathematica is not able to simplifythe sum even if this condition is given in the assumptions. An annihilatingideal for the left-hand side can be readily computed using closure properties.Starting from the differential equation for the hyperbolic sine, the algebraicsubstitution is done:

In[25]:= DFiniteSubstitute[

ToOrePolynomial[Der[x]2 − 1

],

x→ Sqrt[z2 − 2Izt],Algebra→ OreAlgebra[Der[t],Der[z]]

]Out[25]= (t+ iz)Dt − zDz, (2t2z + 3itz2 − z3)D2

z + t2Dz + (it3 − 3t2z − 3itz2 + z3)

For continuous substitutions it is important to use different variables for theinput and the output; a substitution of the form x→

√1− x2 will not work.

Hence also the Ore algebra in which the output shall be represented has tobe specified using the option Algebra.

It remains to perform the multiplication by 1z

and we obtain an annihi-lating ideal for the left-hand side:

In[26]:= lhs = DFiniteTimes[%,ToOrePolynomial[zDer[z] + 1,Der[t],OreAlgebra[Der[t],Der[z]]]]

Out[26]= (t+ iz)Dt − zDz − 1, (2t2z2 + 3itz3 − z4)D2z + (5t2z + 6itz2 − 2z3)Dz

+ (it3z − 3t2z2 + t2 − 3itz3 + z4)

In order to tackle the right-hand side, we first have to get a handle on thesummand, which means computing an annihilating ideal for it. Similarly asbefore we first perform the discrete substitution for the expression I−n+ 1

2(z).

We take the annihilating ideal for the Bessel function In(z) computed earlier.The same command as for continuous substitution is used, only that fordiscrete substitutions it is possible to use the same variable on both sides ofthe substitution.

In[27]:= DFiniteSubstitute[bess, n→ −n+ 1/2]Out[27]= 2zDz − 2zSn + (1− 2n), zS2

n + (2n+ 1)Sn − z

In the special case where we wish to multiply a ∂-finite function f by afactor that is hypergeometric resp. hyperexponential in all variables underconsideration, there is an extra command DFiniteTimesHyper that com-putes the output relations directly without performing the closure propertyalgorithm. Therefore it does not require the input (the annihilating ideal

of f) to be a Grobner basis. This applies to the factor (−it)nn!

√π2z

that is stillmissing: it is hypergeometric in n and hyperexponential in both t and z.Since now the variable t enters, we have to add an annihilating relation forI−n+ 1

2(z) with respect to Dt, that is just Dt, and convert everything to Ore

polynomials in the same algebra (this can be done using ToOrePolynomial):

Page 77: UNIVERSIT AT LINZ JKU - Koutschan

4.3. ∂-finite closure properties 77

In[28]:= smnd = DFiniteTimesHyper[ToOrePolynomial[Append[%,Der[t]],OreAlgebra[S[n],Der[t],Der[z]]], (−It)n/n! Sqrt[Pi/(2z)]]

Out[28]= (inz + iz)Sn − tzDz + (nt− t), −z2D2z − 2zDz + (n2 − n+ z2),−tDt + n

This example will be continued in the next section where a detailed demon-stration of Chyzak’s algorithm is done to solve the summation problem.

Concerning the usage of ∂-finite closure properties the previous calcula-tions have shown that it can be cumbersome to compute an annihilating idealfor a given compound expression for two reasons: First because you have tocompute Grobner bases and repeatedly apply closure properties, basicallyas often as the number of nodes in the expression tree. Second because youhave to know (or to look up) the defining equations for the functions that arecontained in the given expression. For some of them it can even be that youare not sure whether they are ∂-finite or not. The command Annihilator

bypasses all these troubles. It takes an arbitrarily nested mathematical ex-pression and computes an annihilating ideal for it by recursively applyingclosure properties (this of course works only if the input indeed represents a∂-finite function—with some exceptions that we will discuss later). Moreoverit recognizes a huge collection of special functions and for each of them a setof annihilating operators is stored. If you are interested in the differentialequation say for the Whittaker hypergeometric function Wk,m(z), you canjust “look it up”!

In[29]:= Annihilator[WhittakerW[k,m, z], Der[z], Head→ w]

Out[29]=

w[z]

(4kz − 4m2 − z2 + 1

)+ 4z2w′′[z]

The second argument, an Ore operator or a list of Ore operators, spec-

ifies what kind of relations you are looking for. The option Head is moreor less a gimmick and causes the output to be given as relations using thegiven function name. But usually we will omit this option and work with Orepolynomials instead (this is also preferable when you want to do further com-putations with HolonomicFunctions). If we also omit the second argument,Annihilator tries to find out himself for which Ore operators relations exist(although in many cases this works quite well, we recommend to specify theOre operators—this is faster and more reliable).

In[30]:= Annihilator[WhittakerW[k,m, z]]

Out[30]= (−2kz + 2mz + z)Sm + (4mz + 2z)Dz + (2kz − 4m2 − 4m− 1),2Sk + 2zDz + (2k − z), 4z2D2

z + (4kz − 4m2 − z2 + 1)

The function Annihilator always returns a Grobner basis with respect tothe rational Ore algebra that is generated by the given operators. So wecould have achieved the annihilating ideals for the left-hand side and the

Page 78: UNIVERSIT AT LINZ JKU - Koutschan

78 Chapter 4. The HolonomicFunctions Package

summand in (4.1) in a single line!

To some extent Annihilator can also handle functions that are not ∂-finite. Following the ideas of Chyzak, Kauers, and Salvy [27] we have enlargedAnnihilator’s database of mathematical functions with some functions thatare not ∂-finite, and also the implementation of the closure properties hasbeen adjusted accordingly. Hence we can try the integrand of Wallis’s inte-gral:

In[31]:= Annihilator[Cos[x] (2m), S[m],Der[x]]Annihilator::nondf : The expression Cos[x]2m is not recognized to be ∂-finite.

The result will not generate a zero-dimensional ideal.

Out[31]= −SmD2x + (−4m2 − 8m− 4)Sm + (4m2 + 6m+ 2)

We obtain only one single relation—too few to generate a zero-dimensionalideal in the Ore algebra Q(m,x)[Sm;Sm, 0][Dx; 1, Dx]; this fact is alwaysindicated by a warning. We also observe that this relation is different fromthe two operators that we used to solve the integral. The reason is thatAnnihilator only returns operators whose coefficients are rational functionsin the variables that correspond to the given Ore operators. In fact the outputis normalized in a way that there are no denominators and no content. Thedimension of an ideal can be computed as follows:

In[32]:= AnnihilatorDimension[%]

Out[32]= 1

which confirms the observation that the ideal was not zero-dimensional.

As an application of Annihilator we solve a problem taken from a paperby Stoll and Zeng [82]. The authors define the function

Un(x, a) =

√akxUk

(−a+x2−1

2√a

), n = 2k + 1

√ak(Uk

(−a+x2−1

2√a

)+√aUk−1

(−a+x2−1

2√a

)), n = 2k

and are interested in its differential equation with respect to x (separately foreven and odd n). In the definition, Uk(x) denotes the Chebyshev polynomialof the second kind. The case n = 2k + 1 we can solve right away:

In[33]:= Annihilator[Sqrt[a] ((n− 1)/2)xChebyshevU[(n− 1)/2,(x2 − a− 1)/(2 Sqrt[a])], Der[x]]

Out[33]= (a2x2 − 2ax4 − 2ax2 + x6 − 2x4 + x2)D2x + (−3a2x+ 6ax+ 3x5 − 3x)Dx +

(3a2 − 6a− n2x4 − 2nx4 + 3)

If we do the same for the case n = 2k we get a much more complicated result:

Page 79: UNIVERSIT AT LINZ JKU - Koutschan

4.3. ∂-finite closure properties 79

In[34]:= Annihilator[Sqrt[a]n/2(ChebyshevU[n/2, (x2 − a− 1)/(2 Sqrt[a])]

+Sqrt[a] ChebyshevU[n/2−1, (x2−a−1)/(2 Sqrt[a])]),Der[x]]

Out[34]= (a4x3 − 4a3x5 − 4a3x3 + 6a2x7 + 4a2x5 + 6a2x3 − 4ax9 + 4ax7 + 4ax5 −4ax3 +x11−4x9 +6x7−4x5 +x3)D4

x +(−6a4x2 +4a3x4 +24a3x2 +24a2x6−4a2x4−36a2x2−36ax8 +16ax6−4ax4 +24ax2 +14x10−36x8 +24x6 +4x4−6x2)D3

x + (15a4x− 60a3x− 2a2n2x5 − 4a2nx5 + 6a2x5 + 90a2x+ 4an2x7 +4an2x5 + 8anx7 + 8anx5−72ax7−12ax5−60ax−2n2x9 + 4n2x7−2n2x5−4nx9+8nx7−4nx5+51x9−72x7+6x5+15x)D2

x +(−15a4+60a3+2a2n2x4+4a2nx4−6a2x4−90a2+8an2x6−4an2x4+16anx6−8anx4−24ax6+12ax4+60a−10n2x8 +8n2x6 +2n2x4−20nx8 +16nx6 +4nx4 +45x8−24x6−6x4−15)Dx + (n4x7 + 4n3x7 − 4n2x7 − 16nx7)

It is a differential equation of order 4 and since the one for n = 2k + 1 wasof order 2, we suspect that there should be one of order 2 for the even case,too. Indeed, by slightly reformulating the input we can achieve this goal.The closure property “application of an operator” that has not been used sofar will help. We observe that the two summands in the parentheses are verysimilar. In fact they can be rewritten as the application of an operator to asingle instance of U :

Un2

(−a+x2−1

2√a

)+√aUn

2−1

(−a+x2−1

2√a

)= (S2

n +√a) • Un

2−1

(−a+x2−1

2√a

).

In all cases where such a rewriting can be done it is preferable to use theclosure under operator application (since there the vector space dimensionof the annihilating ideal cannot grow).

In[35]:= DFiniteTimes[Annihilator[Sqrt[a] (n/2), S[n],Der[x]],DFiniteOreAction[Annihilator[ChebyshevU[n/2− 1,(x2 − a− 1)/(2 Sqrt[a])], S[n],Der[x]], S[n]2 + Sqrt[a]]]

Out[35]= (−a3x+a2nx3 +3a2x3 +3a2x−2anx5−2anx3−3ax5−2ax3−3ax+nx7−2nx5 + nx3 + x7 − x5 − x3 + x)D2

x + (a3 − 3a2nx2 + a2x2 − 3a2 +6anx2 − 5ax4 + 6ax2 + 3a+ 3nx6 − 3nx2 + 3x6 + 5x4 − 7x2 − 1)Dx +(3an2x3 + 6anx3 − n3x5 − 3n2x5 − 3n2x3 − 2nx5 − 6nx3),(2a− 2nx2 − 2x2 − 2)S2

n + (a2x− 2ax3 − 2ax+ x5 − 2x3 + x)Dx +(−anx2 − 2ax2 + 2a+ nx4 − nx2 + 2x4 − 2)

The Ore operator Sn has to be included in the Ore algebra because it appearsin the second argument of DFiniteOreAction. Again this result can be ob-tained by a single call of Annihilator. The operator application is encodedby the name ApplyOreOperator:

In[36]:= % === Annihilator[Sqrt[a]n/2 ApplyOreOperator[S[n]2 + Sqrt[a],ChebyshevU[n/2− 1, (x2− a− 1)/(2 Sqrt[a])]], S[n],Der[x]]

Out[36]= True

Page 80: UNIVERSIT AT LINZ JKU - Koutschan

80 Chapter 4. The HolonomicFunctions Package

Both differential equations agree with the results of Stoll and Zeng who foundit by other means (ad-hoc ansatz for the polynomial coefficients).

In the input line 36 it was crucial that the expression given to the com-mand Annihilator was not evaluated. Otherwise ApplyOreOperator wouldhave delivered the same expression that we had at the beginning. For thisreason, Annihilator carries the attribute HoldFirst. In a similar mannerthe symbol D can be used in the first argument of Annihilator; and insteadof letting Mathematica evaluate the differentiation the corresponding closureproperty is carried out.

4.4 Finding relations by ansatz

In Section 3.1 we have investigated how to use an ansatz in order to elimi-nate variables that are part of the coefficients of Ore polynomials. Actuallythis method is much more general: by prescribing the structure set we canask for relations in an ideal that are of a certain shape. We have imple-mented the command FindRelation that makes use of all the optimizationsdescribed in Section 3.4. There are several options which serve for specifyingthe properties of the desired operators.

• Eliminate gives a set of variables to be eliminated; this option is usedin the coefficient comparison.

• The use of the option Support forces to search only for operators withthe given support.

• With Pattern only those monomials are considered whose exponentvector is matched by the given pattern.

As an example we want to turn to the widely used hypergeometric func-tion 2F1 that has been introduced [36] by Carl Friedrich Gauß at the begin-ning of the nineteenth century. Besides many other important properties ofthis function, Gauß investigated what he called contiguous functions, nowa-days better known as contiguous relations:

Functionem ipsi F (α, β, γ, x) contiguam vocamus, quae ex illaoritur, dum elementum primum, secundum, vel tertium unitatevel augetur vel diminuitur, manentibus tribus reliquis elementis.1

1As contiguous function to F (α, β, γ, x) we denominate such a function that emergesfrom the latter by either augmenting or diminishing the first, second, or third element byone whereat the other three elements remain unaffected.

Page 81: UNIVERSIT AT LINZ JKU - Koutschan

4.4. Finding relations by ansatz 81

In the following Gauß gives a complete list of all 15 possible such contiguousrelations for his function F (that is the 2F1 in our present-day notation).What must have been a tedious task at the times where the word “computer”referred to some pitiable human being, we can now achieve in a second. Westart with the annihilating ideal for the hypergeometric function with respectthe Ore algebra that is generated by the three shift operators:

In[37]:= ann = Annihilator[Hypergeometric2F1[a, b, c, x], S[a], S[b], S[c]]Out[37]= (bcx− bc)Sb + (abx− acx− bcx+ c2x)Sc + (acx+ bc+ c2(−x)),

(acx− ac)Sa + (abx− acx− bcx+ c2x)Sc + (ac+ bcx+ c2(−x)),(abx− acx− ax− bcx− bx+ c2x+ 2cx+ x)S2

c +(acx+ax+bcx+bx−2c2x+c2−3cx+c−x)Sc+(c2x−c2 +cx−c)

Then we have to build the set of all supports for the 15 contiguous rela-tions, that correspond to all 2-subsets of the set of the 6 forward and back-ward shifts. In order to get rid of the inverse shifts we use our commandNormalizeVector that takes a list of rational functions, multiplies themwith the common denominator and removes the common polynomial content.This set is then given to FindRelation by means of the option Support. Forbetter readability we factor the coefficients:

In[38]:= supps = NormalizeVector[Append[#, 1]]& /@Subsets[S[a], 1/S[a], S[b], 1/S[b], S[c], 1/S[c], 2];

In[39]:= ApplyOreOperator[Factor[FindRelation[ann, Support→ supps]],F [a, b, c, x]] // TableForm

Out[39]= (−a+ c− 1)F [a, b, c, x] + (a(−x) + 2a+ bx− c− x+ 2)F [a+ 1, b, c, x] +(a+ 1)(x− 1)F [a+ 2, b, c, x]

(b− a)F [a, b, c, x]− bF [a, b+ 1, c, x] + aF [a+ 1, b, c, x](−b+c−1)F [a, b, c, x]+(a+b−c+1)F [a, b+1, c, x]+a(x−1)F [a+1, b+1, c, x]c(a+bx−cx)F [a, b, c, x]+x(a−c)(b−c)F [a, b, c+1, x]+ac(x−1)F [a+1, b, c, x]− cF [a, b, c, x] + (c− a)F [a, b, c+ 1, x] + aF [a+ 1, b, c+ 1, x](−a+c−1)F [a, b, c, x]+(a+b−c+1)F [a+1, b, c, x]+b(x−1)F [a+1, b+1, c, x](a− c+ 1)F [a, b+ 1, c, x] + (−b+ c− 1)F [a+ 1, b, c, x] +

(x− 1)(a− b)F [a+ 1, b+ 1, c, x]cF [a, b, c, x] + c(x− 1)F [a+ 1, b, c, x] + x(b− c)F [a+ 1, b, c+ 1, x](c−a)F [a, b, c+1, x]+c(x−1)F [a+1, b, c, x]+(a+bx−cx)F [a+1, b, c+1, x](−b+ c− 1)F [a, b, c, x] + (ax+ b(−x) + 2b− c− x+ 2)F [a, b+ 1, c, x] +

(b+ 1)(x− 1)F [a, b+ 2, c, x]c(ax+b−cx)F [a, b, c, x]+x(a−c)(b−c)F [a, b, c+1, x]+bc(x−1)F [a, b+1, c, x]− cF [a, b, c, x] + (c− b)F [a, b, c+ 1, x] + bF [a, b+ 1, c+ 1, x]cF [a, b, c, x] + c(x− 1)F [a, b+ 1, c, x] + x(a− c)F [a, b+ 1, c+ 1, x](c−b)F [a, b, c+1, x]+c(x−1)F [a, b+1, c, x]+(ax+b−cx)F [a, b+1, c+1, x]c(c+ 1)(x− 1)F [a, b, c, x]− (c+ 1)(−ax− bx+ 2cx− c+ x)F [a, b, c+ 1, x] +

x(a− c− 1)(b− c− 1)F [a, b, c+ 2, x]

Page 82: UNIVERSIT AT LINZ JKU - Koutschan

82 Chapter 4. The HolonomicFunctions Package

Modulo backwards shifting, our result looks very much like the table in theoriginal paper—the only difference are two little typos in the formulas 4 and11 where an x has been forgotten.

4.5 Rational solutions of systems of differen-

tial and difference equations

Finding rational solutions of parameterized coupled systems of differentialand difference equations is a subtask in Chyzak’s algorithm. We show howthis task can be carried out with the package HolonomicFunctions. We con-tinue with identity (4.1) from Section 4.3 and solve the summation problemwith Chyzak’s algorithm. Recall that we have already computed an annihi-lating ideal smnd for the summand and that now we have to find telescopingrelations of the form Pi + ∆nQi. The Pi are supposed to be free of n andSn, and we want to find so many of them that their principal parts Pi gener-ate a zero-dimensional ideal. For the Qi in the ansatz we have to know themonomials under the stairs of the Grobner basis smnd:

In[40]:= UnderTheStaircase[smnd]

Out[40]= 1, Sn

Chyzak’s algorithm loops over the support of the principal parts Pi. Toshorten this process, we look at the annihilating ideal lhs that has beencomputed for the left-hand side. Of particular interest is the support of itsgenerators:

In[41]:= Support[lhs]

Out[41]= Dt, Dz, 1, D2z , Dz, 1

Hoping that the annihilating ideal that we are going to find for the sum is thesame as that one for the left-hand side, we try our luck with a principal partthat has the same support as the first generator of lhs. Hence the ansatzlooks as follows:

In[42]:= ansatz = a3Der[t]+a2Der[z]+a1+(S[n]−1) ∗∗ (c1[n]+c2[n] ∗∗S[n])

Out[42]= a3Der[t] + a2Der[z] + a1 + (S[n]− 1) ∗∗ (c2[n] ∗∗ S[n] + c1[n])

Bringing the ansatz to canonical form as an Ore polynomial reveals the factwhy later a coupled difference system has to be solved.

In[43]:= ToOrePolynomial[ansatz, OreAlgebra[Der[t],Der[z], S[n]]]

Out[43]= c2[n+ 1]S2n + a3Dt + a2Dz + (c1[n+ 1]− c2[n])Sn + (a1 − c1[n])

The commutation of Sn to the right causes shifted instances of the unknowns

Page 83: UNIVERSIT AT LINZ JKU - Koutschan

4.5. Rational solutions 83

c1 and c2 to appear. The last computation also shows that the coefficientsof an OrePolynomial need not be polynomials or rational functions in therespective variables but can be anything, even unspecified functions in thesevariables.

The next step consists in reducing the ansatz with the annihilating idealof the summand and setting all the coefficients of the normal form to zero.The command OrePolynomialListCoefficients returns the list of nonzerocoefficients of an Ore polynomial ordered according to the monomial order.

In[44]:= OreReduce[ansatz, smnd]

Out[44]=

(ia2n

2

(n+ 2)t+

3ia2n

(n+ 2)t+

2ia2

(n+ 2)t+

2intc2[n+ 1]

(n+ 2)z+itc2[n+ 1]

(n+ 2)z+nc1[n+ 1]

n+ 2

−nc2[n]

n+ 2+

2c1[n+ 1]

n+ 2− 2c2[n]

n+ 2

)Sn +

(3a3n

2

(n2 + 3n+ 2) t+

2a3n

(n2 + 3n+ 2) t

+2a2n

2

(n2 + 3n+ 2) z− a2n

(n2 + 3n+ 2) z− 2a2

(n2 + 3n+ 2) z+

a1n2

n2 + 3n+ 2

+3a1n

n2 + 3n+ 2+

2a1

n2 + 3n+ 2+

a3n3

(n2 + 3n+ 2) t+

a2n3

(n2 + 3n+ 2) z

− t2c2[n+ 1]

n2 + 3n+ 2− n2c1[n]

n2 + 3n+ 2− 3nc1[n]

n2 + 3n+ 2− 2c1[n]

n2 + 3n+ 2

)In[45]:= eq = Collect[#, a1, a2, a3, c1[ ], c2[ ], Together]& /@

OrePolynomialListCoefficients[%]

Out[45]=

ia2(n+ 1)

t+ic2[n+ 1](2nt+ t)

(n+ 2)z+ c1[n+ 1]− c2[n],

a3n

t+a2(n− 1)

z+ a1 −

t2c2[n+ 1]

n2 + 3n+ 2− c1[n]

This coupled system has to be solved for unknown rational functions c1, c2 ∈Q(n, t, z) and for the parameters a1, a2, a3 ∈ Q(t, z). The uncoupling here istrivial and can be done by hand.

In[46]:= eq[[1]] /. c1[n+ 1]→ ((eq[[2]] + c1[n]) /. n→ n+ 1)

Out[46]=ia2(n+ 1)

t+a3(n+ 1)

t+a2n

z+ a1 −

t2c2[n+ 2]

(n+ 1)2 + 3(n+ 1) + 2

+ic2[n+ 1](2nt+ t)

(n+ 2)z− c2[n]

We obtain a scalar difference equation of order 2 for c2 and have to findrational solutions of it. The command RSolveRational does the job byexecuting Abramov’s algorithm [1, 2, 4]. Plugging the solution into one of

Page 84: UNIVERSIT AT LINZ JKU - Koutschan

84 Chapter 4. The HolonomicFunctions Package

the original equations immediately gives the solution for c1.

In[47]:= sol = RSolveRational[%, c2[n], ExtraParameters→ a1, a2, a3]

Out[47]=

c2[n]→ 0, a1 →

C[1]

z, a2 → C[1], a3 →

C[1](−t− iz)z

In[48]:= eq[[1]] /. c2[ ]→ 0 /. First[sol]

Out[48]= c1[n+ 1] +iC[1] (n+ 1)

t

In a similar fashion, DSolveRational is designed for finding rational so-lutions of linear differential equations. The procedures RSolvePolynomial

and DSolvePolynomial perform the subtasks of finding polynomial solutionsof linear difference resp. differential equations.

We can verify whether the above computations are correct by pluggingthe solution into our original ansatz and reducing it with the Grobner basis:

In[49]:= ansatz /. First[sol] /. c1[n]→ −InC[1]/t

Out[49]=C[1] Der[t] (−t− iz)

z+ C[1] Der[z] + (S[n]−1)∗∗

(0∗∗S[n]− iC[1]n

t

)+

C[1]

z

In[50]:= OreReduce[%, smnd]

Out[50]= 0

Indeed we have found a telescoping relation. It remains to investigate thedelta part. As we can set the arbitrary constant C[1] to 1 we have to evaluatethe expression [

n(−i)n+1tn−1

n!

√π

2zI−n+ 1

2(z)

]∞0

at the boundaries. For n = 0 this clearly vanishes, but for n→∞ this is notso easy to see (also Mathematica is not able to compute this limit). Similarto the statement of the identity (4.1) we have to use asymptotic expansionsof Bessel functions together with condition (4.2) to show that the limit tendsindeed to 0 (but since our package cannot address such tasks we do not wantto go more into detail here). Hence the principal part is an annihilatingoperator for the sum (in fact the same as found for the left-hand side):

In[51]:= NormalizeCoefficients[ToOrePolynomial[a3Der[t] + a2Der[z] + a1] /. First[sol]]

Out[51]= (−t− iz)Dt + zDz + 1

Most of the subtasks that have been accomplished above are combinedin the command SolveCoupledSystem: It takes as input a coupled systemof difference and/or differential equations, tries to uncouple it, and in the

Page 85: UNIVERSIT AT LINZ JKU - Koutschan

4.5. Rational solutions 85

successful case finds all rational solutions by backwards substitution as wedid before. So for finding a second telescoping relation we can do faster(for the principal part in the ansatz we now choose a differential equation oforder 2 in z as indicated by the supports of lhs):

In[52]:= SolveCoupledSystem[OrePolynomialListCoefficients[OreReduce[a3Der[z]2+a2Der[z]+a1+(S[n]−1)∗∗(c1[n]+c2[n]∗∗S[n]), smnd]],c1, c2, n, ExtraParameters→ a1, a2, a3]

Out[52]=

c1[n]→

C[1](2n2t2 + 3in2tz − n2z2 − nt2 − 3intz + nz2

)2t2 + 3itz − z2

,

a1 →C[1]

(it3z − 3t2z2 + t2 − 3itz3 + z4

)2t2 + 3itz − z2

,

a2 →C[1]z

(−5t2 − 6itz + 2z2

)−2t2 − 3itz + z2

,

a3 → C[1]z2, c2[n]→i(C[1]n2z + C[1]nz

)2t+ iz

After clearing the content in the coefficients of the principal part it is apparentthat the solution coincides with the second annihilating operator of lhs:

In[53]:= NormalizeVector[a3, a2, a1] /. First[%]

Out[53]=

−it3z + 3t2z2 − t2 + 3itz3 − z4,−5t2z − 6itz2 + 2z3,−2t2z2 − 3itz3 + z4

SolveCoupledSystem in principal can also handle mixed difference and

differential systems of equations, and solve them in case that they can beuncoupled. Gaussian elimination over Ore polynomial rings is used for theuncoupling and can be easily performed using our OreGroebnerBasis imple-mentation (we have to work over a module).

For the special case where we have a coupled either difference or dif-ferential system of order 1, there are other algorithms that are designedexactly for such problems. Some of them—like Zurcher’s algorithm [97] oran uncoupling algorithm due to Abramov and Zima [5] —have been imple-mented at RISC by Stefan Gerhold who described them in his thesis [37].From an early stage of development and for testing purposes the packageHolonomicFunctions contains a function SolveOreSys that can find ratio-nal solutions of order 1 systems as they appear in Chyzak’s algorithm, usingGerhold’s package OreSys (but it has to be loaded separately). We also madesome efforts to implement the algorithms by Abramov and Barkatou [3, 11].The commands DSystemSolvePolynomial and DSystemSolveRational forexample compute the polynomial resp. rational solutions of a linear first-order system of differential equations directly. So far only simple systems

Page 86: UNIVERSIT AT LINZ JKU - Koutschan

86 Chapter 4. The HolonomicFunctions Package

(for the definition see [3, 11]) can be treated; there are several algorithms totransform a system that not simple into a simple one [12, 13] but this seemsto be a very cumbersome procedure.

So far we have shown that both sides of identity (4.1) share the sameannihilating ideal. To make the proof rigorous we have to compare initialvalues, which in general can be a tricky and difficult task. So in this example:Since we have a pole for z = 0 we cannot just prove the identity on the formalpower series level. Additionally we have to consider convergence issues dueto condition 4.2. One strategy consists in taking initial values at a differentpoint, e.g., at t = 0 and z = 1, but one has to argue carefully what exactlythen has been proven (compare also our proof of identity (10.2.38) below).We consider such questions as a direction for future research. Another strat-egy consists in reducing the problem to a univariate one by considering onlythe ordinary differential equation in t that is contained in both annihilatingideals. Then initial values are compared by treating z as a parameter; byconvergence considerations it can then be determined for which t, z ∈ C theidentity actually holds. This discussion has been carried out explicitly in [39].

4.6 Summation and Integration

We turn to the implementation of algorithms that are designed for solvingsummation and integration problems: Takayama’s and Chyzak’s algorithm.Using these algorithms we are going to solve four more of Olver’s problems(at least concerning the computer algebra part—we will allow ourselves toleave to the reader some tasks that are not in the scope of our package). Allthe remaining ones are variations of them and can be solved analogously. Incase that you belong to the kind of impatient readers who jumped directlyinto this section, you may consider to learn the basics about how to use thecommand Annihilator described at the end of Section 4.3 (page 77).

Identity (10.1.52)

First we are going to prove the following identity that was among Olver’sproblems [6, 10.1.52] where jn(z) and Si(z) denote the spherical Bessel func-tion of the first kind and the sine integral, respectively:

∞∑n=0

j2n(z) =

Si(2z)

2z. (4.3)

The command for executing Chyzak’s algorithm is CreativeTelescoping. Itcomputes a set of telescoping relations Pi+EQi for a given ∂-finite function.

Page 87: UNIVERSIT AT LINZ JKU - Koutschan

4.6. Summation and Integration 87

The first argument has to be a mathematical expression (like Annihilator ithas the attribute HoldFirst) or a list of Ore polynomials that form a Grobnerbasis of some annihilating ideal. The second argument is the factor E thatappears left to the delta part in the telescoping relation. It describes thenature of the problem: For an integration problem w.r.t. x we set E = Dx,and if we are tackling a sum that runs over n we set either E = Sn − 1or E = ∆n. In the third argument the Ore operators that are intended toconstitute the principal parts Pi are given.

In[54]:= ct= CreativeTelescoping[SphericalBesselJ[n, z]2, S[n]− 1, Der[z]

]Out[54]=

zDz + 1,

z2Dz + (n+ 1)

The only variable that survives the summation is z and hence we get a singletelescoping relation P + (Sn − 1)Q. The output consists of the principalpart P and the delta part Q, and it is easily verified that this telescopingrelation lies indeed in the annihilating ideal of the summand:

In[55]:= OreReduce[ct[[1, 1]] + (S[n]− 1) ∗∗ ct[[2, 1]],Annihilator[SphericalBesselJ[n, z]2]]

Out[55]= 0

Next we have to check whether, after summing over the telescoping relation,the delta part Q • j2

n(z) vanishes.

In[56]:= test = ApplyOreOperator[ct[[2, 1]], SphericalBesselJ[n, z]2

]Out[56]= (n+ 1)SphericalBesselJ[n, z]2 + z

(1

2(SphericalBesselJ[n− 1, z]−

SphericalBesselJ[n+ 1, z])− SphericalBesselJ[n, z]

2z

)SphericalBesselJ[n, z]

We have to evaluate this expression at the summation bounds. For n → ∞this is not so trivial and Mathematica is not able to compute the limit directly.But we can use the asymptotic expansion for large orders for Jn(z), afterrewriting jn(z) in terms of Jn(z). For n = 0 the delta part is nonzero.

In[57]:= Limit[test/. SphericalBesselJ[k , z]→ Sqrt[Pi/(2z)] BesselJ[k + 1/2, z]/. BesselJ[k , z]→ (Ez/(2k)) k/Sqrt[2 Pi k], n→ Infinity]

Out[57]= 0

In[58]:= delta = −FullSimplify[test /. n→ 0]

Out[58]= −Sin[z] Cos[z]

z

Page 88: UNIVERSIT AT LINZ JKU - Koutschan

88 Chapter 4. The HolonomicFunctions Package

This means that we end up with an inhomogeneous equation for the left-handside. It is homogenized by multiplying (from the left) with an annihilatingoperator of the inhomogeneous part:

In[59]:= lhs = First[Annihilator[delta,Der[z]]] ∗∗ ct[[1, 1]]

Out[59]= z2D4z + 7zD3

z + (4z2 + 9)D2z + 12zDz + 4

For the right-hand side an annihilating operator is readily obtained.

In[60]:= rhs = Annihilator[SinIntegral[2z]/(2z), Der[z]]

Out[60]= z2D3z + 5zD2

z + (4z2 + 4)Dz + 4z

The operators are not identical but we find out that the order 4 operator forthe left-hand side is a left multiple of the other one:

In[61]:= OreReduce[lhs, rhs]

Out[61]= 0

Thus by comparing 4 initial values we can complete the proof. We start withthe left-hand side, investigating the derivatives of the summand:

In[62]:= Table[D[SphericalBesselJ[n, z]2, z, k], k, 0, 3] // Together

Out[62]= SphericalBesselJ[n, z]2,

− 1

z(SphericalBesselJ[n, z](−z SphericalBesselJ[n− 1, z] +

SphericalBesselJ[n, z] + z SphericalBesselJ[n+ 1, z]),

1

2z2(z2SphericalBesselJ[n− 1, z]2 − 2z2SphericalBesselJ[n, z]2 +

...

(We have cut the output which takes about one page and continues in asimilar fashion.) Since jn(0) is 0 for all integers n > 0 and the smallest shiftof n in jn(z) that occurs is n− 3, we can safely cut the summation at n = 3.

In[63]:= Limit[Sum[%, n, 0, 3], z → 0]

Out[63]=

1, 0,−4

9, 0

The initial values of the right-hand side match:

In[64]:= Limit[Table[D[SinIntegral[2z]/(2z), z, k], k, 0, 3], z → 0]

Out[64]=

1, 0,−4

9, 0

For reasons of fairness we shall mention that Mathematica evaluates the sumimmediately to the expression on the right-hand side of (4.3).

Page 89: UNIVERSIT AT LINZ JKU - Koutschan

4.6. Summation and Integration 89

Identity (10.2.38)

The next example is the duplication formula for Kn(z), the modified Besselfunction of the second kind, see [6, 10.2.38].

Kn+ 12(2z) =

n!√πzn+ 1

2

n∑k=0

(−1)k(2n− 2k + 1)

k!(2n− k + 1)!K2n−k+ 1

2(z) (4.4)

Mathematica leaves the sum unevaluated. Recapitulating the previous ex-ample we realize that still a lot of work had to be done: Evaluating thedelta part at the boundaries, computing an annihilating ideal for it, and soon, until we ended up with a differential equation for the sum. In manyexamples we can save this time: The functionality of Annihilator has beenextended so that it recognizes also expressions of the form Sum[...] orIntegrate[...] and then internally calls CreativeTelescoping and takescare about the boundaries and possible inhomogeneous parts. Hence we justtype both sides of identity (4.4) into the computer and get:

In[65]:= Annihilator[BesselK[n+ 1/2, 2z], S[n],Der[z]]Out[65]= 4zSn + 2zDz + (−2n− 1), 4z2D2

z + 4zDz + (−4n2 − 4n− 16z2 − 1)

In[66]:= Annihilator[n! Pi (−1/2) z (n+ 1/2) Sum

[(−1)k(2n− 2k + 1)

/k!/(2n−k+1)! BesselK[n−k+1/2, z]2, k, 0, n], S[n],Der[z]

]Out[66]= 4zSn + 2zDz + (−2n− 1), 4z2D2

z + 4zDz + (−4n2 − 4n− 16z2 − 1)

The only thing that has to be done by hand is comparing initial values. Theinitial values that have to be taken into account can be read off from themonomials that lie under the stairs of the Grobner basis of the annihilatingideal. For convenience, we can just take the operators that are returned byUnderTheStaircase and apply them to both sides. After that the substitu-tion has to take place.

In[67]:= uts = UnderTheStaircase[%]

Out[67]= 1, Dz

In[68]:= ApplyOreOperator[uts, BesselK[n+ 1/2, 2z]] /. n→ 0 /. z → 1

Out[68]=

√π

2e2,−5√π

4e2

In[69]:= ApplyOreOperator

[uts, n! Pi (−1/2) z (n+1/2)(−1)k(2n− 2k+ 1)

/k!/(2n− k + 1)! BesselK[n− k + 1/2, z]2]

/. n→ 0 /. k→ 0 /. z → 1 // Together

Out[69]=

√π

2e2,−5√π

4e2

Page 90: UNIVERSIT AT LINZ JKU - Koutschan

90 Chapter 4. The HolonomicFunctions Package

Since Kn(z) has a singularity at z = 0 we decided to compare initial valuesat the point z = 1. The ordinary differential equation in z together with thetwo initial values (for n = 0) guarantees a unique solution that is analytic atz = 1. From this solution the instances for n > 0 can be obtained via thefirst relation. Hence there exists a uniquely defined function that is equalto the expression on either side of (4.4) in a neighborhood around z = 1.The validity of the identity can be extended to a larger region by analyticcontinuation.

Identity (10.1.48)

We continue with a beautiful formula that connects different kinds of Besselfunctions with Legendre polynomials where trigonometric functions appearin the arguments [6, 10.1.48]:

J0(z sin t) =∞∑n=0

(4n+ 1)(2n)!

22n(n!)2j2n(z)P2n(cos t). (4.5)

At first glance one might be tempted to say that neither side is ∂-finite. InSection 2.3 we have proven that the class of ∂-finite functions in continuousvariables is closed under algebraic substitution. But z sin(t) is definitely notalgebraic. As we already feared we do not get annihilating operators bytyping:

In[70]:= Annihilator[BesselJ[0, z Sin[t]], Der[t],Der[z]]DFiniteSubstitute::algsubs : The substitutions for continuous variables

z Sin[t] must be algebraic expressions.

Not all of them are recognized to be algebraic.

Annihilator::nondf : The expression (w.r.t. Der[t], Der[z]) is not recognized to be ∂-finite.

The result will not generate a zero-dimensional ideal.

Out[70]=

But in contrast to Wallis’s integral where the integration took place withrespect to the argument of the cosine, we here can treat t and therefore alsosin(t) and cos(t) as parameters. This is done by omitting the derivative withrespect to t.

In[71]:= lhs = Annihilator[BesselJ[0, z Sin[t]], Der[z]]

Out[71]= zD2z +Dz + z Sin2[t]

This operator was not found in the first try because its coefficients are notrational functions in the given variables t and z, but they are if we consideronly z.

Page 91: UNIVERSIT AT LINZ JKU - Koutschan

4.6. Summation and Integration 91

Now the summand of the right-hand side has to be investigated. Thesquared factorial in the denominator causes the summand to be 0 for neg-ative n. Similarly when n goes to infinity, the summand as well as all itspossible “derivations” (in the sense of application of an operator from the al-gebra) tend to zero. In other words, the sum has natural boundaries and wecan apply Takayama’s algorithm. The corresponding command takes a list ofOre polynomials that constitute a Grobner basis for some annihilating ideal,and a list of variables that have to be eliminated. In standard applicationsthese are just the summation and integration variables.

In[72]:= ann = Annihilator[(4n+ 1)(2n)!/22n/(n!)2 SphericalBesselJ[2n, z]LegendreP[2n,Cos[t]], S[n],Der[z]];

In[73]:= rhs = Takayama[ann, n]Out[73]= −16z5D6

z − 144z4D5z + (16z5Cos[t]2 − 48z5 − 216z3)D4

z +(128z4Cos[t]2 − 288z4 + 120z2)D3

z +(32z5Cos[t]2 + 152z3Cos[t]2 − 48z5 − 240z3 − 45z)D2

z +(128z4Cos[t]2 − 80z2Cos[t]2 − 144z4 + 120z2 − 45)Dz +(16z5Cos[t]2 + 24z3Cos[t]2 + 45zCos[t]2 − 16z5 − 24z3 − 45z)

As it often happens with Takayama’s algorithm we do not find the differ-ential equation of minimal order. We have to test whether it is compatiblewith the left-hand side. We could reduce it with the order 2 differential equa-tion of the left-hand side. Instead, let’s plug in the left-hand side and seewhether it satisfies the order 6 differential equation:

In[74]:= ApplyOreOperator[First[rhs], BesselJ[0, z Sin[t]]] // FullSimplify

Out[74]= 0

Finally 6 initial values have to be computed for both sides.

In[75]:= Table[D[BesselJ[0, z Sin[t]], z, k], k, 0, 5] /. z → 0

Out[75]=

1, 0,−1

2Sin[t]2, 0,

3 Sin[t]4

8, 0

In[76]:= Limit[Table[Sum[D[(4n+1)(2n)!/22n/(n!)2 SphericalBesselJ[2n, z]

LegendreP[2n,Cos[t]], z, k], n, 0, 2], k, 0, 5], z → 0]

Out[76]=

1, 0,−1

2Sin[t]2, 0,

3 Sin[t]4

8, 0

Identity (10.1.41)

As a last example from Olver’s problem set we want to mention a class ofidentities that express the first derivatives of spherical Bessel functions with

Page 92: UNIVERSIT AT LINZ JKU - Koutschan

92 Chapter 4. The HolonomicFunctions Package

respect to the discrete parameter n, evaluated at a certain point, in termsof the sine integral and the cosine integral. They are all very similar, so wecontent ourselves with displaying only one of them [6, 10.1.41] (note thatthere is a misprint in Abramowitz and Stegun’s book: an additional factorπ/2 appears on the right-hand side):

[∂

∂νjν(x)

]ν=0

=1

x(Ci(2x) sinx− Si(2x) cosx)

First we have to notice that in our framework mixing the discrete or con-tinuous nature of a variable is possible only in rare cases, e.g., for rationalfunctions:

In[77]:= Annihilator[(a2 − 1)/(a2 + 1)

]Out[77]= (a4 − 1)Da − 4a, (a4 + 2a3 + a2 − 2a− 2)Sa + (−a4 − 2a3 − a2 − 2a)

But usually it is determined by the input which variables have to be treatedas discrete and which ones as continuous. The spherical Bessel function jn(z)is only ∂-finite with respect to Sn and Dz. There is no other way to make it∂-finite, or in other words there is no P-finite recurrence for jn(z) in n. Sothere is a problem when we want to consider the derivative with respect toa discrete variable: We cannot apply the closure property “application of anoperator” since the Ore operator Dn does not play any role in the annihilatingideal of jn(z). Therefore we proceed by rewriting the left-hand side manuallyin order to fit it into the ∂-finite/holonomic framework. We replace jn(z) by√π/(2z)Jn+1/2(z) and then apply formula (9.1.64) from [6]:

∂νjν(z) =

√π

2z

log(z

2

)Jν+ 1

2(z)−

(z2

)ν+ 12

∞∑k=0

(− z2

4

)kψ(k + ν + 3

2

)k! Γ

(k + ν + 3

2

) .

Now this expression, although it looks quite complicated, can be fed withoutfurther changes into Annihilator, and the right-hand side anyway is no bigchallenge for our package:

In[78]:= lhs = Annihilator[Sqrt[Pi/(2z)] (Log[z/2] BesselJ[1/2, z]−

(z/2) (1/2) Sum[(−z2/4)k PolyGamma[k + 3/2]/k!/Gamma[k + 3/2], k, 0, Infinity]), Der[z]

]Out[78]= z3D6

z + 14z2D5z + (3z3 + 52z)D4

z + (28z2 + 48)D3z + (3z3 + 64z)D2

z +(14z2 + 32)Dz + (z3 + 12z)

Page 93: UNIVERSIT AT LINZ JKU - Koutschan

4.6. Summation and Integration 93

In[79]:= rhs = Annihilator[1/z (CosIntegral[2z] Sin[z]−SinIntegral[2z] Cos[z]), Der[z]]

Out[79]= (12z5 + 5z3)D6z + (144z4 + 70z2)D5

z + (132z5 + 475z3 + 260z)D4z +

(1056z4 + 796z2 + 240)D3z + (228z5 + 1991z3 + 1288z)D2

z +(912z4 + 1110z2 + 560)Dz + (108z5 + 753z3 + 516z)

Both differential equations are of order 6 and obviously not the same. Thissituation is different from the examples before where one annihilating idealwas contained in the other (when they did not even coincide). But they havenontrivial common factors, as a gcd computation via Grobner bases reveals:

In[80]:= OreGroebnerBasis[Join[lhs, rhs]]

Out[80]= z3D4z + 8z2D3

z + (2z3 + 14z)D2z + (8z2 + 4)Dz + (z3 + 6z)

This is a strong indication that the identity is indeed correct. What we haveto do is to test whether the difference of both sides gives zero. We use theclosure property sum to compute a differential equation that is satisfied bythe difference of the two sides (in fact by any K-linear combination of them):

In[81]:= DFinitePlus[lhs, rhs]

Out[81]= (48z5 + 95z3)D8z + (864z4 + 1900z2)D7

z + (576z5 + 5436z3 + 10830z)D6z +

(7968z4 + 23684z2 + 17100)D5z + (1440z5 + 32442z3 + 77002z)D4

z +(13344z4 + 59332z2 + 83448)D3

z + (1344z5 + 33596z3 + 82858z)D2z +

(6240z4 + 31404z2 + 46892)Dz + (432z5 + 6495z3 + 15150z)

It remains to compare 8 initial values which we leave as an exercise to thereader.

Wallis’s integral revisited

Let us return to our first example, Wallis’s integral. In Section 4.1 we haveperformed Takayama’s algorithm step by step. Of course, everything goesautomatically when we use the corresponding command:

In[82]:= Takayama[ToOrePolynomial[−Cos[x]2+S[m],Cos[x] Der[x]+2mSin[x],Sin[x]2+Cos[x]2−1], Sin[x],Cos[x], Extended→ True]

Out[82]= (−2m− 2)Sm + (2m+ 1), Sin[x] Cos[x]

Note that in the second argument we have to give sin(x) and cos(x), thetwo “variables” that we wish to eliminate (usually we would just use x toindicate the integration with respect to that variable). The option Extended

forces the computation of the delta part in the way it was done in Section 4.1(which usually is not very efficient).

Page 94: UNIVERSIT AT LINZ JKU - Koutschan

94 Chapter 4. The HolonomicFunctions Package

Alternatively we can use the powerful Annihilator command in order toget the recurrence at one stroke, after performing the substitution u = cos(x):∫ π

2

0

cos(x)2m dx =

∫ 1

0

u2m

√1− u2

du.

In[83]:= Annihilator[Integrate[u (2m)/Sqrt[1− u2], u, 0, 1], S[m]]

Out[83]= (−2m− 2)Sm + (2m+ 1)

Feynman integrals

Since all Bessel function identities sent by Frank Olver consisted of summa-tion problems only, we want to turn to an integration problem now. In thefollowing it is shown how recursive application of Chyzak’s algorithm cansolve multiple integrals. We want to tie in with a very fruitful cooperationthat takes place between the Research Institute for Symbolic Computation(RISC) and Deutsches Elektronen-Synchrotron (DESY). In the latter insti-tution, research on particle physics and big bang theory is done, for whichpurpose so-called Feynman integrals have to be evaluated. Computer alge-bra could already significantly contribute in the form of Carsten Schneider’sSigma package [78]. We study the double integral∫ 1

0

∫ 1

0

w−1−ε/2(1− z)ε/2z−ε/2

(z + w − wz)1−ε

(1− wn+1 − (1− w)n+1

)dw dz (4.6)

than can be found in [52, (J.17)]. The task is to compute a recurrence in nwhere ε is just a parameter (that we replace by the symbol e for convenience).We are aware of the fact that (4.6) is not a hard challenge for the physicists,and we use it only as a proof of concept here.

For computing an annihilating ideal for the inner integral, we simplyuse the command Annihilator that takes care of the inhomogeneous partautomatically:

In[84]:= expr = w (−1− e/2) (1− z) (e/2) z (−e/2)/(w+ z −w z) (1− e)(1− w (n+ 1)− (1− w) (n+ 1));

In[85]:= ann = Annihilator[Integrate[expr, w, 0, 1], S[n], Der[z]

];

In[86]:= UnderTheStaircase[ann]

Out[86]= 1, Dz, Sn, D2z , SnDz

This result is so big that we do not want to display it here. But it can be usedagain as input to Chyzak’s algorithm, in order to treat the outer integral.

In[87]:= P, Q = CreativeTelescoping[ann, Der[z], S[n]];

Page 95: UNIVERSIT AT LINZ JKU - Koutschan

4.6. Summation and Integration 95

It is a little bit tricky to handle the inhomogeneous part of the outer integralsince it involves an integral itself. In other words, with Q denoting the deltapart that was obtained in the previous computation, we have to evaluate[

Q •∫ 1

0

expr dw

]z=1

z=0

=

∫ 1

0

[Q • expr]z=1z=0 dw. (4.7)

It turns out that the right-hand side of (4.7) is preferable. In the following,we first compute the integrand and investigate it further. It contains sev-eral expressions of the form 0a which we can set to zero, provided that thesymbolic parameter e is not in −2, 0, 2 (which is a realistic assumption).

In[88]:= inh = With[d = Together[ApplyOreOperator[Q, expr]],Together[(d /. z → 1)− (d /. z → 0)]];

In[89]:= Union[Cases[inh, 0 , Infinity]]

Out[89]=

01− e

2 , 0e2

+1, 0e/2

In[90]:= inh /. (0 )→ 0

Out[90]= 0

We find that the integrand of the inhomogeneous part is zero, hence thiswhole part vanishes. Therefore the operator P annihilates the double inte-gral, and this is the desired recurrence in n (which is of order 3):

In[91]:= Factor[P ]

Out[91]= −(e− n− 3)(e− n− 2)(e+ 2n+ 4)(e+ 2n+ 6)S3n +

(e− n− 2)(e+ 2n+ 4)(e2 + 2en+ 5e− 6n2 − 28n− 34)S2n −

(n+ 2)(e3− 3e2n− 6e2− 8en2− 30en− 28e+ 12n3 + 64n2 + 116n+ 72)Sn−2(n+ 1)(n+ 2)2(e− 2n− 2)

Non-holonomic functions

We have already seen in Out[31] that also functions that are not holonomicor ∂-finite can be treated to some extent with our package (although it isnamed HolonomicFunctions!). In Section 2.6 we have mentioned how theclosure properties can be performed for functions that do not possess enoughrelations to be ∂-finite. Now we want to give two examples that are in thespirit of [27]. The handling of initial values is more involved in this settingthan for ∂-finite functions, since we have to consider infinitely many initialvalues.First, we look at the integral that is given as an example in [27]:∫ ∞

0

xa−1 Lin(−xy) dx =π(−a)ny−a

sin(πa)

Page 96: UNIVERSIT AT LINZ JKU - Koutschan

96 Chapter 4. The HolonomicFunctions Package

where Lin(x) denotes n-th polylogarithm. We start by computing an anni-hilating ideal for the integrand that is not ∂-finite but of dimension 1.

In[92]:= ann = Annihilator[xa−1 PolyLog[n,−x y], S[n], Der[x], Der[y]

]Annihilator::nondf : The expression PolyLog[n, -x y] is not recognized to be ∂-finite.

The result will not generate a zero-dimensional ideal.

Out[92]= xDx − yDy + (1− a), ySnDy − 1

In[93]:= AnnihilatorDimension[ann]

Out[93]= 1

Then Chyzak’s algorithm, extended according to [27], delivers an ordinarydifferential equation in y for the whole integral (the delta part vanishes for−1 < a < 0, but this has to be established by hand) which is the same as weobtain for the right-hand side.

In[94]:= CreativeTelescoping[ann, Der[x], Der[y], S[n]

]Out[94]=

yDy + a, −x

In[95]:= Annihilator

[Pi (−a) ny (−a)/Sin[aPi], Der[y]

]Out[95]= yDy + a

In this example the initial values are easily compared since both sides give 0for y = 0. The second non-holonomic example is the summation identity

n∑k=0

(k

m

)S(n, k)(x− k +m+ 1)k−m =

n∑k=0

(n

k

)S(k,m)xn−k

where (x)k = x(x + 1) · · · (x + k − 1) denotes the Pochhammer symbol orrising factorial, and S(n, k) the Stirling numbers of the second kind. Theannihilating ideals for the two sums can be computed in a nearly completelyautomatic fashion. Only the additional information that Mathematica needsfor evaluating the inhomogeneous parts, has to be figured out by hand: in thefirst case it suffices to state that n is a natural number, in the second instancewe have to tell Mathematica about the Stirling recurrence—otherwise it doesnot simplify the inhomogeneous part (which would lead to a far too bigannihilating ideal).

In[96]:= lhs = Annihilator[Sum[Binomial[k,m]

Pochhammer[x− k +m+ 1, k −m] StirlingS2[n, k], k, 0, n],S[m],S[n], Assumptions→ Element[n, Integers] && n ≥ 0

]Annihilator::nondf : The expression StirlingS2[n, k] is not recognized to be ∂-finite.

The result will not generate a zero-dimensional ideal.

Out[96]= SmSn + (−m− x− 1)Sm − 1

Page 97: UNIVERSIT AT LINZ JKU - Koutschan

4.7. q-Identities 97

In[97]:= rhs = Annihilator[Sum[Binomial[n, k] x (n− k) StirlingS2[k,m],

k, 0, n], S[m],S[n], Assumptions→ StirlingS2[n,m] +(m+ 1) StirlingS2[n,m+ 1]− StirlingS2[n+ 1,m+ 1] == 0

]Annihilator::nondf : The expression StirlingS2[k, m] is not recognized to be ∂-finite.

The result will not generate a zero-dimensional ideal.

Out[97]= SmSn + (−m− x− 1)Sm − 1

The result indicates that we have to compare initial values for m = 0 andarbitrary n, as well as for n = 0 and arbitrary m. This means that infinitelymany cases have to be checked, which can be achieved without problems inthis instance. For m = 0 we obtain

n∑k=0

(x− k + 1)kS(n, k) = xn =n∑k=0

(n

k

)xn−k

and for n = 0 the identity reduces to(0

m

)(x+m+ 1)−m = S(0,m)

which is 1 for m = 0 and 0 otherwise. This concludes the proof.

4.7 q-Identities

To finish this series of examples we would like to demonstrate how q-identitiescan be treated with HolonomicFunctions. These kinds of identities containan extra parameter q that is assumed to be a transcendental element, inparticular no root of unity. For many classical combinatorial identities thereexist q-analogs, i.e., identities that reduce to the classical one when q isset to 1. This aspect of HolonomicFunctions continues the tradition ofthe RISC combinatorics software of always having a strong emphasis on q-calculus. The following identity can be found in [64, Formula (56)]; it is oneof the finite forms of the Gollnitz-Gordon identities:

∞∑j=−∞

(−1)jq4j2−3j

[2l + 1j + l

]q2

= (q2l+2; q2)l+1

∞∑j=0

q2j2+2j

(−q; q2)j+1

[lj

]q2

where (a; q)m = (1 − a)(1 − aq) · · · (1 − aqm−1) denotes the q-Pochhammersymbol and [

nk

]q

=(q; q)n

(q; q)k(q; q)n−k

Page 98: UNIVERSIT AT LINZ JKU - Koutschan

98 Chapter 4. The HolonomicFunctions Package

denotes the q-binomial coefficient.

Note that the summations could as well be performed with qZeil [68], animplementation of a q-version of Zeilberger’s fast algorithm. For univariateclosure properties in the q-world, the package qGeneratingFunctions [47]is available. Since both sums have finite support we can perform creativetelescoping without having to care about the delta part (recall that J and Lreplace the expressions qj and ql, respectively:

In[98]:= lhs = First[CreativeTelescoping

[(−1) j q (4j 2− 3j) QBinomial[2l+ 1, l+ j, q 2],QS[J, q j]− 1,QS[L, q l]

]]Out[98]=

S4L,q +

(L8q33 + L8q31 + L4q20 + L4q18 − q6 − q4 − q2 − 1

)S3L,q +(

L16q56 +L8q36 +L8q34 +L8q32−L4q24−2L4q22−3L4q20−2L4q18−L4q16−L4q14 + q10 + q8 + 2q6 + q4 + q2

)S2L,q +(

−L20q64−L20q62 +L16q54 +L16q52 +L16q50 +L16q48 +L12q48 +L12q46 +L12q44 +L12q42−L8q38−2L8q36−3L8q34−3L8q32−3L8q30−2L8q28−L8q26−L8q24 +L4q26 + 2L4q24 + 3L4q22 + 3L4q20 + 2L4q18 + 2L4q16 +L4q14 − q12 − q10 − q8 − q6

)SL,q +(

L24q66 − L20q62 − L20q60 − L20q58 − L20q56 − L20q54 − L20q52 + L16q56 +L16q54 + 2L16q52 + 2L16q50 + 3L16q48 + 2L16q46 + 2L16q44 + L16q42 +L16q40 − L12q48 − L12q46 − 2L12q44 − 3L12q42 − 3L12q40 − 3L12q38 −3L12q36−2L12q34−L12q32−L12q30 +L8q38 +L8q36 +2L8q34 +2L8q32 +3L8q30 + 2L8q28 + 2L8q26 + L8q24 + L8q22 − L4q26 − L4q24 − L4q22 −L4q20 − L4q18 − L4q16 + q12

)In[99]:= ct = First

[CreativeTelescoping

[q (2j 2 + 2j)

QBinomial[l, j, q 2]/QPochhammer[−q, q 2, j + 1],QS[J, q j]− 1,QS[L, q l]

]]Out[99]=

(− L2q5 − 1

)S2L,q +

(L4q8 + L2q5 − L2q4 + q2 + 1

)SL,q +

(L2q4 − q2

)In order to obtain a recurrence for the right hand side, we compute an an-nihilating ideal of the extra factor (q2l+2; q2)l+1 and use the closure propertyproduct:

In[100]:= ann = Annihilator[QPochhammer[q (2l+ 2), q 2, l+ 1],QS[L, q l]

]Out[100]=

SL,q +

(L6q8 + L4q6 − L2q2 − 1

)In[101]:= rhs = DFiniteTimes[ann, ct]

Out[101]=

S2L,q+

(L8q17+L6q14−L6q12+L4q11+L4q10−L4q9+L2q7−L2q6−q2−1

)SL,q+(

−L12q21−L10q17+L10q16+L8q17+L8q15+L8q12+L6q13−L6q12+L6q11−L6q10 − L4q11 − L4q8 − L4q6 − L2q7 + L2q6 + q2

)We end up with two different recurrences. We can now use the closure

Page 99: UNIVERSIT AT LINZ JKU - Koutschan

4.8. Interface to Singular/Plural 99

property sum to get an operator that annihilates either side; it turns outthat it is the same as we computed already for the left-hand side. Thismeans that it is a left multiple of the recurrence for the right-hand side.

In[102]:= GBEqual[DFinitePlus[lhs, rhs], lhs]

Out[102]= True

In[103]:= OreReduce[lhs, rhs]

Out[103]= 0

Hence we have to compare 4 initial values:

In[104]:= Table[Sum

[(−1) j q (4j 2− 3j) QBinomial[2l+ 1, l+ j, q 2],j,−l, l+ 1

]==

QPochhammer[q (2l+ 2), q 2, l+ 1]Sum

[q (2j 2 + 2j) QBinomial[l, j, q 2]/QPochhammer[−q, q 2, j + 1], j, 0, l

],

l, 0, 3]// FullSimplify

Out[104]= True, True, True, True

4.8 Interface to Singular/Plural

Computing Grobner bases is a very costly task, especially in noncommuta-tive polynomial rings. And since this task is only a subproblem in the al-gorithms that are contained in HolonomicFunctions, our main concern wasnot to make this implementation of Buchberger’s algorithm the fastest in theworld; using an interpreter language, in our case that of Mathematica, thisanyway seems to be a hopeless undertaking. Ergo we have to admit that ourOreGroebnerBasis cannot compete with special purpose computer algebrasystems like Singular [43] and its noncommutative extension Plural [57, 55].The idea therefore was to provide an interface between HolonomicFunctions

and Singular/Plural that enables the user to switch to the special purposesystem for heavy computations. Manuel Kauers and Viktor Levandovskyyhave written such an interface for commutative Grobner bases and relatedcomputations [50]. We have extended this piece of software such that itcan also translate objects of type OrePolynomial into polynomials in thecorresponding noncommutative ring in Plural. This works already fine forcomputations in purely polynomial algebras like the Weyl algebra.

But in contrast to the Weyl algebra, the noncommutativity in a rationalOre algebraK(x)[∂x;σx, δx] is between the “variables” ∂1, ∂2, . . . of the skewpolynomial ring and its coefficients. It was a basic prerequisite in the design

Page 100: UNIVERSIT AT LINZ JKU - Koutschan

100 Chapter 4. The HolonomicFunctions Package

of Singular from the very beginning, that the coefficients commute with thevariables that generate the polynomial ring.

During two visits to RISC, Viktor Levandovskyy and Hans Schonemannworked hard on an extension of the Singular kernel that enables computa-tions in rational Ore algebras. At the moment a prototype version is testedwhich will be included into one of the forthcoming Singular distributions. Wealso plan to include our interface between HolonomicFunctions and Singu-lar/Plural into [50].

Page 101: UNIVERSIT AT LINZ JKU - Koutschan

Chapter 5

Proof of Gessel’s Lattice PathConjecture

In this chapter we want to describe how the methods that were subject of theprevious chapters could successfully be used to prove a conjecture about theenumeration of certain lattice paths that was open for several years (DoronZeilberger named it “the holy grail for lattice-walk-counters” [51]). Theresults presented below evolved from a collaboration with Manuel Kauersand Doron Zeilberger and have recently been published in the prestigiousjournal PNAS [49].

5.1 Gessel walks

We start by introducing some basic notions. The objects that we are goingto study are walks in the integer lattice N2 that start at the origin (0, 0) anduse only unit steps from the step set

G :=

(−10

),

(10

),

(−1−1

),

(11

)= ←,→,,.

Of course we demand that a walk does not leave the first quadrant N2. Suchwalks we want to call Gessel walks ; an example is depicted in Figure 5.1.

Throughout this chapter we want to use the symbol f(n; i, j) with i, j, n ∈N to denote the number of Gessel walks that consist of exactly n steps, startat (0, 0) and end at the point (i, j).

The conjecture that we are going to prove is about the enumeration ofsuch Gessel walks and has been formulated by Ira Gessel around the year2001. Unfortunately he did not publish it anywhere, but nevertheless it wasspread inside the combinatorial community and several people worked on it.

101

Page 102: UNIVERSIT AT LINZ JKU - Koutschan

102 Chapter 5. Proof of Gessel’s Lattice Path Conjecture

r r r r rr r r r rr r r r rr r r r rr r r r r

-

6

- - -

Figure 5.1: Example of a closed Gessel walk

In short Gessel conjectured that f(n; 0, 0), the number of closed Gessel walksthat return to the origin after n steps, can be computed by the innocent-looking formula

f(n; 0, 0) =

16k (5/6)k(1/2)k

(2)k(5/3)kif n = 2k

0 if n is odd

5.2 Transfer to the holonomic world

When just reading the statement of Gessel’s conjecture it is not immediatelyclear how the techniques related to the holonomic systems approach can beapplied. Before doing so we have to reformulate the problem and the keyfor that is the quantity f(n; i, j) which is more general than needed to statethe conjecture. But this generality makes it easier to characterize it viarecurrence relations.

Looking at the steps ←,→,, that are allowed in Gessel walks, avery simple recurrence for f(n; i, j) can be readily read off. Consider a certainpoint in (i, j) ∈ N2 and assume that this point was reached with exactly nsteps. We can express the number of possible paths by considering all pointsthat are candidates for the previous position (see Figure 5.2):

f(n; i, j) = f(n− 1; i+ 1, j) + f(n− 1; i− 1, j) +f(n− 1; i+ 1, j + 1) + f(n− 1; i− 1, j − 1).

(5.1)

Having only this single recurrence at hand we are still far away from a∂-finite description of the function f(n; i, j). Moreover it is not at all clear

Page 103: UNIVERSIT AT LINZ JKU - Koutschan

5.2. Transfer to the holonomic world 103

r r r rr r r rr r r rr r r r

u(i, j)-

Figure 5.2: Four possibilities to reach the point (i, j) with a single step.

a priori whether such a description exists (in fact, this question was open aswell and has been answered only very recently by Alin Bostan and ManuelKauers [20] who proved that the trivariate generating function of f(n; i, j) iseven algebraic!). Also note that with a single operator we cannot do much(no recombination, elimination, summation, etc.). So we wish to have morerecurrences and the question is how to find these. The answer is: withguessing!

What sounds as a joke at the first glance turns out to be a serious andvery powerful technique. The basic ingredient is an ansatz with unspecifiedcoefficients for a linear recurrence with polynomial coefficients. The prereq-uisite is that sufficiently many values of the sequence in question are known.Plugging them into the ansatz yields a linear system that has to be solvedin the end. This method has deserved the name guessing for the reason thatthere is some uncertainty in it: There is no guarantee that guessed recur-rences are indeed correct. We only know that they describe our sequence upto the limit to which we provided concrete values. But who knows how thesequence proceeds beyond them? The more values we provide the higher isthe probability that a guessed recurrence is correct, but we can never be 100%sure. Summarizing, we have to prove separately that the guessed recurrencesare indeed correct!

The guessing was conducted by Manuel Kauers with his powerful Mathe-matica package Guess [46]. The result is a set of 68 recurrences and each ofthem—except the one from above—fills several lines or even pages. For thatreason and to save paper, we do not print them here.

Instead we present a simple procedure how to prove their correctness. Ithas to be noted that this method is very particular and is applicable only toa very restricted class of problems. Let

O = Q(n, i, j)[Sn;Sn, 0][Si;Si, 0][Sj;Sj, 0]

Page 104: UNIVERSIT AT LINZ JKU - Koutschan

104 Chapter 5. Proof of Gessel’s Lattice Path Conjecture

and letT = SnSiSj − S2

i Sj − Sj − S2i S

2j − 1

be the simple recurrence (5.1). Given some operator R ∈ O we want todecide whether R • f(n; i, j) = 0 or not.

We will argue that it suffices to show that (TR) • f = 0, because then itcan be algorithmically decided whether also R•f = 0. Saying (TR)•f = 0 isequivalent to the assertion that R•f satisfies the recurrence T . But R•f = 0if and only if all the initial values (R•f)(0; i, j) are zero. The crucial propertywith such problems coming from restricted lattice walks is that f(n; i, j) = 0for i > n or j > n, so we are left with only finitely many values to check!

By a division with remainder computation we obtain

TR = UT + V

where the remainder V is of smaller total degree with respect to the variablesn, i, j. This can easily be seen by—without loss of generality—consider R tobe a single term of the form p(n, i, j)SanS

bi S

cj . Then

TR = p(n+ 1, i+ 1, j + 1)Sa+1n Sb+1

i Sc+1j − p(n, i+ 2, j + 2)SanS

b+2i Sc+2

j − . . .

Viewing the first displayed term as the leading one (this can be achieved bya lexicographic monomial order for example), the quotient will be

U = p(n+ 1, i+ 1, j + 1)SanSbi S

cj

and it is now obvious that the degree in the coefficients of the remainderdrops.

Since (UT ) • f = 0 for sure, we reduced the problem: TR • f = 0 ifand only if V • f = 0. We continue recursively with TV knowing that afterfinitely many steps we will end up with remainder 0. This completes therecurrence proving algorithm; it is needless to say that we applied it to all68 guessed candidate recurrences with affirmative result.

5.3 The quasi-holonomic ansatz

Let I ⊂ O be the left ideal that is generated by the 68 recurrences that weguessed in the previous section. The quasi-holonomic ansatz proposed in [51]consists in finding an operator R ∈ I that has the special form

R(n, i, j, Sn, Si, Sj) = P (n, Sn) + iQ1(n, i, j, Sn, Si, Sj) + jQ2(n, i, j, Sn, Si, Sj).(5.2)

Page 105: UNIVERSIT AT LINZ JKU - Koutschan

5.4. Takayama’s algorithm adapted 105

By construction, the operator R annihilates f(n; i, j). If we now seti = j = 0 the only part that will survive is P (n, Sn), which then will bean annihilating operator of f(n; 0, 0). As soon as we have such a univariaterecurrence, it is an easy routine exercise to rigorously proving or disprovingGessel’s conjecture.

My colleague Manuel Kauers tried his Guess package in order to guessthis operator R. By means of modular computations he found out that if itreally exists, then R must be bigger than what nowaday’s computers couldcope with.

5.4 Takayama’s algorithm adapted

The fact that by setting i = j = 0 in equation (5.2) the two parts withQ1 and Q2 will vanish suggests to tackle the problem with a Takayama-likeapproach. Recall that Takayama’s algorithm (see Section 3.2) computes theprincipal part of a telescoping relation without caring about the delta parts.For that reason one has to ensure natural boundaries in order to make theinhomogeneous parts vanish. In the quasi-holonomic ansatz we are in aneven more comfortable position: The “delta parts” will vanish and we donot have to care about any extra condition.

So instead of computing the full operator R and then setting i = j = 0,we first substitute i = j = 0 and then compute the “principal part” Pby eliminating Si and Sj. Hence the only difference to Takayama’s originalalgorithm is that here somehow the roles of the shift operators Si and Sj andcorresponding variables i and j are interchanged. Still we have to care aboutthe noncommutativity and shall not allow multiplication by either Si or Sjafter the substitution i = j = 0. As before this is achieved by translatingthe operators to elements in a module, the positions of whose elements beingin correspondence with the power products Sαi S

βj . For example, the simple

recurrence (5.1)

SnSiSj − S2i Sj − Sj − S2

i S2j − 1

translates to

(−1,−1, 0, 0, Sn, 0, 0,−1,−1)T

when going up to degree 2 in both Si and Sj. Finally we have to compute aGrobner basis with position over term ordering to get and element with zeroentries except in the first position, corresponding to an operator P free of Siand Sj.

Page 106: UNIVERSIT AT LINZ JKU - Koutschan

106 Chapter 5. Proof of Gessel’s Lattice Path Conjecture

5.5 Results

Following the lines of the previous section we carried out the necessarycomputation with our package HolonomicFunctions. They are quite time-consuming and therefore we first experimented with modular Grobner bases,i.e. using the option Modulus -> p in OreGroebnerBasis we calculate withthe coefficient domain Zp(n) instead ofQ(n) and get information about whichinput (a selection of the 68 recurrences) and which pair selection strategyin Buchberger’s algorithm deliver the desired P (n, Sn) in shortest time (itturned out that our elimination strategy was superior here). Moreoverwe can record during the modular run, which pairs reduced to zero andomit them in the final computation over Q(n). Another means to shortenBuchberger’s algorithm is to set the option Incomplete -> True. The ef-fect is that Buchberger’s algorithm is interrupted as soon as an element thatmatches the desired elimination property. Of course it is not guaranteed thenthat this element is the minimal one that lies ideal generated by the input.Sometimes however, like in the application that we have in mind here, thisdoes not hurt much. If we have to compare 10 initial values in the end or20, we do not really care, since we can easily compute the number of Gesselwalks for moderate-sized number of steps (for other applications it may wellby that this is not the case!).

Finally the computation took around 7 hours and delivered an operatorP (n, Sn) annihilating f(n; 0, 0) of impressive size (order 32, polynomial co-efficients of degree 172 and therein integers with up to 385 decimal digits).With the computer it is now easily verified that this monstrous recurrenceoperator also annihilates

g(n; 0, 0) :=

16k (5/6)k(1/2)k

(2)k(5/3)kif n = 2k

0 if n is odd

We now have to compare initial values, in other words we have to inspectwhether f(n; 0, 0) = g(n; 0, 0) for 0 ≤ n ≤ 31 (this is indeed the case).Finally we have to make sure that the leading coefficient of P (n, Sn) (and allpolynomial contents that have been cancelled out during the computation) donot introduce singularities, i.e., do not have positive integer roots. In orderto get a handle on the contents that during the run of Buchberger’s algorithmare tacitly canceled, the are stored in the variable GlobalNormalizeFactors.The fact that all these polynomials have only negative integer roots concludesour rigorous computer proof of Gessel’s conjecture.

The natural question that arises is whether this computational effort isreally necessary, or whether it should not be possible to prove this simply-

Page 107: UNIVERSIT AT LINZ JKU - Koutschan

5.6. Related conjectures 107

stated conjecture in a more direct way by hand. Since so far, our proof isthe only one, we don’t know. But Doron Zeilberger [49] offers a bet on it:

I offer a prize of one hundred (100) US-dollars for a short, self-contained, human-generated (and computer-free) proof of Ges-sel’s conjecture, not to exceed five standard pages typed in stan-dard font. The longer that prize would remain unclaimed, themore (empirical) evidence we would have that a proof of Gessel’sconjecture is indeed beyond the scope of humankind.

5.6 Related conjectures

In 2008 also Marko Petkovsek and Herb Wilf worked on Gessel’s conjecture.In their report [71] they state a bunch of conjectures that are related toGessel’s and that we want to investigate in this section.

The first two conjectures of Petkovsek and Wilf concern other specialcases of the general path counting function f(n; i, j), namely f(2n; 0, 1) andf(2n+ 1; 1, 0), which count the number of Gessel walks that end at (0, 1) or(1, 0) respectively. For the first they conjecture the closed form formula

f(2n; 0, 1) = 16n(1/2)n(3)n

((111n2 + 183n− 50) (5/6)n

270(8/3)n+

5(7/6)n27(7/3)n

)and for the latter they conjecture that it satisfies the second order recurrence

(n+ 3)(3n+ 7)(3n+ 8) g(n+ 1)−8(2n+ 3)(18n2 + 54n+ 35) g(n)

+256n(3n+ 1)(3n+ 2) g(n− 1) = 0.

We have proven both conjectures in the same way as we did Gessel’s. Omit-ting the details here, we just want to mention that the computations did notbecome smaller compared to the case f(n; 0, 0) but grew.

In the same article [71] Marko Petkovsek and Herbert Wilf conjecturedthat h(n) := f(2n; 2, 0) is not holonomic. With our approach we were ableto disprove this conjecture! In fact, we could prove that h(n) satisfies therecurrence

0 = 4096(n+1)(2n+1)(2n+3)(3n+4)(3n+5)(6n+5)(6n+7) p1(n)h(n)

−128(2n+ 3) p2(n)h(n+ 1) + 48(n+ 4) p3(n)h(n+ 2)

−8(n+ 4)(n+ 5)(3n+ 13)(3n+ 14) p4(n)h(n+ 3) +

(n+4)(n+5)(n+6)(3n+13)(3n+14)(3n+16)(3n+17) p5(n)h(n+ 4)

Page 108: UNIVERSIT AT LINZ JKU - Koutschan

108 Chapter 5. Proof of Gessel’s Lattice Path Conjecture

that was guessed by Manuel Kauers with help of the computer. In order topresent a clear arrangement, we abbreviated some nasty irreducible factorsof higher degree:

p1(n) = 6144n7 + 130560n6 + 1169216n5 + 5718720n4 + 16490716n3+28015035n2 + 25933899n+ 10077210,

p2(n) = 31850496n13 + 1043103744n12 + 15528112128n11+139066675200n10 + 835537836288n9 + 3554184658752n8+11003992594864n7 + 25083927328960n6 + 42052581871616n5+51138759649954n4 + 43770815405708n3 + 24915467579665n2+8429189779675n+ 1274964941250,

p3(n) = 15925248n13 + 561364992n12 + 9001764864n11 + 86874808320n10+562452019584n9 + 2576877461856n8 + 8584177057392n7+21020268432120n6 + 37767656881868n5 + 49065078284877n4+44671143917844n3 + 26891118085035n2 + 9545234776900n+1498120123500,

p4(n) = 442368n10 + 11612160n9 + 133731840n8 + 888142080n7+3758533024n6 + 10562908440n5 + 19901273510n4+24718969695n3 + 19263730233n2 + 8437822050n+ 1558180800,

p5(n) = 6144n7 + 87552n6 + 514880n5 + 1616000n4 + 2911836n3+2992423n2 + 1606825n+ 341550.

Page 109: UNIVERSIT AT LINZ JKU - Koutschan

Chapter 6

Applications in Numerics

A domain which is quite far away from symbolic computation and computeralgebra but in which our package HolonomicFunctions can be very fruit-fully applied, are finite element methods (FEM) in numerical analysis. Thesemethods serve to approximate the solution of a partial differential equationon a given domain Ω ⊆ Rd subject to certain constraints, e.g., boundaryconditions. The domain Ω is decomposed into a set of finite elements, thatare just intervals when working in one dimension and that can be triangles ortetrahedra for example when working in dimension 2 or 3 respectively. Us-ing the concept of weak derivative—that is a generalization of the derivativein the classical sense to nondifferentiable functions—the original problem istransformed to a variational formulation. In order to obtain this formulationthe original equation is multiplied by a smooth test function v, then inte-grated over Ω and simplified by partial integration. Two main reasons fordoing so are that the order of the partial differential equation is decreased bypassing to the weak formulation and that one now can look for solutions in aSobolev space V that admits also non-smooth solutions. After this reformu-lation usually the task consists in finding solutions u ∈ V of a(u, v) = F (v)for all v ∈ V , for some bilinear form a and some linear form F . This problemnow is discretized by approximating the infinite-dimensional space V by somefinite-dimensional space that is spanned by a finite set of basis functions. Bythat the variational formulation translates into a linear system that has tobe solved. The basis functions are chosen in a way that they have localsupport, for example being nonzero only on a small patch of neighboringelements, and therefore they are typically defined to be piecewise polynomialfunctions. Furthermore they influence the sparsity of the linear system thatin the end has to be solved. It turned out that orthogonal polynomials servethis goal perfectly in many instances. This is the point where computeralgebra can contribute valuable results: Computing relations for the basis

109

Page 110: UNIVERSIT AT LINZ JKU - Koutschan

110 Chapter 6. Applications in Numerics

functions may help in building the system matrix, and providing recurrencesfor the matrix entries can show that most of them are zero. Being not at allan expert in finite element methods we would like to refer to [73] where theinterested reader can find an excellent and easy-to-read introduction to thesubject (this paragraph also followed this exposition).

6.1 Small examples

A Jacobi polynomial identity

This section contains some identities that are easily derived with our packageHolonomicFunctions and which are useful for mathematicians working innumerics. Veronika Pillwein was so kind to communicate these formulas tous. We start with a relation for the Jacobi polynomials that can be found inher thesis [73, Formula (4.7)]:

(2n+ a+ b)P (a−1,b)n (x) = (n+ a+ b)P (a,b)

n (x)− (n+ b)P(a,b)n−1 (x).

In order to find this relation automatically we have to formulate the problemfirst, for example: For P

(a,b)n (x) find a mixed recurrence with shifts in a and n,

whose coefficients are free of x. This can be seen as an elimination problem:Find an operator in the annihilating ideal of P

(a,b)n (x) that is free of Sb, Dx

and x. This problem can be solved by means of Grobner bases. We have toinclude the variable x into the generators of the algebra, because otherwisewe don’t have a handle on it with the monomial order (but recall that becauseof extension/contraction we are not guaranteed to find the smallest operatoror to succeed at all by such an approach):

In[105]:= jac = Annihilator[JacobiP[n, a, b, x], S[n], S[a], S[b], Der[x]

]Out[105]= (a+ b+ n+ 1)Sb + (1− x)Dx + (−a− b− n− 1),

(a+ b+ n+ 1)Sa + (−x− 1)Dx + (−a− b− n− 1),(2an+ 2a+ 2bn+ 2b+ 2n2 + 4n+ 2)Sn + (−ax2 + a− bx2 + b− 2nx2 + 2n−

2x2 + 2)Dx + (a2(−x)− a2 − 2abx− 3anx− an− 3ax− a− b2x+ b2 −3bnx+ bn− 3bx+ b− 2n2x− 4nx− 2x),

(x2 − 1)D2x + (ax+ a+ bx− b+ 2x)Dx + (−an− bn− n2 − n)

In[106]:= First[OreGroebnerBasis[jac, OreAlgebra[x, S[b],Der[x], S[n], S[a]],MonomialOrder→ EliminationOrder[3]]]

Out[106]= (−a− b− n− 2)SnSa + (a+ b+ 2n+ 3)Sn + (b+ n+ 1)Sa

In this simple example, elimination via Grobner basis worked fine, but ingeneral the command FindRelation is preferable for such problems:

Page 111: UNIVERSIT AT LINZ JKU - Koutschan

6.1. Small examples 111

In[107]:= FindRelation[jac, Eliminate→ x, Pattern→ , , 0, 0]Out[107]= (−a− b− n− 2)SnSa + (a+ b+ 2n+ 3)Sn + (b+ n+ 1)Sa

In the above input line the pattern , , 0, 0 tells that only exponent vectorsare taken into account where the first two positions can contain anything butthe last two, which correspond to Sb and Dx, have to be 0. Of course, wecould also start differently by computing an annihilating ideal for P

(a,b)n (x)

with respect to Sn and Sa only, and then eliminate x.There is a different way to formulate the problem, namely to ask for an

operator with a certain support. We have seen that the relation that we arelooking for, involves the monomials Sa, Sn, and SaSn. We can specify thiscondition with the option Support:

In[108]:= FindRelation[jac, Support→ S[a], S[n], S[a] S[n]

]Out[108]= (a+ b+ n+ 2)SnSa + (−a− b− 2n− 3)Sn + (−b− n− 1)Sa

Integrated Jacobi polynomials

As a second example we want to turn to integrated Jacobi polynomials thatwere introduced in [18, 17] for constructing sparse shape functions for tetra-hedral p-FEM. They are defined via

pan(x) :=

∫ x

−1

P(a,0)n−1 (s) ds. (6.1)

In order to find relations for pan(x), we first need to compute an annihilatingideal for it. Unfortunately this cannot be achieved completely automatic(by typing Annihilator of the integral expression), because Mathematicaspends too much time in simplifying the inhomogeneous part. So we have towork a little bit and first compute a creative telescoping relation for (6.1):

In[109]:= ann = Annihilator[JacobiP[n− 1, a, 0, x], Der[x], S[n], S[a]

];

In[110]:= ct = CreativeTelescoping[ann, Der[x], S[n], S[a]

]Out[110]=

1,

a+ n− ax− nxn(−1 + a+ n)

Sa +−2a− n+ nx

n(−1 + a+ n)

Now we have to care about the inhomogeneous part. For the lower bound wecan easily convince ourselves that P

(a,0)n (−1) does not depend on a. Hence Sa

can be replaced by 1 in the delta part and we find that the lower bound doesnot contribute to the inhomogeneous part.

In[111]:= Annihilator[JacobiP[n− 1, a, 0,−1]

]Out[111]= Sn + 1, Sa − 1

Page 112: UNIVERSIT AT LINZ JKU - Koutschan

112 Chapter 6. Applications in Numerics

In[112]:= OrePolynomialSubstitute[ct[[2, 1]], S[a]→ 1, x→ −1

]Out[112]= 0

Applying the delta part to the integrand (we bypassed the extra substitutions → x) thus gives the inhomogeneous part, and an annihilating ideal for itcan be obtained by using the closure property DFiniteOreAction. Since theprincipal part was 1 this ideal does already annihilate the whole integral.

In[113]:= phat = DFiniteOreAction[ann, ct[[2, 1]]

]Out[113]=

(2 + 2n)Sn + (a+ 2n− ax− 2nx)Sa + (2− 2a− 2n),(1 + x)Dx + (−a− n)Sa + (−1 + a+ n),(−1− a− n+ x+ ax+ nx)S2

a + (3a+ 2n− ax− 2nx)Sa + (2− 2a− 2n)

A useful property of the integrated Jacobi polynomial—breakbefores isthat they can be written in terms of the original Jacobi polynomials whereatthis relation is free of the variable x and shifts are only taken with respect to n(see [17, Formula (12)]). With FindRelation this identity is immediately

recovered, where we make use of the fact that Dx • pan(x) = P(a,0)n−1 (x):

In[114]:= Factor[FindRelation

[phat, Eliminate→ x, Pattern→ , , 0

]]Out[114]=

2(a+ n+ 1)(a+ 2n)DxS

2n + 2a(a+ 2n+ 1)DxSn − 2n(a+ 2n+ 2)Dx −

(a+ 2n)(a+ 2n+ 1)(a+ 2n+ 2)Sn

As a last example of this type we want to derive automatically the recur-rence relation for pan(x) that is given in [17, Formula (14)], and we observethat the result matches exactly:

In[115]:= ApplyOreOperator[First

[FindRelation

[phat,Pattern→ 0, , 0

]],

ph[n]]/. n→ n− 2 // FullSimplify

Out[115]= 2(−2 + n)(−3 + a+ n)(−2 + a+ 2n) ph[−2 + n]−(−3 + a+ 2n)((−2 + a)a+ (−4 + a+ 2n)(−2 + a+ 2n)x) ph[−1 + n] +2n(−1 + a+ n)(−4 + a+ 2n) ph[n]

6.2 Simulation of electromagnetic waves

The rest of this chapter is dedicated to some results that arose from a jointwork with Joachim Schoberl (RWTH Aachen). The goal is to simulate thepropagation of electromagnetic waves for which he uses high order discontin-uous Galerkin finite elements. The results of these simulations can be appliedfor example for constructing antennas of mobile phones, car radios, etc. Someinventions in this context that make use of our symbolically derived formulas,are considered to be registered as a patent.

Page 113: UNIVERSIT AT LINZ JKU - Koutschan

6.3. Relations for the basis functions 113

We want to approximate the electric field E = (Ex(t), Ey(t), Ez(t)) andthe magnetic field H = (Hx(t), Hy(t), Hz(t)) in 3D space. For that purposewe use Maxwell’s equations in free space:

∂H

∂t= −∇×E

∂E

∂t=

1

µ0ε0

∇×H

where ε0 and µ0 are the electric and the magnetic constant respectively, andwhere ∇×F denotes the curl operator (also known as rotor) which is definedto be

∇× F =

(∂

∂x,∂

∂y,∂

∂z

)× (Fx, Fy, Fz)

=

(∂Fz∂y− ∂Fy

∂z,∂Fx∂z− ∂Fz

∂x,∂Fy∂x− ∂Fx

∂y

).

As described above, the unknown quantities are approximated by polyno-mial basis functions using orthogonal polynomials. The basis functions aredenoted by ϕi,j,k(x, y, z), and in this application it turned out to be useful todefine them as follows:

ϕi,j,k(x, y, z) = ui(x, y, z)vi,j(x, y)wi,j,k(x), where

ui(x, y, z) = Pi

(2z

(1− x)(1− y)− 1

)(1− x)i(1− y)i,

vi,j(x, y) = P(2i+1,0)j

(2y

1− x− 1

)(1− x)j,

wi,j,k(x) = P(2i+2j+2,0)k (2x− 1),

(6.2)

where Pn(x) and P(a,b)n (x) denote the Legendre and Jacobi polynomials, re-

spectively. These basis functions have nice properties, for example beingorthogonal on the reference tetrahedron

(x, y, z) ∈ R3 | x ≥ 0 ∧ y ≥ 0 ∧ z ≥ 0 ∧ x+ y + z ≤ 1.

6.3 Relations for the basis functions

For setting up the linear system, integrals over products of basis functionsand their partial derivatives in all combinations need to be computed, whichthen yield the entries for the system matrix. Certain rewritings of the basis

Page 114: UNIVERSIT AT LINZ JKU - Koutschan

114 Chapter 6. Applications in Numerics

functions have to be performed during this process. An important step is toexpress the partial derivatives (with respect to x, y, and z, respectively) inthe original basis. In other words, we want to rewrite

∂xϕi,j,k(x, y, z) =

∑α∈N3

cα · ϕ(i,j,k)+α(x, y, z) (6.3)

as a linear combination of the basis functions themselves. The same appliesto the derivatives with respect to y and z, but for sake of simplicity wecontent ourselves with writing explicitly only the first case, the ∂

∂xderivative.

Such relations are easily found by just computing an annihilating ideal forϕi,j,k(x, y, z) with our command Annihilator:

In[116]:= phi = (1− x) (i+ j) (1− y) iLegendreP[i, 2z/((1− x)(1− y))− 1]JacobiP[j, 2i+1, 0, 2y/(1−x)−1] JacobiP[k, 2i+2j+2, 0, 2x−1];

In[117]:= Timing[ann = Annihilator[phi, Der[x], S[i], S[j], S[k]]; ]

Out[117]= 820.147,Null

In[118]:= Support[ann]

Out[118]= S2k , Sk, 1, S2

j , SjSk, Sj , Sk, 1, S2i , SiSj , SiSk, SjSk, Si, Sj , Sk, 1,

DxSk, SiSj , SiSk, SjSk, Dx, Si, Sj , Sk, 1, DxSj , SiSj , SiSk, SjSk, Dx, Si, Sj , Sk, 1,DxSi, SiSj , SiSk, SjSk, Dx, Si, Sj , Sk, 1, D2

x , SiSj , SiSk, SjSk, Dx, Si, Sj , Sk, 1,SiSjSk, SiSj , SiSk, SjSk, Dx, Si, Sj , Sk, 1

In[119]:= ByteCount[ann]

Out[119]= 215677308

The last operator is exactly of the form (6.3). But there is another constraintthat we did not mention so far, namely the coefficients cα have to be freeof x, y, and z, and therefore may only depend on i, j, and k. It wouldbe too much to expect a relation of the form (6.3) matching this additionalcondition. Hence we allow more freedom on the left-hand side, namely tohave a linear combination of shifted ∂

∂xderivatives, their coefficients also

being free of x, y, and z. More concretely we are now looking for a finitely-supported operator of the form∑

(l,m,n)∈N3

c1,l,m,n(i, j, k)DxSli S

mj S

nk +

∑(l,m,n)∈N3

c0,l,m,n(i, j, k)Sli Smj S

nk . (6.4)

Having implemented noncommutative Grobner bases, our first attemptwas to use them to eliminate the variables x, y, and z. When we start withan annihilating ∂-finite ideal with respect to the Ore algebra

Q(i, j, k, x, y, z)[Dx; 1, Dx][Si;Si, 0][Sj;Sj, 0][Sk;Sk, 0]

Page 115: UNIVERSIT AT LINZ JKU - Koutschan

6.3. Relations for the basis functions 115

we can hope that an operator P with degDx P = 1 (matching the form of(6.4)) is found. But we can do better as we will see later. Before tacklingthis difficult problem we insert an intermezzo by looking at the simpler two-dimensional case.

2D case

Let’s for a moment assume that our world is a flat disc (this can also be arealistic assumption if we consider plane waves where the propagation in thethird dimension can be neglected). Then we would be interested in simulatingthe propagation of electromagnetic waves in two dimensions only. In this casethe finite elements are just flat triangles and the basis functions are muchsimpler:

ϕi,j(x, y) = (1− x)iP(2i+1,0)j (2x− 1)Pi

(2y

1− x− 1

).

The task is the same as before, namely to find an x, y-free operator that isa 2D-analog of (6.4). The elimination of the two variables can be achieved byGrobner bases and indeed we find an operator that involves only Dx and nohigher derivative. But the computation takes quite long: we interrupted itafter more than one day and took the smallest operator in the intermediatebasis that fits our needs. Moreover this result seems to be far from beingoptimal: Its support involves 42 monomials, the shifts are up to order 9 andthe coefficients have degrees up to 13 and 14 in i and j, respectively. Thissomehow was to be expected since with the Grobner basis approach we sufferfrom the notorious extension/contraction problem (see Section 2.4, as wellas the Examples 2.24 and 3.1).

At the end of Section 3.1 we described a method by ansatz that candeliver such x, y-free operators. Just use equation (6.4) as the ansatz (ofcourse without k and Sk), reduce it with the ∂-finite annihilating ideal, setthe coefficients to zero, do coefficient comparison with respect to x and y,and solve the resulting linear system over Q(i, j)! Even more is possible:the degree condition on Dx can be incorporated from the very beginningwhen creating the ansatz. The last but very important point is that we canmake use of the modular techniques that have been described in Section 3.4.Indeed, using our command FindRelation that automatically performs thesesteps, we can find x, y-free operators for both derivatives ∂

∂xand ∂

∂yin a

few seconds. We should mention that the Grobner basis elimination approachworks better if we consider the derivative with respect to y; in this case we getthe Grobner basis in less than a minute and the desired operator is exactlythe same as we have found by ansatz.

Page 116: UNIVERSIT AT LINZ JKU - Koutschan

116 Chapter 6. Applications in Numerics

3D case

Since the times of Copernicus we know that the earth is not a flat discwhich leads us back to our original problem in three dimensions. The two-dimensional intermezzo has taught us that it may not be a good idea to tryGrobner basis elimination in the 3D case. Instead we immediately try to find(6.4) by ansatz. We primarily focus on the ∂

∂xderivative again (the other

two give similar results). The modular computations already take about 10hours and they tell us that the smallest operator of the form (6.4) has thefollowing support (for that task the command FindSupport which performsonly the modular computations, has been used):

SjS4k , S

2j S

3k , S

3j S

2k , S

4j Sk, DxSjS

3k , DxS

2j S

2k , DxS

3j Sk, DxS

4j , SjS

5k , S

2j S

4k , S

3j S

3k ,

S4j S

2k , SiS

5k , SiSjS

4k , SiS

2j S

3k , SiS

3j S

2k , DxSjS

4k , DxS

2j S

3k , DxS

3j S

2k , DxS

4j Sk,

DxSiS4k , DxSiSjS

3k , DxSiS

2j S

2k , DxSiS

3j Sk, SjS

6k , S

2j S

5k , S

3j S

4k , S

4j S

3k , SiS

6k , SiSjS

5k ,

SiS2j S

4k , SiS

3j S

3k , DxSjS

5k , DxS

2j S

4k , DxS

3j S

3k , DxS

4j S

2k , DxSiS

5k , DxSiSjS

4k ,

DxSiS2j S

3k , DxSiS

3j S

2k , SjS

7k , S

2j S

6k , S

3j S

5k , S

4j S

4k , SiS

7k , SiSjS

6k , SiS

2j S

5k , SiS

3j S

4k ,

DxSjS6k , DxS

2j S

5k , DxS

3j S

4k , DxS

4j S

3k , DxSiS

6k , DxSiSjS

5k , DxSiS

2j S

4k , DxSiS

3j S

3k ,

SjS8k , S

2j S

7k , S

3j S

6k , S

4j S

5k , DxSjS

7k , DxS

2j S

6k , DxS

3j S

5k , DxS

4j S

4k , DxSiS

7k ,

DxSiSjS6k , DxSiS

2j S

5k , DxSiS

3j S

4k , DxSjS

8k , DxS

2j S

7k , DxS

3j S

6k , DxS

4j S

5k , DxSiS

8k ,

DxSiSjS7k , DxSiS

2j S

6k , DxSiS

3j S

5k , DxSjS

9k , DxS

2j S

8k , DxS

3j S

7k , DxS

4j S

6k .

This is impressive but unfortunately rather useless. Even if we succeededin computing the coefficients (for this purpose homomorphic images andrational reconstruction can be used), the relation is of a size that might nothelp in speeding up the work of the numerists. But it also illustrates anotheradvantage of the ansatz technique combined with modular computations: Incertain instances as it is the case in the current example, we get a lot ofinformation about the expected result at a very early stage. This usuallysuffices to decide whether it is worth to proceed or whether the computationshould be aborted because the result will not match the individual needs.

6.4 Extension of the holonomic framework

As we have seen in the last section, the relations that we in principle couldderive are not very adjuvant. Moreover, by having followed the proposedansatz, we have a proof that no smaller relations (with respect to the totaldegree of the involved Ore operators) can exist. At this point, VeronikaPillwein and Joachim Schoberl came up with the following idea: Since thebasis functions are composed of three factors ϕ = u · v · w (see (6.2)), the

Page 117: UNIVERSIT AT LINZ JKU - Koutschan

6.4. Extension of the holonomic framework 117

product rule delivers

∂ϕ

∂x=∂u

∂xvw + u

∂v

∂xw + uv

∂w

∂x.

It is now manifest to split the right-hand side and to try to find smallerrelations that connect for example uvw and ∂u

∂xvw.

The question is how this fits into the holonomic framework where wehandled only equations of the form P • f = 0 for some operator P . Arelation that contains f1 = uvw and f2 = ∂u

∂xvw cannot be formulated as an

operator applied to some function yielding zero (at least not for general u,v, and w). Instead it could be formulated as

P1 • f1 + P2 • f2 = 0. (6.5)

More generally we can consider an arbitrary number of functions f1, . . . , fd.The natural way to express a relation like (6.5) is by introducing the free leftO-module M = Od. The operations in this module are defined component-wise, e.g.,

R · (P +Q) = R ·

P1 +Q1...

Pd +Qd

=

R · (P1 +Q1)...

R · (Pd +Qd)

=

RP1 +RQ1...

RPd +RQd

for R ∈ O and P ,Q ∈ M . Denoting with F the space of functions that weconsider, we define the action of P ∈M on f ∈ Fd by

P • f =

P1...Pd

•f1

...fd

:= P1 • f1 + · · ·+ Pd • fd. (6.6)

If the right-hand side of (6.6) evaluates to zero we say that the module ele-ment P annihilates the vector of functions f . The set of all elements in Mthat annihilate f is a left submodule of M . So it makes sense to speak aboutannihilating modules rather than annihilating ideals. This construction be-comes useful as soon as we are able to compute a basis for the submoduleof relations between f1, . . . , fd, i.e. the annihilator AnnM(f) (as always wewould be happy with a sufficiently large submodule, without claiming thatit coincides with the full annihilator). Trivially we get that

(P1, . . . , Pd)T ∈M | Pi • fi = 0 for 1 ≤ i ≤ d

⊆ AnnM(f). (6.7)

In many cases, when the fi are not at all related with each other, we will haveequality in (6.7). On the other side there are examples where more relationsexist, in which case this construction makes sense in the first place.

Page 118: UNIVERSIT AT LINZ JKU - Koutschan

118 Chapter 6. Applications in Numerics

Example 6.1. Let O = Q(x)[Dx; 1, Dx] and M = O2. First consider f =(f1, f2)T with f1(x) = ex and f2(x) = x. Clearly whatever operator P ∈ O isapplied to f1, the result will be of the form r(x)ex for some rational functionr(x) ∈ Q(x). So for any (P1, P2)T ∈ AnnM(f) we must have that P1 •f1 = 0because otherwise the surviving exponential cannot be canceled by P2 • f2.Similarly P2 • f2 = 0 must hold and we have equality in (6.7).

On the other hand let g = (g1, g2)T with g1(x) = log(x) and g2(x) = x.Then clearly (−Dx, x−2)T ∈ AnnM(g) but does not have the property describedin (6.7): both (−Dx) • g1(x) and x−2 • g2(x) are not zero.

We have seen that in our work an essential ingredient is the ability toexecute closure properties. Therefore we should have a short look on howto perform them for annihilating modules. It turns out that the algorithmsof Section 2.3 can be extended in a natural way to the module setting. Wewant to exemplify that by discussing the closure property “multiplicationby a scalar function”, i.e., given an annihilating module J ⊆ AnnM(f) forf ∈ Fd and an annihilating ideal I ⊆ AnnO(g) for g ∈ F , compute anannihilating module for g · f = (gf1, . . . , gfd)

T (this is also the only closureproperty that we will need in the following).

Once again, we use the basic ideas of the FGLM algorithm (see Fig-ure 2.2). Since the result shall be an annihilating module in M , the “stan-dard monomials” (that will be considered in the FGLM-systematic way) areelements of the form P = (0, . . . , Pi, . . . , 0)T ∈ M where Pi ∈ O is a mono-mial. Consequently we do not start with 1 as the set of test monomials,but with (1, 0, . . . , 0)T , . . . , (0, . . . , 0, 1)T. The task is now to compute anormal form for such standard monomials. If we apply P to the productg · f we obtain Pi • (gfi), which can be rewritten to the form∑

k

ck · (Qk • g) · (Rk • fi), Qk, Rk ∈ O

exactly as we did in the scalar case. Reducing the Qk to normal form withrespect to I and reducing the Rk to normal form with respect to J (for thispurpose, Rk has to be identified with the vector that has Rk on its i-thposition and that is zero elsewhere), yields a normal form for P . The rest ofthe algorithm works exactly as depicted in Figure 2.2.

We turn back to our original problem: Compute an annihilating modulefor f = (f1, f2)T where f1 = uvw and f2 = u′vw (u, v, w as defined in (6.2),and u′ denoting the partial derivative of u with respect to x). Let from nowon

O = Q(i, j, k, x, y, z)[Si;Si, 0][Sj;Sj, 0][Sk;Sk, 0][Dx; 1, Dx][Dy; 1, Dy][Dz; 1, Dz]

Page 119: UNIVERSIT AT LINZ JKU - Koutschan

6.4. Extension of the holonomic framework 119

and M = O2. We expect the annihilating module for f to be strictly largerthan (6.7), because f1 and f2 are closely related by the common factor vw.Hence we will start with h = (u, u′)T and compute an annihilating ideal forf = (vw) · h by the above mentioned closure property.

First we have to ask ourselves how to compute an annihilating moduleJ ⊆ AnnM h ⊆M for (u, u′)T . We know how to compute annihilating idealsfor u and u′, and clearly J should incorporate this knowledge (this givesrise to elements in J that have only a single nonzero entry annihilating thecorresponding component). Additionally we are aware of the fact that thesecond component is the derivative of the first one. Putting all this together,we let J be the submodule that is generated by

(P, 0)T | P ∈ AnnO u∪

(0, P )T | P ∈ AnnO u′ ∪ (Dx,−1)T

.

At this point we should not forget to compute a module Grobner basis of theabove, because this will usually not be the case on its own. Now the closureproperty “component-wise multiplication by vw” can be performed, yieldingan annihilating module for f .

Finally we can use the ansatz technique as before in order to find anx, y, z-free element in the annihilating module of f . As a result we get thefollowing relation:

−2(1 + 2i)(2 + j)(3 + 2i+ j)(7 + 2i+ 2j)(5 + i+ j + k)(7 + i+ j + k)(8 + i+ j + k)(8 + 2i+ 2j + k)(9 + 2i+ 2j + k)(11 + 2i+ 2j + 2k)

(15 + 2i+ 2j + 2k) f1(i, j + 1, k + 3)...

+ 〈31 similar terms〉+...

−2(4 + 2i+ j)(5 + 2i+ j)(5 + 2i+ 2j)(5 + i+ j + k)(6 + i+ j + k)(8 + i+ j + k)(10 + 2i+ 2j + k)(11 + 2i+ 2j + k)(11 + 2i+ 2j + 2k)

(15 + 2i+ 2j + 2k) f2(i+ 1, j + 2, k + 3) = 0

(most other cases are smaller, i.e., when taking the partial derivatives of vand w). But why restrict to vectors of dimension 2? We could as well try tofind relations for

f =

(uvw,

∂u

∂xvw,

∂u

∂yvw,

∂u

∂zvw

)Tand obtain an identity that connects uvw, ∂u

∂xvw, and ∂u

∂zvw, and that has the

Page 120: UNIVERSIT AT LINZ JKU - Koutschan

120 Chapter 6. Applications in Numerics

following support:

(0, 0, 0, S3j S

4k )T , (0, 0, 0, S2

j S5k )T , (0, 0, 0, SjS

6k )T , (0, S2

j S4k , 0, 0)T ,

(0, 0, 0, SiS2j S

3k )T , (0, 0, 0, SiSjS

4k )T , (0, 0, 0, SiS

5k )T , (0, 0, 0, S3

j S3k )T ,

(0, 0, 0, S2j S

4k )T , (0, 0, 0, SjS

5k )T , (S2

j S3k , 0, 0, 0)T , (0, S2

j S3k , 0, 0)T ,

(0, 0, 0, SiS2j S

2k )T , (0, 0, 0, SiSjS

3k )T , (0, 0, 0, SiS

4k )T , (0, 0, 0, S3

j S2k )T ,

(0, 0, 0, S2j S

3k )T , (0, 0, 0, SjS

4k )T , (0, S2

j S2k , 0, 0)T , (0, 0, 0, SiS

2j Sk)

T ,(0, 0, 0, SiSjS

2k )T , (0, 0, 0, SiS

3k )T , (0, 0, 0, S3

j Sk)T , (0, 0, 0, S2

j S2k )T ,

(0, 0, 0, SjS3k )T , (0, 0, 0, S3

j )T , (0, 0, 0, S2j Sk)

T , (0, 0, 0, SjS2k )T.

Page 121: UNIVERSIT AT LINZ JKU - Koutschan

Chapter 7

A fully algorithmic proof ofStembridge’s TSPP theorem

Chapter 3 contained four algorithms, all of them serving more or less thesame goal: to find a creative telescoping relation in a given annihilatingideal. To the three existing classical algorithms we added what we calledthe “polynomial ansatz”. In this chapter an application is presented thatjustifies its invention. In fact, it was the TSPP problem that lead us to comeup with this kind of ansatz.

The theorem (see Theorem 7.3 below) that we are going to prove isabout the enumeration of totally symmetric plane partitions (TSPP); it wasfirst proven by John Stembridge [81]. We will reprove the statement usingonly computer algebra; this means that basically no human ingenuity (fromthe mathematical point of view) is needed any more—once the algorithmicmethod has been invented (in this case, by Doron Zeilberger). But it is not assimple (otherwise our contribution would be trivial): The summation prob-lems that have to be solved are very much involved and we were not able todo them with the known methods that have been presented in Sections 3.1,3.2, and 3.3. One option would be to wait for 20 years hoping that Moore’slaw equips us with computers that are thousands of times faster than theones of nowadays and that can do the job easily. But we prefer a secondoption, namely to think about how to make the problem feasible for today’scomputers.

Somehow, the results of this chapter are a byproduct of a joint work withDoron Zeilberger and Manuel Kauers where the long term goal is to applythe methodology described below to the Andrews-Robbins q-TSPP conjec-ture [80] (which is a q-analogue of Theorem 7.3). Some first but remarkablesteps into this direction have been done [48], but at some point the limi-tations of our computers forced us to stop. Therefore the ordinary q = 1

121

Page 122: UNIVERSIT AT LINZ JKU - Koutschan

122 Chapter 7. A fully algorithmic proof of Stembridge’s TSPP theorem

case serves as a proof-of-concept and to get a feeling for the complexity ofthe underlying computations; it delivers valuable information that go furtherthan just giving yet another proof of Stembridge’s theorem.

It should be mentioned that this is not the first proof of Stembridge’stheorem that uses computer algebra. In 2005 George Andrews, Peter Paule,and Carsten Schneider [10] came up with a computer-assisted proof. Bymeans of a matrix decomposition into triangular matrices they transformedthe problem of evaluating the determinant into the task to verify the cor-rectness of the decomposition which resulted in a couple of hypergeometricmultiple-sum identities. These were solved with help of the Mathematicapackage Sigma [78]. Finding the matrix decomposition however required hu-man insight (and so far it is not clear how to do it in the q-case). We claimto have the first “human-free” computer proof of Stembridge’s theorem thatis completely algorithmic and does not require any human insight into theproblem. Moreover our method generalizes immediately to the q-case and itis only the computational complexity that prevented us from proving it.

7.1 Totally symmetric plane partitions

We first want to motivate the topic of this chapter by giving a short expla-nation of the underlying combinatorial objects.

Definition 7.1. A plane partition π of some integer n is a two-dimensionalarray

π = (πi,j), πi,j ∈ N for integers i, j ≥ 1,∑i,j≥1

πi,j = n,

which is weakly decreasing in rows and columns, or more precisely

πi+1,j ≤ πi,j and πi,j+1 ≤ πi,j for all i, j ≥ 1.

Note that this definition implies that only finitely many entries πi,j can benonzero. To each plane partition we can draw its 3D Ferrers diagram bystacking πi,j unit cubes on top of the location (i, j). Each unit cube canbe addressed by its location (i, j, k) in 3D coordinates. The conditions onthe entries of πi,j imply that the 3D Ferrers diagram is an origin-justifiedstructure, in the sense that if the position (i, j, k) is occupied then so areall positions (i′, j′, k′) with i′ ≤ i, j′ ≤ j, and k′ ≤ k. Figure 7.1 shows anexample of a plane partition together with its 3D Ferrers diagram. We arenow going to define TSPPs, the objects of interest.

Page 123: UNIVERSIT AT LINZ JKU - Koutschan

7.1. Totally symmetric plane partitions 123

5 4 1

3 2 1

1

Figure 7.1: A plane partition of n = 17

Definition 7.2. A plane partition is totally symmetric iff whenever the po-sition (i, j, k) in its 3D Ferrers diagram is occupied (in other words πi,j ≥ k),it follows that all its permutations (i, k, j), (j, i, k), (j, k, i), (k, i, j), (k, j, i)are also occupied.

Stembridge’s theorem [81] now tells us how many TSPPs of a certain sizeexist.

Theorem 7.3. The number of totally symmetric plane partitions whose 3DFerrers diagram is contained in the cube [0, n]3 is given by the product-formula

∏1≤i≤j≤k≤n

i+ j + k − 1

i+ j + k − 2. (7.1)

Example 7.4. We are considering the case n = 2: Formula (7.1) tells usthat there should be ∏

1≤i≤j≤k≤2

i+ j + k − 1

i+ j + k − 2=

2

1· 3

2· 4

3· 5

4= 5

TSPPs that fit into the cube [0, 2]3. This result is confirmed by the enumer-ation given in Figure 7.2.

As others that proved the TSPP formula before us we will make use ofa result by Soichi Okada [61] that reduces the proof of Theorem 7.3 to adeterminant evaluation:

Page 124: UNIVERSIT AT LINZ JKU - Koutschan

124 Chapter 7. A fully algorithmic proof of Stembridge’s TSPP theorem

Figure 7.2: All TSPPs that fit into the cube [0, 2]2

Theorem 7.5. The enumeration formula (7.1) for TSPPs is correct if andonly if the determinant evaluation

det (a(i, j))1≤i,j≤n =∏

1≤i≤j≤k≤n

(i+ j + k − 1

i+ j + k − 2

)2

(7.2)

holds, where the entries in the matrix are given by

a(i, j) =

(i+ j − 2

i− 1

)+

(i+ j − 1

i

)+ 2δ(i, j)− δ(i, j + 1). (7.3)

In the above, δ(i, j) denotes the Kronecker delta.

7.2 How to prove determinant evaluations

Doron Zeilberger [95] proposes a method for completely automatic and rig-orous proofs of determinant evaluations that fit into a certain class. Forthe sake of self-containedness this section gives a short summary how thismethod works. It concerns the following problem: For all n ≥ 1 prove that

det(a(i, j))1≤i,j≤n = Nice(n),

for some explicitly given expressions a(i, j) and Nice(n). We assume thatthe matrix has full rank. What you have to do is the following: Pull out of

Page 125: UNIVERSIT AT LINZ JKU - Koutschan

7.3. The computer proof 125

the hat another discrete function B(n, j) (this looks a little bit like magic fornow—we will make this step more explicit later) and check the identities

n∑j=1

B(n, j)a(i, j)=0 for 1 ≤ i < n, i, n ∈ N, (7.4)

B(n, n)=1 for all n ≥ 1, n ∈ N. (7.5)

If they hold, then by uniqueness it follows that B(n, j) equals the cofactorof the (n, j)-entry of the n× n determinant divided by the (n− 1)× (n− 1)determinant. This fact becomes more obvious when we expand the deter-minant with respect to the last row using Laplace’s formula (we divided thewhole equation by Mn,n already):

1

Mn,n

det(a(i, j))1≤i,j≤n =n∑j=1

(−1)n+jMn,j

Mn,n︸ ︷︷ ︸B(n,j)

a(n, j)

where Mn,j denotes the (n, j)-minor, i.e., the determinant of the matrix withthe last row and the jth column removed. Changing the term a(n, j) inthe sum to a(i, j), i < n corresponds to replace the last row of the originalmatrix by its i-th row. The determinant then is of course 0 and we haveequation (7.4). Since there are n − 1 choices for i we obtain as many lin-ear independent equations for the B(n, j), 1 ≤ j ≤ n and they determinethe solution up to a constant multiple. This ambiguity is disposed by thenormalization condition (7.5).

If one finally succeeds to verify the identity

n∑j=1

B(n, j)a(n, j) =Nice(n)

Nice(n− 1)for all n ≥ 1, n ∈ N, (7.6)

the determinant evaluation Nice(n) is established.

7.3 The computer proof

The annihilating ideal

The first thing we have to do according to Zeilberger’s algorithmic prooftechnique is to resolve the magic step that we have left as a black box so far,namely “to pull out of the hat” the sequence B(n, j) for which we have toverify the identities (7.4) – (7.6). Note that we are able, using the definition

Page 126: UNIVERSIT AT LINZ JKU - Koutschan

126 Chapter 7. A fully algorithmic proof of Stembridge’s TSPP theorem

of what B(n, j) is supposed to be (namely a certain cofactor in a determinantexpansion), to compute the values of B(n, j) for small concrete integers nand j. This data allows us (by plugging it into an appropriate ansatz andsolving the resulting linear system) to find recurrence relations for B(n, j)that will hold for all values of n and j with a very high probability. We callthis method guessing; it has been executed by Manuel Kauers who used hishighly optimized software Guess [46]. More details about this part of theproof can be found in [48]. The result of the guessing were 65 recurrences,their total size being about 5MB.

Many of these recurrences are redundant and it is desirable to have aunique description of the object in question that additionally is as small aspossible (in a certain metric). To this end we compute a Grobner basis of the∂-finite left ideal that is generated by the 65 recurrences. The computationwas executed by the noncommutative Grobner basis implementation which ispart of the package HolonomicFunctions. We later found out that it can aswell be obtained directly from the guessing procedure. One just has to choosethe structure set of the ansatz in an appropriate way. The Grobner basisconsists of 5 polynomials (their total size being about 1.6MB). Their leadingmonomials S4

j , S3j Sn, S

2j S

2n , SjS

3n , S

4n form a staircase of regular shape. This

means that we should take 10 initial values into account which correspondto the monomials under the staircase.

In addition, we have now verified that all the 65 recurrences are consistent.Hence they are all valid for the same object. If this is not the case then wewould have expected to get 1 as the Grobner basis. The next questionis whether the 5 elements of the Grobner basis together with the 10 initialvalues define a unique bivariate sequence, or in other words whether theygive already a complete description of the sequence that we want to identifyas B(n, j).

The singularities

Before we start to prove the relevant identities there is one subtle pointthat, aiming at a fully rigorous proof, we should not omit: the questionof singularities in the ∂-finite description of B′(n, j). Recall that in theunivariate case when we deal with a P-finite recurrence, we have to regard thezeros of the leading coefficient and in case that they introduce singularities inthe range where we would like to apply the recurrence, we have to separatelyspecify the values of the sequence at these points. Similarly in the bivariatecase: We have to check whether there are points in N2 where none of therecurrences can be applied because the leading term vanishes.

For all points that lie in the area (4, 4) + N2 we may apply any of the

Page 127: UNIVERSIT AT LINZ JKU - Koutschan

7.3. The computer proof 127

recurrences, hence we have to look for common nonnegative integer solutionsof all their leading coefficients (being bivariate polynomials in n and j).In order to determine the common solutions we compute a (commutative)Grobner basis of the leading coefficients (the variables shifted according tothe exponents of the leading monomial). It reveals that everything goes wellin the (4, 4)-shifted quadrant:

(n− 3)2(n− 2)(n− 1)2(2n− 3)2(2n− 1)(j + n− 1)(j + n),(n− 2)(n− 1)(2n− 3)(2n− 1)(j + n− 1)(j + n)(1608j + 154n3 − 847n2

−222n− 693),(j − 3)(n− 1)(2n− 1)(j − n)(j + n− 1)(j + n),(2n− 1)(j + n− 1)(j + n)(308n6 − 3080n5 + 12397n4 + 9648jn2 + . . . ),(j + n− 1)(j + n)(1053818880n14 − 983564288jn13 + . . . )

where two irreducible polynomials were cut off for better readability. Firstone observes that all Grobner basis elements contain the factors (j + n)and (j + n − 1) from which we can read off the solutions (0, 0), (1, 0), and(0, 1). But since these points are lying under the stairs anyway they are ofno interest. The remaining factors of the first polynomial involve only thevariable n and they tell us that we have to address the cases n = 1, 2, 3.The first three polynomials contain the factor (n− 1) and hence are zero forall j when n = 1. Plugging n = 1 into the remaining two polynomials andfactoring delivers

3216(j − 2)2(j − 1)j(j + 1),1072(j − 2)2(j − 1)j(j + 1) (65536j11 − 2686976j10 + . . . )

which luckily restricts j to a finite set of values: For n = 1 we obtain theadditional solutions j = 1 and j = 2. Doing the same reasoning for n = 2 andn = 3 we can write down the complete set of common nonnegative integersolutions:

(0, 0), (0, 1), (1, 0), (1, 1), (2, 1), (2, 2), (3, 2), (3, 3).

But all of them are outside of (4, 4) +N2 so we need not to care.

It remains to look at the lines j = 0, 1, 2, 3 and the lines n = 0, 1, 2, 3.They are simpler to treat because we can substitute the value of the linefor j resp. n and are left with finding common nonnegative integer roots ofunivariate polynomials. As an example consider the line j = 0: On this linewe may only apply the last recurrence that has leading monomial S4

n , sinceall others would require values outside the first quadrant. So take the leading

Page 128: UNIVERSIT AT LINZ JKU - Koutschan

128 Chapter 7. A fully algorithmic proof of Stembridge’s TSPP theorem

coefficient of this recurrence, shift n to n−4, and substitute j = 0, obtaining

576(n− 4)(n− 3)2(n− 2)2(n− 1)3n2

×(2n− 7)(2n− 5)(2n− 3)(2n− 1)(3n− 8)(3n− 4)× (81n6 − 1389n5 + 10009n4 − 38819n3 + 85522n2 − 101620n+ 51016) .

We can read off the singularities (0, 0), (0, 1), (0, 2), (0, 3), and (0, 4). In asimilar way the other seven cases can be treated (we omit the details here).Summarizing, the points for which initial values have to be given (eitherbecause they are under the stairs or because of singularities) are

(j, n) | 0 ≤ j ≤ 6 ∧ 0 ≤ n ≤ 1 ∪ (j, 2) | 0 ≤ j ≤ 4∪(j, 3) | 0 ≤ j ≤ 3 ∪ (j, 4) | 0 ≤ j ≤ 2 ∪ (1, 5).

They are depicted in Figure 7.3.

j

n

Figure 7.3: The points for which the initial values of the sequence B(n, j)have to be given because the recurrences do not apply.

Aiming at a rigorous proof we have to admit at this point that what wehave found so far does not prove anything yet. Supplying the ∂-finite descrip-tion with these 27 initial values uniquely and completely defines a bivariatesequence—let’s call it B′(n, j). We still have to show that this B′(n, j) isidentical to the sequence B(n, j) defined by (7.4) and (7.5). We anticipatethe correctness of these two identities and write always B(n, j) instead ofB′(n, j). Finally we have to verify that identity (7.6) indeed holds. In thefollowing we prove the three identities in the order of their difficulty.

The second identity

The simplest of the three identities to prove is (7.5). From the ∂-finite de-scription of B′(n, j) we can compute a recurrence for the diagonal B′(n, n) by

Page 129: UNIVERSIT AT LINZ JKU - Koutschan

7.3. The computer proof 129

the closure property substitution. Our command DFiniteSubstitute deliv-ers a recurrence of order 7 in a couple of minutes. Reducing this recurrencewith the ideal generated by Sn− 1 (which annihilates 1) gives 0; hence it is aleft multiple of the recurrence for the right-hand side. We should not forgetto have a look on the leading coefficient in order to make sure that we don’trun into singularities:

256(2n+ 3)(2n+ 5)(2n+ 7)(2n+ 9)(2n+ 11)2(2n+ 13)2p1p2

where p1 and p2 are irreducible polynomials in n of degree 4 and 12 respec-tively. Comparing initial values (which of course match due to our definition)establishes identity (7.5).

The third identity

In order to prove (7.6) we first rewrite it slightly. Using the definition of thematrix entries a(n, j) we obtain for the left-hand side

n∑j=1

B(n, j)

((n+ j − 2

n− 1

)+

(n+ j − 1

n

))︸ ︷︷ ︸

=:a′(n,j)

+2B(n, n)−B(n, n− 1)

and the right-hand side simplifies to

Nice(n)

Nice(n− 1)=

∏1≤i≤j≤k≤n

(i+j+k−1i+j+k−2

)2

∏1≤i≤j≤k≤n−1

(i+j+k−1i+j+k−2

)2 =41−n(3n− 1)2(2n)2

n−1

(3n− 2)2(n/2)2n−1

.

Note that a′(n, j) = 2n+j−1n+j−1

(n+j−1j−1

)is a hypergeometric expression in both

variables j and n. A ∂-finite description of the summand can be computedwith our implementation DFiniteTimes from the annihilating ideal of B(n, j)using the closure property product. The task is now to find a creative tele-scoping relation for the summand. We tried to accomplish this in variousways.

Some unsuccessful tries

Zeilberger’s slow algorithm We tried this approach but it seems to behopeless: The summation variable j that we would like to eliminate occursin the annihilating relations for the summand B(n, j)a′(n, j) with degreesbetween 24 and 30. When we follow the intermediate results of the Grobnerbasis computation we observe that none of the elements that were added to

Page 130: UNIVERSIT AT LINZ JKU - Koutschan

130 Chapter 7. A fully algorithmic proof of Stembridge’s TSPP theorem

the basis because some S-polynomial did not reduce to zero has a degreein j lower than 23 (we aborted the computation after more than 48 hours).Additionally the coefficients grow rapidly and it seems very likely that werun out of memory before coming to an end.

Takayama’s algorithm First we note that our summand has finite sup-port and hence natural boundaries which allows us to apply Takayama’salgorithm. Although this algorithm is much superior to the elimination al-gorithm proposed by Zeilberger, we were not able to complete the necessarycomputations. The underlying elimination problem, as before, seems to beunsolvable with today’s computers: We now can lower the degree of j to 18,but the intermediate results consume already about 12GB of memory (after48 hours).

Chyzak’s algorithm In the run of Chyzak’s algorithm (see Section 3.3)we have to solve a system of linear first-order difference equations. Due tothe size of the input, we did not succeed in uncoupling this system (neitherwith our implementation nor with Stefan Gerhold’s OreSys), and even if wecan do this step, it would remain to solve a presumably huge (concerning thesize of the coefficients as well as the order) scalar difference equation.

A successful approach

At this point we came up with the idea to treat this problem with the tech-nique described in Section 3.4. The advantage of this technique is that thecomputations are better controllable for big inputs, because the buildingsteps are only normal form computation with respect to a given Grobnerbasis and linear algebra. No run of Buchberger’s algorithm or expensiveuncoupling is needed.

We found by means of modular computations that the ansatz

I∑i=0

pi(n)Sin︸ ︷︷ ︸= P (n,Sn)

+ (Sj − 1) ·K∑k=0

L∑l=0

M∑m=0

qk,l,m(n)jkSljSmn︸ ︷︷ ︸

=Q(j,n,Sj ,Sn)

. (7.7)

with I = 7, K = 5, and the support of Q being the power products SljSmn

with l + m ≤ 7 delivers a solution with nontrivial principal part. Afteromitting the 0-components of this solution, we ended up with an ansatzcontaining 126 unknowns. For computing the final solution we used againhomomorphic images and rational reconstruction. Still it was quite some

Page 131: UNIVERSIT AT LINZ JKU - Koutschan

7.3. The computer proof 131

effort to compute the solution (it consists of rational functions in n withdegrees up to 382 in the numerators and denominators). The total size ofthe telescoping relation becomes smaller when we reduce the delta part tonormal form (then obtaining an operator of the form that Chyzak’s algorithmwould deliver). In contrast to Chyzak’s algorithm we do not necessarily findthe telescoping relation with minimal-order principal part. Finally the resulttakes about 5 MB of memory. We counterchecked its correctness by reducingthe relation with the annihilating ideal of B(n, j)a′(n, j) and obtained 0 asexpected.

We have now a recurrence for the sum but we need to to cover the wholeleft-hand side. A recurrence for B(n, n − 1) is easily obtained with ourpackage performing the substitution j → n − 1, and B(n, n) = 1 as shownbefore. Using our command DFinitePlus, the closure property sum deliversa recurrence of order 10. On the right-hand side we have a ∂-finite expressionfor which our package automatically computes an annihilating operator. Thisoperator is a right divisor of the one that annihilates the left-hand side. Bycomparing 10 initial values and verifying that the leading coefficients of therecurrences do not have singularities among the positive integers, we haveestablished identity (7.6).

The first identity

With the same notation as before we reformulate identity (7.4) asn∑j=1

B(n, j)a′(i, j) = B(n, i− 1)− 2B(n, i).

The hard part again is to do the sum on the left-hand side. Since two param-eters i and n are involved and remain after the summation, one annihilatingoperator does not suffice. We decided to search for two operators with lead-ing monomials being pure powers of Si and Sn respectively. Although this isfar away from being a Grobner basis, it is nevertheless a complete descrip-tion of the object (together with sufficiently (but still finitely) many initialvalues). We obtained these two relations in a similar way as in the previoussection, but the computational effort was even bigger (more than 500 hoursof computation time were needed). The first telescoping operator is about200 MB big and the support of its principal part is

S5i , S

4i Sn, S

3i S

2n , S

2i S

3n , SiS

4n , S

4i , S

3i Sn, S

2i S

2n , SiS

3n ,

S3i , S

2i Sn, SiS

2n , S

3n , S

2i , SiSn, S

2n , Si, Sn, 1.

The second one is of size 700 MB and the support of its principal part is

S5n , S

4i , S

3i Sn, S

2i S

2n , SiS

3n , S

4n , S

3i , S

2i Sn, SiS

2n , S

3n , S

2i , SiSn, S

2n , Si, Sn, 1.

Page 132: UNIVERSIT AT LINZ JKU - Koutschan

132 Chapter 7. A fully algorithmic proof of Stembridge’s TSPP theorem

Again we can independently from their derivation check their correctness byreducing them with the annihilating ideal of B(n, j)a′(i, j): both give 0.

Let’s now examine the right-hand side: From the Grobner basis of re-currences for B(n, j) that we computed in Section 7.3 one immediately getsan annihilating ideal for B(n, i − 1) by replacing Sj by Si and by substitut-ing j → i − 1 in the coefficients. We now could apply the closure prop-erty sum but we can do better: Since the right-hand side can be written as(1 − 2Si) • B(n, i − 1) we can use the closure property operator applicationand obtain a Grobner basis which has even less monomials under the stairsthan the input, namely 8. The opposite we expect to happen when usingthe closure property sum: usually there the dimension grows but never canshrink. It is now a relatively simple task to verify that the two principal partsthat were computed for the left-hand side are contained in the annihilatingideal of the right-hand side (both reductions give 0).

The initial value question needs some special attention here since wewant the identity to hold only for i < n; hence we cannot simply look atthe initial values in the square [0, 4]2. Instead we compare the initial valuesin a trapezoid-shaped area which allows us to compute all values below thediagonal. Since all these initial values match for the left-hand and right-handside we have the proof that the identity holds for all i < n. Looking at theleading coefficients of the two principal parts we find that they contain thefactors 5 + i− n and 5− i+ n respectively. This means that both operatorscannot be used to compute values on the diagonal which is a strong indicationthat the identity does not hold there: Indeed, identity (7.4) is wrong for n = ibecause in this case we get (7.6).

The prize

It might have become manifest that our proof did not go so smooth and wehad to overcome many difficulties, in particular we had to recover from manydisappointing unsuccessful attempts. Doron Zeilberger was so generous tostimulate my motivation by offering two prizes of $100 and $200 for prov-ing (7.6) and (7.4), respectively! And he really pushed towards the completerigorous proof as the following e-mail [96] evidences:

I was about to write you a $100 check, when I realized that youdon’t deserve it (yet) The stipulation of the prize was that youFIRST do (Soichi) for $200, and then if you can also do (Okada)then you get an additional $100.

[. . . ]

Page 133: UNIVERSIT AT LINZ JKU - Koutschan

7.4. Outlook 133

P.S. This is like Jacob and Laban, before Jacob could marryRachel, working for seven years, he had to marry Leah, also byworking seven years, so the price of Rachel was 14 years of labor,plus an extra, unwanted wife. I am sure that it would take youless than 14 years.

7.4 Outlook

As we have demonstrated, Zeilberger’s methodology is completely algorith-mic and does not need human intervention. This fact makes it possible toapply it to other problems (of the same class) without further thinking. Justfeed the data into the computer! The q-TSPP enumeration formula∏

1≤i≤j≤k≤n

1− qi+j+k−1

1− qi+j+k−2

has been conjectured independently by George Andrews and Dave Robbinsin the early 1980s [80]. This conjecture is still open and one of the mostintriguing problems in enumerative combinatorics. The tantalizing aspectof this chapter is that the methodology can be applied one-to-one to thatproblem (also a q-analogue of Okada’s result exists). Unfortunately, dueto the additional indeterminate q the complexity of the computations is in-creased considerably which prevents us from proving it right away. But weare working on that. . .

Page 134: UNIVERSIT AT LINZ JKU - Koutschan

134 Chapter 7. A fully algorithmic proof of Stembridge’s TSPP theorem

Page 135: UNIVERSIT AT LINZ JKU - Koutschan

Bibliography

[1] Sergej Abramov. Rational solutions of linear differential and differenceequations with polynomial coefficients. USSR Computational Mathe-matics and Mathematical Physics, 29(6):7–12, 1989.

[2] Sergej Abramov. Rational solutions of linear difference and q-differenceequations with polynomial coefficients. In ISSAC’95: Proceedings of the1995 International Symposium on Symbolic and Algebraic Computation,pages 285–289, New York, NY, USA, 1995. ACM.

[3] Sergej Abramov and Moulay Barkatou. Rational solutions of first orderlinear difference systems. In ISSAC’98: Proceedings of the 1998 In-ternational Symposium on Symbolic and Algebraic Computation, pages124–131, New York, NY, USA, 1998. ACM.

[4] Sergej Abramov, Manuel Bronstein, and Marko Petkovsek. On polyno-mial solutions of linear operator equations. In ISSAC ’95: Proceedingsof the 1995 International Symposium on Symbolic and Algebraic Com-putation, pages 290–296, New York, NY, USA, 1995. ACM.

[5] Sergej Abramov and Eugene Zima. A universal program to uncouplelinear systems. In Proceedings of the International Conference on Com-putational Modelling and Computing in Physics, Dubna, Russia, pages16–26, September 1996.

[6] Milton Abramowitz and Irene Stegun. Handbook of Mathematical Func-tions with Formulas, Graphs, and Mathematical Tables. Dover, NewYork, 1964.

[7] Gert Almkvist and Doron Zeilberger. The method of differentiatingunder the integral sign. Journal of Symbolic Computation, 10(6):571–591, 1990.

135

Page 136: UNIVERSIT AT LINZ JKU - Koutschan

136 Bibliography

[8] Tewodros Amdeberhan and Victor H. Moll. A formula for a quarticintegral: a survey of old proofs and some new ones. Ramanujan Journal,18(1):91–102, 2009.

[9] George Andrews, Richard Askey, and Ranjan Roy. Special functions,volume 71 of Encyclopedia of mathematics and its applications. Cam-bridge University Press, Cambridge, UK, 1999.

[10] George E. Andrews, Peter Paule, and Carsten Schneider. Plane Parti-tions VI. Stembridge’s TSPP theorem. Advances in Applied Mathemat-ics, 34:709–739, 2005.

[11] Moulay Barkatou. On rational solutions of systems of linear differentialequations. Journal of Symbolic Computation, 28:547–567, 1999.

[12] Moulay Barkatou. On super-irreducible forms of linear differential sys-tems with rational function coefficients. Journal of Computational andApplied Mathematics, 162(1):1–15, 2004.

[13] Moulay Barkatou and Eckhard Pflugel. Computing super-irreducibleforms of systems of linear differential equations via Moser-reduction:a new approach. In ISSAC’07: Proceedings of the 2007 InternationalSymposium on Symbolic and Algebraic Computation, pages 1–8, NewYork, NY, USA, 2007. ACM.

[14] Thomas Becker, Heinz Kredel, and Volker Weispfenning. Grobner bases:a computational approach to commutative algebra. Springer-Verlag, Lon-don, UK, 1993.

[15] George M. Bergman. The diamond lemma for ring theory. Advances inMathematics, 29:178–218, 1978.

[16] Joseph N. Bernstein. The analytic continuation of generalized functionswith respect to a parameter. Functional Analysis and its Applications,6(4):273–285, 1972.

[17] Sven Beuchler and Veronika Pillwein. Sparse shape functions for tetrahe-dral p-FEM using integrated Jacobi polynomials. Computing, 80(4):345–375, 2007.

[18] Sven Beuchler and Joachim Schoberl. New shape functions for triangularp-FEM using integrated Jacobi polynomials. Numerische Mathematik,103(3):339–366, 2006.

Page 137: UNIVERSIT AT LINZ JKU - Koutschan

Bibliography 137

[19] George Boros and Victor Moll. Irresistible Integrals. Symbolics, Analysisand Experiments in the Evaluation of Integrals. Cambridge UniversityPress, 2004.

[20] Alin Bostan and Manuel Kauers. The full counting function for Gesselwalks is algebraic. Technical report, INRIA-Rocquencourt, 2008. Inpreparation.

[21] Manuel Bronstein and Marko Petkovsek. An introduction to pseudo-linear algebra. Theoretical Computer Science, 157(1):3–33, 1996.

[22] Bruno Buchberger. Ein Algorithmus zum Auffinden der Basiselementedes Restklassenrings nach einem nulldimensionalen Polynomideal. PhDthesis, University of Innsbruck, Innsbruck, Austria, 1965.

[23] Pierre Cartier. Demonstration “automatique” d’identites et fonctionshypergeometriques [d’apres D. Zeilberger]. Asterisque, 206:41–91, 1991.Seminaire Bourbaki, 44eme annee, 1991–1992, n746.

[24] Frederic Chyzak. Fonctions holonomes en calcul formel. PhD thesis,Ecole polytechnique, 1998.

[25] Frederic Chyzak. Grobner bases, symbolic summation and symbolicintegration. In Bruno Buchberger and Franz Winkler, editors, GrobnerBases and Applications, volume 251 of London Mathematical SocietyLecture Notes Series, pages 32–60. Cambridge University Press, 1998.Proceedings of the Conference 33 Years of Grobner Bases.

[26] Frederic Chyzak. An extension of Zeilberger’s fast algorithm to generalholonomic functions. Discrete Mathematics, 217(1-3):115–134, 2000.

[27] Frederic Chyzak, Manuel Kauers, and Bruno Salvy. A non-holonomicsystems approach to special function identities. In ISSAC’09: Proceed-ings of the 2009 International Symposium on Symbolic and AlgebraicComputation, pages 111–118, New York, NY, USA, 2009. ACM.

[28] Frederic Chyzak and Peter Paule. Computer algebra. In D. Lozier, ed-itor, The Digital Library of Mathematical Functions (DLMF). NationalInstitute of Standards and Technology (NIST), Gaithersburg, U.S.A.,2007. In preparation.

[29] Frederic Chyzak and Bruno Salvy. Non-commutative elimination in Orealgebras proves multivariate identities. Journal of Symbolic Computa-tion, 26:187–227, 1998.

Page 138: UNIVERSIT AT LINZ JKU - Koutschan

138 Bibliography

[30] Severino C. Coutinho. A primer of algebraic D-modules, volume 33of London Mathematical Society Student Texts. Cambridge UniversityPress, 1995.

[31] David Cox, John Little, and Donal O’Shea. Ideals, Varieties, and Algo-rithms. Springer-Verlag, New York, 1992.

[32] Sister Mary Celine Fasenmyer. Some generalized hypergeometric poly-nomials. PhD thesis, University of Michigan, 1945.

[33] Jean Charles Faugere, Patrizia Gianni, Daniel Lazard, and Teo Mora.Efficient computation of zero-dimensional Grobner bases by change ofordering. Journal of Symbolic Computation, 16(4):329–344, 1993.

[34] Richard P. Feynman and Ralph Leighton (ed.). Surely You’re Joking,Mr. Feynman!: Adventures of a Curious Character. W. W. Norton &Co, 1985.

[35] Philippe Flajolet, Stefan Gerhold, and Bruno Salvy. On the non-holonomic character of logarithms, powers and the nth prime function.Electronic Journal of Combinatorics, 11(2):1–16, 2005.

[36] Carl Friedrich Gauß. Disquisitiones generales circa series infinitam 1 +αβ1·γx+ α(α+1)β(β+1)

1·2·γ(γ+1)xx+ α(α+1)(α+2)β(β+1)(β+2)

1·2·3·γ(γ+1)(γ+2)x3+ etc. In Commentationes

societatis regiae scientiarum Gottingensis recentiores, volume II, pages3–46, 1813. English and German translation by Christoph Koutschan.

[37] Stefan Gerhold. Uncoupling systems of linear Ore operator equa-tions. Master’s thesis, RISC, Johannes Kepler University Linz, 2002.http://www.risc.uni-linz.ac.at/research/combinat/software/OreSys/.

[38] Stefan Gerhold. Combinatorial Sequences: Non-Holonomicity and In-equalities. PhD thesis, RISC, Johannes Kepler University Linz, 2005.

[39] Stefan Gerhold, Manuel Kauers, Frank W. J. Olver, Peter Paule, CarstenSchneider, and Burkhard Zimmermann. Computer proofs of some iden-tities for Bessel functions of fractional order. In preparation, 2005.

[40] Alessandro Giovini, Teo Mora, Gianfranco Niesi, Lorenzo Robbiano, andCarlo Traverso. “one sugar cube, please” or selection strategies in theBuchberger algorithm. In ISSAC’91: Proceedings of the 1991 Interna-tional Symposium on Symbolic and Algebraic Computation, pages 49–54,New York, NY, USA, 1991. ACM.

Page 139: UNIVERSIT AT LINZ JKU - Koutschan

Bibliography 139

[41] William Gosper. Decision procedure for indefinite hypergeometric sum-mation. Proceedings of the US National Academy of Sciences, 75:40–42,1978.

[42] Israil S. Gradshteyn and Josif M. Ryzhik. Table of Integrals, Series, andProducts. Academic Press, Elsevier, seventh edition, 2007. Alan Jeffreyand Daniel Zwillinger (eds.).

[43] Gert-Martin Greuel, Gerhard Pfister, and Hans Schonemann. Sin-gular 3.1. A computer algebra system for polynomial computations,2009. Centre for Computer Algebra, University of Kaiserslautern,http://www.singular.uni-kl.de.

[44] Abdelilah Kandri-Rody and Volker Weispfenning. Non-commutativeGrobner bases in algebras of solvable type. Journal of Symbolic Com-putation, 9(1):1–26, 1990.

[45] Masaki Kashiwara. On the holonomic systems of linear differential equa-tions, II. Inventiones Mathematicae, 49(2):121–135, 1978.

[46] Manuel Kauers. Guessing handbook. Technical Report 09-07, RISC Re-port Series, Johannes Kepler University Linz, 2009. http://www.risc.uni-linz.ac.at/research/combinat/software/Guess/.

[47] Manuel Kauers and Christoph Koutschan. A Mathematica packagefor q-holonomic sequences and power series. The Ramanujan Journal,19(2):137–150, 2009. http://www.risc.uni-linz.ac.at/research/combinat/software/qGeneratingFunctions/.

[48] Manuel Kauers, Christoph Koutschan, and Doron Zeilberger. A proofof George Andrews’ and Dave Robbins’ q-TSPP conjecture (modu-lo a finite amount of routine calculations). The personal journal ofShalosh B. Ekhad and Doron Zeilberger, pages 1–8, 2009. http://www.math.rutgers.edu/˜zeilberg/pj.html.

[49] Manuel Kauers, Christoph Koutschan, and Doron Zeilberger. Proof ofIra Gessel’s lattice path conjecture. Proceedings of the US NationalAcademy of Sciences, 106(28):11502–11505, 2009.

[50] Manuel Kauers and Viktor Levandovskyy. An interface between Singularand Mathematica. http://www.kauers.de/software.html, 2006.

[51] Manuel Kauers and Doron Zeilberger. The quasi-holonomic ansatz andrestricted lattice walks. Journal of Difference Equations and Applica-tions, 14(10–11):1119–1126, 2008.

Page 140: UNIVERSIT AT LINZ JKU - Koutschan

140 Bibliography

[52] Sebastian Klein. Heavy flavor coefficient functions in deep-inelastic scat-tering at O(a2

s) and large virtualities. Diplomarbeit, Universitat Pots-dam, Germany, 2006.

[53] Wolfram Koepf. Hypergeometric Summation. An Algorithmic Approachto Summation and Special Function Identities. Advanced Lectures inMathematics. Vieweg Verlag, Braunschweig/Wiesbaden, 1998.

[54] Christoph Koutschan. HolonomicFunctions (user’s guide). Tech-nical Report 10-01, RISC Report Series, Johannes Kepler Univer-sity, Linz, Austria, 2010. http://www.risc.jku.at/research/combinat/software/HolonomicFunctions/.

[55] Viktor Levandovskyy. Non-commutative computer algebra for polyno-mial algebras: Grobner bases, applications and implementation. PhDthesis, Universitat Kaiserslautern, 2005.

[56] Viktor Levandovskyy and Jorge Martin Morales. Computational D-module theory with SINGULAR, comparison with other systems andtwo new algorithms. In ISSAC’08: Proceedings of the 2008 Interna-tional Symposium on Symbolic and Algebraic Computation, pages 173–180, New York, NY, USA, 2008. ACM.

[57] Viktor Levandovskyy and Hans Schonemann. Plural: a computer al-gebra system for noncommutative polynomial algebras. In ISSAC’03:Proceedings of the 2003 International Symposium on Symbolic and Al-gebraic Computation, pages 176–183, New York, NY, USA, 2003. ACM.

[58] Leonard Lipshitz. D-finite power series. Journal of Algebra, 122:353–373,1989.

[59] Christian Mallinger. Algorithmic Manipulations and Transformationsof Univariate Holonomic Functions and Sequences. Master’s thesis,RISC, Johannes Kepler University, August 1996. http://www.risc.uni-linz.ac.at/research/combinat/software/GeneratingFunctions/.

[60] Toshinori Oaku. Algorithms for the b-function and D-modules asso-ciated with a polynomial. Journal of Pure and Applied Algebra, 117-118:495–518, 1997.

[61] Soichi Okada. On the generating functions for certain classes of planepartitions. Journal of Combinatorial Theory, Series A, 53:1–23, 1989.

Page 141: UNIVERSIT AT LINZ JKU - Koutschan

Bibliography 141

[62] Frank W. J. Olver. DLMF chapter BS. Personal e-mail communicationwith Peter Paule, 2006.

[63] Øystein Ore. Theory of non-commutative polynomials. The Annals ofMathematics, 34(3):480–508, 1933.

[64] Peter Paule. On identities of the Rogers-Ramanujan type. Journal ofMathematical Analysis and Applications, 107:255–284, 1985.

[65] Peter Paule. Parallel algorithms in computer algebra—Zeilberger’s holo-nomic systems approach. Technical Report 90-49.0, RISC Report Series,Johannes Kepler University Linz, 1990.

[66] Peter Paule. Greatest factorial factorization and symbolic summation.Journal of Symbolic Computation, 20(3):235–268, 1995.

[67] Peter Paule and Veronika Pillwein. Automatic improvements of Wallis’inequality. Technical Report 08–18, RISC Report Series, University ofLinz, Austria, 2008.

[68] Peter Paule and Axel Riese. A Mathematica q-analogue of Zeil-berger’s algorithm based on an algebraically motivated approach to q-hypergeometric telescoping. In Mourad E. H. Ismail, David R. Masson,and Mizan Rahman, editors, Special Functions, q-Series and RelatedTopics, volume 14 of Fields Institute Communications, pages 179–210.American Mathematical Society, 1997.

[69] Peter Paule and Markus Schorn. A Mathematica version of Zeilberger’salgorithm for proving binomial coefficient identities. Journal of SymbolicComputation, 20(5/6):673–698, 1995. http://www.risc.uni-linz.ac.at/research/combinat/software/PauleSchorn/.

[70] Peter Paule and Volker Strehl. Symbolic summation—some recentdevelopments. In Computer Algebra in Science and Engineering—Algorithms, Systems, and Applications, pages 138–162. World Scientific,Singapore, 1995.

[71] Marko Petkovsek and Herbert S. Wilf. On a conjecture of Ira Gessel.Technical Report 0807.3202, arXiv, July 2008.

[72] Marko Petkovsek, Herbert S. Wilf, and Doron Zeilberger. A = B.A. K. Peters, Ltd., Wellesley MA, 1996.

Page 142: UNIVERSIT AT LINZ JKU - Koutschan

142 Bibliography

[73] Veronika Pillwein. Computer Algebra Tools for Special Functions in HighOrder Finite Element Methods. PhD thesis, Johannes Kepler UniversityLinz, 2008.

[74] Earl D. Rainville. Special Functions. Macmillan, New York, 1960.

[75] Claude Sabbah. Systemes holonomes d’equations aux q-differences. InMasaki Kashiwara, Pierre Schapira, and Teresa M. Fernandes, editors,Proceedings of the International Conference on D-Modules and Microlo-cal Geometry, 1990, University of Lisbon, pages 125–147. Walter deGruyter & Co., Berlin, 1993.

[76] Mutsumi Saito, Bernd Sturmfels, and Nobuki Takayama. Grobner De-formations of Hypergeometric Differential Equations, volume 6 of Algo-rithms and Computation in Mathematics. Springer-Verlag, Berlin, 2000.

[77] Bruno Salvy and Paul Zimmermann. GFUN: A Maple package for themanipulation of generating and holonomic functions in one variable.Rapport Technique 143, Institut National de Recherche en Informatiqueet en Automatique (INRIA), 78153 Le Chesnay Cedex, France, 1992.

[78] Carsten Schneider. Symbolic summation assists combinatorics. Semi-naire Lotharingien de Combinatoire, 56:1–36, April 2007. Article B56b,http://www.risc.uni-linz.ac.at/research/combinat/software/Sigma/.

[79] Richard Stanley. Differentiably finite power series. European Journal ofCombinatorics, 1:175–188, 1980.

[80] Richard Stanley. A baker’s dozen of conjectures concerning plane par-titions. In Gilbert Labelle and Pierre Leroux, editors, CombinatoireEnumerative, number 1234 in Lecture Notes in Mathematics, pages 285–293. Springer-Verlag Berlin/Heidelberg/New York, 1986.

[81] John Stembridge. The enumeration of totally symmetric plane parti-tions. Advances in Mathematics, 111:227–243, 1995.

[82] Thomas Stoll and Jiang Zeng. On the total weight of weighted matchingsof segment graphs. The Electronic Journal of Combinatorics, 16(1):R56,2009.

[83] Gilbert Strang. A Legendre identity. Personal e-mail to Peter Paule, 19April 2002.

Page 143: UNIVERSIT AT LINZ JKU - Koutschan

Bibliography 143

[84] Nobuki Takayama. An algorithm of constructing the integral of amodule—an infinite dimensional analog of Grobner basis. In ISSAC’90:Proceedings of the International Symposium on Symbolic and AlgebraicComputation, pages 206–211, New York, NY, USA, 1990. ACM.

[85] Nobuki Takayama. Grobner basis, integration and transcendental func-tions. In ISSAC’90: Proceedings of the International Symposium onSymbolic and Algebraic Computation, pages 152–156, New York, NY,USA, 1990. ACM.

[86] Nobuki Takayama. An approach to the zero recognition problem byBuchberger algorithm. Journal of Symbolic Computation, 14(2-3):265–282, 1992.

[87] Harrison Tsai. Algorithms for algebraic analysis. PhD thesis, Universityof California, Berkeley, 2000.

[88] Harrison Tsai. Weyl closure of a linear differential operator. Journal ofSymbolic Computation, 29(4-5):747–775, 2000.

[89] Alfred van der Poorten. A proof that Euler missed—Apery’s proof ofthe irrationality of ζ(3). An informal report. Mathematical Intelligencer,1:195–203, 1979.

[90] Kurt Wegschaider. Computer generated proofs of binomial multi-sumidentities. Master’s thesis, RISC, Johannes Kepler University Linz,May 1997. http://www.risc.uni-linz.ac.at/research/combinat/software/MultiSum/.

[91] Herbert S. Wilf and Doron Zeilberger. An algorithmic proof theory forhypergeometric (ordinary and “q”) multisum/integral identities. Inven-tiones Mathematicae, 108(1):575–633, 1992.

[92] Doron Zeiberger. A fast algorithm for proving terminating hypergeo-metric identities. Discrete Mathematics, 80(2):207–211, 1990.

[93] Doron Zeilberger. A holonomic systems approach to special func-tions identities. Journal of Computational and Applied Mathematics,32(3):321–368, 1990.

[94] Doron Zeilberger. The method of creative telescoping. Journal of Sym-bolic Computation, 11:195–204, 1991.

Page 144: UNIVERSIT AT LINZ JKU - Koutschan

144 Bibliography

[95] Doron Zeilberger. The HOLONOMIC ANSATZ II. Automatic DIS-COVERY(!) and PROOF(!!) of Holonomic Determinant Evaluations.Annals of Combinatorics, 11:241–247, 2007.

[96] Doron Zeilberger. (Okada) is nice, but to get the promised $100, youneed to do (Soichi) first. Personal e-mail communication with ChristophKoutschan, 2009.

[97] B. Zurcher. Rationale Normalformen von pseudo-linearen Abbildungen.Diplomarbeit, ETH Zurich, 1994.

Page 145: UNIVERSIT AT LINZ JKU - Koutschan

Index

∂-finite, 19, 24, 27, 28–44, 47, 49, 50,52, 55–59, 62, 65, 67, 68, 75–78, 86, 90, 92, 95, 102, 114,115, 126, 128, 129, 131

3D Ferrers diagram, 122, 123

Abramov’s algorithm, 56, 57, 83Abramov, Sergej, 56, 85Abramov-Zima algorithm, 56, 85Algebra, 76algebra

differential, 25free, 18Ore, 25, 26–37, 39, 42, 44, 47, 49,

52, 55, 58, 62, 67, 69, 70, 74–76, 78, 99, 114

shift, 19, 24, 27Weyl, 17, 18, 19, 20, 22, 24–26,

38, 40, 51, 68, 73, 99algorithm

Abramov’s, 56, 57, 83Abramov-Zima, 56, 85Buchberger’s, 72, 99, 106, 130Chyzak’s, 55, 57, 59, 65, 77, 82,

85, 86, 130Euclidean division, 26extended Euclidean, 35FGLM, 30, 31, 34, 36, 58, 75, 118Gosper’s, 55–57Sister Celine’s, 59Takayama’s, 47, 51, 54, 55, 63,

67, 74, 86, 91, 93, 105, 130Zurcher’s, 56, 85Zeilberger’s fast, 48, 57, 58, 98

Zeilberger’s slow, 47, 48, 51, 54,55, 63, 71, 129

Almkvist, Gert, 51Andrews, George, 121, 122, 133annihilating module, 117Annihilator, 75, 77–80, 87, 89–92,

94, 96, 98, 110, 111, 114annihilator, 18, 21, 32, 39–41, 117AnnihilatorDimension, 78, 96antiderivative, 56, 57antidifference, 55, 56Antosiewicz, Henry, 66Apery’s proof, 45ApplyOreOperator, 79, 80, 89

Barkatou, Moulay, 56, 85basis function, 109, 110, 113–116Bernstein dimension, 20–22, 37Bernstein’s inequality, 21, 22Bernstein, Joseph, 21, 23Bessel differential equation, 28Bessel function

modified, of the first kind, 42, 73,75

modified, of the second kind, 42,89

of the first kind, 32, 42, 90, 92of the second kind, 32, 42of the third kind, 32spherical, of the first kind, 86, 90,

92binomial sum, 47block order, 48Boros, George, 42

145

Page 146: UNIVERSIT AT LINZ JKU - Koutschan

146 Index

Bostan, Alin, 103Bronstein, Manuel, 26Buchberger’s algorithm, 72, 99, 106,

130Buchberger’s criterion, 29, 72, 73Buchberger, Bruno, 14, 65, 72

canonical basis, 18canonical form, 18, 68Catalan number, 24chain criterion, 72ChangeMonomialOrder, 69ChangeOreAlgebra, 69Chebyshev polynomial of the second

kind, 78Chyzak’s algorithm, 55, 57, 59, 65,

77, 82, 85, 86, 130, 131Chyzak, Frederic, 13, 43, 51, 55, 57,

78, 130closure property, 24, 30, 39, 42–44,

62, 65, 75, 76–78, 80, 95, 112,118, 119

operator application, 31, 79, 92,112, 132

product, 33, 62, 98, 129substitution, 35, 36, 62, 90, 129sum, 33, 93, 99, 131, 132

conjectureq-TSPP, 121, 133Gessel’s, 101, 102, 105–107Petkovsek-Wilf, 107

contiguous relation, 80continuous variable, 16, 19, 24, 27,

30, 34, 75, 90, 92Copernicus, Nicolaus, 116cosine integral, 92Coutinho, Severino, 22creative telescoping, 42, 44, 45, 48,

58, 111, 121, 129CreativeTelescoping, 64, 86, 89,

96, 98, 111

critical pair, 72curl operator, 113

D-finite, 17, 38D-module, 20, 23, 24, 40Delta, 67delta part, 45, 49, 51–54, 58, 62–64,

70, 71, 84, 87, 89, 93, 95, 105,111, 112, 131

Der, 67DESY, 94DFiniteOreAction, 75, 79, 112DFinitePlus, 75, 131DFiniteSubstitute, 75, 76, 129DFiniteTimes, 75, 98, 129DFiniteTimesHyper, 76difference operator, 15, 47, 67DifferenceRoot, 41differential algebra, 25differential operator, 15, 67DifferentialRoot, 41Dirac delta, 38discrete variable, 16, 24, 30, 75, 92DSolvePolynomial, 84DSolveRational, 84DSystemSolvePolynomial, 85DSystemSolveRational, 85

electric field, 113electromagnetic wave, 112Eliminate, 80elimination property, 23, 38, 39, 41,

48, 53error function, 19Euclidean algorithm, 35Euclidean division, 26Euler, 67Euler operator, 16, 24, 67exponential function, 19, 118Extended, 54, 63, 73, 93extended Euclidean algorithm, 35

Page 147: UNIVERSIT AT LINZ JKU - Koutschan

Index 147

extension/contraction, 40, 49, 50, 63,110, 115

factorial, 36, 91Fasenmyer, Celine, 59Faugere, Jean Charles, 30, 75Ferrers diagram, 122, 123Feynman integral, 94Feynman, Richard, 45FGLM, 75FGLM algorithm, 30, 31, 34, 36, 58,

75, 118Fibonacci number, 15filtered module, 20filtration, 20FindRelation, 63, 80, 81, 110, 112,

115FindSupport, 116finite element method, 109–111forward difference, 15free algebra, 18

Gollnitz-Gordon identities, 97Galerkin finite element, 112Gamma function, 28, 29, 92Gauß, Carl Friedrich, 80Gegenbauer polynomial, 40GeneratingFunctions, 19Gerhold, Stefan, 66, 85, 130Gessel walk, 101, 102, 106, 107Gessel’s lattice path conjecture, 101,

102, 105–107Gessel, Ira, 101gfun, 19Gianni, Patrizia, 30, 75GlobalNormalizeFactors, 106Gosper’s algorithm, 55–57Gosper, William, 55Grobner basis, 14, 22, 29, 30, 32–34,

36, 40, 47, 48, 50–62, 65, 72,73–77, 82, 84, 87, 89, 91, 93,

99, 105, 110, 114–116, 119,126, 127, 129–132

graded module, 20guessing, 103, 105, 108, 126

Hankel function, 32Hermite polynomial, 15, 57Hilbert dimension, 43Hilbert polynomial, 20, 21holonomic, 17, 19–21, 22, 23–25, 28,

30, 37–41, 47–49, 53, 57, 58,92

holonomic system, 23hyperbolic sine, 75hyperexponential, 29, 39, 41, 55, 76hypergeometric, 39, 47, 55, 57–59, 76hypergeometric function 2F1, 80

Incomplete, 106inhomogeneous part, 29, 46, 47, 51,

62, 63, 88, 89, 94–96, 105,111, 112

initial value, 23, 28, 29, 42, 43, 71,86, 88–91, 93, 95–97, 99, 104,106, 126, 128, 129, 131, 132

integralcosine, 92Feynman, 94probability, 19sine, 86, 92Strang’s, 61Wallis’s, 67, 71, 74, 78

integrated Jacobi polynomial, 111,112

Jacobi polynomial, 42, 110–113

Kashiwara, Masaki, 38Kauers, Manuel, 43, 66, 78, 99, 101,

103, 105, 108, 121, 126Koutschan, Christoph, 66Kronecker delta, 30

Page 148: UNIVERSIT AT LINZ JKU - Koutschan

148 Index

Laplace expansion, 125Lazard, Daniel, 30, 75LeadingCoefficient, 72LeadingExponent, 72LeadingPowerProduct, 72, 74LeadingTerm, 72left ideal, 18Legendre polynomial, 62, 90, 113Leibniz law, 17, 25Levandovskyy, Viktor, 99, 100lexicographic order, 48, 71, 75, 104localization, 26logarithm, 92, 118

magnetic field, 113Maximon, Leonard, 66Maxwell’s equations, 113Method, 72Mgfun, 13modified Bessel function of the first

kind, 42, 73, 75modified Bessel function of the sec-

ond kind, 42, 89ModuleBasis, 74Modulus, 106Moll, Victor, 42monomial, 15monomial order, 48, 49, 53, 61, 69,

75, 83, 104, 110Mora, Teo, 30, 75multiindex, 15MultiSum, 59

natural boundaries, 47, 49, 51, 53,55, 62, 63, 71, 91, 105, 130

non-holonomic function, 43, 44, 78,95, 96

NonCommutativeMultiply, 70Normal, 69normal strategy, 72NormalizeCoefficients, 72, 84

NormalizeVector, 81, 85numerical analysis, 109

Okada, Soichi, 123Olver, Frank, 65, 94Ore algebra, 25, 26–37, 39, 42, 44, 47,

49, 51, 52, 55, 58, 62, 67, 69,70, 74–76, 78, 99, 114

Ore extension, 25, 26, 67, 68Ore operator, 16, 27, 28, 37, 38, 44,

45, 48, 56, 60, 67, 69, 75, 77,79, 87, 92

Ore, Øystein, 25OreAction, 67OreAlgebra, 68, 69, 73–76, 82, 110OreAlgebraObject, 68OreDelta, 67OreGroebnerBasis, 62, 73, 74, 85,

93, 99, 106, 110OrePlus, 70OrePolynomial, 68, 83OrePolynomialDegree, 72OrePolynomialList-

Coefficients, 72, 83, 85OrePolynomialSubstitute, 70, 111OrePower, 70OreReduce, 74, 83–85OreSigma, 67OreSys, 85, 130OreTimes, 70orthogonal polynomial, 40, 109, 113

P-finite, 18, 19, 38, 92, 126pair selection strategy, 72, 106Pascal’s rule, 49Pattern, 80Paule, Peter, 48, 61, 62, 65, 66, 122Petkovsek, Marko, 26, 107Pillwein, Veronika, 110, 116plane partition, 122

totally symmetric, 121, 123

Page 149: UNIVERSIT AT LINZ JKU - Koutschan

Index 149

Pochhammer symbol, 96polygamma function, 92polylogarithm, 96polynomial

Chebyshev, of the second kind, 78Gegenbauer, 40Hermite, 15, 57Hilbert, 20, 21integrated Jacobi, 111, 112Jacobi, 42, 110–113Legendre, 62, 90, 113orthogonal, 109, 113

polynomial ansatz, 50, 59, 64, 121polynomial ring, 15van der Poorten, Alfred, 45position over term, 53, 105power product, 15principal part, 45, 48, 49, 53, 54, 58,

59, 62–64, 70, 82, 84, 85, 87,105, 112, 130–132

probability integral, 19product criterion, 29, 72, 73prooemium, 13proper hypergeometric, 48, 57Pythagorean identity, 71

q-binomial coefficient, 98q-Pochhammer symbol, 97q-shift operator, 16, 67qGeneratingFunctions, 98QS, 67quasi-holonomic ansatz, 104qZeil, 98

rectangular system, 28–30, 38, 42ring of solvable type, 14, 71RISC, 13, 14, 65, 94, 97, 100rising factorial, 96Robbins, Dave, 121, 133rotor, 113RSolvePolynomial, 84

RSolveRational, 83

S, 67S-polynomial, 22, 130Salvy, Bruno, 43, 51, 78Saturate, 52Schoberl, Joachim, 112, 116Schonemann, Hans, 100Schneider, Carsten, 66, 94, 122shift algebra, 19, 24, 27shift operator, 15, 67Sigma, 94, 122simple system, 85sine integral, 86, 92singularity, 28, 106, 126, 128, 129, 131Sister Celine’s technique, 59skew Leibniz law, 26, 33Sobolev space, 109SolveCoupledSystem, 84, 85SolveOreSys, 85spherical Bessel function of the first

kind, 86, 90, 92standard monomial, 18, 68, 118Stanley, Richard, 17Stembridge, John, 121Stirling number

of the first kind, 29, 43, 44of the second kind, 44, 96

Stoll, Thomas, 78, 79Strang’s integral, 61Strang, Gilbert, 61strategy

elimination, 72, 106normal, 72pairsize, 72sugar, 72

structure set, 50, 59, 60, 64, 80, 126Struve function, 28sugar strategy, 72Support, 72, 80–82, 111

Page 150: UNIVERSIT AT LINZ JKU - Koutschan

150 Index

support, 15, 58, 59, 61, 80–82, 85,111, 115, 116, 120, 130, 131

Sylvester’s dialytic elimination, 48

Takayama, 52, 54, 63, 91, 93Takayama’s algorithm, 47, 51, 54, 55,

63, 67, 74, 86, 91, 93, 105, 130Takayama, Nobuki, 51, 54, 130telescoping operator, 45–47, 49, 53,

54, 58, 59, 64, 71, 82, 84, 85,87, 105, 111

test function, 109tetrahedral p-FEM, 111Theorem

Okada’s, 123Stembridge’s TSPP, 121, 123

ToOrePolynomial, 69, 76, 82, 84totally symmetric plane parti-

tion, 121, 123Tsai, Harrison, 40TSPP, 121–124

UnderTheStaircase, 82, 89, 94

variational formulation, 109

Wallis’s integral, 67, 71, 74, 78, 90,93

weak derivative, 109Wegschaider, Kurt, 59Weyl algebra, 17, 18, 19, 20, 22, 24–

26, 37, 38, 40, 51, 68, 73, 99Weyl closure, 40Whittaker hypergeometric

function, 77Wilf, Herbert, 39, 107

Zurcher’s algorithm, 56, 85Zeilberger’s fast algorithm, 48, 57, 58,

98Zeilberger’s slow algorithm, 47, 48,

51, 54, 55, 63, 71, 129

Zeilberger, Doron, 23, 39, 45, 47, 48,51, 55, 101, 107, 121, 124,129, 132

Zeng, Jiang, 78, 79Zimmermann, Burkhard, 66

Page 151: UNIVERSIT AT LINZ JKU - Koutschan

Curriculum Vitae

Personal Data

Name Christoph Bernhard KoutschanDate of birth December 12, 1978Place of birth Dillingen an der Donau, GermanyNationality German

Contact

Affiliation Research Institute for Symbolic Computation (RISC)Johannes Kepler University LinzAltenberger Straße 694040 Linz, Austriahttp://www.risc.uni-linz.ac.at

E-mail [email protected] http://www.risc.uni-linz.ac.at/people/ckoutsch/

Education

1998 Abitur (high school graduation) at Gymnasium Casimiri-anum Coburg

1999–2005 Studies in Computer Science at Friedrich-Alexander Uni-versity Erlangen-Nurnberg

2005 Diploma degree (Dipl.-Inf.)Diploma thesis: Regular Languages and Their GeneratingFunctions: The Inverse Problem. (advised by Prof. Dr.Volker Strehl)

2005–2009 Doctorate studies in Symbolic Computation at RISC-Linz