1 Introduction

1.1 Concatenation theory versus number theory

First-order concatenation theory can be compared to first-order number theory, e.g., Peano Arithmetic or Robinson Arithmetic. The universe of a standard structure for first-order number theory is the set of natural numbers. The universe of a standard structure for first-order concatenation theory is the set of finite strings over some alphabet. A first-order language for number theory normally contains two binary functions symbols. In a standard structure these symbols will be interpreted as addition and multiplication. A first-order language for concatenation theory normally contains just one binary function symbol. In a standard structure this symbol will be interpreted as the operator that concatenates two stings. A classical first-order language for concatenation theory—like e.g. the ones studied in Quine [19] and Grzegorczyk [5]—contains no other non-logical symbols apart from constant symbols.

We will stick to a version of concatenation theory where we have a binary alphabet consisting of the bits zero and one, and we will refer to this version as bit theory. It is convenient to introduce and explain some notation before we continue our discussion.

1.2 Notation and terminology

We will use \({\varvec{0}}\) and \({\varvec{1}}\) to denote respectively the bits zero and one, and we use pretty standard notation when we work with bit strings: \(\{ {\varvec{0}}, {\varvec{1}}\}^*\) denotes the set of all finite bit strings; \(|\alpha |\) denotes the length of the bit string \(\alpha \); \((\alpha )_i\) denotes the \(i{{\mathrm{th}}}\) bit of the bit string \(\alpha \); and \({\varvec{0}}{\varvec{1}}^3{\varvec{0}}^2{\varvec{1}}\) denotes the bit string \({\varvec{0}}{\varvec{1}}{\varvec{1}}{\varvec{1}}{\varvec{0}}{\varvec{0}}{\varvec{1}}\). The set \(\{ {\varvec{0}}, {\varvec{1}}\}^*\) contains the empty string which we will denote \(\varepsilon \).

The language \(\mathcal {L}_{BT}^{-}\) of first-order bit theory consists of the constant symbols e, 0, 1 and the binary function symbol \(\circ \). We will use \({\mathfrak {B}}^{-}\) to denote the standard \(\mathcal {L}_{BT}^{-}\)-structure: The universe of \({\mathfrak {B}}^{-}\) is the set \(\{ {\varvec{0}}, {\varvec{1}}\}^*\). The constant symbol 0 is interpreted as the string containing nothing but the bit \({\varvec{0}}\), and the constant symbol 1 is interpreted as the string containing nothing but the bit \({\varvec{1}}\), that is, \(0^{{\mathfrak {B}}^{-}} = {\varvec{0}}\) and \(1^{{\mathfrak {B}}^{-}} = {\varvec{1}}\). The constant symbol e is interpreted as the empty string, that is, \(e^{{\mathfrak {B}}^{-}} = \varepsilon \). Finally, \(\circ ^{{\mathfrak {B}}^{-}}\) is the function that concatenates two strings (e.g. \({\varvec{0}}{\varvec{1}} \circ ^{{\mathfrak {B}}^{-}} {\varvec{0}}{\varvec{0}}{\varvec{0}} = {\varvec{0}}{\varvec{1}}{\varvec{0}}{\varvec{0}}{\varvec{0}}\) and \( \varepsilon \circ ^{{\mathfrak {B}}^{-}} \varepsilon = \varepsilon \)).

We will soon need the biterals. For each \(\alpha \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) we define the biteral \({\overline{\alpha }}\) by \({\overline{\varepsilon }} = e\), \(\overline{\alpha {\varvec{0}}} = {\overline{\alpha }} \circ 0\) and \(\overline{\alpha {\varvec{1}}} = {\overline{\alpha }} \circ 1\). The biterals correspond to the numerals of first-order number theory: they serve as canonical names for the elements in the universe of the standard structure. Note that, e.g., \(((e \circ 1)\circ 1) \circ 0\) is a biteral whereas \((e\circ 1)\circ (1\circ 0)\) is not.

1.3 Decidability and undecidability

At a first glance the parsimonious language of first-order bit theory does not seem very expressive, but a little bit of thought shows otherwise. Observe that we can encode a sequence \(a_1, a_2, \ldots , a_n\) of natural numbers by the bit string

$$\begin{aligned} {\varvec{0}}{\varvec{0}}{\varvec{1}}{\varvec{0}}{\varvec{1}}^{a_1+1}{\varvec{0}}{\varvec{0}} {\varvec{1}}{\varvec{1}}{\varvec{0}}{\varvec{1}}^{a_2+1}{\varvec{0}}{\varvec{0}} {\varvec{1}}^3{\varvec{0}}{\varvec{1}}^{a_3+1}{\varvec{0}}{\varvec{0}}\ldots {\varvec{0}}{\varvec{0}}{\varvec{1}}^n{\varvec{0}}{\varvec{1}}^{a_n+1}{\varvec{0}}{\varvec{0}}. \end{aligned}$$

Furthermore, we can state that a string is a substring of another (the formula \(\exists uv[(u \circ x) \circ v = y]\) holds in \({\mathfrak {B}}^{-}\) iff x is a substring of y). We can state that a string contains only ones (the formula \(\lnot \exists uv[(u \circ 0) \circ v = x]\) holds in \({\mathfrak {B}}^{-}\) iff x contains only ones, and so does the the formula \(x\circ 1= 1\circ x\)). We can state that a bit string does not contain two consecutive occurrences of zeros, and so on. If we proceed along these lines, we can come up with a formula \(\phi (x,y,z)\) such that \(\phi (\overline{{\varvec{1}}^{i}}, \overline{{\varvec{1}}^{a}},{\overline{\alpha }})\) is true in \({\mathfrak {B}}^{-}\) iff \(\alpha \) encodes a sequence of natural numbers where the \(i^{{\mathrm{th}}}\) element is a. The reader interested in the details should consult Section 8 of Leary and Kristiansen [15].

First-order bit theory is indeed expressive enough to code and decode sequences of natural numbers, and then it should be no surprise that the following theorem holds. e.g., it is straightforward to prove the theorem by induction over a Kleene-recursive definition of f.

Theorem 1

(Definability of computable functions) For any (partially) computable function \(f:{\mathbb {N}}^n \rightarrow {\mathbb {N}}\) there exists an \(\mathcal {L}_{BT}^{-}\)-formula \(\phi (x_1,\ldots , x_n,y)\) such that

$$\begin{aligned} f(a_1, \ldots , a_n)= b \;\; \Leftrightarrow \;\; {\mathfrak {B}}^{-} \models \phi (\overline{{\varvec{1}}^{a_1}},\ldots , \overline{{\varvec{1}}^{a_n}},\overline{{\varvec{1}}^{b}}). \end{aligned}$$

Moreover, given a definition of the function, we can compute the formula.

This theorem implies that it is undecidable if an \(\mathcal {L}_{BT}^{-}\)-sentence is true in the standard structure \({\mathfrak {B}}^{-}\). It is of course also undecidable if a sentence of first-order number theory is true in its standard structure \({\mathfrak {N}}\). Indeed, due to the negative solution of Hilbert’s \(10{{\mathrm{th}}}\) problem (the Davis-Putnam-Robinson-Matiyasevich Theorem), it is even undecidable if a sentence of the form

$$\begin{aligned} \exists x_1, \ldots , x_n[ s=t ] \end{aligned}$$

is true in \({\mathfrak {N}}\). The bit-theoretic version of Hilbert’s \(10{{\mathrm{th}}}\) problem turned out to have a positive solution. The next theorem is just a reformulation of a result of Makanin [16].

Theorem 2

(Makanin) It is decidable if an \(\mathcal {L}_{BT}^{-}\)-sentence of the form

$$\begin{aligned} \exists x_1, \ldots , x_n[ s=t ] \end{aligned}$$

is true in \({\mathfrak {B}}^{-}\).

Hence, it is in general undecidable if a sentence is true in \({\mathfrak {B}}^{-}\), but it is decidable if a sentence of the form \(\exists x_1, \ldots x_n[s=t]\) is true in \({\mathfrak {B}}^{-}\). This raises the question: where do we find the border between the decidable and the undecidable? For which subclasses of formulas can we, or can we not, decide truth in the standard structure? Such a question yields an obvious motivation for introducing bounded quantifiers similar to those we know from number theory. Once the bounded quantifiers are there, a number of other questions will knock at the door.

1.4 Bounded quantifiers and \({\varSigma }\)-formulas

The first-order language \(\mathcal {L}_{BT}\) is \(\mathcal {L}_{BT}^{-}\) extended by a binary relation symbol \(\sqsubseteq \). We introduce the bounded existential quantifier \((\exists x \sqsubseteq t)\phi \) and bounded universal quantifier \((\forall x \sqsubseteq t)\phi \) as shorthand notations for respectively

$$\begin{aligned} \exists x [ x \sqsubseteq t \, \wedge \, \phi ]\;\;\; \text{ and } \;\;\; \forall x [ x \sqsubseteq t \, \rightarrow \, \phi ] . \end{aligned}$$

Next we define the \({\varSigma }\)-formulas inductively by

  • \(\phi \) and \(\lnot \phi \) are \({\varSigma }\)-formulas if \(\phi \) is of the form \(s\sqsubseteq t\), or of the form \(s = t\), where s and t are terms

  • \((\phi \vee \psi )\) and \((\phi \wedge \psi )\) are \({\varSigma }\)-formulas if \(\phi \) and \(\psi \) are \({\varSigma }\)-formulas

  • \((\exists x \sqsubseteq t) \phi \) and \((\forall x \sqsubseteq t) \phi \) and \((\exists x) \phi \) are \({\varSigma }\)-formulas if \(\phi \) is a \({\varSigma }\)-formula, t is a term and x is a variable not occurring in t.

A purely existential formula is a \({\varSigma }\)-formula that does not contain bounded universal quantifiers.

We assume that the reader notes the similarities with first-order number theory. The formulas that correspond to \({\varSigma }\)-formulas in number theory are often called \({\varSigma }_1\)-formulas or \({\varSigma }^0_1\)-formulas. Now, in contrast to in number theory, it is not clear how the relation symbol that defines the bounded quantifiers should be interpreted. In the standard model for number theory the relation symbol should obviously be interpreted as the standard ordering relation of the natural numbers. There do not seem to be any other natural options. We can chose between the less-than or less-than-or-equal-to relation over the natural numbers, and that is it. In bit theory a number of essentially different interpretations will make sense. We might interpret \(x \sqsubseteq y\) as

  • x is a substring y,

  • x is a prefix of y,

  • x is shorter than y.

The three interpretations listed above are the ones that will be investigated in the current paper, but there are definitely other interesting options. We might, e.g., interpret \(\sqsubseteq \) as the subword relation investigated in Halfon et. al. [8], or as a lexicographical ordering relation.

1.5 More on notation and terminology

We reserve the letter \({\mathfrak {B}}\) for the structure where \(\sqsubseteq \) is the substring relation, that is, the \(\mathcal {L}_{BT}\)-structure \({\mathfrak {B}}\) is the extension of \({\mathfrak {B}}^{-}\) where \(\alpha \sqsubseteq ^{\mathfrak {B}} \beta \) holds iff there exists \(\gamma ,\delta \in \{{\varvec{0}}, {\varvec{1}}\}^*\) such that \(\gamma \alpha \delta =\beta \).

The \(\mathcal {L}_{BT}\)-structure \({\mathfrak {D}}\) is the same structure as \({\mathfrak {B}}\) with one exception: the relation \(\alpha \sqsubseteq ^{\mathfrak {D}} \beta \) holds iff \(\alpha \) is a prefix of \(\beta \), that is, iff there exists \(\gamma \in \{{\varvec{0}}, {\varvec{1}}\}^*\) such that \(\alpha \gamma = \beta \).

The \(\mathcal {L}_{BT}\)-structure \({\mathfrak {F}}\) is the same structure as \({\mathfrak {B}}\) with one exception: the relation \(\alpha \sqsubseteq ^{\mathfrak {F}} \beta \) holds iff the number of bits in \(\alpha \) is less than or equal to the number of bits in \(\beta \), that is, iff \(|\alpha |\le |\beta |\).

To improve the readability we will use the symbol \(\preceq \) in place of the symbol \(\sqsubseteq \) in formulas that are meant to be interpreted in the structure \({\mathfrak {D}}\). Thus, \(x \preceq y\) should be read as “x is a prefix of y”. Similarly, we will use \(\trianglelefteq \) in formulas that are meant to be interpreted in \({\mathfrak {F}}\), and \(x\trianglelefteq y\) should be read as “x is shorter than y”. We will continue to use the symbol \(\sqsubseteq \) in formulas that are meant to be interpreted in \({\mathfrak {B}}\). Thus, \(x \sqsubseteq y\) should be read as “x is a substring of y”.

We may skip the operator \(\circ \) in first-order formulas and simply write st in place of \(s\circ t\), and we will of course also skip parentheses in terms whenever this is not likely to cause confusion. Furthermore, we will occasionally contract quantifiers and write, e.g., \((\forall x y \sqsubseteq z)[\phi ] \ \) in place of \((\forall x \sqsubseteq z)(\forall y \sqsubseteq z) \phi \), and for \(\sim \, \in \{\preceq , \sqsubseteq ,\trianglelefteq , =\}\), we will normally write \(s\not \sim t\) in place of \(\lnot s\sim t\).

Recall that a sentence is a formula with no free variables.

1.6 References and related research

