Ma · Mathematics

Why Is (A\C)\(B\C) Equal to (A\B)\C?

Published By the 9to5Science editorial team

At a glance

  1. 1. Start with membership

    Take an arbitrary element x and translate each set difference into membership and nonmembership conditions.

  2. 2. Simplify the left side

    Because x is already outside C, excluding elements of B ∖ C is equivalent to requiring x to be outside B.

  3. 3. Match the right side

    The resulting conditions are exactly that x belongs to A, not B, and not C.

  4. 4. Conclude equality

    Since both sides contain precisely the same elements, the two sets are equal.

The identity is true for all sets AA, BB, and CC. The key is to read set difference as a membership condition: x∈X∖Yx\in X\setminus Y means that xx is in XX and is not in YY. Applying that meaning to both sides shows that they contain exactly the same elements.

Prove the identity element by element

Take any object xx. It belongs to the left-hand side precisely when it belongs to A∖CA\setminus C and does not belong to B∖CB\setminus C:

x∈(A∖C)∖(B∖C)  ⟺  x∈A∖C and x∉B∖C  ⟺  x∈A, x∉C, and not (x∈B and x∉C)  ⟺  x∈A, x∉C, and x∉B  ⟺  x∈A∖B and x∉C  ⟺  x∈(A∖B)∖C.\begin{aligned} x\in (A\setminus C)\setminus(B\setminus C) &\iff x\in A\setminus C\text{ and }x\notin B\setminus C\\ &\iff x\in A,\ x\notin C,\text{ and not }(x\in B\text{ and }x\notin C)\\ &\iff x\in A,\ x\notin C,\text{ and }x\notin B\\ &\iff x\in A\setminus B\text{ and }x\notin C\\ &\iff x\in (A\setminus B)\setminus C. \end{aligned}

In the third line, the condition x∉Cx\notin C is already known. Therefore, for xx not to belong to B∖CB\setminus C, it must not belong to BB. This is the step that makes the identity work.

Because the equivalence holds for every xx, the two sets have the same elements, so

(A∖C)∖(B∖C)=(A∖B)∖C.(A\setminus C)\setminus(B\setminus C)=(A\setminus B)\setminus C.

A shorter way to see it

Both sides can be described as “the elements of AA that are in neither BB nor CC.” In set notation, that description is

A∖(B∪C).A\setminus(B\cup C).

For the left side, first removing CC and then removing B∖CB\setminus C removes all elements of CC and all elements of BB not already removed. Together, those are exactly the elements of B∪CB\cup C. For the right side, removing BB and then removing CC has the same effect. Hence both sides equal A∖(B∪C)A\setminus(B\cup C).

This argument also shows that the order in which you remove BB and CC does not matter:

(A∖B)∖C=(A∖C)∖B=A∖(B∪C).(A\setminus B)\setminus C=(A\setminus C)\setminus B=A\setminus(B\cup C).

Worked example

Let the universe for this example be the positive integers up to 88, and choose

A={1,2,3,4,5},B={2,4,6},C={3,4,7}.A=\{1,2,3,4,5\},\quad B=\{2,4,6\},\quad C=\{3,4,7\}.

Evaluate the left side in stages:

  • A∖C={1,2,5}A\setminus C=\{1,2,5\}.
  • B∖C={2,6}B\setminus C=\{2,6\}.
  • Removing {2,6}\{2,6\} from {1,2,5}\{1,2,5\} leaves {1,5}\{1,5\}.

Now evaluate the right side:

  • A∖B={1,3,5}A\setminus B=\{1,3,5\}.
  • Removing C={3,4,7}C=\{3,4,7\} leaves {1,5}\{1,5\}.

The two sides agree. The common description A∖(B∪C)A\setminus(B\cup C) gives the same result, since B∪C={2,3,4,6,7}B\cup C=\{2,3,4,6,7\} and A∖(B∪C)={1,5}A\setminus(B\cup C)=\{1,5\}.

Common mistakes

Treating set difference as symmetric. In general, X∖YX\setminus Y is not the same as Y∖XY\setminus X. The first keeps elements of XX that are not in YY; the second starts with YY instead.

Dropping a condition too early. From x∉B∖Cx\notin B\setminus C alone, you cannot conclude x∉Bx\notin B: an element of BB might also be in CC, and then it is not in B∖CB\setminus C. The conclusion follows here only because membership in the left side already gives x∉Cx\notin C.

Ignoring parentheses. The expression (A∖C)∖(B∖C)(A\setminus C)\setminus(B\setminus C) specifies exactly which sets are being subtracted. Parentheses matter when translating a nested expression into membership conditions.

Checking only one example. A finite example can help you understand the operations, but it does not prove a statement for all sets. The arbitrary-element argument establishes the identity in full generality.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.