Degrees of bi-embeddable categoricity of equivalence structures

We study the algorithmic complexity of embeddings between bi-embeddable equivalence structures. We define the notions of computable bi-embeddable categoricity, (relative) $\Delta^0_\alpha$ bi-embeddable categoricity, and degrees of bi-embeddable categoricity. These notions mirror the classical notions used to study the complexity of isomorphisms between structures. We show that the notions of $\Delta^0_\alpha$ bi-embeddable categoricity and relative $\Delta^0_\alpha$ bi-embeddable categoricity coincide for equivalence structures for $\alpha=1,2,3$. We also prove that computable equivalence structures have degree of bi-embeddable categoricity $\mathbf{0},\mathbf{0}'$, or $\mathbf{0}''$. We obtain results on index sets of computable equivalence structure with respect to bi-embeddability.


Introduction
The systematic study of the complexity of isomorphisms between computable copies of structures was initiated in the 1950's by Fröhlich and Shepherdson [FS56] and independently by Maltsev [Mal62].The notions of computable categoricity (in the Russian tradition also called autostability) and relative computable categoricity are probably the most prominent in this line of research.A computable structure A is computably categorical if for every computable copy B there is a computable isomorphism from B to A. A structure A is relatively computably categorical if for every copy B of A there is a deg(A ⊕ B)-computable isomorphism from B to A. For a survey of this topic see Fokina, Harizanov, and Melnikov [FHM14].
In this article we study the algorithmic complexity of embeddings between biembeddable equivalence structures.The relation of bi-embeddability has attracted a lot of attention of specialists in computable structure theory and descriptive set theory in the recent years.Two structures A and B are bi-embeddable if there is an embedding of A in B and vice versa.In the literature A and B are sometimes called equimorphic [Mon05;Mon07;GM08].Montalbán [Mon05] showed that any hyperarithmetic linear ordering is bi-embeddable with a computable one and together with Greenberg [GM08] they showed the same for hyperarithmetic Boolean algebras, trees, compact metric spaces, and Abelian p-groups.Fokina, Rossegger, and San Mauro [FRS17] studied degree spectra with respect to the bi-embeddability relation and noticed that any countable equivalence structure is bi-embeddable with a computable one.For this reason, the study of the algorithmic complexity of embeddings is particularly interesting for this class of structures.
2010 Mathematics Subject Classification.03C57.The first author was supported by RFBR, according to the research project No. 16-31-60058 mol_a_dk.The second, third and fourth author were supported by the Austrian Science Fund FWF through project P 27527.
In this paper we focus on computability-theoretic properties of equivalence structures.An equivalence structure A = (A, E) has a computable subset A of the natural numbers as its universe and is equipped with an equivalence relation E on A. We identify such a structure A with its atomic diagram, which is the set of atomic formulas and negations of atomic formulas with parameters from A that are true of A under a fixed Gödel numbering.Our computability theoretic notions are standard and as in Soare [Soa16].
Calvert, Cenzer, Harizanov, and Morozov [Cal+06] initiated the study of computable categoricity for equivalence structures.Given a structure A and a structure B bi-embeddable with A, we say that B is a bi-embeddable copy of A. We study the complexity of embeddings through the following notions analogous to computable categoricity and relative computable categoricity.
• A computable structure A is d-computably bi-embeddably categorical if any computable bi-embeddable copy of A is bi-embeddable with A by dcomputable embeddings.Here d is a Turing degree.For the case d = 0 (n) , we usually use the term "∆ 0 n+1 bi-embeddably categorical" instead.• A countable (not necessarily computable) structure A is relatively ∆ 0 n biembeddably categorical if for any bi-embeddable copy B, A and B are biembeddable by ∆ A⊕B n embeddings.A computable structure is relatively computably bi-embeddably categorical if n = 1.The definitions can be extended to arbitrary hyperarithmetic α in the usual way.In this paper we only focus on the cases of n = 0, 1, 2. Fokina, Kalimullin, and R. Miller [FKM10] introduced the notion of a (strong) degree of categoricity of a structure.Given a computable structure A that is dcomputably categorical in the classical sense, the degree of categoricity of A is the least degree that computes an isomorphism between any two computable isomorphic copies of A. It is the strong degree of categoricity of A if there are two computable copies A 0 and A 1 such that for any f : A 0 ∼ = A 1 , f ≥ T d.Note that A might not have a (strong) degree of categoricity [Mil09;FFK16].A Turing degree d is a (strong) degree of categoricity if there exists a structure having d as its (strong) degree of categoricity.This notion has seen a lot of interest over the last years.Fokina, Kalimullin, and R. Miller [FKM10] showed that all strong degrees of categoricity are hyperarithmetical.Csima, Franklin, and Shore [CFS13] extended this result by showing that all degrees of categoricity are hyperarithmetical.R. Miller [Mil09] exhibited a field that does not have a degree of categoricity, and Fokina, Frolov, and Kalimullin [FFK16] gave an example of a rigid structure without degree of categoricity.Recently, Csima and Stephenson [CS17], and independently, Bazhenov, Kalimullin, and Yamaleev [BKY16; BKY17] found examples of structures that have degree of categoricity but no strong degree of categoricity.The question whether there exists a degree of categoricity that is not strong is still open.We give an analogous definition for bi-embeddability.Csima and Ng [unpublished] showed that a computable equivalence structure has strong degree of categoricity 0, 0 ′ , or 0 ′′ .Our main result reflects theirs in our setting.
Theorem 1.1.Let A be a computable equivalence structure.
(1) If A has bounded character and finitely many infinite equivalence classes, then its degree of bi-embeddable categoricity is 0.
(2) If A has unbounded character and finitely many infinite equivalence classes, then its degree of bi-embeddable categoricity is 0 ′ .(3) If A has infinitely many infinite equivalence classes, then its degree of biembeddable categoricity is 0 ′′ .Thus, the degree of bi-embeddable categoricity of equivalence structures is either 0, 0 ′ , or 0 ′′ .Furthermore, the degrees of bi-embeddable categoricity of equivalence structures are strong.
The proof of Theorem 1.1 combines various theorems proved in Sections 2 and 3.In these sections we also obtain results on the relation between classical notions of categoricity and bi-embeddable categoricity, summarized in Fig. 1.

