I have a question related to axiom schema of specification and set notation.
Now my specific question goes like this.
Let $X = \{a,b\}$ be given ($a \neq b$). Define $f: \mathcal{P}(X) \to X$ as $f(\emptyset) = a$, $f(\{a\}) = b$, $f(\{b\}) = a$, $f(\{a,b\}) = a$. Now consider the set (written informally) $$ S = \{f(A) \in X: f(A) \notin A\}. $$ Is $a \in S$?
My reasoning is that using axiom schema of specification, $S = \{ x \in X : \exists A \big( x=f(A) \land A \in \mathcal{P}(X) \land f(A) \notin A \big) \}$. Since $ f(\emptyset) = a \notin \emptyset $, $a \in S$. Although $f(\{a,b\}) = a \in \{a,b\}$, I don't think this gives the contradictory result $a \notin S$. To say $a \notin S$ (in other words, $a \in X \setminus S$), we have to check
$$ \lnot \exists A(x=f(A) \land A \in \mathcal{P}(X) \land f(A) \notin A) \iff \forall A (x \neq f(A) \lor A \notin \mathcal{P}(X) \lor f(A) \in A) $$
Since $A = \emptyset$ gives $a = f(\emptyset)$, $\emptyset \in \mathcal{P}(X)$, $f(\emptyset) = a \notin \emptyset$, I think one cannot conclude $a \notin S$.
I'm very confused. Is $S$ just an ill-defined set? Any comments are appreciated