The Quasi-Holonomic Ansatz and Restricted Lattice Walks

Manuel KAUERS^{1} and Doron ZEILBERGER^{2}

Dedicated to Gerry Ladas on his 70th Birthday

Preface: A One-Line Proof of Kreweras’ Quarter-Plane Walk Theorem

See: http://www.math.rutgers.edu/~zeilberg/tokhniot/oKreweras .

Comments: The great enumerator Germain Kreweras empirically discovered this intriguing fact, and then needed lots of pages[K], and lots of human ingenuity, to prove it. Other great enumerators, for example, Heinrich Niederhausen[N], Ira Gessel[G1], and Mireille Bousquet-Mélou[B], found other ingenious, “simpler” proofs. Yet none of them is as simple as ours! Our proof (with the generous help of our faithful computers) is “ugly” in the traditional sense, since it would be painful for a lowly human to follow all the steps. But according to our humble aesthetic taste, this proof is much more elegant, since it is (conceptually) one-line. So what if that line is rather long (a huge partial-recurrence equation satisfied by the general counting function), it occupies less storage than a very low-resolution photograph.

Unrestricted Lattice Walks

Suppose that you are walking, in the d-dimensional hyper-cubic lattice Z^{d}, starting at the origin, and at each time-unit (you can call it a nano-second if you are a fast-walker, or a year if you are slow), you are allowed to use any step from a certain finite set of fundamental steps

S = {(s_{1}, …, s_{d})} ,

where each fundamental step can have arbitrary integer components (i.e. negative, positive, or zero).

For example, for the simple lattice (“random”) walk on the line, we have S = {−1, 1}, while for the simple random walk on the two-dimensional square lattice, we have S = {(1, 0), (−1, 0), (0, 1), (0, −1)}. To cite another example, a Knight, on an infinite chessboard, is allowed any of the following eight steps:

S = { (±2, ±1) , (±1, ±2) } .

The quantity of interest is the d + 1-variable discrete function, let’s call it

F (m; n_{1}, …, n_{d}) ,

1 Supported in part by the Austrian Science Foundation (FWF), grants SFB F1305 and P19462-N18.

2 Supported in part by the USA National Science Foundation.

that counts the number of ways of walking from the origin (0, …, 0) to the point (n_{1}, …, n_{d}) in exactly m steps.

Often, one is interested, more specifically, in f(m) := F (m; 0, …, 0), the number of such walks that return to the origin after m steps, and, of course we have that g(m), the total number of walks with m steps, at the present unrestricted case, is trivially |S|^{m}.

It is very easy to write down the (full) generating function of F:

F̃(t; x_{1}, …, x_{d}) := ∑_{m=0}^{∞} ∑_{n_{1}=−∞}^{∞} … ∑_{n_{d}=−∞}^{∞} F (m; n_{1}, …, n_{d}) t^{m}x_{1}^{n_{1}} … x_{d}^{n_{d}} .

Indeed, the readers will have no trouble convincing themselves that

F̃(t; x_{1}, …, x_{d}) = [1 − t ( ∑_{(s_{1},...,s_{d})∈S} x_{1}^{s_{1}} … x_{d}^{s_{d}} )]^{−1} ,

which is a rational function of its variables, and it should be interpreted as a formal power series in t whose coefficients are Laurent polynomials in (x_{1}, …, x_{d}).

It follows immediately from “general holonomic nonsense” [Z1][WZ] that F (m; n_{1}, …, n_{d}) is completely holonomic, i.e. it satisfies d + 1 pure (homogeneous) linear recurrences with polynomial coefficients, one for each of its arguments. (Generically speaking. In some degenerate cases some or all of these d + 1 equations coincide, and one needs more equations to describe the function.).

More verbosely, there exists a positive integer L, and polynomials

p_{0}(m; n_{1}, ..., n_{d}) , p_{1}(m; n_{1}, ..., n_{d}) , …, p_{L}(m; n_{1}, ..., n_{d}) ,

such that

