Chapter 1 made a function a graph with a codomain,
and Chapter 4 cut sets into classes. This chapter builds
new functions out of old ones. Here we take the three
simplest constructions: cutting a function down to a
smaller domain, enlarging its domain, and assembling one
function from pieces defined on parts of the domain. The
last of these is behind every definition “by cases”, and
the section ends with the functions that take only the
values and , with which an equation
between sets becomes a computation with numbers.
A function
in two pieces
The proof of the Schröder–Bernstein theorem (Theorem 3.4.3)
defined its bijection by one formula on a set
and by another
off , and then
said: each falls
under exactly one case, and in each case the value
exists and is unique, so is a function. That
sentence carried the whole definition. It is worth
asking what it really needed.
Here is a familiar definition by cases: This time a point falls under
both cases: and . So the sentence
from Schröder–Bernstein does not apply. Is still a
function? Most readers would say yes at once, because
both formulas give at . Now try At the
first line gives
and the second gives . The “rule” offers two
values at one input, and by (Fn2) of Definition 1.5.1
it is not a function.
So whether “one formula on this piece, another on
that piece” defines a function depends on two things:
whether the pieces leave any point out, and what the
formulas do where the pieces meet. Before reading
on: write down the condition on two formulas, on two
pieces, that makes the definition a function. The
gluing theorem below answers this, for any number of
pieces.
Restriction
and extension
Section 1.5 cut a function down: the restriction of
to
a subset keeps the pairs of whose input lies in
. The reverse
question is just as natural. A function is known on part
of a set, say on ; can it be extended to a
larger set, and in how many ways?
A restriction forgets part of the domain; an
extension fills in the part that was missing.
Definition
5.1.1 (Restriction, Extension,
Inclusion)
Let and be sets and .
- (a) For , the
restriction of to is the function ,
, as in Section 1.5.
- (b) For , an
extension of to is a
function with .
- (c) The
inclusion map of into is ,
.
In words: the restriction keeps the codomain and
forgets the inputs outside . An extension is any
function on the larger set that agrees with at every point of ; by Proposition 1.5.1,
says
exactly that for every , since both functions have domain and codomain . The inclusion map is
the identity of
with its codomain enlarged to ; it is not unless , because the
codomains differ.
The article in (b) is “a”, not
“the”, and the naive expectation that an extension is
determined by
fails at once. The function ,
, has an
extension to
for every choice of a value at : sending to and sending to give two different
extensions, since they differ at . The formula suggests no value at
all there. Nor need an extension keep a property that
has. Let , and let send and , a bijection. An extension to with codomain
is a
function from a set of three elements to a set of two,
and by Corollary 2.5.3
(a) no such function is injective. So the bijection
has extensions,
but no injective one.
Restriction, by contrast, is predictable. The next
proposition lists what it does.
Proposition
5.1.1 (Restrictions)
Let be a function and .
- (a) .
- (b) .
- (c) For every
function , .
- (d) If is injective, then so
is .
- (e) .
Idea. Parts (a)–(c) are equations
between functions, so we compare domains, codomains and
values. Parts (d) and (e) only unwind Definition 1.5.3
and Definition 1.7.1,
using .
Proof. For (a)–(c) we use Proposition 1.5.1:
in each part both sides have the same domain and
codomain, and we compare values.
(a) Both sides
are functions (Definition 1.5.2).
For , .
(b) Both sides
are functions . For , , where the middle step
uses .
(c) Both sides
are functions . For , .
(d) Let with
. Then , so
because
is injective (Definition 1.5.3).
(e) By Definition 1.7.1,
, since for every
.
Part (e) with says that the restriction has the same image
as on : . Part (d)
has no partner for surjectivity, and the next check asks
why.
Quick check. Is a restriction of a
surjection always surjective?
Solution. No. The function , , is surjective (every is ). Its
restriction has image , so
is not a value.
The restriction keeps the codomain while the domain
shrinks, so it can lose surjectivity. It can also gain
injectivity: is injective, although is not.
Gluing
Restriction takes a function apart: it hands us the
pieces on
the parts of
the domain. Gluing is the reverse. We are given
functions on the parts and want one function on the
whole set. The hook named the two ways this can go
wrong: a point may lie in no part, and a point may lie
in two parts whose formulas disagree there. Only the
second failure appeared there; the first is easy to
picture.
Theorem
5.1.2 (Gluing Functions)
Let be a family of subsets of a set with , and let be a family of functions .
Suppose the
agree on overlaps: Then there is exactly one
function with for every .
Idea (Scratch work). A function is
a graph satisfying (Fn1) and (Fn2), together with a
codomain (Definition 1.5.1).
We must produce a graph, and the only graphs in sight
are the graphs
of the . The
obvious candidate is their union. The plan, as givens
and goal:
| graphs , each with (Fn1) and (Fn2) on ; ;
agreement on overlaps |
a function whose restriction to each is , and only one |
|
(Fn1) and (Fn2) for on |
| , so
for some
(the cover) |
(Fn1): |
| ,
; so , and |
(Fn2): ; this is the gap, and agreement on
overlaps closes it |
In the existence part each hypothesis has one job:
the cover gives (Fn1), agreement gives (Fn2). Uniqueness
is easier: two functions with the right restrictions
both take the value at a point .
Proof. For each , let be the graph of , and let (Definition 1.3.4).
Since , each , so .
(Fn1). Let . Since , there is with . Then .
(Fn2). Let and . Then and for
some .
Since and , we have , and
by of
Section 1.5, and . Agreement on overlaps gives .
So is a function . Let . Both and are functions , and for we have , so
by
; that
is, . By Proposition 1.5.1,
.
Uniqueness. Let also
satisfy for every . Let , and choose with . Then . By Proposition 1.5.1,
. This proves
the theorem.
In the existence part, the proof used the cover only
for (Fn1) and agreement only for (Fn2). Each hypothesis
is needed. If a point lies in no , the union graph has
no pair with first coordinate , and (Fn1) fails; the
theorem fails too: for , and , both ways of choosing the value at give a function with , so
“exactly one” fails. The rule of the hook shows two
pieces that cover and disagree at , where (Fn2) fails.
The theorem is used so often that its use deserves a
template. Step (4) below is the one most often
forgotten.
Example
(Method: define a function by gluing)
Template. (1) Name the pieces and
check that they cover the domain. (2) For each two
pieces, find the overlap and check that the formulas
agree on it; disjoint pieces need nothing. (3) Conclude
by Theorem 5.1.2.
(4) Prove further properties piece by piece and
across pieces: for injectivity, compare a value
from one piece with a value from another.
When to use it. Definitions by
cases, piecewise formulas, a default value off a subset,
constructions such as Schröder–Bernstein’s.
The usual failure. Checking the
cover and forgetting the overlaps (a boundary point lies
in two pieces); checking injectivity inside each piece
only.
Example
(Piecewise definitions are gluings)
Decide whether each definition glues to a function
.
- (a) on and on .
- (b) on and on .
- (c) on and on . If it
glues, is the result injective?
Solution.
(a) Step (1): the
pieces cover ,
since every real number is or . Step (2): the
overlap is ,
where the formulas give and . They agree, so by
Theorem 5.1.2
there is exactly one function with these restrictions:
the absolute value .
(b) The pieces
cover and
overlap in ,
where the values are and . Agreement fails, so
the hypothesis of Theorem 5.1.2
fails; and no function can have both restrictions, since
its value at
would be and
. This is the rule
of the hook,
which is not a function.
(c) A minimal
change to (b): the second piece loses the point . Now the pieces are
disjoint and still cover , so step (2) has
nothing to check, and they glue to a function .
Inside each piece
is injective ( and each force ). Across the
pieces, step (4) finds a collision:
and . So is not
injective.
Back to Schröder–Bernstein. In the
proof of Theorem 3.4.3,
the pieces were
and :
disjoint, and covering . So the definition of
is a gluing, with
nothing to check in step (2), and “each falls under exactly one
case” is steps (1) and (2) at once: the pieces cover
, and there is no
overlap to check. The proof’s Case 3 of injectivity, one
point in and one
outside, is step (4)’s comparison across pieces; Cases 1
and 2 are the checks inside each piece.
Default values. Let , and
. “Take
on and the value on ” glues
with the constant
function with value : the pieces and are
disjoint and cover . The “Repair” in the
solution of Section 3.1’s Exercise (C2: Find the error)
was a default-value definition of this kind, with the
default on the
inputs that had no value of the right kind. The
indicator functions of the next subsection are
default-value definitions too.
Warning. A boundary point usually
lies in two pieces. “ on , on ” covers , and each formula is
a function on its piece, but at the values are and , so nothing glues.
Check every overlap, not just the cover.
Quick check. Glue on and on . Does it
glue? Is the result injective?
Solution. The pieces cover and overlap in , where ;
so the definitions glue to a function . It
is not injective, and the failure is inside the first
piece: .
Indicator
functions
A subset of
can be described
by a function that answers, for each , the question “is
in ?” with for yes and for no. Section 1.5 met
this function in Example (First functions)
(d). It now gets its own label, because it turns
statements about sets into arithmetic.
Definition
5.1.2 (Indicator Function)
Let be a set
and .
The indicator function of is ,
It is a default-value definition: the constant on glued with the constant
on , over a
disjoint cover of . The function depends
on as well as on
, since is its domain;
throughout this subsection one set is fixed and every set
named is a subset of it. Two small cases: is the constant
function , and
is
the constant function .
Section 3.6 proved that is a bijection , with inverse (Theorem 3.6.4).
Only one consequence is needed here, and it can be read
off directly: is
recovered from its indicator as the set of points where
the value is . So
This is what lets a computation with
indicators prove an equation between sets: show that the
two sides have the same indicator, and they are
equal.
To compute, we need to know what the set operations
do to indicators. Besides the operations of Definition 1.3.1
we use one more. The symmetric
difference of and is the set of points that lie in exactly one of
and .
Proposition
5.1.3 (Set Operations as Arithmetic of
Indicators)
Let . For every , write and .
Then:
- (a) ;
- (b) ;
- (c) ;
- (d) ;
- (e) if and only
if for every .
Idea. For (a), (b) and (d),
membership of in
the left-hand set is decided by which of , hold: four cases,
one table. Part (c) need not be tabled at all: De Morgan
turns a union into a complement of an intersection, and
(a), (b) compute that.
Proof. Fix . By Definition 5.1.2,
if and otherwise, and
likewise for and
.
(a), (b), (d). There are four cases, and in each we
read membership from Definition 1.3.1
and the definition of :
| yes |
yes |
1 |
1 |
yes |
1 |
no |
0 |
no |
0 |
| yes |
no |
1 |
0 |
no |
0 |
no |
0 |
yes |
1 |
| no |
yes |
0 |
1 |
no |
0 |
yes |
1 |
yes |
1 |
| no |
no |
0 |
0 |
no |
0 |
yes |
1 |
no |
0 |
In every row, the number in each formula column is
exactly when the
membership column before it says yes, and otherwise. That is (a),
(b) and (d).
(c) By Theorem 1.3.1
(d) with in the
place of , . Applying (a)
to the sets and , whose indicators at are and by (b), gives . Applying (b) to the set ,
(d) Suppose
and
let . If
, then
, so and . If , then
since . Suppose the
inequality holds at every point, and let . Then , so and . By Definition 1.2.2,
.
Part (e) says the only pattern of values that forbids is
, : a point of outside .
Quick check. Express
in terms of and .
Solution. By Definition 1.3.1,
, since both consist of the points
of not in . By (a) and (b), . Check on the row , : the value is , and indeed such an
lies in .
Compute with indicators. To prove an
equation
between sets built from subsets of , fix , write for the values of
at , and translate each
side into a polynomial in by Proposition 5.1.3.
Simplify both, using , , , which hold because and . If the two
polynomials agree for all values in , then , and
because a set
is recovered from its indicator. The method replaces a
case analysis on memberships by algebra, and it pays
most when the case analysis is long.
Example
(Symmetric difference is associative)
Show that for
all .
Solution. Fix and let be the values of
at . By Proposition 5.1.3
(d), . Applying (d) again, to the sets
and
, The final expression does not change when
are
permuted. The right-hand side gives , which expands to the same expression. So
the two sets have the same indicator, and they are
equal.
The common value is exactly when an odd
number of
equal : with one
of them equal to
it is , with two
it is ,
with three . So both sides are the set of points lying in
an odd number of . An element chase would split into eight
cases, one for each pattern of memberships; the
indicator computation did all eight at once.
Cantor, re-read. The set in the proof of Theorem 3.3.2
has indicator : it is the flipped diagonal of
the proof of Theorem 3.3.1
in Section 3.3, and Section 3.3, after Theorem 3.3.2,
already joined the two arguments for . Exercise C3 runs
the argument for an arbitrary set, with 0–1 functions
first and subsets second.
Quick check. Let , and . List the
values , first
from the formula and then from the definition of .
Solution. The values of are and those of
are . The formula
gives , , , : the
list .
From the definition, ,
whose indicator is the same list.
Exercises
A. Check your
understanding
Exercise
(A1)
- (a) Let ,
. What is
the image of ?
- (b) Let be distinct and
let send , . Does have an injective
extension to with codomain ? With codomain
?
- (c) Let and . Show
that has an
extension to if
and only if
or .
- (d) For , write
as
the list of its values at , and name the subset of whose indicator has the
values .
Solution.
(a) By Proposition 5.1.1
(e), the image is . For , ; conversely each is with . So
the image is .
(b) No: a
function from a set of three elements to a set of two
elements is not injective, by Corollary 2.5.3
(a). Yes: send ; the three values are distinct, so
the extension is injective.
(c) If , then is an extension of
itself, since . If , choose and glue with the constant
function with value : the pieces and are
disjoint and cover , so Theorem 5.1.2
gives with . Suppose
and . Since
and
, some is not in ; so is non-empty, and by Proposition 1.5.2
(b) there is no function , let alone an extension of . By contraposition, an
extension forces or .
(d) ; the subset
, the set
of points where the value is .
B. Practice
Exercise
(B1: Three pieces)
Let
on ,
on
and on , each with
codomain . Show
that they glue to a function .
Find and
, and
decide whether is
injective.
Solution. The three intervals cover
. The overlaps
are , where ;
, where ; and . So the pieces agree on overlaps and
glue, by Theorem 5.1.2.
Since is the
union of the three pieces, Theorem 1.7.3
gives as the
union of the images of the pieces, and by Proposition 5.1.1
(e) the image of a piece is the image of the
corresponding .
These are , and
. Hence .
On the first and third pieces every value is , so a solution of
lies in ,
where it solves . Hence . Two different points
have the same value, so is not injective.
Exercise
(B2: Injective across pieces)
Let and . Prove that is injective if and
only if and
are injective
and .
Solution. The
restrictions are injective by Proposition 5.1.1
(d), and by Theorem 1.7.4
(b), since is
injective.
Let
with . If both lie in , then
and
since is
injective; likewise if both lie in . Otherwise, since , one lies in
and the other in
; by symmetry say
and . Then lies in , so for some (Definition 1.7.1).
Now with
, so ; and with ,
so .
Hence ,
and is
injective.
Exercise
(B3: By indicators)
Let . Prove by computing with indicators:
- (a) ;
- (b) .
Solution. Fix and write for the values of
at . For any , , so Proposition 5.1.3
(a), (b) give .
(a) By Proposition 5.1.3
(c), , so the left side has indicator value
. The right side has, by Proposition 5.1.3
(a), , using
. The
indicators agree at every , so the sets are
equal.
(b) By Proposition 5.1.3
(a) and (d), the left side has . The sets and have indicator values and , so by Proposition 5.1.3
(d) the right side has . The indicators agree, so the sets are
equal.
Exercise
(B4: Prove or disprove)
Prove each true statement and refute each false one
with a counterexample.
- (a) If with , and
,
are functions, then there is exactly one with
and .
- (b) If , , and and are injective, then
is
injective.
- (c) If and
is surjective for some , then is surjective.
- (d) The definition
for , for
gives a bijection .
- (e) Gluing on and on gives an injective
function .
Solution.
(a) True. The
family covers
, and the only
overlap is
empty, so agreement holds vacuously. By Theorem 5.1.2
there is exactly one such .
(b) False. Let
, , and . Then , and both
restrictions are injective (on each piece, with of the same
sign gives ), but . The collision is across the
pieces.
(c) True. Let
. Since
is surjective,
for some . So is
a value of .
(d) True. The
pieces and
are disjoint and cover , so is a function by Theorem 5.1.2.
Injective. Inside the pieces: and each give
. Across
the pieces: if , and , then , so , a contradiction.
Surjective. A rational is . An irrational is : here , since
otherwise .
(e) False. The
pieces agree at the overlap (both give ), so they glue to a
function ; but
.
C. Going deeper
Exercise
(C1: Counting extensions)
Let and , and let be the set of all
extensions of to
. Show that is a bijection from to .
Solution. Write , a function . For ,
the pieces and
are
disjoint and cover , so by Theorem 5.1.2
there is exactly one
with and . In particular , so .
Round trip on . , by the choice of .
Round trip on . Let . Both and restrict
to on and to on
. By
the uniqueness in Theorem 5.1.2,
.
So is a
two-sided inverse of , and is a bijection by Theorem 1.6.4.
In words: an extension of is the same thing as an
arbitrary choice of values off . For finite sets this
counts the extensions: if has elements and has , there are as many
extensions as functions from an -element set to an -element set.
Marking scheme. (10 points) - 3:
defines by
gluing, checking the pieces cover and are disjoint. - 2:
. - 3: by
uniqueness in Theorem 5.1.2.
- 2: concludes that is a bijection.
Exercise
(C2: Find the error)
Here is a proposed proof of the existence part of Theorem 5.1.2.
“Given ,
pick with , and set .
Then
for every .”
Which hypothesis of the theorem is never used? Where
does the argument fail, and which check is missing? Is
the conclusion true?
Solution. The conclusion is true:
it is Theorem 5.1.2.
The argument does not prove it.
Agreement on overlaps is never used. The failure is
in the definition of : the rule reads a
chosen index from
the set , and it defines a function only if the
value does
not depend on which such is picked. That is the
well-definedness check of Example (Method: checking that a definition on classes is well defined),
with “an index
with ” in
the role of a representative; it is exactly agreement on
overlaps. Without it, the second sentence fails too: at
a point where was picked, ,
which need not equal . Example (Piecewise definitions are gluings)
(b) at is a
case: picking the first piece gives , and then is not
,
which has the value at .
Marking scheme. (10 points) - 3:
names agreement on overlaps as the unused hypothesis. -
4: locates the failure either in the definition of (the value depends on
the choice of , so
a well-definedness check is missing) or in the claim
at a
point of where another index was picked, and says
that agreement on overlaps is what is missing. - 3:
gives a concrete case where the choice matters and fails.
Fatal errors (0 for the step): claiming the conclusion
is false; locating the error in the cover (every does lie in some ).
Exercise
(C3: Cantor through indicators)
Let be a set
and a function. Define
by .
- (a) Prove that is not a value of .
- (b) Deduce Theorem 3.3.2.
Hint: for , use .
Solution.
(a) Since ,
also , so . Suppose for some . Then , and by the definition of , . Hence
,
which is impossible for . So
is not a value of
.
(b) Let be a function, and put . Let . Since takes only the values
and , . If for some , then , against (a). So is not a value of , and is not surjective.
Unwinding,
exactly when , so , the set of the proof
in Section 3.3.
Marking scheme. (10 points) - 1:
checks that . - 4: assumes and reaches the
contradiction . - 4: shows and transfers
the argument to
via . - 1: concludes that is not surjective.
Section 3.6’s Corollary 3.6.5
went the other way, from Cantor’s theorem to 0–1
functions; here the argument about 0–1 functions comes
first, and the statement about subsets follows from
it.