Definition:Set Difference

From ProofWiki
Jump to navigation Jump to search

Definition

The (set) difference between two sets $S$ and $T$ is written $S \setminus T$, and means the set that consists of the elements of $S$ which are not elements of $T$:

$x \in S \setminus T \iff x \in S \land x \notin T$


It can also be defined as:

$S \setminus T = \set {x \in S: x \notin T}$
$S \setminus T = \set {x: x \in S \land x \notin T}$


Illustration by Venn Diagram

The difference $S \setminus T$ between the two sets $S$ and $T$ is illustrated in the following Venn diagram by the red area:

VennDiagramSetDifference.png


Examples

Example: $\set {1, 2, 3} \setminus \set { 2, 4, 5, 6}$

Let $S$ and $T$ be sets such that:

$S = \set {1, 2, 3}$
$T = \set {2, 4, 5, 6}$

Let $\setminus$ denote set difference.

Then:

$S \setminus T = \set {1, 3}$

while:

$T \setminus S = \set {4, 5, 6}$


Arbitrary Example $1$

Let:

\(\ds A\) \(=\) \(\ds \set {1, 2}\)
\(\ds B\) \(=\) \(\ds \set {2, 3}\)

Then:

$A \setminus B = \set 1$


Also known as

Some sources refer to $S \setminus T$ as the difference set (as opposed to set difference).

Some authors call $S \setminus T$ the relative difference between $S$ and $T$.

Some authors call $S \setminus T$ the (relative) complement of $T$ in $S$, but the standard definition for the latter concept requires that $T \subseteq S$.


$S \setminus T$ can be voiced:

$S$ slash $T$
$S$ cut down by $T$.


Another frequently seen notation for $S \setminus T$ is $S - T$.

Both notations may be encountered on this website, but $\setminus$ is preferred.

Some sources use $S \sim T$.


Also see

  • Results about set difference can be found here.


Sources