domain: math info

text:
Boris Adamczewski

Alin Bostan
email: alin.bostan@inria.fr

Xavier Caruso
email: xavier@caruso.ovh

A SHARPER MULTIVARIATE CHRISTOL'S THEOREM WITH APPLICATIONS TO DIAGONALS AND HADAMARD PRODUCTS

Keywords: Christol's theorem, automatic sequences, algebraic power series, diagonals, Hadamard products

We provide a new proof of the multivariate version of Christol's theorem about algebraic power series with coefficients in finite fields, as well as of its extension to perfect ground fields of positive characteristic obtained independently by Denef and Lipshitz, Sharif and Woodcok, and Harase. Our proof is elementary, effective, and allows for much sharper estimates. We discuss various applications of such estimates, in particular to a problem raised by Deligne concerning the algebraicity degree of reductions modulo p of diagonals of multivariate algebraic power series with integer coefficients.

CONTENTS

1. Introduction 1 2. Proof of Theorem 1.2 8 3. From perfect to arbitrary fields of positive characteristic 12 4. State complexity in Christol's theorem 14 5. Diagonals 17 6. Hadamard product and other similar products 22 7. Algorithmic consequences of Theorem 1.2 24 References 30

INTRODUCTION

Rational and algebraic power series play an important role in various areas of mathematics, and especially in number theory and combinatorics. There are two fundamental results concerning rationality of power series in one variable. The first one is that, given an arbitrary field k, a power series

f (t) = ∞ n=0 a(n)t n ∈ k[[t]
] is rational if and only if its coefficient sequence a(n) satisfies a linear recurrence with coefficients in k. The second one is the famous Skolem-Mahler-Lech theorem stating that, when k is a field of characteristic zero, the zero set Z(f ) := {n ∈ N : a(n) = 0} of a rational power series f ∈ k[[t]] is a periodic set, that is the union of a finite set and of finitely many arithmetic progressions. When k has characteristic zero, it seems difficult to obtain similar results for algebraic power series, i.e. power series f ∈ k[[t]] for which there exists a nonzero bivariate polynomial P ∈ k[t, y] such that P (t, f ) = 0. Although it is known that the coefficient sequences of univariate algebraic power series do satisfy linear recurrences with polynomial coefficients, a characterization of such sequences is still lacking. On the other hand, proving that the corresponding zero sets are periodic remains a challenging open problem (cf. [START_REF] Zannier | Lecture notes on Diophantine analysis, volume 8 of Appunti[END_REF]p. 176]). The situation in several variables is worse and not much is known or even conjectured about zero sets of multivariate rational power series; this is very unfortunate, as they encode interesting Diophantine problems.

In a short but influential paper, Furstenberg [START_REF] Furstenberg | Algebraic functions over finite fields[END_REF] observed for the first time that algebraic power series over ground fields of positive characteristic have a very particular structure. For instance, when k = F q is a finite field, he proved that the ring of algebraic power series is closed under the Hadamard product and that ∞ n=0 a(n)t n ∈ F q [[t]] is algebraic over F q (t) if and only if n:a(n)=a t n is algebraic for every a ∈ F q ; these two properties do not hold in characteristic zero. Later, Christol [START_REF] Christol | Ensembles presque periodiques k-reconnaissables[END_REF] elaborated on Furstenberg's approach and proved the following beautiful result.

Theorem A (Christol). A power series ∞ n=0 a(n)t n ∈ F q [[t]] is algebraic over F q (t) if and only if its coefficient sequence a(n) can be generated by a finite q-automaton.

We refer the reader to [AS03, Chapters 4 and 5] for the notions of finite automata and automatic sequences. A different proof of Christol's theorem was given in [START_REF] Christol | Suites algébriques, automates et substitutions[END_REF], from which Salon [START_REF] Salon | Suites automatiques à multi-indices et algébricité[END_REF][START_REF] Salon | Suites automatiques à multi-indices. Sém. Théorie Nombres Bordeaux[END_REF] also derived a natural extension to multivariate power series. What makes Christol's theorem deep and fascinating is that it establishes an intimate connection between two important objects coming from seemingly unrelated areas.

When the ground field k is an arbitrary field of positive characteristic, the characterization of algebraic power series in terms of finite automata is somewhat lost but there are still important related results. Furstenberg [START_REF] Furstenberg | Algebraic functions over finite fields[END_REF] proved that the diagonal of a multivariate rational power series remains algebraic; this result was generalized by Deligne [START_REF] Deligne | Intégration sur un cycle évanescent[END_REF] to diagonals of multivariate algebraic power series. A related result is that the ring of multivariate algebraic power series is closed under the Hadamard product (cf. [START_REF] Denef | Algebraic power series and diagonals[END_REF][START_REF] Sharif | Algebraic functions over a field of positive characteristic and Hadamard products[END_REF][START_REF] Harase | Algebraic elements in formal power series rings[END_REF]). More recently, Derksen [START_REF] Derksen | A Skolem-Mahler-Lech theorem in positive characteristic and finite automata[END_REF] found an appropriate version of the Skolem-Mahler-Lech theorem involving finite automata. Derksen's theorem was then generalized to zero sets of arbitrary multivariate algebraic power series by Adamczewski and Bell [START_REF] Adamczewski | On vanishing coefficients of algebraic power series over fields of positive characteristic[END_REF].

It turns out that all the previously mentioned results (in positive characteristic) can be proved by using some splitting process associated with the Frobenius map (cf. Equality (1.1)). Let k be a perfect field of characteristic p > 0.

Then the Frobenius endomorphism F, that maps x to x p , is an automorphism of k. Let t = (t 1 , . . . , t n ) be indeterminates, and let K denote the field of fractions of the ring of power series k[[t]] := k[[t 1 , . . . , t n ]]. The Frobenius map F extends naturally to K as an injective homomorphism. We let K ⟨p⟩ denote the image of K by F, so that F defines an isomorphism between K and K ⟨p⟩ . Then K is a K ⟨p⟩ -vector space of dimension p n , a basis being given by all the products of the form t r := t r 1 1 • • • t rn n , with r := (r 1 , . . . , r n ) ∈ {0, . . . , p -1} n . Thus, every f ∈ K has a unique expansion of the form (1.1) f = r∈{0,...,p-1} n t r f r .

For every r ∈ {0, . . . , p -1} n , the section operator S r is defined by (1.2) S r (f ) := F -1 (f r ) .

Section operators are semilinear maps from K into itself. For a power series

f := i∈N n a(i)t i ∈ k[[t]], we have S r (f ) = i∈N n i=(i 1 ,...,in) a(pi 1 + r 1 , . . . , pi n + r n ) 1/p t i ∈ k[[t]]] .
We let Ω n denote the monoid generated by all section operators under composition.

At the end of the 1980s, Denef and Lipshitz [START_REF] Denef | Algebraic power series and diagonals[END_REF], Sharif and Woodcock [START_REF] Sharif | Algebraic functions over a field of positive characteristic and Hadamard products[END_REF] and Harase [START_REF] Harase | Algebraic elements in formal power series rings[END_REF] obtained independently the following nice characterization of multivariate algebraic power series in terms of section operators.

Theorem B.

Let k be a perfect field of characteristic p. A power series f ∈ k [[t]] is algebraic over k(t) if and only if there exists a finite-dimensional k-vector space W ⊂ K containing f and invariant under the action of Ω n .

Remark 1.1. When k = F q , the putative vector space W has to be finite and its existence is thus equivalent to the finiteness of the orbit of f under Ω n . By a classical result of Eilenberg, the latter property is itself equivalent to the fact that the coefficient sequence of f is q-automatic, so one recovers the multivariate extension of Christol's theorem.

In this paper, we investigate the problem of finding a sharp quantitative version of Theorem B, i.e. finding a k-vector space W having the smallest possible dimension in terms of the "complexity" of the algebraic power series f .

The particular case of multivariate rational power series can be treated in a satisfactory way. Indeed, if

f (t) = A(t)/B(t) ∈ k[[t]] for some A, B ∈ k[t],
whose degree in t i is at most h i , then it is easy to prove that the k-vector space

W := P (t) B(t) : P ∈ k[t], deg t i P ≤ h i , 1 ≤ i ≤ n
contains f and is invariant under Ω n . Similarly, if the total degree of both A and B is at most h, then the same conclusion applies to

W ′ := P (t) B(t) : P ∈ k[t], deg t P ≤ h .
Furthermore, W and W ′ have dimensions (h 1 + 1) • • • (h n + 1) and n+h n , respectively.

On the other hand, the case of algebraic irrational multivariate power series is known to be more difficult and the known estimates are much weaker. To summarize roughly, the main aim of this paper is to develop a unified method, which is able to deal with arbitrary multivariate algebraic power series as if they were rational. In this direction, our main results are Theorem 1.2 and Corollary 1.4. The proof of Theorem 1.2 follows a new approach recently initiated in [START_REF] Bostan | Fast coefficient computation for algebraic power series in positive characteristic[END_REF] for the case n = 1. Its main feature is that it combines all the advantages of the different methods used so far to study (part of) this problem (cf. [Chr79, CKMFR80, Sal86, Sal87, DL87, SW88, Har88, Har89, AB12, AB13, Bri17, AY19]). Indeed, our method is elementary, as general as possible in the sense that it applies to arbitrary multivariate algebraic power series over arbitrary fields of characteristic p, and it provides much sharper quantitative estimates. The methods used to date are briefly discussed in Section 1.3. 1.1. Statement of our main result. The "complexity" of an algebraic power series f ∈ k[[t]] is classically measured by its degree and its height. The degree of f is the minimal degree in y of a nonzero polynomial A(t, y) ∈ k[t, y] such that A(t, f ) = 0. It is also equal to [k(t)(f ) : k(t)], the degree of the field extension k(t)(f ) of k(t). For the height, we have two natural choices, since we can consider either the partial height or the total height. We say that f has partial height h = (h 1 , . . . , h n ) if, for all i, h i is the minimal degree in t i of a nonzero polynomial A(t, y) ∈ k[t, y] such that A(t, f ) = 0, while the total height of f is the minimal total degree in t of such polynomials A(t, y). In fact, a finer way to measure the complexity of multivariate polynomials, and hence of algebraic power series, is to consider their Newton polytopes. We recall that the Newton polytope (or, Newton polyhedron) NP(A) of a multivariate polynomial

