1

enter image description here

In this example that I have created, f and g are both surjective and total (total is a requirement for both f and g in this question) and the composite is bijective meaning it is injective. Is this a counter-example?

Context: Im studying cs first year in uk and one of the modules is discrete maths

M G
  • 39
  • 1
    You are messing up domains. To even write $g\circ f$ you would need the domain of $g$ to be the target of $f$. Even then, the question would be : "is $g\circ f$ injective" on the whole domain ${A, B, E}$. Is this making sense to you? – Daniel Teixeira Dec 12 '22 at 16:21
  • No but ill read it again and come back to your comment – M G Dec 12 '22 at 16:23
  • Not a duplicate, but just for reference, some answers to the following question are proofs of the statement in the title: https://math.stackexchange.com/q/1274914/139123 – David K Dec 13 '22 at 03:34

2 Answers2

8

I think you need to look a bit more thoroughly into exactly how $\circ$ works. I'm sure it could've worked the way you describe, but history and tradition has made it not work that way.

To be more explicit, in order for $g\circ f$ to make sense, the image of $f$ (some might even say the codomain) needs to be inside the domain of $g$. For instance, since $f(B)$ makes sense, we need $g(f(B))$ to make sense. Which is to say, $g(D)$ needs to exist. If $f(B)$ exists but $g(f(B))$ doesn't exist, then $g\circ f$ doesn't exist.

Arthur
  • 199,419
3

Suppose $f$ is not injective. Then there exist some $x_1$ and $x_2$ with $x_1\neq x_2$ such that $f(x_1)=f(x_2)$.

It follows then that $g(f(x_1))=g(f(x_2))$ and so by definition $(g\circ f)(x_1)=(g\circ f)(x_2)$ and therefore $(g\circ f)$ is also not injective.

That is to say, if $g\circ f$ is injective then $f$ must also be injective.

JMoravitz
  • 79,518