# A human proof of Gessel's lattice path conjecture

Alin Bostan, Irina Kurkova, Kilian Raschel

► To cite this version:

Alin Bostan, Irina Kurkova, Kilian Raschel. A human proof of Gessel's lattice path conjecture. Transactions of the American Mathematical Society, 2017, 369 (2, February 2017), pp.1365-1393. hal-00858083v3

HAL Id: hal-00858083

https://hal.science/hal-00858083v3

Submitted on 13 Feb 2015

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A HUMAN PROOF OF GESSEL'S LATTICE PATH CONJECTURE

A. BOSTAN, I. KURKOVA, AND K. RASCHEL

Abstract. Gessel walks are lattice paths confined to the quarter plane that start at the origin and consist of unit steps going either West, East, South-West or North-East. In 2001, Ira Gessel conjectured a nice closed-form expression for the number of Gessel walks ending at the origin. In 2008, Kauers, Koutschan and Zeilberger gave a computer-aided proof of this conjecture. The same year, Bostan and Kauers showed, again using computer algebra tools, that the complete generating function of Gessel walks is algebraic. In this article we propose the first "human proofs" of these results. They are derived from a new expression for the generating function of Gessel walks in terms of Weierstrass zeta functions.

## 1. Introduction

**Main results.** Gessel walks are lattice paths confined to the quarter plane $N^2 = \{0, 1, 2, \dots\} \times \{0, 1, 2, \dots\}$, that start at the origin (0, 0) and move by unit steps in one of the following directions: West, East, South-West and North-East, see Figure 1. Gessel excursions are those Gessel walks that return to the origin. For $(i, j) \in N^2$ and $n \ge 0$, let $q(i, j; n)$ be the number of Gessel walks of length $n$ ending at the point $(i, j)$. Gessel walks have been puzzling the combinatorics community since 2001, when Ira Gessel conjectured:

(A) For all $n \ge 0$, the following closed-form expression holds for the number of Gessel excursions of even length $2n$

$$q(0, 0; 2n) = 16^n \frac{(5/6)_n (1/2)_n}{(2)_n (5/3)_n}, \qquad (1)$$

where $(a)_n = a(a+1)\cdots(a+n-1)$ denotes the Pochhammer symbol.

Note that obviously there are no Gessel excursions of odd length, that is $q(0, 0; 2n+1) = 0$ for all $n \ge 0$. In 2008, Kauers, Koutschan and Zeilberger [19] provided a computer-aided proof of this conjecture.

A second intriguing question was to decide whether or not:

Date: February 12, 2015.

1991 Mathematics Subject Classification. Primary 05A15; Secondary 30F10, 30D05.

Key words and phrases. Enumerative combinatorics; lattice paths; Gessel walks; generating functions; algebraic functions; elliptic functions.

A. Bostan: INRIA Saclay Île-de-France, Bâtiment Alan Turing, 1 rue Honoré d'Estienne d'Orves, 91120 Palaiseau, France.

I. Kurkova: Laboratoire de Probabilités et Modèles Aléatoires, Université Pierre et Marie Curie, 4 Place Jussieu, 75252 Paris Cedex 05, France.

K. Raschel: CNRS & Fédération de recherche Denis Poisson & Laboratoire de Mathématiques et Physique Théorique, Université de Tours, Parc de Grandmont, 37200 Tours, France.

Emails: Alin.Bostan@inria.fr, Irina.Kourkova@upmc.fr, and Kilian.Raschel@lmpt.univ-tours.fr.
<figure><img src="image_2.png" /><figcaption>Figure 1. On the left: allowed steps for Gessel walks. Note that on the boundary of $\mathbb{N}^2$, the steps that would take the walks out of $\mathbb{N}^2$ are discarded. On the right: an equivalent formulation of Gessel walks as the simple walks evolving in the cone with opening 135°.</figcaption></figure>

(B) Is the complete generating function (GF) of Gessel walks

$$Q(x, y; z) = \sum_{i,j,n \ge 0} q(i, j; n) x^i y^j z^n \quad (2)$$

D-finite<fnref n="1" />, or even algebraic (i.e., root of a non-zero polynomial in $Q(x, y, z)[T]$)?

The answer to this question —namely, the (initially unexpected) algebraicity of $Q(x, y; z)$— was finally obtained by Bostan and Kauers [4], using computer algebra techniques.

In summary, the only existing proofs for Problems (A) and (B) used heavy computer calculations in a crucial way. In this article we obtain a new explicit expression for $Q(x, y; z)$, from which we derive the first “human proofs” of (A) and (B).

**Context of Gessel's conjecture.** In 2001, the motivation for considering Gessel's model of walks was twofold. First, by an obvious linear transformation, Gessel's walk can be viewed as the simple walk (i.e., with allowed steps to the West, East, South and North) constrained to lie in a cone with angle 135°, see Figure 1. It turns out that before 2001, the simple walk was well studied in different cones. Pólya [32] first considered the simple walk in the whole plane ("drunkard's walk"), and remarked that the probability that a simple random walk ever returns to the origin is equal to 1. This is a consequence of the fact that there are exactly $\binom{2n}{n}^2$ simple excursions of length $2n$ in the plane $\mathbb{Z}^2$. There also exist formulæ for simple excursions of length $2n$ evolving in other regions of $\mathbb{Z}^2$: $\binom{2n+1}{n}C_n$ for the half plane $\mathbb{Z} \times \mathbb{N}$, and $C_nC_{n+1}$ for the quarter plane $\mathbb{N}^2$, where $C_n = \frac{1}{n+1}\binom{2n}{n}$ is the Catalan number [2]. Gouyou-Beauchamps [16] found a similar formula $C_nC_{n+2} - C_{n+1}^2$ for the number of simple excursions of length $2n$ in the cone with angle 45° (the first octant). It was thus natural to consider the cone with angle 135°, and this is what Gessel did.

The second part of the motivation is that Gessel's model is a particular instance of walks in the quarter plane. In 2001 there were already several famous examples of such models: Kreweras' walk [21, 13, 14, 6] (with allowed steps to the West, North-East and South) for which the GF (2) is algebraic; Gouyou-Beauchamps's walk [16]; the simple walk [17].

<footnote n="1">¹The function $Q(x, y; z)$ is called D-finite if the vector space over $Q(x, y, z)$—the field of rational functions in the three variables x, y, z—spanned by the set of all partial derivatives of $Q(x, y; z)$ is finite-dimensional, see for instance [25].</footnote>
Further, around 2000, walks in the quarter plane were brought up to date, notably by Bousquet-Mélou and Petkovšek [8, 9]. Indeed, they were used to illustrate the following phenomenon: although the numbers of walks satisfy a (multivariate) linear recurrence with constant coefficients, their GF (2) might be non-D-finite; see [9] for the example of the knight walk.

**Existing results in the literature.** After 2001, many approaches appeared for the treatment of walks in the quarter plane. Bousquet-Mélou and Mishna initiated a systematic study of such walks with small steps (this means that the step set, i.e., the set of allowed steps for the walk, is a subset of the set of the eight nearest neighbors). Mishna [29, 30] first considered the case of step sets of cardinality three. She presented a complete classification of the GF (2) of these walks with respect to the classes of algebraic, transcendental D-finite and non-D-finite power series. Bousquet-Mélou and Mishna [7] then explored all the 79 small step sets<fnref n="2" />. They considered a functional equation for the GF that counts walks in such a model leading to a group<fnref n="3" /> of birational transformations of $C^2$. In 23 cases out of 79 this group turns out to be finite, and the corresponding functional equations were solved in 22 out of 23 cases (the finiteness of the group being a crucial feature in [7]). The remaining case was precisely Gessel's. In 2008, a method using computer algebra techniques was proposed by Kauers, Koutschan and Zeilberger [20, 19]. Kauers and Zeilberger [20] first obtained a computer-aided proof of the algebraicity of the GF counting Kreweras' walks. A few months later, this approach was enhanced to cover Gessel's case, and the conjecture (Problem (A)) was proved [19]. At the same time, Bostan and Kauers [4] showed, again using heavy computer calculations, that the complete GF counting Gessel walks is algebraic (Problem (B)). Using the minimal polynomials obtained by Bostan and Kauers, van Hoeij [4, Appendix] managed to obtain an explicit and compact expression for the complete GF of Gessel walks.

Since the computerized proofs [19, 4], several computer-free analyses of the GF of Gessel walks have been proposed [22, 34, 11, 3, 33, 36, 24], but none of them solved Gessel's conjecture (Problem (A)), nor proved the algebraicity of the complete GF (Problem (B)). We briefly review the contributions of these works. Kurkova and Raschel [22] obtained an explicit integral representation (a Cauchy integral) for $Q(x, y; z)$. This was done by solving a boundary value problem, a method inspired by the book [10]. It can be deduced from [22] that the generating function (2) is D-finite, since the Cauchy integral of an algebraic function is D-finite [31, 35]. This partially solves Problem (B). Nevertheless, the representation of [22] seems to be hardly accessible for further analyses, such as for expressing the coefficients $q(i, j; n)$ in any satisfactory manner, and in particular for providing a proof of Gessel's conjecture. This approach has been generalized subsequently for all models of walks with small steps in the quarter plane, see [34]. In [11], Fayolle and Raschel gave a proof of the algebraicity of the bivariate GF (partially solving Problem (B)), using probabilistic and algebraic methods initiated in [10, Ch. 4]: more specifically, they proved that for any fixed value $z_0 \in (0, 1/4)$, the bivariate generating function $Q(x, y; z_0)$ for Gessel walks is algebraic over $R(x, y)$, hence over $Q(x, y)$. The same approach gives the nature of the bivariate GF

<footnote n="2">²A priori, there are $2^8 = 256$ step sets, but the authors of [7] showed that, after eliminating trivial cases, and also those which can be reduced to walks in a half plane, there remain 79 inherently different models.</footnote>

<footnote n="3">³Historically, this group was introduced by Malyshev [26, 27, 28] in the seventies. For details on this group we refer to Section 2, in particular to equation (16).</footnote>
in all the other 22 models with finite group. It is not possible to deduce Gessel's conjecture using the approach in [11], since it only uses the structure of the solutions of the functional equation (3) satisfied by the generating function (2), but does not give access to any explicit expression. Ayyer [3] proposed a combinatorial approach inspired by representation theory. He interpreted Gessel walks as words on certain alphabets. He then reformulated $q(i, j; n)$ as numbers of words, and expressed very particular numbers of Gessel walks. Petkovšek and Wilf [33] stated new conjectures, closely related to Gessel's. They found an expression for Gessel's numbers in terms of determinants of matrices, by showing that the numbers of walks are solution to an infinite system of equations. Ping [36] introduced a probabilistic model for Gessel walks, and reduced the computation of $q(i, j; n)$ to the computation of a certain probability. Using then probabilistic methods (such as the reflection principle) he proved two conjectures made by Petkovšek and Wilf in [33]. Very recently, using the Mittag-Leffler theorem in a constructive way, Kurkova and Raschel [24] obtained new series expressions for the GFs of all models of walks with small steps in the quarter plane, and worked out in detail the case of Kreweras' walks. The present article is strongly influenced by [24] and can be seen as a natural prolongation of it.

**Presentation of our method and organization of the article.** We fix $z \in (0, 1/4)$. To solve Problems (A) and (B), we start from the GFs $Q(x, 0; z)$ and $Q(0, y; z)$ and from the functional equation (see e.g. [7, §4.1])

$$ K(x, y; z)Q(x, y; z) = K(x, 0; z)Q(x, 0; z) + K(0, y; z)Q(0, y; z) - K(0, 0; z)Q(0, 0; z) - xy, \quad \forall |x|, |y| < 1. \quad (3) $$

Above, $K(x, y; z)$ is the kernel of the walk, given by

$$ K(x, y; z) = xyz \left( \sum_{(i,j) \in \mathcal{G}} x^i y^j - \frac{1}{z} \right) = xyz(xy + x + \frac{1}{x} + \frac{1}{(xy) - \frac{1}{z}}), \quad (4) $$

where $\mathcal{G} = \{(1, 1), (1, 0), (-1, 0), (-1, -1)\}$ denotes Gessel's step set (Figure 1).

Rather than deriving an expression directly for the GFs $Q(x, 0; z)$ and $Q(0, y; z)$, we shall (equivalently) obtain expressions for $Q(x(\omega), 0; z)$ and $Q(0, y(\omega); z)$ for all $\omega \in \mathbf{C}_\omega$, where $\mathbf{C}_\omega$ denotes the complex plane, and where the functions $x(\omega)$ and $y(\omega)$ arise for reasons that we now present. This idea of introducing the $\omega$-variable might appear unnecessarily complicated; in fact it is very natural, in the sense that many technical aspects of the reasonings will appear simple on the complex plane $\mathbf{C}_\omega$ (in particular, the group of the walk, the continuation of the GFs, their regularity, their explicit expressions, etc.).

We shall see in Section 2 that the elliptic curve defined by the zeros of the kernel

$$ \mathbf{T}_z = \{(x, y) \in (\mathbf{C} \cup \{\infty\})^2 : K(x, y; z) = 0\} \quad (5) $$

is of genus 1. This is a torus (constructed from two complex spheres properly glued together), or, equivalently, a parallelogram $\omega_1[0, 1] + \omega_2[0, 1]$ whose opposite edges are identified. It can be parametrized by

