Abstract 1 Introduction 2 Preliminaries 3 -rational Polynomials 4 Beyond Polynomials 5 Outlook References

Commutative -Rational Series of Polynomial Growth

Aliaume Lopez ORCID University of Warsaw, Poland
Abstract

This paper studies which functions computed by -weighted automata can be realised by -weighted automata, under two extra assumptions: commutativity (the order of letters in the input does not matter) and polynomial growth (the output of the function is bounded by a polynomial in the size of the input). We leverage this effective characterization to decide whether a function computed by a commutative -weighted automaton of polynomial growth is star-free, a notion borrowed from the theory of regular languages that has been the subject of many investigations in the context of string-to-string functions during the last decade.

Keywords and phrases:
Rational series, weighted automata, polyregular function, commutative
Copyright and License:
[Uncaptioned image] © Aliaume Lopez; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Quantitative automata
; Theory of computation Transducers
Related Version:
Full Version: https://arxiv.org/abs/2404.02232 [11]
Funding:
Aliaume Lopez was supported by the Polish National Science Centre (NCN) grant “Polynomial finite state computation” (2022/46/A/ST6/00072).
Editors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim Thắng

1 Introduction

Given a semiring 𝕊, and a finite alphabet Σ, the class of (noncommutative) 𝕊-rational series is defined as functions from Σ to 𝕊 that are computed by 𝕊-weighted automata [1]. This computational model is a generalization of the classical notion of non-deterministic finite automata to the weighted setting, where transitions are labeled with elements of 𝕊. The semantics of 𝕊-weighted automata on a given word w is defined by the sum over all accepting runs reading w, of the product of the weights of the transitions taken along this run. In this paper, we are interested in the case where 𝕊 equals or , hence, in -rational series (𝖲𝖾𝗋𝗂𝖾𝗌) and -rational series (𝖲𝖾𝗋𝗂𝖾𝗌). It is clear that 𝖲𝖾𝗋𝗂𝖾𝗌 is a proper subclass of 𝖲𝖾𝗋𝗂𝖾𝗌, and a longstanding open problem is to provide an algorithm that decides whether a given 𝖲𝖾𝗋𝗂𝖾𝗌 is in 𝖲𝖾𝗋𝗂𝖾𝗌 [10].

Problem 1.

Input: A 𝖲𝖾𝗋𝗂𝖾𝗌 f. Output: Is f in 𝖲𝖾𝗋𝗂𝖾𝗌?

Problem 1 recently received attention in the context of polyregular functions (𝖯𝗈𝗅𝗒), a computational model that aims to generalize the theory of regular languages to the setting of string-to-string functions [2]. In the case of regular languages, star-free languages form a robust subclass of regular languages described equivalently in terms of first order logic [13], counter-free automata [13], or aperiodic monoids [16]. Analogously, there exists a star-free fragment of polyregular functions called star-free polyregular functions (𝖲𝖥) [2]. One open question in this area is to decide whether a given polyregular function is star-free.

Problem 2.

Input: A polyregular function f. Output: Is f star-free?

In order to approach decision problems on polyregular functions, restricting the output alphabet to a single letter has proven to be a fruitful method [6, 7]. Because words over a unary alphabet are canonically identified with natural numbers, unary output polyregular functions are often called -polyregular functions (𝖯𝗈𝗅𝗒), and their star-free counterpart star-free -polyregular functions (𝖲𝖥). Coincidentally, polyregular functions with unary output forms a subclass of -rational series, namely the class of -rational series of polynomial growth, i.e. the output of the function is bounded by a polynomial in the size of the input. In [5], the authors introduced the class of -polyregular functions (𝖯𝗈𝗅𝗒) as a subclass of -rational series that generalizes -polyregular functions by allowing negative outputs, and showed that membership in the star-free subclass 𝖲𝖥 inside 𝖯𝗈𝗅𝗒 is decidable [5, Theorem V.8]. Although this could not be immediately leveraged to decide 𝖲𝖥 inside 𝖯𝗈𝗅𝗒, it was conjectured that 𝖯𝗈𝗅𝗒𝖲𝖥=𝖲𝖥 [8, Conjecture 7.61]. It was believed that understanding the membership problem of 𝖯𝗈𝗅𝗒 inside 𝖯𝗈𝗅𝗒, that is, a restricted version of Problem 1, would be a key step towards proving 𝖯𝗈𝗅𝗒𝖲𝖥=𝖲𝖥, which itself would give hope in designing an algorithm for Problem 2. We illustrate in Figure 1 the known inclusions and related open problems between the discussed classes of functions.

Figure 1: Decidability and inclusions of classes of functions, arranged along two axes. The first one is the complexity of the output alphabet (, , Σ). The second one is the allowed computational power (star-free polyregular functions, polyregular functions, rational series). Arrows denote strict inclusions, and effectiveness (both in terms of decidability and of effective representation) is represented by thick double arrows. Inclusions that are suspected to be effective are represented using a dashed arrow together with a question mark.

Contributions.

In this paper, we work under the extra assumption of commutativity, that is, assuming that the function is invariant under the permutation of its input. In this setting, we prove that 𝖯𝗈𝗅𝗒𝖲𝖥=𝖲𝖥 [8, Conjecture 7.61] and design an algorithm that decides whether a function in 𝖯𝗈𝗅𝗒 is in 𝖯𝗈𝗅𝗒 [8, Open question 5.55]. As a consequence, the upper left square of Figure 1 has all of its arrows decidable and with effective conversion procedures under this extra assumption. Because -rational series with polynomial growth are exactly -polyregular functions [5], this can be seen as decision procedure for Problem 1 under the extra assumption of commutativity and polynomial growth. Similarly, our results provide an algorithm for Problem 2 under the extra assumption of commutativity and unary output alphabet.

As an intermediate step, we provide a complete and decidable characterization of polynomials in [X] that can be computed using 𝖲𝖾𝗋𝗂𝖾𝗌 (resp. 𝖲𝖾𝗋𝗂𝖾𝗌). These characterizations uncover a fatal flaw in the proof of a former characterization of such polynomials [10, Theorem 3.3, page 4]. We also prove that this previous results holds for polynomials with at most two indeterminates (Lemma 29), which may explain why it was not detected earlier. Furthermore, these characterizations provide effective descriptions of polynomials that can be expressed in 𝖲𝖾𝗋𝗂𝖾𝗌 as those obtained using integer combinations of products of binomial coefficients (called integer binomial polynomials, defined page 3) and similarly for 𝖲𝖾𝗋𝗂𝖾𝗌 by introducing the notion of strongly natural binomial polynomials (defined page 3.3), which we believe has its own interest. Finally, these characterizations demonstrate that polynomials expressible by 𝖲𝖾𝗋𝗂𝖾𝗌 (resp. 𝖲𝖾𝗋𝗂𝖾𝗌) are exactly those expressible by 𝖲𝖥 (resp. 𝖲𝖥), that is, polynomials are inherently star free functions.

