This deck presents functions as a special kind of relation and draws the distinction between the codomain and the image. It covers injective, surjective, and bijective maps and their characterizations in terms of inverses, the behavior of image and preimage under unions and intersections, and the pigeonhole principle. It targets the misconceptions that being one-to-one can be checked on a single pair, that the codomain has no bearing on whether a map is onto, that image distributes over intersection, and that the preimage notation requires an inverse function to exist.
Subject: Foundations of Higher Mathematics · 107 slides · symbolic lesson
Open the interactive version of this deck · Homework for this lesson
Objectives
By the end of this deck you can:
1. Say precisely what a function is as a special kind of relation, and name its three parts.
2. Prove a map is injective, surjective, or bijective, and construct inverses.
3. Explain why the codomain changes whether a map is onto, and why the same rule can be onto one target but not another.
4. Work with image and preimage of sets and know exactly which set operations they preserve.
5. Apply the pigeonhole principle and see functions as the morphisms of the category of sets.
Warm-up
Discussion prompt
Before we open Functions: Injections, Surjections, Bijections: without looking back, what was the main idea of Relations, Equivalence Relations & Partitions, and what could you do by the end of it that you could not do before?
Hint: One sentence for the idea, one for the skill. If the second one is blank, that is the part to revisit.
Answer:
That deck defines relations as subsets of a product and covers the reflexive, symmetric, antisymmetric, and transitive properties, then equivalence relations and their classes, and the fundamental theorem that equivalence relations on a set correspond exactly to partitions of it. It targets the classic misconceptions: that symmetry and transitivity together imply reflexivity, that a partition is the same thing as an arbitrary cover, and that classes of related points are distinct.
Concept
A relation from A to B is any set of input-output pairs. A function is a relation with two extra guarantees.
Total: every input in the domain gets an output. Single-valued: no input gets two different outputs.
function — A relation f from A to B such that for every a in A there is exactly one b in B with (a, b) in f. We write f(a) = b.
\[ f : A \to B, \qquad \forall a \in A \;\; \exists! \, b \in B : (a,b) \in f \]
Counterexample
Discussion prompt
A relation from A to B is any set of input-output pairs. A function is a relation with two extra guarantees.
That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.
Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.
Intuition
Picture a machine: you feed in one input, it always produces something, and it never gives two different answers for the same input.
Total kills the 'undefined for some inputs' failure. Single-valued kills the 'ambiguous answer' failure. Both together make the machine deterministic.
This is exactly a pure, total function in programming: same input, same output, always defined.
Analogy
Discussion prompt
Explain A function is a reliable machine by analogy to something with no Foundations of Higher Mathematics in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.
Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.
Answer:
Picture a machine: you feed in one input, it always produces something, and it never gives two different answers for the same input.
Concept
Two functions are equal only when they agree on all three ingredients: same domain, same codomain, and the same output at every point.
\[ f = g \iff \operatorname{dom} f = \operatorname{dom} g \;\wedge\; \operatorname{cod} f = \operatorname{cod} g \;\wedge\; \forall x\, f(x) = g(x) \]
So the same formula with a different declared target is a different function. This will matter enormously for surjectivity.
Explain it
Discussion prompt
Explain When are two functions equal? to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.
Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.
Answer:
Two functions are equal only when they agree on all three ingredients: same domain, same codomain, and the same output at every point.
Concept
The domain is where inputs live. The codomain is the declared target set. The image is the set of outputs actually achieved.
image — The image (or range) of f is the set of all actual outputs: { f(a) : a in A }. It is always a subset of the codomain, possibly a proper one.
\[ \operatorname{im} f = \{\, f(a) : a \in A \,\} \subseteq B \]
Intuition
The codomain is what you declare the outputs will live in. The image is what the function actually hits.
You get to choose the codomain when you define the function; you do not get to choose the image — the rule decides it.
Onto-ness is precisely the question: does delivery fill the whole promise?
Picture it
Figure (svg): Two columns of dots with one arrow leaving each left dot and landing on a right dot; one right dot has no arrow into it, marking it outside the image.
Discussion prompt
Read the picture before the words. What is this showing, and what is the one thing it is built to make obvious? Commit to an answer, then read on.
Hint: Name the parts, then say what changes between them — and if nothing changes, say what is being held still.
Answer:
Draw the domain on the left, the codomain on the right, one arrow out of every left dot.
Concept
Draw the domain on the left, the codomain on the right, one arrow out of every left dot.
Figure (svg): Two columns of dots with one arrow leaving each left dot and landing on a right dot; one right dot has no arrow into it, marking it outside the image.
Every left dot has exactly one arrow out (total and single-valued). The red right dot has no arrow into it, so it is in the codomain but not the image.
Ranking
Put in order
Put the moves of Pin down domain, codomain, image into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Both are given by the declaration: the domain is the integers, and the codomain is the declared target, also the integers.
Worked example
Consider the squaring map on the integers, declared into the integers.
\[ f : \mathbb{Z} \to \mathbb{Z}, \qquad f(n) = n^2 \]
Read off the domain and codomain
Why: Both are given by the declaration: the domain is the integers, and the codomain is the declared target, also the integers.
Compute the image
Why: The outputs are exactly the perfect squares 0, 1, 4, 9, 16, and so on; negative integers and non-squares are never produced.
\[ \operatorname{im} f = \{\, 0, 1, 4, 9, 16, \dots \,\} \subsetneq \mathbb{Z} \]
Verify the image is a proper subset
Why: The value 2 is in the codomain but is not a perfect square, so it is never an output; the image sits strictly inside the codomain.
Picture it
Animation
Shows: Each line of the worked example "Pin down domain, codomain, image", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The value 2 is in the codomain but is not a perfect square, so it is never an output; the image sits strictly inside the codomain.
Trap
Claiming the outputs of the squaring map fill all of the integers because the codomain is the integers.
\[ \text{claim: } \operatorname{im} f = \mathbb{Z} \]
But 2 has no integer whose square is 2. The codomain being the integers does not force every integer to be an output.
The codomain is chosen by you; the image is forced by the rule. Keep them separate.
\[ \operatorname{im} f = \{ n^2 : n \in \mathbb{Z} \} \subsetneq \mathbb{Z} \]
The image is the perfect squares only. Whether the map is onto depends on which codomain you declared.
Concept
If the outputs of one function feed the inputs of another, you can chain them. Do the inner one first.
\[ g \circ f : A \to C, \qquad (g \circ f)(a) = g\big(f(a)\big) \]
For the chain to typecheck, the codomain of the inner map must be the domain of the outer map.
\[ f : A \to B, \quad g : B \to C \;\;\Rightarrow\;\; g \circ f : A \to C \]
Intuition
Read the notation right-to-left: the input hits the machine nearest to it first, and the result flows outward through the next machine.
It is a Unix pipe: the value passes through f, then through g. The order matters, and the types have to line up at each junction.
Step zero
Discussion prompt
Compute a composition — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Compute g after f
Answer:
Worked example
Take these two real functions and form both composites.
\[ f(x) = x + 1, \qquad g(x) = x^2 \]
Compute g after f
Why: Apply f first, then feed the result to g: square the quantity x plus one.
\[ (g \circ f)(x) = g(x+1) = (x+1)^2 \]
Compute f after g
Why: Apply g first, then feed to f: square, then add one. The order flips the answer.
\[ (f \circ g)(x) = f(x^2) = x^2 + 1 \]
Verify the two are genuinely different
Why: Test at x = 2: the first gives nine, the second gives five. Different outputs prove composition is not commutative.
\[ (g\circ f)(2) = 9 \neq 5 = (f \circ g)(2) \]
Picture it
Animation
Shows: Each line of the worked example "Compute a composition", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Test at x = 2: the first gives nine, the second gives five. Different outputs prove composition is not commutative.
Concept
When you chain three functions, it does not matter how you parenthesize the chain; you get the same function.
\[ (h \circ g) \circ f = h \circ (g \circ f) \]
This is because both sides send an input to the same nested application. Associativity is what makes function composition a monoid.
\[ \big((h\circ g)\circ f\big)(a) = h\big(g(f(a))\big) = \big(h\circ(g\circ f)\big)(a) \]
Worked example
Let each map act on the reals.
\[ f(x) = x+1, \quad g(x) = 2x, \quad h(x) = x^2 \]
Evaluate the left grouping at x = 3
Why: First h composed with g gives 2x squared; apply that to f of 3, which is 4, giving 8 squared.
\[ \big((h\circ g)\circ f\big)(3) = (h\circ g)(4) = (2\cdot 4)^2 = 64 \]
Evaluate the right grouping at x = 3
Why: First g composed with f sends 3 to 8; then h squares it.
\[ \big(h\circ(g\circ f)\big)(3) = h\big((g\circ f)(3)\big) = h(8) = 64 \]
Verify both groupings agree
Why: Both give 64, matching the general identity; the parenthesization did not change the result.
Picture it
Animation
Shows: Each line of the worked example "Check associativity on a value", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Both give 64, matching the general identity; the parenthesization did not change the result.
Concept
On any set there is a do-nothing function that returns its input unchanged. It is the neutral element for composition.
\[ \operatorname{id}_A : A \to A, \qquad \operatorname{id}_A(a) = a \]
Composing with identity changes nothing, on either side.
\[ f \circ \operatorname{id}_A = f = \operatorname{id}_B \circ f \]
Concept
A function is injective when different inputs are guaranteed to give different outputs. No two inputs collide onto the same value.
injective — f is injective (one-to-one) if whenever a and b are different inputs, f(a) and f(b) are different outputs.
\[ a \neq b \;\Rightarrow\; f(a) \neq f(b) \]
Intuition
Think of a hash function you wish you had: every distinct key lands in its own bucket, so nothing ever overwrites anything else.
In the arrow picture, no two arrows from the left ever point at the same dot on the right.
Concept
In practice you never chase unequal inputs directly. You use the logically equivalent contrapositive form, which is far easier to compute with.
\[ f(a) = f(b) \;\Rightarrow\; a = b \]
So the working recipe is: assume the outputs are equal, then do algebra until you are forced to conclude the inputs were equal.
Estimation
Predict first
Show the map is one-to-one on the reals.
Commit before you compute: what does Prove a linear map is injective come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.
Correct: Verify the conclusion matches the test
Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. Equal outputs forced equal inputs, which is exactly the contrapositive form of injectivity, so the map is one-to-one.
Worked example
Show the map is one-to-one on the reals.
\[ f : \mathbb{R} \to \mathbb{R}, \qquad f(x) = 2x + 1 \]
Assume two outputs are equal
Why: This starts the contrapositive test: set f of a equal to f of b and see what the inputs must satisfy.
\[ 2a + 1 = 2b + 1 \]
Cancel the constant and the coefficient
Why: Subtract one from both sides, then divide by two; every step is reversible because two is nonzero.
\[ 2a = 2b \;\Rightarrow\; a = b \]
Verify the conclusion matches the test
Why: Equal outputs forced equal inputs, which is exactly the contrapositive form of injectivity, so the map is one-to-one.
Picture it
Animation
Shows: Each line of the worked example "Prove a linear map is injective", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Equal outputs forced equal inputs, which is exactly the contrapositive form of injectivity, so the map is one-to-one.
Trap
Trying to prove a map is injective by plugging in two specific numbers and noticing the outputs differ.
\[ g(x) = x^2 : \quad g(2) = 4,\; g(3) = 9,\; 4 \neq 9 \]
Concluding 'injective' from this is wrong. Two happy sample pairs prove nothing about all pairs.
Injectivity is a universal claim; it must hold for every pair. One bad pair kills it.
\[ g(-2) = 4 = g(2), \quad \text{yet } -2 \neq 2 \]
So squaring on the reals is not injective. Prove injectivity by the general contrapositive argument, and disprove it with a single collision.
Concept
A function is surjective when every element of the codomain is actually hit by some input. Nothing in the target is left out.
surjective — f from A to B is surjective (onto) if for every b in B there exists an a in A with f(a) = b. Equivalently, the image equals the codomain.
\[ \forall b \in B \;\; \exists a \in A : f(a) = b \quad\Longleftrightarrow\quad \operatorname{im} f = B \]
Definition probe
Sort into buckets
Every line below is part of the definition of image or of surjective — one or the other, never both. Put each where it belongs.
Intuition
Surjective says the image equals the codomain: delivery covers the entire promise, with no target element missed.
To prove it you play a game: an opponent hands you any target value, and you must produce an input that maps to it. Winning for every target is surjectivity.
Step zero
Discussion prompt
Prove a linear map is onto the reals — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Take an arbitrary target y
Answer:
Worked example
Same map, now prove it is surjective onto the reals.
\[ f : \mathbb{R} \to \mathbb{R}, \qquad f(x) = 2x + 1 \]
Take an arbitrary target y
Why: Surjectivity must handle every target, so we fix an unknown y in the codomain and hunt for a preimage.
Solve for the required input
Why: Set 2x plus 1 equal to y and solve; because we can always divide by two over the reals, a real solution exists.
\[ x = \frac{y - 1}{2} \in \mathbb{R} \]
Verify the witness maps back to y
Why: Plug the candidate in: two times the quantity plus one collapses back to y exactly, so every target is hit.
\[ f\!\left(\tfrac{y-1}{2}\right) = 2\cdot\tfrac{y-1}{2} + 1 = y \]
Picture it
Animation
Shows: Each line of the worked example "Prove a linear map is onto the reals", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Plug the candidate in: two times the quantity plus one collapses back to y exactly, so every target is hit.
Concept
Because onto-ness compares the image to the codomain, changing the codomain can flip the answer even though the rule is identical.
Shrink the codomain down to the image and any function becomes surjective. Enlarge it past the image and it stops being surjective.
\[ n \mapsto n^2 \text{ is onto } \{0,1,4,9,\dots\} \text{ but not onto } \mathbb{Z} \]
Hypothesis
Predict first
Squaring: codomain and domain sensitivity is about to be worked. State your hypothesis first: which rule or definition decides this one, and what is the first move it forces? Then watch whether the example agrees with you.
Correct: Restrict the domain to the nonnegative reals
Why: On the nonnegative reals, equal squares force equal bases because the square root is single-valued there; so s is injective on that domain.
A hypothesis you wrote down is falsifiable; a vague sense of how it will go is not. If the example opens somewhere else, that gap is the thing worth chasing.
Worked example
Study the squaring rule under different domains and codomains.
\[ s(x) = x^2 \]
Restrict the domain to the nonnegative reals
Why: On the nonnegative reals, equal squares force equal bases because the square root is single-valued there; so s is injective on that domain.
\[ a,b \ge 0,\; a^2 = b^2 \;\Rightarrow\; a = b \]
Declare the codomain as the nonnegative reals
Why: Every nonnegative target y has the witness square root of y, so with this codomain s is surjective.
\[ s\big(\sqrt{y}\,\big) = y \quad (y \ge 0) \]
Enlarge the codomain back to all reals
Why: Now negative targets are unreachable since squares are never negative, so surjectivity is lost though nothing about the rule changed.
Verify the contrast with a concrete value
Why: The target minus one has no real square root, confirming that onto-ness genuinely depends on the declared codomain.
\[ \nexists\, x \in \mathbb{R} : x^2 = -1 \]
Picture it
Animation
Shows: Each line of the worked example "Squaring: codomain and domain sensitivity", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The target minus one has no real square root, confirming that onto-ness genuinely depends on the declared codomain.
Trap
Calling the squaring map surjective because 'it produces lots of values' without checking the declared codomain.
\[ s : \mathbb{R} \to \mathbb{R}, \quad s(x) = x^2 \;\;(\text{claimed onto}) \]
But the negative reals are in the codomain and are never outputs, so the map misses half the target.
Always test onto-ness against the exact declared codomain, target by target.
\[ s : \mathbb{R} \to [0,\infty), \quad s(x) = x^2 \;\;(\text{onto}) \]
With the codomain trimmed to the nonnegative reals it is surjective; with all reals it is not. The codomain is part of the question.
Concept
A bijection is a function that is both one-to-one and onto: every target is hit, and hit exactly once.
bijective — f is bijective if it is both injective and surjective. Equivalently, every element of the codomain has exactly one preimage.
\[ \text{bijective} \iff \text{injective} \;\wedge\; \text{surjective} \]
Matching
Match the pairs
Match each term to the definition this lesson gave it — not the one you would guess from the word.
Why: These are the working definitions of function, image, injective, surjective, bijective as Functions: Injections, Surjections, Bijections uses them. Pairing them correctly is the test of whether you could state each one with the slide switched off.
Intuition
A bijection pairs up the two sets flawlessly: each left element with one right element and vice versa, with none left over on either side.
That is why bijections are the tool for saying two sets have the same size, and why they are exactly the invertible functions.
Picture it
Figure (svg): Three small arrow diagrams. Left: injective, arrows land on distinct targets but one target is unhit. Middle: surjective, every target hit but two arrows share one target. Right: bijective, a one-to-one pairing covering every target once.
Discussion prompt
Read the picture before the words. What is this showing, and what is the one thing it is built to make obvious? Commit to an answer, then read on.
Hint: Name the parts, then say what changes between them — and if nothing changes, say what is being held still.
Answer:
Three arrow diagrams: injective misses a target, surjective doubles up on one, bijective is a clean pairing.
Concept
Three arrow diagrams: injective misses a target, surjective doubles up on one, bijective is a clean pairing.
Figure (svg): Three small arrow diagrams. Left: injective, arrows land on distinct targets but one target is unhit. Middle: surjective, every target hit but two arrows share one target. Right: bijective, a one-to-one pairing covering every target once.
Only the rightmost diagram is a bijection: no missed target, no doubled target.
Missing information
Discussion prompt
Combine the two earlier results into a bijection and read off the inverse.
What do you need to know — or decide — before the first line can be written? List everything the problem has to hand you.
Hint: Anything you would have to invent to get started is a thing the problem must supply.
Answer:
Solving y equals 2x plus 1 for x gave x equals y minus one over two; that formula is the inverse candidate.
Worked example
Combine the two earlier results into a bijection and read off the inverse.
\[ f : \mathbb{R} \to \mathbb{R}, \qquad f(x) = 2x + 1 \]
Propose the inverse rule
Why: Solving y equals 2x plus 1 for x gave x equals y minus one over two; that formula is the inverse candidate.
\[ g(y) = \frac{y-1}{2} \]
Check g undoes f
Why: Compose g after f on a general x; the arithmetic collapses to x, so g is a left inverse.
\[ g(f(x)) = \frac{(2x+1)-1}{2} = x \]
Check f undoes g
Why: Compose f after g on a general y; it collapses to y, so g is also a right inverse.
\[ f(g(y)) = 2\cdot\frac{y-1}{2} + 1 = y \]
Verify both composites are the identity
Why: A two-sided inverse exists, so f is a bijection; g composed with f and f composed with g are both the identity map.
\[ g \circ f = \operatorname{id}_{\mathbb{R}} = f \circ g \]
Picture it
Animation
Shows: Each line of the worked example "Prove a linear map is a bijection", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Compose g after f on a general x; the arithmetic collapses to x, so g is a left inverse.
Concept
The clean characterization: a function has a genuine inverse function if and only if it is a bijection. Injectivity and surjectivity are precisely the two halves of invertibility.
\[ f \text{ bijective} \iff \exists\, g : f \circ g = \operatorname{id}_B \;\wedge\; g \circ f = \operatorname{id}_A \]
When it exists, the inverse is unique, and we write it as the map that reverses every arrow.
\[ f^{-1} : B \to A \]
Concept
Half of invertibility already means something. A function has a left inverse exactly when it is injective.
\[ (\exists g)\; g \circ f = \operatorname{id}_A \iff f \text{ injective} \]
Intuitively, if a left inverse can recover the input from the output, then the output must have pinned the input down uniquely.
Concept
The mirror image: a function has a right inverse exactly when it is surjective.
\[ (\exists g)\; f \circ g = \operatorname{id}_B \iff f \text{ surjective} \]
Building the right inverse means choosing, for each target, some preimage. Making infinitely many simultaneous choices is exactly the Axiom of Choice.
Ranking
Put in order
Put the moves of A left inverse for a non-surjection into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Send nonnegative integers to themselves and dump every negative integer onto zero; this is defined on all of the codomain.
Worked example
The inclusion of the naturals into the integers is injective but not onto. It still has a left inverse.
\[ \iota : \mathbb{N} \to \mathbb{Z}, \qquad \iota(n) = n \]
Define a retraction on the integers
Why: Send nonnegative integers to themselves and dump every negative integer onto zero; this is defined on all of the codomain.
\[ r(k) = \begin{cases} k & k \ge 0 \\ 0 & k < 0 \end{cases} \]
Compose r after the inclusion
Why: Inputs from the naturals are already nonnegative, so r returns them unchanged; the composite is the identity on the naturals.
\[ r(\iota(n)) = r(n) = n \quad (n \in \mathbb{N}) \]
Verify it is only a left inverse
Why: Check the other order at negative input: r sends minus one to zero, and the inclusion cannot recover minus one, so it is not a right inverse. Left inverse matches injectivity, not surjectivity.
\[ \iota(r(-1)) = \iota(0) = 0 \neq -1 \]
Picture it
Animation
Shows: Each line of the worked example "A left inverse for a non-surjection", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Check the other order at negative input: r sends minus one to zero, and the inclusion cannot recover minus one, so it is not a right inverse. Left inverse matches injectivity, not surjectivity.
Trap
Seeing a left inverse and concluding the function is invertible, hence bijective.
\[ r \circ \iota = \operatorname{id}_{\mathbb{N}} \;\Rightarrow\; \iota \text{ bijective} \;? \]
But the inclusion of the naturals into the integers is not onto, so it is not bijective despite having a left inverse.
A left inverse buys injectivity only; a right inverse buys surjectivity only. You need both orders to conclude bijective.
\[ \text{bijective} \iff (\exists g)\; g\circ f = \operatorname{id} \;\wedge\; f\circ g = \operatorname{id} \]
Always check that the same candidate inverse works on both sides before claiming a genuine inverse function.
Break the constraint
Discussion prompt
The rule this trap just fixed:
A left inverse buys injectivity only; a right inverse buys surjectivity only. You need both orders to conclude bijective.
Now break it on purpose. Build a case that violates it and follow the consequences until something visibly fails. Where does the failure first show up — and would you have noticed it if you had not been looking?
Hint: The dangerous rules are the ones whose violation still produces an answer. If yours fails loudly, try to find one that fails quietly.
Concept
Both properties survive composition. Chaining two injections gives an injection; chaining two surjections gives a surjection; chaining two bijections gives a bijection.
\[ f,g \text{ injective} \Rightarrow g\circ f \text{ injective}; \quad f,g \text{ surjective} \Rightarrow g\circ f \text{ surjective} \]
This is what makes bijections behave like isomorphisms: the class is closed under composition and contains the identities.
Estimation
Predict first
Prove the general statement for two injective maps that chain.
Commit before you compute: what does Composition of injections is injective come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.
Correct: Verify the injectivity conclusion
Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. Equal composite outputs forced equal inputs, which is exactly injectivity of g composed with f.
Worked example
Prove the general statement for two injective maps that chain.
\[ f : A \to B, \quad g : B \to C, \quad \text{both injective} \]
Assume the composite agrees on two inputs
Why: Start the contrapositive test on the composite: suppose g of f of a equals g of f of b.
\[ g(f(a)) = g(f(b)) \]
Cancel the outer injection
Why: Since g is injective, equal g-values force equal inputs to g, so f of a equals f of b.
\[ f(a) = f(b) \]
Cancel the inner injection
Why: Since f is injective, equal f-values force a equals b.
\[ a = b \]
Verify the injectivity conclusion
Why: Equal composite outputs forced equal inputs, which is exactly injectivity of g composed with f. Both injections were used, in order.
Picture it
Animation
Shows: Each line of the worked example "Composition of injections is injective", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Equal composite outputs forced equal inputs, which is exactly injectivity of g composed with f. Both injections were used, in order.
Step zero
Discussion prompt
Composition of surjections is surjective — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Fix an arbitrary final target
Answer:
Worked example
Now the dual statement for two surjective maps.
\[ f : A \to B, \quad g : B \to C, \quad \text{both surjective} \]
Fix an arbitrary final target
Why: Surjectivity of the composite must reach every c in C, so we start with an unknown c.
\[ c \in C \]
Pull c back through g
Why: Since g is onto, there is some b in B mapping to c.
\[ \exists\, b \in B : g(b) = c \]
Pull that b back through f
Why: Since f is onto, there is some a in A mapping to b; chaining gives the composite hitting c.
\[ \exists\, a \in A : f(a) = b, \quad (g\circ f)(a) = c \]
Verify every target is reached
Why: The arbitrary c received a preimage a under the composite, so g composed with f is surjective.
Picture it
Animation
Shows: Each line of the worked example "Composition of surjections is surjective", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The arbitrary c received a preimage a under the composite, so g composed with f is surjective.
Trap
Knowing the composite is injective and concluding that both f and g must be injective.
\[ g \circ f \text{ injective} \;\Rightarrow\; g \text{ injective} \;? \]
False. Take f from a one-point set into the reals, and g the squaring map. The composite is trivially injective, yet g is not.
If the composite is injective, only the inner map f is forced to be injective; the outer map g need not be.
\[ g \circ f \text{ injective} \;\Rightarrow\; f \text{ injective} \]
Dually, if the composite is surjective, only the outer map g is forced onto. Track which side the property lands on.
Concept
Functions act not just on points but on whole sets. The image of a subset of the domain is the set of its outputs.
image of a set — For a subset S of the domain, f of S is the set { f(a) : a in S }, collecting every output of an element of S.
\[ f(S) = \{\, f(a) : a \in S \,\} \]
Concept
Running the other direction, the preimage of a target subset gathers every input that lands inside it.
preimage of a set — For a subset T of the codomain, the preimage of T is the set of all inputs whose output lies in T. Written f-inverse of T, but no inverse function need exist.
\[ f^{-1}(T) = \{\, a \in A : f(a) \in T \,\} \]
Intuition
For a single target value, the preimage is its fiber: all the inputs that collapse onto it. For a set of targets, you union up their fibers.
This is why the preimage is so well behaved: sorting inputs by which fiber they fall in respects unions, intersections, and complements automatically.
Concept
Preimage commutes with union, intersection, and complement. Image commutes with union, but only gives a subset relation for intersection.
\[ f^{-1}(T_1 \cap T_2) = f^{-1}(T_1) \cap f^{-1}(T_2), \qquad f^{-1}(T^c) = \big(f^{-1}(T)\big)^c \]
\[ f(S_1 \cup S_2) = f(S_1) \cup f(S_2), \qquad f(S_1 \cap S_2) \subseteq f(S_1) \cap f(S_2) \]
Missing information
Discussion prompt
Prove the image of a union is the union of the images, by mutual inclusion.
What do you need to know — or decide — before the first line can be written? List everything the problem has to hand you.
Hint: Anything you would have to invent to get started is a thing the problem must supply.
Answer:
A point y in the image of the union is f of some a with a in one of the two sets.
Worked example
Prove the image of a union is the union of the images, by mutual inclusion.
\[ f(S_1 \cup S_2) = f(S_1) \cup f(S_2) \]
Take an element of the left side
Why: A point y in the image of the union is f of some a with a in one of the two sets.
\[ y = f(a), \quad a \in S_1 \cup S_2 \]
Case-split on which set holds a
Why: If a is in the first set then y is in the first image; if in the second, y is in the second image; either way y is in the union of images.
\[ y \in f(S_1) \cup f(S_2) \]
Run the reverse inclusion
Why: Any y in one of the images comes from an a in that set, hence from the union, so y is in the image of the union; both inclusions hold.
Verify with a tiny instance
Why: Take squaring, first set is negative one, second is one; both sides equal the single value one, matching the proven identity.
\[ f(\{-1\}\cup\{1\}) = \{1\} = f(\{-1\}) \cup f(\{1\}) \]
Picture it
Animation
Shows: Each line of the worked example "Image preserves union", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Take squaring, first set is negative one, second is one; both sides equal the single value one, matching the proven identity.
Estimation
Predict first
Exhibit the failure with a two-point counterexample.
Commit before you compute: what does Image does not preserve intersection come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.
Correct: Verify the inclusion is strict
Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. The empty set is a proper subset of the singleton one, so equality fails here; the collision at one is exactly what breaks it.
Worked example
Exhibit the failure with a two-point counterexample.
\[ f : \mathbb{R} \to \mathbb{R}, \; f(x) = x^2, \quad S_1 = \{-1\}, \; S_2 = \{1\} \]
Compute the left side
Why: The two singletons are disjoint, so their intersection is empty, and the image of the empty set is empty.
\[ f(S_1 \cap S_2) = f(\varnothing) = \varnothing \]
Compute the right side
Why: Squaring sends both minus one and one to one, so each image is the singleton one, and their intersection is that singleton.
\[ f(S_1) \cap f(S_2) = \{1\} \cap \{1\} = \{1\} \]
Verify the inclusion is strict
Why: The empty set is a proper subset of the singleton one, so equality fails here; the collision at one is exactly what breaks it.
\[ \varnothing \subsetneq \{1\} \]
Picture it
Animation
Shows: Each line of the worked example "Image does not preserve intersection", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The empty set is a proper subset of the singleton one, so equality fails here; the collision at one is exactly what breaks it.
Trap
Assuming image behaves like preimage and commutes with intersection.
\[ f(S_1 \cap S_2) = f(S_1) \cap f(S_2) \quad (\text{false in general}) \]
The two-point example above breaks it: the left side is empty, the right side is a singleton.
Only the subset direction is guaranteed, and equality is exactly recovered when f is injective.
\[ f(S_1 \cap S_2) \subseteq f(S_1) \cap f(S_2), \quad \text{equality if } f \text{ injective} \]
Preimage always commutes with intersection; image needs injectivity. Remember which direction is safe.
Concept
The symbol for preimage looks like an inverse function, but it is defined for every function, even ones with no inverse at all.
\[ f^{-1}(T) = \{ a : f(a) \in T \} \text{ always makes sense} \]
It is an operation on subsets of the codomain. Only when f is a bijection does it also happen to agree with an actual inverse function applied pointwise.
Trap
Reading the preimage notation as proof that the function can be inverted.
\[ f^{-1}(\{4\}) \text{ written} \;\Rightarrow\; f^{-1} \text{ exists as a function} \;? \]
For squaring, the preimage of the singleton four is the two-element set of minus two and two — that is not the output of any inverse function.
Preimage of a set is a set of inputs; it can be empty or have many elements. An inverse function requires a single output per input.
\[ f^{-1}(\{4\}) = \{-2, 2\}, \qquad f^{-1}(\{-1\}) = \varnothing \]
An inverse function exists only when every such preimage is a single point, that is, when f is a bijection.
Two truths and a lie
Sort into buckets
Some of these hold up and some are the exact mistakes this lesson is built to prevent. Sort them.
A to B is any set of input-output pairs. A function is a relation with two extra guarantees.; Picture a machine: you feed in one input, it always produces something, and it never gives two different answers for the same input.; Two functions are equal only when they agree on all three ingredients: same domain, same codomain, and the same output at every point.Concept
A short but powerful counting fact about functions: you cannot fit more inputs into fewer output slots without a collision.
pigeonhole principle — If a function maps a finite set to a strictly smaller finite set, it cannot be injective: some two distinct inputs share an output.
\[ |A| > |B| \;\Rightarrow\; f : A \to B \text{ is not injective} \]
Intuition
If more pigeons roost than there are holes, at least one hole holds two pigeons. That is the whole idea, and it is just injectivity failing on finite sets.
Computer scientists meet it as the reason a hash from many keys into few buckets must produce a collision.
Explain it
Discussion prompt
Explain More pigeons than holes to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.
Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.
Answer:
If more pigeons roost than there are holes, at least one hole holds two pigeons. That is the whole idea, and it is just injectivity failing on finite sets.
Step zero
Discussion prompt
Pigeonhole: shared handshake counts — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Bound each person's handshake count
Answer:
Worked example
Claim: at a party of n people, two people have shaken the same number of hands.
\[ n \ge 2 \text{ people} \]
Bound each person's handshake count
Why: Nobody shakes their own hand, so each person's count lies among the n values from zero to n minus one.
\[ \text{count} \in \{0, 1, \dots, n-1\} \]
Rule out the two extremes coexisting
Why: If someone shook everyone (count n minus one) then nobody can have shaken zero, so at most n minus one distinct counts are actually possible.
\[ \text{not both } 0 \text{ and } n-1 \text{ occur} \]
Apply pigeonhole
Why: There are n people but only n minus one possible count-values, so the count function cannot be injective.
\[ n \text{ people} \to (n-1) \text{ values} \]
Verify on a small case
Why: With three people the possible counts are zero, one, two but not both zero and two, so three people share among two values; two must match.
Picture it
Animation
Shows: Each line of the worked example "Pigeonhole: shared handshake counts", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: With three people the possible counts are zero, one, two but not both zero and two, so three people share among two values; two must match.
Concept
Step back: sets are objects, functions are the arrows between them, identities exist, and composition is associative. That is a category, the category of sets.
In this language, the invertible arrows are exactly the bijections. Bijection is to sets what isomorphism is to every later structure: groups, rings, vector spaces.
\[ \text{bijection} : \mathbf{Set} \;\;\longleftrightarrow\;\; \text{isomorphism} : \text{any category} \]
Analogy
Discussion prompt
Explain Functions are the morphisms of Set by analogy to something with no Foundations of Higher Mathematics in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.
Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.
Answer:
Step back: sets are objects, functions are the arrows between them, identities exist, and composition is associative. That is a category, the category of sets.
Concept
A map that collides on its full domain can become injective the moment you shrink the domain to remove the offending inputs.
Squaring collides because a number and its negative share a square. Cut the domain down to the nonnegative reals and the collision is gone.
\[ x^2 \text{ injective on } [0,\infty) \text{ though not on } \mathbb{R} \]
Counterexample
Discussion prompt
A map that collides on its full domain can become injective the moment you shrink the domain to remove the offending inputs.
That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.
Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.
Answer:
Squaring collides because a number and its negative share a square. Cut the domain down to the nonnegative reals and the collision is gone.
Ranking
Put in order
Put the moves of Compute a preimage set into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. By definition the preimage gathers all x whose square is one or four; solve each membership condition.
Worked example
Find the preimage of a target set under the squaring map on the reals.
\[ f(x) = x^2, \qquad T = \{1, 4\} \]
Collect every input landing in the target
Why: By definition the preimage gathers all x whose square is one or four; solve each membership condition.
\[ f^{-1}(T) = \{ x : x^2 = 1 \text{ or } x^2 = 4 \} \]
Solve the two square conditions
Why: The square equals one at plus or minus one, and equals four at plus or minus two; union the fibers.
\[ f^{-1}(T) = \{ -2, -1, 1, 2 \} \]
Verify each candidate maps into T
Why: Squaring each of the four values gives one or four, both in the target, and no other real squares to one or four; the preimage is exactly these four points.
Picture it
Animation
Shows: Each line of the worked example "Compute a preimage set", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Squaring each of the four values gives one or four, both in the target, and no other real squares to one or four; the preimage is exactly these four points.
Pattern
1. To prove injective, assume equal outputs and derive equal inputs
Why: Use the contrapositive form: set f of a equal to f of b, do reversible algebra, conclude a equals b. To disprove, exhibit one collision.
2. To prove surjective, take an arbitrary target and construct a preimage
Why: Fix a general y in the exact declared codomain, solve f of x equals y, and confirm the solution lies in the domain. Always check against the stated codomain.
3. To prove bijective, exhibit a two-sided inverse
Why: Produce a candidate g and verify both g after f and f after g are the identity. Both orders are required.
4. For set-images, trust preimage and doubt image
Why: Preimage commutes with union, intersection, and complement; image commutes only with union, and with intersection only up to a subset unless f is injective.
Real world
Discussion prompt
Outside this lesson: where does Functions: Injections, Surjections, Bijections actually turn up? Name one concrete situation — a job, a piece of software someone ships, a decision somebody has to make — and say which part of The recipe: proving injective, surjective, bijective is doing the work in it.
Hint: Vague is the failure mode here. "Engineering" is not a situation; "deciding whether this build is fast enough to ship" is.
Answer:
That deck presents functions as a special kind of relation and draws the distinction between the codomain and the image. It covers injective, surjective, and bijective maps and their characterizations in terms of inverses, the behavior of image and preimage under unions and intersections, and the pigeonhole principle. It targets the misconceptions that being one-to-one can be checked on a single pair, that the codomain has no bearing on whether a map is onto, that image distributes over intersection, and that the preimage notation requires an inverse function to exist.
Elimination
Eliminate the wrong options
Which of these functions from the reals to the reals is injective?
3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.
Survives elimination: B
Why: The cubing map is strictly increasing on the reals, so equal cubes force equal inputs and no two distinct inputs collide. That is exactly injectivity.
Check
Read each rule as a function from the reals to the reals, then choose.
Check your understanding
Which of these functions from the reals to the reals is injective?
Answer: B
Why: The cubing map is strictly increasing on the reals, so equal cubes force equal inputs and no two distinct inputs collide. That is exactly injectivity.
Prediction
Predict first
Is this map surjective, and what is the reason?
Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.
Correct: Not surjective, because 2 has no integer preimage
Why: Surjectivity onto the integers requires every integer to be an output. The integer two is not a perfect square, so no input maps to it and the map misses part of the codomain.
Check
Consider the squaring map declared into the integers.
\[ f : \mathbb{Z} \to \mathbb{Z}, \qquad f(n) = n^2 \]
Check your understanding
Is this map surjective, and what is the reason?
Answer: B
Why: Surjectivity onto the integers requires every integer to be an output. The integer two is not a perfect square, so no input maps to it and the map misses part of the codomain.
Check
This linear map is a bijection of the reals.
\[ f : \mathbb{R} \to \mathbb{R}, \qquad f(x) = 3x - 6 \]
Check your understanding
What is the inverse function?
Answer: A
Why: Set y equal to 3x minus 6 and solve for x: add six then divide by three, giving x equal to y plus six over three. Checking, f of that expression returns y.
Prediction
Predict first
Which statement about the image of the intersection is correct?
Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.
Correct: The image of the intersection is empty, but the intersection of the images is the set containing 1
Why: The two singletons are disjoint, so their intersection is empty and its image is empty. But both singletons map to one, so the intersection of the images is the set containing one.
Check
Use the squaring map and two singletons.
\[ f(x) = x^2, \quad S_1 = \{-1\}, \; S_2 = \{1\} \]
Check your understanding
Which statement about the image of the intersection is correct?
Answer: B
Why: The two singletons are disjoint, so their intersection is empty and its image is empty. But both singletons map to one, so the intersection of the images is the set containing one.
Elimination
Eliminate the wrong options
What does the pigeonhole principle guarantee?
3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.
Survives elimination: B
Why: With ten letters mapped into nine mailboxes, the assignment cannot be injective, so at least two letters share a mailbox, meaning some mailbox holds two or more.
Check
Ten letters are placed into nine mailboxes.
Check your understanding
What does the pigeonhole principle guarantee?
Answer: B
Why: With ten letters mapped into nine mailboxes, the assignment cannot be injective, so at least two letters share a mailbox, meaning some mailbox holds two or more.
Connect it up
Draw it
One page, no notation unless you need it: draw how these connect — The recipe: proving injective, surjective, bijective · A function is a special relation · A function is a reliable machine · When are two functions equal? · Domain, codomain, image are three different things. Put an arrow wherever one of them is what makes another possible, and label the arrow with why.
Recap
A function is a total, single-valued relation with three ingredients: domain, codomain, and image. The codomain is declared; the image is forced by the rule.
Injective means no collisions (prove by assuming equal outputs, deriving equal inputs). Surjective means the image fills the declared codomain (prove by constructing a preimage for every target). Bijective means both.
Left inverse matches injectivity, right inverse matches surjectivity, and a two-sided inverse exists exactly for bijections. Bijections are the isomorphisms of the category of sets.
| Operation | Union | Intersection |
|---|---|---|
| Preimage | preserved | preserved |
| Image | preserved | subset only |
And the pigeonhole principle: more inputs than outputs forces a collision. Next stop is modular arithmetic, where congruence classes turn these ideas into computation.
Want this taught 1-on-1? Alexander tutors Foundations of Higher Mathematics — $55/session, free consultation.