0% found this document useful (0 votes)
31 views4 pages

Functions As Relations

The document defines and discusses functions, relations, and properties of functions such as injectivity and surjectivity. It provides examples and explanations of: - What defines a relation and function - Injective, surjective, and bijective functions - How to prove statements about functions rigorously using examples - Exercises for the reader to check properties of specific functions

Uploaded by

Alaz Fofana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views4 pages

Functions As Relations

The document defines and discusses functions, relations, and properties of functions such as injectivity and surjectivity. It provides examples and explanations of: - What defines a relation and function - Injective, surjective, and bijective functions - How to prove statements about functions rigorously using examples - Exercises for the reader to check properties of specific functions

Uploaded by

Alaz Fofana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Function as Relations

Max Wong
November 14, 2023

1 Recall: Relations
A relation R between two sets A and B is a subset of A × B. If A = B, we simply say that R ⊆ A × A is a relation on A.
For example, the set R⩽ = {(x, y) ∈ R2 : x ⩽ y} is a relation on R.
For any elements a ∈ A, b ∈ B, we say that a and b are related by R if (a, b) ∈ R. A common alternative notation is a R b.
Consider the example R⩽ ⊆ R × R above. We say that 1 is related by 3 by R⩽ because (1, 3) ∈ R⩽ (or alternatively, 1 R⩽ 3).

2 Functions
A relation R between sets A and B represents a function if the following conditions are satisfied:

(1) For any a ∈ A, there exists b ∈ B such that (a, b) ∈ R


(2) If (a, b) ∈ R and (a, c) ∈ R, then b = c.

Condition (1) guarantees that the function “makes sense" when evaluated at any point in A. Condition (2) guarantees that the
output of the function is unique.
Note that R itself is not a function, but rather the graph of the function. (Geometrically, it really is the graph, if you
consider a function from a subset of R to R.)
Suppose the function f is a mapping from A to B, then its graph Rf is defined by

Rf = {(x, f (x)) : x ∈ A}

A is said to be the domain of f , and B is said to be the codomain of f .


For example, consider A = {1, 2, 3, 4} and B = {1, 2, 3}. In each of the following examples, the relation is a relation between A
and B.

• The relation f1 = {(1, 1), (2, 2), (3, 1), (4, 2)} represents a function because it satisfies both (1) and (2). (Please take some
time to check it and convince yourself this is true.)

• The relation f2 = {(1, 1), (2, 1)} does not represent a function because it violates condition (1). However, if we consider
f2 as a relation between A′ = {1, 2} and B = {1, 2, 3, 4}, it is a function.
• The relation f3 = {(1, 1), (1, 2), (2, 1), (3, 3)} does not represent a function because it violates condition (2). (f3 maps
1 to 1 and 1 to 2 at the same time, which is not allowed. A function must only map each element of its domain to one
element of its codomain.)

3 Injective functions and surjective functions


Let A and B be sets and f : A → B be a function. Let Rf be its graph.

