Function
A function from
to
Y
denoted by
f
:
X
→
Y
is a
binary relation
R
on
X
×
Y
such that if
(
x
,
y
)
,
(
x
,
z
)
∈
R
, then
z
=
y
, which says given an element
x
∈
X
it is only ever related to a single
y
∈
Y
.
Function Equality
Suppose that
f
:
X
→
Y
and
g
:
X
→
Y
are two functions, then we say that they are equal and write
f
=
g
when
f
(
x
)
=
g
(
x
)
for every
x
∈
X
dom f
Given a function
f
:
X
→
Y
, then we denote
dom
(
f
)
:=
X
which we is shorthand for the word domain
ran f
Given a function
f
:
X
→
Y
, then we denote
ran
(
f
)
:=
Y
which we is shorthand for the word range
Constant Function
Suppose that we have a
function
f
:
X
→
Y
such that there is a value
c
∈
Y
such that for every
x
∈
X
, we have
f
(
x
)
=
c
, then we say that
f
is
constant with value
c
Identity Function
Let
X
be a set, the we define the following function
id
X
:
X
→
X
, such that for any
a
∈
X
id
X
(
a
)
=
a
and call it the identity function on
X
.
Domain Restricted Function
Let
f
:
E
→
F
let
A
⊆
E
, then the restriction of
f
to
A
is the function
f
↾
A
:
A
→
F
defined by:
f
↾
A
(
x
)
:=
f
(
x
)
for each
x
∈
A
The restriction of a function is thought of as the same function but with elements from it's domain removed, or restricted to a smaller set.
Inclusion Function
Suppose that
A
⊆
B
, the inclusion function
ι
:
A
→
B
is defined by:
ι
(
x
)
=
x
where the output of
ι
is considered as an element from
B
Restriction Equals Inclusion Composed with Original
let
f
:
E
→
F
and suppose
A
⊆
E
, and let
ι
:
A
→
E
be the
inclusion function, then we have
f
↾
A
=
f
∘
ι
Let
x
∈
A
, then
f
↾
A
(
x
)
=
f
(
x
)
, and
(
f
∘
ι
)
(
x
)
=
f
(
ι
(
x
)
)
=
f
(
x
)
thus the two functions are equal.
Function Composition
Suppose that
A
,
B
,
C
are sets, and that
f
:
A
→
B
,
g
:
B
→
C
are functions, then we define
g
∘
f
(
x
)
:=
g
(
f
(
x
)
)
for any
x
∈
A
, so that
g
∘
f
:
A
→
C
Function Addition
Suppose that
f
,
g
:
X
→
Y
are functions and
⊕
is a binary operation on
Y
, then we define
f
⊕
g
:
X
→
Y
as:
(
f
⊕
g
)
(
x
)
:=
f
(
x
)
⊕
g
(
x
)
Function Multiplication
Let
f
:
X
→
Y
be a function and let
⊗
be a binary operation on
Y
, then for any
c
∈
Y
, we define
c
⊗
f
:
X
→
Y
as:
(
c
⊗
f
)
(
x
)
=
c
⊗
f
(
x
)
Image of a Set
Let
f
:
X
→
Y
be a function and
S
⊆
X
, then
f
(
S
)
:=
{
y
∈
Y
:
y
=
f
(
s
)
,
for some
s
∈
S
}
An Element Belongs to a set Implies its Image belongs to the Image of the Set
x
∈
A
⟹
f
(
x
)
∈
f
(
A
)
An Element belongs to a Set iff its Image belongs to the Image of the Set when the Function is Surjective
Suppose that
f
:
A
→
B
is
injective, then
x
∈
A
⟺
f
(
x
)
∈
f
(
A
)
The
previous corollary already shows
⟹
now if we suppose that
f
(
x
)
∈
f
(
A
)
then there is some
a
∈
A
such that
f
(
x
)
=
f
(
a
)
, since
f
is injective, then we deduce that
x
=
a
so that
x
∈
A
.
Image Maintains Subsets
Suppose that
A
⊆
B
then we have
f
(
A
)
⊆
f
(
B
)
Let
x
∈
f
(
A
)
so that
x
=
f
(
a
)
where
a
∈
A
we then know that
a
∈
B
so therefore
x
∈
f
(
B
)
Union Factors through Image
f
(
⋃
M
)
=
⋃
{
f
(
M
)
:
M
∈
M
}
p
∈
f
(
⋃
M
)
iff
p
=
f
(
x
)
where
x
∈
⋃
M
iff there exists some
M
∈
M
such that
x
∈
M
which shows that
f
(
x
)
∈
f
(
M
)
iff
p
∈
⋃
{
f
M
:
M
∈
M
}
as needed.
Image of the Intersection is a Subset of the Intersection of the Images
f
(
⋂
M
)
⊆
⋂
{
f
(
M
)
:
M
∈
M
}
Suppose that
p
∈
f
(
⋂
M
)
iff
p
=
f
(
x
)
where
x
∈
⋂
M
iff
M
∈
M
,
x
∈
M
therefore
f
(
x
)
∈
f
(
M
)
so that
p
=
f
(
x
)
∈
⋂
{
f
(
M
)
:
M
∈
M
}
Image of the Intersection is Equal to the Intersection of the Images if the Function is Injective
Suppose that
f
is
injective, then
f
(
⋂
M
)
=
⋂
{
f
(
M
)
:
M
∈
M
}
We already know that
⊆
holds true therefore we do the other direction so suppose that
p
∈
⋂
{
f
(
M
)
:
M
∈
M
}
therefore
p
∈
f
(
M
)
for all
M
∈
M
so that there is some
x
M
∈
M
such that
p
=
f
(
x
M
)
. We note that for all
J
,
K
∈
M
we know that
f
(
x
J
)
=
p
=
f
(
x
K
)
so that by injectivity we have
x
J
=
x
K
let
x
′
be their common value and note that
x
′
∈
⋂
M
and that
p
=
f
(
x
′
)
so that
p
∈
f
(
⋂
M
)
Inverse Image of a Function
Suppose
f
:
X
→
Y
and
U
⊆
Y
, then
f
−
1
(
U
)
:=
{
x
∈
X
:
f
(
x
)
∈
U
}
Inverse Image Maintains Subsets
Suppose that
A
⊆
B
then we have
f
−
1
(
A
)
⊆
f
−
1
(
B
)
Let
x
∈
f
−
1
(
A
)
so that
f
(
x
)
∈
A
we then know that
f
(
x
)
∈
B
so therefore
x
∈
f
−
1
(
B
)
Inverse Image of The Range is The Domain
Suppose that
f
is a function, then
f
−
1
(
ran
(
f
)
)
=
dom
(
f
)
x
∈
f
−
1
(
ran
(
f
)
)
iff
f
(
x
)
∈
ran
(
f
)
iff
x
∈
dom
(
f
)
by definition
Inverse Image of a Composition
Suppose that we have two functions
f
:
X
→
Y
and
g
:
Y
→
Z
and suppose that
S
⊆
Z
, then
(
g
∘
f
)
−
1
(
S
)
=
f
−
1
(
g
−
1
(
S
)
)
A point
p
is an element of
(
g
∘
f
)
−
1
(
S
)
iff
(
g
∘
f
)
(
p
)
∈
S
by definition this means that
g
(
f
(
p
)
)
∈
S
iff
f
(
p
)
∈
g
−
1
(
S
)
iff
p
∈
f
−
1
(
g
−
1
(
S
)
)
as needed.
Union Factors through Inverse Image
f
−
1
(
⋃
M
)
=
⋃
{
f
−
1
(
M
)
:
M
∈
M
}
We can observe that
p
∈
f
−
1
(
⋃
M
)
, if and only if
f
(
p
)
∈
⋃
M
, iff there exists some
M
∈
M
such that
f
(
p
)
∈
M
iff
p
∈
f
−
1
(
M
)
so that
p
∈
⋃
{
f
−
1
(
M
)
:
M
∈
M
}
as needed.
Since all the logical connectives in the above proof are iff's then this shows the two sets equal
Set Difference Factors through Inverse Image
Suppose that
f
:
X
→
Y
, and that
A
,
B
⊆
Y
, then
f
−
1
(
A
∖
B
)
=
f
−
1
(
A
)
∖
f
−
1
(
B
)
x
∈
f
−
1
(
A
∖
B
)
iff
f
(
x
)
∈
A
∖
B
iff
f
(
x
)
∈
A
and
f
(
x
)
∉
B
, iff
x
∈
f
−
1
(
A
)
and
x
∉
f
−
1
(
B
)
, iff
x
∈
f
−
1
(
A
)
∖
f
−
1
(
B
)
, as needed.
Intersection Factors through Inverse Image
f
−
1
(
⋂
M
)
=
⋂
{
f
−
1
(
M
)
:
M
∈
M
}
We can observe that
p
∈
f
−
1
(
⋂
M
)
, if and only if
f
(
p
)
∈
⋂
M
, iff for every
M
∈
M
we have
f
(
p
)
∈
M
iff
p
∈
f
−
1
(
M
)
(still for each
M
∈
M
) so that
p
∈
⋂
{
f
−
1
(
M
)
:
M
∈
M
}
as needed.
Since all the logical connectives in the above proof are iff's then this shows the two sets equal
Image of the Inverse Image
Suppose that
f
:
X
→
Y
is a function, and that
S
⊆
Y
, then
f
(
f
−
1
(
S
)
)
⊆
S
Let
p
∈
f
(
f
−
1
(
S
)
)
, therefore
p
=
f
(
x
)
where
x
∈
f
−
1
(
S
)
, therefore
f
(
x
)
∈
S
as needed.
Note that the above proposition is not equality, consider the function
f
:
X
→
{
0
,
1
}
defined as
f
(
x
)
=
0
for every
x
∈
X
, then
f
(
f
−
1
(
{
0
,
1
}
)
)
=
{
0
}
. This hints at how we can force equality
Inverse Image of the Image
Suppose that
S
⊆
X
, then
f
−
1
(
f
(
S
)
)
⊇
S
Let
s
∈
S
, we wish to prove that
s
∈
f
−
1
(
f
(
S
)
)
, which means that we must show
f
(
s
)
∈
f
(
S
)
, clearly this is true since
s
∈
S
This proposition is not equality if we consider the function
f
:
{
1
,
2
,
3
,
4
}
→
{
1
,
2
,
3
,
4
}
and define
f
(
1
)
=
1
,
f
(
2
)
=
2
,
f
(
3
)
=
2
,
f
(
4
)
=
1
, then if we consider
f
−
1
(
f
(
{
1
,
2
}
)
)
we see it equals
{
1
,
2
,
3
,
4
}
which is clearly a superset.
Invertible Function
Let
f
:
X
→
Y
be a
function, then
f
is said to be
invertible if there exists a function
g
:
Y
→
X
such that
g
(
f
(
x
)
)
=
x
for every
x
∈
X
and
f
(
g
(
y
)
)
=
y
for every
y
∈
Y
Inverse Function
Suppose that
f
is
invertible, then there is a function
g
satifying said properties, then we define the notation
f
−
1
:=
g
and say that
f
−
1
is the inverse function of
f
Note that this seems quite similar to the inverse image notation, which looks like
f
−
1
(
S
)
where
S
⊆
Y
, note that they differ as the inverse image is a function from
P
(
Y
)
to
P
(
X
)
, so it is a function that maps sets to sets.
This differs from the inverse of a function because it operates on individual elements of
Y
, so we may write things like
f
−
1
(
s
)
where
s
∈
Y
, noting that
f
−
1
:
Y
→
X
.This idea of using the same notation for a function, but having the type of it's parameters be different is usually known as overloading in the world of programming.
If this is your first brush with notation overloading, then know that it can be confusing, but all confusion can be cleared by inspecting what the inputs are to the function. This should remind you that a function is not just a name, it's signature is given by it's name, input types and return type. To see if you really understand this, answer the following exercise.
This means that the notation
f
−
1
(
y
)
where
y
∈
ran
(
f
)
is reserved only for functions
f
whose inverse exists, otherwise we have problems for example if
f
was not surjective and there was an element
z
that can never get mapped to then what does
f
−
1
(
z
)
mean? If it was not injective, then suppose that there was
a
≠
b
such that
f
(
a
)
=
f
(
b
)
then
a
=
?
f
−
1
(
f
(
a
)
)
=
f
−
1
(
f
(
b
)
)
=
?
b
makes no sense because we know that
a
≠
b
, so we must have injectivity. Therefore you must be carful not to write the symbol
f
−
1
unless you know that
f
is invertible.
Inverse Image of the Inverse Function is the Image
Let
f
:
X
→
Y
and assume that it's inverse exists
f
−
1
:
Y
→
X
and let
S
⊆
Y
show that:
(
f
−
1
)
−
1
(
S
)
=
f
(
S
)
Suppose that
p
∈
(
f
−
1
)
−
1
(
S
)
, by definition this is only true when
f
−
1
(
p
)
∈
S
, so
f
−
1
(
p
)
=
s
for some
s
∈
S
, equivalent to
p
=
f
(
s
)
, which is true if and only if
p
∈
f
(
S
)
.
All logical connectives in the above proof are iff's therefore we've shown the two sets equal.
Injective Function
a
function
f
:
X
→
Y
is injective iff
∀
x
,
y
∈
X
,
f
(
x
)
=
f
(
y
)
⟹
x
=
y
Inverse Image of Image Equality
Suppose that
f
:
X
→
Y
and that
S
⊆
X
, if
f
is injective then
f
−
1
(
f
(
S
)
)
=
S
We've already proven that
f
−
1
(
f
(
S
)
)
⊇
S
, so we just need to prove that
f
−
1
(
f
(
S
)
)
⊆
S
.
Suppose that
p
∈
f
−
1
(
f
(
S
)
)
, therefore
f
(
p
)
∈
f
(
S
)
, which means that there is some
s
∈
S
such that
f
(
p
)
=
f
(
s
)
, since we assumed that
f
was injective this implies that
p
=
s
, which concludes by showing
p
∈
S
.
Surjective Function
a
function
f
:
X
→
Y
is surjective iff
∀
y
∈
Y
,
∃
x
∈
X
such that
f
(
x
)
=
y
Image of Inverse Image Equality
Suppose that
f
:
X
→
Y
and that
S
⊆
Y
, if
f
is surjective then
f
(
f
−
1
(
S
)
)
=
S
We're already aware that
f
(
f
−
1
(
S
)
)
⊆
S
, so we must just show that
f
(
f
−
1
(
S
)
)
⊇
S
.
So we start by assuming
s
∈
S
, and now we must show that
s
∈
f
(
f
−
1
(
S
)
)
, this is only true if
s
=
f
(
x
)
for some
x
∈
(
f
−
1
(
S
)
)
, which in turn means that
x
also has to satisfy:
f
(
x
)
∈
S
.
We start with
s
∈
S
⊆
Y
, thus since
s
∈
Y
and
f
is surjective we get some
a
∈
X
such that
f
(
a
)
=
s
, since
s
∈
S
, then also
a
∈
f
(
S
)
as needed.
composition of two bijective functions is bijective
Suppose
A
,
B
,
C
are non-empty sets and
f
:
A
→
B
,
g
:
B
→
C
are functions, and that
g
∘
f
:
A
→
C
is a function. Then if
f
and
g
are
bijective then
g
∘
f
is also bijective.
We'll show that
g
∘
f
is surjective first, so let
c
∈
C
, since
g
is bijective we get some
b
∈
B
such that
g
(
b
)
=
c
, since
b
∈
B
, then since
f
is surjective we get some
a
∈
A
such that
f
(
a
)
=
b
, thus
g
∘
f
(
a
)
=
g
(
f
(
a
)
)
=
g
(
b
)
=
c
so then
g
∘
f
is surjective
Now let's show that
g
∘
f
is injective, so suppose that
a
1
,
a
2
∈
A
and assume that
g
∘
f
(
a
1
)
=
g
∘
f
(
a
2
)
, note that this means
g
(
f
(
a
1
)
)
=
g
(
f
(
a
2
)
)
, therefore since
g
is injective we know that
f
(
a
1
)
=
f
(
a
2
)
and since
f
is injective then we know that
a
1
=
a
2
as needed.
Self Map
Suppose that
X
is a set, then a self map is any function of the form
f
:
X
→
X
Function Iteration
Given a function
f
:
X
→
X
, then we define
f
∘
0
:=
id
X
and then for any
n
∈
N
1
we define via
composition:
f
∘
n
=
f
∘
f
∘
n
−
1
So for example
f
∘
3
(
x
)
=
f
(
f
(
f
(
id
(
x
)
)
)
)
which is what we expect.
Relation Preserving Function
Suppose that
(
R
,
X
)
and
(
S
,
Y
)
are
binary relations, and
f
:
X
→
Y
a function, then we say that
f
is relation preserving if given
x
,
y
∈
X
x
R
y
⟹
f
(
x
)
S
f
(
y
)
Note that when the relation is an order, we say that it is an order preserving function, you are already familiar with them, consider
f
(
x
)
=
x
+
1
on
R
.
Relation Reversing Function
Suppose that
(
R
,
X
)
and
(
S
,
Y
)
are relations, and
f
:
X
→
Y
a function, then we say that
f
is relation reversing if given
x
,
y
∈
X
x
R
y
⟹
f
(
y
)
S
f
(
x
)
The Inverse of an Order Preserving Function is Order Preserving
Suppose that
(
A
,
≤
A
)
and
(
B
,
≤
B
)
are partial orders and
f
:
A
→
B
is order preserving and invertible, then
f
−
1
:
B
→
A
is also order preserving
Let
b
1
,
b
2
∈
B
such that
b
1
≤
B
b
2
now we want to prove that
f
−
1
(
b
1
)
≤
A
f
−
1
(
b
2
)
.
If it so happens that
b
1
=
b
2
then we automatically have that
f
−
1
(
b
1
)
=
f
−
1
(
b
2
)
as
≤
A
is reflexive.
So suppose rather that
b
1
≤
B
b
2
and that
b
1
≠
b
2
. Note that
f
−
1
(
b
1
)
=
a
1
and
f
−
1
(
b
2
)
=
a
2
for some
a
1
,
a
2
∈
A
since
≤
A
is a total order than
a
1
,
a
2
are comparable, if it so happens that
a
2
≤
A
a
1
then since
f
is order preserving, then we would have
f
(
a
2
)
≤
B
f
(
a
1
)
⟺
b
2
≤
B
b
1
since
f
was assumed invertible, which would only be possible if
b
1
=
b
2
which we know is not the case, therefore we must have that
a
1
≤
A
a
2
which means that
f
−
1
(
b
1
)
≤
A
f
−
1
(
b
2
)
When a Function Defined in Terms of a Function is a Function
Suppose that
g
:
A
→
B
and
h
:
A
→
A
, then if
f
is a defined such that
f
(
g
(
a
)
,
g
(
b
)
)
=
g
(
h
(
a
,
b
)
)
is a function iff for any
x
,
y
,
z
,
w
∈
A
(
g
(
x
)
=
g
(
z
)
∧
g
(
y
)
=
g
(
w
)
)
⟹
g
(
h
(
x
,
y
)
)
=
g
(
h
(
z
,
w
)
)