0% found this document useful (0 votes)
11 views

Bijective Functions

The document provides an introduction to set theory, focusing on the concepts of injective (one-to-one) and surjective (onto) functions, along with exercises to illustrate these definitions. It defines injections and surjections, provides examples, and discusses the properties of various functions, including bijections. The document also includes exercises for constructing functions with specific properties from the set of natural numbers.

Uploaded by

settibhavana519
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Bijective Functions

The document provides an introduction to set theory, focusing on the concepts of injective (one-to-one) and surjective (onto) functions, along with exercises to illustrate these definitions. It defines injections and surjections, provides examples, and discusses the properties of various functions, including bijections. The document also includes exercises for constructing functions with specific properties from the set of natural numbers.

Uploaded by

settibhavana519
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Introduction to set theory and to methodology and philosophy of

mathematics and computer programming

Injective and surjective functions


An overview

by Jan Plaza

c 2017 Jan Plaza


Use under the Creative Commons Attribution 4.0 International License

Version of November 8, 2017


Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ?
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why?
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.

Consider the following functions on R.


1. Is f (x) = x3 1-1 ?
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.

Consider the following functions on R.


1. Is f (x) = x3 1-1 ? Yes.
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.

Consider the following functions on R.


1. Is f (x) = x3 1-1 ? Yes.
2. Is f (x) = ex 1-1 ?
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.

Consider the following functions on R.


1. Is f (x) = x3 1-1 ? Yes.
2. Is f (x) = ex 1-1 ? Yes.
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.

Consider the following functions on R.


1. Is f (x) = x3 1-1 ? Yes.
2. Is f (x) = ex 1-1 ? Yes.
3. Is f (x) = x sin x 1-1 ?
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.

Consider the following functions on R.


1. Is f (x) = x3 1-1 ? Yes.
2. Is f (x) = ex 1-1 ? Yes.
3. Is f (x) = x sin x 1-1 ? No.
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.

Consider the following functions on R.


1. Is f (x) = x3 1-1 ? Yes.
2. Is f (x) = ex 1-1 ? Yes.
3. Is f (x) = x sin x 1-1 ? No.
4. Is f (x) = x2 1-1 ?
Injections
Definition
1. Let f be a function. f is an injection or f is injective or f is 1-1 or
f is one-to-one if f (a) = f (b) implies a = b, for any a, b ∈ domain(f ).
1-1
2. One writes f : X −→ Y if f : X −→ Y and f is 1-1.
Exercise
Is the function motherOf 1-1 ? No.
Why? Two different persons may have the same mother.

Consider the following functions on R.


1. Is f (x) = x3 1-1 ? Yes.
2. Is f (x) = ex 1-1 ? Yes.
3. Is f (x) = x sin x 1-1 ? No.
4. Is f (x) = x2 1-1 ? No.
Surjections
Definition
1. Let f be a function and let Y be a set.
f is (a surjection) onto Y if range(f ) = Y .
2. Let f be a function and let X, Y be sets.
onto
f is (a surjection) from X onto Y , denoted f : X −→ Y ,
if f : X −→ Y and f is onto Y .
The words in parentheses can be omitted.

Exercise Consider the following functions on R.


1. Is f (x) = x3 onto R ?
Surjections
Definition
1. Let f be a function and let Y be a set.
f is (a surjection) onto Y if range(f ) = Y .
2. Let f be a function and let X, Y be sets.
onto
f is (a surjection) from X onto Y , denoted f : X −→ Y ,
if f : X −→ Y and f is onto Y .
The words in parentheses can be omitted.

Exercise Consider the following functions on R.


1. Is f (x) = x3 onto R ? Yes.
Surjections
Definition
1. Let f be a function and let Y be a set.
f is (a surjection) onto Y if range(f ) = Y .
2. Let f be a function and let X, Y be sets.
onto
f is (a surjection) from X onto Y , denoted f : X −→ Y ,
if f : X −→ Y and f is onto Y .
The words in parentheses can be omitted.

Exercise Consider the following functions on R.


1. Is f (x) = x3 onto R ? Yes.
2. Is f (x) = ex onto R ?
Surjections
Definition
1. Let f be a function and let Y be a set.
f is (a surjection) onto Y if range(f ) = Y .
2. Let f be a function and let X, Y be sets.
onto
f is (a surjection) from X onto Y , denoted f : X −→ Y ,
if f : X −→ Y and f is onto Y .
The words in parentheses can be omitted.

