2

Please help me find the mistake I made in a set theory exercise.

I have a function $f:\Bbb N\times\Bbb N\to\Bbb N$ defined by

$$f((a,b))=\frac{(a+b)(a+b+1)}2+a\;.$$

I'm trying to prove that $f$ is bijective. This is my proof:

  1. Let's look at the set $f$, $$f=\left\{((a,b),c) \mid (a,b)\in\Bbb N\times\Bbb N, c=\frac{(a+b)(a+b+1)}2+a\in\Bbb N\right\}\;.$$ Let's define a new function $g:\Bbb N\to\Bbb N\times\Bbb N$ by $g(c)=(a,b)$. (The set looks like this $g=\{(c,(a,b))\}$ ).

  2. Let's check $(f\circ g)(\Bbb N)=\operatorname{Id}(\Bbb N)$?
    I say that to all $n\in\Bbb N$ exists $k,m\in\Bbb N$ such that $\frac{(k+m)(k+m+1)}2 + k=n$ (induction with respect to $n$): For $n=0$, there exists $k=m=0$. Lets assume true for $n$, and prove for $n+1$: Looking for $k',m'\in\Bbb N$ - for $k'=k+1, m'=m-1$ the expression equals $n+1$. $(f\circ g)(\Bbb N)=\operatorname{Id}(\Bbb N)$.

  3. Let's check $(g\circ f)(\Bbb N\times\Bbb N)=\operatorname{Id}(\Bbb N\times\Bbb N)$?
    I say that to all $k,m\in\Bbb N$ exists $n\in\Bbb N$ such that $g(n)=\frac{(k+m)(k+m+1)}2 + k$ (induction with respect to $k,m$): For $k,m=0$, exists $n=0$. Lets assume true for $k,m$, and prove for $k+1,n+1$: Looking for $n'$ so that $g(n')=\frac{(k+1+m+1)(k+1+m+1+1)}2 +k+1$
    For $n'=(n+k+m+4)$ which is clearly a natural number the expression is true. $(g\circ f)(\Bbb N\times\Bbb N)=\operatorname{Id}(\Bbb N\times\Bbb N)$.

Therefore $f$ is a bijective function. And $f^{-1}=g$.

Please help find why I'm a fool and where is the mistake.

Brian M. Scott
  • 616,228

1 Answers1

2

The problem is that unless you prove #2 and #3 (or a variant of it), the new function $g$ is not well-defined. You write $$ g(c) = (a,b) \qquad (\ast) $$ so there are two questions :

  1. Given $c\in \mathbb{N}$, how do you know that $\exists a,b\in \mathbb{N}$ such that $$ c = \frac{(a+b)(a+b+1)}{2} + a $$ This amounts to proving that $f$ is surjective, which you have proved in #2. But until you establish this, you can't write down $(\ast)$

  2. Given $c\in \mathbb{N}$, how do you know that the $a$ and $b$ you have obtained in (1) are unique? In other words, why is $g$ well-defined? This amounts to proving that $f$ is injective. I suspect you can rework the proof of #3 to prove this?