Relations between categoricity for computable equivalence structures
In Section 2 we characterize the computably bi-embeddably categorical equivalence structures.In Section 3 we study ∆ 0 2 and ∆ 0 3 bi-embeddably categorical and relatively ∆ 0 2 and ∆ 0 3 bi-embeddably categorical equivalence structure.We show that all equivalence structures are relatively ∆ 0 3 categorical.We prove (2) and (3) of Theorem 1.1 and study the relations between those notions summarized in Fig. 1.
In Section 4 we obtain results on the complexity of the index sets of equivalence structures with degrees of bi-embeddable categoricity 0, 0 ′ , and 0 ′′ .

Computable bi-embeddable categoricity
Given an equivalence structure A and a ∈ A we write [a] A for the equivalence class of a; if it is clear from the context which structure is meant, we omit the superscript.The following notions are central to our analysis.
Proposition 2.1.Let A be an equivalence structure, then there is a transversal T of A such that T ≤ T A.
Proof.For each equivalence class, we choose the least element in the class.We can do this computably in (the atomic diagram of) A.
(1) We say that A has bounded character, or simply is bounded, if there is some finite k such that all finite equivalence classes of A have size at most k.If A has bound k on the sizes of its finite equivalence classes, we say that A is k-bounded.(2) We will use the following relativization of [Cal+06, Lemma 2.2].
Lemma 2.2.Let A be an equivalence structure, then

and
2 definition.Our first goal is to characterize computably bi-embeddably categorical equivalence structures.In [Cal+06] the following characterization of computably categorical equivalence structures was given.
Theorem 2.3 (Calvert, Cenzer, Harizanov, and Morozov) an enumeration of the transversal of the equivalence classes of size l in B and let (a i ) i∈ω be a computable enumeration of A. We can define a computable embedding ν : A ֒→ B by recursion as follows.
The embedding of B in A is defined similarly.
(⇒).We show that computable equivalence structures with unbounded character and without infinite equivalence classes are not computably bi-embeddably categorical.The proof for equivalence structures with finitely many infinite equivalence classes is analogous.By Corollary 3.4 below, equivalence structures with infinitely many infinite equivalence classes are not even ∆ 0 2 bi-embeddably categorical.Note that any two equivalence structures with unbounded character and the same number of infinite equivalence classes are bi-embeddable and that any embedding needs to map elements to elements in equivalence classes of at least the same size.Consider the equivalence structure A with universe i∈ω { i, n : n ≤ i} where all elements with the same left column are in the same equivalence class.This structure is clearly a computable equivalence structure with computable size function | • |.We build a computable equivalence structure B = (ω, E B ) in stages such that no partial computable function is an embedding of B in A. We want to satisfy the following requirements.
P e : ϕ e is not an embedding of B in A We say that a requirement P e needs attention at stage s if the restriction of the approximation ϕ e,s of ϕ e to elements in the structure B s is a partial embedding of B in A not equal to ∅.The structure B is the limit of the structures B s constructed as follows.Construction: Stage s = 0: B 0 is the singleton 0, 0 .Stage s + 1: Check if there is a requirement P e , e ≤ s that needs attention.If such P e exists, do the following.Choose the least requirement P e that needs attention.Then ϕ e,s ( s, 0 ) ↓= i, n for some i, n .Let B s+1 = B s ∪ { s, s + j : 0 ≤ j ≤ s} ∪ { s + 1, 0 }; put all elements with s in the left column in the equivalence class of s, 0 , and let s + 1, 0 be a singleton.
If no P e needs attention set B s+1 = B s ∪ { s + 1, 0 } and let s + 1, 0 be a singleton.

