Professional Documents
Culture Documents
Functions - READ PDF
Functions - READ PDF
1
Introducing Functions
1. (a, b1 ) ∈ f ∧ (a, b2 ) ∈ f ⇒ b1 = b2 ;
2. ∀a ∈ A. ∃b ∈ B. (a, b) ∈ f .
2
Comments
3
Image Set
4
Example
5
Example
6
Examples
7
Cardinality
8
Partial Functions
(a, b1 ) ∈ f ∧ (a, b2 ) ∈ f ⇒ b1 = b2 .
9
Examples of Partial Functions
Let f : A → B be a function.
1. f is onto if and only if every element of B is in the image
of f :
∀b ∈ B. ∃a ∈ A. f (a) = b.
11
Example
12
Example
a 1
2
b
3
13
Example
A B
a 1
b 2
c 3
14
Example
15
Examples
16
The Pigeonhole Principle
Pigeonhole Principle
Let f : A → B be a function, where A and B are finite. If
|A| > |B|, then f cannot be a one-to-one function.
Example
Let A = {1, 2, 3} and B = {a, b}. A function f : A → B
cannot be one-to-one, since A is too big.
It is not possible to prove this property directly.
The pigeonhole principle states that we assume that the
property is true.
17
Proposition
|f [X]| ≤ |X|.
Proof
Part (a) is the contrapositive of the
pigeonhole principle.
For (b), notice that if f is onto then
f [A] = B. Hence, |f [A]| = |B|. Also
|A| ≥ |f [A]| by previous proposition.
Therefore |A| ≥ |B| as required.
Part (c) follows from parts (a) and (b).
Composition
Let A = {1, 2, 3}, B = {a, b, c}, f = {(1, a), (2, b), (3, a)}
and g = {(a, 3), (b, 1)}.
Then g ◦ f = {(1, 3), (2, 1), (3, 3)}.
A B A
1 a 1
2 2
b
3 3
21
Associativity
22
Proposition
id :: A -> A
id x = x
24
Inverse
25
Examples
26
Proposition
27
Proposition
28
Example
f (x) = x + 1, x odd
= x − 1, x even
29
Cardinality of Sets
Definition
For any sets A, B, define A ∼ B if and only if there is bijection
from A to B.
Proposition Relation ∼ is reflexive, symmetric and transitive.
Proof Relation ∼ is reflexive , as idA : A → A is a bijection.
To show that it is symmetric, A ∼ B implies that there is a
bijection f : A → B. By previous proposition, it follows that f
has an inverse f −1 which is also a bijection. Hence B ∼ A.
The fact that the relation ∼ is transitive follows from previous
proposition.
30
Example
31
Example
32
Example
cA : {1, 2, . . . , n} → A.
Two finite sets have the same number of elements if and only if
there is a bijection between then.
33
Cardinality
34
Exploring Infinite Sets
0
0, 1
0, 1, 2
...
35
Countable
36
Example
37
Example
Comment
The rational numbers are also countable.
38
Uncountable Sets
39