Definition:Set Difference

The difference between two sets $$S$$ and $$T$$ is written $$S - T$$, and means the set that consists of the elements of $$S$$ which are not elements of $$T$$:

$$x \in S - T \iff x \in S \land x \notin T$$

This can also be written $$S - T = \left\{{x \in S : x \notin T}\right\}$$

For example, if $$S = \left\{{1, 2, 3}\right\}$$ and $$T = \left\{{2, 3, 4}\right\}$$, then $$S - T = \left\{{1}\right\}$$, while $$T - S = \left\{{4}\right\}$$.

It can immediately be seen that $$S - T$$ is not commutative.

Another frequently seen notation for $$S - T$$ is $$S \backslash T$$.

The expression $$S - T$$ is referred by some authors as the relative complement of $$T$$ in $$S$$.