Keywords

1 Introduction

We pursue in this paper a study of the links between automata theory and set theory we begun in previous papers [Fin09, Fin11, Fin15]

In [Fin09] we proved a surprising result: the topological complexity of an \(\omega \)-language accepted by a 1-counter Büchi automaton, or of an infinitary rational relation accepted by a 2-tape Büchi automaton, is not determined by the axiomatic system ZFC; notice that here the topological complexity refers to the location of an \(\omega \)-language in hierarchies, like Borel or Wadge hierarchies, in the Cantor space of infinite words over a finite alphabet \(\varSigma \), and one assume, as usually, that ZFC is consistent and thus has a model. In particular, there is a 1-counter Büchi automaton \(\mathcal {A}\) (respectively, a 2-tape Büchi automaton \(\mathcal {B}\)) and two models \(\mathbf{V}_1\) and \(\mathbf{V}_2\) of ZFC such that the \(\omega \)-language \(L(\mathcal {A})\) (respectively, the infinitary rational relation \(L(\mathcal {B})\)) is Borel in \(\mathbf{V}_1\) but not in \(\mathbf{V}_2\). We have proved in [Fin11] other independence results, showing that some basic cardinality questions on automata reading infinite words actually depend on the models of ZFC.

The next step in this research project was to determine which properties of automata actually depend on the models of ZFC, and to achieve a more complete investigation of these properties.

Recall that a large cardinal in a model of set theory is a cardinal which is in some sense much larger than the smaller ones. This may be seen as a generalization of the fact that \(\omega \) is much larger than all finite cardinals. The inaccessible cardinals are the simplest such large cardinals. Notice that it cannot be proved in ZFC that there exists an inaccessible cardinal, but one usually believes that the existence of such cardinals is consistent with the axiomatic theory ZFC. The assumed existence of large cardinals have many consequences in Set Theory as well as in many other branches of Mathematics like Algebra, Topology or Analysis, see [Jec02].

In [Fin15], we recently proved that there exist some 1-counter Büchi automata \(\mathcal {A}_n\) for which some elementary properties are independent of theories like \(T_n\) =: ZFC + “There exist (at least) n inaccessible cardinals”, for integers \(n\ge 1\). We first prove that “\(L(\mathcal {A}_n)\) is Borel”, “\(L(\mathcal {A}_n)\) is arithmetical”, “\(L(\mathcal {A}_n)\) is \(\omega \)-regular”, “\(L(\mathcal {A}_n)\) is deterministic”, and “\(L(\mathcal {A}_n)\) is unambiguous” are equivalent to the consistency of the theory \(T_n\) (denoted Cons\((T_n)\)). This implies that, if \(T_n\) is consistent, all these statements are provable from ZFC + “There exist (at least) \(n+1\) inaccessible cardinals” but not from ZFC + “There exist (at least) n inaccessible cardinals”.

We prove in this paper that independence results, even from strong set theories with large cardinals, occur in the theory of various automata over finite words, like 1-counter automata, pushdown automata (equivalent to context-free grammars), 2-tape automata accepting finitary rational relations, weighted automata. We first show that if T is a given recursive theory then there exists an instance of the Post Correspondence Problem (denoted PCP), constituted of two n-tuples \((x_1, x_2, \ldots ,x_n)\) and \((y_1, y_2, \ldots ,y_n)\) of non-empty words over a finite alphabet \(\varGamma \), which has no solution if and only if T is consistent. In other words the theory T is consistent if and only if there does not exist any non-empty sequence of indices \(i_1, i_2, \ldots ,i_k \) such that \(x_{i_1}x_{i_2}\cdots x_{i_k} =y_{i_1}y_{i_2}\cdots y_{i_k}.\) This allows to find many elementary properties of some pushdown automata, context-free grammars, or 2-tape automata, which are independent from ZFC or from some strong theory in the form ZFC + “There exist some kind of large cardinals”, since many properties of these automata are proved to be undecidable via some effective reductions of the PCP to these properties.

For instance we prove that, for every integer \(n\ge 0\), there exist 2-tape automata \(\mathcal {A}_n\), \(\mathcal {B}_n\), \(\mathcal {C}_n\), and \(\mathcal {D}_n\), accepting subsets of \(A^\star \times B^\star \), for two alphabets A and B, such that Cons\((T_n)\) is equivalent to each of the following items: (1) \(L(\mathcal {A}_n)\cap L(\mathcal {B}_n) =\emptyset \); (2) \(L(\mathcal {C}_n) = A^\star \times B^\star \); (3) “\(L(\mathcal {D}_n)\) is accepted by a deterministic 2-tape automaton”; (4) “\(L(\mathcal {D}_n)\) is accepted by a synchronous 2-tape automaton”. In particular, if ZFC + “There exist (at least) n inaccessible cardinals” is consistent, then each of the properties of these 2-tape automata given by Items (1)–(4) is provable from ZFC + “There exist (at least) \(n+1\) inaccessible cardinals” but not from ZFC + “There exist (at least) n inaccessible cardinals”.

We also prove some independence results for weighted automata, via some independence results for finitely generated matrix subsemigroups of \(\mathbb {Z}^{3\times 3}\). Notice that in this context we also obtain results of independence from Peano Arithmetic which make sense since in the context of finite words or of integer matrices everything can be formalized in first-order arithmetic. For instance we show that there exists a finite set of matrices \(M_1, M_2,\ldots , M_{n} \in \mathbb {Z}^{3\times 3}\), for some integer \(n \ge 1\), such that: (1) “the subsemigroup of \(\mathbb {Z}^{3\times 3}\) generated by these matrices does not contain the zero matrix”, and (2) “The property (1) is not provable from PA”.

