MATH 308 — Lec 16 — Functions (Injective, Surjective, Bijective)
Math 308 · November 6, 2026
Lecture 16 — Functions: Injective, Surjective, Bijective
MATH 308 Bridge to Advanced Mathematics Chartrand §10.1–10.3
Goals for today. By the end of this lecture you should be able to:
-
define a function f:A→B as a special relation, and name its domain, codomain, and range;
-
state precisely what injective, surjective, and bijective mean, and recognize examples and non-examples;
-
prove a given function is injective (assume f(a1)=f(a2), deduce a1=a2) or surjective (given b, produce a preimage);
-
disprove one-to-one or onto with a single well-chosen counterexample.
A function is a special kind of relation (§10.1)
Recall from Lecture 13 that a relation from A to B is just a subset R⊆A×B: a set of ordered pairs (a,b). A function is a relation with one extra requirement — every input gets exactly one output.
Definition 1. A function f from a set A to a set B, written f:A→B, is a relation from A to B such that every a∈A is the first coordinate of exactly one ordered pair in f. When (a,b)∈f we write b=f(a) and call b the image of a, and a a preimage of b.
Here A is the domain and B is the codomain. The range of f is the set of values actually attained,
ran(f)={f(a):a∈A}⊆B.So “exactly one” splits into two demands: (i) at least one output — f(a) is defined for every a∈A (the function is total); and (ii) at most one output — a cannot map to two different values (the function is well-defined). The picture is a rule that sends each dot on the left to a single dot on the right.
A function f:A→B. Here f(a2)=f(a3)=b2, so ran(f)={b1,b2} while b3,b4 have no preimage. Two inputs may share an output; what is not allowed is an a with no arrow, or an a with two arrows.
Example 1. f:R→R, f(x)=x2. Domain R, codomain R, but ran(f)=[0,∞): squares are never negative, and every nonnegative y equals (y)2. So range = codomain here — keep the two ideas separate.
Example 2 (Two relations that are not functions). Let A={1,2,3}, B={a,b}.
-
R1={(1,a),(2,b)} fails (i): 3∈A is the first coordinate of no pair.
-
R2={(1,a),(1,b),(2,a),(3,b)} fails (ii): 1 is the first coordinate of two pairs.
The “vertical line test” from precalculus is exactly condition (ii): each vertical line x=a meets the graph in at most one point, and (with (i)) exactly one.
Remark 1. The codomain is part of the data of a function, not something you read off the rule. “f(x)=x2 as a map R→R” and “f(x)=x2 as a map R→[0,∞)” are different functions — and, as we’ll see, the second is onto while the first is not.
One-to-one and onto (§10.2)
The two central properties compare inputs to outputs.
Definition 2. Let f:A→B.
-
f is injective (one-to-one) if distinct inputs give distinct outputs:
for all a1,a2∈A,f(a1)=f(a2) ⇒ a1=a2. -
f is surjective (onto) if every element of the codomain is hit:
for all b∈B, there exists a∈A with f(a)=b,i.e.ran(f)=B.
These are the two quantifier shapes from Lecture 4. Injectivity is a universal statement, so we prove it by taking arbitrary a1,a2 with f(a1)=f(a2) and forcing a1=a2. Surjectivity is a “for all b, there exists a” statement, so we prove it by constructing a preimage a from b.
Injective = no two arrows share a target; surjective = every right-hand dot is targeted; bijective = a perfect pairing.
Proposition 1 (A proof of injectivity). f:R→R, f(x)=3x−5, is injective.
Proof. Let x1,x2∈R with f(x1)=f(x2). Then 3x1−5=3x2−5, so 3x1=3x2, and dividing by 3 gives x1=x2. Hence f is injective. ◻
Proposition 2 (A proof of surjectivity). The same f:R→R, f(x)=3x−5, is surjective.
Proof. Let y∈R be arbitrary. We must produce x∈R with f(x)=y. Solving 3x−5=y suggests x=3y+5, which is a real number. Check: f(3y+5)=3⋅3y+5−5=(y+5)−5=y. So every y has a preimage, and f is onto. ◻
(Notice the working style: solve for x on scratch paper to find the preimage, then present the clean verification. The reader only needs to see that your x works.)
Example 3 (Disproving one-to-one and onto). Consider g:R→R, g(x)=x2.
-
Not injective: g(−2)=4=g(2) but −2=2. One counterexample suffices to kill a “for all.”
-
Not surjective: −1∈R (the codomain) has no preimage, since x2=−1 has no real solution. Again, one witness suffices.
But h:[0,∞)→[0,∞), h(x)=x2, is both: shrinking the domain removes the sign ambiguity (injective), and matching the codomain to the range makes it onto (y=(y)2). Domain and codomain change everything.
A horizontal line hitting the graph of g(x)=x2 twice witnesses failure of injectivity (the “horizontal line test”).
Bijective functions (§10.3)
Definition 3. f:A→B is bijective (a bijection, or a one-to-one correspondence) if it is both injective and surjective. Equivalently: every b∈B has exactly one preimage.
A bijection is a perfect matching between A and B: each element on one side is paired with exactly one on the other, nothing left over on either side. This is precisely the property that lets us “undo” f, which is why bijections are the functions with inverses — the subject of Lecture 17.
Theorem 3. The function f:R→R, f(x)=3x−5, is a bijection.
Proof. It is injective and surjective by the two propositions above. A function that is both is by definition a bijection. ◻
Example 4 (A bijection between infinite sets). Let s:N→E where E={n∈N:n even} is defined by s(n)=2n. Injective: if 2n1=2n2 then n1=n2. Surjective: any even m∈E has the form m=2k for some k∈N, and s(k)=2k=m. So s is a bijection — the naturals and the even naturals are “the same size,” even though E⊊N. This astonishing possibility is the doorway to cardinality (Lecture 18).
The bijection s(n)=2n pairs each natural number with an even one, with nothing left over on either row.
Homework problems
-
For f:R→R, f(x)=5−2x, prove f is injective and surjective (hence bijective).
-
Decide, with proof or counterexample, whether each is injective / surjective: (a) f:Z→Z, f(n)=2n; (b) f:Z→Z, f(n)=n+7; (c) f:R→R, f(x)=x3.
-
Let A={1,2,3}. How many functions A→A are there in total? How many are bijections? (A bijection A→A is a permutation.)
-
Give a function N→N that is surjective but not injective, and one that is injective but not surjective.
-
Show that f:R−{2}→R−{1}, f(x)=x−2x, is injective. (Optional: is it onto?)
Suggested textbook exercises (Chartrand §10.1–10.3): 10.2, 10.6, 10.10, 10.14, 10.20, 10.26, 10.32.