Why does the Axiom of Selection solve Russell's Paradox in Set Theory?

I am a beginner in mathematics and I was reading a text on Set Theory that talked about how Zermelo's Axiom of Selection "solves" Russel's Paradox.

I understand that the the axiom does not allow constructions of the form $$\{x \:: \text S(x) \}$$ and only allows$$\{x \in \text A \:: \text S(x) \}$$ but how does this change the outcome of the paradox when we have:
$$S = \{x \in \text A \:: \text x \notin \text x \}$$ where $S$ is still the set of all sets that do not contain themselves.

Won't we still get the paradox?


Axiom of regularity (or Foundation) rules out the case $S\in S$.

Otherwise, we would have $S\notin S$. Now does this imply $S\in S$?

The problem with Russel's paradox is it implicitly implies existence of universal set ("set of all sets").

If $A$ is a set and $S=\{x\in A:x\notin x\}$, $S\notin S$ implies either $S\in S$ or $S\notin A$.

In case of Russell's paradox, it is not possible to have $S\notin A$, because $S$ must belong to set of all sets, if that existed, and leads us to paradox $S \in S$. But with our construction such set cannot exist (exactly because existence of such set leads us to Russell's paradox). So paradox does not arise.


If we assume the existence of a set $R$ such that $$R=\{x: x\notin x\}$$then we can obtain the contradiction $R\in R $ and $R\notin R$. So, $R$ cannot exist.

To avoid Russell's Paradox then, all we need to do is not assume that, for every unary predicate $P$, there exists a set $S$ such that $$S=\{x:P(x)\}$$

If, however, $A$ is assumed or proven to be a set, then we can assume without fear of contradiction that there exists a subset $S\subset A$ such that $$S=\{x\in A: P(x)\}$$Or equivalently$$S=\{ x: x\in A \text{ and } P(x)\}$$

You can think of $P(x)$ as the criterion for selecting elements from the set $A$ for the subset $S$. The only restriction is that the variable $S$ may not occur in the selection criterion. This is the Axiom of Specification (Selection).

If, for example, we have set $A$, then we can assume that there exists a subset $S\subset A$ such that $$S=\{x\in A: x\notin x\}$$ Or equivalently $$S=\{x:x\in A \text{ and } x\notin x\}$$ Then we would not obtain a contradiction, but we would have $S\notin A$. (Proof left as an exercise.)