Outline of the paper.

In Section 2, we provide a combinatorial definition of -polyregular functions (resp. -polyregular functions), show that one can decide if a function f𝖯𝗈𝗅𝗒 is commutative (Lemma 8). In Section 3, we provide a counterexample to the flawed result of [10, Theorem 3.3, page 4] (Lemma 15), and correct it by providing effective characterizations of polynomials computed by 𝖲𝖾𝗋𝗂𝖾𝗌 (Theorem 31) and 𝖲𝖾𝗋𝗂𝖾𝗌 (Theorem 34). Finally, in Section 4, we answer positively to [8, Open question 5.55] (Theorem 37) and to [8, Conjecture 7.61] (Theorem 40), both under the extra assumption of commutativity.

2 Preliminaries

The capital letters Σ,Γ denote fixed alphabets, i.e. finite set of letters, and Σ,Γ (resp. Σ+,Γ+) are the set of words (resp. non-empty words) over Σ,Γ. The empty word is written εΣ. When wΣ and aΣ, we let |w| be the length of w, and |w|a be the number of occurrences of a in w.

We assume that the reader is familiar with the basics of automata theory, in particular the notions of monoid morphisms, idempotents in monoids, monadic second-order (𝖬𝖲𝖮) logic and first-order (𝖥𝖮) logic over finite words (see e.g. [17]). As aperiodicity will be a central notion of this paper, let us recall that a monoid M is aperiodic whenever for all xM, there exists n such that xn+1=xn. If the monoid M is finite, this n can be uniformly chosen for all elements in M.

We use the notation {{}}:ΣΣ for the map that counts occurrences of every letter in the input word (that is, computes the Parikh vector) namely: {{w}}:=(a|w|a)aΣ. Given a set X, a function f:ΣX is commutative whenever for all uΣ, for all permutations σ of {1,,|w|}, f(σ(u))=f(u). Equivalently, it is commutative whenever there exists a map g:ΣX such that g{{}}=f.

Let k, and let Σ be a finite alphabet. Given a function η:{1,,k}Σ, we define the η:kΣ as η(x):=η(1)x1η(k)xk. A function f:kX is represented by a commutative function g:ΣX if there exists a map η:{1,,k}Σ such that gη=f. This notion will be useful to formally state that a polynomial “is” a commutative polyregular function. For instance, the polynomial function P(X,Y)=X×Y is represented by the commutative function g:{a,b} defined by g(w):=|w|a×|w|b.

2.1 Polynomials

A polynomial P[X1,,Xk] is non-negative when for all non-negative integer inputs n1,,nk0, the output P(n1,,nk) of the polynomial is non-negative. In the case of at most three indeterminates, we use variables X,Y,Z instead of X1,X2,X3 to lighten the notation. Beware that we do not consider negative values as input, as the numbers ni will ultimately count the number of occurrences of a letter in a word. As an example, the polynomial (XY)2 is non-negative, and so is the polynomial X3, but the polynomial X22X is not.

A monomial is a product of indeterminates and integers. For instance, XY is a monomial, 3X is a monomial, Y is a monomial, but X+Y and 2X2+XY are not. Every polynomial P[X1,,Xn] decomposes uniquely into a sum of monomials. A monomial S divides a monomial T, when S divides T seen as polynomials in . For instance, 2X divides XY, YZ divides X2YZ3, and Y does not divide X. In the decomposition of P[X1,,Xk], a monomial is a maximal monomial if it is a maximal element for the divisibility preordering of monomials. In the polynomial P(X,Y):=X22XY+Y2+X+Y, the set of maximal monomials is {X2,2XY,Y2}. For instance, the non-negative monomials of P(X,Y):=(XY)2 are X2 and Y2.

2.2 Polyregular Functions

Because the functions of interest in this paper have output in or , we will only provide the definition of polyregular functions for these two output semigroups, and we refer the reader to [3] for the general definition of polyregular functions and their aperiodic counterpart, the star-free polyregular functions. We chose in this paper to provide a combinatorial description of polyregular functions with commutative outputs because it will play nicely with our analysis on polynomials. This description is very similar in shape to the finite counting automata introduced by [15].

Definition 3 (-polyregular functions [5]).

Let d. The set 𝖯𝗈𝗅𝗒d of polyregular -polyregular functions of degree at most d, is the set of functions f:Σ such that there exists a finite monoid M, a morphism μ:ΣM, and a function π:Md+1 satisfying for all wΣ:

f(w)=π(w):=w=u1ud+1π(μ(u1),,μ(ud+1)).

We call π the production function of f. If the function π has codomain , then f is -polyregular of degree at most d, i.e., f𝖯𝗈𝗅𝗒d. If the monoid M is aperiodic then the function f is star-free -polyregular (𝖲𝖥d), resp. star-free -polyregular (𝖲𝖥d).

We complete Definition 3 by letting 𝖯𝗈𝗅𝗒:=d𝖯𝗈𝗅𝗒d, and similarly for 𝖯𝗈𝗅𝗒, 𝖲𝖥, and 𝖲𝖥. In order to illustrate these definitions, let us provide an example of an -polyregular function computed using a finite monoid in Example 4. Let us also introduce in Example 5 a function that serves as an example of division computed by a -polyregular function.

Example 4.

The map f:w|w|+1 belongs to 𝖲𝖥1.

Proof.

Let us define M:=({1},×) which is a finite aperiodic monoid, μ:ΣM defined by μ(w):=1, and π:M2 that is the constant function equal to 1. We check that for all wΣ: π(w)=uv=w1=|w|+1=f(w).

Example 5.

Let f:Σ be the function that maps a word w to the number of distinct pairs of positions in w, i.e., f(w)=(|w|2)=|w|(|w|1)/2. Then, f𝖲𝖥2.

Proof.

Let us remark that the set Pw of distinct pairs of positions i<j in a word w is in bijection with the set Dw of decompositions of the form w=xyz, where x and y are non-empty, via the map (i,j)(w1,i,wi+1,j,wj+1,|w|). Let us write M:=({0,1},max) which is a finite aperiodic monoid, and μ:ΣM that maps the empty word ε to 0 and the other words to 1. Then, let us define π:M3 via π(x,y,z)=x×y. We conclude because:

π(w) :=xyz=wπ(μ(x),μ(y),μ(z))=xyz=wxεyε1=|Dw|=|Pw|=f(w).

