An Invitation to Analytic Combinatorics

MPI Lecture Series

Lecture 2

Stephen Melczer

Die Augustusbrücke in Dresden by Gotthardt Kuehl (1907)

Summary of Lecture 1

Computing with a sequence requires an encoding, usually using its generating function.
 

 


 

 


 

Summary of Lecture 1

Computing with a sequence requires an encoding, usually using its generating function.
 

Computing asymptotics for (univariate) rational generating functions is interesting but solved* in practice.


 

 


 

Summary of Lecture 1

Computing with a sequence requires an encoding, usually using its generating function.
 

Computing asymptotics for (univariate) rational generating functions is interesting but solved* in practice.



Can we handle different types of generating functions?

 

$$ \text{rational} \;\subset\; \text{algebraic} \;\subset\; \text{D-finite} \;\subset\; \text{D-algebraic}$$

 

 

 


 

Summary of Lecture 1

Computing with a sequence requires an encoding, usually using its generating function.
 

Computing asymptotics for (univariate) rational generating functions is interesting but solved* in practice.



Can we handle different types of generating functions?

 

$$ \text{rational} \;\subset\; \text{algebraic} \;\subset\; \text{D-finite} \;\subset\; \text{D-algebraic}$$

 

What can we say in general?

 


 

Part 1
Basics of Analytic Combinatorics

The exponential growth of a sequence \((f_n)\) is

$$ \rho = \limsup_{n \rightarrow \infty} |f_n|^{1/n} .$$ If \(\rho>0\) is finite then

$$ f_n = \rho^n \cdot \theta(n) $$
for a sub-exponential function \(\theta(n)\).

 

 

Exponential Growth

The exponential growth of a sequence \((f_n)\) is

$$ \rho = \limsup_{n \rightarrow \infty} |f_n|^{1/n} .$$ If \(\rho>0\) is finite then

$$ f_n = \rho^n \cdot \theta(n) $$
for a sub-exponential function \(\theta(n)\).

 

Example
If \( f_n \sim 4^n/\sqrt{\pi n^3} \) then \(f_n\) has exponential growth \(4\).

 

Exponential Growth

The exponential growth of a sequence \((f_n)\) is

$$ \rho = \limsup_{n \rightarrow \infty} |f_n|^{1/n} .$$ If \(\rho>0\) is finite then

$$ f_n = \rho^n \cdot \theta(n) $$
for a sub-exponential function \(\theta(n)\).

 

Example
If \( f_n \sim 4^n/\sqrt{\pi n^3} \) then \(f_n\) has exponential growth \(4\).

Example
The exponential growth of \(\displaystyle f_n = {\big(}1+(-1)^n{\big)} \cdot 4^n  \) is also \(4\).

Exponential Growth

The exponential growth of a sequence \((f_n)\) is

$$ \rho = \limsup_{n \rightarrow \infty} |f_n|^{1/n} .$$ If \(\rho>0\) is finite then

$$ f_n = \rho^n \cdot \theta(n) $$
for a sub-exponential function \(\theta(n)\).

 

This is the coarsest part of asymptotic behaviour (for us).

Exponential Growth

The exponential growth of a sequence \((f_n)\) is

$$ \rho = \limsup_{n \rightarrow \infty} |f_n|^{1/n} .$$ If \(\rho>0\) is finite then

$$ f_n = \rho^n \cdot \theta(n) $$
for a sub-exponential function \(\theta(n)\).

 

This is the coarsest part of asymptotic behaviour (for us).

If \(F(z) = \sum_{n \geq 0} f_nz^n \) has radius of convergence \(R>0\) then Cauchy's root test implies \(\rho = 1/R\).

Exponential Growth

The exponential growth of a sequence \((f_n)\) is

$$ \rho = \limsup_{n \rightarrow \infty} |f_n|^{1/n} .$$ If \(\rho>0\) is finite then

$$ f_n = \rho^n \cdot \theta(n) $$
for a sub-exponential function \(\theta(n)\).

 

This is the coarsest part of asymptotic behaviour (for us).

 

Problem: How do we find \(R\) without knowing \(f_n\)?

Exponential Growth

The exponential growth of a sequence \((f_n)\) is

$$ \rho = \limsup_{n \rightarrow \infty} |f_n|^{1/n} .$$ If \(\rho>0\) is finite then

$$ f_n = \rho^n \cdot \theta(n) $$
for a sub-exponential function \(\theta(n)\).

 

This is the coarsest part of asymptotic behaviour (for us).

 

Solution: Use analytic properties of \(F(z)\) directly.

Exponential Growth

The exponential growth of a sequence \((f_n)\) is

$$ \rho = \limsup_{n \rightarrow \infty} |f_n|^{1/n} .$$ If \(\rho>0\) is finite then

$$ f_n = \rho^n \cdot \theta(n) $$
for a sub-exponential function \(\theta(n)\).

 

This is the coarsest part of asymptotic behaviour (for us).

 

First we need some facts from complex analysis.

Exponential Growth

An analytic function at \(a \in \mathbb{C}\) is one which has a convergent power series expansion in some disk around \(a\).

Analytic Functions

$$F(z) = \sum_{n \geq 0}f_n(z-a)^n$$

An analytic function in an open set \(U \subset \mathbb{C}\) is one which is analytic at each point of \(U\).

 

 

 

Analytic Functions

Fact 1: Cauchy Integral Formula

If \(\displaystyle F(z) = \sum_{n \geq 0}f_nz^n \) is analytic at the origin then

 

$$ f_n = \frac{1}{2\pi i}\int_{\color{violet}\mathcal{C}} \frac{F(z)}{z^{n+1}}dz$$

 

where \(\mathcal{C}\) is any sufficiently small circle* around the origin.

Fact 1: Cauchy Integral Formula

If \(\displaystyle F(z) = \sum_{n \geq 0}f_nz^n \) is analytic at the origin then

 

$$ f_n = \frac{1}{2\pi i}\int_{\color{violet}\mathcal{C}} \frac{F(z)}{z^{n+1}}dz$$

 

where \(\mathcal{C}\) is any sufficiently small circle* around the origin.

Fact 2: Deforming Curves of Integration

