Set theory - why there are complement operation? [closed]

To see why they are different, let $U=\{1,2,3,4,5,6,7,8,9\}$ be our ambient space. Let $A=\{2,4,6,8\}$ $B=\{1,3,4,5\}$

Then $A^c = \{1,3,5,7,9\}$ while $A \setminus B = \{2,6,8\}$ these sets are not the same.


$A, B\subseteq X$ .

Then, $A^c_X=\{x\in X : x\notin A\}$

Now, \begin{align} A\setminus B &=\{x\in A: x\notin B\}=A\cap (X\setminus B) \end{align}

For, $A^c_X = X \cap (X\setminus A) =X\setminus A$

Hence, $A^c_B =B \setminus A$

For the operation of complement the underlying set $X$ plays an important role.

Here you can see the difference, Set difference $A\setminus B $ and complement of $B$ relative to $A$ are indeed same but not same with the complement relative to the mother set(loosely speaking, Universal Set!).