I'm reading through Basic Algebra I (which I enjoy so far. Thoughts on this for self-studying?) and am having a difficult time proving surjection. I believe I understand the concept, but when it comes to the proof I'm not sure how I'm supposed to prove it. Is this an acceptable proof, or is it at least part of the final proof?
$f$ and $g$ are surjective $\implies f \circ g$ surjective
Known: $$\forall y\in Y, \exists x \in X \mid y = f(x)$$ $$\forall z\in Z, \exists y \in Y \mid z = g(y)$$
Therefore: $$\forall y\in Y \texttt{ and }\forall z\in Z, \exists x \in X \mid y = f(x), z = g(y) = g(f(x)) = (g \circ f)(x)$$
So I guess the final line should be:
$$\forall z \in Z, \exists x \in X \mid z = (g \circ f)(x)$$
P.S. This is my first post here, so hopefully the style isn't too bad.
EDIT: What if I included an extra set that includes the members of Y that exist for z = g(y)?
$$A = \{ y \in Y \mid z = g(y)\}$$ $$\forall y_A \in A, z \in Z, \exists x \in X \mid y = f(x) \texttt{ and } z = g(y_A) = g(f(x))$$
$$\forall z \in Z, \exists x \in X \mid z = g(f(x))$$
(Perhaps I'm not explaining it right)
It is not correct to say that $$\forall y\in Y \texttt{ and }\forall z\in Z, \exists x \in X \mid y = f(x), z = g(y) = g(f(x)) = (f \circ g)(x)$$ You cannot guarantee that $z=g(y),\forall y,z$. For example, let $X=Y=Z$ and $f,g$ be the identity map. It is clearly incorrect that $\forall y,z(\exists x(y=x,z=y=x))$.
Instead, argue through inference rules of predicative logic, like universal instantiation and existential instantiation: $$(\forall z\in Z(\exists y \in Y (z = g(y)))) \\\Rightarrow (\exists y \in Y (z_v = g(y))) \\\Rightarrow z_v=g(y_0) $$ and universal instantiation and existential instantiation: $$(\exists x \in X (y_0 = f(x))) \\\Rightarrow (y_0 = f(x_0)) $$
hence $z_v=g(f(x_0)$. Then existential generalization and universal generalization: $$(\exists x \in X (z_v=g(f(x)) \\\Rightarrow \forall z \in Z(\exists x \in X(z=g(f(x))) $$
This is basically a rigor version of human intuition.