2

This is straightforward when $\mathbb{N} = \{1,2,3, \ldots\}$. I define the map $f(a,b) = 2^{a-1} \cdot (2b - 1)$, which I can prove directly is bijective. When I define $\mathbb{N} = \{0,1,2, \ldots\}$, things get much more complicated. By composing bijective maps on both sides, both $\mathbb{N} \cup \{0\} \times \mathbb{N} \cup \{0\} \to \mathbb{N} \times \mathbb{N}$ and $\mathbb{N} \to \mathbb{N} \cup \{0\}$, I come up with the map $$ f(a,b) = 2^a (2b + 1) - 1. $$ It is straightforward to prove this map is injective because the $-1$ cancels. But I don't know how to prove this map is surjective. I can deal with the zero case by simply letting $a = b = 0$, but I can't "map" between the previous bijection and this one. Though this is a composition of bijections and hence bijective, I want to try to prove this directly.

I'd appreciate any tips.

EDIT: Here is my prove that $f(a,b) = 2^{a-1} \cdot (2b - 1)$ is bijective, provided that I exclude $0$ from the definition of $\mathbb{N}$. I will call this set $\mathbb{N}' = \{1,2,3, \ldots\}$.

I claim that $f$ is a bijection. First, let $y \in \mathbb{N}'$. If $y$ is odd, then $y = 2k - 1$ for some $k \in \mathbb{N}'$. Then we have $y = 1y = 2^{1-1} \cdot (2k-1)$, so $f(1,k) = y$. If $y$ is even, then $y = 2m$ for some $m \in \mathbb{N}'$. Let $r \in \mathbb{N}'$ be the highest power of $2$ such that $2^r \mid y$. Then $y = 2^r \cdot z$ for some $z \in \mathbb{N}'$, where $z$ is odd. Then $z = 2n - 1$ for some $n \in \mathbb{N}'$, so we have $y = 2^{(r+1)-1} \cdot (2n - 1)$. Then $f(r+1, n) = y$. Therefore, $f$ is surjective. Now, given $(a,b), (p,q) \in \mathbb{N}' \times \mathbb{N}'$ for which $f(a,b) = f(p,q)$, we have $2^{a-1} \cdot (2b - 1) = 2^{p-1} \cdot (2q - 1)$. Notice that neither $2b - 1$ nor $2q - 1$ are odd, so $2$ divides neither. Without loss of generality, suppose that $a - 1 \geq p - 1$, so $a \geq p$, so $a - p$ is a non-negative integer. Dividing through by $2^{p-1}$, we obtain $2^{a-p} \cdot (2b - 1) = 2q - 1$. If $a > p$, then $a - p - 1 \geq 0$, so $2\left(2^{a-p-1} \cdot (2b - 1)\right) = 2q - 1$, so $2q - 1$ is even, which is a contradiction. So $a = p$, so $2^{a-p} = 2^0 = 1$, so $2b - 1 = 2q - 1$, so $b = q$. Therefore, $(a,b) = (p,q)$, so $f$ is injective and hence bijective, so $\mathbb{N}' \times \mathbb{N}' \cong \mathbb{N}'$.

Brad G.
  • 2,238
  • 2
    Note that it is often easier to prove that two sets are in bijection than it is to exhibit a simple bijection between them. For instance, it suffices to exhibit injections in both directions. – lulu Sep 16 '21 at 19:36
  • 1
    You can proceed as here, without using $f(a,b)$ explicitly. – Dietrich Burde Sep 16 '21 at 19:37
  • 1
    Let $n$ be a natural number, you want to show there exists $a, b$ such that $2^a(2b + 1) - 1 = n$, now you have $n + 1 > 0$, so you can write $n + 1 = 2^a \cdot d$ where $d$ is some odd number, and those can be written in the form $d = (2b + 1)$. This gives you your $a$ and $b$ – Rushy Sep 16 '21 at 19:42
  • 1
    I suggest using different symbols like $\mathbb{N}_{+}$ and $\mathbb{N}_0$ whenever both definitions of "natural number" could be meant. – aschepler Sep 16 '21 at 19:45
  • Given $n,$ write $n$ in binary, and let $a(n)$ and the number of consecutive $1$s at the end of the binary. So $$n\equiv 2^{a(n)}-1\pmod {2^{a(n)+1}}.$$ Then $$b(n)=\frac{n-(2^{a(n)}-1)}{2^{a(n)+1}}.$$ Then $$f(a(n),b(n))=n.$$ – Thomas Andrews Sep 16 '21 at 20:06
  • You can recursively define $a(n)$ as $a(2m)=0, a(2m+1)=a(m)+1.$ Prove recursively that $$n\equiv 2^{a(n) }-1\pmod {2^{a(n)+1}}$$ – Thomas Andrews Sep 16 '21 at 20:13
  • You say you can "prove directly" that the first map is bijective. If you show us that proof, someone can probably show you how to adapt into a direct proof for the second map. – Barry Cipra Sep 16 '21 at 20:15
  • @BarryCipra I added my proof. – Brad G. Sep 16 '21 at 20:18
  • "Notice that since neither ... so two divides neither". the first 'neither' should be changed to 'both'. and might i suggest this: if $2^{a-1}(2b-1)=2^{p-1}(2q-1)$ then $2^{a-p}(2b-1)=2q-1$. if $a>p$ then $2q-1$ is both even and odd. if $a<p$, then $2b-1$ is both even and odd. both lead to contradictions, so you have to have $a=p$ – C Squared Sep 16 '21 at 20:36

