Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer...

29
unilogo CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale Preliminary Training: Computer Algebra, Power Series and Summation Prof. Dr. Wolfram Koepf University of Kassel www.mathematik.uni-kassel.de/˜koepf AIMS-Volkswagen Stiftung Workshop on Introduction to Orthogonal Polynomials and Applications Preliminary Training 12 October 6, 2018

Transcript of Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer...

Page 1: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Preliminary Training:Computer Algebra,

Power Series and Summation

Prof. Dr. Wolfram Koepf

University of Kassel

www.mathematik.uni-kassel.de/˜koepf

AIMS-Volkswagen Stiftung Workshop onIntroduction to Orthogonal Polynomials and Applications

Preliminary Training 12October 6, 2018

Page 2: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Online Demonstrations with Computer Algebra

Computer Algebra SystemsI will use the computer algebra system Maple to programand demonstrate the considered methods.Of course one could also easily use any other generalpurpose system like Mathematica, Maxima, Reduce orSage.

Needed AlgorithmsThe mostly used algorithms are:

Algorithms of Linear Algebra with many variables andcoefficients that are rational functions,multivariate polynomial factorization.

Page 3: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Online Demonstrations with Computer Algebra

General-Purpose Computer Algebra Systemscontain a high level programming language,are dialog-oriented and not compiling,are able to plot functions,and can compute with symbols.

High-End AlgorithmsModular arithmetic,algebraic numbers,solving polynomial systems,differentiation and integration,solving differential equations,Taylor polynomials and power series.

Page 4: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Example: Taylor Series

Robertson Conjecture I

The coefficients Bk (x) of the power series√√√√(1+z1−z

)x− 1

2xz=∞∑

k=0

Bk (x) zk

are polynomials of degree k .In a 1976 publication Malcolm S. Robertson conjecturedthat the coefficients of all these polynomials Bk (x) arenon-negative. He had computed Bk (x) for 1 5 k 5 6.This conjecture was repeated in an article published byRobertson in 1989.

Page 5: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Example: Taylor Series

Robertson Conjecture IIIn this 1989 publication Robertson further conjectured thatthe coefficients Ak of the univariate power series√

ex − 1x

=∞∑

k=0

Ak xk

are all positive.It turns out that both conjectures are false!MapleBy these computations both conjectures are disproved.This result was published in 1991.Please notice that the reviewing process of my articlealmost 30 years ago was still very hard!

Page 6: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Formal Power Series

Power Series RepresentationsSometimes one is not only interested in a Taylorpolynomial approximation, but in the full Taylor series.Assume, given an expression f (x) depending of thevariable x , we would therefore like to compute a formula forthe coefficient ak of the power series

f (x) =∞∑

k=0

ak xk

representing f (x).A well-known example of that type is given by

sin x =∞∑

k=0

(−1)k

(2k + 1)!x2k+1 .

Page 7: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Formal Power Series

Algorithm FPS (Koepf, 1992)

Input: expression f (x)

HolonomicDE: Determine a holonomic differential equationDE (i.e. homogeneous and linear with polynomialcoefficients) by computing the derivatives of f (x) iteratively.DEtoRE: Convert DE to a holonomic recurrence equationRE for ak .RSolve: Solve RE for ak .

Output: ak resp.∞∑

k=0akxk

ExamplesMaple

Page 8: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Computation of Holonomic Differential Equations

Algorithm HolonomicDE (Koepf, 1992)

Input: expression f (x)

Compute c0f (x) + c1f ′(x) + · · ·+ f (J)(x) with stillundetermined coefficients cj .Sort this linear combination w.r.t. linearly independentfunctions over Q(x) and determine their coefficients∈ Q(x).Set these coefficients zero, and solve the correspondinglinear system for the unknowns c0, c1, . . . , cJ−1.Output: DE := c0f (x) + c1f ′(x) + · · ·+ f (J)(x) = 0 (or elsemultiply by the common denominator of the cjs).

ExamplesMaple

Page 9: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Algebraic Properties

Algebraic Perspective

The existence of a holonomic DE shows that thedimension of the vector space

Vf = 〈f (x), f ′(x), f ′′(x), . . .〉

over the field of rational functions Q(x) is finite.

Algorithms (Stanley, 1980), Maple (Salvy, Zimmermann, 1994)

Let a function f (x) be given by a holonomic differentialequation DE1 of order n, and let a function g(x) be givenby a holonomic differential equation DE2 of order m.Then there are linear algebra algorithms showing that f + gis holonomic of degree 5 n + m, and f · g is holonomic ofdegree 5 n ·m.Maple

Page 10: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Holonomic Functions

