I have the following functions:
$ \begin{align} f&: \mathbb{N} \times \mathbb{N} \to \mathbb{N} \times \mathbb{N} \\ g&: \mathbb{N} \times \mathbb{N} \to \mathbb{N} \times \mathbb{N} \end{align} $ defined by $f(x, y) = (x + y, x)$ and $g(x, y) = (x - y, y)$.
a) Calculate $g\circ f$ for the originals $(2, 2), (3, 5)$ and $(4, 1)$. $ \begin{align} f(2, 2) &= (2 + 2, 2) = (4, 2) \text{ and then } g(4, 2) = (4 - 2, 2) = (2, 2)\\ f(3, 5) &= (3 + 5, 3) = (8, 3) \text{ and then } g(8, 3) = (8 - 3, 3) = (5, 3)\\ f(4, 1) &= (4 + 1, 4) = (5, 4) \text{ and then } g(5, 4) = (5 - 4, 4) = (1, 4) \end{align} $
b) Give a function description for the function $h: \mathbb{N} \times \mathbb{N} \to \mathbb{N} \times \mathbb{N}$ with $h = g \circ f$ and show that it counts for all $x$, $y$ element of $\mathbb{N}$.
I have no idea how to tackle these two questions, don't even know where to begin.
c) Show that $f$ is injective, but not surjective.
To show that something is injective, I would need to find an element of the codomain that does not have an element in the domain. To find something that is surjective, I would need to find an element in the codomain that has more than one original.
Some sample input/output data:
input -> output
$ \begin{align} (0, 0) &\to (0, 0)\\ (0, 1) &\to (1, 0)\\ (0, 2) &\to (2, 0)\\ ...&\text{etc...}\\ (1, 0) &\to (1, 1)\\ (1, 1) &\to (2, 1)\\ ...&\text{etc...}\\ (2, 0) &\to (2, 2)\\ (2, 1) &\to (3, 2)\\ \end{align} $ ...etc...
Now, if I have e.g. the element $(0, 1)$ in the codomain, then there is no corresponding element in the domain. In element $(0, 1), x = 1$, but then $y$ has to be $-1$ to make the $0$, and since the domain is $\mathbb{N} \times \mathbb{N}$, this cannot be.
Another example, this time with element $(1, 0)$ in the codomain. This means that $x = 0$, and that $y = 1$. So the corresponding element in the domain should then be $(0, 1)$, but when this element is put into $f$, it goes to $(1, 1)$. In other words, $(1, 0)$ also does not have an original.
Is this evidence enough to say that this function is not surjective, or do I still need to prove it further?
d) We confine the function $f$ now to $ f: \mathbb{N} \times \mathbb{N} \to \{(n, m)\lvert n \geq m\} $ still with $ f(x, y) = (x + y, x). $ Show that the inverse of $f$ now does exist, and calculate this inverse.
My problem here is that there are elements that satisfy $n \geq m$, but these are not inverse. For example, if I put $(2, 1)$ into $f$, the answer is $(3, 2)$. This is not the inverse of $(2, 1)$ What is the thinking mistake I'm making here?