Set difference

The set of elements in A that are not in B, denoted A \ B
Set difference

Let AA and BB be . The set difference (or relative complement) of BB in AA is

AB={x:xA and xB}. A \setminus B = \{x : x \in A \text{ and } x \notin B\}.

Set difference can be expressed using and a when a universe is fixed, and it is a basic operation in describing and .

Examples:

  • {1,2,3}{2}={1,3}\{1,2,3\} \setminus \{2\} = \{1,3\}.
  • (0,2)(1,3)=(0,1](0,2)\setminus(1,3) = (0,1].
  • If ABA \subseteq B (see ), then AB=A\setminus B = \emptyset.