1

I've been stuck for a couple of hours on how to prove that $C(m,n)=\frac{(m+n)(m+n+1)}{2}+m$ is a bijection from $\mathbb{N}^2$ to $\mathbb{N}$.

I read in another question that in order to prove that it is injective, you have to show: $$m+n<m'+n'\Rightarrow C(m,n)<C(m',n')$$

From where $C(m,n)=C(m',n')\Rightarrow m+n=m'+n'$, and then $m=m',n=n'$.

However, I failed to show the first implication, and I also couldn't understand how to go from $m+n=m'+n'$ to $m=m',n=n'$.

Would someone be kind enough to give me some tips on how to proceed?

1 Answers1

2

For the first implication, notice that $$ C(m,n) = m + \sum_{k=0}^{m+n} k$$ If $m+n < m' + n'$, this implies that \begin{align} C(m',n') - C(m,n) &= m' - m + \sum_{k=m+n+1}^{m'+n'} k \\ &\ge m' + n + 1 \end{align}

For the second implication, use the fact that $m = C(m,n) - \frac{(m+n)(m+n+1)}{2}$.

Math536
  • 1,898
  • The first equation is obtained by noticing that $0+1+2+\cdots +(m+n-1)+(m+n)=(m+n)\frac{(m+n+1)}{2}$, which is the summation of $\frac{(m+n+1)}{2}$ elements equal to $m+n$. – Guilherme Salomé Jul 17 '15 at 21:16