Verification:
Assume towards a contradiction that ϕ e is an embedding of B in A and no ϕ j , j < e is an embedding.Then there is a stage s such that ϕ e,s is a partial embedding of B s in A and no P j , j < e, needs attention.Thus, P e receives attention at stage s + 1 and ϕ e,s ( s, 0 ) ↓; say ϕ e,s ( s, 0 ) = i, n .Then, by construction, the equivalence class of s, 0 in B s+1 is bigger than the one of i, s .Thus, ϕ e can not be an embedding.However, by construction of B, every equivalence class is grown only once and has the size of an equivalence in A plus one.Thus, B is unbounded without infinite equivalence classes and hence, is bi-embeddable with A.
The following corollaries follow directly from Theorem 2.3 and Theorem 2.4.

Corollary 2.5. There is a computably bi-embeddably categorical equivalence structure that is not computably categorical.
Corollary 2.6.There is a computably categorical equivalence structure that is not computably bi-embeddably categorical.
Calvert, Cenzer, Harizanov, and Morozov [Cal+06] showed that a computable equivalence structure is computably categorical if and only if it is relatively computably categorical.The analogous result holds in the context of bi-embeddability.

Proposition 2.7. Let A be a computable equivalence structure. Then A is computably bi-embeddably categorical if and only if it is relatively computably bi-embeddably categorical.
Proof.Relativization of the proof of Theorem 2.4 ensures the result.

∆ 0
2 and ∆ 0 3 bi-embeddable categoricity In this section we characterize ∆ 0 2 and ∆ 0 3 bi-embeddably categorical equivalence structures.We will show that a computable equivalence structure is ∆ 0 2 (∆ 0 3 ) bi-embeddably categorical if and only if it relatively so.We will also see that all equivalence structures are relatively ∆ 0 3 bi-embeddably categorical.This, together with the fact that any countable equivalence structure is bi-embeddable with a computable one [FRS17] gives a complete structural characterization of bi-embeddable categoricity for equivalence structures.We also establish the remaining parts of Theorem 1.1.At first we characterize ∆ 0 2 bi-embeddably categorical equivalence structures.We start by exhibiting a class of equivalence structures that is relatively ∆ 0 2 bi-embeddably categorical.Theorem 3.1.If A has finitely many infinite equivalence classes, then A is relatively ∆ 0 2 bi-embeddably categorical.Proof.By Theorem 2.4 and Proposition 2.7 equivalence structures with bounded character are relatively computably bi-embeddably categorical and thus relatively ∆ 0 2 bi-embeddably categorical.It remains to show that equivalence structures with unbounded character and finitely many infinite equivalence classes are relatively ∆ 0 2 bi-embeddably categorical.
Let A have finitely many infinite equivalence classes and unbounded character, and let B be a bi-embeddable copy of A. Note that B must have the same number of infinite equivalence classes as A. Fix transversals T A and T B of Inf A and Inf B , respectively.Let f : T A → T B be a bijection.As T A and T B are finite sets, they are computable.We define a ∆ A⊕B 2 embedding ν : A ֒→ B by recursion.Let (a i ) i∈ω be a computable enumeration of A.
Assume ν has been defined for a 0 , . . .a s .We define ν(a s+1 ); there are three cases.Case 1: a s+1 is equivalent to an element for which ν has already been defined, i.e., ∃j ≤ s a s+1 ∈ [a j ] A .Then Case 2: a s+1 is not equivalent to any element for which ν has been defined and its equivalence class is infinite, i.e., ∃t ∈ T Case 3: a s+1 is not equivalent to any element for which ν has been defined and its equivalence class is finite.Then As A and B are both unbounded, at any stage s of the construction we can find an element in B with an equivalence class greater than or equal to the one of a s in A. Therefore, ν is an embedding.As T A , T B , and f are computable and comparing the size of two equivalence classes is ∆ A⊕B The following is the relativization of the classical computability theoretic concepts of immune and simple sets to 0 ′ .

