First-Order Concatenation Theory with Bounded Quantifiers

We study first-order concatenation theory with bounded quantifiers. We give axiomatizations with interesting properties, and we prove some normal-form results. Finally, we prove a number of decidability and undecidability results.


Concatenation Theory vs. 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.

Notation and Terminology
We will use 0 and 1 to denote respectively the bits zero and one, and we use pretty standard notation when we work with bit strings: {0, 1} * denotes the set of all finite bit strings; |α| denotes the length of the bit string α; (α) i denotes the i th bit of the bit string α; and 01 3 0 2 1 denotes the bit string 0111001. The set {0, 1} * contains the empty string which we will denote ε.
The language L − BT of first-order bit theory consists of the constants symbols e, 0, 1 and the binary function symbol •. We will use B − to denote the standard L − BT -structure: The universe of B − is the set {0, 1} * . The constant symbol 0 is interpreted as the string containing nothing but the bit 0, and the constant symbol 1 is interpreted as the string containing nothing but the bit 1, that is, 0 B − = 0 and 1 B − = 1. The constant symbol e is interpreted as the empty string, that is, e B − = ε. Finally, • B − is the function that concatenates two strings (e.g. 01 • B − 000 = 01000 and ε • B − ε = ε).

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 , . . . , a n of natural numbers by a the bit string 00101 a1+1 001101 a2+1 001 3 01 a3+1 00 . . . 001 n 01 an+1 00 .
Furthermore, we can state that a string is a substring of another (the formula (∃uv)[u • x • v = y] holds in B − iff x is a substring of y). We can state that a string contain only ones (the formula ¬(∃uv)[u • 0 • v = x] holds in B − iff x contains only ones, and so does the the formula x • 1 = 1 • 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 φ(x, y, z) such that φ(1 i , 1 a , α) is true in B iff α encodes a sequence of natural numbers where the i th element is a. The reader interested in the details should consult Section 8 of Leary & 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 Kleenerecursive definition of f .

Moreover, given a definition of the function, we can compute the formula.
This theorem implies that it is undecidable if a L − BT -sentence is true in the standard structure B − . It is of course also undecidable if a sentence of first-order number theory is true in its standard structure N. Indeed, due to the negative solution of Hilbert's 10 th problem (the Davis-Putnam-Robinson-Matiyasevich Theorem), it is even undecidable if a sentence of the form is true in N. The bit-theoretic version of Hilbert's 10 th problem turned out to have a positive solution. The next theorem is just a reformulation of a result of Makanin [16].
Hence, it is in general undecidable if a sentence is true in B − , but it is decidable if a sentence of the form ∃x 1 , . . . x n [s = t] is true in 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.

Bounded Quantifiers and Σ-formulas
The first-order language L BT is L − BT extended by a binary relation symbol ⊑. We introduce the bounded existential quantifier (∃x ⊑ t)φ and bounded universal quantifier (∀x ⊑ t)φ as shorthand notations for respectively Next we define the Σ-formulas inductively by φ and ¬φ are Σ-formulas if φ is of the form s ⊑ t, or of the form s = t, where s and t are terms a term and x is a variable not occurring in t.
A purely existential formula is a Σ-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 Σ-formulas in number theory are often called Σ 1 -formulas or Σ 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 does 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 ⊑ 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 ⊑ as the subword relation investigated in Halfon et. al. [8], or as a lexicographical ordering relation.

More on Notation and Terminology
We reserve the letter B for the structure where ⊑ is the substring relation, that is, the The L BT -structure D is the same structure as B with one exception: the relation α ⊑ D β holds iff α is a prefix of β, that is, iff there exists γ ∈ {0, 1} * such that αγ = β.
The L BT -structure F is the same structure as B with one exception: the relation α ⊑ F β holds iff the number of bits in α is less than or equal to the number of bits in β, that is, iff |α| ≤ |β|.
To improve the readability we will use the symbol in place of the symbol ⊑ in formulas that are meant to be interpreted in the structure D. Thus, x y should be read as "x is a prefix of y". Similarly, we will use in formulas that are meant to be interpreted in F, and x y should be read as "x is shorter than y". We will continue to use the symbol ⊑ in formulas that are meant to be interpreted in B. Thus, x ⊑ y should be read as "x is a substring of y".
We may skip the operator • in first-order formulas and simply write st in place of s • t. Furthermore, we will occasionally contract quantifiers and write, e.g., ∀xy ⊑ z[φ] in place of (∀x ⊑ z)(∀y ⊑ z)φ, and for ∼ ∈ { , ⊑, , =}, we will normally write s ∼ t in place of ¬s ∼ t.
Recall that a sentence is a formula with no free variables.

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 that 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 & Zdanowski [6], Svejdar [22], Visser [24], Horihata [11] and Higuchi & 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 Section 2, the latter to the results we present in last two sections of the paper. More on the history of concatenation theory can be found in Visser [24].
The present paper is a significantly extended an improved version of the conference paper Kristiansen & Murwanashyaka [13]. We assume that the reader is familiar with the basics of mathematical logic and computability theory. An introduction can be found Leary & 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 & Pudlak [7].

Σ-Complete Axiomatizations
Once the bounded quantifiers are present, it is natural to ask if we can find neat and natural Σ-complete axiomatisations 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 Σ-complete with respect to our different structures (B, D and F). These axiomatizations might serve as base theories which can be extended with, e.g., collection principles or induction schemes of the form

The Theory B −
B − is a L − BT -theory. All the first-order theories we will present contain the axioms of B − . Definition 3. The first-order theory B − contains the following four non-logical axioms: We will use B − i to refer to the i th axiom of B − .
Proof. We prove the lemma by induction on the length of β, and we consider the following cases: β ≡ ε, β ≡ γ0 and β ≡ γ1.
Proof. We will use induction on the structure of t. Assume t ≡ e. Obviously, 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 = e. A symmetric argument shows that x1 = e. ⊓ ⊔ Proof. We prove the lemma by induction on the natural number min(|α|, |β|). Assume min(|α|, |β|) = 0. Then, either α or β will be the empty string ε. Furthermore, it cannot be the case that both α or β are the empty string as α = β. By Lemma 6, we have B − ⊢ α = β. We leave the proof of the next theorem to the reader (see the proof of Theorem 13).
Theorem 8. For any purely existential sentence φ, we have

The Structure B
Definition 9. The first-order theory B contains the following eleven non-logical axioms: -the first four axioms are the axioms of We will use B i to refer to the i th axiom of B.
In the cases when β is empty or just contains a single bit, the lemma holds by Assume β ≡ 0γ0. The proof splits into the cases In case (i), we have B ⊢ α = β by logical axioms. By The cases β ≡ 0γ1, β ≡ 1γ0 and β ≡ 1γ1 are similar to the case β ≡ 0γ0, use B 9 , B 10 and B 11 , respectively, in place of Proof. The proof of this lemma is symmetric to the proof of Lemma 10, and we omit the details. ⊓ ⊔ for any α ∈ {0, 1} * . Then we have Proof. We proceed by induction on the length of α. We will consider the cases By (*) and the induction hypothesis, we have The case α ≡ 0β1, the case α ≡ 1β0 and the case α ≡ 1β1 are handled similarly using B 9 , B 10 and B 11 , respectively, in place of B 8 .

⊓ ⊔
Theorem 13 (Σ-completeness of B). For any Σ-sentence φ, we have Proof. We prove the theorem by induction on the structure of the Σ-sentence φ. The base cases are φ ≡ s = t, φ ≡ s = t, φ ≡ s ⊑ t and φ ≡ s ⊑ t (where s and t are variable free). We attend to the case φ ≡ s ⊑ t. So assume φ ≡ s ⊑ t. Furthermore, assume B |= s ⊑ t. By Lemma 5, we have α, β ∈ {0, 1} * such that By the Soundness Theorem for first-order logic, we have α ⊑ B β. By Lemma 10, This proves that the theorem holds when φ ≡ s ⊑ t. The cases φ ≡ s = t, φ ≡ s = t and φ ≡ s ⊑ t are similar. Use Lemma 7 in place of Lemma 10 when φ ≡ s = t. Use Lemma 11 in place of Lemma 10 when φ ≡ s ⊑ t.
. Then we have B |= ψ(α) for some α ∈ {0, 1} * . Our induction hypothesis yields B ⊢ ψ(α), and then we also have By the Soundness Theorem of first-order logic, we have Our induction hypothesis yields The first-order theory D contains the following seven non-logical axioms: -the first four axioms are the axioms of We will use D i to refer to the i th axiom of D.
Proof. This proof is symmetric to the proof of the next lemma. We omit the details.
⊓ ⊔ Proof. We prove the lemma by induction on the length of β, and we consider the cases β ≡ ε, β ≡ γ0 and β ≡ γ1.
Assume β is empty. Then α is not empty. By Lemma 7, we have D ⊢ α = e. By axiom D 5 , we have D ⊢ α e. Thus, D ⊢ α β. Assume β ≡ γ0. Then we have α = γ0 and α D γ. By our induction hypothesis, we have D ⊢ α γ. By Lemma 7, we have D ⊢ α = γ0. By axiom D 6 , we have D ⊢ α γ0. The case where β is of the form γ1 is similar. Apply axiom D 7 in place of D 6 .
The case α ≡ β1 is similar to the preceding case. Use D 7 in place of D 6 . ⊓ ⊔ Proof. Given the lemmas above, we can more or less just repeat the proof of -the first four axioms are the axioms of We will use F i to refer to the i th axiom of F .
This proves the case α ≡ α ′ 0. The proof when α ≡ α ′ 1 is similar. Use F 9 and F 10 , respectively, in place of F 7 and F 8 .
It is convenient to introduce some new notation before we state our next lemma: for any α ∈ {0, 1} * .
Proof. We prove this lemma by induction on the length of α. The base case is α ≡ ε. The inductive cases are α ≡ γ0 and α ≡ γ1.
First we deal with case α ≡ ε. The axiom F 6 says that Thus, we have straightaway as α is e, the set [ε . . . α] is the singleton set {ε} and ε is e.
We will now turn to the inductive case α ≡ γ0. In this case it is sufficient to prove as it follows from (1), (2), (3) and the axiom F 11 that Our induction hypothesis yields It is trivial that (1) holds. This is a logical truth that 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 γ0. We need to argue that Finally, we observe that ( ‡) implies ( †). 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 α ≡ γ0. The case α ≡ γ1 is symmetric. Use the axioms F 8 and F 10 , respectively, in place of F 7 and F 9 . ⊓ ⊔ Lemma 23. Let φ(x) be an L BT -formula such that for any α ∈ {0, 1} * . Then we have Proof. Given the lemmas above, we can more or less just repeat the proof of whereas F is not. The axiom F 11 contains an existential quantifier. Can we find a purely universal set of axioms that is Σ-complete with respect to the model F? Yes, we can. We can regard Lemma 22 as an axiom scheme. Then we do not need F 11 to achieve Σ-completeness.
Definition 25. Let F ′ be the first-order theory F where the axiom F 11 is replaced by the scheme Theorem 26 (Σ-completeness of F ′ ). For any Σ-sentence φ, we have Proof. Proceed as in the proof of Theorem 24. Since the axiom scheme is present, F 11 will not be needed anymore. ⊓ ⊔ Now, F ′ is an open theory, but in contrast to B and D, it is not finite.
Conjecture: There is no finite open set of axioms that is Σ-complete with respect to the structure F.

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 (27, 29, 30 ) in this section can be found elsewhere, e.g., in Büchi & 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 & Senger [1]).
The next lemma shows that conjunctions of equations can be replaced by one equation.

