2

I am a undergraduate majoring in CS. In preparation for a discrete mathematics exam coming up next week, I am looking through problems I got wrong on the homework. A concept I don't understand are surjections, injections, and bijection. From lecture, for a function to be a bijection, it has to be both an injection and a surjection. So say I proved a function is not a surjection, why couldn't I say that it has to be injection since we know it can't be a bijection by definition?

So my homework problem is in the link below.

Assignment

Problem 4.26. Let $A$, $B$, and $C$ be sets and let $f\colon B\to C$ and $g\colon A\to B$ be functions. Let $h\colon A\to C$ be the composition, $f\circ g$, that is, $h(x)::=f(g(x))$ for $x\in A$. Prove or disprove the following claims.

  • (a) If $h$ is surjective, then $f$ must be surjective.
  • (b) If $h$ is surjective, then $g$ must be surjective.
  • (c) If $h$ is injective, then $f$ must be injective.
  • (d) If $h$ is injective and $f$ is total, then $g$ must be surjective

I got a) True b) False c) True d) False

When the answer is supposed to be a) True b) false c) false d) true

I think the reason why I got them wrong is because I assumed that if a function is not surjective, then it has to be injective and vice versa. Could someone help me understand this concept? That would be much appreciated!

Alex Li
  • 21
  • Try to come up with an example for $(c)$. A simple one will do ($A,B,C$ finite). By $f$ total do you mean it's defined for all elements of $B$? If so, to prove $(d)$, take $x,y\in A$ such that $g(x)=g(y)$. You need to show that $x=y$. – Reveillark Sep 21 '16 at 02:26
  • It is certainly possible to have a function that is not injective, surjective, or bijective. Do you understand the concepts for functions from finite sets to finite sets? –  Sep 21 '16 at 02:28
  • Some general advice for asking questions on this site: 1) It is better to ask single question in one post. (Your post contains 4 different questions.) 2) It is good to search before asking. (I'd guess that there already are some posts about this on this site.) 3) It is good to explain your terminology. (The last part mention total function. Does this mean that in the first three subquestions you can possible work with partial functions?) See also: How to ask a good question? – Martin Sleziak Sep 22 '16 at 01:05
  • For the parts dealing with injective functions you can have a look at these past questions: http://math.stackexchange.com/questions/63552/composite-functions-and-one-to-one or http://math.stackexchange.com/questions/229065/if-f-circ-g-is-onto-then-f-is-onto-and-if-f-circ-g-is-one-to-one-then-g or http://math.stackexchange.com/questions/845284/if-g-circ-f-is-injective-so-is-g http://math.stackexchange.com/questions/442510/example-of-an-injective-function-g-and-function-f-such-that-g-circ-f-is-no – Martin Sleziak Sep 22 '16 at 01:07
  • For the parts dealing with surjective functions, you can have a look at: http://math.stackexchange.com/questions/777132/proving-a-function-is-surjective-given-the-composition-is-surjective http://math.stackexchange.com/questions/229065/if-f-circ-g-is-onto-then-f-is-onto-and-if-f-circ-g-is-one-to-one-then-g http://math.stackexchange.com/questions/1274914/show-that-if-g-circ-f-is-injective-then-so-is-f http://math.stackexchange.com/questions/75880/if-g-circ-f-is-the-identity-function-then-which-of-f-and-g-is-onto-and-w and perhaps also http://math.stackexchange.com/questions/1705016 – Martin Sleziak Sep 22 '16 at 01:12
  • Formatting tips here. – Em. Sep 24 '16 at 08:37

2 Answers2

0

I think the simplest way to identify things like this as false (in those cases that are false) is to find counterexamples in sets of perhaps two or three members.

One of the statements says "If $h$ is injective, then $f$ must be injective." $$ A=\left\{ \begin{array}{c} 1 \\ 2 \\ 3 \end{array} \right\} \overset{g} \longrightarrow B = \left\{ \begin{array}{c} a \\ b \\ c \\ d \end{array} \right\} \overset{f} \longrightarrow C = \left\{ \begin{array}{c} p \\ q \\ r \end{array} \right\} $$ $$ \begin{array}{rr} f(1) = a, & g(a) = p, \\ f(2) = b, & g(b) = q, \\ f(3) = c, & g(c) = r, \\ & g(d)= r. \end{array} $$ Then $f\circ g$ is injective and $f$ is not injective. And $f\circ g$ is surjective although $g$ is not surjective.

"If $h$ is surjective, then $f$ must be surjective." That one is true. If $f$ didn't map some member of $B$ to $c$, then neither would $f\circ g$.

"If $h$ is injective and $f$ is total, then $g$ must be injective." As most mathematicians define "function", all functions are "total", but in computer science it is necessary to consider total and partial functions. I take "$f$ is total" to mean it is well defined at every member of $B$ rather than only some of them. If $g$ is not injective, then it takes two members of $A$ to the same member of $B$; say $g(1)=g(2)=a$. Since $f$ is total, $f(g(1))$ and $f(g(2))$ both exist, and they must be equal since $g(1)=g(2)$. Therefore $h$ would not be injective.

Epilogue:

I once heard a confused undergraduate say "onto is the opposite of one-to-one." That of course is nonsense, but there is a deeper sense in which something similar is true. Suppose $$ g: A \longrightarrow B $$ (and that means $g$ is a total function) and for subsets $B_1\subseteq B$, let $g^{-1}(B_1) = \{ a\in A: g(a)\in B_1 \}$. There is no need for an inverse function $g^{-1}$ to exist for this to be well defined. Let $k(B_1) = g^{-1}(B_1)$, so $k$ is a function from the set of all subsets of $B$ into the set of all subsets of $A$. Then: \begin{align} g \text{ is injective if and only if } k \text{ is surjective.} \\[6pt] g \text{ is surjective if and only if } k \text{ is injective.} \end{align}

0

A function $f:A\rightarrow B$ can be classified in two categories:

  1. a)$f$ is one-one (injection)

    b) $f$ is many-one.


  1. a) $f$ is onto (surjection)

    b)$f$ is into.


Now, cases (a) and (b) of either category are mutually exclusive while categories $1$ and $2$ are independent.

Nitin Uniyal
  • 7,946