General Recursive Function

From BusyBeaverWiki
Revision as of 16:54, 8 May 2026 by Sligocki (talk | contribs) (Champions: BBµ(17) ≥ 2090)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

General recursive functions (GRFs), also called µ-recursive functions or partial recursive functions, are the collection of partial functions k 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 k 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:BBμ(n)=max{f()|fGRF0,|f|=n}

where fGRFk means that f:k is a k-ary GRF and |f| 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 GRFk inductively based on the following construction rules, start with Atoms and combine them using Combinators.

Atoms
  • Zero: k,ZkGRFk is the constant 0 function Zk(x1,,xk)=0
  • Successor: SGRF1 is the successor function S(x)=x+1
  • Projection: 1ik,PikGRFk is a projection function Pik(x1,xk)=xi
Combinators
  • Composition: k,m,hGRFm,g1,gmGRFk,Ck(h,g1,gm)GRFk is the composition or substitution of the gs into h: Ck(h,g1,gm)(x1,xk)=h(g1(x1,xk),gm(x1,xk))
  • Primitive Recursion: k,gGRFk,hGRFk+2,Rk+1(g,h)GRFk+1 is primitive recursion using g as the base case and h as the inductive step.
  • Minimization / Unlimited Search: k,fGRFk+1,Mk(f)GRFk is the µ-operator which allows unlimited search.

The arity superscripts for C, R and M are redundant (except for Ck(h)) and so are sometimes omitted below.

Size

The size of a GRF is the number of atoms and combinators in the definition:

  • |Zk|=|Pik|=|S|=1
  • |C(h,g1,,gm)|=1+|h|+|g1|++|gm|
  • |R(g,h)|=1+|g|+|h|
  • |M(f)|=1+|f|

Primitive Recursion

R models a typical iterative function definition over ℕ.

Base case: Rk(g,h)(0,x2,x3,...,xk)=g(x2,x3,...,xk)

Iterative case (for x1>0): Rk(g,h)(x1,x2,...,xk)=h(x11,v,x2,x3,...,xk) where v=R(g,h)(x11,x2,x3,...,xk).

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 x2,x3,...,xk.

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

Mk(f)(x1,...,xk)min{i:f(i,x1,...,xk)=0}

In computational language, when M(f) is evaluated it can be considered to calculate f(i,x1,...,xk) with i=0, then i=1, then i=2 etc. until one of the calls to f returns 0, at which point it returns the value of i which first gave a result of 0. If no first argument causes f to return 0, M(f) 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 fGRF1

Macro arity Definition Size Function
Constant Kk[n] k Kk[0]:=ZkKk[n]:=C(Plus[n],Zk) 2n+1 λx1xk.n
Plus constant Plus[n] 1 Plus[1]:=SPlus[n+1]:=C(S,Plus[n]) 2n1 λx.x+n
Triangular numbers Tri 1 Tri:=R(Z0,R(S,C(Plus[2],P23))) 7 λx.x(x+1)2
Iteration RepSucc[f] 2 RepSucc[f]:=R(S,C(f,P23)) |f|+4 λx y.fx(y+1)
Diagonalization & Iteration DiagRep[f] 2 DiagRep[f]:=R(S,C(f,P23,P23)) |f|+5 λx y.(λz.f(z,z))x(y+1)
Diagonalization DiagS[f] 1 DiagS[f]:=C(f,S,S) |f|+3 λx.f(x+1,x+1)
Ackermann iteration AckDiag2[n,f] 2 AckDiag2[0,f]:=RepSucc[f]AckDiag2[n+1,f]:=DiagRep[AckDiag2[n,f]] 5n+4+|f|
AckDiag[n,f] 1 AckDiag[n,f]:=DiagS[AckDiag2[n,f]] 5n+7+|f|

Champions

