didn't succeeded to prove this function is a bijective function: $$ f \in \mathbb{N} x \mathbb{N} \rightarrow \mathbb{N} $$ $$ f = \lambda <a,b>\in \mathbb{N} x \mathbb{N} . \frac {1}{2}(a+b)(a+b+1)+a $$
I need to prove that f is injective and surjective but i didn't find any way to do it. i really could use your help. thanks
Surjectivity
By induction:
base case
$(0,0) = 0$
Suppose there is an $(a,b)$ such that $\lambda (a,b) = n$
We must show that there is some combination $(p,q)$ such that $\lambda (p,q) = n+1$
If $b\ne 0$ then $\lambda (a+1, b-1) = \lambda (a,b) + 1.$
$\lambda(a+1,b-1) = \frac 12 (a+1+b-1)(a+1+b-1+1) + a+1 = \frac 12 (a+b)(a+b) + a+1 = \lambda (a,b) + 1$
If $b = 0,$ then $\lambda (0, a+1) = n + 1$
$\lambda (0, a+1)=\frac 12 (a+1)(a+2) = \frac 12 (a+1)(a) + a+1 = \lambda (a,0) + 1$
This implies $\lambda (a,b)$ is surjective.
Injection, there is probably a cleaner way, but this it what I came up with.
if $\lambda$ is injective, $\lambda (a,b) = \lambda (p,q) \implies (a,b) = (p,q)$
By contradiction
Assume $\lambda (a,b) = \lambda (p,q),$ and $(a,b) \ne (p,q)$
WLOG $a+b \ge p+q$
If $a+b = p+q$
$\lambda (a,b)- \lambda (p,q)= a-p=0\\ a=p, b=q$
If $a+b > p+q$
$\lambda (a,b) - \lambda (p,q) = \left (\sum_\limits{n=p+q+1}^{a+b} n\right)+a-p\ge a+b + a -p > 0$
In either case we have a contradiction.