# Show that the set of all $x$ such that $x \in P$ and $x \notin Q$ exists

I have to show that set of all $$x$$ such that $$x \in P$$ and $$x \notin Q$$ exists. So, I think I have to assume that sets $$P$$ and $$Q$$ already exist. So, with that, I can use axiom schema of specification . This axiom is

$$\forall w_1,\cdots, w_n \, \forall A \,\exists B \,\forall x \left( x \in B \Longleftrightarrow [ x \in A \wedge \varphi(x,w_1, \cdots , w_n, A)] \right)$$

So, I will let $$\varphi(x, Q, P) = x \in P \text{ and } x \notin Q$$. Also, I will let $$A = P$$ and $$w_1 = Q$$. So using universal instantiation, I get the following

$$\exists B \,\forall x \left( x \in B \Longleftrightarrow [ x \in P \wedge \varphi(x, Q, P)] \right)$$

And using, existential instantiation, there exists a set $$B$$ such that

$$\forall x \left( x \in B \Longleftrightarrow [ x \in P \wedge \varphi(x, Q, P)] \right)$$

Using the definition of $$\varphi(x, Q, P)$$, this can be simplified as following

$$\forall x \left( x \in B \Longleftrightarrow [ x \in P \wedge x \in P \wedge x \notin Q] \right)$$

$$\forall x \left( x \in B \Longleftrightarrow [ x \in P \wedge x \notin Q] \right)$$

$$\forall x \left( x \in B \Longleftrightarrow x \in \{ x \,| x \in P \text{ and } x \notin Q \} \right)$$

Now, using axiom of extensionality, it will follow that

$$B = \{ x \,| x \in P \text{ and } x \notin Q \}$$

And, since $$B$$ exists, this means that $$\{ x \,| x \in P \text{ and } x \notin Q \}$$ also exists. Is the proof good ?

• Does this answer your question? Show that $\{ x | x \in P \text{ and } x \in Q \}$ exists
– Rick
Commented Aug 25, 2020 at 9:14
• Rick, yes this is related question. But nobody commented there, so I was unsure if its correct. Commented Aug 25, 2020 at 9:17

As you can already see in your proof, the bit "$$x \in P$$" is unnecessary in your $$\varphi$$ because this is already in the axiom of specification (at least, in the formulation you use). There is nothing really wrong with this, but it might trick you into believing that $$\varphi$$ can contain parameters. Really $$\varphi$$ is just a formula in the language of set theory. So it would be more precise to say that $$\varphi(x, w_1, z)$$ is $$x \not \in w_1$$ (or $$x \in z \wedge x \not \in w_1$$). Then after the step of universal instantiation the sets $$Q$$ and $$P$$ come in the place of $$w_1$$ and $$z$$ respectively.
• But axiom schema of specification is a true statement since its an axiom. So, there are no free variables. Which means that $\varphi$ should have variables which are present in other part of the axiom. Right ? Commented Aug 25, 2020 at 9:23
• @user9026 There are indeed no free variables in the axiom (schema) itself. The schema ranges over all formulas $\varphi(x, w_1, \ldots, w_n, z)$ in the language of set theory. So yes, the free variables in $\varphi$ will be quantified in the axiom (I replaced $A$ by $z$ to emphasise it being a variable). The point is that $\varphi(x, Q, P)$ is technically not a formula in the language of set theory as it contains parameters $Q$ and $P$ (these are actual sets, not variables). Put differently: $Q$ and $P$ are not part of the axiom, they only enter the picture after universal instantiation. Commented Aug 25, 2020 at 9:32
• I agree Mark. And to use the axiom itself, we should argue that sets $P$ and $Q$ already exist as I did. Only then we can use universal instantiation. Commented Aug 25, 2020 at 9:38