0

I have seen a lot of material on why the set $(0,1)$ is not countable. Especially Cantor's diagonalization argument. Which seems to prove that the set of natural numbers is smaller than the set of real numbers between 0 and 1.

However, I believe that there does exist an invertible function $f: \mathbb{N} \rightarrow (0,1)$. One such function be the following: $$ f(x) = \sum_{n=0}^{L}\frac{g(x,n)}{10^{n-1}} $$ Where $L = \lfloor\log_{10}(x)\rfloor$ and $g(x,n)$ is defined as: $$ g(x,n) =\Big\lfloor\frac{x}{10^n}\Big\rfloor \mod{10} $$ Which essentially just 'mirrors $x\in\mathbb{N}$ in the decimal point'. To see what I mean here are some examples: \begin{align} f(1) = 0.1000...\\ f(2) = 0.2000...\\ f(42) = 0.2400...\\ f(1726) = 0.62710...\\ \end{align} I do not immediately see where there would be 'gap' where we miss real numbers in this interval. Is there something crucial that I am missing?

My background is not in set theory. So I first wanted to check, before I try to prove that this function is invertible.

  • 3
    What is $f^{-1}(1/9)?$ – Thomas Andrews Apr 02 '25 at 14:55
  • 1
    It is true that your function is $1-1,$ but it is far from onto. – Thomas Andrews Apr 02 '25 at 14:57
  • 8
    A positive integer $n$ with $f(n)=1/3$ does not seem to exist. I believe that your proof shows existence of a bijection between finite decimal and positive integers, and finite decimal is indeed countable. – Myungheon Lee Apr 02 '25 at 14:57
  • 4
    This function is invertible on its image, but its image isn't $(0,1)$. – Randall Apr 02 '25 at 15:34
  • Notice you don’t miss any interval. This is not enough to say you or onto, though. The inclusion of $\mathbb{Q}$ into $\mathbb{R}$ misses no interval, but is of course not onto. – Malady Apr 02 '25 at 16:03
  • @Malady the OP refering to "gaps" wasn't talking about missing whole intervals but "where we miss real numbers". The function (and the inclusion of $\mathbb Q$ into $R$) certain does miss (uncountably infinitely many) real numbers. The OPs function misses all terminating decimals and the inclusion of $\mathbb Q$ all irrationals. – fleablood Apr 02 '25 at 16:09
  • @fleablood They said “Gaps where we miss real numbers in this interval.” I’m not sure why you are telling me this, I said specifically in my comment that having dense image does not imply onto. – Malady Apr 02 '25 at 16:11
  • 2
    Yes, but I don't believe when the OP refered to "interval" they were talking about intervals in the image and density of the image within the codomain (I don't think the OP even considered that). I'm fairly sure they "the interval" (singular) referred to $(0,1)$ specifically and that "gap" refered to any missed singular real numbers. The OP I believe was claiming they didn't see any numbers being missed. And, of course, there are uncountably many numbers being missed. That's all. – fleablood Apr 02 '25 at 16:22

1 Answers1

4

All natural numbers have a finite number digits. So the each output of this function will be a terminating decimal with a finite number of digits. It is a bijection of the set of all terminating decimals between $0$ and $1$ but no nonterminating decimal (such as $\frac 13$, $\frac 37$, or $\frac 1{\sqrt 2}$ or $\frac 1\pi$) will be mapped to.

Your function which essentially reverses the digits is invertable (which mapping the digits without reversing would not be) but, as Thomas Andrews comments, its not onto.

Invertable (injective) functions from a lower cardinality to a higher cardinality are always possible[1] (I believe... I think that's thats equivalent to the definition of lower cardinality) but never onto.

====

[1] I guess this depends on the definition of "invertable" and whether it means invertable from the functions image (everything mapped to can be uniquely mapped back-- then all invertable is synonymous with injective-- as Randall points out the image [all terminating decimals] is not $(0,1)$) or whether it means invertable from the entire codomain (in which case invertible is synonymous with bijective and a functiom must be onto as well as one-to-one [your function is indeed one-to-one but it isn't onto).

fleablood
  • 130,341
  • A fun fact related to your last paragraph, without Choice, cardinalities are not totally ordered. Either way though, you are right it is the definition of the ordering on cardinals. – Malady Apr 02 '25 at 16:05
  • I was a little worried about choice when I was blithely saying "Well, of course we can always find an injective function from a smaller cardinality to another! because, duh, totatlly obvs!". But then I thought, wait, that is the definition, right? But... it's always wise to leave myself an egg in face avoidance loophole. "I believe" "I think". – fleablood Apr 02 '25 at 16:14
  • Thank you, I missed the fact that 'all natural numbers have a finite number of digits'. It feels a bit counter intuitive, since we can always add a digit after it to get a new number. Extrapolating that means that there should be numbers with an infinite number of digits. But I image there is a counter argument there as well. – stacksper Apr 03 '25 at 10:48
  • @stacksper Is it also “a bit counterintuitive” to you that we can always add 1 to any integer and get a new larger one? Suppose you do this in unary notation, so every +1 appends a “1” . Do you ever end up with an infinite string of 1s? At any stage you’ve done it only finitely many times. – BrianO Apr 14 '25 at 17:29
  • I dunno. To me it is obvious that every natural numbers has a specific finite value. The specific value is determined and bounded by the digits for that number. To me it seems utterly obvious an infinite number digits would make the value of that number completely unbounded and the idea there might a natural number that has and infinite number of powers of $10$s is utterly absurd. Nothing counter intuitive about that at all. – fleablood Apr 15 '25 at 06:45
  • The gates to Berlin are open and another person can always move in. They might not have a place to live but they can be homeless in the streets. Since you can always add more people to Berlin. Does "extrapolating that" mean that eventually Berlin will have an infinite population? "Extrapolating" from a finite number of cases doesn't mean you'll ever get an infinite case. If an integer had an infinite number of digits then what value would that integer actually have. What would it mean to have that many ducks in a lake? How many ducks actually is that? – fleablood Apr 15 '25 at 06:52