Share this page

Learn X in Y minutes

Where X=Set theory

Set theory is a branch of mathematics that studies sets, their operations, and their properties.

Basic symbols

Operators

Qualifiers

Canonical sets

There are a few caveats to mention regarding the canonical sets: 1. Even though the empty set contains no items, the empty set is a subset of itself (and indeed every other set); 2. Mathematicians generally do not universally agree on whether zero is a natural number, and textbooks will typically explicitly state whether or not the author considers zero to be a natural number.

Cardinality

The cardinality, or size, of a set is determined by the number of items in the set. The cardinality operator is given by a double pipe, |...|.

For example, if S = { 1, 2, 4 }, then |S| = 3.

The Empty Set

Representing sets

Literal Sets

A set can be constructed literally by supplying a complete list of objects contained in the set. For example, S = { a, b, c, d }.

Long lists may be shortened with ellipses as long as the context is clear. For example, E = { 2, 4, 6, 8, ... } is clearly the set of all even numbers, containing an infinite number of objects, even though we’ve only explicitly written four of them.

Set Builder

Set builder notation is a more descriptive way of constructing a set. It relies on a subject and a predicate such that S = { subject : predicate }. For example,

A = { x : x is a vowel } = { a, e, i, o, u }
B = { x : x ∈ N, x < 10 } = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
C = { x : x = 2k, k ∈ N } = { 0, 2, 4, 6, 8, ... }

Sometimes the predicate may “leak” into the subject, e.g.

D = { 2x : x ∈ N } = { 0, 2, 4, 6, 8, ... }

Relations

Membership

Equality

Special Sets

The Power Set

P(A) = { x : x ⊆ A }

Set operations among two sets

Union

Given two sets A and B, the union of the two sets are the items that appear in either A or B, written as A ∪ B.

A ∪ B = { x : x ∈ A ∪ x ∈ B }

Intersection

Given two sets A and B, the intersection of the two sets are the items that appear in both A and B, written as A ∩ B.

A ∩ B = { x : x ∈ A, x ∈ B }

Difference

Given two sets A and B, the set difference of A with B is every item in A that does not belong to B.

A \ B = { x : x ∈ A, x ∉ B }

Symmetrical difference

Given two sets A and B, the symmetrical difference is all items among A and B that doesn’t appear in their intersections.

A △ B = { x : ((x ∈ A) ∩ (x ∉ B)) ∪ ((x ∈ B) ∩ (x ∉ A)) }

A △ B = (A \ B) ∪ (B \ A)

Cartesian product

Given two sets A and B, the cartesian product between A and B consists of a set containing all combinations of items of A and B.

A × B = { (x, y) | x ∈ A, y ∈ B }

Got a suggestion? A correction, perhaps? Open an Issue on the GitHub Repo, or make a pull request yourself!

Originally contributed by Andrew Ryan Davis, and updated by 9 contributors.