TITLE: Showing a function $f: \mathbb{N} \times\mathbb{N} \to \mathbb{N}$ is injective
QUESTION [6 upvotes]: Let $f: \mathbb{N} \times\mathbb{N} \to \mathbb{N}$ with 
$$
f(i,j) = \frac{(i+j-2)(i+j-1)}{2}+j.
$$
I want to show $f$ is an injection. This is how I approached the problem:
I tried to show $f(i,j)=f(u,v)\Rightarrow (i,j)=(u,v)$. So,
$$
\frac{(i+j-2)(i+j-1)}{2}+j = \frac{(u+v-2)(u+v-1)}{2}+v
$$ implies
$$
[(i-u)+(j-v)](i+j+u+v-3)+2(j-v)=0.
$$
So I looked at the two cases:
If $(i-u)+(j-v)=0$, then
$$
0+2(j-v)=0 \Rightarrow j=v.
$$
So $i=u$ as well.
Now, for the case $(i-u)+(j-v)\neq0$ I have tried different things but none of them have worked so far.
I would like to get some ideas.

REPLY [2 votes]: Mathematical Induction

(if anyone is up to it, replace this picture with genuine MathJax)