If \(\mathcal{C}\) and \(\mathcal{C}'\) are simple closed curves and \(\mathcal{C}\) can be deformed
to \(\mathcal{C}'\) in an open set where \(F(z)\) is analytic then

 

$$\int_{\color{violet}\mathcal{C}} F(z)dz = \int_{\color{lightblue}\mathcal{C}'}F(z)dz$$

Fact 3: Max Modulus Bound

If \(g(z)\) is continuous on \(\mathcal{C}\) then

 

$$ \left|\int_\mathcal{C} g(z) dz\right| \leq \text{length}(\mathcal{C}) \times \max_{z \in \mathcal{C}}|g(z)|$$

A domain is an open connected subset of \(\mathbb{C}^d\).

 

Let \(U\) and     be domains with                    .
Let \(F\) be an analytic function on \(U\).

 

 

Analytic Continuation

\(F:U \rightarrow \mathbb{C}\)

\(V\)

\(U \cap V \neq \emptyset\)

A domain is an open connected subset of \(\mathbb{C}^d\).

 

Let \(U\) and     be domains with                    .
Let \(F\) be an analytic function on \(U\).

 

The direct analytic continuation of \(F\) from \(U\) to     is the analytic function \(G\) on     with \(F=G\) on              (if it exists).

Analytic Continuation

\(F:U \rightarrow \mathbb{C}\)

\(G:V \rightarrow \mathbb{C}\)

\(F=G\)

\(V\)

\(V\)

\(V\)

\(U \cap V\)

\(U \cap V \neq \emptyset\)

Example: The series

$$F(z)=\sum_{n \geq 0}2^nz^n \qquad (|z|<1/2)$$
admits the direct analytic continuation

$$G(z)=\frac{1}{1-2z} \qquad\; (z \neq 1/2)$$

Analytic Continuation

Analytic Continuation

\(U\)

\(W\)

Now let \(W\) be any domain.

 

An analytic continuation of \(F\) to \(W\) is a sequence of direct analytic continuations starting at \(U\) and ending at \(W\).

 






 

Analytic Continuation

\(U\)

\(W\)

Now let \(W\) be any domain.

 

An analytic continuation of \(F\) to \(W\) is a sequence of direct analytic continuations starting at \(U\) and ending at \(W\).

 






 

The Sage ore_algebra package (Kauers, Mezzarobba, ...) can numerically compute analytic continuations for functions 
satisfying linear ODEs.

This will be important for D-finite asymptotics (to come).

Numeric Analytic Continuation

# The principal branch of F(z) = sqrt(z) is defined 
# by the ODE 2zF'(z) - F(z) = 0 and F(1)=1

The Sage ore_algebra package (Kauers, Mezzarobba, ...) can numerically compute analytic continuations for functions 
satisfying linear ODEs.

This will be important for D-finite asymptotics (to come).

Numeric Analytic Continuation

# The principal branch of F(z) = sqrt(z) is defined 
# by the ODE 2zF'(z) - F(z) = 0 and F(1)=1

# Import the ore_algebra package
sage: from ore_algebra import *
sage: Pols.<z> = QQ['z']
sage: Diff.<Dz> = OreAlgebra(Pols)
  
# Define the ODE 2zF'(z) - F(z) = 0
sage: deq = 2*z*Dz - 1

Numeric Analytic Continuation

# Continue solution with F(1)=1 to z=-1 ABOVE real axis
sage: deq.numerical_solution(ini=[1], path=[1, I, -1])
> [+/- 6.68e-21] + [1.0000000000000000  +/- 6.11e-20]*I

Numeric Analytic Continuation

# Continue solution with F(1)=1 to z=-1 ABOVE real axis
sage: deq.numerical_solution(ini=[1], path=[1, I, -1])
> [+/- 6.68e-21] + [1.0000000000000000  +/- 6.11e-20]*I

# Continue solution with F(1)=1 to z=-1 BELOW real axis
sage: deq.numerical_solution(ini=[1], path=[1, -I, -1])
> [+/- 6.68e-21] + [-1.0000000000000000 +/- 6.11e-20]*I

Numeric Analytic Continuation

# Continue solution with F(1)=1 to z=-1 ABOVE real axis
sage: deq.numerical_solution(ini=[1], path=[1, I, -1])
> [+/- 6.68e-21] + [1.0000000000000000  +/- 6.11e-20]*I

# Continue solution with F(1)=1 to z=-1 BELOW real axis
sage: deq.numerical_solution(ini=[1], path=[1, -I, -1])
> [+/- 6.68e-21] + [-1.0000000000000000 +/- 6.11e-20]*I

Note

This illustrates why we need branch cuts to define algebraic functions such as \(\sqrt{z}\).

A singularity of \(F\) is a point which \(F\) can be analytically continued arbitrarily close to but not directly at.

 

Example

The only singularity of \(F(z) = \displaystyle\sum_{n\geq0}2^nz^n\) is \(z=1/2\). 

 


 

Singularities

A singularity of \(F\) is a point which \(F\) can be analytically continued arbitrarily close to but not directly at.

 

Example

The only singularity of \(F(z) = \displaystyle\sum_{n\geq0}2^nz^n\) is \(z=1/2\). 

 


Common Singularity Types: Dividing by zero, putting zero in a square-root, cube-root, logarithm, etc.

Singularities

Let \(F(z) = \sum_{n \geq 0}f_nz^n\) be analytic at the origin.
Let \(M\) be the minimum modulus among the singularities of \(F\).

 

Lemma
The radius of convergence of \(F\) as a series is \(R=M\).

Exponential Growth Take 2

Let \(F(z) = \sum_{n \geq 0}f_nz^n\) be analytic at the origin.
Let \(M\) be the minimum modulus among the singularities of \(F\).

 

Lemma
The radius of convergence of \(F\) as a series is \(R=M\).


Proof is an Exercise (CIF and Max Modulus Bound)

 

Exponential Growth Take 2

Let \(F(z) = \sum_{n \geq 0}f_nz^n\) be analytic at the origin.
Let \(M\) be the minimum modulus among the singularities of \(F\).

 

Lemma
The radius of convergence of \(F\) as a series is \(R=M\).


Proof is an Exercise (CIF and Max Modulus Bound)

Corollary
The exponential growth of \(f_n\) is \(\rho=1/M\).

Exponential Growth Take 2

Example of Exponential Growth

Example (Binary Trees)

The generating function for binary trees
 

$$ F(z) = \frac{1-\sqrt{1-4z}}{2z} $$
has only one singularity, when \(z=1/4\). Thus,


$$ [z^n]F(z) = 4^n \cdot \theta(n) $$
for some sub-exponential function \(\theta\).

 

Example (Binary Trees)

The generating function for binary trees
 

$$ F(z) = \frac{1-\sqrt{1-4z}}{2z} $$
has only one singularity, when \(z=1/4\). Thus,


$$ [z^n]F(z) = 4^n \cdot \theta(n) $$
for some sub-exponential function \(\theta\).


 

Corollary: Need at least \(2n\) bits to encode binary trees.

Example of Exponential Growth

Example (Binary Trees)

The generating function for binary trees
 

$$ F(z) = \frac{1-\sqrt{1-4z}}{2z} $$
has only one singularity, when \(z=1/4\). Thus,


$$ [z^n]F(z) = 4^n \cdot \theta(n) $$
for some sub-exponential function \(\theta\).


 

Corollary: Need at least \(2n\) bits to encode binary trees.
Note:         Storing child labels for each vertex uses \(n\log n\) bits!

Example of Exponential Growth

Theorem (Vivanti-Pringsheim)

If \(F(z)=\sum_{n \geq 0}f_nz^n\) with each \(f_n\geq0\) then one singularity of \(F\) with minimal modulus is positive and real.

 

 

Finding Exponential Growth

Theorem (Vivanti-Pringsheim)

If \(F(z)=\sum_{n \geq 0}f_nz^n\) with each \(f_n\geq0\) then one singularity of \(F\) with minimal modulus is positive and real.

 

Example
A surjection of size \(n\) is a mapping from \(\{1,\dots,n\}\) onto any set of the form \(\{1,\dots,k\}\). The EGF of the class of surjections is
 

    \(\displaystyle S(z) = \sum_{n \geq 0}\frac{s_n}{n!} z^n =  \frac{1}{2-e^z}.\)

 

Finding Exponential Growth

Theorem (Vivanti-Pringsheim)

If \(F(z)=\sum_{n \geq 0}f_nz^n\) with each \(f_n\geq0\) then one singularity of \(F\) with minimal modulus is positive and real.

 

Example
A surjection of size \(n\) is a mapping from \(\{1,\dots,n\}\) onto any set of the form \(\{1,\dots,k\}\). The EGF of the class of surjections is
 

    \(\displaystyle S(z) = \sum_{n \geq 0}\frac{s_n}{n!} z^n =  \frac{1}{2-e^z}.\)

The singularities of \(S\) are

   \(\{\log(2) + 2\pi i k : k \in \mathbb{Z}\}\).

Finding Exponential Growth

Theorem (Vivanti-Pringsheim)

If \(F(z)=\sum_{n \geq 0}f_nz^n\) with each \(f_n\geq0\) then one singularity of \(F\) with minimal modulus is positive and real.

 

Example
A surjection of size \(n\) is a mapping from \(\{1,\dots,n\}\) onto any set of the form \(\{1,\dots,k\}\). The EGF of the class of surjections is
 

    \(\displaystyle S(z) = \sum_{n \geq 0}\frac{s_n}{n!} z^n =  \frac{1}{2-e^z}.\)

So
        \(\displaystyle \frac{s_n}{n!} = \left(\frac{1}{\log 2}\right)^n \cdot \Theta(n).\)

Finding Exponential Growth

First Principle of Univariate
Analytic Combinatorics

The locations of the singularities of a generating function determine the exponential growth of its coefficient sequence.

 

 

 

The Two Principles of AC

First Principle of Univariate
Analytic Combinatorics

The locations of the singularities of a generating function determine the exponential growth of its coefficient sequence.

 

 

Second Principle of Univariate
Analytic Combinatorics

The type of the singularities of a generating function determine the sub-exponential growth of its coefficient sequence.

The Two Principles of AC

Part 2
Transfer Theorems

Pole Singularities

The simplest type of singularity is a pole singularity.

 

The point \(\omega\in\mathbb{C}\) is a pole of \(F\) if there exists a convergent Laurent expansion near \(\omega\),
 

$$ F(z) = \sum_{n \in\mathbb{Z}} f_n (z-\omega)^n, $$
with only a finite number of negative powers appearing.

 

 

Pole Singularities

The simplest type of singularity is a pole singularity.

 

The point \(\omega\in\mathbb{C}\) is a pole of \(F\) if there exists a convergent Laurent expansion near \(\omega\),
 

$$ F(z) = \sum_{n \in\mathbb{Z}} f_n (z-\omega)^n, $$
with only a finite number of negative powers appearing.

 

The largest \(m>0\) such that \(f_{-m}\neq0\) is the order of the pole.

Pole Singularities

The simplest type of singularity is a pole singularity.

 

The point \(\omega\in\mathbb{C}\) is a pole of \(F\) if there exists a convergent Laurent expansion near \(\omega\),
 

$$ F(z) = \sum_{n \in\mathbb{Z}} f_n (z-\omega)^n, $$
with only a finite number of negative powers appearing.

 

We say \(F\) is meromorphic on a domain \(U\) if it is either analytic or has a pole at every point of \(U\).

Residues

If \(F(z) = \sum_{n \in\mathbb{Z}} f_n (z-\omega)^n\) then the residue of \(F\) at \(\omega\) is


$$\mathop{\mathrm{Res}}\limits_{z=\omega} {\Big(}F(z){\Big)} = f_{-1}$$
Example
The computation




shows that
$$\mathop{\mathrm{Res}}\limits_{z=\pi/2}{\Big(}\tan(z){\Big)} = -1$$

sage: var('z')
sage: tan(z).series(z == pi/2, 1)
> (-1)*(z - 1/2*pi)^(-1) + O(z - 1/2*pi)

Meromorphic Functions

A meromorphic function \(F\) on \(U\) is a ratio \(F(z)=G(z)/H(z)\) of analytic functions on \(U\).

 

The residue of \(F\) at \(z=\omega\) is computable from the derivatives of \(G\) and \(H\) at \(z=\omega\).


 

Meromorphic Functions

A meromorphic function \(F\) on \(U\) is a ratio \(F(z)=G(z)/H(z)\) of analytic functions on \(U\).

 

The residue of \(F\) at \(z=\omega\) is computable from the derivatives of \(G\) and \(H\) at \(z=\omega\).


Example
If \(H(\omega)=0\) but \(G(\omega)\neq0\) and \(H'(\omega)\neq0\) then \(\omega\) is a pole of \(F\) with order 1 and
$$\mathop{\mathrm{Res}}\limits_{z=\omega} {\Big(}F(z){\Big)} = \frac{-G(\omega)}{\omega H'(\omega)}.$$

The Residue Theorem

Assume

  • \(F(z)\) meromorphic inside and on a
    positively oriented simple closed curve \(\mathcal{C}\)
     
  • \(F\) has no poles on \(\mathcal{C}\) and the poles
    inside \(\mathcal{C}\) form the (necessarily finite) set \(\Omega\).

 

Then

$$ \frac{1}{2\pi i}\int_{\mathcal{C}}F(z)dz = \sum_{\omega \in \Omega} \mathop{\mathrm{Res}}\limits_{z=\omega} {\Big(}F(z){\Big)} .$$

Alternating Permutations

An alternating permutation is a permutation \(\pi\) of odd length such that \(\pi_1 > \pi_2 < \pi_3 > \cdots \)

 

The alternating permutations of length three: 213 and 312
 

$$A(z) = \sum_{k \geq 0}\frac{a_{2k+1}}{(2k+1)!}z^{2k+1} {\color{black} = \tan z\;} $$

Alternating Permutations

An alternating permutation is a permutation \(\pi\) of odd length such that \(\pi_1 > \pi_2 < \pi_3 > \cdots \)

 

The alternating permutations of length three: 213 and 312
 

$$A(z) = \sum_{k \geq 0}\frac{a_{2k+1}}{(2k+1)!}z^{2k+1} = \tan z$$

Asymptotics of Alternating Permutations

The Cauchy integral formula implies

 

$$ \frac{a_n}{n!} = [z^n]\tan z = \frac{1}{2\pi i}\int_{\color{violet}\mathcal{C}} \frac{\tan z}{z^{n+1}} $$

Asymptotics of Alternating Permutations

The Cauchy integral formula implies

 

$$ \frac{a_n}{n!} = [z^n]\tan z = \frac{1}{2\pi i}\int_{\color{violet}\mathcal{C}} \frac{\tan z}{z^{n+1}} $$

Asymptotics of Alternating Permutations

The Cauchy integral formula implies

 

$$ \frac{a_n}{n!} = [z^n]\tan z = \frac{1}{2\pi i}\int_{\color{violet}\mathcal{C}} \frac{\tan z}{z^{n+1}} $$

Asymptotics of Alternating Permutations

The Cauchy integral formula implies

 

$$ \frac{a_n}{n!} = [z^n]\tan z = \frac{1}{2\pi i}\int_{\color{violet}\mathcal{C}} \frac{\tan z}{z^{n+1}} $$

Asymptotics of Alternating Permutations

The Cauchy integral formula implies

 

$$ \frac{a_n}{n!} = [z^n]\tan z = \frac{1}{2\pi i}\int_{\color{violet}\mathcal{C}} \frac{\tan z}{z^{n+1}} $$

Asymptotics of Alternating Permutations

 

$$ \frac{a_n}{n!} = {\color{lightblue}\frac{1}{2\pi i}\int_{\mathcal{C_1}} \frac{\tan z}{z^{n+1}}} + {\color{lightgreen}\frac{1}{2\pi i}\int_{\mathcal{C_2}} \frac{\tan z}{z^{n+1}}} + {\color{orange}\frac{1}{2\pi i}\int_{|z|=\pi} \frac{\tan z}{z^{n+1}}} $$

Asymptotics of Alternating Permutations

 

$$ \frac{a_n}{n!} = {\color{lightblue}-\mathop{\mathrm{Res}}\limits_{z=-\pi/2}\left(\frac{\tan z}{z^{n+1}}\right)}   {\color{lightgreen}-\mathop{\mathrm{Res}}\limits_{z=\pi/2}\left(\frac{\tan z}{z^{n+1}}\right)} + {\color{orange}O\left(\left(\frac{1}{\pi}\right)^n\right)} $$

Asymptotics of Alternating Permutations

 

$$ \frac{a_n}{n!} = {\color{lightblue}\left(\frac{-2}{\pi}\right)^{n+1}} +  {\color{lightgreen}\left(\frac{2}{\pi}\right)^{n+1}} + {\color{orange}O\left(\left(\frac{1}{\pi}\right)^n\right)} $$

Asymptotics of Alternating Permutations

 

$$ \frac{a_n}{n!} = 2\left(\frac{2}{\pi}\right)^{n+1} + O\left(\left(\frac{1}{\pi}\right)^n\right) \quad (n \text{ odd})  $$

Asymptotics of Alternating Permutations

 

$$ \frac{a_n}{n!} = 2\left(\frac{2}{\pi}\right)^{n+1} + 2\left(\frac{2}{3\pi}\right)^{n+1} +  O\left(\left(\frac{2}{5\pi}\right)^n\right) \quad (n \text{ odd})  $$

Asymptotics of Alternating Permutations

 

$$ \frac{a_n}{n!} = 2\left(\frac{2}{\pi}\right)^{n+1}\sum_{k \geq 0}\frac{1}{(2k+1)^{n+1}}  \quad (n \text{ odd})$$

Asymptotics of Alternating Permutations

 

$$ \frac{a_n}{n!} = 2\left(\frac{2}{\pi}\right)^{n+1}\sum_{k \geq 0}\frac{1}{(2k+1)^{n+1}}  \quad (n \text{ odd})$$

$$\left(\frac{2}{\pi}\right)^{n+1}$$

$$\left(\frac{2}{3\pi}\right)^{n+1}$$

$$\left(-\frac{2}{\pi}\right)^{n+1}$$

$$\left(-\frac{2}{3\pi}\right)^{n+1}$$

Meromorphic Asymptotics

Theorem
Suppose \(F(z)\) is analytic on \(|z|=R\)
and at the origin, and has only pole singularities \(\omega_1,\dots,\omega_s\) in \(|z|<R\). Then
 

$$ f_n = \sum_{k=1}^m P_k(n) \; \omega_k^{-n} + O\left(R^{-n}\right)$$
where \(P_k(n)\) is a computable polynomial in \(n\) of degree one less than the order of the pole of \(F\) at \(z=\omega_k\).

Meromorphic Asymptotics

Theorem
If \(z=\omega_k\) is a pole of order \(m\) of \(F(z)=G(z)/H(z)\) and \(G(\omega_k)\neq0\) then

$$ p_k(n) = \frac{m \; G(\lambda_k)}{(-\lambda_k)^{m} H^{(m)}(\lambda_k)} \, n^{m-1} + O\left(n^{m-2}\right).$$

Meromorphic Asymptotics

Theorem
If \(z=\omega_k\) is a pole of order \(m\) of \(F(z)=G(z)/H(z)\) and \(G(\omega_k)\neq0\) then

$$ p_k(n) = \frac{m \; G(\lambda_k)}{(-\lambda_k)^{m} H^{(m)}(\lambda_k)} \, n^{m-1} + O\left(n^{m-2}\right).$$
Example (Surjections)
The EGF \(S(z) = 1/(2-e^z)\) has a pole of order 1 at \(z=\log(2)\) and


$$ s_n = n! [z^n]S(z) \sim \frac{n!}{2(\log 2)^{n+1}}.$$

Transfer Theorems

Residues only work for isolated singularities -- not for branch points like \(z^{1/k}\) or \(\log(z)\) at \(z=0\).

 

 

Transfer Theorems

Residues only work for isolated singularities -- not for branch points like \(z^{1/k}\) or \(\log(z)\) at \(z=0\).

 

It is still possible to prove transfer theorems of the form

$$ F(z) = a(z) + O{\Big(}b(z){\Big)} \implies [z^n]F(z) = [z^n]a(z) + O{\Big(}[z^n]b(z){\Big)}  $$

 

 

Transfer Theorems

Residues only work for isolated singularities -- not for branch points like \(z^{1/k}\) or \(\log(z)\) at \(z=0\).

 

It is still possible to prove transfer theorems of the form

$$ F(z) = a(z) + O{\Big(}b(z){\Big)} \implies [z^n]F(z) = [z^n]a(z) + O{\Big(}[z^n]b(z){\Big)}  $$

 

There are many known formulas for different singularities (see Flajolet and Odlyzko 1990)

 

$$ F(z) \sim (1-z)^\alpha\left(\log\frac{1}{1-z}\right)^\beta \implies f_n \sim  \frac{n^{-\alpha-1}}{\Gamma(-\alpha)}(\log n)^\beta + \cdots$$

Transfer Theorems

A.<n> = AsymptoticRing('n^QQ * QQ^n', coefficient_ring=SR)
coeff_asm = A.coefficients_of_generating_function

def C(z): return (1-sqrt(1-4*z))/(2*z)  
show(coeff_asm(function=C, singularities=(1/4), precision=4))

$$ \frac{1}{\sqrt{\pi}} n^{-\frac{3}{2}} 4^{n} - \frac{9}{8 \, \sqrt{\pi}} n^{-\frac{5}{2}} 4^{n} + \frac{145}{128 \, \sqrt{\pi}} n^{-\frac{7}{2}} 4^{n} - \frac{1155}{1024 \, \sqrt{\pi}} n^{-\frac{9}{2}} 4^{n} + O\!\left(n^{-5} 4^{n}\right) $$

Can compute first 30 terms in the expansion in ~1 second

AsymptoticRing in SageMath

Many of these contributions have been automated in Sage using the AsymptoticRing (Hackl, Heuberger, Krenn).

Analytic Combinatorics

To analyze \(f_n\)

     1. Find singularities of \(F(z)\) closest to the origin

     2. Find leading terms in the series expansions of \(F\)

     3. Add corresponding contributions

Problem 1: No singularities (or too exotic)

Solution: Saddle-point method 

Problem 2: How to do this implicitly for different encodings

Part 3
Algebraic Functions

An algebraic function is a root \(P(z,F(z))=0\) of some

 

$$ P(z,y) = p_d(z)y^d + \cdots + p_1(z)y + p_0(z) \in \mathbb{Z}[z][y].$$

 

Algebraic functions have branch cuts.

Thus we expand them in slit disks.

Algebraic Functions

Algebraic Functions

An algebraic function is a root \(P(z,F(z))=0\) of some

 

$$ P(z,y) = p_d(z)y^d + \cdots + p_1(z)y + p_0(z) \in \mathbb{Z}[z][y].$$
Puiseux's Theorem
If \(P\) is irreducible then in a slit disk around any \(\omega\in\mathbb{C}\) there exist \(d\) roots \(y_1(z),\dots,y_d(z)\) represented by convergent series expansions with fractional exponents

$$ y_k(z) = \sum_{n \geq N} c_{k,n}(1-z/\omega)^{{\color{red}n/d}}$$
where all coefficients are algebraic numbers and \(N\in\mathbb{Z}\).

Algebraic Functions

An algebraic function is a root \(P(z,F(z))=0\) of some

 

$$ P(z,y) = p_d(z)y^d + \cdots + p_1(z)y + p_0(z) \in \mathbb{Z}[z][y].$$
Puiseux's Theorem
If \(P\) is irreducible then in a slit disk around any \(\omega\in\mathbb{C}\) there exist \(d\) roots \(y_1(z),\dots,y_d(z)\) represented by convergent series expansions with fractional exponents

$$ y_k(z) = \sum_{n \geq N} c_{k,n}(1-z/\omega)^{{\color{red}n/d}}$$
When do we have singularities?

Algebraic Functions

An algebraic function is a root \(P(z,F(z))=0\) of some

 

$$ P(z,y) = p_d(z)y^d + \cdots + p_1(z)y + p_0(z) \in \mathbb{Z}[z][y].$$
Corollary (of Implicit Function Theorem)
All roots of \(P(z,y)=0\) around \(z=\omega\) are analytic power series (near \(\omega\)) unless \(P(\omega,y)\) has less than \(d\) distinct roots:

Algebraic Functions

An algebraic function is a root \(P(z,F(z))=0\) of some

 

$$ P(z,y) = p_d(z)y^d + \cdots + p_1(z)y + p_0(z) \in \mathbb{Z}[z][y].$$
Corollary (of Implicit Function Theorem)
All roots of \(P(z,y)=0\) around \(z=\omega\) are analytic power series (near \(\omega\)) unless \(P(\omega,y)\) has less than \(d\) distinct roots:

$$p_d(\omega) = 0 \qquad\text{or}\qquad \text{resultant}_y(P,P_y)=0.$$

Algebraic Functions

An algebraic function is a root \(P(z,F(z))=0\) of some

 

$$ P(z,y) = {\color{red}p_d(z)}y^d + \cdots + p_1(z)y + p_0(z) \in \mathbb{Z}[z][y].$$
Corollary (of Implicit Function Theorem)
All roots of \(P(z,y)=0\) around \(z=\omega\) are analytic power series (near \(\omega\)) unless \(P(\omega,y)\) has less than \(d\) distinct roots:

$${\color{red}p_d(\omega) = 0} \qquad\text{or}\qquad \text{resultant}_y(P,P_y)=0.$$

Roots going off to infinity

Algebraic Functions

An algebraic function is a root \(P(z,F(z))=0\) of some

 

$$ P(z,y) = p_d(z)y^d + \cdots + p_1(z)y + p_0(z) \in \mathbb{Z}[z][y].$$
Corollary (of Implicit Function Theorem)
All roots of \(P(z,y)=0\) around \(z=\omega\) are analytic power series (near \(\omega\)) unless \(P(\omega,y)\) has less than \(d\) distinct roots:

$${\color{red}p_d(\omega) = 0} \qquad\text{or}\qquad {\color{black}\text{resultant}_y(P,P_y)=0}.$$

$$\text{resultant}_y(P,P_y)= 0$$

Roots going off to infinity

Collision of two roots

Algebraic Functions

An algebraic function is a root \(P(z,F(z))=0\) of some

 

$$ P(z,y) = p_d(z)y^d + \cdots + p_1(z)y + p_0(z) \in \mathbb{Z}[z][y].$$
Corollary (of Implicit Function Theorem)
All roots of \(P(z,y)=0\) around \(z=\omega\) are analytic power series (near \(\omega\)) unless \(P(\omega,y)\) has less than \(d\) distinct roots:

$${\color{red}p_d(\omega) = 0} \qquad\text{or}\qquad {\color{black}\text{resultant}_y(P,P_y)=0}.$$
Corollary
Singularities of \(F\) are roots of \(\Xi(z) = p_d(z) \cdot \text{resultant}_y(P,P_y)(z)\).

$$\text{resultant}_y(P,P_y)= 0$$

Algebraic Functions

$$P(z,y) = zy^2 - y + 1$$

Algebraic Functions

$$p_d(z) = z$$

$$P(z,y) = zy^2 - y + 1$$

Roots going off to infinity

Algebraic Functions

$$P(z,y) = zy^2 - y + 1$$

$$p_d(z) = z$$

$$\text{resultant}_y(P,P_y)= z(4z-1)$$

Roots going off to infinity

Collision of two roots

Algebraic Asymptotics

Lemma

If \(\alpha \notin \mathbb{N}\) there is an asymptotic expansion
 

$$ [z^n] (1-z/\omega)^\alpha =  \omega^{-n} \frac{n^{-\alpha-1}}{\Gamma(-\alpha)}\left( 1 + \frac{\alpha(\alpha+1)}{2n} + \cdots\right).$$


 

Algebraic Asymptotics

Lemma

If \(\alpha \notin \mathbb{N}\) there is an asymptotic expansion

$$ [z^n] (1-z/\omega)^\alpha =  \omega^{-n} \frac{n^{-\alpha-1}}{\Gamma(-\alpha)}\left( 1 + \frac{\alpha(\alpha+1)}{2n} + \cdots\right).$$



Example (Central Binomial Coefficients)
If \(F(z) = \displaystyle \sum_{n \geq 0}\binom{2n}{n}z^n = (1-4z)^{-1/2}\) then

$$ [z^n]F(z) = \frac{4^n}{\sqrt{\pi n}} \left(1 - \frac{1}{8 \, n}  + \cdots \right).$$

Algebraic Asymptotics

def F(z): return (1-4*z)^(-1/2)
show(coeff_asm(function=F, singularities=(1/4), precision=4))

$$ \frac{1}{\sqrt{\pi}} n^{-\frac{1}{2}} 4^{n} - \frac{1}{8 \, \sqrt{\pi}} n^{-\frac{3}{2}} 4^{n} + \frac{1}{128 \, \sqrt{\pi}} n^{-\frac{5}{2}} 4^{n} + \frac{5}{1024 \, \sqrt{\pi}} n^{-\frac{7}{2}} 4^{n} + O\!\left(n^{-9/2} 4^{n}\right) $$

Lemma

If \(\alpha \notin \mathbb{N}\) there is an asymptotic expansion
 

$$ [z^n] (1-z/\omega)^\alpha =  \omega^{-n} \frac{n^{-\alpha-1}}{\Gamma(-\alpha)}\left( 1 + \frac{\alpha(\alpha+1)}{2n} + \cdots\right).$$



Example (Central Binomial Coefficients)

Algebraic Asymptotics

Corollary (Darboux's Theorem)
If \(F(z)\) is algebraic then

$$ f_n = \frac{\beta^n \, n^s}{\Gamma(s+1)} \sum_{j=1}^m C_j \omega_j^n + O\left(\beta^n n^t\right)$$

where \(\beta>0\) and the \(\omega_j,C_j\) are algebraic with all \(|\omega_j|=1\)

            \(s \in \mathbb{Q} \setminus \{-1,-2,\dots\}\) with \(t<s\)
 

Algebraic Asymptotics

Corollary (Darboux's Theorem)
If \(F(z)\) is algebraic then

$$ f_n = \frac{\beta^n \, n^s}{\Gamma(s+1)} \sum_{j=1}^m C_j \omega_j^n + O\left(\beta^n n^t\right)$$

where \(\beta>0\) and the \(\omega_j,C_j\) are algebraic with all \(|\omega_j|=1\)

            \(s \in \mathbb{Q} \setminus \{-1,-2,\dots\}\) with \(t<s\)

Notes

  • All constants are algebraic except for possibly \(\Gamma(s+1)\).
  • The exponent in \(n^s\) cannot be a negative integer.

Algebraic Asymptotics

Example (Labelled 2-Regular Graphs)

If \(g_n\) is the number of 2-regular labelled simple graphs then
 

$$ G(z) = \sum_{n \geq 0}\frac{g_n}{n!} z^n = \frac{e^{-z/2-z^2/4}}{\sqrt{1-z}}.$$The expansion

$$ G(z)  = e^{-3/4}(1-z)^{-1/2} + \cdots $$
at the only singularity \(z=1\) of \(G\) shows

$$\frac{g_n}{n!} \sim e^{-3/4} \frac{n^{-1/2}}{\Gamma(1/2)} = \frac{e^{-3/4}}{\sqrt{n \pi}}.$$

Algebraic Asymptotics

Example (Labelled 2-Regular Graphs)

If \(g_n\) is the number of 2-regular labelled simple graphs then
 

$$ G(z) = \sum_{n \geq 0}\frac{g_n}{n!} z^n = \frac{e^{-z/2-z^2/4}}{\sqrt{1-z}}.$$

def G(z): return exp(-z/2-z^2/4)/sqrt(1-z)
show(coeff_asm(function=G, singularities=(1), precision=4))

$$ \frac{e^{-3/4}}{\sqrt{\pi}} n^{-\frac{1}{2}} - \frac{5e^{-3/4}}{8\sqrt{\pi}} n^{-\frac{3}{2}}  + \frac{e^{-3/4}}{128\sqrt{\pi}} n^{-\frac{5}{2}} +  O\!\left(n^7\right) $$

Transcendence via Asymptotics

Example (Powers of Central Binomial Coefficients)

Recall that 

$$ \binom{2n}{n} \sim \frac{4^n}{\sqrt{\pi n}}. $$
For positive integers \(k\) the series

$$ F_{2k}(z) = \sum_{n \geq 0}\binom{2n}{n}^{2k}z^n$$
is transcendental as \(\binom{2n}{n}^{2k} \sim 4^{2kn} n^{-k} \pi ^{-k}\) has a negative integer power of \(n\).

Example (Powers of Central Binomial Coefficients)

Recall that 

$$ \binom{2n}{n} \sim \frac{4^n}{\sqrt{\pi n}}. $$
For positive integers \(k\) the series

$$ F_{2k}(z) = \sum_{n \geq 0}\binom{2n}{n}^{2k}z^n$$
is transcendental as \(\binom{2n}{n}^{2k} \sim 4^{2kn} n^{-k} \pi ^{-k}\) has a negative integer power of \(n\).
What about \(F_{2k+1}(z)\)? Exercise.

Transcendence via Asymptotics

Example (Transcendence of Zeta Generating Function)

The series

$$ F(z) = \sum_{n \geq 1} \frac{z^n}{n^5} $$
is transcendental for the same reason.

Recall it is unknown if \(F(1)=\zeta(5)\) is irrational.


 

Transcendence via Asymptotics

Example (Transcendence of Zeta Generating Function)

The series

$$ F(z) = \sum_{n \geq 1} \frac{z^n}{n^5} $$
is transcendental for the same reason.

Recall it is unknown if \(F(1)=\zeta(5)\) is irrational.


Flajolet 1987: Many context free languages are ambiguous as their generating functions are transcendental.

Transcendence via Asymptotics

Suppose we know that \(F(z)\) satisfies \(P(z,F(z))=0\).





 

Implicit Asymptotics

Suppose we know that \(F(z)\) satisfies \(P(z,F(z))=0\).

How do we check which roots of \(\Xi(z)\) are singularities of \(F\)?



 

Implicit Asymptotics

Suppose we know that \(F(z)\) satisfies \(P(z,F(z))=0\).

How do we check which roots of \(\Xi(z)\) are singularities of \(F\)?

How do we find a series expansion of \(F\) near its dominant singularities?


 

Implicit Asymptotics

Suppose we know that \(F(z)\) satisfies \(P(z,F(z))=0\).

How do we check which roots of \(\Xi(z)\) are singularities of \(F\)?

How do we find a series expansion of \(F\) near its dominant singularities?



Step 1: Find algorithm to compute series expansions of all roots \(y(z)\) of \(P(z,y)=0\) near a point \(\omega\in\mathbb{C}\).

 

 

Implicit Asymptotics

Suppose we know that \(F(z)\) satisfies \(P(z,F(z))=0\).

How do we check which roots of \(\Xi(z)\) are singularities of \(F\)?

How do we find a series expansion of \(F\) near its dominant singularities?



Step 1: Find algorithm to compute series expansions of all roots \(y(z)\) of \(P(z,y)=0\) near a point \(\omega\in\mathbb{C}\).

 

Step 2: Determine which series expansion corresponds to \(F(z)\) and whether it is a power series.

Implicit Asymptotics

Computing Puiseux Expansions

The series expansions around the origin are computable using the Newton-Puiseux algorithm (and around any point with a change of variable \(z \mapsto a-z\)).

Computing Puiseux Expansions

The series expansions around the origin are computable using the Newton-Puiseux algorithm (and around any point with a change of variable \(z \mapsto a-z\)).

Idea
Substitute generic solution
 

$$ y(z) = c_\alpha z^\alpha + \cdots $$
into \(P(z,y(z))=0\) and try to cancel lowest powers.

Computing Puiseux Expansions

The series expansions around the origin are computable using the Newton-Puiseux algorithm (and around any point with a change of variable \(z \mapsto a-z\)).

Example
The GF for 3-ary trees is a root of \(P(z,y) = zy^3-y+1\).

sage: var('z, y')
sage: P = z*y^3 - y + 1
sage: compute_Puiseux_solutions(P, z, y, 3)
> [-z^(-1/2) - 1/2 + 3/8*z^(1/2) - 1/2*z + O(z^(3/2)),
    z^(-1/2) - 1/2 - 3/8*z^(1/2) - 1/2*z + O(z^(3/2)),
    1 + z + 3*z^2 + 12*z^3 + O(z^4)]

Computing Puiseux Expansions

The series expansions around the origin are computable using the Newton-Puiseux algorithm (and around any point with a change of variable \(z \mapsto a-z\)).

Corollary (of Implicit Function Theorem)
If \(y_k(z)\) is the only root of \(P(z,y)\) whose expansion begins

$$p_k(z) = c_az^{a/d}  +  c_{a+1}z^{(a+1)/d} + \cdots + c_b z^{b/d}$$
then all series coefficients of \(y_k(z)\) lie in \(\mathbb{Q}(c_a,\dots,c_b)\).

If \(p_k(z)\) is a polynomial then \(y_k(z)\) is a power series.

Computing Puiseux Expansions

The series expansions around the origin are computable using the Newton-Puiseux algorithm (and around any point with a change of variable \(z \mapsto a-z\)).

Theorem (Walsh 1999)
At most \(2d_zd_y(2d_y-1)\) terms are needed to separate all roots of \(P(z,y)\).

 

Computing Puiseux Expansions

The series expansions around the origin are computable using the Newton-Puiseux algorithm (and around any point with a change of variable \(z \mapsto a-z\)).

Theorem (Walsh 1999)
At most \(2d_zd_y(2d_y-1)\) terms are needed to separate all roots of \(P(z,y)\).

Note: After separation can make a change of variables and use symbolic Newton iteration to get \(N\) terms in the expansion of \(y_k(z)\) in \(\tilde{O}(N)\) operations.

A Solvable Connection Problem

Assume we can compute the expansion of \(F(z)\) at \(z=0\).

How can we determine which series solution of \(P(z,y)=0\) around \(z=\omega\) corresponds to \(F\)?

 

This is a connection problem: we want to relate local behaviour of solutions near different points.

 

A Solvable Connection Problem

Assume we can compute the expansion of \(F(z)\) at \(z=0\).

How can we determine which series solution of \(P(z,y)=0\) around \(z=\omega\) corresponds to \(F\)?

 

This is a connection problem: we want to relate local behaviour of solutions near different points.

Solvable using: 

  • Homotopy methods,
  • Root separation bounds, or
  • "Branch ranking" for real solutions.


 

Implicit Asymptotics

Example

The generating function of bicoloured supertrees begins

$$F(z) = 2z^2 + 2z^3 + \cdots$$
and satisfies \(P(z,F(z))=0\) where

$$P(z,y) = y^4 - 2y^3 + (1+2z)y^2 - 2zy + 4z^3.$$

sage: P = y^4 - 2*y^3 + (1+2*z)*y^2 - 2*y*z + 4*z^3
sage: compute_Puiseux_solutions(P, z, y, 3)
> [1 - 2*z - 2*z^2 + O(z^(5/2)),
   1       - 2*z^2 - 2*z^3 + O(z^(7/2)),
       2*z + 2*z^2 + 6*z^3 + 24*z^4 + O(z^5),
             2*z^2 + 2*z^3 + 8*z^4  + 18*z^5 + O(z^6)]

$$F(z) = 2z^2 + 2z^3 + \cdots$$

Implicit Asymptotics

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

sage: P = y^4 - 2*y^3 + (1+2*z)*y^2 - 2*y*z + 4*z^3
sage: compute_Puiseux_solutions(P, z, y, 3)
> [1 - 2*z - 2*z^2 + O(z^(5/2)),
   1       - 2*z^2 - 2*z^3 + O(z^(7/2)),
       2*z + 2*z^2 + 6*z^3 + 24*z^4 + O(z^5),
             2*z^2 + 2*z^3 + 8*z^4  + 18*z^5 + O(z^6)]

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

sage: P = y^4 - 2*y^3 + (1+2*z)*y^2 - 2*y*z + 4*z^3
sage: compute_Puiseux_solutions(P, z, y, 3)
> [1 - 2*z - 2*z^2 + O(z^(5/2)),
   1       - 2*z^2 - 2*z^3 + O(z^(7/2)),
       2*z + 2*z^2 + 6*z^3 + 24*z^4 + O(z^5),
             2*z^2 + 2*z^3 + 8*z^4  + 18*z^5 + O(z^6)]
sage: Xi = 1 * P.resultant(P.derivative(y),y)
sage: Xi.roots(z, multiplicities=False)
> [-1/8*sqrt(5) - 1/8, 1/8*sqrt(5) - 1/8, 1/4, 0]

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

sage: Xi = 1 * P.resultant(P.derivative(y),y)
sage: Xi.roots(z, multiplicities=False)
> [-1/8*sqrt(5) - 1/8, 1/8*sqrt(5) - 1/8, 1/4, 0]

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

sage: Xi = 1 * P.resultant(P.derivative(y),y)
sage: Xi.roots(z, multiplicities=False)
> [-1/8*sqrt(5) - 1/8, 1/8*sqrt(5) - 1/8, 1/4, 0]
sage: compute_Puiseux_solutions(P.subs(z=(1-t)/4), t, y, 2)
> [1/2 - 1/2*t^(1/4)      + O(t^(3/4)),
   1/2 + 1/2*t^(1/4)      + O(t^(3/4)),
   1/2 - 0.500?*I*t^(1/4) + O(t^(3/4)),
   1/2 + 0.500?*I*t^(1/4) + O(t^(3/4))]

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

$$ F(z) = \frac{1}{2} - \frac{1}{2}\left(1-4z\right)^{1/4} + O\left(\left(1-4z\right)^{3/4}\right)$$

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

$$ f_n = - \frac{4^n n^{-5/4}}{2\;\Gamma(-1/4)} + O\left(4^nn^{-7/4}\right)$$

Implicit Asymptotics

$$F(z) = 2z^2 + 2z^3 + \cdots$$

$$ f_n = \frac{4^n n^{-5/4}}{8 \; \Gamma(3/4)} + O\left(4^nn^{-7/4}\right)$$

Part 4
D-Finite Functions

P-Recursive Sequences

\(F(z)\) is D-finite if it satisfies a linear differential equation

 

$$ p_s(z)F^{(s)}(z) + \cdots + p_1(z)F'(z) + p_0(z)F(z) = 0.$$

 

 

P-Recursive Sequences

\(F(z)\) is D-finite if it satisfies a linear differential equation

 

$$ p_s(z)F^{(s)}(z) + \cdots + p_1(z)F'(z) + p_0(z)F(z) = 0.$$

 

This happens if and only if \(f_n\) is P-recursive

 

$$ c_r(n)f_{n+r} + \cdots + c_1(n)f_{n+1} + c_0(n)f_n = 0$$

 

It is automatic to convert D-finite \(F(z) \leftrightarrow\) P-recursive \(f_n\)

Encoding P-Recursions

We can encode a P-recursion using the Shift algebra consisting of polynomials in \(S_n\) and \(n\) such that \(S_n n = (n+1)S_n\)

The Shift algebra is implemented in the ore_algebra Sage package.

Such polynomials act on sequences via

 

$$n \cdot (f_n) = (nf_n) \qquad\qquad S_n \cdot (f_n) = (f_{n+1})$$

sage: [binomial(2*k,k) for k in range(10)]
> [1, 2, 6, 20, 70, 252, 924, 3432, 12870, 48620]

We can use P-recurrences to generate terms efficiently

# Algebraic Simplification
sage: Sn * n
> (n + 1)*Sn

ore_algebra

sage: rec.to_list([1],1001)[1000]
> 2048151626989489714335162502980825044396424887981397033820382637671748186202083755828932994182610206201464766319998023692415481798004524792018047549769261578563012896634320647148511523952516512277685886115395462561479073786684641544445336176137700738556738145896300713065104559595144798887462063687185145518285511731662762536637730846829322553890497438594814317550307837964443708100851637248274627914170166198837648408435414308177859470377465651884755146807496946749238030331018187232980096685674585602525499101181135253534658887941966653674904511306110096311906270342502293155911108976733963991149120
# Define the ring of shift operators
from ore_algebra import *
Ind.<n> = PolynomialRing(QQ); Shift.<Sn> = OreAlgebra(Ind)
sage: rec = (n + 1)*Sn - 4*n - 2 
sage: rec.to_list([1],10)
> [1, 2, 6, 20, 70, 252, 924, 3432, 12870, 48620]

This recovers that \(\displaystyle f_n = \binom{2n}{n}^2\) satisfies


 

$$ (n+1)^2f_{n+1} = 4(2n+1)^2f_n$$

sage: LST = [binomial(2*k,k)^2 for k in range(10)]
sage: LST
> [1, 4, 36, 400, 4900, 63504, 853776, 11778624, 165636900, 2363904400]

Guessing P-Recursions

You can heuristically solve many problems automatically

sage: guess(LST,Shift)
> (-n^2 - 2*n - 1)*Sn + 16*n^2 + 16*n + 4

Guessing can fail (because non-P-recursive or can't detect)

Walks in \(\mathbb{N}^2\)
 

A Recursion for NSEW Walks

sage: rec = guess([w(n) for n in range(50)], Shift)
sage: rec
> (-n^2 - 7*n - 12)*Sn^2 + (8*n + 20)*Sn + 16*n^2 + 48*n + 32

$$(n^2 - 7n - 12)w_{n+2} = (8n + 20)w_{n+1} + (16n^2 + 48n + 32)w_n$$

@CachedFunction 
def NSEW(i,j,n):
    if i<0 or j<0:               return 0
    elif n==0 and i==0 and j==0: return 1
    elif n==0:                   return 0
    else:                        return NSEW(i-1,j,n-1) + NSEW(i,j-1,n-1) + NSEW(i+1,j,n-1) + NSEW(i,j+1,n-1)
    
def w(n): return add([NSEW(i,j,n) for i in range(n+1) for j in range(n+1)])
sage: print([w(n) for n in range(50)])
> [1, 2, 6, 18, 60, 200, 700, 2450, 8820, 31752, 116424, 426888, 1585584, 5889312, 22084920, 82818450, 312869700, 1181952200, 4491418360, 17067389768, 65166397296, 248817153312, 953799087696, 3656229836168, 14062422446800, 54086240180000, 208618354980000, 804670797780000, 3111393751416000, 12030722505475200, 46619049708716400, 180648817621276050, 701342468412012900, 2722858995011344200, 10588896091710783000, 41179040356653045000, 160381525599596070000, 624643836545795220000, 2436110962528601358000, 9500832753861545296200, 37098489800792700680400, 144860769698333402656800, 566273917911666937658400, 2213616224563788938119200, 8661976530901782801336000, 33894690773093932700880000, 132754205527951236411780000, 519953971651142342612805000, 2038219568872477983042195600, 7989820709980113693525406752]

A Recursion for NSEW Walks

@CachedFunction 
def NSEW(i,j,n):
    if i<0 or j<0:               return 0
    elif n==0 and i==0 and j==0: return 1
    elif n==0:                   return 0
    else:                        return NSEW(i-1,j,n-1) + NSEW(i,j-1,n-1) + NSEW(i+1,j,n-1) + NSEW(i,j+1,n-1)
    
def w(n): return add([NSEW(i,j,n) for i in range(n+1) for j in range(n+1)])
sage: rec.to_list([1,2],10001)[10000]
> 50670858282363109450882533219385259116791651540860443528673788922006774660220135310076567190665877663227497610525216815179429196607949478468748915553152375749653361221125994945474312616551330785108050737125999149418854958253313760788500342419049188481548195955872633072687330360556794612654171049047211290195895456025776601166247232446800350871069853386548640043023875983206449827956660730234679224516097198566173345466226206912806717223010783200431450238527706770095844211019722426251793366950229386021807959129665280523676001799217267052478632201668733187252366897659520599167745871330655916268889673302362801838426936470105250077069488978931901731578966225360615394702370507089360895154065504666700587104090146760929313217351099539933140567655936082655681299170775905165644858153798348028777806004237453498378696816911713139361951420845865726262051994066992649399337204730904228221844913878475687608747835373198738775753219892796436372044015343546795120675525699408340634791486584741790183393940926197374390086240262042582449430164865375076395588987194887307089397649270689537745335338154495687649266578930031902333761475037829692896262498770271425885732492405179293598043990016563687030856649804387654971097362613794337373836758977008636389962314597843633841032627656883778165941274609560000697532642002468084422761062389106453298040757776956335230145086087940477772574847284044421930216720434474352316480161734848238858999080155279923745403969039709287324757374384790603827955162412914486192356944069511090856710652154351840737712407826739855920023546935106586288048874550544058030645736646311458039349446177051326282471808530466683266021672593133197720212428655043054923265926590161898310051318216499390497398335250477461051609836707468126913886101481598934742106657852699731888189564239891907789489387595933629511023855294225309530724153831204725610845446611721868550252331314924946613187780063083051507565617547894672537631737549784736674972279541063483949223264200625606706039828712278483054659143069314802127278851477493792811778662130623812809173425565895682617680056460930895805824229128847565677034763500222393161381064750618863217828812260915349862475933000389771680893042050268128860045233814678778637077487206805899903386504951131300864470272800477247571872568890190240016908973266215311690603721512336252665398854194841921860439222783673632616077033606607575370043713102948169716053281582965203407023561945150993709744512604377333301144388824916266835874668210698181716255976032541348206547750008530136869204301677672429389905688088653644511016402405401585335724639934248663821265735786168392178722012509566084394504530483792197688412603718620224251359211671714502661234813617049047607195898895544174790050741473619122076173331370750128697290361085322992294577671892941694190981025336380459290730894351927467743602393751326990874017063366861015440697608337084352431427879165441654071352622411659851787303492927467526541631418862696851291408996204862731208655648213122704707420619766998429620026069040101314252439416133459035634998364516344321380131632929427600636492953843012117944899150521534124992557855560152667137120679845929053246092174403895384774887585183239306578935477772888275355797760809213411669059334517690561448912884341338748976003574284847087139677085948236978096013857983915122178114425513639671301955992717368692696722002617877706796044652232811091148018991185443833802780876863228852630583041786532910920415578150634108377729235156670187459944174386750855702702405059132900343709662195965203464322999943189352428154278774622860021781931214415337513920463516570928183212496605732190431867813305085280817038220020281427675225994338382780074696444097375114844123823620570656852389281948091185933428624609951335857859486387875474645820101207557896825695213126067264165443422933555661660710279425253575794849141895541145040542894144217961490202799598146579492559083744185206673213882428611299744934247436059812001154919152511036104421799354988278541282082417763413709163100809584644234185712108984426813972363955877331014963814571870715876314298028919846532758435734435284393987172121796802034893803802665485861703351180728339878446281317115400174401961744161674081868686309708448750291674726622882548580616139292421774929961400288903489270461568890469792638480298432587664932171700961790244857182952310453101918294850607072924780368523036133216200764154694161058999645810707980661415273847856731758813121663661609473715027929225665799495419632092905431248660168254869543905446819393377854196395958215756806758051144880153459812938372953456551840063237594037992100684795808937022079510357115173988631043608823473835850180853207386201724496554609818426035210312142952482771541168708024442999685012931625713392233483938269706888945950703908003557170535033107512140782727252179099152178108839492991107741142445993771633863503705221693566188731578674005853050134504167663178597797801964857332669805161653877876642993855469907659008454967266837823861103074554243792696711249985133903641449804181113777278677465243089910796392779094226493655328349171611629505387451363516118666424673542658222517046786231402225793458159247896085710896374815324512470664548054885012039431380502790393737842000547485006282461867171417717003368433937083447993516493850892862173256394450222186575479376603742419525495589844723654393074201550114693434416962705347764401972194458098290779716403939350216414003627470203049211201083288411829874372704692246175461226439735585539879570902721252781444925714489447140199559870112189971578442953111869497236791173960853392385539764375378898274745897236228532519479891041539608227583914229414640560040801894033819396747796435418946937369866989187687235910422901506067920312998698309626368795857248638014481351836817855421838767557901909948438233464390236776468994528549482777553759453890570453460723232583360354139086158457684643045104378875875376069417188546249214473886405631857740880250266157853166591875046834017283606130015861687484068521700358094930116253971948774400
sage: rec = guess([w(n) for n in range(50)], Shift)
sage: rec
> (-n^2 - 7*n - 12)*Sn^2 + (8*n + 20)*Sn + 16*n^2 + 48*n + 32
sage: print([w(n) for n in range(50)])
> [1, 2, 6, 18, 60, 200, 700, 2450, 8820, 31752, 116424, 426888, 1585584, 5889312, 22084920, 82818450, 312869700, 1181952200, 4491418360, 17067389768, 65166397296, 248817153312, 953799087696, 3656229836168, 14062422446800, 54086240180000, 208618354980000, 804670797780000, 3111393751416000, 12030722505475200, 46619049708716400, 180648817621276050, 701342468412012900, 2722858995011344200, 10588896091710783000, 41179040356653045000, 160381525599596070000, 624643836545795220000, 2436110962528601358000, 9500832753861545296200, 37098489800792700680400, 144860769698333402656800, 566273917911666937658400, 2213616224563788938119200, 8661976530901782801336000, 33894690773093932700880000, 132754205527951236411780000, 519953971651142342612805000, 2038219568872477983042195600, 7989820709980113693525406752]

Automated Asymptotics


We can compute series expansions of an asymptotic basis

Thus, there exist \({\color{pink}\lambda_1},{\color{lightblue}\lambda_2} \in \mathbb{C}\) such that

So \(\displaystyle {\color{pink}w_n \sim \lambda_1 \cdot \frac{4^n}{n}}\) because \({\color{pink}\lambda_1\neq0}\)

The solutions of a P-recurrence form a \(\mathbb{C}\)-vector space

$$ w_n = {\color{pink}\lambda_1} \frac{4^n}{n}\left(1 - \frac{3}{2n} + \cdots\right) + {\color{lightblue}\lambda_2} \frac{(-4)^n}{n^2}\left(1 - \frac{9}{2n} + \cdots\right) $$

rec = (-n^2 - 7*n - 12)*Sn^2 + (8*n + 20)*Sn + 16*n^2 + 48*n + 32
show(rec.generalized_series_solutions(n=3))

$$ \left[4^{n}n^{-1}\Bigl(1 - \frac{3}{2} n^{-1} + \frac{19}{8} n^{-2} + O(n^{-3})\Bigr), \qquad (-4)^{n}n^{-3}\Bigl(1 - \frac{9}{2} n^{-1} + \frac{107}{8} n^{-2} + O(n^{-3})\Bigr)\right]$$

Automated Asymptotics


We can compute series expansions of an asymptotic basis

Thus, there exist \({\color{pink}\lambda_1},{\color{lightblue}\lambda_2} \in \mathbb{C}\) such that

The solutions of a P-recurrence form a \(\mathbb{C}\)-vector space

$$ w_n = {\color{pink}\lambda_1} \frac{4^n}{n}\left(1 - \frac{3}{2n} + \cdots\right) + {\color{lightblue}\lambda_2} \frac{(-4)^n}{n^2}\left(1 - \frac{9}{2n} + \cdots\right) $$

How do we prove \({\color{pink}\lambda_1 \neq 0}\) in general?

Back to GF.

rec = (-n^2 - 7*n - 12)*Sn^2 + (8*n + 20)*Sn + 16*n^2 + 48*n + 32
show(rec.generalized_series_solutions(n=3))

$$ \left[4^{n}n^{-1}\Bigl(1 - \frac{3}{2} n^{-1} + \frac{19}{8} n^{-2} + O(n^{-3})\Bigr), \qquad (-4)^{n}n^{-3}\Bigl(1 - \frac{9}{2} n^{-1} + \frac{107}{8} n^{-2} + O(n^{-3})\Bigr)\right]$$

Encoding D-Finite Equations

# Define the ring of differential operators
sage: Pols.<z> = PolynomialRing(QQ); Diff.<Dz> = OreAlgebra(Pols)
sage: Dz * z
> z*Dz + 1

P-Recursive to D-finite

sage: rec.to_D(Diff)
> (16*z^4 - z^2)*Dz^4 + (192*z^3 + 8*z^2 - 8*z)*Dz^3 + (608*z^2 + 44*z - 12)*Dz^2 + (512*z + 40)*Dz + 64
sage: deq = guess([w(n) for n in range(50)],Diff)
sage: deq
> (16*z^4 - z^2)*Dz^3 + (128*z^3 + 8*z^2 - 6*z)*Dz^2 + (224*z^2 + 28*z - 6)*Dz + 64*z + 12

P-Recursive to D-finite

sage: rec.to_D(Diff)
> (16*z^4 - z^2)*Dz^4 + (192*z^3 + 8*z^2 - 8*z)*Dz^3 + (608*z^2 + 44*z - 12)*Dz^2 + (512*z + 40)*Dz + 64
sage: deq = guess([w(n) for n in range(50)],Diff)
sage: deq
> (16*z^4 - z^2)*Dz^3 + (128*z^3 + 8*z^2 - 6*z)*Dz^2 + (224*z^2 + 28*z - 6)*Dz + 64*z + 12

P-Recursive to D-finite

sage: rec.to_D(Diff)
> (16*z^4 - z^2)*Dz^4 + (192*z^3 + 8*z^2 - 8*z)*Dz^3 + (608*z^2 + 44*z - 12)*Dz^2 + (512*z + 40)*Dz + 64
sage: deq = guess([w(n) for n in range(50)],Diff)
sage: deq
> (16*z^4 - z^2)*Dz^3 + (128*z^3 + 8*z^2 - 6*z)*Dz^2 + (224*z^2 + 28*z - 6)*Dz + 64*z + 12

D-Finite Expansions

The solutions of a D-finite equation form a \(\mathbb{C}\)-vector space


We can compute expansions of a basis around any point

D-Finite Expansions

sage: deq.local_basis_expansions(0)
> [z^(-2) - 4*z^(-1)*log(z) - 8*log(z) - 16*z*log(z) - 8*z - 48*z^2*log(z) - 28*z^2 - 144*z^3*log(z) - 96*z^3,
   z^(-1),
   1 + 2*z + 6*z^2 + 18*z^3]

The solutions of a D-finite equation form a \(\mathbb{C}\)-vector space

There exist constants \({\color{lightblue}\alpha_1},{\color{lightblue}\alpha_2},{\color{lightblue}\alpha_3} \in \mathbb{C}\) such that

$$W(z) = {\color{lightblue}\alpha_1}{\Big(}z^{-2} + \cdots{\Big)} +  {\color{lightblue}\alpha_2}{\Big(}z^{-1} + \cdots{\Big)} +  {\color{lightblue}\alpha_3}{\Big(}1 + \cdots{\Big)}$$


We can compute expansions of a basis around \(z=0\)

D-Finite Expansions

The solutions of a D-finite equation form a \(\mathbb{C}\)-vector space


We can compute expansions of a basis around \({\color{lightgreen}z=1}\)

There exist constants \({\color{lightgreen}\beta_1},{\color{lightgreen}\beta_2},{\color{lightgreen}\beta_3} \in \mathbb{C}\) such that

$$W(z) = {\color{lightgreen}\beta_1}{\Big(}1 + \cdots{\Big)} +  {\color{lightgreen}\beta_2}{\Big(}(z-1) + \cdots{\Big)} +  {\color{lightgreen}\beta_3}{\Big(}(z-1)^2 + \cdots{\Big)}$$

As expected \(W(z)\) analytic at \(z=1\)

sage: deq.local_basis_expansions(1)
> [1 - 38/45*(z - 1)^3 + 568/225*(z - 1)^4 - 86132/16875*(z - 1)^5,
   (z - 1) - 41/15*(z - 1)^3 + 541/75*(z - 1)^4 - 76484/5625*(z - 1)^5,
   (z - 1)^2 - 26/9*(z - 1)^3 + 256/45*(z - 1)^4 - 32039/3375*(z - 1)^5]

D-Finite Expansions

The solutions of a D-finite equation form a \(\mathbb{C}\)-vector space


We can compute expansions of a basis around \({\color{pink}z=1/4}\)

There exist constants \({\color{pink}\gamma_1},{\color{pink}\gamma_2},{\color{pink}\gamma_3} \in \mathbb{C}\) such that

$$W(z) = {\color{pink}\gamma_1}{\Big(}\log(z-1/4) + \cdots{\Big)} +  {\color{pink}\gamma_2}{\Big(}1 + \cdots{\Big)} +  {\color{pink}\gamma_3}{\Big(}(z-1/4) + \cdots{\Big)}$$

What is \({\color{pink}\gamma_1}\)?

sage: deq.local_basis_expansions(1/4)
> [log(z - 1/4) - 6*(z - 1/4)*log(z - 1/4) + 31*(z - 1/4)^2*log(z - 1/4) - 150*(z - 1/4)^3*log(z - 1/4) - 2/3*(z - 1/4)^3 + 2797/4*(z - 1/4)^4*log(z - 1/4) + 55/8*(z - 1/4)^4 - 6363/2*(z - 1/4)^5*log(z - 1/4) - 2869/60*(z - 1/4)^5,
   1 - 14*(z - 1/4)^2 + 108*(z - 1/4)^3 - 1261/2*(z - 1/4)^4 + 3291*(z - 1/4)^5,
   (z - 1/4) - 15/2*(z - 1/4)^2 + 43*(z - 1/4)^3 - 1773/8*(z - 1/4)^4 + 4315/4*(z - 1/4)^5]

Connection Coefficients

We have

$$\begin{aligned}W(z) &= {\color{lightblue}\alpha_1}{\Big(}z^{-2} + \cdots{\Big)} \hspace{0.54in} +  {\color{lightblue}\alpha_2}{\Big(}z^{-1} + \cdots{\Big)} +  {\color{lightblue}\alpha_3}{\Big(}1 + \cdots{\Big)} \\[+4mm] &={\color{pink}\gamma_1}{\Big(}\log(z-1/4) + \cdots{\Big)} +  {\color{pink}\gamma_2}{\Big(}1 + \cdots{\Big)} \hspace{0.15in}+  {\color{pink}\gamma_3}{\Big(}(z-1/4) + \cdots{\Big)} \end{aligned}$$

By counting walks we can compute

$$W(z) = 1 + 2z + 8z^2 + 16z^3 + 60z^4 + \cdots$$
so \(({\color{lightblue}\alpha_1},{\color{lightblue}\alpha_2},{\color{lightblue}\alpha_3})=({\color{lightblue}0},{\color{lightblue}0},{\color{lightblue}1})\)

Numeric analytic continuation: Numerically compute change of basis matrix from \(({\color{lightblue}\alpha_1},{\color{lightblue}\alpha_2},{\color{lightblue}\alpha_3})\) to \(({\color{pink}\gamma_1},{\color{pink}\gamma_2},{\color{pink}\gamma_3})\)

Connection Coefficients

Using ore_algebra we can get 1000 digits in a few seconds!

Thus \(\displaystyle W(z) = {\color{pink}(-1.27324\dots)}\log(z-1/4) + \cdots\)

sage: ini = vector([0,0,1])
sage: bas = deq.numerical_transition_matrix([0,1/4],1e-5) * ini
sage: bas
> ([-1.27324 +/- 1.82e-6] + [+/- 1.87e-12]*I, 
   [-2.39070 +/- 6.34e-6] + [4.00000  +/- 3.82e-6]*I, 
   [12.8907  +/- 5.22e-5] + [-24.0000 +/- 3.06e-5]*I)
sage: loc = deq.local_basis_expansions(1/4,2)
sage: add([a*b for [a,b] in zip(bas,loc)])
> ([-1.273 +/- 1.82e-6] + [+/- 1.87e-12]*I)         *log(z - 1/4) 
+ ([7.63   +/- 4.06e-5] + [+/- 1.1e-11]*I)*(z - 1/4)*log(z-1/4) 
+ ([-2.391 +/- 6.34e-6] + [4.00000  +/- 3.82e-6]*I) *1 
+ ([12.89  +/- 5.22e-5] + [-24.0000 +/- 3.06e-5]*I) *(z - 1/4)

Connection Coefficients

Using ore_algebra we can get 1000 digits in a few seconds!

sage: ini = vector([0,0,1])
sage: bas = deq.numerical_transition_matrix([0,1/4],1e-5) * ini
sage: bas
> ([-1.27324 +/- 1.82e-6] + [+/- 1.87e-12]*I, 
   [-2.39070 +/- 6.34e-6] + [4.00000  +/- 3.82e-6]*I, 
   [12.8907  +/- 5.22e-5] + [-24.0000 +/- 3.06e-5]*I)

And so \(\displaystyle w_n \sim {\color{pink}(1.27324\dots)} \cdot \frac{4^n}{n}\)

sage: loc = deq.local_basis_expansions(1/4,2)
sage: add([a*b for [a,b] in zip(bas,loc)])
> ([-1.273 +/- 1.82e-6] + [+/- 1.87e-12]*I)         *log(z - 1/4) 
+ ([7.63   +/- 4.06e-5] + [+/- 1.1e-11]*I)*(z - 1/4)*log(z-1/4) 
+ ([-2.391 +/- 6.34e-6] + [4.00000  +/- 3.82e-6]*I) *1 
+ ([12.89  +/- 5.22e-5] + [-24.0000 +/- 3.06e-5]*I) *(z - 1/4)

Automating Everything

Dong, M., Mezzarobba (2024)
Algorithm for asymptotics with bounded error

sage: from ore_algebra.analytic.singularity_analysis import *
sage: bound_coefficients(deq, [1, 2, 6], order=2, prec=20)
sage: from ore_algebra.analytic.singularity_analysis import *
sage: bound_coefficients(deq, [1, 2, 6], order=2, prec=20)
> 1.00000*4^n   
* (([1.2732  +/- 4.39e-5] + [+/- 2.04e-18]*I) * n^(-1) 
+ ([-1.9099  +/- 5.60e-5] + [+/- 3.06e-18]*I) * n^(-2) 
+ B([1503.38 +/- 3.05e-3]*n^(-3)*log(n), n >= 7))

Automating Everything

Dong, M., Mezzarobba (2024)
Algorithm for asymptotics with bounded error

Thus 

 

 

when \(n \geq 7\)

$$\begin{aligned}w_n \in \frac{4^{n}}{n} \cdot \biggl( &\left[1.27 \pm 4.39 \cdot 10^{-5}\right]+ \left[-1.91 \pm 5.60 \cdot 10^{-5}\right] \frac{1}{n} + \left[1503.38\pm 3.05 \cdot 10^{-3}\right] \frac{\log^2 n}{n^2} \biggr)\end{aligned}$$

@CachedFunction 
def NSEW(i,j,n):
    if i<0 or j<0:               return 0
    elif n==0 and i==0 and j==0: return 1
    elif n==0:                   return 0
    else:                        return NSEW(i-1,j,n-1) + NSEW(i,j-1,n-1) + NSEW(i+1,j,n-1) + NSEW(i,j+1,n-1)
def w(n): return add([NSEW(i,j,n) for i in range(n+1) for j in range(n+1)])

from ore_algebra import *
from ore_algebra.analytic.singularity_analysis import *
Pols.<z> = PolynomialRing(QQ); Diff.<Dz> = OreAlgebra(Pols);

deq = guess([w(n) for n in range(50)],Diff)
bound_coefficients(deq, [w(n) for n in range(3)])
1.00*4^n*(   
  ([1.27323954473516  +/- 3.09e-15] + [+/- 1.21e-30]*I) * n^(-1) 
+ ([-1.90985931710274 +/- 4.63e-15] + [+/- 1.81e-30]*I) * n^(-2) 
+ ([3.02394391874601  +/- 6.05e-15] + [+/- 6.46e-30]*I) * n^(-3) 
+ [0.318309886183791  +/- 7.53e-16] * (e^(I*arg(-1)))^n * n^(-3)
+ B([3432.030228663511+/- 9.35e-13] * n^(-4)*log(n), n >= 9))

Automatic Positivity Proofs

Yu and Chen (2020): The genus one Canham model for 

biomembrane shape has a unique solution if a P-recursive sequence \((d_n)\) has all positive terms.

M. and Mezzarobba (2022): This sequence has all positive terms

Yu and Chen (2020) - Michalet and Bensimon (1995)

sage: seqini = [72, 1932, 31248, 790101/2, 17208645/4, 338898609/8, 1551478257/4]
sage: deq = (8388593*z^2*(3*z^4 - 164*z^3 + 370*z^2 - 164*z + 3)*(z + 1)^2*(z^2 - 6*z + 1)^2*(z - 1)^3*Dz^3 + 8388593*z*(z + 1)*(z^2 - 6*z + 1)*(66*z^8 - 3943*z^7 + 18981*z^6 - 16759*z^5 - 30383*z^4 + 47123*z^3 - 17577*z^2 + 971*z - 15)*(z - 1)^2*Dz^2 + 16777186*(z - 1)*(210*z^12 - 13761*z^11 + 101088*z^10 - 178437*z^9 - 248334*z^8 + 930590*z^7 - 446064*z^6 - 694834*z^5 + 794998*z^4 - 267421*z^3 + 24144*z^2 - 649*z + 6)*Dz + 6341776308*z^12 - 427012938072*z^11 + 2435594423178*z^10 - 2400915979716*z^9 - 10724094731502*z^8 + 26272536406048*z^7 - 8496738740956*z^6 - 30570113263064*z^5 + 39394376229112*z^4 - 19173572139496*z^3 + 3825886272626*z^2 - 170758199108*z + 2701126946)

sage: bound_coefficients(deq, seqini, order=5, prec=20, n0=50)
> 1.00*5.828?^n
*(([8.072  +/- 1.77e-4] + [+/- 1.57e-12]*I)   *n^3*log(n) 
+ ([1.371  +/- 5.79e-4] + [+/- 1.08e-4 ]*I)   *n^3 
+ ([50.509 +/- 8.16e-4] + [+/- 9.77e-12]*I)   *n^2*log(n) 
+ ([29.70  +/- 2.92e-3] + [+/- 6.71e-4 ]*I)   *n^2 
+ ([106.36 +/- 2.08e-3] + [+/- 2.06e-11]*I)   *n*log(n) 
+ ([118.76 +/- 5.85e-3] + [+/- 1.42e-3 ]*I)   *n 
+ ([72.85  +/- 4.56e-3] + [+/- 1.41e-11]*I)   *log(n) 
+ ([154.7  +/- 0.0133 ] + [+/- 9.55e-4 ]*I)   *1
+ ([-0.28  +/- 3.33e-6] + [+/- 5.49e-14]*I)   *n^(-1)*log(n) 
+ ([35.5   +/- 0.0224 ] + [+/- 3.41e-6 ]*I)   *n^(-1) 
+ B([3056.71 +/- 2.97e-3]*n^(-2)*log(n)^2, n >=50))

Asymptotic expansion shows \(d_n \geq 0\) when \(n \geq 50\)


Check \(d_0,\dots,d_{50}\) by hand

Regular Singular Points

D-finite functions can have complicated singular behaviour.
We usually work in a special case.

 

A power series \(F(z) = \sum_{n \geq 0}f_nz^n\) with \(f_n \in \mathbb{Q}\) is a G-function if

  • \(F\) is D-finite, and
     
  • both \(|f_n|\) and the least common denominator of \(f_0,\dots,f_n\) grow at most exponentially

 

 

Regular Singular Points

D-finite functions can have complicated singular behaviour.
We usually work in a special case.

 

A power series \(F(z) = \sum_{n \geq 0}f_nz^n\) with \(f_n \in \mathbb{Q}\) is a G-function if

  • \(F\) is D-finite, and
     
  • both \(|f_n|\) and the least common denominator of \(f_0,\dots,f_n\) grow at most exponentially

 

Note: If \(F\) is a D-finite generating function (with integer coefficients) analytic at the origin then it is a G-function.

Regular Singular Points

Theorem (André-Chudnovsky-Katz)

If \(F(z)\) is a G-function then a minimal order annihilating D-finite equation for \(F\) has only regular singular points and its indicial polynomial \(I(\theta)\) has only rational roots.

 

 

Regular Singular Points

Theorem (André-Chudnovsky-Katz)

If \(F(z)\) is a G-function then a minimal order annihilating D-finite equation for \(F\) has only regular singular points and its indicial polynomial \(I(\theta)\) has only rational roots.

 

Corollary

If \(F(z)\) is a G-function then \(f_n\) has an asymptotic expansion given by a sum of terms of the form \(C \, n^{\alpha} \, (\log n)^\ell \, \zeta^n \) where \(C \in \mathbb{C}, \, \alpha \in \mathbb{Q}, \,\ell \in \mathbb{N}, \,\) and \(\zeta\) is algebraic.

Regular Singular Points

Theorem (André-Chudnovsky-Katz)

If \(F(z)\) is a G-function then a minimal order annihilating D-finite equation for \(F\) has only regular singular points and its indicial polynomial \(I(\theta)\) has only rational roots.

 

Corollary

If \(F(z)\) is a G-function then \(f_n\) has an asymptotic expansion given by a sum of terms of the form \({\color{red}C } \, n^{\alpha} \, (\log n)^\ell \, \zeta^n\) where \({\color{red}C \in \mathbb{C}},\, \alpha \in \mathbb{Q},\, \ell \in \mathbb{N},\,\) and \(\zeta\) is algebraic.

Regular Singular Points

Theorem (André-Chudnovsky-Katz)

If \(F(z)\) is a G-function then a minimal order annihilating D-finite equation for \(F\) has only regular singular points and its indicial polynomial \(I(\theta)\) has only rational roots.

 

Corollary

If \(F(z)\) is a G-function then \(f_n\) has an asymptotic expansion given by a sum of terms of the form \(C \, n^{{\color{red}\alpha}} \, (\log n)^\ell \, \zeta^n\) where \(C \in \mathbb{C},\, {\color{red}\alpha \in \mathbb{Q}},\, \ell \in \mathbb{N},\,\) and \(\zeta\) is algebraic.

Regular Singular Points

Theorem (André-Chudnovsky-Katz)

If \(F(z)\) is a G-function then a minimal order annihilating D-finite equation for \(F\) has only regular singular points and its indicial polynomial \(I(\theta)\) has only rational roots.

 

Corollary

If \(F(z)\) is a G-function then \(f_n\) has an asymptotic expansion given by a sum of terms of the form \(C \, n^{\alpha} \, (\log n)^{{\color{red}\ell}} \, \zeta^n\) where \(C \in \mathbb{C},\, \alpha \in \mathbb{Q},\, {\color{red}\ell \in \mathbb{N}},\,\) and \(\zeta\) is algebraic.

Regular Singular Points

Theorem (André-Chudnovsky-Katz)

If \(F(z)\) is a G-function then a minimal order annihilating D-finite equation for \(F\) has only regular singular points and its indicial polynomial \(I(\theta)\) has only rational roots.

 

Corollary

If \(F(z)\) is a G-function then \(f_n\) has an asymptotic expansion given by a sum of terms of the form \(C \, n^{\alpha} \, (\log n)^{\ell} \, {\color{red}\zeta}^n\) where \(C \in \mathbb{C},\, \alpha \in \mathbb{Q},\, \ell \in \mathbb{N},\,\) and \({\color{red}\zeta}\) is algebraic.

Two Difficulties

Skolem's Problem: When can cancellation occur with multiple singularities of minimal modulus?

Connection Problem: Can we prove when \(\lambda_1=0\)?

Doesn't happen "generically"

Can occur in practice

Main reason D-finite asymptotics still open

Not usually an issue in practice

More Quadrant Walks

Consider walks in \(\mathbb{N}^2\) on the steps N-SE-SW

We can show \(\displaystyle w_n = {\color{pink}\lambda_1} \cdot \frac{3^n}{\sqrt{n}}(1+\cdots) + O((2\sqrt{2})^n)\) where \({\color{pink}|\lambda_1|<10^{-1000}}\)

How can we (automatically) prove \({\color{pink}\lambda_1=0}\)?

sage: ini = [1,1,2,3,8,15,39]
sage: deq = (196608*z^16 - 4096*z^15 - 106496*z^14 + 90112*z^13 + 4096*z^12 + 16192*z^11 + 3776*z^10 - 4736*z^9 - 560*z^8 - 124*z^7 - 33*z^6 + 52*z^5 + 7*z^4 - 2*z^3)*Dz^4 + (3145728*z^15 - 462848*z^14 - 1073152*z^13 + 1252352*z^12 + 192512*z^11 + 370112*z^10 + 76800*z^9 - 58176*z^8 - 11152*z^7 - 2468*z^6 - 968*z^5 + 518*z^4 + 90*z^3 - 22*z^2)*Dz^3 + (14155776*z^14 - 3870720*z^13 - 2199552*z^12 + 4733952*z^11 + 1582080*z^10 + 2059392*z^9 + 525696*z^8 - 164256*z^7 - 47904*z^6 - 9648*z^5 - 5508*z^4 + 1236*z^3 + 306*z^2 - 60*z)*Dz^2 + (18874368*z^13 - 7544832*z^12 + 294912*z^11 + 5081088*z^10 + 3201024*z^9 + 3148416*z^8 + 1068864*z^7 - 68832*z^6 - 41136*z^5 - 5520*z^4 - 7584*z^3 + 648*z^2 + 276*z - 36)*Dz + 4718592*z^12 - 2482176*z^11 + 811008*z^10 + 964608*z^9 + 1075200*z^8 + 880128*z^7 + 387648*z^6 + 31296*z^5 + 6864*z^4 + 3024*z^3 - 1320*z^2 + 72*z + 36

sage: bound_coefficients(deq, ini, prec=20)
> 1.00000 * 3^n 
*(([+/- 1.56e-12] + [+/- 1.56e-12]*I)*n^(-1/2) 
+ ([+/- 3.21e-12] + [+/- 3.21e-12]*I)*n^(-3/2) 
+ ([+/- 8.71e-12] + [+/- 8.71e-12]*I)*n^(-5/2) 
+ B([2.18961e+7  +/- 68.1]*n^(-7/2), n >= 10))

More Quadrant Walks

Consider walks in \(\mathbb{N}^2\) on the steps N-SE-SW

sage: ini = [1,1,2,3,8,15,39]
sage: deq = (196608*z^16 - 4096*z^15 - 106496*z^14 + 90112*z^13 + 4096*z^12 + 16192*z^11 + 3776*z^10 - 4736*z^9 - 560*z^8 - 124*z^7 - 33*z^6 + 52*z^5 + 7*z^4 - 2*z^3)*Dz^4 + (3145728*z^15 - 462848*z^14 - 1073152*z^13 + 1252352*z^12 + 192512*z^11 + 370112*z^10 + 76800*z^9 - 58176*z^8 - 11152*z^7 - 2468*z^6 - 968*z^5 + 518*z^4 + 90*z^3 - 22*z^2)*Dz^3 + (14155776*z^14 - 3870720*z^13 - 2199552*z^12 + 4733952*z^11 + 1582080*z^10 + 2059392*z^9 + 525696*z^8 - 164256*z^7 - 47904*z^6 - 9648*z^5 - 5508*z^4 + 1236*z^3 + 306*z^2 - 60*z)*Dz^2 + (18874368*z^13 - 7544832*z^12 + 294912*z^11 + 5081088*z^10 + 3201024*z^9 + 3148416*z^8 + 1068864*z^7 - 68832*z^6 - 41136*z^5 - 5520*z^4 - 7584*z^3 + 648*z^2 + 276*z - 36)*Dz + 4718592*z^12 - 2482176*z^11 + 811008*z^10 + 964608*z^9 + 1075200*z^8 + 880128*z^7 + 387648*z^6 + 31296*z^5 + 6864*z^4 + 3024*z^3 - 1320*z^2 + 72*z + 36

sage: bound_coefficients(deq, ini, prec=20)
> 1.00000 * 3^n 
*(([+/- 1.56e-12] + [+/- 1.56e-12]*I)*n^(-1/2) 
+ ([+/- 3.21e-12] + [+/- 3.21e-12]*I)*n^(-3/2) 
+ ([+/- 8.71e-12] + [+/- 8.71e-12]*I)*n^(-5/2) 
+ B([2.18961e+7  +/- 68.1]*n^(-7/2), n >= 10))

Bostan and Kauers (FPSAC 2009): Conjectured asymptotics for 23 "small step" models in \(\mathbb{N}^2\)

M. and Wilson (FPSAC 2016): Finished proofs for all models 

The Kernel Method

Rigorous derivation of the D-finite equations for lattice path models usually uses the kernel method

 

1. Get functional equation for \(W(z)\)

 

2. Represent \(W(z)\) using a multivariate series

 

3. Use creative telescoping to get D-finite equation

Idea: Get asymptotics directly from multivariate series

D-Algebraic Functions

A D-algebraic function satisfies a polynomial ODE.

 

Example (Tutte 1982)
The generating function enumerating 4-coloured rooted triangulations by number of vertices satisfies

$$2z^2H''(z)+5H(z)H''(z)-3z^2H'(z)H''(z)=48z^2$$

 

Example (Ramanujan)
The generating function \(P(q)\) for integer partitions satisfies

$$\begin{aligned}q^2 P^3 P^{(4)} &+ 20 q^2 P^2 P' P^{(3)} - 39 q^2 P^2 (P'')^2 + 12 q^2 P (P')^2 P'' + 6 q^2 (P')^4 & \\  &+ 5 q P^3 P^{(3)} - 15 q P^2 P' P'' + 10 q P (P')^3 + 4 P^3 P'' - 16 P^2 (P')^2=0 \end{aligned}$$

D-Algebraic Functions

Some D-algebraic equations say very little about their solutions.


Theorem (Duffin 1981)
For any real continuous function \(g(z)\) and \(\epsilon>0\) there exist initial conditions for a four times continuously differentiable solution \(s(z)\) to

$$ 2F''''(z)F'(z)^2 - 5F'''(z)F''(z)F'(z) + 3F''(z)^3 = 0 $$
such that \(|s(z)-g(z)|<\epsilon\) for all \(z\in\mathbb{R}\).

D-Algebraic Functions

Theorem (Denef and Lipshitz, 1989)
It is undecidable (by reduction to Hilbert's 10th problem) to determine whether an analytic D-algebraic defined by initial conditions at \(z=0\) has radius of convergence \(<1\) or \(\geq 1\).


 

 

D-Algebraic Functions

Theorem (Denef and Lipshitz, 1989)
It is undecidable (by reduction to Hilbert's 10th problem) to determine whether an analytic D-algebraic defined by initial conditions at \(z=0\) has radius of convergence \(<1\) or \(\geq 1\).


 

Thus, asymptotics behaviour is

  • decidable (up to Skolem) for rational and algebraic GFs
     
  • undecidable for D-algebraic GFs
     
  • still open for D-finite GFs

Summary of Lecture 2

Transfer series expansions of \(F(z)\) near singularities into contributions to asymptotics of \(f_n\).

 

Meromorphic asymptotics behave like rational asymptotics up to exponentially small error.

 

Commutative algebra tools allow for automatic* asymptotics of algebraic functions.

 

Decidability of D-finite asymptotics depends on resolving the connection problem.

Thank You!

https://melczer.ca/MPI26

 

Lecture 3 (tomorrow morning)
Multivariate series and rational diagonals