User:Kannaum/sandbox/recEq

= P-recursive equations = In mathematics a P-recursive equation is a linear equation of sequences where the coefficient sequences can be represented as polynomials. P-recursive equations are linear recurrence equations (or linear recurrence relations or linear difference equations) with polynomial coefficients. These equations play an important role in different areas of mathematics, specifically in combinatorics. The sequences which are solutions of these equations are called holonomic, P-recursive or D-finite.

From the late 1980s on the first algorithms were developed to find solutions for these equations. Sergei A. Abramov, Marko Petkovšek and Mark van Hoeij described algorithms to find polynomial, rational, hypergeometric and d'Alembertian solutions.

Definition
Let $\mathbb{K}$ be a field of characteristic zero (for example $\mathbb{K} = \mathbb{Q}$ ), $p_k(n) \in \mathbb{K} [n]$  polynomials for $k = 0,\dots,r$ ,$f \in \mathbb{K}^{\N}$  a sequence and $y \in \mathbb{K}^{\N}$  an unknown sequence. The equation$$\sum_{k=0}^r p_k(n) \, y (n+k) = f(n)$$is called a linear recurrence equation with polynomial coefficients (all recurrence equations in this article are of this form). If $p_0$ and $p_r$  are both nonzero, then $r$  is called the order of the equation. If $f$ is zero the equation is called homogeneous, otherwise it is called inhomogeneous.

This can also be written as $L y = f$ where $L=\sum_{k=0}^r p_k N^k$  is a linear recurrence operator with polynomial coefficients and $N$  is the shift operator, i.e. $N \, y (n) = y (n+1)$.

Closed form solutions
Let $\sum_{k=0}^r p_k(n) \, y (n+k) = f(n)$ or equivalently $Ly=f$  be a recurrence equation with polynomial coefficients. There exist several algorithms which compute solutions of this equation. These algorithms can compute polynomial, rational, hypergeometric and d'Alembertian solutions. The solution of a homogeneous equation is given by the kernel of the linear recurrence operator: $\ker L = \{ y \in \mathbb{K}^\N \, : \, L y = 0\}$. As a subspace of the space of sequences this kernel has a basis. Let $\{ y^{(1)}, y^{(2)}, \dots, y^{(m)} \}$ be a basis of $\ker L$, then the formal sum $c_1 y^{(1)} + \dots + c_m y^{(m)}$  for arbitrary constants $c_1,\dots,c_m \in \mathbb{K} $  is called the general solution of the homogeneous problem $Ly=0$. If $\tilde{y}$ is a particular solution of $Ly=f$, i.e. $L \tilde{y}=f$ , then $c_1 y^{(1)} + \dots + c_m y^{(m)} + \tilde{y}$  is also a solution of the inhomogeneous problem and it is called the general solution of the inhomogeneous problem.

Polynomial solutions
In the late 1980s Sergei A. Abramov described an algorithm which finds the general polynomial solution of a recurrence equation, i.e. $y (n) \in \mathbb{K} [n]$, with a polynomial right-hand side$f(n) \in \mathbb{K} [n]$. He (and a few years later Marko Petkovšek) gave a degree bound for polynomial solutions. This way the problem can simply be solved by considering a system of linear equations. In 1995 Abramov, Bronstein and Petkovšek showed that the polynomial case can be solved more efficiently by considering power series solution of the recurrence equation in a specific power basis (i.e. not the ordinary basis $(x^n)_{n \in \N}$ ).

The other algorithms for finding more general solutions (e.g. rational or hypergeometric solutions) also rely on algorithms which compute polynomial solutions.

Rational solutions
In 1989 Sergei A. Abramov showed that a general rational solution, i.e. $y(n) \in \mathbb{K} (n)$, with polynomial right-hand side $f(n) \in \mathbb{K}[n]$ , can be found by using the notion of a universal denominator. A universal denominator is a polynomial $u$ such that the denominator of every rational solution divides $u$. Abramov showed how this universal denominator can be computed by only using the first and the last coefficient polynomial $p_0$ and $p_r$. Substituting this universal denominator for the unknown denominator of $$y$$ all rational solutions can be found by computing all polynomial solutions of a transformed equation.

Hypergeometric solution
A sequence $y(n)$ is called hypergeometric if the ratio of two consecutive terms is a rational function in $$n$$, i.e. $y (n+1) / y(n) \in \mathbb{K} (n)$. This is the case if and only if the sequence is the solution of a first-order recurrence equation with polynomial coefficients. The set of hypergeometric sequences is not a subspace of the space of sequences as it is not closed under addition.

