Guessing Linear Recurrence Relations of Sequence Tuplesand P-recursive Sequences with Linear Algebra

Given several n-dimensional sequences, we first present an algorithm for computing the Grobner basis of their module of linear recurrence relations. A P-recursive sequence (ui)i ∈ Nn satisfies linear recurrence relations with polynomial coefficients in i, as defined by Stanley in 1980. Calling directly the aforementioned algorithm on the tuple of sequences ((ij, ui)i ∈ Nn)j for retrieving the relations yields redundant relations. Since the module of relations of a P-recursive sequence also has an extra structure of a 0-dimensional right ideal of an Ore algebra, we design a more efficient algorithm that takes advantage of this extra structure for computing the relations. Finally, we show how to incorporate Grobner bases computations in an Ore algebra K t1,...,tn,x1,...,xn, with commutators xk,xl-xl,xk=tk,tl-tl,tk= tk,xl-xl,tk=0 for k ≠ l and tk,xk-xk,tk=xk, into the algorithm designed for P-recursive sequences. This allows us to compute faster the elements of the Grobner basis of which are in the ideal spanned by the first relations, such as in 2D/3D-space walks examples.


INTRODUCTION
Computing linear recurrence relations of multi-dimensional sequences is a fundamental problem in Computer Science. As this is the core of the paper, we start with an example. The binomial sequence b = ( i 1 ! /(i 2 ! (i 1 − i 2 )!)) (i 1 ,i 2 )∈N 2 satisfies Pascal's rule, a linear recurrence relation: It has constant coefficients. But this sequence also satisfies relations with polynomial coefficients in (i1, i2): Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.
Deciding if a sequence is P-recursive, as defined by Stanley [28] finds applications for instance in Combinatorics and in Computer algebra [27]. We refer the reader to the series of papers on planar [10,11,12] and 3D-space walks [7,8].
The generating series i 1 ,...,in∈N ui 1 ,...,in x i 1 1 · · · x in n of a P-recursive sequence (ui 1 ,...,in ) (i 1 ,...,in)∈N n is a D-finite function in x1, . . . , xn, see [19,Theorem 3.7]. A D-finite function is such that the dimension of the vector space spanned by all its derivatives is finite over K(x1, . . . , xn), this allows one to characterize such functions with initial conditions and differential equations. For instance, the Dynamical Dictionary of Mathematical Functions [3] generates dynamically and automatically web pages on elementary and special functions thanks to the equations they satisfy. Likewise, a P-recursive sequence is uniquely defined by the linear recurrence relations with polynomial coefficients it satisfies and a finite number of initial terms.

Related work
For one-dimensional sequences, C-relations (linear recurrence relations with constant coefficients) can be guessed with Berlekamp -Massey algorithm [4,20], while for multidimensional sequences, they can be guessed with Berlekamp -Massey -Sakata algorithm [24,26] or Scalar-FGLM [5,6]. All these algorithms only guess and check that the relations are valid for a finite number of terms of the sequence. Then, usually, one need to prove that they are satisfied for all the terms of the sequence. In this paper, a table shall denote a finite subset of terms of a sequence: it is one of the input parameter of the algorithms since one cannot handle an infinite sequence.
When computing parameterized sums of multivariate sequences, or integrals of multivariate functions, in general, it is hopeless to obtain a closed form. Indeed, even for elementary univariate function we may not have closed forms when computing their integral on some domain. This motivated Zeilberger in 1990 [29] to introduce the so-called creative telescoping method. It is now one of the most efficient ways to do so and has been a tremendously active research topic. We refer the reader to the up-to-date nice survey on the state of the art in creative telescoping in [13] and the references therein.
Although sequences can satisfy some linear recurrence re-lations with constant or polynomial coefficients, they still may be neither C-recursive nor P-recursive. Given a subset S of steps in {0, ±1} 2 , one can define the sequence u = (un,i,j) (n,i,j)∈N 3 of the number of planar walks of length n ending at (i, j) with steps in S. Determining if u is Precursive has applications in lattice path enumeration [1,11,12]. Likewise, now 3D-space walks are investigated. In [7], the authors use several different methods to prove that somes sequences of walks are P-recursive among which: the algebraic kernel method, the reduction to smaller dimensions and the guessing and proving method.