One of the appeals of 𝖯𝗈𝗅𝗒 and 𝖯𝗈𝗅𝗒 are the numerous characterizations of these classes in terms of logic, weighted automata, and the larger class of polyregular functions [5, 8]. In this paper, the main focus will be the connection to weighted automata, which is based on the notion of growth rate. The growth rate of a function f:Σ is defined as the minimal d such that |f(w)|=𝒪(|w|d). If such a d exists, we say that the function f has polynomial growth. It turns out that for all k, 𝖯𝗈𝗅𝗒d (resp. 𝖯𝗈𝗅𝗒d) are precisely functions in 𝖲𝖾𝗋𝗂𝖾𝗌 (resp. in 𝖲𝖾𝗋𝗂𝖾𝗌) that have growth rate at most d.

Lemma 6 ([8, Theorem 5.22]).

Let f𝖲𝖾𝗋𝗂𝖾𝗌. The following are equivalent:

  1. 1.

    f𝖯𝗈𝗅𝗒d.

  2. 2.

    f has polynomial growth of degree at most d.

And similarly for 𝖯𝗈𝗅𝗒 and 𝖲𝖾𝗋𝗂𝖾𝗌.

Let us introduce some compositional properties of -polyregular functions that will be used in this paper to construct -polyregular functions.

Lemma 7 ([5, Theorem II.20]).

Let d1, f,g𝖯𝗈𝗅𝗒d (resp. 𝖯𝗈𝗅𝗒d, 𝖲𝖥d, 𝖲𝖥d), L be a star-free language over Σ, and h:ΣΓ be a polyregular function (resp. a star-free polyregular function). Then, the following are also in 𝖯𝗈𝗅𝗒d (resp. 𝖯𝗈𝗅𝗒d, 𝖲𝖥d, 𝖲𝖥d): fh, f+g:=wf(w)+g(w), f×g:=wf(w)×g(w), 𝟏L×f. Furthermore, the above constructions preserve commutativity.

Let us briefly state that commutativity is a decidable property of -rational series, hence of -polyregular functions. As a consequence, we are working inside a relatively robust and decidable subclass of -rational series.

Lemma 8.

Let f𝖲𝖾𝗋𝗂𝖾𝗌. One can decide if f is commutative.

Proof.

Remark that the group of permutations of {1,,n} is generated by the cycle c:=(n,1,,n1) and the transposition t:=(1,2). As a consequence, a function f is commutative if and only if fc=f=ft. When f is a rational series, fc and ft are both rational series that can be effectively computed from f,111 This can be done by guessing the second (resp. last) letter of the input word, remembering the first letter in a state, and then running the original automaton for f on the modified input, checking at the second position (resp. the end of the word) if the guess was correct. and since equivalence of rational series is decidable [1, Corollary 3.6], we have obtained a decision procedure.

3 -rational Polynomials

In this section, we will completely characterize which polynomials in [X] are represented by -rational series (resp. -rational series). To that end, we start by characterizing these classes for polynomials in [X]. We say that a polynomial P[X1,,Xn] is an -rational polynomial if it is represented by a -rational series. It is an easy check that polynomials with coefficients in are -rational polynomials (Lemma 9). However, Example 10 provides a polynomial with negative coefficients that is an -rational polynomial. The problem of characterizing -rational polynomials was claimed to be solved in [10], using the Definition 11 to characterize -rational polynomials, as restated in Flawed 12.

Lemma 9.

Let P[X]. Then, P is an -rational polynomial.

Example 10.

The polynomials X, X2+3, and X22X+2 are -rational polynomials, but X is not an -rational polynomial.

Definition 11 ([10, Section 3, page 3]).

The class 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀[X] is the class of polynomials P[X] that are non-negative and such that every maximal monomial is non-negative. When the indeterminates are clear from the context, we write this class 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀.

Flawed Theorem 12 ([10, Theorem 3.3, page 4]).

Let P[X] be a polynomial. Then, P is an -rational polynomial if and only if P𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀.

Before giving a counterexample to the above statement, let us first exhibit in Example 14 some non-negative polynomial that is not an -rational polynomial. While the example will not be in 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀, it illustrates the key difference between non-negative polynomials and -rational polynomials. In order to derive this example, we will need the following fundamental result about the pre-image of regular languages by polyregular functions.222 In this particular case, one could have considered more generally -rational series, and replaced regular languages over a unary alphabet by semi-linear sets. Before that, let us remark that if a polynomial P is represented by a -rational series, then it is in fact represented by a -polyregular function thanks to Lemma 6.

Theorem 13 ([2, Theorem 1.7]).

The pre-image of a regular language by a (string-to-string) polyregular function is a regular language.

Example 14.

Let P(X,Y):=(XY)2. Then P is non-negative, but is not an -rational polynomial. Indeed, assume by contradiction that f𝖯𝗈𝗅𝗒 represents P over the alphabet Σ:={a,b}. Then, f1({0}) is a regular language (Theorem 13), but f1({0})={wΣ|w|a=|w|b} is not.

Please note that the same argument cannot be leveraged for proving that P is not representd by a -rational series: Theorem 13 only holds for string-to-string functions, and is applied to the specific case where the output alphabet is {1}, i.e., where the output of the function belongs to {1} which is isomorphic to .

Let us now design a counterexample to Flawed 12 by suitably tweaking Example 14 to ensure that the polynomial not only is non-negative, but also belongs to 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀. We define 𝖯𝖻𝖺𝖽(X,Y,Z):=Z(X+Y)2+2(XY)2.

Lemma 15.

The polynomial 𝖯𝖻𝖺𝖽 belongs to 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀, but is not an -rational polynomial. As a corollary, [10, Theorem 3.3], restated in Flawed 12, is false when allowing at least 3 indeterminates.

Proof.

It is clear that 𝖯𝖻𝖺𝖽 is non-negative. We can expand the expression of 𝖯𝖻𝖺𝖽 to obtain 𝖯𝖻𝖺𝖽=ZX2+ZY2+2ZXY+2X24XY+2Y2. The maximal monomials of P are ZX2, ZY2, and 2ZXY, all of which are non-negative.

Assume by contradiction that 𝖯𝖻𝖺𝖽 is an -rational polynomial. Let Σ:={a,b,c} be a finite alphabet. There exists a commutative -polyregular function f:Σ such that for all wΣ, 𝖯𝖻𝖺𝖽(|w|a,|w|b,|w|c)=f(w). Remark that for all x,y,z0, 𝖯𝖻𝖺𝖽(x,y,z)=0 if and only if z(x+y)2=2(xy)2. Hence, 𝖯𝖻𝖺𝖽(x,y,z)=0 if and only if z=0 and x=y, or z0, and x=y=0. Now, let us consider the language L:={wf(w)=0}. By the above computation, we conclude that L={w{a,b}|w|a=|w|b}{c}. Because L{a,b} is not a regular language, we conclude that L is not a regular language. However, L=f1({0}) is a regular language (Theorem 13).

