## You are here

Homeset difference

## Primary tabs

# 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. If $A$ is a set, then

$A\setminus\varnothing=A$ and

$A\setminus A=\varnothing=\varnothing\setminus A.$ 2. If $A$ and $B$ are sets, then

$B\setminus(A\cap B)=B\setminus A.$ 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. 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), 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.

Keywords:

set

Related:

SymmetricDifference, InverseImageCommutesWithSetOperations, Difference2

Synonym:

difference between sets, difference

Type of Math Object:

Definition

Major Section:

Reference

Groups audience:

## Mathematics Subject Classification

03E20*no label found*

- Forums
- Planetary Bugs
- HS/Secondary
- University/Tertiary
- Graduate/Advanced
- Industry/Practice
- Research Topics
- LaTeX help
- Math Comptetitions
- Math History
- Math Humor
- PlanetMath Comments
- PlanetMath System Updates and News
- PlanetMath help
- PlanetMath.ORG
- Strategic Communications Development
- The Math Pub
- Testing messages (ignore)

- Other useful stuff
- Corrections

## Comments

## for example

Often one will see \mathbb{Z} \ {0} to mean "integers except zero", etc

-apk