4 Answers4

1

Per comment by ascheler, let $\mathbb{N}_+=\{1,2,\dots\}$ and $\mathbb{N}_0=\{0,1,2,\dots\}$.

The map $p:\mathbb{N}_0\to\mathbb{N}_+$ given by $p(n)\colon=n+1$ is a bijection, with $p^{-1}(n)=n-1$.

The function $p\times p:\mathbb{N}_0^2\to\mathbb{N}_+^2$ given by $$(p\times p)(n,m)\colon=(p(n),p(m))=(n+1,m+1)$$ is a bijective map with inverse given by $$(p\times p)^{-1}(n,m)\colon=(p^{-1}(n),p^{-1}(m))=(n-1,m-1)$$

The map you you want to define is the composition of bijective maps, specifically,

$$f\circ (p\times p):\mathbb{N}_0^2\to\mathbb{N}_+$$ which is again bijective, where $f:\mathbb{N}_+^2\to\mathbb{N}_+$ is $f(n,m)\colon=2^{n-1}(2m-1)$.

C Squared
  • 3,648
  • 1
  • 9
  • 32
0

I find the formula in this approach to showing that $\Bbb{N} \times \Bbb{N}$ is countable to be much easier to understand and remember when $0$ is considered to be a member of $\Bbb{N}$. Let's expand your formula for $f(a, b)$: $$ f(a, b) = 2^a(2b+1) - 1 = 2^{a+1}b + 2^a - 1 $$ $2^a-1$ is a $a$ written in unary notation (i.e., a string of $a$ $1s$). $2^{a+1}b$ in binary notation is what you get by tacking $a+1$ $0$s to the right of the binary notation for $b$. So $f(a, b)$ (in binary) is what you get by writing down $b$ in binary, then a $0$ and then $a$ $1s$. That's clearly injective (because the position of the rightmost $0$ in a number expressed in binary uniquely determines $a$ and $b$ according to this construction) and surjective (because any number expressed in binary has a rightmost $0$).

A formal recursive definition for this $f$ is: \begin{align*} f(0, b) &= 2a \\ f(a+1, b) &=2f(a, b) + 1 \end{align*} and you can use this to give inductive proofs that $f$ is injective and surjective that mirror my intuitive arguments above.

Rob Arthan
  • 48,577
0

Define $a(n)$ recursively by $a(2m)=0$ for all $m\in\mathbb N_0.$ Define $a(2m+1)=a(m)+1.$

Then prove recursively that $$n\equiv 2^{a(n)}-1\pmod{2^{a(n)+1}}\tag1$$

This lets you define $$b(n)=\frac{n-(2^{a(n)}-1)}{2^{a(n)+1}}.$$

Then $f(a(n),b(n))=n.$


Proving (1)

When $n=2m,$ $a(n)=0,$ and this is:

$$2m\equiv 0\pmod 2$$ which is trivially true.

Assume true for $n<2m+1.$ Then for $n=m:$

$$m\equiv 2^{a(m)}-1\pmod {2^{a(m)+1}}$$

Multiply by $2$ and add $1,$ you get:

$$2m+1\equiv 2^{a(m)+1}-1\pmod{2^{a(m)+2}}$$

Then substitute $a(m)+1=a(2m+1)$ and you get the result for $n=2m+1.$


$a(n)$ can be thought of as the number of consecutive $1$s on the right of the binary representation of $n,$ which is the same as the number of $0$s on the right of the binary representation of $n+1.$

Thomas Andrews
  • 177,126
0

Since $\Bbb N$ is in bijection with $\Bbb N\times \{i\}$ for all $i\in\Bbb N$, we have that $\Bbb N\times \{i\}$ is countable. But

$$\Bbb N\times \Bbb N=\bigcup_{i\in \Bbb N}(\Bbb N\times \{i\}),$$

which is countable since any countable union of countable sets is countable.

Shaun
  • 44,997