Mohamed G. Gouda CS 313K Fall 2012 Exercise 10 1. Let f:A->B and g:B->C be two functions. Show, by direct inference, that (f is injective) and (g is injective) => (g.f is injective) Sol: g.f(x1) = g.f(x2) => {Definition of "."} g(f(x1)) = g(f(x2)) => {g is injective} f(x1) = f(x2) => {f is injective} x1 = x2 2. Let f:A->B be a function. Show, by direct inference, that (Exist g:B->A, All x in A, g.f(x) = x) => (f is injective) Sol: f(x1) = f(x2) => {g is a function} g(f(x1)) = g(f(x2)) => {Definition of "."} g.f(x1) = g.f(x2) => {All x in A, g.f(x) = x} x1 = x2 3. Let f:A->B be a function. Show, by direct inference, that (Exist g:B->A, All y in B, f.g(y) = y) => (f is surjective) Sol: y in B => {All y in B, f.g(y) = y} f.g(y) = y => {Definition of "."} f(g(y)) = y => {Let x be the element g(y) in A} Exist x in A, f(x) = y 4. Let f:A->B and g:B->C be two functions. Show, by direct inference, that (g.f is bijective) => (f is injective) and (g is surjective) Sol: Proving (f is injective) f(x1) = f(x2) => {g is a function} g(f(x1)) = g(f(x2)) => {Definition of "."} g.f(x1) = g.f(x2) => {g.f is bijective and so injective} x1 = x2 Proving (g is surjective) z in C => {g.f is bijective and so surjective} (Exist x in A, g.f(x) = z) => {Definition of "."} (Exist x in A, g(f(x)) = z) => {Let y be f(x) in B} (Exist y in B, g(y) = z) 5. Let f:A->B and g:B->C be two functions. Show, by guessing definitions for f and g, that if g and (g.f) are both onto, then f is not necessarily onto. Sol: Guess A = {x}, B = {y,y'}, f(x) = y C = {z}, g(y) = g(y') = z In this case, both g and (g.f) are onto, but f is not onto. 6. Let f:A->B be a function that has an inverse f'. Show, by direct inference, that the function (f'.f) has an inverse and that its inverse is (f'.f) itself. Sol: Proving that (f'.f) is 1-1 f'.f(x1) = f'.f(x2) => {definition of "."} f'(f(x1)) = f'(f(x2)) => {f' is 1-1} f(x1) = f(x2) => {f is 1-1} x1 = x2 Proving that (f'.f) is onto x in A => {f' is inverse of f} (f'.f)(x) = x => {property of Exist} (Exist x1 in A, (f'.f)(x1) = x) Proving that the inverse of (f'.f) is (f'.f) itself T => {Definition of "."} ((f'.f).(f'.f))(x) = (f'.f)((f'.f)(x)) => {(f'.f)(x) = x} ((f'.f).(f'.f))(x) = (f'.f)(x) => {(f'.f)(x) = x} ((f'.f).(f'.f))(x) = x 7. Let f:A->B be a function that has an inverse f', and let B1 be a non-empty subset of B. Show, by direct inference, that (f(f'(B1)) sub B1) Sol: y in f(f'(B1)) => {f(f'(B1)) = B1} y in B1 8. Let f:A->B be a function and let A1 and A2 be two non-empty subsets of A. Prove, by direct inference, that (A1 sub A2) => (f(A1) sub f(A2)) Sol: y in f(A1) => {Definition of f(A1)} Exist x in A1, f(x) = y => {A1 sub A2} Exist x in A2, f(x) = y => {Definition of f(A2)} y in f(A2) 9. Let R be the set of all real numbers and let f:R->R be the function f(x) = x^2 - 3. Show, by guessing, that f is neither injective nor surjective. Sol: Proving that f is not injective Guess: x1 = 2 and x2 = -2. Then, (f(x1) = f(x2)) and (x1 != x2). Proving that f is not surjective Note that f(x) >= -3. Thus, there is no x in R such that f(x) = -4. 10. Let R be the set of all real numbers and let f:R->range(f) be the function f(x) = 5x + 7. Show that f has an inverse f' and derive the inverse function f'. Sol: By choosing the codomain of function f to be range(f), function f is surjective. Thus, for f to have an inverse f', we need to show that f(x) is injective: f(x1) = f(x2) => {definition of f} (5*x1 + 7) = (5*x2 + 7) => {arithmetics} (x1) = (x2) Guess that f'(x) = (x-7)/5. (Hint: f(x) is defined by multiplication followed by addition. Thus, f'(x) should be defined by subtraction followed by division.) Finally, we need to show that f'.f(x) = x. The proof is by direct inference. T => {Definition of f'.f(x)} f'.f(x) = f'(f(x)) = f'(5x + 7) = ((5x + 7) - 7)/5 = x 11. Let f:A->B be a function and let A1 and A2 be two subsets of A. Show, by guessing values for A, B, f, A1, and A2, that f(A1 ^ A2) is not necessarily equal to (f(A1) ^ f(A2)). Sol: Guess: A = {1,2,3} B = {4,5} f(1) = 4, f(2) = 5, f(3) = 4 A1 = {1,2} A2 = {2,3} f(A1 ^ A2) = {5} f(A1) ^ f(A2) = {4,5} Thus, f(A1 ^ A2) != (f(A1) ^ f(A2)).