25
Digital Object Identifier (DOI): 10.1007/s001530100083 Arch. Math. Logic 40, 489–513 (2001) Mathematical Logic Frank Stephan On one-sided versus two-sided classification Received: 2 December 1999 / Revised version: 28 February 2000 / Published online: 15 June 2001 – © Springer-Verlag 2001 Abstract. One-sided classifiers are computable devices which read the characteristic func- tion of a set and output a sequence of guesses which converges to 1 iff the set on the input belongs to the given class. Such a classifier is two-sided if the sequence of its output in ad- dition converges to 0 on sets not belonging to the class. The present work obtains the below mentioned results for one-sided classes (= 0 2 classes) with respect to four areas: Turing complexity, 1-reductions, index sets and measure. There are one-sided classes which are not two-sided. This can have two reasons: (1) the class has only high Turing complexity. Then there are some oracles which allow to construct noncomputable two-sided classifiers. (2) The class is difficult because of some topological constraints and then there are also no nonrecursive two-sided classifiers. For case (1), several results are obtained to localize the Turing complexity of certain types of one-sided classes. The concepts of 1-reduction, 1-completeness and simple sets is transferred to one-sided classes: There are 1-complete classes and simple classes, but no class is at the same time 1-complete and simple. The one-sided classes have a natural numbering. Most of the common index sets relative to this numbering have the high complexity 1 1 : the index set of the class {0, 1} , the index set of the equality problem and the index set of all two-sided classes. On the other side the index set of the empty class has complexity 0 2 ; 0 2 and 0 2 are the least complexities any nontrivial index set can have. Lusin showed that any one-sided class is measurable. Concerning the effectiveness of this measure, it is shown that a one-sided class has recursive measure 0 if it has measure 0, but that there are one-sided classes having measure 1 without having measure 1 effectively. The measure of a two-sided class can be computed in the limit. 1. Introduction Classification means to identify whether an object is contained in a class or not, these objects are in the present work subsets of the natural numbers. Classification is a concept common to two fields: (a) In recursion theory, classes can be defined via formulas describing whether a set belongs to a class or not. (b) In inductive inference, classification is just a natural generalization of a learning-process. The learner does not any longer infer a program for a set but decides only whether a set belongs to a class or not. F. Stephan: Mathematisches Institut der Universit¨ at Heidelberg, Im Neuenheimer Feld 294, 69120 Heidelberg, Germany. e-mail: [email protected]. Supported by the Deutsche Forschungsgemeinschaft (DFG) grant Am 60/9-1. Mathematics Subject Classification (2000): 03D28, 03D30, 68T05

On one-sided versus two-sided classification

Embed Size (px)

Citation preview

Digital Object Identifier (DOI):10.1007/s001530100083

Arch. Math. Logic 40, 489–513 (2001) Mathematical Logic

Frank Stephan

On one-sided versus two-sided classification

Received: 2 December 1999 / Revised version: 28 February 2000 /Published online: 15 June 2001 – © Springer-Verlag 2001

Abstract. One-sided classifiers are computable devices which read the characteristic func-tion of a set and output a sequence of guesses which converges to 1 iff the set on the inputbelongs to the given class. Such a classifier is two-sided if the sequence of its output in ad-dition converges to 0 on sets not belonging to the class. The present work obtains the belowmentioned results for one-sided classes (= �0

2 classes) with respect to four areas: Turingcomplexity, 1-reductions, index sets and measure.

There are one-sided classes which are not two-sided. This can have two reasons: (1) theclass has only high Turing complexity. Then there are some oracles which allow to constructnoncomputable two-sided classifiers. (2) The class is difficult because of some topologicalconstraints and then there are also no nonrecursive two-sided classifiers. For case (1), severalresults are obtained to localize the Turing complexity of certain types of one-sided classes.

The concepts of 1-reduction, 1-completeness and simple sets is transferred to one-sidedclasses: There are 1-complete classes and simple classes, but no class is at the same time1-complete and simple.

The one-sided classes have a natural numbering. Most of the common index sets relativeto this numbering have the high complexity �1

1: the index set of the class {0, 1}∞, the indexset of the equality problem and the index set of all two-sided classes. On the other side theindex set of the empty class has complexity �0

2; �02 and �0

2 are the least complexities anynontrivial index set can have.

Lusin showed that any one-sided class is measurable. Concerning the effectiveness ofthis measure, it is shown that a one-sided class has recursive measure 0 if it has measure 0,but that there are one-sided classes having measure 1 without having measure 1 effectively.The measure of a two-sided class can be computed in the limit.

1. Introduction

Classification means to identify whether an object is contained in a class or not,these objects are in the present work subsets of the natural numbers. Classificationis a concept common to two fields: (a) In recursion theory, classes can be definedvia formulas describing whether a set belongs to a class or not. (b) In inductiveinference, classification is just a natural generalization of a learning-process. Thelearner does not any longer infer a program for a set but decides only whether a setbelongs to a class or not.

F. Stephan: Mathematisches Institut der Universitat Heidelberg, Im Neuenheimer Feld 294,69120 Heidelberg, Germany. e-mail: [email protected].

Supported by the Deutsche Forschungsgemeinschaft (DFG) grant Am 60/9-1.

Mathematics Subject Classification (2000): 03D28, 03D30, 68T05

490 F. Stephan

Here, two basic forms of classification are investigated. In the more restrictivesetting of two-sided classification, the classifier converges to 1 on the data frommembers of the class and to 0 on the data from nonmembers of the class. In themore general setting of one-sided classification, the classifier converges on datafrom members of the class and diverges on data from nonmembers. These notionscoincide with the basic recursion-theoretic concepts of �0

2 and �02 classes, respec-

tively. These definitions reflect a similarity to the world of computable (�01) and

enumerable (�01) sets. So there are many parallel definitions and phenomena, which

are also investigated in the present work. This similarity has also its limitations, forexample, there exists an infinite one-sided class not having an infinite two-sidedsubclass. This is due to the fact that besides the computational aspects known fromthe theory of sets, the theory of classes has also to deal with an aspects of a secondtype: many results are influenced by topological properties of the classes. Anotherexample for this influence is that it is impossible to turn every one-sided class intoa two-sided one with help of an oracle: For example, the class of all finite sets is in�0

2 but not in �02 since it is not the intersection of topologically open classes [23,

Theorem 15.IX].For recursion theorists, picking �0

2 and �02 classes seems to be arbitrary and

random, looking at �03 versus �0

3 classes could also be interesting. But from theviewpoint of learning theory, the �0

2 and �02 classes fit well into the until now

studied concepts; choosing them has therefore some kind of naturalness.Wiehagen and Smith [29] introduced a model, in which a finite number of

classes is given and the classifier has to detect at least one class where the languageto be classified belongs to. As in many other definitions in the field of inductiveinference [2,9], the process has only to converge in the limit and so the machine hasthe right to withdraw hypotheses and to replace them by new ones. Wiehagen andSmith [29] expected the process only to converge on the domain, so they avoidedthe topological problems which arize when the classifier has also to signal that alanguage does not belong to any class of the given collection.

Ben-David [1] and Kelly [10] started to investigate these topological aspects ofclassification: they showed that a (not necessarily computable) device can classifyall sets with respect to one class in the limit iff the given class is the union of count-ably many closed classes and the intersection of countably many open classes at thesame time; for this definition they use the Baire topology generated by the subbasisAx,y = {A : A(x) = y} (x ∈ lN, y ∈ {0, 1}). So their work is a direct motiva-tion for the notion of two-sided classification since their model is just equivalentto relativized two-sided classification. Gasarch, Pleszkoch and Velauthapillai [7,8]extended the result by establishing a close relation between the topological Borelhierarchy and the quantifier-hierarchy of query-languages during classification.

Minicozzi [16] introduced the notion of reliable inference: In this notion, givendata of an arbitrary function f , the learner either converges to a correct programfor f or diverges. This concept motivates one-sided classification since the learnerconverges exactly on the functions belonging to the class learned.

A further and early approach to classification was to design finite automatawhich decide in the limit whether an infinite string (representing the character-

On one-sided versus two-sided classification 491

istic function of a language) belongs to a given ω-language or not [3,14,17,28].The restrictive computational ability of these finite automata led Buchi [3] and hissuccessors to consider nondeterministic automata. The present approach takes thealternative way of choosing Turing machines as classifiers. In fact, already Buchiand Landweber [4,12] did some first research into this direction. As already men-tioned, Ben-David and Kelly have shown that a class is classifiable in the limit iffit is a (relativized) �0

2 class; Rogers [23] called the �02 classes also �

(s)2 classes.

Reliable inference [16] can be generalized to the concept of one-sided learningclasses since the learner signals membership by converging for the sets in the classand nonmembership by divergence. This is equivalent to the notion of �0

2 classes

or �(s)2 classes as Rogers [23] called them. That is, a machine H is a classifier for a

class A iff H accepts every set in A by converging to 1 and rejects every set out-side A by either diverging (one-sided classification) or converging to 0 (two-sidedclassification); the formal definition follows.

Definition 1.1. H is a one-sided classifier for A iff

(∀A ∈ A) (∀∞σ � A) [H(σ) = 1]

