Foundations, logic and sets

Set theory

A hands-on map of membership, Venn diagrams, operations, laws, foundations, infinity and the paradox that stopped mathematicians from putting absolutely everything into one set.

Common notationx∈A; A⊆B; A∪B; A∩B; Aᶜ; ℘(A); |A|

One idea, three depths

What is set theory?

Explain it to a 5-year-old

Sorting treasure into boxes

A set is like a box of special things. One box might hold red blocks and another might hold round blocks. A red, round block can belong in both groups. Set theory asks what is in each box, what the boxes share and what is left outside.

Explain it to a 15-year-old

Collections with exact rules

A set is an unordered collection with no repeated elements. We can combine sets with union, keep common elements with intersection, remove one set from another with difference and compare them using subset relationships.

College level

A language for mathematical objects

Set theory formalises membership and builds structures from sets: ordered pairs, relations, functions, number systems, spaces and probability events. Modern foundations use axioms that permit useful constructions while blocking contradictory “collections of everything.”

Interactive set laboratory

Build two sets and watch every relationship change

Separate elements with commas. Repeated elements are removed because a set records membership, not repetition.

Runs locally
Live Venn diagram

A and B overlap, but neither contains the other.

Union A ∪ B
{1, 2, 3, 5, 4, 6}
Intersection A ∩ B
{3, 5}
Difference A ∖ B
{1, 2}
Difference B ∖ A
{4, 6}
Symmetric difference A △ B
{1, 2, 4, 6}
Complement Aᶜ
{4, 6, 7, 8}
Complement Bᶜ
{1, 2, 7, 8}
Cardinality
|A| = 4; |B| = 4; |A ∪ B| = 6
Show the Cartesian product A × B (16 ordered pairs)

{(1, 3), (1, 4), (1, 5), (1, 6), (2, 3), (2, 4), (2, 5), (2, 6), (3, 3), (3, 4), (3, 5), (3, 6), (5, 3), (5, 4), (5, 5), (5, 6)}

Now you do it

Practice set theory one level at a time

Work each problem by hand first. Use the linked calculator or lab to check examples, then reveal the short worked solution to inspect your reasoning.

Pre-high school

Build the idea with concrete examples.

Problem 1

Box A contains cat, dog and owl. Box B contains dog and fox. Which animal is in both boxes?

Check with the labEnter the two lists in the Venn lab and inspect the overlap.
Show answer and worked solution

Answer: dog

Reasoning: Look for an item that appears in both lists. Only dog is shared, so A∩B={dog}.

Problem 2

Using the same boxes, list every different animal that appears in either box.

Check with the labEnter both lists and read Union A∪B.
Show answer and worked solution

Answer: {cat, dog, owl, fox}

Reasoning: Union collects every element but does not repeat dog. Therefore A∪B={cat,dog,owl,fox}.

High school

Apply notation and calculation rules.

Problem 1

Let A={1,2,3,4} and B={3,4,5}. Find A∪B, A∩B and A∖B.

Check with the labEnter A and B in the Venn lab and compare all three outputs.
Show answer and worked solution

Answer: A∪B={1,2,3,4,5}; A∩B={3,4}; A∖B={1,2}

Reasoning: Union keeps every distinct member, intersection keeps the shared members, and A∖B keeps members of A that are absent from B.

Problem 2

How many subsets does S={a,b,c,d} have?

Check with calculatorCalculate 2⁴ with the exponent calculator.
Show answer and worked solution

Answer: 16

Reasoning: Each of four elements has two independent choices: included or excluded. Therefore |℘(S)|=2⁴=16.

College

Connect definitions and justify each step.

Problem 1

Using an arbitrary element x, prove that A∩B⊆A.

Show answer and worked solution

Answer: Every element of A∩B belongs to A by the definition of intersection

Reasoning: Choose an arbitrary x∈A∩B. By definition of intersection, x∈A and x∈B. In particular x∈A. Since the argument works for every x in the intersection, A∩B⊆A.

