29
Algorithmic Variations on Linear Differential Equations Bruno Salvy Inria & ENS de Lyon MBM’2014

Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Algorithmic Variations on Linear Differential Equations

Bruno Salvy Inria & ENS de Lyon

MBM’2014

Page 2: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Computer Algebra

• Systems with millions of users

• A scientific area: effective mathematics and their complexity

• 30 years of progress in mathematical algorithms

2

Thesis in this talk: linear differential equations are a good data-structure.

Page 3: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Menu dégustation

1. Equations as a data-structure

2. Guess & Prove combinatorial walks

3. Proofs of identities

4. Sums and Integrals

5. Numerical evaluation via the Taylor series

6. Chebyshev expansions

Page 4: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

I. Equations as adata-structure

erf := (y00 + 2xy

0 = 0, ini. cond.)

basis of the gfun package

Page 5: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Dynamic Dictionary of Mathematical Functions

• User need

• Recent algorithmic progress

• Maths on the web

http://ddmf.msr-inria.inria.fr/

Heavy work by F. Chyzak

Page 6: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Demonstration

Page 7: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

II. Guess & Prove Combinatorial Walks

Page 8: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Gessel's walks in the 1/4-plane

G(x, y, t) :=X

n�0

X

i,j

fi,j;nxiy

jt

n

• 79 inequivalent step sets (MBM & Mishna); • long history of special cases; • Gessel’s was left; • conjectured not soln of LDE.

Thm. [Bostan-Kauers 2010]G is algebraic!

Computer-driven discovery & proof.

Page 9: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Computation

G(x, y, t) :=X

n�0

X

i,j

fi,j;nxiy

jt

n

• Compute G up to t1000; • conjecture LDE with 1.5 million coeffs! • check for sanity (bit size, more coeffs, Fuchsian, p-curvature); • oh! • conjecture polynomials (deg ≤ (45,25,25), 25 digit coeffs); • Proof by (big) resultants.

Page 10: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

The 79 cases: finite and infinite groups

79 step sets

23 admit a finite group[Mishna’07]

56 have an infinite group[Bousquet-Melou-Mishna’10]

all are holonomic19 transcendental[Gessel-Zeilberger’92]

[Bousquet-Melou’02]

4 are algebraic(3 Kreweras-type + Gessel)

[BMM’10] + [B.-Kauers’10]

�! all non-holonomic• [Mishna-Rechnitzer’07] and

[Melczer-Mishna’13] for 5 singular cases

• [Kurkova-Raschel’13] and

[B.-Raschel-Salvy’13] for all others

20/45

[Slide borrowed from A. Bostan]

Page 11: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Proving no LDE exists

• log(n), na (a∉Z), pn, e√n, Γ(n√2),... by their asymptotic behavior, or that of their generating function (with P. Flajolet & S. Gerhold).

11

• walks in the 1/4-plane (with A. Bostan & K. Raschel) � :=

X

(i,j)2S

x

iy

j

c :=@2�@x@yq

@2�@x2 · @2�

@y2

(x0

, y0

)

arccos(c)/⇡ 62 Q

Page 12: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

III. Proofs of Identities

Page 13: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Proof technique> series(sin(x)^2+cos(x)^2-1,x,4);

O(x4)

Why is this a proof?

1. sin and cos satisfy a 2nd order LDE: y’’+y=0; 2. their squares and their sum satisfy a 3rd order LDE; 3. the constant -1 satisfies y’=0; 4. thus sin2+cos2-1 satisfies a LDE of order at most 4; 5. Cauchy’s theorem concludes.

Proofs of non-linear identities by linear algebra!

f satisfies a LDE⟺

f,f ’,f ’’,… live in a finite-dim. vector space

Page 14: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Example: Mehler’s identity for Hermite polynomials

1X

n=0

Hn

(x)Hn

(y)un

n!=

exp

⇣4u(xy�u(x2+y

2))1�4u

2

p1� 4u2

1. Definition of Hermite polynomials: recurrence of order 2;

2. Product by linear algebra: Hn+k(x)Hn+k(y)/(n+k)!, k∈ℕgenerated over (x,n) by → recurrence of order at most 4;

3. Translate into differential equation.

