Cobham's theorem

Cobham's theorem is a theorem in combinatorics on words that has important connections with number theory, notably transcendental numbers, and automata theory. Informally, the theorem gives the condition for the members of a set S of natural numbers written in bases b1 and base b2 to be recognised by finite automata. Specifically, consider bases b1 and b2 such that they are not powers of the same integer. Cobham's theorem states that S written in bases b1 and b2 is recognised by finite automata if and only if S differs by a finite set from a finite union of arithmetic progressions. The theorem was proved by Alan Cobham in 1969 and has since given rise to many extensions and generalisations.

Definitions
Let $$n>0$$ be an integer. The representation of a natural number $n$ in base $b$  is the sequence of digits $$n_0n_1\cdots n_h$$ such that


 * $$n=n_0+n_1b+\cdots+n_hb^h$$

where $$0\le n_0,n_1,\ldots,n_h < b$$ and $$n_h>0$$. The word $$n_0n_1\cdots n_h$$ is often denoted $$\langle n\rangle_b$$, or more simply, $$n_b$$.

A set of natural numbers S is recognisable in base $b$ or more simply $b$ -recognisable or $b$ -automatic if the set $$\{n_b\mid n\in S\}$$ of the representations of its elements in base $$b$$ is a language recognisable by a finite automaton on the alphabet $$\{0,1,\ldots,b-1\}$$.

Two positive integers $$k$$ and $$\ell$$ are multiplicatively independent if there are no non-negative integers $$p$$ and $$q$$ such that $$k^p=\ell^q$$. For example, 2 and 3 are multiplicatively independent, but 8 and 16 are not since $$8^4=16^3$$. Two integers are multiplicatively dependent if and only if they are powers of a same third integer.

Original problem statement
More equivalent statements of the theorem have been given. The original version by Cobham is the following: $$Another way to state the theorem is by using automatic sequences. Cobham himself calls them "uniform tag sequences.". The following form is found in Allouche and Shallit's book: $$We can show that the characteristic sequence of a set of natural numbers S recognisable by finite automata in base k is a k-automatic sequence and that conversely, for all k-automatic sequences $$u$$ and all integers $$0\le i <k$$, the set $$S_i$$ of natural numbers $$s$$ such that $$u_s=i$$ is recognisable in base $$k$$.

Formulation in logic
Cobham's theorem can be formulated in first-order logic using a theorem proven by Büchi in 1960. This formulation in logic allows for extensions and generalisations. The logical expression uses the theory


 * $$\langle N, +, V_r\rangle$$

of natural integers equipped with addition and the function $$V_r$$ defined by $$V_r(0)=1$$ and for any positive integer $n$, $$V_r(n)=r^m$$ if $$r^m$$ is the largest power of $$r$$ that divides $n$. For example, $$V_2(20)=4$$, and $$V_3(20)=1$$.

A set of integers $$S$$ is definable in first-order logic in $$\langle N, +, V_r\rangle$$ if it can be described by a first-order formula with equality, addition, and $$V_r$$.

Examples:

$$We can push the analogy with logic further by noting that S is first-order definable in Presburger arithmetic if and only if it is ultimately periodic. So, a set S is definable in the logics $$\langle N, +, V_k\rangle$$ and $$\langle N, +, V_\ell\rangle$$ if and only if it is definable in Presburger arithmetic.
 * The set of odd numbers is definable (without $$V_r$$) by the formula $$(\exists y)(x=y+y+1)$$
 * The set $$\{2^n\mid n\ge0\}$$ of the powers of 2 is definable by the simple formula $$V_2(x)=x$$.

Approach by morphisms
An automatic sequence is a particular morphic word, whose morphism is uniform, meaning that the length of the images generated by the morphism for each letter of its input alphabet is the same. A set of integers is hence k-recognisable if and only if its characteristic sequence is generated by a uniform morphism followed by a coding, where a coding is a morphism that maps each letter of the input alphabet to a letter of the output alphabet. For example, the characteristic sequence of the powers of 2 is produced by the 2-uniform morphism (meaning each letter is mapped to a word of length 2) over the alphabet $$B=\{a,0,1\}$$ defined by


 * $$a \mapsto a1\ ,\quad 1\mapsto 10\ ,\quad 0\mapsto 00$$

