First-Order Concatenation Theory with Bounded Quantifiers
aa r X i v : . [ m a t h . L O ] M a r First-Order Concatenation Theory withBounded Quantifiers
Lars Kristiansen , and Juvenal Murwanashyaka Department of Mathematics, University of Oslo, Norway Department of Informatics, University of Oslo, Norway
Abstract.
We study first-order concatenation theory with bounded quan-tifiers. We give axiomatizations with interesting properties, and we provesome normal-form results. Finally, we prove a number of decidability andundecidability results.
First-order concatenation theory can be compared to first-order number theory,e.g., Peano Arithmetic or Robinson Arithmetic. The universe of a standard struc-ture for first-order number theory is the set of natural numbers. The universe of astandard structure for first-order concatenation theory is the set of finite stringsover some alphabet. A first-order language for number theory normally containstwo binary functions symbols. In a standard structure these symbols will beinterpreted as addition and multiplication. A first-order language for concate-nation theory normally contains just one binary function symbol. In a standardstructure this symbol will be interpreted as the operator that concatenates twostings. A classical first-order language for concatenation theory—like e.g. theones studied in Quine [19] and Grzegorczyk [5]—contains no other non-logicalsymbols apart from constant symbols.We will stick to a version of concatenation theory where we have a binary al-phabet 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 wecontinue our discussion.
We will use and to denote respectively the bits zero and one, and we usepretty standard notation when we work with bit strings: { , } ∗ denotes the setof all finite bit strings; | α | denotes the length of the bit string α ; ( α ) i denotesthe i th bit of the bit string α ; and denotes the bit string . Theset { , } ∗ contains the empty string which we will denote ε . Lars Kristiansen and Juvenal Murwanashyaka
The language L − BT of first-order bit theory consists of the constants symbols e, , ◦ . We will use B − to denote the standard L − BT -structure: The universe of B − is the set { , } ∗ . The constant symbol 0is interpreted as the string containing nothing but the bit , and the constantsymbol 1 is interpreted as the string containing nothing but the bit , that is,0 B − = and 1 B − = . 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. ◦ B − = and ε ◦ B − ε = ε ).We will soon need the biterals . For each α ∈ { , } ∗ we define the biteral α by ε = e , α = α ◦ α = α ◦
1. The biterals correspond to the numerals offirst-order number theory: they serve as canonical names for the elements in theuniverse of the standard structure. Note that, e.g., (( e ◦ ◦ ◦ e ◦ ◦ (1 ◦
0) is not.
At a first glance the parsimonious language of first-order bit theory does notseem very expressive, but a little bit of thought shows otherwise. Observe thatwe can encode a sequence a , a , . . . , a n of natural numbers by a the bit string a +1 a +1 a +1 . . . n a n +1 . 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 thata string contain only ones (the formula ¬ ( ∃ uv )[ u ◦ ◦ v = x ] holds in B − iff x contains only ones, and so does the the formula x ◦ ◦ x ). We can state thata bit string does not contain two consecutive occurrences of zeros, and so on. Ifwe proceed along these lines, we can come up with a formula φ ( x, y, z ) such that φ ( i , 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 ofLeary & Kristiansen [15].First-order bit theory is indeed expressive enough to code and decode sequencesof natural numbers, and then it should be no surprise that the following theoremholds. 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 : N n → N there exists an L − BT -formula φ ( x , . . . , x n , y ) such that f ( a , . . . , a n ) = b ⇔ B − | = φ ( a , . . . , a n , b ) . 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 thestandard structure B − . It is of course also undecidable if a sentence of first-order irst-Order Concatenation Theory with Bounded Quantifiers 3 number theory is true in its standard structure N . Indeed, due to the negativesolution of Hilbert’s 10 th problem (the Davis-Putnam-Robinson-MatiyasevichTheorem), it is even undecidable if a sentence of the form ∃ x , . . . , x n [ s = t ]is true in N . The bit-theoretic version of Hilbert’s 10 th problem turned out tohave a positive solution. The next theorem is just a reformulation of a result ofMakanin [16]. Theorem 2 (Makanin).
It is decidable if an L − BT -sentence of the form ∃ x , . . . , x n [ s = t ] is true in B − . Hence, it is in general undecidable if a sentence is true in B − , but it is decidableif a sentence of the form ∃ x , . . . x n [ s = t ] is true in B − . This raises the question:where do we find the border between the decidable and the undecidable? Forwhich subclasses of formulas can we, or can we not, decide truth in the standardstructure? Such a question yields an obvious motivation for introducing boundedquantifiers similar to those we know from number theory. Once the boundedquantifiers are there, a number of other questions will knock at the door. Σ -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 universalquantifier ( ∀ x ⊑ t ) φ as shorthand notations for respectively ∃ x [ x ⊑ t ∧ φ ] and ∀ x [ x ⊑ t → φ ] . 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 – ( φ ∨ ψ ) and ( φ ∧ ψ ) are Σ -formulas if φ and ψ are Σ -formulas – ( ∃ x ⊑ t ) φ and ( ∀ x ⊑ t ) φ and ( ∃ x ) φ are Σ -formulas if φ is a Σ -formula, t isa term and x is a variable not occurring in t .A purely existential formula is a Σ -formula that does not contain bounded uni-versal quantifiers.We assume that the reader notes the similarities with first-order number the-ory. The formulas that correspond to Σ -formulas in number theory are oftencalled Σ -formulas or Σ -formulas. Now, in contrast to in number theory, it isnot clear how the relation symbol that defines the bounded quantifiers should Lars Kristiansen and Juvenal Murwanashyaka be interpreted. In the standard model for number theory the relation symbolshould obviously be interpreted as the standard ordering relation of the naturalnumbers. There does not seem to be any other natural options. We can chosebetween 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 willmake 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 inthe current paper, but there are definitely other interesting options. We mighte.g. interpret ⊑ as the subword relation investigated in Halfon et. al. [8], or as alexicographical ordering relation. We reserve the letter B for the structure where ⊑ is the substring relation, thatis, the L BT -structure B is the extension of B − where α ⊑ B β holds iff thereexists γ, δ ∈ { , } ∗ such that γαδ = β .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 γ ∈ { , } ∗ 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 ofbits in β , that is, iff | α | ≤ | β | .To improve the readability we will use the symbol (cid:22) in place of the symbol ⊑ in formulas that are meant to be interpreted in the structure D . Thus, x (cid:22) y should be read as “ x is a prefix of y ”. Similarly, we will use E in formulas thatare meant to be interpreted in F , and x E y should be read as “ x is shorterthan y ”. We will continue to use the symbol ⊑ in formulas that are meant to beinterpreted 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 placeof s ◦ t . Furthermore, we will occasionally contract quantifiers and write, e.g., ∀ xy ⊑ z [ φ ] in place of ( ∀ x ⊑ z )( ∀ y ⊑ z ) φ , and for ∼ ∈ {(cid:22) , ⊑ , E , = } , we willnormally write s t in place of ¬ s ∼ t .Recall that a sentence is a formula with no free variables. 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 irst-Order Concatenation Theory with Bounded Quantifiers 5 on the subject that may have some historical interest. A rather recent line ofresearch in concatenation theory has focused on interpretablity between weakfirst-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 wordequations and formal languages. Papers in this line, like e.g., Karhum¨aki et al.[12], Ganesh et al. [4], Halfon et al. [8] and Day et al. [3], are in general orientedtowards theoretical computer science. Both lines are related to our research: theformer to the first-order theories we present in Section 2, the latter to the resultswe present in last two sections of the paper. More on the history of concatenationtheory can be found in Visser [24].The present paper is a significantly extended an improved version of the con-ference paper Kristiansen & Murwanashyaka [13]. We assume that the readeris familiar with the basics of mathematical logic and computability theory. Anintroduction can be found Leary & Kristiansen [15] (Chapter 8 contains somematerial on concatenation theory). Some familiarity with first-order arithmeticwill probably also be beneficial to the reader. An introduction can be found inHajek & Pudlak [7]. Σ -Complete Axiomatizations Once the bounded quantifiers are present, it is natural to ask if we can findneat and natural Σ -complete axiomatisations of bit theory. Corresponding ax-iomatizations of number theory, e.g. Robinson Arithmetic, have been of greatimportance 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 ax-iomatizations might serve as base theories which can be extended with, e.g.,collection principles or induction schemes of the form (cid:0) φ ( e ) ∧ ∀ x [ φ ( x ) → ( φ ( x ∧ φ ( x (cid:1) → ∀ x [ φ ( x )] . B − B − is a L − BT -theory. All the first-order theories we will present contain theaxioms of B − . Definition 3.
The first-order theory B − contains the following four non-logicalaxioms:1. ∀ x [ x = ex ∧ x = xe ] ∀ xyz [ ( xy ) z = x ( yz ) ] ∀ xy [ ( x = y ) → ( ( x = y ∧ ( x = y
1) ) ] ∀ xy [ x = y Lars Kristiansen and Juvenal Murwanashyaka
We will use B − i to refer to the i th axiom of B − . Lemma 4.
Let α, β ∈ { , } ∗ . Then B − ⊢ α ◦ β = αβ .Proof. We prove the lemma by induction on the length of β , and we considerthe following cases: β ≡ ε , β ≡ γ and β ≡ γ .Assume β ≡ ε . Then β ≡ e , and the lemma holds by the axiom B − . Assume β ≡ γ . By the induction hypothesis, we have B − ⊢ α ◦ γ = αγ . Thus, we alsohave B − ⊢ ( α ◦ γ ) ◦ αγ ◦ . By B − , we have B − ⊢ α ◦ ( γ ◦
0) = αγ ◦ . Thus, the lemma holds as β ≡ γ ◦ αβ ≡ αγ ≡ αγ ◦
0. The case β ≡ γ is similar. ⊓⊔ Lemma 5.
For any L BT -term t there is α ∈ { , } ∗ such that B − ⊢ t = α .Proof. We will use induction on the structure of t . Assume t ≡ e . Obviously, B − ⊢ e = e . Thus, we have B − ⊢ e = ε as ε ≡ e . Assume t ≡
0. By B − , we have B − ⊢ e ◦
0. Thus, we have B − ⊢ as = e ◦
0. The case t ≡ t ≡
0. Finally, assume t ≡ t ◦ t . By induction hypothesis we have α , α ∈ { , } ∗ such that B − ⊢ t = α and B − ⊢ t = α . By Lemma 4, wehave B − ⊢ α ◦ α = α α . Thus, B − ⊢ t = α α . ⊓⊔ Lemma 6. B − , B − , B − ⊢ ∀ x [ x = e ∧ x = e ] .Proof. We reason in an arbitrary model for { B − , B − , B − } . Let x be an arbitraryelement in the universe. Assume x e . Then 1( x
0) = 1 e . By B − , we have1( x
0) = 1. By B − , we have (1 x )0 = 1. By B − , we have (1 x )0 = e
1. Thiscontradicts B − . This proves that x = e . A symmetric argument shows that x = e . ⊓⊔ Lemma 7.
Let α, β ∈ { , } ∗ and α = β . Then B − ⊢ α = β .Proof. We prove the lemma by induction on the natural number min( | α | , | β | ).Assume min( | α | , | β | ) = 0. Then, either α or β will be the empty string ε . Fur-thermore, it cannot be the case that both α or β are the empty string as α = β .By Lemma 6, we have B − ⊢ α = β .Assume min( | α | , | β | ) >
0. Then we have α ≡ α ′ a and β ≡ β ′ b where α, β ∈{ , } ∗ and a, b ∈ { , } . 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 − ⊢ α ′ = β ′ ,and the lemma follows by B − . Case (ii):
The lemma follows straightaway by B − (we do not need the induction hypothesis). ⊓⊔ irst-Order Concatenation Theory with Bounded Quantifiers 7 We leave the proof of the next theorem to the reader (see the proof of Theorem13).
Theorem 8.
For any purely existential sentence φ , we have B − | = φ ⇒ B − ⊢ φ . B Definition 9.
The first-order theory B contains the following eleven non-logicalaxioms:- the first four axioms are the axioms of B − ∀ x [ x ⊑ e ↔ x = e ] ∀ x [ x ⊑ ↔ ( x = e ∨ x = 0) ] ∀ x [ x ⊑ ↔ ( x = e ∨ x = 1) ] ∀ xy [ x ⊑ y ↔ ( x = 0 y ∨ x ⊑ y ∨ x ⊑ y
0) ] ∀ xy [ x ⊑ y ↔ ( x = 0 y ∨ x ⊑ y ∨ x ⊑ y
1) ] ∀ xy [ x ⊑ y ↔ ( x = 1 y ∨ x ⊑ y ∨ x ⊑ y
0) ] ∀ xy [ x ⊑ y ↔ ( x = 1 y ∨ x ⊑ y ∨ x ⊑ y
1) ]
We will use B i to refer to the i th axiom of B . Lemma 10.
Let α, β ∈ { , } ∗ and α ⊑ B β (i.e. α is a substring of β ). Then B ⊢ α ⊑ β .Proof. We prove this lemma by induction on the length of β . The proof splitsinto the cases β ≡ ε , β ≡ , β ≡ , β ≡ γ , β ≡ γ , β ≡ γ and β ≡ γ .In the cases when β is empty or just contains a single bit, the lemma holds by B , B or B .Assume β ≡ γ . The proof splits into the cases(i) α = γ , (ii) α ⊑ B γ and (iii) α ⊑ B γ .In case (i), we have B ⊢ α = β by logical axioms. By B , we have B ⊢ α ⊑ β . Incase (ii), the induction hypothesis yields B ⊢ α ⊑ γ . By B , we have B ⊢ α ⊑ β .In case (iii), the induction hypothesis yields B ⊢ α ⊑ γ . By B , we have B ⊢ α ⊑ β .The cases β ≡ γ , β ≡ γ and β ≡ γ are similar to the case β ≡ γ , use B , B and B , respectively, in place of B . ⊓⊔ Lemma 11.
Let α, β ∈ { , } ∗ and α B β (i.e. α is a not substring of β ).Then B ⊢ α β .Proof. The proof of this lemma is symmetric to the proof of Lemma 10, and weomit the details. ⊓⊔ Lars Kristiansen and Juvenal Murwanashyaka
Lemma 12.
Let φ ( x ) be an L BT -formula such that B | = φ ( α ) ⇒ B ⊢ φ ( α ) (*) for any α ∈ { , } ∗ . Then we have B | = ( ∀ x ⊑ α ) φ ( x ) ⇒ B ⊢ ( ∀ x ⊑ α ) φ ( x ) for any α ∈ { , } ∗ .Proof. We proceed by induction on the length of α . We will consider the cases α ≡ ε , α ≡ , α ≡ , α ≡ β , α ≡ β , α ≡ β and α ≡ β .Let α ≡ ε . Assume B | = ( ∀ x ⊑ e ) φ ( x ). Then B | = φ ( e ). By (*), we have B ⊢ φ ( e ). By B , we have B ⊢ ( ∀ x ⊑ e ) φ ( x ).Let α ≡ . Assume B | = ( ∀ x ⊑ ) φ ( x ). Then B | = φ ( ε ) ∧ φ ( ). By (*), we have B ⊢ φ ( ε ) ∧ φ ( ). By B , we have B ⊢ ( ∀ x ⊑ ) φ ( x ). The case α ≡ is similarto the case α ≡ . Use B in place of B .Let α ≡ β . Assume B | = ( ∀ x ⊑ β ) φ ( x ). Then B | = φ ( β ) ∧ ( ∀ x ⊑ β ) φ ( x ) ∧ ( ∀ x ⊑ β ) φ ( x ) . By (*) and the induction hypothesis, we have B ⊢ φ ( β ) ∧ ( ∀ x ⊑ β ) φ ( x ) ∧ ( ∀ x ⊑ β ) φ ( x ) . By B , we have B ⊢ ( ∀ x ⊑ β ) φ ( x ).The case α ≡ β , the case α ≡ β and the case α ≡ β are handled similarlyusing B , B and B , respectively, in place of B . ⊓⊔ Theorem 13 ( Σ -completeness of B ). For any Σ -sentence φ , we have B | = φ ⇒ B ⊢ φ . 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 α, β ∈ { , } ∗ such that B ⊢ s = α ∧ t = β . (*)By the Soundness Theorem for first-order logic, we have α ⊑ B β . By Lemma 10,we have B ⊢ α ⊑ β . By (*), we have B ⊢ s ⊑ t . This proves that the theoremholds 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 ofLemma 10 when φ ≡ s t .We turn to the inductive cases. Let φ ≡ ( ψ ∧ ξ ). Assume B | = ψ ∧ ξ . Then wehave B | = ψ and B | = ξ . By the induction hypothesis, we have B ⊢ ψ and B ⊢ ξ .Thus, B ⊢ ψ ∧ ξ . The case φ ≡ ( ψ ∨ ξ ) is similar. irst-Order Concatenation Theory with Bounded Quantifiers 9 Let φ ≡ ( ∃ x ) ψ ( x ). Assume B | = ( ∃ x ) ψ ( x ). Then we have B | = ψ ( α ) for some α ∈ { , } ∗ . Our induction hypothesis yields B ⊢ ψ ( α ), and then we also have B ⊢ ( ∃ x ) ψ ( x ).Let φ ≡ ( ∀ x ⊑ t ) ψ ( x ). Assume B | = ( ∀ x ⊑ t ) ψ ( x ). By Lemma 5, we have β ∈ { , } ∗ such that B ⊢ t = β ( † )By the Soundness Theorem of first-order logic, we have B | = ( ∀ x ⊑ β ) ψ ( x ) ( ‡ )Our induction hypothesis yields B | = ψ ( α ) ⇒ B ⊢ ψ ( α ) (IH)for all α ∈ { , } ∗ . By (IH), ( ‡ ) and Lemma 12, we have B ⊢ ( ∀ x ⊑ β ) ψ ( x ).Finally, by ( † ), we have B ⊢ ( ∀ x ⊑ t ) ψ ( x ). This completes the case where φ isof the form ( ∀ x ⊑ t ) ψ ( x ). We leave the case φ ≡ ( ∃ x ⊑ t ) ψ ( x ) to the reader. ⊓⊔ D Definition 14.
The first-order theory D contains the following seven non-logicalaxioms:- the first four axioms are the axioms of B − ∀ x [ x (cid:22) e ↔ x = e ] ∀ xy [ x (cid:22) y ↔ ( x = y ∨ x (cid:22) y ) ] ∀ xy [ x (cid:22) y ↔ ( x = y ∨ x (cid:22) y ) ] We will use D i to refer to the i th axiom of D . Lemma 15.
Let α, β ∈ { , } ∗ and α (cid:22) D β (i.e. α is a prefix of β ). Then D ⊢ α (cid:22) β .Proof. This proof is symmetric to the proof of the next lemma. We omit thedetails. ⊓⊔ Lemma 16.
Let α, β ∈ { , } ∗ and α D β (i.e. α is a not prefix of β ). Then D ⊢ α β .Proof. We prove the lemma by induction on the length of β , and we considerthe cases β ≡ ε , β ≡ γ and β ≡ γ .Assume β is empty. Then α is not empty. By Lemma 7, we have D ⊢ α = e . Byaxiom D , we have D ⊢ α e . Thus, D ⊢ α β . Assume β ≡ γ . Then wehave α = γ and α D γ . By our induction hypothesis, we have D ⊢ α γ . ByLemma 7, we have D ⊢ α = γ . By axiom D , we have D ⊢ α γ . The casewhere β is of the form γ is similar. Apply axiom D in place of D . ⊓⊔ Lemma 17.
Let φ ( x ) be an L BT -formula such that D | = φ ( α ) ⇒ D ⊢ φ ( α ) (*) for any α ∈ { , } ∗ . Then we have D | = ( ∀ x (cid:22) α ) φ ( x ) ⇒ D ⊢ ( ∀ x (cid:22) α ) φ ( x ) for any α ∈ { , } ∗ .Proof. We prove the lemma by induction on the length of α , and we considerthe cases α ≡ ε , α ≡ β and α ≡ β .Let α ≡ ε . Assume D | = ( ∀ x (cid:22) e ) φ ( x ). Then we have D | = φ ( e ). By (*), we have D ⊢ φ ( e ). By D , we have D ⊢ ( ∀ x (cid:22) e ) φ ( x ).Let α ≡ β . Assume D | = ( ∀ x (cid:22) β ) φ ( x ). Then we have D | = ( ∀ x (cid:22) β ) φ ( x ) and D | = φ ( β ). By our induction hypothesis we have D ⊢ ( ∀ x (cid:22) β ) φ ( x ). By (*), wehave D ⊢ φ ( β ). By axiom D we have D ⊢ ( ∀ x (cid:22) β ) φ ( x ).The case α ≡ β is similar to the preceding case. Use D in place of D . ⊓⊔ Theorem 18 ( Σ -completeness of D ). For any Σ -sentence φ , we have D | = φ ⇒ D ⊢ φ . Proof.
Given the lemmas above, we can more or less just repeat the proof ofTheorem 13. Use Lemma 15 in place of Lemma 10, Lemma 16 in place of Lemma11 and Lemma 17 in place of Lemma 12. ⊓⊔ F Definition 19.
The first-order theory F contains the following eleven non-logicalaxioms:- the first four axioms are the axioms of B − ∀ x [ e E x ] ∀ x [ x E e → x = e ] ∀ xy [ x E y ↔ x E y ] ∀ xy [ x E y ↔ x E y ] ∀ xy [ x E y ↔ x E y ] ∀ xy [ x E y ↔ x E y ] .11. ∀ x [ x = e ∨ ∃ y [ x = y ∨ x = y .We will use F i to refer to the i th axiom of F . Lemma 20.
Let α, β ∈ { , } ∗ and α E F β (i.e. | α | ≤ | β | ). Then F ⊢ α E β . irst-Order Concatenation Theory with Bounded Quantifiers 11 Proof.
We prove this lemma by induction on the length of α , and we considerthe cases α ≡ ε , α ≡ α ′ and α ≡ α ′ .If α ≡ ε , we have F ⊢ α E β by F . Let α ≡ α ′ . Since | α | ≤ | β | , we have b ∈ { , } and β ′ ∈ { , } ∗ such that β = β ′ b . The induction hypothesis yields F ⊢ α ′ E β ′ . If b = , we have F ⊢ α E β by F . If b = , we have F ⊢ α E β by F . This proves the case α ≡ α ′ . The proof when α ≡ α ′ is similar. Use F and F , respectively, in place of F and F . ⊓⊔ Lemma 21.
Let α, β ∈ { , } ∗ and α E F β (i.e. | α | > | β | ). Then F ⊢ α E β .Proof. We prove this lemma by induction on the length of β , and we considerthe cases β ≡ ε , β ≡ β ′ and β ≡ β ′ .Assume β ≡ ε . Since | α | 6≤ | β | , we have α ′ ∈ { , } ∗ such that α = α ′ or α = α ′ . We can w.l.o.g. say that α = α ′ . By Lemma 6, we have F ⊢ α = e .By F , we have F ⊢ α E β . Assume β ≡ β ′ . Since | α | 6≤ | β | , we have b ∈ { , } and α ′ ∈ { , } ∗ such that α ≡ α ′ b . By our induction hypothesis, we have F ⊢ α ′ E β ′ . If b = , we have F ⊢ α E β by F . If b = , we have F ⊢ α E β by F . The case β ≡ β ′ is symmetric to the case β ≡ β ′ . Use F in place of F ,and use F in place of F . ⊓⊔ It is convenient to introduce some new notation before we state our next lemma:For any α ∈ { , } ∗ , let[ ε . . . α ] = { β | β ∈ { , } ∗ and β E F α } . Lemma 22.
We have F ⊢ ∀ x [ x E α → _ β ∈ [ ε...α ] x = β ] for any α ∈ { , } ∗ .Proof. We prove this lemma by induction on the length of α . The base case is α ≡ ε . The inductive cases are α ≡ γ and α ≡ γ .First we deal with case α ≡ ε . The axiom F says that ∀ x [ x E e → x = e ] . Thus, we have F ⊢ ∀ x [ x E α → _ β ∈ [ ε...α ] x = β ]straightaway as α is e , the set [ ε . . . α ] is the singleton set { ε } and ε is e . We will now turn to the inductive case α ≡ γ . In this case it is sufficient toprove (1) F ⊢ ∀ x [ x = e → ( x E γ → _ β ∈ [ ε...γ ] x = β ) ](2) F ⊢ ∀ xy [ x = y → ( x E γ → _ β ∈ [ ε...γ ] x = β ) ](3) F ⊢ ∀ xy [ x = y → ( x E γ → _ β ∈ [ ε...γ ] x = β ) ] . as it follows from (1), (2), (3) and the axiom F that F ⊢ ∀ x [ x E γ → _ β ∈ [ ε...γ ] x = β ] . Our induction hypothesis yields F ⊢ ∀ x [ x E γ → _ β ∈ [ ε...γ ] x = β ] . (IH)It is trivial that (1) holds. This is a logical truth that holds in any model. Wedo not need any of our non-logical axioms to prove (1). Let us turn to the proofof (2). We reason in an arbitrary model for F . Assume x = y x E γ . Weneed to argue that _ β ∈ [ ε...γ ] x = β ( † )holds in the model. It is obvious that we have y E γ . By F , we have y E γ .By (IH), we have _ β ∈ [ ε...γ ] y = β . Thus, we also have _ β ∈ [ ε...γ ] y β y = β → y β
0. Furthermore, since x = y β ≡ β
0, we have _ β ∈ [ ε...γ ] x = β . ( ‡ )Finally, we observe that ( ‡ ) implies ( † ). This proves (2).The proof of (3) is symmetric to the proof of (2). Use the axiom F in place of F . This completes the proof for the case α ≡ γ . The case α ≡ γ is symmetric.Use the axioms F and F , respectively, in place of F and F . ⊓⊔ irst-Order Concatenation Theory with Bounded Quantifiers 13 Lemma 23.
Let φ ( x ) be an L BT -formula such that F | = φ ( α ) ⇒ F ⊢ φ ( α ) (*) for any α ∈ { , } ∗ . Then we have F | = ( ∀ x E α ) φ ( x ) ⇒ F ⊢ ( ∀ x E α ) φ ( x ) for any α ∈ { , } ∗ .Proof. Assume F | = ( ∀ x E α ) φ ( x ). Then, we have F | = ^ β ∈ [ ε...α ] φ ( β ) . By (*), we have F ⊢ ^ β ∈ [ ε...α ] φ ( β ) . By Lemma 22, we have F ⊢ ( ∀ x E α ) φ ( x ). ⊓⊔ Theorem 24 ( Σ -completeness of F ). For any Σ -sentence φ , we have F | = φ ⇒ F ⊢ φ . Proof.
Given the lemmas above, we can more or less just repeat the proof ofTheorem 13. Use Lemma 20 in place of Lemma 10, Lemma 21 in place of Lemma11 and Lemma 23 in place of Lemma 12. ⊓⊔ Both B and D are open theories (all the axioms are purely universal statements)whereas F is not. The axiom F contains an existential quantifier. Can we finda 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 notneed F to achieve Σ -completeness. Definition 25.
Let F ′ be the first-order theory F where the axiom F is re-placed by the scheme ∀ x [ x E α → _ β ∈ [ ε...α ] x = β ] . (for α ∈ { , } ∗ ) Theorem 26 ( Σ -completeness of F ′ ). For any Σ -sentence φ , we have F | = φ ⇒ F ′ ⊢ φ . Proof.
Proceed as in the proof of Theorem 24. Since the axiom scheme is present, F 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 respectto the structure F . After we have endowed bit theory with bounded quantifiers, it becomes naturalto search for normal forms and see if we can prove normal form theorems similarto the ones we know from number theory.Some lemmas (27, 29, 30 ) in this section can be found elsewhere, e.g., in B¨uchi& Senger [1], Senger [21] and Karhum¨aki et al. [12]. We have given completeproofs below in order to make our paper self-contained (the proofs we give donot differ essentially from those given in B¨uchi & Senger [1]).The next lemma shows that conjunctions of equations can be replaced by oneequation.
Lemma 27.
Let s , s , t , t be L BT -terms. We have B − | = ( s = t ∧ s = t ) ↔ s s s s = t t t t . Proof.
Let α , α , β , β ∈ { , } ∗ . Assume α α α α = β β β β . Then | α α | = | β β | and | α α | = | β α | . The proof splits into the two cases | α | = | β | and | α | 6 = | β | . In the case when | α | = | β | , we obviously have α = β and α = β . Assume | α | 6 = | β | . We can w.l.o.g. assume that | α | < | β | .This implies that = ( α α ) | α | +1 = ( t ) | α | +1 = ( α α ) | α | +1 = . This is a contradiction. This proves the implication from the right to the left.The converse implication is obvious. ⊓⊔ The next lemma shows that disjunctions of equations can be replaced by oneequation at the price of some more existential quantifiers.
Lemma 28.
Let s , s , t , t be L BT -terms. There exist L BT -terms s, t and vari-ables v , . . . , v k such that D | = ( s (cid:22) t ∨ s (cid:22) t ) ↔ ∃ v . . . v k [ s = t ] . Proof.
Let x , . . . , x be variables that do not occur in any of the terms s , s , t , t .It is not very hard to see that the formula s (cid:22) t ∨ s (cid:22) t is D -equivalent tothe formula ∃ x . . . x [ s = x x ∧ t = x x ∧ s = x x ∧ t = x x ∧ ( x = e ∨ x = e ) ] . (*) irst-Order Concatenation Theory with Bounded Quantifiers 15 We will show that the disjunction in (*), that is x = e ∨ x = e , can be replacedby a formula x x = x x ∧ ∃ y . . . y [ v = v ′ ∧ v = v ′ ∧ v = v ′ ]where v , v , v , v ′ , v ′ , v ′ are terms. Thus, by Lemma 27 which allow us to mergeconjunctions of equations, (*) will be equivalent to a formula of the form ∃ x . . . x y . . . y [ s = t ]and our proof will be complete.Let ψ ( u, w ) be the formula ∃ y y y y [ y y = 0 ∧ y y = 1 ∧ uy wy = wy uy ∧ uy wy = wy uy ] . We claim that B − | = ( u = e ∨ w = e ) ↔ ( uw = wu ∧ ψ ( u, w )) . (**)We prove (**). Assume that u = e ∨ w = e (we reason in B − ). Let us say that u = e (the case when w = e is symmetric). It is obvious that we have uw = wu .Moreover, ψ ( u, w ) holds with y = y = e , y = 0 and y = 1. This prove theleft-right implication of (**).To see that the converse implication holds, assume that ¬ ( u = e ∨ w = e ), thatis, 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 bothstrings, or it is that case that 1 is the last bit of both strings. If 0 is the last bitof both, the two equations uy wy = wy uy and y y = 1 cannot be satisfiedsimultaneously. If 1 is the last bit of both, the two equations uy wy = wy uy and y y = 0 cannot be satisfied simultaneously. Hence we conclude that ψ ( u, w )does not hold. This completes the proof of (**).As explained above, our lemma follows from (*) and (**) by Lemma 27. ⊓⊔ Karhum¨aki et al. [12] prove that the next lemma indeed holds with k = 2. Lemma 29.
Let s , s , t , t be L BT -terms. There exist L BT -terms s, t and vari-ables v , . . . , v k such that B − | = ( s = t ∨ s = t ) ↔ ∃ v . . . v k [ s = t ] . Proof.
Observe that s = t ∨ s = t is D -equivalent to( s (cid:22) t ∧ t (cid:22) s ) ∨ ( s (cid:22) t ∧ t (cid:22) s ) which again is (logically) equivalent to( s (cid:22) t ∨ s (cid:22) t ) ∧ ( s (cid:22) t ∨ t (cid:22) s ) ∧ ( t (cid:22) s ∨ s (cid:22) t ) ∧ ( t (cid:22) s ∨ t (cid:22) s ) . By Lemma 27 and Lemma 28, we have terms s, t and variables v . . . v k suchthat D | = ( s = t ∨ s = t ) ↔ ∃ v . . . v k [ s = t ] . Thus, the lemma holds as we are dealing with a L − BT -formula. ⊓⊔ Lemma 30.
Let s , t be L BT -terms. There exist L BT -terms s, t and variables v , . . . , v k such that B − | = s = t ↔ ∃ v . . . v k [ s = t ] . Proof.
Observe that the formula s = t is B − -equivalent to the formula ∃ xyz [ s = t x ∨ s = t x ∨ t = s x ∨ t = s x ∨ ( s = x y ∧ t = x z ) ∨ ( s = x y ∧ t = x z ) ] . Thus, the lemma follows from Lemma 29 and Lemma 27. ⊓⊔ Lemma 31.
Let s , t be L BT -terms. There exist L BT -terms s, t and variables v , . . . , v k such that D | = s t ↔ ∃ v . . . v k [ s = t ] . Proof.
The formula s t is D -equivalent to the formula( ∃ u [ t u = s ] ∧ t = s ) ∨ ∃ xyz [ ( t = x y ∧ s = x z ) ∨ ( t = x y ∧ s = x z ) ] . Thus, the lemma follows from the preceding lemmas. ⊓⊔ Theorem 32 (Normal Form Theorem for D ). Any Σ -formula φ is D -equivalent to a L BT -formula of the form ( Q t v ) . . . ( Q t m m v m ) s = t where t , .., t m are L BT -terms and Q t j j v j ∈ {∃ v j , ∃ v j (cid:22) t j , ∀ v j (cid:22) t j } for j =1 , . . . , m . Moreover, if φ is a purely existential formula, then Q t j j v j is ∃ v j .Proof. We proceed by induction on the structure of the Σ -formula φ (throughoutthe proof we reason in the structure D ). Assume φ ≡ s (cid:22) t . Then φ is equivalentto a formula of the form ∃ x [ sx = t ] and the theorem holds. Assume φ ≡ s t . irst-Order Concatenation Theory with Bounded Quantifiers 17 Then the theorem holds by Lemma 31. Assume φ ≡ s = t . Then the theoremholds 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( Q t x ) . . . ( Q t k k x k ) s = t and ( Q s y ) . . . ( Q s m m y m ) s = t which are equivalent to respectively ψ and ξ . Thus, φ is equivalent to a formula ofthe form ( Q t x ) . . . ( Q t k k x k )( Q s y ) . . . ( Q s m m y m )( s = t ∧ s = t ) . By Lemma27, we have a formula of the desired form which is equivalent to φ . The casewhen φ 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 ofthe forms ( ∃ v ) ψ , ( ∀ v (cid:22) t ) ψ and ( ∃ v (cid:22) t ) ψ .If φ is a purely existential formula, there will be no bounded universal quantifiersamong ( Q t v ) . . . ( Q t m m v m ). Thus, φ is equivalent to a formula of the form ∃ v . . . v k [ s (cid:22) t ∧ . . . ∧ s ℓ (cid:22) t ℓ ∧ s = t ]which again is equivalent to a formula of the form ∃ v . . . v k x . . . x ℓ [ s x = t ∧ . . . ∧ s ℓ x ℓ = t ℓ ∧ s = t ] . By Lemma 27, we can conclude that any purely existential formula is equivalentto a formula of the form ∃ v . . . v m [ s = t ]. ⊓⊔ Theorem 33 (Normal Form Theorem for F ). Any Σ -formula φ is F -equivalentto a L BT -formula of the form ( ∃ v )( Q v E t ) . . . ( Q m v m E t m ) s = t where Q j ∈ {∃ , ∀} for j = 1 , . . . , m . Moreover, if φ is a purely existential for-mula, then φ is equivalent to a formula of the form ∃ v . . . v m [ v E t ∧ . . . ∧ v m E t m ∧ s = t ] . Proof.
We prove the theorem by induction on the structure of the Σ -formula φ (throughout the proof we reason in the structure F ). Assume φ ≡ s E t . Then φ is equivalent to a formula of the form ∃ x E t [ x = s ], and the theorem holds.Assume φ ≡ s E t . Then φ is equivalent to t ◦ E s , and thus also equivalent toa formula of the form ∃ x E s [ x = t ◦ φ ≡ s = t , and the theorem holds triviallywhen φ ≡ s = t .The inductive cases φ ≡ ψ ∧ ξ and φ ≡ ψ ∨ ξ are similar to the correspondingcases in the proof of Theorem 32 (normal form theorem for D ).The cases φ ≡ ( ∃ x ) ψ , φ ≡ ( ∃ x E t ) ψ and φ ≡ ( ∀ x E t ) ψ are are easy to dealwith. A formula of the form – ( ∀ x E t )( ∃ y ) ψ is equivalent to a formula of the form ( ∃ z )( ∀ x E t )( ∃ y E z ) ψ – ( ∃ x E t )( ∃ y ) ψ is equivalent to a formula of the form ( ∃ y )( ∃ x E t ) ψ – ( ∃ x )( ∃ y ) ψ is equivalent to a formula of the form ( ∃ z )( ∃ x E z )( ∃ y E z ) ψ .Thus, any Σ -formula is F -equivalent to a Σ -formula that contains maximum oneunbounded existential quantifier.If φ is a purely existential formula, then Q , . . . , Q m will all be existential quan-tifiers. Thus, it is easy to see that any purely existential formula is equivalent toa formula of the form ∃ v . . . v m [ v E t ∧ . . . ∧ v m E t m ∧ s = t ] . ⊓⊔ It is not true that any purely existential formula is F -equivalent to a formula ofthe form ∃ x . . . x n [ s = t ]. This follows from the results in Karhum¨aki et al. [12].E.g., a formula like x E y ∧ y E x which states that the length of x equals thelength of y , is not F -equivalent to a formula of the form ∃ x . . . x n [ s = t ]. SeeExample 27 in Section 6 of [12]. Lemma 34.
Let s , t be L BT -terms. There exist L BT -terms s, t and variables v , . . . , v k such that B | = s t ↔ ∀ v ⊑ t ∃ v . . . v k [ s = t ] . Proof.
Observe that s t is B -equivalent to ( ∀ v ⊑ t ) α where α is ∃ x [ t x = vs ∧ x = e ] ∨ ∃ xyz [ ( t = x y ∧ vs = x z ) ∨ ( t = x y ∧ vs = x z ) ] . If we let vs (cid:22) t abbreviate ∃ x [ vs x = t ], then α can be written as vs t .Thus, the lemma follows by Lemma 31. ⊓⊔ Theorem 35 (Normal Form Theorem for B ). Any Σ -formula φ is B -equivalent in to a L BT -formula of the form ( ∃ v )( Q v ⊑ t ) . . . ( Q m v m ⊑ t m ) s = t where Q j ∈ {∃ , ∀} for j = 1 , . . . , m .Proof. Proceed by induction on the structure of the Σ -formula φ . This proof issimilar to the proof of Theorem 33 (normal form theorem for F ). If φ is of form s ⊑ t , then φ is B -equivalent a formula of the form ∃ x x [ x sx = t ]. If φ is ofthe form s t , then then Lemma 34 says that φ is B -equivalent to a formulaof the form ∀ v ⊑ t ∃ v . . . v k [ s = t ]. The remaining cases of the inductive proofare similar to their respective cases in the proof of Theorem 33. ⊓⊔ irst-Order Concatenation Theory with Bounded Quantifiers 19 We have not been able to find an interesting normal form for purely existentialformulas which is stronger than the one for Σ -formulas in B . It follows form theresults in Karhum¨aki et al. [12] that the relation x B y cannot be defined in thestructure B − : By Theorem 16 in [12], it is not possible to define the language L = { α | α ∈ { , } ∗ and B α } by a word equation. If we could define x B y in B − , then it would have beenpossible to define L by a word equation. We refer the reader to the paper itselffor 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 theoremfor purely existential formulas in D (Theorem 32), will for sure be false withrespect to B . So will the normal form theorem for purely existential formulas in F (Theorem 33). 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 isdecidable if a sentence of the form ∃ ~x [ s = t ] holds in the standard model. We alsoknow that any purely existential formula is 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 36 ( Σ -Definability of Computable Functions). For any (par-tially) computable function f : N n → N there exists a Σ -formula φ ( x , . . . , x n , y ) such that f ( a , . . . , a n ) = b ⇔ D | = φ ( a , . . . , a n , b ) . 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 ofthis theorem. The theorem implies that it is undecidable if a Σ -sentence holds in D . It is easy to define the relations (cid:22) D and D by Σ -formulas in the structures B and F , and the bounded quantifiers of D can be expressed by Σ -formulas inin B and F , e.g., if D | = φ ⇔ B | = φ ′ then D | = ( ∃ x (cid:22) t ) φ ⇔ B | = ( ∃ xy ⊑ t )[ xy = t ∧ φ ′ ]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 bittheory, 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 itcontains n unbounded existential quantifiers, m bounded existential quantifiersand k bounded universal quantifiers. The fragment Σ A n,m,k is the set of Σ n,m,k -sentences 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 occurrencesof bounded universal quantifiers). A ∆ -formula is a Σ -formula that contain nounbounded existential quantifiers, and the fragment ∆ A is the set of ∆ -sentencesthat are true in the L BT -structure A . Note that ∃ A = [ n,m ∈ N Σ A n,m, and ∆ A = [ m,k ∈ N Σ A ,m,k . The fragments ∆ D , ∆ B and ∆ F are decidable.Proof. We prove that ∆ B is decidable. Let φ be a ∆ -formula. The negation ofa ∆ -formula is logically equivalent to a ∆ -formula (use De Morgan’s laws). Wecan compute a ∆ -formula φ ′ which is logically equivalent to ¬ φ . By Theorem13, we have B ⊢ φ if B | = φ . By the same theorem, we have B ⊢ φ ′ if B | = ¬ φ .The set of formulas derivable from the axioms of B is computably enumerable.Hence it is decidable if φ is true in B .We can prove that the fragments ∆ D and ∆ F are decidable in the same way aswe also have Σ -complete axiomatizations for both D and F . ⊓⊔ In some sense, we kill a fly with a hammer when we use Σ -completeness to provethe 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 -equivalentto a formula of the normal form ∃ v . . . v m [ s = t ]. Our proofs show that there isan algorithm for transforming φ into this normal form. Thus the theorem followsby Makanin’s result (Theorem 2). ⊓⊔ Open Problem:
Is the fragment ∃ B decidable? Open Problem:
Is the fragment ∃ F decidable? In [13] we use the Post’s Correspondence Problem (Post [18]) to prove thatthe fragments Σ D , , , Σ D , , , Σ B , , and Σ B , , are undecidable. We will improve irst-Order Concatenation Theory with Bounded Quantifiers 21 these results considerably in the next section. In this section we introduce anundecidable problem that is especially tailored for our needs in that respect, thatis, an undecidable problem that makes the proofs in next section smooth andtransparent. In lack of a better name, we dub the problem the Modulo Problem .We assume that the reader is familiar with modulo arithmetic and elementarynumber theory. We use f N to denote the N th iteration of an unary function f ,that is, f ( X ) = X and f N +1 ( x ) = f ( f N ( x )). Definition 39.
The Modulo Problem is given by – Instance: a list of pairs h A , B i , . . . , h A M − , B M − i where M > and A i , B i ∈ N (for i = 0 , . . . , M − ). – Solution: a natural number N such that f N (3) = 2 where f ( x ) = A j z + B j if there exists j < M such that x = zM + j . The undecidability of the Modulo Problem follows from the existence of a certaintype of Collatz functions constructed in Kurtz & Simon [14]. We will spend therest of this section to explain why the problem is undecidable.We will work with the counter machines introduced by Minsky [17]. These ma-chines are also known as register machines or Minsky machines. A counter ma-chine consists of – a finite number of registers X , . . . X n – a finite number of instructions I , . . . , I m .The registers store natural numbers. The instructions tell the machine how tomanipulate these numbers. The machine starts by executing the instruction I .Each resister stores 0 when the execution starts (our counter machines do nottake input). The instruction I is the unique halting instruction. This instructiondoes not modify any register, and the machine halts if and only if this instructionis executed. Each of the the remaining instructions I , . . . , I m will either be an increment instruction or a decrement instruction . An increment instruction I i isof the form I i : X j , I k . The instruction tells the machine to increment the naturalnumber 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 themachine to decrement the natural number stored in the register X j by one if thisis possible, that is, if the number is strictly greater than zero. If it is possible todecrement the number, the machine will proceed with instruction I k ; if it is notpossible, the machine will proceed with instruction I ℓ . We assume that we have i = k in any increment instruction and i
6∈ { 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 everyregister 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 , . . . , q s of non-negative rational numbers. The transitionfunction 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 ) asundefined.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 Nf M (3) = 2 iff M terminates with every register set to zero. Let p i denote the i th prime ( p = 2).The execution of a counter machine can be viewed as a sequence of configurations of the form I i , a , a , . . . , a n where I i is the instruction to be executed next and a , a , . . . , a n , respectively,are the numbers stored in the registers X , . . . X n . We represent a configurationby a natural number of the form p i p a m +1 p a m +2 . . . p a n m + n . where i ≤ m . Let f M be a FracTran program q , . . . , 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 , . . . , q s is a minimal sequence that satisfies (1) and (2) (so no sequence oflength s − 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 , . . . , q s such that q t p i p a m +1 . . . p a n m + n is integral. Thus, we have F f M ( p i p a m +1 . . . p a j m + j . . . p a n m + n ) = p k p m + j p i p i p a m +1 . . . p a j m + j . . . p a n m + n = p k p a m +1 . . . p a j +1 m + j . . . p a n m + n . 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 , . . . , q s suchthat rp i p a m +1 . . . p a n 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 F f M ( p i p a m +1 . . . p a j m + j . . . p a n m + n ) = p k p i p m + j p i p a m +1 . . . p a j m + j . . . p a n m + n = p k p a m +1 . . . p a j − m + j . . . p a n m + n . irst-Order Concatenation Theory with Bounded Quantifiers 23 If I i is the decrement instruction I i : X j , I k , I ℓ and X j stores 0, then p ℓ /p i is theonly q t in the sequence that makes q t p i p a m +1 . . . p a n m + n integral, and we have F f M ( p i p a m +1 . . . p a n m + n ) = p ℓ p a m +1 . . . p a n m + n . Any counter machine starts in the configuration I , , , . . . , p , that is, 3. If a counter ma-chine halts with every register set to 0, it halts in the configuration I , , , . . . , p , that is, 2. Given the observa-tions above, it should be obvious that there exists N such that F Nf M (3) = 2 iff M halts with every register set to 0. Thus, we conclude that it is undecidable ifthere exists N such that F Nf M (3) = 2.A Collatz function is a function C : N → N that can be written of the form C ( x ) = a i x + b i if x ≡ i mod M where a i , b i ∈ Q and M ∈ N (for more on Collatz functions and the relatedCollatz problem, see [14]). Following the ideas of Kurtz & Simon [14], we willnow construct a Collatz function C M of the more restricted form C M ( x ) = a i x if x ≡ i mod M .such that we have C M ( x ) = F f M ( x ) whenever F f M ( x ) is defined. We use theFracTran program f M = q , . . . , q s to determine M and a , a , . . . , a M − .For each q i in the FracTran program f M = q , . . . , q s , let c i , d i ∈ 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 multipleof d , . . . , d s and then follow the procedure (I) to determine a , a , . . . , a M − .When the procedure starts every a j is undefined. PROCEDURE (I): for i := 1 , . . . , s dofor j := 0 , . . . , M − a j := a j if a j already is defined q i if a j is not yet defined and d i divides j undefined otherwise.This completes the construction of C M . Many of the rationals a , a , . . . , a M − might still not be defined when the procedure terminates, but that is not impor-tant to us. The following claim is what matters to us: F f M ( x ) = q i x ⇔ C M ( x ) = q i x . (claim)In order to see that our claim holds, assume that F f M ( x ) = q i x . Then, we knowthat q i x ∈ N and that q ℓ x N when ℓ < i . Let x = zM + j where j < M andlet c i /d i = q i where c i and d i are relatively prime. Then, we have q i x = c i d i ( zM + j ) ∈ N . As d i divides M but not c i , it must be the case that d i divides j . A symmetricargument 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 provesthat the left-right implication of the claim holds. It is easy to see that also theright-left implication holds.It follows from the claim that F Nf M (3) = 2 iff C N M (3) = 2. Thus, we concludethat it is undecidable if there exists N such that C N M (3) = 2 (since we alreadyhave concluded that it is undecidable if there exists N such that F Nf M (3) = 2).We are soon ready to conclude that the Modulo Problem is undecidable. Thefunction f in the Modulo Problem is a total function. Now, C M is by no meansa total function, but if C M ( x ) is defined and x = zM + j where j < M , then itturns out that we have A j , B j ∈ N such that C M ( x ) = A j z + B j . To see thatsuch A j and B j exist, observe that C M ( zM + j ) = cd ( zM + j ) ∈ N for some relatively prime natural numbers c and d . Moreover, the algorithm forconstructing 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 h A , B i , . . . h A M − , B M − i of pair of natural numbers: PROCEDURE (II): for j := 0 , . . . , M − A j = cM/d and B j = cj/d if procedure (I) defines a j to equal c/d – set A j = B j = 0 if procedure (I) leaves a j undefined.Now, let f ( x ) = A j z + B j if there exists j < M such that x = zM + j . Then, we obviously have f ( x ) = C M ( x ) whenever C M ( x ) is defined. Thus, as it is undecidable if there exists N such that C N M (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 Problemis undecidable. The stage is now set for our undecidability results. We know that the ModuloProblem is undecidable. Let h A , B i , . . . , h A M − , B M − i be an instance of theproblem, and let f ( x ) = A j z + B j 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 a +1 a +1 . . . a N +1 (*)where irst-Order Concatenation Theory with Bounded Quantifiers 25 – a = 3 and a N = 2 – for each i ∈ { , . . . , N − } 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 usingas few quantifiers as possible. We will of course need one unbounded existentialquantifier to claim the existence of x . Then we will need some quantifiers to statethat x is of the desired form. In the structure D , we will state that any prefix of x of the form y can be extended to a prefix of x of the form y
01 111 . . . | {z } kM copies . . . | {z } j copies
01 111 . . . | {z } kA j copies . . . | {z } B j copies (**)for some j and k . Recall that j , M , A j , B j are fixed natural numbers. Thus, foreach j ∈ { , . . . , M − } , we can express that x has a prefix of the form (**) bya formula ∃ z [ ψ j ( x, y, z )] where ψ j ( x, y, z ) ≡ z z ∧ y zz . . . zz | {z } M . . . | {z } j zz . . . zz | {z } A j . . . | {z } B j (cid:22) x . In addition we have to state that x should start with and end with . This explains why the formula( ∃ x ) h (cid:22) x ∧ ( ∀ y (cid:22) x ) (cid:2) y x ∨ y x ∨ ( ∃ z )[ M − _ j =0 ψ j ( x, y, z ) ] (cid:3) i claims the existence of a bit string of the form (*). The formula contains twounbounded existential quantifiers and one bounded universal quantifier. If wecould decide if such a formula is true in D , then we could decide the ModuloProblem. Hence, Σ D , , is an undecidable fragment.Similar reasoning will show that the fragments Σ B , , and Σ F , , are undecidable.The details can be found below. Theorem 40.
The fragments Σ D , , , Σ B , , and Σ F , , are undecidable.Proof. For any L BT -term t let [ t ] ≡ e and let [ t ] n +1 ≡ t ◦ [ t ] n . Furthermore,note that the word equation x = x is satisfied iff x ∈ { } ∗ .Let h A , B i , . . . , h A M − , B M − i be an instance of the Modulo Problem.First we prove that Σ D , , is undecidable. For i ∈ { , . . . , M − } , let ψ j ( x, y, z ) ≡ z z ∧ y z ] M [1] j z ] A j [1] B j (cid:22) x . and let φ be the Σ , , -formula( ∃ x ) h (cid:22) x ∧ ( ∀ y (cid:22) x ) (cid:2) y x ∨ y x ∨ ( ∃ z )[ M − _ j =0 ψ j ( x, y, z ) ] (cid:3) i Then D | = φ if and only if the instance has a solution. Obviously, there is analgorithm for constructing φ when the instance is given, and thus no algorithmcan decide if a Σ , , -sentence is true in D , that is, the fragment Σ D , , is unde-cidable.Next we prove that Σ B , , is undecidable. For j ∈ { , . . . , M − } , let ξ j ( y, x ) bethe formula (cid:16) y y ∧ y ] M [1] j ⊑ x ∧ [ y ] M [1] j = [1] (cid:17) → y ] M [1] j y ] A j [1] B j ⊑ x . Note that ξ j ( y, x ) is trivially equivalent to a Σ , , -formula ˆ ξ j ( y, x ). Let φ ′ bethe Σ , , -formula( ∃ x ) h ⊑ x ∧ ( ∀ y ⊑ x )[ M − _ j =0 ˆ ξ j ( y, x ) ] i . Then B | = φ ′ if and only if the instance has a solution. There is an algorithmfor constructing φ ′ from the instance, and thus we conclude that Σ B , , is unde-cidable.We are left to prove that Σ F , , is undecidable. The following formula does tojob:( ∃ x ) h ( ∃ v E x )[ 01[1] v = x ] ∧ ( ∀ uv E x ) (cid:2) u v = x ∨ u x ∨ ( ∃ zy E x )[ M − _ j =0 η j ( z, u, y, x ) ] (cid:3) i where η j ( z, u, y, x ) ≡ z z ∧ u z ] M [1] j z ] A j [1] B j y = x for j ∈ { , . . . , M − } . ⊓⊔ Corollary 41. (i) It is undecidable whether a sentence of the form ( ∃ x )( ∀ y (cid:22) x )( ∃ x ) . . . ( ∃ x n ) s = t irst-Order Concatenation Theory with Bounded Quantifiers 27 is true in D . (ii) It is undecidable whether a sentence of the form ( ∃ x )( ∀ y y ⊑ x )( ∃ x ) . . . ( ∃ x n ) s = t is true in B . (iii) It is undecidable whether a sentence of the form ( ∃ x )( ∀ y y E x )( ∃ x ) . . . ( ∃ x n ) s = t is true in F .Proof. Consider the Σ , , -sentence φ if the proof of the preceding theorem. ByTheorem 32, φ is D -equivalent to sentence of the form( ∃ x )( ∀ y (cid:22) x )( ∃ x ) . . . ( ∃ x n ) s = t . This proves that (i) holds. Furthermore, we have D | = ( ∃ x )( ∀ y (cid:22) x )( ∃ x ) . . . ( ∃ x n ) s = t if and only if B | = ( ∃ x )( ∀ y y ⊑ x )( ∃ x ) . . . ( ∃ x n )[ y ◦ y = x ∨ s = t ]if and only if F | = ( ∃ x )( ∀ y y E x )( ∃ x ) . . . ( ∃ x n )[ y ◦ y = x ∨ s = t ] . Thus, (ii) and (iii) hold by Lemma 29 and Lemma 30. ⊓⊔ References
1. B¨uchi, J. R. and Senger, S.:
Coding in the existential theory of concatenation.
Archiv f¨ur mathematische Logik und Grundlagenforschung (1986/7), 101-106.2. Corcoran, J., Frank, W. and Maloney, M.: String theory.
The Journal of SymbolicLogic (1974), 625-637.3. Day, J., Ganesh, V., He, P., Manea, F. and Nowotka, D.: The satisfiability ofextended word equations: The boundary between decidability and undecidability. arXiv:1802.00523 (2018).4. Ganesh, V., Minnes, M., Solar-Lezama, A. and Rinard, M. C.:
Word equationswith length constraints: Whats decidable?
In: Biere A., Nahir A., Vos T. (eds),Hardware and Software: Verification and Testing. HVC 2012. LNCS 7857, pp.209226. Springer, Berlin, Heidelberg.5. Grzegorczyk, A.:
Undecidability without arithmetization.
Studia Logica (2005),163-230.6. Grzegorczyk, A. and Zdanowski, K.: Undecidability and concatenation.
In: Ehren-feucht et al. (eds), Andrzej Mostowski and Foundational Studies, pp. 72-91, IOS,Amsterdam, 2008.7. Hajek, P. and Pudlak, P.:
Metamathematics of first-order arithmetic.
Perspectivesin Mathematical Logic. Springer-Verlag, Berlin, 1993.8 Lars Kristiansen and Juvenal Murwanashyaka8. Halfon, S., Schnoebelen, P. and Zetzsche G:
Decidability, complexity, and ex-pressiveness of first-order logic over the subword ordering.
In: 2017 32nd AnnualACM/IEEE Symposium on Logic in Computer Science (LICS),
DOI: 10.1109/LICS40289.2017
9. Hermes, H.:
Semiotik. Eine Theorie der Zeichengestalten als Grundlage f¨ur Un-tersuchungen von formalisierten Sprachen.
Vol. 5 of “Forschungen zur Logik undzur Grundlegung der exakten Wissenschaften”, Neue Folge, S. Hirzel, Leipzig,1938.10. Higuchi, K. and Horihata, Y.:
Weak theories of concatenation and minimal essen-tially undecidable theories.
Archive for Mathematical Logic (2014), 835-85311. Horihata, Y.: Weak theories of concatenation and arithmetic.
Notre Dame Journalof Formal Logic (2012), 203-222.12. Karhum¨aki, J., Mignosi, F. and Plandowski, W.: The expressibility of languagesand relations by word equations.
Journal of the ACM (2000), 483-505.13. Kristiansen, L. and Murwanashyaka, J.: Decidable and undecidable fragments offirst-order concatenation theory.
In: Florin Manea, Russel G. Miller and DirkNowokta (eds), CiE 2018 – Sailing Routes in the World of Computation, LNCS10936, pp. 244-253, Springer-Verlag 2018.14. Kurtz S.A. and Simon J.:
The undecidability of the generalized Collatz problem.
In: Cai JY., Cooper S.B., Zhu H. (eds), TAMC 2007 – Theory and Applicationsof Models of Computation, LNCS 4484, pp. 542-553, Springer, Berlin, Heidelberg,2007.15. Leary, C. and Kristiansen, L.:
A friendly introduction to mathematical logic.
The problem of solvability of equations in a free semigroup.
Math-ematics of the USSR-Sbornik (1977), 129-198.17. Minsky, M. L.: Recursive unsolvability of Post’s problem of ”tag” and other topicsin theory of Turing machines.
Annals of Mathematics (1961), 437-455.18. Post, E. L.: A variant of a recursively unsolvable problem.
Bulletin of the AmericanMathematical Society (1946), 264-268.19. Quine, W. V.: Concatenation as a basis for arithmetic.
Journal of Symbolic Logic (1946), 105-114.20. Quine, W. V.: Review of Hermes [9]. Journal of Symbolic Logic (1939), 87-88.21. Senger, S.: The existential theory of concatenation over a finite alphabet.
PhDdissertation, Purdue University, 1982).22. Svejdar, V.:
On interpretability in the theory of concatenation.
Notre Dame Journalof Formal Logic (2009), 87-95.23. Tarski, A.: Der Wahrheitsbegriff in den formalisierten Sprachen.
Studia Philo-sophica (1935), 261-405.24. Visser, A.: Growing commas. A study of sequentiality and concatenation.
NotreDame Journal of Formal Logic50