These results seem of more concrete mathematical nature than the fact that Cons\((\mathbf{PA})\) is an arithmetical statement which is true but unprovable from PA. Indeed although our results follow from Gödel’s Second Incompleteness Theorem, they express some properties about some natural and simple mathematical objects: the finitely generated subsemigroups of the semigroup \(\mathbb {Z}^{3\times 3}\) of 3-3-matrices with integer entries.

This could be compared to the fact that if PA (respectively, ZFC) is consistent then there is a polynomial \(P(x_1, \ldots , x_n)\) which has no integer roots, but for which this cannot be proved from PA (respectively, ZFC); this result can be inferred from Matiyasevich’s Theorem, see [EFT94, End of Chap. 10.7]. The above results could also be compared with other independence results obtained by Kanamori and McAloon [KM87].

Notice that we recently discovered that in older papers it had been noted that undecidability and incompleteness in automata theory were intimately related and that one could for instance obtain some results about automata which are true but unprovable in some recursive theory extending Peano Arithmetic like ZFC, [Har85, JY81]. However the results presented here, although they are not very difficult to prove, exhibit in our opinion the following novelties:

  1. 1.

    We obtain results of a different kind: we show that a great number of elementary properties of automata over finite words, are actually independent from strong set theories.

  2. 2.

    We show how we can effectively construct some automata, like 1-counter or 2-tape automata, for which many elementary properties reflect the scale of a hierarchy of large cardinals axioms like “There exist (at least) n inaccessible cardinals” for integers \(n\ge 1\).

  3. 3.

    We show how we can use Post Correspondence Problem to get simple combinatorial statements about finite words which are independent from strong set theories.

Altogether we think that the collection of results presented in this paper will be of interest for computer scientists and also for set theorists.

The paper is organized as follows. We recall some notions and results of set theory in Sect. 2. We prove some independence results for various kinds of automata over finite words in Sect. 3. Concluding remarks are given in Sect. 4.

2 Some Results of Set Theory

We now recall some basic notions of set theory which will be useful in the sequel, and which are exposed in any textbook on set theory, like [Kun80, Jec02].

The usual axiomatic system ZFC is Zermelo-Fraenkel system ZF plus the axiom of choice AC. The axioms of ZFC express some natural facts that we consider to hold in the universe of sets. For instance a natural fact is that two sets x and y are equal iff they have the same elements. This is expressed by the Axiom of Extensionality:

$$\forall x \forall y ~ [ ~ x=y \leftrightarrow \forall z ( z\in x \leftrightarrow z\in y ) ~].$$

Another natural axiom is the Pairing Axiom which states that for all sets x and y there exists a set \(z=\{x, y\}\) whose elements are x and y:

$$\forall x \forall y ~ [ ~\exists z ( \forall w ( w\in z \leftrightarrow (w=x \vee w=y) ) ) ].$$

Similarly the Powerset Axiom states the existence of the set \(\mathcal {P}(x)\) of subsets of a set x. Notice that these axioms are first-order sentences in the usual logical language of set theory whose only non logical symbol is the membership binary relation symbol \(\in \). We refer the reader to any textbook on set theory for an exposition of the other axioms of ZFC.

A model (V, \(\in )\) of an arbitrary set of axioms \(\mathbb {A}\) is a collection V of sets, equipped with the membership relation \(\in \), where “\(x \in y\)” means that the set x is an element of the set y, which satisfies the axioms of \(\mathbb {A}\). We often say “the model V” instead of “the model (V, \(\in )\)”.

We say that two sets A and B have same cardinality iff there is a bijection from A onto B and we denote this by \(A \approx B\). The relation \(\approx \) is an equivalence relation. Using the axiom of choice AC, one can prove that any set A can be well-ordered so there is an ordinal \(\gamma \) such that \(A \approx \gamma \). In set theory the cardinal of the set A is then formally defined as the smallest such ordinal \(\gamma \).

The infinite cardinals are usually denoted by \(\aleph _0, \aleph _1, \aleph _2, \ldots , \aleph _\alpha , \ldots \) The cardinal \(\aleph _\alpha \) is also denoted by \(\omega _\alpha \), when it is considered as an ordinal. The first infinite ordinal is \(\omega \) and it is the smallest ordinal which is countably infinite so \(\aleph _0=\omega \) (which could be written \(\omega _0\)). The first uncountable ordinal is \(\omega _1\), and formally \(\aleph _1=\omega _1\).

Let \(\mathbf{ON}\) be the class of all ordinals. Recall that an ordinal \(\alpha \) is said to be a successor ordinal iff there exists an ordinal \(\beta \) such that \(\alpha =\beta + 1\); otherwise the ordinal \(\alpha \) is said to be a limit ordinal and in this case \(\alpha =\mathrm{sup} \{ \beta \in \mathbf{ON}\mid \beta < \alpha \}\).

We recall now the notions of cofinality of an ordinal and of regular cardinal which may be found for instance in [Jec02]. Let \(\alpha \) be a limit ordinal, the cofinality of \(\alpha \), denoted \(cof(\alpha )\), is the least ordinal \(\beta \) such that there exists a strictly increasing sequence of ordinals \((\alpha _i)_{i<\beta }\), of length \(\beta \), such that \(\forall i< \beta \) \(\alpha _i < \alpha \) and \(\sup _{i< \beta } \alpha _i = \alpha \). This definition is usually extended to 0 and to the successor ordinals: \(cof(0)=0 \text { and } cof(\alpha +1)=1 \text { for every ordinal } \alpha .\) The cofinality of a limit ordinal is always a limit ordinal satisfying: \(\omega \le cof(\alpha ) \le \alpha \). Moreover \(cof(\alpha )\) is in fact a cardinal. A cardinal \(\kappa \) is said to be regular iff \(cof(\kappa )=\kappa \). Otherwise \(cof(\kappa )<\kappa \) and the cardinal \(\kappa \) is said to be singular.

