2.2 Injections and Surjections
Section 2.1 defined functions and composed them. This
section asks the two basic questions about a function,
and gives each its method of proof and its way of
failing. We then ask what composition does to the two
properties, and find the half of each converse that
survives. After the maps that every subset, product and
power set carries, and a set of examples from arithmetic
and calculus, we read injectivity and surjectivity in a
second way: as permission to cancel
2.2.1. Injective, surjective, bijective
Two questions can be asked of any function
Injective functions
An injective function never sends two different inputs to the same output.
A function
In words: if two inputs give the same output, they
were the same input. By Logic and Proof, Proposition 2.3.2,
the definition gives the contrapositive
form
The negation is found by the laws of Logic and
Proof, Chapter 6 for negating bounded quantifiers
and implications: “
Surjective functions
A surjective function reaches every point of its codomain.
A function
In words: every point of the codomain is an output;
equivalently, the range of
Surjectivity depends on the codomain, which is why Definition 2.1.1 records
it:
Warning. Surjectivity cannot be
checked by trying some
Bijective functions
A function is bijective (a bijection) if it is both injective and surjective.
A bijection is a function in which every point of the
codomain is reached exactly once: for
every
Second readingWhy a bijection reaches each point once
In the terms of Example (Method: existence and uniqueness),
the two halves are these. Existence of such an
Worked examples
Template. “Let
When to use it. Any claim that
The usual failure. Starting from
Template. On scrap paper, solve
When to use it. Any claim that
The usual failure. Writing the
scratch work as the proof, so that the proof assumes
The two methods meet in one function whose surjectivity has to be found, not guessed.
Let
Idea (Scratch work). A function
into
Injectivity. If
Surjectivity, backwards. The absolute value
suggests cases on the sign of
| Givens | Goal |
|---|---|
| some |
|
Solution. Function. For
every real
Injective. Let
Surjective. Let
The order is the one the box prescribes. The solving
went backwards and needed two cases; the proof goes
forwards, states one formula for
Quick check. Show that
Solution. Injective:
For each function below, decide with proof whether it is injective and whether it is surjective.
(a)
, .(b)
, .(c)
, with , , .(d)
, with , .
Solution.
- (a)
Injective. Let
with . Adding and dividing by gives .Surjective. On scrap paper,
gives . Now the proof: let , and put . Then , and . So is bijective. - (b)
Injective. Let
with . Dividing by gives .Not surjective. The witness is
. If , then ; if , then . So for every integer , and has no preimage. (Solving gives , which is not in the domain : the same formula on would be surjective.) (c) Not injective:
and . Surjective: the codomain has two points, and , . For a finite codomain, checking every point is a proof: the instances are all the cases.(d) Injective: the two inputs have the different outputs
, and there are no other pairs of different inputs to check. Not surjective: is not an output, since the only outputs are and .
Parts (c) and (d) show two more things. A function from a three-element set to a two-element set cannot be injective, and one from a two-element set to a three-element set cannot be surjective: there are too many inputs in the first case and too few in the second.
Second readingDrawing finite pictures
And the finite pictures are worth drawing: two columns of dots, with an arrow from each input to its output. Injective means no dot on the right receives two arrows; surjective means every dot on the right receives at least one.
The key example of the section is one formula read as three different functions.
For each of the three functions, settle both questions: injective or not, surjective or not.
(a)
, .(b)
, .(c)
, .
Solution.
(a) Not injective:
and . Not surjective: the witness is , since for every real . So is neither.(b) Injective. Let
with . Then , so by Logic and Proof, Theorem 2.4.5, which applies since both numbers are nonnegative; and likewise . Hence . Not surjective: the witness still works, for the same reason.(c) Injective, by the same proof as in (b): injectivity concerns only the domain and the values, and these are the same as for
. Surjective. Let . A nonnegative real number has a nonnegative square root, so put . Then and . So is bijective.
The same rule gives three different functions.
Shrinking the domain from
Warning. Injectivity is not the
defining property of a function read backwards. Every
function satisfies “if
Quick check. Is
Solution. On
2.2.2. Composites of injections and surjections
Both properties survive composition. This is the first theorem about functions whose proof uses the definitions and nothing else, and it shows the two proof shapes of the last subsection working together.
Let
(a) If
and are injective, then is injective.(b) If
and are surjective, then is surjective.(c) If
and are bijective, then is bijective.
Idea. For (a), start from equal
outputs of
Proof.
(a) Let
with , that is, by Definition 2.1.2. The points and lie in , and is injective, so [ , : injectivity of at ]. Since is injective, [ , : injectivity of at ]. So is injective.(b) Let
. Since is surjective, there is with [ : the name is fresh]. Since is surjective, there is with [ : is fresh]. Then so has the preimage under [ , witness ]. Since was arbitrary, is surjective.(c) If
and are bijective, they are injective and surjective, so is injective by (a) and surjective by (b), that is, bijective.
Second readingPart (a) as a derivation
Part (a) is short enough to see whole at level 0 of
Logic and Proof, Section 8.3, a full
derivation. Here is its derivation, with the quantifiers
bounded and handled by the bounded rules (Logic and Proof, Proposition 6.1.1),
and
Compare it with the prose of (a). “Let
Second readingEach hypothesis is needed
Each hypothesis is needed. In (a),
dropping the injectivity of
The converses fail. If
Let
(a) If
is injective, then is injective.(b) If
is surjective, then is surjective.
Idea. For (a), equal values of
Proof.
(a) Suppose
is injective. Let with ; we must show . Applying to both sides gives , because a function gives equal outputs at equal inputs. By Definition 2.1.2, this says . Since is injective, . So is injective.(b) Let
. Since is surjective, there is with . Let , an element of . Then , by Definition 2.1.2. So has a preimage under , namely . Since was arbitrary, is surjective.
In particular, if
2.2.3. Structure maps
Every subset, product and power set comes with maps of its own. They are the first test cases for the two questions, and the answers depend on the sets involved, sometimes only on whether a set is empty.
Let
(a) The inclusion map
, .(b) The projection
, .(c) The diagonal map
, .(d) The complement map
, .
Solution.
(a) Injective: the value at a point of
is the point itself, so equal values come from equal points. Surjective exactly when . The values are the points of , so every is a value if and only if , that is, since , if and only if .(b) Surjective exactly when
has an element or . If , then each is the value . If , there is no point of to reach, and is surjective vacuously. If and has an element , then (Proposition 1.4.1), so has no values at all, and it misses . Injectivity of is the Quick check below. The second projection , , behaves in the same way, with the roles of and exchanged.(c) Injective: if
, then by Definition 1.4.1. Not surjective as soon as has two points : the pair is not a value, since would give . If has at most one element, is surjective, and so bijective: is or , and each of its pairs is a value.(d) Bijective. We write
, for subsets of , to keep them apart from the fixed . First, for every . Let be arbitrary. By a chain of equivalences (Example (Method: a chain of equivalences)), The step tagged De Morgan uses De Morgan (d), (c) (Logic and Proof, Proposition 2.5.5) applied to the second conjunct, together with (Logic and Proof, Proposition 2.5.1); from left to right both steps use . In the step that drops the disjunct, from left to right, the disjunct clashes with the conjunct , so disjunctive syllogism (Logic and Proof, Proposition 2.3.4) leaves ; from right to left, puts the disjunct back. In the last step, from right to left, gives because . By Definition 1.2.1, .
Now
So
Quick check. When is the projection
Solution. Exactly when
2.2.4. Examples from algebra and calculus
The methods of the first subsection now meet maps from school mathematics. Three times below, a single feature decides an answer: a coefficient, a theorem of Chapter 1, and an order property.
Decide whether each map is injective and whether it is surjective.
(a) For integers
and , the map , .(b) The map
, .(c) The map
, .
Solution.
(a) The maps
and of the first subsection generalize. Injective: gives , so , since and a product of integers is only if a factor is. Surjective exactly when or . If , then ; for put , and then . If , then , and is not a value: means , which is false for , and false for because then .(b) Surjective: each
is the value at . Not injective: (Definition 1.4.1), and both are sent to . Any formula symmetric in and fails injectivity in the same way; the sum is Exercise B1 (b).(c) Surjective: by Theorem 1.1.2, every
is or for some , that is, or . Injective: let . If , then , so , and the pairs are equal (Definition 1.4.1). If , then, since , the cases and remain (Example (Method: proof by cases)). The equation is symmetric in the two pairs, so the second case is the first with the pairs exchanged, and we may assume and ; now is an integer that is both even and odd, which Theorem 1.1.2 excludes. So is a bijection.
So “every integer is even or odd, and not both” is
exactly the statement that
For real functions, injectivity often comes from order. A function that keeps every strict inequality, or reverses every one, cannot take a value twice.
Let
Proof. We use the contrapositive
form of Definition 2.2.1. Let
Decide whether each map is injective and whether it is surjective.
(a)
, .(b) The floor map
, , where is the unique integer with .(c) Differentiation of polynomials of degree at most
, recorded on coefficients: since has derivative , this is the map , .
Solution.
(a) Injective. The map is strictly increasing. Let
. Then The second expression is positive unless : if , then ; if , it equals , which is positive unless . And is excluded by . So both factors are positive, , and Proposition 2.2.3 applies. Surjective: every real has a real cube root , with . So the map is bijective.(b) Surjective: for
, , since . Not injective: , since .(c) Surjective: for
, . Not injective: ; a constant has derivative . In general the first coordinate of a preimage is free: it is the constant of integration.
In (a), injectivity came from an order property, not
from the equation
Quick check. Is
Solution. On
2.2.5. Cancellation
For numbers,
Let
(a)
is injective if and only if, for every set and all functions , implies .(b)
is surjective if and only if, for every set and all functions , implies .
Injections cancel on the left, and surjections on the right.
Idea (Scratch work). The two
directions
| Givens | Goal |
|---|---|
| cancellation on the left; |
|
| the hypothesis needs functions into |
|
For (b), argue by contrapositive. If a point
Proof.
- (a)
Suppose is injective. Let be a set and functions with , and let . Then by Definition 2.1.2, so by the injectivity of . Since and have the same domain and codomain and agree at every point, (Proposition 2.1.1). Suppose the cancellation property of (a) holds, and let with . Define by and ; each is a function, with one input and one value. The composites agree at , the only point of their domain: . So (Proposition 2.1.1), and the hypothesis with gives . Therefore , and is injective. - (b)
Suppose is surjective. Let be a set and functions with , and let . By surjectivity there is with [ : the name is fresh], and then So (Proposition 2.1.1).
The proofs needed only
Template. To prove
When to use it. When
The usual failure. Canceling a
non-injective
Let
(a) Suppose
for all and . Show that by cancellation.(b) Suppose only that
for all . Must ?
Solution.
(a) Let
, , be the map of Example (Maps from arithmetic) (c). The hypothesis says that at every point of , so (Proposition 2.1.1). The map is surjective (Example (Maps from arithmetic) (c)), so it cancels on the right (Theorem 2.2.4 (b)): .(b) No. The hypothesis now says
for , , and is not surjective: would make even, while is odd, and Theorem 1.1.2 says no integer is both. Here is a pair that the hypothesis cannot tell apart. Let be the set of odd integers, , and , with the indicator function of Example (First functions) (d). Then for every , since is even and so not odd; but .
The odd numbers, the points that
Quick check. Functions
Solution. The function
Second readingPart (a) by cancellation
Part (a) of Proposition 2.2.2 has a
second proof by cancellation. Suppose
Remark (Looking ahead). Chapter 3
proves the division algorithm, which makes
2.2.6. Exercises
A. Check your understanding
- (a) Define “
is injective” in symbols, and write its negation in symbols. - (b) Is the empty
function
injective? Is it surjective? Justify your answers. - (c) Which of these
relations on
are graphs of functions ? For each that is not, name the clause of the definition that fails. , , . - (d) How many
functions
are there, and how many of them are injective? Answer by listing.
Solution.
(a)
is injective: (Definition 2.2.1). Its negation: . The bounds stay as they are, and the negated implication becomes “hypothesis and not conclusion”, by the negation laws of Logic and Proof, Chapter 6.(b) Injective: yes. The condition “for all
, …” holds vacuously, since there are no (Logic and Proof, Proposition 2.1.2). Surjective: no. The witness is : there is no at all, so none with value .(c)
is a function ( , , ). is not: clause (Fn1) fails at , which has no output. is not: clause (Fn2) fails at , which has the two outputs and .(d) A function
is determined by the pair of values (Proposition 2.1.1), and each value can be any of the three letters. Listing the pairs: There are functions. A function on is injective exactly when , since and are the only two different inputs. Removing the three pairs with equal entries, on the diagonal of the list, leaves injective functions.
B. Practice
Determine which of the following are injective, which are surjective, and which are not functions at all. Justify your answers.
- (a)
, . - (b)
, . - (c)
, . - (d)
, . - (e)
, .
Solution.
(a) Injective:
gives . Not surjective: the witness is , which is odd, while every is even, and no integer is both even and odd (Theorem 1.1.2).(b) Not injective:
(Definition 1.4.1), and both are sent to . Surjective: for , the pair lies in and is sent to .(c) Injective:
is strictly increasing on (Example (Maps from calculus) (a)), so also on , and Proposition 2.2.3 applies. Not surjective: the witness is . If , then ; if , then . So for every integer .(d) A function: for every
, , so is defined and exceeds ; hence , and the value lies in . Injective. Suppose . The denominator is positive, so has the sign of , and squaring gives , that is, . Since (shown above), , so . Of the square roots of this number, is the one with the sign of : So is determined by : two inputs with the same output are both equal to , hence equal. Surjective. Let and put , a real number since . Then , so , and So the function is bijective. (For example, , and comes back to .) The same plan as in Example (Solving backwards, proving forwards) works, with in place of and squaring in place of the split by sign.(e) Not a function
: at the formula gives , and , so (Fn1) fails at . This is the planted failure: the question whether it is injective or surjective does not arise. (On the same formula is a function, and a bijection: it swaps , , and so on.)
Let
(i) Since
is injective, .(ii) Let
.(iii) Then
.(iv) Since
was arbitrary, is surjective.(v) Since
is surjective, there is with .(vi) Let
.(vii) Since
is injective, .(viii) So
has the preimage under .
Solution. The order is (vi), (iii), (v), (i), (viii), (iv):
Let
. Then . Since is surjective, there is with . Since is injective, . So has the preimage under . Since was arbitrary, is surjective.
No other order is admissible. Each line uses the one
before it: (iii) needs the
The distractor (ii) opens with an arbitrary element
of the wrong set. The goal “
The hypothesis “
Give an example of a function
Solution. Surjective, not
injective. Let
Injective, not surjective. Let
Many other answers are correct. An answer to the
first part must have: every value in
Prove each true statement by the methods of Example (Method: proving injectivity) and Example (Method: proving surjectivity), and refute each false one with a concrete counterexample.
- (a) The function
, , is injective. - (b) The function
, , is injective. - (c) The function
, , is surjective. - (d) The function
, , is surjective. - (e) The formula
defines a bijection from to .
Solution.
(a) False. The inputs
and are different, and both are sent to : .(b) True. Let
. Then and . A product of two reals is only if a factor is , so , that is, .(c) True. Let
. The pair lies in , and . (The scrap-paper search: , so multiply that solution of by .)(d) False. The witness is
. For all integers and , is even, and is odd; no integer is both (Theorem 1.1.2). So .(e) True. First, the formula is a function into
: . Injective: let with . Then , and both bases are , so by Logic and Proof, Theorem 2.4.5 (used twice, as in Example (Squaring, three ways) (b)), and . Surjective: let and put , defined since . Then , and .
Let
- (a) If
is injective and is surjective, then is surjective. - (b) If
is surjective and is injective, then is injective. - (c) If
satisfy for every real , then . - (d) If
satisfy for every real , then . - (e) If
satisfy for every real , then .
Solution.
(a) False. Let
, , , , and the constant function . Then is injective, since its domain has one element; is surjective, since ; and is not a value of .(b) False. On
, let , and let for even and for odd . By Theorem 1.1.2 each falls under exactly one case, and in each case ; so is a function. Then , so (Proposition 2.1.1), which is surjective. And is injective, since gives . But , so is not injective.(c) True. Let
, . The hypothesis says , and is injective (Example (Maps from calculus) (a)). Canceling on the left (Theorem 2.2.4 (a)) gives .(d) False. Let
and . Then for every , since ; but . Squaring is not surjective, so it cannot be canceled on the right, and and differ exactly on the negative numbers, which squaring misses.(e) True. With
as in (c), the hypothesis says , and is surjective, since every real number has a real cube root (Example (Maps from calculus) (a)). Canceling on the right (Theorem 2.2.4 (b)) gives .
C. Going deeper
Let
- (a) Prove that if
is injective and is surjective, then is injective. - (b) Give an example
in which
is injective and is not injective, and say which hypothesis of (a) fails.
Solution.
(a) Suppose
is injective and is surjective. Let with ; we must show . Since is surjective, there are with and [ , twice: the names and are fresh and different]. Then, by Definition 2.1.2, so , since is injective. Hence , and is injective.(b) Take the example before Proposition 2.2.2:
, , and , . Then is injective, because its domain has only one element: if , then . And is not injective: with . The hypothesis of (a) that fails is the surjectivity of : is not a value of .
Marking scheme. (10 points) - 2:
fixes arbitrary
Fatal errors (0 for the step): assuming
- (a) Give functions
with bijective and neither nor bijective. - (b) Let
and be functions. Prove that if is bijective and is surjective, then and are both bijective.
Solution.
(a) Let
, and let and for ; both are functions , since for . Then , since ; so (Proposition 2.1.1), which is bijective. But misses , since , so is not surjective; and , so is not injective.(b) Suppose
is bijective and is surjective. Since is injective, is injective by Proposition 2.2.2 (a); with the hypothesis, is bijective. Since is surjective, is surjective by Proposition 2.2.2 (b). Since is injective and is surjective, is injective: for with , choose with and ; then , so , and . So is bijective too.