Normal FormBy their algebraic properties the ring of holonomicfunctions has a so-called normal form which consists of thedifferential equation together with enough initial values.The same is true for the ring of holonomic sequenceswhose normal form consists of their recurrence equationtogether with enough initial values.By computing their normal forms two functions can beidentified as identical!MapleA function is holonomic iff it is the generating function of aholonomic sequence.Unfortunately, holonomic functions are not closed underdivision. Example: tan x = sin x

cos x .

Page 11: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Hypergeometric Functions

Generalized Hypergeometric Series

A very rich class of holonomic functions are thehypergeometric functions / series.The formal power series

pFq

(a1, . . . ,ap

b1, . . . ,bq

∣∣∣∣∣ z)

=∞∑

k=0

Ak zk =∞∑

k=0

αk ,

whose summands αk = Akzk have a rational term ratio

αk+1

αk=

Ak+1 zk+1

Ak zk =(k + a1) · · · (k + ap)

(k + b1) · · · (k + bq)

z(k + 1)

,

is called the generalized hypergeometric series.

Page 12: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Hypergeometric Functions

Hypergeometric Terms

For this purpose, the summand αk = Akzk of a hypergeometricseries is called a hypergeometric term.

Formula for Hypergeometric Terms

For the coefficients of the generalized hypergeometric functionone gets the following formula using the shifted factorial(Pochhammer symbol) (a)k = a(a + 1) · · · (a + k − 1)

pFq

(a1, . . . ,ap

b1, . . . ,bq

∣∣∣∣∣ z)

=∞∑

k=0

(a1)k · · · (ap)k

(b1)k · · · (bq)k

zk

k !.

Page 13: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Hypergeometric Terms

First Order Holonomic Recurrence EquationsTherefore every holonomic recurrence equation of firstorder defines a hypergeometric term which can bedetermined by the hypergeometric coefficient formula.If the recurrence is brought into the form

αk+1

αk=

(k + a1) · · · (k + ap)

(k + b1) · · · (k + bq)

z(k + 1)

,

or, equivalently

(k+b1) · · · (k+bq)(k+1)αk+1−(k+a1) · · · (k+ap) z αk = 0 ,

then αk is given by

αk =(a1)k · · · (ap)k

(b1)k · · · (bq)k

zk

k !·α0 .

Page 14: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Identification of Hypergeometric Functions / Terms

Algorithm Sumtohyper (Koepf 1998)The above method provides an algorithm to detect thehypergeometric representation for

S =∞∑

k=0

αk .

Input: αk

Computerk :=

αk+1

αk∈ Q(k) .

Factorize rk .Output: Read off upper and lower parameters, theargument z, and compute an initial value.

Page 15: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Identification of Hypergeometric Functions / Terms

ExampleFor

sin x =∞∑

k=0

αk =∞∑

k=0

(−1)k

(2k + 1)!x2k+1 ,

we get

rk =αk+1

αk= − x2

2(k + 1)(2k + 3)∈ Q(x , k)

andα0 = x .

Thereforesin x = x · 0F1

(−

3/2

∣∣∣∣∣−x2

4

).

Maple

Page 16: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Page 17: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Fasenmyer’s Algorithm (1949)

Binomial sumsThe sum evaluation

n∑k=0

(nk

)= 2n

is well-known.However, the similar, but more advanced identities

n∑k=0

k(

nk

)= n 2n−1 and

n∑k=0

(nk

)2

=

(2nn

)might be less known.Our question is: How can we compute the right hand sides,given the sums on the left?Maple

Page 18: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Fasenmyer’s Algorithm (1949)

Applying k -free recurrence for the summand

Consider the sum

Sn :=n∑

k=0

F (n, k) withF (n+1, k)

F (n, k),F (n, k +1)

F (n, k)∈ Q(n, k).

F (n, k) is a hypergeometric term w r. t. k and n.Fasenmyer’s idea is to find first a k -free recurrence for thesummand F (n, k):

J∑j=0

I∑i=0

aij F (n + j , k + i) = 0 for some aij ∈ Q(n) .

This can be done by linear algebra!Since the recurrence is k -free, it can be summed fork = −∞, . . . ,∞ to get a pure recurrence for the sum Sn.

Page 19: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Fasenmyer’s Algorithm (1949)

ExampleFor

F (n, k) =

(nk

)and Sn =

n∑k=0

(nk

)=

∞∑k=−∞

(nk

)the first step yields the Pascal triangle identity

F (n + 1, k + 1) = F (n, k + 1) + F (n, k) .

If we sum this relation for k = −∞, . . . ,∞, we clearly get

Sn+1 = Sn + Sn = 2 Sn .

Since S0 = 1, we finally have Sn = 2n.Maple

Page 20: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Gosper’s Algorithm (1978)

AntidifferenceGiven ak , a sequence sk is called an antidifference of ak if

ak = sk+1 − sk .