We will discuss at the end of Section 3.2 why Lemma 15 is minimal in the number of indeterminates, which first requires us to provide a correct analogue of Flawed 12. Our counterexample relies on the fact that 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀 is not stable under fixing indeterminates, while -rational polynomials are. Indeed, the polynomial 𝖯𝖻𝖺𝖽 satisfies 𝖯𝖻𝖺𝖽(X,Y,1)=3X2+3Y22XY, which has a negative coefficient for a maximal monomial. Let us now prove that closing 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀 under variable assignments is enough to recover from Flawed 12. We use the following notation to fix the value of some indeterminate, if P(X,Y) is a polynomial in [X,Y], then [P(X,Y)]X=1 is the polynomial P(1,Y)[Y]. More generally, if ν is a partial function from X to , written ν:X, the restriction [P(X)]ν is the polynomial with indeterminates Y:=Xdom(ν) obtained by fixing the variables of the domain of ν.

Definition 16.

The class 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀[X] is the collection of polynomials P[X] such that, for every partial function ν:X, every maximal monomial of [P]ν is non-negative.

First, let us remark that 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀, because polynomials in 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 are non-negative. We also remarked at the beginning of this section that our counterexample 𝖯𝖻𝖺𝖽 provided in Lemma 15 is not in 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀. The rest of the section is mainly concerned with proving the following corrected version of Flawed 12.

Theorem 17.

Let P[X]. The following are equivalent:

  1. 1.

    P𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀,

  2. 2.

    P is represented by a -rational series,

  3. 3.

    P is represented by a -polyregular function,

  4. 4.

    P is represented by a star-free -polyregular function,

Furthermore, the properties are decidable, and conversions effective.

Theorem 17 is surprising given the fact that it is not possible to decide whether a polynomial P[X] is non-negative or if a polynomial P belongs to 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀 (Remark 18), by reduction to the undecidability of Hilbert’s Tenth Problem [9, 12]. That is, 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 is a decidable class that strictly contains [X], and is contained in the undecidable classes 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀 and the class of non-negative polynomials.

 Remark 18.

Checking whether a polynomial P[X] is non-negative is undecidable. Similarly, checking whether a polynomial P[X] belongs to 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀 is undecidable.

The proof of Theorem 17 is divided into two parts. First, we provide in Section 3.1 a fine combinatorial understanding of what functions can be computed in 𝖯𝗈𝗅𝗒 and 𝖯𝗈𝗅𝗒. This allows us to prove that -polyregular functions are in 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 (Corollary 22). Then, in Section 3.2 we will show how to compute polynomials in 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 using 𝖯𝗈𝗅𝗒 (Lemma 26). Finally, we will next generalize Theorem 17 to polynomials in [X] in Section 3.3.

3.1 From -polyregular functions to polynomials

Let us prove that -rational polynomials are in 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀. This fact follows from the correct implication in the statement of Flawed 12, but we provide a self-contained proof using a refinement of the classical combinatorial pumping arguments for 𝖯𝗈𝗅𝗒 [5, Lemma 4.16] and 𝖯𝗈𝗅𝗒 [8, Lemma 5.37]. We take extra care to reprove in our upcoming Lemma 20 a strong statement that has two main goals. Our first goal is to highlight the role of commutative polyregular functions in the broader study of polyregular functions, which is done by reformulating the traditional pumping argument as a composition property involving said functions, which will be reused in the upcoming Definitions 35 and 39 of Section 4. Our second goal is to give a precise shape of the functions that arise from such pumping arguments, which was lacking in former similar statements.

To address our first goal, let us define that a function q is a pumping pattern from p to Σ whenever there exists words α0,,αpΣ, and words u1,,upΣ, such that q(X1,,Xp)=α0i=1puiXiαi. That is, q is syntactically defined by a non-commutative monomial over the monoid Σ. Pumping patterns are commutative polyregular functions.

Our second goal is achieved by understanding that -polyregular functions essentially compute binomial coefficients, as illustrated by the polynomial X(X1)/2=(X2) of Example 5. A simple binomial function is a function of the form (Xk), where and k are natural numbers. We extend this to natural binomial functions that are obtained by considering -linear combinations of products of simple binomial functions, that is, we consider functions that have the following shape: f(x1,,xk)=i=1nnij=1k(xjpi,jki,j). Beware that (Xk) is defined to be 0 when X, and is therefore not a polynomial. Let us immediately prove that simple binomial functions can be represented in 𝖲𝖥, generalizing Example 5. Conversely, we prove in Lemma 20 that, when suitably pumping a -polyregular function, one always obtains natural binomial functions.

Lemma 19.

Let F be a simple binomial function from k to . Then it is represented by a star-free polyregular function.

Proof.

Because of the stability properties of 𝖲𝖥 (Lemma 7), we only need to check that given r,s, the function x(xrs) is represented by a function fr,s𝖲𝖥. Let us prove it when r=0, since the other functions can be obtained by translating fr,s. By definition, (xs)=|Px,s|, where Px,s:={(x1,,xs)s1x1<<xsx}. Let us proceed as in Example 5 and define Dw,s:={(u1,,us,us+1)(Σ+)s×Σw=u1u2usus+1}. It is clear that Dax,s is in bijection with Px,s for all x using the map (x1,,xs)(ax1,,axs). Now, using the monoid M:=({0,1},max) and the morphism μ(ε):=0 and μ(a):=1, one can compute |Dw,s| as π(w) where π:Ms+1 is defined by π(m1,,ms,ms+1):=m1××ms. We conclude that f0,s𝖲𝖥s is a star-free polyregular function.

Lemma 20.

Let f be an -polyregular function. There exists a computable ω1 such that for all pumping patterns q:pΣ, there exists a computable natural binomial function F such that:

fq(ωX1,,ωXp)=F over (1)p.

The multiplicative factor ω is necessary in Lemma 20. Indeed, the function f:{a} defined as 0 when the input is of odd length and 1 when the input is of even length is -polyregular, but f(aX) is not a polynomial. We can trade off this multiplicative factor for a constant term addition under the extra assumption that the function is star-free polyregular, as described in the following Lemma 21. This lemma is not immediately of use, but is crucial for the upcoming characterization of -rational polynomials in Theorem 34, which in turn is a key ingredient of our main Theorem 40.

Lemma 21.

Let f be a star-free -polyregular function. There exists a computable s1 such that for all pumping patterns q:pΣ, there exists a computable natural binomial function F such that:

fq(X1+s,,Xp+s)=F over p.