A cardinal \(\kappa \) is said to be a (strongly) inaccessible cardinal iff \(\kappa > \omega \), \(\kappa \) is regular, and for all cardinals \(\lambda < \kappa \) it holds that \(2^\lambda < \kappa \), where \(2^\lambda \) is the cardinal of \(\mathcal {P}(\lambda )\).

There are many other notions of large cardinals which have been studied in set theory, see [Dra74, Kan97, Jec02]. A remarkable fact is that the strengths of these notions appear to be linearly ordered (and in fact well ordered).

Recall that the class of sets in a model V of ZF may be stratified in a transfinite hierarchy, called the Cumulative Hierarchy, which is defined by \(\mathbf{V} = \bigcup _{\alpha \in \mathbf{ON}} \mathbf{V}_\alpha \),

where the sets \(\mathbf{V}_\alpha \) are constructed by induction as follows:

  1. (1)

    \(\mathbf{V}_0 =\emptyset \)

  2. (2)

    \(\mathbf{V}_{\alpha + 1} = \mathcal {P}(\mathbf{V}_\alpha )\) is the set of subsets of \(\mathbf{V}_\alpha \), and

  3. (3)

    \(\mathbf{V}_\alpha = \bigcup _{\beta < \alpha } \mathbf{V}_\beta \), for \(\alpha \) a limit ordinal.

It is well known that if V is a model of ZFC and \(\kappa \) is an inaccessible cardinal in V then \(\mathbf{V}_\kappa \) is also a model of ZFC. If there exist in V at least n inaccessible cardinals, where \(n\ge 1\) is an integer, and if \(\kappa \) is the n-th inaccessible cardinal, then \(\mathbf{V}_\kappa \) is also a model of ZFC + “There exist exactly \(n-1\) inaccessible cardinals” (and the same result is true if we replace “inaccessible” by “hyperinaccessible”). This implies that one cannot prove in ZFC that there exists an inaccessible cardinal, because if \(\kappa \) is the first inaccessible cardinal in V then \(\mathbf{V}_\kappa \) is a model of ZFC + “There exist no inaccessible cardinals”.

We now recall that a (first-order) theory T in the language of set theory is a set of (first-order) sentences, called the axioms of the theory. If T is a theory and \(\varphi \) is a sentence then we write \(T \vdash \varphi \) iff there is a formal proof of \(\varphi \) from T; this means that there is a finite sequence of sentences \(\varphi _j\), \(1\le j \le n\), such that \(\varphi _1 \vdash \varphi _2 \vdash \ldots \varphi _n\), where \(\varphi _n\) is the sentence \(\varphi \) and for each \(j\in [1, n]\), either \(\varphi _j\) is in T or \(\varphi _j\) is a logical axiom or \(\varphi _j\) follows from \(\varphi _1, \varphi _2, \ldots \varphi _{j-1}\) by usual rules of inference which can be defined purely syntactically. A theory is said to be consistent iff for no (first-order) sentence \(\varphi \) does \(T \vdash \varphi \) and \(T \vdash \lnot \varphi \). If T is inconsistent, then for every sentence \(\varphi \) it holds that \(T \vdash \varphi \). We shall denote \(\mathrm {Cons}(T)\) the sentence “the theory T is consistent”.

Recall that one can code in a recursive manner the sentences in the language of set theory by finite sequences over a finite alphabet, and then simply over the alphabet \(\{0, 1\}\), by using a classical Gödel numbering of the sentences. We say that the theory T is recursive iff the set of codes of axioms in T is a recursive set of words over \(\{0, 1\}\). In that case one can also code formal proofs from axioms of a recursive theory T and then \(\mathrm {Cons}(T)\) is an arithmetical statement. The theory ZFC is recursive and so are the theories \(T_n\) =: ZFC + “There exist (at least) n inaccessible cardinals”, for any integer \(n\ge 1\).

We now recall Gödel’s Second Incompleteness Theorem, [Göd63, Fri11].

Theorem 1

(Gödel 1931 [Göd63]). Let T be a consistent recursive extension of ZF. Then \(T \nvdash \mathrm {Cons}\) \((T)\).

We now state the following lemmas.

Lemma 2

Let T be a recursive theory in the language of set theory. Then there exists a Turing machine \(\mathcal {M}_T\), starting on an empty tape, such that \(\mathcal {M}_T\) halts iff T is inconsistent.

Proof

We describe informally the behaviour of the machine \(\mathcal {M}_T\). Essentially the machine works as a program which enumerates all the formal proofs from T and enters in an accepting state and then halts iff the last sentence of the proof is the sentence “\(\exists x (x\ne x)\)”. If the theory T is consistent the machine will never enter in an accepting state \(q_f\) and never halts. But if the theory is inconsistent then at some point of the computation the machine sees a proof whose last sentence is actually “\(\exists x (x\ne x)\)” and halts.    \(\square \)

In [Fin15] we have focused our results on set theories, even if we noticed that some of our results could be extended to weaker arithmetical theories and to other recursive theories. We have shown that some elementary properties of automata may be independent from strong set theories like ZFC + “There exist (at least) n inaccessible cardinals”. We are going to show in this paper that some similar phenomena still hold for some kinds of automata on finite words. However in the context of automata over finite words, we can notice that automata and their behaviour can be coded by integers and this can be done in Peano arithmetic; this will be often assumed in the sequel. Then we shall also obtain some new independence results from the axiomatic system of Peano Arithmetic PA. Indeed while we have first stated Gödel’s Second Incompleteness Theorem for consistent recursive extensions of ZF in the above Theorem 1, the prooof of this Theorem leads also to the following version, see [Poi00] for a proof.