QHn(x)Hn(y)

n!,Hn+1(x)Hn(y)

n!,Hn(x)Hn+1(y)

n!,Hn+1(x)Hn+1(y)

n!

Page 15: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Guess & prove continued fractions (with S. Maulat)

arctan x =x

1+13x

2

1+415x

2

1+935x

2

1+ · · ·

1. Differential equation produces first terms (easy):

2. Guess a formula (easy): an =n2

4n2 � 1

3. Prove that the CF with these an satisfies the differential equation.

No human intervention needed.

Taylor Continuedfraction

Page 16: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Automatic Proof of the guessed CF

• Aim: RHS satisfies (x2+1)y’-1=0; • Convergents Pn/Qn where Pn and Qn satisfy a LRE

(and Qn(0)≠0); • Define Hn:=(Qn)2((x2+1)(Pn/Qn)’-1); • Hn is a polynomial in Pn,Qn and their derivatives; • therefore, it satisfies a LRE that can be computed; • from it, Hn=O(xn) visible, ie lim Pn/Qn soln; • conclude Pn/Qn➝ arctan (check initial cond.).

arctan x?=

x

1+· · ·

1+n2

4n2�1x2

1+ · · ·

More generally: this guess-and-proof approach applies to CF for solutions of (q-)Ricatti equations → all explicit C-fractions in Cuyt et alii.

Page 17: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

IV. Sums and Integrals

Page 18: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Creative telescoping

Input: equations (differential for f or recurrence for u).

Output: equations for the sum or the integral.

Method: integration (summation) by parts and differentiation (difference) under the integral (sum) sign

Example (with Pascal’s triangle):

Algorithms: reduce the search space.

I(x) =

Zf(x, t) dt =? or S(n) =

X

k

u(n, k) =?

u(n, k) =

✓n

k

◆def. by

⇢✓n+ 1

k

◆=

n+ 1

n+ 1� k

✓n

k

◆,

✓n

k+ 1

◆=

n� k

k+ 1

✓n

k

◆�

S(n+ 1) =X

k

✓n+ 1

k

◆=

X

k

✓n+ 1

k

◆�✓n+ 1

k+ 1

| {z }telesc.

+

✓n

k+ 1

◆�✓n

k

| {z }telesc.

+2

✓n

k

◆= 2S(n).

Page 19: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Telescoping Ideal

• hypergeometric summation: dim=1 + param. Gosper. [Zeilberger]

• holonomy: restrict int. by parts to and Gröbner bases. [Wilf-Zeilberger]

• finite dim, Ore algebras & GB (with F. Chyzak)

• infinite dim & GB (with F. Chyzak & M. Kauers)

• rational f and restrict to in very good complexity(with A. Bostan & P. Lairez)

19

Tt(f) :=⇣Ann f + @tQ(x, t)h@

x

, @ti| {z }int. by parts

⌘\ Q(x)h@

x

i| {z }di↵. under

R.

Q(x)h@x

, @tiQ(x)[t, 1/den f]h@

x

, @ti

Page 20: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Multiple binomial sums (with A. Bostan & P. Lairez)

Def. Combination of binomial coefficients, geometric sequences, +, x, multiplication by scalars, affine changes of indices and ∑.

Thm. The generating series is the integral of a rational function that can be constructed automatically.

→ whence an efficient summation algorithm using the previous algo.

Ex. (Apéry) A(n) =nX

k=0

✓n

k

◆2✓n+ k

k

◆2

7!I

dt1 ^ dt2 ^ dt3t1t2t3(1� t1t2 � t1t2t3)� (1+ t1)(1+ t2)(1+ t3)z

7! LDE 7! (n+ 1)3A(n) + (· · · )A(n+ 1) + (n+ 2)2A(n+ 2) = 0.

More at Pierre’s PhD defense on Nov. 12.

Page 21: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

V. Numerical evaluation via the Taylor series

From large integers to precise numerical values

Page 22: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Numerical evaluation of solutions of LDEs

1. linear recurrence in N for the first sum (easy); 2. tight bounds on the tail (e.g., work with M. Mezzarobba); 3. no numerical roundoff errors.

f solution of a LDE with coeffs in Q(x) (our data-structure!)

