DISCRETE MATH • SETS, RELATIONS, AND FUNCTIONS

Venn diagrams and set identities

Visualizing and proving the algebraic laws that govern how sets combine, intersect, and complement one another.

Historical Context & Motivation

The formal study of sets traces its origins to the nineteenth century, a period when mathematicians sought a rigorous foundation for all of mathematics. Before set theory, arguments about collections of objects were handled informally—logicians reasoned about categories and classes without a unifying symbolic framework. The need for such a framework became acute as analysis, algebra, and logic grew more abstract, and mathematicians realized that paradoxes and contradictions lurked beneath intuitive reasoning. Venn diagrams and set identities emerged from this intellectual climate: Venn diagrams as an intuitive visual tool for reasoning about relationships among sets, and set identities as the algebraic laws that formalize those relationships with mathematical precision.

1763
Euler Diagrams
Leonhard Euler introduced circle-based diagrams in his Lettres à une princesse d'Allemagne to illustrate syllogistic logic. Unlike later Venn diagrams, Euler diagrams only draw circles for non-empty regions, making them less systematic but visually cleaner for simple cases.
1874
Cantor Founds Set Theory
Georg Cantor published his groundbreaking paper on the uncountability of the real numbers, formally initiating set theory as a mathematical discipline. His work provided the rigorous definitions of union, intersection, and complement that set identities depend upon.
1880
Venn Publishes His Diagrams
John Venn introduced his systematic overlapping-circle diagrams in the paper "On the Diagrammatic and Mechanical Representation of Propositions and Reasonings" in the Philosophical Magazine. Unlike Euler diagrams, Venn's method draws all possible overlapping regions regardless of emptiness, enabling systematic analysis of any Boolean relationship.
1908
Zermelo's Axiomatization
Ernst Zermelo proposed the first axiomatic system for set theory, resolving paradoxes like Russell's paradox. This axiomatization placed set identities on a firm deductive footing, showing they follow from a small collection of axioms rather than from diagram-based intuition alone.

The central question motivating this lesson is twofold: How can we visualize relationships among sets in a way that exposes structure at a glance, and how do we prove that certain algebraic transformations on sets are universally valid? Venn diagrams supply the visual intuition; set identities supply the algebraic machinery. Together they form an indispensable toolkit for reasoning about collections in computer science, probability, database theory, and beyond.

Core Principles & Definitions

Before diving into diagrams and identities, we need to establish the fundamental operations on sets. Throughout this lesson, we assume a fixed universal set U that contains every element under discussion. All sets A, B, C, … are subsets of U. The three primitive operations—union, intersection, and complement—together with subset inclusion, generate a rich algebra of sets whose laws mirror those of propositional logic.

1

Union (A ∪ B)

The set of all elements belonging to A, to B, or to both. Formally: A ∪ B = {x ∈ U : x ∈ A or x ∈ B}. Union corresponds to logical disjunction (∨).
2

Intersection (A ∩ B)

The set of all elements belonging to both A and B simultaneously. Formally: A ∩ B = {x ∈ U : x ∈ A and x ∈ B}. Intersection corresponds to logical conjunction (∧).
3

Complement (Aᶜ or A̅)

The set of all elements in U that do not belong to A. Formally: Aᶜ = {x ∈ U : x ∉ A}. Complement corresponds to logical negation (¬).
4

Set Difference (A − B)

The set of elements in A that are not in B. Formally: A − B = A ∩ Bᶜ = {x ∈ U : x ∈ A and x ∉ B}. Also written A \ B, this operation is not commutative.
5

Symmetric Difference (A △ B)

The set of elements in exactly one of A or B but not both. Formally: A △ B = (A − B) ∪ (B − A) = (A ∪ B) − (A ∩ B). This operation corresponds to exclusive or (⊕).
KEY TAKEAWAY
Think of set operations as filters on a database query. Union is the OR filter ("show me customers from New York OR California"), intersection is the AND filter ("show me customers from New York AND who purchased in January"), and complement is the NOT filter ("show me everyone who is NOT a premium member"). A set identity is a guarantee that two different filter expressions always return the same result set, regardless of the underlying data—much like query optimization rules that a database engine relies on.

Venn Diagrams: The Visual Toolbox