Theorem 3

(Gödel 1931). Let \(\mathbf{PA}\) be Peano Arithmetic. Then

$$ \mathbf{PA} \nvdash \mathrm {Cons} (\mathbf{PA}).$$

Notice that PA is known to be consistent, since the axioms of Peano Arithmetic are satisfied in the standard model of the natural numbers. Thus the above Theorem 3 gives a true arithmetical statement which is not provable from Peano Arithmetic. Notice that Gentzen gave in 1936 a proof of the consistency of Peano Arithmetic which uses only transfinite induction up to the Cantor ordinal \(\varepsilon _0\), see [Gen36, Hor14]; this proof can be considered as being finitistic since the ordinal \(\varepsilon _0\) can be coded with finite objects, like finite trees.

3 Incompleteness Results for Automata over Finite Words

We assume the reader to be familiar with the theory of formal languages [HMU01]. We recall the usual notations of formal language theory.

If \(\varSigma \) is a finite alphabet, a non-empty finite word over \(\varSigma \) is any sequence \(x=a_1\ldots a_k\), where \(a_i\in \varSigma \) for \(i=1,\ldots ,k\), and k is an integer \(\ge 1\). The length of x is k, denoted by |x|. The empty word has no letter and is denoted by \(\varepsilon \); its length is 0. \(\varSigma ^\star \) is the set of finite words (including the empty word) over \(\varSigma \).

The usual concatenation product of two finite words u and v is denoted u.v (and sometimes just uv). This product is extended to the product of a finite word u and an \(\omega \)-word v: the infinite word u.v is then the \(\omega \)-word such that:

$$(u.v)(k)=u(k) \text { if }k\le |u|, \text { and } (u.v)(k)=v(k-|u|) \text { if }k>|u|.$$

We now recall the well known Post Correspondence Problem (PCP), see [HMU01, pp. 392–402]. It is one of the famous undecidable problems in Theoretical Computer Science and in Formal Language Theory. The PCP is an abstract problem involving strings, and it has been very useful to prove the undecidability of many other problems by reduction of PCP to those problems. In particular, many problems about context-free languages, those accepted by pushdown automata or generated by context-free grammars, have been shown to be undecidable by this method. For instance it follows from the undecidability of the Post Correspondence Problem that the universality problem, the inclusion and the equivalence problems for context-free languages are also undecidable.

An instance of the Post Correspondence Problem consists of two lists of finite words over some finite alphabet \(\varGamma : (x_1, x_2, \ldots ,x_n)\) and \((y_1, y_2, \ldots ,y_n)\). Notice that the two lists must have the same length \(n\ge 1\). One says that this instance has a solution if there exists a non-empty sequence of indices \(i_1, i_2, \ldots ,i_k \) such that \(x_{i_1}x_{i_2}\cdots x_{i_k} =y_{i_1}y_{i_2}\cdots y_{i_k}\). The Post Correspondence Problem is:

“Given an instance of the PCP, tell whether this instance has a solution”.

We now recall Post’s result, now well-known as the undecidability of the Post Correspondence Problem.

Theorem 4

(Post, see [HMU01]). Let \(\varGamma \) be an alphabet having at least two elements. Then it is undecidable to determine, for arbitrary n-tuples \((x_1, x_2, \ldots ,x_n)\) and \((y_1, y_2, \ldots ,y_n)\) of non-empty words in \(\varGamma ^\star \), whether there exists a non-empty sequence of indices \(i_1, i_2, \ldots ,i_k \) such that \(x_{i_1}x_{i_2}\cdots x_{i_k} =y_{i_1}y_{i_2}\cdots y_{i_k}\).

We now recall the variant of the PCP called the modified Post Correspondence Problem, which is used in the proof of the above Theorem 4.

The MPCP consists, given two n-tuples \((x_1, x_2, \ldots ,x_n)\) and \((y_1, y_2, \ldots ,y_n)\) of non-empty words in \(\varGamma ^\star \), in determining whether there exists a non-empty sequence of indices \(i_1, i_2, \ldots ,i_k \) such that \(x_1x_{i_1}x_{i_2}\cdots x_{i_k} =y_1y_{i_1}y_{i_2}\cdots y_{i_k}\).

The proof of Theorem 4 is given in two steps, see [HMU01]. First one can associate in a recursive manner, to each pair (\(\mathcal {M}_z, w)\) where \(\mathcal {M}_z\) is the Turing machine of index \(z\in \mathbb {N}\) and w is an input word for \(\mathcal {M}_z\), an instance of the MPCP consisting of two n-tuples \((x_1, x_2, \ldots ,x_n)\) and \((y_1, y_2, \ldots ,y_n)\) such that there exists a finite sequence of indices \(i_1, i_2,\ldots ,i_k,\) such that \(x_1x_{i_1}x_{i_2}\cdots x_{i_k} =y_1y_{i_1}y_{i_2}\cdots y_{i_k}\) if and only if the Turing machine \(\mathcal {M}_z\) does halt on the input w.

Next we can associate in an effective manner, to each instance of the MPCP consisting of two n-tuples \((x_1, x_2, \ldots ,x_n)\) and \((y_1, y_2, \ldots ,y_n)\), another instance of the PCP consisting of two \(n+2\)-tuples \((x'_1, x'_2, \ldots ,x'_{n+2})\) and \((y'_1, y'_2, \ldots ,y'_{n+2})\), such that \((x_1, x_2, \ldots ,x_n)\) and \((y_1, y_2, \ldots ,y_n)\) form a solution of the MPCP if and only if \((x'_1, x'_2, \ldots ,x'_{n+2})\) and \((y'_1, y'_2, \ldots ,y'_{n+2})\) form a solution of the PCP.

We can now state the following result.

