Operations and families · Definition

Relative complement

set theoryoperations and families

Before you start you need to know

The relative complement describes what remains of A once the elements of B are removed.

Definition

The relative complement of \(B\) in \(A\) is the set \(A \setminus B\) of elements of \(A\) that do not belong to \(B\).

\[A \setminus B = \{x \in A : x \notin B\}\]

Since \(A \setminus B = \{x \in A : x \notin B\}\), the set is always contained in \(A\): \(A \setminus B \subseteq A\). If \(B \subseteq A\), the sets \(B\) and \(A \setminus B\) are disjoint and their union is \(A\), so \(|A| = |B| + |A \setminus B|\) when \(A\) is finite. If \(B\) is not contained in \(A\), the difference is still defined and equals \(A \setminus (A \cap B)\).

Worked example: let \(A = \{1,2,3,4,5,6\}\) and \(B = \{2,4,6\}\). Then \(A \setminus B = \{1,3,5\}\). Order matters: \(B \setminus A = \varnothing\), while \(A \setminus B = \{1,3,5\}\).

Typical mistake: writing \(A \setminus B = B \setminus A\) as if the operation were symmetric. Set difference is not commutative; the symmetric difference \(A \,\triangle\, B\) is. Another error is forgetting that \(A \setminus B\) keeps only elements of \(A\), even when \(B\) has elements outside \(A\).

Think about it

Is \(A \setminus B\) always equal to \(B \setminus A\)?

No. With \(A=\{1,2\}\) and \(B=\{2,3\}\), \(A \setminus B=\{1\}\) and \(B \setminus A=\{3\}\).

Exercises 10

References

  • Herbert B. Enderton, Elements of Set Theory, 1st edition, Academic Press, 1977.
  • Thomas Jech, Set Theory (The Third Millennium Edition), 3rd millennium edition, Springer, 2003.