Problem 2

Prove (A∪B)ᶜ=Aᶜ∩Bᶜ by following one arbitrary element x.

Check with the labChoose a finite universe in the lab and compare both sides with sample sets.
Show answer and worked solution

Answer: x∉A∪B exactly when x∉A and x∉B

Reasoning: x∈(A∪B)ᶜ iff x∉A∪B, iff x∉A and x∉B, iff x∈Aᶜ and x∈Bᶜ, iff x∈Aᶜ∩Bᶜ. Equal membership conditions prove the sets are equal.

Advanced

Prove, generalise and test the limits.

Problem 1

Why can no function f:A→℘(A) be surjective?

Show answer and worked solution

Answer: The diagonal set D={a∈A | a∉f(a)} cannot equal f(d) for any d∈A

Reasoning: Assume D=f(d). If d∈D, the definition says d∉f(d)=D. If d∉D, the definition says d∈f(d)=D. Both possibilities contradict themselves, so D is missing from the range of f.

Problem 2

On ℤ define a∼b when a−b is divisible by 3. Describe the equivalence classes.

Check with calculatorTest several positive and negative integers modulo 3.
Show answer and worked solution

Answer: There are three classes: integers congruent to 0, 1 or 2 modulo 3

Reasoning: Every integer has exactly one remainder 0, 1 or 2 after division by 3. Integers share a class precisely when their difference is divisible by 3, producing [0], [1] and [2].

Read the language

Set notation from ∈ to ℘(A)

These symbols compress complete statements. Read each one aloud before manipulating it.

SymbolRead asMeaning and example
x ∈ Ax is an element of A3 ∈ {1,3,5} is true.
x ∉ Ax is not an element of A2 ∉ {1,3,5} is true.
the empty setA set containing no elements; |∅|=0.
A ⊆ BA is a subset of BEvery element of A also belongs to B; equality is allowed.
A ⊂ BA is a proper subset of BEvery element of A belongs to B, and A≠B.
A ∪ BA union BEverything in A, B or both.
A ∩ BA intersection BOnly elements shared by both sets.
A ∖ BA minus BElements in A that are not in B.
Aᶜthe complement of AEverything in the stated universe U that is not in A.
A △ Bsymmetric differenceElements in exactly one of A and B, but not both.
|A|cardinality of AThe number of elements when A is finite.
℘(A)power set of AThe set of every subset of A; if |A|=n, then |℘(A)|=2ⁿ.
A × BCartesian productEvery ordered pair (a,b) with a∈A and b∈B.
{x∈ℤ | x is even}set-builder notationAll integers x such that x is even.

The algebra of sets

Laws that let you simplify set expressions

These are not magic recipes. Each law says that both sides have exactly the same members.

IdentityA ∪ ∅ = AA ∩ U = A
DominationA ∪ U = UA ∩ ∅ = ∅
IdempotentA ∪ A = AA ∩ A = A
ComplementA ∪ Aᶜ = UA ∩ Aᶜ = ∅
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

Worked reasoning

Three problems sets solve

Counting an overlap

How many students chose either club?

Let M be 18 music students, S be 14 sports students and |M∩S|=6. Adding 18+14 counts the six shared students twice.

|M∪S| = |M| + |S| − |M∩S| = 18 + 14 − 6 = 26

Turning a relation into a function

Why ordered pairs matter

If A={1,2} and B={a,b}, then A×B={(1,a),(1,b),(2,a),(2,b)}. A function from A to B is a special subset of this product that gives each input exactly one output.

Probability as sets

Events live inside a sample space

For a die, Ω={1,2,3,4,5,6}. Let E be even outcomes and H be outcomes greater than 3. Then E∩H={4,6}, so P(E∩H)=2/6=1/3.

The map beneath mathematics

How sets grow into whole fields

Set theory is less a single destination than a construction language. Add structure to sets and familiar mathematics appears.

StartSets

Objects and membership

Add orderTuples

Coordinates and data