$$ \mathbf{T}_z = \{(x(\omega), y(\omega)) : \omega \in \mathbf{C}/(\omega_1\mathbf{Z} + \omega_2\mathbf{Z})\}, \quad (6) $$
<figure><img src="image_3.png" /><figcaption>Figure 2. Left: the subdomains of the fundamental parallelogram $[0, \omega_1) + [0, \omega_2)$ where $|x(\omega)| < 1$ (blue), $|y(\omega)| < 1$ (red) and $|x(\omega)|, |y(\omega)| < 1$ (grey). Right: corresponding domains $\Delta_x$ (blue) and $\Delta_y$ (red) on the universal covering $C_\omega$. The intersection $\Delta_x \cap \Delta_y$ is represented in grey. The domain $\Delta = \Delta_x \cup \Delta_y$ has length $7\omega_2/8$, which is larger than $\omega_3 = 3\omega_2/4$.</figcaption></figure>

where the complex number $\omega_1 \in i\mathbb{R}$ and the real number $\omega_2 \in \mathbb{R}$ are given in (11), and the functions $x(\omega)$, $y(\omega)$ are made explicit in (12) in terms of the Weierstrass elliptic function $\wp$ with periods $\omega_1, \omega_2$. By construction, $K(x(\omega), y(\omega); z)$ is identically zero.

Equation (12) and the periodicity of $\wp$ imply that the functions $x(\omega)$ and $y(\omega)$ are elliptic functions on $C_\omega$ with periods $\omega_1, \omega_2$. The complex plane $C_\omega$ can thus be considered as the universal covering of $\mathbb{T}_z$ and can be viewed as the union $\cup_{n,m \in \mathbb{Z}} \{\omega_1[n, n+1) + \omega_2[m, m+1)\}$ of infinitely many parallelograms, with the natural projection $C_\omega \to C/(\omega_1\mathbb{Z} + \omega_2\mathbb{Z})$ (see Figure 2). Our first aim is to lift on it the unknown functions $Q(x, 0; z)$ and $Q(0, y; z)$, initially defined on their respective unit disk.

The domain of $\omega_1[0, 1) + \omega_2[0, 1)$ where $|x(\omega)| < 1$ is delimited by two vertical lines (see Figure 2). Due to the ellipticity of $x(\omega)$, the corresponding domain $\{\omega \in C_\omega : |x(\omega)| < 1\}$ on the universal covering $C_\omega$ consists of infinitely many vertical strips. One of them, denoted by $\Delta_x$, belongs to the strip $i\mathbb{R} + \omega_2[0, 1)$; the other ones are its shifts by multiples of $\omega_2 > 0$.

Next, we lift $Q(x, 0; z)$ to the strip $\Delta_x \subset C_\omega$ putting $Q(x(\omega), 0; z) = Q(x, 0; z)$ for any $\omega \in \Delta_x$ such that $x(\omega) = x$. This defines an analytic and $\omega_1$-periodic—but yet unknown—function. In the same way, $Q(0, y; z)$ is lifted to the corresponding strip $\Delta_y$ on $C_\omega$. The intersection $\Delta_x \cap \Delta_y$ is a non-empty strip (Figure 2), where both functions are analytic. Since $K(x(\omega), y(\omega); z) = 0$, it follows from the main equation (3) that

$$K(x(\omega), 0; z)Q(x(\omega), 0; z) + K(0, y(\omega); z)Q(0, y(\omega); z) - K(0, 0; z)Q(0, 0; z) - x(\omega)y(\omega) = 0$$
for any $\omega \in \Delta_x \cap \Delta_y$.

This equation allows to continue $Q(x(\omega), 0; z)$ to $\Delta_y$ and $Q(0, y(\omega); z)$ to $\Delta_x$, so that both functions become meromorphic and $\omega_1$-periodic on the strip $\Delta = \Delta_x \cup \Delta_y$.
The crucial point of our approach is the following: letting $r_x(\omega) = K(x(\omega), 0; z)Q(x(\omega), 0; z)$, we have the key-identity

$$r_x(\omega - \omega_3) = r_x(\omega) + f_x(\omega), \quad \forall \omega \in \mathbf{C}_\omega, \qquad (7)$$

where the shift vector $\omega_3 = 3\omega_2/4$ (real positive) and the function $f_x$ are explicit (and relatively simple, see (14) and (23)). Equation (7) has many useful consequences:

(I) Due to (a repeated use of) (7), the function $r_x(\omega)$ can be meromorphically continued from its initial domain of definition $\Delta$ to the whole plane

$$\mathbf{C}_{\omega} = \bigcup_{n \in \mathbb{Z}} \{\Delta + n\omega_3\}, \qquad (8)$$

see Section 2. By projecting back on $\mathbf{C}_x$, we shall recover all branches of $Q(x, 0; z)$.

