Section 1.4 sorted functions by two questions. Does
ever send two
different inputs to the same output? Does reach every point of
its codomain? The answers were the words injective and
surjective (Definition 1.4.3,
Definition 1.4.4).
This section asks a question that sounds different: can
the work of be
undone? It turns out that it asks the
same two questions again, one for each side of . Undoing after it has acted
forces to be
injective, and when is non-empty
injectivity is also enough. Undoing it before, so that
finishes the job,
forces to be
surjective. The one new idea in the section is an
inverse on one side; an inverse on both sides, written
, is simply a
map that is both.
Throughout, is a function in the sense of Definition 1.4.1,
and composites are formed as in Definition 1.4.2:
is
defined when the codomain of is the domain of , and .
Undoing a
function
Start with a function we can compute in our heads.
Let be the doubling map, . Suppose
someone applies
to a secret number and tells us the result, say . We recover the secret
by halving: it was . Halving undoes
doubling.
But halving is not quite a function from to : has no half in . If we want a
function that undoes , we must give a value at every odd
number as well. Those values do not matter for the
undoing, because
never produces an odd number. Any choice will do. So one
answer is and another is
for even and
for odd . Both are functions
: every
is even
or odd and not both, and an even is for exactly one , which is . Both undo : for every , the number
is even, so
and the same computation holds for . In the language
of composition, and .
Now try to undo in the other order. Is there a
function with , so that undoes ? Such a would give , that is
, and
is odd, not twice
a natural number. So there is no such . The obstacle is
visible: is not
in the range of ,
so no input to ,
however chosen, comes out as .
Two things happened here, and they are the whole
section in miniature. Undoing
afterwards was possible, in more than
one way, and the reason is that loses no information:
different inputs give different outputs. Undoing it
beforehand was impossible, and the
reason is that
misses a point of its codomain. The two sides behave
differently, so they get two names.
Left and
right inverses
A left inverse undoes after it acts; a right
inverse is undone by .
Definition
1.5.1 (Left and Right Inverses)
Let be a function, and let be a
function in the opposite direction.
- (a) is a left
inverse of if , that
is,
for every .
- (b) is a right
inverse of if , that
is,
for every .
In words: a left inverse is written on the
left of in the composite, and
the composite does nothing to points of . A right inverse is
written on the right, and does nothing to points of . The two phrasings in
each clause say the same thing. Two functions are equal exactly
when they agree at every point (Proposition 1.4.1),
and and
have the same
domain and codomain ; so means
for every , which is .
The phrase “ is
a left inverse of ” and the phrase “ is a right inverse of
” say the same
thing: both say . Which word applies depends on which
function we are talking about.
Check the definition against the doubling map. With
on , the functions and above are left
inverses of : the
composite
sends every back
to . And has no
right inverse, because clause (b) fails at the single
point . For a
right inverse the “for every ” is the demanding
part: one bad is
enough to rule it out.
Example
(Left inverses on small sets)
Let , , and , , : the inclusion of into .
- (a) Show that with
, , is a left
inverse of , and
that is a right
inverse of .
- (b) Is a right inverse of
?
- (c) Let be
constant, . Does
have a left inverse?
Solution.
(a) Clause (a) of
Definition 1.5.1
asks for at each of the two points of : and
.
So , and is a left inverse of
. Read with the
roles exchanged, the same equation is
clause (b) for and :
is a right inverse of .
(b) No. Clause
(b) would need for every , and at we get . The equation fails
at one point, which is enough.
(c) No. A left
inverse would
need
and ,
that is
and . A
function has one value at , and . The information
“which input was it” is gone once both inputs land on
, and nothing
applied afterwards can bring it back.
Part (c) is the degenerate case of the example, and
it is the one to remember. A left inverse must recover
from , so it cannot exist
when two inputs share an output. Part (b) shows the
other side:
undoes , but does not undo , because never produces .
Warning. A left inverse need not be
a right inverse. For the doubling map on and its left inverse
above, for every
, but .
The equation says nothing about : composition is
not commutative (Section 1.4), and here the two
composites are different functions.
Quick check. Let be
the successor map, . Does have a left inverse?
Does it have a right inverse?
Solution. It has a left inverse,
for instance for and . This is a function , since when , and
because . It has no right inverse: a right inverse
of
would need , that is , which no satisfies. The number is not reached by .
A left
inverse exists exactly for injective functions
The examples point to a pattern. The doubling map,
the inclusion ,
and the successor map are injective, and each has a left
inverse. The constant map is not injective, and
it has none. Here is the pattern as a theorem. Its
hypothesis looks like a technicality; after the
proof we will see that it is not.
We need the range of from Section 1.4, and
from now on we write it as : Section 1.6 extends this notation to the image
of any subset of .
Theorem
1.5.1 (Left Inverses and Injectivity)
Let be a function.
- (a) If has a left inverse,
then is
injective.
- (b) If and is injective, then
has a left
inverse.
Consequently, if , then has a left inverse
if and only if is injective.
Part (a) carries no hypothesis on , on purpose: the last
theorem of this section uses it for every , the empty set
included. The hypothesis sits in (b) only, where it is
used. As in Proposition 1.4.2
(b), “” is read as “ is non-empty: it has an
element”, and the proof uses it in that form. (From an
element, follows at once, since the empty set
has none (Definition 1.1.4).
The passage back, from “ is not the empty set”
to “ has an
element”, is the classical law “not all fail, so one
holds” of Logic and Proof, Chapter 6; reading
the hypothesis as “has an element” avoids it.)
Idea. For (a), start from the goal.
Injectivity asks: from , get
. A left
inverse turns
each back into
, so apply to both sides.
For (b), build
point by point, the way halving was extended to the odd
numbers. ① A point of the range has a
preimage, and injectivity says it has only one; let
be that one. ②
A point outside the range has no preimage; send it to a
fixed point . This is where is needed. ③ Check that ① and ②
together define a function, and that .
Before reading on: where is used, and
what would go wrong at that line if were empty?
Proof.
(a) Let be a
left inverse of .
Let
with . Since is a function, equal
inputs give equal outputs, so . By
Definition 1.5.1
(a),
for every ,
so Since
and were
arbitrary, is
injective by Definition 1.4.3.
(b) Suppose and is injective. Since
has an element,
fix one and call it .
Let be the subset
of given
by specification (Definition 1.1.3):
We show that for every there is exactly
one with
, by
checking the two clauses (Fn1) (existence) and (Fn2)
(uniqueness) into which Section 1.4 splits the condition
of Definition 1.4.1
(Logic and Proof, Proposition 5.8.1).
Then , with
codomain , is a
function . Let .
Existence (Fn1). By excluded middle (Logic and Proof, Proposition 2.5.3),
or . Case
1: .
Then for
some ;
name it .
The pair
satisfies the first alternative, so . Case
2: . Then satisfies the second alternative, so . In either
case some
has .
Uniqueness (Fn2). Let with
and
.
Each pair satisfies one of the two alternatives. If both
satisfy the first, then , so because is injective. If both
satisfy the second, then . If one satisfies the first and
the other the second, then and , a contradiction, so this case
cannot occur. Hence .
So is a function, and means . It remains
to show . Let . Then , with as the witness ,
and , so
the pair
satisfies the first alternative: , that is,
. The
functions
and have
domain and codomain and agree at every
point, so they are equal by Proposition 1.4.1.
Hence is a left
inverse of .
The last sentence of the theorem combines (a) and
(b). This proves the theorem.
Look at where each hypothesis did its work.
Injectivity was used once, in the uniqueness step: it is
what makes “the preimage of ” a single point. The
hypothesis was used once, in the first line of
(b), to have a point for the second
alternative. The case split on used excluded
middle, a classical step: the proof does not tell us,
for a given ,
which case we are in.
Neither hypothesis of (b) can be dropped.
- Without injectivity. The constant
map of Example (Left inverses on small sets)
(c) sends and
to , and it has no left
inverse. In the proof, the uniqueness step breaks: and both lie in , so is not a function.
- Without . The empty function is
injective: the condition “for all …”
holds vacuously. A left inverse would be a function
, and there is none, since the point
would need a
value in the empty set (Proposition 1.4.2).
In the proof, the first line fails: there is no to fix, and the point
, which lies
outside the range, has nowhere to go.
The proof of (b) describes explicitly in terms of
and , so on a small
example the construction can be run by hand.
Example
(Running the construction)
Let be given by and , where , , are three different
objects. Run the proof of Theorem 1.5.1
(b) with ,
then with .
How many left inverses does have?
Solution. First the hypotheses:
, and is injective because
its two inputs have the different outputs and . The range is .
With :
the points and
of the range go
back to their unique preimages, and . The point lies outside the range,
so .
Check: and , so .
With :
,
as
before, and . The same check shows .
These are all the left inverses. Any left inverse
must satisfy
and , so its values on the range are
forced. Its value at is free, and there are
two points of to choose from. So has exactly 2 left
inverses, and the construction with and with produces
both.
The example shows that a left inverse is not
unique in general. The values on the range are
forced by the equation ; the values
off the range are free, and they may go to any point of
. (They are free
but not always varied: if has only one point,
there is only one place to send them.)
A right
inverse forces surjectivity
The doubling map has no right inverse because it
misses . The same
obstacle works for every function.
Proposition
1.5.2 (Right Inverses Give Surjectivity)
Let be a function. If has a right inverse,
then is
surjective.
Proof. Let be a
right inverse of ,
and let . By
Definition 1.5.1
(b), .
So
is an element of
with .
Since was
arbitrary, is
surjective by Definition 1.4.4.
The proof names its witness: the right inverse
is a rule that hands us, for each , a preimage . No hypothesis on
or is needed. If , then is surjective
vacuously; and as well, since there is no function
from a non-empty set to (Proposition 1.4.2).
Right inverses are not unique either. Here is a small
surjection with several.
Example
(All right inverses of a small surjection)
Let send each number to if it is even and to
if it is odd:
, , , . Find all right
inverses of .
Solution. A right inverse is a
function with and . The first
condition says that is a preimage of
, so . The
second says . The two choices are independent, and each
combination gives a function satisfying both conditions. So has exactly 4 right
inverses: Each one picks one preimage of each point of
the codomain. By Proposition 1.5.2,
the fact that one exists shows again that is surjective.
Does every
surjection have a right inverse?
Theorem 1.5.1
went both ways: for , a left inverse exists exactly when
is injective.
Does Proposition 1.5.2
go both ways too? Suppose is surjective. Must have a right
inverse?
Read what a right inverse must do. For
every ,
must be a preimage of : an with . Surjectivity
promises that each has at least one
preimage. It does not say which, and there may be many.
So the right inverse must choose one
preimage for every , all at once, and
assemble the choices into one set of pairs.
Now look at what our rules can do.
- One . For a single
, the statement
“there is
with ” lets
us name a preimage by E (Logic and
Proof, Section 5.6). That is one choice, made
inside one proof.
- Finitely many . For a
particular finite , with a fixed number, we can
apply E
times, once for
each point, and write down the pairs. (To get this for
every finite at
once, with
arbitrary, one inducts on , Logic and Proof, Axiom 4.2.1.)
Example (All right inverses of a small surjection)
picked one preimage per point in the same spirit, by
listing the preimage sets and choosing from them.
- Infinitely many . A proof is a
finite object. It cannot contain one E for each of
infinitely many points, and no rule of Logic and
Proof, Chapter 5 makes infinitely many choices in
one step.
Sometimes the difficulty does not arise, because a
rule picks the preimage. The squaring
map from onto
is
surjective, and each has the preimages and . The rule “take
the non-negative one” defines ,
and is a right
inverse: . Likewise the projection ,
,
is surjective, and is a right inverse. In each case the
specification of Definition 1.1.3
writes down,
because the rule names one preimage for each .
For a surjection with no such rule, nothing proved so
far produces a right inverse. The missing ingredient is
a new principle of set formation, which says that a
choice of one element from each set of a family can be
made. Chapter 3 states it and proves, with it, that
every surjection has a right inverse. Until then, we use
only the implication proved above: a right inverse gives
surjectivity.
Two-sided
inverses
The two halves meet in a single fact about
composition: when a function has an inverse on each
side, the two inverses coincide.
Proposition
1.5.3 (Left and Right Inverses Agree)
Let be a function. If is a
left inverse of
and is a right inverse of , then .
Proof. By Proposition 1.4.3
(associativity and the identity laws), where the first and last equalities are the
identity laws, the second uses that is a right inverse, the
third is associativity, and the fourth uses that is a left inverse. This
proves the proposition.
The chain is worth reading twice. The composite can be
simplified from either end: the left pair collapses to
, the right
pair
collapses to .
Associativity says both simplifications are of the same
function.
Definition
1.5.2 (Inverse Function)
Let be a function. A function is a
two-sided inverse, or an
inverse, of if it is both a left
inverse and a right inverse of : A function with an inverse is
invertible. Its inverse is
unique: if and are both inverses
of , then is a left inverse and
a right
inverse, so by Proposition 1.5.3.
We call it the inverse of and write it .
In words:
undoes on both
sides. It sends back to , and sends back to . The article “the” was
earned by Proposition 1.5.3;
without it,
could name several functions, as “a left inverse”
does.
The definition is symmetric in and . The two equations
that say is
an inverse of
also say that is
an inverse of . So is invertible, and
by uniqueness its inverse is : This is the pattern for every identity about
inverses: to show that some function is
the inverse of , check the two
equations of Definition 1.5.2,
and uniqueness does the rest.
Example
(Inverses found and checked)
Show that each function is invertible by finding its
inverse and checking both composites.
- (a) ,
.
- (b) , .
- (c) ,
,
that is,
for and
for
.
Solution. Idea. Solve
for to find a candidate,
then check both equations of Definition 1.5.2.
The solving is scratch work; the two checks are the
proof.
(a) Solving gives . Let ,
a function . For every , , and for every , . So .
(b) For , , so does map to . Here for
every .
This one equation is both checks at once, with in the roles of and . So : the function
is its own inverse.
(c) Solve by
cases on the sign of , since has the sign of
. For the candidate is
; for it is . Let First check, , by cases on
. If , then , so
, the non-negative square root of being . If , then , so
, since the non-negative square root
of is .
Second check, , by cases on
. If , then , so
. If , then , so .
Both checks hold, so . Notice that each check needs its own
case split: the first splits on the sign of the input
, the second on
the sign of .
Now the theorem that connects inverses with the words
of Section 1.4.
Theorem
1.5.4 (Bijections Are the Invertible
Functions)
A function is bijective if and only if it has a
two-sided inverse.
Idea. is already
proved in two halves: an inverse is a left inverse,
which gives injectivity by Theorem 1.5.1
(a), and a right inverse, which gives surjectivity by Proposition 1.5.2.
Neither half asks anything of .
looks like the open question of the last subsection,
since we must pick a preimage of every . But for a bijection
there is nothing to pick. Surjectivity gives each a preimage and
injectivity says there is only one. So the set of pairs
with already has the
property of Definition 1.4.1.
Proof. Let be a two-sided inverse
of . Then is a left inverse of
, so is injective by Theorem 1.5.1
(a); and is a
right inverse, so
is surjective by Proposition 1.5.2.
Hence is
bijective by Definition 1.4.5.
Let be bijective,
and let a subset of by specification (Definition 1.1.3).
Let . Since
is surjective,
there is
with , so
some has . If and , then
, so since is injective. So satisfies (Fn1) and
(Fn2) (Logic and Proof, Proposition 5.8.1):
for every
there is exactly one with , and
with codomain is
a function (Definition 1.4.1).
By construction, holds exactly when .
Now let .
Then for
the with , so . And let
. The pair
lies in
, since ; so . By Proposition 1.4.1,
and . So is a two-sided inverse
of . This proves
the theorem.
Compare the two constructions of this section. The
left inverse of Theorem 1.5.1
(b) needed a fixed point and a case split by
excluded middle, because some have no preimage. The
inverse of a bijection needs neither. Every has exactly
one preimage, so the definition “ is the preimage of
” names one
element for each
without any choosing. This is why no new principle is
needed here, while the open question about surjections
needs one. The difference between the two is exactly the
difference between “exactly one” and “at least one”.
The theorem also covers the degenerate case. A
function is surjective only if , since a
point of would
need a preimage in . The empty
function is bijective, and it is its own
inverse: both composites are the empty function ,
which is . The proof
of
runs at without change, because it cites only
part (a) of Theorem 1.5.1,
which has no hypothesis on .
Warning. Do not write for a left
inverse. The doubling map has the two different
left inverses and
of the first
subsection, so “” would not say
which one is meant. And neither is an inverse: . The
notation is earned by Proposition 1.5.3,
which needs an inverse on both
sides.
Quick check. Does from to have a two-sided
inverse? Does from to ?
Solution. The first does: ,
the real cube root, which exists and is unique for every
real (a school
fact). Indeed and . The
second does not. It is injective (Example (Squaring, three ways)
(b)), but it is not surjective, since has no preimage; by Theorem 1.5.4
it has no two-sided inverse. (It has left inverses, by
Theorem 1.5.1,
for instance for and for .)
What the
section proved
For a function , the section proved four facts and left
one question open.
- A left inverse makes injective (Theorem 1.5.1
(a)).
- If , an injective has a left inverse (Theorem 1.5.1
(b)). The empty function shows
that the hypothesis is needed.
- A right inverse makes surjective (Proposition 1.5.2).
- A two-sided inverse exists exactly when is bijective (Theorem 1.5.4),
and it is unique (Proposition 1.5.3).
- Open: a surjective has a right inverse.
Chapter 3 proves it, with the new principle.
Exercises
A. Check your
understanding
Exercise
(A1)
These parts are about Theorem 1.5.1
and its proof.
- (a) At which line of
the proof of (b) is used, and for what?
- (b) The proof shows
that the set is a
function by proving two things about the case split into
and
. What
are they, and which step of the proof uses each?
- (c) Run the
construction on , , with . Write out the
left inverse and
check .
- (d) Give the idea of
the proof of (b) in two sentences.
- (e) Let be the only function between these sets.
Which step of the proof of (b) fails for , and why?
Solution.
(a) In the first
line of (b): “fix one and call it ”. The point is the value for every outside the range ; without it, the
second alternative in the definition of would have nothing to
send such
to.
(b) The two cases
exhaust every : by excluded middle,
or ; this is
used in the existence step. And they do not
overlap: a cannot satisfy both,
since
and
contradict each other; this is used in the uniqueness
step, to rule out a pair from each alternative.
(Uniqueness inside the first case uses injectivity;
inside the second, it is automatic.)
(c) The
hypotheses hold: , and is injective, since
gives .
The range is . On the range, returns the unique
preimage: ,
, . The point is outside the range,
so .
Check: , , . So .
(d) A point of
the range has exactly one preimage, by injectivity, and
sends it there; a
point outside the range is sent to a fixed point of the non-empty
domain. Then is the unique
preimage of ,
which is .
(e) The
uniqueness step fails. The point lies in the range
and has the two preimages and , so and both lie in , and is not a function. The
step “, so ” needs injectivity, which this lacks. (By part (a) of
the theorem, has
no left inverse at all.)
B. Practice
Exercise
(B1: Counting one-sided inverses)
- (a) Find all left
inverses of , .
- (b) Find all right
inverses of , , .
Solution.
(a) A left
inverse must satisfy and , that is
and . The point is outside the range
, so is free: or . Each choice satisfies
both equations. So there are exactly 2 left inverses:
and , with , in
both.
(b) A right
inverse must satisfy and . The
preimages of
under are and , so ; the
only preimage of
is , so . So there are
exactly 2 right inverses: or , with in
both.
Exercise
(B2: The inverse of a composite)
Let and be bijections. Prove that is invertible
and that .
Hint: check the two equations of Definition 1.5.2
for the candidate .
Solution. The candidate is defined, since and
exist by Theorem 1.5.4.
We check the two equations of Definition 1.5.2,
using Proposition 1.4.3
to regroup and for its identity laws : So is a two-sided inverse of . By the
uniqueness of inverses (Proposition 1.5.3,
as in Definition 1.5.2),
it is the inverse: . Notice the order: to undo “first , then ”, undo first.
Exercise
(B3: A bijection between an interval and the
line)
Let , , and , .
Show that and
are well defined
(each denominator is non-zero, and takes values in ), and that is the inverse of , by checking both
composites by cases on the sign. Hence is a bijection.
Solution. Well defined.
For ,
, so
.
For ,
, and because ;
so .
First check, for . If , then
, so If , then and , so
and
Second check, for . If , then , so If , then , so
and Both composites are identities, so , and is a bijection by Theorem 1.5.4.
C. Going deeper
Exercise
(C1: One composite equal to the identity)
Let and be functions with .
- (a) Prove that is injective and is surjective.
- (b) Show by an
example that neither nor need be bijective.
- (c) Prove that if,
in addition, is
surjective, then .
Solution (Hint 1). Read the
equation twice: once as a statement about , once as a statement
about .
Solution (Hint 2). For : let ; you need a point
of that sends to .
Solution.
(a) The equation
says that is a
left inverse of ,
so is injective
by Theorem 1.5.1
(a). The same equation says that is a right inverse of
, so is surjective by Proposition 1.5.2.
(Directly: for , the point satisfies .)
(b) Let , , and , . Then
, so
. But is not surjective
( has no preimage)
and is not
injective ( with ), so neither is bijective.
(c) If is also surjective, it
is bijective by (a), so exists by Theorem 1.5.4,
and it is in particular a right inverse of . Also is a left inverse of
. By Proposition 1.5.3,
.
Marking scheme. (10 points)
- 2: injective,
from the left-inverse equation (citing Theorem 1.5.1
(a) or arguing directly from ).
- 2:
surjective, either by citing Proposition 1.5.2
( is a right
inverse of ) or
directly, naming the witness for a given .
- 3: an example with explicit sets and both failures
checked (a point missed by , two points identified
by ).
- 3: (c) obtains a right inverse of (from bijectivity) and
applies uniqueness of one-sided inverses, or checks
directly (for , , using surjectivity to
write ).
Fatal errors (0 for the step): assuming in (a)
or (c) without proof; in (c), writing before showing
bijective.
Exercise
(C2: When is a left inverse unique?)
Let be injective, with .
- (a) Prove that if
is surjective, or
has exactly one
element, then has
exactly one left inverse.
- (b) Prove that if
some is
not in , and
has two different
elements , then has at least two
different left inverses.
- (c) Let , . List all left inverses of , and explain in one
sentence why there are of them.
Solution (Hint 1). For (a), a left
inverse exists by Theorem 1.5.1
(b); only “at most one” needs proof. For (b), run the
construction of that proof twice.
Solution (Hint 2). For (a), let
and be left inverses
of . If is surjective, write a
given as
and
compare with
.
Solution.
(a) A left
inverse exists by Theorem 1.5.1
(b). For “at most one”, let and be left inverses
of . Case
1: is
surjective. Then
is bijective (Definition 1.4.5),
so it has the inverse (Theorem 1.5.4),
which is in particular a right inverse of . By Proposition 1.5.3,
and
, so
.
Case 2:
has exactly one element . For every , both and are elements of
, so ;
hence by
Proposition 1.4.1.
In either case any two left inverses are equal, so has exactly
one.
(b) Run the proof
of Theorem 1.5.1
(b) once with the fixed point and once with ; call the resulting
left inverses
and . The point
is outside the
range, so the second alternative in the definition of
applies to it:
and
.
Since ,
the functions
and differ at
, so .
(c) The range is
. A left
inverse must satisfy and , that is
and . The values
and are free, each in
, and every
choice gives a left inverse. The four are The values on the range are forced, and each
of the two points , outside the range may
go to either of the two points of the domain,
independently: choices. This is the situation of (b): is not surjective and
its domain has two elements.
Marking scheme. (10 points)
- 1: (a) existence of a left inverse, citing Theorem 1.5.1
(b).
- 2: (a) surjective case: an inverse exists, and
uniqueness of one-sided inverses (Proposition 1.5.3)
forces every left inverse to equal it (or a direct
argument: for , ).
- 2: (a) one-element case: any two functions into a
one-element set agree at every point, so they are
equal.
- 3: (b) two left inverses that take the values and at (by the construction
or defined directly), each checked to be a left inverse,
and shown to differ at .
- 2: (c) the forced values , , the four left
inverses, and the count .
Fatal errors (0 for the step): in (a), writing before showing
bijective; in
(b), concluding without exhibiting a point where they
differ.