I am now self-studying Terence Tao's Analysis 1. I am trying to solve all of the exercises. The question I have a problem with is
Let $f: X\rightarrow Y$ and $g:Y\rightarrow Z$ be functions. Show that if $g\circ f$ is injective, then $f$ must be injective. Is it true that $g$ must also be injective?
I solved the first part and tried to do the second part, but I could not solve it. I checked the solutions, and it was explained with a counterexample. However, as a practice, I tried to do it using contradiction. This is what I got so far.
Suppose $f$ is injective and $g$ is not injective. By definition, $\exists y,y'\in Y s.t. y\neq y'$ with $g(y)=g(y')$ and if $x\neq x'$ then $f(x)\neq f(x')$.
Pick $y,y'\in Y$ such that $y\neq y'$ with $g(y)=g(y')$. Using axiom of substitution, $g(f(x))=g(f(x'))$. Since $y\neq y'$ implies $x\neq x'$ by definition, $g\circ f$ with $x,x'$ as inputs have same outputs. Therefore, $g\circ f$ is not injective, which is a contradiction. So, $g$ should also be injective.
I am unsure which part has errors since it should be '$f$ injective only.' I guess that I cannot use the axiom of substitution for objects that are not equal. Is there any way that I can prove this without using a counterexample?
Thank you in advance.

- 53,687

- 13
-
8I suggest: study the counterexample you were given. Go through your argument line by line using that example until you spot the error. – lulu May 31 '23 at 14:40
-
1Your use of axiom of substitution is wrong. $f(x) \neq f(x')$ so you don't get $g(f(x)) = g(f(x'))$ directly through the axiom. You also can't use the axiom through $y = f(x), y' = f(x')$ (leveraging the non-injectivity of $g$) because you don't know those equalities either. – balddraz May 31 '23 at 14:46
-
3[This is intended as a helpful comment.] It seems to me to be perverse to prove that "$g$ need not be injective" by any other method than finding an example. If you are learning mathematics you should be learning that this cries out for an explicit example. – ancient mathematician May 31 '23 at 14:47
-
Thank you so much for all the helpful comments on pointing out my errors, giving suggestions, and even a piece of advice! I think my sequence of logic is messed up according to 0XLR. I will expose myself to more exercises :) – slowpoke May 31 '23 at 14:50
-
If the primary intention of your question is to get comment on your own solution (or attempt), then you should use the tag ([tag:solution-verification]). See also the corresponding tag-info. – Martin Sleziak Jun 01 '23 at 09:56
-
If $|Y| \le 1$, then $g$ must be injective. – Gribouillis Jun 01 '23 at 09:59
2 Answers
If you read carefully your attempt, you are in fact proving this:$\newcommand{\inv}[1]{{#1}^{-1}}$
Claim. If $g\circ f$ is injective and $f$ is surjective, then $g$ is injective.
Notice, that you have replaced $y$ by $g(x)$ and $y'$ by $g(x')$. But for this you need to now whether there actually exists some element $x\in X$ fulfilling $y=g(x)$. (And the same for $y'=g(x')$.) If you add the assumption that $g$ is surjective, that would be enough to make this step correct.
The fact that this claim is valid should not be surprising. Injectivity of $g\circ f$ implies that $f$ is injective. If you add that $f$ is also surjective, you get that $f$ is a bijection. So there exists an inverse $\inv f$. And you get that $$g=(g\circ f)\circ \inv f,$$ so it is a composition of two injective functions. Thus $g$ is injective.
And even without writing down the formal proof, it should not be surprising that if you composing a function with a bijective function does not influence injectivity. (And the same is true for surjectivity.)
Some questions related to the original problem:

- 53,687
-
I see it now. Because of "But for this, you need to know whether there actually exists some element ∈" this part, I am assuming the surjectivity of $f$. Thank you for your detailed answer! – slowpoke Jun 03 '23 at 02:59
I would say that g is not always injective because it depends of the domain and of the codomain. Look at this counterexample:
g: R → R , g(x) = |x|
f: N → N, f(x) = 2x + 1
f is injective, g∘f is injective, but g is not.

- 11
-
1The OP is already aware of the existence of counterexamples. – José Carlos Santos Jun 04 '23 at 16:35