Formal concatenation theory can be traced back to Tarski [23] and Hermes [9] (see [20] for an English review). Quine [19] and Corcoran et al. [2] are also papers on the subject which may have some historical interest. A rather recent line of research in concatenation theory has focused on interpretablity between weak first-order theories and essential undecidability. Grzegorczyk [5], Grzegorczyk and Zdanowski [6], Svejdar [22], Visser [24], Horihata [11] and Higuchi and Horihata [10] belong to this line. Another recent line of research has focused on word equations and formal languages. Papers in this line, like e.g., Karhumäki et al. [12], Ganesh et al. [4], Halfon et al. [8] and Day et al. [3], are in general oriented towards theoretical computer science. Both lines are related to our research: the former to the first-order theories we present in Sect. 2, the latter to the results we present in last two sections. More on the history of concatenation theory can be found in Visser [24].

The present paper is a significantly extended and improved version of the conference paper Kristiansen and Murwanashyaka [13]. We assume that the reader is familiar with the basics of mathematical logic and computability theory. An introduction can be found in Leary and Kristiansen [15] (Chapter 8 contains some material on concatenation theory). Some familiarity with first-order arithmetic will probably also be beneficial to the reader. An introduction can be found in Hajek and Pudlak [7].

2 \({\varSigma }\)-complete axiomatizations

Once the bounded quantifiers are present, it is natural to ask if we can find neat and natural \({\varSigma }\)-complete axiomatizations of bit theory. Corresponding axiomatizations of number theory, e.g. Robinson Arithmetic, have been of great importance in logic. In this section we will give finite sets of axioms that are \({\varSigma }\)-complete with respect to our different structures (\({\mathfrak {B}}\), \({\mathfrak {D}}\) and \({\mathfrak {F}}\)). These axiomatizations might serve as base theories which can be extended with, e.g., collection principles or induction schemes of the form

$$\begin{aligned} \left( \ \phi (e) \; \wedge \; \forall x [ \phi (x) \rightarrow (\phi (x0) \wedge \phi (x1)) ]\ \right) \rightarrow \forall x [ \phi (x) ] . \end{aligned}$$

2.1 The theory \(B^{-}\)

\(B^{-}\) is an \(\mathcal {L}_{BT}^{-}\)-theory. All the first-order theories we will present contain the axioms of \(B^{-}\).

Definition 1

The first-order theory \(B^{-}\) contains the following four non-logical axioms:

  1. 1.

    \(\forall x[ x= e x \wedge x=x e ] \)

  2. 2.

    \(\forall x y z [ (x y) z = x (y z) ]\)

  3. 3.

    \(\forall x y[ ( x \ne y) \rightarrow ( ( x 0 \ne y 0) \wedge ( x 1 \ne y 1) ) ] \)

  4. 4.

    \( \forall x y [ x 0 \ne y 1 ] \)

We will use \(B^{-}_i\) to refer to the \(i{{\mathrm{th}}}\) axiom of \(B^{-}\). \(\square \)

Lemma 1

Let \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\). Then \(B^{-}\vdash {\overline{\alpha }} \circ {\overline{\beta }} = \overline{\alpha \beta }\).

Proof

We prove the lemma by induction on the length of \(\beta \), and we consider the following cases: \(\beta \equiv \varepsilon \), \(\beta \equiv \gamma {\varvec{0}}\) and \(\beta \equiv \gamma {\varvec{1}}\).

Assume \(\beta \equiv \varepsilon \). Then \({\overline{\beta }}\equiv e\), and the lemma holds by the axiom \(B^{-}_1\). Assume \(\beta \equiv \gamma {\varvec{0}}\). By the induction hypothesis, we have \(B^{-}\vdash {\overline{\alpha }} \circ {\overline{\gamma }} = \overline{\alpha \gamma }\). Thus, we also have

$$\begin{aligned} B^{-}\vdash ({\overline{\alpha }} \circ {\overline{\gamma }}) \circ 0 = \overline{\alpha \gamma } \circ 0 . \end{aligned}$$

By \(B^{-}_2\), we have

$$\begin{aligned} B^{-}\vdash {\overline{\alpha }} \circ ({\overline{\gamma }} \circ 0) = \overline{\alpha \gamma } \circ 0 . \end{aligned}$$

Thus, the lemma holds as \({\overline{\beta }} \equiv {\overline{\gamma }} \circ 0\) and \(\overline{\alpha \beta } \equiv \overline{\alpha \gamma {\varvec{0}}} \equiv \overline{\alpha \gamma } \circ 0\). The case \(\beta \equiv \gamma {\varvec{1}}\) is similar. \(\square \)

Lemma 2

For any \(\mathcal {L}_{BT}\)-term t there is \(\alpha \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) such that \(B^{-}\vdash t={\overline{\alpha }}\).

Proof

We will use induction on the structure of t. Assume \(t\equiv e\). Obviously, \(B^{-}\vdash e=e\). Thus, we have \(B^{-}\vdash e ={\overline{\varepsilon }}\) as \({\overline{\varepsilon }}\equiv e\). Assume \(t\equiv 0\). By \(B^{-}_1\), we have \(B^{-}\vdash 0 = e\circ 0\). Thus, we have \(B^{-}\vdash 0 = \overline{{\varvec{0}}}\) as \(\overline{{\varvec{0}}} = e\circ 0\). The case \(t\equiv 1\) is similar to the case \(t\equiv 0\). Finally, assume \(t\equiv t_1\circ t_2\). By induction hypothesis we have \(\alpha _1, \alpha _2 \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) such that \(B^{-}\vdash t_1=\overline{\alpha _1}\) and \(B^{-}\vdash t_2=\overline{\alpha _2}\). By Lemma 1, we have \(B^{-}\vdash \overline{\alpha _1} \circ \overline{\alpha _2} = \overline{\alpha _1\alpha _2}\). Thus, \(B^{-}\vdash t =\overline{\alpha _1\alpha _2}\). \(\square \)

Lemma 3

\( B^{-}_1, B^{-}_2, B^{-}_4 \vdash \forall x[ x 0 \ne e \wedge x1 \ne e ]\).

Proof

We reason in an arbitrary model for \(\{ B^{-}_1, B^{-}_2, B^{-}_4 \}\). Let x be an arbitrary element in the universe. Assume \(x0=e\). Then \(1(x0)=1e\). By \(B^{-}_1\), we have \(1(x0)=1\). By \(B^{-}_2\), we have \((1x)0=1\). By \(B^{-}_1\), we have \((1x)0=e1\). This contradicts \(B^{-}_4\). This proves that \(x0\ne e\). A symmetric argument shows that \(x1\ne e\). \(\square \)

Lemma 4

Let \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) and \(\alpha \ne \beta \). Then \(B^{-}\vdash {\overline{\alpha }} \ne {\overline{\beta }}\).

Proof

We prove the lemma by induction on the natural number \(\min (|\alpha |,|\beta |)\). Assume \(\min (|\alpha |,|\beta |)=0\). Then, either \(\alpha \) or \(\beta \) will be the empty string \(\varepsilon \). Furthermore, it cannot be the case that both \(\alpha \) or \(\beta \) are the empty string as \(\alpha \ne \beta \). By Lemma 3, we have \(B^{-}\vdash {\overline{\alpha }} \ne {\overline{\beta }}\).

Assume \(\min (|\alpha |,|\beta |)>0\). Then we have \(\alpha \equiv \alpha 'a\) and \(\beta \equiv \beta 'b\) where \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) and \(a,b\in \{ {\varvec{0}}, {\varvec{1}}\}\). The proof splits into two cases: (i) a and b are equal, and (ii) a and b are different. Case (i): The induction hypothesis yields \( B^{-}\vdash \overline{\alpha '} \ne \overline{\beta '}\), and the lemma follows by \(B^{-}_3\). Case (ii): The lemma follows straightaway by \(B^{-}_4\) (we do not need the induction hypothesis). \(\square \)

We leave the proof of the next theorem to the reader (see the proof of Theorem 4).

Theorem 3

For any purely existential sentence \(\phi \), we have

$$\begin{aligned} {\mathfrak {B}}^{-} \models \phi \; \Rightarrow \; B^{-}\vdash \phi . \end{aligned}$$

2.2 The structure \({\mathfrak {B}}\)

Definition 2

The first-order theory B contains the following eleven non-logical axioms:

  1. -

    the first four axioms are the axioms of \(B^{-}\)

  2. 5.

    \(\forall x [x \sqsubseteq e \leftrightarrow x=e ] \)

  3. 6.

    \(\forall x[x \sqsubseteq 0 \leftrightarrow (x=e \vee x = 0) ] \)

  4. 7.

    \(\forall x [x \sqsubseteq 1 \leftrightarrow (x=e \vee x = 1) ] \)

  5. 8.

    \( \forall x y [x \sqsubseteq 0 y 0 \leftrightarrow (x = 0 y 0 \vee x \sqsubseteq 0 y \vee x \sqsubseteq y 0 ) ]\)

  6. 9.

    \(\forall x y [ x \sqsubseteq 0 y 1 \leftrightarrow (x = 0 y 1 \vee x \sqsubseteq 0 y \vee x \sqsubseteq y 1 ) ]\)

  7. 10.

    \(\forall x y [ x \sqsubseteq 1 y 0 \leftrightarrow (x = 1 y 0 \vee x \sqsubseteq 1 y \vee x \sqsubseteq y 0 ) ]\)

  8. 11.

    \(\forall x y [ x \sqsubseteq 1 y 1 \leftrightarrow (x = 1 y 1 \vee x \sqsubseteq 1 y \vee x \sqsubseteq y 1 ) ]\)

We will use \(B_i\) to refer to the \(i{{\mathrm{th}}}\) axiom of B. \(\square \)

Lemma 5

Let \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) and \(\alpha \sqsubseteq ^{\mathfrak {B}} \beta \) (i.e. \(\alpha \) is a substring of \(\beta \)). Then \(B\vdash {\overline{\alpha }} \sqsubseteq {\overline{\beta }}\).

Proof

We prove this lemma by induction on the length of \(\beta \). The proof splits into the cases \(\beta \equiv \varepsilon \), \(\beta \equiv {\varvec{0}}\), \(\beta \equiv {\varvec{1}}\), \(\beta \equiv {\varvec{0}}\gamma {\varvec{0}}\), \(\beta \equiv {\varvec{0}}\gamma {\varvec{1}}\), \(\beta \equiv {\varvec{1}}\gamma {\varvec{0}}\) and \(\beta \equiv {\varvec{1}}\gamma {\varvec{1}}\).

In the cases when \(\beta \) is empty or just contains a single bit, the lemma holds by \(B_5\), \(B_6\) or \(B_7\).

Assume \(\beta \equiv {\varvec{0}}\gamma {\varvec{0}}\). The proof splits into the cases

$$\begin{aligned} \hbox {(i)} \, \alpha = {\varvec{0}}\gamma {\varvec{0}}, \, \hbox {(ii)} \, \alpha \sqsubseteq ^{\mathfrak {B}} {\varvec{0}}\gamma \, \hbox {and (iii)} \, \alpha \sqsubseteq ^{\mathfrak {B}} \gamma {\varvec{0}}. \end{aligned}$$

In case (i), we have \(B \vdash {\overline{\alpha }} = {\overline{\beta }}\) by logical axioms. By \(B_8\), we have \(B\vdash {\overline{\alpha }} \sqsubseteq {\overline{\beta }}\). In case (ii), the induction hypothesis yields \(B\vdash {\overline{\alpha }} \sqsubseteq \overline{ {\varvec{0}}\gamma }\). By \(B_8\), we have \(B\vdash {\overline{\alpha }} \sqsubseteq {\overline{\beta }}\). In case (iii), the induction hypothesis yields \(B\vdash {\overline{\alpha }} \sqsubseteq \overline{ \gamma {\varvec{0}}}\). By \(B_8\), we have \(B\vdash {\overline{\alpha }} \sqsubseteq {\overline{\beta }}\).

The cases \(\beta \equiv {\varvec{0}}\gamma {\varvec{1}}\), \(\beta \equiv {\varvec{1}}\gamma {\varvec{0}}\) and \(\beta \equiv {\varvec{1}}\gamma {\varvec{1}}\) are similar to the case \(\beta \equiv {\varvec{0}}\gamma {\varvec{0}}\), use \(B_9\), \(B_{10}\) and \(B_{11}\), respectively, in place of \(B_8\). \(\square \)

Lemma 6

Let \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) and \(\alpha \not \sqsubseteq ^{\mathfrak {B}} \beta \) (i.e. \(\alpha \) is a not substring of \(\beta \)). Then \(B\vdash {\overline{\alpha }} \not \sqsubseteq {\overline{\beta }}\).

Proof

The proof of this lemma is symmetric to the proof of Lemma 5, and we omit the details. \(\square \)

Lemma 7

Let \(\phi (x)\) be an \(\mathcal {L}_{BT}\)-formula such that

$$\begin{aligned} {\mathfrak {B}} \models \phi ({\overline{\alpha }}) \; \Rightarrow \; B \vdash \phi ({\overline{\alpha }}) \end{aligned}$$
(*)

for any \(\alpha \in \{ {\varvec{0}}, {\varvec{1}}\}^*\). Then we have

$$\begin{aligned} {\mathfrak {B}} \models (\forall x \sqsubseteq {\overline{\alpha }})\phi (x) \; \Rightarrow \; B \vdash (\forall x \sqsubseteq {\overline{\alpha }})\phi (x) \end{aligned}$$

for any \(\alpha \in \{ {\varvec{0}}, {\varvec{1}}\}^*\).

Proof