∑_{i=0}^{L} p_{i}(m; n_{1}, …, n_{d})F (m + i; n_{1}, …, n_{d}) = 0 ,

for all m ≥ 0 and (n_{1}, …, n_{d}) ∈ Z^{d}, and for each dimension n_{i}, (i = 1 … d), there exists a positive integer K_{i}, and polynomials q_{j}^{(i)}(m; n_{1}, …, n_{d}), j = 0 … K_{i}, such that

∑_{j=0}^{K_{i}} q_{j}^{(i)}(m; n_{1}, …, n_{d})F (m; n_{1}, n_{i−1}, n_{i} + j, n_{i+1} …, n_{d}) = 0 .

Furthermore, thanks to [MZ] (that contains, among other things, a multi-variable extension of the Almkvist-Zeilberger[AZ] algorithm), and [W], one can actually explicitly find these recurrences. However, for d larger than 4 and/or for large sets S, it soon becomes impractical with today’s computers.

Restricted Lattice Walk

Very often, in real life, we would like to stay in certain sub-regions of Z^{d}. In this case, it is no longer true that the counting function F is necessarily holonomic, as shown by Mireille Bousquet-Mélou and Marko Petkovsek in a seminal paper [MP]. But, sometimes it is still holonomic, because of the “nice” structure of the restricted region.

For example, if the the set of steps, S, consists of the unit positive steps in d dimensions, and one is only allowed to stay in n_{1} ≥ n_{2} ≥ … ≥ n_{d}, we have the famous d-dimensional ballot problems, that is equivalent to the problem of enumerating standard Young Tableaux of shape (n_{1}, …, n_{d}). Here we famously have the Young-Frobenius-MacMahom formula, that f(n_{1}, …, n_{d}) := F (n_{1} + … + n_{d}; n_{1}, …, n_{d}) is given by

f(n_{1}, …, n_{d}) = ∏_{1≤i<j≤d}(n_{i} − n_{j} + j − i) · \frac{(n_{1} + … + n_{d})!}{(n_{1} + d − 1)!(n_{2} + d − 2)! … (n_{d})!} ,

that immediately implies that not only is it holonomic, but the relevant recurrences for f are first-order in each of its variables, since f is expressible in closed-form.

There are other examples, even allowing negative steps, where one still stays in the holonomic realm, see for example [GZ]. This happens because if you put mirrors on the bounding hyper-planes, the group generated by the reflections is finite (the so-called Weyl, or Coxeter group), and the set of steps is invariant under that group.

Kreweras’ Walks

But things start to get complicated very soon. Consider the following set of three steps

S = {(−1, 0), (0, −1), (1, 1)} ,

walking in two dimensions, and staying in the positive quadrant, i.e. one must stay in the region {(n_{1}, n_{2}) | n_{1} ≥ 0 , n_{2} ≥ 0}.

Obviously, F (m; n_{1}, n_{2}), defined for m ≥ 0, n_{1} ≥ −1, n_{2} ≥ −1, satisfies the following simple recurrence

F (m; n_{1}, n_{2}) = F (m − 1; n_{1} + 1, n_{2}) + F (m − 1; n_{1}, n_{2} + 1) + F (m − 1; n_{1} − 1, n_{2} − 1) ,

(whenever m ≥ 1 and n_{1}, n_{2} ≥ 0),

subject to the initial condition:

F (0; n_{1}, n_{2}) = \{ \begin{matrix}1, & if (n_{1},n_{2})=(0,0) , \\ 0, & otherwise . \end{matrix}

and the boundary conditions:

F (m; n_{1}, n_{2}) = 0 if n_{1} = −1 or n_{2} = −1 .

Surprisingly, F (m; 0, 0) is closed-form. In a classic paper, Germain Kreweras[K] proved that

F (3n; 0, 0) = \frac{4^{n}}{(n + 1)(2n + 1)}\binom{3n}{n} ,

(of course F (m; 0, 0) = 0 if m is not a multiple of 3).

A naive approach would be to try and conjecture a closed-form formula, in terms of m, n_{1}, n_{2}, for the general F (m; n_{1}, n_{2}), verify that this formula obeys the above simple recurrence and the initial and boundary conditions, and finally plug-in n_{1} = 0, n_{2} = 0.

Alas, while F (m; 0, 0) is almost as nice as could be, the general F (m; n_{1}, n_{2}) is a huge mess, and the above approach is doomed to failure, at least if taken literally. We will later show how to rescue this simple-minded approach, by reasoning in the holonomic (or if necessary, quasi-holonomic) realm.

Approaches

The most successful approach so far, was to derive a functional equation for the generating function, using combinatorial ([K]) or probabilistic ([G1]) reasoning, followed sometimes by the Kernel method, brought to new heights by “La Mireille”[B]. A very nice systematic study of the successes of the Kernel method, still in the quarter plane, and with exactly three steps, all with coordinates between −1 and 1, was undertaken by Marni Mishna[Mi].

Ira Gessel’s Intriguing Conjecture

If the set of steps is

S = {(−1, 0), (1, 0), (−1, −1), (1, 1)} ,

still staying in the positive quadrant ({(x, y) | x ≥ 0, y ≥ 0}), then Ira Gessel[G2] discovered empirically that (recall that (a)_{n} := a(a + 1) ⋯ (a + n − 1)),

F (2n; 0, 0) = 16^{n} \frac{(5/6)_{n}(1/2)_{n}}{(2)_{n}(5/3)_{n}} .

(Of course F(2n+1;0) =0). At this time of writing, as far as we know, this remains unproved. The Kernel method, so far, did not succeed, perhaps because that now there are four steps.

The Holonomic Approach

In [Z2], an empirical-yet-rigorous approach for enumerating unrestricted lattice paths was suggested, using the holonomic ansatz. This method should, (and indeed does!, see the output at this article’s webpage) succeed in doing the Kreweras problem. We now know, a posteriori, that the full generating function F̃(t; x_{1}, x_{2}) for Kreweras walk is even algebraic, and hence a fortiori, holonomic. Hence, there exists, a (giant!) linear recurrence operator

P(M, m, n_{1}, n_{2}) ,

where M is the shift operator in m, (i.e. Mf(m) := f(m + 1) for any function f(m) ), annihilating F (m; n_{1}, n_{2}). It turns out that P(M, m, n_{1}, n_{2}) is extremely complicated, but once found, pluggingin n_{1} = 0, n_{2} = 0 gives an operator, P(M, m, 0, 0), annihilating F (m; 0, 0).

How to prove that the empirically-derived operator does indeed annihilate F?

Let’s restrict attention to the quarter-plane. Similar reasonings apply to higher dimensions and more general regions.

Given a set of steps S, our discrete function F (m; n_{1}, n_{2}) satisfies the recurrence

F (m; n_{1}, n_{2}) = ∑_{(s_{1},s_{2})∈S} F (m − 1; n_{1} − s_{1}, n_{2} − s_{2}) ,

which means that F (m; n_{1}, n_{2}) is annihilated by the linear recurrence operator with constant coefficients

Q = 1 − M^{−1} ( ∑_{(s_{1},s_{2})∈S} N_{1}^{−s_{1}}N_{2}^{−s_{2}} ) .

We want to prove that QF = 0 plus the obvious initial and boundary conditions, imply that PF = 0.

Let’s call an operator good it it only contains non-negative exponents of the shift operators N_{1}, N_{2}. For example 1 − M^{−1}N_{1}^{2} − M^{−2}N_{2} is good but 1 − M^{−1}N_{1}^{−1} is not.

By taking commutators, or otherwise, we find, calling P_{0} = P, a sequence of good operators, R_{0}(m, n_{1}, n_{2}, M, N_{1}, N_{2}), …, R_{d}(m, n_{1}, n_{2}, M, N_{1}, N_{2}), and operators P_{1}(m, n_{1}, n_{2}, M, N_{1}, N_{2}), … , P_{d}(m, n_{1}, n_{2}, M, N_{1}, N_{2}), of lower-and-lower degrees such that

QP_{0} = R_{0}Q + P_{1} ,
QP_{1} = R_{1}Q + P_{2} ,
…
QP_{d} = R_{d}Q + P_{d+1} ,

with P_{d+1} = 0. Since R_{d} is “good”, and since QF = 0, we have that R_{d}QF = 0 and hence Q[P_{d}F] = 0. Then check that the boundary conditions for P_{d}F are the same and the initial condition is identically 0 to deduce that P_{d}F = 0. By backwards induction we (or rather our computer, it can all be mechanized) in turn, proves P_{d−1}F = 0 , P_{d−2}F = 0 , …, P_{0}F = 0.

Note that if you don’t insist that the R_{i}’s are “good” one can always take R_{i} = P_{i}, and P_{i+1} is simply the commutator of Q and P_{i}, for i = 0, 1, …, d. Since Q is constant-coefficients, taking commutators with any operator with polynomial coefficients, always decreases the degree of the polynomial coefficients, so if the degree is d, eventually, after d+1 iterations, we get that P_{d+1} = 0. If we want the R_{i} to be good, we have to adjust things to be good.

In fact, for the lattice-paths-counting problems treated here, with the time variable m, starting at time m = 0 at the origin, it is not really necessary to demand that the R_{i} be “good”. We can consider the function F to be defined everywhere, with 0 at the forbidden region, and rephrase that QF = δ(n_{1}, n_{2}) when m = 0, where δ(n_{1}, n_{2}) is the discrete delta function that is 1 at the origin and 0 elsewhere.

The Quasi-Holonomic Approach

For the sake of exposition, let’s stay in the plane (analogous reasoning applies in general), and let n denote discrete time and (a, b) discrete space.

As mentioned above, Mireille Bousquet-Mélou and Marko Petkovsek proved that it is not always true, for arbitrary steps and arbitrary boundaries, that the counting function is holonomic. It is probably usually false, and the holonomicity of the Kreweras walks, and the few other cases in which it may hold, are just flukes (or follow from other considerations).

But who cares about holonomicity? Maybe it is asking way too much. Suppose, like, in the case of Gessel’s conjecture mentioned above, F (n; 0, 0) turns out to be holonomic in the single variable n.

If F (n; a, b) is holonomic in all its arguments, then there exist three independent, pure recurrence operators

P_{1}(n, a, b, N) , P_{2}(n, a, b, A) , P_{3}(n, a, b, B) ,

annihilating F. In particular, P_{1}(n, 0, 0, N) would give us the desired operator.

But, very likely, F (n; a, b) is not holonomic, and even if it is, like in Kreweras’ case, P_{1}(n, a, b, N) is too big. What do we do now? Something much more modest would do the job!

All we need is one linear recurrence operator with polynomial coefficients of the form

R(a, b, n, A, B, N) = R_{0}(n, N) + aR_{1}(a, b, n, A, B, N) + bR_{2}(b, n, A, B, N) ,

with R_{0} ≠ 0.

Once found, empirically, one can prove that it annihilates our counting function F (n, a, b) as above, by constructing a sequence of operators (by taking commutators, and possibly tweaking to get good operators). Once R is found, and proved to indeed annihilate F (n, a, b) (all of which should be done completely automatically by the computer), all we have to do is plug-in a = 0, b = 0 in

R(a, b, n, A, B, N)F (n, a, b) = 0 ,

and get that

R_{0}(n, N)F (n, 0, 0) = 0 .

QED.

Our “one-line” proof of Kreweras’ theorem, mentioned in the preface, used this quasi-holonomic ansatz, even though, in this case, it is known that the counting function is holonomic. Staying within the holonomic ansatz would have made the “one-line” yet longer and its computation yet slower. (A holonomic operator R(a, b, n, N) for the Kreweras walks is, for comparison, also available from the webpage of this article: krewerasComplete).

Analogs to Kreweras’ theorem can be found effortlessly for all the eleven walks that Mishna[Mi] has isolated as being essentially different. The results are as follows:

step set  number of closed paths
1 {(0, 1), (1, 1), (1, 0)}  f(n, 0, 0) = 0
2 \{(0, 1), (1, 1), (−1, −1)\}  f(2n, 0, 0) = \frac{4^{n}(1/2)_{n}}{(1)_{n+1}}
3 {(0, 1), (1, 1), (1, −1)}  f(n, 0, 0) = 0
4 \{(0, 1), (0, −1), (1, −1)\}  f(2n, 0, 0) = \frac{4^{n}(1/2)_{n}}{(1)_{n+1}}
5 \{(−1, 0), (0, −1), (1, 1)\}  f(3n, 0, 0) = \frac{2·27^{n−1}(4/3)_{n−1}(5/3)_{n−1}}{(5/2)_{n−1}(3)_{n−1}}
6 \{(0, 1), (1, 0), (−1, −1)\}  f(3n, 0, 0) = \frac{2·27^{n−1}(4/3)_{n−1}(5/3)_{n−1}}{(5/2)_{n−1}(3)_{n−1}}
7 \{(−1, 0), (0, 1), (1, −1)\}  f(3n, 0, 0) = \frac{27^{n−1}(4/3)_{n−1}(5/3)_{n−1}}{(3)_{n−1}(4)_{n−1}}
8 \{(0, 1), (−1, −1), (1, −1)\} f(4n, 0, 0) = \frac{2·64^{n−1}(5/4)_{n−1}(3/2)_{n−1}(7/4)_{n−1}}{(2)_{n−1}(5/2)_{n−1}(3)_{n−1}}
9 \{(−1, 0), (1, 1), (1, −1)\}  f(4n, 0, 0) = \frac{2·64^{n−1}(5/4)_{n−1}(3/2)_{n−1}(7/4)_{n−1}}{(2)_{n−1}(5/2)_{n−1}(3)_{n−1}}
10 {(−1, 1), (0, 1), (1, −1)}  f(n, 0, 0) = 0
11 {(−1, 1), (1, 1), (1, −1)}  f(n, 0, 0) = 0

Computer-generated proofs for the non-zero entries can be found at the webpage of this article.

We have also searched for an operator R(a, b, n, A, B, N) that would yield a proof of Gessel’s conjecture, but it has turned out that no such operator can be found whose degree in A, B, N individually is at most 8 and whose total degree in a, b, n is at most 6.

A more refined counting

Another interesting problem is as follows. Given a set of steps S = {S_{i}|i = 1 … r}, count the number of walks with exactly A_{i} steps of kind S_{i}. Now the condition that it stays in the quarterplane (or half-line, or eighth-space, or whatever), can be expressed as walks, with positive unit steps in N^{r} confined to the positive sides of certain hyperplane. For example, for Kreweras’s walks, if f(a, b, c) is the number of walks using a steps of kind (−1, −1), b steps of kind (1, 0) and c steps of kind (0, 1), we are counting walks from the origin to (a, b, c) staying in c ≥ a and b ≥ a. Then f(n, n, n) is what we called above F (3n; 0, 0).

To get the quantity of interest in Gessel’s conjecture, we need to compute

G(n) := ∑_{a=0}^{n} f(a, a, n − a, n − a) .

Even though f(a, b, c, d) is unlikely to be holonomic, let’s hope that it is quasi-holonomic enough to guarantee that G(n) is holonomic in the single variable n, a fact that we already know empirically, but it would be nice to prove it.

The Maple package WalkCarefully counts walks this way. Open problem (even empirically) Is the analog of Kreweras’ walk in three dimensions holonomic? In other words does the sequence a(n) := the number of ways of walking in the positive eigth-space ( {(x, y, z) | x ≥ 0, y ≥ 0, z ≥ 0}), starting at the origin, walking 4n steps, and returning to the origin, only employing the steps

{ (−1, −1, −1) , (1, 0, 0) , (0, 1, 0) , (0, 0, 1) } ,

a solution of a linear recurrence equation with polynomial coefficients? According to our computations, it would satisfy a recurrence of very high order and degree if it were. What About Gessel’s Problem The holy grail for lattice-walk-counters, currently, is a proof of Ira Gessel’s conjecture. We strongly believe that the counting function is quasi-holonomic, so the present approach should, at least in principle, prove it. But, of course, it remains to be seen whether our proverbial margin is wide enough to contain the proof. We also strongly believe that there is a much simpler proof (in all senses of the word) of that conjecture, that requires less that 1K of memory. That simple proof would come once the right and natural ansatz to which the (restricted) counting function belongs to, will be discovered. To give an analogy, we can routinely prove that

∑_{k=0}^{10000000} \binom{10000000}{k}x^{k}y^{10000000−k} = (x + y)^{10000000} ,

by staying in the polynomial ansatz. But it would be much more efficient to first prove that

∑_{k=0}^{n} \binom{n}{k}x^{k}y^{n−k} = (x + y)^{n} ,

for all n, by working in the holonomic ansatz, using WZ theory, say, and then, simply, plug-in n = 10000000. The hard part, of course, for which we still need humans, is to chercher l’ansatz. Maple and Mathematica Packages This article is accompanied by four very basic Maple packages, that compute the counting functions and empirically guess recurrences. These are:

HalfLine , OneDimWalks, QuarterPlane, WalkCarefully .

There are also Mathematica packages

Guess , Walks

All these are available at the webpage of this article:

http://www.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/quasiholo.html .

It is hoped that these can be extended to prove, fully automatically, Gessel’s conjecture, as well as make up their own conjectures and proofs for other sets of steps. References

[AZ] G. Almkvist and D. Zeilberger, The method of differentiating under the integral sign, J. Symbolic Computation 10, 571-591 (1990).

[B] M. Bousquet-Mélou, Walks in the quarter plane: Kreweras’ algebraic model, Annals of Applied Probability 15 (2005), 1451-1491.

[BP] M. Bousquet-Mélou and M. Petkovsek, Walks confined in a quadrant are not always D-finite, Theor. Computer Sci. 307 (2003), 257-276.

[G1] I. Gessel, A probabilistic method for lattice path enumeration, J. Stat. Plann. Inference 14 (1986), 49-58.

[G2] I. Gessel , private communication.

[GZ] I. Gessel and D. Zeilberger, Random Walk in a Weyl chamber, Proc. Amer. Math. Soc. 115, 27-31 (1992).

[K] G. Kreweras, Sur une class de problèmes liés au treillis des partitions d’ entiers, Cahiers du B.U.R.O, 6 (1965), 5-105.

[Mi] M. Mishna, Classifying lattice walks restricted to the quarter plane, preprint. Available from arxiv.org (# 0611651).

[MZ] M. Mohammed and D. Zeilberger, Multi-Variable Zeilberger and Almkvist-Zeilberger Algorithms and the Sharpening of Wilf-Zeilberger Theory, Adv. Appl. Math. 37 (2006), 139-152.

[N] H. Niederhausen, The ballot problem with three candidates, European J. Combin., 1 (1980), 175-188.

[W] K. Wegschaider. “Computer Generated Proofs of Binomial Multi-Sum Identities, RISC, J. Kepler University. Diploma Thesis. May 1997.

[WZ] H.S. Wilf and D. Zeilberger, An algorithmic proof theory for hypergeometric (ordinary and ”q”) multisum/integral identities, Invent. Math. 108, 575-633 (1992).

[Z1] D. Zeilberger, A Holonomic systems approach to special functions identities, J. of Computational and Applied Math. 32, 321-368 (1990).

[Z2] The Holonomic ansatz I. Foundations and Applications to Lattice Paths Counting, Annals of Combinatorics 11 (2007), 227-239.

Manuel Kauers, Research Institute for Symbolic Computation, J. Kepler Univ. Linz, Austria. mkauers@risc.uni-linz.ac.at .

Doron Zeilberger, Mathematics Department, Rutgers University (New Brunswick), Piscataway, NJ, USA. zeilberg@math.rutgers.edu .

First Written: Dec. 5, 2007

This version: Dec. 14, 2007