How do I define Injective/Surjective functions in terms of sets and not the elements within them? I am in a Proof writing class and we are currently on functions. I have a good understanding of what it means to be injective or surjective in terms of elements in the set but I am having trouble coming up with a formal definition that just generalizes the definitions in terms of sets using an iff statement.
So if we have a function  $f: A\rightarrow B$
Would my statement be considered a proper theorem?
If $G\subseteq B$ then  $f: A\rightarrow B$  is surjective if and only if  $G=B$ and $f(f^{-1}( B)) = B$.
My reasoning here being that if our function is surjective everything in B has to have some pre-image in A. I am not sure If I need to say anything about A.
For Injective I came up with a similar theorem:
If $H\subseteq A$ then $f: A\rightarrow B$ is injective if and only if $A=H$ and $f(f^{-1}(A))=A$
My reasoning again being we need everything in our domain to have some image in B. So our domain subset must take on the whole set A.
Your help and knowledge would be extremely appreciated!
 A: Here is a pair of categorical definitions:
A function $m:Y \to Z$ is injective, iff for all functions $a,b$ with codomain $Y$,
$$m \circ a = m \circ b \implies a = b$$
A function $e:X \to Y$ is surjective, iff for all functions $f,g$ with domain $Y$,
$$f \circ e = g \circ e \implies f=g$$
A: For the surjective definition, the $G$ is irrelevant. It just must verify that $f(f^{-1}(B))=B$, or simpler, just that $f(A)=B$.
For the injective definition, you can write it as:
$\forall H,N\subseteq A$, $f(H)=f(N) \implies H=N$.
A: It's not very clear exactly what you are looking for, but the following are very useful "element-free" characterisations of injectivity and surjectivity:

*

*$f : A \to B$  is injective iff it has a left inverse, i.e, iff there is a function $g: B  \to A$ such that $g \circ f = f$ (i.e., $g(f(x)) = x$ for all $x \in A$).


*$f : A \to B$  is surjective iff it has a right inverse, i.e, iff there is a function $g: B \to A$ such that $f \circ g = f$ (i.e., $f(g(y)) = y$ for all $y \in B$).
