LogicGates.org Open the simulatorSimulator

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.

Symbol Name and reading Example Logic Diagram
∈ Element of "is an element of, is in" 3 ∈ A is true x ∈ A is a statement: true or false
∉ Not an element of "is not an element of" 7 ∉ A is true ¬(x ∈ A)
⊆ Subset "is a subset of" {1, 2} ⊆ A is true; A ⊆ A is true x ∈ X → x ∈ Y, for every x
⊂ Proper subset "is a proper subset of" {1, 2} ⊂ A is true; A ⊂ A is false X ⊆ Y and X ≠ Y
⊇ Superset "is a superset of, contains" A ⊇ {3, 4} is true x ∈ Y → x ∈ X, for every x
∪ Union "A union B; in A or B" A ∪ B = {1, 2, 3, 4, 5, 6} ∨ (OR)
∩ Intersection "A intersect B; in A and B" A ∩ B = {3, 4} ∧ (AND)
A′ Aᶜ Complement "A complement; not in A" A′ = {5, 6, 7, 8} ¬ (NOT)
A − B A \ B Difference "A minus B; in A but not B" A − B = {1, 2}, B − A = {5, 6} A ∧ ¬B (AND NOT)
Δ Symmetric difference "in A or B but not both" A Δ B = {1, 2, 5, 6} ⊕ (XOR)
∅ { } Empty set "the empty set" A ∩ A′ = ∅ always false (0)
U ξ Universal set "the universal set: everything under discussion" U = {1, 2, 3, 4, 5, 6, 7, 8} always true (1)
|A| n(A) Cardinality "the number of elements in A" |A| = 4, |A ∪ B| = 6
P(A) 𝒫(A) Power set "the set of all subsets of A" P({1, 2}) = {∅, {1}, {2}, {1, 2}}
× Cartesian product "A cross B: every ordered pair" {1, 2} × {x, y} = {(1, x), (1, y), (2, x), (2, y)}
{ , } Roster notation "the set containing" A = {1, 2, 3, 4}
{x : …} {x | …} Set-builder notation "the set of all x such that" {x ∈ U : x is even} = {2, 4, 6, 8}
= Equal sets "has exactly the same elements as" {1, 2} = {2, 1} is true x ∈ X ↔ x ∈ Y, for every x

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.

Set notation symbols chart: 18 set theory symbols including ∈ ∉ ⊆ ⊂ ⊇ ∪ ∩ A′ A − B Δ ∅ with their names, how to read them and a worked example on A = {1, 2, 3, 4} and B = {3, 4, 5, 6} 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 ∪ Bp ∨ qOR
A ∩ Bp ∧ qAND
A′¬pNOT
A − Bp ∧ ¬qAND with one input inverted
A Δ Bp ⊕ qXOR
(A Δ B)′p ↔ qXNOR
A ⊆ Bp → 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.