Set Theory - Cardinality - Having trouble "building" functions While not a specific problem, trying to prove the cardinality of one set is equal to that of another one leaves me puzzled and confused. After looking at several problems and solutions, I don't know how to define an inverse function that satisfies (meaning, I'm having trouble thinking of such a function.)
For example:
Prove that the sets below have equal cardinality:
$\lbrace f:\mathbb{N} \rightarrow \lbrace 0,1\rbrace\rbrace, 
\text{and}\ 
\lbrace f:\mathbb{N} \to \lbrace 0,1\rbrace, \text{such that there's no}\ f(i) = f(i+1) = 0\rbrace$
What can I do in order to understand better? I'll be glad to hear what your experiences with this kind of problem are (function building).
 A: In this case, there are a number of ways you could go about constructing an injection that "removes consecutive zeros". It's important to remember that your construction can be massively non-surjective, which may open your mind. (Thanks Cantor-Schröder-Bernstein!)
Here are a couple.

*

*How about using more bits to encode the one bit of output? We can use two bits of the output of the transformed function to code one bit of output of the original function, e.g. by transforming $0 \mapsto 10$ and $1 \mapsto 11$; then a function which outputs $0$ on input $n$ can be turned into a function which outputs $(1,0)$ on inputs $(2n, 2n+1)$, etc.

*$f$ is really an infinite stream of zeros and ones. How about run-length encoding? Start with $0$ or $1$ depending on what $f(0)$ is - wlog it starts with $0$ - and then follow it with a string of $n$ $1$'s, where $n$ is the smallest natural such that $f(n) \ne f(0)$ (i.e. append a number of $1$'s equal to the count of the first consecutive string of zeros). Then delimit with another $0$, and then follow it with a string of $m$ $1$'s, where $m$ is the smallest $m > n$ such that $f(m) \ne f(n)$ (i.e. append a number of $1$'s equal to the count of the first consecutive string of ones). Then append another $0$, and then a number of $1$'s equal to the count of the second consecutive string of zeros; and so on.

I'm a programmer, so I like this view of "coding up $f$, an infinite stream of bits, using a different encoding scheme"; it's rather like designing a wire format, a means of transferring data from one place (where it's represented in one way) to another (where it's represented in a different way), over a transmission medium which may have some restrictions (like "no two consecutive $0$-bits").
There is a lot of room to pack as much information as you like into a real number - after all, even arbitrary plain text can be expressed as a natural number, via Unicode! Your specific example has only put a small constraint on what encodings are allowed ("no two consecutive $0$'s"), but that's not a massive restriction as long as you just make sure the language you code things up in is made up of components which start with a $1$ and which don't contain consecutive $0$'s (as in my first bullet point above).
