7.2 One-to-One, Onto, and Inverse Functions
Definitions
- Let F be a function from a set X to a set Y. F is one-to-one
(or injective) if and only if for all elements x1
and x2 in X,
- if F(x1) = F(x2), then x1 = x2
- (or equivalently) if x1 ≠ x2 then
F(x1) ≠ F(x2)
- Symbolically: F: X → Y is one-to-one ↔ ∀
x1, x2 ∈ X, if F(x1) =
F(x2) then x1 = x2
- Let F be a function from a set X to a set Y. F is onto
(or surjective) if and only if given any element y in Y,
it is possible to find an element x in X with the property
that y = F(x).
- Symbolically: F: X → Y is onto ↔ ∀ y ∈ Y,
∃ x ∈ X such that F(x) = y
- A one-to-one correspondence (or bijection) from a
set X to a set Y is a function F: X → Y that is both
one-to-one and onto
Proof Techniques
Suppose f is a function defined on an infinite set X
- To prove f is one-to-one, (1) suppose x1 and x2
are elements of X such that f(x1) = f(x2),
and then (2) show that x1 = x2
- To prove that f is not one-to-one, find x1 and x2
in X so that f(x1) = f(x2) but x1
≠ x2.
- To prove f is onto, (1) suppose that y is any element of Y and then
(2) show that there is an element x in X with F(x) = y
- To prove that f is not onto, find an element y of Y
such that y ≠ F(x) for any x in X
One-to-One Data Structure Application
- Hash Function: A function defined from a larger, possibly infinite,
set of data to a smaller fixed-size set of integers.
- Note: Hash functions are not guaranteed to be one-to-one so a
collision resolution strategy is needed.
Theorem 7.2.2
Suppose F: X → Y is a one-to-one correspondence; in other words,
suppose F is one-to-one and onto. Then there is a function F-1:
Y → X that is defined as follows: Given any element y in Y,
- F-1(y) = that unique element x in X such that F(x) equals y
- Equivalently, F-1(y) = x ↔ y = F(x)
The function F-1 is called the inverse function for F.
Theorem 7.2.3
If X and Y are sets and F: X → Y is one-to-one and onto,
then F-1:Y → X is also one-to-one and onto.
In Class Exercises
- 6a. Let X = {1, 5, 9}, Y = {3, 4, 7}, f(1) = 4, f(5) = 7 and f(9) = 4.
Is f one-to-one? Is f onto? Explain your answers.
- 10a. Define f: Z → Z by the rule f(n) = 2n
for every integer n. Is f one-to-one? Is f onto? Prove or give
a counterexample.
- 26. Define S: Z+ → Z+ by
the rule: For each integer n, S(n) = the sum of the positive divisors
of n. Is S one-to-one? Is S onto? Prove or give a counterexample.
- 44. Is function f in 6a a one-to-one correspondence? If so,
find f-1. If not modify it to be a one-to-one correspondence
and then find f-1
A Few Set Applications (Chapter 6)
- Data Structures (CSCI 132, CSCI 232, CSCI 432)
- Databases (CSCI 440)
- Machine Learning (CSCI 446)
- Formal Languages (CSCI 338)