Skip to content

Difference Set

Definition

Given two sets AA and B,B\text{,} we define the difference set A∖BA\setminus B or A−BA-B to be the set AA with any elements of BB removed. In other words, we have x∈A∖B    ⟺    (x∈A)∧(x∉B).x\in A\setminus B\;\iff\; (x\in A)\land (x\notin B)\text{.}


Interpretation

The difference A∖BA\setminus B keeps the elements of AA and removes those that also lie in BB. The set BB acts only as a filter: its elements outside AA play no role, and BB need not be a subset of AA.

Two overlapping discs A and B with the part of A outside B shaded as the difference A minus B, and the overlap and the part of B outside A labelled.

The shaded crescent is A∖BA\setminus B, the part of disc AA outside disc BB. The lens A∩BA\cap B is removed, and the right-hand crescent B∖AB\setminus A is never part of the result. The two crescents are different sets in general, which is the asymmetry in the Key Results, and A∖B=∅A\setminus B=\varnothing if and only if A⊆BA\subseteq B. Inside a fixed universal set, A∖B=A∩B∁A\setminus B=A\cap B^{\complement} with the complement of BB: "in AA and not in BB".

A common slip is to count elements as ∣A∖B∣=∣A∣−∣B∣|A\setminus B|=|A|-|B|. For finite sets the correct count is ∣A∖B∣=∣A∣−∣A∩B∣|A\setminus B|=|A|-|A\cap B|: with A={1,2,3}A=\{1,2,3\} and B={2,4}B=\{2,4\} it is 3−1=23-1=2, not 3−2=13-2=1. The two agree only when B⊆AB\subseteq A.


Key Results

  • Set difference is not commutative: in general A∖B≠B∖AA\setminus B\neq B\setminus A (for example {1}∖{2}={1}\{1\}\setminus\{2\}=\{1\} but {2}∖{1}={2}\{2\}\setminus\{1\}=\{2\}).
  • The difference of a set with itself is empty.

Examples

  • If A={1, 2, 3}A=\{1,\,2,\,3\} and B={2, 4},B=\{2,\,4\}\text{,} then A∖B={1, 3}.A\setminus B=\{1,\,3\}\text{.}
  • A∖∅=A.A\setminus\varnothing=A\text{.}

Prerequisites

Sources

Aliases: set difference, difference of sets, relative complement, set minus, set-theoretic difference Symbols: element of, intersection, subset

Last updated: 20 October 2026 03:02