Theorem 3.2. There is a computable equivalence structure A with infinitely many infinite equivalence classes such that
Proof.We build A with universe ω such that F in A is 0 ′ -simple, i.e., for every infinite Σ 2 set S the intersection of F in A and S is nonempty.It has to satisfy the following requirements.
Our strategy to satisfy a requirement P e is to pick a witness x e for W ∅ ′ e and prevent the equivalence class of x e from growing any further.
We will construct A in stages.Elements and equivalence classes can be in one of three states.An element is blocked by P e if it is equivalent to a witness picked by P e .During the construction we also designate unblocked elements for expansion, i.e., we allow the equivalence class of such elements to grow in a later stage.Elements which are neither designated nor blocked are fresh, these elements have equivalence classes of size 1.The set W ∅ ′ e,s is the Σ 2 approximation of W ∅ ′ e at stage s and the set F in A s is the set of blocked elements at stage s; we will have that (1) Choose the least e < s such that P e needs attention.Take the least x > e 3 satisfying the second part of the matrix in Eq. (⋆).Check if x ≤ s.If so, then take the element y, e 3 < y ≤ s which has been in the approximation the longest without interruption and declare its equivalence class as blocked by P e .If not, then declare the equivalence class of x as blocked by P e .If P e receives attention for the first time, designate the least fresh element.
(2) Add to all designated equivalence classes a fresh element bigger than s.
(3) Check if for any e < s there is an element x blocked by P e that is not blocked by any P j , j < s, and x ∈ W ∅ ′ e,s−1 but x ∈ W ∅ ′ e,s .If so, declare the equivalence class of x as designated.Verification: It is clear from the construction that A = lim s A s is a computable equivalence structure.The following two claims establish that it has the desired properties.
Proof.By construction, no requirement P e injures a requirement P j , j = e, so it is sufficient to consider them in isolation.As W ∅ ′ e,s is a Σ 2 approximation we have that x ∈ W ∅ ′ e iff there is a stage s 0 such that for all t > s 0 , x ∈ W ∅ ′ e,t .In particular, there is a stage after which an element x 0 ∈ W ∅ ′ e , x 0 > e 3 will be in the approximation longer than any element y ∈ W ∅ ′ e .This element will be chosen by our strategy the next time that P e receives attention (which it will if its current witness is not in W ∅ ′ e ).Hence, P e is satisfied in the limit.Claim 3.2.2.The requirement G is satisfied.
Proof.Assume that P e is the maximum requirement that acted at some stage in the construction.At most e equivalence classes are blocked at this stage and because at every stage every designated equivalence class grows by one element, at most e 2 out of e 3 elements are blocked.By the same reasoning at most e 2 elements are designated for expansion.Hence, at least e 3 − 2e 2 fresh elements are left to expand the equivalence classes of designated elements and so, for e > 2 there are enough fresh elements smaller than e 3 left to expand the designated elements.As every requirement that receives attention for the first time designates one fresh element, in the limit there are infinitely many infinite equivalence classes.
It is immediate that two equivalence structures A and B with infinitely many infinite equivalence classes are bi-embeddable.To obtain an embedding of A in B just map all equivalence classes of A to infinite equivalence classes of B. Proposition 3.3.If an equivalence structure A has infinitely many infinite equivalence classes, then it is not ∆ 0 2 bi-embeddably categorical.Proof.Let A be a computable equivalence structure with infinitely many infinite equivalence classes and no finite equivalence classes, and take B as in Theorem 3.2.Then, by the above argument, they are bi-embeddable and every embedding of A in B has as range an infinite subset of Inf B .Now, assume that ν : A ֒→ B is 0 ′ -computable.Then, its range is a Σ 0 2 set and an infinite subset of Inf B .But Inf B is 0 ′ -immune, a contradiction.Hence, no embedding of A in B is 0 ′ -computable and therefore A is not ∆ 0 2 bi-embeddably categorical.The analogue of Corollary 3.7 does not hold for isomorphisms.Kach and Turetsky [KT09] gave an example of a ∆ 0 2 categorical but not relatively ∆ 0 2 categorical equivalence structure.Downey, Melnikov, and Ng [DMN15] showed that an equivalence structure A is ∆ 0 2 categorical iff the structure containing only one equivalence class of A for each finite size and all its infinite equivalence classes is ∆ 0 2 -computably categorical.

Corollary 3.4. An equivalence structure
We now proceed with the study of possible degrees of categoricity for equivalence structures.