Theorem 5

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exist two n-tuples \(X_T=(x_1, x_2, \ldots ,x_n)\) and \(Y_T=(y_1, y_2, \ldots , y_n)\) of finite words over a finite alphabet \(\varSigma \), such that there exists a non-empty sequence of indices \(i_1, i_2, \ldots ,i_k \) such that \(x_{i_1}x_{i_2}\cdots x_{i_k} =y_{i_1}y_{i_2}\cdots y_{i_k}\) iff T is inconsistent.

Proof

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a Turing machine \(\mathcal {M}\), starting with an empty tape, which halts if and only if the theory T is inconsistent. We can now deduce the announced result from the proof of the undecidability of the PCP which is just sketched above.    \(\square \)

Remark 6

We can easily see that the above theorem is true for the two-letter alphabet \(\varSigma =\{a, b\}\). Indeed if \(\varSigma =\{a_1, a_2, \ldots , a_p\}\) is an alphabet having more than two letters, we can use the coding given by: \(a_j \rightarrow b^ja\), where a and b are two letters, which provides the announced claim.

Corollary 7

For every integer \(n \ge 0\), there exist \(p\ge 1\) and two p-tuples \(X_{T,n}=(x_{1,n}, x_{2,n}, \ldots ,x_{p,n})\) and \(Y_{T,n}=(y_{1,n}, y_{2,n}, \ldots ,y_{p,n})\) of finite words over \(\varSigma =\{a, b\}\), such that: “\(P_n\): there exist no non-empty sequence of indices \(i_1, i_2, \ldots , i_k \) such that: \(x_{i_1, n}x_{i_2, n}\cdots x_{i_k, n} =y_{i_1, n}y_{i_2, n}\cdots y_{i_k, n}\)

iff \(T_n\) is consistent.

In particular, if ZFC + “There exist (at least) n inaccessible cardinals” is consistent, then \(P_n\) is provable from ZFC + “There exist (at least) \(n+1\) inaccessible cardinals” but not from ZFC + “There exist (at least) n inaccessible cardinals”.

Proof

By Theorem 5, for each integer \(n \ge 0\), there exist \(p\ge 1\) and two p-tuples \(X_{T,n}=(x_{1,n}, x_{2,n}, \ldots ,x_{p,n})\) and \(Y_{T,n}=(y_{1,n}, y_{2,n}, \ldots ,y_{p,n})\) of finite words over \(\varSigma =\{a, b\}\), such that: “\(P_n\): there exist no non-empty sequence of indices \(i_1, i_2, \ldots , i_k \) such that \(x_{i_1, n}x_{i_2, n}\cdots x_{i_k, n} =y_{i_1, n}y_{i_2, n}\cdots y_{i_k, n}\)” iff \(T_n\) is consistent. Recall that one can prove from ZFC + “There exist (at least) \(n+1\) inaccessible cardinals” that if \(\kappa \) is the \(n+1\)-th inaccessible cardinal, then the set \(\mathbf{V}_\kappa \) of the cumulative hierarchy is also a model of ZFC + “There exist n inaccessible cardinals”. This implies that the theory ZFC + “There exist n inaccessible cardinals” is consistent and thus this also implies that there exist no non-empty sequence of indices \(i_1, i_2, \ldots , i_k \) such that:

$$x_{i_1, n}x_{i_2, n}\cdots x_{i_k, n} =y_{i_1, n}y_{i_2, n}\cdots y_{i_k, n}$$

On the other hand if \(T_n\) is consistent, then \(P_n\) is not provable from \(T_n\). Indeed \(T_n\) is then a consistent recursive extension of ZFC and thus by Gödel’s Second Incompleteness Theorem we know that \(T_n \nvdash \mathrm {Cons}\) \((T_n)\).    \(\square \)

Moreover, since PA is consistent, we also get the following result.

Corollary 8

There exist two p-tuples \(X=(x_1, x_2, \ldots ,x_p)\) and \(Y=(y_1, y_2, \ldots ,y_p)\) of finite words over \(\varSigma =\{a, b\}\), such that:

  1. (1)

    there exist no non-empty sequence of indices \(i_1, i_2, \ldots ,i_k \) such that:

    $$x_{i_1}x_{i_2}\cdots x_{i_k} =y_{i_1}y_{i_2}\cdots y_{i_k}$$
  2. (2)

    The property (1) is not provable from \(\mathbf{PA}\).

We can now infer from Theorem 5 some incompleteness results for context-free languages generated by context-free grammars or equivalently accepted by pushdown automata. We use the reductions of PCP to some problems about context-free grammars ans context-free languages given in [HMU01, pp. 404–408]. We refer the reader to this textbook for background about context-free grammars and context-free languages.

We first state the following result about ambiguity of context-free grammars.

Theorem 9

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a context-free grammar \(G_T\) which is unambiguous iff T is consistent.

Proof

We refer here to the proof of the undecidability of the unambiguity of a given context-free grammar in [HMU01, pp. 404–406]. From a given instance of the PCP constituted by two n-tuples \((x_1, x_2, \ldots ,x_n)\) and \((y_1, y_2, \ldots ,y_n)\) of finite words over a finite alphabet \(\varSigma \), is constructed a context-free grammar G such that G is ambiguous if and only if this instance of PCP has a solution. The result now follows from this construction and from the above Theorem 5.    \(\square \)

Corollary 10

For every integer \(n\ge 0\), there exists a context-free grammar \(G_n\) such that \(G_n\) is unambiguous iff \(T_n\) is consistent.

In particular, if ZFC + “There exist (at least) n inaccessible cardinals” is consistent, then “ \(G_n\) is unambiguous” is provable from ZFC + “There exist (at least) \(n+1\) inaccessible cardinals” but not from ZFC + “There exist (at least) n inaccessible cardinals”.

