Exercises on functions
Exercise 1. Let A = {1,2,3} B = {0,1} determine all functions. Which are injectives, surjectives and bijectives?
The total number of functions from set A to set B containing m and n elements, repsectively is nm, so 8 functions.
f1 = {(1,0), (2,0), (3,0)}; f2 = {(1,1), (2,0), (3,0)}; f3 = {(1,1), (2,1), (3,0)}; f4 = {(1,1), (2,1), (3,1)}; f5 = {(1,0), (2,1), (3,0)}; f6={(1,0), (2,1), (3,1)}; f7 = {(1,1), (2,1), (3,1)}; f8 = {(1,0), (2,0), (3,1)}; no one is injective.
f1, f2, f3, f5, f6, f7 are surjectives.
From B to a A there are 32 = 9 functions. No one is surjective. Execption made for f1 = {(0,1), (1,1)}, f2={(0,2), (1,2)}, f3 = {(0,3),(1,3)} the other 6 functions are all injectives
Exercise 2. Let f and g two injective functions (surjective) respectively from A to B and from B to C. Prove that g ∘ f is as well injective (surjective). Deduce that the composition of bijective functions is bijective.
Solution. We must prove (g ∘ f)(a) = (g ∘ f)(a') implies a = a'. (g ∘ f)(a) = g(f(a)) = g(f(a')). Since g is injective it follows that f(a) = f(a'). Since f is injective we have a = a'.
To prove that (g ∘ f): A → C is surjective, we need to prove that ∀c ∈ C, ∃ a∈ A such that (g ∘ f) (a) = c. Let c be any element of C. Since g: B → C is surjective, ∀c ∈ C, ∃ b ∈ B such that g(b) = c. Since f: A→B is surjective, ∀b ∈ B, ∃a ∈ A such that f(a) = b. So, (g ∘ f)(a) = g(f(a)) = g(b) = c. This completes the proof. Since the function is both injective and surjective is also bijective.
Exercise 3. Let f,g h application respectively from A to B, from B to C and from C to D. Prove that
h∘(g ∘ f) = (h ∘ g) ∘ f
Proof. We have to prove that ∀x ∈ A, (h∘(g ∘ f))(x) = ((h ∘ g) ∘ f)(x). Indeed we have (h∘(g ∘ f))(x) = h((g∘f)(x)) = h(g(f(x)) and ((h∘g)∘f)(x) = (h ∘ g)(f(x)) = h(g(f(x))).
Exercise 4. Let A = B = ℤ, determine which of the following relation are graphic of functions
{(a, b) ∈ ℤ x ℤ | a+b = 2};
{(a, 3) | a ∈ ℤ};
{(1 ,b) | b ∈ ℤ};
{(a, a2) | a ∈ ℤ};
{(a + 1, a | a ∈ ℤ}
{(a, |a| | a ∈ ℤ}
{|a|, a) |a ∈ ℤ}
Exercise 5. Sepcify if the fuctions of the previuos exercise are injective, and/or surjective and express their image. If bijective determine the inverse function.
a) injective and surjective Im = ℤ;
b) neither injective nor surjective. Im = 3;
d) neither injective nor surjective Im = ℕ.
e) injective and surjective Im = ℤ;
f) neither injective nor surjective Im = ℕ;
Let A and B two non-empty sets e and let f a function from A to B. A function from B to A is known as left inverse (right inverse) of f, if g ∘ f = iA (f ∘ g = iB). Prove that f has left inverse if and only if is injective and, f has right inverse inf and only if is surjective.
Solution. Suppose g ∘ f = iA holds true then if f(a1) = f(a2) we have g(f(a1)) = g(f(a2)) then a1 = a2 ⇒ f is injective.
Conversely suppose that f is injective. We define g: B ⟶ A in this way: If y ∈ B and y = f(x) and g(y) = x. By injectivity this x is unique If y is not an element of the range of f, we define g so that g(b) = x0 with x0 ∈ A. Now g is defined for all y ∈ B and g(f(x)) = x by definition of g, so g is a left inverse.
If f has a right inverse f(g(b)) = b, ∀b ∈ B, then f is surjective. Conversely suppose f is surjective, given an b ∈ B there exists at least an a such that f(a) = b. Define g such that g(b) = a, with a an element such that f(a) = b. We have (f ∘ g)(b) = iB = f(g(b)) = f(a) = b ∀b ∈ B thus f ∘ g = iB.
Exercise 6. Let f: ℂ ⟶ ℝ+ the application from complex number to positive real numbers defined by f(a + ib) := a2 + b2. Verify if there exists a function g: ℝ+ ⟶ ℂ such that f ∘ g = idR+ or a g': ℂ ⟶ ℝ+ such that g' ∘ f = idR+. Determine the function g or g' in case such a functions exists.
Solution. It is a surjective function but not injective hence there will be only a right inverse. To determine a g: ℝ+ ⟶ ℂ such that f ∘ g = idR+, it is sufficient to set r > 0, g(r) = √r. We have f(g(r)) = f(√r) = r, ∀r ∈ R+.
Let f a function between A and A' with X and Y two subsets of A and A'. Prove the following statements:
f(X ∪ Y) = f (X) ∪ f(Y)
f(X ∩ Y) = f (X) ∩ f(Y)
f−1(X' ∪ Y') = f−1 (X') ∪ f−1(Y')
f−1(X' ∩ Y') = f−1 (X') ∩ f−1(Y')
Solution.(a). a ∈ f (X) ∪ f(Y) ⇐⇒ a ∈ f(X) or a ∈ f(Y) ⇐⇒ [a = f(x) for some a ∈ X or a = f(y) for some y ∈ Y] ⇐⇒ a = f(t) for some t ∈ X ∪ Y ⇐⇒ a ∈ f(X ∪ Y).
(b). a ∈ f(X ∩ Y) ⇒ a = f(c) for some c ∈ X ∩ Y. Thus a ∈ f(X) and a ∈ f(Y) that is a ∈ f(X) ∩ f(Y).