Cryptids: Formally Verified Conjecture-Checking & Busy Beaver Turing Machines
This repository contains two Lean 4 (v4.35.0-rc4) formalization libraries for small Turing machines whose halting behavior encodes deep mathematical problems or complex dynamical invariants:
- Conjecture-Checking Turing Machines (
Cryptids/) — Certified state reductions (goldbach_21,goldbach_19,zf_380,zf_173,riemann_95,erdos_ternary_14,weak_collatz_41,weak_collatz_27,weak_collatz_17,weak_collatz_16,weak_collatz_15) and end-to-end Lean 4 mathematical semantics proofs (Halts M ↔ ...) for Goldbach's Conjecture, ZF Set Theory Consistency, the Riemann Hypothesis, Erdős's ternary conjecture, Brocard's problem (brocard_27, a new 27-state machine), Tao's Weak Collatz Conjecture (weak_collatz_75,weak_collatz_41,weak_collatz_27,weak_collatz_17,weak_collatz_16, andweak_collatz_15), Legendre's conjecture (legendre_21, a new 21-state machine), Kurepa's left factorial conjecture (kurepa_19, a new 19-state machine), and Oppermann's conjecture (oppermann_22, a new 22-state machine). - Busy Beaver Holdouts (
BusyBeaver/) — Kernel-verified behavioral proofs (IsHalt,IsNotHalt,HasCollatzReduction,HasStackedCollatzReduction,IsValidAcceleration) for Busy Beaver 6 (BB(6)) and Busy Beaver (3, 3) (BB(3, 3)) holdouts—covering both community-documented machines and novel Collatz-like accelerations discovered via the autonomous agentic pipeline of At the Limits of Computability: Steps Towards Autonomous AI Discovery on the Busy Beaver Frontier (some are potential Cryptids, subject to community acceptance)—connected toConjectureMachines.MachineviaBusyBeaver/Bridge.lean.
Overview
| Library | Scope | Key Results | Documentation |
|---|---|---|---|
Cryptids/ |
(Q, 2) Turing machines for Goldbach, ZF consistency, the Riemann Hypothesis, Erdős's ternary conjecture, Brocard's problem, Tao's Weak Collatz Conjecture, Legendre's conjecture, Kurepa's left factorial conjecture, and Oppermann's conjecture |
Certified state reductions (25 → 21 → 19, 393 → 380, plus zf_173 reduced from James Chang's ZF192 (192 → 173) and proved halting-equivalent to zf_380 (380 → 173), 120 → 104 → 95, 15 → 14, 75 → 41 → 27 → 17 → 16 → 15), a 27-state Brocard machine, a 75-state Weak Collatz reference machine, a 21-state Legendre machine, a 19-state Kurepa machine, a 22-state Oppermann machine, and end-to-end halting equivalences (Halts M ↔ ¬ GoldbachConjecture, ZFInconsistent, ¬ RiemannHypothesis, ¬ ErdosTernaryConjecture, ¬ BrocardConjecture, ¬ WeakCollatzConjecture, ¬ LegendreConjecture, ¬ KurepaConjecture, ¬ OppermannConjecture) |
Cryptids/README.md, Cryptids/Semantics/README.md |
BusyBeaver/ |
BB(6) (6, 2) and BB(3, 3) (3, 3) holdout Turing machines (some are potential Cryptids, subject to community acceptance) |
Shared execution semantics (BusyBeaver/Defs.lean), foundational lemmas (BusyBeaver/Basic.lean), RLE loader and ConjectureMachines bridge (BusyBeaver/Bridge.lean), and certified behavioral proofs in BusyBeaver/BB6/ (277 reductions & potential cryptids across 7 Accelerations/ subdirectories + 228 resolved Halt/ and NonHalt/ proofs, plus hardness evidence) and BusyBeaver/BB33/ (6 machines) |
BusyBeaver/README.md, BusyBeaver/BB6/README.md, BusyBeaver/BB6/Accelerations/README.md, BusyBeaver/BB33/README.md |
All Lean 4 proofs are checked by the kernel without sorry and audited in CI across three axiom tiers:
-
Zero-Axiom (
[]— pureCIC, no axioms whatsoever): Specification definitions (ListBlank,Tape,Halts,Machine,BundledMachine,candidate,reference,PAProvable) represent half-tapes concretely as canonical blank-trimmed lists rather than quotients, and all twelvecandidate_fewer_statestheorems together with syntactic first-orderPAconsistency (not_paProvable_false) depend on zero axioms ([]), audited in CI viacomparator/zero_axioms.json. -
Constructive (
["propext", "Quot.sound"], noClassical.choice): All twelve state reductions (Goldbach21.lean,Goldbach19.lean,Zf380.lean,Zf173.lean,Riemann104.lean,Riemann95.lean,ErdosTernary14.lean,WeakCollatz41.lean,WeakCollatz27.lean,WeakCollatz17.lean,WeakCollatz16.lean,WeakCollatz15.lean), all ZF machine-to-proof-search equivalences (halts_zf393_iff_zfInconsistent,Zf380.Semantics.halts_candidate_iff_zfInconsistent,Zf173.Semantics.halts_candidate_iff_zfInconsistent,halts_zf432_iff_wadeZFInconsistent), first-order Peano Arithmetic (PAProvable) consistency and$\Sigma_1^0$ standard-model adequacy (not_paProvable_false,paHalts_holds_iff_halts,paZFInconsistent_holds_iff_zfInconsistentinCryptids/Semantics/PA/), thebrocard_27equivalenceHalts brocard27 ↔ ∃ n, 7 < n ∧ IsSquare (n! + 1)(Brocard27.lean,Semantics/Brocard27.lean), theweak_collatz_75,weak_collatz_41,weak_collatz_27,weak_collatz_17,weak_collatz_16, andweak_collatz_15nontrivial-cycle and Böhm–Sontacchi Diophantine equivalences, thelegendre_21equivalenceHalts legendre21 ↔ ∃ n, 1 ≤ n ∧ ∀ p, p.Prime → ¬ (n ^ 2 < p ∧ p < (n + 1) ^ 2)(Legendre21.lean,Semantics/Legendre21.lean), thekurepa_19equivalenceHalts kurepa19 ↔ ∃ n, 2 < n ∧ n ∣ leftFactorial n(Kurepa19.lean,Semantics/Kurepa19.lean), and theoppermann_22equivalenceHalts oppermann22 ↔ ∃ n, 2 ≤ n ∧ ((∀ p, p.Prime → ¬ (n ^ 2 - n < p ∧ p < n ^ 2)) ∨ (∀ p, p.Prime → ¬ (n ^ 2 < p ∧ p < n ^ 2 + n)))(Oppermann22.lean,Semantics/Oppermann22.lean), audited in CI viacomparator/constructive.json. Because classical Lean (ZFSet.{0}inSoundness.lean) proves¬ ZFInconsistent—so any non-halting machine would vacuously satisfyHalts M ↔ ZFInconsistentunderClassical.choice—excludingClassical.choiceblocks classicalCon(ZF)shortcuts, while deeply embeddedPAProvableprovides a weak first-order metatheory strictly belowZF(see Foundational Note onCon(ZF)and Constructive Equivalence). -
Classical (
["propext", "Classical.choice", "Quot.sound"]): First-orderPAstandard-model soundness and object-levelPAProvableproofs thatzf_173,zf_380, andzf_393halt iffZFis inconsistent (paProvable_sound_nat,paProvable_halts_zf380_iff_zf393,paProvable_halts_zf393_iff_zfInconsistent,paProvable_halts_zf380_iff_zfInconsistent,paProvable_halts_zf173_iff_zf380,paProvable_halts_zf173_iff_zfInconsistent; proved semantically in arbitraryPAModels via first-order induction and reflected toPAProvablevia internal Gödel–Henkin completenesspaProvable_iff_holdsIn_all_models, which usesClassical.choice), set-theoretic soundness and non-halting inZFSet.{0}(zfProvable_sound_zfSet,not_zfInconsistent,not_halts_zf393,not_halts_candidate), negated-$\Pi_1^0$ Goldbach equivalence (¬ GoldbachConjecture, which uses Markov's Principle), complex-analyticRiemannHypothesisequivalences, theerdos_ternary_15anderdos_ternary_14equivalences withErdosTernaryConjecture(Nat.digits, and Markov's Principle for¬ ErdosTernaryConjecture), thebrocard_27equivalence with¬ BrocardConjecture(Markov's Principle), theweak_collatz_75,weak_collatz_41,weak_collatz_27,weak_collatz_17,weak_collatz_16, andweak_collatz_15equivalences with¬ WeakCollatzConjecture(Markov's Principle), thelegendre_21equivalence with¬ LegendreConjecture(Markov's Principle), thekurepa_19equivalence with¬ KurepaConjecture(Markov's Principle), theoppermann_22equivalence with¬ OppermannConjecture(Markov's Principle), and theBB(6)andBB(3, 3)holdout proofs, audited viacomparator/all.json,comparator/pa_semantics.json,comparator/busy_beaver.json, andcomparator/a6.json.
The 95-state Riemann machine has a kernel-checked
blank-tape halting equivalence to the 104-state machine and to ¬ RiemannHypothesis.
Its transition table, complete 3,634-step initializer, and proof guide are included.
Building and Verifying
Fetch the precompiled Mathlib cache:
Build the conjecture-checking library (Cryptids and Challenge, default targets) and audit with leanprover/comparator:
lake build lake comparator --config comparator/zero_axioms.json lake comparator --config comparator/constructive.json lake comparator --config comparator/all.json python3 verify.py
Build the Busy Beaver library (BusyBeaver and BusyBeaverChallenge) and audit with leanprover/comparator:
lake build BusyBeaver BusyBeaverChallenge lake comparator --config comparator/busy_beaver.json
Repository Structure
Cryptids/— Conjecture-checking Turing machines (Machines.lean,Propositions.lean), state-reduction proofs (Goldbach21.lean,Zf380.lean,Zf173.lean,Riemann95.lean), and end-to-end mathematical semantics (Cryptids/Semantics/).BusyBeaver/— Busy Beaver holdout specifications (Defs.lean), foundational lemmas (Basic.lean), RLE loader and bridge toConjectureMachines(Bridge.lean), and machine behavioral proofs.Challenge.lean,BusyBeaverChallenge.lean&comparator/— Self-contained target theorem specifications and configuration files forleanprover/comparator.artifacts/— Canonicalmachine.txttransition tables and reduction write-ups (exceptzf_173, whose MIT-derivedmachine.txtlives atthird_party/jamesyc_busybeaver/machine.txt) forgoldbach_21,goldbach_19,zf_380,zf_173,riemann_104,riemann_95,erdos_ternary_14,brocard_27,weak_collatz_75,weak_collatz_41,weak_collatz_27,weak_collatz_17,weak_collatz_16,weak_collatz_15,legendre_21,kurepa_19, andoppermann_22.baselines/— Verbatim upstream source files, canonical 5-tuple tables, andPROVENANCE.md.third_party/jamesyc_busybeaver/— MIT-licensed upstreamjamesyc/BusyBeaver(ZF192) machine table and VM verification base, generalized in place forzf_173.RELATED_WORK.md— Literature lineage and(Q, 2)Turing machine conventions.verify.py— Standalone Python 3 verification script for the conjecture-checking machines.
Contributing
Pull requests and issues are welcome, especially for smaller Turing machines for these problems, machines for other conjectures, Busy Beaver holdout proofs, or streamlined Lean proofs. Please also open an issue if you notice anything amiss, such as a missing reference or provenance detail. See CONTRIBUTING.md for general guidelines.
Acknowledgements
We thank Eric Wieser for careful review, as well as the Busy Beaver Challenge community, int-y1 (whose BusyLean project pioneered Lean 4 Busy Beaver formalizations and directed-head configuration representations), James Chang (whose MIT-licensed jamesyc/BusyBeaver ZF192 machine and VM formalization zf_173 builds upon directly), Jeff Ketchersid, Mira (Mira-Cult), Vladimir Reshetnikov, Elliot Glazer, Shivam Patel, Johannes Riebel, Rohan Ridenour, Christoph Wernhard, Wolfgang Bibel, Yijun Leng, Stefan O'Rear, Yuri Matiyasevich, Scott Aaronson, Adam Yedidia, Andrew Wade, Joseph Shunia, Tristan Stérin, and Damien Woods for the baseline Turing machines, compilers, and ZF constructions, and the Mathlib community.
License and disclaimer
Copyright 2026 Google LLC
All software is licensed under the Apache License, Version 2.0 (Apache 2.0), except for third-party files under third_party/, which retain their upstream licenses (e.g., MIT in third_party/jamesyc_busybeaver/LICENSE);
you may not use this file except in compliance with the Apache 2.0 license.
You may obtain a copy of the Apache 2.0 license at:
https://www.apache.org/licenses/LICENSE-2.0
All other materials are licensed under the Creative Commons Attribution 4.0 International License (CC-BY). You may obtain a copy of the CC-BY license at: https://creativecommons.org/licenses/by/4.0/legalcode
Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2.0 or CC-BY licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.
This is not an official Google product.