In 1992 Marko Petkovšek gave an algorithm to get the general hypergeometric solution of a recurrence equation where the right-hand side $$f$$ is the sum of hypergeometric sequences. The algorithm makes use of the Gosper-Petkovšek normal-form of a rational function. With this specific representation it is again sufficient to consider polynomial solutions of a transformed equation.

A different and more efficient approach is due to Mark van Hoeij. Considering the roots of the first and the last coefficient polynomial $p_0$ and $p_r$  – called singularities – one can build a solution step by step making use of the fact that every hypergeometric sequence $y (n)$  has a representation of the form$$y (n) = c \, r(n)\, z^n \, \Gamma(n-\xi_1)^{e_1} \Gamma(n-\xi_2)^{e_2} \cdots \Gamma(n-\xi_s)^{e_s}$$for some $c \in \mathbb{K}, z \in \overline{\mathbb{K}}, s \in \N, r(n) \in \overline\mathbb{K}(n), \xi_1, \dots, \xi_s \in \overline{\mathbb{K}}$  with $\xi_i-\xi_j \notin \Z$  for $i \neq j$  and $e_1, \dots, e_s \in \Z$. Here $\Gamma (n)$ denotes the Gamma function and $\overline{\mathbb{K}}$  the algebraic closure of the field $\mathbb{K}$. Then the $\xi_1, \dots, \xi_s $ have to be singularities of the equation (i.e. roots of $p_0$  or $p_r$ ). Furthermore one can compute bounds for the exponents $e_i$. For fixed values $\xi_1, \dots, \xi_s, e_1, \dots, e_s $ it is possible to make an ansatz which gives candidates for $z$. For a specific $z$ one can again make an ansatz to get the rational function $r(n)$  by Abramov's algorithm. Considering all possibilities one gets the general solution of the recurrence equation.

D'Alembertian solutions
A sequence $$y$$ is called d'Alembertian if $y = h_1 \sum h_2 \sum \cdots \sum h_k$ for some hypergeometric sequences $h_1,\dots,h_k$  and $y=\sum x$  means that $\Delta y = x$  where $\Delta $  denotes the difference operator, i.e. $\Delta y = N y - y = y (n+1) - y(n)$. This is the case if and only if there are first-order linear recurrence operators $L_1, \dots, L_k$ with rational coefficients such that $L_k \cdots L_1 y = 0$.

1994 Abramov and Petkovšek described an algorithm which computes the general d'Alembertian solution of a recurrence equation. This algorithm computes hypergeometric solutions and reduces the order of the recurrence equation recursively.

Signed permutation matrices
The number of signed permutation matrices of size $$n \times n$$ can be described by the sequence $y(n) \in \Q^{\N}$. A signed permutation matrix is a square matrix which has exactly one nonzero entry in every row and in every column. The nonzero entries can be $\pm 1$. The sequence is determined by the linear recurrence equation with polynomial coefficients$$y (n) = 4(n-1)^2 \, y (n-2) + 2 \, y (n-1)$$and the initial values $y(0) = 1, y(1) = 2$. Applying an algorithm to find hypergeometric solutions one can find the general hypergeometric solution$$y (n) = c \, 2^n n!$$for some constant $c$. Also considering the initial values, the sequence $y (n) = 2^n n!$ describes the number of signed permutation matrices.

Involutions
The number of involutions $y(n)$ of a set with $n$  elements is given by the recurrence equation$$y (n) = (n-1) \, y (n-2) + y (n-1).$$Applying for example Petkovšek's algorithm it is possible to see that there is no polynomial, rational or hypergeometric solution for this recurrence equation.

Applications
A function $F(n,k)$ is called hypergeometric if $F(n,k+1)/F(n,k), F(n+1,k)/F(n,k) \in \mathbb{K}(n,k)$  where $\mathbb{K}(n,k)$  denotes the rational functions in $n$  and $k$. A hypergeometric sum is a finite sum of the form $f(n)=\sum_k F(n,k)$ where $F(n,k)$  is hypergeometric. Zeilberger's creative telescoping algorithm can transform such a hypergeometric sum into a recurrence equation with polynomial coefficients. This equation can then be solved to get for example a linear combination of hypergeometric solutions which is called a closed form solution of $f$.