Contributions
We start by recalling the definitions of C-recursive (linear recursive with constant coefficients) sequences and define Crecursive tuples of sequences. This framework allows us to transform a P-recursive sequence into a tuple of sequences.
In Section 3, we extends Scalar-FGLM [5,6] for guessing the module of C-relations satisfied by a tuple of tables up to a degree bound d. The algorithm returns a (d+1)-truncated Gröbner basis of their module of relations. The main idea of this algorithm is the same as Scalar-FGLM's: extracting a full-rank submatrix of maximal rank. P-relations with coefficients of degree at most δ satisfied by a sequence u = (ui 1 ,...,in ) (i 1 ,...,in)∈N n are C-relations satisfied by the tuple of sequences (i j 1 1 · · · i jn n ui 1 ,...,in ) (i 1 ,...,in)∈N n , with j1, . . . , jn ≥ 0 and j1 + · · · + jn ≤ δ. Hence, a first idea is to compute them with the extended Scalar-FGLM for instance. However, this strategy is not optimal because the sequences are not independent: the module of relations has an additional structure, see also [21]. This is why, in Section 4, we design algorithm P-recursive-FGLM to take advantage of this particular structure. This algorithm input is a P-recursive table, a degree bound on the order of the relations and a degree bound on the polynomial coefficients. It returns a Gröbner basis of the right ideal of relations in a skew-polynomial ring K t1, . . . , tn, x1 . . . , xn with commutation rules is only known to be valid for a given pair (i1, i2), then we still know that for any j1, j2 ≥ 0, i j 1 This makes the extracted matrix smaller. Sometimes an estimate of the Gröbner basis staircase size is known. To optimize the number of table queries, we present an output sensitive probabilistic algorithm in Section 4.2.
The relations computed by P-recursive-FGLM can be output one after the other. When several relations are found, it seems profitable not to look for any relation in the ideal they span. In Section 5, we use a mixed approach by computing truncated Gröbner bases in the aforementioned skewpolynomial ring to determine "needed redundant relations". On the one hand, they are redundant for they are deduced from previously found relations. On the other hand, they are computed faster since this approach does not require any extra queries to the table. Furthermore, these relations can help us to close the staircase in order to guess prematurely the P-recursiveness of the table for a given degree. We illustrate this with Examples 6 and 7 In Section 6, we show that the matrices handled by Multi-Scalar-FGLM and P-recursive-FGLM are heavily structured. When the monomial ordering is LEX, we can make use of the quasi-Hankel structure to improve the complex-ity of the linear system solving [9]. We also investigate the number of table queries performed by the algorithms.