Because natural binomial functions behave as polynomials with non-negative maximal monomials on large enough inputs, we can conclude from Lemma 20 that -rational polynomials are in 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀.

Corollary 22.

Let P[X1,,Xp] be an -rational polynomial. Then, P𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀.

Proof.

Let f be a commutative -rational series with domain defined as Σ:={a1,,ap} that represents P. Because f has polynomial growth, f𝖯𝗈𝗅𝗒 (Lemma 6). Using Lemma 20, there exists a number ω1 and natural binomial function Q such that for all n1,,np1:

f(i=1paiωni)=Q(n1,,np)=P(ωn1,,ωnp).

For large enough values of X, the simple binomial function (Xpk) coincides with a polynomial whose leading coefficient is 1/k! which is non-negative. We conclude that the maximal monomials of P(ωX1,,ωXp) are non-negative, and since ω1, we conclude that the maximal monomials of P have non-negative coefficients.

For every partial valuation ν:X, the polynomial [P]ν continues to be represented by a -polyregular function, namely fu:wf(uw) where w belongs to a restricted alphabet. As a consequence, the maximal monomials of [P]ν are also non-negative, and we have proven that P𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀.

3.2 From polynomials to -polyregular functions

This section is devoted to proving that polynomials in 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 can be represented by star-free -polyregular functions. The key lemma of this section is Lemma 26, which is proved by induction on the number of indeterminates of a given polynomial P. In order to prove that result, we use the combinatorial Lemma 25 that allows us to transform a polynomial P𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 into a polynomial in [X] through a well-chosen translation of the indeterminates. This argument is based on the notion of discrete derivative which is built by translating the domain of the polynomial. To that end, let us write τK for the translation function that maps a polynomial P[X1,,Xk] to the polynomial P(X1+K,,Xk+K).

Definition 23.

Let K, and P[X] be a polynomial, then ΔK(P):=τK(P)P.

Lemma 24.

Let P[X] that is non-constant, and K, then ΔK(P)[X] and all of its coefficients are (positive) multiples of K. Furthermore, every monomial that strictly divides some monomial of P appears in ΔK(P).

Proof.

We prove the result for monomials, as it extends to -linear combinations by linearity. Let P=i=1kXiαi be a monomial. Notice that τK(P)=i=1k(Xi+K)αi, and using a binomial expansion we list all the possible divisors of P, all of which with coefficients that are positive integers and multiples of K except the coefficient of the maximal monomial (equal to P itself) which is 1. As a consequence, τK(P)P is simply obtained by removing this maximal monomial, which concludes the proof.

Lemma 25.

Let P𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀, P1 be the sum of maximal monomials of P, and P2:=PP1 be the sum of non-maximal monomials of P. There exists a computable number K, such that Q:=(ΔK(P1)+τK(P2))[X].

Proof.

Let us first tackle the specific case where P is a constant polynomial. In this case, P1=P and P2=0. Furthermore, ΔK(P1)=0 for all K. We conclude that ΔK(P1)+τK(P2)=0 for all K, hence belongs to [X]. Selecting K=0 we conclude. Assume now that P is not a constant polynomial. We will use Lemma 24 on a well-selected value of K. Let us write α to be the maximal absolute value of a coefficient in P. Let D be the number of unitary monomials that divide some monomial appearing in P. We can now define K:=D×α, and let Q:=(ΔK(P1)+τK(P2)). Remark that ΔK(P1) is already in [X], and the constant coefficient of τK(P2) is also in . For any other monomial of P2, by the maximality of P1, it strictly divides some monomial of P1, and equals some monomial of ΔK(P1) up to a multiplication by a factor in . Because every monomial of ΔK(P1) has a coefficient that is a multiple of K=α×D, we can compensate every monomial of P2 by a monomial of ΔK(P1). Therefore, Q[X].

Lemma 26.

Let P[X]. If P𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀, then P is represented by a star-free -polyregular function, which is computable given P.

Proof.

We prove the result by induction on the number of indeterminates of P. In the proof, we write X for the indeterminates appearing in P, that is, we assume without loss of generality that all indeterminates are used.

Base case: If the (unique) maximal monomial of P is a constant term. Since P𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀, P=n, and therefore P is represented by a constant star-free -polyregular function.

Induction: Assume that P is not a constant polynomial, and let us write P=P1+P2 where P1 is the sum of the maximal monomials of P. We compute a bound K such that Q:=(ΔK(P1)+τK(P2))[X] (Lemma 25). In particular, Q is represented by a star-free -polyregular function using Lemma 9, the latter being effectively computable from Q. Let us now remark that P1[X], and is therefore (effectively) represented by a star-free -polyregular function (using again Lemma 9). As a consequence, τK(P)=P1+Q is (effectively) represented by a function fΔ.

For all partial valuations ν:X{0,,K} fixing at least one indeterminate, one can use the induction hypothesis to compute a star-free -polyregular function fν that represents [P]ν. This is possible because we assumed that all indeterminates in X are used in P.

Let us assume that the alphabet over which the (commutative) functions fΔ and fν are defined is {a1,,ak}, with ai representing the indeterminate Xi of the polynomials. Now, let us define by case analysis the following commutative star-free -polyregular function, defined on words w of the form w:=a1x1akxk, with x1,,xk0.

