Skip to content

Commit 9bdb19c

Browse files
tcosmoPaul-Lez
andauthored
Beaver Math Olympiad problems (#251)
This PR adds the current [Beaver Math Olympiad problems](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#5._1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_---0RE_(bbch)) to the project (see #230). A few notes: - I have added verbose comments documenting each problem and crediting the bbchallenge contributors who found the associated TMs and mathematical reformulations - I have used a lean parenthesisation style that is slightly more verbose than was originally done to help non-native lean speakers - [BMO#4](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#4._1RB3RB---1LB0LA_2LA4RA3LA4RB1LB_(bbch)) original formulation is based on a partial definition of `a` I have taken the liberty of making it total through the `else` branch - In BMO#5 statement, I've used [global definition of function "f"](https://github.com/tcosmo/formal-conjectures/blob/579d1ba125ce8b61a4f20b5085af36ccc07f33b5/FormalConjectures/Other/BeaverMathOlympiad.lean#L128), I don't know if it is compatible with your preferred good practice, I will inline it if you prefer - I added "The bbchallenge Collaboration (bbchallenge.org)" in the AUTHORS, let me know if this is against your authoring guidelines and what we should do instead --------- Co-authored-by: Paul Lezeau <[email protected]> Co-authored-by: Paul Lezeau <[email protected]>
1 parent 58f640e commit 9bdb19c

File tree

3 files changed

+206
-51
lines changed

3 files changed

+206
-51
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Mirek Olšák
1717
Paul Lezeau
1818
Salvatore Mercuri
1919
Seewoo Lee
20+
The bbchallenge Collaboration (bbchallenge.org)
2021
Thomas Hubert
2122
Zeyu Zheng
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
/-
2+
Copyright 2025 The Formal Conjectures Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-/
16+
17+
import FormalConjectures.Util.ProblemImports
18+
19+
/-!
20+
# Beaver Math Olympiad (BMO)
21+
22+
The Beaver Math Olympiad (BMO) is a set of mathematical reformulations of the halting/nonhalting
23+
problem of specific Turing machines from all-0 tape. These problems came from studying small Busy
24+
Beaver values. Some problems are open and have a conjectured answer, some are open and don't have a
25+
conjectured answer, and, some are solved.
26+
27+
Among these problems is the Collatz-like *Antihydra* problem which is open and coming from a 6-state
28+
Turing machine, and a testament to the difficulty of knowing the sixth Busy Beaver value.
29+
30+
For some BMO problem, the equivalence between the mathematical formulation and the corresponding
31+
Turing machine non-termination has been formally proved in Rocq, we indicate it when done.
32+
33+
*References:*
34+
35+
- [bbchallenge.org](https://bbchallenge.org)
36+
- [Beaver Math Olympiad wiki page](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad)
37+
- [Antihydra web page](https://bbchallenge.org/antihydra)
38+
- [Antihydra wiki page](https://wiki.bbchallenge.org/wiki/Antihydra)
39+
-/
40+
41+
/--
42+
[BMO#1](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#1._1RB1RE_1LC0RA_0RD1LB_---1RC_1LF1RE_0LB0LE_(bbch))
43+
44+
Let $(a_n)_{n \ge 1}$ and $(b_n)_{n \ge 1}$ be two sequences such that $(a_1, b_1) = (1, 2)$ and
45+
46+
$$(a_{n+1}, b_{n+1}) = \begin{cases}
47+
(a_n-b_n, 4b_n+2) & \text{if }a_n \ge b_n \\
48+
(2a_n+1, b_n-a_n) & \text{if }a_n < b_n
49+
\end{cases}$$
50+
51+
for all positive integers $n$. Does there exist a positive integer $i$ such that $a_i = b_i$?
52+
53+
The first 10 values of $(a_n, b_n)$ are $(1, 2), (3, 1), (2, 6), (5, 4), (1, 18), (3, 17),
54+
(7, 14), (15, 7), (8, 30), (17, 22)$.
55+
56+
[BMO#1](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#1._1RB1RE_1LC0RA_0RD1LB_---1RC_1LF1RE_0LB0LE_(bbch)) is equivalent to asking whether the 6-state Turing machine
57+
[`1RB1RE_1LC0RA_0RD1LB_---1RC_1LF1RE_0LB0LE`](https://wiki.bbchallenge.org/wiki/1RB1RE_1LC0RA_0RD1LB_---1RC_1LF1RE_0LB0LE) halts or not.
58+
59+
There is presently no consensus on whether the machine halts or not, hence the problem is formulated
60+
using `↔ answer(sorry)`.
61+
62+
The machine was discovered by [bbchallenge.org](bbchallenge.org) contributor Jason Yuen on
63+
June 25th 2024.
64+
-/
65+
@[category research open, AMS 5 11 68]
66+
theorem busy_beaver_math_olympiad_problem_1 (a : ℕ → ℕ) (b : ℕ → ℕ)
67+
(a_ini : a 0 = 1)
68+
(a_rec : ∀ n, a (n + 1) = if b n ≤ a n then a n - b n else 2 * a n + 1)
69+
(b_ini : b 0 = 2)
70+
(b_rec : ∀ n, b (n + 1) = if b n ≤ a n then 4 * b n + 2 else b n - a n):
71+
(∃ i, a i = b i) ↔ answer(sorry) := by
72+
sorry
73+
74+
/--
75+
[BMO#2](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#2._Hydra_and_Antihydra)
76+
77+
Antihydra is a sequence starting at 8, and iterating the function
78+
$$H(n) = \left\lfloor \frac {3n}2 \right\rfloor.$$
79+
The conjecture states that the cumulative number of odd values in this sequence
80+
is never more than twice the cumulative number of even values. It is a relatively new open problem
81+
with, so it might be solvable, although seems quite hard because of its Collatz-like flavor.
82+
The underlying Collatz-like map has been studied independently in the past,
83+
see doi:[10.1017/S0017089508004655](https://doi.org/10.1017/S0017089508004655) (Corollary 4).
84+
85+
It is equivalent to non-termination of the [`1RB1RA_0LC1LE_1LD1LC_1LA0LB_1LF1RE_---0RA`](https://wiki.bbchallenge.org/wiki/Antihydra) 6-state Turing machine (from all-0 tape). Note that the conjecture
86+
that the machine does not halt is based on [a probabilistic argument](https://wiki.bbchallenge.org/wiki/Antihydra#Trajectory).
87+
88+
This machine and its mathematical reformulations were found by [bbchallenge.org](bbchallenge.org)
89+
contributors mxdys and Rachel Hunter on June 28th 2024.
90+
-/
91+
@[category research open, AMS 5 11 68]
92+
theorem beaver_math_olympiad_problem_2_antihydra
93+
(a : ℕ → ℕ) (b : ℕ → ℤ)
94+
(a_ini : a 0 = 8)
95+
(a_rec : ∀ n, a (n + 1) = (3 * a n) / 2)
96+
(b_ini : b 0 = 0)
97+
(b_rec : ∀ n, b (n + 1) = if a n % 2 = 0 then b n + 2 else b n - 1) :
98+
∀ n, b n ≥ 0 := by
99+
sorry
100+
101+
/--
102+
[BMO#2](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#2._Hydra_and_Antihydra) formulation variant
103+
104+
Alternative statement of beaver_math_olympiad_problem_2_antihydra
105+
using set size comparison instead of a recurrent sequence b.
106+
-/
107+
@[category research open, AMS 5 11 68]
108+
theorem beaver_math_olympiad_problem_2_antihydra.variants.set
109+
(a : ℕ → ℕ) (a_ini : a 0 = 8)
110+
(a_rec : ∀ n, a (n + 1) = (3 * a n) / 2) (n : ℕ) :
111+
((Finset.Ico 0 n).filter fun x ↦ Odd (a x)).card ≤
112+
2 * ((Finset.Ico 0 n).filter fun x ↦ Even (a x)).card := by
113+
sorry
114+
115+
/--
116+
[BMO#3][https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#3._1RB0RB3LA4LA2RA_2LB3RA---3RA4RB_(bbch)_and_1RB1RB3LA4LA2RA_2LB3RA---3RA4RB_(bbch)]
117+
118+
Let $v_2(n)$ be the largest integer $k$ such that $2^k$ divides $n$.
119+
Let $(a_n)_{n \ge 0}$ be a sequence such that
120+
121+
$$a_n = \begin{cases}
122+
2 & \text{if } n=0 \\
123+
a_{n-1}+2^{v_2(a_{n-1})+2}-1 & \text{if } n \ge 1
124+
\end{cases}$$
125+
126+
for all non-negative integers $n$. Is there an integer $n$ such that $a_n=4^k$ for
127+
some positive integer $k$?
128+
129+
[BMO#3][https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#3._1RB0RB3LA4LA2RA_2LB3RA---3RA4RB_(bbch)_and_1RB1RB3LA4LA2RA_2LB3RA---3RA4RB_(bbch)] is equivalent to the non-termination of 2-state 5-symbol Turing machine [`1RB0RB3LA4LA2RA_2LB3RA---3RA4RB`](https://wiki.bbchallenge.org/wiki/1RB0RB3LA4LA2RA_2LB3RA---3RA4RB) (from all-0 tape).
130+
131+
The machine was found and informally proven not to halt by [bbchallenge.org](bbchallenge.org)
132+
contributor Daniel Yuan on June 18th 2024; see [Discord discussion](https://discord.com/channels/960643023006490684/1084047886494470185/1252634913220591728).
133+
-/
134+
@[category research solved, AMS 5 11 68]
135+
theorem beaver_math_olympiad_problem_3
136+
(a : ℕ → ℕ)
137+
(a_ini : a 0 = 2)
138+
(a_rec : ∀ n, a (n + 1) = (a n) + 2 ^ ((padicValNat 2 (a n)) + 2) - 1) :
139+
¬ (∃ n k, a n = 4 ^ k) := by
140+
sorry
141+
142+
/--
143+
[BMO#4](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#4._1RB3RB---1LB0LA_2LA4RA3LA4RB1LB_(bbch))
144+
145+
Bonnie the beaver was bored, so she tried to construct a sequence of integers $\{a_n\}_{n \ge 0}$.
146+
She first defined $a_0=2$, then defined $a_{n+1}$ depending on $a_n$ and $n$
147+
using the following rules:
148+
149+
* If $a_n \equiv 0\text{ (mod 3)}$, then $a_{n+1}=\frac{a_n}{3}+2^n+1$.
150+
* If $a_n \equiv 2\text{ (mod 3)}$, then $a_{n+1}=\frac{a_n-2}{3}+2^n-1$.
151+
152+
With these two rules alone, Bonnie calculates the first few terms in the sequence: $2, 0, 3, 6, 11,
153+
18, 39, 78, 155, 306, \dots$. At this point, Bonnie plans to continue writing terms until a term
154+
becomes $1\text{ (mod 3)}$. If Bonnie sticks to her plan, will she ever finish?
155+
156+
[BMO#4](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#4._1RB3RB---1LB0LA_2LA4RA3LA4RB1LB_(bbch))
157+
is equivalent to the non-termination of 2-state 5-symbol Turing machine
158+
[`1RB3RB---1LB0LA_2LA4RA3LA4RB1LB`](https://wiki.bbchallenge.org/wiki/1RB3RB---1LB0LA_2LA4RA3LA4RB1LB) (from all-0 tape).
159+
160+
The machine was informally proven not to halt [bbchallenge.org](bbchallenge.org)
161+
contributor Daniel Yuan on July 19th 2024; see [sketched proof](https://wiki.bbchallenge.org/wiki/1RB3RB---1LB0LA_2LA4RA3LA4RB1LB) and [Discord discussion](https://discord.com/channels/960643023006490684/960643023530762343/1263666591900631210).
162+
-/
163+
@[category research solved, AMS 5 11 68]
164+
theorem beaver_math_olympiad_problem_4
165+
(a : ℕ → ℕ)
166+
(a_ini : a 0 = 2)
167+
(a_rec : ∀ n, a (n+1)
168+
= if a n % 3 = 0 then a n / 3 + 2 ^ n + 1 else (a n - 2) / 3 + 2 ^ n - 1) :
169+
¬ (∃ n, a n % 3 = 1) := by
170+
sorry
171+
172+
/--
173+
[BMO#5](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#5._1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_---0RE_(bbch))
174+
175+
Let $(a_n)_{n \ge 1}$ and $(b_n)_{n \ge 1}$ be two sequences such that $(a_1, b_1) = (0, 5)$ and
176+
177+
$$(a_{n+1}, b_{n+1}) = \begin{cases}
178+
(a_n+1, b_n-f(a_n)) & \text{if } b_n \ge f(a_n) \\
179+
(a_n, 3b_n+a_n+5) & \text{if } b_n < f(a_n)
180+
\end{cases}$$
181+
182+
where $f(x)=10\cdot 2^x-1$ for all non-negative integers $x$.
183+
184+
Does there exist a positive integer $i$ such that $b_i = f(a_i)-1$?
185+
186+
[BMO#5](https://wiki.bbchallenge.org/wiki/Beaver_Math_Olympiad#5._1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_---0RE_(bbch)) is equivalent to asking whether the 6-state Turing machine
187+
[`1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_---0RE`](https://wiki.bbchallenge.org/wiki/1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_---0RE) halts or not.
188+
189+
There is presently no consensus on whether the machine halts or not, hence the problem is formulated
190+
using `↔ answer(sorry)`.
191+
192+
The machine was discovered by [bbchallenge.org](bbchallenge.org) contributor mxdys
193+
on August 7th 2024.
194+
195+
The correspondence between the machine's halting problem and the below reformulation has been proven
196+
in [Rocq](https://github.com/ccz181078/busycoq/blob/BB6/verify/1RB0LD_1LC0RA_1RA1LB_1LA1LE_1RF0LC_---0RE.v).
197+
-/
198+
@[category research open, AMS 5 11 68]
199+
theorem beaver_math_olympiad_problem_5
200+
(a b f : ℕ → ℕ) (hf : f = fun x ↦ 10 * 2 ^ x - 1)
201+
(a_ini : a 0 = 0) (b_ini : b 0 = 5)
202+
(a_rec : ∀ n, a (n + 1) = if f (a n) ≤ b n then a n + 1 else a n)
203+
(b_rec : ∀ n, b (n+1) = if f (a n) ≤ b n then b n - f (a n) else 3 * b n + a n + 5) :
204+
(∃ i, b i = (f (a i)) - 1) ↔ answer(sorry) := by
205+
sorry

FormalConjectures/Other/BusyBeaverAntihydra.lean

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)