f(x) =NX

n=0

anxn

| {z }fast evaluation

+1X

n=N+1

anxn

| {z }good bounds

The technique used for fast evaluation of constants like

1

⇡=

12

C3/2

1X

n=0

(�1)n(6n)!(A+ nB)

(3n)!n!3C3n

with A=13591409, B=545140134,

C=640320.

Code available: NumGfun [Mezzarobba 2010]

Principle:

Page 23: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Binary Splitting for linear recurrences (70’s and 80’s)

• n! by divide-and-conquer: Cost: O(n log3n loglog n) using FFT

• linear recurrences of order 1 reduce to

• arbitrary order: same idea, same cost (matrix factorial):

n! = n⇥ · · ·⇥ dn/2e| {z }size O(n log n)

⇥bn/2c ⇥ · · ·⇥ 1| {z }size O(n log n)

p!(n) := (p(n)⇥ · · ·⇥ p(dn/2e))⇥ (p(bn/2c)⇥ · · ·⇥ p(1))

ex: satisfies a 2nd order rec, computed via

✓enen�1

◆=

1

n

✓n+ 1 �1n 0

| {z }A(n)

✓en�1

en�2

◆=

1

n!A!(n)

✓10

◆.

en :=nX

k=0

1

k!

Page 24: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Analytic continuation

Ex: erf(π) with 15 digits: 0 ������!

200 terms3.1416 �����!

18 terms3.1415927 �����!

6 terms3.14159265358979

arctan(1+i)

Again: computation on integers. No roundoff errors.

Compute as new initial conditions and handle error propagation:

f(x), f 0(x), . . . , f(d�1)(x)

Page 25: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

VI Chebyshev expansions

Taylor Chebyshev

Page 26: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

From equations to operators(n↦n+1) ↔ S mult by n ↔ n

composition ↔ product Sn=(n+1)S

Taylor morphism: D ↦ (n+1)S; x ↦ S-1

produces linear recurrence from LDE

Ore (1933): general framework for these non-commutative polynomials. Main property: deg AB=deg A+deg B. Consequence 1: (non-commutative) Euclidean division Consequence 2: (non-commutative) Euclidean algorithm.

d/dx ↔ D mult by x ↔ x

composition ↔ product Dx=xD+1

erf: D

2 + 2xD 7! (n+ 1)S(n+ 1)S+ 2S

�1(n+ 1)S = (n+ 1)(n+ 2)S2 + 2n

Page 27: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Ore fractions (Q-1P with P&Q operators)

Application: extend Taylor morphism to Chebyshev expansions

Thm. (Ore 1933) Sums and products reduce to that form.

Taylor xn+1=x·xn, (xn)’=nxn-1

↔ X:=S-1, D:=(n+1)S

Prop. [with A. Benoit] If y is a solution of L(x,d/dx), then its Chebyshev coefficients annihilate the numerator of L(X,D).

erf: D

2 + 2xD 7! (2(S�1 � S)�1n)2 + 2

S+ S

�1

2

2(S�1 � S)�1n

= pol(n, S)�1(2(n+ 1)(n+ 4)S4 � 4(n+ 2)3S2 + 2n(n+ 3))

Efficient numerical use: arXiv:1407.2802

Chebyshev 2xTn(x)=Tn+1(x)+Tn-1(x),

2(1-x2)Tn’(x)=-nTn+1(x)+nTn-1(x) ↔ X:=(S+S-1)/2,

D:=(1-X2)-1n(S-S-1)/2=2(S-1-S)-1n.

Page 28: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Next steps: FastRelax (starting this Fall)

28

Computer Algebra Formal proofs

ComputerArithmetic

y

00 + 2xy

0 = 0 + ini. cond.

5 teams, 4 years

double erf(double x) {…}

Page 29: Algorithmic Variations on Linear Differential Equationsperso.ens-lyon.fr › bruno.salvy › talks › mbm2014.pdffunction that can be constructed automatically. → whence an efficient

Conclusion

• Linear differential equations and recurrences are a great data-structure;

• Numerous algorithms have been developed in computer algebra;

• Efficient code is available; • More is true (creative telescoping, diagonals,…); • More to come for Mireille and her followers.

Bravo Mireille !