and (∀A /∈ A) (∃∞σ � A) [H(σ) = 0];M is a two-sided classifier for A iff

(∀A ∈ A) (∀∞σ � A) [M(σ) = 1]

and (∀A /∈ A) (∀∞σ � A) [M(σ) = 0].

The relations between these two natural concepts of classification is the centraltopic of the present work. For each n, the concepts of �0

n sets relate to that of the�0

n almost in the same way as that of the enumerable (= �01) sets to that of the

computable (= �01) sets. This work shows that on the one hand for one-sided versus

two-sided classes this analogy basically also holds but that on the other hand thesimilarities are much more restricted than the parallel definitions suggest at the firstglance.

Example 1.2. The notions of effective topology follow the definitions as stated byKo [11, p. 72, p. 165] and Rogers [23, §15.1]: A classA is recursively open iff thereis a recursive sequence σ0, σ1, . . . of strings such that A ∈ A ⇔ (∃n) [σn � A]. Aclass A is a recursively Gδ class iff there is a recursive array σm,n of strings suchthat A ∈ A ⇔ (∃m) (∀n) [σm,n �� A].

Any recursively open class is two-sided and any recursively Gδ class is one-sided. There are recursively Gδ classes which are one-sided but not two-sided. Anexample for such a class is the class of all finite sets.

One important tool in recursion theory is that there is an acceptable numberingof all enumerable sets. Similarly there is an acceptable numbering of all one-sidedclasses given by total one-sided classifiers.

Fact 1.3. There is an effective list H0, H1, . . . of one-sided classifiers such thatevery one-sided class is generated by such a classifier and every machine He is to-tal. The so defined numbering of the one-sided classes is acceptable: every further

492 F. Stephan

effective numbering G0,G1, . . . can be represented via a computable function f asHf (e) = Ge.

This effective list of classifiers He is generated from an acceptable numberingϕe of all partial computable functions which of course contains all classifiers. Theformal definition is

