Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose we have the following sets, and determine whether they are countably infinite or uncountable .

  1. The set of all functions from $\mathbb{N}$ to $\mathbb{N}$.

  2. The set of all non-increasing functions from $\mathbb{N}$ to $\mathbb{N}$.

  3. The set of all non-decreasing functions from $\mathbb{N}$ to $\mathbb{N}$.

  4. The set of all injective functions from $\mathbb{N}$ to $\mathbb{N}$.

  5. The set of all surjective functions from from $\mathbb{N}$ to $\mathbb{N}$.

  6. The set of all bijection functions from from $\mathbb{N}$ to $\mathbb{N}$.

My thoughts on this:

  1. The first set is uncountable by using diagonalization argument.

  2. I have read something about it saying this is countable since we can see this as a set of finite sequences of natural numbers. But I have hard time following the argument.

  3. The article I read says this is uncountable but I couldn't follow the argument either.

  4. For (4),(5) and (6), I am not even sure how to approach problems like these.

Could someone please explain how to approach this kind of problems in general?

And does it matter when I change all the $\mathbb{N}$ to $\mathbb{R}$?

share|cite|improve this question
Recall the definition of a function as a set of ordered pairs. That should help. – Potato Dec 3 '11 at 2:27
Maybe you can argue that (2) is countable because any given sequence that is non-increasing eventually stops decreasing at some finite natural number or hits zero and then is forced to be constant at 0. Then come up with a clever way to list all the functions, maybe by listing them first by starting position then by "length before it is constant" or something like that. – tomcuchta Dec 3 '11 at 2:28
@tomcuchta Your idea for (2) is alright, but a small nitpick. The function need not go to $0$ but might stop at $1$ (say). What is true (and important) is that the function is eventually constant. – Srivatsan Dec 3 '11 at 2:39
I removed the (functional-analysis), the (set-theory) and the (proof-theory) tag. Each of these tags is intended for subjects usually taught at an advanced undergraduate or graduate level. – t.b. Dec 3 '11 at 2:42
@t.b.Thanks, I guess I am confused about what function spaces really study. – geraldgreen Dec 3 '11 at 3:12
up vote 5 down vote accepted

Another approach to the 6th part.

Let us denote the set of all bijections from $\mathbb N$ to $\mathbb N$ by $\operatorname{Bij}(\mathbb N,\mathbb N)$.

Clearly $$|\operatorname{Bij}(\mathbb N,\mathbb N)| \le \aleph_0^{\aleph_0} = 2^{\aleph_0} = \mathfrak c.$$

Let us try to show the opposite inequality.

For arbitrary function $f\in\operatorname{Bij}(\mathbb N,\mathbb N)$ we define $$\operatorname{Fix}(f)=\{n\in\mathbb N; f(n)=n\}.$$ (That is, $\operatorname{Fix}(f)$ is the set of all fixed points of the map $f$.) Let us try to answer the question, whether for any $A\subseteq\mathbb N$ it is possible to find a bijection ${f_A}:{\mathbb N}\to {\mathbb N}$ such $\operatorname{Fix}(f_A)=A$. Let us consider two cases.

If the complement of the set $A$ is infinite, i.e. $\mathbb N\setminus A=\{b_n; n\in\mathbb N\}$ (and we can assume that the elements $\mathbb N\setminus A$ are written in the increasing order, i.e. $b_1<b_2<\dots<b_n<b_{n+1}<\dots$ ), then we can define a function $f_A$ as follows: $$f_A(x)= \begin{cases} x, & \text{if }x\in A, \\ b_{2k+1}, &\text{ak $x=b_{2k}$ for some $k\in\mathbb N$},\\ b_{2k}, &\text{ak $x=b_{2k+1}$ for some $k\in\mathbb N$}. \end{cases} $$ In the other words, we did not move the elements of $A$ and the elements from the complement were paired and we interchanged it pair. Such map is a bijection from $\mathbb N$ to $\mathbb N$ such that $\operatorname{Fix}(f_A)=A$.

Next we consider the case that $\mathbb N\setminus A$ is finite.

If $\mathbb N\setminus A=\emptyset$, then $f=id_{\mathbb N}$ is a function fulfilling $\operatorname{Fix}(f_A)=\mathbb N=A$.

If the set $\mathbb N\setminus A$ is a singleton $\{a\}$, then is is impossible to find a bijection $f$ such that $\operatorname{Fix}(f)=A=\mathbb N\setminus\{a\}$. No element of $\mathbb N\setminus A$ can be mapped on $a$ (since all such elements are fixed). But $a$ cannot be mapped on $a$ since this would mean that $a$ is a fixed point.

