this is from Velleman's How To Prove It, exercise 4.6.14.b. The exercise reads as in the title and $A\vartriangle Y$ is the symmetric difference between $X$ and $Y$, so $X\vartriangle Y = (X \setminus Y) \cup (Y \setminus X)$. I have written a proof and would appreciate it if someone could check it. To prove uniqueness I use the equivalence $\exists !xP(x) \equiv \exists x(P(x)\wedge \forall y (P(y) \to y=x))$. Are there any other ways to prove it besides using proof by contradiction twice? Maybe using identities on the symmetric difference operation? Maybe using the equivalence $\exists!xP\left(x\right)\equiv\exists xP\left(x\right)\wedge\forall y\forall z\left(\left(P\left(y\right)\wedge P\left(z\right)\right)\to y=z\right)$? By the way, the relation $R$ is proven to be an equivalence relation in exercise 4.6.14.a.
Suppose $B \subseteq A$, and define a relation $R$ on $\mathscr{P}(A)$ as $$R=\left\{ \left(X,Y\right)\in\mathscr{P}\left(A\right)\times\mathscr{P}\left(A\right)\mid\left(X\vartriangle Y\right)\subseteq B\right\}.$$ Prove that for every $X\in\mathscr{P}\left(A\right)$, there is exactly one $Y\in\left[X\right]_{R}$ such that $Y\cap B=\varnothing$.
Let $Y=X\setminus B$. Then $X\vartriangle\left(X\setminus B\right)=\left(X\setminus\left(X\setminus B\right)\right)\cup\left(\left(X\setminus B\right)\setminus X\right)=\left(X\cap B\right)\subseteq B$, so $Y\in\left[X\right]_{R}$. Since $\left(X\setminus B\right)\cap B=\varnothing$, $Y$ has the desired properties. To see that $Y$ is unique, suppose $Z$ is an arbitrary set such that $Z\in\left[X\right]_{R}$ and $Z\cap B=\varnothing$. We will prove that $Z=X\setminus B=Y$.
Let $x\in Z$ and, seeking a contradiction, suppose $x\notin X$. Then $x\in X \vartriangle Z$. Since $Z\in\left[X\right]_{R}$, $Z\vartriangle X\subseteq B$, so $x\in B$. But $Z\cap B=\varnothing$, so $x\notin B$ and thus we can conclude that $x\in X$. Hence $x\in X\setminus B$, and since $x$ was an arbitrary element of $Z$, it follows that $Z\subseteq X\setminus B$.
Now let $x\in X\setminus B$ and, seeking a contradiction once more, suppose $x\notin Z$. Then $x\in X\setminus Z$, so $x\in X\vartriangle Z\subseteq B$. But we know $x\notin B$, so it must be the case that $x\in Z$. Since $x$ was arbitrary, $X\setminus B\subseteq Z$, and therefore $Z = X\setminus B = Y$.