⊓ ⊔
The next lemma shows that disjunctions of equations can be replaced by one equation at the price of some more existential quantifiers.
Lemma 28. Let s 1 , s 1 , t 1 , t 2 be L BT -terms. There exist L BT -terms s, t and variables v 1 , . . . , v k such that Proof. Let x 1 , . . . , 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 t 1 ∨ s 2 t 2 is D-equivalent to the formula We will show that the disjunction in (*), that is x 2 = e ∨ x 5 = e, can be replaced by a formula Thus, by Lemma 27 which allow us to merge conjunctions of equations, (*) will be equivalent to a formula of the form and our proof will be complete.
To see that the converse implication holds, assume that ¬(u = e ∨ w = e), that is, both u and w are different from the empty string. Furthermore, assume that uw = wu. We will argue that ψ(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 uy 3 wy 4 = wy 4 uy 3 and y 3 y 4 = 1 cannot be satisfied simultaneously. If 1 is the last bit of both, the two equations uy 1 wy 2 = wy 2 uy 1 and y 1 y 2 = 0 cannot be satisfied simultaneously. Hence we conclude that ψ(u, w) does not hold. This completes the proof of (**).
Lemma 29. Let s 1 , s 2 , t 1 , t 2 be L BT -terms. There exist L BT -terms s, t and variables v 1 , . . . , v k such that Proof. Observe that which again is (logically) equivalent to By Lemma 27 and Lemma 28, we have terms s, t and variables v 1 .
Thus, the lemma holds as we are dealing with a L − BT -formula. ⊓ ⊔ Lemma 30. Let s 1 , t 1 be L BT -terms. There exist L BT -terms s, t and variables v 1 , . . . , v k such that Proof. Observe that the formula s = t is B − -equivalent to the formula Thus, the lemma follows from Lemma 29 and Lemma 27. Proof. The formula s 1 t 1 is D-equivalent to the formula Thus, the lemma follows from the preceding lemmas.

⊓ ⊔
Theorem 32 (Normal Form Theorem for D). Any Σ-formula φ is Dequivalent to a L BT -formula of the form where t 1 , .., t m are L BT -terms and Q tj j v j ∈ {∃v j , ∃v j t j , ∀v j t j } for j = 1, . . . , m. Moreover, if φ is a purely existential formula, then Q tj j v j is ∃v j . Proof. We proceed by induction on the structure of the Σ-formula φ (throughout the proof we reason in the structure D). Assume φ ≡ s t. Then φ is equivalent to a formula of the form ∃x[sx = t] and the theorem holds. Assume φ ≡ s t.
Then the theorem holds by Lemma 31. Assume φ ≡ s = t. Then the theorem holds by Lemma 30. The theorem holds trivially when φ is of the form s = t.
Suppose φ is of the form ψ ∧ ξ. By our induction hypothesis, we have formulas which are equivalent to respectively ψ and ξ. Thus, φ is equivalent to a formula of the form (Q t1 . By Lemma 27, we have a formula of the desired form which is equivalent to φ. The case when φ is of the form ψ ∨ ξ is similar. Use Lemma 29 in place of Lemma 27. The theorem follows trivially from the induction hypothesis when φ is of one of the forms (∃v)ψ, (∀v t)ψ and (∃v t)ψ.
If φ is a purely existential formula, there will be no bounded universal quantifiers among (Q t1 Thus, φ is equivalent to a formula of the form which again is equivalent to a formula of the form By Lemma 27, we can conclude that any purely existential formula is equivalent to a formula of the form ∃v 1 . . . v m [s = t].

⊓ ⊔
Theorem 33 (Normal Form Theorem for F). Any Σ-formula φ is F-equivalent to a L BT -formula of the form where Q j ∈ {∃, ∀} for j = 1, . . . , m. Moreover, if φ is a purely existential formula, then φ is equivalent to a formula of the form Proof. We prove the theorem by induction on the structure of the Σ-formula φ (throughout the proof we reason in the structure F). Assume φ ≡ s t. Then φ is equivalent to a formula of the form ∃x t[x = s], and the theorem holds. Assume φ ≡ s t. Then φ is equivalent to t • 0 s, and thus also equivalent to a formula of the form ∃x s[x = t • 0]. Hence the theorem holds. Furthermore, the theorem holds by Lemma 30 when φ ≡ s = t, and the theorem holds trivially when φ ≡ s = t.
The inductive cases φ ≡ ψ ∧ ξ and φ ≡ ψ ∨ ξ are similar to the corresponding cases in the proof of Theorem 32 (normal form theorem for D).
Thus, any Σ-formula is F-equivalent to a Σ-formula that contains maximum one unbounded existential quantifier.
If φ is a purely existential formula, then Q 1 , . . . , Q m will all be existential quantifiers. Thus, it is easy to see that any purely existential formula is equivalent to a formula of the form

⊓ ⊔
It is not true that any purely existential formula is F-equivalent to a formula of the form ∃x 1 . . . x n [s = t]. This follows from the results in Karhumäki et al. [12]. E.g., a formula like x y ∧ y x which states that the length of x equals the length of y, is not F-equivalent to a formula of the form ∃x 1 . . . x n [s = t]. See Example 27 in Section 6 of [12].
Lemma 34. Let s 1 , t 1 be L BT -terms. There exist L BT -terms s, t and variables v 1 , . . . , v k such that Proof. Observe that s 1 ⊑ t 1 is B-equivalent to (∀v ⊑ t 1 )α where α is If we let vs 1 t 1 abbreviate ∃x[vs 1 x = t 1 ], then α can be written as vs 1 t 1 . Thus, the lemma follows by Lemma 31. ⊓ ⊔ Theorem 35 (Normal Form Theorem for B). Any Σ-formula φ is Bequivalent in to a L BT -formula of the form Proof. Proceed by induction on the structure of the Σ-formula φ. This proof is similar to the proof of Theorem 33 (normal form theorem for F). If φ is of form If φ is of the form s ⊑ t, then then Lemma 34 says that φ is B-equivalent to a formula of the form ∀v The remaining cases of the inductive proof are similar to their respective cases in the proof of Theorem 33.

⊓ ⊔
We have not been able to find an interesting normal form for purely existential formulas which is stronger than the one for Σ-formulas in B. It follows form the results in Karhumäki et al. [12] that the relation x ⊑ B y cannot be defined in the structure B − : By Theorem 16 in [12], it is not possible to define the language by a word equation. If we could define x ⊑ B y in B − , 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 ⊑ B y in B − , the normal form theorem for purely existential formulas in D (Theorem 32), will for sure be false with respect to B. So will the normal form theorem for purely existential formulas in F (Theorem 33).

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 ∃ x[s = t] holds in the standard model. We also know that any purely existential formula is D-equivalent to formula of this form.

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 Σ-sentence holds in D. It is easy to define the relations D and D by Σ-formulas in the structures B and F, and the bounded quantifiers of D can be expressed by Σ-formulas in in B and F, e.g., if Thus Theorem 36 also implies that it undecidable if a Σ-sentence holds in B or 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 Σ-formulas. We will say that a Σ-formula is a Σ n,m,k -formula if it contains n unbounded existential quantifiers, m bounded existential quantifiers and k bounded universal quantifiers. The fragment Σ A n,m,k is the set of Σ n,m,ksentences that are true in the L BT -structure A. The (purely existential) fragment ∃ A is the set of purely existential sentences that are true in the L BT -structure A (recall that a purely existential formula is a Σ-formula with no occurrences of bounded universal quantifiers). A ∆-formula is a Σ-formula that contain no unbounded existential quantifiers, and the fragment ∆ A is the set of ∆-sentences that are true in the L BT -structure A. Note that

Decidable Fragments
Theorem 37. The fragments ∆ D , ∆ B and ∆ F are decidable.
Proof. We prove that ∆ B is decidable. Let φ be a ∆-formula. The negation of a ∆-formula is logically equivalent to a ∆-formula (use De Morgan's laws). We can compute a ∆-formula φ ′ which is logically equivalent to ¬φ. By Theorem The set of formulas derivable from the axioms of B is computably enumerable.
We can prove that the fragments ∆ D and ∆ F are decidable in the same way as we also have Σ-complete axiomatizations for both D and F.

⊓ ⊔
In some sense, we kill a fly with a hammer when we use Σ-completeness to prove the preceding theorem. It can of course be checked by brute-force algorithms if ∆-sentences are true in the structures D, B and F.
Theorem 38. The fragment ∃ D is decidable.
Proof. Theorem 32 states that any purely existential formula φ is D-equivalent to a formula of the normal form ∃v 1 . . . v m [s = t]. Our proofs show that there is an algorithm for transforming φ into this normal form. Thus the theorem follows by Makanin's result (Theorem 2).

⊓ ⊔
Open Problem: Is the fragment ∃ B decidable?
Open Problem: Is the fragment ∃ F decidable?

The Modulo Problem
In [13] we use the Post's Correspondence Problem (Post [18]) to prove that the fragments Σ D 3,0,2 , Σ D 4,1,1 , Σ B 1,2,1 and Σ B 1,0,2 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 th iteration of an unary function f , that is, f 0 (X) = X and f N +1 (x) = f (f N (x)).
The undecidability of the Modulo Problem follows from the existence of a certain type of Collatz functions constructed in Kurtz & 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 X 1 , . . . X n a finite number of instructions I 1 , . . . , 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 , . . . , I m will either be an increment instruction or a decrement instruction. An increment instruction I i is of the form I i : X j , I k . The instruction tells the machine to increment the natural number stored in the register X j by one and then proceed with instruction I k . A decrement instruction I i is of the form I i : X j , I k , I ℓ . The instruction tells the machine to decrement the natural number stored in the register 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 ℓ . We assume that we have i = k in any increment instruction and i ∈ {k, ℓ} 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 & Simon [14] simulate counter machines by FracTran programs. A FracTran program f is a finite sequence q 1 , . . . , 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 & Simon [14], we will show how we given a counter machine M can construct a FracTran program f M such that there exists N such that F N fM (3) = 2 iff M terminates with every register set to zero. Let p i denote the i th prime (p 1 = 2).
The execution of a counter machine can be viewed as a sequence of configurations of the form I i , a 1 , a 2 , . . . , a n where I i is the instruction to be executed next and a 1 , a 2 , . . . , a n , respectively, are the numbers stored in the registers X 1 , . . . X n . We represent a configuration by a natural number of the form where i ≤ m. Let f M be a FracTran program q 1 , . . . , q s such that (1) for each increment instruction I i : X j , I k of M's, there is t such that q t = p k p m+j /p i (2) for each decrement instruction I i : X j , I k , I ℓ of M's, there is t such that q t = p k /p i p m+j and q t+1 = p ℓ /p i (3) q 1 , . . . , 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 : X j , I k .
Then p k p m+j /p i is the one and only q t in the sequence q 1 , . . . , q s such that q t p i p a1 m+1 . . . p an m+n is integral. Thus, we have Let I i be the decrement instruction I i : X j , I k , I ℓ and assume that X j stores a j > 0. Now there are exactly two rationals r in the sequence q 1 , . . . , q s such that rp i p a1 m+1 . . . p an m+n is integral. These two rationals are p k /p i p m+j and p ℓ /p i . Since p k /p i p m+j occur before p ℓ /p i , we have If I i is the decrement instruction I i : X j , I k , I ℓ and X j stores 0, then p ℓ /p i is the only q t in the sequence that makes q t p i p a1 m+1 . . . p an m+n integral, and we have F fM (p i p a1 m+1 . . . p an m+n ) = p ℓ p a1 m+1 . . . p an m+n .
Any counter machine starts in the configuration I 2 , 0, 0, . . . , 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, . . . , 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 fM (3) = 2 iff M halts with every register set to 0. Thus, we conclude that it is undecidable if there exists N such that F N fM (3) = 2. A Collatz function is a function C : N → N that can be written of the form where a i , b i ∈ Q and M ∈ N (for more on Collatz functions and the related Collatz problem, see [14]). Following the ideas of Kurtz & Simon [14], we will now construct a Collatz function C M of the more restricted form is not yet defined and d i divides j undefined otherwise.
This completes the construction of C M . Many of the rationals a 0 , a 1 , . . . , 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: In order to see that our claim holds, assume that F fM (x) = q i x. Then, we know that q i x ∈ N and that q ℓ x ∈ N when ℓ < 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 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 ℓ does not divide j when ℓ < i. Thus, our procedure sets a j to q i . Hence, we have C M (x) = C M (zM + j) = a j x = q i x. 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 fM (3) = 2 iff C N M (3) = 2. Thus, we conclude that it is undecidable if there exists N such that C N M (3) = 2 (since we already have concluded that it is undecidable if there exists N such that F N fM (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 M is by no means a total function, but if C M (x) is defined and x = zM + j where j < M , then it turns out that we have A j , B j ∈ N such that C M (x) = A j z + B j . To see that such A j and B j exist, observe that for some relatively prime natural numbers c and d. Moreover, the algorithm for constructing C 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 M (x) = A j z + B j . This entails that the following procedure will construct a sequence

Undecidable Fragments
The stage is now set for our undecidability results. We know that the Modulo Problem is undecidable. Let where -a 0 = 3 and a N = 2 -for each i ∈ {0, . . . , N − 1} there is z ∈ N and j < M such that a i = zM + j and a i+1 = A j z + B j .
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 to claim the existence of x. Then we will need some quantifiers to state that x is of the desired form. In the structure D, we will state that any prefix of x of the form y01 can be extended to a prefix of x of the form x .
In addition we have to state that x should start with 011110 and end with 01110. This explains why the formula 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 D, then we could decide the Modulo Problem. Hence, Σ D 2,0,1 is an undecidable fragment. Similar reasoning will show that the fragments Σ B 1,0,1 and Σ F 1,3,2 are undecidable. The details can be found below. Then D |= φ if and only if the instance has a solution. Obviously, there is an algorithm for constructing φ when the instance is given, and thus no algorithm can decide if a Σ 2,0,1 -sentence is true in D, that is, the fragment Σ D 2,0,1 is undecidable.
Next we prove that Σ B Note that ξ j (y, x) is trivially equivalent to a Σ 0,0,0 -formulaξ j (y, x). Let φ ′ be the Σ 1,0,1 -formula Then B |= φ ′ if and only if the instance has a solution. There is an algorithm for constructing φ ′ from the instance, and thus we conclude that Σ B 1,0,1 is undecidable.
We are left to prove that Σ F 1,3,2 is undecidable. The following formula does to job: Thus, (ii) and (iii) hold by Lemma 29 and Lemma 30. ⊓ ⊔