We now state some other results about elementary properties of context-free languages.

Theorem 11

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exist context-free grammars \(G_{1,T}\) \(G_{2,T}\), \(G_{3,T}\), and \(G_{4,T}\), such that Cons(T) is equivalent to each of the following items:

  1. (1)

    \(L(G_{1,T})\cap L(G_{2,T})=\emptyset \);

  2. (2)

    \(L(G_{3,T}) = L(G_{4,T})\);

  3. (3)

    \(L(G_{3,T}) =\varGamma ^\star \), for some alphabet \(\varGamma \).

Corollary 12

For every integer \(n\ge 0\), there exist context-free grammars \(G_{1,n}\) \(G_{2,n}\), \(G_{3,n}\), and \(G_{4,n}\), such that Cons\((T_n)\) is equivalent to each of the following items:

  1. (1)

    \(L(G_{1,n})\cap L(G_{2,n}) =\emptyset \);

  2. (2)

    \(L(G_{3,n}) = L(G_{4,n})\);

  3. (3)

    \(L(G_{3,n}) =\varGamma ^\star \), for some alphabet \(\varGamma \).

In particular, if ZFC + “There exist (at least) n inaccessible cardinals” is consistent, then each of the properties of these context-free languages given by Items (1)–(3) is provable from ZFC + “There exist (at least) \(n+1\) inaccessible cardinals” but not from ZFC + “There exist (at least) n inaccessible cardinals”.

We are now going to state some similar independence results for other very simple finite machines reading finite words: the class of 2-tape automata (or transducers) accepting finitary rational relations. We shall refer to the book [Ber79] in which some elementary problems about finitary rational relations are proved to be undecidable by reducing the PCP to these problems, see pages 79–82 in this book.

We now state the following results.

Theorem 13

let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exist 2-tape automata \(\mathcal {A}\), \(\mathcal {B}\), and \(\mathcal {C}\), accepting finitary rational relations \(X, Y, Z \subseteq A^\star \times B^\star \), for two alphabets A and B having at least two letters, and such that Cons(T) is equivalent to each of the following items:

  1. (1)

    \(X\cap Y =\emptyset \);

  2. (2)

    \(Z = A^\star \times B^\star \);

  3. (3)

    \( A^\star \times B^\star \subseteq Z\).

Proof

We refer to the proof of [Ber79, Theorem 8.4, p. 81]. We assume, as in this proof, that A contains exactly two letters and that \(A=\{a, b\}\). For two sequences \(u_1, u_2, \ldots , u_p\), and \(v_1, v_2, \ldots , v_p,\) of finite words over the alphabet B, we define \(U=\{(ab,u_1), \ldots , (ab^p, u_p)\}\), and \(V=\{(ab,v_1), \ldots , (ab^p, v_p)\}\). Then \(U^+\) and \(V^+\) are rational relations and, by [Ber79, Lemma 8.3, p. 80], the relations \(\bar{U}= A^\star \times B^\star \setminus U^+\) and \(\bar{V}= A^\star \times B^\star \setminus V^+\) are also rational. It is noticed in the proof of Theorem 8.4 in [Ber79] that if we set \(X=U^+\) and \(Y=V^+\), then it holds that \(X\cap Y \ne \emptyset \) iff the instance of the PCP given by \((u_1, u_2, \ldots , u_p)\), and \((v_1, v_2, \ldots , v_p)\) has a solution. Item (1) of the Theorem follows then from the above Theorem 5. Moreover if we set \(Z=\bar{U} \cup \bar{V}\), then \(Z = A^\star \times B^\star \) iff \(X\cap Y =\emptyset \), and this implies Items (2) and (3).    \(\square \)

Using a 2-tape automaton \(\mathcal {C}\) accepting the finitary relation Z given by the above theorem, it is easy to construct, with similar methods as in the paper [Fin03] about infinitary rational relations, another 2-tape automaton \(\mathcal {D}\) accepting a finitary rational relation \(L \subseteq A^\star \times B^\star \) such that L is accepted by a deterministic 2-tape automaton iff L is accepted by a synchronous 2-tape automaton iff \(Z = A^\star \times B^\star \). Thus we can state the following result. The detailed proof is here left to the reader.

Theorem 14

let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a 2-tape automaton \(\mathcal {D}\), accepting a finitary rational relation \(L \subseteq A^\star \times B^\star \), for two alphabets A and B having at least two letters, and such that Cons(T) is equivalent to each of the following items:

  1. (1)

    L is accepted by a deterministic 2-tape automaton;

  2. (2)

    L is accepted by a synchronous 2-tape automaton.

Corollary 15

For every integer \(n\ge 0\), there exist 2-tape automata \(\mathcal {A}_n\), \(\mathcal {B}_n\), \(\mathcal {C}_n\), and \(\mathcal {D}_n\), accepting subsets of \(A^\star \times B^\star \), for two alphabets A and B having at least two letters, such that Cons\((T_n)\) is equivalent to each of the following items:

  1. (1)

    \(L(\mathcal {A}_n)\cap L(\mathcal {B}_n) =\emptyset \);

  2. (2)

    \(L(\mathcal {C}_n) = A^\star \times B^\star \);

  3. (3)

    \(L(\mathcal {D}_n)\) is accepted by a deterministic 2-tape automaton;

  4. (4)

    \(L(\mathcal {D}_n)\) is accepted by a synchronous 2-tape automaton.

In particular, if ZFC + “There exist (at least) n inaccessible cardinals” is consistent, then each of the properties of these 2-tape automata given by Items (1)–(4) is provable from ZFC + “There exist (at least) \(n+1\) inaccessible cardinals” but not from ZFC + “There exist (at least) n inaccessible cardinals”.

