I'm studying for my discrete math exam and I'm having some trouble understanding this practice problem and solution. I know what surjective functions are, but I can't really understand the way this trait is proved in this example, especially the purpose of the ending exist statement. Could someone translate the steps to plain English for me?
3. Let f:A->B be a function. Show, by direct inference, that
(Exist g:B->A, All y in B, f.g(y) = y) => (f is surjective)
Sol:
y in B
=> {All y in B, f.g(y) = y}
f.g(y) = y
=> {Definition of "."}
f(g(y)) = y
=> {Let x be the element g(y) in A}
Exist x in A, f(x) = y
Thanks.
Suppose $f:A\to B$, and suppose that $g:B\to A$ is such that for all $y\in B$, $f(g(y)) = y$. We want to show $f$ is surjective. So choose $y\in B$, and consider $g(y)\in A$. Since $f(g(y)) = y$ by hypothesis, $g(y)$ is an element of $A$ whose image is $y$, so that $f$ is surjective.