Definition 3.2. A function f is limitwise monotonic if there is a computable approximation function h
It is not hard to see that for any limitwise monotonic function f , f ≤ T 0 ′ .For more on limitwise monotonic functions and their applications see Downey, Kach, and Turetsky [DKT11].
Theorem 3.8.The degree of bi-embeddable categoricity of computable equivalence structures with unbounded character and finitely many infinite equivalence classes is 0 ′ .Proof.First notice that there are countably many bi-embeddability types of equivalence structures with unbounded character and finitely many infinite equivalence classes.Namely exactly one for each number of equivalence classes of infinite size.We prove the theorem for equivalence structures with no infinite equivalence classes.However, the argument can be easily modified to accomodate equivalence structures with finitely many infinite equivalence classes.
We define the following function.
Clearly f is limitwise monotonic and dominates every partial computable function.By the domination theorem (see [Soa16, Theorem 4.5.4]) it holds that for any set D such that f ≤ T D, D ≥ T 0 ′ ; hence, in particular, f ≡ T 0 ′ .
We build a computable equivalence structure A f with universe ω and no infinite equivalence classes in stages such that Let h f be the computable approximation for f .At stage 0 of the construction, let the universe of the approximation A f be ω and put 0, n in the equivalence class of 0, 0 for n < h f (0, 0).At stage s + 1 check if for any x, 0 x ≤ s, |[ x, 0 ]| < h f (x, s + 1).If so, add x, s + 1 to the equivalence class.Now consider the equivalence structure A with universe i∈ω { i, n : n ≤ i} and where all elements with the same left column are in the same equivalence class.This structure is clearly a computable equivalence structure bi-embeddable with A f and computable size function by the domination theorem.As by Corollary 3.4 every computable equivalence structure with finitely many infinite equivalence classes is ∆ 0 2 bi-embeddably categorical the theorem follows.
Theorem 3.9.Equivalence structures are relatively ∆ 0 3 bi-embeddably categorical.Proof.By Theorem 3.1, equivalence structures with finitely many infinite equivalence classes are relatively ∆ 0 2 bi-embeddably categorical.Thus, it suffices to show that equivalence structures with infinitely many infinite classes are relatively ∆ 0 3 biembeddably categorical.Let A and B be equivalence structures with infinitely many infinite classes.Recall that any two such equivalence structures are bi-embeddable.There is an embedding of A in B that maps every equivalence class in A to an infinite equivalence class in B. As Inf B is Π B 2 there is at least one such embedding which is ∆ A⊕B

3
. By the same argument there is a ∆ A⊕B 3 embedding of B in A.
The analogous result about classical relative ∆ 0 3 categoricity of equivalence structures is also true [Cal+06], as every equivalence structure has a Σ c 3 Scott family.We close by proving the remaining parts of Theorem 1.1.
Theorem 3.10.The degree of bi-embeddable categoricity of computable equivalence structures with infinitely many infinite equivalence classes is 0 ′′ .Proof.We first build a computable equivalence structure A with the property that any infinite partial transversal of Inf A computes 0 ′′ .Let (σ i ) i∈ω be a computable 1 − 1 enumeration of 2 <ω and associate to every σ i an infinite set of witnesses { i, x, y : x, y ∈ ω}.Elements of the form i, x, 0 will serve as witnesses while all other elements will be used to grow the equivalence classes.We will build A using a Π 2 approximation to ∅ ′′ .Let ∅ ′′ s be the Π 2 approximation at stage s of our construction.Construction: Stage s=0: Let A = ω and E A = {(x, x) : x ∈ ω}.Furthermore, for all strings σ i in our computable enumeration of 2 <ω designate witnesses i, 0, 0 .stage s+1: Assume we have built A s .
(1) For all witnesses with left column i < s + 1 check if for some x with σ i (x) = 0, x ∈ ∅ ′′ s+1 .If i, j, 0 is a witness for such σ i , discard it (never touch its equivalence class again during the construction) and designate the witness i, s + 1, 0 .
Verification: We have to show that any infinite partial transversal of Inf A computes 0 ′′ .The following claim establishes the crucial part.
As we have a Π 2 approximation to ∅ ′′ there is a stage s such that no x < |σ i |, x ∈ ∅ ′′ enters ∅ ′′ t at any stage t > s.Hence, by construction there is a j < s such that i, j, 0 has infinite equivalence class.
Assume, for some x, τ (x) = 0 and σ i (x) = 1.Then there are only finitely many stages t such that x ∈ ∅ ′′ t .Thus, by construction, no equivalence class of elements with i in the left column can become infinite.Therefore, if τ (x) = 0, then σ i (x) = 0 as well.Now assume that τ (x) = 1 and σ i (x) = 0. Then there are infinitely many stages s such that x ∈ ∅ ′′ s .Hence, by construction, there can not be finite j such that |[ i, j, 0 ]| = ω because for any j if i, j, 0 is designated at step s there is a step t > s such that x ∈ ∅ ′′ t .Let t 0 be the least such step, then i, j + 1, 0 will be designated at step t 0 and no new elements will be added to the equivalence class of [ i, j, 0 ] at any stage t ≥ t 0 .Thus [ i, j, 0 ] is finite, τ (x) = 1 ⇒ σ i (x) = 1 and hence τ = σ.
Consider an infinite partial transversal T of Inf A .To check whether some fixed x ∈ 0 ′′ , consider an enumeration of T .As all elements in T code an initial segment of ∅ ′′ in their left column there is a finite stage t and y, z, such that i, y, z ∈ T t and |σ i | ≥ x.Hence, x ∈ 0 ′′ ⇔ σ i (x) = 0 and we can find σ i uniformly.Therefore, T ≥ T 0 ′′ .Now consider the structure B with universe ω and where ∀x∀n x, n ∈ [ x, 0 ] B .It is a computable equivalence structure consisting only of infinite equivalence classes and it clearly embeds into A. To compute 0 ′′ from any embedding ν : B ֒→ A look at the strings coded by the left column of the images of elements of the form x, 0 .By the above argument, after enumerating a finite number of images of such elements we can decide whether x ∈ 0 ′′ , hence ν ≥ T 0 ′′ .Since, by Theorem 3.9, any equivalence structure is relatively ∆ 0 3 bi-embeddably categorical the theorem follows.
At last we put together the pieces that prove Theorem 1.1.
Proof of Theorem 1.1.(1) follows directly from Theorem 2.4.Theorem 3.8 proves that 0 ′ is the degree of bi-embeddable categoricity of equivalence structures with unbounded character and finitely many infinite equivalence classes.The two equivalence structures A f and A constructed in the proof witness that 0 ′ is a strong degree of bi-embeddable categoricity for equivalence structures with unbounded character and no infinite equivalence classes.Similar structures can be easily constructed for equivalence structures with any finite number of infinite classes.This proves (2).Theorem 3.10 shows that 0 ′′ is the degree of bi-embeddable categoricity of equivalence structures with infinitely many infinite classes.To see that it is a strong degree of bi-embeddable categoricity, consider the structures A and B constructed in the proof.Any embedding ν : B ֒→ A computes 0 ′′ , hence, for any µ : A ֒→ B, µ ⊕ ν ≥ T 0 ′′ .

