Set operations combine sets to form new sets. These operations — union, intersection, complement, difference, and symmetric difference — provide the tools for manipulating collections and form the basis for the algebraic rules that govern set theory. Visualizing these operations through Venn diagrams makes their behavior immediately clear.
The union of two sets A and B is the set of elements that belong to A or B or both:
A∪B={x:x∈A or x∈B}
The word "or" here is inclusive — elements belonging to both sets are included. If A={1,2,3} and B={3,4,5}, then:
A∪B={1,2,3,4,5}
The element 3 appears in both sets but is listed only once in the union.
Union is commutative and associative:
A∪B=B∪A
(A∪B)∪C=A∪(B∪C)
For multiple sets, the union extends naturally:
i=1⋃nAi=A1∪A2∪⋯∪An
This contains every element that appears in at least one of the sets A1,A2,…,An.
UAB
A ∪ B, frozen
Both circles shaded as one region: every element of A, of B, or of both — the inclusive “or” made visible. Watch the union highlight for sets you configure yourself on the two-set Venn explorer.
Everything that follows in set algebra — distributive laws, De Morgan's laws, inclusion–exclusion — begins with this simplest act of pooling two collections into one.
Intersection
The intersection of two sets A and B is the set of elements that belong to both A and B:
A∩B={x:x∈A and x∈B}
If A={1,2,3} and B={3,4,5}, then:
A∩B={3}
When two sets have no elements in common, their intersection is the empty set, and the sets are called disjoint:
A∩B=∅
Intersection is commutative and associative:
A∩B=B∩A
(A∩B)∩C=A∩(B∩C)
For multiple sets:
i=1⋂nAi=A1∩A2∩⋯∩An
This contains only elements that appear in every one of the sets A1,A2,…,An.
UAB
A ∩ B, frozen
Only the lens where the circles overlap is shaded — the elements A and B share. Switch to disjoint sets and watch this region empty out on the two-set Venn explorer.
Intersection is union's natural counterpart, and the interplay between the two — each distributing over the other — drives most of the algebra ahead.
Complement
The complement of a set A consists of all elements not in A. This operation requires a universal set U that contains all elements under consideration:
Ac={x∈U:x∈/A}
Alternative notations include A′ and A.
If the universal set is U={1,2,3,4,5} and A={1,2}, then:
Ac={3,4,5}
The complement depends entirely on the choice of universal set. The same set A has different complements relative to different universal sets.
Taking the complement twice returns the original set:
(Ac)c=A
Two additional facts hold for any set A:
A∪Ac=U
A∩Ac=∅
Every element either belongs to A or to its complement, but not to both.
UAB
A′, frozen
Everything inside the universe U except circle A is shaded — the complement drawn against its reference set. Flip between A′, B′, and the De Morgan combinations on the two-set Venn explorer.
Complementation is the only unary operation of the five, and the bridge between set algebra and logic: it is negation, drawn as a region.
Set Difference
The set difference A∖B (also written A−B) contains all elements that belong to A but not to B:
A∖B={x:x∈A and x∈/B}
If A={1,2,3,4} and B={3,4,5}, then:
A∖B={1,2}
B∖A={5}
Unlike union and intersection, set difference is not commutative — the order of A and B matters.
Set difference relates to complement: when B⊆U, the complement Bc equals U∖B. More generally:
This expresses difference as an intersection with a complement.
UAB
A ∖ B, frozen
Only the crescent of A lying outside B is shaded: the elements of A that are not in B. Compare it with B ∖ A — the opposite crescent — on the two-set Venn explorer.
The identity A∖B=A∩Bc is worth internalizing — it turns every difference into an intersection, whose algebra you already know.
Symmetric Difference
The symmetric difference of A and B contains elements that belong to exactly one of the two sets:
A△B=(A∖B)∪(B∖A)
An equivalent definition uses union and intersection:
The element 3 belongs to both sets, so it is excluded from the symmetric difference.
Symmetric difference is commutative and associative:
A△B=B△A
(A△B)△C=A△(B△C)
The symmetric difference with the empty set leaves a set unchanged: A△∅=A. The symmetric difference of a set with itself is empty: A△A=∅.
UAB
A △ B, frozen
Both crescents shaded with the shared lens carved out: the elements belonging to exactly one of the two sets. See how it equals (A ∖ B) ∪ (B ∖ A) on the two-set Venn explorer.
With symmetric difference the toolkit is complete: five operations, closed over sets, ready for the algebraic rules that organize them.
Set Operation Notation
Notation
Set Operation Notation
Five operations, six marks, and more glyph collisions than any other page in the section: the cup and cap, a complement with three spellings, two ways to subtract sets, and a triangle already working three other jobs elsewhere.
The braces, set-builder bar, ∈ and ∅ inside every definition come from set theory basics; the containment marks from the subsets page.
∪ · ∩
union; intersection
The cup collects, the cap filters: A∪B holds members of either set, A∩B only members of both — Union and Intersection above. The cup opens upward "to hold everything", the standard hook for keeping them apart.
CasesChains of sets grow the marks into big operators with index bounds — ⋃i=1nAi, the same enlarging habit Σ has; the shapes deliberately mirror logic's or (∨) and and (∧), catalogued with the logic symbols.
Do not confuseEach other, by rotation. A flipped glance swaps "either" for "both" — and a domain built with ∩ by reflex is usually empty, the error domain notation warns about from the other side.
Ac · A′ · A
the complement of A
One operation, three spellings: the superscript c (this site's choice), the prime, and the overbar — all meaning "everything in U that is not in A", as Complement above defines. The mark is meaningless until the universal set is fixed.
CasesThis site's interactive explorers use the prime form A′ — expect both when moving between pages; the overbar dominates probability, where complements of events are everywhere.
Do not confuseThe other bars and primes. A shares its stroke with the complex conjugate and the sample mean; A′ with the derivative prime — the object under the mark (a set) is the only tell.
A∖B
A minus B; the difference of A and B
Subtraction for sets: everything in A that is not in B — Set Difference above. The backslash is the set-specific spelling; A−B borrows the arithmetic minus for the same job.
CasesOrder matters — A∖B=B∖A in general; against a universal set the difference becomes complement, U∖B=Bc, and domain notation writes "all reals except 2" as R∖{2} with exactly this mark.
Do not confuseThe division slash. ∖ leans backward, / forward — and unlike numeric subtraction, removing elements never produces "negative" members: subtracting what is not there does nothing.
A△B
the symmetric difference of A and B
The either-but-not-both operation: A△B keeps elements of exactly one set — the shared members drop out, as Symmetric Difference above shows. Logic knows the pattern as exclusive or.
CasesTwo equivalent spellings mirror the two definitions: (A∖B)∪(B∖A) and (A∪B)∖(A∩B) — one collects the private parts, the other removes the shared core.
Same glyph elsewhereThe triangle's fourth job: Δ already means increment in calculus, the discriminant in algebra, and the determinant in older linear-algebra texts — between two sets it is an operator, not a quantity.
The five operations introduced above share a uniform structure: each consumes one or two sets and returns a new set, defined by a precise membership condition. The capstone table below collects them all in one place — every operation with its notation, its membership rule, the result on a single worked example (A={1,2,3}, B={3,4,5}, U={1,2,3,4,5}), and its key algebraic properties.
Operation
Notation
Elements that...
Result on A = {1, 2, 3}, B = {3, 4, 5}, U = {1, ..., 5}
Key properties
Union
A ∪ B
belong to A or B (inclusive or)
{1, 2, 3, 4, 5}
commutative, associative; identity = ∅
Intersection
A ∩ B
belong to both A and B
{3}
commutative, associative; identity = U; empty if A, B disjoint
Complement
Ac (also A', A, or U \ A)
are in U but not in A (unary operation)
Ac = {4, 5}
(Ac)c = A; A ∪ Ac = U; A ∩ Ac = ∅
Set difference
A \ B (also A − B)
are in A but not in B
A \ B = {1, 2}; B \ A = {4, 5}
NOT commutative; A \ B = A ∩ Bc
Symmetric difference
A △ B
are in exactly one of A or B
{1, 2, 4, 5}
commutative, associative; identity = ∅; A △ A = ∅
Set Operations FAQ
What is the difference between union and intersection?
+
Union collects, intersection filters. A ∪ B holds every element belonging to A or B or both, so it is at least as large as either set. A ∩ B holds only the elements the two sets share, so it is no larger than either. Shade both regions on the two-set Venn explorer to compare them directly.Read more →
What are the different symbols for the complement of a set?
+
Three spellings mean the same thing: Aᶜ with a superscript c, A′ with a prime, and Ā with an overbar. All denote every element of the universal set U that is not in A. This site writes Aᶜ in prose and A′ in the interactive tools; probability texts prefer the overbar. See all set theory symbols.Read more →
Is set difference commutative?
+
No. A \ B keeps the elements of A that are not in B, while B \ A keeps the elements of B that are not in A — two different sets. With A = {1, 2, 3} and B = {3, 4, 5}, A \ B is {1, 2} and B \ A is {4, 5}. Union and intersection are commutative; difference is not.Read more →
How does set difference relate to complement?
+
Every difference is an intersection in disguise: A \ B = A ∩ Bᶜ. Removing the elements of B from A is the same as keeping the elements of A that lie in the complement of B. The identity matters because it turns difference, the one non-commutative operation, into intersection, whose algebra is already familiar.Read more →