# set difference

## Definition

Let $A$ and $B$ be sets. The set difference (or simply difference) between $A$ and $B$ (in that order) is the set of all elements of $A$ that are not in $B$. This set is denoted by $A\setminus B$ or $A-B$ (or occasionally $A\sim B$). So we have

 $A\setminus B=\{x\in A\mid x\notin B\}.$
 Venn diagram showing $A\setminus B$ in blue

## Properties

Here are some properties of the set difference operation:

1. 1.

If $A$ is a set, then

 $A\setminus\varnothing=A$

and

 $A\setminus A=\varnothing=\varnothing\setminus A.$
2. 2.

If $A$ and $B$ are sets, then

 $B\setminus(A\cap B)=B\setminus A.$
3. 3.

If $A$ and $B$ are subsets of a set $X$, then

 $A\setminus B=A\cap B^{\complement}$

and

 $(A\setminus B)^{\complement}=A^{\complement}\cup B,$

where ${}^{\complement}$ denotes complement in $X$.

4. 4.

If $A$, $B$, $C$ and $D$ are sets, then

 $(A\setminus B)\cap(C\setminus D)=(A\cap C)\setminus(B\cup D).$

## Remark

As noted above, the set difference is sometimes written as $A-B$. However, if $A$ and $B$ are sets in a vector space (or, more generally, a module (http://planetmath.org/Module)), then $A-B$ is commonly used to denote the set

 $A-B=\{a-b\mid a\in A,b\in B\}$

rather than the set difference.

Title set difference SetDifference 2013-03-22 11:59:38 2013-03-22 11:59:38 yark (2760) yark (2760) 33 yark (2760) Definition msc 03E20 difference between sets difference SymmetricDifference InverseImageCommutesWithSetOperations Difference2