Index sets
Let (C e ) e∈ω be an enumeration of the partial computable equivalence structures, i.e., given a computable function ϕ e : ω × ω → {0, 1}, C e has universe ω and Note that it is Π 0 1 to check whether C e is indeed an equivalence structure.We say that a set is D 0 n if it is the difference of two Σ n sets, or equivalently, the intersection of a Σ 0 n and a Π 0 n set.We make the following assumptions without loss of generality.
(1) Let P be a Π 0 n set, n > 1, and S a Σ 0 n−1 set such that p ∈ P ⇔ ∃s s, p ∈ S, then the witness s is unique.
(2) Let S be a Σ 0 n set, n > 1, and P a Π 0 n−1 set such that s ∈ S ⇔ ∀p p, s ∈ S, then p, s ∈ S ⇒ p + 1, s ∈ S, i.e., the left columns form initial segments of ω.We start by recalling a simple observation.To see that the index set is D 0 1 -hard, we define a computable function g such that C g(e,i) ≈ A if and only if e ∈ ∅ ′ and i ∈ ∅ ′ .Fix an element a of A. Let B be a computable equivalence structure isomorphic to A \ [a] A ; say |[a] A | = n.We build a computable function f and a structure E f (e,i) disjoint from B in stages such that C g(e,i) = B ⊕ E f (e,i) .