Since PA is consistent, we get the following result from Theorems 13 and 14 (where we assume, as we have already said at the beginning of this section, that automata are coded by integers):

Corollary 16

There exist 2-tape automata \(\mathcal {A}\), \(\mathcal {B}\), \(\mathcal {C}\), and \(\mathcal {D}\), accepting subsets of \(A^\star \times B^\star \), for two alphabets A and B having at least two letters, such that

  1. (1)

    \(L(\mathcal {A})\cap L(\mathcal {B}) =\emptyset \).

  2. (2)

    \(L(\mathcal {C}) = A^\star \times B^\star \).

  3. (3)

    \(L(\mathcal {D})\) is accepted by a deterministic 2-tape automaton.

  4. (4)

    \(L(\mathcal {D})\) is accepted by a synchronous 2-tape automaton.

But none of the items (1)–(4) is provable from PA.

We are now going to state some incompleteness results about weighted automata. We shall also state some incompleteness results about finitely generated semigroups of matrices with integer entries (with the semigroup operation of multiplication of matrices) which can be presented by automata with multiplicities, see [Har02].

We first recall the notion of an n-state \(\mathbb {Z}\)-automaton, i.e. a non-deterministic automaton with integer multiplicities, as presented in [Har02].

A non-deterministic \(\mathbb {Z}\)-automaton is a 5-tuple \(\mathcal {A}=(\varSigma , Q, \delta , J, F)\), where: \(\varSigma =\{a_1, a_2, \ldots , a_k\}\) is a finite input alphabet and the letter \(a_i\) is associated to a matrix \(M_i\in \mathbb {Z}^{n\times n}\); \(Q=\{1, 2, \ldots , n\}\) is the state set (and i corresponds to the ith row and column of the matrices); J is the set of initial states and \(F \subseteq Q\) is the set of final states; \(\delta \) is the set of transitions that provides the rules

$$r \mathop {\longrightarrow }\limits ^{\scriptstyle {{a_i \atopwithdelims ()m}}} s,$$

where \(a_i\in \varSigma \), and \(m=(M_i)_{rs}\) is the multiplicity of the rule.

A path

$$\pi =s_1 \mathop {\longrightarrow }\limits ^{\scriptstyle {{b_1 \atopwithdelims ()m_1}}} s_2 \mathop {\longrightarrow }\limits ^{\scriptstyle {{b_2 \atopwithdelims ()m_2}}} s_3 \longrightarrow \cdots \longrightarrow s_t \mathop {\longrightarrow }\limits ^{\scriptstyle {{b_t \atopwithdelims ()m_t}}} s_ {t+1}$$

is a computation of the automaton \(\mathcal {A}\) reading a word \(w=b_1b_2\ldots b_t \in \varSigma ^\star \) and the multiplicity of this path is equal to \(\Vert \pi \Vert = m_1m_2 \ldots m_t \in \mathbb {Z}\). For a word \(w\in \varSigma ^\star \) we denote by \(\varPi _{rs}\) the set of the paths of \(\mathcal {A}\) reading the word w which go from state r to state s. Then the multiplicity of the word \(w=a_{i_1}a_{i_2}\ldots a_{i_t } \in \varSigma ^\star \) from r to s is the sum

$$\mathcal {A}_{rs}(w) = \sum _{\pi \in \varPi _{rs}} \Vert \pi \Vert = ( M_ {i_1}M_ {i_2}\ldots M_ {i_t})_{rs}$$

and we get the multiplicity of w in \(\mathcal {A}\) from the accepting paths:

$$\mathcal {A}(w) = \sum _{r\in J, s\in F} \mathcal {A}_{rs}(w) = \sum _{r\in J, s\in F}( M_ {i_1}M_ {i_2}\ldots M_ {i_t})_{rs}.$$

We first state the following result.

Theorem 17

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a finite set of matrices \(M_1, M_2, \ldots , M_n \in \mathbb {Z}^{3\times 3}\), for some integer \(n\ge 1\), such that the subsemigroup of \(\mathbb {Z}^{3\times 3}\) generated by these matrices does not contain any matrix M with \(M_{13}=0\) if and only if T is consistent.

One can easily state corollaries of the above Theorem for strong set theories, as for previous results in this paper. Details are here left to the reader. Moreover, since PA is consistent, we also get the following result.

Corollary 18

There exists a finite set of matrices \(M_1, M_2,\ldots , M_{n} \in \mathbb {Z}^{3\times 3}\), for some integer \(n \ge 1\), such that:

  1. (1)

    the subsemigroup of \(\mathbb {Z}^{3\times 3}\) generated by these matrices does not contain any matrix M with \(M_{13}=0\), and

  2. (2)

    The property (1) is not provable from PA.

We also get the following result as a corollary of the above Theorem 17.

Corollary 19

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a 3-state \(\mathbb {Z}\)-automaton \(\mathcal {A}\) such that \(\mathcal {A}\) accepts a word with multiplicity zero iff T is inconsistent.

Corollary 20

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists two 2-state \(\mathbb {N}\)-automata \(\mathcal {A}\) and \(\mathcal {B}\) such that \(\mathcal {A}\) and \(\mathcal {B}\) accept a word w with the same multiplicity iff T is inconsistent.

One can easily state corollaries of the above one for strong set theories or for Peano Arithmetic, as for previous results in this paper. Details are here left to the reader.

Following an idea of Paterson, Halava and Harju proved in [HH01] that it is undecidable for finitely generated subsemigroups S of \(\mathbb {Z}^{3\times 3}\) whether S contains a matrix with \(M_{11}=0\). We now prove the following result.

Theorem 21

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a finite set of matrices \(M_1, M_2, \ldots , M_n \in \mathbb {Z}^{3\times 3}\), for some integer \(n\ge 1\), such that the subsemigroup of \(\mathbb {Z}^{3\times 3}\) generated by these matrices does not contain any matrix M with \(M_{11}=0\) if and only if T is consistent.