We proceed by induction on the length of \(\alpha \). We will consider the cases \(\alpha \equiv \varepsilon \), \(\alpha \equiv {\varvec{0}}\), \(\alpha \equiv {\varvec{1}}\), \(\alpha \equiv {\varvec{0}}\beta {\varvec{0}}\), \(\alpha \equiv {\varvec{0}}\beta {\varvec{1}}\), \(\alpha \equiv {\varvec{1}}\beta {\varvec{0}}\) and \(\alpha \equiv {\varvec{1}}\beta {\varvec{1}}\).

Let \(\alpha \equiv \varepsilon \). Assume \({\mathfrak {B}} \models (\forall x \sqsubseteq e)\phi (x)\). Then \({\mathfrak {B}} \models \phi (e)\). By (*), we have \(B\vdash \phi (e)\). By \(B_5\), we have \(B \vdash (\forall x \sqsubseteq e)\phi (x)\).

Let \(\alpha \equiv {\varvec{0}}\). Assume \({\mathfrak {B}} \models (\forall x \sqsubseteq \overline{{\varvec{0}}})\phi (x)\). Then \({\mathfrak {B}} \models \phi ({\overline{\varepsilon }}) \wedge \phi (\overline{{\varvec{0}}})\). By (*), we have \(B\vdash \phi ({\overline{\varepsilon }}) \wedge \phi (\overline{{\varvec{0}}})\). By \(B_6\), we have \(B \vdash (\forall x \sqsubseteq \overline{{\varvec{0}}})\phi (x)\). The case \(\alpha \equiv {\varvec{1}}\) is similar to the case \(\alpha \equiv {\varvec{0}}\). Use \(B_7\) in place of \(B_6\).

Let \(\alpha \equiv {\varvec{0}}\beta {\varvec{0}}\). Assume \({\mathfrak {B}} \models (\forall x \sqsubseteq \overline{{\varvec{0}}\beta {\varvec{0}}} )\phi (x)\). Then

$$\begin{aligned} {\mathfrak {B}} \models \phi (\overline{{\varvec{0}}\beta {\varvec{0}}}) \; \wedge \; (\forall x \sqsubseteq \overline{{\varvec{0}}\beta })\phi (x) \; \wedge \; (\forall x \sqsubseteq \overline{\beta {\varvec{0}}})\phi (x). \end{aligned}$$

By (*) and the induction hypothesis, we have

$$\begin{aligned} B \vdash \phi (\overline{{\varvec{0}}\beta {\varvec{0}}}) \; \wedge \; (\forall x \sqsubseteq \overline{{\varvec{0}}\beta })\phi (x) \; \wedge \; (\forall x \sqsubseteq \overline{\beta {\varvec{0}}})\phi (x) . \end{aligned}$$

By \(B_8\), we have \(B\vdash (\forall x \sqsubseteq \overline{{\varvec{0}}\beta {\varvec{0}}} )\phi (x)\).

The case \(\alpha \equiv {\varvec{0}}\beta {\varvec{1}}\), the case \(\alpha \equiv {\varvec{1}}\beta {\varvec{0}}\) and the case \(\alpha \equiv {\varvec{1}}\beta {\varvec{1}}\) are handled similarly using \(B_9\), \(B_{10}\) and \(B_{11}\), respectively, in place of \(B_8\). \(\square \)

Theorem 4

(\({\varSigma }\)-completeness of B) For any \({\varSigma }\)-sentence \(\phi \), we have

$$\begin{aligned} {\mathfrak {B}} \models \phi \; \Rightarrow \; B\vdash \phi . \end{aligned}$$

Proof

We prove the theorem by induction on the structure of the \({\varSigma }\)-sentence \(\phi \). The base cases are \(\phi \equiv s=t\), \(\phi \equiv s\ne t\), \(\phi \equiv s \sqsubseteq t\) and \(\phi \equiv s \not \sqsubseteq t\) (where s and t are variable free). We attend to the case \(\phi \equiv s \sqsubseteq t\). So assume \(\phi \equiv s \sqsubseteq t\). Furthermore, assume \({\mathfrak {B}} \models s \sqsubseteq t\). By Lemma 2, we have \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) such that

$$\begin{aligned} B\vdash s= {\overline{\alpha }} \; \wedge \; t= {\overline{\beta }} . \end{aligned}$$
(*)

By the Soundness Theorem for first-order logic, we have \(\alpha \sqsubseteq ^{{\mathfrak {B}}} \beta \). By Lemma 5, we have \(B\vdash {\overline{\alpha }} \sqsubseteq {\overline{\beta }}\). By (*), we have \(B\vdash s \sqsubseteq t\). This proves that the theorem holds when \(\phi \equiv s \sqsubseteq t\). The cases \(\phi \equiv s=t\), \(\phi \equiv s\ne t\) and \(\phi \equiv s \not \sqsubseteq t\) are similar. Use Lemma 4 in place of Lemma 5 when \(\phi \equiv s\ne t\). Use Lemma 6 in place of Lemma 5 when \(\phi \equiv s \not \sqsubseteq t\).

We turn to the inductive cases. Let \(\phi \equiv (\psi \wedge \xi )\). Assume \({\mathfrak {B}} \models \psi \wedge \xi \). Then we have \({\mathfrak {B}} \models \psi \) and \({\mathfrak {B}} \models \xi \). By the induction hypothesis, we have \(B\vdash \psi \) and \(B \vdash \xi \). Thus, \(B\vdash \psi \wedge \xi \). The case \(\phi \equiv (\psi \vee \xi )\) is similar.

Let \(\phi \equiv (\exists x)\psi (x)\). Assume \({\mathfrak {B}} \models (\exists x)\psi (x)\). Then we have \({\mathfrak {B}} \models \psi ({\overline{\alpha }})\) for some \(\alpha \in \{ {\varvec{0}}, {\varvec{1}}\}^*\). Our induction hypothesis yields \(B\vdash \psi ({\overline{\alpha }})\), and then we also have \(B\vdash (\exists x)\psi (x)\).

Let \(\phi \equiv (\forall x\sqsubseteq t)\psi (x)\). Assume \({\mathfrak {B}} \models (\forall x\sqsubseteq t)\psi (x)\). By Lemma 2, we have \(\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) such that

figure a

By the Soundness Theorem of first-order logic, we have

figure b

Our induction hypothesis yields

$$\begin{aligned} {\mathfrak {B}} \models \psi ({\overline{\alpha }}) \;\; \Rightarrow B\vdash \psi ({\overline{\alpha }}) \end{aligned}$$
(IH)

for all \(\alpha \in \{ {\varvec{0}}, {\varvec{1}}\}^*\). By (IH), (\(\ddagger \)) and Lemma 7, we have \(B\vdash (\forall x\sqsubseteq {\overline{\beta }})\psi (x)\). Finally, by (\(\dagger \)), we have \(B\vdash (\forall x\sqsubseteq t)\psi (x)\). This completes the case where \(\phi \) is of the form \((\forall x\sqsubseteq t)\psi (x)\). We leave the case \(\phi \equiv (\exists x\sqsubseteq t)\psi (x)\) to the reader. \(\square \)

2.3 The structure \({\mathfrak {D}}\)

Definition 3

The first-order theory D contains the following seven non-logical axioms:

  1. -

    the first four axioms are the axioms of \(B^{-}\)

  2. 5.

    \(\forall x[ x \preceq e \leftrightarrow x=e ]\)

  3. 6.

    \( \forall x y [ x \preceq y 0 \leftrightarrow (x = y 0 \vee x \preceq y) ]\)

  4. 7.

    \(\forall x y [ x \preceq y 1 \leftrightarrow (x = y 1 \vee x \preceq y) ]\)

We will use \(D_i\) to refer to the \(i{{\mathrm{th}}}\) axiom of D. \(\square \)

Lemma 8

Let \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\), and let \(\alpha \preceq ^{\mathfrak {D}} \beta \) (i.e. \(\alpha \) is a prefix of \(\beta \)). Then \(D\vdash {\overline{\alpha }} \preceq {\overline{\beta }}\).

Proof

This proof is symmetric to the proof of the next lemma. We omit the details. \(\square \)

Lemma 9

Let \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\), and let \(\alpha \not \preceq ^{\mathfrak {D}} \beta \) (i.e. \(\alpha \) is a not prefix of \(\beta \)). Then \(D\vdash {\overline{\alpha }} \not \preceq {\overline{\beta }}\).

Proof

We prove the lemma by induction on the length of \(\beta \), and we consider the cases \(\beta \equiv \varepsilon \), \(\beta \equiv \gamma {\varvec{0}}\) and \(\beta \equiv \gamma {\varvec{1}}\).

Assume \(\beta \) is empty. Then \(\alpha \) is not empty. By Lemma 4, we have \(D\vdash {\overline{\alpha }} \ne e\). By axiom \(D_5\), we have \(D\vdash {\overline{\alpha }} \not \preceq e\). Thus, \(D\vdash {\overline{\alpha }} \not \preceq {\overline{\beta }}\). Assume \(\beta \equiv \gamma {\varvec{0}}\). Then we have \(\alpha \ne \gamma {\varvec{0}}\) and \(\alpha \not \preceq ^{\mathfrak {D}} \gamma \). By our induction hypothesis, we have \(D\vdash {\overline{\alpha }} \not \preceq {\overline{\gamma }}\). By Lemma 4, we have \(D\vdash {\overline{\alpha }} \ne \overline{\gamma {\varvec{0}}}\). By axiom \(D_6\), we have \(D\vdash {\overline{\alpha }} \not \preceq \overline{\gamma {\varvec{0}}}\). The case where \(\beta \) is of the form \(\gamma {\varvec{1}}\) is similar. Apply axiom \(D_7\) in place of \(D_6\). \(\square \)

Lemma 10

Let \(\phi (x)\) be an \(\mathcal {L}_{BT}\)-formula such that

$$\begin{aligned} {\mathfrak {D}} \models \phi ({\overline{\alpha }}) \; \Rightarrow \; D \vdash \phi ({\overline{\alpha }}) \end{aligned}$$
(*)

for any \(\alpha \in \{ {\varvec{0}}, {\varvec{1}}\}^*\). Then we have

$$\begin{aligned} {\mathfrak {D}} \models (\forall x \preceq {\overline{\alpha }})\phi (x) \; \Rightarrow \; D \vdash (\forall x \preceq {\overline{\alpha }})\phi (x) \end{aligned}$$

for any \(\alpha \in \{ {\varvec{0}}, {\varvec{1}}\}^*\).

Proof

We prove the lemma by induction on the length of \(\alpha \), and we consider the cases \(\alpha \equiv \varepsilon \), \(\alpha \equiv \beta {\varvec{0}}\) and \(\alpha \equiv \beta {\varvec{1}}\).

Let \(\alpha \equiv \varepsilon \). Assume \({\mathfrak {D}} \models (\forall x \preceq e)\phi (x)\). Then we have \({\mathfrak {D}} \models \phi (e)\). By (*), we have \(D\vdash \phi (e)\). By \(D_5\), we have \(D\vdash (\forall x \preceq e)\phi (x)\).

Let \(\alpha \equiv \beta {\varvec{0}}\). Assume \({\mathfrak {D}} \models (\forall x \preceq \overline{\beta {\varvec{0}}})\phi (x)\). Then we have \({\mathfrak {D}} \models (\forall x \preceq {\overline{\beta }})\phi (x)\) and \({\mathfrak {D}} \models \phi (\overline{\beta {\varvec{0}}})\). By our induction hypothesis we have \(D\vdash (\forall x \preceq {\overline{\beta }})\phi (x)\). By (*), we have \(D\vdash \phi (\overline{\beta {\varvec{0}}})\). By axiom \(D_6\) we have \(D \vdash (\forall x \preceq \overline{\beta {\varvec{0}}})\phi (x)\).

The case \(\alpha \equiv \beta {\varvec{1}}\) is similar to the preceding case. Use \(D_7\) in place of \(D_6\). \(\square \)

Theorem 5

(\({\varSigma }\)-completeness of D) For any \({\varSigma }\)-sentence \(\phi \), we have

$$\begin{aligned} {\mathfrak {D}} \models \phi \; \Rightarrow \; D\vdash \phi . \end{aligned}$$

Proof

Given the lemmas above, we can more or less just repeat the proof of Theorem 4. Use Lemma 8 in place of Lemma 5, Lemma 9 in place of Lemma 6 and Lemma 10 in place of Lemma 7. \(\square \)

2.4 The structure \({\mathfrak {F}}\)

Definition 4

The first-order theory F contains the following eleven non-logical axioms:

  1. -

    the first four axioms are the axioms of \(B^{-}\)

  2. 5.

    \(\forall x[ e \trianglelefteq x ]\)

  3. 6.

    \(\forall x[ x \trianglelefteq e \rightarrow x=e ]\)

  4. 7.

    \(\forall x y [ x0 \trianglelefteq y0 \leftrightarrow x\trianglelefteq y ]\)

  5. 8.

    \(\forall x y [ x0 \trianglelefteq y1 \leftrightarrow x\trianglelefteq y ]\)

  6. 9.

    \(\forall x y [ x1 \trianglelefteq y0 \leftrightarrow x\trianglelefteq y ]\)

  7. 10.

    \(\forall x y [ x1 \trianglelefteq y1 \leftrightarrow x\trianglelefteq y ]\)

  8. 11.

    \(\forall x [ x= e \; \vee \; \exists y [ x=y0 \, \vee \, x=y1 ] \ ]\)

We will use \(F_i\) to refer to the \(i{{\mathrm{th}}}\) axiom of F. \(\square \)

Lemma 11

