\setminus

The \setminus operator is used to denote the set difference between two sets. In set theory, if A and B are sets, then A \setminus B represents the set of elements that are in A but not in B.

Examples

Set difference between sets A and B

A \setminus B = \{ x \in A \mid x \notin B \}

The set of all irrational numbers, which is the set of real numbers excluding the rational numbers

\mathbb{R} \setminus \mathbb{Q}

The set S excluding the element a

S \setminus \{ a \}