Finite Automata and Arithmetic: J.-P. Allouche
Finite Automata and Arithmetic: J.-P. Allouche
∗
J.-P. Allouche
1 Introduction
The notion of sequence generated by a finite automaton, (or more precisely
a finite automaton with output function, i. e. a “uniform tag system”) has
been introduced and studied by Cobham in 1972 (see [19]; see also [24]).
In 1980, Christol, Kamae, Mendès France and Rauzy, ([18]), proved that a
sequence with values in a finite field is automatic if and only if the related
formal power series is algebraic over the rational functions with coefficients
in this field: this was the starting point of numerous results linking automata
theory, combinatorics and number theory. Our aim is to survey some results
in this area, especially transcendence results, and to provide the reader with
examples of automatic sequences. We will also give a bibliography where
more detailed studies can be found. See in particular the survey of Dekking,
Mendès France and van der Poorten, [22], or the author’s, [2], where many
relations between finite automata and number theory (and between finite
automata and other mathematical fields) are described. For applications of
finite automata to physics see [6].
In the first part of this paper we will recall the basic definitions and give
the theorem of Christol, Kamae, Mendès France and Rauzy. We will also
give five typical examples of sequences generated by finite automata.
In the second part we will discuss transcendence results related to au-
tomata theory, giving in particular some results concerning the Carlitz zeta
function.
We will indicate in the third part of this paper the possible generaliza-
tions of these automatic sequences.
Finally in an appendix we will give an elementary “automatic” proof of
the transcendence of the Carlitz formal power series Π.
∗
C. N. R. S., Mathématiques, 351 cours de la Libération, F-33405 Talence Cedex,
(France).
1
2 Generalities, examples, the main theorem
2.1 Sequences generated by finite automata
Definition 1 Let q be an integer (q ≥ 2). A q-automaton consists of
- a finite set S = {a1 = i, a2 , · · · , ad }, which is called the set of states.
One of the states is denoted by i and called the initial state,
- q maps from S to itself, labelled 0, 1, · · · , q − 1. The image of the state
s by the map j is denoted by j.s,
- a map (the output function), say ϕ, from S to a set Y .
This “machine” generates a sequence with values in Y , say (un )n≥0 , as fol-
lows: to compute the term un , one expands n in base q, say n = `j=0 nj q j ,
P
2.2 Examples
1) The Prouhet-Thue-Morse sequence
This sequence has been studied by Thue at the beginning of the century,
to give an example of a binary sequence without cubes (i. e. without three
consecutive identical blocks, see [40] and [41]), by Morse in the 20’s, (see
[31]), but also by Prouhet in 1851 ([32]). It can be defined by the following
2-automaton :
- the set of states is S = {i, a},
- the maps 0 and 1 from S to S are defined by,
0.i = i, 0.a = a,
1.i = a, 1.a = i,
- the output function is defined by,
ϕ(i) = 0, ϕ(a) = 1.
Hence this sequence begins by:
011010011001 ···
2
1
' - $
0 i a 0
& %
1
ϕ(i) = 0, ϕ(a) = 1
√ N
X −1 N
X −1
N =k an e2iπnx kL2 ≤k an e2iπnx kL∞ = FN (a) ≤ N.
n=0 n=0
On the other hand, for almost all (in the sense of the Haar measure on
{−1, +1}IN ) sequences of ±1, one has
p
FN (a) ≤ N log N .
In
√ other words, for a “random” sequence a, FN (a) behaves roughly like
N . Shapiro in 1951 ([37])
√ and Rudin in 1959 ([33]) constructed a sequence
a for which FN (a) ≤ C N and which is deterministic for any reasonable
definition of this notion. Moreover this sequence is 2-automatic, and can be
generated by the following 2-automaton:
- set of states S = {i, a, b, c},
- maps from S to S,
3
- output function,
ϕ(i) = ϕ(a) = +1,
ϕ(b) = ϕ(c) = −1.
+1 + 1 + 1 − 1 + 1 + 1 − 1 + 1 + 1 · · ·
-1 -1
-0
i
0
a b c 0
0 1 1
VVΛVVΛΛV ···
4
b
01
0
*
0
1 i - a
HH
H
HH1
jH
H
HH
H
H
c
01
ϕ(i) = ϕ(a) = ϕ(b) = V, ϕ(c) = Λ
5
' -0 $
1
1 i a - b
0 1
& %
0
6
the cyclic towers of Hanoi, (where the pegs are on a circle and where only
clockwise moves are allowed), the infinite sequence of moves resulting from
the classical cyclic algorithm is NOT automatic, but can be generated by a
non-uniform morphism, (see [8]).
-1
cm am
1
0 TTR 0
0 T
0T
IT
cm
T Tm
a
1 TTR 1 1
1
T
m 1T
IT 1
T Tm -0
bm
0
b
1
)
0 0
m
P
PP
-0
bm bm
PP
PP
PPqP
1 PP 0
1 TTR 1
PP 1 T
PP 1T
IT
P m T Tm
P
a c
TTR 0 0
T 0
0T
IT
T Tm -1
cm
a
1
7
- a set A,
- a uniform morphism σ of length q on A, i. e. a map which associates to
each letter in A a q-letter word on A. This map is extended by concatenation
to a morphism of the free monoid A∗ generated by A, and by continuity to
the infinite sequences with values in A,
- a sequence v = (vn )n≥0 with values in A, which is a fixed point of σ,
- a map ψ from A to Y such that ∀n ∈ IN, ψ(vn ) = un .
2.4 Examples
The patient reader can check (or prove) that the five examples given previ-
ously are images of fixed points of uniform morphisms of length 2, indeed:
σ(0) = 01,
σ(1) = 10.
σ(a) = ab,
σ(b) = ac,
σ(c) = db,
σ(d) = dc,
Then the sequence v = (vn )n≥0 defined by v = limk→∞ σ k (a) is a fixed point
of σ, and the Rudin-Shapiro sequence is the pointwise image of the sequence
v by the map ψ.
8
3) The paperfolding sequence
Let A = {a, b, c, d}, define σ on A by:
σ(a) = ab,
σ(b) = cb,
σ(c) = ad,
σ(d) = cd,
and let ψ be the map:
ψ(a) = ψ(b) = V, ψ(c) = ψ(d) = Λ.
Then the sequence v = (vn )n≥0 defined by v = limk→∞ σ k (a) is a fixed point
of σ, and the paperfolding sequence is the pointwise image of the sequence
v by the map ψ.
σ(a) = ac,
σ(b) = cb,
σ(c) = ba,
σ(a) = ac,
σ(b) = cb,
σ(c) = ba.
9
2.5 The main theorem
It is not by chance that our five examples are simultaneously 2-automatic
and images of fixed points of uniform morphisms of length 2. Indeed a
theorem due to Cobham, [19], asserts that this is general:
Christol, Kamae, Mendès France and Rauzy, gave in 1980, [18], an arith-
metical condition which is equivalent to the theoretical-computer-science
condition and to the combinatorial condition given above:
Theorem 2 ([18]). Let u be a sequence with values in the finite field IFq ,
(q is a power of a prime number p). Then the sequence u is q-automatic if
and only if the formal power series +∞ n
P
n=0 un X is algebraic over the field
IFq (X) of rational functions with coefficients in IFq .
Remarks
- this theorem has, of course, nothing to do with the Chomsky-Schützen-
berger theorem, ([17]);
- to give the flavour of this theorem, let us consider again the Prouhet-
Thue-Morse sequence quoted above. Remember that this sequence is the
fixed point of the 2-morphism σ defined by:
σ(0) = 01,
σ(1) = 10.
We consider from now on 0 and 1 as the two elements of IF2 and we make all
computations modulo 2. The definition of our sequence u by the morphism
σ shows that:
∀n ∈ IN, u2n = un , u2n+1 = 1 + un .
10
Hence:
+∞
X +∞
X +∞
X
F (X) := un X n = u2n X 2n + u2n+1 X 2n+1
n=0 n=0 n=0
+∞
X +∞
X
= un X 2n + (1 + un )X 2n+1
n=0 n=0
+∞ +∞
X
n 2
X X
= ( un X ) + X( un X n )2 +
n=0 n=0
(1 + X)2
2 2 X
= F (X) + XF (X) + .
(1 + X)2
(1 + X)3 F 2 + (1 + X)2 F + X = 0,
Theorem 3 [25]. Let u = (un )n≥0 be a sequence with values in the finite
un X n is algebraic over the field IFq (X) if and
P
field IFq . Then the series
only if there exists a double formal power series m,n≥0 am,n X m Y n such
P
that
- this series is a rational function, i. e. belongs to the field IFq (X, Y ),
- the sequence u is the diagonal of the sequence a, i. e. : ∀n ∈ IN,
un = an,n .
Putting all these conditions together one obtains the following funda-
mental theorem:
is finite,
11
ii) the sequence u is q-automatic,
iii) the sequence u is the image of a fixed point of a uniform morphism
of length q,
iv) the formal power series +∞ n
P
n=0 un X is algebraic over the field IFq (X),
v) there exists a double sequence a = (am,n )m,n with values in IFq such
that the formal power series m,n≥0 am,n X m Y n is a rational function, (i.
P
e. an element of IFq (X, Y )), and such that u is the diagonal of a, (i. e.
∀n ∈ IN, un = an,n ).
Theorem 4 Let (an )n be a binary sequence such that the formal power se-
ries +∞ n
P
n=0 an X is algebraic over IF2 (X) when considered as an element
of IF2 [[X]], and algebraic over IF3 (X) when considered as an element of
IF3 [[X]]. Then this sequence is ultimately periodic, i. e. both formal power
series are indeed rational functions.
12
- Let sq (n) be the residue modulo q of the sum of the digits of the integer n
in its q-ary expansion. It is not hard to see that the sequence (sq (an + b))n
is q-automatic; in particular for q = 2, a = 1, b = 0, one gets the Prouhet-
Thue-Morse sequence. But what can be said of (sq (n2 ))? A result of the
author ([1]), states that this sequence is NOT q-automatic.
IFq (X).
1
∀n ∈ IN∗ , ζ(n) =
X
.
P monic ∈ IFq [X]
Pn
13
Note that this property can be compared to the classical result on the values
of the Riemann zeta function at the even integers.
One can ask whether this formal Laurent series Π, the values of this zeta
function, and the values ζ(n)
Πn are transcendental over IFq (X). Remember
that the real number π is transcendental over the field of rational numbers,
hence the values of the Riemann zeta function at the even integers are also
transcendental, as the numbers ζ(2n)/π 2n are rational. For the other values
of the Riemann zeta function, (divided by a suitable power of π or not), the
only thing which is known is the irrationality of ζ(3) proved by Apéry in
1978.
Four methods are available for the Carlitz zeta function and the related
series:
- the original method due to Wade in the 40’s, (he proved many tran-
scendence results, in particular the transcendence of the formal power series
Π), ressembles transcendence methods for the case of real numbers. This
method has been extended recently by Dammame and Hellegouarch, who
proved the transcendence of all the values ζ(n), ∀n ∈ IN∗ ;
- the method of diophantine approximation is worked out by de Mathan
and Chérif and gives irrationality measures for the values of the Carlitz zeta
function;
- the method of Yu uses Drinfeld modules and gives the most complete
results, indeed ζ(n) is transcendental ∀n ∈ IN∗ and ζ(n) Πn is transcendental
for every n 6≡ 0 mod (q − 1);
- the “automatic method”. This method has been proposed by the au-
thor to give an “elementary” proof of the transcendence of the formal series
Π, (see [5]). The reader will find in the appendix a different (but even sim-
pler) proof of the transcendence of this series Π. This “automatic” method
has been recently extended by Berthé: she gave an elementary automatic
proof of the transcendence of ζ(n), ∀n ≤ q − 2, (see [13]), as well as linear
independence results for these series, ([14]), and transcendence results for
the Carlitz logarithm, (see [15]).
14
The answer is yes, it is due to Loxton and van der Poorten, (see also the
work of Nishioka):
Theorem 6 [27]. If the coefficients of the base-q expansion of a real number
form an automatic sequence, then this number is either rational or transcen-
dental.
√
In other words a number like 2 cannot have an automatic expansion
in any base. Note that this theorem gives the transcendence of a countable
set of “ad hoc” real numbers, and that one should not hope to get that way
the transcendence of classical numbers like the Euler constant (!), even for
numbers which are known to be transcendental: a reasonable but out of
reach conjecture is that the real numbers π and e are not automatic. Note
also that Mendès France and van der Poorten proved that a real number
whose base-2 expansion is any paperfolding sequence is transcendental, (see
[28]), this gives an uncountable (but “thin”) set of numbers, (which of course
are not all automatic numbers), for which the transcendence can be proved
using this kind of methods.
4 Generalizations
In this chapter we will survey quickly some possible generalizations of the
automatic sequences. The interested reader can find a survey with more
details in [7], in particular what is kept and what is lost in each of these
generalizations.
0 1 1 0
0→ , 1→ .
1 0 0 1
0 1 1 0
0 1 1 0 0 1
0→ → → ···
1 0 1 0 0 1
0 1 1 0
15
The reader can find in [34] and [35] more details, in particular a theorem
analogous to the Christol, Kamae, Mendès France and Rauzy theorem holds
true.
The arithmetic properties of the infinite sequences which are (images of)
fixed points of these morphisms are not very simple as the numeration base
associated to them is not the base q for some integer q ≥ 2. For instance,
in the above example, the numeration base is the Fibonacci base: F0 = 1,
F1 = 2, F2 = 3, F3 = 5, · · ·
On this subject one can read the paper of Shallit ([36]), and also the
work of Fabre.
un X n
P
Suppose that u takes its values in the finite field IFq . Then the series
is algebraic over IFq (X) if and only if its q-kernel Nq (u) is finite.
The main result obtained by Sharif and Woodcock in [38] and Harase in [26]
(see also the survey of the author [4]), can be stated as follows:
16
Then the series un X n is algebraic over K(X) if and only if the vector
P
Note that this theorem contains the Christol, Kamae, Mendès France and
Rauzy theorem, and that it can be easily extended to the multidimensional
case. Note also that two interesting corollaries can been proved, using the
work of Salon for a finite field, or more generally the above theorem for a
field of positive characteristic, (these results have been first given by Deligne
by a non-elementary method in [23]):
- the Hadamard product of two algebraic formal power series with coef-
ficients in a field of positive characteristic, un X n and vn X n , i. e. the
P P
17
5 Appendix: an easy “automatic” proof of the
transcendence of the formal power series Π
As said in chapter 3.2 the Carlitz formal power series Π, given by
+∞ j
!
Y Xq − X
Π= 1 − qj+1 .
j=1
X −X
has been proved transcendental by Wade in the 40’s. We gave an “auto-
matic” proof of this result in [5]. We want to present now another - still
simpler - “automatic” proof.
The first step consists of a remark due to Laurent Denis concerning an
0
expression for ΠΠ . Indeed taking the derivative of the expression of Π ∈
IFq ((X −1 )), one has:
j
0
X q −X
X 1−
Π0 +∞ Xq
j+1
−X
+∞
X 1
= j =
q j+1 − X
.
Π j=1 1 −
X q −X
j+1 j=1
X
Xq −X
j
A traditional notation is [j] = X q − X, hence the above equality can be
written
Π0 +∞X 1
= .
Π j=1
[j + 1]
If Π were algebraic, that would be the case also for Π0 , (the proof is left
to the reader who might use - for instance - the Christol, Kamae, Mendès
France an Rauzy theorem, where the variable X is replaced by X −1 ), hence
0
for ΠΠ .
Finally to prove the transcendence of Π it suffices to prove the transcen-
dence of the series +∞ 1
P
j=1 [j] . This series is known as the “bracket” series and
has been proved transcendental by Wade, but we gave in [5] an “automatic”
proof for the transcendence of slightly more general series. We rewrite here
this - easy - proof in the case of the bracket series. One has:
+∞ +∞ +∞ qj −1 !−1
1 1 X 1 1
X X
= j = 1−
j=1
q
[j] j=1 X − X j=1
X qj X
X 1 qj +m(qj −1) j
1 X 1 m(q −1) 1 X X 1
= = = 1 .
Xn
X X X X n≥1
j≥1 j≥1 j,m
m≥0 m≥1 m(q j −1)=n
18
This last expression can also be written
1 X X
1
1 .
Xn
X n≥1
j
(q j −1)|n
Using the theorem of Christol, Kamae, Mendès France and Rauzy one sees
that the series above is algebraic over IFq (X) if and only if the sequence
X
n→ 1
j
(q j −1)|n
n → τ (n)
This implies
19
prime numbers, (note that this case, i. e. the existence of arbitrarily large
prime numbers in the progression 1+kT , can be proved in a very elementary
way, using cyclotomic polynomials). Taking n = (1 + kT ) = ω, one gets:
τ (ω 2 ) ≡ τ (ω) mod p,
i. e.
3 ≡ 2 mod p,
which yields the desired contradiction.
References
[1] J.-P. Allouche, Somme des chiffres et transcendance, Bull. Soc. math.
France, 110 (1982), 279–285.
[2] J.-P. Allouche, Automates finis en théorie des nombres, Expo. Math.,
5 (1987), 239–266.
[8] J.-P. Allouche, Note on the cyclic towers of Hanoi, Theoret. Comput.
Sci., (to appear).
[9] J.-P. Allouche, J. Bétréma and J. Shallit, Sur des points fixes de mor-
phismes d’un monoı̈de libre, Inform. Théor. Appl., 23 (1989), 235–249.
20
[10] J.-P. Allouche and F. Dress, Tours de Hanoı̈ et automates, Inform.
Théor. Appl., 24 (1990), 1–15.
[11] J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoret.
Comput. Sci., 98 (1992), 163–197.
[12] L. E. Baum and M. M. Sweet, Continued fractions of algebraic power
series in characteristic 2, Ann. of Math., 103 (1976), 539–610.
[13] V. Berthé, De nouvelles preuves “automatiques” de transcendance
pour la fonction zéta de Carlitz, Journées arithmétiques de Genève,
Astérisque, 209 (1992), 159–168.
ζ(s)
[14] V. Berthé, Combinaisons linéaires de Πs sur IFq (x), pour 1 ≤ s ≤
(q − 2), submitted.
[15] V. Berthé, Automates et valeurs de transcendance du logarithme de
Carlitz, Acta Arithmetica, (to appear).
[16] L. Carlitz, On certain functions connected with polynomials in a Galois
field, Duke Math. J., 1 (1935), 137–168.
[17] N. Chomsky and M. P. Schützenberger, The algebraic theory of context-
free languages, in Computer programming and formal languages, 118–
161, North Holland, Amsterdam, 1963.
[18] G. Christol, T. Kamae, M. Mendès France, G. Rauzy, Suites algébri-
ques, automates et substitutions, Bull. Soc. math. France, 108 (1980),
401–419.
[19] A. Cobham, Uniform tag sequences, Math. Systems Theory, 6 (1972),
164–192.
[20] A. Cobham, On the base-dependence of sets of numbers recognizable by
finite automata, Math. Systems Theory, 3 (1969), 186–192.
[21] C. Davis and D. E. Knuth, Number representations and dragon curves,
I, II, J. Recr. Math. 3 (1970), 161–181 and 133–149.
[22] M. Dekking, M. Mendès France and A. van der Poorten, FOLDS!,
Math. Intell. 4 (1982), 130–138, 173–181 and 190–195.
[23] P. Deligne, Intégration sur un cycle évanescent, Invent. Math., 76
(1984), 129–143.
21
[24] S. Eilenberg, Automata, Languages and Machines, vol. A, Acad. Press,
New York, 1974.
[25] H. Furstenberg, Algebraic functions over finite fields, J. Algebra, 7
(1967), 271–277.
[26] T. Harase, Algebraic elements in formal power series rings, Israel J.
Math., 63 (1988), 281–288.
[27] J. H. Loxton and A. J. van der Poorten, Arithmetic properties of au-
tomata: regular sequences, J. Reine Angew. Math., 392 (1988), 57–69.
[28] M. Mendès France and A. van der Poorten, Arithmetic and analytic
properties of paperfolding sequences, dedicated to K. Mahler, Bull. Aus-
tral. Math. Soc., 24 (1981), 123–131.
[29] W. H. Mills and D. P. Robbins, Continued fractions for certain algebraic
power series, J. Number Theory, 23 (1986), 388–404.
[30] M. Mkaouar, Thèse, Lyon, 1993.
[31] M. Morse, Recurrent geodesics on a surface of negative curvature, Trans.
Amer. Math. Soc., 22 (1921), 84–100.
[32] E. Prouhet, Comptes-Rendus de l’Académie des Sciences, Paris, 33
(1851), 225.
[33] W. Rudin, Some theorems on Fourier coefficients, Proc. Amer. Math.
Soc., 10 (1959), 855–859.
[34] O. Salon, Suites automatiques à multi-indices et algébricité, C. R. Acad.
Sci. Paris, Série I, 305 (1987), 501–504.
[35] O. Salon, Suites automatiques à multi-indices, Séminaire de Théorie des
Nombres de Bordeaux, Exposé 4, 1986–1987.
[36] J. Shallit, A generalization of automatic sequences, Theoret. Comput.
Sci., 61 (1988), 1–16.
[37] H. S. Shapiro, Extremal problems for polynomial and power series, The-
sis, M.I.T., 1951.
[38] H. Sharif and C. F. Woodcock, Algebraic functions over a field of pos-
itive characteristic and Hadamard products, J. Lond. Math. Soc., 37
(1988), 395–403.
22
[39] N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press,
New York, 1973.
[40] A. Thue, Über unendliche Zeichenreihen, Norske vid. Selsk. Skr. I. Mat.
Kl. Christiana, 7 (1906), 1–22.
[41] A. Thue, Lage gleicher Teile gewisse Zeichenreihen, Norske vid. Selsk.
Skr. I. Mat. Kl. Christiana, 1 (1912), 1–67.
23