Let \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) and \(\alpha \trianglelefteq ^{\mathfrak {F}} \beta \) (i.e. \(|\alpha | \le |\beta |\)). Then \(F\vdash {\overline{\alpha }} \trianglelefteq {\overline{\beta }}\).

Proof

We prove this lemma by induction on the length of \(\alpha \), and we consider the cases \(\alpha \equiv \varepsilon \), \(\alpha \equiv \alpha ' {\varvec{0}}\) and \(\alpha \equiv \alpha ' {\varvec{1}}\).

If \(\alpha \equiv \varepsilon \), we have \(F\vdash {\overline{\alpha }}\trianglelefteq {\overline{\beta }}\) by \(F_5\). Let \(\alpha \equiv \alpha ' {\varvec{0}}\). Since \(|\alpha |\le |\beta |\), we have \(b\in \{ {\varvec{0}}, {\varvec{1}}\}\) and \(\beta '\in \{ {\varvec{0}}, {\varvec{1}}\}^*\) such that \(\beta = \beta 'b\). The induction hypothesis yields \(F\vdash \overline{\alpha ' }\trianglelefteq \overline{\beta '}\). If \(b= {\varvec{0}}\), we have \(F\vdash {\overline{\alpha }}\trianglelefteq {\overline{\beta }}\) by \(F_7\). If \(b= {\varvec{1}}\), we have \(F\vdash {\overline{\alpha }}\trianglelefteq {\overline{\beta }}\) by \(F_8\). This proves the case \(\alpha \equiv \alpha ' {\varvec{0}}\). The proof when \(\alpha \equiv \alpha ' {\varvec{1}}\) is similar. Use \(F_9\) and \(F_{10}\), respectively, in place of \(F_7\) and \(F_{8}\). \(\square \)

Lemma 12

Let \(\alpha ,\beta \in \{ {\varvec{0}}, {\varvec{1}}\}^*\) and \(\alpha \not \trianglelefteq ^{\mathfrak {F}} \beta \) (i.e. \(|\alpha | > |\beta |\)). Then \(F\vdash {\overline{\alpha }} \not \trianglelefteq {\overline{\beta }}\).

Proof

We prove this lemma by induction on the length of \(\beta \), and we consider the cases \(\beta \equiv \varepsilon \), \(\beta \equiv \beta '{\varvec{0}}\) and \(\beta \equiv \beta '{\varvec{1}}\).

Assume \(\beta \equiv \varepsilon \). Since \(|\alpha |\not \le |\beta |\), we have \(\alpha '\in \{ {\varvec{0}}, {\varvec{1}}\}^*\) such that \(\alpha = \alpha '{\varvec{0}}\) or \(\alpha = \alpha '{\varvec{1}}\). We can w.l.o.g. say that \(\alpha = \alpha '{\varvec{0}}\). By Lemma 3, we have \(F\vdash {\overline{\alpha }}\ne e\). By \(F_6\), we have \(F\vdash {\overline{\alpha }}\not \trianglelefteq {\overline{\beta }}\). Assume \(\beta \equiv \beta '{\varvec{0}}\). Since \(|\alpha |\not \le |\beta |\), we have \(b\in \{ {\varvec{0}}, {\varvec{1}}\}\) and \(\alpha '\in \{ {\varvec{0}}, {\varvec{1}}\}^*\) such that \(\alpha \equiv \alpha 'b\). By our induction hypothesis, we have \(F\vdash \overline{\alpha '}\not \trianglelefteq \overline{\beta '}\). If \(b= {\varvec{0}}\), we have \(F\vdash {\overline{\alpha }}\not \trianglelefteq {\overline{\beta }}\) by \(F_7\). If \(b= {\varvec{1}}\), we have \(F\vdash {\overline{\alpha }}\not \trianglelefteq {\overline{\beta }}\) by \(F_9\). The case \(\beta \equiv \beta '{\varvec{1}}\) is symmetric to the case \(\beta \equiv \beta '{\varvec{0}}\). Use \(F_8\) in place of \(F_7\), and use \(F_{10}\) in place of \(F_9\). \(\square \)

It is convenient to introduce some new notation before we state our next lemma: For any \(\alpha \in \{{\varvec{0}}, {\varvec{1}}\}^*\), let

$$\begin{aligned}{}[ \varepsilon \ldots \alpha ] = \{ \ \beta \mid \beta \in \{{\varvec{0}}, {\varvec{1}}\}^*\, \hbox {and} \, \beta \trianglelefteq ^{{\mathfrak {F}}} \alpha \} . \end{aligned}$$

Lemma 13

We have

$$\begin{aligned} F\vdash \forall x \left[ x\trianglelefteq {\overline{\alpha }} \; \rightarrow \bigvee _{\beta \in [ \varepsilon \ldots \alpha ]} x= {\overline{\beta }} \ \right] \end{aligned}$$

for any \(\alpha \in \{{\varvec{0}}, {\varvec{1}}\}^*\).

Proof

We prove this lemma by induction on the length of \(\alpha \). The base case is \(\alpha \equiv \varepsilon \). The inductive cases are \(\alpha \equiv \gamma {\varvec{0}}\) and \(\alpha \equiv \gamma {\varvec{1}}\).

First we deal with case \(\alpha \equiv \varepsilon \). The axiom \(F_6\) says that

$$\begin{aligned} \forall x[ x \trianglelefteq e \rightarrow x=e ] . \end{aligned}$$

Thus, we have

$$\begin{aligned} F\vdash \forall x \left[ x\trianglelefteq {\overline{\alpha }} \; \rightarrow \bigvee _{\beta \in [ \varepsilon \ldots \alpha ]} x= {\overline{\beta }} \ \right] \end{aligned}$$

straightaway as \({\overline{\alpha }}\) is e, the set \( [ \varepsilon \ldots \alpha ]\) is the singleton set \(\{\varepsilon \}\) and \({\overline{\varepsilon }}\) is e.

We will now turn to the inductive case \(\alpha \equiv \gamma {\varvec{0}}\). In this case it is sufficient to prove

$$\begin{aligned} \begin{array}{ccl} (1) &{} \;\;\; &{} F\vdash \forall x \left[ x=e \; \rightarrow \; \left( \ x \trianglelefteq \overline{\gamma {\varvec{0}}} \; \rightarrow \; {\displaystyle \bigvee _{\beta \in [ \varepsilon \ldots \gamma {\varvec{0}} ] } x= {\overline{\beta }} } \ \right) \ \right] \\ (2) &{} \;\;\; &{} F\vdash \forall x y \left[ x=y0 \; \rightarrow \; \left( \ x \trianglelefteq \overline{\gamma {\varvec{0}}} \; \rightarrow \; {\displaystyle \bigvee _{\beta \in [ \varepsilon \ldots \gamma {\varvec{0}} ] } x= {\overline{\beta }} } \ \right) \ \right] \\ (3) &{} \;\;\; &{} F\vdash \forall x y\left[ x=y1 \; \rightarrow \; \left( \ x \trianglelefteq \overline{\gamma {\varvec{0}}} \; \rightarrow \; {\displaystyle \bigvee _{\beta \in [ \varepsilon \ldots \gamma {\varvec{0}} ] } x= {\overline{\beta }} } \ \right) \ \right] . \end{array} \end{aligned}$$

as it follows from (1), (2), (3) and the axiom \(F_{11}\) that

$$\begin{aligned} F\vdash \forall x \left[ x \trianglelefteq \overline{\gamma {\varvec{0}}} \; \rightarrow \; \bigvee _{\beta \in [ \varepsilon \ldots \gamma {\varvec{0}} ] } x= {\overline{\beta }} \ \right] . \end{aligned}$$

Our induction hypothesis yields

$$\begin{aligned} F\vdash \forall x \left[ x\trianglelefteq {\overline{\gamma }} \; \rightarrow \bigvee _{\beta \in [ \varepsilon \ldots \gamma ]} x= {\overline{\beta }} \ \right] . \end{aligned}$$
(IH)

It is trivial that (1) holds. This is a logical truth which holds in any model. We do not need any of our non-logical axioms to prove (1). Let us turn to the proof of (2). We reason in an arbitrary model for F. Assume \(x=y0\) and \(x\trianglelefteq \overline{\gamma {\varvec{0}}}\). We need to argue that

figure c

holds in the model. It is obvious that we have \(y0 \trianglelefteq \overline{\gamma {\varvec{0}}}\). By \(F_7\), we have \(y \trianglelefteq {\overline{\gamma }}\). By (IH), we have

$$\begin{aligned} \bigvee _{\beta \in [ \varepsilon \ldots \gamma ]} y= {\overline{\beta }} . \end{aligned}$$

Thus, we also have

$$\begin{aligned} \bigvee _{\beta \in [ \varepsilon \ldots \gamma ]} y0 = {\overline{\beta }}0 \end{aligned}$$

as \(y= {\overline{\beta }} \rightarrow y0 = {\overline{\beta }}0\). Furthermore, since \(x=y0\) and \( \overline{\beta {\varvec{0}}} \equiv {\overline{\beta }}0\), we have

figure d

Finally, we observe that (\(\ddagger \)) implies (\(\dagger \)). This proves (2).

The proof of (3) is symmetric to the proof of (2). Use the axiom \(F_9\) in place of \(F_7\). This completes the proof for the case \(\alpha \equiv \gamma {\varvec{0}}\). The case \(\alpha \equiv \gamma {\varvec{1}}\) is symmetric. Use the axioms \(F_8\) and \(F_{10}\), respectively, in place of \(F_7\) and \(F_{9}\). \(\square \)

Lemma 14

Let \(\phi (x)\) be an \(\mathcal {L}_{BT}\)-formula such that

$$\begin{aligned} {\mathfrak {F}} \models \phi ({\overline{\alpha }}) \; \Rightarrow \; F \vdash \phi ({\overline{\alpha }}) \end{aligned}$$
(*)

for any \(\alpha \in \{{\varvec{0}}, {\varvec{1}}\}^*\). Then we have

$$\begin{aligned} {\mathfrak {F}} \models (\forall x \trianglelefteq {\overline{\alpha }})\phi (x) \; \Rightarrow \; F \vdash (\forall x \trianglelefteq {\overline{\alpha }})\phi (x) \end{aligned}$$

for any \(\alpha \in \{{\varvec{0}}, {\varvec{1}}\}^*\).

Proof

Assume \({\mathfrak {F}} \models (\forall x \trianglelefteq {\overline{\alpha }})\phi (x)\). Then, we have

$$\begin{aligned} {\mathfrak {F}} \models \bigwedge _{\beta \in [ \varepsilon \ldots \alpha ]} \phi ({\overline{\beta }}) . \end{aligned}$$

By (*), we have

$$\begin{aligned} F \vdash \bigwedge _{\beta \in [ \varepsilon \ldots \alpha ]} \phi ({\overline{\beta }}) . \end{aligned}$$

By Lemma 13, we have \(F \vdash (\forall x \trianglelefteq {\overline{\alpha }})\phi (x)\). \(\square \)

Theorem 6

(\({\varSigma }\)-completeness of F) For any \({\varSigma }\)-sentence \(\phi \), we have

$$\begin{aligned} {\mathfrak {F}} \models \phi \; \Rightarrow \; F\vdash \phi . \end{aligned}$$

Proof

Given the lemmas above, we can more or less just repeat the proof of Theorem 4. Use Lemma 11 in place of Lemma 5, Lemma 12 in place of Lemma 6 and Lemma 14 in place of Lemma 7. \(\square \)

Both B and D are open theories (all the axioms are purely universal statements) whereas F is not. The axiom \(F_{11}\) contains an existential quantifier. Can we find a purely universal set of axioms that is \({\varSigma }\)-complete with respect to the model \({\mathfrak {F}}\)? Yes, we can. We can regard Lemma  13 as an axiom scheme. Then we do not need \(F_{11}\) to achieve \({\varSigma }\)-completeness.

Definition 5

Let \(F'\) be the first-order theory F where the axiom \(F_{11}\) is replaced by the scheme

figure e

\(\square \)

Theorem 7

(\({\varSigma }\)-completeness of \(F'\)) For any \({\varSigma }\)-sentence \(\phi \), we have

$$\begin{aligned} {\mathfrak {F}} \models \phi \Rightarrow F' \vdash \phi . \end{aligned}$$

Proof

Proceed as in the proof of Theorem 6. Since the axiom scheme is present, \(F_{11}\) will not be needed anymore. \(\square \)

Now, \(F'\) is an open theory, but in contrast to B and D, it is not finite.

Conjecture 1

There is no finite open theory that is \({\varSigma }\)-complete with respect to the structure \({\mathfrak {F}}\).

3 Normal form theorems

After we have endowed bit theory with bounded quantifiers, it becomes natural to search for normal forms and see if we can prove normal form theorems similar to the ones we know from number theory.

Some lemmas (151718) in this section can be found elsewhere, e.g., in Büchi and Senger [1], Senger [21] and Karhumäki et al. [12]. We have given complete proofs below in order to make our paper self-contained (the proofs we give do not differ essentially from those given in Büchi and Senger [1]).

The next lemma shows that conjunctions of equations can be replaced by a single equation.

Lemma 15

Let \(s_{1}, s_{2}, t_{1}, t_{2}\) be \(\mathcal {L}_{BT}\)-terms. We have

$$\begin{aligned} {\mathfrak {B}}^{-} \models (s_{1} = t_{1} \wedge s_{2} = t_{2}) \leftrightarrow s_{1} 0 s_{2} s_{1} 1 s_{2} = t_{1} 0 t_{2} t_{1} 1 t_{2}. \end{aligned}$$

Proof

Let \(\alpha _1,\alpha _2,\beta _1,\beta _2\in \{{\varvec{0}}, {\varvec{1}}\}^*\). Assume \(\alpha _1 {\varvec{0}} \alpha _2 \alpha _1 {\varvec{1}} \alpha _2 = \beta _{1} {\varvec{0}} \beta _{2} \beta _{1} {\varvec{1}} \beta _{2}\). Then \(|\alpha _1 {\varvec{0}} \alpha _2| = |\beta _{1} {\varvec{0}} \beta _{2}|\) and \(|\alpha _1 {\varvec{1}} \alpha _2| = |\beta _{1} {\varvec{1}} \beta _2|\). The proof splits into the two cases \(|\alpha _1|=|\beta _1|\) and \(|\alpha _1|\ne |\beta _1|\). In the case when \(|\alpha _1|=|\beta _1|\), we obviously have \(\alpha _1=\beta _1\) and \(\alpha _2=\beta _2\). Assume \(|\alpha _1|\ne |\beta _1|\). We can w.l.o.g. assume that \(|\alpha _1|< |\beta _1|\). This implies that

$$\begin{aligned} {\varvec{0}} = (\alpha _1 {\varvec{0}} \alpha _2)_{|\alpha _1| + 1} = (\beta _1)_{|\alpha _1| + 1} = (\beta _1 {\varvec{1}} \beta _2)_{|\alpha _1| + 1} = (\alpha _1 {\varvec{1}} \alpha _2)_{|\alpha _1| + 1} = {\varvec{1}}. \end{aligned}$$

This is a contradiction. This proves the implication from the right to the left. The converse implication is obvious. \(\square \)

The next two lemmas show that disjunctions of equations can be replaced by a single equation at the price of some more existential quantifiers.

Lemma 16

Let \(s_{1},s_{2},t_{1},t_{2}\) be \(\mathcal {L}_{BT }\)-terms. There exist \(\mathcal {L}_{BT }\)-terms st and variables \(v_1,\ldots , v_k\) such that

$$\begin{aligned} {\mathfrak {D}} \models (s_{1}\preceq t_{1} \vee s_{2} \preceq t_{2}) \leftrightarrow \exists v_{1} \ldots v_{k}[ s = t ]. \end{aligned}$$

Proof

Let \(x_1,\ldots , x_6\) be variables that do not occur in any of the terms \(s_1,s_2,t_1,t_2\). It is not very hard to see that the formula \(s_{1} \preceq t_{1} \vee s_{2} \preceq t_{2}\) is \({\mathfrak {D}}\)-equivalent to the formula

$$\begin{aligned} \exists x_{1} \ldots x_{6}&[ s_{1} = x_{1} x_{2} \; \wedge \; t_{1} = x_{1} x_{3} \; \wedge \; \\&\, s_{2} = x_{4} x_{5} \; \wedge \; t_{2} = x_{4} x_{6} \; \wedge \; ( x_{2} = e \; \vee \; x_{5} = e ) ] . \end{aligned}$$
(*)

We will show that the disjunction in (*), that is \(x_{2} = e \vee x_{5} = e\), can be replaced by a formula

$$\begin{aligned} x_2x_5 = x_5x_2 \; \wedge \; \exists y_1\ldots y_4[ v_1 = v^\prime _1 \; \wedge \; v_2 = v^\prime _2 \; \wedge \; v_3 = v^\prime _3 ] \end{aligned}$$

where \(v_1, v_2, v_3, v^\prime _1 , v^\prime _2 , v^\prime _3\) are terms. Thus, by Lemma 15 which allow us to merge conjunctions of equations, (*) will be equivalent to a formula of the form

$$\begin{aligned} \exists x_{1} \ldots x_{6}y_1\ldots y_4[ s=t ] \end{aligned}$$

and our proof will be complete.

Let \(\psi (u,w)\) be the formula

$$\begin{aligned}&\exists y_1 y_2 y_3 y_4 \\&\quad [\ y_1y_2 = 0 \; \wedge \; y_3y_4 = 1 \; \wedge \; u y_1 w y_2 = w y_2 u y_1 \; \wedge \; u y_3 w y_4 = w y_4 u y_3 ] . \end{aligned}$$

We claim that

$$\begin{aligned} {\mathfrak {B}}^{-} \models ( u = e \; \vee \; w = e ) \; \leftrightarrow \; ( uw = wu \; \wedge \; \psi (u,w) ). \end{aligned}$$
(**)

We prove (**). Assume that \(u = e \vee w = e\) (we reason in \({\mathfrak {B}}^{-}\)). Let us say that \(u = e\) (the case when \(w = e\) is symmetric). It is obvious that we have \(uw = wu\). Moreover, \(\psi (u,w)\) holds with \(y_1=y_3=e\), \(y_2=0\) and \(y_4=1\). This prove the left-right implication of (**).

To see that the converse implication holds, assume that \(\lnot (u = e \vee w = e)\), that is, both u and w are different from the empty string. Furthermore, assume that \(uw = wu\). We will argue that \(\psi (u,w)\) does not hold: Since \(uw = wu\) and both u and w contain at least one bit, it is either the case that 0 is the last bit of both strings, or it is that case that 1 is the last bit of both strings. If 0 is the last bit of both, the two equations \(u y_3 w y_4 = w y_4 u y_3\) and \(y_3y_4 = 1\) cannot be satisfied simultaneously. If 1 is the last bit of both, the two equations \(u y_1 w y_2 = w y_2 u y_1\) and \(y_1y_2 = 0\) cannot be satisfied simultaneously. Hence we conclude that \(\psi (u,w)\) does not hold. This completes the proof of (**).

As explained above, our lemma follows from (*) and (**) by Lemma 15. \(\square \)

Karhumäki et al. [12] prove that the next lemma indeed holds with \(k=2\).

Lemma 17

Let \(s_{1}, s_{2}, t_{1}, t_{2}\) be \(\mathcal {L}_{BT}\)-terms. There exist \(\mathcal {L}_{BT}\)-terms st and variables \(v_{1},\ldots ,v_{k}\) such that

$$\begin{aligned} {\mathfrak {B}}^{-} \models (s_{1} = t_{1} \vee s_{2} = t_{2}) \leftrightarrow \exists v_{1}\ldots v_{k}[ s=t ] . \end{aligned}$$

Proof

Observe that \(s_{1} = t_{1} \vee s_{2} = t_{2}\) is \({\mathfrak {D}}\)-equivalent to

$$\begin{aligned} (s_{1} \preceq t_{1} \wedge t_{1} \preceq s_{1} ) \vee (s_{2} \preceq t_{2} \wedge t_{2} \preceq s_{2} ) \end{aligned}$$

which again is (logically) equivalent to

$$\begin{aligned}&(s_{1} \preceq t_{1} \; \vee \; s_{2} \preceq t_{2} ) \; \wedge \; (s_{1} \preceq t_{1} \; \vee \; t_{2} \preceq s_{2} ) \\&\quad \wedge \; \, ( t_{1} \preceq s_{1} \; \vee \; s_{2} \preceq t_{2} ) \; \wedge \; ( t_{1} \preceq s_{1} \; \vee \; t_{2} \preceq s_{2} ). \end{aligned}$$

By Lemmas 15 and 16, we have terms st and variables \( v_{1}\ldots v_{k}\) such that

$$\begin{aligned} {\mathfrak {D}} \models (s_{1} = t_{1} \vee s_{2} = t_{2}) \leftrightarrow \exists v_{1}\ldots v_{k}[ s=t ] . \end{aligned}$$

Thus, the lemma holds as we are dealing with a \(\mathcal {L}_{BT}^{-}\)-formula. \(\square \)

Next we show that negated atomic formulas can be replaced by an equations if we add existential quantifiers.

Lemma 18

Let \(s_{1}, t_{1}\) be \(\mathcal {L}_{BT}\)-terms. There exist \(\mathcal {L}_{BT}\)-terms st and variables \(v_{1},\ldots ,v_{k}\) such that

$$\begin{aligned} {\mathfrak {B}}^{-} \models s_{1} \ne t_{1} \leftrightarrow \exists v_{1} \ldots v_{k} [ s=t ] . \end{aligned}$$

Proof

Observe that the formula \(s\ne t\) is \({\mathfrak {B}}^{-}\)-equivalent to the formula

$$\begin{aligned}&\exists x y z [ s= t 0 x \; \vee \; s= t 1 x \; \vee \; t= s 0 x \vee t= s 1 x \\&\qquad \vee \; ( s= x 1 y \; \wedge \; t= x 0 z ) \; \vee \; ( s= x 0 y \; \wedge \; t= x 1 z ) ]. \end{aligned}$$

Thus, the lemma follows from Lemmas 17 and 15. \(\square \)

Lemma 19

Let \(s_1, t_1\) be \(\mathcal {L}_{BT}\)-terms. There exist \(\mathcal {L}_{BT}\)-terms st and variables \(v_{1},\ldots , v_{k}\) such that

$$\begin{aligned} {\mathfrak {D}} \models s_{1} \not \preceq t_{1} \leftrightarrow \exists v_{1} \ldots v_{k} [ s=t ] . \end{aligned}$$

Proof

The formula \( s_{1} \not \preceq t_{1}\) is \({\mathfrak {D}}\)-equivalent to the formula

$$\begin{aligned}&( \exists u [ t_1u = s_1 ] \; \wedge \; t_1 \ne s_1 ) \\&\quad \vee \; \exists x y z [ (t_1 = x 0 y \; \wedge \; s_1 =x 1 z ) \; \vee \; (t_1 = x 1 y \; \wedge \; s_1 =x 0 z ) ] . \end{aligned}$$

Thus, the lemma follows from the preceding lemmas. \(\square \)

We are now ready to prove our normal form theorems.

Theorem 8

(Normal form theorem for \({\mathfrak {D}}\)) Any \({\varSigma }\)-formula \(\phi \) is \({\mathfrak {D}}\)-equivalent to an \(\mathcal {L}_{BT}\)-formula of the form

$$\begin{aligned} \left( {\mathbf {Q}}_{1}^{t_{1}} v_{1} \right) \ldots \left( {\mathbf {Q}}_{m}^{t_{m}} v_{m} \right) [ s=t ] \end{aligned}$$

where \(t_{1},\ldots ,t_{m}\) are \(\mathcal {L}_{BT}\)-terms and \({\mathbf {Q}}_{j}^{t_{j}} v_{j} \in \lbrace \exists v_{j}, \exists v_{j} \preceq t_{j} , \forall v_{j} \preceq t_{j} \rbrace \) for \(j=1,\ldots , m\). Moreover, if \(\phi \) is a purely existential formula, then \({\mathbf {Q}}_{j}^{t_{j}} v_{j}\) is \(\exists v_j\).

Proof

We proceed by induction on the structure of the \({\varSigma }\)-formula \(\phi \) (throughout the proof we reason in the structure \({\mathfrak {D}}\)). Assume \(\phi \equiv s\preceq t\). Then \(\phi \) is equivalent to a formula of the form \(\exists x[ sx=t]\) and the theorem holds. Assume \(\phi \equiv s\not \preceq t\). Then the theorem holds by Lemma 19. Assume \(\phi \equiv s\ne t\). Then the theorem holds by Lemma 18. The theorem holds trivially when \(\phi \) is of the form \(s=t\).

Suppose \(\phi \) is of the form \((\psi \wedge \xi )\). By our induction hypothesis, we have formulas

$$\begin{aligned} \left( {\mathbf {Q}}_{1}^{t_{1}} x_{1}\right) \ldots \left( {\mathbf {Q}}_{k}^{t_{k}} x_{k}\right) [ s_{1}=t_{1} ] \;\; \text{ and } \;\; \left( {\mathbf {Q}}_{1}^{s_{1}} y_{1}\right) \ldots \left( {\mathbf {Q}}_{m}^{s_{m}} y_{m}\right) [ s_{2}=t_{2} ] \end{aligned}$$

which are equivalent to respectively \(\psi \) and \(\xi \). Thus, \(\phi \) is equivalent to a formula of the form

$$\begin{aligned} \left( {\mathbf {Q}}_{1}^{t_{1}} x_{1}\right) \ldots \left( {\mathbf {Q}}_{k}^{t_{k}} x_{k}\right) \left( {\mathbf {Q}}_{1}^{s_{1}} y_{1}\right) \ldots \left( {\mathbf {Q}}_{m}^{s_{m}} y_{m}\right) [ s_{1}=t_{1} \, \wedge \, s_{2}=t_{2} ] . \end{aligned}$$

By Lemma 15, we have a formula of the desired form which is equivalent to \(\phi \). The case when \(\phi \) is of the form \((\psi \vee \xi )\) is similar. Use Lemma 17 in place of Lemma 15.

The theorem follows trivially from the induction hypothesis when \(\phi \) is of one of the forms \((\exists v) \psi \), \((\forall v \preceq t) \psi \) and \((\exists v \preceq t) \psi \).

If \(\phi \) is a purely existential formula, there will be no bounded universal quantifiers among \(({\mathbf {Q}}_{1}^{t_{1}} v_{1} )\ldots ({\mathbf {Q}}_{m}^{t_{m}} v_{m} )\). Thus, \(\phi \) is equivalent to a formula of the form

$$\begin{aligned} \exists v_1 \ldots v_k[ \ s_1\preceq t_1 \, \wedge \, \ldots \, \wedge \, s_\ell \preceq t_\ell \wedge s=t ] \end{aligned}$$

which again is equivalent to a formula of the form

$$\begin{aligned} \exists v_1 \ldots v_kx_1\ldots x_\ell [ s_1 x_1 = t_1 \, \wedge \, \ldots \, \wedge \, s_\ell x_\ell = t_\ell \, \wedge \, s=t ]. \end{aligned}$$

By Lemma 15, we can conclude that any purely existential formula is equivalent to a formula of the form \(\exists v_1\ldots v_{m} [ s=t ]\). \(\square \)

Theorem 9

(Normal form theorem for \({\mathfrak {F}}\)) Any \({\varSigma }\)-formula \(\phi \) is \({\mathfrak {F}}\)-equivalent to a \(\mathcal {L}_{BT}\)-formula of the form

$$\begin{aligned} \exists v_0({\mathbf {Q}}_{1} v_1 \trianglelefteq t_1 )\ldots ({\mathbf {Q}}_{m} v_{m} \trianglelefteq t_m) [ s=t ] \end{aligned}$$

where \({\mathbf {Q}}_{j} \in \lbrace \exists , \forall \rbrace \) for \(j= 1, \ldots ,m\). Moreover, if \(\phi \) is a purely existential formula, then \(\phi \) is equivalent to a formula of the form

$$\begin{aligned} \exists v_0\ldots v_{m} [ v_1\trianglelefteq t_1 \; \wedge \; \ldots \; \wedge \; v_m \trianglelefteq t_m \; \wedge \; s=t ]. \end{aligned}$$

Proof

We prove the theorem by induction on the structure of the \({\varSigma }\)-formula \(\phi \) (throughout the proof we reason in the structure \({\mathfrak {F}}\)). Assume \(\phi \equiv s\trianglelefteq t\). Then \(\phi \) is equivalent to a formula of the form \((\exists x\trianglelefteq t) [x=s]\), and the theorem holds. Assume \(\phi \equiv s\not \trianglelefteq t\). Then \(\phi \) is equivalent to \(t\circ 0 \trianglelefteq s\), and thus also equivalent to a formula of the form \((\exists x\trianglelefteq s) [x=t\circ 0]\). Hence the theorem holds. Furthermore, the theorem holds by Lemma 18 when \(\phi \equiv s\ne t\), and the theorem holds trivially when \(\phi \equiv s=t\).

The two inductive cases \(\phi \equiv (\psi \wedge \xi )\) and \(\phi \equiv (\psi \vee \xi )\) are similar to the corresponding cases in the proof of Theorem 8 (normal form theorem for \({\mathfrak {D}}\)).

The cases \(\phi \equiv (\exists x)\psi \), \( \phi \equiv (\exists x\trianglelefteq t)\psi \) and \(\phi \equiv (\forall x\trianglelefteq t)\psi \) are easy to deal with. A formula of the form

  • \((\forall x \trianglelefteq t)(\exists y)\psi \) is equivalent to a formula of the form \((\exists z)(\forall x \trianglelefteq t)(\exists y \trianglelefteq z)\psi \)

  • \((\exists x \trianglelefteq t)(\exists y)\psi \) is equivalent to a formula of the form \((\exists y) (\exists x \trianglelefteq t)\psi \)

  • \((\exists x)(\exists y)\psi \) is equivalent to a formula of the form \((\exists z)(\exists x \trianglelefteq z)(\exists y \trianglelefteq z)\psi \).

Thus, any \({\varSigma }\)-formula is \({\mathfrak {F}}\)-equivalent to a \({\varSigma }\)-formula that contains maximum one unbounded existential quantifier.

If \(\phi \) is a purely existential formula, then \({\mathbf {Q}}_{1},\ldots , {\mathbf {Q}}_{m}\) will all be existential quantifiers. Thus, any purely existential formula is equivalent to a formula of the form

$$\begin{aligned} \exists v_0\ldots v_{m} [ v_1\trianglelefteq t_1 \; \wedge \ldots \wedge \; v_m \trianglelefteq t_m \; \wedge \; s=t ]. \end{aligned}$$

\(\square \)

It is not true that any purely existential formula is \({\mathfrak {F}}\)-equivalent to a formula of the form \(\exists x_1\ldots x_n [s=t]\). This follows from the results in Karhumäki et al. [12]. E.g., a formula like \(x\trianglelefteq y \wedge y\trianglelefteq x\) which states that the length of x equals the length of y, is not \({\mathfrak {F}}\)-equivalent to a formula of the form \(\exists x_1\ldots x_n [s=t]\). See Example 27 in Section 6 of [12].

Lemma 20

Let \(s_1,t_1\) be \(\mathcal {L}_{BT}\)-terms. There exist \(\mathcal {L}_{BT}\)-terms st and variables \(v_{1},\ldots , v_k\) such that

$$\begin{aligned} {\mathfrak {B}} \models s_1 \not \sqsubseteq t_1 \leftrightarrow (\forall v_{1} \sqsubseteq t_1) \exists v_{2}\ldots v_{k} [ s = t ] . \end{aligned}$$

Proof

Observe that \(s_1 \not \sqsubseteq t_1\) is \({\mathfrak {B}}\)-equivalent to \((\forall v \sqsubseteq t_1)\alpha \) where \(\alpha \) is

$$\begin{aligned}&\exists x [ t_1x = v s_1 \, \wedge \, x\ne e ] \\&\quad \vee \; \exists x y z [(t_1 = x0y \, \wedge \, vs_1 = x1z) \; \vee \; (t_1 = x1y \, \wedge \, vs_1 = x0z) \ ] . \end{aligned}$$

If we let \(vs_1 \preceq t_1\) abbreviate \(\exists x[v s_1 x = t_1]\), then \(\alpha \) can be written as \(vs_1 \not \preceq t_1\). Thus, the lemma follows by Lemma 19. \(\square \)

Theorem 10

(Normal Form Theorem for \({\mathfrak {B}}\)) Any \({\varSigma }\)-formula \(\phi \) is \({\mathfrak {B}}\)-equivalent in to a \(\mathcal {L}_{BT}\)-formula of the form

$$\begin{aligned} (\exists v_0)({\mathbf {Q}}_{1} v_1 \sqsubseteq t_1 )\ldots ({\mathbf {Q}}_{m} v_{m} \sqsubseteq t_m) [ s=t ] \end{aligned}$$

where \({\mathbf {Q}}_{j} \in \lbrace \exists , \forall \rbrace \) for \(j= 1, \ldots , m\).

Proof

Proceed by induction on the structure of the \({\varSigma }\)-formula \(\phi \). This proof is similar to the proof of Theorem 9 (normal form theorem for \({\mathfrak {F}}\)). If \(\phi \) is of form \(s\sqsubseteq t\), then \(\phi \) is \({\mathfrak {B}}\)-equivalent a formula of the form \(\exists x_1x_2[ x_1sx_2=t ]\). If \(\phi \) is of the form \(s\not \sqsubseteq t\), then Lemma 20 says that \(\phi \) is \({\mathfrak {B}}\)-equivalent to a formula of the form \((\forall v_{1} \sqsubseteq t_1) \exists v_{2}\ldots v_{k}[ s = t ]\). The remaining cases of the inductive proof are similar to their respective cases in the proof of Theorem 9. \(\square \)

We have not been able to find an interesting normal form for purely existential formulas in \({\mathfrak {B}}\) which is stronger than the one for \({\varSigma }\)-formulas. It follows form the results in Karhumäki et al. [12] that the relation \(x\not \sqsubseteq ^{\mathfrak {B}} y\) cannot be defined in the structure \({\mathfrak {B}}^-\) by a purely existential formula: By Theorem 16 in [12], it is not possible to define the language

$$\begin{aligned} L = \{ \ \alpha \mid \alpha \in \{{\varvec{0}}, {\varvec{1}}\}^*\, \hbox {and} \, {\varvec{1}}{\varvec{0}}{\varvec{1}} \not \sqsubseteq ^{\mathfrak {B}} \alpha \ \} \end{aligned}$$

by a word equation. If we could define \(x\not \sqsubseteq ^{\mathfrak {B}} y\) in \({\mathfrak {B}}^-\) by a purely existential formula, then it would have been possible to define L by a word equation. We refer the reader to the paper itself for further details as Theorem 16 is a rather involved statement.

Since it is not possible to define \(x\not \sqsubseteq ^{\mathfrak {B}} y\) in \({\mathfrak {B}}^-\) by a purely existential formula, the normal form theorem for purely existential formulas in \({\mathfrak {D}}\) (Theorem 8), will for sure be false with respect to \({\mathfrak {B}}\). So will the normal form theorem for purely existential formulas in \({\mathfrak {F}}\) (Theorem 9).

4 Decidability and undecidability

4.1 Fragments

Let us start to track the border between the decidable and the undecidable. On the one hand, we have Makanin’s result (Theorem 2). We know that it is decidable if a sentence of the form \(\exists x_1\ldots x_n[s=t]\) holds in the standard model. We also know that any purely existential formula is \({\mathfrak {D}}\)-equivalent to formula of this form. On the other hand, it is not very hard to prove a stronger version of Theorem 1:

Theorem 11

(\({\varSigma }\)-definability of computable functions) For any (partially) computable function \(f:{\mathbb {N}}^n \rightarrow {\mathbb {N}}\) there is a \({\varSigma }\)-formula \(\phi (x_1,\ldots , x_n,y)\) such that

$$\begin{aligned} f(a_1, \ldots , a_n)= b \Leftrightarrow {\mathfrak {D}} \models \phi (\overline{{\varvec{1}}^{a_1}},\ldots , \overline{{\varvec{1}}^{a_n}},\overline{{\varvec{1}}^{b}}). \end{aligned}$$

Moreover, given a definition of the function, we can compute the formula.

With some effort, the interested reader should be able to accomplish a proof of this theorem. The theorem implies that it is undecidable if a \({\varSigma }\)-sentence holds in \({\mathfrak {D}}\). It is easy to define the relations \(\preceq ^{{\mathfrak {D}}}\) and \(\not \preceq ^{{\mathfrak {D}}}\) by \({\varSigma }\)-formulas in the structures \({\mathfrak {B}}\) and \({\mathfrak {F}}\), and the bounded quantifiers of \({\mathfrak {D}}\) can be expressed by \({\varSigma }\)-formulas in in \({\mathfrak {B}}\) and \({\mathfrak {F}}\), e.g., if

$$\begin{aligned} {\mathfrak {D}}\models \phi \Leftrightarrow {\mathfrak {B}}\models \phi ' \end{aligned}$$

then

$$\begin{aligned} {\mathfrak {D}}\models (\exists x \preceq t)\phi \;\;\; \Leftrightarrow \;\;\; {\mathfrak {B}}\models (\exists xy \sqsubseteq t)[ xy=t \; \wedge \; \phi ' ] \end{aligned}$$

Thus Theorem 11 also implies that it undecidable if a \({\varSigma }\)-sentence holds in \({\mathfrak {B}}\) or \({\mathfrak {F}}\).

In order to gain further insight into what we can—and cannot—decide in bit theory, we need to keep track of the number and the type of quantifiers that appear in our \({\varSigma }\)-formulas. We will say that a \({\varSigma }\)-formula is a \({\varSigma }_{n,m,k}\)-formula if it contains n unbounded existential quantifiers, m bounded existential quantifiers and k bounded universal quantifiers. The fragment \({\varSigma }_{n,m,k}^\mathfrak {A}\) is the set of \({\varSigma }_{n,m,k}\)-sentences that are true in the \(\mathcal {L}_{BT}\)-structure \({\mathfrak {A}}\). The (purely existential) fragment \(\exists ^{{\mathfrak {A}}}\) is the set of purely existential sentences that are true in the \(\mathcal {L}_{BT}\)-structure \({\mathfrak {A}}\) (recall that a purely existential formula is a \({\varSigma }\)-formula with no occurrences of bounded universal quantifiers). A \({\varDelta }\)-formula is a \({\varSigma }\)-formula that contain no unbounded existential quantifiers, and the fragment \({\varDelta }^{{\mathfrak {A}}}\) is the set of \({\varDelta }\)-sentences that are true in the \(\mathcal {L}_{BT}\)-structure \({\mathfrak {A}}\). Note that

$$\begin{aligned} \exists ^{{\mathfrak {A}}} = \bigcup _{n,m\in {\mathbb {N}}} {\varSigma }_{n,m,0}^\mathfrak {A}\;\; \text{ and } \;\; {\varDelta }^{{\mathfrak {A}}} = \bigcup _{m,k\in {\mathbb {N}}} {\varSigma }_{0,m,k}^\mathfrak {A}. \end{aligned}$$

4.2 Decidable fragments

Theorem 12

The fragments \({\varDelta }^{{\mathfrak {D}}}\), \({\varDelta }^{{\mathfrak {B}}}\) and \({\varDelta }^{{\mathfrak {F}}}\) are decidable.

Proof

We prove that \({\varDelta }^{{\mathfrak {B}}}\) is decidable. Let \(\phi \) be a \({\varDelta }\)-formula. The negation of a \({\varDelta }\)-formula is logically equivalent to a \({\varDelta }\)-formula (use De Morgan’s laws). We can compute a \({\varDelta }\)-formula \(\phi '\) which is logically equivalent to \(\lnot \phi \). By Theorem 4, we have \(B\vdash \phi \) if \({\mathfrak {B}}\models \phi \). By the same theorem, we have \(B\vdash \phi '\) if \({\mathfrak {B}}\models \lnot \phi \). The set of formulas deducible from the axioms of B is computably enumerable. Hence it is decidable if \(\phi \) is true in \({\mathfrak {B}}\).

We can prove that the fragments \({\varDelta }^{{\mathfrak {D}}}\) and \({\varDelta }^{{\mathfrak {F}}}\) are decidable in the same way as we also have \({\varSigma }\)-complete axiomatizations for both \({\mathfrak {D}}\) and \({\mathfrak {F}}\). \(\square \)

In some sense, we kill a fly with a hammer when we use \({\varSigma }\)-completeness to prove the preceding theorem. It can of course be checked by brute-force algorithms if \({\varDelta }\)-sentences are true in the structures \({\mathfrak {D}}\), \({\mathfrak {B}}\) and \({\mathfrak {F}}\).

Theorem 13

The fragment \(\exists ^{{\mathfrak {D}}}\) is decidable.

Proof

Theorem 8 states that any purely existential formula \(\phi \) is \({\mathfrak {D}}\)-equivalent to a formula of the normal form \(\exists v_1\ldots v_{m} [s=t]\). Our proofs show that there is an algorithm for transforming \(\phi \) into this normal form. Thus the theorem follows by Makanin’s result (Theorem 2). \(\square \)

Problem 1

Is the fragment \(\exists ^{{\mathfrak {B}}}\) decidable?

Problem 2

Is the fragment \(\exists ^{{\mathfrak {F}}}\) decidable?

The authors have tried, without success, to solve these problems. We have no conjectures to offer.

4.3 The Modulo Problem

In [13] we use the Post’s Correspondence Problem (Post [18]) to prove that the fragments \({\varSigma }_{3,0,2}^\mathfrak {D}\), \({\varSigma }_{4,1,1}^\mathfrak {D}\), \({\varSigma }_{1,2,1}^\mathfrak {B}\) and \({\varSigma }_{1,0,2}^\mathfrak {B}\) are undecidable. We will improve these results considerably in the next section. In this section we introduce an undecidable problem that is especially tailored for our needs in that respect, that is, an undecidable problem that makes the proofs in next section smooth and transparent. In lack of a better name, we dub the problem the Modulo Problem.

We assume that the reader is familiar with modulo arithmetic and elementary number theory. We use \(f^N\) to denote the \(N{{\mathrm{th}}}\) iteration of an unary function f, that is, \(f^0(X)=X\) and \(f^{N+1}(x)= f(f^N(x))\).

Definition 6

The Modulo Problem is given by

  • Instance: a list of pairs \(\langle A_{0}, B_{0} \rangle ,\ldots , \langle A_{M-1}, B_{M-1} \rangle \) where \(M>1\) and \(A_i,B_i \in {\mathbb {N}}\) (for \(i=0,\ldots , M-1\)).

  • Solution: a natural number N such that \(f^N(3)=2\) where

    $$\begin{aligned} f(x) \; = \; A_jz+ B_j \end{aligned}$$

    if there exists \(j<M\) such that \(x=zM+j\).

\(\square \)

The undecidability of the Modulo Problem follows from the existence of a certain type of Collatz functions constructed in Kurtz and Simon [14]. We will spend the rest of this section to explain why the problem is undecidable.

We will work with the counter machines introduced by Minsky [17]. These machines are also known as register machines or Minsky machines. A counter machine consists of

  • a finite number of registers \({\texttt {X}}_1,\ldots {\texttt {X}}_n\)

  • a finite number of instructions \(I_1,\ldots , I_m\).

The registers store natural numbers. The instructions tell the machine how to manipulate these numbers. The machine starts by executing the instruction \(I_2\). Each resister stores 0 when the execution starts (our counter machines do not take input). The instruction \(I_1\) is the unique halting instruction. This instruction does not modify any register, and the machine halts if and only if this instruction is executed. Each of the the remaining instructions \(I_2,\ldots , I_m\) will either be an increment instruction or a decrement instruction. An increment instruction \(I_i\) is of the form \(I_i: {\texttt {X}}_j, I_k\). The instruction tells the machine to increment the natural number stored in the register \({\texttt {X}}_j\) by one and then proceed with instruction \(I_k\). A decrement instruction \(I_i\) is of the form \(I_i : {\texttt {X}}_j, I_k, I_{\ell }\). The instruction tells the machine to decrement the natural number stored in the register \({\texttt {X}}_j\) by one if this is possible, that is, if the number is strictly greater than zero. If it is possible to decrement the number, the machine will proceed with instruction \(I_k\); if it is not possible, the machine will proceed with instruction \(I_\ell \). We assume that we have \(i\ne k\) in any increment instruction and \(i\not \in \{ k ,\ell \}\) in any decrement instruction (this makes it easier to see that some of the arguments below indeed are correct).

It is well known that it is undecidable if a counter machine that starts with every register set to zero will terminate with every register set to zero. Kurtz and Simon [14] simulate counter machines by FracTran programs. A FracTran program f is a finite sequence \(q_1,\ldots , q_s\) of non-negative rational numbers. The transition function \(F_f\) for the FracTran program f maps the natural number x to \(q_i x\) where i is the least i such that \(q_i x\) is integral. If no such i exists, we regard \(F_f(x)\) as undefined.

Following Kurtz and Simon [14], we will show how we given a counter machine \(\mathcal {M}\) can construct a FracTran program \(f_\mathcal {M}\) such that there exists N such that \(F_{f_\mathcal {M}}^N(3)=2\) iff \(\mathcal {M}\) terminates with every register set to zero. Let \(p_i\) denote the \(i{{\mathrm{th}}}\) prime (\(p_1=2\)).

The execution of a counter machine can be viewed as a sequence of configurations of the form

$$\begin{aligned} I_i, a_1, a_2,\ldots , a_n \end{aligned}$$

where \(I_i\) is the instruction to be executed next and \( a_1, a_2,\ldots , a_n\), respectively, are the numbers stored in the registers \({\texttt {X}}_1,\ldots {\texttt {X}}_n\). We represent a configuration by a natural number of the form

$$\begin{aligned} p_ip_{m+1}^{a_1}p_{m+2}^{a_2}\ldots p_{m+n}^{a_n}. \end{aligned}$$

where \(i\le m\). Let \(f_\mathcal {M}\) be a FracTran program \(q_1,\ldots ,q_s\) such that

  1. (1)

    for each increment instruction \(I_i: {\texttt {X}}_j, I_k\) of \(\mathcal {M}\)’s, there is t such that \(q_t = p_k p_{m+j}/p_i\)

  2. (2)

    for each decrement instruction \(I_i : {\texttt {X}}_j, I_k, I_{\ell }\) of \(\mathcal {M}\)’s, there is t such that \(q_t = p_k /p_ip_{m+j}\) and \(q_{t+1} = p_\ell /p_i\)

  3. (3)

    \(q_1,\ldots ,q_s\) is a minimal sequence that satisfies (1) and (2) (so no sequence of length \(s-1\) will satisfy (1) and (2)).

Let us make some observations. Let \(I_i\) be the increment instruction \(I_i: {\texttt {X}}_j, I_k\). Then \(p_k p_{m+j}/p_i\) is the one and only \(q_t\) in the sequence \(q_1,\ldots ,q_s\) such that \(q_t p_ip_{m+1}^{a_1}\ldots p_{m+n}^{a_n}\) is integral. Thus, we have

$$\begin{aligned} F_{f_\mathcal {M}}\left( p_ip_{m+1}^{a_1}\ldots p_{m+j}^{a_j}\ldots p_{m+n}^{a_n}\right)&= \frac{p_kp_{m+j}}{p_i} p_ip_{m+1}^{a_1}\ldots p_{m+j}^{a_j}\ldots p_{m+n}^{a_n} \\&= p_kp_{m+1}^{a_1}\ldots p_{m+j}^{a_j + 1}\ldots p_{m+n}^{a_n}. \end{aligned}$$

Let \(I_i\) be the decrement instruction \(I_i : {\texttt {X}}_j, I_k, I_{\ell }\) and assume that \({\texttt {X}}_j\) stores \(a_j>0\). Now there are exactly two rationals r in the sequence \(q_1,\ldots ,q_s\) such that \(r p_ip_{m+1}^{a_1}\ldots p_{m+n}^{a_n}\) is integral. These two rationals are \(p_k /p_ip_{m+j}\) and \(p_\ell /p_i\). Since \(p_k /p_ip_{m+j}\) occur before \(p_\ell /p_i\), we have

$$\begin{aligned} F_{f_\mathcal {M}}\left( p_ip_{m+1}^{a_1}\ldots p_{m+j}^{a_j}\ldots p_{m+n}^{a_n}\right)&= \frac{p_k}{p_ip_{m+j}} p_ip_{m+1}^{a_1}\ldots p_{m+j}^{a_j}\ldots p_{m+n}^{a_n} \\&= p_kp_{m+1}^{a_1}\ldots p_{m+j}^{a_j -1 }\ldots p_{m+n}^{a_n} . \end{aligned}$$

If \(I_i\) is the decrement instruction \(I_i : {\texttt {X}}_j, I_k, I_{\ell }\) and \({\texttt {X}}_j\) stores 0, then \(p_\ell /p_i\) is the only \(q_t\) in the sequence that makes \(q_t p_ip_{m+1}^{a_1}\ldots p_{m+n}^{a_n}\) integral, and we have

$$\begin{aligned} F_{f_\mathcal {M}}\left( p_ip_{m+1}^{a_1}\ldots p_{m+n}^{a_n}\right) = p_\ell p_{m+1}^{a_1}\ldots p_{m+n}^{a_n}. \end{aligned}$$

Any counter machine starts in the configuration \(I_2,0,0,\ldots ,0\) (our counter machines do not take input and every register stores zero when the execution starts). This start configuration is represented by the prime \(p_2\), that is, 3. If a counter machine halts with every register set to 0, it halts in the configuration \(I_1,0,0,\ldots ,0\). This configuration is represented by the prime \(p_1\), that is, 2. Given the observations above, it should be obvious that there exists N such that \(F^N_{f_\mathcal {M}}(3) =2\) if and only if \(\mathcal {M}\) halts with every register set to 0. Thus, we conclude that it is undecidable if there exists N such that \(F^N_{f_\mathcal {M}}(3) =2\).

A Collatz function is a function \(C:{\mathbb {N}}\rightarrow {\mathbb {N}}\) that can be written of the form

$$\begin{aligned} C(x) = a_i x + b_i \;\; \text{ if } \, x\equiv i \mod M \end{aligned}$$

where \(a_i,b_i\in {\mathbb {Q}}\) and \(M\in {\mathbb {N}}\) (for more on Collatz functions and the related Collatz problem, see [14]). Following the ideas of Kurtz and Simon [14], we will now construct a Collatz function \(C_\mathcal {M}\) of the more restricted form

$$\begin{aligned} C_\mathcal {M}(x) = a_i x \;\; \text{ if } \, x\equiv i \mod M. \end{aligned}$$

such that we have \(C_\mathcal {M}(x) = F_{f_\mathcal {M}}(x)\) whenever \(F_{f_\mathcal {M}}(x)\) is defined. We use the FracTran program \(f_\mathcal {M}= q_1, \ldots ,q_s\) to determine M and \(a_0,a_1,\ldots ,a_{M-1}\).

For each \(q_i\) in the FracTran program \(f_\mathcal {M}= q_1, \ldots ,q_s\), let \(c_i,d_i\in {\mathbb {N}}\) be such that \(c_i/d_i = q_i\) and \(c_i\) and \(d_i\) are relatively prime. Set M to the least common multiple of \(d_1,\ldots , d_s\) and then follow the procedure (I) to determine \(a_0,a_1,\ldots ,a_{M-1}\). When the procedure starts every \(a_j\) is undefined.

$$\begin{aligned} \begin{array}{l} {\texttt {PROCEDURE (I):}}\\ \hbox {for} \, i:=1,\ldots ,s \, \hbox {do}\\ \;\;\;\;\;\; \hbox {for} \, j:=0,\ldots , M-1 \, \hbox {do}\\ \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; a_j := {\left\{ \begin{array}{ll} a_j &{} \hbox {if} \, a_j \, \hbox {already is defined}\\ q_i &{} \hbox {if} \, a_j \, \hbox {is not yet defined and} \, d_i \, \hbox {divides} \, j \\ \text{ undefined } &{} \text{ otherwise. } \end{array}\right. } \end{array} \end{aligned}$$

This completes the construction of \(C_\mathcal {M}\). Many of the rationals in the sequence \(a_0,a_1,\ldots ,a_{M-1}\) might still not be defined when the procedure terminates, but that is not important to us. The following claim is what matters to us:

$$\begin{aligned} F_{f_\mathcal {M}}(x)= q_i x \Leftrightarrow C_\mathcal {M}(x)=q_ix . \end{aligned}$$
(claim)

In order to see that our claim holds, assume that \( F_{f_\mathcal {M}}(x)= q_i x\). Then, we know that \(q_ix\in {\mathbb {N}}\) and that \(q_\ell x\not \in {\mathbb {N}}\) when \(\ell < i\). Let \(x= zM + j\) where \(j<M\) and let \(c_i/d_i = q_i\) where \(c_i\) and \(d_i\) are relatively prime. Then, we have

$$\begin{aligned} q_i x = \frac{c_i}{d_i}(zM + j) \; \in \; {\mathbb {N}}. \end{aligned}$$

As \(d_i\) divides M but not \(c_i\), it must be the case that \(d_i\) divides j. A symmetric argument yields that \(d_\ell \) does not divide j when \(\ell < i\). Thus, our procedure sets \(a_j\) to \(q_i\). Hence, we have \(C_\mathcal {M}(x) = C_\mathcal {M}(zM+ j) = a_jx = q_ix\). This proves that the left-right implication of the claim holds. It is easy to see that also the right-left implication holds.

It follows from the claim that \(F^N_{f_\mathcal {M}}(3) =2\) iff \(C_\mathcal {M}^N(3)=2\). Thus, we conclude that it is undecidable if there exists N such that \(C_\mathcal {M}^N(3)=2\) (since we already have concluded that it is undecidable if there exists N such that \(F^N_{f_\mathcal {M}}(3) =2\)).

We are soon ready to conclude that the Modulo Problem is undecidable. The function f in the Modulo Problem is a total function. Now, \(C_\mathcal {M}\) is by no means a total function, but if \(C_\mathcal {M}(x)\) is defined and \(x= zM+j\) where \(j<M\), then it turns out that we have \(A_j,B_j\in {\mathbb {N}}\) such that \(C_\mathcal {M}(x)= A_jz + B_j\). To see that such \(A_j\) and \(B_j\) exist, observe that

$$\begin{aligned} C_\mathcal {M}(zM+j) = \frac{c}{d}(zM+j) \; \in \; {\mathbb {N}}\end{aligned}$$

for some relatively prime natural numbers c and d. Moreover, the algorithm for constructing \(C_\mathcal {M}\) assures that d divides both M and j. Hence, let \(A_j= cM/d\) and let \(B_j= cj/d\), and \(A_j\) and \(B_j\) will be natural numbers such that \(C_\mathcal {M}(x)= A_jz+B_j\). This entails that the following procedure will construct a sequence \(\langle A_0,B_0\rangle , \ldots \langle A_{M-1},B_{M-1}\rangle \) of pair of natural numbers:

$$\begin{aligned} \begin{array}{l} {\texttt {PROCEDURE (II):}} \\ \hbox {for} \, j:=0,\ldots , M-1 \, \hbox {do}\\ \;\;\;\;\;\;\; - \hbox {set} \, A_j = cM/d \, \hbox {and} \, B_j= cj/d \, \hbox {if procedure} \, {\texttt {(I)}} \, \hbox {defines}\, a_j \, \hbox {to equal} \, c/d \\ \;\;\;\;\;\;\; - \hbox {set} \, A_j=B_j=0 \, \hbox {if procedure} \, {\texttt {(I)}} \, \hbox {leaves} \, a_j \, \hbox {undefined.}\\ \end{array} \end{aligned}$$

Now, let

$$\begin{aligned} f(x) \; = \; A_jz+ B_j \end{aligned}$$

if there exists \(j<M\) such that \(x=zM+j\). Then, we obviously have \(f(x) = C_\mathcal {M}(x)\) whenever \(C_\mathcal {M}(x)\) is defined. Thus, as it is undecidable if there exists N such that \(C_\mathcal {M}^N(3)=2\), it is also undecidable if there exists N such that \(f^N(3)=2\). These considerations should make it clear that the Modulo Problem is undecidable.

4.4 Undecidable fragments

The stage is now set for our undecidability results. We know that the Modulo Problem is undecidable. Let \(\langle A_{0}, B_{0} \rangle ,\ldots , \langle A_{M-1}, B_{M-1} \rangle \) be an instance of the problem, and let

$$\begin{aligned} f(x) \; = \; A_jz+ B_j \end{aligned}$$

if there exists \(j<M\) such that \(x=zM+j\). It is easy to see that there is N such that \(f^N(3)=2\) if and only if there exists a bit string of the form

$$\begin{aligned} {\varvec{0}}{\varvec{1}}^{a_0+1}{\varvec{0}} {\varvec{1}}^{a_1+1}{\varvec{0}}\ldots {\varvec{0}}{\varvec{1}}^{a_N +1}{\varvec{0}} \end{aligned}$$
(*)

where

  • \(a_0=3\) and \(a_N=2\)

  • for each \(i\in \{0,\ldots , N-1\}\) there is \(z\in {\mathbb {N}}\) and \(j<M\) such that

    $$\begin{aligned} a_i = zM + j \; \text{ and } \; a_{i+1}= A_jz + B_j . \end{aligned}$$

The challenge is to claim the existence of a bit string x of the form (*) by using as few quantifiers as possible. We will of course need one unbounded existential quantifier just to say that a string x is there. Then we will need some quantifiers to state that x is of the desired form. In the structure \({\mathfrak {D}}\), we will state that any prefix of x of the form \(y{\varvec{0}}{\varvec{1}}\) can be extended to a prefix of x of the form

$$\begin{aligned} y{\varvec{0}}{\varvec{1}}\underbrace{{\varvec{1}} {\varvec{1}}{\varvec{1}}\ldots {\varvec{1}}{\varvec{1}}{\varvec{1}}}_{kM \, \mathrm{copies}} \underbrace{{\varvec{1}}{\varvec{1}}{\varvec{1}} \ldots {\varvec{1}}{\varvec{1}}{\varvec{1}}}_{j \, \mathrm{copies}} {\varvec{0}}{\varvec{1}}\underbrace{{\varvec{1}}{\varvec{1}}{\varvec{1}} \ldots {\varvec{1}}{\varvec{1}}{\varvec{1}}}_{kA_j \, \mathrm{copies}} \underbrace{{\varvec{1}}{\varvec{1}}{\varvec{1}} \ldots {\varvec{1}}{\varvec{1}}{\varvec{1}}}_{B_j \, \mathrm{copies}} {\varvec{0}} \end{aligned}$$
(**)

for some j and k. Recall that j, M, \(A_j\), \(B_j\) are fixed natural numbers. Thus, for each \(j\in \{0 ,\ldots , M-1\}\), we can express that x has a prefix of the form (**) by a formula \(\exists z [\psi _j(x,y,z)]\) where

$$\begin{aligned} \psi _j(x,y,z) \;\; \equiv \;\; z1=1z \; \wedge \; y01\underbrace{zz \ldots zz}_{M}\underbrace{11 \ldots 11}_{j}01\underbrace{zz \ldots zz}_{A_j}\underbrace{11 \ldots 11}_{B_j}0 \; \preceq \; x . \end{aligned}$$

In addition we have to state that x should start with \({\varvec{0}}{\varvec{1}}{\varvec{1}}{\varvec{1}}{\varvec{1}}{\varvec{0}}\) and end with \({\varvec{0}}{\varvec{1}}{\varvec{1}}{\varvec{1}}{\varvec{0}}\). This explains why the formula

$$\begin{aligned}&\exists x \left[ 011110\preceq x \; \wedge \; (\forall y \preceq x) \left[ \ y01 \not \preceq x \; \vee \; y01110 = x \right. \right. \\&\quad \left. \left. \vee \exists z\left[ \bigvee _{j=0}^{M-1} \psi _j(x,y,z) \ \right] \ \right] \ \right] \end{aligned}$$

claims the existence of a bit string of the form (*). The formula contains two unbounded existential quantifiers and one bounded universal quantifier. If we could decide if such a formula is true in \({\mathfrak {D}}\), then we could decide the Modulo Problem. Hence, \({\varSigma }_{2,0,1}^\mathfrak {D}\) is an undecidable fragment.

Similar reasoning will show that the fragments \({\varSigma }_{1,0,1}^\mathfrak {B}\) and \({\varSigma }_{1,3,2}^\mathfrak {F}\) are undecidable. The details can be found below.

Theorem 14

The fragments \({\varSigma }_{2,0,1}^\mathfrak {D}\), \({\varSigma }_{1,0,1}^\mathfrak {B}\) and \({\varSigma }_{1,3,2}^\mathfrak {F}\) are undecidable.

Proof

For any \(\mathcal {L}_{BT}\)-term t let \([t]^{0}\equiv e\) and let \([t]^{n+1}\equiv t \circ [t]^{n}\). Furthermore, note that the word equation \(x{\varvec{1}}= {\varvec{1}}x\) is satisfied iff \(x\in \{ {\varvec{1}}\}^*\).

Let \(\langle A_{0}, B_{0} \rangle ,\ldots , \langle A_{M-1}, B_{M-1} \rangle \) be an instance of the Modulo Problem.

First we prove that \({\varSigma }_{2,0,1}^\mathfrak {D}\) is undecidable. For \(i\in \{0, \ldots , M-1\}\), let

$$\begin{aligned} \psi _j(x,y,z) \equiv z1= 1z \wedge y01[z]^{M}[1]^{j}01[z]^{A_j}[1]^{B_j}0\preceq x . \end{aligned}$$

and let \(\phi \) be the \({\varSigma }_{2,0,1}\)-formula

$$\begin{aligned}&\exists x \left[ 01[1]^{3}0\preceq x \wedge (\forall y \preceq x) \left[ \ y01 \not \preceq x \vee y01[1]^{2}0 = x \right. \right. \\&\quad \left. \left. \vee \exists z\left[ \bigvee _{j=0}^{M-1} \psi _j(x,y,z) \ \right] \ \right] \ \right] \end{aligned}$$

Then \({\mathfrak {D}}\models \phi \) if and only if the instance has a solution. Obviously, there is an algorithm for constructing \(\phi \) when the instance is given, and thus no algorithm can decide if a \({\varSigma }_{2,0,1}\)-sentence is true in \({\mathfrak {D}}\), that is, the fragment \({\varSigma }_{2,0,1}^\mathfrak {D}\) is undecidable.

Next we prove that \({\varSigma }_{1,0,1}^\mathfrak {B}\) is undecidable. For \(j\in \{0,\ldots , M-1 \}\), let \(\xi _j(y,x)\) be the formula

$$\begin{aligned}&\Big ( \ y1=1y \; \wedge \; 01[y]^{M}[1]^{j}0\sqsubseteq x \; \wedge \; [y]^{M}[1]^{j}\ne [1]^{2} \ \Big ) \;\; \rightarrow \;\; \\&\qquad \qquad 01[y]^{M}[1]^{j}01[y]^{A_j}[1]^{B_j}0\sqsubseteq x . \end{aligned}$$

Note that \(\xi _j(y,x)\) is trivially equivalent to a \({\varSigma }_{0,0,0}\)-formula \({\hat{\xi }}_j(y,x)\). Let \(\phi '\) be the \({\varSigma }_{1,0,1}\)-formula

$$\begin{aligned} \exists x \left[ 01[1]^{3}0 \sqsubseteq x \; \wedge \; (\forall y\sqsubseteq x)\left[ \bigvee _{j=0}^{M-1} {\hat{\xi }}_j(y,x) \ \right] \ \right] . \end{aligned}$$

Then \({\mathfrak {B}}\models \phi '\) if and only if the instance has a solution. There is an algorithm for constructing \(\phi '\) from the instance, and thus we conclude that \({\varSigma }_{1,0,1}^\mathfrak {B}\) is undecidable.

We are left to prove that \({\varSigma }_{1,3,2}^\mathfrak {F}\) is undecidable. The following formula does to job:

$$\begin{aligned}&\exists x \left[ (\exists v \trianglelefteq x) [ 01[1]^{3}0v =x ] \; \wedge \; (\forall uv \trianglelefteq x) \right. \\&\quad \left. \left[ u01v \ne x \; \vee \; u01[1]^{2}0 = x \; \vee \; (\exists zy\trianglelefteq x)\left[ \bigvee _{j=0}^{M-1} \eta _j(z,u,y,x) \ \right] \ \right] \ \right] \end{aligned}$$

where

$$\begin{aligned} \eta _j(z,u,y,x) \;\; \equiv \;\; z1=1z \; \wedge \; u 01 [z]^{M}[1]^{j}01 [z]^{A_j}[1]^{B_j}0y=x \end{aligned}$$

for \(j \in \{0,\ldots , M-1 \}\). \(\square \)

Corollary 1

(i) It is undecidable whether a sentence of the form

$$\begin{aligned} \exists x_1(\forall y\preceq x_1)\exists x_2 \ldots x_n [ s=t ] \end{aligned}$$

is true in \({\mathfrak {D}}\). (ii) It is undecidable whether a sentence of the form

$$\begin{aligned} \exists x_1(\forall y_1 y_2 \sqsubseteq x_1)\exists x_2 \ldots x_n [ s=t ] \end{aligned}$$

is true in \({\mathfrak {B}}\). (iii) It is undecidable whether a sentence of the form

$$\begin{aligned} \exists x_1(\forall y_1 y_2 \trianglelefteq x_1) \exists x_2 \ldots x_n [ s=t ] \end{aligned}$$

is true in \({\mathfrak {F}}\).

Proof

Consider the \({\varSigma }_{2,0,1}\)-sentence \(\phi \) if the proof of the preceding theorem. By Theorem 8, \(\phi \) is \({\mathfrak {D}}\)-equivalent to sentence of the form

$$\begin{aligned} \exists x_1 (\forall y\preceq x_1) \exists x_2 \ldots x_n [ s=t ] . \end{aligned}$$

This proves that (i) holds. Furthermore, we have

$$\begin{aligned} {\mathfrak {D}} \models \exists x_1(\forall y\preceq x_1)\exists x_2\ldots x_n [ s=t ] \end{aligned}$$

if and only if

$$\begin{aligned} {\mathfrak {B}} \models \exists x_1 (\forall y_1 y_2 \sqsubseteq x_1) \exists x_2 \ldots x_n [ y_1 y_2\ne x_1 \vee s=t ] \end{aligned}$$

if and only if

$$\begin{aligned} {\mathfrak {F}} \models \exists x_1 (\forall y_1 y_2 \trianglelefteq x_1) \exists x_2 \ldots \exists x_n [ y_1 y_2\ne x_1 \vee s=t] . \end{aligned}$$

Thus, (ii) and (iii) hold by Lemmas 17 and 18. \(\square \)