Injective: no two inputs collide
Last node, we noted functions may send two inputs to the same output ( sends and both to ). A function that never does this is injective (one-to-one). Formally:
Read it as: if two outputs are equal, the inputs were already equal. Different inputs are guaranteed different outputs — no collisions. The contrapositive says the same thing forward: .
How you prove it. Assume , then grind algebra until you've forced . That's the whole template — memorize it, love it, use it. If instead you can find two different inputs with the same output, you've proven NOT injective with a single counterexample. Proving requires generality; disproving needs one example. One. That's all. One beautiful collision and the injectivity claim is dead.
Surjective: nothing in the codomain is missed
Recall codomain (declared) versus image (earned). A function is surjective (onto) when the image fills the entire codomain — every declared possible output actually gets hit:
Equivalently, — no gap between what's promised and what's delivered.
How you prove it. Take an arbitrary in the codomain, then solve for and check your is a legal input. If you can always produce a preimage, it's surjective. To disprove, exhibit one with no solution — one orphan in the codomain.
Crucial: surjectivity depends on what codomain you declared. The exact same formula is surjective or not depending on whether you aimed it at or at . The choice of codomain is part of the function.
Bijective: the perfect pairing
A function that is both injective and surjective is bijective — a one-to-one correspondence. Every element of pairs with exactly one element of and vice versa: no collisions (injective) and no orphans (surjective). It's a perfect matching, partner for partner, nothing doubled and nothing left over.
Bijections are the crown jewels. They're exactly the functions that have inverses (next lesson), and they're the tool Cantor uses to count infinity (the stratum boss fight, and it is spectacular). A bijection between and says, with total precision, "these two sets are the same size" — even when both are infinite, even when that sounds insane. Hold that thought; the reactor is warming up.
Worked proof: f(x) = 3x + 1 on ℝ is bijective
Let , . Claim: bijective. Prove both halves.
Injective. Assume : Equal outputs forced equal inputs. Injective. ✓
Surjective. Take an arbitrary . Solve : This is a real number (legal input), and . So every has a preimage. Surjective. ✓
Both hold, so is bijective. Every nonzero-slope line is bijective on by the same argument — and that formula you just solved for? That's secretly the inverse function, which we'll name and weaponize next lesson.
The plot twist: domain and codomain CHANGE the verdict
Here's the trap that humbles everyone without exception — I've watched brilliant people stumble on this — and the most important idea in the lesson. Whether a function is injective/surjective is not a property of the formula alone — it depends on the domain and codomain you declare. Same formula, completely different verdict. Changing the endpoints changes the function. Full stop.
Take squaring, , and watch the verdict flip as we change the sets:
- . Not injective: (collision). Not surjective: has no preimage (nothing squares to a negative). Neither.
- . Now restrict inputs to non-negatives. Injective: if and , then (no ambiguity once you drop negatives). Still not surjective ( still orphaned). Injective only.
- . Restrict the codomain too. Now injective (as above) and surjective (every has preimage ). Bijective!
Same rule "", three different functions, three different verdicts — because a function is its formula plus its domain plus its codomain. Change any of those and you may change everything. This is why mathematicians are pedantic about writing in full, and why students who skip that notation get burned constantly. The arrow's endpoints aren't decoration. They're half the definition.
The horizontal line test: injectivity, drawn
Last lesson the vertical line test pictured single-valuedness. Now the horizontal line test pictures injectivity: a function is injective iff every horizontal line hits the graph at most once.
Why? A horizontal line at height collects all inputs with . Two hits means two different inputs sharing the output — a collision, i.e. NOT injective. So "at most one hit per horizontal line" is injectivity, drawn. Graph and slide a horizontal line: above the axis it hits twice (at ), exposing the collision — but restrict to and each horizontal line hits once.
Vertical test "is it a function" (single-valued). Horizontal test "is it injective" (no collisions). Two perpendicular tests, two perpendicular properties. Beautiful symmetry — and now you can read both straight off a graph.