1

Forgive me for asking though some of this has been asked/answered elsewhere and there are many examples on the internet; I ask again because I am doing a Maths course (not computer science) and we don't learn about Turing machines or decidability etc and thus I can't understand many of these explanations.

For my course, a recursively enumerable set R is defined as:

  • A set that is the range of some partial recursive function $f: \Bbb{N} \rightarrow \Bbb{N}$
  • A set that is either empty or the range of a (primitive) recursive function $g: \Bbb{N} \rightarrow \Bbb{N}$
  • A set that is the domain of a partial recursive function $h: \Bbb{N} \rightarrow \Bbb{N}$

Question: If A,B are recursively enumerable, then decide (with proof or counterexample) whether or not the following are recursively enumerable:

$C=A\cap B$; $D=A\cup B$ and $E=A\setminus B$ where $A\setminus B$ is the set theoretic difference.

My thoughts:

$D$ is clearly recursively enumerable as if $A,B$ are empty then the result is trivial. So we assume that each are nonempty and the range of recursive functions and $f$ and $g$ and define: $$h(0)=f(0), h(1)=g(0), h(2)=f(1), h(3)=f(1), h(4)=f(2),\ldots$$ and so on. Thus, $h$ consists of alternate values of $f$ and $g$. Then clearly $D$ is the range of $h$ - a recursive function - and so is recursively enumerable.

Similarly, $C$ is recursively enumerable because A and B are the domains of partial recursive functions and if we denote them $k,l$ respectively, then $C$ is just the domain of $k+l$

I am not so sure about the last part. I suspect that $E$ is not recursively enumerable because I know that a set $A$ is recursive if and only if both $A$ and its complement are recursively enumerable. Since not all sets are recursive, there must be cases where $A$ is recursively enumerable but is complement is not. In this case, $\Bbb{N}\setminus A$ would provide a counterexample. I can't, however, think of an actual example. Any help would be greatly appreciated :)

Andrew
  • 877
  • 2
    You correctly noted that for $A\setminus B$ you get a counterexample by taking $A=\mathbb N$ and $B$ a nonrecursive r.e. set. For that you can take $B={n:W_n\text{ eventually halts if started on a blank tape }}$ where ${W_1,W_2,W_3,\dots}$ is an effective enumeration of the set of all Turing machines. – bof May 22 '16 at 03:08
  • 1
    Or let $B$ be the set of Gödel numbers of theorems of first-order Peano arithmetic, or let $B$ be the set of all logically valid first-order sentences in the language of one binary relation, etc. etc. etc. – bof May 22 '16 at 03:12

1 Answers1

1

In my opinion, the most useful characterization is that a set $\def\nn{\mathbb{N}}$$S \subseteq \nn$ is RE (recursively enumerable) if and only if it is the set accepted by some program $P$ ($P$ on input $x$ outputs "yes" if and only if $x \in S$). Note that since programs may not halt, simply negating the output of $P$ would not in general give a program that accepts the complement of an RE set, since there may be inputs on which $P$ does not output anything at all.

A set is said to be coRE if and only if its complement is RE. The easiest way to show the existence of an RE set that is not coRE is via the halting problem or similar. Let $H$ be the set of pairs $(P,x)$ such that that $P$ halts on $x$. $H$ is clearly RE because we just simulate $P$ on $x$ and accept if it halts. But $H$ is not coRE, otherwise let $D$ be a decider for $H$ and consider the program $Q$ that takes input $P$ and halts if and only if $\neg D(P,P)$, which means that $Q(Q)$ halts if and only if $\neg D(Q,Q)$, which is a contradiction.

user21820
  • 57,693
  • 9
  • 98
  • 256
  • 1
    Perhaps, by the domain of the partial function $h,$ the OP means the set of all $n$ for which $h(n)$ is defined? – bof May 22 '16 at 08:20
  • @bof: But then what on earth would the definition of a partial function be? – user21820 May 22 '16 at 09:53
  • @bof: In any case, the fact that the third point is wrong is not disputable, since the notation $h : \nn \to \nn$ already means that the domain of $h$ is $\nn$. – user21820 May 22 '16 at 09:54
  • @user21820 Late to the party but your claims about partial functions are wrong. A partial function $A\rightarrow B$ is a function with domain a subset of $A$ and codomain $B$. (Yes, this is godawful notation. Some texts modify it to something like "$\subseteq A\rightarrow B$" or "$A\dashrightarrow B$," but most in my experience don't.) All three bulletpoints in the OP are correct. – Noah Schweber Apr 23 '21 at 00:29
  • @NoahSchweber: Regardless of terminological issues, why would you downvote an answer that otherwise explains the key concepts for the actual question? – user21820 Apr 24 '21 at 02:50
  • @user21820 Because in its current form, it contains an incorrect claim which could easily confuse a new student. I'll happily remove my downvote (and upvote) once this answer is fixed. – Noah Schweber Apr 24 '21 at 02:57
  • @NoahSchweber: You mean remove the first paragraph? Ok I've done it, though it is unfortunate (in my opinion) that some people choose to use the same notation "$f : ℕ→ℕ$" for both functions and partial functions. Probably, when I wrote this post (5 years ago!) I was not aware of that. – user21820 Apr 24 '21 at 03:08
  • @user21820 Oh I agree, it is catastrophically shitty notation. That's actually why I take it so seriously - it is a totally reasonable place for beginners to get tripped up (I know I did when I was first learning this stuff). Heck, if you added a paragraph saying how much you hate that notation I'd upvote twice if that was possible. It's especially unforgivable in the latex age where it's so easy to whip up nice-looking alternate notations. – Noah Schweber Apr 24 '21 at 03:09
  • @NoahSchweber: Oh lol I was afraid you didn't want me to say anything about it so I didn't make a fuss hahaha... As for alternative notation, do you have any good suggestions for what you prefer? From the programming side there is this thing called "option type", sometimes denoted by "T?" to mean "of type T or null". I don't like putting "?" at the back because it looks like question mark and just add more confusion? But "?T" looks fine to me, and so we could use "ℕ→?ℕ" for partial functions on ℕ. Unfortunately, nobody else uses such notation as far as I know. – user21820 Apr 24 '21 at 03:15
  • @user21820 Oh I will never stand in the way of complaining about notation :D. As to what I'd like, in my own notes (and once when I taught this long ago) I used "${}^\subseteq\mathbb{N}\rightarrow\mathbb{N}$." I didn't know about the $?$-notation, that's a nice one (and I agree re: "$?\mathbb{N}$" vs. "$\mathbb{N}?$"). I've also seen (in the context of intuitionism, maybe?) notation like "$\mathbb{N}\rightarrow\mathbb{N}_\perp$," but I don't like that as much. – Noah Schweber Apr 24 '21 at 03:22
  • @NoahSchweber: Ah ok. I have no idea what the "⊥" means except that some people use it for non-halting. It kind of has the intuitionist flavour yea. – user21820 Apr 24 '21 at 04:12