n BBµ(n) Champion Champion Found Holdouts Proven
1 = 0 Z0 Shawn Ligocki 8 Dec 2025 By hand
2 = 0 C0(Z0) Shawn Ligocki 8 Dec 2025 By hand
3 = 1 K0[1] Shawn Ligocki 8 Dec 2025 By hand
4 = 1 C0(K0[1]) Jacob Mandelson 3 Apr 2026
5 = 2 K0[2] Jacob Mandelson 3 Apr 2026
6 = 2 C0(K0[2]) Jacob Mandelson 3 Apr 2026
7 = 3 K0[3] Jacob Mandelson 3 Apr 2026
8 ≥ 3 C0(K0[3])
9 ≥ 4 K0[4]
10 ≥ 4 C0(K0[4])
11 ≥ 5 K0[5]
12 ≥ 5 C0(K0[5])
13 ≥ 6 K0[6]
14 ≥ 32 M0(C1(R2(P11,R3(P12,C4(R2(P11,P13),P24,P14))),P11,S)) Shawn Ligocki 29 Apr 2026
15
16 ≥ 47 M(C(R(S,R(P12,R(P23,C(R(S,P13),P35,P25)))),P11,S)) Shawn Ligocki 5 May 2026
17 ≥ 2090 M0(C1(R2(P11,R3(P12,R4(R3(R2(S,C3(S,P23)),P14),P25))),P11,S)) Shawn Ligocki 8 May 2026
18
19
20
21
22 >1013.35 C(AckDiag[2,S],K0[1]) Shawn Ligocki 13 Apr 2026
23 >1010463 C(AckDiag[1,Tri],K0[1]) Shawn Ligocki 13 Apr 2026
24
25 >105 C(AckDiag[1,Tri],K0[2]) Shawn Ligocki 13 Apr 2026
26
27 >10103 C(AckDiag[3,S],K0[1]) Shawn Ligocki 13 Apr 2026
28 >10105 C(AckDiag[2,Tri],K0[1]) Shawn Ligocki 13 Apr 2026
29 >1010104 C(AckDiag[3,S],K0[2]) Shawn Ligocki 13 Apr 2026
30 >1010108 C(AckDiag[2,Tri],K0[2]) Shawn Ligocki 13 Apr 2026
31 >101010105 C(AckDiag[3,S],K0[3]) Shawn Ligocki 13 Apr 2026
...
5k+17 > 10k10k3 C(AckDiag[k+1,S],K0[1]) Shawn Ligocki 13 Apr 2026
5k+18 > 10k10k3 C(AckDiag[k,Tri],K0[1]) Shawn Ligocki 13 Apr 2026
5k+19 > 10k10k10k4 C(AckDiag[k+1,S],K0[2]) Shawn Ligocki 13 Apr 2026
5k+20 > 10k10k10k5 C(AckDiag[k,Tri],K0[2]) Shawn Ligocki 13 Apr 2026
5k+21 > 10k10k10k10k5 C(AckDiag[k+1,S],K0[3]) Shawn Ligocki 13 Apr 2026
...
94 > 1015101510154 C(AckDiag[16,S],K0[2]) Shawn Ligocki 13 Apr 2026
95 >fω(1013) Omega() from example_ack.rs Shawn Ligocki 16 Apr 2026
96
97 >fω3(3) Omega3() from example_ack.rs Shawn Ligocki 22 Apr 2026
98
99 >fω4(3) Omega4() from example_ack.rs Shawn Ligocki 22 Apr 2026
100 >fω+1(fω2(1013))Graham's number Graham() from example_ack.rs Shawn Ligocki 16 Apr 2026

Cryptids

So far all Cryptids have been constructed by hand. None found "in the wild" yet.

Hand Constructed Cryptids
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 Erdos Ternary Conjecture Shawn Ligocki 28 Apr 2026 erdos.mgrf
139 Antihydra-like problem Jacob Mandelson 8 Apr 2026 Orig (size 141) Size 139

Notable Divergent GRF

Tetrahedral Divisibility

The GRF M0(C1(R2(S,R3(P12,R4(P13,R5(R4(P33,P15),P26)))),S,S)) (Size 15) halts iff there exists some n ≥ 1 such that n+3 divides Tetr(n)=n(n+1)(n+2)6.[1] aparker[2] and star[3] proved that there is no such n, therefore this GRF diverges.

Macro Bounds

Let C=1log10(2)3.32

AckDiag[k, S]

Let ASk(n):=DiagRepk[RepSucc[S]](n,n)=AckDiag[k,S](n1)

  • AS0(n)=Sn(n+1)=2n+1
  • AS1(n)=AS0n(n+1)=(n+2)2n1
  • AS1(n)>C10n/C (for n2)
  • AS2(n)=AS1n(n+1)>C(10)n(n+1C)>10n[n+1C] (for n2)
  • ASk(n)=ASk1n(n+1)>(10k1)n(n+1) (for k3 and n1)

AckDiag[k, Tri]