(II) We shall apply four times (7) and prove the identity $f_x(\omega) + f_x(\omega + \omega_3) + f_x(\omega + 2\omega_3) + f_x(\omega + 3\omega_3) = 0$ (as we remark in Section 3, it exactly corresponds to the fact that the orbit sum of Gessel's walks is zero, which was noticed in [7, Section 4.2]), from where we shall derive that $r_x$ is elliptic with periods $(\omega_1, 4\omega_3)$, see Section 3.

(III) Since by (15) $4\omega_3 = 3\omega_2$ (which is a non-trivial fact, and means that the group—to be defined in Section 2—of Gessel's model has order 8), the theory of transformations of elliptic functions will imply that $r_x$ is algebraic in the Weierstrass function $\wp$ with periods $\omega_1, \omega_2$. This will eventually yield the algebraicity of the GF $Q(x, 0; z)$. Using a similar result for $Q(0, y; z)$ and the functional equation (3), we shall derive in this way the solution to Problem (B), see Section 5.

(IV) From (7) we shall also find the poles of $r_x$ and the principal parts at them. In general, it is clearly impossible to deduce the expression of a function from the knowledge of its poles. A notable exception is constituted by elliptic functions, which is the case of the function $r_x$ for Gessel walks, see (II) above. From this fact we shall deduce an explicit expression of $r_x$ in terms of elliptic $\zeta$-functions. By projection on $\mathbf{C}_x$, this will give a new explicit expression of $Q(x, 0; z)$ for Gessel walks as an infinite series. An analogous result will hold for $Q(0, y; z)$, and (3) will then lead to a new explicit expression for $Q(x, y; z)$, see Section 3. This part of the article is inspired by [24]. However, it does not rely on results from [24], and it is more elementary.

(V) Evaluating the so-obtained expression of $Q(x, 0; z)$ at $x = 0$ and performing further simplifications (based on several identities involving special functions [1], and on the theory of the Darboux coverings for tetrahedral hypergeometric equations [37]), we shall obtain the solution of Problem (A), and, in this way, the first human proof of Gessel's conjecture, see Section 4.

## 2. Meromorphic continuation of the generating functions

**Roadmap.** The aim of Section 2 is to prove equation (7), which, as we have seen just above, is the fundamental starting tool for our analysis. In passing, we shall also introduce some useful tools for the next sections. Though crucial, this section does not contain any new result. We thus choose to state the results and to give some intuition, without proof, and we refer to [23, Sections 2–5] and to [24, Section 2] for full details.

We first properly define the Riemann surface $\mathbf{T}_z$ in (5), then we connect it to elliptic functions (in particular, we obtain the expressions of the functions $x(\omega)$ and $y(\omega)$ in terms
of the Weierstrass elliptic function $\wp$). We next introduce the universal covering of $\mathbf{T}_z$ (the plane $\mathbf{C}_\omega$) and the group of the walk. We lift the GFs to the universal covering (this allows us to define the function $r_x(\omega)$ in (7)). Finally we show how to meromorphically continue $r_x(\omega)$, and we prove the key-equation (7).

For brevity, we drop the variable $z$ (which is kept fixed in $(0, 1/4)$) from the notation when no ambiguity arises, writing for instance $Q(x, y)$ instead of $Q(x, y; z)$ and $\mathbf{T}$ instead of $\mathbf{T}_z$. In Appendix A, we gather together a few useful results on the Weierstrass functions $\wp(z)$ and $\zeta(z)$.

**Branch points and Riemann surface T.** The kernel $K(x, y)$ defined in (4) is a quadratic polynomial with respect to both variables $x$ and $y$. The algebraic function $X(y)$ defined by $K(X(y), y) = 0$ has thus two branches, and four branch points that we call $y_i$, $i \in \{1, \dots, 4\}^4$. They are the roots of the discriminant with respect to $x$ of the polynomial $K(x, y)$:

$$ \tilde{d}(y) = (-y)^2 - 4z^2(y^2 + y)(y + 1). $$

We have $y_1 = 0$, $y_4 = \infty = 1/y_1$, and

$$ y_2 = \frac{1 - 8z^2 - \sqrt{1 - 16z^2}}{8z^2}, \quad y_3 = \frac{1 - 8z^2 + \sqrt{1 - 16z^2}}{8z^2} = 1/y_2, $$

so that $y_1 < y_2 < y_3 < y_4$. Since there are four distinct branch points, the Riemann surface of $X(y)$, which has the same construction as the Riemann surface of the algebraic function

$$ \sqrt{\tilde{d}(y)} = \sqrt{-4z^2(y - y_1)(y - y_2)(y - y_3)}, \quad (9) $$

is a torus $\mathbf{T}^y$ (i.e., a Riemann surface of genus 1). We refer to [18, Section 4.9] for the construction of the Riemann surface of the square root of a polynomial, and to [23, Section 2] for this same construction in the context of models of walks in the quarter plane.

The analogous statement holds for the algebraic function $Y(x)$ defined by $K(x, Y(x)) = 0$. Its four branch points $x_i$, $i \in \{1, \dots, 4\}$, are the roots of

$$ d(x) = (zx^2 - x + z)^2 - 4z^2x^2. \quad (10) $$

They are all real, and numbered so that $x_1 < x_2 < x_3 < x_4$:

$$ x_1 = \frac{1 + 2z - \sqrt{1 + 4z}}{2z}, \quad x_2 = \frac{1 - 2z - \sqrt{1 - 4z}}{2z}, \quad x_3 = 1/x_2, \quad x_4 = 1/x_1. $$

The Riemann surface of $Y(x)$ is also a torus $\mathbf{T}^x$. Since $\mathbf{T}^x$ and $\mathbf{T}^y$ are conformally equivalent (there are two different views of the same surface), in the remainder of our work we shall consider a single Riemann surface $\mathbf{T}$ with two different coverings $x : \mathbf{T} \to \mathbf{C}_x$ and $y : \mathbf{T} \to \mathbf{C}_y$; see Figure 3.

**Connection with elliptic functions.** The torus $\mathbf{T}$, like any compact Riemann surface of genus 1, is isomorphic to a quotient space $\mathbf{C}/(\omega_1\mathbf{Z}+\omega_2\mathbf{Z})$, where $\omega_1, \omega_2$ are complex numbers linearly independent on $\mathbf{R}$, see [18]. This set can obviously be thought as the (fundamental) parallelogram $[0, \omega_1] + [0, \omega_2]$, whose opposed edges are identified (here, all parallelograms

<footnote n="4">⁴By definition, a branch point $y_i$ is a point $y \in \mathbf{C}$ such that the two roots $X(y)$ are equal.</footnote>
<figure><img src="image_4.png" /><figcaption>Figure 3. The GF $Q(x, 0)$ is defined on (a subdomain of) the complex plane $C_x$. It will be lifted on the Riemann surface $T$ as $s \mapsto Q(x(s), 0)$, and on the universal covering $C_\omega$ as $r_x(\omega) = K(x(\omega), 0)Q(x(\omega), 0)$. The same holds for $Q(0, y)$. We have also represented the projections between the different levels.</figcaption></figure>

will be rectangles). The periods $\omega_1, \omega_2$ are unique (up to a unimodular transform) and are found in [10, Lemma 3.3.2]$^5$:

$$ \omega_1 = i \int_{x_1}^{x_2} \frac{dx}{\sqrt{-d(x)}}, \qquad \omega_2 = \int_{x_2}^{x_3} \frac{dx}{\sqrt{d(x)}}. \qquad (11) $$

The expression of the periods above cannot be considerably simplified, but could be written in terms of elliptic integrals, see e.g. [23, Eqs. (7.20)–(7.25)].

The algebraic curve defined by the kernel $K(x, y)$ can be parametrized using the following uniformization formulæ, in terms of the Weierstrass elliptic function $\wp$ with periods $\omega_1, \omega_2$ (whose expansion is given in equation (53)):

$$ \left\{ \begin{aligned} x(\omega) &= x_4 + \frac{d'(x_4)}{\wp(\omega) - d''(x_4)/6}, \\ y(\omega) &= \frac{1}{2a(x(\omega))} \left( -b(x(\omega)) + \frac{d'(x_4)\wp'(\omega)}{2(\wp(\omega) - d''(x_4)/6)^2} \right). \end{aligned} \right. \qquad (12) $$

Here $a(x) = zx^2$ and $b(x) = zx^2 - x + z$ are the coefficients of $K(x, y) = a(x)y^2 + b(x)y + c(x)$, and $d(x)$ is defined in (10) as $d(x) = b(x)^2 - 4a(x)c(x)$. Due to (12), the functions $x(\omega), y(\omega)$ are elliptic functions on the whole $C$ with periods $\omega_1, \omega_2$. By construction

$$ K(x(\omega), y(\omega)) = 0, \quad \forall \omega \in C. \qquad (13) $$

We shall not prove equation (12) here (we refer to [10, Lemma 3.3.1] for details). Let us simply point out that it corresponds to the rewriting of $K(x, y) = 0$ as $(2a(x)y + b(x))^2 = d(x)$, then as $w^2 = z^2(x - x_1)(x - x_2)(x - x_3)(x - x_4)$, and finally as the classical identity involving elliptic functions $(\wp')^2 = 4\wp^3 - g_2\wp - g_3 = 4(\wp - e_1)(\wp - e_2)(\wp - e_3)$.

**Universal covering.** The universal covering of $T$ has the form $(C, \lambda)$, where $C$ is the complex plane that can be viewed as the union of infinitely many parallelograms

$$ \Pi_{m,n} = \omega_1[m, m+1) + \omega_2[n, n+1), \quad m, n \in \mathbb{Z}, $$

<footnote>$^5$Note a small misprint in Lemma 3.3.2 in [10], namely a (multiplicative) factor of 2 that should be 1; the same holds for (14).</footnote>
which are glued together and $\lambda: \mathbf{C} \to \mathbf{T}$ is a non-branching covering map (Figure 3). This is a standard fact on Riemann surfaces, see, e.g., [18, Section 4.19]. For any $\omega \in \mathbf{C}$ such that $\lambda\omega = s \in \mathbf{T}$, we have $x(\omega) = x(s)$ and $y(\omega) = y(s)$. The expression of $\lambda\omega$ is very simple: it equals the unique $s$ in the rectangle $[0, \omega_1) + [0, \omega_2)$ such that $\omega = s + m\omega_1 + n\omega_2$ with some $m, n \in \mathbf{Z}$.

Furthermore, since each parallelogram $\Pi_{m,n}$ represents a torus $\mathbf{T}$ composed of two complex spheres, the function $x(\omega)$ (resp. $y(\omega)$) takes each value of $\mathbf{C} \cup \{\infty\}$ twice within this parallelogram, except for the branch points $x_i, i \in \{1, \dots, 4\}$ (resp. $y_i, i \in \{1, \dots, 4\}$). The points $\omega_{x_i} \in \Pi_{0,0}$ such that $x(\omega_{x_i}) = x_i, i \in \{1, \dots, 4\}$, are represented in Figure 4. They are equal to

$$ \omega_{x_1} = \omega_2/2, \quad \omega_{x_2} = (\omega_1 + \omega_2)/2, \quad \omega_{x_3} = \omega_1/2, \quad \omega_{x_4} = 0. $$

The points $\omega_{y_i}$ such that $y(\omega_{y_i}) = y_i$ are just the shifts of $\omega_{x_i}$ by a real vector $\omega_3/2$ (to be defined below, in equation (14)): $\omega_{y_i} = \omega_{x_i} + \omega_3/2$ for $i \in \{1, \dots, 4\}$, see also Figure 4. We refer to [10, Chapter 3] and to [22, 34] for proofs of these facts. The vector $\omega_3$ is defined as in [10, Lemma 3.3.3]:

$$ \omega_3 = \int_{-\infty}^{x_1} \frac{dx}{\sqrt{d(x)}}. \qquad (14) $$

For Gessel's model we have the following relation [22, Proposition 14], which holds for all $z \in (0, 1/4)$:

$$ \omega_3/\omega_2 = 3/4. \qquad (15) $$

The identity above contains a lot of informations: it turns out that for any model of walks in the quarter plane, the quantity $\omega_3/\omega_2$ is a rational number (independent of $z$) if and only if a certain group (to be defined in the next section) is finite, see [10, Eq. (4.1.11)]. Equation (15) thus readily implies that Gessel's group is finite (of order 8). Although we shall not use this result here, let us also mention that if $\omega_3/\omega_2$ is rational, then the solution of the functional equation (3) (i.e., the generating function (2) of interest) is D-finite (with respect to $x$ and $y$), see [11, Theorem 2.1]. On the other hand, the relation (15) does not imply, a priori, that the generating function (2) is algebraic.

**Galois automorphisms and group of the walk.** It is easy to see that the birational transformations $\xi$ and $\eta$ of $\mathbf{C}^2$ defined by

$$ \xi(x, y) = \left(x, \frac{1}{x^2y}\right), \quad \eta(x, y) = \left(\frac{1}{xy}, y\right) \qquad (16) $$

leave invariant the quantity $\sum_{(i,j) \in \mathcal{B}} x^i y^j$ (and therefore also the set $\mathbf{T}$ in (5) for any fixed $z \in (0, 1/4)$). They span a group $\langle \xi, \eta \rangle$ of birational transformations of $\mathbf{C}^2$, which is a dihedral group, since

$$ \xi^2 = \eta^2 = \mathrm{id}. \qquad (17) $$

It is of order 8, see [7].

This group was first defined in a probabilistic context by Malyshev [26, 27, 28]; it was introduced for the combinatorics of walks with small steps in the quarter plane by Bousquet-Mélou [5, 6], and more systematically by Bousquet-Mélou and Mishna [7]. In (16), it is defined as a group on $\mathbf{C}^2 = \mathbf{C}_x \times \mathbf{C}_y$, i.e., at the bottom level of Figure 3. We now lift it
<figure><img src="image_5.png" /><figcaption>Figure 4. The fundamental parallelograms for the functions $r_x(\omega)$ and $r_y(\omega)$, namely, $\Pi_{0,0} = \omega_1[0, 1) + \omega_2[0, 1)$ (in grey) and $\Pi_{0,0} + \omega_3/2 = \omega_1[0, 1) + \omega_2[0, 1) + \omega_3/2$, and some important points and domains on them.</figcaption></figure>

to the upper levels of Figure 3, that is, to $\mathbf{T}_z$ and $\mathbf{C}_w$. Our final objective is to demonstrate the following result:

$$ \xi\omega = -\omega + \omega_1 + \omega_2, \quad \eta\omega = -\omega + \omega_1 + \omega_2 + \omega_3, \quad \forall \omega \in \mathbf{C}. \quad (18) $$

This equation illustrates the fact that the universal covering is a natural object: while the expressions of the elements of the group were rather complicated in (16), they are now just affine functions.

*Proof of Equation (18).* First, we lift the elements of the group to the intermediate level $\mathbf{T}$ as the restriction of $\langle\xi, \eta\rangle$ on $\mathbf{T}$. Namely, any point $s \in \mathbf{T}$ admits the two "coordinates" $(x(s), y(s))$, which satisfy $K(x(s), y(s)) = 0$ by construction. For any $s \in \mathbf{T}$, there exists a unique $s'$ (resp. $s''$) such that $x(s') = x(s)$ (resp. $y(s') = y(s)$). The values $x(s), x(s')$ (resp. $y(s), y(s'')$) are the two roots of the second degree equation $K(x, y(s)) = 0$ (resp. $K(x(s), y) = 0$) in $x$ (resp. $y$). The automorphism $\xi : \mathbf{T} \to \mathbf{T}$ (resp. $\eta : \mathbf{T} \to \mathbf{T}$) is defined by the identity $\xi s = s'$ (resp. $\eta s = s''$) and is called a Galois automorphism, following the terminology of [26, 27, 28, 10]. Clearly by (16) and (17), we have, for any $s \in \mathbf{T}$,

$$ x(\xi s) = x(s), \quad y(\xi s) = \frac{1}{x^2(s)y(s)}, \quad x(\eta s) = \frac{1}{y(s)x(s)}, \quad y(\eta s) = y(s), \quad \xi^2(s) = \eta^2(s) = s. $$

Finally $\xi s = s$ (resp. $\eta s = s$) if and only if $x(s) = x_i$, $i \in \{1, \dots, 4\}$ (resp. $y(s) = y_i$, for some $i \in \{1, \dots, 4\}$).

There are many ways to lift $\xi$ and $\eta$ from $\mathbf{T}$ to the universal covering $\mathbf{C}$. For any of them $\xi(\omega_{x_i}) = \omega_{x_i} + n\omega_1 + m\omega_2$, $\eta(\omega_{y_i}) = \omega_{y_i} + k\omega_1 + l\omega_2$ for some $n, m, k, l \in \mathbf{Z}$. There should also exist constants $p, q, r, s \in \mathbf{Z}$ such that $\xi^2 = \text{id} + p\omega_1 + q\omega_2$ and $\eta^2 = \text{id} + r\omega_1 + s\omega_2$.

We follow the way of [10] and [23], lifting them on $\mathbf{C}$ in such a way that $\omega_{x_2}$ and $\omega_{y_2}$ are their fixed points, respectively (see Figure 4). It follows immediately that $p, q, r, s = 0$. Since any automorphism of $\mathbf{C}_w$ has the form $\alpha\omega + \beta$ with $\alpha, \beta \in \mathbf{C}$, the relations $\xi^2 = \text{id}$
and $\xi(\omega_{x_2}) = \omega_{x_2}$ (resp. $\eta^2 = \text{id}$ and $\eta(\omega_{y_2}) = \omega_{y_2}$), lead to $\alpha = -1$ and $\beta = 2\omega_{x_2}$ (resp. $\alpha = -1$ and $\beta = 2\omega_{y_2}$). We obtain equation (18), recalling that $\omega_1 + \omega_2 = 2\omega_{x_2}$ and that $\omega_1 + \omega_2 + \omega_3 = 2\omega_{y_2}$. The proof of equation (18) is thus completed. $\square$

By construction the elements of the group satisfy

$$x(\xi\omega) = x(\omega), \quad y(\eta\omega) = y(\omega), \quad \forall \omega \in \mathbf{C}.$$

Finally, by (18)

$$\eta\xi\omega = \omega + \omega_3, \quad \xi\eta\omega = \omega - \omega_3, \quad \forall \omega \in \mathbf{C}. \qquad (19)$$

**Lifting of the GFs on the universal covering.** The functions $Q(x, 0)$ and $Q(0, y)$ can be lifted on their respective natural domains of definition on $\mathbf{T}$ and next on the corresponding domains of the universal covering $\mathbf{C}$, namely $\{\omega \in \mathbf{C} : |x(\omega)| < 1\}$ and $\{\omega \in \mathbf{C} : |y(\omega)| < 1\}$. This lifting procedure is illustrated in Figure 3. The first level (at the bottom) represents the complex planes $\mathbf{C}_x$ and $\mathbf{C}_y$, where $Q(x, 0)$ and $Q(0, y)$ are defined in $\{|x| < 1\}$ and $\{|y| < 1\}$. The second level, where the variables $x$ and $y$ are not independent anymore, is given by $\mathbf{T}$. The third level is $\mathbf{C}$, the universal covering of $\mathbf{T}$. All this construction has been first elaborated by Malyshev [26] for stationary probability GFs of random walks in $\mathbf{N}^2$, and has been further developed in [10] and in [23] in a combinatorial context.

The domains

$$\{\omega \in \mathbf{C} : |x(\omega)| < 1\}, \quad \{\omega \in \mathbf{C} : |y(\omega)| < 1\}$$

consist of infinitely many curvilinear strips, which differ from translations by multiples of $\omega_2$. We denote by $\Delta_x$ (resp. $\Delta_y$) the strip that is within $\bigcup_{m \in \mathbb{Z}} \Pi_{m,0}$ (resp. $\bigcup_{m \in \mathbb{Z}} \Pi_{m,0} + \omega_3/2$). The domain $\Delta_x$ (resp. $\Delta_y$) is delimited by vertical lines, see [22, Proposition 26], and is represented in Figure 4. We notice that the function $Q(x(\omega), 0)$ (resp. $Q(0, y(\omega))$) is well defined in $\Delta_x$ (resp. $\Delta_y$), by its expression (2) as a GF. Let us define

$$\left\{ \begin{array}{ll} r_x(\omega) = K(x(\omega), 0)Q(x(\omega), 0), & \forall \omega \in \Delta_x, \\ r_y(\omega) = K(0, y(\omega))Q(0, y(\omega)), & \forall \omega \in \Delta_y. \end{array} \right. \qquad (20)$$

The domain $\Delta_x \cap \Delta_y$ is a non-empty open strip, see Figure 4. It follows from (3) and (13) that

$$r_x(\omega) + r_y(\omega) - K(0, 0)Q(0, 0) - x(\omega)y(\omega) = 0, \quad \forall \omega \in \Delta_x \cap \Delta_y. \qquad (21)$$

**Meromorphic continuation of the GFs on the universal covering.** Let $\Delta = \Delta_x \cup \Delta_y$. Due to (21), the functions $r_x(\omega)$ and $r_y(\omega)$ can be continued as meromorphic functions on the whole domain $\Delta$, by setting

$$\begin{aligned} r_x(\omega) &= -r_y(\omega) + K(0, 0)Q(0, 0) + x(\omega)y(\omega), & \forall \omega \in \Delta_y, \\ r_y(\omega) &= -r_x(\omega) + K(0, 0)Q(0, 0) + x(\omega)y(\omega), & \forall \omega \in \Delta_x. \end{aligned} \qquad (22)$$

To continue the functions from $\Delta$ to the whole complex plane $\mathbf{C}$, we first notice that $\bigcup_{n \in \mathbb{Z}} (\Delta + n\omega_3) = \mathbf{C}$ (see (8)), as proved in [10, 23] and illustrated in Figure 4.

Let us define

$$\left\{ \begin{array}{ll} f_x(\omega) = y(\omega)[x(-\omega + \omega_1 + \omega_2 + \omega_3) - x(\omega)], & \forall \omega \in \Delta_y, \\ f_y(\omega) = x(\omega)[y(-\omega + \omega_1 + \omega_2) - y(\omega)]. & \forall \omega \in \Delta_x. \end{array} \right. \qquad (23)$$
**Lemma 1** ([23]). The functions $r_x(\omega)$ and $r_y(\omega)$ can be continued meromorphically to the whole of $\mathbf{C}$. Further, for any $\omega \in \mathbf{C}$, we have

$$r_x(\omega) + r_y(\omega) - K(0,0)Q(0,0) - x(\omega)y(\omega) = 0, \qquad (24)$$

$$r_x(\omega - \omega_3) = r_x(\omega) + f_x(\omega),$$

$$r_y(\omega + \omega_3) = r_y(\omega) + f_y(\omega), \qquad (25)$$

$$\left\{ \begin{array}{l} r_x(\xi\omega) = r_x(\omega), \\ r_y(\eta\omega) = r_y(\omega), \end{array} \right. \qquad (26)$$

$$\left\{ \begin{array}{l} r_x(\omega + \omega_1) = r_x(\omega), \\ r_y(\omega + \omega_1) = r_y(\omega). \end{array} \right. \qquad (27)$$

*Sketch of the proof.* We shall not prove Lemma 1 above in full details (for that we refer to the proof of [23, Theorem 4]). However, we give some intuitions on the above identities. First, (24) is simply the translation of the functional equation (3). Second, (26) comes from the fact that $x(\omega)$ (resp. $y(\omega)$) is invariant by $\xi$ (resp. $\eta$). Equation (27) follows from the $\omega_1$-periodicity of the functions $x(\omega)$ and $y(\omega)$. Let us give some more details for (25). Evaluate (24) at $\omega$ and $\xi\omega$, and make the subtraction of the two identities so obtained. We deduce that $r_y(\xi\omega) - r_y(\omega) = x(\omega)[y(\xi\omega) - y(\omega)]$. We conclude by (26), since $r_y(\xi\omega) = r_y(\eta\xi\omega) = r_y(\omega + \omega_3)$, where the last equality follows from (19). $\square$

### 3. Generating functions in terms of Weierstrass zeta functions

**Statements of results.** The aim of this section is to prove that the generating function for Gessel walks can be expressed in terms of the Weierstrass zeta function (Theorems 2 and 3 below). To formulate them, we need to recall some notation: let $\omega_1, \omega_2$ be the periods defined in (11), and let $\zeta_{1,3}$ be the Weierstrass zeta function with periods $\omega_1, 3\omega_2$, see Appendix A for its definition and some of its properties. We shall prove the following results:

**Theorem 2.** For any $z \in (0, 1/4)$ we have

$$Q(0, 0; z) = \frac{\zeta_{1,3}(\omega_2/4) - 3\zeta_{1,3}(2\omega_2/4) + 2\zeta_{1,3}(3\omega_2/4) + 3\zeta_{1,3}(4\omega_2/4) - 5\zeta_{1,3}(5\omega_2/4) + 2\zeta_{1,3}(6\omega_2/4)}{2z^2}. \qquad (28)$$

**Theorem 3.** We have, for all $\omega \in \mathbf{C}$,

$$r_y(\omega) = c + \frac{1}{2z}\zeta_{1,3}(\omega - (1/8)\omega_2) - \frac{1}{2z}\zeta_{1,3}(\omega - (3/8)\omega_2) \\ + \frac{1}{2z}\zeta_{1,3}(\omega - (1 + 3/8)\omega_2) - \frac{1}{2z}\zeta_{1,3}(\omega - (1 + 5/8)\omega_2) \\ - \frac{1}{2z}\zeta_{1,3}(\omega - (1 + 7/8)\omega_2) + \frac{1}{z}\zeta_{1,3}(\omega - (2 + 1/8)\omega_2) \\ - \frac{1}{z}\zeta_{1,3}(\omega - (2 + 5/8)\omega_2) + \frac{1}{2z}\zeta_{1,3}(\omega - (2 + 7/8)\omega_2), \qquad (29)$$

where c is a constant (depending only on z).

Note that the constant c in the statement of Theorem 3 can be made explicit. In fact, the point $\omega_0^y = 7\omega_2/8 \in \Delta_y$ is such that $y(\omega_0^y) = 0$ (see Lemma 5 below). Hence the value
of $r_y(7\omega_2/8) = K(0, y(7\omega_2/8))Q(0, y(7\omega_2/8))$ is equal to $K(0, 0)Q(0, 0) = zQ(0, 0)$ which is given by Theorem 2. Thus $c$ is equal to $zQ(0, 0) - \hat{\zeta}_{1,3}(7\omega_2/8)$, where $\hat{\zeta}_{1,3}(\omega)$ is the sum of the eight $\zeta$-functions in (29).

An expression similar to (29) holds for $r_x(\omega)$ (for a different constant $c$). There are two ways to obtain this expression: the first one consists in doing the same analysis as for $r_y$; the second one is to express $r_x$ from equation (24) in terms of $r_y$ and to apply Theorems 2 and 3. In terms of $\zeta$-functions, the results of both approaches are rigorously the same.

Theorems 2 and 3 are crucial for the remainder of the article. We shall explain in Section 4 how to deduce from Theorem 2 a proof of Gessel's conjecture (Problem (A)). Then, in Section 5, we deduce from Theorem 3 the algebraicity of $Q(0, y; z)$ and $Q(x, 0; z)$. Using the functional equation (3), we shall then obtain the algebraicity of the complete generating function $Q(x, y; z)$ (Problem (B)).

**Preliminary results.** The poles of the function $f_y$ defined in equation (23) will play a crucial role in our analysis. They are given in the lemma hereafter.

**Lemma 4.** In the fundamental parallelogram $\omega_1[0, 1) + \omega_2[0, 1)$, the function $f_y$ has poles at $\omega_2/8, 3\omega_2/8, 5\omega_2/8$ and $7\omega_2/8$. These poles are simple, with residues equal to $-1/(2z)$, $1/(2z)$, $1/(2z)$ and $-1/(2z)$, respectively.

Before proving Lemma 4, we recall from [22, Lemma 28] the following result, dealing with the zeros and poles of $x(\omega)$ and $y(\omega)$:

**Lemma 5 ([22]).** In the fundamental parallelogram $\omega_1[0, 1) + \omega_2[0, 1)$, the only poles of $x$ (of order one) are at $\omega_2/8, 7\omega_2/8$, and its only zeros (of order one) are at $3\omega_2/8, 5\omega_2/8$. The only pole of $y$ (of order two) is at $3\omega_2/8$, and its only zero (of order two) is at $7\omega_2/8$.

*Sketch of the proof of Lemma 5.* Expressions for $x(\omega)$ and $y(\omega)$ are written down in (12). To show that $x$ has a pole of order 1 at $\omega_2/8$ it is enough to prove that $\wp(\omega_2/8) = d''(x_4)/6$, see again (12). Such computations follow from the fact that both quantities are known in terms of the variable $z$. This is clear for the right-hand side. For $\wp(\omega_2/8)$ we can use $\wp(\omega_2/4) = (1 + 4z^2)/3$ (see the proof of Lemma 10) and then the bisection formula (P10). We do not pursue the computations in more details. We would proceed similarly for the other poles and zeros. $\square$

**Proof of Lemma 4.** Using the definition (23) of the function $f_y(\omega)$ and formulas (12), we derive that

$$f_y(\omega) = \frac{1}{2z} \frac{x'(\omega)}{x(\omega)}.$$

Indeed, we have

$$f_y(\omega) = x(\omega)[y(-\omega) - y(\omega)] = \frac{x(\omega)}{2a(x(\omega))} \left( - \frac{d'(x_4)\wp'(\omega)}{(\wp(\omega) - d''(x_4)/6)^2} \right) = \frac{1}{2z} \frac{x'(\omega)}{x(\omega)}.$$

Above, we have used the identities $y(-\omega + \omega_1 + \omega_2) = y(-\omega)$, $x(-\omega) = -x(\omega)$, $\wp'(-\omega) = -\wp'(\omega)$ and $a(x) = zx^2$.

Accordingly, if $x(\omega)$ has a simple zero (resp. a simple pole) at $\omega_0$, then $f_y(\omega)$ has a simple pole at $\omega_0$, with residue $1/(2z)$ (resp. $-1/(2z)$). Lemma 4 then follows from Lemma 5. $\square$

The following lemma will shorten the proof of Theorem 3.
**Lemma 6.** The function $r_y$ is elliptic with periods $\omega_1, 3\omega_2$.

*Proof.* The function $r_y$ is meromorphic and $\omega_1$-periodic due to (27). Further, by Lemma 1,
$$r_y(\omega + 4\omega_3) - r_y(\omega) = f_y(\omega) + f_y(\omega + \omega_3) + f_y(\omega + 2\omega_3) + f_y(\omega + 3\omega_3), \quad \forall \omega \in \mathbf{C}. \quad (30)$$

We start by showing that the elliptic function

$$\mathcal{O}(\omega) = \sum_{k=0}^{3} f_y(\omega + k\omega_3)$$

has no poles on $\mathbf{C}$. As $\mathcal{O}(\omega)$ is $(\omega_1, \omega_2)$-periodic, it suffices to verify this on the parallelogram $[0, \omega_1) + [0, \omega_2)$. Since $\mathcal{O}(\omega)$ is also $\omega_3$-periodic (this follows immediately from $4\omega_3 = 3\omega_2$ and the $\omega_2$-periodicity of $f_y(\omega)$), it is enough to check that the poles of $f_y(\omega)$ are not those of $\mathcal{O}(\omega)$. The function $f_y(\omega)$ has four poles in the main parallelogram, at $\omega_2/8, 3\omega_2/8, 5\omega_2/8$ and $7\omega_2/8$ (Lemma 4). Since $\mathcal{O}(\omega)$ is also $\omega_2 - \omega_3 = \omega_2/4$-periodic, it remains to check that $\omega_2/8$ is a removable singularity. This is an elementary verification using the residues of $f_y(\omega)$ at its poles, which are given in Lemma 4.

Hence, with property (P2) of Lemma 15, $\mathcal{O}(\omega)$ must be a constant $c$, so that with (30)
$$r_y(\omega+4\omega_3) = r_y(\omega)+c \text{ for all } \omega \in \mathbf{C}.$$ In particular, evaluating the previous equality at $\omega_{y2}$ and $\omega_{y2}-4\omega_3$ and summing the two identities so obtained gives $r_y(\omega_{y2}-4\omega_3)+2c = r_y(\omega_{y2}+4\omega_3)$.
But in view of (26), $r_y(\omega_{y2}-4\omega_3) = r_y(\omega_{y2}+4\omega_3)$, since $\eta\omega = -\omega+2\omega_{y2}$, and then $c = 0$.

It follows that $r_y(\omega)$ is also $4\omega_3 = 3\omega_2$-periodic, and thus elliptic with periods $\omega_1, 3\omega_2$. $\square$

**Remark 7.** Note that the fact that $\mathcal{O}(\omega)$ is identically zero also follows from [24, Proposition 10], which gives an easy necessary and sufficient condition for $\mathcal{O}(\omega)$ to be zero (equivalently, for $r_x$ and $r_y$ to be elliptic, or for the orbit sum of Bousquet-Mélou and Mishna to be zero): the poles of $x(\omega)$ and $y(\omega)$ in the fundamental parallelogram should not be poles of $\mathcal{O}(\omega)$. In the case of Gessel's walks, by Lemma 5, it is reduced to checking that the points $\omega_2/8, 3\omega_2/8$ and $7\omega_2/8$ are not poles of $\mathcal{O}(\omega)$. This is immediate by Lemma 4.

Finally, Lemma 6 is proved in [23, Proposition 11] as well, using the representation of $\mathcal{O}(\omega)$ as the so-called orbit-sum:

$$\begin{aligned}
\mathcal{O}(\omega) &= \sum_{1 \le k \le 4} (xy)(\omega + k\omega_3) - (xy)(\eta(\omega + k\omega_3)) \\
&= \sum_{1 \le k \le 4} (xy)((\eta\xi)^k\omega) - (xy)(\xi(\eta\xi)^{k-1}\omega) \\
&= \sum_{\theta \in (\xi, \eta]} (-1)^\theta xy(\theta(\omega)),
\end{aligned}$$

where $(-1)^\theta$ is the signature of $\theta$, i.e., $(-1)^\theta = (-1)^{\ell(\theta)}$, where $\ell(\theta)$ is the smallest $\ell$ for which we can write $\theta = \theta_1 \circ \dots \circ \theta_\ell$, with $\theta_1, \dots, \theta_\ell$ equal to $\xi$ or $\eta$.

**Proof of Theorems 2 and 3.** In order to prove Theorem 3, we could use [24, Theorem 6], which gives the poles and the principal parts at these poles of $r_y$ in terms of the function $f_y$, for any model of walks with small steps in the quarter plane (and rational $\omega_2/\omega_3$—which is the case here, see (15)). However, we prefer adopting a simpler and more direct approach, which is based on our key-equation (7). We shall then deduce Theorem 2 from Theorem 3.
*Proof of Theorem 3.* Since $r_y$ is elliptic with periods $\omega_1, 3\omega_2$ (Lemma 6), and since any elliptic function is characterized by its poles in a fundamental parallelogram, it suffices to find the poles of $r_y$ in $\omega_1[-1/2, 1/2) + \omega_2[1/8, 25/8)$. We shall consider the decomposition

$$ \begin{aligned} \frac{\omega_1}{2}[-1, 1) + \frac{\omega_2}{8}[1, 25) = & \left\{ \frac{\omega_1}{2}[-1, 1) + \frac{\omega_2}{8}[5, 9) \right\} \cup \left\{ \frac{\omega_1}{2}[-1, 1) + \frac{\omega_2}{8}[2, 5) \right\} \\ & \cup \left\{ \frac{\omega_1}{2}[-1, 1) + \frac{\omega_2}{8}[9, 15) \right\} \cup \left\{ \frac{\omega_1}{2}[-1, 1) + \frac{\omega_2}{8}[15, 21) \right\} \\ & \cup \left\{ \frac{\omega_1}{2}[-1, 1) + \frac{\omega_2}{8}[21, 25) \right\} \cup \left\{ \frac{\omega_1}{2}[-1, 1) + \frac{\omega_2}{8}[1, 2) \right\}, \end{aligned} \quad (31) $$

and we shall study successively the six domains in the right-hand side of (31).

The function $r_y$ cannot have poles in the first domain, since the latter is equal to $\Delta_y$ (Figure 4), where $r_y$ is defined through its GF, see (20). In the second domain, $r_y$ is defined thanks to $r_y(\omega) = -r_x(\omega) + K(0, 0)Q(0, 0) + x(\omega)y(\omega)$, see (22). The second domain being included in $\Delta_x$ (Figure 4), the function $r_x$ has no poles there, and the possible singularities of $r_y$ necessarily come from the term $x(\omega)y(\omega)$. Using Lemma 5, we find only one pole in that domain, namely at $3\omega_2/8$, of order 1. To compute its residue we notice that the function $x(\omega)y(\omega)$ has the same principal part as the function $-f_y(\omega)$ at $3\omega_2/8$ due to the expression (23): in fact, by Lemma 5, the point $3\omega_2/8$ is not a pole of $x(\omega)$ and the point $-3\omega_2/8 + \omega_1 + \omega_2$ is not a pole of $y(\omega)$. By Lemma 4 the point $3\omega_2/8$ is a simple pole of $-f_y$ with residue $-1/(2z)$, and hence of $x(\omega)y(\omega)$ as well. We record this information in Table 1 below.

<table><caption>Table 1. The points of the domain $\omega_1[-1/2, 1/2) + \omega_2[1/8, 25/8)$ where the function $r_y$ has poles and the residues at these poles</caption><tr><td>Point</td><td>ω<sub>2</sub>/8</td><td>3ω<sub>2</sub>/8</td><td>11ω<sub>2</sub>/8</td><td>13ω<sub>2</sub>/8</td><td>15ω<sub>2</sub>/8</td><td>17ω<sub>2</sub>/8</td><td>21ω<sub>2</sub>/8</td><td>23ω<sub>2</sub>/8</td></tr><tr><td>Residue</td><td>1/(2z)</td><td>-1/(2z)</td><td>1/(2z)</td><td>-1/(2z)</td><td>-1/(2z)</td><td>1/z</td><td>-1/z</td><td>1/(2z)</td></tr></table>

We now consider the third domain. We use the equation

$$ r_y(\omega + 6\omega_2/8) = r_y(\omega) + f_y(\omega), \quad (32) $$

see (25) together with (15). Since $r_y$ and $f_y$ both have a pole at $3\omega_2/8$ (see just above for $r_y$ and Lemma 4 for $f_y$), $r_y$ has a priori a pole at $9\omega_2/8$. The residue is the sum of residues of $r_y$ and $f_y$ at $3\omega_2/8$: $-1/(2z) + 1/(2z) = 0$, so that the singularity $9\omega_2/8$ is removable. The point $3\omega_2/8$ is the unique pole of $r_y$ on $\omega_1[-1/2, 1/2) + \omega_2[3/8, 9/8)$ by the previous analysis. It follows that, except for $9\omega_2/8$, the poles of $r_y$ on the third domain $\omega_1[-1/2, 1/2) + \omega_2[9/8, 15/8)$ necessarily arise by (32) from those of $f_y$ on $\omega_1[-1/2, 1/2) + \omega_2[3/8, 9/8)$, that is $5\omega_2/8$ and $7\omega_2/8$. Lemma 4 thus implies that $r_y$ has poles at $11\omega_2/8$ and $13\omega_2/8$, with respective residues $1/(2z)$ and $-1/(2z)$. These results are summarized in Table 1.

For the fourth and the fifth domains, we use exactly the same arguments, namely equation (32) and the knowledge of the poles in the previous domains. For the fourth domain $\omega_1[-1/2, 1/2) + \omega_2[15/8, 21/8)$, by (32), the poles of $r_y$ can arise from $9\omega_2/8$ where $f_y$ has a pole, and from $11\omega_2/8, 13\omega_2/8$ were both $r_y$ and $f_y$ have poles. Then the residue at $15\omega_2/8$ is $-1/(2z)$, the one at $17\omega_2/8$ is $1/(2z) + 1/(2z) = 1/z$, the residue at $19\omega_2/8$
is $-1/(2z) + 1/(2z) = 0$, so that $19\omega_2/8$ is a removable singularity. For the fifth domain $\omega_1[-1/2, 1/2) + \omega_2[21/8, 25/8)$, by (32), the poles may come from $15\omega_2/8$ and $17\omega_2/8$ where both $r_y$ and $f_y$ have poles. The residue at $21\omega_2/8$ is $-1/(2z) - 1/(2z) = -1/z$, the one at $23\omega_2/8$ is $1/z - 1/(2z) = 1/(2z)$.

As for the last domain, we can use equation (32) under the form $r_y(\omega) = r_y(\omega + 6\omega_2/8) - f_y(\omega)$. As already proven, $r_y$ has no poles at $[7\omega_2/8, \omega_2)$, hence, the only poles of $r_y$ in this domain are those of $-f_y$. By Lemma 4 this is $\omega_2/8$ with the residue $1/(2z)$.

The proof of Table 1 is complete.

To conclude the proof of Theorem 3 we use Property (P6) of Appendix A. This property allows to express $r_y$ as a sum of a constant $c$ and of eight $\zeta$-functions (eight because there are eight poles in Table 1), exactly as in equation (29). $\square$

*Proof of Theorem 2.* Equation (24) yields $r_x(\omega) = x(\omega)y(\omega) - r_y(\omega) + K(0,0)Q(0,0)$. We compute the constant $K(0,0)Q(0,0)$ as $r_y(\omega_0^y) = K(0, y(\omega_0^y))Q(0, y(\omega_0^y))$, where $\omega_0^y \in \Delta_y$ is such that $y(\omega_0^y) = 0$. Lemma 5 gives a unique possibility for $\omega_0^y$, namely, $\omega_0^y = 7\omega_2/8$. Hence $r_x(\omega) = x(\omega)y(\omega) - r_y(\omega) + r_y(7\omega_2/8)$. Let us substitute $\omega = 5\omega_2/8$ in this equation. The point $5\omega_2/8$ is a zero of $x(\omega)$ that lies in $\Delta_x$, so that

$$r_x(5\omega_2/8) = K(x(5\omega_2/8), 0)Q(x(5\omega_2/8), 0) = K(0, 0)Q(0, 0) = zQ(0, 0).$$

This point is not a pole of $y(\omega)$, in such a way that $x(5\omega_2/8)y(5\omega_2/8) = 0$. We obtain

$$zQ(0, 0) = r_y(7\omega_2/8) - r_y(5\omega_2/8). \qquad (33)$$

Note in particular that in order to obtain the expression (33) of $Q(0,0)$, there is no need to know the constant $c$ in Theorem 3.

With Theorem 3 and (33), $Q(0,0)$ can be written as a sum of 16 Weierstrass $\zeta_{1,3}$-functions (each of them being evaluated at a rational multiple of $\omega_2$). Using the fact that $\zeta_{1,3}$ is an odd function and using property (P8), we can perform many easy simplifications in (33), and, this way, we obtain (28). $\square$

We shall see in Section 5 how to deduce from Theorem 3 the expression of $Q(0, y; z)$ (and in fact, the expression of all its algebraic branches).

### 4. Proof of Gessel's conjecture (Problem (A))

In this section, we shall prove Gessel's formula (1) for the number of Gessel excursions. The starting point is Theorem 2, which expresses the generating function of Gessel excursions as a linear combination of (evaluations at multiples of $\omega_2/4$ of) the Weierstrass zeta function $\zeta_{1,3}$ with periods $\omega_1, 3\omega_2$. The individual terms of this linear combination are (possibly) transcendental functions; our strategy is to group them in a way that brings up a linear combination of algebraic hypergeometric functions, from which Gessel's conjecture follows by telescopic summation.

**Roadmap of the proof.** More precisely, Gessel's formula (1) is equivalent to$^6$

$$Q(0, 0; z) = \frac{1}{2z^2} \left( {}_2F_1\left(\left[-\frac{1}{2}, -\frac{1}{6}\right], \left[\frac{2}{3}\right], 16z^2\right) - 1 \right).$$

<footnote>$^6$This was already pointed out by Ira Gessel when he initially formulated the conjecture.</footnote>
Here, we use the notation ${}_2F_1([a, b], [c], z)$ for the Gaussian hypergeometric function

$$ {}_2F_1([a, b], [c], z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n z^n}{(c)_n n!}. \qquad (34) $$

In view of Theorem 2, Gessel's conjecture is therefore equivalent to

$$ L_1 - 3L_2 + 2L_3 + 3L_4 - 5L_5 + 2L_6 = G - 1, \qquad (35) $$

where $G = G(z)$ is the algebraic hypergeometric function ${}_2F_1([-1/2, -1/6], [2/3], 16z^2)$, and where $L_k$ denotes the function $\zeta_{1,3}(k\omega_2/4)$ for $1 \le k \le 6$.

Let us denote by $V_{i,j,k}$ the function $L_i + L_j - L_k$. Then, the left-hand side of equality (35) rewrites $4V_{1,4,5} - V_{2,4,6} - V_{1,5,6} - 2V_{1,2,3}$.

To prove (35), our key argument is encapsulated in the following identities:

$$ V_{1,4,5} = (2G + H)/3 - K/2, \qquad (36) $$

$$ V_{2,4,6} = (2G + H)/3 - K, \qquad (37) $$

$$ V_{1,5,6} = (J + 1)/2, \qquad (38) $$

$$ V_{1,2,3} = (2G + 2H - J - 2K + 1)/4. \qquad (39) $$

Here $H, J$ and $K$ are auxiliary algebraic functions, defined in the following way: $H$ is the hypergeometric function ${}_2F_1([-1/2, 1/6], [1/3], 16z^2)$, and $J$ stands for $(G - K)^2$, where $K$ is equal to $zG' = 4z^2 {}_2F_1([1/2, 5/6], [5/3], 16z^2)$.

Gessel's conjecture is a consequence of the equalities (36)–(39). Indeed, by summation, these equalities imply that $4V_{1,4,5} - V_{2,4,6} - V_{1,5,6} - 2V_{1,2,3}$ is equal to $G - 1$, proving (35).

It then remains to prove equalities (36)–(39). To do this, we use the following strategy. Instead of proving the equalities of functions of the variable $z$, we rather prove that their evaluations at $z = (x(x+1)^3/(4x+1)^3)^{1/2}$ are equal. This is sufficient, since the map $\varphi: x \mapsto (x(x+1)^3/(4x+1)^3)^{1/2}$ is a diffeomorphism between $(0, 1/2)$ onto $(0, 1/4)$. The choice of this algebraic transformation is inspired by the Darboux covering for tetrahedral hypergeometric equations of the Schwarz type $(1/3, 1/3, 2/3)$ [37, §6.1].

First, we make use of a corollary of the Frobenius-Stickelberger identity (P9) ([39, page 446]), which implies that $V_{i,j,k}$ is equal to the algebraic function $\sqrt{T_i + T_j + T_k}$ as soon as $k = i + j$. Here, $T_\ell$ denotes the algebraic function $\wp_{1,3}(\ell\omega_2/4)$. Second, using classical properties of the Weierstrass functions $\wp$ and $\zeta$, we explicitly determine $T_\ell(\varphi(x))$ for $1 \le \ell \le 6$, then use them to compute $V_{1,4,5}, V_{2,4,6}, V_{1,5,6}$ and $V_{1,2,3}$ evaluated at $z = \varphi(x)$. Finally, equalities (36)–(39) are proved by checking that they hold when evaluated at $z = \varphi(x)$.

**Preliminary results.** We shall deal with elliptic functions with different pairs of periods. We shall denote by $\zeta, \wp$ the elliptic functions with periods $\omega_1, \omega_2$, and by $\zeta_{1,3}, \wp_{1,3}$ the elliptic functions with periods $\omega_1, 3\omega_2$, see Appendix A for their definition and properties. Further, we recall that elliptic functions are alternatively characterized by their periods (see equation (53)) or by their invariants. The invariants of $\wp$ are denoted by $g_2, g_3$. They are such that

$$ \wp'(\omega)^2 = 4\wp(\omega)^3 - g_2\wp(\omega) - g_3, \quad \forall \omega \in \mathbf{C}. \qquad (40) $$

We recall from [22, Lemma 12] the following result that provides explicit expressions for the invariants $g_2, g_3$.
**Lemma 8 ([22]).** We have

$$g_2 = (4/3)(1 - 16z^2 + 16z^4), \quad g_3 = -(8/27)(1 - 8z^2)(1 - 16z^2 - 8z^4). \quad (41)$$

Likewise, we define the invariants $g_2^{1,3}$, $g_3^{1,3}$ of $\wp_{1,3}$. To compute them, it is convenient to first introduce an algebraic function denoted $R$, which is the unique positive root of

$$X^4 - 2g_2X^2 + 8g_3X - \frac{g_2^2}{3} = 0. \quad (42)$$

To prove that (42) has a unique positive root, we need to introduce the discriminant of the fourth-degree polynomial $P(X)$ defined by (42). Since $\deg P(X) = 4$ and since the leading coefficient of $P(X)$ is 1, its discriminant equals the resultant of $P(X)$ and $P'(X)$. Some elementary computations give that it equals $cz^{16}(1 - 16z^2)^2$, where $c$ is a negative constant. The discriminant is thus negative (for any $z \in (0, 1/4)$). On the other hand, the discriminant can be interpreted as $\prod_{1 \le i < j \le 4} (R_i - R_j)^2$, where the $R_i$, $i \in \{1, \dots, 4\}$, are the roots of $P(X)$. The negative sign of the discriminant implies that $P(X)$ has two complex conjugate roots and two real roots. Further, the product of the roots is clearly negative, see (42), so that one of the two real roots is negative while another one is positive.

Using equations (41) and (42), we obtain the local expansion $R(z) = 2 - 16z^2 - 48z^4 + O(z^6)$ in the neighborhood of 0.

The algebraic function $R$ will play an important role in determining the algebraic functions $T_\ell = \wp_{1,3}(\ell\omega_2/4)$. To begin with, the next lemma expresses $T_4$, as well as the invariants $g_2^{1,3}$, $g_3^{1,3}$, in terms of $R$.

**Lemma 9.** One has

$$\begin{aligned} T_4 &= \wp_{1,3}(\omega_2) = R/6, \\ g_2^{1,3} &= -g_2/9 + 10R^2/27, \\ g_3^{1,3} &= -35R^3/729 + 7g_2R/243 - g_3/27, \end{aligned}$$

where expressions for $g_2$ and $g_3$ are given in (41).

*Proof.* Using the properties (P4) and (P7) from Lemma 15, one can write,

$$\wp(\omega) = -4\wp_{1,3}(\omega_2) - \wp_{1,3}(\omega) + \frac{\wp'_{1,3}(\omega)^2 + \wp'_{1,3}(\omega_2)^2}{2(\wp_{1,3}(\omega) - \wp_{1,3}(\omega_2))^2}, \quad \forall \omega \in \mathbf{C}. \quad (43)$$

We then make a local expansion at the origin of the both sides of the equation above, using property (P3) from Lemma 15. We obtain

$$\frac{1}{\omega^2} + \frac{g_2}{20}\omega^2 + \frac{g_3}{28}\omega^4 + O(\omega^6) = \frac{1}{\omega^2} + \left(6\wp_{1,3}(\omega_2)^2 - \frac{9g_2^{1,3}}{20}\right)\omega^2 + \left(10\wp_{1,3}(\omega_2)^3 - \frac{3g_2^{1,3}\wp_{1,3}(\omega_2)}{2} - \frac{27g_3^{1,3}}{28}\right)\omega^4 + O(\omega^6).$$

Identifying the expansions above, we obtain two equations for the three unknowns $\wp_{1,3}(\omega_2)$, $g_2^{1,3}$ and $g_3^{1,3}$ (remember that its invariants $g_2$ and $g_3$ are known from Lemma 8). We add a third equation by noticing that $\wp_{1,3}(\omega_2)$ is the only real positive solution to (see, e.g., [22, Proof of Lemma 22])

$$X^4 - \frac{g_2^{1,3}}{2}X^2 - g_3^{1,3}X - \frac{(g_2^{1,3})^2}{48} = 0.$$
We then have a (non-linear) system of three equations with three unknowns. A few easy computations finally lead to the expressions of $\wp_{1,3}(\omega_2)$, $g_2^{1,3}$ and $g_3^{1,3}$ of Lemma 9. $\square$

The next result expresses the algebraic functions $T_1, T_2, T_3, T_5$ and $T_6$ in terms of the algebraic function $R$, and of the invariants $g_2$ and $g_3$ (the quantity $T_4$ has already been found in Lemma 9).

**Lemma 10.** One has the following formulæ:

(i) $T_1 = \wp_{1,3}(\omega_2/4)$ is the unique solution of

$$X^3 - \left(\frac{R}{3} + \frac{1+4z^2}{3}\right) X^2 + \left(\frac{R(1+4z^2)}{9} + \frac{R^2}{108} + \frac{g_2}{18}\right) X + \left(\frac{23R^3}{2916} - \frac{R^2(1+4z^2)}{108} + \frac{g_3}{27} - \frac{19Rg_2}{972}\right) = 0 \quad (44)$$

such that in the neighborhood of 0, $T_1 = 1/3 + 4z^2/3 - 4z^6 - 56z^8 + O(z^{10})$.

(ii) $T_2 = \wp_{1,3}(2\omega_2/4)$ is equal to

$$T_2 = \frac{R + 1 - 8z^2}{6} - \frac{T_6}{2}. \quad (45)$$

(iii) $T_3 = \wp_{1,3}(3\omega_2/4)$ is the unique solution of (44) such that in the neighborhood of 0, $T_3 = 1/3 - 8z^2/3 - 8z^4 - 60z^6 + O(z^8)$.

(iv) $T_5 = \wp_{1,3}(5\omega_2/4)$ is the unique solution of (44) such that in the neighborhood of 0, $T_5 = 1/3 - 8z^2/3 - 8z^4 - 64z^6 + O(z^8)$.

(v) $T_6 = \wp_{1,3}(6\omega_2/4)$ is equal to

$$T_6 = \frac{R + 1 - 8z^2 - \sqrt{3R^2 - 4R(1 - 8z^2) + 4(1 - 8z^2)^2 - 6g_2}}{9}. \quad (46)$$

*Proof.* We first prove that for a given value of $\omega$ (and thus for a given value of $\wp(\omega)$), the three solutions of

$$X^3 - \left(\frac{R}{3} + \wp(\omega)\right) X^2 + \left(\frac{R\wp(\omega)}{3} + \frac{R^2}{108} + \frac{g_2}{18}\right) X + \left(\frac{23R^3}{2916} - \frac{\wp(\omega)R^2}{36} + \frac{g_3}{27} - \frac{19Rg_2}{972}\right) = 0 \quad (47)$$

are

$$\{\wp_{1,3}(\omega), \wp_{1,3}(\omega + \omega_2), \wp_{1,3}(\omega + 2\omega_2)\}.$$

By property (P7) we find

$$\wp(\omega) = -4\wp_{1,3}(\omega_2) - \wp_{1,3}(\omega) + \frac{\wp'_{1,3}(\omega)^2 + \wp'_{1,3}(\omega_2)^2}{2(\wp_{1,3}(\omega) - \wp_{1,3}(\omega_2))^2}, \quad \forall \omega \in \mathbf{C},$$

where by Lemma 9, one has $\wp_{1,3}(\omega_2) = R/6$. Then $\wp'_{1,3}(\omega_2)^2 = 4(R/6)^3 - g_2^{1,3}R/6 - g_3^{1,3}$, and following this way, we obtain that $\wp_{1,3}(\omega)$ satisfies (47).

We start the proof of the lemma by showing (i). Using [22, Lemma 19] one has that $\wp(\omega_2/4) = \wp(3\omega_2/4) = (1+4z^2)/3$. Then the equation (44) is exactly (47) with $\omega = \omega_2/4$. The three roots of (44) are $\wp_{1,3}(\omega_2/4)$, $\wp_{1,3}(5\omega_2/4)$ and $\wp_{1,3}(9\omega_2/4) = \wp_{1,3}(3\omega_2/4)$. By using standard properties of the Weierstrass function $\wp$, we see that $\wp_{1,3}(\omega_2/4)$ is the largest of the three quantities (and this for any $z \in (0, 1/4)$). Further, since (47) is a polynomial of
degree 3, we can easily find its roots in terms of the variable z. This way, we find that the three solutions admit the expansions

$$ 
\begin{aligned}
& 1/3 + 4z^2/3 - 4z^4 - 56z^6 + O(z^8), \\
& 1/3 - 8z^2/3 - 8z^4 - 60z^6 + O(z^8), \\
& 1/3 - 8z^2/3 - 8z^4 - 64z^6 + O(z^8).
\end{aligned}
$$

Accordingly, $T_1 = \wp_{1,3}(\omega_2/4)$ corresponds to the first one, $T_3 = \wp_{1,3}(3\omega_2/4)$ to the second one and $T_5 = \wp_{1,3}(5\omega_2/4)$ to the last one.

We now prove (ii) and (v). Using again [22, Lemma 19], one derives that $\wp(2\omega_2/4) = (1-8z^2)/3$. The three roots of equation (47) with $\omega = 2\omega_2/4$ are $\wp_{1,3}(2\omega_2/4)$, $\wp_{1,3}(6\omega_2/4)$ and $\wp_{1,3}(10\omega_2/4)$. Since $\wp_{1,3}(10\omega_2/4) = \wp_{1,3}(2\omega_2/4)$, (47) with $\omega = 2\omega_2/4$ has a double root (that we call $t_1$) and a simple root ($t_2$). It happens to be simpler to deal now with the derivative of the polynomial in the left-hand side of (47). It is an easy exercise to show that the roots of the derivative of a polynomial of degree 3 with a double root at $t_1$ and a simple root at $t_2$ are $t_1$ and $(t_1 + 2t_2)/3$. This way, we obtain expressions for $\wp_{1,3}(2\omega_2/4)$ and $(\wp_{1,3}(2\omega_2/4) + 2\wp_{1,3}(6\omega_2/4))/3$, which are equal to

$$ \frac{R + 1 - 8z^2 \pm \sqrt{3R^2 - 4R(1 - 8z^2) + 4(1 - 8z^2)^2 - 6g_2}}{9}. \quad (48) $$

Since $\wp_{1,3}(2\omega_2/4) > \wp_{1,3}(6\omega_2/4)$, the root $\wp_{1,3}(2\omega_2/4)$ corresponds to the sign + in (48). This way we immediately find expressions for $\wp_{1,3}(2\omega_2/4)$ and $\wp_{1,3}(6\omega_2/4)$, and this finishes the proof of the lemma. $\square$

Let $\varphi : (0, 1/2) \to (0, 1/4)$ be the diffeomorphism defined by $\varphi(x) = \sqrt{x(x+1)^3/(4x+1)^3}$. The next result derives explicit expressions of $T_\ell(z)$ when evaluated at $z = \varphi(x)$.

**Lemma 11.** *Define*

$$ M(x) = \frac{4x^4 + 28x^3 + 30x^2 + 10x + 1}{3(4x + 1)^3} \quad \text{and} \quad N(x) = \frac{2x(x+1)(2x+1)}{(4x+1)^{5/2}}. $$

*For any $x \in (0, 1/2)$, the following formulae hold:*

$$ 
\begin{aligned}
T_1(\varphi(x)) &= M(x) + N(x), \\
T_2(\varphi(x)) &= M(x) - \frac{2x(x+1)(2x+1)}{(4x+1)^3}, \\
T_3(\varphi(x)) &= M(x) - \frac{2x(x+1)}{(4x+1)^2}, \\
T_4(\varphi(x)) &= M(x) - \frac{2x(2x+1)(3x+1)}{(4x+1)^3}, \\
T_5(\varphi(x)) &= M(x) - N(x), \\
T_6(\varphi(x)) &= \left(\frac{2x+1}{4x+1}\right)^2 - 2M(x).
\end{aligned}
$$

*Proof.* All equalities are consequences of Lemma 10. We begin with $R$: we replace $z$ by $\varphi(x)$ in equation (42), factor the result, and identify the corresponding minimal polynomial
of $R(\varphi(x))$ in $Q(x)[T]$. To do this, we use that the local expansion of $R(\varphi(x))$ at $x = 0$ is equal to $2 - 16x + O(x^2)$. The minimal polynomial has degree 1, proving the equality

$$R(\varphi(x)) = \frac{2(2x^2 - 2x - 1)^2}{(4x + 1)^3}.$$

From $R$, we directly deduce $T_4 = R/6$. Now, replacing $z$ by $\varphi(x)$ in Lemma 10 (v) provides the expression of $T_6(\varphi(x))$. Then $T_2$ is treated in a similar way using Lemma 10 (ii). Finally, an annihilating polynomial for $T_1(\varphi(x))$, $T_3(\varphi(x))$, $T_5(\varphi(x))$ is deduced in a similar manner using Lemma 10 (i). This polynomial in $Q(x)[T]$ factors as a product of a linear factor and a quadratic factor. Using the local expansions $1/3 + 4/3x - 12x^2 + 80x^3 + O(x^4)$, $1/3 - 8/3x + 16x^2 - 84x^3 + O(x^4)$ and $1/3 - 8/3x + 16x^2 - 88x^3 + O(x^4)$ allows to conclude. $\square$

The following Corollary is a direct consequence of the previous lemma and of the Frobenius-Stickelberger identity (P9).

**Corollary 12.** The algebraic functions $V_{1,4,5}$, $V_{2,4,6}$, $V_{1,5,6}$ and $V_{1,2,3}$ defined in (36)–(39) satisfy the following equalities for any $x \in (0, 1/2)$:

$$\begin{align*}
V_{1,4,5}(\varphi(x)) &= \frac{2x^2 + 4x + 1}{(4x + 1)^{3/2}}, \\
V_{2,4,6}(\varphi(x)) &= \frac{2x + 1}{(4x + 1)^{3/2}}, \\
V_{1,5,6}(\varphi(x)) &= \frac{2x + 1}{4x + 1}, \\
V_{1,2,3}(\varphi(x)) &= \frac{x}{4x + 1} + \frac{(x + 1)(2x + 1)}{(4x + 1)^{3/2}}.
\end{align*}$$

**Completing the proof of Gessel's conjecture.** The last step consists in proving the four equalities (36)–(39). The starting point is that the hypergeometric power series $G = {}_2F_1([-1/2, -1/6], [2/3], 16z^2)$, $H = {}_2F_1([-1/2, 1/6], [1/3], 16z^2)$, $K = z \cdot G'$ and $J = (G - K)^2$ are algebraic and satisfy the equations displayed in the following lemma.

**Lemma 13.** For any $x \in (0, 1/2)$, one has the following formulae:

$$\begin{align*}
G(\varphi(x)) &= \frac{4x^2 + 8x + 1}{(4x + 1)^{3/2}}, \\
H(\varphi(x)) &= \frac{4x^2 + 2x + 1}{(4x + 1)^{3/2}}, \\
K(\varphi(x)) &= \frac{4x(x + 1)}{(4x + 1)^{3/2}}, \\
J(\varphi(x)) &= \frac{1}{4x + 1}.
\end{align*}$$

*Proof.* The first two equalities are consequences of identities (46)–(49) in [37, Section 6.1]. Let us prove the first equality. We start with the contiguity relation [1, Eq. 15.2.15]

${}_2F_1([-1/2, -1/6], [2/3], z) = 2 \cdot {}_2F_1([1/2, -1/6], [2/3], z) + (z-1) \cdot {}_2F_1([1/2, 5/6], [2/3], z)$, that we evaluate at $z = \psi(x) = 16\varphi(x)^2$. It follows that

$$G(\varphi(x)) = 2 \cdot {}_2F_1([1/2, -1/6], [2/3], \psi(x)) + (\psi(x) - 1) \cdot {}_2F_1([1/2, 5/6], [2/3], \psi(x)).$$
Identities (46)–(47) in [37, Section 6.1] write

$$ {}_2F_1([1/2, -1/6], [2/3], \psi(x)) = (1 + 4x)^{-1/2}, \quad \text{and} $$

$$ {}_2F_1([1/2, 5/6], [2/3], \psi(x)) = (1 + 4x)^{3/2} / (1 - 2x)^2. $$

Therefore, $G(\varphi(x))$ is equal to

$$ G(\varphi(x)) = 2 \cdot (1 + 4x)^{-1/2} + (\psi(x) - 1) \cdot \frac{(1 + 4x)^{3/2}}{(1 - 2x)^2} = \frac{4x^2 + 8x + 1}{(1 + 4x)^{3/2}}. $$

To prove the second equality, we start from Euler's formula [1, Eq. 15.3.3]

$$ {}_2F_1([-1/2, 1/6], [1/3], z) = (1 - z)^{2/3} \cdot {}_2F_1([5/6, 1/6], [1/3], z) $$

and from the contiguity relation [1, Eq. 15.2.25]

$$ {}_2F_1([5/6, 1/6], [1/3], z) = \frac{z}{2z-2} {}_2F_1([5/6, 1/6], [4/3], z) + \frac{1}{1-z} {}_2F_1([-1/6, 1/6], [1/3], z). $$

Putting them together, evaluating the result at $z = \psi(x)$ and using identities (48)–(49) in [37, Section 6.1] shows that $H(\varphi(x))$ is equal to

$$ (1 - \psi(x))^{2/3} \cdot \left( \frac{\psi(x)}{2\psi(x) - 2} \cdot \frac{(1 + 4x)^{1/2}(1 + 2x)^{1/3}}{1 + x} + \frac{1}{1 - \psi(x)} \cdot \frac{(1 + 2x)^{1/3}}{(1 + 4x)^{1/2}} \right), $$

which further simplifies to $(4x^2 + 2x + 1)/(4x + 1)^{3/2}$ for $x \in (0, 1/2)$.

The last two equalities are easy consequences of the first two. $\square$

Now, equalities (36)–(39) evaluated at $z = \varphi(x) = (x(x+1)^3/(4x+1)^3)^{1/2}$ are easily proven using Lemmas 12 and 13. For instance, equality (36) evaluated at $z = \varphi(x)$ reads:

$$ \frac{2x^2 + 4x + 1}{(4x + 1)^{3/2}} = \frac{2}{3} \frac{4x^2 + 8x + 1}{(4x + 1)^{3/2}} + \frac{1}{3} \frac{4x^2 + 2x + 1}{(4x + 1)^{3/2}} - \frac{1}{2} \frac{4x(x + 1)}{(4x + 1)^{3/2}}. $$

Similarly, equality (39) evaluated at $z = \varphi(x)$ reads:

$$ \frac{x}{4x + 1} + \frac{(x + 1)(2x + 1)}{(4x + 1)^{3/2}} = \frac{1}{2} \frac{4x^2 + 8x + 1}{(4x + 1)^{3/2}} + \frac{1}{2} \frac{4x^2 + 2x + 1}{(4x + 1)^{3/2}} - \frac{1}{4} \frac{1}{4x + 1} - \frac{1}{2} \frac{4x(x + 1)}{(4x + 1)^{3/2}} + \frac{1}{4}. $$

The proof of Gessel's formula (1) for the number of Gessel excursions is thus completed. Note that incidentally we have proved that the generating series $Q(0, 0; z)$ for Gessel excursions is *algebraic*. The next section is devoted to the proof that the complete generating series of Gessel walks is also algebraic.

## 5. Proof of the algebraicity of the GF (Problem (B))

**Branches of the GFs and algebraicity of $Q(x, y)$ in the variables $x, y$.** In this section we prove a weakened version of Problem (B): we show that $Q(x, y)$ is algebraic in $x, y$ (we shall prove in the next section that the latter function is algebraic in $x, y, z$, which is much stronger). This is not necessary for our analysis, but this illustrates that our approach easily yields algebraicity results.

We first propose two proofs of the algebraicity of $Q(0, y)$ as a function of $y$. The first proof is an immediate application of property (P5). The sum of the residues (i.e., the multiplicative factors in front of the $\zeta$-functions) in the formula (29) of Theorem 3 is clearly 0, so that $r_y(\omega)$ is an algebraic function of $\wp_{1,3}(\omega)$, by (P5). Further, by (P7), $\wp_{1,3}(\omega)$ is an algebraic
function of $\wp(\omega)$, and finally by (12), $\wp(\omega)$ is algebraic in $y(\omega)$. This eventually implies that $r_y(\omega)$ is algebraic in $y(\omega)$, or equivalently that $Q(0, y)$ is algebraic in $y$, see (20).

The second proof is based on the meromorphic continuation of the GFs on the universal covering, which was recalled in Section 2. The restrictions of $r_y(\omega)/K(0, y(\omega))$ to the half parallelogram

$$D_{k,l} = \omega_3/2 + \omega_1[\ell, \ell+1) + \omega_2(k/2, (k+1)/2]$$

for $k, \ell \in \mathbb{Z}$ provide all branches of $Q(0, y)$ on $C \setminus ([y_1, y_2] \cup [y_3, y_4])$ as follows:

$$Q(0, y) = \{r_y(\omega)/K(0, y(\omega)) : \omega \text{ is the (unique) element of } D_{k,l} \text{ such that } y(\omega) = y\},$$

see [23, Section 5.2] for more details. Due to the $\omega_1$-periodicity of $r_y(\omega)$ and $y(\omega)$ (see (27) and (12), respectively), the restrictions of these functions on $D_{k,0}$ do not depend on $\ell \in \mathbb{Z}$, and therefore determine the same branch as on $D_{k,0}$ for any $\ell$. Furthermore, due to equation (26), the restrictions of $r_y(\omega)/K(0, y(\omega))$ on $D_{-k+1,0}$ and on $D_{k,0}$ lead to the same branches for any $k \in \mathbb{Z}$. Hence, the restrictions of $r_y(\omega)/K(0, y(\omega))$ on $D_{k,0}$ with $k \ge 1$ provide all different branches of this function. In addition, Lemma 6 says that $r_y$ is $3\omega_2$-periodic. This fact yields that $Q(0, y)$ has (at most) six branches, and is thus algebraic.

An analogous statement holds for (the restrictions of) the function $r_x(\omega)/K(x(\omega), 0)$ and then for $Q(x, 0)$. Using the functional equation (3), we conclude that $Q(x, y)$ is algebraic in the two variables $x, y$.

In the next section, we refine the previous statement, and prove that $Q(x, y)$ is algebraic in $x, y, z$ (Problem (B)).

**Proof of the algebraicity of the complete GF.** We start by proving the algebraicity of $Q(0, y)$ as a function of $y, z$. We consider the representation of $r_y(\omega)$ given in Theorem 3 and apply eight times the addition theorem (P4) for $\zeta$-functions, namely

$$\zeta_{1,3}(\omega - k\omega_2/8) = \zeta_{1,3}(\omega) - \zeta_{1,3}(k\omega_2/8) + \frac{1}{2} \frac{\wp'_{1,3}(\omega) + \wp'_{1,3}(k\omega_2/8)}{\wp_{1,3}(\omega) - \wp_{1,3}(k\omega_2/8)},$$

for suitable values of $k \in \mathbb{Z}$ that can be deduced from (29):

$$k \in \{1, 3, 11, 13, 15, 17, 21, 23\}. \qquad (49)$$

We then make the weighted sum of the eight identities above (corresponding to the appropriate values of $k$ in (29)); this way, we obtain

$$r_y(\omega) = U_1(\omega) + U_2 + U_3(\omega),$$

where $U_1(\omega)$ is the weighted sum of the eight functions $\zeta_{1,3}(\omega)$, $U_2$ is the sum of $c$ and of the weighted sum of the eight quantities $-\zeta_{1,3}(k\omega_2/8)$, and $U_3(\omega)$ is the weighted sum of the eight quantities

$$\frac{1}{2} \frac{\wp'_{1,3}(\omega) + \wp'_{1,3}(k\omega_2/8)}{\wp_{1,3}(\omega) - \wp_{1,3}(k\omega_2/8)}, \qquad (50)$$

Since the sum of the residues in the formula (29) equals 0, the coefficient in front of $\zeta_{1,3}(\omega)$ is 0, so that $U_1(\omega)$ is identically zero. To prove that $U_2$ is algebraic in $z$, it suffices to use similar arguments as we did to prove that $Q(0, 0)$ is algebraic (we group together different $\zeta$-functions and we use standard identities as the Frobenius-Stickelberger equality (P9) or the addition formula for the $\zeta$-function (P4), see Section 4); we do not repeat the arguments here. Finally, we show that $U_3(\omega)$ is algebraic in $y(\omega)$ over the field of algebraic
functions in z. In other words, we show that there exists a non-zero bivariate polynomial P such that

$$P(U_3(\omega), y(\omega)) = 0,$$

where the coefficients of P are algebraic functions in z. This is enough to conclude the algebraicity of $Q(0, y)$ as a function of y and z.

To prove the latter fact, we shall prove that each term (50) for k as in (49) satisfies the property above (with different polynomials P, of course). First, Lemma 14 below implies that $\wp_{1,3}(k\omega_2/8)$ and $\wp'_{1,3}(k\omega_2/8)$ are both algebraic in z. Further, it follows from (P7) that the function $\wp_{1,3}(\omega)$ is algebraic in $\wp(\omega)$ over the field of algebraic functions in z. It is thus also algebraic (over the field of algebraic functions in z) in $y(\omega)$, thanks to (12). The same property holds for $\wp'_{1,3}(\omega)$: this comes from the differential equation (40) satisfied by the Weierstrass elliptic functions.

The proof of the algebraicity of $Q(x, 0)$ as a function of x and z is analogous. With equation (3) the algebraicity of $Q(x, y)$ as a function of x, y, z is proved. □

To conclude this section it remains to prove the following lemma.

**Lemma 14.** For any $k \in \mathbb{Z}$ and any $\ell \in \mathbb{N}$, $\wp^{(\ell)}(k\omega_2/8)$ and $\wp^{(\ell)}_{1,3}(k\omega_2/8)$ are (infinite or) algebraic functions of z.

*Proof.* First, for any $\ell \in \mathbb{N}$ and $k \in 8\mathbb{Z}$ (resp. $k \in 24\mathbb{Z}$), $\wp^{(\ell)}(k\omega_2/8)$ (resp. $\wp^{(\ell)}_{1,3}(k\omega_2/8)$) is infinite. For other values of k, they are finite. By periodicity and parity, it is enough to prove the algebraicity for $k \in \{1, \dots, 4\}$ (resp. $k \in \{1, \dots, 12\}$).

It is important to notice that it suffices to prove the result for $\ell = 0$. Indeed, all the invariants $g_2$, $g_3$, $g_{2,3}$ and $g_{3,3}$ are algebraic functions of z (see Lemmas 8 and 9), so that using inductively the differential equation (40), we obtain the algebraicity for values of $\ell \ge 1$ from the algebraicity for $\ell = 0$.

We first consider $\wp = \wp^{(0)}$. It is demonstrated in [22, Lemma 19] that $\wp(k\omega_2/8)$ is algebraic for $k = 2$ and $k = 4$. For $k = 1$ this follows from the bisection formula (P10) and from the case $k = 2$ (note that $\wp(\omega_1/2)$, $\wp(\omega_2/2)$ and $\wp((\omega_1 + \omega_2)/2)$ are algebraic in z, see [22, Lemma 12]). For $k = 3$, this is a consequence of the addition formula (P4).

We now deal with $\wp_{1,3}$. Let $k \in \{1, \dots, 12\}$. Using (43), we easily derive that $\wp_{1,3}(\omega_0)$ is algebraic in z as soon as $\wp(\omega_0)$ is algebraic in z: indeed, in (43) the functions $\wp_{1,3}(\omega_2)$ and $\wp'_{1,3}(\omega_2)$ are algebraic in z, as a consequence of Lemma 9. This remark applies to all $\omega_0 = k\omega_2/8$, except for $k = 8$, since then $\wp(k\omega_2/8) = \infty$. In fact, for $k = 8$ the situation is also simple, as $\wp_{1,3}(k\omega_2/8) = R/6$ (see Lemma 9) is already known to be algebraic. □

## 6. Conclusion

**Application of our results to other end points.** In this article we have presented the first human proofs of Gessel conjecture (Problem (A)) and of the algebraicity of the complete GF counting Gessel walks (Problem (B)). We have deduced the closed-form expression (1) of the numbers of walks $q(0, 0; n)$ from a new algebraic expression of the GF $\sum_{n \ge 0} q(0, 0; n)z^n$.

With a very similar analysis, we could obtain an expression for the series $\sum_{n \ge 0} q(i, j; n)z^n$, for any fixed couple $(i, j) \in \mathbb{N}^2$. Let us illustrate this fact with the example $(i, j) = (0, j)$,
$j \ge 0$. Let

$$g_j(z) = \sum_{n \ge 0} q(0, j; 2n) z^{2n}$$

be the function counting walks ending at the point $(0, j)$ of the vertical axis. We obviously have

$$Q(0, y) = \sum_{j \ge 0} y^j g_j(z).$$

In particular, up to a constant factor $j!$, the functions $g_j(z)$ are exactly the successive derivatives of $Q(0, y)$ w.r.t. the variable $y$ evaluated at $y = 0$. First, $g_0(z) = Q(0, 0)$. Further, one has $r_y(\omega) = z(y(\omega) + 1)Q(0, y(\omega))$. Differentiating w.r.t. $\omega$ and evaluating at $\omega_0^y$ (which is such that $y(\omega_0^y) = 0$), we find

$$g_1(z) = \frac{r'_y(\omega_0^y)}{z y'(\omega_0^y)} - Q(0, 0).$$

All quantities above can be computed, and a similar analysis as in Section 4 could lead to a closed-form expression for the GF of the numbers of walks $q(0, 1; 2n)$, $n \ge 0$. Similarly, one could compute $g_2(z)$, $g_3(z)$, etc.

**New Gessel conjectures.** For any $j \ge 0$, define

$$f_j(z) = (-1)^j (2j + 1)z^j + 2z^{j+1} \sum_{n \ge 0} q(0, j; 2n)z^n.$$

With this notation, the closed-form expression (1) for the $q(0, 0; 2n)$ is equivalent to (see [4, 15])

$$f_0 \left( z \frac{(1+z)^3}{(1+4z)^3} \right) = \frac{1+8z+4z^2}{(1+4z)^{3/2}}. \qquad (51)$$

On March 2013, Ira Gessel [15] proposed the following new conjectures: for any $j \ge 1$,

$$f_j \left( z \frac{(1+z)^3}{(1+4z)^3} \right) = (-z)^j \frac{p_j(z)}{(1+4z)^{3/2+3j}}, \qquad (52)$$

where $p_j(z)$ is a polynomial of degree $3j + 2$ with positive coefficients (due to (51), these new conjectures generalize the original one).

We shall not prove these conjectures in the present article. However, we do think that following the method sketched in the first part of Section 6, it could be possible to prove them, at least for small values of $j \ge 0$.

# Appendix A. Some properties of elliptic functions

In this appendix, we bring together useful results on the Weierstrass functions $\wp$ and $\zeta$. First, they are defined as follows for all $\omega \in \mathbf{C}$:

$$\wp(\omega) = \frac{1}{\omega^2} + \sum_{(\bar{n}, \bar{n}) \in \mathbb{Z}^2 \setminus \{(0,0)\}} \left( \frac{1}{(\omega - (\bar{n}\bar{\omega} + \hat{n}\hat{\omega}))^2} - \frac{1}{(\bar{n}\bar{\omega} + \hat{n}\hat{\omega})^2} \right), \qquad (53)$$

$$\zeta(\omega) = \frac{1}{\omega} + \sum_{(\bar{n}, \bar{n}) \in \mathbb{Z}^2 \setminus \{(0,0)\}} \left( \frac{1}{\omega - (\bar{n}\bar{\omega} + \hat{n}\hat{\omega})} + \frac{1}{\bar{n}\bar{\omega} + \hat{n}\hat{\omega}} + \frac{\omega}{(\bar{n}\bar{\omega} + \hat{n}\hat{\omega})^2} \right). \qquad (54)$$

The next lemma displays a collection of useful properties of the functions $\wp$ and $\zeta$. These properties are very classical; they can be found in [1, 18, 39] (see also the references in [24]).
**Lemma 15.** Let $\zeta$ and $\wp$ be the Weierstrass functions with periods $\bar{\omega}, \hat{\omega}$. Then:

(P1) $\zeta$ (resp. $\wp$) has a unique pole in the fundamental parallelogram $[0, \bar{\omega}) + [0, \hat{\omega})$. It is of order 1 (resp. 2), at 0, and has residue 1 (resp. 0, and principal part $1/\omega^2$).

(P2) An elliptic function with no poles in the fundamental parallelogram $[0, \bar{\omega}) + [0, \hat{\omega})$ is constant.

(P3) In the neighborhood of 0, the function $\wp(\omega)$ admits the expansion

$$ \wp(\omega) = \frac{1}{\omega^2} + \frac{g_2}{20}\omega^2 + \frac{g_3}{28}\omega^4 + O(\omega^6). $$

(P4) We have the addition theorems, for any $\omega, \tilde{\omega} \in \mathbf{C}$:

$$ \zeta(\omega + \tilde{\omega}) = \zeta(\omega) + \zeta(\tilde{\omega}) + \frac{1}{2} \frac{\wp'(\omega) - \wp'(\tilde{\omega})}{\wp(\omega) - \wp(\tilde{\omega})}, $$

and

$$ \wp(\omega + \tilde{\omega}) = -\wp(\omega) - \wp(\tilde{\omega}) + \frac{1}{4} \left( \frac{\wp'(\omega) - \wp'(\tilde{\omega})}{\wp(\omega) - \wp(\tilde{\omega})} \right)^2. $$

(P5) For given $\tilde{\omega}_1, \dots, \tilde{\omega}_p \in \mathbf{C}$, define

$$ f(\omega) = c + \sum_{1 \le l \le p} r_l \zeta(\omega - \tilde{\omega}_l), \quad \forall \omega \in \mathbf{C}. \qquad (55) $$

The function $f$ above is elliptic if and only if $\sum_{1 \le l \le p} r_l = 0$.

(P6) Let $f$ be an elliptic function with periods $\bar{\omega}, \hat{\omega}$ such that in the fundamental parallelogram $[0, \bar{\omega}) + [0, \hat{\omega})$, $f$ has only poles of order 1, at $\tilde{\omega}_1, \dots, \tilde{\omega}_p$, with residues $r_1, \dots, r_p$, respectively. Then there exists a constant $c$ such that (55) holds.

(P7) Let $p$ be some positive integer. The Weierstrass elliptic function with periods $\bar{\omega}, \hat{\omega}/p$ can be written in terms of $\wp$ as

$$ \wp(\omega) + \sum_{1 \le l \le p-1} \left[ \frac{\wp(\omega + l\hat{\omega}/p) - \wp(l\hat{\omega}/p)}{\omega} \right], \quad \forall \omega \in \mathbf{C}. $$

(P8) The function $\zeta$ is quasi-periodic, in the sense that

$$ \zeta(\omega + \bar{\omega}) = \zeta(\omega) + 2\zeta(\bar{\omega}/2), \quad \zeta(\omega + \hat{\omega}) = \zeta(\omega) + 2\zeta(\hat{\omega}/2), \quad \forall \omega \in \mathbf{C}. $$

(P9) If $\alpha + \beta + \gamma = 0$ then

$$ (\zeta(\alpha) + \zeta(\beta) + \zeta(\gamma))^2 = \wp(\alpha) + \wp(\beta) + \wp(\gamma). $$

(P10) We have the bisection formula:

$$ \begin{aligned} \wp(\omega/2) ={}& \wp(\omega) + \sqrt{(\wp(\omega) - \wp(\omega_1/2))(\wp(\omega) - \wp(\omega_2/2))} \\ & + \sqrt{(\wp(\omega) - \wp(\omega_1/2))(\wp(\omega) - \wp((\omega_1 + \omega_2)/2))} \\ & + \sqrt{(\wp(\omega) - \wp(\omega_2/2))(\wp(\omega) - \wp((\omega_1 + \omega_2)/2))}, \quad \forall \omega \in \mathbf{C}. \end{aligned} $$

Acknowledgments

We thank the two anonymous referees for their useful and insightful comments and suggestions, which led us to improve the presentation of the paper.
References

[1] Abramowitz, M., and Stegun, I.: *Handbook of mathematical functions with formulas, graphs, and mathematical tables*. National Bureau of Standards Applied Mathematics Series, Washington (1964)

[2] Arquès, D.: Dénombrements de chemins dans $\mathbb{R}^2$ soumis à contraintes. *RAIRO Inform. Théor. Appl.* **20** 473–482 (1986)

[3] Ayyer, A.: Towards a human proof of Gessel's conjecture. *J. Integer Seq.* **12** (2009)

[4] Bostan, A., and Kauers, M.: The complete generating function for Gessel walks is algebraic. *Proc. Amer. Math. Soc.* **138** 3063–3078 (2010)

[5] Bousquet-Mélou, M.: Walks in the quarter plane: a functional equation approach. *Proceedings of the Fourteenth International Conference on Formal Power Series and Algebraic Combinatorics*. Melbourne, Australia (2002)

[6] Bousquet-Mélou, M.: Walks in the quarter plane: Kreweras' algebraic model. *Ann. Appl. Probab.* **15** 1451–1491 (2005)

[7] Bousquet-Mélou, M., and Mishna, M.: Walks with small steps in the quarter plane. *Contemp. Math.* **520** 1–40 (2010)

[8] Bousquet-Mélou, M., and Petkovšek, M.: Linear recurrences with constant coefficients: the multivariate case. *Discrete Math.* **225** 51–75 (2000)

[9] Bousquet-Mélou, M., and Petkovšek, M.: Walks confined in a quadrant are not always D-finite. *Theoret. Comput. Sci.* **307** 257–276 (2003)

[10] Fayolle, G., lasnogorodski, R., and Malyshev, V.: *Random walks in the quarter-plane*. Springer-Verlag, Berlin (1999)

[11] Fayolle, G., and Raschel, K.: On the holonomy or algebraicity of generating functions counting lattice walks in the quarter-plane. *Markov Process. Related Fields* **16** 485–496 (2010)

[12] Flajolet, P., and Sedgewick, R.: *Analytic combinatorics*. Cambridge University Press, Cambridge (2009)

[13] Flatto, L., and Hahn, S.: Two parallel queues created by arrivals with two demands. I. *SIAM J. Appl. Math.* **44** 1041–1053 (1984)

[14] Flatto, L.: Two parallel queues created by arrivals with two demands. II. *SIAM J. Appl. Math.* **45** 861–878 (1985)

[15] Gessel, I.: Personal communication. (2013)

[16] Gouyou-Beauchamps, D.: Chemins sous-diagonaux et tableaux de Young. In *Combinatoire énumérative*, Lecture Notes in Math. 1234, Springer, Berlin, 112–125 (1986)

[17] Guy, R., Krattenthaler, C. and Sagan, B.: Lattice paths, reflections and dimension-changing bijections. *Ars Combin.* **34** 3–15 (1992)

[18] Jones, G., and Singerman, D.: *Complex Functions*. Cambridge University Press, Cambridge (1987)

[19] Kauers, M., Koutschan, C., and Zeilberger, D.: Proof of Ira Gessel's lattice path conjecture. *P. Natl. Acad. Sci. USA* **106** 11502–11505 (2009)

[20] Kauers, M., and Zeilberger, D.: The quasi-holonomic ansatz and restricted lattice walks. *J. Difference Equ.* Appl. **14** 1119–1126 (2008)

[21] Kreweras, G.: Sur une classe de problèmes de dénombrement liés au treillis des partitions des entiers. *Cahiers du B.U.R.O.* **6** 5–105 (1965)

[22] Kurkova, I., and Raschel, K.: Explicit expression for the generating function counting Gessel's walks. *Adv. in Appl. Math.* **47** 414–433 (2011)

[23] Kurkova, I., and Raschel, K.: On the functions counting walks with small steps in the quarter plane. *Publ. Math. Inst. Hautes Études Sci.* **116** 69–114 (2012)

[24] Kurkova, I., and Raschel, K.: New steps in walks with small steps in the quarter plane. *Preprint arXiv:1307.0599*, to appear in *Ann. Comb.* (2015)

[25] Lipshitz, L.: *D-finite power series*. *J. Algebra* **122** (2), 353–373 (1989)

[26] Malyshev, V.: Random Walks, Wiener-Hopf Equations in the Quarter Plane, Galois Automorphisms. *Lomonosov Moscow University Press* (1970) (in Russian)

[27] Malyshev, V.: Positive random walks and Galois theory. *Uspehi Matem. Nauk* **26** 227–228 (1971)

[28] Malyshev, V.: An analytical method in the theory of two-dimensional positive random walks. *Siberian Math. J.* **13** 1314–1329 (1972)
[29] Mishna, M.: Classifying lattice walks restricted to the quarter plane. *Proceedings of the Nineteenth International Conference on Formal Power Series and Algebraic Combinatorics*. Tianjin, China (2007)

[30] Mishna, M.: Classifying lattice walks restricted to the quarter plane. *J. Combin. Theory Ser. A* **116** 460–477 (2009)

[31] Picard, É.: Sur les périodes des intégrales doubles et sur une classe d'équations différentielles linéaires. *Ann. Sci. École Norm. Sup.* **50** 393–395 (1933)

[32] Pólya, G.: Über eine Aufgabe der Wahrscheinlichkeitsrechnung betreffend die Irrfahrt im Straßennetz. *Math. Ann.* **84** 149–160 (1921) (in German)

[33] Petkovšek, M., and Wilf, H.: On a conjecture of Ira Gessel. *Preprint arXiv:0807.3202* (2008)

[34] Raschel, K.: Counting walks in a quadrant: a unified approach via boundary value problems. *J. Eur. Math. Soc.* **14** 749–777 (2012)

[35] Roytvarf, N., and Yomdin, Y.: Analytic continuation of Cauchy-type integrals. *Funct. Differ. Equ.* **12** 375–388 (2005)

[36] Sun, P.: Proof of two conjectures of Petkovšek and Wilf on Gessel walks. *Discrete Math.* **312** 3649–3655 (2012)

[37] Vidūnas, R.: Transformations of algebraic Gauss hypergeometric functions. *Preprint arXiv:0807.4808* (2008)

[38] Vidūnas, R.: Algebraic transformations of Gauss hypergeometric functions. *Funkcial. Ekvac.* **52** 139–180 (2009)

[39] Watson, G., and Whittaker, E.: *A course of modern analysis*. Cambridge University Press, Cambridge (1962)