Introduce to Set

Basis
Last updated: Tags: Set Theory

Sets are the foundation on which almost all of modern mathematics is built. Functions, sequences, probability spaces, even the natural numbers themselves — all of these are ultimately defined in terms of sets. Before you can read or write serious mathematics, you need to be fluent with sets.

What is a set?

A set is an unordered collection of distinct objects. The objects it contains are called its elements (or members).

The most direct way to describe a set is to list its elements inside curly braces:

A={1,  2,  3}A = \{1,\; 2,\; 3\}

Two things to keep in mind:

  • Order doesn’t matter. {1,2,3}\{1, 2, 3\} and {3,1,2}\{3, 1, 2\} are the same set.
  • Repetition is ignored. {1,1,2,3}\{1, 1, 2, 3\} is the same set as {1,2,3}\{1, 2, 3\}.

Membership

The symbol \in means “is an element of.” Its negation \notin means “is not an element of.”

2{1,2,3}5{1,2,3}2 \in \{1, 2, 3\} \qquad 5 \notin \{1, 2, 3\}

Standard number sets

Certain sets of numbers appear so often that they have reserved symbols:

SymbolNameElements
N\mathbb{N}Natural numbers0,1,2,3,0, 1, 2, 3, \dots
Z\mathbb{Z}Integers,2,1,0,1,2,\dots, -2, -1, 0, 1, 2, \dots
Q\mathbb{Q}Rational numbers12,  34,  7,  \tfrac{1}{2},\; -\tfrac{3}{4},\; 7,\; \dots
R\mathbb{R}Real numbersπ,  2,  1.5,  \pi,\; \sqrt{2},\; -1.5,\; \dots
C\mathbb{C}Complex numbers1+2i,  i,  1 + 2i,\; -i,\; \dots

Convention: Whether 0N0 \in \mathbb{N} varies by author. In this series, 00 is a natural number.

Set-builder notation

Listing elements works for small sets, but most interesting sets are too large — or infinite — to list explicitly. Set-builder notation lets you describe a set by a property its elements must satisfy:

{xRx>0}\{x \in \mathbb{R} \mid x > 0\}

Read this as: “the set of all xx in R\mathbb{R} such that x>0x > 0” — the positive reals. The vertical bar \mid stands for “such that.” You will also see a colon used in its place: {xR:x>0}\{x \in \mathbb{R} : x > 0\}.

More generally:

{xSP(x)}\{x \in S \mid P(x)\}

denotes the subset of SS consisting of all elements for which the predicate PP holds.

The empty set

The empty set \emptyset (also written {}\{\}) is the unique set that contains no elements. For every object xx, you have xx \notin \emptyset.

The empty set plays the same structural role in set theory that 00 plays in arithmetic.

Subsets

A set AA is a subset of BB, written ABA \subseteq B, when every element of AA is also an element of BB:

AB    x,xA    xBA \subseteq B \;\coloneqq\; \forall x,\quad x \in A \;\Rightarrow\; x \in B

If ABA \subseteq B but ABA \neq B, then AA is a proper subset of BB, written ABA \subsetneq B.

A few facts worth memorizing:

  • A\emptyset \subseteq A for every set AA.
  • AAA \subseteq A for every set AA.
  • NZQRC\mathbb{N} \subsetneq \mathbb{Z} \subsetneq \mathbb{Q} \subsetneq \mathbb{R} \subsetneq \mathbb{C}.

Set equality

Two sets are equal when they contain exactly the same elements. The standard way to prove A=BA = B is to show mutual containment:

A=B        AB   and   BAA = B \;\iff\; A \subseteq B \;\text{ and }\; B \subseteq A

This means sets are fully determined by their elements alone — it does not matter how you wrote down the set.

Core set operations

Given sets AA and BB, you can form new sets using the following operations.

Union

The union ABA \cup B collects every element that belongs to AA, to BB, or to both:

AB    {xxA or xB}A \cup B \;\coloneqq\; \{x \mid x \in A \text{ or } x \in B\}

Intersection

The intersection ABA \cap B keeps only elements that belong to both AA and BB:

AB    {xxA and xB}A \cap B \;\coloneqq\; \{x \mid x \in A \text{ and } x \in B\}

When AB=A \cap B = \emptyset, the sets are called disjoint.

Set difference

The difference ABA \setminus B (read: ”AA minus BB”) contains elements of AA that are not in BB:

AB    {xxA and xB}A \setminus B \;\coloneqq\; \{x \mid x \in A \text{ and } x \notin B\}

Complement

When all sets under discussion sit inside a fixed universal set UU, the complement of AA is everything in UU that is not in AA:

Ac    UA  =  {xUxA}A^c \;\coloneqq\; U \setminus A \;=\; \{x \in U \mid x \notin A\}

Cardinality

The cardinality of a finite set AA, written A|A|, is the number of elements it contains:

{a,b,c}=3,=0|\{a, b, c\}| = 3, \qquad |\emptyset| = 0

For infinite sets — like N\mathbb{N} or R\mathbb{R} — cardinality still makes sense, but requires more care. You will encounter the full theory of infinite cardinality in later checkpoints.

Summary

  • A set is an unordered collection of distinct objects; write it as {a,b,c}\{a, b, c\} or with set-builder notation {xSP(x)}\{x \in S \mid P(x)\}.
  • xAx \in A means xx belongs to AA; xAx \notin A means it does not.
  • The empty set \emptyset has no elements and is a subset of every set.
  • ABA \subseteq B iff every element of AA is in BB; A=BA = B iff ABA \subseteq B and BAB \subseteq A.
  • Core operations: union (ABA \cup B), intersection (ABA \cap B), difference (ABA \setminus B), complement (AcA^c).
  • The cardinality A|A| counts how many elements a set has.