Equivalence of Definitions of Surjection

Definition 1 implies Definition 2
Let $f$ be a mapping which fulfils the condition:
 * $\forall y \in T: \exists x \in \operatorname{Dom} \left({f}\right): f \left({x}\right) = y$

From Image is Subset of Codomain:
 * $\operatorname{Im} \left({f}\right) \subseteq T$

It remains to be proved that:
 * $T \subseteq \operatorname{Im} \left({f}\right)$

Thus:

Thus by definition of set equality:
 * $\operatorname{Im} \left({f}\right) = T$

and by definition of image of mapping:
 * $f \left[{S}\right] = T$

Hence $f$ is a surjection by definition 2.

Definition 2 implies Definition 1
Let $f$ be a mapping which fulfils the condition:
 * $f \left[{S}\right] = T$

that is:
 * $\operatorname{Im} \left({f}\right) = T$

Then by definition of set equality:
 * $T \subseteq \operatorname{Im} \left({f}\right)$

Hence:

So by the definition of the image of $f$:
 * $\exists x \in \operatorname{Dom} \left({f}\right): f \left({x}\right) = y$

Hence $f$ is a surjection by definition 1.