Set Complement and Difference: What Is Not in a Set

Set Complement and Difference: What Is Not in a Set
Set Complement and Difference: What Is Not in a Set | Ideasthesia

Here's a thought experiment: define "not a mammal."

You can't list all non-mammals — there are infinitely many things that aren't mammals. Rocks. Numbers. The color blue. But relative to the set of all animals, "not a mammal" becomes manageable: fish, birds, reptiles, insects, and so on.

That's what complement means in set theory: everything outside a set, but within some agreed-upon universe.

The complement operation flips membership. If you're in the set, you're out of the complement. If you're out of the set, you're in the complement. It's the set-theoretic version of "not."


The Universal Set

Complement requires a universal set U — the backdrop containing all elements under consideration.

If we're talking about integers, U = ℤ. If we're talking about students in a class, U = {all students in the class}. If we're talking about animals, U = {all animals}.

The complement of A is everything in U that's not in A.


Complement Notation

The complement of A, relative to U, is written:

Aᶜ or A′ or Ā or U \ A

All mean the same thing:

Aᶜ = {x ∈ U : x ∉ A}

Elements of the universe that are not in A.


Examples

Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

If A = {2, 4, 6, 8, 10} (even numbers), then: Aᶜ = {1, 3, 5, 7, 9} (odd numbers)

If B = {1, 2, 3}, then: Bᶜ = {4, 5, 6, 7, 8, 9, 10}

The complement depends entirely on U. Change the universe, change the complement.


Fundamental Properties

Double complement: (Aᶜ)ᶜ = A

The complement of the complement gives back the original. Makes sense: "not not in A" means "in A."

Empty set complement: ∅ᶜ = U

Everything is outside the empty set.

Universal set complement: Uᶜ = ∅

Nothing is outside everything.

A and Aᶜ are disjoint: A ∩ Aᶜ = ∅

Nothing is both in A and not in A.

A and Aᶜ cover U: A ∪ Aᶜ = U

Everything is either in A or not in A. There's no third option.


Set Difference

What if you want things in one set but not another, without referencing a universal set?

That's set difference, written A \ B (or A - B):

A \ B = {x : x ∈ A and x ∉ B}

Elements of A that aren't in B. You're "subtracting" B from A.

Examples:

  • {1, 2, 3, 4, 5} \ {3, 4} = {1, 2, 5}
  • {a, b, c} \ {c, d, e} = {a, b}
  • A \ ∅ = A (removing nothing changes nothing)
  • A \ A = ∅ (removing everything leaves nothing)

Difference vs. Complement

Set difference is more general than complement:

Aᶜ = U \ A

Complement is just difference from the universal set.

But difference doesn't require a universal set. A \ B works for any two sets, regardless of any ambient universe.


Visualizing Difference

In a Venn diagram:

A \ B is the crescent-shaped region inside circle A but outside circle B.

It's what remains of A after you "cut out" the overlap with B.


Properties of Set Difference

Not commutative: A \ B ≠ B \ A (in general)

{1, 2, 3} \ {2, 3, 4} = {1} {2, 3, 4} \ {1, 2, 3} = {4}

Order matters. You're keeping different things.

Not associative: (A \ B) \ C ≠ A \ (B \ C) (in general)

Identity: A \ ∅ = A

Annihilator: ∅ \ A = ∅

You can't subtract from nothing.


Difference and Intersection

There's a relationship:

A \ B = A ∩ Bᶜ

"In A but not in B" equals "in A and in the complement of B."

This gives you two ways to think about the same operation.


De Morgan's Laws

Here's where complement gets powerful. These laws connect union, intersection, and complement:

(A ∪ B)ᶜ = Aᶜ ∩ Bᶜ

The complement of a union is the intersection of complements.

"Not in A or B" means "not in A and not in B."

(A ∩ B)ᶜ = Aᶜ ∪ Bᶜ

The complement of an intersection is the union of complements.

"Not in both A and B" means "not in A or not in B."

These laws are fundamental. They let you push complement through union and intersection, flipping one into the other.


Proving De Morgan's Laws

Let's prove (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ.

(⊆ direction): Let x ∈ (A ∪ B)ᶜ. Then x ∉ A ∪ B. So x ∉ A and x ∉ B. Therefore x ∈ Aᶜ and x ∈ Bᶜ. Hence x ∈ Aᶜ ∩ Bᶜ. ✓

(⊇ direction): Let x ∈ Aᶜ ∩ Bᶜ. Then x ∈ Aᶜ and x ∈ Bᶜ. So x ∉ A and x ∉ B. Therefore x ∉ A ∪ B. Hence x ∈ (A ∪ B)ᶜ. ✓

Both directions hold, so the sets are equal. ∎


Symmetric Difference

The symmetric difference of A and B, written A △ B:

A △ B = (A \ B) ∪ (B \ A)

Elements in exactly one of the sets — not both, not neither.

Equivalently:

A △ B = (A ∪ B) \ (A ∩ B)

Everything in at least one, minus what's in both.

Think of it as exclusive or (XOR) for sets.


Properties of Symmetric Difference

Commutative: A △ B = B △ A

Associative: (A △ B) △ C = A △ (B △ C)

Identity: A △ ∅ = A

Self-inverse: A △ A = ∅

Symmetric difference with itself gives empty — every element is in both or neither, never exactly one.


Complement in Logic

In logic, complement corresponds to negation:

  • A = {x : P(x) is true}
  • Aᶜ = {x : P(x) is false} = {x : ¬P(x) is true}

De Morgan's laws in logic:

  • ¬(P ∨ Q) ⟺ ¬P ∧ ¬Q
  • ¬(P ∧ Q) ⟺ ¬P ∨ ¬Q

Same structure, different notation. Set theory and logic are parallel languages.


Relative Complement

Sometimes A \ B is called the relative complement of B in A.

It emphasizes that we're taking complement relative to A specifically, not some universal set.

The relative complement of B in A = A \ B = A ∩ Bᶜ


Practical Counting

When counting with complements:

|Aᶜ| = |U| - |A|

Sometimes it's easier to count what you don't want and subtract.

How many integers from 1 to 100 are not divisible by 7? Total: 100. Divisible by 7: 14 (namely 7, 14, 21, ..., 98). Not divisible by 7: 100 - 14 = 86.


The Core Insight

Complement and difference let you talk about absence.

Complement is global: everything outside, relative to the universe. Difference is local: what one set has that another doesn't.

Together with union and intersection, these four operations give you complete control over set manipulation. Any region of a Venn diagram — any possible combination of membership conditions — can be expressed through these building blocks.

The complement operation is the mathematical formalization of "not." It turns exclusion into something you can compute with.


Part 6 of the Set Theory series.

Previous: Venn Diagrams: Making Set Operations Visible Next: De Morgan's Laws: The Duality of And and Or