Your task is to write a short program that represents a large (infinite) ordinal, using a well-ordering of the set of positive integers. Your program will take two different positive integers and indicate which one is greater in your chosen well-ordering. The order type of the well-order is the represented ordinal. The challenge is to min-max your code size and the represented ordinal respectively.
Explanation
Usually the positive integers are ordered like so:
1, 2, 3, 4, 5, ...
In this ordering, the expressions: 2 < 5
, 1 < 2
, 3 < 19
, are true, as usual. The expressions 5 < 2
, 10 < 3
, and so on, are false. However, we can order the positive integers also in the following way:
2, 4, 6, 8, 10, ..., 1, 3, 5, 7, ...
Here all the even numbers are followed by all the odd numbers. Now the expressions 2 < 1
, 6 < 8
, 1 < 5
, 100 < 51
are true, and the expressions 101 < 2
5 < 3
and 120 < 110
are false.
This is another well-ordering:
2, 4, 6, 8, 10, ..., 3, 9, 15, 21, ..., 5, 25, 35, 55, ..., 7, 49, 77, ..., ..., 1
First we have all the even numbers, then all the remaining numbers that are divisible by 3, then ones that are divisible by 5 and so on. Finally, at the very end is 1. Notice that we have a nested "...". This is allowed. What is not allowed is a "..." that starts from the left.
1, 3, 5, 7, 9, ..., ..., 10, 8, 6, 4, 2
This is not a well-order (just a total order). A more rigorous way of stating this rule is that every nonempty subset must have a smallest element. Here the subset of even numbers doesn't have a smallest element.
Another way of looking at this, is to imagine starting from the right and walking to the left. You can jump over an arbitrary (possibly infinite) amount of numbers, but you have to always go left. If the numbers are well-ordered, your walk will always take a finite amount of steps. In this example however, you can just stay on the even side, by never jumping over the three dots, thus never reaching the beginning.
Notice that if you lay the three well-orders on top of each other like so:
1, 2, 3, 4, 5, ...
2, 4, 6, 8, 10, ..., 1, 3, 5, 7, ...
2, 4, 6, 8, 10, ..., 3, 9, 15, 21, ..., 5, 25, ..., ..., 1
They have different "length". The bottom one is the longest, and the top one is the shortest. The "length" is called the "order type", and it can be measured with an ordinal. Our first well-order has order type \$\omega\$, the second one \$\omega\cdot2\$ and the third one is \$\omega^2+1\$
Your program will compare two positive integers, according to a well-ordering of your choice. That way your program will represent the order type of your well-order.
For more info on ordinals, visit the Wikipedia page for ordinals and ordinal arithmetic. For more ordinals, visit Googology Wiki. Also check out the previous infinite ordinal question on Code Golf.
More ordinal examples
\$\omega\$ 1, 3, 2, 4, 5, 7, 6, 8, ...
\$\omega^2\$ 1, 2, 4, 8, 16, ..., 3, 5, 6, 9, 10, 12, 17, 18, ..., 7, 11, 13, 14, 19, 21, 22, ..., 15, 23, 27, ..., ...
(popcount then value)
\$\omega^2+\omega\$ 2, 4, 8, 16, 32, ..., 3, 9, 27, 81, ..., 5, 25, 125, ..., ..., 1, 6, 10, 12, 14, ...
\$\omega^\omega\$ 1, 2, 4, 8, 16, ..., 3, 6, 12, 24, 48, ..., 9, 18, 36, 72, ..., ..., 5, 10, 20, 40, 80, ..., 15, 30, ..., 45, ..., ..., ..., etc.
(reverse lexiographic ordering of the standard form)
Rules
You must pick a well-ordering on \$\mathbb{Z}^+\$. A well ordering is a binary relation \$<\$ such that for all distinct elements \$a\$, \$b\$, \$c\$, \$a<b\space\veebar\space b<a\$ and \$a<b\space\land\space b<c\implies a<c\$ and also for every nonempty subset \$S\$ of \$\mathbb{Z}^+\$, there is a minimal element \$m\$, so that for every other member \$n\$ in \$S\$, \$m<n\$.
Your program will receive two distinct positive integers \$a\$ and \$b\$ in some reasonable format. The program will output TRUE if \$a<b\$ and FALSE otherwise. Instead of "TRUE" and "FALSE", you can choose any two distinct output strings, such as ("true", "false"), ("1", "0") and so on.
Instead of reading from stdin/cmdline and writing to sdtout, you can make a function that takes two integers. The function should still have only two possible (distinct) return values, although they don't have to be strings.
If your programming language has no built-in bignum support, you can assume that a native integer datatype has infinite range (doesn't overflow).
Scoring
Your score is the tuple \$(Value, Bytes)\$ where \$Value\$ is the represented ordinal and \$Bytes\$ is the number of bytes in your program. For example, if you implement the ordinal \$\omega^3+\omega\$ in 6 bytes, your score is \$(\omega^3+\omega, 6)\$.
To compare scores we define a partial order \$\ge\$ so that \$(v_0, b_0)\ge (v_1, b_1)\$ iff \$v_0\ge v_1\$ and \$b_0\le b_1\$. A score \$(v_0, b_0)\$ is better than a score \$(v_1, b_1)\$ iff \$(v_0, b_0)\ge (v_1, b_1)\$ and the scores are not equal.
In other words, your submission is better than another submission, if you achieve more bang-for-buck. That is, you achieve a bigger ordinal with the same number of bytes, or achieve the same ordinal, with a smaller amount of bytes. And obviously if you achieve a bigger ordinal with fewer bytes, your submission is better.
This does mean that some scores can't be compared. For example, \$(\omega\cdot 2, 2)\$ and \$(\omega^2, 4)\$ are incomparable.
You are a winner if there is no submission that is better than yours. If there are two or more submissions with the exact same score, the one submitted first is the winner. Since some scores can't be compared with others, there can be multiple winners. You are free to make multiple submissions, and possibly have multiple winning ones.
List of winning submissions
Bytes | Value | Language and Author |
---|---|---|
1 | \$\omega\$ | Polyglot - community wiki |
6 | \$\omega^\omega\$ | Pyth - Anders Kaseorg |
12 | \$\omega^\omega+1\$ | Husk - Dominic van Essen |
17 | \$\varepsilon_0\$ | Pyth - Anders Kaseorg |
208 | \$\phi_{\Omega^\omega}(0)\cdot\omega\$ | Haskell - Grain Ghost |
218+2\$n\$ | \$\phi_{\Omega^\omega}(0)^n\cdot\omega\$ | Haskell - Grain Ghost |