Mohamed G. Gouda CS 313K Fall 2012 Homework 4 1. Let A be any set. Which of the following six statements is true? can be true? or is false? (a) {} in A (b) {} sub A (c) {{}} sub A (d) {} in PS(A) (e) {} sub PS(A) (f) {{}} sub PS(A) Note that {} denotes the empty set and {{}} denotes a set that contains the empty set as an element: Sol: (a) can be true because {} can be an element in A (b) is true (c) can be true because {} can be an element in A (d) is true (e) is true (f) is true 2. Let A be the set of all real numbers other than (-1), and B the set of all real numbers. Define f:A->B be the function f(x) = 2x/(x+1). Show, by direct inference, that if f is injective. Show, by guessing, that f is not surjective. Sol: Proving that f is injective f(x) = f(y) => {Definition of f} 2x/(x+1) = 2y/(y+1) => {Arithmetics} (xy + x) = (yx + y) => {xy = yx} x = y Proving that f is not surjective Guess that there is no x such that f(x) != 2. Then, prove this fact by contradiction. f(x) = 2 => {Definition of f} 2x/(x+1) = 2 => {Arithmetics} 2x = 2(x+1) => {Arithmetics} 0 = 2 => F 3. Let f:A->B and g:B->C be two functions. Show, by direct inference, that (f is surjective) and (g is surjective) => (g.f is surjective) Sol: (z in C) => {g is surjective} (Exist y in B, g(y) = z) => {f is surjective and y in B} (Exist x in A, f(x) = y) => {Definition of "."} (Exist x in A, g.f(x) = g(f(x)) = g(y) = z) 4. Let R be the set of all real numbers and let f:R->R be the function f(x) = x^3. Show, by direct inference, that f is bijective (i.e. f is both injective and surjective). Sol: Proving that f is injective: f(x) = f(y) => {Definition of f} x^3 = y^3 => {Arithmetics} x = y Proving that f is surjective: y in R => {Let x be the real number y^(1/3)} Exist x in R, x^3 = y => {Definition of f} Exist x in R, f(x) = y 5. Let R be the set of all real numbers and let f:R->R and g:R->R be two functions. (a) Use guessing to define functions f and g such that f.g = g.f (b) Use guessing to define functions f and g such that f.g != g.f Sol: (a) Let f(x) = x and g(x) = x+1. In this case, f.g(x) = f(g(x)) = f(x+1) = x+1 g.f(x) = g(f(x)) = g(x) = x+1 Thus, f.g(x) = g.f(x) (b) Let f(x) = x^2 and g(x) = x+1. In this case, f.g(x) = f(g(x)) = f(x+1) = (x+1)^2 g.f(x) = g(f(x)) = g(x^2) = x^2 + 1 Thus, f.g(x) != g.f(x) 6. Let f:A->B be a function that has an inverse f' and let B1 and B2 be two subsets of set B. Show, by a two-sided inference proof, that f'(B1 ^ B2) = f'(B1) ^ f'(B2) Sol: x in f'(B1 ^ B2) <=> {Definition of f'} f(x) in B1 ^ B2 <=> {Definition of ^} (f(x) in B1) and (f(x) in B2) <=> {Definition of f'} (x in f'(B1)) and (x in f'(B2)) <=> {Definition of ^} x in (f'(B1) ^ f'(B2))