A := i∈N n j∈N a i,j t i y j ∈ k[t, y]
is defined as the convex hull in R n+1 of the tuples (i, j) with a i,j ̸ = 0. An important result is that, for a generic polynomial A, the number of integer points in the interior of NP(A) is equal to the (geometric) genus of the hypersurface associated with A. This has been proved by Baker for plane curves [START_REF] Baker | Examples of the application of Newton's polygon to the theory of singular points of algebraic functions[END_REF], by Hodge for surfaces [START_REF] Hodge | The Isolated Singularities of an Algebraic Surface[END_REF] and by Khovanskii for arbitrary hypersurfaces [START_REF] Hovanskiȋ | Newton polyhedra, and the genus of complete intersections[END_REF]. As a result, Theorem 1.2 has a geometric flavor, as does the result obtained by Bridy [START_REF] Bridy | Automatic sequences and curves over finite fields[END_REF] in the case where k is a finite field and n = 1 (cf. Section 4 for more details).

Keeping the previous notation, our main result reads as follows.

Theorem 1.2. Let k be a perfect field of characteristic p. Let A(t, y) be a nonzero polynomial in k[t, y] and let

f ∈ k[[t]] satisfy the algebraic relation A(t, f ) = 0. Set C := NP(A) + (-1, 0] n+1 .
Then there exists a k-vector space W ⊂ K of dimension at most

Card(C ∩ N n+1 )
that contains f and that is closed under the action of Ω n .

Remark 1.3. The plus sign in the definition of C refers to the Minkowski sum.

In Theorems B and 1.2, the field k must be perfect for the section operators to be well-defined, but this is not a real limitation. Indeed, replacing an arbitrary field of characteristic p by its perfect closure does not affect our results (cf. Section 3).

When measuring complexity of algebraic power series in terms of degree and height, our main result can be translated as follows.

Corollary 1.4. We keep the notation of Theorem 1.2. Let us further assume that deg y (A) ≤ d, deg t (A) ≤ h, and deg t i (A) ≤ h i for all 1 ≤ i ≤ n. Then, there exists a k-vector space W ⊂ K of dimension at most

N := (d + 1) • min n i=1 (h i + 1), n + h n
that contains f and that is closed under the action of Ω n .

Remark 1.5. In the rest of the paper, we express our results mostly in terms of degree and height rather than in terms of Newton polytopes, which leads to somewhat less precise bounds (compare, for instance, Theorem 1.2 and Corollary 1.4). This is the case for Theorems 4.1, 5.2, 6.1 and 6.3. The reason for this choice is that we think it could be more meaningful for some readers. However, there is no difficulty in deducing from our arguments and Theorem 1.2 more precise results involving Newton polytopes.

1.2. Motivation. Theorem 1.2 is motivated by various applications, in particular to the four following problems:

(i) Given an algebraic power series

f (t) := i∈N n a(i)t i ∈ F q [[t]] ,
find upper bounds for the minimal number of states required for a q-automaton in order to generate the sequence (a(i)) i∈N n . (ii) Given an algebraic power series

f (t) := i∈N n a(i)t i ∈ Z[[t]] ,
find upper bounds for the degree of algebraicity over F p (t) of the reduction modulo p of the diagonal of f , that is

∆(f ) |p := ∞ i=0 (a(i, . . . , i) mod p)t i ∈ F p [[t]] .
(iii) Given two multivariate algebraic power series over an arbitrary field of characteristic p, find upper bounds for the degree of algebraicity of their Hadamard product. (iv) Given an algebraic power series

f (t) := i∈N n a(i)t i ∈ F q [[t]]
(encoded by its minimal polynomial over F q (t) and a large enough enclosure which guarantees uniqueness) and given a multi-index i ∈ N n , find fast algorithms to compute the coefficient a(i).

For each of them, our results strongly improve and/or generalize previously known results (cf. Sections 4-7). For example, in connection with Problem (ii), we significantly improve the main upper bound obtained by Adamczewski and Bell [START_REF] Adamczewski | Diagonalization and rationalization of algebraic Laurent series[END_REF] for the algebraicity degree of reductions modulo p of diagonals of algebraic power series with integer coefficients, thus fully answering a question raised in 1984 by Deligne [START_REF] Deligne | Intégration sur un cycle évanescent[END_REF] (see Theorem 5.2).

Comparison of previous methods.

There are essentially three different approaches to prove results in the vein of Theorems A and 1.2. We briefly recall them together with their main advantages and shortcomings.

(1) The most classical approach, initiated in [START_REF] Christol | Suites algébriques, automates et substitutions[END_REF] and used in [Sal86, Sal87, DL87, SW88, Har88, Har89, AB12], is based on the fact that algebraic power series are roots of polynomials of a certain type called Ore polynomials, i.e. they satisfy algebraic equations of the form

a 0 f + a 1 f p + • • • + a d f p d = 0 ,
where a 0 , . . . , a d ∈ k[t], not all zero. The main advantage of this approach is that it is elementary and general in the sense that it applies to arbitrary multivariate algebraic power series over arbitrary fields of positive characteristic. Its main deficiency is that it provides poor bounds for the dimension of the k-vector space W , namely bounds of the form p A , where A can be made explicit and depends polynomially on the parameters d and h (or d and h 1 , . . . , h n ), that is on the degree and the height of f .