which generates the infinite word


 * $$a11010001\cdots$$,

followed by the coding (that is, letter to letter) that maps $$a$$ to $$0$$ and leaves $$0$$ and $$1$$ unchanged, giving


 * $$011010001\cdots$$.

The notion has been extended as follows: a morphic word $$s$$ is $$\alpha$$-substitutive for a certain number $$\alpha$$ if when written in the form


 * $$s=\pi(f^\omega(b))$$

where the morphism $$f:B^*\to B^*$$, prolongable in $b$, has the following properties:


 * all letters of $$B$$ occur in $$f^\omega(b)$$, and
 * $$\alpha>1$$ is the dominant eigenvalue of the matrix of morphism $$f$$, namely, the matrix $$M(f)=(m_{x,y})_{x\in B,y\in A}$$, where $$m_{x,y}$$ is the number of occurrences of the letter $$x$$ in the word $$f(y)$$.

A set S of natural numbers is $$\alpha$$-recognisable if its characteristic sequence $$s$$ is $$\alpha$$-substitutive.

A last definition: a Perron number is an algebraic number $$z > 1$$ such that all its conjugates belong to the disc $$\{z' \in \Complex,|z'|< z\}$$. These are exactly the dominant eigenvalues of the primitive matrices of positive integers.

We then have the following statement: $$

Logic approach
The logic equivalent permits to consider more general situations: the automatic sequences over the natural numbers $$\N$$ or recognisable sets have been extended to the integers $$\Z$$, to the Cartesian products $$\N^m$$, to the real numbers $$\R$$ and to the Cartesian products $$\R^m$$.


 * Extension to $$\Z$$

We code the base $$k$$ integers by prepending to the representation of a positive integer the digit $$0$$, and by representing negative integers by $$k-1$$ followed by the number's $k$-complement. For example, in base 2, the integer $$-6=-8+2$$ is represented as $$1010$$. The powers of 2 are written as $$010^*$$, and their negatives $$110^*$$ (since $$11000$$ is the representation of $$-16+8=-8$$).


 * Extension to $$\N^m$$

A subset $$X$$ of $$N^m$$ is recognisable in base $$k$$ if the elements of $$X$$, written as vectors with $$m$$ components, are recognisable over the resulting alphabet.

For example, in base 2, we have $$3=11_2$$ and $$9=1001_2$$; the vector $$\begin{pmatrix}3\\9\end{pmatrix}$$ is written as $$\begin{pmatrix}0011\\1001\end{pmatrix}=\begin{pmatrix}0\\1\end{pmatrix}\begin{pmatrix}0\\0\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix}\begin{pmatrix}1\\1\end{pmatrix}$$.$$An elegant proof of this theorem is given by Muchnik in 1991 by induction on $$m$$.

Other extensions have been given to the real numbers and vectors of real numbers.

Proofs
Samuel Eilenberg announced the theorem without proof in his book; he says "The proof is correct, long, and hard. It is a challenge to find a more reasonable proof of this fine theorem." Georges Hansel proposed a more simple proof, published in the not-easily accessible proceedings of a conference. The proof of Dominique Perrin and that of Allouche and Shallit's book contains the same error in one of the lemmas, mentioned in the list of errata of the book. This error was uncovered in a note by Tomi Kärki, and corrected by Michel Rigo and Laurent Waxweiler. This part of the proof has been recently written.

In January 2018, Thijmen J. P. Krebs announced, on Arxiv, a simplified proof of the original theorem, based on Dirichlet's approximation criterion instead of that of Kronecker; the article appeared in 2021. The employed method has been refined and used by Mol, Rampersad, Shallit and Stipulanti.