HAL Id: hal-03133516
https://hal-unilim.archives-ouvertes.fr/hal-03133516v2
Preprint submitted on 8 Jun 2021
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.
Algorithms for Linearly Recurrent Sequences of Truncated Polynomials
Seung Gyu Hyun, Vincent Neiger, Éric Schost
To cite this version:
Seung Gyu Hyun, Vincent Neiger, Éric Schost. Algorithms for Linearly Recurrent Sequences of
Truncated Polynomials. 2021. �hal-03133516v2�
Algorithms for Linearly Recurrent Sequences of Truncated Polynomials
Seung Gyu Hyun
University of Waterloo Waterloo, ON, Canada
Vincent Neiger
Univ. Limoges, CNRS, XLIM, UMR 7252 F-87000 Limoges, France
Éric Schost
University of Waterloo Waterloo, ON, Canada
ABSTRACT
Linear recurrent sequences are those whose elements are defined as linear combinations of preceding elements, and finding recurrence relations is a fundamental problem in computer algebra. In this paper, we focus on sequences whose elements are vectors over the ringA=K[𝑥]/⟨𝑥𝑑⟩of truncated polynomials. Finding the ideal of their recurrence relations has applications such as the computation of minimal polynomials and determinants of sparse matrices over A. We present three methods for finding this ideal: a Berlekamp- Massey-like approach due to Kurakin, one which computes the ker- nel of some block-Hankel matrix overAvia a minimal approximant basis, and one based on bivariate Padé approximation. We propose complexity improvements for the first two methods, respectively by avoiding the computation of redundant relations and by exploit- ing the Hankel structure to compress the approximation problem.
Then we confirm these improvements empirically through a C++
implementation, and we discuss the above-mentioned applications.
CCS CONCEPTS
•Computing methodologies→Algebraic algorithms; •The- ory of computation→Design and analysis of algorithms.
KEYWORDS
Linear recurrences; Berlekamp-Massey-Sakata; Approximant basis;
Kurakin’s algorithm; Sparse matrix.
ACM Reference Format:
Seung Gyu Hyun, Vincent Neiger, and Éric Schost. 2021. Algorithms for Linearly Recurrent Sequences of Truncated Polynomials. InProceedings of the 2021 International Symposium on Symbolic and Algebraic Computation (ISSAC ’21), July 18–23, 2021, Virtual Event, Russian Federation.ACM, New York, NY, USA,8pages.https://doi.org/10.1145/3452143.3465533
1 INTRODUCTION
Linear recurrences appear in many domains of computer science and mathematics, and computing recurrence relations efficiently is a fundamental problem in computer algebra. More specifically, given a sequence of elements inK𝑟 for some fieldKand integer𝑟 >0, we seek a representation of itsannihilator, which is a polynomial ideal corresponding to all recurrence relations which are satisfied
ISSAC ’21, July 18–23, 2021, Virtual Event, Russian Federation
© 2021 Copyright held by the owner/author(s). Publication rights licensed to ACM.
This is the author’s version of the work. It is posted here for your personal use. Not for redistribution. The definitive Version of Record was published inProceedings of the 2021 International Symposium on Symbolic and Algebraic Computation (ISSAC ’21), July 18–23, 2021, Virtual Event, Russian Federation,https://doi.org/10.1145/3452143.3465533.
by the sequence; the polynomials in the annihilator are said to cancelthe sequence. In dimension𝑟 =1, the Berlekamp-Massey algorithm [4,26] computes the unique monic univariate polynomial of minimal degree that cancels the sequence. Sakata extended this algorithm first to dimension 2 [33] and then to the general case 𝑟 >1 [34]; see also Norton and Fitzpatrick’s extension to𝑟 >1 [13]. Recent work includes variants of Sakata’s algorithm such as one which handles relations that are satisfied by several sequences simultaneously [35], approaches relating the problem to the kernel of a multi-Hankel matrix and exploiting either fast linear algebra [5]
or a process similar to Gram-Schmidt orthogonalization [27], and an algorithm relying directly on multivariate polynomial arithmetic [6]. As for the representation of the output, all these algorithms compute a Gröbner basis or a border basis of the annihilator.
In this paper, we focus on computing recurrence relations for sequences whose elements are inA𝑛, whereA=K[𝑥]/⟨𝑥𝑑⟩. This problem can be solved using a specialization of Kurakin’s algo- rithm [20,21], as detailed in Section3, where we explicitly describe the output generating set of the annihilator as a lexicographic Gröbner basis of some bivariate ideal. We derive a cost bound of𝑂˜(𝛿𝑑(𝑛2𝛿𝑑+𝑛𝜔𝑑))operations inK, where𝛿is the order of recurrence (see Section2.1), and𝜔is an exponent for matrix multi- plication overK[1,9,24]. Because the Gröbner bases computed by Kurakin’s algorithm are often non-minimal, in Section4we propose a modified algorithm which aims at limiting as much as possible the computation of these extraneous generators. This lowers the cost to 𝑂˜(𝛿𝑑∗(𝑛2𝛿𝑑+𝑛𝜔𝑑)), where𝑑∗is a number arising in the algorithm as an upper bound on the cardinality𝑑optof minimal Gröbner bases of the annihilator. In Section7, we observe empirically that𝑑∗is often close or equal to𝑑opt.
Despite the improvement, the above cost bound still has a de- pendence at least quadratic in the dimension𝑛. Our interest in the case𝑛≫1 is motivated among others by the following fact: given a zero-dimensional idealI ∈K[𝑥 , 𝑦], one can recover a Gröbner basis of it viaI=Ann(𝒔)for some well-chosen𝒔 ∈ ANonly if K[𝑥 , 𝑦]/Ihas theGorensteinproperty [16,25]. When that is not the case, one can recover a basis ofIvia the annihilator ofseveral sequences simultaneously, which means precisely𝑛>1. For large 𝑛, we compute the annihilator via a minimal approximant basis of a block-Hankel matrix overAconstructed from𝒔. Computing this approximant basis via the algorithm PM-Basis of [14] leads to a complexity of𝑂˜(𝛿𝜔𝑛𝑑)operations inK(Section5.1). We then propose a novel improvement of this minimal approximant basis computation, based on a randomized compression of the input ma- trix which leverages its block-Hankel structure, reducing the cost to𝑂˜(𝛿2𝑛𝑑+𝛿𝜔𝑑)operations inK(Section5.2).
The four above algorithms have been implemented in C++ using the libraries NTL [37] and PML [18], using Lazard’s structural
theorem [23] for generating examples of sequences; see Section7 for more details. Our experiments on a prime fieldKhighlight a good match between cost bounds and practical running times, confirming also the benefit obtained from the improvements of both Kurakin’s algorithm and the plain approximant basis approach.
Furthermore, in Section6we propose an algorithm with cost quasi-linear in the order𝛿, whereas the above cost bounds are at least quadratic. For𝑑∈𝑂(𝛿), we compute the annihilator via the bivariate Padé approximation algorithm of [28]: this uses𝑂˜(𝑑𝜔+1𝛿) operations inK, at the price of restricting to𝑛∈𝑂(1).
Finally, in Section8we mention applications to the computation of minimal polynomials and determinants of sparse matrices over A. To design Wiedemann-like algorithms [39] for such matrices 𝐴 ∈ A𝜇×𝜇, we need to compute annihilators from sequences of the form(𝑢𝑇𝐴𝑖𝑣)𝑖≥0∈ANfor some vectors𝑢and𝑣; several such sequences may be needed, leading to the case𝑛>1.
Sakata’s 2-dimensional algorithm shares similarities with the case𝑛=1 of Kurakin’s algorithm, and has the same complexity 𝑂(𝛿2𝑑2)[33, Thm. 3]. Apart from this, to the best of our knowledge previous work has𝑛=1 and considers𝑟-dimensional sequences overKfor an arbitrary𝑟 ≥2 [5,6,27]. Complexity in this𝑟-variate context is often expressed using the degree𝐷of the considered zero-dimensional ideal; here,𝛿≤𝐷≤𝛿𝑑and a minimal Gröbner basis or a border basis will have at most min(𝛿 , 𝑑) +1 elements.
The Scalar-FGLM algorithm has cost𝑂˜(𝑑opt𝛿𝜔𝑑) [5, Prop. 16].
Both the Artinian border basis and Polynomial-Scalar-FGLM algo- rithms [6,27] cost𝑂(𝐷2𝛿𝑑), which is𝑂(𝛿3𝑑)in the most favourable case𝐷=𝛿, and𝑂(𝛿3𝑑3)when𝐷∈Θ(𝛿𝑑)(which will be the case in our experiments, see Section7). In all cases, a better complexity bound can be achieved by one of our algorithms outlined above.
While this is not reflected in the cost estimates above, Kurakin’s algorithm and our modified version are still affected by the shape of the staircase of the computed Gröbner basis, due to early termi- nation of the iterations and late additions; we leave a more refined complexity analysis with respect to𝐷as future work.
2 LINEARLY RECURRENT SEQUENCES
In this section, we review key facts about linearly recurrent se- quences and algorithmic tools used throughout the paper.
2.1 Recurrent sequences over K [ 𝑥 ]/⟨ 𝑥
𝑑⟩
We consider the setS=(A𝑛)Nof(vector) sequencesover the ring A=K[𝑥]/⟨𝑥𝑑⟩for some𝑑∈Z>0, that is, sequences𝒔=(𝑆0, 𝑆1, . . .) with each𝑆
𝑘inA𝑛. Such a sequence is said to belinearly recurrent if there exist𝛾∈Nand𝑝0, . . . , 𝑝𝛾 ∈Awith𝑝𝛾 invertible such that 𝑝0𝑆𝑘+ · · · +𝑝𝛾−1𝑆𝑘+𝛾−1+𝑝𝛾𝑆𝑘+𝛾 =0 for all𝑘≥0; (1) theorder of𝒔is the smallest such𝛾, denoted by𝛿 hereafter. A polynomial𝑝0+ · · · +𝑝𝛾𝑦𝛾 inA[𝑦]is said tocancel𝒔if𝑝0, . . . , 𝑝𝛾 satisfies Eq. (1) (without requiring that𝑝𝛾 be invertible). The set of canceling polynomials forms an ideal Ann(𝒔)inA[𝑦], called the annihilatorof𝒔. Thus𝒔is linearly recurrent of order𝛿if and only if there is a monic polynomial of degree𝛿in Ann(𝒔): such polyno- mials are calledgenerating polynomialsof𝒔. Unlike for sequences over fields, here there may be canceling polynomials of degree less than𝛿, which prevents uniqueness of generating polynomials; and
there are sequences which are not linearly recurrent but still admit a nonzero canceling polynomial (i.e. Ann(𝒔)≠{0}).
Example 2.1. ConsiderA =K[𝑥]/⟨𝑥2⟩and the sequence𝒔 = (1,1+𝑥 ,1,1+𝑥 ,1,1+𝑥 , . . .)inAN. Note that𝑥𝒔=(𝑥 , 𝑥 , 𝑥 , 𝑥 , . . .). This sequence has order𝛿=2, a generating polynomial is𝑦2−1, and a canceling polynomial of degree less than 2 is𝑥(𝑦−1). One can verify that Ann(𝒔)=⟨𝑦2−1, 𝑥(𝑦−1)⟩; in particular𝑦2+𝑥(𝑦−1) −1 is also a generating polynomial. For any sequence𝒔inKNwhich is not linearly recurrent, the sequence𝑥𝒔inANis not linearly recurrent but is canceled by𝑥, i.e.𝑥∈Ann(𝑥𝒔) \ {0}.
Like for sequences over fields, here canceling polynomials can be characterized as denominators of the (vector) generating series of the sequence, defined as𝐺𝒔=Í
𝑘≥0𝑆𝑘𝑦−𝑘−1in(A[ [𝑦−1]])𝑛. In what follows, the elements ofA[𝑦]𝑛are called polynomials, and for 𝑔=(𝑔1, . . . , 𝑔𝑛) ∈A[𝑦]𝑛we define deg(𝑔)=max1≤𝑗≤𝑛deg(𝑔𝑗).
Lemma 2.2. Let𝒔∈ S, let𝐺𝒔be its generating series, and let𝑝∈ A[𝑦]. Then,𝑝∈Ann(𝒔)if and only if the series𝑝𝐺𝒔∈ (A[ [𝑦−1]])𝑛 is a polynomial, in which casedeg(𝑝𝐺𝒔)<deg(𝑝).
In this paper, we want to compute a generating set for Ann(𝒔), for a linearly recurrent𝒔∈ S, but for algorithms we typically only have access to a finite number of terms of the sequence. Suppose we have access to the partial sequence𝒔𝑒 = (𝑆0, . . . , 𝑆𝑒−1)inS𝑒 =(A𝑛)𝑒, for some𝑒∈Z>0. Similar to Eq. (1), a polynomial𝑝0+ · · · +𝑝𝛾𝑦𝛾 of degree𝛾 <𝑒cancels𝒔𝑒if
𝑝0𝑆𝑘+ · · · +𝑝𝛾𝑆𝑘+𝛾 =0 for all 0≤𝑘<𝑒−𝛾 . (2) Like for sequences over fields, here polynomials of degree𝛾which cancel𝒔𝑒also cancel the whole sequence𝒔, provided the discrepancy between𝑒and𝛾is sufficiently large (namely,𝑒 ≥𝛾+𝛿).
Lemma 2.3. Let𝒔 ∈ Sbe linearly recurrent of order𝛿. For any
𝑒 ∈Z>0and any𝑝∈A[𝑦]withdeg(𝑝) ≤𝑒−𝛿, one has𝑝∈Ann(𝒔)
if and only if𝑝cancels𝒔𝑒.
2.2 Bivariate interpretation and generating sets
Uni-dimensional sequences of vectors inA𝑛 as above can be in- terpreted as two-dimensional sequences of vectors inK𝑛, that is, sequences𝝈 = (𝜁𝑖, 𝑗)𝑖, 𝑗≥0 in𝔖 = (K𝑛)N2. This is based on the natural injection𝜑:A[𝑦] →K[𝛼 , 𝛽]with(𝜑(𝑥), 𝜑(𝑦))=(𝛼 , 𝛽).
Here we recall from [13,33] that a polynomial𝑞=Í
𝑖, 𝑗𝑞𝑖 𝑗𝛼𝑖𝛽𝑗 inK[𝛼 , 𝛽]is said to cancel a sequence𝝈=(𝜁𝑖, 𝑗)𝑖, 𝑗≥0∈𝔖if
Í
𝑖, 𝑗𝑞𝑖 𝑗𝜁𝑖+𝑘
1, 𝑗+𝑘2=0 for all𝑘1, 𝑘2≥0.
Then, let𝒔=(𝑆0, 𝑆1, . . .) ∈ S, and define𝝈 =(𝜁𝑖, 𝑗)𝑖, 𝑗≥0∈𝔖such that𝜁𝑖, 𝑗∈K𝑛is the coefficient of degree𝑑−1−𝑖of the truncated polynomial vector𝑆𝑗 ∈A𝑛if𝑖<𝑑, and𝜁𝑖, 𝑗=0 otherwise. Then, a polynomial𝑝∈A[𝑦]cancels𝒔if and only if the polynomial𝜑(𝑝) cancels𝝈. Furthermore, the set of polynomials inK[𝛼 , 𝛽]which cancel𝝈is an ideal ofK[𝛼 , 𝛽]which contains𝛼𝑑, and this ideal is zero-dimensional if and only if𝒔is linearly recurrent.
In what follows, we define ¯𝜑(I)=⟨{𝜑(𝑝) |𝑝∈ I} ∪ {𝛼𝑑}⟩for any idealIofA[𝑦], providing a correspondence between the ideals ofA[𝑦]and those ofK[𝛼 , 𝛽]containing𝛼𝑑. For insight into possible
“nice” generating sets for Ann(𝒔), we consider the lexicographic order≼lexwith𝛼 ≼lex 𝛽, and use the fact that Gröbner bases of the ideals inK[𝛼 , 𝛽]for this order are well understood [23]. Below,
unless mentioned otherwise, we use≼lexwhen some term order is needed, e.g. leading terms and Gröbner bases.
Consider a zero-dimensional idealIinK[𝛼 , 𝛽]that contains a power of𝛼and letGbe its reduced Gröbner basis. Let
(𝛽𝑒0, 𝛼𝑑1𝛽𝑒1, . . . , 𝛼𝑑𝑡−1𝛽𝑒𝑡−1, 𝛼𝑑𝑡)
be the leading terms of the elements ofG listed in decreasing order, i.e. the𝑒𝑖’s are decreasing and the𝑑𝑖’s are increasing. We set𝑑0 =𝑒𝑡 =0, and for 1≤𝑖 ≤𝑡we set𝛿𝑖 =𝑑𝑖 −𝑑𝑖−1, so that 𝑑𝑖 =𝛿1+ · · · +𝛿𝑖. Similarly, for 0 ≤𝑖 <𝑡 we set𝜀𝑖 =𝑒𝑖 −𝑒𝑖+1. Then writeG={𝑔0, . . . , 𝑔𝑡}, with𝑔𝑖 having leading term𝛼𝑑𝑖𝛽𝑒𝑖; in particular𝑔𝑡=𝛼𝑑𝑡 =𝛼𝛿1+···+𝛿𝑡 and𝑔0is monic in𝛽.
Lazard’s Theorem states the following [23]: for 0 ≤𝑖≤𝑡 one can write𝑔𝑖 =𝛼𝑑𝑖𝑔ˆ𝑖, with ˆ𝑔𝑖monic of degree𝑒𝑖 in𝛽. In addition, for 0≤𝑖<𝑡, ˆ𝑔𝑖=𝑔𝑖/𝛼𝑑𝑖is in the ideal generated by
⟨𝑔ˆ𝑖+1, 𝛼𝛿𝑖+2𝑔ˆ𝑖+2, . . . , 𝛼𝛿𝑖+2+···+𝛿𝑡⟩= 𝑔𝑖+1
𝛼𝑑𝑖+1
, 𝑔𝑖+2 𝛼𝑑𝑖+1
, . . . , 𝑔𝑡
𝛼𝑑𝑖+1
; in particular,𝛼𝛿1divides𝑔1, . . . , 𝑔𝑡. Lazard also proved that a set of polynomials which satisfies these conditions is necessarily a minimal Gröbner basis.
With the above notation, a minimal Gröbner basis ofIhas cardi- nality𝑡+1, with𝑡 ≤min(𝑒0, 𝑑𝑡)since 0=𝑑0<𝑑1<· · ·<𝑑𝑡and 0=𝑒𝑡 <· · ·<𝑒1<𝑒0. Since for the reduced Gröbner basisGeach polynomial𝑔𝑖is represented by at most𝑒0𝑑𝑡coefficients inK, the total size ofGin terms of field elements is at most𝑒0𝑑𝑡min(𝑒0, 𝑑𝑡). Finer bounds for the cardinality and size ofGcould be given using the vector space dimension dim
K(K[𝛼 , 𝛽]/I).
2.3 Univariate and bivariate approximation
For a univariate polynomial matrix𝐹 ∈ K[𝑥]𝜇×𝜈 and a positive integer𝑑, we consider a freeK[𝑥]-module of rank𝜇defined as
A𝑑(𝐹)={𝑝∈K[𝑥]1×𝜇 |𝑝 𝐹=0 mod𝑥𝑑};
its elements are calledapproximants for𝐹at order𝑑[2,38]. Bases of such submodules can be represented as𝜇×𝜇nonsingular matrices overK[𝑥]and are usually computed in so-calledreducedforms [40]
or the corresponding canonicalPopovforms [31]. Extensions of these forms have been defined to accommodate degree weights or degree constraints, and are calledshiftedreduced or Popov forms [2, 3,38]. The algorithm PM-Basis [14] computes an approximant basis in shifted reduced form in time𝑂˜(𝜇𝜔−1(𝜇+𝜈)𝑑); using essentially two calls to this algorithm, one recovers the unique approximant basis in shifted Popov form within the same cost bound [19].
More generally, in the bivariate case with𝐹 ∈K[𝛼 , 𝛽]𝜇×𝜈and (𝑑 , 𝑒) ∈Z>0, the set
A𝑑 ,𝑒(𝐹)={𝑝∈K[𝛼 , 𝛽]1×𝜇 |𝑝 𝐹=0 mod(𝛼𝑑, 𝛽𝑒)}
is aK[𝛼 , 𝛽]-submodule ofK[𝛼 , 𝛽]1×𝜇whose elements are called approximants for𝐹at order(𝑑 , 𝑒). Such submodules are usually rep- resented by a≼-Gröbner basis for some term order≼onK[𝛼 , 𝛽]1×𝜇; for definitions of term orders and Gröbner bases for submodules we refer to [10]. For𝜈≤𝜇algorithms based on an iterative approach or on efficient linear algebra yield cost bounds in𝑂˜(𝜇(𝜈𝑑𝑒)2+ (𝜈𝑑𝑒)3) and𝑂˜(𝜇(𝜈𝑑𝑒)𝜔−1+ (𝜈𝑑𝑒)𝜔)operations inKrespectively [12,30], whereas a recent divide and conquer approach costs𝑂˜( (𝑀𝜔+ 𝑀2𝜈)𝑑𝑒), where𝑀=𝜇min(𝑑 , 𝑒)[28, Prop. 5.5]; in these cases the output is a minimal Gröbner basis.
3 KURAKIN’S ALGORITHM
In [20], Kurakin gives an algorithm based on the Berlekamp-Massey algorithm that computes the annihilators of a partial sequence over a ring𝑅(and modules over𝑅) that can be decomposed as a disjoint union𝑅={0} ∪𝑅0∪ · · · ∪𝑅𝑑−1where
𝑅𝑖={𝑟𝑖𝑟∗|𝑟∗∈𝑅invertible}for some𝑟𝑖 ∈𝑅 .
In this paper we consider𝑅 = A = K[𝑥]/⟨𝑥𝑑⟩; in this case the canonical choice is𝑟𝑖 =𝑥𝑖, with
𝑅𝑖 ={𝑥𝑖𝑝∗|𝑝∗∈Awith nonzero constant term}. Consider a partial sequence𝒔𝑒 ∈ S𝑒 of a linearly recurrent 𝒔 ∈ Sof order𝛿. Kurakin’s algorithm computes𝑑polynomials 𝑃𝑖 ∈A[𝑦],𝑖=0, . . . , 𝑑−1, such that𝑃𝑖is a canceling polynomial of 𝒔𝑒that has leading coefficient𝑥𝑖and is minimal in degree among all canceling polynomials with leading coefficient𝑥𝑖. Furthermore, one has Ann(𝒔)=⟨𝑃0, . . . , 𝑃𝑑−1⟩provided𝑒 ≥2𝛿[21, Thm. 1].
We first define three operations on sequences. Given a partial sequence𝒔𝑒and𝑐∈A,𝑐·𝒔𝑒denotes multiplying𝑐to every element in𝒔𝑒, while𝑦𝑗·𝒔𝑒denotes a shift of𝑗elements — that is, removing the first𝑗 elements. Given another partial sequence ˆ𝒔𝑒ˆ, the sum 𝒔𝑒+𝒔ˆ𝑒ˆreturns the first min(𝑒,𝑒ˆ)elements of the two sequences added together element-wise.
Kurakin’s algorithm iterates on𝑠=0, . . . , 𝑒−1, keeping track of polynomials𝑃𝑖,𝑠as well as partial sequences𝒔𝑒,𝑖,𝑠 =𝑃𝑖,𝑠·𝒔𝑒= Í𝑒−𝑠
𝑗=0𝑃𝑖,𝑠[𝑗] ·𝑦𝑗·𝒔𝑒, where𝑃𝑖,𝑠[𝑗]is the𝑗-th coefficient of𝑃𝑖,𝑠. An invariant is that the leading coefficient of𝑃𝑖,𝑠is𝑥𝑖for all𝑠. For each 𝑠=0, . . . , 𝑒−1, the algorithm essentially attempts to either create a zero by using the partial sequences from previous iterations with equal number of leading zeros (similar to Gaussian elimination), or shift the sequence if we cannot cancel this element.
At each iteration𝑠, letI [𝑘]be theA-submodule ofA𝑛generated by the elements𝒔𝑒,𝑖,𝑠′[𝑘]for all𝑖 = 0, . . . , 𝑑−1 and𝑠′ <𝑠such that𝒔𝑒,𝑖,𝑠′has𝑘leading zeros. Furthermore, letP [𝑘 , 𝑗]andS [𝑘 , 𝑗] be the corresponding polynomial and partial sequence to the𝑗-th element in the basis ofI [𝑘],I [𝑘 , 𝑗]. At iteration𝑠, if𝒔𝑒,𝑖,𝑠 has𝑘 leading zeros and𝒔𝑒,𝑖,𝑠[𝑘] ∈ I [𝑘], then we can find coefficients such that𝒔𝑒,𝑖,𝑠[𝑘] −Í
𝑗𝑐𝑗I [𝑘 , 𝑗]=0 and𝒔𝑒,𝑖,𝑠−Í
𝑗𝑐𝑗S [𝑘 , 𝑗]results in a sequence with at least𝑘+1 zeros since both sequences had𝑘 leading zeros and we canceled𝒔𝑒,𝑖,𝑠[𝑘]. The algorithm terminates when all𝒔𝑒,𝑖,𝑠 =0 (see Algorithm1).
We track the subiterations by the index𝑡for analysis; this does not play a role in the algorithm. Kurakin shows that the total num- ber of subiterations across all𝑠is𝑂(𝑒)per polynomial, bringing the total to𝑂(𝑒𝑑)([20, Thm. 2]). However, the analysis of the runtime in [20] treats all ring operations (including computing solution to line12of Algorithm1) as constant time operations, which is unrealistic overA𝑛. Thus, we will give a cost analysis in terms of number of field operations overK.
We note that, sinceA𝑛is a freeK[𝑥]-module of rank𝑛(with a basis given by the canonical vectors of length𝑛) andK[𝑥]is a principal ideal domain, any of itsK[𝑥]-submodule is free of rank at most𝑛. As a consequence, the number of generators ofI [𝑘]is at most𝑛. This will allow us to bound the cost for solving submodule membership as well as the equation𝒔𝑒,𝑠,𝑖(𝑡) [𝑘] −Í
𝑗𝑐𝑗I [𝑘 , 𝑗]=0.
Algorithm 1Kurakin(𝒔𝑒) Input: partial sequence𝒔𝑒
Output: minimal canceling polynomials of𝒔𝑒 1: for𝑖=0, . . . , 𝑑−1do
2: set𝑃𝑖,0=𝑥𝑖and𝒔𝑒,𝑖,0=𝑥𝑖𝒔𝑒
3: set𝑘to be index of first non-zero element of𝒔𝑒,𝑖,0 4: if𝒔𝑒,𝑖,0[𝑘]≠0then
5: add𝒔𝑒,𝑖,0[𝑘], 𝑃𝑖,0,𝒔𝑒,𝑖,0toI [𝑘],P [𝑘],S [𝑘]resp.
6: for𝑠=1, . . . , 𝑒−1do
7: for𝑖=0, . . . 𝑑−1do
8: set𝑡=0;𝑃(𝑡)
𝑖,𝑠 =𝑦𝑃𝑖,𝑠−1; and shift𝒔𝑒,𝑖,𝑠(𝑡) =𝑦·𝒔𝑒,𝑖,𝑠−1 9: if𝒔𝑒,𝑖,𝑠(𝑡) =0thencontinue to next𝑖
10: set𝑘to be the first non-zero index of𝒔𝑒,𝑖,𝑠(𝑡)
11: if𝒔𝑒,𝑖,𝑠(𝑡) [𝑘]∉I [𝑘]thencontinue to next𝑖
12: solve for𝑐𝑗’s such that𝒔𝑒,𝑠,𝑖(𝑡) [𝑘] −Í
𝑗𝑐𝑗I [𝑘 , 𝑗]=0
13: set𝒔𝑒,𝑖,𝑠(𝑡+1)=𝒔𝑒,𝑖,𝑠(𝑡) −Í
𝑗𝑐𝑗S [𝑘 , 𝑗]
14: set𝑃(𝑡+1)
𝑖,𝑠 =𝑃(𝑡)
𝑖,𝑠 −Í
𝑗𝑐𝑗P [𝑘 , 𝑗]
15: go to line9with𝑡=𝑡+1
16: for𝑖=0, . . . , 𝑑−1do
17: set𝑠𝑒,𝑖,𝑠=𝑠(𝑡)
𝑒,𝑖,𝑠and𝑃𝑖,𝑠 =𝑃(𝑡)
𝑖,𝑠
18: set𝑘to be the index of first non-zero element of𝑠𝑒,𝑖,𝑠
19: if𝑠𝑒,𝑖,𝑠[𝑘]∉I [𝑘]then
20: add𝒔𝑒,𝑖,𝑠[𝑘], 𝑃𝑖,𝑠,𝒔𝑒,𝑖,𝑠toI [𝑘],P [𝑘],S [𝑘]resp.
21: reduce the basis ofI [𝑘]if needed
22: for𝑖=0, . . . , 𝑑−1do
23: return𝑃𝑖,𝑠that makes𝒔𝑒,𝑖,𝑠 =0 for the first time
We can check membership𝑠𝑒,𝑖,𝑠[𝑘] ∈ I [𝑘]and solve𝑠𝑒,𝑠,𝑖[𝑘] − Í𝑐𝑗I [𝑘 , 𝑗]=0 by finding the right approximant basis of
𝐹=
I [𝑘 ,0] · · · I [𝑘 , 𝑛−1] 𝑠𝑒,𝑠,𝑖[𝑘]
in Popov form. Since𝐹has𝑛rows and at most𝑛+1 columns, we can compute this in cost𝑂˜(𝑛𝜔𝑑)[19]. The reduction in line21can be computed by the same approximant basis: if𝐹has𝑛+1 columns, there is a column in the approximant basis such that at least one entry has a nonzero constant term. By removing the corresponding I [𝑘 , 𝑗], we get a basis ofI [𝑘]of size𝑛.
At lines13and14,𝑆[𝑘 , 𝑗]and𝑃[𝑘 , 𝑗]have length and degree at most𝑒resp., making the cost of these lines𝑂˜(𝑛(𝑛𝑒𝑑))=𝑂˜(𝑛2𝑒𝑑). Finally, using the fact that the total number of subiterations is bounded by𝑂(𝑒𝑑), we arrive at the total cost𝑂˜(𝑒𝑑(𝑛2𝑒𝑑+𝑛𝜔𝑑)). We conclude by showing that the output of Algorithm1is indeed a basis of Ann(𝒔)and that it forms a lexicographical Gröbner basis.
Theorem 3.1. For each𝑖∈ {0, . . . , 𝑑−1}, let𝑃𝑖be a canceling polynomial of𝒔with leading coefficient𝑥𝑖that is minimal in degree among all polynomials with leading coefficient𝑥𝑖. Then one has Ann(𝒔) = ⟨𝑃0, . . . , 𝑃𝑑−1⟩. Furthermore,{𝜑(𝑃0),· · ·, 𝜑(𝑃𝑑−1), 𝛼𝑑} forms a Gröbner basis of𝜑¯(Ann(𝒔))with respect to the lexicographic term order with𝛼≼lex𝛽.
Proof. Suppose that there exists some𝑄∈A[𝑦]with leading coefficient𝑥𝑡 that is in Ann(𝒔)but𝑄 ∉ ⟨𝑃0, . . . , 𝑃𝑑−1⟩. Note that for any polynomial inA[𝑦], we can always make the leading coef- ficient to be some𝑥𝑡by pulling out the minimal power of𝑥from
the leading coefficient and multiplying by its inverse. Now, since we assumed minimality of degrees for𝑃𝑖’s, deg(𝑄) >deg(𝑃𝑡)and 𝑄′=𝑄−𝑦deg𝑄−deg𝑃𝑡𝑃𝑡 ∈Ann(𝒔)has degree less than𝑄. By nor- malizing the leading coefficient of𝑄′to be some𝑥𝑡
′
, we can repeat the same process and keep decreasing the degree. This process must terminate when we encounter some𝑄′with leading coefficient𝑥𝑡
′
such that deg𝑄′<deg𝑃𝑡′, or𝑄′=0. Both cases lead to contradic- tions; thus, such𝑄cannot exist and Ann(𝒔)=⟨𝑃0, . . . , 𝑃𝑑−1⟩.
Next, letG = {𝑔0, . . . , 𝑔𝑘},𝑔𝑖 ∈ K[𝛼 , 𝛽] with leading coeffi- cient𝑥𝑑𝑖, be the minimal reduced (lexicographic) Gröbner basis of ¯𝜑(Ann(𝒔)). We can turnGinto another non-minimal Gröbner basis by adding the polynomials𝑎𝑐𝑔𝑖, for𝑐 =1, . . . , 𝑑𝑖+1−1; we define the resulting basis asG′={𝑔′
0,· · ·, 𝑔′
𝑑}, with𝑔′
𝑑=𝛼𝑑and each𝑔′
𝑖has leading term𝛼𝑖𝛽𝑟𝑖. Furthermore, define𝑢𝑖as the degree of𝑃𝑖such that𝜑(𝑃𝑖)has leading term𝛼𝑖𝛽𝑢𝑖.
For𝑖=0, . . . , 𝑑, we have that𝑢𝑖 ≥𝑟𝑖, otherwiseG′would not reduce𝜑(𝑃𝑖)to zero, whichG′must since𝜑(𝑃𝑖) ∈𝜑¯(Ann(𝒔)). We also have that𝑢𝑖 ≤𝑟𝑖 due to the assumed minimality of degree for 𝑃𝑖’s. Thus, the leading terms of{𝜑(𝑃0), . . . , 𝜑(𝑃𝑑−1), 𝛼𝑑}generate
the leading terms of ¯𝜑(Ann(𝒔)). □
4 LAZY ALGORITHM BASED ON KURAKIN’S
Kurakin’s algorithm requires that we keep track of all𝑑possible generators, regardless of the actual number of generators needed.
For example, consider𝒔 = (1,1,2,3,5, . . .) ∈ ANwith Ann(𝒔) =
⟨𝑦2−𝑦−1⟩: Kurakin’s algorithm returns{𝑥𝑖(𝑦2−𝑦−1),0≤𝑖<𝑑}. In this section, we outline a modified version of Kurakin’s algorithm that attempts to avoid as many extraneous computations as possible.
In the previous example, we can see that the polynomials asso- ciated with𝑥𝑖,𝑖≥1, were not useful. The next definition aims to qualify precisely the usefulness of the monomial𝑥𝑖.
Definition 4.1. Let𝑃𝑖,𝑠and𝒔𝑒,𝑖,𝑠be the polynomial and sequence at the end of step𝑠associated with monomial𝑥𝑖. A monomial𝑥𝑖2 isusefulwrt to𝑥𝑖1,𝑖1<𝑖2, at step𝑠if at least one of two conditions is true at the end of𝑠:
U1. 𝑃𝑖
2,𝑠≠𝑥𝑖2−𝑖1𝑃𝑖
1,𝑠
U2. let𝑘𝑖
1and𝑘𝑖
2be the index of the first non-zero element of 𝒔𝑒,𝑖1,𝑠and𝒔𝑒,𝑖2,𝑠resp., then𝑘𝑖
1≠𝑘𝑖
2
Suppose a monomial𝑥𝑖2is not useful wrt𝑥𝑖1at step𝑠, then by negating condition U1, we have𝑃𝑖
2,𝑠=𝑥𝑖2−𝑖1𝑃𝑖
1,𝑠. Due to negation of U2,𝒔𝑒,𝑖2,𝑠is the zero sequence if and only if𝒔𝑒,𝑖1,𝑠is the zero se- quence; so either we return𝑃𝑖
2,𝑠=𝑥𝑡2−𝑡1𝑃𝑖
1,𝑠or we do not terminate at this step for both monomials. Finally, since𝑘𝑖
1=𝑘𝑖
2and𝒔𝑒,𝑖2,𝑠= 𝑥𝑖2−𝑖1𝒔𝑒,𝑖1,𝑠, we always have that𝒔𝑒,𝑖2,𝑠[𝑘𝑖
2] =𝑥𝑖2−𝑖1𝒔𝑒,𝑖1,𝑠[𝑘𝑖
1] ∈
⟨𝒔𝑒,𝑖1,𝑠[𝑘𝑖
1]⟩ ∪ I [𝑘𝑖
1]
, meaning we can safely ignore𝒔𝑒,𝑖2,𝑠[𝑘𝑖
2] when updatingI [𝑘𝑖
2]at the end of step𝑠. Thus, the negation of usefulness conditions U1 and U2 implies that any computation associated with𝑥𝑖2is not needed at step𝑠.
However, as defined, U1 and U2 do not impose any conditions about the subiterations (indexed by𝑡). The next lemma gives a different characterization of the usefulness conditions in terms of𝑡.
Lemma 4.2. If𝑥𝑖2is useful wrt to𝑥𝑖1at some step𝑠, then at some subiteration𝑡of step𝑠, one of u1, u2, u3 is true at the start of𝑡:
u1. 𝑃(𝑡)
𝑖2,𝑠≠𝑥𝑖2−𝑖1𝑃(𝑡)
𝑖1,𝑠
u2. if𝑃(𝑡)
𝑖2,𝑠=𝑥𝑖2−𝑖1𝑃(𝑡)
𝑖1,𝑠
, then𝑘(𝑡)
𝑖2 ≠𝑘(𝑡)
𝑖1
u3. if𝑃(𝑡)
𝑖2,𝑠 = 𝑥𝑖2−𝑖1𝑃(𝑡)
𝑖1,𝑠 and𝑘(𝑡)
𝑖2 = 𝑘(𝑡)
𝑖1 , then𝒔𝑒,𝑖(𝑡)1,𝑠[𝑘(𝑡)
𝑖1 ] ∉ I [𝑘(𝑡)
𝑖1 ]and𝑠(𝑡)
𝑒,𝑖2,𝑠[𝑘(𝑡)
𝑖1 ] ∈ I [𝑘(𝑡)
𝑖1 ]
Proof. We prove that if u1, u2, and u3 are false for every subit- eration𝑡and𝑠, then U1 and U2 are false for𝑥𝑖2wrt𝑥𝑖1. Suppose the conditions u1, u2, and u3 are all false for every subiteration𝑡at𝑠.
The negation of u1 forces𝑃(𝑡)
𝑖2,𝑠=𝑥𝑖2−𝑖1𝑃(𝑡)
𝑖1,𝑠at the start of𝑡, which sets the hypothesis of u2 true, implying𝑘(𝑡)
𝑖2 =𝑘(𝑡)
𝑖1
. Finally, since the hypothesis of u3 holds, we must have𝑠(𝑡)
𝑒,𝑖1,𝑠[𝑘(𝑡)
𝑖1 ] ∈ I [𝑘(𝑡)
𝑖1 ] or𝑠(𝑡)
𝑒,𝑖2,𝑠[𝑘(𝑡)
𝑖1 ] ∉ I [𝑘(𝑡)
𝑖1 ]. The two are mutually exclusive since 𝒔𝑒,𝑖(𝑡)
2,𝑠 =𝑥𝑖2−𝑖1𝒔𝑒,𝑖(𝑡)
1,𝑠, if𝑠(𝑡)
𝑒,𝑖1,𝑠[𝑘(𝑡)
𝑖1 ] ∈ I [𝑘(𝑡)
𝑖1 ], then𝑠(𝑡)
𝑒,𝑖2,𝑠[𝑘(𝑡)
𝑖1 ] ∈ I [𝑘(𝑡)
𝑖1 ]. When𝑠(𝑡)
𝑒,𝑖1,𝑠[𝑘(𝑡)
𝑖1 ] ∈ I [𝑘(𝑡)
𝑖1 ], we can update 𝑃(𝑡+1)
𝑖1,𝑠 =𝑃(𝑡)
𝑖1,𝑠−Õ 𝑐𝑗I [𝑘(𝑡)
𝑖1
, 𝑗] 𝑃(𝑡+1)
𝑖2,𝑠 =𝑥𝑖2−𝑖1𝑃(𝑡)
𝑖1,𝑠−𝑥𝑖2−𝑖1 Õ
𝑐𝑗P [𝑘(𝑡)
𝑖1 , 𝑗]=𝑥𝑖2−𝑖1𝑃(𝑡+1)
𝑖1,𝑠 ,
which was already implied by the assumption that u1 is false for all𝑡. On the other hand, when𝑠(𝑡)
𝑒,𝑖2,𝑠[𝑘(𝑡)
𝑖1 ]∉I [𝑘(𝑡)
𝑖1 ], we also have 𝒔𝑒,𝑖(𝑡)
1,𝑠[𝑘(𝑡)
𝑖1 ]∉I [𝑘(𝑡)
𝑖1 ], so the subiterations terminate and we must have𝑃𝑖
2,𝑠=𝑥𝑖2−𝑖1𝑃𝑖
1,𝑠with𝑘𝑖
2=𝑘𝑖
1
. This implies U1 and U2 also
do not hold for step𝑠. □
While the converse is not true, we say a monomial𝑥𝑖2ispoten- tially usefulwrt𝑥𝑖1when at some step𝑠and subiteration𝑡, at least one of the conditions u1, u2, and u3 holds. Rather than iterating through𝑖=0, . . . , 𝑑−1, we keep a list of potentially useful mono- mialsUand iterate through𝑖∈ U, withU=[0]initially. At each subiteration, we check to see if there exists𝑖′>𝑖, 𝑖′∉Usuch that 𝑥𝑖
′
satisfies one of u2 or u3, and add the smallest such𝑖′toU. Note that we need not check u1 since if u1 holds, then either u2 or u3 must have been true at some previous subiteration, thus𝑖′is already included inU. Condition u2 can be checked in𝑂(𝑛)by checking the valuations of all entries in𝒔𝑒,𝑖,𝑠[𝑘]at lines4and10. Condition u3 can be checked in𝑂(log𝑑)membership computations via a bi- nary search to find the minimal𝑖′such that𝑥𝑖
′−𝑖
𝒔𝑒,𝑖,𝑠[𝑘] ∈ I [𝑘] when𝒔𝑒,𝑖,𝑠[𝑘]∉I [𝑘]on line11. Thus, the complexity for the subit- erations do not change in terms of𝑂˜(·). Defining𝑑∗ =|U | ≤𝑑, this brings the total cost to𝑂˜(𝑒𝑑∗(𝑛2𝑒𝑑+𝑛𝜔𝑑)). While we do not know how far𝑑∗is from the number𝑑optof polynomials in the min- imal lexicographic Gröbner basis of ¯𝜑(Ann(𝒔)), we have observed empirically that𝑑∗is often equal or close to𝑑opt(see Section7).
5 VIA UNIVARIATE APPROXIMANT BASES 5.1 Approximants of a wide Hankel matrix
Extending the classical theory of linearly recurrent sequences over the fieldK, another approach is to consider the left kernel of the block-Hankel matrix
𝐻𝒔,𝑒=
𝑆0 𝑆1 · · · 𝑆𝑒−1 𝑆1 𝑆2 ...
𝑆𝑒 ..
. ...
... . . . 𝑆𝑒 𝑆𝑒+1 · · · 𝑆2𝑒−1
∈A(𝑒+1)×(𝑒𝑛).
Indeed, if𝑒is large enough, vectors in this kernel represent poly- nomials which cancel𝒔, and which even generate all of Ann(𝒔).
Lemma 5.1. Let𝒔∈ Sbe linearly recurrent of order𝛿, and define K𝒔,𝑒={𝑝=𝑝0+ · · · +𝑝𝑒𝑦𝑒 ∈A[𝑦] | [𝑝0 · · · 𝑝𝑒]𝐻𝒔,𝑒=0} for𝑒 ∈ N. Assume𝑒 ≥𝛿. ThenK𝒔,𝑒 =Ann(𝒔) ∩A[𝑦]≤𝑒, and in particularK𝒔,𝑒is a generating set ofAnn(𝒔).
Proof. Let𝑝=𝑝0+ · · · +𝑝𝑒𝑦𝑒∈A[𝑦]and𝛾 =deg(𝑝) ≤𝑒. Then 𝑝∈ K𝒔,𝑒if and only if[𝑝0 · · · 𝑝𝑒]𝐻𝒔,𝑒 =0, and by definition of canceling partial sequences this exactly means that𝑝cancels𝒔𝑒+𝛾. Now, deg(𝑝) =𝛾 ≤𝑒+𝛾−𝛿holds under the assumption𝑒 ≥𝛿, hence𝑝cancels𝒔𝑒+𝛾 if and only if𝑝 ∈Ann(𝒔)by Lemma2.3. It follows thatK𝒔,𝑒generates Ann(𝒔), since there exists a generating set of Ann(𝒔)whose polynomials all have degree at most𝛿. □ Computing the left kernel of𝐻𝒔,𝑒can be done via univariate ap- proximation. Indeed, calling𝐹 ∈K[𝑥](𝑒+1)×(𝑒𝑛)the natural lifting of𝐻𝒔,𝑒, an approximant basis of𝐹 at order𝑑gives a generating set of that left kernel. As recalled in Section2.3, using PM-Basis, a basis ofA𝑑(𝐹)in shifted reduced or Popov form can be computed in𝑂˜(𝑒𝜔−1(𝑒+𝑒𝑛)𝑑)=𝑂˜(𝑒𝜔𝑛𝑑)operations inK.
5.2 Speed-up by compression using structure
Now we show that, when𝑛is large, one can speed up the above ap- proach by a randomized “compression” of the matrix𝐻𝒔,𝑒. Precisely, taking a random constant matrix𝐶 ∈K(𝑒𝑛)×(𝑒+1)and performing the right-multiplication𝐹 𝐶, one obtains a square(𝑒+1) × (𝑒+1) matrix such thatA𝑑(𝐹) =A𝑑(𝐹 𝐶)holds with good probability.
The cost of the approximant basis computation is thus reduced to 𝑂˜(𝑒𝜔𝑑)operations inK, and the right-multiplication can be done efficiently by leveraging the block-Hankel structure of𝐹.
Theorem 5.2. Algorithm2takes as input an integer𝑑 ∈ Z>0, vectors𝐹0, . . . , 𝐹𝜇+𝑒−2 ∈K[𝑥]1×𝑛of degree less than𝑑, and a shift 𝑤 ∈ Z
𝜇
>0, and uses𝑂˜(𝜇𝑒𝑛𝑑+𝜇𝜔𝑑)operations inKto compute a
𝑤-Popov matrix𝑃∈K[𝑥]𝜇×𝜇of degree at most𝑑. It chooses at most 𝜇𝑒𝑛elements independently and uniformly at random from a subset ofKof cardinality𝜅, and𝑃 is the𝑤-Popov basis of A𝑑(𝐹) with probability at least1−𝜇𝜅, where𝐹is the block-Hankel matrix
𝐹 =
𝐹0 𝐹1 · · · 𝐹𝑒−1 𝐹1 𝐹2 ...
𝐹𝑒 ..
. ...
... . . . 𝐹𝜇−1 𝐹𝜇 · · · 𝐹𝜇+𝑒−2
∈K[𝑥]𝜇×(𝑒𝑛). (3)
When applied to the computation of Ann(𝒔)with𝜇=𝑒+1, the cost becomes𝑂˜(𝑒2𝑛𝑑+𝑒𝜔𝑑). Below we focus on the case of interest 𝜇≤𝑒𝑛, since when𝑒𝑛∈𝑂(𝜇)this𝑤-Popov approximant basis is computed deterministically by PM-Basis at a cost of𝑂˜(𝜇𝜔𝑑)oper- ations inK. Our approach is based on the following two lemmas.
Lemma 5.3. Let𝐹 ∈K[𝑥]𝜇×𝜈and𝑑∈Z>0. Let𝐶∈K[𝑥]𝜈×𝑟 and 𝐾 ∈ K[𝑥]𝜈×(𝜈−𝑟), for some𝑟 ∈ {0, . . . , 𝜈}, such that𝐹 𝐾 =0and [𝐶(0) 𝐾(0)] ∈K𝜈×𝜈is invertible. Then,𝑟≥𝜌where𝜌is the rank of𝐹, andA𝑑(𝐹)=A𝑑(𝐹 𝐶).
Proof. Let𝑁 =[𝐶 𝐾] ∈K[𝑥]𝜈×𝜈. The assumption that𝑁(0) is invertible ensures that𝑁 is nonsingular (since det(𝑁) (0) = det(𝑁(0))≠0), and therefore𝐾has full rank𝜈−𝑟. The assumption that the columns of𝐾are in the right kernel of𝐹, which has rank 𝜈−𝜌, implies that𝜈−𝑟 ≤𝜈−𝜌and therefore𝑟≥𝜌.
The inclusionA𝑑(𝐹) ⊂ A𝑑(𝐹 𝐶)is obvious. For the other in- clusion, let𝑝 ∈ A𝑑(𝐹 𝐶), i.e. there exists𝑞 ∈ K[𝑥]1×𝑟 such that 𝑝 𝐹 𝐶=𝑥𝑑𝑞. It follows that𝑝 𝐹 𝑁=𝑥𝑑[𝑞 0], and thus
𝑝 𝐹=𝑥𝑑[𝑞 0]𝑁−1= 𝑥𝑑[𝑞 0]Adj(𝑁) det(𝑁)
where Adj(𝑁) ∈ K[𝑥]𝜈×𝜈 is the adjugate of𝑁. Our assumption det(𝑁) (0) ≠ 0 means that 𝑥𝑑 and det(𝑁) are coprime, hence det(𝑁)divides[𝑞 0]Adj(𝑁), and𝑝 𝐹=0 mod𝑥𝑑follows. □ Lemma 5.4. Let𝐹 ∈K[𝑥]𝜇×𝜈with rank𝜌and𝜇≤𝜈, and let𝑟 ∈ {𝜌 , . . . , 𝜇}. LetRbe a finite subset ofKof cardinality𝜅∈Z>0, and let 𝐶∈K𝜈×𝑟with entries chosen independently and uniformly at random fromR. Then, the probability that there exists𝐾∈K[𝑥]𝜈×(𝜈−𝑟)such that[𝐶 𝐾(0)]is invertible and𝐹 𝐾=0is at least1−𝑟𝜅; furthermore ifKis finite andR=K, this probability is at leastÎ𝑟
𝑖=1(1−𝜅−𝑖). Proof. Consider a right kernel basis𝐵 ∈ K[𝑥]𝜈×(𝜈−𝜌) for𝐹. Then𝐵 has unimodular row bases [41, Lem. 3.1], implying that there exists𝑉 ∈K[𝑥](𝜈−𝜌)×𝜈 such that𝑉 𝐵=𝐼𝜈−𝜌. In particular 𝑉(0)𝐵(0) = 𝐼𝜈−𝜌 and therefore𝐵(0)has full rank𝜈−𝜌. Define 𝐾∈K[𝑥]𝜈×(𝜈−𝑟)as the matrix formed by the first𝜈−𝑟columns of 𝐵(recall𝜈−𝑟≤𝜈−𝜌by assumption). Then𝐹 𝐾=0. Furthermore 𝐾(0)has rank𝜈−𝑟, hence the DeMillo-Lipton-Schwartz-Zippel lemma implies that[𝐶 𝐾(0)] ∈K𝜈×𝜈is singular with probability at most𝑟/𝜅[11,36,42]. IfKis finite andR=Kthen[𝐶 𝐾(0)]is invertible with probability exactlyÎ𝑟
𝑖=1(1−𝜅−𝑖). □
These lemmas lead to Algorithm2and Theorem5.2; indeed computing𝐹 𝐶has quasi-linear cost𝑂˜(𝜇𝑒𝑛𝑑)thanks to the block- Hankel structure of𝐹, and then the call PM-Basis(𝑑 , 𝐹 𝐶, 𝑤)costs 𝑂˜(𝜇𝜔𝑑)operations as recalled in Section2.3.
Algorithm 2Hankel-PM-Basis(𝑑 , 𝐹 , 𝑤)
Input: integers𝑑 , 𝜇, 𝑒, 𝑛∈Z>0, vectors𝐹0, . . . , 𝐹𝜇+𝑒−2∈K[𝑥]1×𝑛 of degree less than𝑑, a shift𝑤∈Z
𝜇
>0
Output: a𝑤-Popov matrix𝑃∈K[𝑥]𝜇×𝜇of degree at most𝑑
1: 𝐹∈K[𝑥]𝜇×(𝑒𝑛)←form the block-Hankel matrix as in Eq. (3)
2: if𝜇≥𝑒𝑛then returnPM-Basis(𝑑 , 𝐹 , 𝑤)
3: Choose𝑟 ∈ {𝜌 , . . . , 𝜇}where𝜌 is the rank of𝐹 (by default, choose𝑟=𝜇if no information is known on𝜌)
4: Fill a matrix𝐶 ∈K(𝑒𝑛)×𝑟 with entries chosen uniformly and independently at random from a subset ofKof cardinality𝜅
5: Compute𝐹 𝐶∈K[𝑥]𝜇×𝑟(exploiting the Hankel structure of𝐹)
6: returnPM-Basis(𝑑 , 𝐹 𝐶, 𝑤)
Note that 1−𝑟/𝜅≥3/4 as soon as𝜅≥4𝜇(which implies𝜅≥4𝑟);
furthermoreÎ𝑟
𝑖=1(1−𝜅−𝑖) ≥3/4 already for𝜅=7. The random- ization is of the Monte Carlo type, since the algorithm may return 𝑃which is not a basis ofA𝑑(𝐹). Still, since the expected𝑤-Popov basis𝑃ofA𝑑(𝐹)is unique, one can easily increase the probability of success by repeating the randomized computation and following
a majority rule. Another approach is to rely on the non-interactive, Monte Carlo certification protocol of [15], which has lower cost than Algorithm2but requires a larger fieldK; this first asks to compute the coefficient of degree𝑑of𝑃 𝐹, which here can be done via bivariate polynomial multiplication in time𝑂˜(𝜇𝑒𝑛𝑑)thanks to the structure of𝐹. For a given output𝑃, this certification can be repeated for better confidence in𝑃(in which case the coefficient of degree𝑑of𝑃 𝐹needs only be computed once).
6 VIA BIVARIATE PADÉ APPROXIMATION
Now, we propose another approach which directly uses the inter- pretation of canceling polynomials as denominators of the gen- erating series of the sequence (see Lemma2.2). The next lemma describes more precisely the link between the annihilator and these denominators when we have access to a partial sequence, that is, denominators of the generating series truncated at some order.
One can also view this lemma as a description of the kernel of the univariate Hankel matrix𝐻𝒔,𝑒via bivariate Padé approximation.
Lemma 6.1. Let𝒔 ∈ Sbe linearly recurrent of order𝛿, and for 𝑒 ∈Ndefine𝐺=Í
𝑗<2𝑒𝑆𝑗𝑦2𝑒−1−𝑗 ∈A[𝑦]𝑛and
P𝒔,𝑒={𝑝∈A[𝑦]≤𝑒 |𝑝𝐺=𝑞mod𝑦2𝑒for some𝑞∈A[𝑦]<𝑒𝑛 }. Assume𝑒 ≥ 𝛿. ThenP𝒔,𝑒 =Ann(𝒔) ∩A[𝑦]≤𝑒, and in particular P𝒔,𝑒is a generating set ofAnn(𝒔); furthermore for any𝑝∈ P𝒔,𝑒the corresponding𝑞∈A[𝑦]𝑛<𝑒satisfiesdeg(𝑞)<deg(𝑝).
Proof. Let𝑝=𝑝0+· · ·+𝑝𝛾𝑦𝛾 ∈A[𝑦]≤𝑒where𝛾=deg(𝑝). Then 𝑝∈ P𝒔,𝑒if and only if the coefficient of𝑝𝐺of degree 2𝑒−1−𝑘is zero for 0≤𝑘<𝑒. Since𝛾≤𝑒 ≤2𝑒−1−𝑘, this coefficient is
Coeff(𝑝𝐺 ,2𝑒−1−𝑘)=
𝛾
Õ
𝑖=0
𝑝𝑖𝑆2𝑒−1−(2𝑒−1−𝑘−𝑖)=
𝛾
Õ
𝑖=0
𝑝𝑖𝑆𝑘+𝑖 =0.
Thus we have provedP𝒔,𝑒 =K𝒔,𝑒, and Lemma5.1shows the claims in this lemma except the last one. Let𝑝∈ P𝒔,𝑒and define𝑞as the polynomial inA[𝑦]𝑛<𝑒such that𝑝𝐺=𝑞mod𝑦2𝑒. Since𝑝∈Ann(𝒔), Lemma2.2shows that𝑝𝐺𝒔is a polynomial. On the other hand the definitions of𝐺and𝐺𝒔yield𝑝𝐺 =𝑦2𝑒𝑝𝐺𝒔−𝑝Í
𝑗≥2𝑒𝑆𝑗𝑦2𝑒−1−𝑗. Hence−𝑝Í
𝑗≥2𝑒𝑆𝑗𝑦2𝑒−1−𝑗is a polynomial, and since it has degree less than𝛾, and thus in particular less than 2𝑒, it is equal to𝑞. □ From𝐺, define𝐹 ∈ K[𝛼 , 𝛽]1×𝑛 of bi-degree less than(𝑑 ,2𝑒) via the morphism𝜑from Section2.2. EquipK[𝛼 , 𝛽]with the lex- icographic order≼lex, and let≼be the corresponding term over position order onK[𝛼 , 𝛽]𝑛+1. Then a minimal≼-Gröbner basis of the submodule of simultaneous Padé approximants
{(𝑝, 𝑞) ∈K[𝛼 , 𝛽] ×K[𝛼 , 𝛽]1×𝑛 |𝑝 𝐹=𝑞mod(𝑥𝑑, 𝑦2𝑒)}
is computed in𝑂˜( (𝑛𝜔min(𝑑 , 𝑒)𝜔+𝑛3min(𝑑 , 𝑒)2)𝑑𝑒)operations, using the algorithm of [28] (see also Section2.3) with input matrix of size(𝑛+1) ×𝑛formed by stacking the identity𝐼𝑛 below𝐹.
Lemma6.1shows that from this≼-Gröbner basis one can find a minimal≼lex-Gröbner basis of ¯𝜑(Ann(𝒔))by selecting𝑝for each (𝑝, 𝑞)in the basis such that deg
𝛽(𝑞) <deg
𝛽(𝑝).
While the PM-Basis approach had cost quasi-linear in𝑑and𝑛, the method here is most efficient in an opposite parameter range:
for𝑛∈𝑂(1)and𝑑≤𝑒the above cost bound becomes𝑂˜(𝑑𝜔+1𝑒).