4
4
4
Functions
Functions, as we defined, are a special case of relations. Recall that a binary
relation R ⊆ S1 × S2 is a (partial) function if for each x ∈ S1, there exists (at most)
one y ∈ S2 such that (x, y) ∈ R.
A partial function need not have a value y = f (x) for each x ∈ S1.
We say that function f is defined at x ∈ S1 if there exists a y ∈ S2 such that
(x, y) ∈ Rf . The domain of a partial function f : S1 → S2 is defined as
dom( f ) = {x ∈ S1 | ∃y ∈ S2 : y = f (x)}, i.e., the elements x ∈ S1 for which
f (x) ∈ S2 is defined. Note that dom( f ) ⊆ S1 = predom( f ).
The range of a partial function f : S1 → S2 is defined as
range( f ) = {y ∈ S2 | ∃x ∈ S1 : y = f (x)}, i.e., the elements y ∈ S2 such that
y = f (x) for some x ∈ S1. Note that range( f ) ⊆ S2 = codom( f ) . .
Total function. If the functional relation Rf is total, i.e., for each x ∈ S1 there
exists a y ∈ S2 such that y = f (x), we call f a total function and
dom( f ) = S1 = predom( f ) .
Onto. If a function f (namely, its functional relation Rf) is onto, i.e., for each y ∈ S2
there exists an x ∈ S1 such that y = f (x), then we call f an onto (surjective, epi)
function and range( f ) = S2 = codom( f ) .
Exercise: Show that the identity function on any set idS : S → S defined by the
mapping “x ↦ x” is (i) total; (ii) 1-1; (iii) onto and (iv) a bijection.
Two sets S1, S2 are said to be in bijection with each other (written S1 ≅ S2) if there
exists a bijective function f : S1 → S2. Note that if S1 ≅ S2, then | S1 | = | S2 |
Exercise. Recall the set 1, with its canonical element written as ().
[Note: this is the empty tuple, and resembles writing a 0]
Show that S × 1 ≅ S ≅ 1 × S
Axioms 1 and 6 define the constructors, Axioms 2-5 characterise equality and
closure of the set with respect to it, and Axiom 7 and 8 define (non)equality
properties of the constructors. Axiom 9 is an induction scheme. (Axiom 9’) is an
alternative way to state Axiom 9 on predicates.
Page 2 of 5
Let N′ ⊆ ℕ . A set A is called denumerable or countable if there exists a 1-1 total
function f : A → N′, i.e., there is an injective mapping from all of A to a subset of
the natural numbers.
A finite set is a set whose cardinality is equal to some n ∈ ℕ. Clearly every finite set
of size n ∈ ℕ has a 1-1 total function mapping to ℕn.
Note that every natural number is finite, but the set of natural numbers ℕ is
denumerably infinite (countably infinite). ℕ is not in bijection with any ℕn
for n ∈ ℕ.
Every finite set is trivially denumerable.
Exercise: Show that total functions are closed under composition. That is, if
f : S1 → S2 and g : S2 → S3 are total functions, then so is f ; g : S1 → S3.
Exercise: Show that 1-1 functions are closed under composition. That is, if
f : S1 → S2 and g : S2 → S3 are 1-1 functions, then so is f ; g : S1 → S3.
Exercise: Show that onto functions are closed under composition. That is, if
f : S1 → S2 and g : S2 → S3 are onto functions, then so is f ; g : S1 → S3.
Exercise: Show that bijections are closed under composition. That is, if
f : S1 → S2 and g : S2 → S3 are bijections, then so is f ; g : S1 → S3.
Exercise: Show that finite-domain functions are closed under composition. That
is, if f : S1 →fin S2 and g : S2 →fin S3 are finite-domain functions, then so is
f ; g : S1 →fin S3.
Page 3 of 5


Some denumerable sets
Proposition: (i) The set of even natural numbers is denumerable but not finite.
(ii) The set of odd natural numbers is denumerable but not finite.
(iii) The cardinalities of the even naturals (respectively, odd naturals) is the same as
that of ℕ.
Proof hint: (Trivial) Define a total 1-1 function from the even (respectively odd)
natural numbers to a subset of the naturals. (More interesting) Also show that the
cardinality of these sets is at least that of the natural numbers by showing a total 1-1
function from the naturals to each of them.
Proposition: The cardinality | ℝ | of the set of real numbers ℝ is the same as that
of any open interval (a, b), in particular (0,1) or (−π /2, π /2).
Theorem (Cantor: Second Diagonal Argument): The set of real numbers ℝ is not
denumerable.
Proof by Cantordiction.
We rely on the fact that if any subset of a ℝ is not denumerable, then ℝ is not
denumerable.
Page 4 of 5
(1) Assume (0,1) is denumerable.
(2) Consider the set D of all non-terminating decimals in (0,1). D is a subset of
(0,1), and so must be denumerable (a subset of a denumerable set is also
denumerable). That is, there is an total 1-1 function e : D → ℕ.
Therefore we can write down all the non-terminating decimal elements of (0,1),
i.e., the elements of D, in some enumerated order as a series of “rows”:
r0 = d00 d01…d0j…
r1 = d10 d11…d1j…
⋮⋮⋮ ⋮…⋮…
ri = di0 di1… dij…
⋮⋮⋮ ⋮…⋮…
where each of the rows (ri ) represents a non-terminating decimal of the form
0.di0 di1… dij… [ Note ri ∈ (0,1), and if e(x) = i, then x is represented as
the i th row ri.]
(Note that all finite decimals, which have finitely many digits followed by an
infinite number of 0’s at the end can instead be represented by an
indistinguishable form “in the limit”— with one less in the last non-zero digit
and then an infinite series of 9’s. For example, instead of 0.5 let us write
0.49999…)
(Note: we don’t know — and don’t care — what the order of enumeration is.
It is not at all likely to be the usual < ordering).
But r′ ≠ rk because its k th digit r′k ≠ dkk, which is k th digit of the rk. (Note
that by construction, for each j ∈ ℕ, the j th digit r′j ≠ djj).
Therefore r′ ∈ D but e(r′) ∉ ℕ. So e is either not total, or not 1-1.
Page 5 of 5