Skip to content

Mathematics · Ch 1 — Sets

Difference of Sets

1.7

Difference of Sets

Difference of sets. The difference of two sets AA and BB (in that order), written

A−BA - B (also read "AA minus BB"), is the set of elements that belong to AA but do

not belong to BB:

A−B={x:x∈A and x∉B}.A - B = \{x : x \in A \text{ and } x \notin B\}.

Not commutative. Unlike union and intersection, set difference is generally

not commutative — that is, A−B≠B−AA - B \ne B - A in general, because the two sets

describe entirely different things: A−BA - B keeps only AA's "private" elements, while

B−AB - A keeps only BB's "private" elements.

Worked illustration. Let A={a,b,c,d,e}A = \{a, b, c, d, e\} and B={b,d,f,g}B = \{b, d, f, g\}. Then

A−B={a,c,e}(elements of A not in B),A - B = \{a, c, e\} \quad (\text{elements of } A \text{ not in } B),

B−A={f,g}(elements of B not in A).B - A = \{f, g\} \quad (\text{elements of } B \text{ not in } A).

Clearly A−B≠B−AA - B \ne B - A here, confirming that difference is not commutative.

A−BA - B and B−AB - A are always disjoint. For any two sets AA and BB,

(A−B)∩(B−A)=∅.(A - B) \cap (B - A) = \varnothing.

Proof. Suppose, for contradiction, some element xx belonged to both A−BA - B and

B−AB - A. Since x∈A−Bx \in A - B, we have x∈Ax \in A and x∉Bx \notin B. Since

x∈B−Ax \in B - A, we have x∈Bx \in B and x∉Ax \notin A. But "x∈Ax \in A" and "x∉Ax \notin A"

cannot both be true at once — a contradiction. Hence no such xx exists, so

(A−B)∩(B−A)=∅(A - B) \cap (B - A) = \varnothing. ■\blacksquare This matches the Venn-diagram

picture directly: A−BA - B is the part of circle AA outside the overlap, and B−AB - A

is the part of circle BB outside the overlap — two regions that, by construction,

never touch.

Relation to a Venn diagram. In the two-circle Venn diagram of Section 1.5, A−BA - B …