Here is an excerpt of Barry Cooper's book Computability Theory (2004), bottom half of page 179, which is short enough that I can copy it verbatim:
THEOREM 11.1.13 (Selman's Theorem, 1971) For any $A,B\subseteq\mathbb{N}$ $$A \mathrel{\leq_e} B \;\Longleftrightarrow\; \forall X[B\text{ c.e. in }X \Rightarrow A\text{ c.e. in }X]$$
PROOF (sketch) The left-to-right implication I will leave to you.
Conversely, assume that $A \mathrel{\not\leq_e} B$. We will construct a $C = \bigcup_{s\geq 0} C _ s$ such that $B$ is c.e. in $C$ but $A$ is not c.e., in $C$.
We satisfy “$B$ c.e. in $C$” by imposing an overall requirement $$\exists\langle x,y\rangle\in C \;\Longleftrightarrow\; x\in B \tag{11.1}$$ for each $x\geq 0$. Call a finite $D\supseteq C_s$ admissible if it satisfies Equation (11.1) with $D$ in place of $C$, but with the right-to-left half of Equation (11.1) restricted to $x\leq s$ (so that the admissible $D$'s can be enumerated from an enumeration of $B$ and a finite amount of information about $\overline{B}$).
We satisfy $A\neq W_s^C$ (at stage $s+1$) by looking for some admissible $D\supseteq C_s$ with $x \in W_s^D - A$. If $D$ exists, choose $C_{s+1} = D$ giving $A \neq W_s^C$. Otherwise, either $x\in A - W_s^D$ for some $x$, all admissible $D$ (so $A\neq W_s^C$ again), or $$\forall x(x\in A \;\Longleftrightarrow\; \exists\text{ an admissible }D\text{ such that }x\in W_s^D),$$ giving $A \mathrel{\not\leq_e} B$, a contradiction. ∎
Notation is mostly standard:
$A \mathrel{\leq_e} B$ stands for enumeration reductibility, i.e., this means “there exists a computably enumerable set $U$ such that ($\forall n$) we have $n\in A$ iff $\exists D\text{ finite}\subseteq B$ such that $\langle n,D\rangle \in U$”;
$W_e^X = \operatorname{dom}\Phi_e^X$ is the $e$-th set computably enumerable in $X$, where $\Phi_e^X$ stands for the $e$-th Turing machine with oracle the characteristic function of $X$; and “$A$ is c.e. in $X$” means there is $e$ such that $A = W_e^X$;
and of course, $\langle,\rangle$ is a coding of pairs by natural numbers.
Now I understand the idea of the proof: we contruct $C$ in stages in such a way that the $s$-th stage ensures $B$ is its first projection up to $s$, and that $A$ does is not $W_s^C$.
But here's what I do not understand: why does $A\neq W_s^D$ ensure $A\neq W_s^C$? or more precisely, why does the construction of (the finite set) $D$ at stage $s$ ensure that we will have $A\neq W_s^C$ in the end?
My problem is that the Turing machine with oracle $\Phi_s^Z$, might have made some queries of the form “$k\in Z$?” which were responded negatively by the oracle when $Z=D$, but which get a positive answer when given $Z=C$ as oracle since the elements $k$ in question might be added at later stages of the construction of $C$. That is, the construction in the proof seems to record only positive information about $C$ (needed to satisfy the constraints), but no negative information (“we shouldn't add this element as it would change the elements of the $W_s^C$”), and I don't understand how this can work.
It almost seems like the proof is assuming that $X\subseteq Y$ implies $W_s^X \subseteq W_s^Y$ (which, unless I'm out of my mind, is completely wrong): this would make sense to me if we were to replace $W_s^X$ by the set of $n$ such that $\exists D\text{ finite}\subseteq X$ such that $\langle n,D\rangle \in W_s$, as in the definition of enumeration reducibility… but this is not what it is about. So I'm confused.
Can someone explain to me what I'm missing?