Given such an antidifference, then by telescoping the sumcan be computed with arbitrary lower and upper bounds:

n∑k=m

ak = (sn+1 − sn) + (sn − sn−1) + · · ·+ (sm+1 − sm)

= sn+1 − sm .

Gosper’s algorithm computes a hypergeometric termantidfference sk for a hypergeometric term ak , i.e.

ak+1

ak∈ Q(k) .

Page 21: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Gosper’s Algorithm (1978)

Computational stepsGiven ak with ak+1

ak=

uk

vk

with polynomials uk , vk ∈ Q[k ], it is easy to show that

sk =gk

hkak

for certain polynomials gk ,hk ∈ Q[k ].Whereas the denominator hk can be written down explicitly,for gk one gets the inhomogeneous recurrence equation

hk uk gk+1 − hk+1 vk gk = hk hk+1 vk .

To compute gk one first finds a degree bound for gk .The final step uses linear algebra to compute thecoefficients of gk by equating coefficients.

Page 22: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Gosper’s Algorithm (1978)

Gosper’s implementationGosper’s algorithm was maybe the first algorithm whichwould not have been found without computer algebra. Inhis paper Gosper stated:Without the support of MACSYMA and its developers, Icould not have collected the experiences necessary toprovoke the conjectures that led to this algorithm.

Examples

An antidifference of ak = (−1)k (nk

)is sk = − k

n ak .

The harmonic numbers Hn =∑n

k=11k cannot be written as

hypergeometric term.Maple

Page 23: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Zeilberger’s Algorithm (1990)

Applying Gosper’s algorithm successfully to definite sumsZeilberger’s algorithm deals again—like Fasenmyer’s—withdefinite sums of the form

Sn :=n∑

k=0

F (n, k) withF (n+1, k)

F (n, k),F (n, k +1)

F (n, k)∈ Q(n, k).

Applying Gosper to F (n, k) w. r. t. k (by telescoping)always generates the identity Sn = 0.Therefore this algorithm generally does not work.Doron Zeilberger’s idea: Apply Gosper instead to

ak := F (n, k) +J∑

j=1

σj F (n + j , k) for some J = 1 .

Page 24: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Zeilberger’s Algorithm (1990)

Applying Gosper’s algorithm successfully to definite sums

Doron Zeilberger’s idea: Apply Gosper instead to

ak := F (n, k) +J∑

j=1

σj F (n + j , k) for some J = 1 .

In the final linear algebra step, solve not only for thecoefficients of gk , but also for σj , (j = 1, . . . , J).If successful, then this algorithm generates the recurrenceequation

Sn +J∑

j=1

σj Sn+j = 0

with rational functions σj ∈ Q(n), (j = 1, . . . , J) for Sn.Multiplication with the common denominator yields aholonomic recurrence equation for Sn.

Page 25: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Doron Zeilberger

Page 26: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Online Orthogonal Polynomials

CAOP = Computer Algebra and Orthogonal Polynomials

CAOP is a web tool for calculating formulas for orthogonalpolynomials belonging to the Askey-Wilson scheme usingMaple.The implementation of CAOP was originally done by RenéSwarttouw as part of the Askey-Wilson Scheme Projectperformed at RIACA in Eindhoven in 2004.The present site is a completely revised version of thisproject which has been done by Torsten Sprenger undermy supervision in 2012 and is maintained at the Universityof Kassel.http://www.caop.org/

Page 27: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Petkovšek’s Algorithm (1992)

Hypergeometric solutions of holonomic recurrences

Assume, Sn is a hypergeometric term, howeverZeilberger’s algorithm generates not the recurrence of firstorder, but a holonomic recurrence of higher order

RE :J∑

j=0

Pj(n) Sn+j = 0

with polynomial coefficients Pj ∈ Q[n].Then Petkovšek’s algorithm—which is quite similar toGosper’s—finds every solution which is a linearcombination of hypergeometric terms.Maple

Page 28: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

Van Hoeij’s Algorithm (1999)

Hypergeometric solutions of holonomic recurrences

Combining Zeilberger’s with Petkovšek’s algorithm leads toa decision procedure for hypergemetric term summation.However, Petkovšek’s algorithm is rather inefficient.Mark van Hoeij gave a much faster algorithm for the samepurpose, based on the singularity behavior of theconstituting Γ functions that occur in the solutions.Van Hoeij’s algorithm is implemented in Maple. Details canbe found in my book.Maple

Page 29: Preliminary Training: Computer Algebra, Power Series and ... · Online Demonstrations with Computer Algebra Computer Algebra Systems I will use the computer algebra system Maple to

unilogo

CA FPS – Holonomic Algebra Hypergeometrics Fasenmyer Gosper Zeilberger Petkovšek/van Hoeij Finale

I would like to thank you very much for your interest!