f(w):={f[Xixi](w) if i{1,,k},xiKfΔ(a1x1KakxkK) otherwise .

Remark that f is a commutative star-free -polyregular function that represents P.

While Lemma 26 provides an effective conversion procedure, it does not explicitly state that the membership is decidable to keep the proof clearer. A similar proof scheme can be followed to conclude that membership is decidable, and even show that elements in 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 are, up to suitable translations, polynomials in [X] (Lemma 27). Beware that partial applications are still needed in this characterization, as Example 28 illustrates.

Lemma 27.

Let P[X]. There exists a computable number K such that the following are equivalent:

  1. 1.

    P𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀,

  2. 2.

    for all partial functions ν:X, τK([P]ν)[X],

  3. 3.

    for all partial functions ν:X{0,,K}, τK([P]ν)[X].

In particular, the above properties are decidable.

Example 28.

The polynomial 𝖯𝖻𝖺𝖽 is not a -rational polynomial, but is non-negative and satisfies τ10(𝖯𝖻𝖺𝖽)[X].

We now have all the tools to prove the corrected version of Flawed 12.

Proof of Theorem 17 on page 17.

The implications Item 4 Item 3 Item 2 are obvious. Lemma 26 proves Item 1 Item 4, while Corollary 22 proves Item 2 Item 1. Note that the lemmas provide effective conversion procedures, and that Lemma 27 also provides a decision procedure.

For completeness, let us remark that the counterexample of Lemma 15 uses three indeterminates, and this is not a coincidence: in the particular cases of one or two indeterminates, the classes 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 and 𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀 coincide. In particular, the examples appearing in [10] are not invalidated, as they all use at most two indeterminates. Note that the equivalence is clear for the univariate case, where being non-negative and having non-negative maximal coefficient clearly imply being an -rational polynomial.

Lemma 29.

𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀[X,Y]=𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀[X,Y].

Proof.

It is clear that 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀[X,Y]𝖯𝗈𝗅𝗒𝖭𝖭𝖾𝗀[X,Y], by considering the empty valuation ν:{X,Y}. For the converse inclusion, let us consider P(X,Y) that is non-negative, such that the maximal monomials are non-negative.

If we fix none of the variables, then the maximal monomials are non-negative by assumption. If we fix one of the variables, we can assume without loss of generality that we fix X=k for some k. Then P(k,Y) is a non-negative univariate polynomial, and therefore must either have a positive leading coefficient (which is the unique maximal monomial in this case) or be constant equal to 0. In both cases, the maximal monomials have positive coefficient. The same reasoning applies a fortiori in the case where we fix the two indeterminates, leading to a constant polynomial.

3.3 From to

Let us complete our analysis of polynomials represented by 𝖲𝖾𝗋𝗂𝖾𝗌 or 𝖲𝖾𝗋𝗂𝖾𝗌 by considering polynomials with coefficients in , and justify that all the combinatorial work has already happened in and . From Lemma 21, we know that the polynomials that can be computed by star-free -polyregular functions are going to coincide (on large enough inputs) with natural binomial functions. For that reason, we introduce the following “polynomial counterpart” of a binomial coefficient: given two numbers ,k, (Xk) defined as (X)(Xk)/k!,333 In particular, (Xk) is defined to be 1 when k=0, and X when k=1. that we call a binomial monomial, and we introduce natural binomial polynomials as -linear combinations of products of binomial monomials, i.e., of the shape: P(X1,,Xk)=i=1nnij=1k(Xjpi,jki,j). Similarly, we introduce the class of integer binomial polynomials, which are obtained by -linear combinations of products of binomial monomials.

These definitions are justified by the classical result of Pólya that characterizes polynomials P in [X] that are integer-valued (i.e., are such that P()) as integer binomial polynomials [14, 4]. Note that this result straightforwardly extends to multiple indeterminates as we prove in Lemma 30.

Lemma 30.

Let P[X1,,Xk] be a polynomial. Then, P is an integer binomial polynomial if and only if P(k), if and only if P(k).

As an immediate corollary, we completely characterize the class of polynomials in [X] that are represented by 𝖯𝗈𝗅𝗒 as the integer binomial polynomials.

Theorem 31.

Let P[X]. Then, the following properties are equivalent:

  1. 1.

    P is integer-valued,

  2. 2.

    P is represented by a -rational series,

  3. 3.

    P is represented by a -polyregular function,

  4. 4.

    P is represented by a star-free -polyregular function,

  5. 5.

    P is an integer binomial polynomial.

These properties are furthermore decidable.

Proof.

The implications Item 4 Item 3 Item 2 Item 1 are obvious. Now, Item 1 Item 5 is a direct consequence of Lemma 30. Finally, Item 5 Item 4 follows from the fact that (Xpk) is represented by a star-free -polyregular function defined by hardcoding the output values (in ) when 0Xp, and using a star-free -polyregular function when X>p (Lemma 19). Because 𝖲𝖥 is closed under products and -linear combinations, we conclude.

Obtaining an analogue of Theorem 31 for -polyregular functions requires a bit more work, as polynomials in [X] that are represented by 𝖯𝗈𝗅𝗒 are not exactly natural binomial polynomials (see Example 32). To address the issues raised by the former example, we introduce the notion of strongly natural binomial polynomials, as the polynomials P[X] such that for all partial valuation ν:, [P]ν is a natural binomial polynomial, which characterizes the class of polynomials that are represented by 𝖯𝗈𝗅𝗒 (Theorem 34).

Example 32.

The polynomial Q(X,Y,Z):=(X41)(Y1)(Z1)+8(Y2)+8(Z2)+4 is a non-negative natural binomial polynomial in [X,Y,Z], but cannot be computed by a star-free -polyregular function. Indeed, Q(0,Y,Z) has a negative maximal monomial, hence Q𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀, and we conclude using Theorem 17.

Lemma 33.

Let P[X] be an integer-valued polynomial, and n1 be such that nP𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀. Then, P is a strongly natural binomial polynomial.

Theorem 34.

Let P[X] be a polynomial with rational coefficients and let α be the smallest number in 1 such that αP[X]. Then, the following are equivalent:

  1. 1.

    αP𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 and P is integer-valued,

  2. 2.

    P is represented by a -rational series,

  3. 3.

    P is represented by a -polyregular function,

  4. 4.

    P is represented by a star-free -polyregular function,

  5. 5.

    P is a strongly natural binomial polynomial.

In particular, the properties are decidable.

Proof.

Let us first remark that 𝖯𝗈𝗅𝗒𝖲𝖾𝗋𝗂𝖾𝗌, and that if P is represented by a function f𝖲𝖾𝗋𝗂𝖾𝗌, then said function has polynomial growth, and in particular f𝖯𝗈𝗅𝗒 thanks to Lemma 6. As a consequence, Item 2 Item 3. For the implication Item 3 Item 1, we obtain αP𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀 via Theorem 17 by remarking that -polyregular functions have output in and are closed under multiplication by a constant α. The fact that P is integer-valued follows from Theorem 31 and the fact that 𝖲𝖥𝖯𝗈𝗅𝗒. The implication Item 1 Item 5 is obtained thanks to Lemma 33.

Let us now prove by induction on the number of indeterminates that Item 5 Item 4. Note that by construction, there exists a number K such that when the input values of P are all greater than K, P coincides with a natural binomial function, which is itself represented by a star-free -polyregular function. If some input value Xi is set to a number xiK, then one can leverage the fact that [P]Xi=xi remains a strongly natural binomial polynomial to conclude by induction that [P]Xi=xi is represented by a star-free -polyregular function. Combining these, we obtain a star-free -polyregular function representing P.

Finally, the implication Item 4 Item 3 is immediate as 𝖲𝖥𝖯𝗈𝗅𝗒.

Let us remark that Theorem 34 shows that the class of polynomials represented by 𝖯𝗈𝗅𝗒 is the same as the class of polynomials represented by 𝖲𝖥, which is a non-trivial statement that will be reused in the study of more general commutative functions in 𝖯𝗈𝗅𝗒.

4 Beyond Polynomials

In this section, we leverage the decidability results of Section 3 to decide membership in 𝖯𝗈𝗅𝗒 inside 𝖯𝗈𝗅𝗒 and membership in 𝖲𝖥 inside 𝖯𝗈𝗅𝗒, both under the extra assumption of commutativity. To characterize 𝖯𝗈𝗅𝗒 inside 𝖯𝗈𝗅𝗒 we introduce the notion of (k,)-combinatorial function (Definition 35), following the spirit of revious characterizations of subclasses of 𝖯𝗈𝗅𝗒 in terms of polynomial pumping arguments [6, 7, 5].

Definition 35.

Let k, and f:Σ be a -polyregular function. The function f is (k,)-combinatorial if there exists ω, such that for all pumping patterns q:kΣ, there exists a strongly natural binomial polynomial P satisfying:

fq(ωX1,,ωXk)=P over (1)k.

Let us now introduce a decomposition of commutative -polyregular functions into integer binomial polynomials. Given a number ω, let us write ω𝖳𝗒𝗉𝖾𝗌k for the collection of pairs (S,r) where S{1,,k} and r{0,,ω1}k. To a tuple xk, one can associate its ω-type, written ω𝗍𝗒𝗉𝖾(x), which is the pair (S,r) where S={i{1,,k}xiω} and r=(ximodω)i{1,,k}.

Lemma 36.

Let f:Σ be a commutative -polyregular function, where we fix the alphabet Σ={a1,,ak}. There exists a computable ω1, and computable integer binomial polynomials P(S,r)[(Xi)iS] for (S,r)ω𝖳𝗒𝗉𝖾𝗌k, such that for all xk,

f(i=1kaixi)=P(S,r)((xi/ω)iS) where (S,r)=ω𝗍𝗒𝗉𝖾(x).
Theorem 37.

Let k,d, and f𝖯𝗈𝗅𝗒d be commutative over an alphabet of size k. Then, the following are equivalent:

  1. 1.

    f is (k,)-combinatorial,

  2. 2.

    f𝖯𝗈𝗅𝗒d,

Furthermore, the properties are decidable, and conversions effective.

Proof.

Let f𝖯𝗈𝗅𝗒d be commutative over an alphabet of size k. We apply Lemma 36 to compute an ω and integer binomial polynomials (P(S,r))(S,r)ω𝖳𝗒𝗉𝖾𝗌k such that for all xk, f(i=1kaixi)=P(S,r)((xi/ω)iS), where (S,r)=ω𝗍𝗒𝗉𝖾(x). We are first going to prove that f𝖯𝗈𝗅𝗒d if and only if P(S,r) is a strongly natural binomial polynomial for all (S,r)ω𝖳𝗒𝗉𝖾𝗌k. This will also provide decidability of Item 2, since one can decide whether a polynomial is strongly natural binomial polynomial using Theorem 34.

Assume that f𝖯𝗈𝗅𝗒, then by definition, the polynomials P(S,r) are represented by an -polyregular function, hence are strongly natural binomial polynomials (Theorem 34). Conversely, if P(S,r) is a strongly natural binomial polynomial for all (S,r)ω𝖳𝗒𝗉𝖾𝗌k, then f𝖯𝗈𝗅𝗒 because one can compute the ω-type of the input using a polyregular function, and then compute the suitable strongly natural binomial polynomial P(S,r) which is possible in 𝖯𝗈𝗅𝗒 thanks to Theorem 34. The resulting composition belongs to 𝖯𝗈𝗅𝗒 thanks to Lemma 7, and we conclude that f𝖯𝗈𝗅𝗒d because it has growth rate at most d (Lemma 6).

Note that the same proof scheme can be used to conclude that Item 2 implies Item 1. For the converse implication, we are going to introduce ω2 associated to the fact that f is (k,)-combinatorial. Because polynomials represented by -polyregular functions and integer binomial polynomials are both closed under multiplication of their input by a constant factor, we can assume that ω=ω2 in the decomposition of f. Now, consider (S,r)ω𝖳𝗒𝗉𝖾𝗌k. Notice that for all vectors x(1)k, the vector (x1ω𝟏S(1)+r1,,xkω𝟏S(k)+rk) has ω-type (S,r). In particular, the following equality holds:

f(i=1kaixiω𝟏S(i)+ri)=P(S,r)((xi)iS)x(1)k.

Let us therefore consider the pumping pattern q:kΣ that is simply defined as q(X1,,Xk):=i=1kaiXi𝟏S(i)+ri. Because f is (k,)-combinatorial with parameter ω, there exists a strongly natural binomial polynomial P[X1,,Xk] such that fq(ωX1,,ωXk)=P(X1,,Xk) over (1)k. This proves that P(S,r)((Xi)iS) equals P(X1,,Xk) as polynomials, hence, that P(S,r) is a strongly natural binomial polynomial for all (S,r)ω𝖳𝗒𝗉𝖾𝗌k. We have proven that f𝖯𝗈𝗅𝗒d.

It was already known that -polyregular functions with unary input that are non-negative are -polyregular [1, Proposition 2.1 p 137]. Let us derive this fact from our Theorem 37.

Corollary 38.

Let f:{a} be a non-negative -polyregular function, then f𝖯𝗈𝗅𝗒.

Proof.

Since f has unary input, it is commutative. Furthermore, f is (1,)-combinatorial because for all q:{a} and all ω1, f(q(ωX)) is non-negative. When it is a polynomial function, it therefore belongs to 𝖯𝗈𝗅𝗒𝖲𝗍𝗋𝖭𝖭𝖾𝗀, hence is a strongly natural binomial polynomial. We conclude using Theorem 37.

Let us now prove that the above characterizations of commutative -polyregular functions can be combined with the recent advances in the study of -polyregular functions [5] allowing to decide the membership of 𝖲𝖥 inside 𝖯𝗈𝗅𝗒. The key ingredient of this study is the use of a semantic characterization of star-free -polyregular functions among -rational series that generalizes the notion of aperiodicity for languages to functions.

Definition 39 (Ultimately polynomial).

Let Σ be a finite alphabet. A function f:Σ is ultimately polynomial when there exists N0 such that for all k, for all pumping pattern q:kΣ, there exists a polynomial P[X1,,Xk] such that:

fq=P over (N0)k.

It was observed in [5, Claim V.6], and in [8, Claim 7.45, Lemma 7.53] that a regular language L is star-free if and only if its indicator function 𝟏L is ultimately polynomial. We can now answer [8, Conjecture 7.61] positively, by proving that 𝖯𝗈𝗅𝗒𝖲𝖥=𝖲𝖥.

Theorem 40.

Let Σ be a finite alphabet, and f:Σ be a commutative -polyregular function. Then, the following are equivalent:

  1. 1.

    f is ultimately polynomial,

  2. 2.

    f𝖲𝖥,

  3. 3.

    f𝖲𝖥.

Furthermore, membership is decidable and conversions are effective.

Proof.

The implication Item 3 Item 2 is immediate since 𝖲𝖥𝖲𝖥. Furthermore, Item 2 implies Item 1 following previous results for star-free -polyregular functions [5, Theorem V.13].

For the implication Item 1 Item 3, let us assume that f is ultimately polynomial. We prove the result by induction on the size of the alphabet Σ. By definition, there exists N0, and P[(Xa)aΣ] such that:

f(aΣaxa)=P((xa)aΣ)x(N0)Σ.

It is clear that τN0(P) is represented by an -polyregular function, namely, fu:wf(uw) where u:=aΣaN0, and is therefore represented by a star-free -polyregular function thanks to Theorem 34. For every letter aΣ and number 0nN0, there exists, by induction hypothesis, a star-free -polyregular function gan that represents the function fan:(Σ{a}) that maps w(Σ{a}) to f(anw).

Let us conclude by computing f using the following star-free -polyregular function g:Σ:

g:w{gan(w) if |w|a=n for some aΣ and nN0τN0(P)((|w|aN0)aΣ) otherwise 

5 Outlook

Let us end on a more general discussion regarding the status of commutative input functions in the study of unary output polyregular functions. A quantitative pumping argument for polyregular function f:Σ states that f has property X if and only if for all pumping pattern q:kΣ, fq has property X. Let us formalize such a statement for growth rate and aperiodicity respectively in Lemmas 41 and 42. Note that we generalized pumping patterns to commutative star-free polyregular functions to simplify the statements.

Lemma 41.

Let f𝖲𝖾𝗋𝗂𝖾𝗌, and d. Then, f𝖯𝗈𝗅𝗒d if and only if for every commutative star-free polyregular function h of growth rate l, (fh)𝖯𝗈𝗅𝗒d×l.

Lemma 42.

Let f𝖯𝗈𝗅𝗒. Then, f𝖲𝖥, if and only if for every commutative star-free polyregular function h, (fh)𝖲𝖥.

Remark that if Lemma 42 were to hold for -polyregular functions, then the decidability of 𝖯𝗈𝗅𝗒 inside 𝖯𝗈𝗅𝗒, and the decidability of 𝖲𝖥 inside 𝖯𝗈𝗅𝗒 would immediately follow. On the one hand, one can guess a candidate function and check for equivalence, on the other hand, one can guess a commutative star-free polyregular function and check membership (which is decidable thanks to this paper). This is restated in our concluding conjecture.

Conjecture 43.

Let f𝖯𝗈𝗅𝗒. Then, f𝖯𝗈𝗅𝗒 if and only if for every commutative star-free polyregular function h, (fh)𝖯𝗈𝗅𝗒.

References

  • [1] Jean Berstel and Christophe Reutenauer. Noncommutative rational series with applications, volume 137 of Encyclopedia of Mathematics and its Applications. Cambridge University Press, 2010. doi:10.1017/CBO9780511760860.
  • [2] Mikołaj Bojańczyk. Polyregular functions, 2018. arXiv:1810.08760.
  • [3] Mikołaj Bojańczyk, Sandra Kiefer, and Nathan Lhote. String-to-String Interpretations With Polynomial-Size Output. In Christel Baier, Ioannis Chatzigiannakis, Paola Flocchini, and Stefano Leonardi, editors, 46th International Colloquium on Automata, Languages, and Programming (ICALP 2019), volume 132 of Leibniz International Proceedings in Informatics (LIPIcs), pages 106:1–106:14, Dagstuhl, Germany, 2019. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2019.106.
  • [4] Paul-Jean Cahen and Jean-Luc Chabert. Integer-Valued Polynomials. American Mathematical Society, December 1996. doi:10.1090/surv/048.
  • [5] Thomas Colcombet, Gaëtan Douéneau-Tabot, and Aliaume Lopez. Z-polyregular functions. In 2023 38th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pages 1–13, Los Alamitos, CA, USA, June 2023. IEEE Computer Society. doi:10.1109/LICS56636.2023.10175685.
  • [6] Gaëtan Douéneau-Tabot. Pebble Transducers with Unary Output. In Filippo Bonchi and Simon J. Puglisi, editors, 46th International Symposium on Mathematical Foundations of Computer Science (MFCS 2021), volume 202 of Leibniz International Proceedings in Informatics (LIPIcs), pages 40:1–40:17, Dagstuhl, Germany, 2021. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.MFCS.2021.40.
  • [7] Gaëtan Douéneau-Tabot. Hiding Pebbles When the Output Alphabet Is Unary. In Mikołaj Bojańczyk, Emanuela Merelli, and David P. Woodruff, editors, 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022), volume 229 of Leibniz International Proceedings in Informatics (LIPIcs), pages 120:1–120:17, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2022.120.
  • [8] Gaëtan Douéneau-Tabot. Optimization of string transducers. PhD thesis, Université Paris Cité, 2023. URL: https://gdoueneau.github.io/pages/DOUENEAU-TABOT_Optimization-transducers_v2.pdf.
  • [9] David Hilbert. Mathematical problems. Bulletin of the American Mathematical Society, 8(10):437–479, 1902. doi:10.1090/s0002-9904-1902-00923-3.
  • [10] Juhani Karhumäki. Remarks on commutative N-rational series. Theoretical Computer Science, 5(2):211–217, 1977. doi:10.1016/0304-3975(77)90008-1.
  • [11] Aliaume Lopez. Commutative n-polyregular functions, 2024. doi:10.48550/arXiv.2404.02232.
  • [12] Yuri Vladimirovich Matiyasevich. The diophantineness of enumerable sets. Doklady Akademii Nauk SSSR, 191:279–282, 1970. in Russian.
  • [13] Robert McNaughton and Seymour A. Papert. Counter-Free Automata. The MIT Press, 1971. doi:10.5555/1097043.
  • [14] G. Pólya. Über ganzwertige ganze Funktionen. Rend. Circ. Mat. Palermo, 40:1–16, 1915. doi:10.1007/BF03014836.
  • [15] Marcel P. Schützenberger. Finite counting automata. Information and control, 5(2):91–107, 1962. doi:10.1016/S0019-9958(62)90244-9.
  • [16] Marcel P. Schützenberger. On finite monoids having only trivial subgroups. Information and Control, 8(2):190–194, 1965. doi:10.1016/S0019-9958(65)90108-7.
  • [17] Wolfgang Thomas. Languages, automata, and logic. In Grzegorz Rozenberg and Arto Salomaa, editors, Handbook of formal languages, pages 389–455. Springer, 1997. doi:10.1007/978-3-642-59136-5.