Exercise Consider the following functions on R.


1. Is f (x) = x3 onto R ? Yes.
2. Is f (x) = ex onto R ? No.
Surjections
Definition
1. Let f be a function and let Y be a set.
f is (a surjection) onto Y if range(f ) = Y .
2. Let f be a function and let X, Y be sets.
onto
f is (a surjection) from X onto Y , denoted f : X −→ Y ,
if f : X −→ Y and f is onto Y .
The words in parentheses can be omitted.

Exercise Consider the following functions on R.


1. Is f (x) = x3 onto R ? Yes.
2. Is f (x) = ex onto R ? No.
3. Is f (x) = x sin x onto R ?
Surjections
Definition
1. Let f be a function and let Y be a set.
f is (a surjection) onto Y if range(f ) = Y .
2. Let f be a function and let X, Y be sets.
onto
f is (a surjection) from X onto Y , denoted f : X −→ Y ,
if f : X −→ Y and f is onto Y .
The words in parentheses can be omitted.

Exercise Consider the following functions on R.


1. Is f (x) = x3 onto R ? Yes.
2. Is f (x) = ex onto R ? No.
3. Is f (x) = x sin x onto R ? Yes.
Surjections
Definition
1. Let f be a function and let Y be a set.
f is (a surjection) onto Y if range(f ) = Y .
2. Let f be a function and let X, Y be sets.
onto
f is (a surjection) from X onto Y , denoted f : X −→ Y ,
if f : X −→ Y and f is onto Y .
The words in parentheses can be omitted.

Exercise Consider the following functions on R.


1. Is f (x) = x3 onto R ? Yes.
2. Is f (x) = ex onto R ? No.
3. Is f (x) = x sin x onto R ? Yes.
4. Is f (x) = x2 onto R ?
Surjections
Definition
1. Let f be a function and let Y be a set.
f is (a surjection) onto Y if range(f ) = Y .
2. Let f be a function and let X, Y be sets.
onto
f is (a surjection) from X onto Y , denoted f : X −→ Y ,
if f : X −→ Y and f is onto Y .
The words in parentheses can be omitted.

Exercise Consider the following functions on R.


1. Is f (x) = x3 onto R ? Yes.
2. Is f (x) = ex onto R ? No.
3. Is f (x) = x sin x onto R ? Yes.
4. Is f (x) = x2 onto R ? No.
Combining results of previous exercises, we have the following functions from R to R.
1. f (x) = x3 is 1-1 and onto R.
2. f (x) = ex is 1-1 but not onto R.
Combining results of previous exercises, we have the following functions from R to R.
1. f (x) = x3 is 1-1 and onto R.
2. f (x) = ex is 1-1 but not onto R.
3. f (x) = x sin x is not 1-1 but is onto R.
Combining results of previous exercises, we have the following functions from R to R.
1. f (x) = x3 is 1-1 and onto R.
2. f (x) = ex is 1-1 but not onto R.
3. f (x) = x sin x is not 1-1 but is onto R.
4. f (x) = x2 is neither 1-1 nor onto R.

Exercise
Construct examples of functions from N to N which are:
1. 1-1 and onto N.
2. 1-1 but not onto N.
3. Not 1-1 but onto N.
4. Neither 1-1 nor onto N.
Bijections

Definition
1. Let f : X −→ Y . f is a bijection between X and Y or
f is a 1-1 correspondence between X and Y or
f is a one-to-one correspondence between X and Y , denoted
1-1, onto
f :X −→ Y , if f is both one-to-one and onto Y .
In the three phrases above we can replace “between X and Y ” by
“from X to Y ” or “from X onto Y ”.

Can you give an example of a function that is a bijection from R to R?


Can you give an example of a function that is not a bijection from R to R?
Summary of definitions

Let f : X −→ Y .
1. f is an injection iff ∀x1 ,x2 ∈X (f (x1 ) = f (x2 ) → x1 = x2 ).
2. f is a surjection onto Y iff ∀y∈Y ∃x f (x) = y
3. f is a bijection between X and Y iff f is 1-1 and onto Y .

