Complement (set theory)

In set theory, the complement of a subset of a given set is the "remainder" of the larger set.

Formally, if A is a subset of X then the (relative) complement of A in X is


 * $$X \setminus A = \{ x \in X : x \not\in A \} . \, $$

In some version of set theory it is common to postulate a "universal set" $$\mathcal{U}$$ and restrict attention only to sets which are contained in this universe. We may then define the (absolute) complement


 * $$\bar A = \mathcal{U} \setminus A . \,$$

The relation of complementation to the other set-theoretic functions is given by De Morgan's laws:


 * $$\overline{A \cap B} = \bar A \cup \bar B ; \,$$
 * $$\overline{A \cup B} = \bar A \cap \bar B . \,$$