Recall that Paterson proved in 1970 that the mortality problem for finitely generated subsemigroups S of \(\mathbb {Z}^{3\times 3}\) is undecidable, i.e. that one cannot decide, for a given set of matrices \(M_1, M_2, \ldots , M_n \in \mathbb {Z}^{3\times 3}\), whether the zero matrix (whose all coefficients are equal to zero) belongs to the subsemigroup generated by the matrices \(M_1, M_2, \ldots , M_n\), i.e. whether there exists a sequence of integers \(i_1, i_2, \ldots i_k\), such that \(M_ {i_1}M_ {i_2}\ldots M_ {i_k}=0\). Halava and Harju gave a proof of this result in [HH01].

We can now state the following result.

Theorem 22

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a finite set of matrices \(M_1, M_2, \ldots , M_n \in \mathbb {Z}^{3\times 3}\), for some integer \(n\ge 1\), such that the subsemigroup of \(\mathbb {Z}^{3\times 3}\) generated by these matrices does not contain the zero matrix if and only if T is consistent.

Corollary 23

For every integer \(p\ge 0\), there exists a finite set of matrices \(M_1, M_2,\ldots , M_{n_p} \in \mathbb {Z}^{3\times 3}\), for some integer \(n_p \ge 1\), such that the subsemigroup of \(\mathbb {Z}^{3\times 3}\) generated by these matrices does not contain the zero matrix if and only if \(T_p\) is consistent.

In particular, if ZFC + “There exist (at least) p inaccessible cardinals” is consistent, then the property “The subsemigroup of \(\mathbb {Z}^{3\times 3}\) generated by the matrices \(M_1, M_2,\) \(\ldots , M_{n_p}\), does not contain the zero matrix” is provable from ZFC + “There exist (at least) \(p+1\) inaccessible cardinals” but not from ZFC + “There exist (at least) p inaccessible cardinals”.

Moreover, since PA is consistent, we also get the following result.

Corollary 24

There exists a finite set of matrices \(M_1, M_2,\ldots , M_{n} \in \mathbb {Z}^{3\times 3}\), for some integer \(n \ge 1\), such that:

  1. (1)

    the subsemigroup of \(\mathbb {Z}^{3\times 3}\) generated by these matrices does not contain the zero matrix, and

  2. (2)

    The property (1) is not provable from PA.

We have used in the proof of the above results some effective reductions of the PCP to some undecidable problems and an independence result about the solutions of some instances of the PCP. We can also sometimes use directly some effective reductions of the halting problem for Turing machines to some undecidable problems along with the above Lemma 2.

We now give some examples of independence results we can get by using this lemma.

Theorem 25

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a 1-counter automaton \(\mathcal {A}\), reading finite words over a finite alphabet \(\varSigma \), such that \(L(\mathcal {A})=\varSigma ^\star \) if and only if T is consistent.

Proof

Recall that Ibarra proved in [Iba79] that the universality problem for languages of 1-counter automata (and actually for some very restricted classes of 1-counter automata) is undecidable. He constructed, for each single-tape Turing machine \(\mathcal {M}\), a 1-counter automaton \(\mathcal {A}\), reading finite words over a finite alphabet \(\varSigma \), such that \(L(\mathcal {A})=\varSigma ^\star \) iff the machine \(\mathcal {M}\) does not halt on the blank tape. The result now follows from the above Lemma 2.    \(\square \)

We can now prove the following result.

Theorem 26

Let T be a recursive theory in the language of set theory or \(T=\mathbf{PA}\). Then there exists a 1-counter automaton \(\mathcal {A}\), reading finite words over a finite alphabet \(\varSigma \), such that Cons(T) is equivalent to each of the following items:

  1. (1)

    \(L(\mathcal {A}) = \varSigma ^\star \);

  2. (2)

    \(L(\mathcal {A}) \) is accepted by a deterministic 1-counter automaton;

  3. (3)

    \(L(\mathcal {A})\) is accepted by an unambiguous 1-counter automaton.

Corollary 27

For every integer \(n\ge 0\), there exists a 1-counter automaton \(\mathcal {A}_n\), reading finite words over a finite alphabet \(\varSigma \), such that Cons\((T_n)\) is equivalent to each of the following items:

  1. (1)

    \(L(\mathcal {A}_n) = \varSigma ^\star \);

  2. (2)

    \(L(\mathcal {A}_n) \) is accepted by a deterministic 1-counter automaton;

  3. (3)

    \(L(\mathcal {A}_n)\) is accepted by an unambiguous 1-counter automaton.

In particular, if ZFC + “There exist (at least) n inaccessible cardinals” is consistent, then each of the properties of the 1-counter automaton \(\mathcal {A}_n\) given by Items (1)–(3) is provable from ZFC + “There exist (at least) \(n+1\) inaccessible cardinals” but not from ZFC + “There exist (at least) n inaccessible cardinals”.

Remark 28

Part of Theorem 26 and of Corollary 27 subsumes Items (2) and (3) of Theorem 11 and of Corollary 12. Indeed we can construct, from a given pushdown automaton (and thus also from a given 1-counter automaton) accepting a finitary language, a context-free grammar generating the same language.

4 Concluding Remarks

We have shown that some very elementary properties of some automata over finite words are actually independent from strong set theories like ZFC + “There exist (at least) n inaccessible cardinals”. The results of this paper are true for other large cardinals than inaccessible ones. For instance we can replace inaccessible cardinals by hyperinaccessible, hyperMahlo, measurable, ...and still other ones and obtain similar results.

Some of our results are even more general because they could have been stated for more general recursive theories,