Let ∅ ′
s , E f (e,i),s be the approximations to ∅ ′ and E f (e,i) , respectively, at stage s.Let E f (e,i),0 = ∅ and assume we have defined E f (e,i),s .To define E f (e,i),s+1 check if (i) e ց ∅ ′ s and (ii) i ց ∅ ′ s .The structure E f (e,i),s+1 extends E f (e,i),s as follows.If (i), add a new equivalence class of size n to E f (e,i),s+1 by using the elements 2(s + j) for j ∈ 1, . . ., n.If (ii), add a new equivalence class of size n + 1 by using the elements 2(s + j) + 1 for j ∈ 1, . . .n + 1.
Let E f (e,i) = lim s E f (e,i),s .It is now easy to see that C g(e,i) = B ⊕ E f (e,i) is bi-embeddable with A (in this case even isomorphic) if e ∈ ∅ ′ and i ∈ ∅ ′ .
Ad (2).Assume n is the maximal size such that A has infinitely many equivalence classes of size n.Let A >n be the substructure of A restricted to classes bigger than n.Then A >n is finite.The index set is definable by the following Π 0 2 formula.
To see that it is hard, consider the Π 0 2 complete set Inf = {e : W e is infinite}.We will build a computable function g such that C g(e) ≈ A ⇔ e ∈ Inf.Fix a computable equivalence structure B isomorphic to A >n .Our desired structure C g(e) will be the disjoint union of B with the structure E f (e) , where f is a computable function constructed as follows.Let W e,s be the computable approximation to W e after s stages of our construction; we make the standard assumption that x ∈ W e,s ⇒ x < s.Assume we have defined E f (e),s and are at stage s + 1 of the construction.The structure E f (e),s+1 extends E f (e),s by a new equivalence class of size n for every x ց W e,s , i.e., if x ց W e,s let x, s , . . ., x, s + n ∈ E f (e),s+1 and set them to be equivalent.This finishes the construction; let E f (e) = lim s E f (e),s .
By construction E f (e) has only equivalence classes of size n and it has infinitely many of those if and only if W e is infinite.As B ∼ = A >n , we have that Thus the index set is Π 0 2 complete.Ad (3).To see that it is in Π 0 2 one has to consider two cases.Either the finite part of A is as in (1) or as in (2).In any case, let k be the bound.If we are in case (1), let m be the number of elements in the finite part of A. If we are in case (2), let m be the number of elements in the finite part of A restricted to equivalence classes bigger than n, where n is as above.
If we are in case (1) we can define the index set by where θ A f in is the formula obtained from the atomic diagram of the finite part of A by replacing the constants by variables and Θ A f in is the disjunction over θ A f in (x 1 , . . ., x m ) permuting over all variables.Let the formula in Eq. ( * ) be ϕ A .
If we are in case (2) the defining formula is where ϕ ′ A>n is as above with the slight difference that the second and third universal quantifiers now range over all x where n < [x] ≤ k instead of only [x] ≤ k.The two formulas are easily seen to be Π 0 2 .For the hardness consider the Π 0 2 complete set Inf = {e : W e is infinite} and fix a computable structure B without infinite equivalence classes isomorphic to the finite part of A. We build a computable function g such that where f is again a computable function.We proof the hardness for the case that A has one infinite equivalence class, the case for r > 1 is similar.The construction of E f (e) is in stages, at stage 0 the universe of E f (e),0 is empty.Assume we have defined E f (e),s and are at stage s + 1 of the construction.
For any x < s such that x ց W e,s , add x, s + 1 to E f (e),s+1 and make it equivalent to all elements already in E f (e),s .It is easy to see that the structure E f (e) = lim s E f (e),s has an infinite equivalence class if and only if e ∈ Inf and thus C g(e) ≈ A if and only if e ∈ Inf.
Theorem 4.3.Let A be an equivalence structure with degree of categoricity 0 ′ .Then the following holds.
(1) If A has no infinite equivalence classes, then the index set {C e : C e ≈ A} is Π 0 3 -complete.(2) If A has 0 < k < ω infinite equivalence classes, then the index set {C e : C e ≈ A} is D 0 3 -complete.Proof.Assume that A has 0 < k < ω infinite equivalence classes.Then the index set is definable by The part of the formula defining the finite equivalence classes is Π 0 3 and the part defining the infinite equivalence classes is Σ 0 3 .Thus, the formula is D 0 3 .If A has no infinite equivalence classes then the part of the defining formula defining the infinite classes becomes ∀x x ∈ F in Ce , a Π 0 3 formula.Hence, in this case the formula is Π 0 3 .To show the completeness of (2) we will define a computable function f such that for every Π 0 3 set P and every Σ 0 3 set S C f (p,e) ≈ A ⇔ p ∈ P ∧ e ∈ S.
There is a Π 0 2 set Q such that for all e e ∈ S ⇔ ∃x x, e ∈ Q.
Then, as Inf = {e : W e is infinite} is Π 0 2 complete we have that there is a computable set T such that x, e ∈ Q ⇔ {t : x, e, t ∈ T } is infinite.for x < s if x ց W e,s .If so declare x, s + i for i ∈ 0, . . ., x to be equivalent.This finishes the construction.Let C f (e) = lim s C f (e),s .It follows directly from the construction that C f (e) has bounded character if and only if W e is finite.This completes the proof.
To proof that Theorem 4.5 is Σ 0 4 hard we use the function that we construct in the proof of Theorem 4.6.We thus first state and prove this theorem.Recall that any two equivalence structures with infinitely many infinite equivalence classes are biembeddable.Furthermore, by Theorem 3.10, equivalence structures with infinitely many infinite classes have degree of bi-embeddable categoricity 0 ′′ .Theorem 4.6.The index set {e : C e has degree of b.e.categoricity 0 ′′ } is Π 0 4complete.
Proof.By Theorem 3.10 the index set of the equivalence structures having degree of bi-embeddability categoricity 0 ′′ is the same as the index set {e : C e has infinitely many infinite equivalence classes}.This index set is clearly Π 0 4 .To see that it is complete consider a Π 0 4 set P , then there is a computable set S such that e ∈ P ⇔ ∀x∃y∀u∃v x, y, u, v, e ∈ S.
We now build a computable function f such that C f (e) has infinitely many infinite equivalence classes.⇔ e ∈ P The construction is in stages; the universe of C f (e),0 is ω and E C f (e),0 = {(x, x) : x ∈ ω}.Assume we have defined C f (e),s and are at stage s + 1 of the construction.The structure C f (e),s+1 extends C f (e),s as follows.For each x, y, u, v ≤ s + 1 such that x, y, u, v, e ∈ S, set x, y, 0, 0 E C f (e),s+1 x, y, u, v .Then proceed to the next stage.
The desired structure C f (e) is the structure in the limit of the construction.If e ∈ P , then C f (e) has infinitely many infinite equivalence classes as for every x there is a y such that { u, v : x, y, u, v, e ∈ S} is infinite and by construction the elements having the same first and second column are in the same equivalence class.Assume e ∈ P , then there exists an x 0 such that for no y 0 the above set is infinite; so no equivalence class of elements with x 0 in the left column will be infinite.Then by our assumption the same holds for all x > x 0 .Hence, C f (e) has only finitely many infinite equivalence classes.where T Inf Ce is a Π 0 2 transversal of Inf Ce .For the hardness we use the strategy used in the proof of Theorem 4.6.There, given a Π 0 4 set P , we define a computable function f such that C f (e) has degree of b.e.categoricity 0 ′′ ⇔ e ∈ P.This proves that the index set is Σ 0 4 hard.