Notes
onto
f : X −→ Y f : X −→ Y
domain(f ) = X domain(f ) = X
range(f ) ⊆ Y range(f ) = Y
Horizontal line tests

Let f : R −→ R. Then,
1. f is 1-1 iff every horizontal line intersects the graph of f in at most one point.
2. f is onto R iff every horizontal line intersects the graph of f in at least one point.
3. f is a bijection between R and R iff every horizontal line intersects the graph of f
in exactly one point.

Exercise
1. Formulate vertical and horizontal line tests for functions f : X −→ Y where
X, Y ⊆ R.
2. Formulate vertical and horizontal line tests for functions visulized in discrete
Cartesian diagrams.
Exercise
True or false?
1-1
1. ∅ : ∅ −→ X ?
Exercise
True or false?
1-1
1. ∅ : ∅ −→ X ? True
Exercise
True or false?
1-1
1. ∅ : ∅ −→ X ? True
1-1, onto
2. ∅ : ∅ −→ ∅.
Exercise
True or false?
1-1
1. ∅ : ∅ −→ X ? True
1-1, onto
2. ∅ : ∅ −→ ∅. True

Fact
Every function f is onto range(f ).

Exercise
1-1
Complete: If f : X −→ Y then f is a bijection between X and ...
Character codes
1. ASCII code is a bijection between the set of ASCII characters and the integers in
the range 0 .. 27 −1, i.e 0..127. (ASCII characters include
a-z,A-Z,0-9, some punctuation marks and symbols, as well as some special
characters which do not have graphic representation but which can typed on a
computer keyboard.)
2. Extended ASCII code ISO Latin-1 is a bijection between the set of a set of
Latin-based characters of most European languages and the integers in the range
0 .. 28 −1, i.e 0 .. 255. It is an extension of the ASCII code.
3. Unicode is an injection from the set of all historic and contemporary characters
and symbols known used by humanity into the set of integers in the range
0 .. 17 · 216 , i.e. 0 .. 1,114,111. It is an extension of ISO Latin-1. Every next
version of Unicode covers more characters/symbols/glyphs but it is not a goal to
make any future version a bijection onto the range above.
Encryption and decryption fucntions

1. Such functions come in pairs.


1-1
An encryption function is any e : Strings −→ Strings.
d : Strings −→ Strings is a decryption function corresponding to e
iff for every string (message) s, d(e(s)) = s.
2. Encryption e is required to be an injection,
otherwise there could be two different messages s, s0 encrypted into the same
string, e(s) = e(s0 ), and there would be no chance to uniquely decrypt that string.
3. The conditions in item 1 imply that
decryption d must be a surjection onto Strings,
otherwise there would be a string s encrypted into e(s),
which cannot be decrypted:
if s 6∈ range(d) then d(e(s) 6= s.
Cryptographic hash functions

Password verification can be done using an encryption-like function that does not have
a corresponding decryption function. Such a function is usually not an injection and is
designed so that:
I For any string a, it is computationally easy to compute e(a);
I For any string b it is computationally infeasible to find an a s.t. e(a) = b;
I It is computationally infeasible to find a, a0 s.t a 6= a0 and e(a) = e(a0 ).
A function with these properties, is called a cryptographic hash function .
Identity verification and digital signatures

Password verification can be done as follows. The computer stores a cryptographic


hash function e (which may be known to hackers). Alice chooses a string a for a
password; the computer uses e to transform a into a string e(a) and stores only e(a)
(but not a) in association with the username “Alice”. When a user tries to log in as
“Alice” with a password a0 , the system allows it iff e(a0 ) is equal to the stored string
e(a). Notice that e(a) does not need to be decrypted in this protocol.
As the function e has properties specified above, a hacker who does not know Alice’s
password a, most likely specifies another password a0 , and it is most likely to result in a
value e(a0 ) 6= e(a), preventing the log-in. Although an a0 , s.t. e(a0 ) = e(a), may exist, it
is hard to find it, even if the hacker gained knowledge of the stored value e(a). Also
notice, that if Alice forgets her password, the computer (or system administrator)
cannot tell Alice what it was.
The same idea is used to verify authencity of messages or files via “digital signatures”.

You might also like