Set notation
The symbols of set theory, what each one is called, how to read it aloud and a worked example. Operations come with a Venn diagram and the logic connective they match.
Set notation symbols and their meanings
The examples use the universal set U = {1, 2, 3, 4, 5, 6, 7, 8}, with A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Each one is computed, not typed in.
Tap a diagram to open it in the Venn diagram generator, where you can shade any expression of up to three sets.
Printable set notation chart
Every symbol in the table above with its name, reading and example on one sheet, for printing or revision.
Click to download: Set notation symbols chart
Roster and set-builder notation
There are two ways to write a set down. Roster notation lists the elements between braces: {1, 2, 3, 4}. Order and repeats do not matter, so {2, 1, 1} is the same set as {1, 2}. Set-builder notation gives a rule instead: {x : condition}, read "the set of all x such that" the condition holds. It is the only way to write most infinite sets.
| Set-builder | Roster |
|---|---|
| {x ∈ ℤ : 1 ≤ x ≤ 4} | {1, 2, 3, 4} |
| {x ∈ U : x is even} | {2, 4, 6, 8} |
| {x² : x ∈ {1, 2, 3}} | {1, 4, 9} |
| {x ∈ ℤ : x² = 4} | {-2, 2} |
| {x ∈ ℤ : x² < 0} | ∅ |
The operations themselves are defined in set-builder notation, and each definition is a logic statement about membership:
- A ∪ B = {x : x ∈ A ∨ x ∈ B}
- A ∩ B = {x : x ∈ A ∧ x ∈ B}
- A′ = {x ∈ U : ¬(x ∈ A)}
- A − B = {x : x ∈ A ∧ x ∉ B}
- A Δ B = {x : x ∈ A ⊕ x ∈ B}
The laws of set algebra
These identities hold for any sets A, B and C. Each was checked here by shading both sides on a three-set diagram and comparing all eight regions; the diagram shows the shading both sides share.
| Law | Sets | Logic | Both sides | Check |
|---|---|---|---|---|
| Commutative | A ∪ B = B ∪ A | A ∨ B = B ∨ A | Checked | |
| Commutative | A ∩ B = B ∩ A | A ∧ B = B ∧ A | Checked | |
| Associative | (A ∪ B) ∪ C = A ∪ (B ∪ C) | A ∨ B ∨ C = A ∨ B ∨ C | Checked | |
| Associative | (A ∩ B) ∩ C = A ∩ (B ∩ C) | A ∧ B ∧ C = A ∧ B ∧ C | Checked | |
| Distributive | A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) | A ∧ (B ∨ C) = A ∧ B ∨ A ∧ C | Checked | |
| Distributive | A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) | A ∨ B ∧ C = (A ∨ B) ∧ (A ∨ C) | Checked | |
| De Morgan's | (A ∪ B)′ = A′ ∩ B′ | ¬(A ∨ B) = ¬A ∧ ¬B | Checked | |
| De Morgan's | (A ∩ B)′ = A′ ∪ B′ | ¬(A ∧ B) = ¬A ∨ ¬B | Checked | |
| Complement | A ∪ A′ = U | A ∨ ¬A = 1 | Checked | |
| Complement | A ∩ A′ = ∅ | A ∧ ¬A = 0 | Checked | |
| Double complement | (A′)′ = A | ¬¬A = A | Checked | |
| Identity | A ∪ ∅ = A | A ∨ 0 = A | Checked | |
| Identity | A ∩ U = A | A ∧ 1 = A | Checked | |
| Domination | A ∪ U = U | A ∨ 1 = 1 | Checked | |
| Domination | A ∩ ∅ = ∅ | A ∧ 0 = 0 | Checked | |
| Idempotent | A ∪ A = A | A ∨ A = A | Checked | |
| Idempotent | A ∩ A = A | A ∧ A = A | Checked | |
| Absorption | A ∪ (A ∩ B) = A | A ∨ A ∧ B = A | Checked | |
| Absorption | A ∩ (A ∪ B) = A | A ∧ (A ∨ B) = A | Checked | |
| Difference | A − B = A ∩ B′ | A ∧ ¬B = A ∧ ¬B | Checked |
Every one of these is also a law of boolean algebra, with ∪ as OR, ∩ as AND and ′ as NOT, U as 1 and ∅ as 0: compare the boolean algebra laws, where the same identities are proved with truth tables. De Morgan's pair has a page of its own.
How set notation maps to logic
Read each set as the statement "x is in it", and the set operations become the connectives of propositional logic and the gates of a circuit.
| Sets | Logic | Gate |
|---|---|---|
| A ∪ B | p ∨ q | OR |
| A ∩ B | p ∧ q | AND |
| A′ | ¬p | NOT |
| A − B | p ∧ ¬q | AND with one input inverted |
| A Δ B | p ⊕ q | XOR |
| (A Δ B)′ | p ↔ q | XNOR |
| A ⊆ B | p → q, for every x | – |
| U | ⊤ (true, 1) | constant 1 |
| ∅ | ⊥ (false, 0) | constant 0 |
So A ⊆ B says the conditional "if x is in A, then x is in B" holds for every x, and A = B says the biconditional does. Compare p ∧ ¬q with ¬(p → q) to see why A ⊆ B is the same as A − B = ∅.
Questions
What is the difference between ⊂ and ⊆?
X ⊆ Y means every element of X is also in Y, and allows X and Y to be equal. X ⊂ Y means a proper subset: X ⊆ Y and Y has at least one element X lacks. Some books use ⊂ for plain subset and ⊊ for proper subset, so check which convention a course uses.
What is the difference between ∈ and ⊆?
∈ relates an element to a set; ⊆ relates two sets. 3 ∈ A says the number 3 is in A. {3} ⊆ A says the set containing 3 is a subset of A. Writing 3 ⊆ A or {3} ∈ A mixes the two up.
What does A′ mean?
The complement of A: every element of the universal set U that is not in A. It is also written Aᶜ, Ā or U − A. The complement always depends on U; with U = {1, …, 8} and A = {1, 2, 3, 4}, A′ is {5, 6, 7, 8}.
Is A − B the same as B − A?
No. Difference is not commutative. With the sets on this page, A − B = {1, 2} and B − A = {5, 6}. Only the symmetric difference A Δ B treats both sides alike.
Why is the empty set a subset of every set?
Because ∅ ⊆ A only claims that every element of ∅ is in A, and ∅ has no elements to break the claim. It is the same reason a conditional with a false "if" part is true in logic.
How do I find the size of a union?
Add the sizes and subtract the overlap, which was counted twice: |A ∪ B| = |A| + |B| − |A ∩ B|. Here that is 4 + 4 − 2 = 6.
How does set notation relate to logic?
Every set operation is defined by a logical connective on membership: x is in A ∪ B when x ∈ A or x ∈ B, in A ∩ B when x ∈ A and x ∈ B, and in A′ when not x ∈ A. So the laws of set algebra and the laws of boolean algebra are the same laws, and a Venn diagram is a picture of a truth table.