Math 205: Real Analysis

Lecture 03 — Functions, Preimages, Composition, and Denumerable Sets

Lecture Notes


1   Injective Functions

Definition: Injective Function

\(f : A \to B\) is injective (one-to-one) if distinct inputs give distinct outputs:

$x \ne y \implies f(x) \ne f(y)$
Proof Strategy: Use the Contrapositive

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\).

Interactive: Logical Equivalence Truth Table

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\)

2   Surjective Functions

Definition: Surjective Function

\(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$$
Proof Strategy for Surjectivity

Take an arbitrary \(y \in B\) and explicitly construct an \(x \in A\) with \(f(x) = y\).

3   Examples

Interactive: Is \(f(x) = x^2\) Injective or Surjective?

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:

Check injectivity:
Check surjectivity:

Example: \(f(n) = 2n - 2\) from \(\mathbb{N}\) to \(\mathbb{E}\)

\(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!

4   Finite Sets and Cardinality

Theorem: Size Constraints

Injection \(f: A \to B \implies |A| \leq |B|\).   Surjection \(\implies |A| \geq |B|\).   Bijection \(\implies |A| = |B|\).

Warning: Same Size ≠ Bijective

Even if \(|A| = |B|\), a specific function between them might not be bijective unless explicitly verified.

5   Operations on Functions

Definition: Arithmetic of Functions

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)$$

6   Images and Preimages

Definition: Image and Preimage

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.

Interactive: Image vs Preimage of Image

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."

6.1   Preimages Preserve Intersections

Warning: Images Don't Preserve Intersections

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\).

Theorem: Preimages Preserve Intersections
$$f^{-1}(A \cap B) = f^{-1}(A) \cap f^{-1}(B)$$

Interactive: Chain of Equivalences Proof

Click each step to highlight the logical reasoning:

Full formal proof (click to expand)

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)\). □

Exercise

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.

7   Composition of Functions

Definition: Composition

For \(f: A \to B\) and \(g: B \to C\):

$$(g \circ f)(x) = g(f(x))$$

Interactive: Composition Visualizer

Watch an element travel through the composition \(g \circ f\):

Theorem: Composition of Bijections is Bijective

If \(f: A \to B\) and \(g: B \to C\) are bijections, then \(g \circ f : A \to C\) is bijective.

Proof (click to expand)

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. □

Warning: Converse Fails!

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.

8   Denumerable Sets

Definition: Denumerable

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.

8.1   \(\mathbb{Z}\) is Denumerable

Theorem: \(\mathbb{Z}\) is Denumerable

Define \(f: \mathbb{N} \to \mathbb{Z}\) by alternating non-negative and negative integers.

Interactive: Interleaving \(\mathbb{Z}\)

Watch the natural numbers map to the integers by interleaving:

ℕ:
ℤ:

8.2   Countability of \(\mathbb{N} \times \mathbb{N}\)

Theorem: \(\mathbb{N} \times \mathbb{N}\) is Denumerable

We index pairs by the sum \(m + n\). Pairs with the same sum lie on the same diagonal.

Interactive: Cantor's Diagonal Enumeration

Click Step to walk through the enumeration, or Auto to watch it animate. Click any cell to see its position:

Key Insight

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$$
Food for Thought

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.

9   Exercises

Exercises for Lecture 03

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