[Math] Suppose $f: A\rightarrow B,g:B\rightarrow C, h:B\rightarrow C$. Pro that If $f$ is onto $B$ and $g\circ f$= $h\circ f$, then $g=h$

discrete mathematicselementary-set-theoryproof-writing

Suppose that $f: A\rightarrow B,g:B\rightarrow C, h:B\rightarrow C$.

Prove that If $f$ is onto $B$ and $g\circ f$= $h\circ f$, then $g=h$

Could anyone please give some guideline on how to solve this proof. Thanks

Best Answer

Here is my attempt and logic on how I would solve this problem. Please bear with me since I'm just giving an educated guess on how to solve it. Thanks.

Based on the definition of $g\circ f$: $(x,z)\in A\times C$| $\exists y \in B$ s.t $f(x)=y$ and $g(y)=z$

I can gather that there must be elements $(y,z)\in g$ which also should be in $h$.

Then my proof would start like this:

Let $(y,z) \in g$

Since $f$ is onto $B$, then $\exists x \in A $ s.t $(x,y) \in f$

Now there must be $(x,z) \in g\circ f$

Since $g\circ f$ = $h\circ f$

then $(x,z) \in h\circ f$

So, $ \exists w \in B$ s.t $(x,w) \in f$ and $(z,w) \in h$

Then $f(x)=y$ and $f(x)=w$

So $y=w$

Therefore $h(y)=z$ , so $(y,z) \in h$