The Timpson Lyceum seal

The Timpson Lyceum · General Topology (Point Set Topology)

Relations and Functions – Lecture 4 (Topology)

Overview

This lecture builds the set-theoretic machinery for functions, the second of the two objects (sets being the first) that point-set topology returns to again and again. After a quick review of relations, equivalence relations, partitions, and equivalence classes, we define a function as a special kind of relation and develop the full notation for a function f:X→Yf : X \to Y — domain, codomain, image, the function/pre-image of a set, and the constant and identity functions. We then state how functions interact with unions, intersections, and differences (with the recurring subtlety that intersections only behave well one way), and finish by defining and proving one-to-one (injective), onto (surjective), and bijective functions, including a bijection between N\mathbb{N} and Z\mathbb{Z} that shows two infinite sets can have the same cardinality.

Key Concepts

Relation (review). A relation RR is just a set of ordered pairs. Writing xRyx \mathrel{R} y means (x,y)∈R(x,y) \in R.

Equivalence relation (review). A relation on XX that is reflexive (xRxx \mathrel{R} x), symmetric (xRy⇒yRxx \mathrel{R} y \Rightarrow y \mathrel{R} x), and transitive (xRyx \mathrel{R} y and yRz⇒xRzy \mathrel{R} z \Rightarrow x \mathrel{R} z). Examples: == on R\mathbb{R}, "same height," congruence of triangles, "same parity" on Z\mathbb{Z}. These capture a notion of being "the same."

Partition. A partition of XX is a set of mutually disjoint subsets of XX whose union is XX — every element lands in exactly one block (like sorting a student body into morning classes).

Equivalence class. For an equivalence relation RR on XX and x∈Xx \in X, [x]={ y∈X:xRy }.[x] = \{\, y \in X : x \mathrel{R} y \,\}. The set of equivalence classes is always a partition, and every partition arises from some equivalence relation — the two ideas are interchangeable. The bracket notation only makes sense once RR is known to be an equivalence relation.

Function. A function is a relation in which each left-hand element is paired with exactly one right-hand element. So {(1,□),(2,△),(3,□)}\{(1,\square),(2,\triangle),(3,\square)\} is a function (two inputs may share an output), but {(2,△),(2,□)}\{(2,\triangle),(2,\square)\} is not (one input, two outputs). Repeated identical pairs collapse, since these are sets.

Function from XX to YY — f:X→Yf : X \to Y. A relation ff from XX to YY such that for every x∈Xx \in X there exists one and only one y∈Yy \in Y with f(x)=yf(x) = y. Key point: a function must use all of XX (every input gets mapped) but need not use all of YY.

Image of a subset. For A⊆XA \subseteq X, f(A)={ y∈Y:∃ x∈A, f(x)=y }f(A) = \{\, y \in Y : \exists\, x \in A,\ f(x) = y \,\} — collect everything the elements of AA map to.

Pre-image (inverse image). For y∈Yy \in Y or W⊆YW \subseteq Y, f−1(y)={ x∈X:f(x)=y },f−1(W)={ x∈X:f(x)∈W }.f^{-1}(y) = \{\, x \in X : f(x) = y \,\}, \qquad f^{-1}(W) = \{\, x \in X : f(x) \in W \,\}. The pre-image is always a set (possibly empty); f−1(y)f^{-1}(y) is only defined for yy in the codomain. Because every input is used, f−1(Y)=Xf^{-1}(Y) = X always — though f(X)f(X) need not equal YY.

Constant function. ff is constant iff there is some c∈Yc \in Y with f(x)=cf(x) = c for all x∈Xx \in X.

Identity function. For a set XX, idX:X→X\mathrm{id}_X : X \to X is given by idX(x)=x\mathrm{id}_X(x) = x — every element pairs with itself.

Writing infinite functions. Rather than list pairs, use a rule: f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=x2f(x) = x^2, equivalently f={ (x,y):x∈R, y=x2 }f = \{\,(x,y) : x \in \mathbb{R},\ y = x^2\,\}.

Behavior under set operations. For f:X→Yf : X \to Y with A,B⊆XA, B \subseteq X, the image preserves unions but only contains the image of an intersection or difference:

The inequalities become strict exactly when two different inputs share an output. Pre-images behave perfectly — for U,V⊆YU, V \subseteq Y: f−1(U∪V)=f−1(U)∪f−1(V)f^{-1}(U \cup V) = f^{-1}(U) \cup f^{-1}(V) and f−1(U∩V)=f−1(U)∩f−1(V)f^{-1}(U \cap V) = f^{-1}(U) \cap f^{-1}(V).

Injective / surjective / bijective.

Cardinality. Two sets have the same size (cardinality) iff a bijection exists between them — you pair elements off rather than count. Written ∣A∣=∣B∣|A| = |B|. Notably ∣N∣=∣Z∣=∣Q∣|\mathbb{N}| = |\mathbb{Z}| = |\mathbb{Q}| (all "countable"), while R\mathbb{R} is a strictly larger infinity.

Worked Example

Prove that f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=3x+1f(x) = 3x + 1, is a bijection.

One-to-one. Assume f(a)=f(b)f(a) = f(b) and derive a=ba = b:

f(a)=f(b)3a+1=3b+13a=3ba=b.\begin{aligned} f(a) &= f(b) \\ 3a + 1 &= 3b + 1 \\ 3a &= 3b \\ a &= b. \end{aligned}

Equal outputs force equal inputs, so ff is injective.

Onto. Given any y∈Ry \in \mathbb{R}, solve f(x)=yf(x) = y for xx to exhibit a pre-image:

3x+1=y3x=y−1x=y−13.\begin{aligned} 3x + 1 &= y \\ 3x &= y - 1 \\ x &= \tfrac{y-1}{3}. \end{aligned}

Since y−13∈R\tfrac{y-1}{3} \in \mathbb{R} and f ⁣(y−13)=3⋅y−13+1=(y−1)+1=yf\!\left(\tfrac{y-1}{3}\right) = 3\cdot\tfrac{y-1}{3} + 1 = (y-1) + 1 = y, every yy is hit. Thus ff is surjective. Being both injective and surjective, ff is a bijection.

Contrast — a bijection between infinite sets. The map f:N→Zf : \mathbb{N} \to \mathbb{Z} given by f(n)={n2,n even−n+12,n oddf(n) = \begin{cases} \dfrac{n}{2}, & n \text{ even} \\ -\dfrac{n+1}{2}, & n \text{ odd} \end{cases} pairs 0↦0, 1↦−1, 2↦1, 3↦−2, 4↦2,…0\mapsto 0,\ 1\mapsto -1,\ 2\mapsto 1,\ 3\mapsto -2,\ 4\mapsto 2,\dots, hitting every integer exactly once — proving ∣N∣=∣Z∣|\mathbb{N}| = |\mathbb{Z}|.

Summary