2
$\begingroup$

I'll call it the binary encoding with sets. I think it's nice and trivial, should have been discovered by many genius brains, but i can't find it by searching with efforts.

Prior arts are Zermelo's and Von Neumann's definition of ordinals, both starting from $0=\emptyset=\{\}$, then followed by $s(n):=\{n\}$ or $s(n):=n\cup\{n\}$ correspondingly.

The binary encoding just encodes the indices of bits the "binary form" of a natural number has. A few examples summarizes it: $0=\{\}$, $1=\{0\}$, $2=\{1\}$, $3=\{0,1\}$, $4=\{2\}$, $5=\{0,2\}$, etc... Here's a longer list since it looks satisfying (using both $\emptyset$ and $\{\}$ for the empty set):

0 {} ∅
1 {{}} {∅}
2 {{{}}} {{∅}}
3 {{}{{}}} {∅{∅}}
4 {{{{}}}} {{{∅}}}
5 {{}{{{}}}} {∅{{∅}}}
6 {{{}}{{{}}}} {{∅}{{∅}}}
7 {{}{{}}{{{}}}} {∅{∅}{{∅}}}
8 {{{}{{}}}} {{∅{∅}}}
9 {{}{{}{{}}}} {∅{∅{∅}}}
10 {{{}}{{}{{}}}} {{∅}{∅{∅}}}
11 {{}{{}}{{}{{}}}} {∅{∅}{∅{∅}}}
12 {{{{}}}{{}{{}}}} {{{∅}}{∅{∅}}}
13 {{}{{{}}}{{}{{}}}} {∅{{∅}}{∅{∅}}}
14 {{{}}{{{}}}{{}{{}}}} {{∅}{{∅}}{∅{∅}}}
15 {{}{{}}{{{}}}{{}{{}}}} {∅{∅}{{∅}}{∅{∅}}}
16 {{{{{}}}}} {{{{∅}}}}
17 {{}{{{{}}}}} {∅{{{∅}}}}
18 {{{}}{{{{}}}}} {{∅}{{{∅}}}}
19 {{}{{}}{{{{}}}}} {∅{∅}{{{∅}}}}
20 {{{{}}}{{{{}}}}} {{{∅}}{{{∅}}}}
21 {{}{{{}}}{{{{}}}}} {∅{{∅}}{{{∅}}}}
22 {{{}}{{{}}}{{{{}}}}} {{∅}{{∅}}{{{∅}}}}
23 {{}{{}}{{{}}}{{{{}}}}} {∅{∅}{{∅}}{{{∅}}}}
24 {{{}{{}}}{{{{}}}}} {{∅{∅}}{{{∅}}}}
25 {{}{{}{{}}}{{{{}}}}} {∅{∅{∅}}{{{∅}}}}
26 {{{}}{{}{{}}}{{{{}}}}} {{∅}{∅{∅}}{{{∅}}}}
27 {{}{{}}{{}{{}}}{{{{}}}}} {∅{∅}{∅{∅}}{{{∅}}}}
28 {{{{}}}{{}{{}}}{{{{}}}}} {{{∅}}{∅{∅}}{{{∅}}}}
29 {{}{{{}}}{{}{{}}}{{{{}}}}} {∅{{∅}}{∅{∅}}{{{∅}}}}
30 {{{}}{{{}}}{{}{{}}}{{{{}}}}} {{∅}{{∅}}{∅{∅}}{{{∅}}}}
31 {{}{{}}{{{}}}{{}{{}}}{{{{}}}}} {∅{∅}{{∅}}{∅{∅}}{{{∅}}}}
32 {{{}{{{}}}}} {{∅{{∅}}}}

What's more satisfying is it forms a one-to-one correspondence between "finite sets of sets" (we might need a proper description here) to natural numbers. (There's too little room for me to write the complete proof though)

The succesor function and comparator will be a bit harder but definitely doable since it's just matter of bit operations. like, $\mathop{addbit}(x,b)=\mathrm{if}(b\notin x): \{b\}\cup x, \mathrm{otherwise}:\mathrm{addbit}(x\setminus b, \mathrm{addbit}(b,0))$ and $s(x)=\mathrm{addbit}(x,0)$.

ps. Some states Zermelo's definition faces problem when dealing with "limit" because of "infinite nesting" while Von Neumann's doesn't. I'm not sure how to understand it since I think it's kinda obvious that Von Neumann's construct also nests infinitly as it (by definition) contains "strictly more" elements (I suspect we need another proper term here). Still, Computer-Science-wise, this scheme nests asymptotically less, say, $O(\log^* n)$.

$\endgroup$
2
  • 2
    $\begingroup$ This looks like (inverse) Ackermann coding. What you call "finite set of sets" is called a hereditarily finite set. This does have uses in logic (eg proving PA interprets ZF-Inf), though I'm not aware of it being used as a definition of natural number. Nice job coming up with it though! It has some similar shortcomings to the Zermelo definition - it doesn't extend naturally to infinite ordinals, and you lose the property that $n$ has cardinality $n$. Proving your addbit operation is well-defined will also take some work. $\endgroup$ Commented Apr 9 at 7:43
  • $\begingroup$ oooops i've actually found the article, but didn't read through it carefully that when i saw the "n pairs of brackets" i thought the Ackermann coding is sorted by the number of pairs of brackets used.... and now i see it's exactly same as what i've came up with, just no one seem to provide coding examples like i did. thx! $\endgroup$ Commented Apr 9 at 9:18

0

You must log in to answer this question.