A way of modifying a set by removing the
elements belonging to another set. Subtraction of sets is indicated
by either of the symbols – or
\. For example, A minus B can be written either A – B or
A \ B.
x = An element that belongs to A but does not belong to B
A−B = The resulting set after subtraction (also written A \ B)
Worked Example
Problem: Let A = {1, 2, 3, 4, 5, 6} and B = {2, 4, 6, 8}. Find A − B.
Step 1: Write out the definition: A − B contains every element that is in A and not in B.
A−B={x∣x∈A and x∈/B}
Step 2: Check each element of A against B. The element 1 is in A but not in B, so 1 stays. The element 2 is in both A and B, so 2 is removed.
1∈A,1∈/B⟹1∈A−B
Step 3: Continue for the remaining elements: 3 is not in B (keep), 4 is in B (remove), 5 is not in B (keep), 6 is in B (remove).
3∈/B✓,4∈B×,5∈/B✓,6∈B×
Step 4: Collect the remaining elements into the result set.
A−B={1,3,5}
Answer: A − B = {1, 3, 5}
Another Example
This example uses the same two sets but reverses the order of subtraction, demonstrating that set subtraction is NOT commutative — A − B ≠ B − A in general.
Problem: Let A = {1, 2, 3, 4, 5, 6} and B = {2, 4, 6, 8}. Find B − A.
Step 1: Notice the order is reversed compared to the first example. Now we keep elements in B that are not in A.
B−A={x∣x∈B and x∈/A}
Step 2: Check each element of B: 2 is in A (remove), 4 is in A (remove), 6 is in A (remove), 8 is not in A (keep).
2∈A×,4∈A×,6∈A×,8∈/A✓
Step 3: Collect the remaining elements.
B−A={8}
Answer: B − A = {8}
Frequently Asked Questions
Is set subtraction the same as set difference?
Yes, they are two names for the same operation. Both refer to removing from one set all elements that belong to another set. You may see it written as A − B, A \ B, or described as "the difference of A and B."
Is set subtraction commutative?
No. The order matters. A − B gives you elements in A that are not in B, while B − A gives you elements in B that are not in A. These are generally different sets. For instance, {1, 2, 3} − {2, 3, 4} = {1}, but {2, 3, 4} − {1, 2, 3} = {4}.
What is the difference between set subtraction and complement?
Set subtraction A − B removes elements of B from A and works with any two sets. The complement of a set A (written Aᶜ or A') removes all elements of A from the universal set U. In fact, the complement is a special case: Aᶜ = U − A.
Set Subtraction (A − B) vs. Set Intersection (A ∩ B)
Set Subtraction (A − B)
Set Intersection (A ∩ B)
Definition
Elements in A that are NOT in B
Elements that are in BOTH A and B
Formula
{x | x ∈ A and x ∉ B}
{x | x ∈ A and x ∈ B}
Commutative?
No — A − B ≠ B − A in general
Yes — A ∩ B = B ∩ A always
Venn diagram region
The part of circle A that does not overlap with circle B
The overlapping region of both circles
Relationship
A − B = A − (A ∩ B)
A ∩ B = A − (A − B)
Why It Matters
Set subtraction appears throughout discrete mathematics, probability, and computer science. When you calculate the probability of "A but not B," you are using set subtraction on event sets. Database queries, filtering data, and programming operations like removing items from a list all rely on this concept.
Common Mistakes
Mistake: Assuming A − B equals B − A (treating set subtraction as commutative).
Correction: Set subtraction is not commutative. Always pay attention to which set comes first. A − B removes B's elements from A, while B − A removes A's elements from B. These usually give different results.
Mistake: Including elements from B that are not in A in the result of A − B.
Correction: A − B can only contain elements that were originally in A. You never add elements from B; you only remove them. If an element is in B but not in A, it simply does not appear in A − B.