Add pairingRelations

Connections and comparisons

Add one output per inputFunctions

Rules and transformations

Add operationsAlgebra

Groups, rings and fields

Add distance or neighbourhoodGeometry and topology

Shape, continuity and space

Add measuresProbability and analysis

Chance, size and integration

Add states and operatorsQuantum mathematics

Hilbert spaces and observables

The strange edge of the map

Paradoxes and facts worth remembering

The oddities are not decoration. They reveal why mathematics needs precise foundations.

Russell’s paradox

Does the set of all sets that do not contain themselves contain itself?

If it does, its rule says it must not. If it does not, its rule says it must. The contradiction shows that any describable collection cannot automatically be accepted as a set.

Cantor’s theorem

Every set has a strictly larger power set

No pairing can match every element of A with every subset of A. Therefore |A|<|℘(A)|—even when A is infinite. This produces an endless hierarchy of larger infinities.

The empty set

Nothing is inside everything

∅⊆A for every set A. A subset claim fails only if it contains a counterexample, and the empty set has no element that could be one.

Not the same object

differs from {∅}

The first has zero elements. The second has one element—and that element happens to be the empty set. So |∅|=0, while |{∅}|=1.

Infinity behaves differently

A proper part can match the whole

The natural numbers and the even natural numbers can be paired by n↦2n. That cannot happen with finite sets, but it is a defining feature of infinite ones.

The continuum

Not all infinities are the same size

The real numbers cannot be listed in a sequence like the natural numbers. Cantor’s diagonal argument constructs a real number missing from any proposed complete list.

How to prove set statements

Membership is the master test

To prove A ⊆ B

  1. Choose an arbitrary element x in A.
  2. Use the definition of A to learn what x satisfies.
  3. Show those facts imply x belongs to B.

To prove A = B

  1. Prove A ⊆ B.
  2. Prove B ⊆ A.
  3. Conclude the sets have exactly the same elements.

To disprove a claim

  1. Find one concrete counterexample.
  2. Verify it belongs where claimed.
  3. Show it fails the required membership condition.

Where this fits

When should you learn Set theory?

The first encounter is not the final level. Many ideas begin visually, become computational in high school and become formal in college.

  1. 1Pre-high schoolUsually introduced
  2. 2High schoolGreater depth
  3. 3CollegeGreater depth
  4. 4AdvancedGreater depth
Typical subjects
  • Sorting and Venn diagrams
  • Algebra
  • Probability
  • Discrete mathematics
  • Foundations
Know first
  • Counting
  • Equality
  • Reading mathematical symbols
What it unlocks
  • Logic
  • Relations
  • Functions
  • Probability spaces
  • Mathematical structures

Clear answers

Questions about Set theory

What is set theory in simple terms?

Set theory is the mathematics of collections: what belongs to a collection, how collections overlap and how they can be combined, compared or used to construct other mathematical objects.

What is the difference between ∈ and ⊆?

The symbol ∈ compares an element with a set: x∈A means x belongs to A. The symbol ⊆ compares two sets: A⊆B means every element of A also belongs to B.

Is there a set of all sets?

Not in standard ZFC set theory. Allowing an unrestricted set of all sets produces contradictions such as Russell's paradox. Collections that are too large to be sets are treated as proper classes.

What is Russell's paradox?

Consider the collection of all sets that do not contain themselves. If that collection contains itself, then by its rule it must not; if it does not, then by its rule it must. The contradiction exposed a flaw in unrestricted set formation.

Is the empty set the same as a set containing the empty set?

No. The empty set ∅ has zero elements. The set {∅} has one element, and that element is the empty set.

Are all infinities the same size?

No. The natural numbers are countably infinite, while the real numbers are uncountably infinite. Cantor's theorem also shows that every set has a power set with strictly greater cardinality.

Why is set theory important?

Sets provide a shared construction language for relations, functions, number systems, probability spaces, algebraic structures, topology, analysis and much of modern mathematics.

MW SysArc Certified