{
  "id": "7712",
  "ident": "NS.07712",
  "slug": "wikipedia-busybeaver",
  "title": "Busy Beaver",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "The value of the Busy Beaver function for 5 states is 47176870.",
  "subjects": [
    "math.LO",
    "msc:03"
  ],
  "tags": [],
  "collection": "wikipedia",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "BusyBeaver.BB_5",
  "statement_lean": "theorem BB_5 : BB 5 = 47176870",
  "challenge_source": "/-\nCopyright 2025 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Busy Beaver\n\nThe Busy Beaver problem asks for the maximum number of steps that an n-state, 2-symbol Turing\nmachine can take before halting, when started on an empty tape.\n\n*References:*\n\n- [The Busy Beaver Challenge](https://wiki.bbchallenge.org/wiki/Main_Page)\n-/\n\n@[expose] public section\n\nuniverse u v\n\nopen Turing BusyBeaver\n\nnamespace BusyBeaver\n\nstructure Candidate (n : ℕ) where\n  Γ : Type\n  Λ : Type\n  Γ_fintype : Fintype Γ\n  Γ_card : Fintype.card Γ = 2\n  Γ_inhabited : Inhabited Γ\n  Λ_fintype : Fintype Λ\n  Λ_card : Fintype.card Λ = n\n  Λ_inhabited : Inhabited Λ\n  M : Machine Γ Λ\n  M_isHalting : M.IsHalting\n\ninstance {n : ℕ} {M : Candidate n} : Fintype M.Γ := M.Γ_fintype\ninstance {n : ℕ} {M : Candidate n} : Fintype M.Λ := M.Λ_fintype\ninstance {n : ℕ} {M : Candidate n} : Inhabited M.Γ := M.Γ_inhabited\ninstance {n : ℕ} {M : Candidate n} : Inhabited M.Λ := M.Λ_inhabited\n\n/--\n`BB(n)` is the `n`-th Busy Beaver number.\n*This is the maximum shifts function*, not the \"number of ones function\"\n-/\nnoncomputable def BB (n : ℕ) : ℕ :=\n  sSup { N | ∃ C : Candidate n, C.M.haltingNumber = N}\n\n/--\nTo compute `BB n`, we need only consider machines with states and symbols indexed in `Fin`.\n-/\n@[category API, AMS 3]\ntheorem sanity_check (n : ℕ) [NeZero n] :\n    BB n = sSup {N | ∃ (M : Machine (Fin 2) (Fin n)) (_ : M.IsHalting),\n      M.haltingNumber = N} := by\n  sorry\n\n/-- The value of the Busy Beaver function for 1 state is 1. -/\n@[category test, AMS 3]\ntheorem BB_1 : BB 1 = 1 := by\n  sorry\n\n/-- The value of the Busy Beaver function for 2 states is 6. -/\n@[category textbook, AMS 3]\ntheorem BB_2 : BB 2 = 6 := by\n  sorry\n\n/-- The value of the Busy Beaver function for 3 states is 21. -/\n@[category textbook, AMS 3]\ntheorem BB_3 : BB 3 = 21 := by\n  sorry\n\n/-- The value of the Busy Beaver function for 4 states is 107. -/\n@[category textbook, AMS 3]\ntheorem BB_4 : BB 4 = 107 := by\n  sorry\n\n/-- The value of the Busy Beaver function for 5 states is 47176870. -/\n@[category research solved, AMS 3]\ntheorem BB_5 : BB 5 = 47176870 := by\n  sorry\n\ndef BB_6.answer : ℕ := sorry\n\n/--\nDetermine the value of the Busy Beaver function at n = 6.\n-/\n@[category research open, question value, AMS 3]\ntheorem BB_6 : BB 6 = BB_6.answer := by\n  sorry\n\nend BusyBeaver\n",
  "statement_hash": "11958dde77a4ac7e56d0623c6dd17644a31fef28c618baa1ef43ab8737382ad9",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}