Coq proof of the 5th Busy Beaver value
Tristan Stérin, The bbchallenge Collaboration�bbchallenge.org
ERC No 772766, SFI 18/ERCS/5746
1
Does it halt?
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #0
Does it halt?
3
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #1
Does it halt?
4
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #2
Does it halt?
5
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #3
Does it halt?
6
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #4
Does it halt?
7
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #5
Does it halt?
8
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #6
Does it halt?
Will we ever read a 0 in state E ?
9
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #6
Does it halt?
Will we ever read a 0 in state E ?
10
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Step #6
Does it halt?�Yes!
The machine has halted!!
11
0
1
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
Step #47,176,870
Does it halt?�Yes!
20,000-step space-time diagram
12
Does it halt?
The machine has halted!!
Can another 5-state machine do better?
13
0
1
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
Step #47,176,870
The Busy Beaver function
14
BB(n) = “Maximum number of steps done by a halting 2-symbol Turing machine with n states starting from all-0 memory tape”
T. Radó. On Non-computable Functions. Bell System Technical Journal, 41(3):877–884. 1962.
Tibor Radó, 1895 - 1965
BB(n) = “Maximum algorithmic bang for your buck”
UNCOMPUTABLE
The Busy Beaver function
15
BB(n) = “Maximum number of steps done by a halting 2-symbol Turing machine with n states starting from all-0 memory tape”
T. Radó. On Non-computable Functions. Bell System Technical Journal, 41(3):877–884. 1962.
Allen Brady, 1934 - 2024
Small busy beaver values:
A 4-state Turing machine that runs more than 107 steps never halts (from all-0 tape)
The Busy Beaver function
16
BB(n) = “Maximum number of steps done by a halting 2-symbol Turing machine with n states starting from all-0 memory tape”
T. Radó. On Non-computable Functions. Bell System Technical Journal, 41(3):877–884. 1962.
Small busy beaver values:
BB(5) = 47,176,870?
Conjectured yes [Aaronson, 2020]
The Busy Beaver Challenge (bbchallenge)
Launched in 2022
17
The Busy Beaver Challenge (bbchallenge)
18
The Busy Beaver Challenge
19
How to prove “BB(5) = 47,176,870” ?
The Busy Beaver Challenge
20
How to prove “BB(5) = 47,176,870” ?
The Busy Beaver Challenge
21
How to prove “BB(5) = 47,176,870” ?
The Busy Beaver Challenge
22
How to prove “BB(5) = 47,176,870” ?
Try another decider
The Busy Beaver Challenge
23
How to prove “BB(5) = 47,176,870” ?
The Busy Beaver Challenge
24
How to prove “BB(5) = 47,176,870” ?
The Busy Beaver Challenge
25
Deciding the undecidable: this is impossible (there is no universal decider)
The Busy Beaver Challenge
26
Deciding the undecidable: this is impossible (there is no universal decider)
How impossible?
The Busy Beaver Challenge
27
27
Deciding the undecidable: this is impossible (there is no universal decider)
How impossible?
-complete
There is a 25-state TM that halts iff Goldbach’s conjecture is false
There is a 744-state TM that halts iff the Riemann hypothesis is false
There is a 748-state TM that halts iff ZF is not consistent
[Code Golf Addict, 2016], [Leng, 2025]
[Matiyasevich and O’Rear, 2016]
[O’Rear, 2017]
[Riebel, 2023]
The Busy Beaver Challenge
28
Deciding the undecidable: this is impossible (there is no universal decider)
Let’s do it anyway!!
(Hope was that 5-state machines do not encode unsolvable problems)
The Busy Beaver Challenge
29
Deciding the undecidable: this is impossible (there is no universal decider)
Let’s do it anyway!!
(Hope was that 5-state machines do not encode unsolvable problems)
(Or else, we would have found the simplest open problem in maths, not bad either)
The Busy Beaver Challenge
30
Since 2022, contributors produced dozens of deciders, in many languages: �C, C++, Go, rust, Haskell, PhP, Python
���
The Busy Beaver Challenge
31
Since 2022, contributors produced dozens of deciders, in many languages: �C, C++, Go, rust, Haskell, PhP, Python
���
Proof Assistants
32
But quickly, contributors with proof assistant skills joined:
Proof Assistants
33
But quickly, contributors with proof assistant skills joined:
Proof Assistants
34
But quickly, contributors with proof assistant skills joined:
That way, mxdys proved in Coq BB(5) = 47,176,870, the proof is called Coq-BB5
Proof Assistants
35
The difficult part is to prove that the deciders are correct: for each decider we need to show that if the decider says that a machine does not halt then, the machine indeed does not halt.��Also need to prove that the enumeration is correct: that the set of 181,385,789 enumerated machines is sufficient to deduce the value of BB(5).
Coq-BB5
36
Method
Coq-BB5
37
Coq-BB5
38
https://docs.bbchallenge.org/CoqBB5_release_v1.0.0/
Coq-BB5
Coq-BB5
Lower bound: easy
Upper bound: hard
Coq-BB5
Coq-BB5 uses one standard axiom: functional extensionality
Summary: landscape of small BB values
42
Legend��Proved in Coq�
Existence of a “Cryptid”
Summary: landscape of small BB values
43
Legend��Proved in Coq�
Existence of a “Cryptid”
Iterate Collatz-like function starting from 8:
Do you ever get twice as many more odd terms than even ones?
Antihydra halts iff this is true.
Future work
Next BB values (although hopeless)
44
Legend��Proved in Coq�
Existence of a “Cryptid”
Future work
Next BB values (although hopeless)
45
Legend��Proved in Coq�
Existence of a “Cryptid”
5-state machine zoo
46
5-state machine zoo��
Machine Skelet #1��Cycles after 10^51 steps�Period is ~10^9 steps
47
5-state machine zoo
Machine Skelet #10��Double Fibonacci counter
48
5-state machine zoo
Machine Skelet #17��Does Gray Code under�many layers of obfuscation
49
Credits, many thanks to all bbchllaenge Collaborators
New contributors welcome!
50
Special thanks to Maja Kądziołka for some of her slides!
Thank you very much!!
Do you have any questions :) ?
51
The first draft of the BB5 paper is out, feedback welcome!
Slides, links and more
I am open to work