A Venn diagram for n sets consists of n simple closed curves (typically circles) drawn so that every possible intersection region is non-empty in the diagram, all enclosed within a rectangle representing the universal set U. For two sets A and B, the two overlapping circles create four distinct regions: elements in A only (A − B), elements in B only (B − A), elements in both (A ∩ B), and elements in neither (the external region, which is (A ∪ B)ᶜ). For three sets, three mutually overlapping circles produce eight regions, corresponding to the 2³ membership combinations. This exhaustive partitioning is what distinguishes Venn diagrams from Euler diagrams, which omit empty regions.

Two overlapping circles within universal set U produce four mutually exclusive regions. The violet region represents elements unique to A, the cyan region elements unique to B, the overlap represents A ∩ B, and the exterior rectangle captures (A ∪ B)ᶜ.

To use a Venn diagram for verifying an identity, shade the region(s) described by the left-hand side expression, then independently shade the regions described by the right-hand side expression on a separate copy of the diagram. If the shaded areas are identical in both diagrams, the identity holds for all possible sets. While this approach constitutes verification rather than formal proof (a Venn diagram for n sets only checks 2ⁿ membership patterns, not arbitrary infinite universes), it is a remarkably reliable heuristic. In fact, for finite Boolean expressions involving ∪, ∩, and ᶜ, agreement across all 2ⁿ regions is equivalent to logical validity, so Venn-diagram verification is a sound proof technique in that restricted setting.

The Algebra of Sets: Fundamental Identities

Set identities are equalities that hold for all possible choices of sets within a given universal set. They form a Boolean algebra under ∪ (join), ∩ (meet), and ᶜ (complement), with U and ∅ serving as the identity elements. Below are the most important identities, grouped by type. Each identity has a dual, obtained by swapping ∪ with ∩ and U with ∅, reflecting the principle of duality for Boolean algebras.

IDEMPOTENT LAWS
A ∪ A = A A ∩ A = A
Combining a set with itself yields the same set. These laws assert that ∪ and ∩ are idempotent operations.
IDENTITY LAWS
A ∪ ∅ = A A ∩ U = A
∅ is the identity element for union; U is the identity element for intersection.
COMPLEMENT LAWS
A ∪ Aᶜ = U A ∩ Aᶜ = ∅
A set and its complement partition the universal set. Their union is everything; their intersection is nothing.
DE MORGAN'S LAWS
(A ∪ B)ᶜ = Aᶜ ∩ Bᶜ (A ∩ B)ᶜ = Aᶜ ∪ Bᶜ
The complement of a union is the intersection of the complements, and vice versa. These laws are among the most frequently applied identities in proofs and in digital logic design.

Additional fundamental identities include the commutative laws (A ∪ B = B ∪ A, A ∩ B = B ∩ A), the associative laws ((A ∪ B) ∪ C = A ∪ (B ∪ C), and analogously for ∩), the distributive laws (A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) and A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)), the absorption laws (A ∪ (A ∩ B) = A and A ∩ (A ∪ B) = A), and the double complement law ((Aᶜ)ᶜ = A). Note carefully that the distributive law for sets distributes union over intersection and intersection over union—a symmetry that does not hold in ordinary arithmetic, where multiplication distributes over addition but not conversely.

Complete Reference of Set Identities

The following table collects all the standard set identities in one place. Each row pairs an identity with its dual—the statement obtained by interchanging ∪ ↔ ∩ and U ↔ ∅. The principle of duality guarantees that if an identity is valid, so is its dual. This table should serve as a quick reference whenever you need to simplify a set expression or construct a proof.