He(σ) ={

ϕe(τ ) for the longest τ � σ such thatϕe(τ ) outputs 0 or 1 within |σ | steps;

0 if there is no such τ.

It is easy to verify that whenever ϕe is a one-sided classifier for A, then so is He;and whenever ϕe is a two-sided classifier for A, then so is He.

At many places this list He of one-sided classifiers will be quite useful; in par-ticular it is much more handy to use the He in diagonalizations than the ϕe since theHe are always total and {0, 1}-valued. He denotes the one-sided class generatedby He.

In the case of sets, the relations between �n and �n sets are — for n > 1 —practically the same as those between enumerable and recursive sets. In the case ofclasses, many but not all analogies from the world of enumerable versus recursivesets carry over. The result that �0

n and �0n classes are closed under union and inter-

section, that �0n classes are closed under all Boolean operations and that a class is

�0n iff the class and its complement is �0

n all carry over [23, Chapter 15]. But thestatement that “every infinite enumerable set contains an infinite recursive subset”causes trouble in the world of classes. It is still true for the lowest level: everyinfinite �0

1 class contains an infinite �01 class. On the next level, it does not longer

hold. The next theorem shows that there is an infinite one-sided (= �02) class which

does not contain an infinite two-sided (= �02) class. Nevertheless one can still save

the result, if “infinite” is replaced by the stronger requirement “uncountable”.

Theorem 1.4. Every uncountable one-sided class has a two-sided subclass ofsame cardinality. There is a one-sided infinite class which has no two-sided infinitesubclass.

Proof. For the first statement, consider any uncountable one-sided class A and letH be its one-sided classifier. A is the ascending union of the �0

1 classes

Ak = {A ∈ A : (∀n ≥ k) [H(A(0)A(1) . . . A(n)) = 1] }

and some Ak is not countable since A is not countable. This class Ak has then thecardinality of the continuum {0, 1}∞. The same holds for the superclass A. Sinceevery �0

1 class is in �02, A has the two-sided subclass Ak of the same cardinality.

The second statement is proven by constructing an infinite sequence a0, a1, . . .

which is computable relative to K such that the class A of all An with An ={a0, a1, . . . , an} is one-sided but does not have an infinite two-sided subclass. Thesequence starts with a0 = 0 and one defines

an+1 = 1 + max{b : (∃e < n) [ϕe(a0, a1, . . . , an)↓= b]}.

On one-sided versus two-sided classification 493

The sequence is obviously computable relative to K , so there is a uniformly recur-sive approximation an,0, an,1, . . . to the an. Now let

H(σa) ={

1 if a = 0 and there exists an nwith

σ(x)↓= 1 ⇔ x ∈ {a0,|σ |, a1,|σ |, . . . , an,|σ |};0 otherwise.

H outputs infinitely often a 0 on every infinite set, so H accepts only finite sets andit is easy to verify that any of these finite sets has to be the set An = {a0, a1, . . . , an}for some n. So H is a one-sided classifier for A.

Assume now by contradiction that M is a two-sided classifier for some infinitesubclass of A. Now there is a partial recursive function ϕe such that for each finiteset D = {b0, b1, . . . , bn} the value ϕe(b0, b1, . . . , bn) is the first x > max(D) suchthat M(D(0)D(1) . . . D(x)) = 1 provided that this x exists. If M converges on An

to 1 and n > e then ϕe(a0, a1, . . . , an) exists and is properly below an+1. So M out-puts a 1 between an and an+1 on the characteristic function of An which up to thatplace also equals to the characteristic function of the infinite set A = {a0, a1, . . .}.It follows that M outputs on A infinitely many 1s if M converges on infinitelymany An to 1. So either M outputs on A infinitely many 1s or M converges only onfinitely many An to 1. Therefore a two-sided classifier either accepts the set A /∈ Aor accepts only a finite subclass of A. ��

2. Classification and Turing complexity

Post [21] asked whether there are enumerable sets which have neither the Turingdegree 0 nor 0′. The work to solve this and similar problems initiated a large study ofthe Turing degrees of enumerable sets. Soare [27] gives a comprehensive overviewon this work.

The analogous question for one-sided classes is to determine the amount ofcomplexity which is necessary to compute a two-sided classifier for them. Thestraightforward implementation of this idea would be to identify each class withthe easiest two-sided classifier for it — but such two-sided classifiers sometimesdo not exist and if they exist, there may be no one of least complexity.

Therefore classes are (in general) not related to a single Turing degree but to acollection of Turing degrees. This collection is called the Turing complexity of aclass and consists of all oracles which allow to compute a two-sided classifier forthe given class.

The one-sided classes are ordered in terms of their Turing complexity: So Ahas Turing complexity below that of B iff a two-sided classifier for A can becomputed relative to every two-sided classifier for B considered as an oracle. Withrespect to this ordering, there are one-sided classes of least and greatest Turingcomplexity. Furthermore, among those of intermediate Turing complexity, thereare some classes whose Turing complexity can be identified with a single Turingdegree: Such a class has Turing degree a iff the Turing-degrees of the two-sidedclassifiers just form a cone above a:

{degT (M) : M is a two-sided classifier for A} = {b : a ≤ b}.

494 F. Stephan

So there are four types of one-sided classes with respect to their Turingcomplexity.

• A two-sided class has the least possible Turing complexity since it is two-sidedrelative to every oracle. ∅ and {0, 1}∞ are examples of two-sided classes. Everytwo-sided class has a Turing degree, namely the degree 0 of the computablesets.

• There are one-sided classes which are not two-sided relative to any oracle. Sothey have the greatest possible Turing complexity: Example 2.6 gives threesuch one-sided classes.

• There is a one-sided class which has a nonrecursive Turing degree.• There is a one-sided class which is two-sided relative to some oracles but which

does not have a Turing degree.

The next results deal with the classes of intermediate Turing complexity accordingto the third and fourth case. Sacks [24, Section II.4] called a set A a �0

2 singletoniff A is the only set B which satisfies (∀x) (∃y) [R(x, y, B)] for some recursivepredicate R. Such �0

2 singletons allow to construct a one-sided class A which hasa nonrecursive Turing degree.

Example 2.1. The cosingle class A = {B : B �= A} has a Turing degree whichis exactly that of A. Furthermore, A is one-sided iff A is a �0

2 singleton. So everyhyperarithmetic set is below the Turing degree of some one-sided class.

Proof. Assume that M classifies two-sided A. Then there is a finite string σ � A

such that M(τ) = 0 for all τ with σ � τ � A. The binary tree

T = {τ : (∀η � τ) [η � σ ∨ M(η) = 0]}

is recursive in M and A is its only recursive branch. Therefore M ≥T A. On theother hand, an A-oracle is obviously sufficient for two-sided classification sincethis means only to compare with A.

The second statement follows directly from the definition: The class A is one-sided iff it is �0

2 iff its complement is �02; since this complement contains exactly

the set A, it is a �02 singleton iff it is �0

2.The third statment follows from the fact that the hyperarithmetic sets are just

the Turing closure downward of the �02 singletons [24, Section II.4]. ��

The single one-sided classes {A} are less complex than the cosingle ones: they arealready two-sided without oracle and so have least Turing complexity. Some of thecocountable classes, which are a natural generalization of the cosingle classes, donot have a Turing degree, but they all are two-sided relative to some hyperarithmet-ic oracle. Example 2.2 gives an example of a class which does not have a Turingdegree and whose Turing complexity is just the collection of all high Turing de-grees. There are also cocountable examples with the same property. But for havinga better readable proof, the easiest example is chosen.

Example 2.2. There is a one-sided class A whose Turing complexity is thecollection of all high Turing degrees. A does not have a Turing degree.

On one-sided versus two-sided classification 495

Proof. Let A = {{e} : e ∈ K ′}. The Limit-Lemma states that K ′ has a {0, 1}-valued approximation a(e, s) such that a(e, s) is almost everywhere 1 iff e ∈ K ′.Now A is one-sided via a classifier H which outputs a(e, s) for the input 0e10s

and 0 otherwise.It is easy to see that for two-sided classifiers only the behaviour on sets with

exactly one element e is interesting. A two-sided classifier converges on these sets{e} to 1 iff e ∈ K ′ and to 0 iff e /∈ K ′. So such a classifier exists in a Turing degreea iff K ′ is computable relative to a′, that is, iff a is high.

The second statement of the theorem follows from the fact that the high Turingdegrees do not form a cone. ��The next three theorems establish further results for classes of intermediate Turingcomplexity.

Theorem 2.3. If a one-sided class is two-sided relative to some oracle, then it istwo-sided relative to an oracle in �1

2.

Proof. Let H be a computable one-sided classifier for C. Assume furthermorethat C is two-sided relative to some oracle. Now any, not necessarily recursive,two-sided classifier M satisfies the following �1

1 equation:

(∀A) [( (∃∞σ � A) [H(σ) = 0] ⇒ (∀∞σ � A) [M(σ) = 0] ) ∧( (∀∞σ � A) [H(σ) = 1] ⇒ (∀∞σ � A) [M(σ) = 1] ) ]

It states that for all A, whenever H accepts or rejects A one-sidedly, so does M

two-sidedly. It follows that M is a solution to the predicate iff M is a two-sidedclassifier for C. So M is specified via a �1

1 predicate. Provided that this predicatehas at least one solution, Addison and Kondo [24, Corollary 9.4] showed that thereis a further �1

1 predicate (∀A) [P(M, A)] which has exactly one solution and whosesolution N is also a solution to the original predicate. The sets {σ : N(σ) = c} arein �1

2 for c = 0, 1:

N(σ) = c ⇔ (∃M) (∀A) [M(σ) = c ∧ P(M, A)].

Since one set is the complement of the other, it follows that the machine N is in�1

2. ��Theorem 2.4. Let H be a one-sided classifier for A and for any A /∈ A let fA(m)

denote the first k > m such that H(A(0)A(1) . . . A(k)) = 0. Then A has a two-sided classifier of degree a iff there is a function g of degree a which dominates thefunctions fA for all A /∈ A.

Proof. Assume that g dominates the functions fA for all A /∈ A. The followingM ≤T g is a two-sided classifier for A:

M(A(0)A(1) . . . A(n)) ={

1 if g(m) < n for all m ≤ n

with H(A(0)A(1) . . . A(m)) = 0;0 otherwise.

If A ∈ A then there are only finitely many m with H(A(0)A(1) . . . A(m)) = 0. Al-most all n are greater than g(m) for each such m and thus M(A(0)A(1) . . . A(n)) =

496 F. Stephan

1 for almost all n. Otherwise A /∈ A and g dominates fA. So for almost all m thereis a k with m < k ≤ g(m) and H(A(0)A(1) . . . A(k)) = 0. So for almost alln, the greatest m ≤ n with H(A(0)A(1) . . . A(m)) = 0 satisfies the conditionm ≤ n ≤ g(m) and it follows that M(A(0)A(1) . . . A(n)) = 0 for these n. So M

is a two-sided classifier for A.For the converse direction, let M ≤T E be a two-sided classifier for A. The

following function g is computable relative to E:

g(n) = 2 + max{|σ | : σ ∈ Tn} where

Tn = {σ : (∀τ � σ) [ |τ | ≤ n ∨ (M(τ) = 0 ∧ H(τ) = 1) ] }.

Assume that g would be undefined for some n. Then Tn is infinite and by Konig’sLemma the tree Tn has an infinite branch A. M converges on A to 0 while H

outputs on input A only finitely many 0s, that is, M and H classify A differentlyin contradiction to the choice of M and H . So Tn is finite and g is total. Since Tn

is computable relative to E, its maximal string can be found using the oracle E

and g ≤T E.Let A /∈ A. There is an n such that M(A(0)A(1) . . . A(m)) = 0 for all m ≥ n.

Assume now by way of contradiction that fA(m) > g(m) for some m ≥ n. ThenM(σ) = 0 and H(σ) = 1 for all σ � A with m < |σ | ≤ g(m) and the stringA(0)A(1) . . . A(g(m)) is in Tm in contradiction to g(m) being greater than thelength of all strings in Tm. Thus such an m does not exist and fA(m) ≤ g(m) foralmost all m. ��A consequence of this is that every one-sided class, which is two-sided relative toa hyperimmune-free oracle, is already two-sided via a classifier without any accessto oracles.

Theorem 2.5. If A has a Turing degree then A has a hyperarithmetic Turingdegree.

Proof. Assume that A has Turing degree a and let M be a two-sided classifierfor A of degree a. Theorem 2.4 implies that a ≤ b whenever every a-recursivefunction is dominated by a b-recursive function. There is a function f0 dominatingevery function computable relative to a such that whenever g majorizes f0 thenM ≤T g. First it has to be shown that this can be done via a single index, that is,

(∃e, f ) (∀g majorizing f ) [M = ϕge ]

and in a second step it is deduced that M has hyperarithmetic Turing degree. Theexistence of such e and f is shown via an algorithm which either provides the in-formation to find e and f or which constructs a g majorizing f0 such that M �≤T g.In this proof σ0, σ1, . . . denote strings of numbers and not of bits. σ0 is the emptystring.

Given σn and fn check whether there is an fn+1 majorizing fn and anextension σn+1 � σn such that

• σn ≺ σn+1 � fn+1 and

On one-sided versus two-sided classification 497

• there is some η ∈ {0, 1}∗ such that either ϕσn+1n (η)↓ �= M(η) or ϕ

gn(η)↑

for all g majorizing fn+1 with g � σn+1.If there are such σn+1, fn+1 the algorithm proceeds with them in the nextstep otherwise it terminates.

If the algorithm goes through all steps, then g = limn σn exists and majorizes f0.By construction, for all e there is some η ∈ {0, 1}∗ such that either ϕ

ge (η)↓ �= M(η)

(since ϕσe+1e (η)↓ �= M(η) and σe+1 � g) or ϕ

ge (η)↑ (since g majorizes fe+1). So

M is not computed relative to g via any e in contradiction to the choice of f0.Thus the algorithm terminates in some stage n. Now for each g the following

set is not empty:

F(g, η) = {τ � σn : ϕτn(η)↓ ∧ (∀m ∈ dom(τ) − dom(σn)) [τ(m) ≥ g(m)]}.

Furthermore, whenever g majorizes fn and τ ∈ F(g, η) then ϕτn(η) ↓= M(η).

Using these two facts it is possible to construct e:

If within |η| steps no triple (θ, τ1, τ2) has been enumerated witnessing in-consistency in the way that τ1, τ2 ∈ F(g, θ) and ϕ

τ1n (θ) �= ϕ

τ2n (θ)

then ϕge (η) = ϕτ

n(η) for the first τ found in F(g, τ)

else ϕge (η)↑ .

So M = ϕge for all g majorizing fn and ϕ

ge is partial if M �= ϕ

ge . The second step

is now easy. The sets Mc = {η : M(η) = c} are �11 according to the following

definition:

M(η) = c ⇔ (∀g) [ϕge is total ⇒ ϕ

ge (η) = c].

Since M0 is the complement of M1, both sets are in �11 and M is hyper-

arithmetic. ��Example 2.6. The following classes are one-sided but not relatively two-sided:(a) A = {A : A is cofinite} [7,23].(b) B = {B : B is primitive recursive} [23].(c) C = {C ⊕ D : D �= C′}.Proof. (a): The one-sided classifier H outputs a on input σa. It takes almost al-ways the value 1 iff the input is a cofinite set. On the other hand this class is notrelatively two-sided since for any function g there is a set A /∈ A such that g doesnot dominate fA. Namely for given g, this set is A = lN − {x0, x1, . . .} wherex0 = g(0) + 1 and xn+1 = g(xn) + xn + 1. From the definition of H it followsthat fA(xn) = xn+1 = g(xn) + xn + 1 > g(xn) and g does not dominate fA.

(b): Rogers [23, §15.1] showed that dense classes with a uniform enumeration areone-sided but not two-sided relative to any oracle, so this proof covers also part (a):Let B0, B1, . . . be a uniform enumeration, in this case of all primitive recursive sets.Now on input σa, the one-sided machine looks for the first k with σ � Bk . If thenalso σa � Bk it outputs 1 otherwise it outputs 0. It is easy to see that the machineoutputs 1 on almost all inputs σ � B iff B = Bk for some k. The other part of the

498 F. Stephan

proof uses that no countable and dense class like B is the intersection of countablymany open sets and thus not a relativized �0

2 class [23, Theorem 15.IX(b)].

(c): For each set C there is a uniform approximation of C′ via strings γ Cn of C

such that each γ Cn queries C only at the places 0, 1, . . . , n, |γ C

n | ≤ n and γ Cn � C′

infinitely often. Now the one-sided machine H outputs a 1 on strings of odd lengthand processes strings of even length as follows:

H(C(0)D(0)C(1)D(1) . . . C(n)D(n)) ={

0 if γ Cn � D(0)D(1) . . . D(n);

1 otherwise.

As mentioned, γ Cn can be computed using only the C(m) with m ≤ n, thus the

whole procedure needs no oracle but retrieves the answers from the input. If D �= C′then γ C

n �� D for almost all n; therefore H accepts all sets in C. If D = C′ thenthere are infinitely many n with γ C

n � D(0)D(1) . . . D(n). H takes 0 at these n

and thus rejects all sets outside C. So H is a one-sided classifier for C.Assume now by way of contradiction thatC is two-sided via M . Now M can also

be viewed as a set and so one can consider the class {C ⊕ D : C �= M ∨ D �= M ′}.A machine to identify this class can be derived from M as follows:

N(σ) ={

M(σ) if σ(x) = M(x2 ) for all even x ∈ dom(σ);

1 otherwise.

N is obviously recursive in M . On the other hand, the new class is cosingle andcontains all sets except M ⊕ M ′. Then M ⊕ M ′ has to be recursive in M , acontradiction. ��Singleton one-sided classes are always two-sided and therefore less complex thancosingleton ones which can have a Turing degree above every given hyperarith-metic Turing degree. The relation between countable and cocountable one-sidedclasses is the other way round: While some countable one-sided classes can havethe highest possible Turing complexity this is not true for cocountable classes.

Theorem 2.7. Let the sets A0, A1, . . . be given. If the cocountable class A = {B :(∀n)[B �= An]} is one-sided then A is also two-sided relative to some hyperarith-metic set.

Proof. Assume that there is a one-sided classifier H for A. Sacks [24, TheoremIII.6.2] showed that every �1

1 class either contains a perfect subclass (and is justuncountable) or has only members below some hyperarithmetic set. Since each one-sided class is defined without quantification over sets or functions, its complementis a �1

1 class (indeed it is even a �11 class). So there is a hyperarithmetic set C such

that An ≤T C for all n. Now for each n the function fAn as defined in Theorem 2.4is recursive in An. Some function g ≤T C′ dominates all functions computablerelative to C, in particular g dominates each function fAn . By Theorem 2.4 theclass A is two-sided relative to C′ which has hyperarithmetic Turing degree sincethe hyperarithmetic Turing degrees are closed under the jump. ��

On one-sided versus two-sided classification 499

3. Complete classes

There are some other reducibilities between sets besides Turing reduction. Post [21]introduced the concept of 1-reduction: A set A is 1-reducible to B iff there is a one-one computable function f such that x ∈ A ⇔ f (x) ∈ B. The set K is completewithin the enumerable sets, that is, every enumerable set can be 1-reduced to K .

It is possible to transfer the notion of 1-reduction to the world of classifi-cation. Here a 1-reduction from a class A to a class B is a one-one comput-able and continuous operator 3 translating every set A into a set 3(A) such thatA ∈ A ⇔ 3(A) ∈ B.

Definition 3.1. A computable operator 3 is called a 1-reduction from A to B if

• 3 is strictly monotone (with respect to �), that is, 3(σ) � 3(τ) iff σ � τ forall σ, τ ∈ {0, 1}∗.

• A ∈ A iff 3(A) = limσ�A 3(σ) ∈ B for all sets A.

A class A is called 1-complete iff every one-sided class is 1-reducible to it and Aitself is one-sided.

It is easy to see that if A ≤1 B and B is two-sided via a (nonrecursive) machineM then A is also two-sided via a classifier computable relative to M . Since thereare classes which are not relatively two-sided, the following 1-complete class is notrelatively two-sided and does not have a Turing degree.

Theorem 3.2. The class K = {A : (∀∞even x) [x ∈ A]} is 1-complete.

Proof. The classifier

H(a0a1 . . . an) ={

1 if n is odd;an if n is even;

witnesses that K is one-sided. Assume now that L is a computable one-sided clas-sifier for a further class A. A 1-reduction 3 from A to K is defined as follows:

3(λ) = L(λ);3(σa) = 3(σ)aL(σa).

From this equation it follows that H(3(σ)) = L(σ) and that whenever η � 3(A)

and H(η) = 0 then η = 3(σ) for some σ � A. The equivalence

(∃∞σ � A) [L(σ) = 0] ⇔ (∃∞η � 3(A)) [H(η) = 0]

gives that A ∈ A iff 3(A) ∈ K and A is 1-reducible to K. So K is1-complete. ��Theorem 3.3. The class A of all cofinite sets has greatest Turing complexity butis not 1-complete.

Proof. By Example 2.6 (a), the class A of all cofinite sets has greatest Turingcomplexity. But A is not 1-complete: Consider the full class {0, 1}∞ of all sets. If

500 F. Stephan

{0, 1}∞ is 1-reducible to A via 3 then every infinite branch of the tree 3({0, 1}∗)would be contained in A. This contradicts the fact that A contains only countablymany sets. ��Post [21] showed that simple sets are not complete under various constructions.Indeed it is possible to define something analogous to simple set and to show thatit is not 1-complete: A one-sided class is called simple iff it intersects every otherinfinite one-sided class.

Theorem 3.4. No 1-complete class is simple.

Proof. Let A be a 1-complete class. Then the class C of all cofinite sets is 1-redu-cible to A via some reduction 3. Now it is shown that A is not simple via showingthat the class {3(A0), 3(A1), . . .} is a two-sided infinite class disjoint to A whereAx = {x}. No set Ax = {x} is contained in C. Thus also no set 3(Ax) is in Aand B = {3(A0), 3(A1), . . .} is an infinite class disjoint to A. It remains to beshown that B is one-sided; indeed it will be shown that the following machine M

is a two-sided classifier for B.

M(σ) ={

1 if there is an x with 3(0x1) � σ � 3(0x10∞);0 otherwise.

The check whether such an x exists, is computable: Only the x ≤ |σ | have to beconsidered since the string 3(0x1) is longer than σ for x > |σ |. Furthermore, thesets 3(Ax) are uniformly recursive, so the whole check and thus M is a computableprocedure.

During the classification of any set A, M makes only two mind changes: fromthe initial guess 0 to 1, if it turns out that 3(0x1) � A for some x, and a furthermind change back to 0, if A turns out to be different from 3(Ax). Since no string3(0y1) with y �= x extends 3(0x1), there is no danger of a third mind change from0 to 1 because of such a 3(0y1) being a prefix of A.

It is now easy to verify is that M converges on the sets 3(Ax) to 1 and on allother sets to 0; so M is a classifier for B.

In particular, B is a one-sided infinite class which is disjoint to A and thuswitnesses that A is not simple. ��

4. Index sets of one-sided classes

Let G be a collection of classes and He denote the class generated by the e-thone-sided classifier He. Then the set E = {e : He ∈ G} is called the index set of Gand every such set E belonging to a collection of classes is called an index set. Sothis section deals with the analogue of the index sets of classes of enumerable sets;while index-sets of sets are mostly situated in the arithmetical hierarchy, index setsof one-sided classes have often the complexity �1

1. The next theorem gives two ex-amples and is the basis for showing that the equality problem {〈e, e′〉 : He = He′ }is �1

1 complete.

Theorem 4.1. The sets I = {e : He is two-sided} and J = {e : He = {0, 1}∞}are �1

1 complete.

On one-sided versus two-sided classification 501

Proof. The set J = {e : (∀A) (∀∞σ � A) [He(σ) = 1] } is in �11. Furthermore,

e ∈ I iff there is an index e′ such that He = He′ and He′ makes on any A onlyfinitely many mind changes, that is,

e ∈ I ⇔ (∃e′)[ (∀A) [(∃∞σ � A) [He(σ) = 0] ⇔ (∃∞σ � A) [He′(σ ) = 0] ] ∧(∀A) (∃c) (∀∞σ � A) [He′(σ ) = c] ]

So it follows that also I is in �11.

Now it is shown that both sets are complete via the same m-reduction f . LetT0, T1, . . . ⊆ lN∗ be a computable enumeration of all primitive recursive trees. Theset

E = {e : Te is well-founded}is �1

1 complete [24] where a tree is well-founded iff it does not contain an in-finite branch. A string σ is said to code a finite branch a0a1 . . . an iff there areb0, b1, . . . , bn ∈ lN such that σ = 1〈a0,b0〉01〈a1,b1〉0 . . . 1〈an,bn〉0. E is m-reducibleto both index sets I and J via the following reduction:

Hf (e)(σ ) ={

0 if σ codes a finite branch of Te, that is,if σ = 1〈a0,b0〉01〈a1,b1〉0 . . . 1〈an,bn〉0 and a0a1 . . . an ∈ Te;

1 otherwise.

It follows that Hf (e) outputs infinitely many 0s on some set A iff A = 1〈a0,b0〉01〈a1,b1〉0 . . . for an infinite branch a0a1 . . . of Te.

In the case that Te is well-founded, Hf (e) outputs on every set A only finitelymany 0s and therefore Hf (e) = {0, 1}∞. This class is two-sided, so f (e) ∈ I andf (e) ∈ J .

Otherwise Te has an infinite branch a0a1 . . . and for any sequence b0b1 . . . theset A with the characteristic function 1〈a0,b0〉01〈a1,b1〉0 . . . is not in Hf (e). It fol-lows that Hf (e) �= {0, 1}∞ and f (e) /∈ J . Furthermore, for each function g, thesequence b0b1 . . . can be chosen such that 〈an+1, bn+1〉 ≥ bn+1 > g(cn) wherecn = n + 〈a0, b0〉 + 〈a1, b1〉 + . . . + 〈an, bn〉. It follows that fA(cn) > g(cn) foreach n and that g does not dominate fA. So there is no function g dominating thefunctions fA for all A /∈ Hf (e). By Theorem 2.4, Hf (e) is not two-sided — noteven relative to any oracle — and f (e) /∈ I . ��Corollary 4.2. The set {〈e, e′〉 : He = He′ } is �1

1 complete.

Proof. The formula

(∀A) [ (∃∞σ � A) [He(σ) = 0] ⇔ (∃∞σ � A) [He′(σ ) = 0] ]

witnesses that equality is in �11. Fixing e′ to be an index of {0, 1}∞, Theorem 4.1

witnesses that the set is also �11 hard. ��

Theorem 4.1 has an immediate application: it shows that there is nothing equivalentto a Friedberg numbering. If all one-sided classes would have a Friedberg num-

502 F. Stephan

bering, then there would be also a numbering where one class, namely {0, 1}∞, isomitted. But such a numbering does not exist.

Theorem 4.3. No numbering contains all one-sided classes except {0, 1}∞.

Proof. Assume by way of contradiction that there is a computable function f suchthat the numbering Hf (0),Hf (1), . . . covers all one-sided classes except {0, 1}∞.Then the set {e : (∃e′) [He = Hf (e′)]} is in �1

1 since �11 is closed under quanti-

fication on numbers as e′ and since the equality problem is in �11. For any given

e such an e′ exists iff He �= {0, 1}∞. So the complement of this �11 set is the �1

1complete index set of {0, 1}∞ and such a recursive function f cannot exist. ��Theorem 4.4. The sets {e : He ≤1 A} and {e : He ≡1 A} are in �1

1 for everyone-sided class A. In particular, {e : He is 1-complete} is in �1

1.

Proof. The proofs are very similar. There is an enumeration of all operators 3i

such that whenever 3i is total then it is strictly monotone. Furthermore, there is aone-sided classifier H for A. Now

He ≤1 A ⇔ (∃i) (∀A) [ 3i is total ∧((∀∞n) [He(A(0)A(1) . . . A(n)) = 1] ⇔(∀∞n) [H(3i(A(0)A(1) . . . A(n))) = 1] ) ]

He ≡1 A ⇔ (∃i, j) (∀A) [ 3i and 3j are total ∧((∀∞n) [He(A(0)A(1) . . . A(n)) = 1] ⇔(∀∞n) [H(3i(A(0)A(1) . . . A(n))) = 1] ) ∧((∀∞n) [H(A(0)A(1) . . . A(n)) = 1] ⇔(∀∞n) [He(3j (A(0)A(1) . . . A(n))) = 1] ) ]

Since the existential quantifier ranges over numbers, these expressions are �11. They

characterize the two index sets. ��These classes are not �1

1 complete for every A. In particular if A = ∅ then theyare in �0

2: He ≡1 ∅ iff He = ∅ iff for each n there is an m such that everystring σ ∈ {0, 1}m has at least n prefixes τ � σ with He(τ) = 0. The differencein the complexity of the question whether He is empty or equals {0, 1}∞ is themirror image of the fact that the question whether We = ∅ is �0

1 complete whilethe question whether We = lN is �0

2 complete.Furthermore, it can be shown that the index set {e : He = ∅} has the least com-

plexity of an index set of classes. Rice [22] showed for the world of enumerablesets that every nontrivial index set is �0

1 hard or �01 hard. In the world of one-sided

classes it can be shown that every nontrivial index set E is �02 hard or �0

2 hard. Inparticular, it is shown that the �0

2 complete set F is m-reducible to E or E.

Theorem 4.5. Let E be a nontrivial index set of some collection G of classes. Thenthe set F = {e : We is finite} is m-reducible either to E or to E.

Proof. First consider the case {0, 1}∞ ∈ G. In this case it is shown that F ≤m E viaan m-reduction f . This f then witnesses that E has at least complexity �0

2. Since E

On one-sided versus two-sided classification 503

is not trivial there is some one-sided class A /∈ G with some computable one-sidedclassifier H . Now f is defined implicitly via giving an informal description for theclassifier Hf (e):

Hf (e) outputs on A at least n 0s iff |We| ≥ n and H outputs on A at least n

0s.

If We is finite, Hf (e) outputs on every A only finitely often a 0 and thus acceptsevery set; so Hf (e) = {0, 1}∞ and f (e) ∈ E for every e ∈ F . If We is infinite thenHf (e) accepts a set A iff H does; so Hf (e) = A and f (e) /∈ E for every e /∈ F .It follows that F is m-reducible to E via f .

The other case that G does not contain the class {0, 1}∞ just gives an m-reduc-tion from F to E using the above proof with E in place of E and {A : A /∈ G} inplace of G. ��

5. Classification and measure

The measure ν given by ν(∅) = 0, ν({0}) = ν({1}) = 0.5, ν({0, 1}) = 1 hasan infinite product µ on the space {0, 1}∞. This can be extended in such a waythat every subclass of a class with measure 0 is again measurable and has measure0. Lusin [24, Lemma II.6.2] showed that any �1

1 class and therefore also everyone-sided class is measurable. So the main question is how effective the measureof the classes is. For two-sided classes, one can compute the measure in the limit.

Theorem 5.1. The measure µ(A) of a two-sided class can be computed from anyindex e of a two-sided classifier He for A.

Proof. For each set A there is a unique n such that He converges at A(0)A(1) . . . A(n)

either to 1 or to 0. Now let Ae = {A : He converges to 1 at n} and Be = {A : He

converges to 0 at n}. Since He converges on every set A either to 1 or to 0, theseclasses A0,A1, . . . and B0,B1, . . . form a partition of {0, 1}∞. In particularµ(A0) + µ(B0) + µ(A1) + µ(B1) + · · · = 1. Now consider the computablesequence

qn = 2−1−n ·∑

a0,a1,...,an∈{0,1}He(a0a1 . . . an)

of rational numbers. This sequence converges to µ(A) since µ(A0) + µ(A1) +. . .+µ(An) ≤ qn ≤ 1− (µ(B0)−µ(B1)− . . .−µ(Bn)) and therefore |µ(A)−qn| ≤ εn where εn = µ(An+1)+µ(Bn+1)+µ(An+2)+µ(Bn+2)+. . .; the εn con-verge to 0 since the sum µ(A0)+µ(B0)+µ(A1)+µ(B1)+. . .+µ(An)+µ(Bn)

approaches monotonically to 1. Thus the sequence of the qn converges to µ(A)

and so the measure of A can be computed in the limit from any two-sided classifierfor A. ��This is not longer true for one-sided classes. The class of all sets A which are lex-icographic before K ′ has the measure 2−1K ′(0) + 2−2K ′(1) + . . . which cannotbe computed in the limit since otherwise K ′ would be computable in the limit. Soone might ask whether the measure is computable at least in those cases where themeasure of the class is a recursive real. But also this fails since one can constructa function f with Hf (e) = {0, 1}∞ if We is finite and Hf (e) = ∅ if We is infinite.

504 F. Stephan

For the further analysis, the notion of recursive measure 0 and 1 is introducedwhich can be defined using martingales [6,13,25]. A class has recursive measure0 if a recursive martingale succeeds on all its members and recursive measure 1 ifa recursive martingale succeeds on all its nonmembers. A martingale is a functionm which associates to every σ ∈ {0, 1}∗ a rational number such that:

• m(σ0) + m(σ1) = 2m(σ);• m(σ) > 0 and m(λ) = 1.

A martingale witnesses that a class A has measure 0 iff for each A ∈ A and foreach k there is an n such that m(A(0)A(1) . . . A(n)) ≥ k. It witnesses that a classhas measure 1 iff it witnesses that the complement of this class has measure 0. Aclass has recursive measure 0 or 1 iff some recursive martingale witnesses that ithas measure 0 or 1, respectively.

Easier than computing such a measure is to verify that a class has measure 0or 1 via presenting a recursive martingale which either succeeds on the class oron its complement. But — as the next example shows — also this fails for certainone-sided classes with measure 1: there is just no such martingale.

Example 5.2. There is a cosingle one-sided class A which does not have recursivemeasure 1.

Proof. Every set A ≤T K is a �02 singleton. Therefore it follows that for every

A ≤T K the class A = {B : B �= A} is one-sided and it remains to be shown thatthere is some A �≤T K such that no recursive martingale succeeds on A. This isjust the well-known fact that there is a random-set A ≤T K . ��It is easier to determine that a one-sided class is small than that it is large. Asalready seen the index set of the empty class is much easier than that of the fullclass {0, 1}∞. This result has a parallel with respect to measure. While some co-single one-sided classes do not have recursive measure 1, every one-sided class ofmeasure 0 does also have recursive measure 0.

Theorem 5.3. If a one-sided class A has measure 0 then A has recursive mea-sure 0.

Proof. Let A be one-sided via a machine H and have measure 0. Now a recursivemartingale m is constructed in order to witness that A has recursive measure 0.The inductive definition starts with m(λ) = 1.

Now in each step choose (one of) the shortest σ such that m(σ) is defined butboth m(σ0) and m(σ1) are undefined. Let Ln be the set of all τ ∈ {0, 1}n such thatH(ση) = 1 for all nonempty η � τ . If for each n the cardinality of Ln would belarger than 2n−2 then H would output on a “quarter” of all sets A � σ never a 0after processing σ which implies µ(A) ≥ 2−|σ |−2 in contradiction to the choiceof A. Thus there is an n > 0 such that Ln has at most 2n−2 elements, without lossof generality, n is the smallest such number.

Now let m(στ) = 1.5 · m(σ) for every τ ∈ Ln and let m(στ) = 2n−1.5·|Ln|2n−|Ln| ·

m(σ) for the other strings τ of length n. All values m(στ) are above 0 and their sumis 2n · m(σ). Furthermore, define m(ση) for strings η of length n− 1, n− 2, . . . , 0

On one-sided versus two-sided classification 505

according to the formula m(η) = 12 · (m(η0) + m(η1)). This finishes the extension

step.Each such step finishes and since each step takes the shortest σ with m(σ0),

m(σ1) being undefined, m becomes a total function. Furthermore, all values of m arepositive rational numbers and it can be verified that the equation m(σ0)+m(σ1) =2 · m(σ) holds for all σ . Thus m is a recursive martingale.

Let now A ∈ A. Let σ0 � σ1 � . . . � A being that sequence of strings suchthat σn+1 is always a string of the form σnτ when m is extended at σn. By theconstruction the following holds:

m(σn+1) < m(σn) ⇔ H(η) = 0 for some η with σn ≺ η � σn+1

m(σn+1) = 1.5 · m(σn) ⇔ H(η) = 1 for all η with σn ≺ η � σn+1

Since H outputs on A almost always 1s, the second case holds for almost all n andit follows that m takes on A arbitrary large values. So A has recursive measure 0witnessed by the recursive martingale m. ��Example 5.2 showed already that one-sided classes of measure 1 do not need tohave recursive measure 1. So it is natural to look for the help of oracles and the nextresult states, that a K-oracle is sufficient to do the job: If a class has measure 1 thenit has already K-recursive measure 1, that is, a K-recursive martingale witnessesthat the class has measure 1.

Theorem 5.4. If a one-sided class A has measure 1 then A has K-recursivemeasure 1.

Proof. For given one-sided class A with measure 1 a K-recursive martingale m isconstructed which succeeds on every A /∈ A and so witnesses that A has K-recur-sive measure 1. Let H be a one-sided classifier for A. Let µ denote the standardmeasure on {0, 1}∞ and for any computable tree T let

ν(T , η) = µ( {A � η : A is an infinite branch on T } ).

Starting with m(λ) = 1, the inductive definition of m runs as follows:

• Choose the shortest σ such that m(σ0)↑ and m(σ1)↑ .Indeed the domain of m will be a tree at each stage and by extending the domainon some shortest leaf, it is guaranteed that m is total at the end. This σ can befound by bookkeeping on the previously defined places.

• Let Tn = {τ : |{m ∈ dom(τ) : H(τ(0)τ (1) . . . τ (m)) = 0}| ≤ n}. Using theoracle K find a suitable n such that ν(Tn, σ ) > 2−|σ |−1.Such an n exists since the union of all Tn contains almost all branches throughσ and so ν(σ, Tn) must approach to 2−|σ | by the continuity of µ. Furthermore,

ν(σ, Tn) = 2−|σ | −∑

τ is leaf of Tn2−|τ |

is computable via K-oracle and thus a suitable n can be found.

506 F. Stephan

• Define m on all nodes of Tn above σ such that m(τ) ≥ 1.5 · m(σ) for everyleaf τ of Tn above σ .The definition m′(τ ) = m(σ) · (0.95 · 2|τ |−|σ | · ν(τ, Tn)/ν(σ, Tn) + 0.05)

satisfies all requirements but has the disadvantage of not giving rational num-bers. But m′ can be approximated by an extension of m onto Tn above σ suchthat m has on this extended domain the same computational complexity asm′, takes only rational values and satisfies 0.9 · m′(η) ≤ m(η) ≤ 1.1 · m′(η)

for all η. Since even m′(τ ) ≥ 1.9 · m(σ) for all leaves of Tn, it follows thatm(τ) ≥ 0.9 · 1.9 · m(σ) ≥ 1.5 · m(σ) for these τ .

At each stage of the definition, a set A stays on the corresponding tree Tn only ifH outputs a finite number of 0s on input A. Thus starting with σ0 = λ, a givenA /∈ A leaves this tree through a leaf σ1 and when m is extended on a tree aboveσ1 then A leaves this tree through a leaf σ2 and so on. So A goes through an infinitesequence σ0, σ1, . . . of nodes such that m(σk+1) ≥ 1.5 · m(σk) for all these nodes.It follows that m takes on A arbitrary high values and so m witnesses that A hasK-recursive measure 0. ��

Let I be an interval of real numbers. It follows from the definition of the Lebesguemeasure, that every measurable set E ⊆ I is approximable via an Fσ set F in thesense that the symmetric difference of E and F has measure 0. Lusin [20, Satz 8.2]showed a function f : I → I is measurable iff for each ε > 0 there is a set D ofmeasure less than ε such that the restriction of f to the domain I −D is continuous.These results motivate to look at the question to which extent from the view-pointof measure theory, a one-sided class can be approximated by a two-sided one.

Theorem 5.5. For every one-sided class A and every ε > 0 there is a two-sidedclass B such that the symmetric difference of both classes has a measure less thanε. But there is also a one-sided class A such that every two-sided class differs fromA on a set of positive measure.

Proof. Recall that every one-sided class is measurable. For given one-sided classA and ε > 0 consider the classes Ak containing all sets A on which H outputsat most k times a 0. These classes are two-sided and they approximate A frombelow. Since the measure is continuous, µ(A) is the upper limit of the µ(Ak) andso µ(A) − ε < µ(Ak) ≤ µ(A) for some k. Since Ak ⊆ A, the symmetricdifference has the measure µ(A) − µ(Ak) which is less than ε.

For the second result let G be 1-generic and below K . Consider the classA = {A : A <lex G}. This class is one-sided via outputting 1 if σ <lex G|σ |and 0 otherwise where Gs is a recursive approximation to G. Now let B be anytwo-sided class with classifier M . M converges on G to some value a; with onlyfinitely many changes one can obtain that M(σ) = a for all σ � M . Thus G

avoids the computable set {τ : M(τ) �= a} and so there is some prefix σ such thatM(τ) = a for all τ � σ . On the other hand there are η0, η1 � σ such that all setsextending η0 belong to A and all sets extending η1 belong to A, in particular allsets A � η1−a are in the symmetric difference of A and B so that this symmetricdifference has a measure larger than 2|η1−a | > 0. ��

On one-sided versus two-sided classification 507

There are two natural properties, one-sided classes can take: being simple and beingmaximal. The first one was already introduced above: a simple class is one-sidedand intersects every infinite one-sided class. The second one is the following: Aone-sided class A is maximal if it is coinfinite and has the property that eitherA ∪ B or A ∪ B is cofinite for every one-sided class B. The easiest way to con-struct a maximal class is just to convert a maximal set into it: Let U be a set whichis maximal relative to K , that is, U is enumerable relative to K , coinfinite and nofurther set which is enumerable relative to K can split the complement of U intotwo infinite parts. The class {A : |A| �= 1 ∨ (A = {x} ∧ x ∈ U)} is maximal. Somaximal classes exist. Simple and maximal classes are not only large in the sensethat they intersect every infinite one-sided class. They are also large with respectto measure theory.

Theorem 5.6. If A is simple then µ(A) > 0. If A is maximal then µ(A) = 1.

Proof. First it is shown that no one-sided class A of measure 0 is simple. Solet A be a one-sided class of measure 0. A then also has recursive measure 0and there is a computable martingale m witnessing this fact. The class Bc ={A : (∃n) [m(A(0)A(1) . . . A(n)) > c]} of all sets on which m obtains some val-ue greater than c has measure at most 1

c. So the class B2 has at least measure

12 and is therefore infinite. B2 is disjoint to A since the martingale succeeds onevery set in A. Furthermore, B2 is one-sided via guessing 1 on input A as longas m(A(0)A(1) . . . A(n)) ≤ 2 and then making a mind change to 0. So the infiniteone-sided class B2 is disjoint to A and A is not simple.

Second it is shown that µ(A) = 1 for all maximal classes A. Given amaximal class A some kind of “kernel” B of A is constructed as follows:for each n one of the classes {A /∈ A : A(n) = 0} and {A /∈ A : A(n) = 1}is finite and the other one is infinite; so let B(n) take that value b for which{A : A(n) = b} is infinite. It follows that for every n the class {A /∈ A : A(n)

�= B(n)} is finite and thus their union is countable. So A has at most count-ably many members: those just mentioned plus perhaps B itself. Therefore thecomplement of any maximal class is countable and so every maximal class hasmeasure 1. ��

Theorem 5.6 has two limitations: first it is only claimed that maximal classes havemeasure 1 but not that they have recursive measure 1. Indeed this is not possiblesince by Example 5.2 there is a cosingle class A not having a recursive measure 1and taking any maximal class B, the new class A∩B does also not have recursivemeasure 1 but is still maximal.

The second restriction is that there are simple classes with arbitrarily smallpositive measure as will be proven below. Indeed this tradeoff between the size ofmaximal and simple classes has an analogy in recursion theory given by the factthat a simple set can be arbitrarily thin — for every given computable function f ,there is a simple set which has only n elements among the numbers 0, 1, . . . , f (n)

— while no similar result holds for maximal sets.

Example 5.7. For each ε > 0 there is a simple class A with µ(A) < ε.

508 F. Stephan

Proof. Each string σ generates an open class σ · {0, 1}∞ of sets. This open classis said to meet the one-sided class He generated by He effectively iff there is aset A ∈ σ · {0, 1}∞ such that He(A(0)A(1) . . . A(n)) = 1 for all n ≥ |σ |. Thiscondition is coenumerable, that is, for each class He given by He the set

Ne = {σ : σ · {0, 1}∞ does not meet He effectively}

is enumerable. Furthermore, almost all sets A(0)A(1) . . . A(n) · {0, 1}∞ meet He

effectively whenever A ∈ He. There is an algorithm which generates a three-di-mensional array σe,k,s of strings such that

• the length of each string σe,k,s is at least k;• if He �= ∅ then σe,k = lims→∞ σe,k,s exists;• if σe,k exists then the open class σe,k · {0, 1}∞ meets He effectively.

This algorithm works after a simple schema: σe,k,s is just the first string (with respectto some given enumeration of all strings) whose length is at least k and which is notenumerated to Ne within s computation steps. So this algorithm converges to someσe,k if He �= ∅ and diverges otherwise. Let E denote the index set of all nonemptyclasses He, that is, the set of all e where the sequences σe,k,0, σe,k,1, . . . converge.

Given ε there is a number n such that 21−n < ε. Now A is taken to be theunion of all classes σe,n+e · {0, 1}∞ with e ∈ E. The measure of A is bounded byµ(A) ≤ �e∈E 2−e−n ≤ 21−n < ε and so the requirement on the measure of A issatisfied. It remains to show that A is one-sided. A one-sided classifier for A isgiven as follows:

H outputs on A at least n 0s iff there is s ≥ n such thatσe,k,s �= A(0)A(1) . . . A(m) for all m ≤ n and e, k ≤ n.

If A ∈ A then some σe,k,s converges to a prefix of A. So there are m, t such thatσe,k,s = A(0)A(1) . . . A(m) for all s ≥ t . It follows that H does not output morethan e + m + t 0s and H accepts A.

If A /∈ A then for each n there is a stage s such that all strings A(0)A(1) . . . A(m)

with m ≤ n are enumerated to all Ne with e ≤ n. It follows that all σe,k,s withe, k ≤ n are different from all A(0)A(1) . . . A(m) with m ≤ n and H outputs onA eventually at least n 0s. Since this holds for each n, H rejects A.

So H is a one-sided classifier for A. By construction, A meets every nonemp-ty set He, so A is a simple class. Furthermore, µ(A) < ε and so A satisfies allconditions of the theorem. ��A related notion to measure is that of category. A class has first category or ismeager iff it is the countable union of nowhere dense classes. Here a class A isdense iff for every string σ there is an A ∈ A with σ � A; A is nowhere dense ifffor every σ there is an extension τ � σ such that no A � τ is an element of A.

Mehlhorn [15] introduced an effective notion of meagerness. He called a classA effectively meager iff there is a uniformly recursive family f0, f1, . . . of func-tions such that fn(σ ) � σ for every n and σ and such that for each A ∈ A thereis a function fn with fn(A(0)A(1) . . . A(m)) �� A for all m.

On one-sided versus two-sided classification 509

Now one can show that for one-sided classes there are many natural relationsbetween these notions.

Theorem 5.8. Let A be a one-sided class. Then A is meager iff A is effectivelymeager iff A is dense. Furthermore, if A has measure 0 then A is meager but theconverse does not hold.

Proof. If A is meager then no class σ · {0, 1}∞ is contained in A and thus the com-plement of A is dense. For the second transition let A be dense and let M witness,that A is one-sided. Then for each n there is a function fn which searches for givenσ an extension τ � σ such that M(η) = 0 for at least n prefixes η � τ . The fn aretotal since A is dense and so every σ has an infinite extension A � σ on whichM outputs infinitely many 0s. Furthermore, the fn are uniformly recursive, that is,the mapping n, σ → fn(σ ) is computable in both parameters. If A ∈ A then M

outputs on A only finitely often, say n times, a 0 and so fn+1(A(0)A(1) . . . A(m))

is for no m a prefix of A. It follows thatA is effectively meager. The third transitionfrom effective meagerness to meagerness follows directly from the definition.

For the second statement of the theorem, the implication holds since no classof measure 0 contains a subclass σ · {0, 1}∞ and so every class of measure 0 has adense complement. The properness of this relation can be obtained by consideringthe following two-sided class:

A ∈ A ⇔ (∀n) [A �� σn0n+2]

where σ0, σ1, . . . is an enumeration of all strings. The class A has a dense comple-ment and so is meager, it is even nowhere dense. But its measure satisfies µ(A) ≥1 − �n 2−n−2−|σn| ≥ 1

2 and so A does not have measure 0. ��

6. Classifying recursive sets only

Smith, Wiehagen and Zeugmann [26,29] looked at classification tasks where onlythe behaviour on computable sets is considered. Case, Kinber, Sharma and Stephan[5] extended this work. Many of the anomalies of classification (compared to thesetting of enumerable versus computable sets) disappear, if classification of onlycomputable sets is considered. In this model, every one-sided class is two-sidedrelative to a high oracle and cosingle classes are already two-sided without any helpof an oracle. This section now deals with the relation of the general model whereall sets are classified versus the restricted model where only computable sets areclassified. The next theorem shows that there is a class which is two-sided in therestricted model but does not have any two-sided classifier relative to any oracle inthe general model.

Theorem 6.1. There is a class A of computable sets such that some computable M

classifies all computable sets with respect to A but there is not even a nonrecursiveclassifier which converges on every input-set and classifies all computable sets withrespect to A.

Proof. Let S be a simple set and A = {finite A : A∩S = ∅∧|A| is odd}. First it isshown that some M classifies S one-sided where M converges on every computable

510 F. Stephan

set. This M is given by

M(σ) ={

0 if {x : σ(x)↓= 1} meets S|σ | or has even cardinality;1 otherwise.

That means that M outputs 0 or 1 depending on the cardinality of the 1s in σ untilM discovers that some x with σ(x)↓= 1 is enumerated into S — then M switchesto 0 forever.

Now it is shown that M converges on every computable set. If A is finite thenM changes its mind only finitely often — either when M finds a new element orwhen some already found element is enumerated into S. If A is computable andinfinite then M also makes a mind change only finitely often since M eventuallydiscovers that there is an x ∈ A ∩ S and from this time on only outputs 0.

The second part is to show that every classifier N which is correct on all finitesets with respect to A diverges on some infinite set A = {a0, a1, . . .} where thisset is defined inductively starting with n = 0 and some a0 /∈ S.

Take some σn � {a0, a1, . . . , an} such that |σn| > an and N(σn) = 1 iffn + 1 is odd. Then take some an+1 /∈ S ∪ dom(σn).

The σn is found since N classifies {a0, a1, . . . , an} with respect to A. The an+1exists since S is coinfinite and dom(σn) is finite. So the construction works for alln and the resulting set A is infinite and disjoint to S. Furthermore, N(σn) = 0 forall even n, N(σn) = 1 for all odd n and the σn are all different prefixes of A, so N

does not converge on A. ��So sometimes two-sided classifiers for computable sets cannot be extended to two-sided classifiers for all sets. But as the next theorem shows, they can be extendedto one-sided classifiers for all sets such that the corresponding class has measure 1.

Theorem 6.2. Every one-sided class A has a one-sided “extension” B of measure1 such that A ∈ A ⇔ A ∈ B for every computable set A.

Proof. Let H be a one-sided classifier for A. Now a new one-sided classifier N isconstructed such that the class B defined via N has the desired properties. N justslows down the output of the 0s and meets the following definition:

N outputs on A at least n 0s if H outputs on A at least n 0s and there ism ≥ n such that ϕm(x)↓= A(x) for all x ≤ m.

So whenever A is recursive, A has infinitely many indices and in particular for eachn there is an index m ≥ n of A. This m satisfies of course ϕm(x)↓= A(x) for allx ≤ m. Therefore M outputs on A infinitely many 0s if H does and N classifies A

to be in B iff H classifies A to be in A. So A and B coincide on the computablesets.

Let Am = {A : (∀x ≤ m) [ϕm(x) ↓= A(x)]}. Each class Am has measure2−m−1 if ϕm is defined on the inputs 0, 1, . . . , m and is empty otherwise. So whenev-er N outputs on a set A at least n 0s, then A belongs to some Am with m ≥ n. Sinceµ(An ∪An+1 ∪ . . .) ≤ µ(An)+µ(An+1)+ . . . ≤ 2−n−1 + 2−n−2 + . . . = 2−n,it follows that the measure of the class of all A on which N outputs at least n 0shas the upper bound 2−n. Thus the measure of B which is the class of all sets on

On one-sided versus two-sided classification 511

which N outputs infinitely many 0s is 0 since it is bounded by each number 2−n.It follows that B has measure 1. ��A similar theorem does not hold with measure 0 in place of measure 1. Taking theone-sided classA = {0, 1}∞ of all sets, every one-sided classB which agrees withA on all computable sets just has to contain every computable set. The measureof B cannot be 0 since then B had recursive measure 0 and so there would be arecursive martingale succeeding on all computable sets - which does not exist.

7. Conclusion

The paper deals with the notion of one-sided and two-sided classes. It is shown thatthere are several similarities between the relation of one-sided to two-sided classeson the one hand and the well-studied relation of enumerable to computable sets onthe other hand.

Similar to the study of Turing degrees of enumerable sets, the Turing complexityof one-sided classes is defined as — roughly spoken — the amount of informationwhich is needed to construct a two-sided classifier for a one-sided class. It turns outthat the classes with the highest Turing complexity which are not two-sided relativeto any oracle are intractable more because of topological reasons than because ofcomputational difficulty.

The classes with intermediate Turing complexity (which are not two-sided buthave a two-sided classifier operating with some oracle) are linked to hyperarith-metic Turing degrees. In particular, if a class is two-sided relative to a cone above aTuring degree a but not relative to any other Turing degree then this Turing degreeis generated by a �0

2 singleton. On the other hand every �02 singleton A generates

the one-sided class {B : B �= A} which has exactly the same Turing degree as A.Furthermore, there are intermediate one-sided classes which do not have a Turingdegree but are linked to a collection of Turing degrees. For example, there is a one-sided class which is two-sided relative to an oracle iff that oracle has high Turingdegree. Within this area the following questions remained open.

• Is there a one-sided and relatively two-sided class which has no hyperarith-metical two-sided classifier?

• Is the structure of the one-sided classes concerning 1-reduction isomorphic toany well-known degree-structure?

Further research deals with index sets {e : He belongs toG} whereG is a collectionof some classes. Most natural index sets as those of the two-sided classes, of theclass {0, 1}∞ and of the 1-complete sets are �1

1 complete. Some as the problemwhether a class is empty have the complexity �0

2 and are therefore easier.Every one-sided class is Borel (in the standard topological sense) and therefore

also measurable. So the question was investigated how effective this measure is.Due to the asymmetric definition of one-sided classification, one-sided classes ofmeasure 0 have already recursive measure 0 while some cosingle one-sided classesdo not have a recursive measure.

Arun Sharma [5] proposed to study the classification of only recursive sets. Inthis world, topological constraints are weakened and the concept becomes quite

512 F. Stephan

more similar to the scenario of enumerable versus computable sets. For example,every one-sided class is two-sided relative to a high oracle in this world. Section 6is therefore dedicated to the relation between these two worlds. The main result isthat a two-sided classifier for the world of classifying computable sets only cannotbe extended to one for the world of classifying all sets — not even with oracles.

Acknowledgements. The author would like to thank Klaus Ambos-Spies, Bernd Borchert,John Case, Rusins Freivalds and Arun Sharma for discussions. He is also grateful to theUniversity of New South Wales where he worked on this and related topics during severalvisits.

References

[1] Ben-David, S.: Can Finite Samples Detect Singularities of Real-Valued Functions?Proceedings of the 24th Annual ACM Symposium on the Theory of Computer Science,Victoria, B.C., 390–399 (1992)

[2] Blum, L., Blum, M.: Toward a mathematical theory of inductive inference, Informationand Control, 28, 125–155 (1975)

[3] Buchi, J.R.: On a decision method in restricted second order arithmetic, Proceedingsof the International Congress on Logic, Methodology and Philosophy of Science,Stanford University Press, Stanford, California (1960)

[4] Buchi, J.R., Landweber, L.H.: Definability in the monadic second order theory ofsuccessor, Journal of Symbolic Logic, 34, 166–170 (1969)

[5] Case, J., Kinber, E., Sharma, A., Stephan, F.: On the classification of computablelanguages, Proceedings of the 14th International Symposium on Theoretical Aspects ofComputer Science, Lecture Notes in Computer Science (Springer-Verlag, Heidelberg)1200, 225–236 (1997)

[6] Fortnow, L., Freivalds, R., Gasarch, W., Kummer, M., Kurtz, S., Smith, C.,Stephan, F.: On the relative size of learnable sets, Theoretical Computer Science,197, 139–156 (1998)

[7] Gasarch, W., Pleszkoch, M., Stephan, F., Velauthapillai, M.: Classification using infor-mation. Annals of Mathematics and Artificial Intelligence, Selected papers from ALT1994 and AII 1994, 23, 147–168 (1998)

[8] Gasarch, W., Pleszkoch, M., Velauthapillai, M.: Classification using information —conference version. Proceedings of the Fifth International Workshop on AlgorithmicLearning Theory, Reinhardsbrunn, Lecture Notes in Computer Science (Springer Ver-lag, Heidelberg) 872, 290–300 (1994)

[9] Gold, E.M.: Language identification in the limit, Information and Control, 10, 447–474(1967)

[10] Kelly, K.: The Logic of Reliable Inquiry, Oxford University Press, Oxford (1995)[11] Ko, K-I.: Complexity Theory of Real Functions, Birkhauser, Boston (1991)[12] Landweber, L.H.: Decision problems for ω-automata, Mathematical Systems Theory,

3, 376–384 (1969)[13] Lutz, J.: Almost everywhere high nonuniform complexity, Journal of Computer and

System Sciences, 44, 226–258 (1992)[14] McNaughton, R.: Testing and generating infinite sequences by a finite automaton,

Information and Control, 9, 434–448 (1966)[15] Mehlhorn, K.: On the size of sets of computable functions, Proceedings of the Four-

teenth Annual Symposium on Switching and Automata Theory, 190–196, IEEE Com-puter Society (1973)

On one-sided versus two-sided classification 513

[16] Minicozzi, E.: Some natural properties of strong-identification in inductive inference,Theoretical Computer Science, 2, 345–360 (1976)

[17] Nivat, M., Perrin, D. (editors): Automata on Infinite Words. Lecture Notes in ComputerScience 192, Springer-Verlag, Heidelberg (1984)

[18] Odifreddi, P.: Classical Recursion Theory, North-Holland, Amsterdam (1989)[19] Osherson, D.N., Stob, M., Weinstein, S.: Systems that learn. Bradford / MIT Press,

London (1986)[20] Oxtoby, J.C.: Maß und Kategorie. Springer-Verlag, Heidelberg (1971)[21] Post, E.: Recursively enumerable sets of positive integers and their decision problems,

Bulletin of the American Mathematical Society, 50, 284–316 (1944)[22] Rice, H.G.: Classes of enumerable sets and their decision problems, Transactions of

the American Mathematical Society, 74, 358–366 (1953)[23] Rogers, H. Jr.: Theory of recursive functions and effective computability, McGraw-Hill

Book Company, New York (1967)[24] Sacks, G.E.: Higher Recursion Theory, Perspectives in Mathematical Logic, Springer-

Verlag, Heidelberg (1990)[25] Schnorr, C.P.: Zufalligkeit und Wahrscheinlichkeit, Lecture Notes in Mathematics,

218, Springer-Verlag, Heidelberg (1971)[26] Smith, C.H., Wiehagen, R., Zeugmann, T.: Classifying predicates and languages,

International Journal of Foundations of Computer Science, 8, 15–42 (1997)[27] Soare, R.I.: Recursively Enumerable Sets and Degrees, Springer-Verlag, Heidelberg

(1987)[28] Trakhtenbrot, B.A.: Finite Automata and the logic of one place predicates, Siberian

Mathematical Journal, 3, 103–131 [in Russian] (1962)[29] Wiehagen, R., Smith, C.: Generalization versus classification, Proceedings 5th Annual

Workshop on Computational Learning Theory, (ACM-Press, New York, 1992) 224–230