Operations on Sets

In mathematics, a set is a well-defined collection of distinct objects called elements. Once we have sets, a natural question arises: how can we combine or compare them? Set operations provide the tools to do exactly that. The three fundamental operations — union, intersection, and difference — allow us to build new sets from existing ones and form the backbone of logic, probability, and nearly every branch of higher mathematics. These operations have precise definitions and can be visualised using Venn diagrams, which were popularised by the English logician John Venn in the 1880s. Each operation answers a different question: the union asks 'what is in either set?', the intersection asks 'what is in both sets?', and the difference asks 'what is in one set but not the other?' Together with the complement operation, they give us a complete algebra of sets. Understanding set operations is essential for working with probability spaces, database queries, logic gates in computing, and formal proofs. When mathematicians write 'let A and B be sets', they immediately have access to all of these operations, making set theory the universal language underlying modern mathematics.

Key takeaways
  • Union: Combining Two Sets
  • Intersection: Finding Common Elements
  • Set Difference: What One Set Has That the Other Lacks
  • Complement: Everything Outside a Set
  • Key Properties and Laws

Union: Combining Two Sets

The union of sets A and B, written A ∪ B, is the set containing every element that belongs to A, or to B, or to both. Formally: A ∪ B = {x : x ∈ A or x ∈ B}. The word 'or' here is inclusive — an element qualifies if it is in at least one of the sets. For example, if A = {1, 2, 3} and B = {3, 4, 5}, then A ∪ B = {1, 2, 3, 4, 5}. Notice that 3 appears in both sets but is listed only once, because sets never contain duplicate elements.

Intersection: Finding Common Elements

The intersection of sets A and B, written A ∩ B, is the set of all elements that belong to both A and B simultaneously. Formally: A ∩ B = {x : x ∈ A and x ∈ B}. Using the same example, A = {1, 2, 3} and B = {3, 4, 5}, we get A ∩ B = {3}, since 3 is the only element in both sets. If two sets share no common elements — for instance {1, 2} and {3, 4} — their intersection is the empty set ∅, and the sets are called disjoint.

Set Difference: What One Set Has That the Other Lacks

The difference of sets A and B, written A \ B (also written A − B), is the set of elements that are in A but not in B. Formally: A \ B = {x : x ∈ A and x ∉ B}. With A = {1, 2, 3} and B = {3, 4, 5}, we get A \ B = {1, 2}. Note that set difference is not commutative: B \ A = {4, 5}, which is entirely different from A \ B. The symmetric difference A △ B = (A \ B) ∪ (B \ A) collects elements in exactly one of the two sets: A △ B = {1, 2, 4, 5}.

Complement: Everything Outside a Set

When all sets under discussion live inside a universal set U, the complement of A, written Aᶜ or A', is the set of all elements in U that are not in A: Aᶜ = {x ∈ U : x ∉ A} = U \ A. For example, if U = {1, 2, 3, 4, 5} and A = {1, 2, 3}, then Aᶜ = {4, 5}. De Morgan's Laws connect complement to union and intersection: (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ and (A ∩ B)ᶜ = Aᶜ ∪ Bᶜ. These identities are used constantly in probability and logic.

Key Properties and Laws

Set operations obey algebraic laws analogous to arithmetic. Commutativity: A ∪ B = B ∪ A and A ∩ B = B ∩ A. Associativity: (A ∪ B) ∪ C = A ∪ (B ∪ C). Distributivity: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C). Identity laws: A ∪ ∅ = A and A ∩ U = A. These properties allow complex set expressions to be simplified step by step, just like algebraic equations.

The Key Equation

A∪B={x∣x∈A or x∈B},A∩B={x∣x∈A and x∈B},A∖B={x∣x∈A and x∉B}A \cup B = \{x \mid x \in A \text{ or } x \in B\}, \quad A \cap B = \{x \mid x \in A \text{ and } x \in B\}, \quad A \setminus B = \{x \mid x \in A \text{ and } x \notin B\}
  • A \cup B — Union (set): All elements belonging to at least one of the two sets.
  • A \cap B — Intersection (set): All elements belonging to both sets simultaneously.
  • A \setminus B — Set Difference (set): Elements that are in A but not in B.
  • \emptyset — Empty Set (set): The unique set containing no elements; the result when two disjoint sets are intersected.

Worked Example

Problem. Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, A = {1, 2, 4, 6, 8, 10} (even numbers) and B = {1, 2, 3, 5, 7} (numbers ≤ 7 that are 1, 2, or prime). Find: (a) A ∪ B, (b) A ∩ B, (c) A \ B, (d) Aᶜ, and (e) verify De Morgan's Law (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ.

A∪B={1,2,3,4,5,6,7,8,10},  A∩B={1,2},  A∖B={4,6,8,10},  Ac={3,5,7,9}A \cup B = \{1,2,3,4,5,6,7,8,10\},\; A \cap B = \{1,2\},\; A \setminus B = \{4,6,8,10\},\; A^c = \{3,5,7,9\}

Answer. A ∪ B = {1,2,3,4,5,6,7,8,10}; A ∩ B = {1,2}; A \ B = {4,6,8,10}; Aᶜ = {3,5,7,9}; De Morgan verified: (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ = {9}.

Figure
Diagram
Venn Diagrams: Set Operations on A and BUABA ∪ B (shaded)UABA ∩ B (shaded)UABA \ B (shaded)UABAᶜ (shaded)
Origins · 1 minGeorg Cantor and how this was discovered
GC
Georg Cantor
1845–1918 · German

Georg Cantor is the founder of modern set theory. Between 1874 and 1884, he developed the rigorous theory of infinite sets, defining key concepts including set operations, cardinality, and the remarkable result that some infinities are larger than others. His formal notation and definitions for union, intersection, and complement underpinned all of 20th-century mathematics. Cantor proved that the set of real numbers is strictly larger than the set of natural numbers — a result so surprising that his colleague Leopold Kronecker called it 'a corruption of youth'. Despite fierce opposition, Cantor's ideas are now universally accepted as the foundation of all mathematics.

  • Subsets and Power Sets — Understanding when one set is contained within another is a prerequisite for interpreting intersection and difference: A ∩ B ⊆ A always holds, and A \ B = ∅ if and only if A ⊆ B.
  • Venn Diagrams — Venn diagrams are the primary visual tool for representing set operations and checking logical relationships between two or three sets.
  • Probability and Set Theory — Events in probability are sets, and P(A ∪ B) = P(A) + P(B) − P(A ∩ B) directly applies the union and intersection operations.
  • Boolean Algebra — Boolean algebra uses AND, OR, and NOT operations that correspond exactly to intersection, union, and complement in set theory.