Complement of a Set
If a set B is a subset of a set A, $$ B \subseteq A $$ the relative complement of B in A is the set of all elements that belong to A but not to B: $$ A \setminus B = \{ x \in A \mid x \notin B \} $$ This set is also called the complement of B in A.
In simple terms, the complement of B in A contains everything that is in A after removing the elements that also belong to B.
The notation $$ A \setminus B $$ is read as "A minus B" or "the complement of B in A".
The idea is illustrated in the following Venn diagram.

The shaded region represents the complement of B in A, namely the set $$ A \setminus B $$
In set theory, the relative complement is equivalent to the set difference A-B.
An Example
Consider the following finite sets:
$$ A = \{ 2, 4, 6, 8, 10 \} $$
$$ B = \{ 4, 6 \} $$
To find the complement of B in A, remove from A all elements that also belong to B.
$$ A \setminus B = A-B = \{ 2, 8, 10 \} $$
The result can be visualized using an Euler-Venn diagram.

Explanation. The elements 4 and 6 appear in both sets A and B. Since these elements are shared by the two sets, they are excluded from the complement. What remains are the elements that belong only to A: {2, 8, 10}.
Example 2
The concept works in exactly the same way for infinite sets.
Let
$$ N = \{ 1, 2, 3, 4, 5, \ldots \} $$
$$ P = \{ 2, 4, 6, 8, \ldots \} $$
where N is the set of natural numbers and P is the set of even natural numbers.
Removing all even numbers from N leaves only the odd numbers:
$$ N \setminus P = D = \{ 1, 3, 5, 7, 9, \ldots \} $$
Therefore, the complement of P in N is the set of odd natural numbers.
Absolute Complement
Given a universal set U, the absolute complement of a set A is the set of all elements of U that do not belong to A: $$ C_A = \{ x \in U \mid x \notin A \} $$ In many textbooks, this is referred to simply as the complement of A.
What Is the Universal Set?
The universal set U contains all elements being considered in a particular context.
Every set under discussion is assumed to be a subset of the universal set.
For this reason, the universal set serves as the reference set when defining an absolute complement.
Example
Let A be a subset of the universal set U.
The complement of A, denoted by CA, consists of all elements that belong to U but not to A.

In the diagram, the shaded region represents the complement of A.
Equivalently, the complement can be written as U\A or U-A.
Other common notations include CA, Ac, A′ and, in some contexts, -A.
Properties of Complements
Complements satisfy several useful properties that are frequently used in set theory and mathematical reasoning.
- The complement of a set with respect to itself is the empty set:
$$ A \setminus A = A-A = \varnothing $$
- If two sets are equal, their difference is empty:
$$ A=B \Longrightarrow A-B = \varnothing $$
- The complement of the empty set with respect to A is A itself:
$$ A \setminus \varnothing = A $$
- If A is a subset of B, then combining A with its complement in B reconstructs the entire set B:
$$ A \cup (B \setminus A) = B $$
- If A is a subset of B, then A and its complement in B have no elements in common:
$$ A \cap (B \setminus A) = \varnothing $$
These properties follow directly from the definition of a complement and provide the foundation for many results in set theory, logic, probability, and other areas of mathematics.
