Sets are all around us: the set of students in your class, the set of songs on your favourite playlist, the set of even numbers. But what happens when these sets meet? How can we combine them, compare them, or pull them apart?
The answer lies in set operations — powerful tools that let us build new sets from existing ones. These operations follow precise rules, forming an elegant algebra that mirrors the very logic of human reasoning.
Table of Contents
What Sets Are
Before combining sets, let us recall what they are. A set is a collection of distinct objects, called elements of the set.
Examples:
- \(A = \{1, 3, 5, 7, 9\}\) (the first five positive odd numbers)
- \(B = \{2, 4, 6, 8, 10\}\) (the first five positive even numbers)
- \(C = \{\text{red, green, blue}\}\) (the primary colours)
- \(D = \{\text{Monday, Tuesday, Wednesday}\}\) (the first three days of the week)
The membership relation
An element either belongs to a set (\(\in\)) or does not belong to it (\(\notin\)):
- \(3 \in A\) (\(3\) belongs to \(A\))
- \(4 \notin A\) (\(4\) does not belong to \(A\))
This raises an interesting question: what happens when we want to work with several sets at once? How can we combine them in different ways to extract new information?
Union: Bringing Everything Together
Imagine you have two music playlists and want to create one playlist containing all the songs from both. That is the idea behind the union.
\[A \cup B = \{x : x \in A \text{ or } x \in B\}\]
An example:
Let:
- \(A = \{1, 3, 5\}\) (odd numbers up to \(5\))
- \(B = \{2, 4, 5, 6\}\) (some even numbers and \(5\))
Then: \(A \cup B = \{1, 2, 3, 4, 5, 6\}\)
Important note: The number \(5\) appears in both sets, but it appears only once in the union. Sets do not contain repeated elements!
Properties of the union
- Commutative: \(A \cup B = B \cup A\) (order does not matter)
- Associative: \((A \cup B) \cup C = A \cup (B \cup C)\)
- Idempotent: \(A \cup A = A\) (taking the union of a set with itself changes nothing)
- Identity element: \(A \cup \emptyset = A\) (the empty set contributes nothing)
Intersection: What They Have in Common
Sometimes we do not want everything — only what is shared by several sets. If two friends compare their playlists, they might want to find the songs they both enjoy. That is the intersection.
\[A \cap B = \{x : x \in A \text{ and } x \in B\}\]
An example:
Consider:
- \(A = \{1, 2, 3, 4, 5\}\) (numbers from \(1\) to \(5\))
- \(B = \{3, 4, 5, 6, 7\}\) (numbers from \(3\) to \(7\))
Then: \(A \cap B = \{3, 4, 5\}\) (the common elements)
Disjoint sets
What happens when two sets share no elements at all?
Example: \(C = \{1, 3, 5\}\) and \(D = \{2, 4, 6\}\)
Result: \(C \cap D = \emptyset\) (the empty set)
We say that \(C\) and \(D\) are disjoint.
Properties of the intersection
- Commutative: \(A \cap B = B \cap A\)
- Associative: \((A \cap B) \cap C = A \cap (B \cap C)\)
- Idempotent: \(A \cap A = A\)
- Absorbing element: \(A \cap \emptyset = \emptyset\)
Set Difference
At times we want to know what is in one set but not in another — much like comparing two shopping lists to see what you forgot to buy.
\[A \setminus B = \{x : x \in A \text{ and } x \notin B\}\]
An example:
Consider:
- \(A = \{1, 2, 3, 4, 5\}\) (all numbers from \(1\) to \(5\))
- \(B = \{3, 4\}\) (some of those numbers)
Then:
- \(A \setminus B = \{1, 2, 5\}\) (what is in \(A\) but not in \(B\))
- \(B \setminus A = \emptyset\) (everything in \(B\) is also in \(A\))
Caution: set difference is not commutative!
Unlike union and intersection, order matters:
If \(A = \{1, 2, 3\}\) and \(B = \{2, 3, 4\}\), then:
- \(A \setminus B = \{1\}\)
- \(B \setminus A = \{4\}\)
Completely different results!
The Complement
We often work within a well-defined "universe". If we are talking about the students in a school, our universe is the set of all students. The complement of a set consists of everything that is not in that set, yet belongs to the universe.
\[A^c = U \setminus A = \{x \in U : x \notin A\}\]
An example:
Suppose:
- \(U = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}\) (the numbers from 1 to 10)
- \(A = \{2, 4, 6, 8, 10\}\) (the even numbers)
Then: \(A^c = \{1, 3, 5, 7, 9\}\) (the odd numbers)
De Morgan's Laws
The complement satisfies the properties discovered by the mathematician Augustus De Morgan:
- \((A \cup B)^c = A^c \cap B^c\)
- \((A \cap B)^c = A^c \cup B^c\)
In plain words: "The complement of the union is the intersection of the complements, and the complement of the intersection is the union of the complements." These laws link the operations of union and intersection in a profound way.
Symmetric Difference
Sometimes we want the elements that are in one set or the other, but not in both.
\[A \triangle B = (A \setminus B) \cup (B \setminus A) = (A \cup B) \setminus (A \cap B)\]
An example:
Consider two friends and their hobbies:
- \(A = \{\text{football, tennis, swimming}\}\) (first friend's hobbies)
- \(B = \{\text{tennis, basketball, running}\}\) (second friend's hobbies)
The symmetric difference \(A \triangle B = \{\text{football, swimming, basketball, running}\}\) represents the hobbies that only one of them pursues.
Notable properties
- Commutative: \(A \triangle B = B \triangle A\)
- Associative: \((A \triangle B) \triangle C = A \triangle (B \triangle C)\)
- Identity element: \(A \triangle \emptyset = A\)
- Inverse element: \(A \triangle A = \emptyset\)
These properties make the symmetric difference a particularly interesting operation in algebra.
Cartesian Product: All Possible Combinations
So far we have combined sets to produce new sets of the same "kind". The Cartesian product works differently: it produces ordered pairs of elements.
\[A \times B = \{(a, b) : a \in A \text{ and } b \in B\}\]
An example:
Imagine choosing:
- \(A = \{\text{pasta, rice}\}\) (first courses)
- \(B = \{\text{tomato sauce, pesto, carbonara}\}\) (toppings)
The Cartesian product \(A \times B\) represents all possible combinations:
\[A \times B = \{(\text{pasta, tomato sauce}),\ (\text{pasta, pesto}),\ (\text{pasta, carbonara}),\] \[(\text{rice, tomato sauce}),\ (\text{rice, pesto}),\ (\text{rice, carbonara})\}\]
The Cartesian plane
The most famous Cartesian product is \(\mathbb{R} \times \mathbb{R} = \mathbb{R}^2\), which represents all points in the Cartesian plane. Every point \((x, y)\) is simply an ordered pair of real numbers!
Properties of the Cartesian product
- Non-commutative: in general, \(A \times B \neq B \times A\)
- Distributive over union: \(A \times (B \cup C) = (A \times B) \cup (A \times C)\)
- Cardinality: \(|A \times B| = |A| \cdot |B|\)
The Laws of Set Algebra
Set operations obey precise rules, just as the algebra of numbers does. These laws allow us to simplify complex expressions and reason rigorously.
Fundamental laws
| Property | Union | Intersection |
|---|---|---|
| Commutative | \(A \cup B = B \cup A\) | \(A \cap B = B \cap A\) |
| Associative | \((A \cup B) \cup C = A \cup (B \cup C)\) | \((A \cap B) \cap C = A \cap (B \cap C)\) |
| Distributive | \(A \cup (B \cap C) = (A \cup B) \cap (A \cup C)\) | \(A \cap (B \cup C) = (A \cap B) \cup (A \cap C)\) |
| Idempotent | \(A \cup A = A\) | \(A \cap A = A\) |
| Identity element | \(A \cup \emptyset = A\) | \(A \cap U = A\) |
| Absorbing element | \(A \cup U = U\) | \(A \cap \emptyset = \emptyset\) |
De Morgan's Laws (a reminder)
- \((A \cup B)^c = A^c \cap B^c\)
- \((A \cap B)^c = A^c \cup B^c\)
Absorption laws
- \(A \cup (A \cap B) = A\)
- \(A \cap (A \cup B) = A\)
These laws reveal a beautiful symmetry: union and intersection are "dual" operations — every property of one is mirrored in the other.
Venn Diagrams: Visualising Set Operations
Sometimes a picture is worth a thousand equations. Venn diagrams, introduced by the logician John Venn in 1880, allow us to visualise set operations at a glance.
How they work
Each set is represented by a circle (or another closed region). The universal set is represented by a rectangle that encloses everything.
The main operations:
- Union \(A \cup B\): the entire area covered by at least one of the two circles
- Intersection \(A \cap B\): the overlapping region of the two circles
- Difference \(A \setminus B\): the part of \(A\) that does not overlap with \(B\)
- Complement \(A^c\): the whole rectangle minus circle \(A\)
- Symmetric difference \(A \triangle B\): the non-overlapping parts of each circle
Beyond two sets
Venn diagrams can represent three or more sets, though they grow more complex. With three sets there are \(8\) distinct regions to consider!
Advantages of Venn diagrams
- Visual intuition: they make operations immediately understandable
- Checking formulae: they provide a way to verify algebraic laws
- Problem-solving: they help organise complex information
Set operations are far more than mere symbolic manipulation. They are the mathematical language with which we describe relationships among groups, categories, and collections of objects. Every time we group, compare, or combine information, we are using these tools.
The elegance of these operations lies in their universality: the same rules that govern the union of two music playlists also govern the intersection of corporate databases or the classification of biological species.
Yet there is something even deeper at work. Set operations teach us that mathematics is not merely calculation — it is a way of organising thought. When we learn to see the world in terms of sets and their relationships, we develop a mode of reasoning that is simultaneously rigorous and flexible.
Each operation we have studied represents a different way of relating ideas:
- The union teaches us inclusivity: how to bring diversity together
- The intersection highlights the importance of what is shared
- The difference helps us identify what is distinctive
- The complement reminds us that every choice excludes some alternatives

And just as we have seen with numbers, here too every apparent "impossibility" pushes towards new discoveries. When simple sets are no longer enough, mathematicians have devised infinite sets, sets of sets, and even more elaborate structures.