Section 1.3 made “the pairs a description picks out”
into a set: a relation from to is a subset of . Among its
examples, the graph of squaring relates each real number
to exactly one number, and the unit circle relates to two numbers and
to none. This
section gives the first kind its name,
function, and builds the rest on it: we
restrict functions, use them to make families, sequences
and the set
precise, compose them, and ask the two questions that
the rest of the chapter turns on: does a function send
different inputs to different outputs, and does it reach
every point of its target?
What is a
function?
Everyone has used functions since school, and the
everyday definition is “a rule that assigns to each
input one output”. Look at the word “rule”. The rules
and
are different: one squares, the other adds,
squares, subtracts, and subtracts again. Yet on every
real number they give the same answer, and nobody would
call them different functions. Other functions have no
rule at all that one could write down. A table of
measured temperatures, one per day, assigns to each day
one number, and no formula produces it.
So the rule is not what matters. What matters is
which output goes with which input: the
set of input–output pairs. That set is a relation, and
Section 1.3 said exactly when two relations are the
same, namely when they contain the same pairs. So we
forget the rule and keep the pairs. One more piece of
data is needed, the set in which the outputs are
declared to lie; the reason is given
after the definition.
A function is its graph, with a declared
target.
Definition
1.4.1 (Function)
Let and be sets. A
function from to , written , is
given by a relation , the
graph of , such that together with the set , the
codomain of . Formally, is the pair . The set is the
domain of . For , the unique with is written
, the
value of at . We write for , and for the
whole function when its domain and codomain are
clear.
In symbols, the condition on the graph is where, as with the bounded quantifiers of Logic and Proof, Definition 5.1.1,
abbreviates .
The whole definition is the quantifier pattern . By Logic and Proof, Definition 5.8.1,
“” is
an existence claim and a uniqueness claim, and by Logic and Proof, Proposition 5.8.1
the uniqueness claim may be stated without reference to
the witness; so the condition on the graph is two
clauses:
- (Fn1) (existence) for every there is
at least one with : every input
has an output;
- (Fn2) (uniqueness) for every and all , if and , then
: no
input has two outputs.
In words: the graph is a set of input–output pairs,
with inputs from
and outputs from ;
(Fn1) says no input is left without an output, and (Fn2)
says no input is given two. The codomain is where outputs are
allowed to lie. It need not consist of outputs: can be
declared as a function from to , although no output
is negative. The set of outputs that actually occur is
the range of , which Section 1.6 will call the image of and write . The domain needs no
slot of its own in the pair : by (Fn1) every
occurs as a
first coordinate in , and since ,
nothing else does. So the graph determines the
domain.
The notation is well
defined. Writing “the with ” is
legitimate only if there is one, and only one. Clause
(Fn1) supplies one, and clause (Fn2) says that any two
are equal; together they license the article “the”. This
gives the equivalence that every argument with functions
uses: For : by the
choice of , and
if then
by
substituting equals (, Logic and Proof, Definition 5.7.1).
For :
both and
lie in
, so by (Fn2). Two
consequences follow at once. Equal inputs give equal
outputs: if , then . And every value lies in the codomain:
for
every .
Functions given by formulas. Most
functions in this book are introduced by a formula: “let
, ”. This means the function whose graph is
. Clause (Fn2) holds for any such graph:
if and
, then
. So for
a formula only (Fn1) needs checking, and it says: for
each in the
domain, the formula makes sense and its
value lies in the codomain. For on both are clear. For
“, ” the formula makes no sense at , and (Fn1) fails
there; for “, ” the value must be checked to lie in , which it
does, since squares are nonnegative.
A function whose domain is a product is a
function of two variables. Its inputs
are pairs, and we write rather than . Addition from
to
is an
example.
Example
(First functions)
Check (Fn1) and (Fn2), and find the range, for each
of the following.
(a) with graph .
(b) The
identity function ,
, for a
set .
(c) A
constant function , , for a fixed
.
(d) The
indicator function of a subset :
Solution.
(a) The graph is
a subset of . Each of , , occurs as a first
coordinate (Fn1), and each occurs exactly once, so no
input has two outputs (Fn2). So is a function, with
, , . Its range is
, the whole
codomain. A function on a small finite set is often
given this way, by listing its values; no formula is
needed.
(b) The graph is
the diagonal .
For each , the
pair is in
it (Fn1); and if is in it, then for some
, and the
characteristic property (Definition 1.3.1)
gives
(Fn2). The range is .
(c) The graph is
. For
each , is in it (Fn1); if
is in it,
then by
the membership test for pairs in a
product (Definition 1.3.2),
so (Fn2). If
has an element,
the range is .
If ,
the range is .
(d) The graph is
.
For (Fn1), let . By excluded middle (Logic and Proof, Proposition 2.5.3),
or ; in the first
case is in
the graph, in the second and is. For (Fn2), the
two cases cannot both hold, so never receives both
and , and each case gives
only one pair with first coordinate . The range is if has an element and
has
an element; it is if and has an element, if and has an element, and
if . This is
the first function of the chapter whose existence clause
needs excluded middle: the definition by cases is a
function only because every falls into one of the
cases.
The next example collects relations that fail to be
functions. Each failure is one clause, and it pays to
say which.
Example
(Relations that are not functions)
(a) Is the unit
circle the graph of a
function ?
(b) “Send a
fraction to its
numerator .” Is
this a function from to ? As a relation it is
Solution.
(a) No, and both
clauses fail, at different points. Clause (Fn2) fails at
: both and lie in , and . Clause (Fn1)
fails at : a
pair
would need , and no real square is negative. Restricting
the inputs to repairs (Fn1) but not (Fn2); keeping only
the upper half, , repairs (Fn2) as well, and gives the
function , .
(b) No. Clause
(Fn1) holds: every rational number is for some and . But
(Fn2) fails, because a rational number has many ways of
being written as a fraction. Since , both and lie in
, and . The “rule” gives
an output that depends on how the input is
written, not on the input. A function may not
do that, since its value is attached to the input
itself. This is why definitions of the form “write as …, then send it to
…” must be checked for
well-definedness, a check that returns
in Chapter 2 for functions defined on classes. Here the
repair is to fix the way of writing: let be the least with
(such
exist, by the
first sentence, so there is a least one by
well-ordering, proved in Chapter 2; a least element is
unique), and send
to . This is a
function.
Why this definition. Each clause has
a job, and dropping one lets in the failures of Example (Relations that are not functions).
Without (Fn1), a “function” could be undefined at some
inputs, like at
; then would not name
anything, and statements “for every ” about would lose their
meaning. Without (Fn2), would not name
one thing, and in part (b)
would be both and
. The graph
replaces the rule because two rules can describe one
function, and sets are compared by their elements.
Why is the codomain part of the data? A relation is a
set, so if a function were only its graph, two functions
with the same graph would be equal (Definition 1.1.1),
whatever target was declared. The graph of as a
function is the same set as its graph as a function
. But these should be different
functions, because the second reaches every point of its
target and the first does not: this is the property
called surjectivity below, and an example later in this
section shows it changing with the codomain. Recording
the codomain in the pair keeps the two apart. Many books take the
same convention, some without saying so.
Warning. A formula is not yet a
function. “The function ” names no function
until a domain and a codomain are given, and the domain
must be chosen so that (Fn1) holds: is a
function , and there is no function given by this
formula. Likewise makes sense on
and not
on . When you
meet “let ”, ask first where lives and where is meant to lie.
Quick check. Which of these
relations on are graphs of functions : , , ? For each that is not, name the clause that
fails.
Solution. The first is a function:
the constant function with value . The second fails (Fn1)
at , which has no
output. The third fails (Fn2) at , which has the two
outputs and .
When are
two functions equal?
A function is a pair , so two functions are equal when their
graphs are equal and their codomains are equal. In
practice we compare functions by their values, and the
next result says that this is the same test.
Proposition
1.4.1 (Equality of Functions)
Let and be functions. Then if and only if
, , and for every
.
Idea. Write and . The
characteristic property of pairs splits into “same graph”
and “same codomain”. Two graphs are equal when they have
the same elements, and by an element of
a graph is a pair ; so “same graph” is “same inputs, same
outputs”.
Proof. Write and , as
in Definition 1.4.1.
Suppose . By
the characteristic property of pairs (Definition 1.3.1),
and
. The
domain is determined by the graph, as the set of first
coordinates of its elements, so . Let . By , ,
so ,
and for
gives .
Suppose ,
, and
for
every . We
show . Let . Since , with and . By , , so by the
hypothesis, and then by for . The same argument with
and exchanged gives , so
by Proposition 1.1.1.
Since also , the characteristic property gives , that is, .
So to show two functions equal, check three things:
the same domain, the same codomain, and the same value
at an arbitrary point. To show them different, one
witness suffices: a point where the values differ, or a
difference in domain or codomain.
Example
(Equal and unequal functions)
Decide which of these functions are equal.
(a) ,
and .
(b) ,
and
.
(c) and , both given by
.
Solution.
(a) Equal. The
domains are both and the codomains
both . For every
real , . By Proposition 1.4.1,
: two rules,
one function.
(b) Equal. Same
domain and codomain, and for every real , : the
number is
nonnegative and its square is , and is by
definition the nonnegative number with square , which is unique by
Logic and Proof, Theorem 2.4.5.
(c) Not equal.
They have the same domain, the same values, and even the
same graph; but their codomains and are different
sets ( is in one
and not the other), so by Proposition 1.4.1
.
Restriction. A function can be cut
down to a smaller domain. For and
, the
restriction of to is the function whose graph is : the pairs of whose input lies in
. The squaring
function restricted to is of part (c). The bar
in is one of
the uses of a vertical bar that the book’s
colon-for-set-builder convention keeps free.
Families,
sequences, and the set of all functions
Section 1.2 used families of sets and
described them informally, as “a set for each index ”. We can now say
exactly what a family is, once its members are known to
lie in some set. A family of subsets of indexed by is a function
,
, with
the power set as the
codomain the definition asks for. More generally, if
is a set whose
elements are sets, a family of members of indexed by is a function . A codomain must
be named, because there is no set of all sets (Theorem 1.1.4).
The value of a family at is written rather than , and the family is
written , in parentheses because it is indexed. A
family is not the same thing as its set of values : the
family with has two indices and one value.
In the same way, a sequence of real
numbers is a function ,
, with
the value at
written . The
sequence is
the function , and its set of values is .
Sequences are the main object of Analysis on the
Real Line.
Finally, all functions from to form a set, written
It is a set by the working rules of Section
1.1: every function is a pair with , so is the subset of
cut out by the condition of Definition 1.4.1,
and this product is a set by (W2), (W4), and (W5), so
is a set by
specification (W1). The letters are in this order
because, for finite sets, has elements when has and has , as the next example
suggests; counting is Chapter 3’s business. The set
of
all sequences of zeros and ones, indexed from , plays a leading role
in Chapter 3.
Example
(All functions between two small sets)
List the elements of , and say which are indicator
functions of subsets of .
Solution. A function is determined by its two values and (Proposition 1.4.1),
and each may be
or . So there are
four:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Every one of them is an indicator function: for . The four subsets of and the four
functions correspond one to one.
The correspondence at the end of the example, between
subsets of and
functions , holds for every set : send to
and to . So counting the
subsets of a finite set and counting the functions from
it to are
one problem, which Chapter 3 solves.
The empty set gives the degenerate cases, and they
are worth settling now, since they are the test cases of
many later statements.
Proposition
1.4.2 (Functions and the Empty Set)
(a) For every set
there is exactly
one function from to : the pair , called
the empty function.
(b) If is nonempty (it has an
element), there is no function from to .
Proof.
- (a)
Existence. The empty relation satisfies , since is a subset of
every set (Section 1.1). The condition of Definition 1.4.1
reads “for every ,
if ,
then there is exactly one with ”. For each the hypothesis is false,
so the implication holds (Logic and Proof, Proposition 2.1.2).
So
is a function from to .
Uniqueness. Let be any function
from to
. Its graph
satisfies , by the
mirror-image law of Proposition 1.3.1.
So an element of
would be an element of ; has no elements, and
by Proposition 1.1.3.
Hence .
- (b) Let , and suppose
were a function. By (Fn1) there would
be
with ; but has no
elements. So there is no such function .
In the notation : the set has exactly
one element for every , including ; and
whenever is
nonempty. The empty function returns
in Section 1.5 as the witness that a hypothesis there
cannot be dropped.
Composition
Two functions can be applied one after the other when
the outputs of the first are inputs of the second.
Temperature in degrees Celsius, as a function of the
day, followed by the conversion to degrees Fahrenheit,
gives temperature in Fahrenheit as a function of the
day.
Definition
1.4.2 (Composition)
Let and be functions, the codomain of being the domain of
. Their
composite is the function read “
after ”.
This is a function by the remark on formulas: for
, the value
lies in , the domain of , so makes sense, and
it lies in . Its
graph is . The order of the
letters is the order of the formula , which is the
reverse of the order in which the
functions act:
acts first.
Example
(The order of composition matters)
Let , and . Compute and , and decide whether they are equal.
Solution. By Definition 1.4.2,
and . At the values are
and , so by Proposition 1.4.1
. In words: “add one, then double” is not
“double, then add one”. (In fact the two composites
differ at every ,
since ; one point already suffices.)
Composition can also fail to be defined in one order
only. For and , the composite is defined, and is not: ’s outputs are real
numbers, and
accepts only and
.
Composition is not commutative, but it is
associative, and the identity functions do nothing.
Proposition
1.4.3 (Composition Is Associative)
Let , , and be functions. Then and .
Proof. Both sides of the first
equation are functions from to , by Definition 1.4.2.
For ,
applying Definition 1.4.2
twice on each side gives So the two functions agree at every point, and
they are equal by Proposition 1.4.1.
Likewise and are functions from to with values and
,
so both equal .
Because of associativity, we write without
brackets: every way of bracketing gives the same
function, .
Quick check. For ,
and
,
compute and .
Solution.
and . The values agree at this point, but the
functions are different: at , and
.
Agreement at one point proves nothing about equality;
disagreement at one point proves inequality.
Injective,
surjective, bijective
Two questions can be asked of any function , and
much of mathematics turns on them. First: can we recover
the input from the output, or can two different inputs
give the same output? Second: is every point of the
codomain an output? The first question is about how
treats ; the second is about
how it covers .
Injective functions
An injective function never sends two different
inputs to the same output.
Definition
1.4.3 (Injective)
A function is injective (an
injection, or
one-to-one) if, for
all , implies . In symbols:
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 different inputs give different outputs. The
two forms are equivalent; the way back, from the
contrapositive form to the definition, is Logic and Proof, Proposition 2.5.2,
which uses . A proof
of injectivity usually uses the form of the definition,
because an equation is something to compute with, while an
inequation is not.
The negation is found by the laws of Logic and
Proof, Chapter 6 for negating bounded quantifiers
and implications: “ is not
injective” is So a failure of injectivity is shown by
two witnesses: two different inputs
with the same output.
Surjective functions
A surjective function reaches every point of its
codomain.
Definition
1.4.4 (Surjective)
A function is surjective (a
surjection, or onto)
if, for every , there
exists with . In symbols:
In words: every point of the codomain is an output;
equivalently, the range of is all of . An with is called a
preimage of . The definition does
not ask for the preimage to be unique. Negating as
before, “ is
not surjective” is so a failure of surjectivity is shown by
one witness: a point of the codomain
that no input reaches.
Surjectivity depends on the codomain, which is why Definition 1.4.1
records it: and
of Example (Equal and unequal functions)
have the same graph, and we shall see that is surjective and
is not.
Warning. Surjectivity cannot be
checked by trying some . The function ,
,
reaches ,
, , and , and a reader
who tries these may believe it reaches everything. It
does not reach :
would
mean , but for every
real . Concluding
“for every ” from
a few instances is entry (N1) of the catalogue in
Logic and Proof, Chapter 8.
Bijective functions
Definition
1.4.5 (Bijective)
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 there
is exactly one with . This is the of Definition 1.4.1
again, now read from the codomain side, and its two
halves are the two properties. Existence of such an
, for every , is surjectivity.
Uniqueness is injectivity: if ,
injectivity gives ; and conversely, if every has at most one
preimage, then makes and two preimages of the
same point , so .
Worked examples
Proofs of these properties have a fixed shape, read
off the definitions.
- To prove
injective: “Let with .” Compute
until you reach .
- To prove
surjective: “Let .” Then produce an
, say what
it is, check that it lies in , and check that . The is usually found by
solving
for on scrap
paper; the proof then states the solution first and
checks it, as every existence proof does.
- To prove
not injective: name with .
Not surjective: name and show that
has no
solution .
Example
(Deciding injective and surjective)
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.
Chapter 3 proves facts of this kind in general, starting
from the pigeonhole principle. 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.
Example
(Squaring, three ways)
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 to removed the
two witnesses
against injectivity. Shrinking the codomain to removed the
witness against
surjectivity. The graphs of and are the same set;
only the declared codomain differs, and surjectivity
changes with it.
Warning. Injectivity is not the
defining property of a function read backwards. Every
function satisfies “if , then ”: equal inputs give equal outputs, which
is part of
being well defined. Injectivity is the
converse, “if , then
”. A
“proof” of injectivity that starts from and reaches
has
proved the wrong implication, entry (N5) of Logic
and Proof, Chapter 8’s catalogue, and it “proves”
injective,
which is false.
Quick check. Is
surjective as a function ? As a function ?
Solution. On : no. The witness is
, since for every
, so has no solution
in . On : yes. For , the integer
satisfies
.
Both functions are injective, since gives
.
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.
Theorem
1.4.4 (Composites of Injections and
Surjections)
Let and be functions.
(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 . They are equal outputs of , at the points and ; peel off by its injectivity,
then by its. For
(b), work backwards along the chain : to reach
, first find
a point of that
sends to , then a point of that sends there. Part (c)
is (a) and (b) together.
Proof.
(a) Let with , that is, by
Definition 1.4.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.
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
already unwound to by Definition 1.4.2.
Premises 1 and 2 are the injectivity of and of ; premise 3 says that
maps into , which the prose used
in the clause “the points and lie in ”.
1
2
3
4
5
6
7 3, 4
8 3, 5
9 2, 7
10 9, 8
11 10, 6
12 1, 4
13 12, 5
14 13, 11
15 6–14
16 5–15
17 4–16
Compare it with the prose of (a). “Let ” opens the
two flagged boxes of lines 4 and 5, and “with ” is
the assumption of line 6. The first tagged sentence is
lines 7–11, and the second is lines 12–14. The closing
“so is
injective” stands for lines 15–17, the closing lines of
and of the two ’s;
by the convention of Logic and Proof, Chapter 8
on silent steps, the prose may state their result
without naming them. The two tags in the prose mark the
only steps where a hypothesis is used, and that is what
the proof is about.
Each hypothesis is needed. In (a),
dropping the injectivity of breaks the conclusion:
with
and ,
squaring on ,
the composite is not injective, although is. Dropping the
injectivity of
instead, with and , gives the same composite. In (b),
with
and , the
composite is
not surjective, although is; with and , again
is
not surjective, although is.
The converses are more interesting, and they are the
exercises of this section. An injective composite forces to be injective and
says nothing of the kind about (exit check C1). A
surjective composite forces to be surjective, and
may miss points
(B2). Section 1.5 builds on these facts: a function
with a function
such that is
forced to be injective.
Exercises
A. Check your
understanding
Exercise
(A1)
- (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 1.4.3).
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 1.4.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
Exercise
(B1: Five functions)
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.
(b) Not
injective: (Definition 1.3.1),
and both are sent to . Surjective:
for , the
pair lies in
and
is sent to .
(c)
Injective. Let . Then If , the second factor is positive: if , then ; if
, it equals
,
because .
Then the product is nonzero, a contradiction. So .
Surjective: for , every real number has a real cube
root, and satisfies . So the function
is bijective.
(d) A
function: for every , , and
, so the value lies
in .
Injective. Suppose ; we
solve for . Taking
absolute values, , so , that is, ; since (shown
above), , and , and then . Hence 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 .)
(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.)
Exercise
(B2: Put the proof in order)
Let and be functions. The following lines contain
a proof that if is surjective, then is surjective,
shuffled, together with two lines that do not belong.
Write the six correct lines in an order that makes a
proof, and say why each of the other two lines
fails.
(i) Then , by Definition 1.4.2.
(ii) Let .
(iii) Since is surjective,
there is
with .
(iv) Since was arbitrary, is surjective.
(v) Let , an
element of .
(vi) Since is surjective, for some .
(vii) Let .
(viii) So has a preimage under
, namely .
Solution. The order is (vii),
(iii), (v), (i), (viii), (iv):
Let .
Since is
surjective, there is with . Let , an element of . Then , by Definition 1.4.2.
So has a preimage
under , namely
. Since was arbitrary, is surjective.
No other order is admissible. Each line uses the one
before it: (iii) needs the of (vii); (v) needs the
of (iii); (i)
needs the of (v);
(viii) is the that
(i) makes possible; and (iv) closes the
opened by (vii).
The distractor (ii) opens with an arbitrary element
of the wrong set. The goal “ is surjective” is , so the proof must take an arbitrary
; the is the witness to be
found, not something given. The distractor (vi) uses a
hypothesis the statement does not have: nothing says
is surjective,
and the claim holds without it. For example, with , , and constant, and are surjective and
is not.
Exercise
(B3: Examples on the natural numbers)
Give an example of a function that is
surjective and not injective, and one that is injective
and not surjective. Check each property.
Solution. Surjective, not
injective. Let and for
; for , , so is a
function. It is surjective: for , , so . It is not
injective: and .
Injective, not surjective. Let . It
is injective: gives . It is not surjective: is not an output, since
.
Many other answers are correct. An answer to the
first part must have: every value in (so it is a function
into ); at least
one value taken at two different inputs, with the two
inputs named; and every reached, with a preimage given as a
formula in , since
checking some is
not enough. An answer to the second part must have:
values in ; a
proof that equal outputs come from equal inputs; and one
named natural number that is never reached, with the
reason.
C. Going deeper
Exercise
(C1: Exit check: composites)
Let and be functions.
- (a) Prove that if
is
injective, then
is injective.
- (b) Give an example
in which
is injective and
is not injective, and check both claims.
Solution.
(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 1.4.2,
this says . Since is injective,
. So is injective.
(b) Let , , ; let , and let be the constant function . Then
is injective, because its domain has only
one element: if , then . And is not injective: with .
Marking scheme. (10 points) - 2:
fixes arbitrary with and states the goal . - 2: applies
to both sides,
with the reason that a function gives equal outputs at
equal inputs. - 3: rewrites the result as an equation of
values of
and invokes the injectivity of . - 3: an
example with explicit sets and functions, and both
claims checked: injective, and two different points with the
same value under .
Fatal errors (0 for the step): assuming is injective; starting
from and
deriving (the converse, entry (N5) of Logic
and Proof, Chapter 8’s catalogue); an example in
which is
not defined because the codomain of is not the domain of
. A proof by
contrapositive (from , injective gives ,
hence , since equal values of would give equal values
of ) earns full
marks: 2 points for fixing and the goal,
3 for the use of the injectivity of , and 2 for the
step from to .
Exercise
(C2: When the composite is a bijection)
Let and be functions.
Solution.
(a) Suppose is bijective.
Then is
injective, so is
injective by part (a) of Exercise (C1: Exit check: composites).
And is
surjective, so is
surjective by the proof put in order in Exercise (B2: Put the proof in order).
(b) Take the
functions of Exercise (C1: Exit check: composites)
(b): , , and , . Then
sends to , so
by Proposition 1.4.1,
which is bijective. But is not surjective,
since is not an
output; and is
not injective, since . So neither is bijective. Part (a) is
sharp: it gives exactly the half of each property that
survives, and this example shows that the other halves
can fail together.