How do I prove injective property of $(x + y)^2 + y: \mathbb{N}×\mathbb{N} \to \mathbb{N}$ Given this function: $(x + y)^2 + y$, how do I go about proving it's injective property of mapping $\mathbb{N}×\mathbb{N} \to \mathbb{N}$ ? Surjection is not required. My current attempts include proving by negation: assume $(x_1,y_1) \ne (x_2,y_2)$ yet $(x_1 + y_1)^2 + y_1 = (x_2 + y_2)^2 + y_2$, then attempt to arrive at a contradiction. I wasn't able to find a technique that would help me reach that goal. Geometrically, I can think of the square value to be a growing line but must have a length of certain values (square values). The addition of $y$ must not overwhelm the line to the next "border" of square values. Thus no other value of $y$ would provide the same total length. While $x$ is bound to stretch the line between square values only. My math jargon isn't refined, but that it is how I think of this question.
 A: Assume $m=(x+y)^2+y$ for some $x,y\in\Bbb N$.
Can we uniquely determine $x,y$ from $m$?
Let $n\in\Bbb N$ be maximal with $n^2\le m$ (or: $n=\lfloor \sqrt m\rfloor$).
Then
$$ (x+y)^2\le m=n^2<(x+y)^2+y + (2x+y+1)=(x+y+1)^2$$
and we conclude $n=x+y$. It follows that $y=m-n^2$ and then $x=n-y$.
A: Both @hagen and @user710290 have lead to a correct approach. Here's an elaboration:

Proof by Contradiction
Given $(x_1,y_1) \ne (x_2,y_2)$, assume $(x_1+y_1)^2+y_1 = (x_2+y_2)^2+y_2$.

*

*Algebraic restructuring


*

*$(x_1+y_1)^2-(x_2+y_2)^2 = y_2-y_1$

*$((x_1-x_2)+(y_1-y_2))((x_1+x_2)+(y_2+y_1))=y_2-y_1$ ; Factorizing difference between 2 squares

$y_2=y_1 \implies x_2=x_1$

*

*$(x_1-x_2)((x_1+x_2)+(y_2+y_1)) = 0$
$(x_1+y_1)^2+y_1 = (x_2+y_2)^2+y_2 \implies y_2=y_1$.

*

*Assume $y_2>y_1$ substituting $y_2$ with $y_1+k$ where $k>0$

*$(x_1-(x_2+k))((x_1+x_2)+(2y_1+k))=k$

*Above $\implies x_1>x_2+k \implies \mathit{L.H.S} > \mathit{R.H.S}$

*Rinse & repeat with $y_1>y_2$
$\therefore (x_1+y_1)^2+y_1 = (x_2+y_2)^2+y_2 \implies (x_1,y_1)=(x_2,y_2)$

Proof by finding an Inverse (Bijection)
From @hagen's post, let $m=(x+y)^2+y$ and $n=\lfloor \sqrt m\rfloor$

*

*$(x+y)^2\le m$

*$(x+y)^2\le n^2<(x+y)^2+y + (2x+y+1)=(x+y+1)^2 \implies n=x+y$
$\therefore y=m-n^2$ and $x=n-y$