Complete table of fundamental set identities with their duals
Identity NamePrimary FormDual Form
IdempotentA ∪ A = AA ∩ A = A
IdentityA ∪ ∅ = AA ∩ U = A
DominationA ∪ U = UA ∩ ∅ = ∅
CommutativeA ∪ B = B ∪ AA ∩ B = B ∩ A
Associative(A ∪ B) ∪ C = A ∪ (B ∪ C)(A ∩ B) ∩ C = A ∩ (B ∩ C)
DistributiveA ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
AbsorptionA ∪ (A ∩ B) = AA ∩ (A ∪ B) = A
ComplementA ∪ Aᶜ = UA ∩ Aᶜ = ∅
De Morgan's(A ∪ B)ᶜ = Aᶜ ∩ Bᶜ(A ∩ B)ᶜ = Aᶜ ∪ Bᶜ
Double Complement(Aᶜ)ᶜ = A
Side-by-side Venn diagrams illustrating De Morgan's first law. On the left, the complement of A ∪ B is shaded (the region outside both circles). On the right, the intersection of Aᶜ and Bᶜ is shaded (the region that lies outside A and outside B simultaneously). Both shaded regions are the same amber-tinted corners, confirming the identity.
📝 Proof Methods Beyond Diagrams
While Venn diagrams provide compelling visual evidence, a formal proof of a set identity typically proceeds by element chasing: assume x belongs to the left-hand side and show it must belong to the right-hand side (⊆), then reverse the argument (⊇). Alternatively, you can prove an identity algebraically by applying previously established identities as rewrite rules, much as you simplify algebraic expressions in regular algebra.

Worked Example: Simplifying a Set Expression

Let us simplify the expression (A ∪ B) ∩ (A ∪ Bᶜ) using set identities. This example demonstrates how the distributive and complement laws interact to collapse a seemingly complex expression into a surprisingly simple one.

Simplify (A ∪ B) ∩ (A ∪ Bᶜ)
1
Step 1 — Write the Original ExpressionWe begin with (A ∪ B) ∩ (A ∪ Bᶜ). Our goal is to reduce this to a simpler equivalent expression using known set identities.
(A ∪ B) ∩ (A ∪ Bᶜ)
2
Step 2 — Apply the Distributive Law (∪ over ∩)Notice that the expression has the form (A ∪ X) ∩ (A ∪ Y) where X = B and Y = Bᶜ. By the distributive law A ∪ (X ∩ Y) = (A ∪ X) ∩ (A ∪ Y), we can factor in reverse. Reading this identity from right to left, we obtain (A ∪ B) ∩ (A ∪ Bᶜ) = A ∪ (B ∩ Bᶜ).
A ∪ (B ∩ Bᶜ)
3
Step 3 — Apply the Complement LawBy the complement law, the intersection of any set with its complement is the empty set: B ∩ Bᶜ = ∅. Substituting this result yields A ∪ ∅.
A ∪ ∅
4
Step 4 — Apply the Identity LawBy the identity law for union, the union of any set with the empty set is just the set itself: A ∪ ∅ = A.
(A ∪ B) ∩ (A ∪ Bᶜ) = A

This result has an elegant interpretation: if you take everything in A or B, and simultaneously keep only what is in A or not-B, the two constraints cancel the B contribution entirely, leaving only A. You can verify this on a Venn diagram by shading each side independently and confirming that the shaded regions coincide with the circle for A.

Proof Techniques: Diagrams vs. Algebraic vs. Element-Chasing

There are three standard methods for establishing a set identity, each with distinct advantages and limitations. Choosing the right method depends on the complexity of the identity, the number of sets involved, and whether you need intuition, brevity, or maximal rigor.

Comparison of three proof methods for set identities
MethodStrengthsLimitations
Venn DiagramHighly intuitive; instantly reveals whether an identity holds; excellent for discovery and debugging. Sound for Boolean expressions.Impractical for more than 3 sets (regions grow as 2ⁿ). Not a substitute for formal proof when identities involve indexed families of sets or infinite operations.
Algebraic (Identity Chain)Concise and elegant; each line cites a known identity. Mirrors algebraic simplification in arithmetic. Easily extends to many sets.Requires memorizing the identity table. The correct sequence of rewrites can be non-obvious. Harder to apply to novel or unusual expressions.
Element-Chasing (Mutual Inclusion)The most general and rigorous approach. Works for any sets, including infinite families. Directly translates to first-order logic.Verbose—requires two directions (⊆ and ⊇). Can feel repetitive for identities that are "obviously" true from a diagram.
KEY TAKEAWAY
Think of these three methods as different debugging strategies in software engineering. A Venn diagram is like running test cases—quick, visual, and convincing, but not exhaustive for all inputs. An algebraic proof is like applying known compiler optimization rules—efficient and formal, but requires familiarity with the rule set. Element-chasing is like writing a formal correctness proof—comprehensive and watertight, but labor-intensive. In practice, experienced mathematicians often sketch a Venn diagram first to build intuition, then produce an algebraic or element-chasing proof for publication.