DEFINITIONS AND NOTATION
We recall the classical definitions of a C-recursive sequence and of a P-recursive sequence. We shall also see how to deal with C-relations between terms of multiple sequences and see that from a P-recursive sequence, we can create a tuple of sequences satisfying C-relations.
In all the paper, we shall use standard notation with bolded letters corresponding to vectors and sequences: for n ∈ N * , i = (i1, . . . , in) and x = (x1, . . . , xn). As usual, x i denotes x i 1 1 · · · x in n and |i| = i1 + · · · + in. Finally, u = (u i ) i∈N n is an n-dimensional sequence over a field K.
For i ∈ N n , we let [ C-relations are straightforwardly extended to n-dimensional sequences [23,Definition 21]: let S be a finite subset of N n , let α = (αs)s∈S be nonzero, then u = (u i ) i∈N n satisfies the linear relation defined by α if for all i ∈ N n , s∈S αs x i+s = s∈S αs u i+s = 0. ( Operator [ ] allows us to make a one-to-one correspondence between C-relations satisfied by u and polynomials in K[x]: relation s∈S αs us = 0 is associated to polynomial s∈S αs x s . According to Sakata [24] and to Fitzpatrick and Norton [17], a C-recursive sequence is defined as follows. Definition 1. An n-dimensional sequence u = (u i ) i∈N n is C-recursive if from a nonzero finite number of initial terms us, s ∈ S, and a finite number of C-relations, without any contradiction, one can compute any term of the sequence.
From the polynomial viewpoint, Definition 1 can be restated as sequence u is C-recursive if and only if set I = {P ∈ K[x], ∀ i ∈ N n , P x i = 0} is a zero-dimensional ideal.
A Gröbner basis of this ideal can be computed using the so-called BMS [25] and Scalar-FGLM [5, Algorithm 3] algorithms, see also [6] for an extended version of [5].
C-recursive sequences are also exactly the only sequences such that their generating series i∈N n u i x i is a rational fraction in x whose denominator factors into univariate polynomials, see for instance [6,Propostion 19] For a sequence u not C-recursive, both algorithms, called on the table of terms u i , |i| ≤ d, return a (d + 1)-truncated Gröbner basis. Sequences such as the binomial one b = may satisfy a C-relation but not be C-recursive.
For instance, b satisfies equation (1), Pascal's rule, while its generating series is the rational whose denominator is irreducible. The greater class of P-recursive sequences satisfy P-relations (linear recurrence relations with polynomials coefficients). These relations are analogous to relations as equation (3) but with αs a polynomial in i. For instance, both equations (2a) and (2b) satisfied by b are P-relations.
Definition 2. An n-dimensional sequence u = (u i ) i∈N n is P-recursive if from a nonzero finite number of initial terms u i , i ∈ S, and a finite number of P-relations with polynomials coefficients, without any contradiction, one can compute any term of the sequence.

Tuple of sequences
In this section, we aim to deal with multiple sequences u (1) , . . . , u (m) all n-dimensional over a common field K. In particular, we shall ask them to satisfy C-relations, of type We extend the operator [ ] to vector of polynomials: for all P = (P1, . . . , This yields a one-to-one correspondence between vectors of polynomials in K[x] m and linear relations. We now aim to 0,1 to compute any term of both sequences. Yet, the module of relations satisfied by (u (1) 0,0 to compute any term.

P-recursive sequences
For P-recursive sequences, we can naturally create several auxiliary sequences such that they satisfy C-relations. For instance, with sequence b, we introduce the three aux- . Equation (1) is still satisfied by b (0) and both equations (2a) and (2b) can be restated as C-relations satisfied by these 3 auxiliary sequences: Hence, their module of relations contains More generally, for any P-recursive sequence, one would have to introduce as many auxiliary sequences as needed depending on the number of indices and the allowed degree for the polynomial coefficients. Usually a new set of variables t = (t1, . . . , tn) is introduced, such that [t k x i ] = i k u i , and thus [t j x i ] = i j u i . This yields commutation rules t k x k = x k (t k +1) and t k x = x t k for k = . We denote by K t, x the skew-polynomial ring with these commutation rules. We also let K(t) x be the ring of skew-polynomials in x whose coefficients are rational fractions in t.
In this setting, P-relations are in a one-to-one correspondence with polynomials in K t, x and a P-recursive sequence is a sequence such that the set of relations In general, if one considers the right ideal I = {P ∈ K t, x , ∀ i, j ∈ N n , P t j x i = 0}, then for all k, there exists d > 0 and j such that t j x d k is the leading monomial of a polynomial in the ideal.

Lattice-based relations
We now deal with sequences satisfying C-relations when evaluated in points i ∈ Λ, a sublattice of N n .
The one-dimensional sequence u = (ui) i∈N defined by for but not ui+3 − ui+2 − ui+1 + ui = 0 for odd i. Nonetheless, computing equation 5 is of interest since with (u2i) i∈N and u1, it allows us to compute all the odd-indexed terms of u.
As in Section 2.1, we can write equation 5: More generally, let (λ1, . . . , λn) be a basis of Λ, S be a finite subset of N n such that sequence u = (u i ) i∈N n satisfies Then, one can create auxiliary sequences u (f ) = (u i+f ) i∈Λ for all f ∈ F , the fundamental domain of Λ to find the relation of equation 6. Mimicking the P-recursive case, we introduce a new variable t such that for all i ∈ N n , t x i = x i 1 λ 1 · · · x in λn t and [t x i ] = u i 1 λ 1 +···+in λn , we can extend these relations to K t, x by linearity. For i ∈ Λ, we let i = c1 λ1 + · · · + cn λn, therefore x i = t x c 1 1 · · · x cn n . Then, one obtains relation

GUESSING RELATIONS FOR TUPLES OF SEQUENCES
This section is devoted to the design of an FGLM-like algorithm in the module K[x] m to compute the Gröbner basis of the submodule of relations of n-dimensional tables u (1) , . . . , u (m) defined over a common field K.
For the paper to be self-contained, we recall the notation and definitions of [5]. We fix an admissible order ≺ on x, T is the ordered set of terms made from x. We extend ≺ to monomial vectors of type For P ∈ K[x] m , we denote by T (P) the set of terms appearing in P and by LT(P) the maximum of T (P) for ≺.
As we try to design an algorithm, we cannot expect to check that a relation is satisfied for all indices i ∈ N n . During the execution of the algorithm, we shall deal with a finite subset of indices U ⊂ N n , and we aim to find relations valid for those indices: Definition 3. Let U be a finite subset of N n . We say that a vector of polynomials P = (P1, . . . ,

Staircases
Since we want to generate minimal relations, it is mandatory to determine a set of terms in T for which there is no C-relations. Useful staircases were defined for C-recursive tables in [5,Definition 6]. The following definitions extends it for multiple tables. Definition 4. Let T1, . . . , Tm, U be finite subsets of T such that T1, . . . , Tm ⊆ U and # U = m =1 # T . We say that a set S = S1 e1 ∪ · · · ∪ Sm em, with S1 ⊆ T1, . . . , Sm ⊆ Tm, implies that β ,s = 0 for all , s, sets S1, . . . , Sm, V are maximal for the inclusion and minimal for ≺. We compare two ordered sets for ≺ by seeing them as tuples of their elements and then comparing them lexicographically.
As we are in a more general case, useful staircases still fail in general to be true staircases in However, this problem is easily solved by stabilizing the staircase, i.e. adding to each set of the tuple all the divisors of its elements.

Algorithm for finding the relations
We design an algorithm for checking that a finite subset S ⊆ T is a useful staircase with V ⊆ U wrt. u (1) , . . . , u (m) , T, U and ≺. In the following example, we compute the useful staircase for two univariate tables.
We are now in a position to define the structured matrix associated to lists of terms T1, . . . , Tm ⊆ U ⊆ T .   Furthermore, finding a monic polynomial vector P of a given support such that P x i = 0, for all x i ∈ U is equivalent to solving a linear system HU,T α+H U,LT(P) = 0, where T is the support of P without its leading term. Proposition 1. Let T1, . . . , Tm, U be finite subsets of T . If the finite sets S1, . . . , Sm, V are such that S = m =1 S e is a useful staircase with V wrt. u (1) , . . . , u (m) , T, U and ≺, then det HV,S = 0, rank HV,S = rank HU,T .
If S 1 ⊆ S1, . . . , S m ⊆ Sm, V ⊆ V are finite sets of terms, then rank H V ,S ≤ rank HV,S.
The algorithm returns {P, P , P , P }.

GUESSING RELATIONS FOR P-RECURSIVE SEQUENCES
As stated in Section 2.2, one could use Algorithm 1 to deal with P-recursive tables. For instance, if one suspects a sequence u to satisfy relations of type s∈S αs(i + s) u i+s = 0 with αs ∈ K[i] of degree at most δ, then one would just need to call the algorithm with all the u (j) = (i j u i ) i∈N , s.t. |j| ≤ δ, as input tables.

A criterion for P-recursive sequences
The main drawback of this strategy is the output of the algorithm: there are polynomials representing redundant relations if the sequence is P-recursive but not C-recursive. For instance, Algorithm 1 called on b (0) , b (1) , b (2) , of Section 2.2, with degree bounds (1, 1, 1) in x returns both relations (4a) and (4b) together with six extra relations.
Yet, the first two are enough to compute every term of the sequence starting from 0 0 = 1. These superfluous relations come from the fact that we forget the extra structure of the module of relations, i.e. it is also a right ideal of K t, x for t = (t1, . . . , tn), t k x = x t k if k = and t k x k = x k (t k + 1).
Therefore, it is possible to extend Multi-Scalar-FGLM to take into account this structure. Whenever a relation t j+δ x i+d = r∈R,s∈S αr,s t j+r x i+s (i + d) j+δ u i+d = r∈R,s∈S αr,s (i + s) j+r u i+s is true up to a certain threshold for i, then its multiples by i k + d k are also true up to the same threshold.
Proposition 2. Let u be a P-recursive table over K. Let T (resp. U ) be a finite subset of monomials in K t, x (resp. in K[x]). If t j x i is not in the useful staircase of matrix Proof. If t j x i is not in the useful staircase, a relation starting with u i+k exists. Multiplying it by i k + d k yields a new relation whose associated polynomial has a leading term t k t j x i , hence column t k t j x i can also be removed.
Let us notice that this is analogous to the behavior of FGLM for polynomial ideals in K[x] [16]: whenever a relation x d = s≺d αs x s is found, then automatically for all i ∈ N n , x i+d = s≺d αs x i+s . This is also analogous to Buchberger -Möller algorithms wherein the finitely many points can be interpreted as the finitely many table terms we have. We illustrate this criterion.
Example 3. We consider u = (i!) i∈N and skew-polynomial ring K t, x . Columns will be labeled by T = {1, t, x, t x} and rows by U = {1, x, x 2 , x 3 }. This yield the rank 3 matrix Column labeled x is the first dependent one meaning we find . This leads us to determine that (i + 1) ui+1 i.e. column t 2 . Therefore, column t x is independent from the previous ones but is not in the useful staircase.
In this context, a useful staircase is the maximal subset S ⊆ T such that columns of HU,S are all linearly independent and for all t j x i ∈ T \ S and j ∈ N n , t j+j x i ∈ S. To compare monomials in K t, x in order to build our matrix, we proceed as follows. We let ≺ be a monomial ordering refined by the total degree on t and x with the convention that for any k, , t k ≺ x .
Remark 3. It is sometimes more convenient to obtain the ideal of relations, not in K t, x but in K(t) x , the ring of skew-polynomials in x with rational fractions in t coefficients. In this setting, we can mimic Scalar-FGLM algorithm by setting L to the set of all monomials in t, x of bidegree at most (δ, d + 1) which are not in S . In a way, this would ensure that the staircase of the Gröbner basis obtained at the end is closed. Then, we need to change also how to update L: since now each t k is invertible, whenever τ = t j x i , we remove every monomial t j x i+i .

Adaptive algorithm
If one is concerned about the number of queries to table u, it is necessary not to visit monomials yielding relations which are multiple of already computed relations. Therefore, we need to have an adaptive approach of the algorithm: we shall discover the staircase term by term, see also Adaptive Scalar-FGLM [5, Section 5]. As in Remark 3, we assume that we look for a Gröbner basis of the ideal in K(t) x .
We start from S = ∅, V = ∅ and try to increase them both: if H V ∪{x i },S∪{t j x i } has a greater rank than HV,S, then S and V are updated accordingly. Otherwise, we have found a new relation whose leading term is t j x i . Therefore, we do not update S nor V and shall never suggest any multiple of x i (resp. x i ) as a new term in S (resp. V ). This yields Algorithm 3.

MIXED APPROACH WITH GRÖBNER BASES COMPUTATIONS
When dealing with a sequence u = (u i ) i∈N n , not all its ideal of relations I in K t, x is necessarily interesting. For instance, whenever one wants to know if u is P-recursive, it is enough to compute for all k, 1 ≤ k ≤ n, a polynomial Algorithm 3: Adaptive P-recursive-FGLM.
Input: A table u = (u i ) i∈N n with coefficients in K, (δ, d) given bounds and ≺ a monomial ordering. Error "Run Algorithm 2".
in I whose leading monomial is t j x d k with j any and d > 0. We recall that this ensures that I K(t) x is 0-dimensional. Therefore, only a subideal of I may be needed to certify that u is P-recursive.
In Adaptive P-recursive-FGLM algorithm, as soon as a polynomial P1 with leading monomial LT(P1) is found, all the t j x i LT(P1) are discarded so that the multiples of P1 are not computed. Therefore, whenever polynomials P2, . . . , Pr are found, we can discard all the right-linear combinations of P1, . . . , Pr, hence the ideal they span. In this algorithm, if P1, . . . , Pr are exactly the first output polynomials, then we know that they are in the final Gröbner basis and that their leading monomials are the least first. By computing the Gröbner basis of J = P1, . . . , Pr ⊆ K t, x , we can expect to be able to find polynomials with leading monomials not in LT(P1), . . . , LT(Pr) . On the one hand, these polynomials are redundant since they are deduced from P1, . . . , Pr, i.e. the relations they represent are deduced by those induced by P1, . . . , Pr. On the other hand, we may find polynomials ensuring that J is zero-dimensional and thus that I is.
Let us assume that when computing the Gröbner basis of J, we find another polynomial Pr+1. Let us assume furthermore that, seen as monomials in x, LT(P1), . . . , LT(Pr) ≺ LT(Pr+1) and that Pr+1 is also in the Gröbner basis of I. Then, we computed Pr+1 without new queries to the table.
Remark 4. The Gröbner basis computation can be done either in K t, x or in K(t) x . In the latter case, as soon as a relation with leading monomial x i is found, no relation with leading monomial x i+i shall be computed. However, in the former case, it is possible that we find new relations with leading monomials x i+i , hence with higher degrees in x, but with also lower degrees in t.
In the black-box model, this approach can be very beneficial, since the computation of even one element of u can be costly. Therefore, we can modify Adaptive P-recursive-FGLM so that it takes these Gröbner bases computations into account: first we compute the polynomials as soon as they are found, instead of just storing their leading monomials in G . Then, whenever # G is big enough, we replace G by the true Gröbner basis of the ideal spanned by G and we remove all the multiples of LT(g), for g ∈ G, in L.
Computation of Gröbner bases in an Ore algebra can be done with the adaptations of Buchberger and F4 [14] algorithms in computer algebra systems [18], such as Maple or Plural the noncommutative extension of Singular.
Let us illustrate this behavior with an example.
We apply this mixed approach to find a 0-dimensional subideal of relations of table g up to degrees (5,5). Variables t0, x0 shall be associated with n, while t2, x2 shall be associated with j. The first computed polynomial has leading monomial t0 t 3 2 x 2 0 x 3 2 . Then, four polynomials with leading monomials t 4 0 t2 x 4 0 x2, t 3 0 t 2 2 x 4 0 x2, t 3 0 t 2 2 x 2 0 x 3 2 , t 4 0 x 4 0 x2. Calling a Gröbner basis computation on these polynomials in K t, x allows us to determine polynomials with leading monomials We can notice that the first (resp. last) two are purely in t and x0 (resp. x2). Hence we can suspect that g is P-recursive.
Example 7. We use the same notation as in Example 6 with the extra convention that t1, x1 (resp. t3, x3) are associated with i (resp. k).
Increasing gradually to column degree (2, 4) and row degree 30, we obtain a 1448 × 350 matrix and 8 leading terms. A Gröbner basis computation yields 25 leading terms including t0 t1 t2 x 2 1 . This closes the staircase on the x1 side. We increase now the column degree to (3,4) and the row degree to 40, obtain a 2959 × 600 matrix and find an extra 25 relations. Unfortunately this does not close the staircase on either side.
A Gröbner basis computation, ideally truncated in total degree 9, returns 127 relations. Among which, there are leading monomials t 3 0 t2 t 2 3 x 4 0 and t0 t 2 1 t2 x 4 2 . In total, 19 monomials are purely in t and one of the xi. Hence, the staircase is closed in K(t) x .
In Table 1

COMPLEXITY ANALYSIS
This section is devoted to the study of the complexity of both Multi-Scalar-FGLM and P-recursive-FGLM algorithms. This comes down to the study of the structure of the multi-Hankel matrix.

Algorithm for tuples of tables
For the Multi-Scalar-FGLM algorithm, the multi-Hankel matrix HU,T is the concatenation of m multi-Hankel matrices HU,T . From [6, Section 6], we know that for an ndimensional table and LEX(x1 ≺ · · · ≺ xn) ordering, if the leading monomials are x d 1 1 , . . . , x d 2 2 , . . . , x dn n , then the multi-Hankel matrix created by Scalar-FGLM is a submatrix of a multilevel block Hankel matrix of depth n, or n-multiblock Hankel matrix which is heavily structured. Definition 6. A multilevel block Hankel matrix of depth 0 is a scalar. For any n ∈ N, a multilevel block Hankel matrix of depth n + 1 is a block Hankel matrix whose blocks are multilevel block Hankel matrices of depth n.
By construction in Algorithm 1, each T of T = T1 e1 ∪ · · · ∪ Tn en is a subset of U , therefore HT ,T e is a submatrix of the generalized multi-Hankel matrix handled by the algorithm. Let S = S1 e1 ∪ · · · ∪ Sm em and V be such that S is a useful staircase with V . A necessary condition for a monomial s to be in S is that column s e is linearly independent from the previous ones in HT ,T e . Thus, row s e is also independent from the previous ones in HU,T . Hence, s ∈ S implies that s ∈ V and each S is a subset of V .
Proposition 5. Given a tuple of m tables. Let µ be the number of polynomials in the Gröbner basis output by Multi-Scalar-FGLM. For 1 ≤ k ≤ n, let d k be the greatest powers in x k appearing in the Gröbner basis. Let M be the number of blocks of size d1 · · · dn appearing on each column of the computed matrix by the algorithm. Then the number of operations in the base field to compute the Gröbner basis is no more than O µ (M m d2 · · · dn) ω−1 M(d1 · · · dn) log(d1 · · · dn) .

Algorithms for P-recursive tables
For j ∈ N n , let Σ j be the set of all monomials t j x i in the useful staircase. By the column removal criterion of Proposition 2, we know that Σ j+j ⊆ Σ j for any j ∈ N n . Hence for all j, Σ j ⊆ Σ0 = Σ.
The remaining part of the analysis is the same as for Multi-Scalar-FGLM called on m = n+δ δ = O(n δ ) tables. This yields the following corollary.
Corollary 6. Let δ be the maximal degree in t allowed to compute the relations of a table. Let µ be the number of polynomials in the Gröbner basis output by P-recursive-FGLM. For 1 ≤ k ≤ n, let d k be the greatest powers in x k appearing in the Gröbner basis. Let M be the number of blocks of size d1 · · · dn appearing on each column of the computed matrix by the algorithm. Then the number of operations in the base field to compute the Gröbner basis is no more than O µ (M n δ d2 · · · dn) ω−1 M(d1 · · · dn) log(d1 · · · dn) .
Concerning the number of table queries, Algorithm 2, Precursive-FGLM, can reach elements of u far away from the useful staircase whenever the degree bound in x is too big. In Algorithm 3, Adaptive P-recursive-FGLM, the matrix elements are [t j x i+i ] = (i + i ) j u i+i with t j x i ∈ S, x i ∈ Σ and x i ∈ V . Hence, the number of table queries is the cardinal of Σ V = {τ χ | τ ∈ Σ, χ ∈ V }.