Automatic sequences #
For a base k, a sequence a : β β Ξ is k-automatic if some deterministic automaton with
output (TauCeti.DFAO) with finitely many states and input alphabet Fin k computes a n from
the base-k digits of n. The digits are Mathlib's Nat.digits k n, read least significant
digit first and without padding zeros. Reading the least significant digit first is the
convention that Bridy (Section 2.1) calls reverse reading and that Christol, Kamae, Mendès France
and Rauzy (Section 4) call lecture inverse. Automatic sequences are the subject of
Christol's theorem, which identifies the p-automatic sequences with values in π½_p, for a
prime p, with the coefficient sequences of the power series over π½_p algebraic over
π½_p(X), and of Cobham's theorem, which identifies the
sequences automatic in two multiplicatively independent bases with the eventually periodic ones.
The output alphabet is arbitrary; automaticity forces the range of the sequence to be finite. The
definition is made for every k β 0. For k = 1, Nat.digits 1 n is the unary word of length
n, and the constructions below cover this case too.
Main definitions and results #
TauCeti.IsAutomatic k a: the sequenceaisk-automatic.TauCeti.DFAO.isAutomatic: a finite automaton computes ak-automatic sequence.TauCeti.IsAutomatic.map,TauCeti.IsAutomatic.prodMk: closure under changing the values and under pairing.TauCeti.IsAutomatic.finite_range: an automatic sequence takes finitely many values.TauCeti.isAutomatic_const: constant sequences are automatic.TauCeti.isAutomatic_of_eventually_periodic: eventually periodic sequences are automatic in every base.
Implementation notes #
For an eventually periodic sequence with preperiod N and period p, the automaton keeps the
value of the digits read so far and the current place value k ^ i, each only through its
truncation min Β· N and its residue modulo p. Both are compatible with addition and with
multiplication by a natural number, and together they determine the value of the sequence.
References #
- Andrew Bridy, Automatic sequences and curves over finite fields, Algebra & Number Theory 11 (2017), Section 2.1.
- G. Christol, T. Kamae, M. Mendès France, G. Rauzy, Suites algébriques, automates et substitutions, Bull. Soc. Math. France 108 (1980), Section 4.
- Jakub Byszewski, Jakub Konieczny, Automatic sequences and generalised polynomials, Canad. J. Math. 72 (2020), Section 1.
A sequence a : β β Ξ is k-automatic if a deterministic automaton with output, with
finitely many states and input alphabet Fin k, outputs a n on the base-k digits of n, read
least significant digit first (Mathlib's Nat.digits k n, so 0 is the empty word).
Instances For
Unfolding IsAutomatic: the introduction and elimination rule.
Changing the values of a k-automatic sequence along any map keeps it k-automatic.
The pairing of two k-automatic sequences is k-automatic.
A k-automatic sequence takes only finitely many values.
Constant sequences are k-automatic, computed by a one-state automaton.
Eventually periodic sequences #
Eventually periodic sequences are automatic. A sequence a with a (n + p) = a n for all
n β₯ N, for some period p > 0, is k-automatic in every base k.