Let ATk(n):=DiagRepk[RepSucc[Tri]](n,n)=AckDiag[k,Tri](n1)

  • Tri(n)=n(n+1)2>12n2
  • AT0(n)=Trin(n+1)>2(n+12)2n
  • AT0(2)=21, AT0(3)=1540, AT0(4)>107.42
  • AT0(n)>C1010(n1C)+1 (for n5)
  • AT1(n)=AT0n(n+1)>C(10)2n2(AT0(n+1)C)
  • AT1(2)>1010AT0(3)/C>1010463, AT1(3)>10101010AT0(4)/C>105
  • AT1(n)>102n (for n4)
  • AT2(n)=AT1n(n+1)>(10)n1(AT1(n+1))
  • AT2(2)=AT12(3)>AT1(105)>10105, AT2(3)=AT13(4)>1010108
  • AT2(n)>10(n+1) (for n4)
  • AT3(n)=AT2n(n+1)>(10)n1(AT2(n+1))
  • AT3(2)=AT22(3)>AT2(103)>10103

Utilizing Minimization

Most champions are primitive recursive functions. In other words they do not use the minimization combinator M. This fundamentally limits their growth rate. In fact, no primitive recursive function can grow faster than the Ackermann function and we can see that above where the assymtotic growth of the known BBµ bound is Ackermann growth: BBμ(6k+17)2k4.

But, like the traditional BB function, BBµ grows uncomputably fast, so eventually it must surpass primitive recursive functions. In order to do that, it needs to use the M combinator. However, in order to do arbitrary computation, you need a way to store arbitrarily large amounts of data into a single integer and extract it back out. In other words, you need to implement a pairing function. Thus there is value in finding small pairing/unpairing functions. A set of pairing functions is a triple Pair,Left,Right such that for all a,b: Left(Pair(a,b)) = a and Right(Pair(a,b)) = b. When functions consume both the left and right values, common subexpression elimination can be used to reduce the number of operations below that from calling Left and Right individually. The smallest known pairing functions are:

Smallest Pairing Functions
Macro arity Definition Size Function
Pair 2 Pair:=C(AddS,C(Tri,Add),P12) 20 λxy.(x+y)(x+y+1)2+x+1
Left 1 Left:=C(RMonus,C(TriP,InvTriCeil),Pred) 38 Left(Pair(x,y))=x
Right 1 Right:=C(RMonus,P11,C(Tri,InvTriCeil)) 36 Right(Pair(x,y))=y
LRCall[f2] 1 LRCall[f]:=C(LRpart3[f],InvTriCeil,P11) 59+|f| LRCall[f](Pair(x,y))=f(x,y)

Where these are based on the following definitions:

Macros
Macro arity Definition Size Function
Addition Add 2 Add:=R(P11,C(S,P23)) 5 λxy.x+y
AddXA 3 AddXA:=R(P12,C(S,P24)) 5 λxyz.x+y
AddS 2 AddS:=R(S,C(S,P23)) 5 λxy.x+y+1
Predecesor Pred 1 Pred:=R(Z0,P12) 3 λx.x˙1
Monus RMonus 2 RMonus:=R(P11,C(Pred,P23)) 7 λxy.y˙x
Triangular numbers Tri 1 Tri:=R(Z0,AddS) 7 λx.x(x+1)2
TriP 1 TriP:=R(Z0,Add) 7 TriP(x+1)=Tri(x)
TriPXA 2 TriPXA:=R(Z1,AddXA) 7 TriPXA(x,y)=TriP(x)
Inverting Tri RMonusTri 2 RMonusTri:=C(RMonus,C(Tri,P12),P22) 18 λxy.y˙Tri(x)
InvTriCeil 1 InvTriCeil:=M(RMonusTri) 19 λy.min{x|Tri(x)y}
Combined LRCall RightPiece 3 RightPiece:=R(P22,C(Pred,P24)) 7 λxyz.z˙x
LeftPiece 3 LeftPiece:=C(RMonus,C(S,P23),P13) 12 λxyz.x˙(y+1)
LRpart1[f] 3 LRpart1[f]:=C(f,LeftPiece,RightPiece) 20+|f| λxyz.f(x˙(y+1),z˙x)
LRpart2[f] 3 LRpart2[f]:=C(LRpart1[f],P33,P13,AddXA) 28+|f| λxyz.f(z˙(x+1),x+y˙z)
LRpart3[f] 2 LRpart3[f]:=C(LRpart2[f],TriPXA,P12,P22) 38+|f| λxy.f(y˙(TriP(x)+1),TriP(x)+x˙y)