Lemma 4. 1 .
For computably bi-embeddably categorical equivalence structures A we have that B ≈ A if and only if (1) B has the same number of infinite equivalence classes as A, (2) B has the same bound as A, (3) and if A has infinitely many equivalence classes of size n and for all k > n there are only finitely many equivalence classes of size k, then for m ≥ n, B has the same number of equivalence classes of size m as A. Theorem 4.2.Let A be a computable, computably bi-embeddably categorical equivalence structure.(1) If A is finite then the index set {C e : C e ≈ A} is D 0 1 -complete.(2) If A has infinitely many equivalence classes of size n for some n < ω, and no infinite equivalence classes, then the index set {C e: C e ≈ A} is Π 0 2 -complete.(3) If A has r > 0 infinite equivalence classes, then the index set {C e : C e ≈ A} is Π 0 2 -complete.Proof.Ad (1).Assume A isfinite, say |A| = m.Let θ A be the formula obtained from the atomic diagram by replacing the constants from A by variables.Then the index set is definable by the following D 0 1 formula.C e ≈ A ⇔ C e ∼ = A ⇔ ∃x 1 , . . .x m (θ A (x 1 , . . ., x m ))∧∀x 1 , . . .x m+1 ( 1≤i<j≤m+1 x i = x j ).
Clearly, P is Σ 0 4 and using the same function we have that C f (e) has degree of b.e.categoricity 0 or 0 ′ ⇔ e ∈ P since if e ∈ P , f produces an equivalence structure with finitely many infinite equivalence classes.Notice that C f (e) need not have unbounded character and thus might have degree of categoricity 0. Therefore, define a computable unbounded equivalence structure B and a function g such thatC g(e) = C f (e) ⊕ B.The function g is clearly computable and C g(e) has degree of b.e.categoricity 0 ′ ⇔ e ∈ P .

. Let A be a computable equivalence structure, then A is computably categorical if and only
Let A be k-bounded and let l be the size of the largest equivalence class such that A has infinitely many equivalence classes of size l (notice that l might be 0).Then the restriction A >l of A to equivalence classes of size larger than l is computably categorical, as the number of equivalence classes in A >l is finite, i.e., the bi-embeddability type and the isomorphism type of A >l coincide.Hence, if B is a bi-embeddable copy of A, then B >l is isomorphic to A >l .Non-uniformly fix a computable isomorphism f : A >l → B >l .Let T A >l be a transversal of A >l , and T B >l one of B >l .Clearly both T A >l and T B >l are finite and hence computable.Furthermore the equivalence classes of size l have a c.e. transversal as