• f is said to be injective (also called “1-1"), if f (x1 ) = f (x2 ) implies x1 = x2 .


• f is said to be surjective (also called “onto"), if for any y ∈ B, there exists x ∈ A such that f (x) = y.

Using graphs to describe the above two:


• f is said to be injective if (x1 , y) ∈ Rf and (x2 , y) ∈ Rf implies x1 = x2 .
(Note the subtle differences of this and condition (2) in the definition of function.)

1
• f is said to be surjective if for any y ∈ B, there exists x ∈ A such that (x, y) ∈ Rf .
(Note the subtle difference of this and condition (1) in the definition of function.)
In natural language, the definition of “surjective" says for any possible output, there exists an input that gives the output,
and the definition of “injective" says that the function maps distinct elements of A to distinct elements of B.
Graphically, the graph of an injective function never repeats its y-coordinate, and a the graph of a surjective function passes
through any y-coordinate in B.
As an example, consider the function f : R → R, f (x) = x2 . The following diagram shows the graph of this function.

• f is not injective because there is a horizontal line that cuts through the graph more than once, that is, it has repeated
in terms of y-coordinate.
• f is not surjective either, because the graph does not have a point with y-coordinate −1, and −1 is in the codomain R.
We now restrict the domain of the function. Define g : R⩾0 → R by g(x) = x2 , where R⩾0 denotes the set {x ∈ R : x ⩾ 0}. (If
you can read interval notation, it is also equal to [0, +∞).) The figure below shows the graph of that function.

Note that this time we are not considering anything on the left of the y-axis, that is, we restrict our domain to “on the y-axis
and the right of y-axis.

2
Changing the domain or codomain could change whether the function is injective and surjective, although the definition is still
x2 . We can see that:

• g is injective because any horizontal line cuts g at one point only.


• g is still not surjective because the graph still does not contain a point with y-coordinate −1.

Now we restrict the codomain to R⩾0 as well. Define h : R⩾0 → R⩾0 by h(x) = x2 . The following diagram shows the graph of
y = h(x).

Now we only consider the portion of the graph that is in the first quadrant. We see that

• h(x) is injective.
• h(x) is surjective.

This is left as an exercise. For functions that are both injective and surjective, we call them bijective functions.

4 Rigorous proofs
So far, we have just been identifying properties of the functions, but we are yet to rigorously give a proof to our claims. In
this section, we briefly look at how to prove statements. We look at three proof problems and the methods used to tackle
them.
Example 1. Let the mapping f : {1, 2, 3} → R be defined as f (x) = x. Show that f is a injective function, but not a
surjective function.
We first show that f is a function, and we do that by checking conditions (1) and (2). After that, we check that f is injective.
Then, we find an example to prove that f does not map to every value in R. Logically if we can find a value that f does not
map to, we can prove that f does not map to all elements in R, that is, f is not surjective.
Proof. Consider the graph Rf of f . Then Rf = {(1, 1), (2, 2), (3, 3)} by definition.
Note that for any a ∈ {1, 2, 3}, there exists b = a ∈ R such that (a, b) = (a, a) ∈ Rf .
Then condition (1) is satisfied.
Suppose (a, b) ∈ R and (a, c) ∈ R.
Since f (a) = a, we have b = a and c = a.
Then it must be true that b = c, since they are both equal to a.
Condition (2) is also satisfied.
Therefore, f is a function.
We check that f is injective.
Pick any x1 , x2 ∈ A and suppose f (x1 ) = f (x2 ).
By definition of f , x1 = x2 .
Therefore, f is injective.
We check that f is not surjective.
Pick y = 4 ∈ R.
Since {(x, 4) : x ∈ {1, 2, 3}} ∩ Rf = ∅, f is not surjective.
(In natural language, this means there is no pair that looks like (x, 4) in Rf , where x is an element of {1, 2, 3}.)

3
We look at a slightly more complicated example.
Example 2. Let S be be a set. Let f : P (S) → P (S) be the mapping defined as f (A) = Ā, where ¯(A) = S\A. Show that f is
a bijective function.
(If you did not know, P (S) is the set of all subsets of S, for example, if S = {1, 2}, then P (S) = {∅, {1}, {2}, {1, 2}}. So, an
element in P (S) is a subset of S.)
Proof. Pick any A ∈ P (S).
Note that for any x ∈ S\A, x ∈ S and x ∈ / A.
In particular, x ∈ S.
Therefore, S\A ⊆ S.
Hence, f (A) ∈ P (S).
Therefore, for any A ∈ P (S), there exists Ā ∈ P (S) such that (A, Ā) ∈ Rf . Condition (1) is satisfied.
Suppose (A, B) ∈ Rf and (A, C) ∈ Rf .
Since B = ¯ {A} = C, B = C. Condition (2) is satisfied.
Therefore, f is a function.
We check that f is injective.
Let A, B ∈ P (S) and suppose f (A) = f (B). Then S\A = S\B.
Therefore, S\A ⊆ S\B and S\B ⊆ S\A.
Since S\A ⊆ S\B, for any x ∈ S\A, we have x ∈ \B.
Therefore, if x ∈ S and x ∈ / A, then x ∈
/ B. The contrapositive of this statement is “if x ∈ B, then x ∈ A."
Therefore, B ⊆ A.
Similarly, by considering S\B ⊆ S\A, we have A ⊆ B.
Since A ⊆ B and B ⊆ A, A = B. Therefore, f is injective.
We check that f is surjective. Pick any A ∈ P (S). Then f (A) ∈ P (S) as we have checked in condition (1).
Note that f (f (A)) = S\A = A.
Therefore, for any A ∈ P (S), there exists B = f (A) ∈ P (S) such that f (B) = A.
Therefore, f is surjective.
Hence, f is a bijective function.
Now you should be able to prove statements about functions, injective functions, and surjective functions.
As a quick summary,

• If you need to prove that a mapping is a function, show conditions (1) and (2) hold for that mapping.
• If you need to prove that a function f is injective, you start by picking elements a, b from the domain and supposing
f (a) = f (b), then reach a = b by operations.
• If you need to prove that a function f is surjective, you start by picking an element y from the codomain, and manually
find an element x (in terms of y) from the domain so that f (x) = y.

• If you need to prove that a function f is not injective, you find a counterexample, that is, two distinct elements a, b
from the domain such that f (a) = f (b).
• If you need to prove that a function f is not surjective, you find a counterexample, that is, an element y from the
codomain, such that no elements from x satisfies f (x) = y.

5 Exercises
1. Check that the function h : R⩾0 → R⩾0 defined by h(x) = x2 is bijective.
2. Let f : {1, 2, 3} → {1, 2, 3} be defined by f (1) = 1, f (2) = 3, f (3) = 2.

(a) Write down the graph Rf of f .


(b) Prove that f is a bijective function.
3. Let A = {1, 2, 3, 4} and B = {4, 5, 6}. Define a function f : P (A) × P (B) → P (A ∪ B) by f ((X, Y )) = X ∪ Y .
(a) Determine whether f is injective or not. Prove your assertion.
(b) Determine whether f is surjective or not. Prove your assertion.

You might also like