General Recursive Function: Difference between revisions
Add assymtotic champions |
elaborate |
||
| (71 intermediate revisions by 5 users not shown) | |||
| Line 5: | Line 5: | ||
'''BBµ'''(n) is a [[Busy Beaver function]] for GRFs:<math display="block">BB \mu (n) = \max \{ f() | f \in \text{GRF}_0 , |f| = n \}</math> | '''BBµ'''(n) is a [[Busy Beaver function]] for GRFs:<math display="block">BB \mu (n) = \max \{ f() | f \in \text{GRF}_0 , |f| = n \}</math> | ||
where <math>f \in GRF_k</math> means that <math>f: \N^k \rightharpoonup \N</math> is a k-ary GRF and <math>|f|</math> is the "structural size" of ''f'' ( | where <math>f \in GRF_k</math> means that <math>f: \N^k \rightharpoonup \N</math> is a k-ary GRF and <math>|f|</math> is the "structural size" of ''f'' (the number of atoms and combinators in the definition, [[General Recursive Function#Size|see details below]]). In other words, it is the largest number computable via a 0-ary function (a constant) with a limited "program" size. It is more akin to the traditional [[Sigma score]] for a Turing machine rather than the Step function in the sense that it maximizes over the produced value, not the number of steps needed to reach that value. | ||
== Definition == | == Definition == | ||
| Line 20: | Line 20: | ||
===== Combinators ===== | ===== Combinators ===== | ||
* Composition: <math>\forall k,m \in \N, \forall h \in GRF_m, \forall g_1, \dots g_m \in GRF_k, C(h, g_1, \dots g_m) \in GRF_k</math> is the composition or substitution of the ''g''s into ''h'': <math>C(h, g_1, \dots g_m)(x_1, \dots x_k) = h(g_1(x_1, \dots x_k), \dots g_m(x_1, \dots x_k))</math> | * Composition: <math>\forall k,m \in \N, \forall h \in GRF_m, \forall g_1, \dots g_m \in GRF_k, C^k(h, g_1, \dots g_m) \in GRF_k</math> is the composition or substitution of the ''g''s into ''h'': <math>C^k(h, g_1, \dots g_m)(x_1, \dots x_k) = h(g_1(x_1, \dots x_k), \dots g_m(x_1, \dots x_k))</math> | ||
* Primitive Recursion: <math>\forall k \in \N, \forall g \in GRF_k, \forall h \in GRF_{k+2}, R(g, h) \in GRF_{k+1}</math> is primitive recursion using ''g'' as the base case and ''h'' as the inductive step. | * Primitive Recursion: <math>\forall k \in \N, \forall g \in GRF_k, \forall h \in GRF_{k+2}, R^{k+1}(g, h) \in GRF_{k+1}</math> is primitive recursion using ''g'' as the base case and ''h'' as the inductive step. | ||
* Minimization / Unlimited Search: <math>\forall k \in \N, \forall f \in GRF_{k+1}, M(f) \in GRF_k</math> is the µ-operator which allows unlimited search. | * Minimization / Unlimited Search: <math>\forall k \in \N, \forall f \in GRF_{k+1}, M^k(f) \in GRF_k</math> is the µ-operator which allows unlimited search. | ||
The arity superscripts for C, R and M are redundant (except for <math>C^k(h)</math>) and so are sometimes omitted below. | |||
=== Size === | |||
The size of a GRF is the number of atoms and combinators in the definition: | |||
* <math>|Z^k| = |P^k_i| = |S| = 1</math> | |||
* <math>|C(h, g_1, \cdots, g_m)| = 1 + |h| + |g_1| + \cdots + |g_m|</math> | |||
* <math>|R(g, h)| = 1 + |g| + |h|</math> | |||
* <math>|M(f)| = 1 + |f|</math> | |||
=== Primitive Recursion === | === Primitive Recursion === | ||
| Line 30: | Line 39: | ||
Iterative case (for <math>x_1 > 0</math>): <math>R^k(g, h)(x_1, x_2, ..., x_k) = h(x_1-1, v, x_2, x_3, ..., x_k)</math> where <math>v = R(g, h)(x_1-1, x_2, x_3, ..., x_k)</math>. | Iterative case (for <math>x_1 > 0</math>): <math>R^k(g, h)(x_1, x_2, ..., x_k) = h(x_1-1, v, x_2, x_3, ..., x_k)</math> where <math>v = R(g, h)(x_1-1, x_2, x_3, ..., x_k)</math>. | ||
''R'' can be recursively evaluated following its definition directly or it can be simulated as a bounded <code>for</code> loop like this python code:<pre> | |||
# f = R(g,h) | |||
def f(n, *xs): | |||
acc = g(*xs) | |||
for k in range(n): | |||
acc = h(k, acc, *xs) | |||
return acc | |||
</pre>The iterative function ''h'' is passed two synthetic args in the front: (''k'') iteration number (0-indexed) and (''acc'') "accumulator" from previous iterations. | |||
Both the base and iterative cases can be parameterized by values <math>x_2, x_3, ..., x_k</math>. | |||
If you restrict functions to only those constructible with Z, S, P, C, R (no M) then this defines the Primitive Recursive Functions, a subset of the General Recursive Functions that always halt. | |||
=== Minimization === | === Minimization === | ||
<math>M^k(f)(x_1, ..., x_k) \triangleq \min \{i \in \N: f(i, x_1, ..., x_k) = 0\}</math> | <math>M^k(f)(x_1, ..., x_k) \triangleq \min \{i \in \N: f(i, x_1, ..., x_k) = 0\}</math> | ||
In computational language, when ''M(f)'' is evaluated it can be considered to calculate <math>f(i, x_1, ..., x_k)</math> with <math>i=0</math>, then <math>i=1</math>, then <math>i=2</math> etc. until one of the calls to <math>f</math> returns 0, at which point it returns the value of <math>i</math> which first gave a result of 0. If no first argument causes <math>f</math> to return 0, <math>M(f)</math> doesn't return | In computational language, when ''M(f)'' is evaluated it can be considered to calculate <math>f(i, x_1, ..., x_k)</math> with <math>i=0</math>, then <math>i=1</math>, then <math>i=2</math> etc. until one of the calls to <math>f</math> returns 0, at which point it returns the value of <math>i</math> which first gave a result of 0. If no first argument causes <math>f</math> to return 0, <math>M(f)</math> doesn't return (this is the only way for a GRF to not halt). | ||
== Macros == | == Macros == | ||
In order to improve readability we define the following macros. For all <math>f \in GRF_1</math> | In order to improve readability we define the following macros. For all <math>f \in GRF_2, g \in GRF_1</math> | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ | |+ | ||
| Line 68: | Line 87: | ||
|<math>2n-1</math> | |<math>2n-1</math> | ||
|<math>\lambda x. x+n</math> | |<math>\lambda x. x+n</math> | ||
|- | |||
|Addition | |||
|Add | |||
|2 | |||
|<math>Add := R(P^1_1, C(S, P^3_2))</math> | |||
|5 | |||
|<math>\lambda xy. x+y</math> | |||
|- | |- | ||
|Triangular numbers | |Triangular numbers | ||
|<math>Tri</math> | |<math>Tri</math> | ||
|1 | |1 | ||
|<math>Tri := R(Z^0, R(S, C( | |<math>Tri := R(Z^0, R(S, C(S, P^3_2)))</math> | ||
| | |7 | ||
|<math>\lambda x. \frac{x(x+1)}{2}</math> | |<math>\lambda x. \frac{x(x+1)}{2}</math> | ||
|- | |- | ||
|Iteration | |Iteration | ||
|<math>RepSucc[ | |<math>RepSucc[g]</math> | ||
|2 | |2 | ||
|<math>RepSucc[f] := R(S, | |<math>RepSucc[g] := R(S, C(g, P^3_2))</math> | ||
|<math>|g| + 4</math> | |||
|<math>\lambda x\ y. g^x(y+1)</math> | |||
|- | |||
|Iteration on first arg | |||
|<math>RepFirst[f]</math> | |||
|2 | |||
|<math>RepFirst[f] := R^2(S, R^3(f, P^4_2))</math> | |||
|<math>|f| + 4</math> | |<math>|f| + 4</math> | ||
|<math>\lambda x\ y. f^x(y+1)</math> | |<math>\lambda x\ y. (\lambda z. f(z, y))^x (y+1)</math> | ||
|- | |- | ||
|Diagonalization & Iteration | |Diagonalization & Iteration | ||
|<math>DiagRep[f]</math> | |<math>DiagRep[f]</math> | ||
| | |2 | ||
|<math>DiagRep[f] := R(S, C(f, P^3_2, P^3_2))</math> | |<math>DiagRep[f] := R(S, C(f, P^3_2, P^3_2))</math> | ||
|<math>|f| + 5</math> | |<math>|f| + 5</math> | ||
| Line 97: | Line 130: | ||
|<math>\lambda x. f(x+1, x+1)</math> | |<math>\lambda x. f(x+1, x+1)</math> | ||
|- | |- | ||
|Ackermann iteration | | rowspan="2" |Ackermann iteration | ||
|<math>AckDiag2[n,f]</math> | |||
|2 | |||
|<math>\begin{array}{lcl} | |||
AckDiag2[0,f] & := & RepSucc[f] \\ | |||
AckDiag2[n+1,f] & := & DiagRep[AckDiag2[n,f]] | |||
\end{array}</math> | |||
|<math>5n + 4 + |f|</math> | |||
| | |||
|- | |||
|<math>AckDiag[n,f]</math> | |<math>AckDiag[n,f]</math> | ||
|1 | |1 | ||
|<math> | |<math>AckDiag[n,f] := DiagS[AckDiag2[n,f]]</math> | ||
|<math>5n + 7 + |f|</math> | |<math>5n + 7 + |f|</math> | ||
| | | | ||
| Line 109: | Line 148: | ||
== Champions == | == Champions == | ||
We divide the champions tables up by enumeration categories. Starting from the simplest functions and moving to the most general. | |||
=== Composition Functions === | |||
The simplest category are PRFs without Recursion. In other words, only atoms and Composition. All composition functions are equivalent to either <math>Plus[n]</math>, <math>C(Plus[n], P_i^k)</math> or <math>K^k[n] = C(Plus[n], Z^k)</math>. For BBµ, the only options are <math>K^0[n]</math> which is size 2n+1. These can be trivially extended to <math>C^0(K^0[n])</math> of size 2n+2. So this proves that <math>BB\mu(2n+1), BB\mu(2n+2) \ge n</math>. These are the best known champions up to size 13. | |||
=== Primitive Recursive Functions === | |||
We get considerably more complexity by allowing all Primitive Recursive Functions (PRFs). But PRFs are still all guaranteed to be total, are decidable and are all dominated by Ackermann growth functions. They are convenient to enumerate since none diverge, so any holdouts that remain when running limited computations must eventually halt. All PRF champions up to size 13 are simple composition functions as mentioned above. PRFs with R begin at size 14. | |||
The size 21-24 PRF champions are also currently full GRF champions, although it seems likely that M(PRF) will surpass these values, it just hasn't been run out that far yet. | |||
{| class="wikitable" | {| class="wikitable" | ||
!n | !n | ||
! | !Max Score | ||
! | !Champions | ||
!Champion Found | !Champion Found | ||
!Holdouts | !# Holdouts | ||
|- | |- | ||
|13 | |13 | ||
| | |= 6 | ||
|< | |<code>K[6]</code> | ||
| | | | ||
|0 | |||
|- | |- | ||
|14 | |14 | ||
| | |= 7 | ||
|< | |<code>C(DiagS[RepSucc[S]], K[2])</code> | ||
<code>C(DiagS[RepSucc[Plus[2]]], K[1])</code> | |||
|Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1492246885329670184 10 Apr 2026] | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1492246885329670184 10 Apr 2026] | ||
| | |0 | ||
|- | |- | ||
|15 | |15 | ||
|= 7 | |||
|<code>K[7]</code> | |||
| | | | ||
| | |0 | ||
|- | |- | ||
|16 | |16 | ||
| | |= 10 | ||
|< | |<code>C(DiagS[RepSucc[Plus[2]]], K[2])</code> | ||
|Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1492394919728517160 11 Apr 2026] | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1492394919728517160 11 Apr 2026] | ||
| | |0 | ||
|- | |- | ||
|17 | |17 | ||
| | |= 15 | ||
|< | |<code>C(DiagS[DiagRep[RepSucc[S]]], K[1])</code> | ||
|Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1492990073820545125 12 Apr 2026] | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1492990073820545125 12 Apr 2026] | ||
| | |0 | ||
|- | |- | ||
|18 | |18 | ||
| | |= 21 | ||
|< | |<code>C(DiagS[RepSucc[Tri]], K[1])</code> | ||
<code>C(DiagS[RepFirst[RepSucc[Plus[2]]]], K[1])</code> | |||
|Jacob Mandelson [https://discord.com/channels/960643023006490684/1447627603698647303/1492021428546179182 9 Apr 2026] | |Jacob Mandelson [https://discord.com/channels/960643023006490684/1447627603698647303/1492021428546179182 9 Apr 2026] | ||
| | |0 | ||
|- | |- | ||
|19 | |19 | ||
| | |= 39 | ||
|< | |<code>C(DiagS[DiagRep[RepSucc[S]]], K[2])</code> | ||
|Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1492997385247264941 12 Apr 2026] | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1492997385247264941 12 Apr 2026] | ||
| | |0 | ||
|- | |- | ||
|20 | |20 | ||
| | |= 1540 | ||
|< | |<code>C(DiagS[RepSucc[Tri]], K[2])</code> | ||
|Jacob Mandelson 9 Apr 2026 | |Jacob Mandelson 9 Apr 2026 | ||
| | |0 | ||
|- | |- | ||
|21 | |21 | ||
| | |= 8,589,934,591 | ||
| | |<code>C(DiagS[RepFirst[DiagRep[RepSucc[S]]]], K[1])</code> | ||
| | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1505396390665130035 16 May 2026] | ||
| | |0 | ||
|- | |- | ||
|22 | |22 | ||
|<math> | |<math>\approx 10^{10^{69}}</math> | ||
|< | |<code>C(DiagS[RepFirst[RepSucc[Tri]]], K[1])</code> | ||
|Shawn Ligocki | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1506168696605904946 17 May 2026] | ||
| | |Deciders: [https://discord.com/channels/960643023006490684/1447627603698647303/1507804514650947654 11] | ||
All decided by hand | |||
|- | |- | ||
|23 | |23 | ||
|<math>> 10^{10^{463}}</math> | |<math>> 10^{10^{463}}</math> | ||
|< | |<code>C(DiagS[DiagRep[RepSucc[Tri]]],K[1])</code> | ||
|Shawn Ligocki | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1519532827186565314 24 Jun 2026] | ||
| | |[https://discord.com/channels/960643023006490684/1447627603698647303/1518981870254297138 129] | ||
|- | |- | ||
|24 | |24 | ||
| | |<math>> 2^{2^{2^{2^{2^{20}}}}}</math> | ||
| | |<code>C(DiagS[RepFirst[RepSucc[Tri]]], K[2])</code> | ||
| | |Shawn Ligocki 17 May 2026 | ||
| | |Not yet enumerated | ||
|} | |||
=== M(PRF) === | |||
We get another level of complexity by allowing Minimization, but only at the very top level. In other words, all of these GRF are M(f) for some PRF f. We call this M(PRF) or <code>min_prf</code>. This is a convenient set to explore because (1) it is Turing complete, (2) it is a smaller domain and easier to enumerate than full GRF, (3) all small known champions are of this form. | |||
All M(PRF) champions up to size 13 are simple composition functions as mentioned above. | |||
{| class="wikitable" | |||
!n | |||
!Max Score | |||
!Champions | |||
!Champion Found | |||
!# Holdouts | |||
|- | |- | ||
| | |12 | ||
| | |= 5 | ||
|< | |<code>C(K[5])</code> | ||
| | | | ||
|0 | |||
|- | |- | ||
| | |13 | ||
|= 6 | |||
| | |<code>K[6]</code> | ||
| | |||
| | | | ||
|Deciders: 15 | |||
All proven by hand | |||
|- | |- | ||
| | |14 | ||
|<math> | |≥ 32 | ||
|<math>M^{0}(C^{1}(R^{2}(P^{1}_{1}, R^{3}(P^{2}_{1}, C^{4}(R^{2}(P^{1}_{1}, P^{3}_{1}), P^{4}_{2}, P^{4}_{1}))), P^{1}_{1}, S))</math><math>M^{0}(C^{1}(R^{2}(S, R^{3}(P^{2}_{1}, C^{4}(R^{2}(P^{1}_{1}, P^{3}_{1}), P^{4}_{2}, P^{4}_{1}))), P^{1}_{1}, P_1^1))</math> | |||
|Shawn Ligocki | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1499223592263745617 29 Apr 2026] | ||
| | |109 | ||
|- | |- | ||
| | |15 | ||
| | |≥ 32 | ||
| | |C^0(size 14 champ) | ||
| | | | ||
|589 | |||
|- | |- | ||
| | |16 | ||
| | |≥ 47 | ||
|<math>C( | |<math>M(C(R(S, R(P^2_1, R(P^3_2, C(R(S, P^3_1), P^5_3, P^5_2)))), P^1_1, S))</math> | ||
|Shawn Ligocki | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1501347538287067267 5 May 2026] | ||
| | |3,430 | ||
|- | |- | ||
| | |17 | ||
| | |≥ 58,471 | ||
|< | |<code>M(C(R(P(1,1),R(R(S,R(R(S,R(Z2,P(4,1))),P(4,2))),P(4,2))),S,P(1,1)))</code> | ||
|Shawn Ligocki | |Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1521327240732737536 29 Jun 2026] | ||
| | |19,862 | ||
|- | |- | ||
| | |18 | ||
| | | | ||
| | | | ||
| | | | ||
|93,738 | |||
|- | |- | ||
|19 | |||
| | | | ||
| | | | ||
| | |||
|1,419,487 | |||
|- | |||
|20 | |||
| | | | ||
| | | | ||
| | | | ||
|7,508,624 | |||
|} | |||
=== Full GRF === | |||
The final level is full GRF where Minimization is allowed at any level. The only champions currently at this level are hand-constructed GRF designed to surpass [[Graham's number]]. | |||
{| class="wikitable" | |||
!n | |||
!BBµ(n) | |||
!Champion | |||
!Champion Found | |||
!# Holdouts | |||
|- | |- | ||
| | |93 | ||
| | |<math>>f_{\omega+1}(f_\omega(2 \uparrow\uparrow\uparrow 2 \uparrow\uparrow\uparrow 6)) \gg \text{Graham's number}</math> | ||
| | |Graham() from [https://github.com/sligocki/etc/blob/main/gen_rec/mgrf/goodstein.mgrf goodstein.mgrf] | ||
|Shawn Ligocki | |Racheline and Shawn Ligocki [https://discord.com/channels/960643023006490684/1447627603698647303/1506295959049474068 19 May 2026] | ||
| | | | ||
|- | |- | ||
| | |... | ||
| | | | ||
| | | | ||
| Line 320: | Line 328: | ||
| | | | ||
|- | |- | ||
| | |98 | ||
| | |<math>> f_\omega^{f_\omega^3(3)}(3) \gg \text{Graham's number}</math> | ||
| | |Graham() from [https://github.com/sligocki/etc/blob/main/gen_rec/mgrf/ack_worm.mgrf ack_worm.mgrf] | ||
|Shawn Ligocki | |Shawn Ligocki 17 May 2026 | ||
| | | | ||
|} | |||
== Analysis of Champions == | |||
=== BBµ(14) ≥ 32 === | |||
This is the smallest non-trivial champion:<pre> | |||
Expression: M(C(R(P(1,1), R(P(2,1), C(R(P(1,1), P(3,1)), P(4,2), P(4,1)))), P(1,1), S)) | |||
Arity: 0 | Size: 14 | GRF | |||
=== Sub-expressions === | |||
a := R(P(1,1), P(3,1)) [arity 2, size 3, PRF, used={1,2}] | |||
a(0, y) = y | |||
a(x, _) = x-1 | |||
b := R(P(2,1), C(a, P(4,2), P(4,1))) [arity 3, size 8, PRF, used={1,2}] | |||
if 0 ≤ x ≤ y: b(x,y) = y-x | |||
if y+1 ≤ x ≤ 2y+1: b(x,y) = 2y+1-x | |||
b(x, y) = (y+1) 2^k - 1 - x (where k is minimal such that this is ≥ 0) | |||
c := R(P(1,1), b) [arity 2, size 10, PRF, used={1,2}] | |||
def c(x, y): | |||
acc = y | |||
for i in range(x): | |||
acc = b(i,acc) | |||
return acc | |||
=== Root === | |||
d := M(C(c, P(1,1), S)) [arity 0, size 14] | |||
def d(): | |||
for n in 0..: | |||
acc = n+1 | |||
for i in range(n): | |||
while acc < i: | |||
acc = 2*acc + 1 | |||
acc -= i | |||
if acc == 0: | |||
return n | |||
d() = 32 | |||
</pre>This GRF subtracts numbers 0 to n-1 from accumulator starting at n+1 with a slightly complex underflow condition (what to do when the number goes negative). It repeats this on increasing n until this process happens to hit exactly 0. It appears to be chaotic. It can be parameterized in a couple of ways by swapping S <-> P(1,1). This parameterization seems to get the luckiest and make it up to n=32 before halting. The other co-champion has the exact same behavior, just by switching when we do S vs P(1,1) for the base case. | |||
== Cryptids == | |||
So far all [[Cryptids]] have been constructed by hand; no GRFs found in the wild have been categorized as Cryptids yet. | |||
{| class="wikitable" | |||
|+Hand Constructed Cryptids | |||
!Size | |||
!Problem | |||
!Authors | |||
!Ref | |||
|- | |- | ||
| | |49 | ||
| | |[[wikipedia:Brocard's_problem|Brocard's problem]] | ||
| | |aparker, star and Shawn 3 May 2026 | ||
| | |[https://github.com/sligocki/etc/blob/main/gen_rec/mgrf/brocard.mgrf brocard.mgrf] [https://discord.com/channels/960643023006490684/1447627603698647303/1500605707748245524 Discord] | ||
| | |- | ||
|56 | |||
|5x+1 trajectory of 7 | |||
|Shawn Ligocki 2 May 2026 | |||
|[https://github.com/sligocki/etc/blob/main/gen_rec/mgrf/collatz.mgrf collatz.mgrf] | |||
|- | |||
|81 | |||
|Erdős ternary conjecture | |||
|Shawn Ligocki 28 Apr 2026 | |||
|[https://github.com/sligocki/etc/blob/main/gen_rec/mgrf/erdos.mgrf erdos.mgrf] | |||
|- | |- | ||
| | |139 | ||
| | |Antihydra-like problem | ||
| | |Jacob Mandelson 8 Apr 2026 | ||
|[https://discord.com/channels/960643023006490684/1447627603698647303/1491642156295913482 Orig (size 141)] [https://discord.com/channels/960643023006490684/1447627603698647303/1494889866704588983 Size 139] | |||
|} | |} | ||
There is also a size 133 GRF that searches for counterexamples to Fermat's Last Theorem, halting iff it ever found one (however, since FLT has been [https://www.jstor.org/stable/2118559 proven], this GRF can be shown to be non-terminating, and is therefore not considered a Cryptid): [https://github.com/sligocki/etc/blob/main/gen_rec/mgrf/fermat.mgrf fermat.mgrf] | |||
== Notable GRF == | |||
=== Unsolved GRFs === | |||
* Size 16: <code>M(C(R(S, R(C(S, P(2,1)), C(R(P(1,1), P(3,1)), P(4,2), P(4,1)))), P(1,1), S))</code>[https://discord.com/channels/960643023006490684/1447627603698647303/1501444301245382707 Discord] [https://discord.com/channels/960643023006490684/1447627603698647303/1504211320864505947 Discord] | |||
** It is known that if this function returns a value, it must be greater than 499 quadrillion. [https://discord.com/channels/960643023006490684/1447627603698647303/1546666535911821413 Discord] | |||
=== Solved GRFs === | |||
==== Hardest Size 12 ==== | |||
This is subjective of course, but it seems like the hardest size 12 M(PRF) holdout is <code>M(R(C(S, Z0), R(S, R(R(S, P(3,1)), P(4,2)))))</code>. Proving it seems requires noticing the pattern that d(x) = x-2 for all x ≥ 3 and proving that it inductively follows that pattern for all future values.<sup>[https://discord.com/channels/960643023006490684/1447627603698647303/1508151420258484354]</sup><pre> | |||
Expression: M(R(C(S, Z0), R(S, R(R(S, P(3,1)), P(4,2))))) | |||
Arity: 0 | Size: 12 | GRF | |||
=== Sub-expressions === | |||
a := R(S, P(3,1)) [arity 2, size 3, PRF, used={1,2}] | |||
a(0, y) = 1 + y | |||
a(x, _) = x-1 | |||
b := R(a, P(4,2)) [arity 3, size 5, PRF, used={1,2,3}] | |||
b(_, 0, z) = 1 + z | |||
b(_, y, _) = y-1 | |||
c := R(S, b) [arity 2, size 7, PRF, used={1,2}] | |||
c(x, y) = (1 + y - x) %< (2 + y) | |||
d := R(C(S, Z0), c) [arity 1, size 11, PRF, used={1}] | |||
d(0) = 1 | |||
d(1) = 2 | |||
d(2) = 2 | |||
d(x) = x - 2 | |||
=== Root === | |||
M(d) [arity 0, size 12] | |||
= ∞ | |||
</pre> | |||
==== Hardest Size 13 (Triangular Divisibility) ==== | |||
Likewise, it seems like the hardest size 13 M(PRF) holdout is <code>M(C(R(S, R(P(2,1), R(R(P(2,2), P(4,1)), P(5,2)))), P(1,1), P(1,1)))</code> which halts iff there exists some n ≥ 1 such that n+2 divides <math>Tri(n) = \frac{n(n+1)}{2}</math>. There is no such n,<sup>[https://discord.com/channels/960643023006490684/1447627603698647303/1527405134857113650]</sup> therefore this GRF diverges, but this requires reasoning about divisibility and modular arithmetic. | |||
==== Tetrahedral Divisibility ==== | |||
The GRF <math>M^{0}(C^{1}(R^{2}(S, R^{3}(P^{2}_{1}, R^{4}(P^{3}_{1}, R^{5}(R^{4}(P^{3}_{3}, P^{5}_{1}), P^{6}_{2})))), S, S))</math> (Size 15) halts iff there exists some n ≥ 1 such that n+3 divides <math>Tetr(n) = \frac{n(n+1)(n+2)}{6}</math>.<sup>[https://discord.com/channels/960643023006490684/960643023530762341/1500584497542987776]</sup> aparker<sup>[https://discord.com/channels/960643023006490684/960643023530762341/1500587569514283098]</sup> and star<sup>[https://discord.com/channels/960643023006490684/960643023530762341/1500595210919346337]</sup> proved that there is no such n, therefore this GRF diverges. | |||
==== Chaotic size 15 ==== | |||
<pre> | |||
Expression: M(C(R(P(1,1), R(R(S, P(3,1)), R(R(P(2,2), P(4,1)), P(5,2)))), S, P(1,1))) | |||
Arity: 0 | Size: 15 | GRF | |||
=== Sub-expressions === | |||
a := R(S, P(3,1)) [arity 2, size 3, PRF, used={1,2}] | |||
a(0, y) = 1 + y | |||
a(x, _) = x-1 | |||
b := R(P(2,2), P(4,1)) [arity 3, size 3, PRF, used={1,3}] | |||
b(0, _, z) = z | |||
b(x, _, _) = x-1 | |||
c := R(b, P(5,2)) [arity 4, size 5, PRF, used={1,2,4}] | |||
c(_, 0, _, w) = w | |||
c(_, y, _, _) = y-1 | |||
d := R(a, c) [arity 3, size 9, PRF, used={1,2,3}] | |||
d(x, 0, z) = (1 + z - x) %< (1 + z) | |||
d(x, y, z) = (y - x - 1) %< (1 + z) | |||
e := R(P(1,1), d) [arity 2, size 11, PRF, used={1,2}] | |||
M(C(e, S, P(1,1))) [arity 0, size 15] | |||
</pre>(where <code>a %< b</code> is <code>a</code> if a ≥ 0 and <code>a % b</code> if a < 0) | |||
Racheline proved this diverges.<sup>[https://discord.com/channels/960643023006490684/1447627603698647303/1508961266490937536]</sup> The key here is that <code>e(n+1, n) = d(n, y, n)</code> for some y (the last step of the recursion) and for all y <code>d(n, y, n) ≠ 0</code> since:<pre> | |||
d(n, 0, n) = 1 | |||
d(n, y+1, n) = y+1 | |||
</pre> | |||
== Macro Bounds == | == Macro Bounds == | ||
| Line 343: | Line 485: | ||
=== AckDiag[k, S] === | === AckDiag[k, S] === | ||
Let <math>AS_k(n) := DiagRep^k[RepSucc[S]](n,n) = AckDiag[S](n-1)</math> | Let <math>AS_k(n) := DiagRep^k[RepSucc[S]](n,n) = AckDiag[k,S](n-1)</math> | ||
* <math>AS_0(n) = S^n(n+1) = 2n+1</math> | * <math>AS_0(n) = S^n(n+1) = 2n+1</math> | ||
| Line 352: | Line 494: | ||
=== AckDiag[k, Tri] === | === AckDiag[k, Tri] === | ||
Let <math>AT_k(n) := DiagRep^k[RepSucc[Tri]](n,n) = AckDiag[Tri](n-1)</math> | Let <math>AT_k(n) := DiagRep^k[RepSucc[Tri]](n,n) = AckDiag[k,Tri](n-1)</math> | ||
* <math>Tri(n) = \frac{n(n+1)}{2} > \frac{1}{2} n^2</math> | * <math>Tri(n) = \frac{n(n+1)}{2} > \frac{1}{2} n^2</math> | ||
* <math>AT_0(n) = Tri^n(n+1) > 2 \left( \frac{n+1}{2} \right)^{2^n}</math> | * <math>AT_0(n) = Tri^n(n+1) > 2 \left( \frac{n+1}{2} \right)^{2^n}</math> | ||
| Line 366: | Line 508: | ||
* <math>AT_3(2) = AT_2^2(3) > AT_2(10 \uparrow\uparrow\uparrow 3) > 10 \uparrow\uparrow\uparrow 10 \uparrow\uparrow\uparrow 3</math> | * <math>AT_3(2) = AT_2^2(3) > AT_2(10 \uparrow\uparrow\uparrow 3) > 10 \uparrow\uparrow\uparrow 10 \uparrow\uparrow\uparrow 3</math> | ||
== | == Pairing Functions == | ||
In order to do arbitrary computation, GRF need to be able to store arbitrary data into a single integer (since the R combinator only passes a single accumulator). There are many ways to do that and the Graham champions above accomplish it via custom binary encodings. But the traditional way to store arbitrary data into an integer is to use a [[wikipedia:Pairing_function|pairing function]]. Thus there is value in finding small pairing/unpairing functions. | |||
We define two APIs here for pairing functions: | |||
# A triple of GRF <code>Pair</code>, <code>Left</code>, <code>Right</code> such that for all a,b: <code>Left(Pair(a,b)) = a</code> and <code>Right(Pair(a,b)) = b</code> | |||
# A GRF <code>Pair</code> and GRF Macro <code>LRCall[f]</code> such that for all a,b,f: <code>LRCall[f](Pair(a,b)) = f(a,b)</code> | |||
The smallest known pairing functions are: | |||
{| class="wikitable" | {| class="wikitable" | ||
|+Smallest Pairing Functions | |+Smallest Pairing Functions | ||
Latest revision as of 17:25, 6 October 2026
General recursive functions (GRFs), also called µ-recursive functions or partial recursive functions, are the collection of partial functions that are computable. This definition is equivalent using any Turing complete system of computation. See Wikipedia:general recursive function for background.
Historically it was defined as the smallest class of partial functions that is closed under composition, recursion, and minimization, and includes zero, successor, and all projections (see formal definitions below). In the rest of this article, this is the formulation that we focus on exclusively. In this way, it can be considered to be a Turing complete model of computation. In fact, it is one of the oldest Turing complete models, first formalized by Kurt Gödel and Jacques Herbrand in 1933, 3 years before λ-calculus and Turing machines.
BBµ(n) is a Busy Beaver function for GRFs:
where means that is a k-ary GRF and is the "structural size" of f (the number of atoms and combinators in the definition, see details below). In other words, it is the largest number computable via a 0-ary function (a constant) with a limited "program" size. It is more akin to the traditional Sigma score for a Turing machine rather than the Step function in the sense that it maximizes over the produced value, not the number of steps needed to reach that value.
Definition
Structure
Define inductively based on the following construction rules, start with Atoms and combine them using Combinators.
Atoms
- Zero: is the constant 0 function
- Successor: is the successor function
- Projection: is a projection function
Combinators
- Composition: is the composition or substitution of the gs into h:
- Primitive Recursion: is primitive recursion using g as the base case and h as the inductive step.
- Minimization / Unlimited Search: is the µ-operator which allows unlimited search.
The arity superscripts for C, R and M are redundant (except for ) and so are sometimes omitted below.
Size
The size of a GRF is the number of atoms and combinators in the definition:
Primitive Recursion
models a typical iterative function definition over ℕ.
Base case:
Iterative case (for ): where .
R can be recursively evaluated following its definition directly or it can be simulated as a bounded for loop like this python code:
# f = R(g,h)
def f(n, *xs):
acc = g(*xs)
for k in range(n):
acc = h(k, acc, *xs)
return acc
The iterative function h is passed two synthetic args in the front: (k) iteration number (0-indexed) and (acc) "accumulator" from previous iterations.
Both the base and iterative cases can be parameterized by values .
If you restrict functions to only those constructible with Z, S, P, C, R (no M) then this defines the Primitive Recursive Functions, a subset of the General Recursive Functions that always halt.
Minimization
In computational language, when M(f) is evaluated it can be considered to calculate with , then , then etc. until one of the calls to returns 0, at which point it returns the value of which first gave a result of 0. If no first argument causes to return 0, doesn't return (this is the only way for a GRF to not halt).
Macros
In order to improve readability we define the following macros. For all
| Macro | arity | Definition | Size | Function | |
|---|---|---|---|---|---|
| Constant | k | ||||
| Plus constant | 1 | ||||
| Addition | Add | 2 | 5 | ||
| Triangular numbers | 1 | 7 | |||
| Iteration | 2 | ||||
| Iteration on first arg | 2 | ||||
| Diagonalization & Iteration | 2 | ||||
| Diagonalization | 1 | ||||
| Ackermann iteration | 2 | ||||
| 1 |
Champions
We divide the champions tables up by enumeration categories. Starting from the simplest functions and moving to the most general.
Composition Functions
The simplest category are PRFs without Recursion. In other words, only atoms and Composition. All composition functions are equivalent to either , or . For BBµ, the only options are which is size 2n+1. These can be trivially extended to of size 2n+2. So this proves that . These are the best known champions up to size 13.
Primitive Recursive Functions
We get considerably more complexity by allowing all Primitive Recursive Functions (PRFs). But PRFs are still all guaranteed to be total, are decidable and are all dominated by Ackermann growth functions. They are convenient to enumerate since none diverge, so any holdouts that remain when running limited computations must eventually halt. All PRF champions up to size 13 are simple composition functions as mentioned above. PRFs with R begin at size 14.
The size 21-24 PRF champions are also currently full GRF champions, although it seems likely that M(PRF) will surpass these values, it just hasn't been run out that far yet.
| n | Max Score | Champions | Champion Found | # Holdouts |
|---|---|---|---|---|
| 13 | = 6 | K[6]
|
0 | |
| 14 | = 7 | C(DiagS[RepSucc[S]], K[2])
|
Shawn Ligocki 10 Apr 2026 | 0 |
| 15 | = 7 | K[7]
|
0 | |
| 16 | = 10 | C(DiagS[RepSucc[Plus[2]]], K[2])
|
Shawn Ligocki 11 Apr 2026 | 0 |
| 17 | = 15 | C(DiagS[DiagRep[RepSucc[S]]], K[1])
|
Shawn Ligocki 12 Apr 2026 | 0 |
| 18 | = 21 | C(DiagS[RepSucc[Tri]], K[1])
|
Jacob Mandelson 9 Apr 2026 | 0 |
| 19 | = 39 | C(DiagS[DiagRep[RepSucc[S]]], K[2])
|
Shawn Ligocki 12 Apr 2026 | 0 |
| 20 | = 1540 | C(DiagS[RepSucc[Tri]], K[2])
|
Jacob Mandelson 9 Apr 2026 | 0 |
| 21 | = 8,589,934,591 | C(DiagS[RepFirst[DiagRep[RepSucc[S]]]], K[1])
|
Shawn Ligocki 16 May 2026 | 0 |
| 22 | C(DiagS[RepFirst[RepSucc[Tri]]], K[1])
|
Shawn Ligocki 17 May 2026 | Deciders: 11
All decided by hand | |
| 23 | C(DiagS[DiagRep[RepSucc[Tri]]],K[1])
|
Shawn Ligocki 24 Jun 2026 | 129 | |
| 24 | C(DiagS[RepFirst[RepSucc[Tri]]], K[2])
|
Shawn Ligocki 17 May 2026 | Not yet enumerated |
M(PRF)
We get another level of complexity by allowing Minimization, but only at the very top level. In other words, all of these GRF are M(f) for some PRF f. We call this M(PRF) or min_prf. This is a convenient set to explore because (1) it is Turing complete, (2) it is a smaller domain and easier to enumerate than full GRF, (3) all small known champions are of this form.
All M(PRF) champions up to size 13 are simple composition functions as mentioned above.
| n | Max Score | Champions | Champion Found | # Holdouts |
|---|---|---|---|---|
| 12 | = 5 | C(K[5])
|
0 | |
| 13 | = 6 | K[6]
|
Deciders: 15
All proven by hand | |
| 14 | ≥ 32 | Shawn Ligocki 29 Apr 2026 | 109 | |
| 15 | ≥ 32 | C^0(size 14 champ) | 589 | |
| 16 | ≥ 47 | Shawn Ligocki 5 May 2026 | 3,430 | |
| 17 | ≥ 58,471 | M(C(R(P(1,1),R(R(S,R(R(S,R(Z2,P(4,1))),P(4,2))),P(4,2))),S,P(1,1)))
|
Shawn Ligocki 29 Jun 2026 | 19,862 |
| 18 | 93,738 | |||
| 19 | 1,419,487 | |||
| 20 | 7,508,624 |
Full GRF
The final level is full GRF where Minimization is allowed at any level. The only champions currently at this level are hand-constructed GRF designed to surpass Graham's number.
| n | BBµ(n) | Champion | Champion Found | # Holdouts |
|---|---|---|---|---|
| 93 | Graham() from goodstein.mgrf | Racheline and Shawn Ligocki 19 May 2026 | ||
| ... | ||||
| 98 | Graham() from ack_worm.mgrf | Shawn Ligocki 17 May 2026 |
Analysis of Champions
BBµ(14) ≥ 32
This is the smallest non-trivial champion:
Expression: M(C(R(P(1,1), R(P(2,1), C(R(P(1,1), P(3,1)), P(4,2), P(4,1)))), P(1,1), S))
Arity: 0 | Size: 14 | GRF
=== Sub-expressions ===
a := R(P(1,1), P(3,1)) [arity 2, size 3, PRF, used={1,2}]
a(0, y) = y
a(x, _) = x-1
b := R(P(2,1), C(a, P(4,2), P(4,1))) [arity 3, size 8, PRF, used={1,2}]
if 0 ≤ x ≤ y: b(x,y) = y-x
if y+1 ≤ x ≤ 2y+1: b(x,y) = 2y+1-x
b(x, y) = (y+1) 2^k - 1 - x (where k is minimal such that this is ≥ 0)
c := R(P(1,1), b) [arity 2, size 10, PRF, used={1,2}]
def c(x, y):
acc = y
for i in range(x):
acc = b(i,acc)
return acc
=== Root ===
d := M(C(c, P(1,1), S)) [arity 0, size 14]
def d():
for n in 0..:
acc = n+1
for i in range(n):
while acc < i:
acc = 2*acc + 1
acc -= i
if acc == 0:
return n
d() = 32
This GRF subtracts numbers 0 to n-1 from accumulator starting at n+1 with a slightly complex underflow condition (what to do when the number goes negative). It repeats this on increasing n until this process happens to hit exactly 0. It appears to be chaotic. It can be parameterized in a couple of ways by swapping S <-> P(1,1). This parameterization seems to get the luckiest and make it up to n=32 before halting. The other co-champion has the exact same behavior, just by switching when we do S vs P(1,1) for the base case.
Cryptids
So far all Cryptids have been constructed by hand; no GRFs found in the wild have been categorized as Cryptids yet.
| Size | Problem | Authors | Ref |
|---|---|---|---|
| 49 | Brocard's problem | aparker, star and Shawn 3 May 2026 | brocard.mgrf Discord |
| 56 | 5x+1 trajectory of 7 | Shawn Ligocki 2 May 2026 | collatz.mgrf |
| 81 | Erdős ternary conjecture | Shawn Ligocki 28 Apr 2026 | erdos.mgrf |
| 139 | Antihydra-like problem | Jacob Mandelson 8 Apr 2026 | Orig (size 141) Size 139 |
There is also a size 133 GRF that searches for counterexamples to Fermat's Last Theorem, halting iff it ever found one (however, since FLT has been proven, this GRF can be shown to be non-terminating, and is therefore not considered a Cryptid): fermat.mgrf
Notable GRF
Unsolved GRFs
- Size 16:
M(C(R(S, R(C(S, P(2,1)), C(R(P(1,1), P(3,1)), P(4,2), P(4,1)))), P(1,1), S))Discord Discord- It is known that if this function returns a value, it must be greater than 499 quadrillion. Discord
Solved GRFs
Hardest Size 12
This is subjective of course, but it seems like the hardest size 12 M(PRF) holdout is M(R(C(S, Z0), R(S, R(R(S, P(3,1)), P(4,2))))). Proving it seems requires noticing the pattern that d(x) = x-2 for all x ≥ 3 and proving that it inductively follows that pattern for all future values.[1]
Expression: M(R(C(S, Z0), R(S, R(R(S, P(3,1)), P(4,2)))))
Arity: 0 | Size: 12 | GRF
=== Sub-expressions ===
a := R(S, P(3,1)) [arity 2, size 3, PRF, used={1,2}]
a(0, y) = 1 + y
a(x, _) = x-1
b := R(a, P(4,2)) [arity 3, size 5, PRF, used={1,2,3}]
b(_, 0, z) = 1 + z
b(_, y, _) = y-1
c := R(S, b) [arity 2, size 7, PRF, used={1,2}]
c(x, y) = (1 + y - x) %< (2 + y)
d := R(C(S, Z0), c) [arity 1, size 11, PRF, used={1}]
d(0) = 1
d(1) = 2
d(2) = 2
d(x) = x - 2
=== Root ===
M(d) [arity 0, size 12]
= ∞
Hardest Size 13 (Triangular Divisibility)
Likewise, it seems like the hardest size 13 M(PRF) holdout is M(C(R(S, R(P(2,1), R(R(P(2,2), P(4,1)), P(5,2)))), P(1,1), P(1,1))) which halts iff there exists some n ≥ 1 such that n+2 divides . There is no such n,[2] therefore this GRF diverges, but this requires reasoning about divisibility and modular arithmetic.
Tetrahedral Divisibility
The GRF (Size 15) halts iff there exists some n ≥ 1 such that n+3 divides .[3] aparker[4] and star[5] proved that there is no such n, therefore this GRF diverges.
Chaotic size 15
Expression: M(C(R(P(1,1), R(R(S, P(3,1)), R(R(P(2,2), P(4,1)), P(5,2)))), S, P(1,1)))
Arity: 0 | Size: 15 | GRF
=== Sub-expressions ===
a := R(S, P(3,1)) [arity 2, size 3, PRF, used={1,2}]
a(0, y) = 1 + y
a(x, _) = x-1
b := R(P(2,2), P(4,1)) [arity 3, size 3, PRF, used={1,3}]
b(0, _, z) = z
b(x, _, _) = x-1
c := R(b, P(5,2)) [arity 4, size 5, PRF, used={1,2,4}]
c(_, 0, _, w) = w
c(_, y, _, _) = y-1
d := R(a, c) [arity 3, size 9, PRF, used={1,2,3}]
d(x, 0, z) = (1 + z - x) %< (1 + z)
d(x, y, z) = (y - x - 1) %< (1 + z)
e := R(P(1,1), d) [arity 2, size 11, PRF, used={1,2}]
M(C(e, S, P(1,1))) [arity 0, size 15]
(where a %< b is a if a ≥ 0 and a % b if a < 0)
Racheline proved this diverges.[6] The key here is that e(n+1, n) = d(n, y, n) for some y (the last step of the recursion) and for all y d(n, y, n) ≠ 0 since:
d(n, 0, n) = 1 d(n, y+1, n) = y+1
Macro Bounds
Let
AckDiag[k, S]
Let
- (for )
- (for )
- (for and )
AckDiag[k, Tri]
Let
- , ,
- (for )
- ,
- (for )
- ,
- (for )
Pairing Functions
In order to do arbitrary computation, GRF need to be able to store arbitrary data into a single integer (since the R combinator only passes a single accumulator). There are many ways to do that and the Graham champions above accomplish it via custom binary encodings. But the traditional way to store arbitrary data into an integer is to use a pairing function. Thus there is value in finding small pairing/unpairing functions.
We define two APIs here for pairing functions:
- A triple of GRF
Pair,Left,Rightsuch that for all a,b:Left(Pair(a,b)) = aandRight(Pair(a,b)) = b - A GRF
Pairand GRF MacroLRCall[f]such that for all a,b,f:LRCall[f](Pair(a,b)) = f(a,b)
The smallest known pairing functions are:
| Macro | arity | Definition | Size | Function |
|---|---|---|---|---|
| 2 | 20 | |||
| 1 | 38 | |||
| 1 | 36 | |||
| 1 |
Where these are based on the following definitions:
| Macro | arity | Definition | Size | Function | |
|---|---|---|---|---|---|
| Addition | Add | 2 | 5 | ||
| AddXA | 3 | 5 | |||
| AddS | 2 | 5 | |||
| Predecesor | Pred | 1 | 3 | ||
| Monus | RMonus | 2 | 7 | ||
| Triangular numbers | Tri | 1 | 7 | ||
| TriP | 1 | 7 | |||
| TriPXA | 2 | 7 | |||
| Inverting Tri | RMonusTri | 2 | 18 | ||
| InvTriCeil | 1 | 19 | |||
| Combined LRCall | RightPiece | 3 | 7 | ||
| LeftPiece | 3 | 12 | |||
| LRpart1[f] | 3 | ||||
| LRpart2[f] | 3 | ||||
| LRpart3[f] | 2 |