Connections to Boolean Algebra & Beyond

The algebra of sets under ∪, ∩, and ᶜ is a concrete instance of a Boolean algebra, an algebraic structure (B, ∨, ∧, ¬, 0, 1) satisfying exactly the same set of axioms. This means that every set identity translates directly into a valid identity in propositional logic (with ∪ → ∨, ∩ → ∧, ᶜ → ¬, U → T, ∅ → F) and into a valid identity in digital circuit design (with ∪ → OR, ∩ → AND, ᶜ → NOT). The table below highlights these correspondences.

Isomorphism between set algebra, propositional logic, and digital circuits
Set TheoryPropositional LogicDigital Logic
A ∪ Bp ∨ qA OR B
A ∩ Bp ∧ qA AND B
Aᶜ¬pNOT A
U (universal set)T (tautology)1 (HIGH)
∅ (empty set)F (contradiction)0 (LOW)
De Morgan: (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ¬(p ∨ q) ≡ ¬p ∧ ¬qNOR ≡ AND of NOTs

Looking ahead, the ideas in this lesson extend in several important directions. In probability theory, the inclusion–exclusion principle generalizes |A ∪ B| = |A| + |B| − |A ∩ B| to any finite number of sets, and set identities underpin the axioms of probability. In relational database theory, SQL queries on tables correspond to set operations—SELECT with WHERE clauses performs intersections and complements, UNION performs unions, and query optimizers rely on set identities to rewrite queries into equivalent, faster forms. In formal verification and model checking, sets of states are combined using Boolean operations, and set identities enable the symbolic manipulation necessary for checking system properties. Mastery of Venn diagrams and set identities thus pays dividends across virtually every branch of mathematics and computer science.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain why the distributive law A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) differs from ordinary arithmetic, where addition does not distribute over multiplication. What structural feature of set algebra permits both forms of distributivity?
PROBLEM 2BASIC CALCULATION
Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, A = {1, 2, 3, 4, 5}, and B = {3, 4, 5, 6, 7}. Compute A ∩ B, A ∪ B, A − B, B − A, A △ B, and (A ∪ B)ᶜ.
PROBLEM 3INTERMEDIATE
Using set identities (not element-chasing), prove that A ∩ (Aᶜ ∪ B) = A ∩ B. State the name of each identity you apply.
PROBLEM 4APPLIED
A university registrar defines the following sets of students: M = {students enrolled in a math course}, C = {students enrolled in a CS course}, S = {students who received a scholarship}. Write set expressions for each of the following groups, then simplify where possible: (a) Students enrolled in both math and CS who did not receive a scholarship. (b) Students who received a scholarship but are not enrolled in any math or CS course. (c) Using De Morgan's law, rewrite the expression for students who are NOT enrolled in both math and CS.
PROBLEM 5CRITICAL THINKING
Prove by element-chasing (mutual inclusion) that for arbitrary sets A, B, and C: A − (B ∩ C) = (A − B) ∪ (A − C). Discuss how this result relates to De Morgan's laws.

Lesson Summary

Venn diagrams provide a systematic visual representation of sets by drawing overlapping closed curves within a rectangle representing the universal set U. For n sets, the diagram partitions U into 2ⁿ mutually exclusive regions, each corresponding to a unique membership pattern. The three fundamental operations—union (∪), intersection (∩), and complement (ᶜ)—together with set difference (−) and symmetric difference (△), can be visualized by shading the appropriate regions of the diagram.

Set identities are algebraic laws that hold universally—including the commutative, associative, distributive, idempotent, identity, domination, absorption, complement, double complement, and De Morgan's laws. Every identity has a dual obtained by swapping ∪ ↔ ∩ and U ↔ ∅. Identities can be established via Venn-diagram verification, algebraic proof chains, or element-chasing (mutual inclusion). The set-theoretic framework is isomorphic to Boolean algebra, linking these identities to propositional logic, digital circuit design, database query optimization, and probability theory.

Varsity Tutors • Discrete Math • Venn diagrams and set identities