But if the set $\mathbb N\setminus A$ has at least two elements, then it is possible to construct such a map. We again assume that the elements $b_k$ are written in the increasing order, i.e. $\mathbb N\setminus A=\{b_0,\dots, b_n\}$ and $b_0<b_1<\dots<b_n$. We put $f_A(x)=x$ for $x\in A$, $f_A(b_k)=b_{k+1}$ for $0\le k<n$ and $f_A(b_n)=b_0$. (I.e. we made a cycle consisting of elements of $\mathbb N\setminus A$.)

This defines a bijection ${f_A}:{\mathbb N}\to{\mathbb N}$ such that $\operatorname{Fix}(f_A)=A$.

The assignment $A\mapsto f_A$ that we described above is a map from the set $\mathcal P({\mathbb N})\setminus\{\mathbb N\setminus\{a\}\in\mathbb N\}$ consisting of all subsets of $\mathbb N$, whose complement is not a singleton, to the set $\operatorname{Bij}(\mathbb N,\mathbb N)$. This map is injective; since from $f_A=f_B$ we get $A=\operatorname{Fix}(f_A)=\operatorname{Fix}(f_B)=B$.

From the set $\mathcal P({\mathbb N})$ with the cardinality $\mathfrak c$ we have omitted a countable set $\{\mathbb N\setminus\{a\}\in\mathbb N\}$. Therefore the cardinality of this difference $\mathcal P({\mathbb N})\setminus\{\mathbb N\setminus\{a\}\in\mathbb N\}$ is again $\mathfrak c$.

So we found an injection from a set of cardinality $\mathfrak c$ to the set $\operatorname{Bij}(\mathbb N,\mathbb N)$. This yields the opposite inequality $$\mathfrak c\le|{\operatorname{Bij}(\mathbb N,\mathbb N)}|$$ and by Cantor-Bernstein theorem we get $|{\operatorname{Bij}(\mathbb N,\mathbb N)}|=\mathfrak c$.

share|cite|improve this answer
Thanks for doing the details. It pointed out a flaw in my answer. – David Mitra Dec 3 '11 at 14:07
I did not notice that we are using basically the same argument until you pointed it out. I like your answer, but I am out of votes for today. – Martin Sleziak Dec 3 '11 at 14:14
This answer looks choice-free, except possibly for the assertion that ${\frak c}-\aleph_0=\frak c$, which I don't think is true in general. (Of course in this case you could take the subset $\{A\in{\cal P}(\Bbb N):{1,2}\subseteq A\}$ which is clearly equinumerous to ${\cal P}(\Bbb N)$.) – Mario Carneiro Oct 21 '15 at 17:37
@MarioCarneiro I believe that it is relatively easy to prove that $|X|\ge\aleph_0$ then $|X|+\aleph_0=|X|$ without any use of AC. (Basically by Hilbert hotel argument.) And this should be sufficient in the above proof. – Martin Sleziak Oct 21 '15 at 18:49
@MartinSleziak Sure, for $|X|+\aleph_0$, but I don't think that the proof extends to $|X|-\aleph_0$ (that is, $X$ with a denumerable subset $Y$ removed). You can take the $X$-image of a bijection from $X+\Bbb N$ to $X$, but that only gives you $|X|=|X\setminus Y'|$ for some denumerable subset $Y'$, not $|X|=|X\setminus Y|$ for the target subset (cardinal differences are not always well-defined, e.g. $\aleph_0-\aleph_0$ can be anything from $0$ to $\aleph_0$). – Mario Carneiro Oct 21 '15 at 19:29

This is not a complete answer. [I am taking $\mathbb N$ to include $0$.] I will give you a proof that there are uncountably many bijections from $\mathbb N$ to itself. This obviously subsumes the questions (4)-(6).

Consider functions $f : \mathbb N \to \mathbb N$ of the following special form: For every $k$, the pair of elements $\{ 2k, 2k+1 \}$ is mapped to itself. However, we have two ways of doing this:

  • either: map $2k$ to itself, and similarly for $2k+1$.

  • or: map $2k$ and $2k+1$ to each other.

The key point is that for each $k$, you could pick one of the two possibilities independently. Since there are $2$ options for each $k$, you have $2^{\mathbb N}$ options; i.e., there are uncountably many such functions satisfying this restriction. And each such function is a bijection from $\mathbb N$ to itself.

The above needs a little bit of work to make it completely rigorous. In particular, try to formalise what I mean by "$2^\mathbb N$ possibilities".

For (3), the idea is similar. For each $k$, try mapping $k$ to either $2k$ or $2k+1$. Details are left as an exercise.

For (2), does the following hint help? Every non-increasing function $f : \mathbb N \to \mathbb N$ is eventually constant. So the function is uniquely specified if we describe the finite initial "portion" of the function.

Another approach (due to tb) for (2): If you plot the graph of a non-increasing function, it looks like a staircase that goes down as we move from left to right -- a staircase with finitely many steps because you the function can go down only finitely many times. One can also reconstruct the function if we record the upper right corners of each of those steps. Since the latter corresponds to a finite subset of $\mathbb N \times \mathbb N$ (which is countable), it follows that our set of non-increasing functions is countable as well.