(2) The second approach is based on the so-called rationalization process. This means that one expresses the algebraic power series f as the diagonal of a rational function with more variables. Its main advantage is that it provides bounds on the dimension of the k-vector space W that do not depend on p. It is based on Furstenberg's formula [Fur67, Proposition 2] which is elementary. The main drawback is that Furstenberg's formula only applies to algebraic power series satisfying some specific polynomial relations. For algebraic power series in one variable, one can overcome this difficulty by using resultant techniques (see, for example, [START_REF] Adamczewski | A on Christol's theorem[END_REF]). For multivariate power series, one can use inductively these resultant methods as in [START_REF] Adamczewski | Diagonalization and rationalization of algebraic Laurent series[END_REF], but the worst case scenario leads to really huge bounds. The same approach is also used in [START_REF] Denef | Algebraic power series and diagonals[END_REF], where the rationalization process is ensured by a nonelementary and ineffective argument (cf. [AB13, Remark 3.1]).

(3) The last approach consists in using a geometric setting, considering the projective curve (or hypersurface) associated with the algebraic power series f . It was used by Deligne [Del84] in order to reprove Furstenberg's theorem on diagonals, and more recently by Bridy [START_REF] Bridy | Automatic sequences and curves over finite fields[END_REF] to prove a strong quantitative version of Christol's theorem in dimension one. The main advantage of the geometric approach is that it seems to provide tight bounds for the dimension of the k-vector space W , which is indeed the case in [START_REF] Bridy | Automatic sequences and curves over finite fields[END_REF]. The main shortcomings of this method are that it is not elementary, since it requires tools from algebraic geometry, and that it does not seem to work as well in the multivariate setting.

1.4. Organization of the paper. Section 2 is devoted to the proof of Theorem 1.2. In Section 3, we prove a result ensuring that one can consider, without any loss in our bounds, algebraic power series over arbitrary ground fields of positive characteristic (instead of perfect fields as assumed in Theorem 1.2). This result is used in Sections 5 and 6. In Section 4, we discuss Problem (i) and prove, in the multivariate setting, results similar to those obtained by Bridy [Bri17] for univariate algebraic power series. Section 5 is devoted to Problem (ii). We consider diagonals of algebraic power series in several variables over arbitrary fields of characteristic p, and obtain a general upper bound for their algebraicity degree, which significantly improves the main known result in this direction obtained by Adamczewski and Bell [START_REF] Adamczewski | Diagonalization and rationalization of algebraic Laurent series[END_REF]. In Section 6, we discuss Problem (iii). We obtain the first simply exponential bound (with respect to the characteristic p of the ground field) for the degree of algebraicity of the Hadamard product of two multivariate algebraic power series. We also prove a similar result for the Hurwitz and the Lamperti products of two algebraic power series in one variable. This considerably improves the doubly exponential bounds which follow from [START_REF] Denef | Algebraic power series and diagonals[END_REF][START_REF] Sharif | Algebraic functions over a field of positive characteristic and Hadamard products[END_REF][START_REF] Harase | Algebraic elements in formal power series rings[END_REF] and that were made explicit by Harase [START_REF] Harase | Algebraic elements in formal power series rings[END_REF]. Finally, in Section 7, we consider some algorithmic consequences of Theorem 1.2 to Problem (iv). In particular, we show that the M -th coefficient of the diagonal of an algebraic power series f ∈ F p [[t 1 , . . . , t n ]] can be computed using a number of operations in F p which is logarithmic in M and almost linear in p n+1 . Again, this improves significantly upon previously known results.

Throughout the paper, we let N := {0, 1, . . .} denote the set of nonnegative integers.

PROOF OF THEOREM 1.2

This section is devoted to the proof of our main result.

A variant of Furstenberg's formula.

Let K be a field and T be an indeterminate. The residue map res is defined from the field of Laurent series K((T )) to K by setting

res n≥ν a n T n := a -1 .
Given a polynomial A ∈ K[y], we let A y denote its derivative with respect to y. The following key lemma is a slight reformulation of [BCCD19, Lemma 2.3], itself inspired by [Fur67, Proposition 2]. We provide a proof for the reader's convenience.

Lemma 2.1. Let K be a field, f ∈ K and A(y) ∈ K[y]. Assume that A(f ) = 0 and A y (f ) ̸ = 0. Then res P (f + T ) A(f + T ) = P (f ) A y (f ) , for all P ∈ K[y].
Proof. By assumption, the polynomial

A(f + T ) ∈ K[T ] has a simple root at T = 0. There thus exists a polynomial Q(T ) ∈ K[T ] such that A(f + T ) = T • Q(T ) and Q(0) ̸ = 0 .
Taking the logarithmic derivative with respect to T yields the equality

A y (f + T ) A(f + T ) = 1 T + Q ′ (T ) Q(T ) • Setting g(T ) := P (f + T )/A y (f + T ), we find that g belongs to K[[T ]], as A y (f + T )
does not vanish at T = 0. Furthermore, one has

P (f + T ) A(f + T ) = g(T ) T + g(T )Q ′ (T ) Q(T ) • Similarly, g(T )Q ′ (T )/Q(T ) belongs to K[[T ]] since Q(0) ̸ = 0. It follows that res P (f + T ) A(f + T ) = g(0) = P (f ) A y (f ) , as claimed. □ 2.2.
Frobenius and section operators. Let k be a perfect field of characteristic p. We keep on with the notation introduced in Section 1. We let F be the Frobenius map. We consider indeterminates t 1 , . . . , t n and write t = (t 1 , . . . , t n ). We set

K 0 := k(t), R := k[[t]
] and K := Frac(R). For every r ∈ {0, . . . , p -1} n , the section operator S r is the semilinear operator from K into itself defined as in (1.2).

Section operators on K((T )). Let us consider a new indeterminate T .

Then F extends to an injective homomorphism from K((T )) into itself. We let K((T )) ⟨p⟩ denote the image of K((T )) by F. As previously, K((T )) is a K((T )) ⟨p⟩ -vector space of dimension p n+1 , a basis being given by all the products of the form t r T s with r ∈ {0, . . . , p -1} n and 0 ≤ s ≤ p -1.

However, it will be more convenient for our purpose to replace this standard basis by a more appropriate one (depending on a given f ∈ R). We proceed in the same way as in [BCCD19, Lemma 2.4].

Lemma 2.2. For any f ∈ R, the family

B f := t r (f + T ) s : r, s ∈ {0, . . . , p -1} n+1
is a basis of K((T )) as a K((T )) ⟨p⟩ -vector space.

Proof. First, we observe that B f is a generating family. Indeed, we can obtain t r T s as a linear combination of t r (f + T ) i , 0 ≤ i ≤ s. To see this, it is enough to invert the matrix

          1 0 • • • • • • • • • 0 f 1 0 • • • • • • 0 f 2 2f 1 0 • • • 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . f s sf s-1 s(s-1) 2 f s-2 • • • sf 1           .
Since B f has the same cardinality as the basis {t r T s : r, s ∈ {0, . . . , p-1} n+1 }, it is also a basis of K((T )). □

It follows that, given f ∈ R, every x ∈ K((T )) has a unique expansion of the form (2.1) x = r∈{0,...,p-1} n t r p-1 s=0 (f + T ) s x f,r,s , with x f,r,s ∈ K((T )) ⟨p⟩ .
For every r ∈ {0, . . . , p -1} n and s ∈ {0, . . . , p -1}, we define the section operator S f,r,s , from K((T )) into itself, by

(2.2) S f,r,s (x) := F -1 (x f,r,s ) .
We observe that S f,r,s (xy p ) = S f,r,s (xF(y)) = S f,r,s (x)y, for all x, y ∈ K((T )), all r ∈ {0, . . . , p -1} n , and all s ∈ {0, . . . , p -1}.

Section operators and residues.

The next result is the key observation of our proof. Roughly speaking, it shows some compatibility between taking residues at f (t) and residues at 0. It corresponds to a multivariate extension of [BCCD19, Proposition 2.5].

Proposition 2.3. For any f ∈ R and r ∈ {0, . . . , p-1} n , the following commutation relation holds over K((T )):

S r • res = res • S f,r,p-1 . Proof. Let x ∈ K((T ))
. By (2.1), we have

x = r∈{0,...,p-1} n t r p-1 s=0 (f + T ) s F(S f,r,s (x)) .
Hence

res(x) = r∈{0,...,p-1} n t r p-1 s=0 res (f + T ) s F(S f,r,s (x)) = r∈{0,...,p-1} n t r F res S f,r,p-1 (x) .
By (1.1) and (1.2), we obtain

S r • res(x) = res • S f,r,p-1 (x) ,
as wanted. □ 2.3. Proof of Theorem 1.2. We keep on with the previous notation and the notation of Section 1. Let E(t, y) ∈ k[t, y] denote the minimal polynomial of f over k(t), normalized so that its coefficients are globally coprime.

Lemma 2.4. The power series f is a simple root of E(t, y).

Proof. It is enough to show that E(t, y) is separable with respect to the variable y. Since it is defined as a minimal polynomial, this further reduces to prove that E(t, y) is not of the form F (t, y p ) for some polynomial

F (t, z) ∈ k[t, z].
We assume by contradiction that this occurs, and we write

F (t, z) = a 0 (t) + a 1 (t)z + • • • + a m (t)z m with a i (t) ∈ k[t]
and a m (t) ̸ = 0. Let r ∈ {0, . . . , p-1} n . Applying the section operator S r to the identity F (t, f p ) = 0, we obtain

S r a 0 (t) + S r a 1 (t) f + • • • + S r a m (t) f m = 0 .
Moreover, since a m (t) is nonzero, there must exist r for which S r (a m (t)) does not vanish either. For this particular r, we then get a polynomial annihilating f with y-degree less than the y-degree of E. This contradicts the minimality of E. □ Let E y be the partial derivative of E with respect to y. Lemma 2.4 ensures that E y (t, f ) ̸ = 0. Besides, given that A annihilates f , it must be a multiple of E, i.e. we can write A = E • F for some polynomial F ∈ k[t, y]. Let J be the interval (-1, 0] and set C ′ := NP(E) + J n+1 .

We claim that the k-vector space

W := P (t, f ) E y (t, f ) : P ∈ k[t, y], NP(P ) ⊂ C ′ ⊂ K
contains f and is invariant under the action of Ω n . The fact that f ∈ W follows from the observation that NP(yE y ) ⊂ NP(E) ⊂ C ′ . We now consider a tuple r ∈ {0, 1, . . . , p-1} n together with a polynomial P ∈ k[t, y] whose Newton polytope is a subset of C ′ . We set R := P • E p-1 and let Q ∈ k[t, y] be defined by

(2.3) Q(t, f + T ) := S f,r,p-1 (R(t, f + T )) ∈ K .
Combining Lemma 2.1 and Proposition 2.3, we obtain:

S r P (t, f ) E y (t, f ) = S r • res P (t, f + T ) E(t, f + T ) (2.4) = res • S f,r,p-1 P (t, f + T ) E(t, f + T ) = res Q(t, f + T ) E(t, f + T ) = Q(t, f ) E y (t, f ) •
To establish our claim, it just remains to prove that NP(Q) ⊂ C ′ . We recall the following standard fact about Newton polytopes. The formation of Newton polytopes is compatible with products: given A, B ∈ k[t, y], we have the relation

NP(AB) = NP(A) + NP(B).

From this property, we derive that

NP(R) ⊂ (p-1)•NP(E) + C ′ = p•NP(E) + J n+1 .
Let (i, j) be a tuple of exponents that belongs to the support of Q, i.e. for which the coefficient in Q in front of t i y j is nonzero. It follows from the definition of S f,r,p-1 that (pi + r, pj + p -1) must lie in NP(R). Dividing by p and writing I := (-1 p , 0], we obtain that

i + 1 p r, j + p-1 p ∈ NP(E) + I n+1 , so that (i, j) ∈ NP(E) + I n+1 + -1 p r, -p-1 p ⊂ NP(E) + J n+1 = C ′ .
Finally, we conclude that NP(Q) ⊂ C ′ , as wanted.

Clearly W is spanned by the fractions of the form t i f j /E y (t, f ) with (i, j) ∈ C ′ ∩ N n+1 . Hence its dimension is upper bounded by the cardinality of this set. We observe moreover that C = NP(F ) + C ′ . Since F is nonzero, its Newton polytope NP(F ) meets N n+1 . Hence C contains a translate of C ′ by an element with nonnegative integral coefficients. Consequently the cardinality of C ∩ N n+1 is at least that of C ′ ∩ N n+1 , and we conclude that

dim k W ≤ Card(C ′ ∩ N n+1 ) ≤ Card(C ∩ N n+1 ) ,
as wanted.

Remark 2.5. The proof above actually implies the following statement, which is a little more precise than Theorem 1.2 and can be useful is some cases. For a nonnegative integer m, let J m be the interval (-1, -1+p -m ] and define:

C ′ m := NP(E) + (J n 0 × J m ) , W m := P (t, f ) E y (t, f ) : P ∈ k[t, y], NP(P ) ⊂ C ′ m .
The W m 's form a nonincreasing sequence of k-vector spaces and the action of Ω n sends W m to W m+1 . In particular, it stabilizes the intersection of the W m 's. However, it is not true that f belongs to W m for all m: in full generality, it only lies in W 0 .

If we set

Ω + n •f := {S r 1 • • • • • S rt (f ) : t ≥ 1}, we obtain that Ω n •f = {f } ∪ Ω + n •f , while Ω + n •f is contained in W 1
, which can be strictly smaller than W 0 . For example, if we assume that deg y (A) ≤ d, deg t (A) ≤ h, and

deg t i (A) ≤ h i for all 1 ≤ i ≤ n, then dim k W 0 ≤ (d + 1) • min n i=1 (h i + 1), n + h n , whereas dim k W 1 ≤ d • min n i=1 (h i + 1), n + h n .

FROM PERFECT TO ARBITRARY FIELDS OF POSITIVE CHARACTERISTIC

In Theorem 1.2, the ground field k must be perfect for the section operators to be well-defined. If k is not perfect, one can always replace k by its perfect closure and then apply Theorem 1.2. In this section, we prove a result which ensures that passing to the perfect closure does not affect the bounds we obtain in Sections 5 and 6.

Recall that if k is an arbitrary field of characteristic p, then adjoining to k all the p r -th roots (r ≥ 1) of all the elements of k yields a perfect field; it is called the perfect closure of k and we will denote it by k p . Proposition 3.1. Let k be an arbitrary field of characteristic p and let k p be its

perfect closure. Let f ∈ k[[t]] be algebraic over k(t). Then, [k(t)(f ) : k(t)] = [k p (t)(f ) : k p (t)].
Proposition 3.1 is a direct consequence of the following lemma. Lemma 3.2. Let k 0 be a field, k 1 be an extension of k 0 , t = (t 1 , . . . , t n ) be indeterminates, and f 1 (t), . . . , f r (t) ∈ k 0 [[t]]. If the power series f 1 , . . . , f r are linearly dependent over the field k 1 (t), then they are linearly dependent over the field k 0 (t).

Proof. By assumption, there exist polynomials

A i (t) ∈ k 1 [t], not all zero, such that (3.1) r i=1 A i (t)f i (t) = 0 . Set A i (t) := j∈S i b i,j t j
where we let S i ⊂ N n denote the support of A i , and

f i (t) := j∈N n a i,j t j ∈ k 0 [[t]] .
Let (e ℓ ) ℓ∈L be a basis of k 1 , seen as a k 0 -vector space. Thus, there exist some

c i,j,ℓ ∈ k 0 such that b i,j := ℓ∈L c i,j,ℓ e ℓ .
Then, Equality 3.1 implies that for all k ∈ N n , one has r i=1 j∈S i b i,j a i,k-j = 0 , and hence

r i=1 j∈S i ℓ∈L c i,j,ℓ e ℓ a i,k-j = ℓ∈L   r i=1 j∈S i c i,j,ℓ a i,k-j   e ℓ = 0 .
Since the e ℓ 's are linearly independent over k 0 , we obtain

(3.2) r i=1 j∈S i c i,j,ℓ a i,k-j = 0 for all ℓ ∈ L and all k ∈ N n . Setting A i,ℓ (t) := j∈S i c i,j,ℓ t j ∈ k 0 [t], Equality (3.2) implies that (3.3) r i=1 A i,ℓ (t)f i (t) = 0, for all ℓ ∈ L .
Since the polynomials A i are not all zero, the coefficients b i,j are not all zero, and the same is also true for the coefficients c i,j,ℓ . Hence, there exists an index ℓ such that the polynomials A i,ℓ , 1 ≤ i ≤ r, are not all zero. We thus deduce from (3.3) that f 1 , . . . , f r are linearly dependent over k 0 (t), as wanted. □

STATE COMPLEXITY IN CHRISTOL'S THEOREM

Given an integer q ≥ 2, a multidimensional sequence a = (a(i)) i∈N n with values in a finite set is said to be q-automatic if a(i) is a finite-state function of the base-q expansions of the entries of i. This means that there exists a deterministic finite automaton taking the base-q expansion of each entry of i as input, and producing the symbol a(i) as output. For a formal definition, we refer the reader to [START_REF] Adamczewski | Automata in number theory[END_REF].

For the rest of this section, we let q denote a prime power. The multivariate extension of Christol's theorem can be stated as follows. It is usually proved by following the approach initiated in [START_REF] Christol | Suites algébriques, automates et substitutions[END_REF] for the case n = 1 (cf. [Sal86, Sal87, DL87, SW88, Har88]).

Theorem C. Let f (t) := i∈N n a(i)t i ∈ F q [[t]].
Then f is algebraic over F q (t) if and only if the sequence a := (a(i)) i∈N n is q-automatic.

On each side, there is a natural way to measure the complexity of the corresponding objects, as described below. A natural problem is then to study the interplay between the complexity of the algebraic power series f and that of its sequence of coefficients a.

Two notions of complexity.

As already mentioned in Section 1, the complexity of an algebraic power series f ∈ F q [[t]] can be measured by its degree d and either its partial height h := (h 1 , . . . , h n ) or its total height h. We recall that d := [F q (t)(f ) : F q (t)], and, for all i, 1 ≤ i ≤ n, h i (resp. h) is the minimal degree in the variable t i (resp. the minimal total degree in t) of a nonzero polynomial A(t, y) such that A(t, f ) = 0. These two notions of height are the same when n = 1.

The complexity of a q-automatic sequence a is measured by its state complexity. We let ←comp q (a) denote the number of states in a minimal finite automaton generating a in reverse reading, by which we mean that the input i is read starting from the least significant digits. In a similar way, we let -→ comp q (a) denote the state complexity of a with respect to direct reading. In general, ←comp q (a) and -→ comp q (a) behave quite differently and are only related by the inequalities (a) . These estimates are derived from classical bounds for converting a nondeterministic finite automaton into a deterministic one (see, for example, [AS03, Chapter 4]).

←- comp q (a) ≤ q -→ comp q (a) and -→ comp q (a) ≤ q ←- comp q

Previous bounds on the state complexity.

Let us first recall that if a is generated by a q-automaton with at most m states in reverse reading, it is not difficult to show that the associated power series f has degree d ≤ q m -1 and total height h ≤ mq m (this follows, for instance, from the proofs of [AB13, Propositions 5.1 and 5.2]). Furthermore, it seems that these bounds cannot be significantly improved in general.

Bounds in the other direction are more challenging. The approach based on Ore's polynomials, initiated in [START_REF] Christol | Suites algébriques, automates et substitutions[END_REF] and pursued in [Sal86, Sal87, DL87, SW88, Har88, Har89, AB12], leads to bounds of the form

←- comp q (a) ≤ q Aq B ,
where A and B are polynomial functions of the parameters d, h 1 , . . . , h n , that can be made explicit. The common feature of these bounds is that they have a doubly exponential nature (with respect to the size q of the ground field).

By contrast, when f is a rational function (i.e. d = 1), one can easily obtain the bound q N , where N := min{(h 1 + 1) • • • (h n + 1), n+h n }, and thus get rid of the double exponential. This follows from Proposition 4.2 using the vector spaces W and W ′ introduced in Section 1, and suggests that the previous bounds are artificially large. In a more recent paper, Bridy [START_REF] Bridy | Automatic sequences and curves over finite fields[END_REF] drastically improved on these doubly exponential bounds in the case n = 1. More precisely, he proved that (4.1)

←- comp q (a) ≤ (1 + o(1))q h+d+g-1 ,
where g is the genus of the projective curve associated with f , and where the o(1) term tends to 0 for large values of any of q, h, d, or g. By Riemann's inequality, which gives g ≤ (h -1)(d -1), he deduced that (4.2)

←- comp q (a) ≤ (1 + o(1))q hd .
He also proved that

(4.3) -→ comp q (a) ≤ q (h+1)d .
Bridy's approach is based on a new proof of Christol's theorem in the context of algebraic geometry, due to Speyer (see his blog post untitled Christol's theorem and the Cartier operator1 ). Speyer's argument is elegant, connecting finite automata with the geometry of curves. However, the price to pay to get (4.1) is that some classical but nonelementary background from algebraic geometry is needed: the Riemann-Roch theorem, the existence and the basic properties of the Cartier operator acting on the space of Kähler differentials of the function field associated with f , along with asymptotic bounds for the Landau function. Also, this geometric method does not seem to generalize easily to higher dimension. In an unpublished note, Adamczewski and Yassawi [START_REF] Adamczewski | A on Christol's theorem[END_REF] showed how a slightly weaker bound can be obtained in an elementary way using diagonals, as in the original proof of Christol's theorem [START_REF] Christol | Ensembles presque periodiques k-reconnaissables[END_REF], and resultant techniques. However, the use of resultants makes the proof somewhat tedious.

A simply exponential bound in all dimensions.

As a consequence of Theorem 1.2, we obtain the following bound valid in any dimension.

Theorem 4.1. Let f (t) := i∈N n a(i)t i ∈ F q [[t]] be algebraic over F q (t) with degree d, total height h, and partial height h := (h 1 , . . . , h n ). Set

N := d • min n i=1 (h i + 1), n + h n
and

N ′ := (d + 1) • min n i=1 (h i + 1), n + h n . Then ←- comp q (a) ≤ 1 + q N and -→ comp q (a) ≤ q N ′ .
For n = 1 we obtain

←- comp p (a) ≤ 1 + p (h+1)d and -→
comp q (a) ≤ q (h+1)(d+1) ; these estimates are close to Bridy's bounds (4.2) and (4.3). Note that this could be pushed a little by considering separately the orbit of f under the section operator S 0 . In fact, this is precisely how Bridy proceeds to get (4.2). Let C := NP(A) + (-1, 0] 2 be defined as in Theorem 1.2 (in the case n = 1) and let g A denote the number of integer points in the interior of NP(A). Generically, we have that g = g A . To simplify the exposition, the bounds given in Theorem 4.1 are obtained by overapproximating C ∩N 2 (for instance, by (h 1 + 1)(d + 1) for the second one). Using g A instead, we would obtain bounds with the same flavor as (4.1). Theorem 4.1 is new in dimension n ≥ 2, where only doubly exponential bounds were available until now (cf. [Har89, FKdM00, AB12] and the discussion in [START_REF] Bridy | Automatic sequences and curves over finite fields[END_REF]).

The proof of Theorem 4.1 is derived from Theorem 1.2 and the following result.

Proposition 4.2. Let f (t) := i∈N n a(i)t i ∈ F q [[t]].
Assume that there exists a F q -vector space W ⊂ F q ((t)) of dimension m containing f and invariant under the action of Ω n . Then

(4.4) max{ -→ comp q (a), ←- comp q (a)} ≤ q m .
Furthermore, we have

(4.5) ←- comp q (a) = |Ω n • f | .
In the case n = 1, Inequality (4.4) is a rephrasing of [Bri17, Proposition 2.4], while Equality (4.5) is a rephrasing of a classical result of Eilenberg which asserts that ←comp q (a) is equal to the cardinality of the q-kernel of the sequence a. Both results extend straightforwardly to arbitrary positive integers n. comp q (a) is a direct consequence of Remark 2.5 and Equation (4.5). □

Proof of Theorem 4.1. The upper bound for

DIAGONALS

Given a field k and a multivariate power series

f (t 1 , . . . , t n ) := (i 1 ,...,in)∈N n a(i 1 , . . . , i n )t i 1 1 • • • t in n ∈ k[[t 1 , . . . , t n ]] ,
the diagonal of f is defined as the univariate power series

∆(f )(t) := +∞ i=0 a(i, . . . , i)t i ∈ k[[t]] .
When k is a number field, diagonals of algebraic functions form a remarkable class of power series: they satisfy linear differential equations of Picard-Fuchs type, they belong to the class of Siegel's G-functions, and they are constantly reoccurring in enumerative combinatorics. Furthermore, diagonalization is related to integration and, in general, the diagonal of an algebraic power series is transcendental over k(t). For more details, we refer to the survey [START_REF] Christol | Diagonals of rational fractions[END_REF]. By contrast, Furstenberg [START_REF] Furstenberg | Algebraic functions over finite fields[END_REF] proved that if k has characteristic p and f is a rational power series, then ∆(f ) is algebraic over k(t). In [START_REF] Deligne | Intégration sur un cycle évanescent[END_REF], Deligne generalized this result to diagonals of algebraic power series. Then Harase [START_REF] Harase | Algebraic elements in formal power series rings[END_REF], Sharif and Woodcock [START_REF] Sharif | Algebraic functions over a field of positive characteristic and Hadamard products[END_REF], Denef and Lipshitz [START_REF] Denef | Algebraic power series and diagonals[END_REF], as well as Salon [START_REF] Salon | Suites automatiques à multi-indices et algébricité[END_REF][START_REF] Salon | Suites automatiques à multi-indices. Sém. Théorie Nombres Bordeaux[END_REF] (in some particular case) independently reproved Deligne's theorem.

Combining Theorem 1.2 with Propositions 5.1 and 5.2 of [START_REF] Adamczewski | Diagonalization and rationalization of algebraic Laurent series[END_REF], we readily obtain an effective version of Deligne's theorem: given an algebraic power series f ∈ k[[t]] with degree d and total heights h, the diagonal ∆(f ) has degree at most p N and height at most N p N , where N is explicitly given by

N := (d + 1) • n + h n .
In this section, we will prove a further refinement of this result, which can be formulated as follows.

Theorem 5.1. Let k be an arbitrary field of characteristic p.

Let f ∈ k[[t]]
be an algebraic power series with degree d, total height h, and partial height h = (h 1 , . . . , h n ). Set

N := (d + 1) • min n i=1 (h i + 1) - n i=1 h i , n + h n - h n .
Then, there exist c 0 , c 1 , . . . , c N ∈ k[t], not all zero, such that

c 0 • ∆(f ) + c 1 • ∆(f ) p + • • • + c N • ∆(f ) p N = 0 .
In particular, ∆(f ) has degree at most p N -1.

Reduction of diagonals modulo primes.

Given a prime number p and a power series f (t) := i∈N n a(i)t i ∈ Z[[t]], we let f |p denote the reduction of f modulo p, that is

f |p (t) := i∈N n (a(i) mod p)t i ∈ F p [[t]] .
Deligne [START_REF] Deligne | Intégration sur un cycle évanescent[END_REF] made the following nice observation: since diagonalization and reduction modulo p commute, that is

∆(f ) |p = ∆(f |p ), if f (t) ∈ Z[[t]] is algebraic over Q(t), then ∆(f ) |p is algebraic over F p (t)
for almost all prime p. Hence, it is natural to ask how the "complexity" of the algebraic function ∆(f ) |p may increase when p runs along the primes. When ∆(f ) is transcendental, van der Poorten [vdP93] conjectured that the degree of ∆(f ) |p cannot remain bounded independently of p. On the other hand, Deligne [START_REF] Deligne | Intégration sur un cycle évanescent[END_REF] suggested that the degree of ∆(f ) |p should grow at most polynomially in p.

Using the vector spaces W and W ′ introduced in Section 1, we can deduce the polynomial bound p N , with N := min{(h 1 + 1) • • • (h n + 1), n+h n }, for f a multivariate rational power series with total height h and partial height h = (h 1 , . . . , h n ). The case where f is not rational is much more challenging. Deligne [START_REF] Deligne | Intégration sur un cycle évanescent[END_REF] obtained a first result in this direction by proving that if

f (t 1 , t 2 ) ∈ Z[[t 1 , t 2 ]
] is algebraic, then, for all but finitely many primes p, ∆(f ) |p is of degree at most Ap B , where A and B do not depend on p but only on certain geometric quantities associated with f . On the other hand, the works of Harase [START_REF] Harase | Algebraic elements in formal power series rings[END_REF][START_REF] Harase | Algebraic elements in formal power series rings[END_REF], Sharif and Woodcock [START_REF] Sharif | Algebraic functions over a field of positive characteristic and Hadamard products[END_REF], and Adamczewski and Bell [START_REF] Adamczewski | On vanishing coefficients of algebraic power series over fields of positive characteristic[END_REF] lead to doubly exponential bounds (i.e. of the form p p M ). The first general polynomial bound (i.e. of the form p A ) was obtained by Adamczewski and Bell in [START_REF] Adamczewski | Diagonalization and rationalization of algebraic Laurent series[END_REF]. They provide an effective A that depends only on the degree and the total height of f . However, when f has degree d > 1, the value of A becomes huge due to a recursive procedure involving resultants. For instance, even for n = 2, the estimate for A is of the form d 4 (h 2 d 6 ) d 4 hd 2 and the length of the exponential tower increases at least linearly with n. It is also possible to deduce from the work of Denef and Lipshitz [START_REF] Denef | Algebraic power series and diagonals[END_REF] the existence of such a polynomial bound, but with an ineffective constant A.

Theorem 5.1 readily implies the following result, which quite significantly improves the previous known bounds.

Theorem 5.2. Let f ∈ Z[[t]] be an algebraic power series with degree d, total height h, and partial height h

= (h 1 , . . . , h n ). Set (5.1) N := (d + 1) • min n i=1 (h i + 1) - n i=1 h i , n + h n - h n .
Then, for all prime numbers p, ∆(f ) |p has degree at most p N -1 over F p (t).

Remark 5.3. Not only Theorem 5.1 gives a nice bound on the degree of ∆(f ) |p , but it also shows that ∆(f ) |p is annihilated by an Ore polynomial of bounded p-degree. This additional feature implies that the Galois conjugates of ∆(f ) |p are all contained in an F p -vector space of dimension N and eventually that the Galois group of ∆(f ) (i.e. the Galois group of the extension of k(t) generated by ∆(f ) and all its Galois conjugates) canonically embeds, up to conjugacy, into GL N (F p ). This observation allows for asking more precise questions about the uniformity with respect to p. For example, one may wonder if the Galois groups of ∆(f ) |p all come by reduction modulo p from a unique group (or maybe a finite number of groups) defined in characteristic zero.

Remark 5.4. Using the same arguments as in [AB13, p. 967], we could also prove a more general statement than Theorem 5.2 by replacing the ring Z with a number field and consider reductions modulo prime ideals. In fact, we could even consider the case where f has coefficients in an arbitrary field of characteristic zero (see [AB13, Theorem 1.4]). Note that, beyond diagonals of algebraic power series, there are other interesting families of G-functions in Q[[t]] whose reductions modulo p are algebraic (cf. [START_REF] Vargas-Montoya | Algébricité modulo p, séries hypergéométriques et structures de Frobenius fortes[END_REF]). Furthermore, algebraicity modulo p turns out to be useful to prove transcendence and algebraic independence results for power series in characteristic zero (cf.

[WS89, AGBS98, AB13, ABD19, VM23]).

Generalized diagonals.

In what follows, we consider a slight generalization of the diagonalization process. Let k be a perfect field of characteristic p and let t := (t 1 , . . . , t n ) be a tuple of indeterminates. We set

K 0 := k(t), R := k[[t]
], and we let K denote the field of fractions of R. Let G be a subgroup of Z n such that the quotient Z n /G has no torsion. We let K 0,G be the subfield of K 0 generated by k and by the monomials t i with i ∈ G. Similarly, we define R G as the k-subalgebra of R consisting of series of the form i∈G a(i)t i . Given that G is abstractly isomorphic to Z m for some integer m ≤ n, the rings K G and R G are respectively isomorphic to k(x 1 , . . . , x m ) and k[[x 1 , . . . , x m ]].

Definition 5.5. We keep the previous notation. The G-diagonal is the operator defined by

∆ G : R -→ R G i∈N n a(i)t i → i∈G a(i)t i with the convention that a(i) = 0 when i ̸ ∈ N n .
When G is the subgroup generated by (1, . . . , 1), the ring R G is isomorphic to k[[t]] via the map t 1 • • • t n → t and the diagonal operator ∆ G is the usual diagonal operator ∆. However the general construction ∆ G is more flexible and allows in particular for partial diagonals: letting G be the subgroup generated by (1, . . . , 1) and by e i = (0, . . . , 0, 1, 0, . . . , 0) (with 1 in i-th position) for i ∈ {1, . . . , m}, we obtain that R G ≃ k[[t 1 , . . . , t m , x]] and

∆ G i∈N n a(i)t i = (i 1 ,...,im)∈N m n∈N a(i 1 , . . . , i m , n, . . . , n) t i 1 1 • • • t im m x n .
In general, one can check that ∆ G is K 0,G -linear.

Theorem 5.6. Let k be an arbitrary field of characteristic p, G be a subgroup of Z n such that Z n /G has no torsion, let G R be the subvector space of R n generated by G, and let

π G : R n+1 → (R n /G R ) × R denote the canonical projection. Let A(t, y) ∈ k[t, y] and let f ∈ k[[t]] satisfying the algebraic relation A(t, f ) = 0.
Let C be the convex subset of R n+1 defined by

C := NP(A) + G R × (-1, 0] .
Then, there exist c 0 , c 1 , . . . , c N ∈ K 0,G , not all zero, such that

(5.2) c 0 • ∆ G (f ) + c 1 • ∆ G (f ) p + • • • + c N • ∆ G (f ) p N = 0 ,
where

N := Card π G (C ∩ N n+1 ) .
Proof. We first observe that, by Proposition 3.1, we can replace without any loss of generality the field k by the perfect closure of the subfield of k generated over F p by the coefficients of f . Hence, we can assume that k is perfect.

Let E ∈ k(t, y) be the minimal polynomial of f and E y be the derivative of E with respect to y. Set J := (-1, 0] and

C ′ := NP(E) + G R × J .
Repeating the proof of Theorem 1.2, we show that the k-vector space

W := P (t, f ) E y (t, f ) : P ∈ k[t, y], NP(P ) ⊂ C ′
contains f and is invariant under S r for all r ∈ G. Noticing that ∆ G commutes with S r whenever r ∈ G, we conclude that ∆ G (W ) is invariant under S r for all r ∈ G as well. Let V be the

K 0,G -span of ∆ G (W ) in K G := Frac(R G )
. By linearity, we find that V is spanned by the elements t i f j /E y (t, f ) for (i, j) running over C ′ ∩ N n+1 . Besides, two fractions t i f j /E y (t, f ) and t i ′ f j ′ /E y (t, f ) are K 0,G -collinear as soon as i ≡ i ′ mod G, which occurs if and only if π G (i, j) = π G (i ′ , j). The dimension of V over K 0,G is then upper bounded by the cardinality of π G (C ′ ∩ N n+1 ), which is itself upper bounded by N (see the last paragraph of the proof of Theorem 1.2 for more details).

The Frobenius map F acts as an endomorphism of K 0,G . We consider the "relative" Frobenius map of K G defined by

ψ : K G ⊗ K 0,G ,F K 0,G -→ K G x ⊗ y → x p y
where the notation ⊗ K 0,G ,F means that we view K 0,G as an algebra over itself via F. Hence, in K G ⊗ K 0,G ,F K 0,G , we have 1 ⊗ y = y p ⊗ 1. This construction ensures that ψ is a K 0,G -linear isomorphism. Moreover, it is related to the section operators via the formula

ψ -1 (f ) = r∈Gp S r (f ) ⊗ t r ,
where we let G p ⊂ G denote a set of representatives of G/pG. Recall that we have proved earlier that V is closed under the action of S r for all r ∈ G. Therefore, we find that ψ -1 induces a K 0,G -linear morphism from V to V ⊗ K 0,G ,F K 0,G . Being the restriction of an injective map, this morphism is clearly injective. Given that V is finite dimensional over K 0,G and that

dim K 0,G V = dim K 0,G (V ⊗ K 0,G ,F K 0,G )
, we conclude that it is an isomorphism. Hence ψ takes V ⊗ K 0,G ,F K 0,G to V , which further implies that V is invariant under the Frobenius map.

In particular, ∆ G (f ) p s lies in V for all nonnegative integers s. Since

moreover dim K 0,G V ≤ N , it follows that ∆ G (f ), ∆ G (f ) p , . . . , ∆ G (f ) p N must be linearly dependent over K 0,G . Thus, there exist c 0 , c 1 , . . . , c N ∈ K 0,G , not all zero, such that c 0 • ∆ G (f ) + c 1 • ∆ G (f ) p + • • • + c N • ∆ G (f ) p N = 0 , as desired. □ 5.
3. Proof of Theorem 5.1. We apply Theorem 5.6 with the group G generated by (1, . . . , 1). As already noticed, the diagonal ∆ G is then the usual diagonal ∆, up to the identification t := t 1 • • • t n . Let A(t, y) be the minimal polynomial of f , so that A has degree d, total height h, and partial height h = (h 1 , . . . , h n ). Let π G be the mapping and C be the convex set defined in the statement of Theorem 5.6. By Theorem 5.6, it remains to prove that

Card π G (C ∩ N n+1 ) ≤ N . Let c := (a 1 , . . . , a n , b) ∈ C ∩ N n+1 .
We have -1 < b ≤ d and, given that b is an integer, we conclude that 0 ≤ b ≤ d. Moreover, up to translating c by an element of G, one may assume that 0 ≤ a i ≤ h i for all i ∈ {1, . . . , n} and that n i=1 a i ≤ h. Define a := min{a 1 , . . . , a n } and, for all i, set ãi := a i -a. Then one of the first n coordinates of c := (ã 1 , . . . , ãn , b) vanishes. On the other hand, one has 0 ≤ ãi ≤ h i and n i=1 ãi ≤ h. Furthermore, π G (c) = π G (c). This ensures that any element of π G (C ∩ N n+1 ) has a preimage in each of the sets

E 1 := (a 1 , . . . , a n , b) ∈ N n+1 : b ≤ d, ∀i, a i ≤ h i , ∃i, a i = 0 and E 2 := (a 1 , . . . , a n , b) ∈ N n+1 : b ≤ d, n i=1 a i ≤ h, ∃i, a i = 0 . Since Card(E 1 ) = (d + 1) • n i=1 (h i + 1) - n i=1 h i and Card(E 2 ) = (d + 1) • n + h n - h n ,
we have that Card π G (C ∩ N n+1 ) ≤ min{Card(E 1 ), Card(E 2 )} = N , as wanted.

HADAMARD PRODUCT AND OTHER SIMILAR PRODUCTS

Let k be a field and t := (t 1 , . . . , t n ) be a vector of indeterminates. Given two multivariate power series f (t) := i∈N n a(i)t i and g(t

) := i∈N n b(i)t i in k[[t]], their Hadamard product is defined by f ⊙ g := i∈N n a(i)b(i)t i ∈ k[[t]] .
The Hadamard product is intimately connected to diagonalization. Indeed, we have

∆(f ) = φ f ⊙ 1 1 -t 1 • • • t n ,
where φ is the map defined by

t 1 • • • t n → t, while f ⊙ g = ∆ G (f (t)g(y)) ,
where G is the subgroup of Z 2n generated by the vectors v i , 1 ≤ i ≤ n, whose i-th and (i + n)-th entries are 1 and the other entries are 0.

As with diagonals, if k has characteristic zero, the Hadamard product of two algebraic power series in k[[t]] is in general transcendental. The situation is totally different if k has characteristic p. When k is a finite field and n = 1, Furstenberg [START_REF] Furstenberg | Algebraic functions over finite fields[END_REF] proved that the ring of algebraic power series is closed under Hadamard product. This was independently extended to arbitrary fields k of characteristic p and positive integers n, by Denef and Lipshitz [DL87], Sharif and Woodcock [START_REF] Sharif | Algebraic functions over a field of positive characteristic and Hadamard products[END_REF], and Harase [START_REF] Harase | Algebraic elements in formal power series rings[END_REF]. Harase [START_REF] Harase | Algebraic elements in formal power series rings[END_REF] also obtained a quantitative version of this result when k is a perfect field: the degree of algebraicity of f ⊙ g over k(t) is bounded by p Ap B for some A and B that are made explicit and depend polynomially on the degrees and the heights of f and g.

The following theorem improves considerably Harase's bound.

Theorem 6.1. Let k be a field of characteristic p and let f, g ∈ k[[t]] be two algebraic power series of degree d and d ′ , total height h and h ′ , and partial height h := (h 1 , . . . , h n ) and h ′ := (h ′ 1 , . . . , h ′ n ), respectively. Set

N 1 := (d + 1) • min n i=1 (h i + 1), n + h n and N 2 := (d ′ + 1) • min n i=1 (h ′ i + 1), n + h ′ n .
Then f ⊙ g is an algebraic power series of degree at most p N 1 N 2 -1 over k(t).

We will prove this theorem in Section 6.2.

Remark 6.2. Again, we could also bound the total height h of f ⊙ g following the argument in [AB13, Proposition 5.2].

6.1. Hurwitz and Lamperti products. All along this section, we only consider univariate power series, that is the case n = 1. Given a field k and two power series f (t) := ∞ i=0 a(i)t i and g(t

) := ∞ i=0 b(i)t i in k[[t]]
, their Hurwitz product is defined by

f • H g := ∞ i=0 i k=0 i k a(k)b(i -k) t i ∈ k[[t]] ,
and their Lamperti product by

f • L g := ∞ i=0   j+k+ℓ=i i! j!k!ℓ! α j β k γ ℓ a(j + k)b(ℓ + k)   t i ∈ k[[t]] ,
where the parameters α, β, and γ belong to k. The Lamperti product generalizes both the Hadamard product (taking α = β = 0 and γ = 1) and the Hurwitz product (taking α = β = 1 and γ = 0). When k has positive characteristic, Harase [START_REF] Harase | Algebraic elements in formal power series rings[END_REF][START_REF] Harase | Algebraic elements in formal power series rings[END_REF] proved that the Lamperti product of two algebraic power series f and g remains algebraic and he provided a doubly exponential bound (i.e. of the form p Ap B ) for the degree of f • L g (and thus for f • H g). Again, our approach leads to a simply exponential bound.

Theorem 6.3. Let k be a field of characteristic p and let f, g ∈ k[[t]] be two algebraic power series of degree d and d ′ and height h and h ′ , respectively. Set

N := (d + 1)(d ′ + 1)(h + 1)(h ′ + 1) .
Then f • L g is an algebraic power series of degree at most p N -1 over k(t). In particular, the same result holds for f ⊙ g and f • H g.

6.2. Proof of Theorems 6.1 and 6.3. As previously, we let K denote the field of fractions of k[[t]] and S r , r ∈ {0, . . . , p -1} n be the section operators. We first deduce from Theorem 1.2 and Proposition 3.1 the following general result.

Proposition 6.4. Let k be a field of characteristic p and let ⋆ be a bilinear product defined over k[ [t]] such that for all f, g ∈ k[[t]] one has

(6.1) S r (f ⋆ g) ∈ span k {S i f ⋆ S j g : i, j ∈ {0, . . . , p -1} n } . Let f 1 , f 2 ∈ k[[t]
] and let us assume that for all i ∈ {1, 2} there exists a k-vector space W i ⊂ K of dimension at most d i containing f i and invariant by Ω n . Then f 1 ⋆ f 2 is an algebraic power series of degree at most p d 1 d 2 -1 over k(t).

Proof. Let us first assume that k is a perfect field. Let h 1 , . . . , h r be a basis of W 1 and h ′ 1 , . . . , h ′ s be a basis of W 2 . Set W := span k {h i ⋆ h ′ j : 1 ≤ i ≤ r, 1 ≤ j ≤ s} . Then W has dimension at most d 1 d 2 and the bilinearity of ⋆ implies that W contains f 1 ⋆ f 2 . On the other hand, since W 1 and W 2 are invariant under Ω n , we infer from the bilinearity of ⋆, the semilinearity of the section operators, and (6.1) that W is also invariant under Ω n . Then it follows classically that f 1 ⋆ f 2 is algebraic over k(t) with degree at most p d 1 d 2 -1 (cf., for instance, [START_REF] Harase | Algebraic elements in formal power series rings[END_REF] and [AB13, Proposition 5.1]). Now, if k is an arbitrary field of characteristic p, one can pass to its perfect closure k p and then apply the previous argument to obtain that f 1 ⋆ f 2 as degree at most p d 1 d 2 -1 over k p (t). By Proposition 3.1, we deduce that the degree of f 1 ⋆ f 2 over k(t) is also at most p d 1 d 2 -1, as wanted. □

Proof of Theorem 6.1. After noticing that

S r (f ⊙ g) = S r (f ) ⊙ S r (g) ,
the proof follows directly from Proposition 6.4 and Corollary 1.4. □

Proof of Theorem 6.3. After noticing, as in [START_REF] Harase | Algebraic elements in formal power series rings[END_REF], that S r (f • L g) = 0≤s,r s+t≤r r! s!t!(r -s -t)! α s/p β t/p γ (r-s-t)/p S r-t (f ) • L S r-s (g) , the proof follows directly from Proposition 6.4 and Corollary 1.4 (with n = 1). □

ALGORITHMIC CONSEQUENCES OF THEOREM 1.2

Throughout this section, we assume for simplicity that k is a finite field F q . We address the question of the efficient computation of one "faraway" coefficient of a power series f (t) ∈ k[[t]] assumed to be algebraic over k(t).

It was pointed out in [AS92, Corollary 4.5] that the M -th term of an automatic sequence (and more generally of a k-regular sequence) can be computed using O(log M ) operations in k. By Christol's theorem (and its multivariate version) it follows that, given i := (i 1 , . . . , i n ), the coefficient of

t i := t i 1 1 • • • t in n
in the expansion of f can be computed in O(log M ) operations in k, where M := max(i 1 , . . . , i n ). (For fields of characteristic zero, there is no algorithm achieving polynomial time in log M for the same task, even if n = 1.) However, this estimate is oversimplified in the sense that the O(•) hides dependencies in the other parameters, namely the characteristic p of the ground field k, the number of variables n and the various algebraicity degree and heights of f . The actual efficiency of any algorithm that computes the coefficient of t i of f heavily depends on these parameters, especially given that before entering the O(log M )-part, some of these algorithms may need to perform precomputations whose cost is so large with respect to the other parameters, that the algorithms are highly inefficient in practice. This is particularly true for the class of algorithms that start with building a q-automaton: the running time of this precomputation depends on number of states of the automaton, which can be huge. For these reasons, in the algorithmic design, it is important to care about the dependencies with respect to all the other parameters. This is the object of this section.

7.1. The algorithm. For algorithmic purposes, the starting point is always to find a suitable finite representation of the objects we want to compute with. In our setting, it is of course not possible to represent a power series f (t) by its full sequence of coefficients in k, because this sequence is an infinite object. However, when f (t) is algebraic, we can hope to come back to a finite representation by working with an annihilating polynomial of f (t), together with sufficiently many initial coefficients in the expansion of f (t). This indeed works but requires some caution, given that the aforementioned polynomial may in general have several roots. In what follows, we shall encode an algebraic power series f (t) := i∈N n a(i)t i by the following data:

(a) its minimal polynomial E(t, y) ∈ k[t, y] over k(t), which we normalize (up to a unit in k) by requiring it to have polynomial coefficients in k[t] that are globally coprime, (b) a minimal element (for the product order on N n ), denoted by ρ := (ρ 1 , . . . , ρ n ), of NP E y (t, y) ∩ N n (which is nonempty thanks to Lemma 2.4), (c) the coefficients a(i) for all tuples i := (i 1 , . . . , i n ) with 0 ≤ i j ≤ ρ j for all 1 ≤ j ≤ n.

Lemma 7.1. The previous data uniquely determines the algebraic power series f .

Proof. Let i := (i 1 , . . . , i n ) ∈ N n be a multiindex. For each j ∈ {1, . . . , n}, we write the decomposition in base p of i j

i j = ℓ-1 m=0 r j,m p m ,
where ℓ is a positive integer and all the r j,m 's are integers between 0 and p-1. For each m, we form the tuple r m := (r 1,m , . . . , r n,m ) and consider the corresponding section operator S rm . It follows from the definitions that the coefficient a(i) is equal to the p ℓ -th power of the constant coefficient of the power series

g(t) := S r ℓ-1 • • • • • S r 1 • S r 0 f (t) .
Input: A multiindex i = (i 1 , . . . , i n ) and an algebraic power series

f (t) ∈ k[[t]] encoded by (E(t, y), ρ, f (t) mod t ρ+1 ) Output: The i-th coefficient of f (t)
1. For j = 1, . . . , n, write the decomposition of i j in base p: i

j = ℓ-1 m=0 r j,m p m 2. Set Q 0 (t, y) := y • E y (t, y) 3. For i = 0, 1, . . . , ℓ -1, set Q i+1 (t, y) := S f,r 1,m ,...,rn,m,p-1 Q i (t, y) • E(t, y) p-1 4. Compute Q ℓ (t, f (t)) mod t ρ+1 and set α := [t ρ ]Q ℓ (t, f (t)) 5. Compute E y (t, f (t)) mod t ρ+1 and set β := [t ρ ]E y (t, f (t)) 6. Return (α/β) p ℓ
Algorithm 1: i-th coefficient of an algebraic power series. Moreover, by Eq. (2.4), there exists a polynomial Q ∈ k[t, y] such that

g(t) = Q(t, f (t)) E y (t, f (t)) , i.e. Q(t, f (t)) = g(t) • E y (t, f (t)) .
Identifying the coefficients in t ρ in the latter equality, we find

[t ρ ]Q(t, f (t)) = u+v=ρ [t u ]g(t) • [t v ]E y (t, f (t)) ,
where the notation [t j ]φ(t) refers to the coefficients in front of t j in the power series φ(t). On the other hand, we derive from the definition of ρ (and especially from the minimality condition (b)) that the unique v ≤ ρ for which the coefficient [t v ]E y (t, f (t)) does not vanish is ρ itself. Therefore, we conclude that

[t ρ ]Q(t, f (t)) = [t 0 ]g(t) • [t ρ ]E y (t, f (t)) which gives a(i) = [t 0 ]g(t) p ℓ = [t ρ ]Q(t, f (t)) [t ρ ]E y (t, f (t)) p ℓ . Since f (t) is given at precision O(t ρ 1 +1 1 • • • t ρn+1 n ), we can compute Q(t, f (t)
) at the same precision; this ensures that the coefficient [t ρ ]Q(t, f (t)) can be recovered from the set of data that we have at our disposal. Hence the same holds for a(i). Since i was chosen arbitrarily at the beginning of the proof, the lemma is proved. □ Importantly, we notice that the proof of Lemma 7.1 together with the explicit formula (2.3) translate immediately to Algorithm 1 which computes the coefficient a(i) of the power series f (t). Note that Algorithm 1 can be seen as a multivariate version of the algorithms in [BCCD19, Section 3].

We now study the (arithmetic) complexity of Algorithm 1. In what follows, we will express complexity of algorithms in terms of the number of operations they perform in the ground field k. By "operation", we mean either a classical arithmetical (field) operation (addition, subtraction, multiplication, division) or an application of the Frobenius map F, or its inverse. We recall the soft-O notation Õ: by definition, Õ(c) is the union of the O(c log k (c)) for k varying in N. Using Õ instead of the more customary O-notation makes it possible to "hide" logarithmic factors.

Theorem 7.2. Let f (t) ∈ k[[t]
] be an algebraic power series encoded by the data (E(t, y), ρ, f (t) mod t ρ+1 ) . Let h := (h 1 , . . . , h n ) be the vector of partial heights of E(t, y) and d be its degree. On input f (t) and i := (i 1 , . . . , i n ), Algorithm 1 performs at most

Õ 2 n dp n+1 (h 1 +1) • • • (h n +1) log M + 2 n (ρ 1 +1) • • • (ρ n +1)
operations in k, where M := max(i 1 , . . . , i n ). (that is the polynomial obtained from Q i by applying F i to each of its coefficients) instead of Q i on line 3, thanks to the recurrence relation:

Proof

Q F i+1 i+1 (t, y) = S F f,r 1,m ,...,rn,m,p-1 Q F i i (t, y) • E F i (t, y) p-1
, where S F f,r,s is the same operator as S f,r,s except that we do not take preimages of the coefficients by the Frobenius map F. Proceeding this way, we retrieve F ℓ (α) = α p ℓ by selecting the coefficient of t ρ in Q F ℓ ℓ (t, f (t)) and can return F ℓ (α)/β p ℓ on line 6. With this optimization, it becomes unnecessary to apply inverses of F in Algorithm 1. This may be beneficial since, in practice, applying F -1 may be a more expensive operation than applying F. Remark 7.4. It is possible to give a priori bounds on ρ in terms of h and d. Indeed, let r(t) be the resultant in y of the polynomials E(t, y) and E y (t, y). A calculation shows that the t i -degree of r(t) is upper bounded by 2dh i .

Besides, it follows from the standard properties of resultants that E y (t, f (t)) divides r(t) in the ring k [[t]]. Hence the Newton polytope of E y (t, f (t)) necessarily has one point in the box [0, 2dh 1 ] × • • • × [0, 2dh n ], from which we derive that one can always choose ρ ≤ 2d•h. The above discussion shows that the complexity of Algorithm 1 can be controlled in terms of h, d and log M only: to simplify notation, setting

H := (h 1 +1) • • • (h n +1) ,
the number of operations used by Algorithm 1 is at most (7.1) Õ 2 n dp n+1 H log M + 4 n d n H .

For n = 1 and h 1 = h > 0, the cost (7.1) reads Õ dhp 2 log M . This is similar to the complexity estimate Õ h(d+h)p 2 +h 2 (d+h) 2 log M of [BCD16, Algorithm 3]. Faster algorithms are available when n = 1, with quasi-linear complexity in p: Õ h 2 (h + d) 2 log M + h(h + d) 5 p ([BCD16, Theorem 11]) and even Õ d 2 h 2 log M + d 2 hp + d 3 h ([BCCD19, Theorem 3.4]).

For a general n, the complexity estimate (7.1) is exponentially better (with respect to p) than all estimates that could be deduced from known approaches. This important improvement is of course ultimately inherited from Theorem 1.2. It would be interesting to design faster variants of Algorithm 1, whose complexities improve the estimate (7.1), e.g. replacing the term p n+1 by p n . 7.2. Applications to diagonals. Assume that f (t) ∈ F p [[t]] is an algebraic power series in n variables of degree d and partial height h := (h 1 , . . . , h n ). We consider here the following algorithmic problem: given M ∈ N, how fast can one compute the M -th coefficient in the expansion of the diagonal ∆(f )?

When f is rational, Rowland and Yassawi proposed in [RY15, Section 2] two algorithms to compute finite automata that could be used to compute terms of the coefficient sequence of ∆(f ). However, the number of states of the produced automata is prohibitively large: Remark 2.2 in [START_REF] Rowland | Automatic congruences for diagonals of rational functions[END_REF] provides an upper bound of the form p (h+1) n , where h is the total height of f . By Theorem 5.2 and the discussion above, ∆(f ) is an algebraic power series in F p [[t]] of degree D ∆ ≤ p N -1 and height H ∆ ≤ N p N where N is at most (d + 1)H and, as before, H = (h 1 +1) • • • (h n +1). Hence, a "naive" way of computing the coefficient [t M ]∆(f ) would be to first determine an annihilating polynomial E ∈ F p [t, y] for ∆(f ), and then to apply the algorithms of [START_REF] Bostan | Fast computation of the N th term of an algebraic series over a finite prime field[END_REF] or [START_REF] Bostan | Fast coefficient computation for algebraic power series in positive characteristic[END_REF] to this E. Starting from the first 2(D ∆ +1)(H ∆ +1) terms in the expansion of ∆(f ), one can compute such an E, by (structured) linear algebra, using Õ(D ω ∆ H ∆ ) ⊆ Õ(N p (ω+1)N ) operations in F p , as explained in [START_REF] Bostan | Fast coefficient computation for algebraic power series in positive characteristic[END_REF]p. 128]. Here ω ∈ [2, 3] is a feasible exponent for the matrix multiplication. Hence, using [BCCD19, Theorem 3.4], we conclude that, for M ≫ 0, the coefficient [t M ]∆(f ) can be computed in

Õ H 2 ∆ (H ∆ + D ∆ ) 2 log M + D 2 ∆ H ∆ p + D 3 ∆ H ∆ ⊆ Õ d 4 H 4 p 4(d+1)H log M
operations in F p . This complexity estimate is quasi-optimal with respect to M , but its dependence in p is far from optimal.

A much better method is to apply Algorithm 1 with i = (M, . . . , M ) directly, without first precomputing an annihilating polynomial for ∆(f ). The resulting complexity is then provided by Theorem 7.2, and is bounded in terms of n, p, d, h 1 , . . . , h n by the estimate in (7.1), namely Õ 2 n dp n+1 H log M + 4 n d n H . This method then allows to compute the M -th coefficient of the diagonal of f (t 1 , . . . , t n ) in arithmetic complexity linear in log M and quasi-linear in p n+1 . This result was previously known only in the bivariate case. For more than two variables, previous algorithms with complexity linear in log M required (at least) doubly exponential time in the arithmetic size of f . Note finally that the truth of Christol's conjecture [Chr90, Conjecture 4] would imply that log(M )-time algorithms for computing the M -th term modulo p might well exist for the whole class of integer sequences with geometric growth which are P-finite (i.e., which satisfy linear recurrence relations with polynomial coefficients in the index n). Their generating function ∞ n=0 A(n)t n is the diagonal of the rational function in n = 4 variables [START_REF] Straub | Multivariate Apéry numbers and supercongruences of rational functions[END_REF] f (t 1 , t 2 , t 3 , t 4 ) := 1 (1 -t 1 -t 2 )(1 -t 3 -t 4 ) -t 1 t 2 t 3 t 4 • Hence, by (7.1), A(M ) mod p can be computed in O(p 5 log M ) operations in F p . This estimate can be lowered to Õ(p 4 log M ) by using that n≥0 A(n)t n is also the diagonal of an algebraic function in n = 3 variables. In this particular case, a better complexity bound can be obtained by exploiting nontrivial arithmetic properties of the Apéry numbers. Indeed, it turns out that the sequence (A(n)) n≥0 is p-Lucas [Ges82]: if M = (i ℓ-1 . . . i 1 i 0 ) p is the basep expansion of M , then A(M ) = A(i ℓ-1 ) • • • A(i 1 )A(i 0 ) mod p, hence it is sufficient to precompute A(0) mod p, . . . , A(p-1) mod p. This can be done for a cost of Õ(p 4 ) operations in F p ; after this, computing A(M ) mod p only requires O(log M ) extra operations in F p . However, beyond this example, many other interesting integer sequences are not p-Lucas, but are known to admit diagonals of algebraic functions as generating functions. Most of the integer sequences from the combinatorial literature, which are P-finite and have a geometric growth, are known to fall into this class. For instance, the sequence 1, 6, 222, 9918, . . . (A144045)

  ←-comp q (a) follows from Theorem 1.2 and Equation 4.4. The upper bound for -→

7. 3 .

 3 Examples. We consider the Apéry numbers A(n)

Available at https://sbseminar.wordpress.com/2010/02/11.

Partially supported by the French grant DeRerumNatura (ANR-19-CE40-0018), and by the French-Austrian project EAGLES (ANR-22-CE91-0007 & FWF I6130-N).

counting diagonal rook paths on a 3D chessboard was proved in [START_REF] Bostan | Explicit formula for the generating series of diagonal 3D rook paths[END_REF] to satisfy the recurrence 2n 2 (n -1)a(n) -(n -1)(121n 2 -91n -6)a(n -1)

and to admit a generating function F (t) := n≥0 a(n)t n equal to

Given a prime p, neither the recurrence, nor the closed form of F (t) are well-suited to compute rapidly the value a(M ) mod p for high values of M . In exchange, a(M ) is the M -th coefficient of the diagonal of the rational function in 3 variables

Hence, by (7.1), a(M ) mod p can be computed using Õ(p 4 log M ) operations in F p .

A similar example is given by the sequence 1, 2, 18, 255, 4522, . . . (A151362) whose n-th term q(n) counts walks in the quarter plane N 2 of length 2n starting at the origin and using steps in the set {N, S, NE, SE, NW, SW}. The generating function Q(t) := n≥0 q(n)t 2n of this sequence is known to be transcendental over Q(t) and to admit the 2 F 1 expression [BCvH + 17]

(12 z 2 + 1) 2 dz dy and also the diagonal expression [MM16]

Using the last expression, q(M ) mod p can be computed in Õ(p 4 log M ) operations in F p . The same remark actually applies to all 19 × 4 -3 transcendental generating functions of the form Q(0, 0), Q(1, 0), Q(0, 1) and Q(1, 1) from [BCvH + 17, Theorem 2].