Lecture Notes
\(f : A \to B\) is injective (one-to-one) if distinct inputs give distinct outputs:
$x \ne y \implies f(x) \ne f(y)$The contrapositive is logically equivalent and much easier to work with:
$$f(x) = f(y) \implies x = y$$To prove injectivity: assume \(f(x) = f(y)\) and deduce \(x = y\).
Click rows to highlight. The blue columns confirm \(p \Rightarrow q \equiv \neg q \Rightarrow \neg p\):
| \(p\) | \(q\) | \(p \Rightarrow q\) | \(\neg q \Rightarrow \neg p\) |
|---|
\(f : A \to B\) is surjective (onto) if every element of \(B\) is hit:
$$\forall y \in B, \;\exists x \in A \text{ such that } f(x) = y$$Take an arbitrary \(y \in B\) and explicitly construct an \(x \in A\) with \(f(x) = y\).
Explore \(f : \mathbb{R} \to \mathbb{R}\), \(f(x) = x^2\). Enter a \(y\)-value to check surjectivity, or two \(x\)-values to check injectivity:
\(f : \mathbb{N} \to \mathbb{E}\) where \(\mathbb{E} = \{0,2,4,6,\ldots\}\). This is a bijection!
✓ Injective \(2n_1 - 2 = 2n_2 - 2 \implies n_1 = n_2\)
✓ Surjective Any \(2m \in \mathbb{E}\) equals \(f(m+1)\)
This shows \(\mathbb{N}\) and \(\mathbb{E}\) have the "same size" — surprising for infinite sets!
Injection \(f: A \to B \implies |A| \leq |B|\). Surjection \(\implies |A| \geq |B|\). Bijection \(\implies |A| = |B|\).
Even if \(|A| = |B|\), a specific function between them might not be bijective unless explicitly verified.
Given \(f, g : A \to \mathbb{R}\):
$$(f+g)(x) = f(x)+g(x), \quad (fg)(x) = f(x)g(x), \quad \left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)} \;\;(g(x)\neq 0)$$Direct image: \(f(E) = \{f(x) : x \in E\}\)
Preimage: \(f^{-1}(S) = \{x \in A : f(x) \in S\}\)
Note: \(f^{-1}\) is defined for any function, even non-invertible ones.
For \(f(x) = x^2\), explore how \(f(E)\) and \(f^{-1}(f(E))\) can differ:
The mismatch occurs because \(f\) is not injective — the preimage "picks up extras."
In general, \(f(A \cap B) \neq f(A) \cap f(B)\).
Counterexample: \(f(x) = w\) constant, \(A = \{1,2,3\}\), \(B=\{a,b\}\). Then \(f(A) \cap f(B) = \{w\}\) but \(f(A \cap B) = f(\varnothing) = \varnothing\).
Click each step to highlight the logical reasoning:
Part 1: \(f^{-1}(A \cap B) \subseteq f^{-1}(A) \cap f^{-1}(B)\).
Let \(x \in f^{-1}(A \cap B)\). Then \(f(x) \in A \cap B\), so \(f(x) \in A\) and \(f(x) \in B\). Hence \(x \in f^{-1}(A)\) and \(x \in f^{-1}(B)\), giving \(x \in f^{-1}(A) \cap f^{-1}(B)\). ✓
Part 2: \(f^{-1}(A) \cap f^{-1}(B) \subseteq f^{-1}(A \cap B)\).
Let \(x \in f^{-1}(A) \cap f^{-1}(B)\). Then \(f(x) \in A\) and \(f(x) \in B\), so \(f(x) \in A \cap B\), giving \(x \in f^{-1}(A \cap B)\). ✓
Both inclusions hold, so \(f^{-1}(A \cap B) = f^{-1}(A) \cap f^{-1}(B)\). □
Prove: \(f^{-1}(A \cup B) = f^{-1}(A) \cup f^{-1}(B)\).
Hint: Replace ∩ with ∪ and "and" with "or" in the chain of equivalences.
For \(f: A \to B\) and \(g: B \to C\):
$$(g \circ f)(x) = g(f(x))$$Watch an element travel through the composition \(g \circ f\):
If \(f: A \to B\) and \(g: B \to C\) are bijections, then \(g \circ f : A \to C\) is bijective.
Injective: Assume \((g \circ f)(x) = (g \circ f)(y)\), i.e. \(g(f(x)) = g(f(y))\).
Since \(g\) is injective: \(f(x) = f(y)\). Since \(f\) is injective: \(x = y\). ✓
Surjective: Let \(c \in C\). Since \(g\) is surjective, \(\exists b \in B\) with \(g(b) = c\). Since \(f\) is surjective, \(\exists a \in A\) with \(f(a) = b\). Then \((g \circ f)(a) = g(f(a)) = g(b) = c\). ✓
Both hold, so \(g \circ f\) is bijective. □
If \(g \circ f\) is bijective, \(f\) and \(g\) need not individually be bijective.
Example: \(f:\{1\}\to\{1,2\}\) with \(f(1)=1\), \(g:\{1,2\}\to\{1\}\) with \(g(x)=1\). Then \(g \circ f\) = identity (bijective!), but \(f\) isn't surjective and \(g\) isn't injective.
A set is denumerable (countably infinite) if it can be put in bijection with \(\mathbb{N}\). Equivalently, its elements can be listed as a sequence.
Define \(f: \mathbb{N} \to \mathbb{Z}\) by alternating non-negative and negative integers.
Watch the natural numbers map to the integers by interleaving:
We index pairs by the sum \(m + n\). Pairs with the same sum lie on the same diagonal.
Click Step to walk through the enumeration, or Auto to watch it animate. Click any cell to see its position:
This "zigzag" enumeration shows we can systematically list all pairs — even though \(\mathbb{N} \times \mathbb{N}\) seems "much larger" than \(\mathbb{N}\). The enumeration order is:
$$(1,1),\;(1,2),\;(2,1),\;(1,3),\;(2,2),\;(3,1),\;(1,4),\;\ldots$$Can you adapt this argument to show \(\mathbb{Q}\) is denumerable?
Hint: Every rational \(p/q\) with \(q \in \mathbb{N}\) corresponds to a pair in \(\mathbb{Z} \times \mathbb{N}\). Discard duplicates.
Exercise 1. Prove \(f(x) = 3x - 7\) is both injective and surjective on \(\mathbb{R}\).
Exercise 2. Prove or disprove: if \(f\) is injective and \(E \subseteq A\), then \(f^{-1}(f(E)) = E\).
Exercise 3. Prove \(f^{-1}(A \cup B) = f^{-1}(A) \cup f^{-1}(B)\).
Exercise 4. (a) If \(g \circ f\) is injective, prove \(f\) is injective. (b) If \(g \circ f\) is surjective, prove \(g\) is surjective.
Exercise 5. Show \(k(m,n) = (2m-1)\cdot 2^{n-1}\) is a bijection \(\mathbb{N}\times\mathbb{N} \to \mathbb{N}\).
Math 205: Real Analysis — Lecture 03