Docsity

Homework 3 Solutions - Constructing Proofs | CS 1050, Assignments of Computer Science

Toggle sidebar
bg1
Homework 3 Solutions
1. Take fand gsatisfying the assumptions. Notice that (we use the as-
sociativity of composition of functions/Proposition 3.2.6, Proposition
3.2.7 [in class we used it as the definition of inverses] and Pause 6 in
Section 3.2):
(g◦f)◦(f−1◦g−1) = g◦((f◦f−1)◦g−1) = g◦(ιB◦g−1) = g◦g−1=ιC
and
(f−1◦g−1)◦(g◦f) = f−1◦((g−1◦g)◦f) = f−1◦(ιB◦f) = f−1◦f=ιA.
This means that the inverse (g◦f) is equal to f−1◦g−1.2
2. Take any c∈C. Because gis surjective, there exists a b∈Bsuch that
g(b) = c. Because fis surjective, there is an a∈Asuch that f(a) = b.
But then, g◦f(a) = g(f(a)) = g(b) = c. To sum up, every element of
Cis in the range of g◦fwhich means that g◦fis onto. 2
3. Let functions fand gsatisfy the assumptions. Take any c∈C. There
exists a∈Asuch that g◦f(a) = c. But then c=g(f(a)) so cis in the
range of f(becaue it is the value of gon f(a)). This proves that gis
onto. 2
Example in which fis not surjective: Take f:{0}→{0,1}and
g:{0,1} → {0}defined by f(0) = 0, g(0) = 0 and g(1) = 0.
4. Take functions fand gsatisfying the assumptions. We’ll do proof by
contradiction. Assume fis not injective. There exist a, a0∈Asuch
that a6=a0and f(a) = f(a0). But then, g◦f(a) = g(f(a)) = g(f(a0)) =
g◦f(a0) which means that g◦fis not one-to-one. This is a contradiction
2
An example showing that gdoes not have to be injective: the same as
in problem 3.
5. (a) Assume fis reflexive. Then (by definition of reflexivity), (x, x)∈f
for any x∈R. In fact, that’s all the elements of for, more
precisely, f={(x,x)|x∈R}=ιR. To see this, notice that if
(x, y)∈fthen x=y(because (x, x)∈fand a function can have
at most one value at x). 2
(b) Assume fis surjective and transitive as a relation on R. Take
any x∈R. There exists a∈Rsuch that f(a) = xor equvalently
(a, x)∈f. We also have (x, f(x)) ∈f. By transitivity, (a, f (x)) ∈
f. But fhas a unique value for a. Therefore, f(x) = x.2
1
pf3

Partial preview of the text

Download Homework 3 Solutions - Constructing Proofs | CS 1050 and more Assignments Computer Science in PDF only on Docsity!

Homework 3 Solutions

  1. Take f and g satisfying the assumptions. Notice that (we use the as- sociativity of composition of functions/Proposition 3.2.6, Proposition 3.2.7 [in class we used it as the definition of inverses] and Pause 6 in Section 3.2):

(g ◦ f ) ◦ (f −^1 ◦ g−^1 ) = g ◦ ((f ◦ f −^1 ) ◦ g−^1 ) = g ◦ (ιB ◦ g−^1 ) = g ◦ g−^1 = ιC

and

(f −^1 ◦g−^1 )◦(g ◦f ) = f −^1 ◦((g−^1 ◦g)◦f ) = f −^1 ◦(ιB ◦f ) = f −^1 ◦f = ιA.

This means that the inverse (g ◦ f ) is equal to f −^1 ◦ g−^1. 2

  1. Take any c ∈ C. Because g is surjective, there exists a b ∈ B such that g(b) = c. Because f is surjective, there is an a ∈ A such that f (a) = b. But then, g ◦ f (a) = g(f (a)) = g(b) = c. To sum up, every element of C is in the range of g ◦ f which means that g ◦ f is onto. 2
  2. Let functions f and g satisfy the assumptions. Take any c ∈ C. There exists a ∈ A such that g ◦ f (a) = c. But then c = g(f (a)) so c is in the range of f (becaue it is the value of g on f (a)). This proves that g is onto. 2 Example in which f is not surjective: Take f : { 0 } → { 0 , 1 } and g : { 0 , 1 } → { 0 } defined by f (0) = 0, g(0) = 0 and g(1) = 0.
  3. Take functions f and g satisfying the assumptions. We’ll do proof by contradiction. Assume f is not injective. There exist a, a′^ ∈ A such that a 6 = a′^ and f (a) = f (a′). But then, g◦f (a) = g(f (a)) = g(f (a′)) = g◦f (a′) which means that g◦f is not one-to-one. This is a contradiction 2 An example showing that g does not have to be injective: the same as in problem 3.
  4. (a) Assume f is reflexive. Then (by definition of reflexivity), (x, x) ∈ f for any x ∈ R. In fact, that’s all the elements of f or, more precisely, f = {(x, x)|x ∈ R} = ιR. To see this, notice that if (x, y) ∈ f then x = y (because (x, x) ∈ f and a function can have at most one value at x). 2 (b) Assume f is surjective and transitive as a relation on R. Take any x ∈ R. There exists a ∈ R such that f (a) = x or equvalently (a, x) ∈ f. We also have (x, f (x)) ∈ f. By transitivity, (a, f (x)) ∈ f. But f has a unique value for a. Therefore, f (x) = x. 2

(c) f (x) = −x (d) f (x) = x + 1

  1. We need to prove that ≡ is reflexive, symmetric and transitive.

Reflexivity. Take x ∈ A. Since ∼ is an equivalence relation, it is reflexive, so f (x) ∼ f (x). Therefore, x ≡ x. Symmetry. Take x, y ∈ A. Assume x ≡ y. This means that f (x) ∼ f (y) Because ∼ is symmetric, f (y) ∼ f (x) and therefore y ≡ x. Transitivity. Take x, y, z ∈ A and assume x ≡ y and y ≡ z. This means that f (x) ∼ f (y) and f (y) ∼ f (z). By transitivity of ∼, f (x) ∼ f (z) so x ≡ z.

2

  1. =⇒ Assume ¹ is a partial order. Take any a, a′^ ∈ A such that f (a) = f (a′). Then, (partial orders are reflexive), f (a)£f (a′) and f (a′)£ f (a). However, this means that a ¹ a′^ and a′^ ¹ a. By antisym- metry of ¹, a = a′ ⇐= Assume f is one-to-one. We need to prove that ¹ is reflexive, transitive and antisymmetric. Reflexivity. Take any x ∈ A. By reflexivity of £, f (x) £ f (x) and therefore x ¹ x. Transitivity. Take any x, y, z ∈ A such that x ¹ y and y ¹ z. Then, f (x) £ f (y) and f (y) £ f (z). By transitivity of £, f (x) £ f (z) so x ¹ z Antisymmetry. Take any x, y ∈ A such that x ¹ y and y ¹ x. Then, f (x) £ f (y) and f (y) £ f (x). By antisymmetry of £, f (x) = f (y). By injectivity of f , x = y. 2
  2. Assume f is as described in the problem.

(a) Assume 0 ∈ A. Since f has an inverse, it is onto and therefore there is an x ∈ A with f (x) = 0. For this x, f −^1 (x) = 1/f (x) can’t hold because the right hand side is undefined. (b) Notice that, by definition of an inverse, for any x ∈ A,

x = f −^1 ◦ f (x) = f −^1 ◦ f (x) =

f (f (x))

which is equivalent to (since x 6 = 0 by part (a))

f ◦ f (x) =

x