Functions:
Injections, Surjections, Bijections
Master the three fundamental types of functions in discrete mathematics: one-to-one, onto, and bijective mappings between sets.
What Is a Function?
A function \( f: A \to B \) is a rule that assigns to each element in the domain \( A \) exactly one element in the codomain \( B \). Every element in \( A \) must be mapped, and no element in \( A \) can map to two different outputs.
The Three Types of Functions
Functions are classified by how they connect domain elements to codomain elements. These three properties capture different structural guarantees about the mapping.
Why Do These Matter?
Injection: One-to-One
Surjection: Onto
Bijection: Perfect Pairing
Cardinality and Set Size
For finite sets \( A \) and \( B \), the type of function \( f: A \to B \) constrains the relationship between \( |A| \) and \( |B| \):
Comparing Injection vs. Surjection
| Property | Injection (1-to-1) | Surjection (Onto) |
|---|---|---|
| Core guarantee | No two inputs share an output | Every output is reached |
| Formal test | \( f(a_1) = f(a_2) \implies a_1 = a_2 \) | \( \forall b, \exists a: f(a)=b \) |
| Cardinality | \( |A| \leq |B| \) | \( |A| \geq |B| \) |
| Left inverse? | ✓ Yes (if injective) | ✕ Not necessarily |
| Right inverse? | ✕ Not necessarily | ✓ Yes (if surjective) |
| Unhit elements in \( B \)? | Possible (some \( b \) unused) | None (all \( b \) hit) |
How to Prove Each Property
Example 1: \( f(x) = 2x + 1 \)
Let \( f: \mathbb{Z} \to \mathbb{Z} \) be defined by \( f(x) = 2x + 1 \). Determine whether \( f \) is injective, surjective, or bijective.
Example 2: \( f(x) = x^2 \)
Let \( f: \mathbb{Z} \to \mathbb{Z} \) be defined by \( f(x) = x^2 \). Classify this function.
Example 3: A Finite Set Bijection
Let \( A = \{a, b, c\} \) and \( B = \{1, 2, 3\} \). Define \( f(a) = 2 \), \( f(b) = 3 \), \( f(c) = 1 \). Is this a bijection?
Domain and Codomain Change Everything
The same formula can have different classification depending on the domain and codomain. Consider \( f(x) = x^2 \):
| Function | Injective? | Surjective? | Bijective? |
|---|---|---|---|
| \( \mathbb{Z} \to \mathbb{Z} \) | ✕ | ✕ | ✕ |
| \( \mathbb{N} \to \mathbb{N} \) | ✓ | ✕ | ✕ |
| \( \mathbb{R} \to [0, \infty) \) | ✕ | ✓ | ✕ |
| \( [0, \infty) \to [0, \infty) \) | ✓ | ✓ | ✓ |
Common Mistakes
Summary Table
| Property | Injection | Surjection | Bijection |
|---|---|---|---|
| Also called | One-to-one | Onto | One-to-one correspondence |
| Each output hit by | At most one input | At least one input | Exactly one input |
| Cardinality | \( |A| \leq |B| \) | \( |A| \geq |B| \) | \( |A| = |B| \) |
| Inverse exists? | Left inverse | Right inverse | Full inverse \( f^{-1} \) |
| Composition rule | \( g \circ f \) injective \( \implies f \) injective | \( g \circ f \) surjective \( \implies g \) surjective | Both rules hold |
Question 1 of 5
A function \( f: A \to B \) is injective if and only if:
Question 2 of 5
Let \( f: \mathbb{Z} \to \mathbb{Z} \) be defined by \( f(n) = n + 3 \). Which classification is correct?
Question 3 of 5
If \( f: A \to B \) is a surjection and \( A \) and \( B \) are finite sets, which must be true?
Question 4 of 5
Consider \( f: \{1,2,3,4\} \to \{a,b,c\} \) defined by \( f(1)=a, f(2)=b, f(3)=c, f(4)=a \). What type of function is this?
Question 5 of 5
Which of the following is necessary and sufficient for a function \( f: A \to B \) between finite sets of equal size to be a bijection?