share|cite|improve this answer

I'll use this opportunity to mention here a very nice (at least in my opinion) proof that the cardinality of all bijections $\mathbb N\to\mathbb N$ is $\mathfrak c=2^{\aleph_0}$, which is basically the part 6. I making it a community wiki, since the idea is not mine. I believe I've seen this at sci. math but I am not sure about it and I cannot find the link now. (Feel free to add some pointers and links, if you know some.)

HINT: If someone wants to try to develop the idea by himself, the basic idea is Riemann's rearrangement theorem.

Let us denote the set of all bijections from $\mathbb N$ to $\mathbb N$ by $\operatorname{Bij}(\mathbb N,\mathbb N)$.

Clearly $$|\operatorname{Bij}(\mathbb N,\mathbb N)| \le \aleph_0^{\aleph_0} = 2^{\aleph_0} = \mathfrak c.$$

Now we will show the opposite inequality. Let us choose a series $\sum_{n=0}^\infty x_n$, which is convergent but not absolutely convergent (e.g. $\sum_{n=0}^\infty x_n = \sum_{n=0}^\infty (-1)^n\frac1{n+1}$). By Riemann's theorem, for any real number $r$ there exists a permutation $\pi\in \operatorname{Bij}(\mathbb N,\mathbb N)$ such that $\sum_{n=0}^\infty x_{\pi(n)}=r$. If we choose for each $r$ one such permutation, we get an injective map from $\mathbb R$ to $\operatorname{Bij}(\mathbb N,\mathbb N)$. Thus $|\operatorname{Bij}(\mathbb N,\mathbb N)| \ge |\mathbb R| = \mathfrak c = 2^{\aleph_0}$.

share|cite|improve this answer
+1, nice approach. I don't think you have to make an answer CW just because it isn't your idea. Writing an answer is contribution enough and one deserves some credit for that. =) – Srivatsan Dec 4 '11 at 0:24

Let $$ \eqalign{ A_1&=\text{the set of all functions from }\Bbb N\text{ to }\Bbb N. \cr A_2&=\text{the set of all non-increasing from }\Bbb N\text{ to }\Bbb N. \cr A_3&=\text{the set of all non-decreasing }\Bbb N\text{ to }\Bbb N. \cr A_4&=\text{the set of all 1-1 functions from}\Bbb N\text{ to }\Bbb N. \cr A_5&=\text{the set of all onto functions from }\Bbb N\text{ to }\Bbb N. \cr A_6&=\text{the set of all bijections from }\Bbb N\text{ to }\Bbb N. \cr } $$

Consider $A_6$:

$A_6$ may be thought of as the set $\bigl\{\,\pi :\pi \text{ is a permutation of } (1,2,3,\ldots)\,\bigr\}$.

For any permutation $\pi$, we may associated a binary sequence $(x_n)$ by setting $$x_n=\cases{ 0,& \text{if } \pi_n=n\cr 1,& \text{otherwise} }.$$ This induces an onto map from $A_6$ to the set of infinite binary sequences (Edit: not quite, as Martin Sleziak points out in his answer, the binary sequences that have "only one 1" have no element in $A_6$ mapped to them. But, as the set of such sequences is countable, the rest of the argument will go through. Martin also describes nicely how to obtain this map.). Since the latter set is uncountable, so is the former.

So, $A_6$ is uncountable.

From this, it follows that $A_5$, $A_4$, and $A_1$ are uncountable.

Now, consider $A_2$:

If $f$ is a non-increasing function, then $f$ must be eventually constant. Thus, the cardinality $A_2$ would be at most the cardinality of the set $$ \bigcup_{j,m} \bigl\{\,(a_i)_{i=1}^\infty : a_i=m, i\ge j\,\bigr \}. $$ But this latter set is a countable union of countable sets and is, thus, countable.

So, $A_2$ is countable.

Now, consider $A_3$:

The cardinality of the set of non-decreasing functions is at least the cardinality of the set $$ \{\, A\subset\Bbb N : A \text{ is an infinite subset of } \Bbb N\, \}. $$

Since this latter set uncountable, $A_3$ is uncountable.

share|cite|improve this answer
"If f is a non-increasing function, then f must be eventually constant" Why ? it can also be increasing. – GinKin Mar 11 '14 at 12:45
@GinKin I took "non-increasing" to mean $f(b)\le f(a)$" whenever $a\le b$ (that is, (perhaps non-strictly) decreasing). This is standard terminology. What do you mean by "it can also be increasing"? – David Mitra Mar 11 '14 at 13:11
Whoops mixed the terms, I meant that if it doesn't increase then it doesn't have to be eventually constant, it can be decreasing. – GinKin Mar 11 '14 at 13:24
@GinKin But the range is $\Bbb N$. If it were strictly decreasing, it would eventually be constantly $0$. – David Mitra Mar 11 '14 at 13:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.