{
  "artifactId": "artifact.library.mathlib.halting-problem.v001",
  "candidateOnly": false,
  "category": "Computability and logic",
  "claimBoundary": "This target indexes Mathlib's encoding-specific theorem that, for a fixed input n, the predicate saying a coded computation c halts on n is not computable. It does not quantify over arbitrary machine models or claim a new undecidability proof.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "theorem ComputablePred.halting_problem (n : ℕ) : ¬ComputablePred (fun c ↦ (c.eval n).Dom)",
  "family": "Undecidability",
  "id": "library.mathlib.halting-problem.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/halting-problem/",
    "entryData": "/data/library-theorems/halting-problem.json",
    "evidence": "/proofs/artifact.library.mathlib.halting-problem.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.halting-problem.v001.evidence.json",
    "source": "/sources/upstream/halting-problem/"
  },
  "landmark": {
    "completeFormalType": "theorem ComputablePred.halting_problem (n : ℕ) : ¬ComputablePred (fun c ↦ (c.eval n).Dom)",
    "concepts": [
      "computable predicate",
      "partial recursive function",
      "program code",
      "defined evaluation",
      "Rice's theorem"
    ],
    "plainLanguage": "Fix one input and vary the encoded program. No single computable test can correctly decide for every code whether its evaluation on that input eventually returns a value.",
    "poster": {
      "alt": "An ivory computability poster shows abstract program sheets, one fixed input, a bifurcating proposed classifier, defined and nowhere-defined trajectories, and the fixed-input scope.",
      "byteSize": 2575985,
      "caption": "No computable predicate decides defined evaluation for every code at a fixed input.",
      "description": "The poster separates the theorem's fixed input and encoded-program quantification from the two Rice witnesses, making noncomputability rather than long running time the central conclusion.",
      "derivatives": [
        {
          "byteSize": 82898,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/halting-problem/theorem-poster-v1-640.webp",
          "sha256": "sha256:b61ec1e45c7f384fe6338e6435f9fecb775a1fe48d0efcdb3416a34555eeea33",
          "width": 640
        },
        {
          "byteSize": 181274,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/halting-problem/theorem-poster-v1-1024.webp",
          "sha256": "sha256:13b746766cc7584037037a4f65f9938720a7eb20b9844a0e240282a817ead25a",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-22T00:00:47Z",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/halting-problem/theorem-poster-v1.png",
      "sha256": "sha256:af43ea5de43719738806d6e66c82caa6b9cf74747297f8b6645ea8425c644311",
      "title": "The Halting Problem at a glance",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "COMPUTABILITY · UNDECIDABILITY\nTHE HALTING PROBLEM\nFix an input n and vary the encoded program c\nNo computable predicate decides whether c.eval n is defined\nHALTING IS A NONTRIVIAL SEMANTIC PROPERTY\nHOW THE CHECKED ROUTE MOVES\n1 · Feed the proposed decider into Rice's theorem\n2 · Contrast the zero function with the nowhere-defined function\nEXACT SCOPE\nMathlib's code model at a fixed input. Not every machine formalism at once."
    },
    "visual": {
      "alt": "Abstract ivory-and-gold program codes and one fixed ivory input enter a cobalt classifier as terminating and open-ended trajectories fold back through a restrained red contradiction fracture.",
      "byteSize": 3111526,
      "caption": "A computable fixed-input halting classifier would decide a nontrivial semantic property forbidden by Rice's theorem.",
      "description": "The same fixed input passes through a proposed classifier with varied program codes. One computation resolves to a defined endpoint and another remains nowhere defined, making the semantic distinction nontrivial before the contradiction folds back on the classifier.",
      "derivatives": [
        {
          "byteSize": 52448,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/halting-problem/theorem-schematic-v1-640.webp",
          "sha256": "sha256:5d2fca7375c8b3ecb89c00f80f08b63b5535d6390d5a80195c4ab45fac2ab245",
          "width": 640
        },
        {
          "byteSize": 194672,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/halting-problem/theorem-schematic-v1-1200.webp",
          "sha256": "sha256:da5f45fd92af384ddb2c9da7db32c0a7de61818b215ef41059df1a641abd9c81",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-21T23:10:58Z",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/halting-problem/theorem-schematic-v1.png",
      "sha256": "sha256:58b17453c687977ab98d522c6f1471b802f04ed89cfd0332216f3877aa8b1fa8",
      "title": "Halting Problem schematic",
      "width": 1536
    },
    "walkthrough": {
      "introduction": "Mathlib fixes one input and treats defined evaluation as a semantic property of encoded partial-recursive programs. Rice's theorem rules out a computable classifier once the defined zero function and the nowhere-defined function witness that the property is nontrivial.",
      "pages": [
        {
          "alt": "Several engraved green code mechanisms meet one fixed ivory input bead and enter a cobalt two-way classification gate.",
          "byteSize": 2935344,
          "caption": "Fixing n, the hypothetical computable predicate would separate exactly the codes whose partial evaluation at n is defined.",
          "description": "The selected theorem fixes a natural-number input and varies Mathlib codes c. Its contradiction assumption is a computable predicate for the semantic class of partial-recursive functions defined at that input, the precise input required by ComputablePred.rice.",
          "derivatives": [
            {
              "byteSize": 34178,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/halting-problem/proof-walkthrough-01-v1-640.webp",
              "sha256": "sha256:335089c9888762b45456476aa35d278acf63d55084682453bff51307002db76b",
              "width": 640
            },
            {
              "byteSize": 122474,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/halting-problem/proof-walkthrough-01-v1-1200.webp",
              "sha256": "sha256:bd1a6cb1b416651b8fb4571252f3c66325d497769896f07f8bcaf0a331176c1e",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-21T23:28:42Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/halting-problem/proof-walkthrough-01-v1.png",
          "sha256": "sha256:1faffb5ec53c13810d2f84f75b3570239ec4fd55c6a81896f0c93d7318d69351",
          "title": "A proposed decider classifies codes by their behavior at one input",
          "width": 1536,
          "equation": "ComputablePred (fun c ↦ (c.eval n).Dom)",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 1
        },
        {
          "alt": "The same fixed input and classifier face an emerald trajectory ending at a gold point and a charcoal spiral that remains open, joined by one restrained red contradiction fracture.",
          "byteSize": 2859933,
          "caption": "The zero function belongs to the fixed-input halting class while the nowhere-defined function does not, so Rice's theorem rejects the decider.",
          "description": "The one-line proof supplies Nat.Partrec.zero and Nat.Partrec.none to Rice's theorem. The first computation is defined at the fixed input; the second has no value there. A computable classifier for this nontrivial semantic difference would contradict Rice's theorem.",
          "derivatives": [
            {
              "byteSize": 34354,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/halting-problem/proof-walkthrough-02-v1-640.webp",
              "sha256": "sha256:ab06f31cef2518bde55d1107588d985b2e383ce72130e3b72872027e2719c622",
              "width": 640
            },
            {
              "byteSize": 121840,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/halting-problem/proof-walkthrough-02-v1-1200.webp",
              "sha256": "sha256:55ad05aea55e012dc6d671b9734b03560bb26e4b6f36fe57a26b6b04874c6f04",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-21T23:33:36Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/halting-problem/proof-walkthrough-02-v1.png",
          "sha256": "sha256:085b5806d92ad9eca33068fa0b7c9fa46ff92d5de641dadcbacf21c56e47411f",
          "title": "One witness halts and one never returns",
          "width": 1536,
          "equation": "¬ComputablePred (fun c ↦ (c.eval n).Dom)",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 2
        }
      ],
      "title": "A Rice-theorem proof of fixed-input halting undecidability"
    },
    "whyLandmark": "Halting undecidability marks a fundamental limit on algorithmic prediction. Mathlib's theorem proves an exact fixed-input version for its own code and partial-evaluation model through Rice's theorem."
  },
  "nonClaims": [
    "Proof Atlas did not originate the halting problem theorem or Mathlib's declaration.",
    "The formal scope is Mathlib's encoded programs and evaluation relation at a fixed input, not every machine formalism simultaneously.",
    "The generated explanation and visuals are not proof evidence."
  ],
  "publicExportEligible": true,
  "relationship": "upstream_direct",
  "schemaVersion": "library-theorem-entry-data.v1",
  "statementId": "statement.library.mathlib.halting-problem.v001",
  "statusAxes": {
    "acceptedAtlasResult": "Not recorded for the preferred artifact",
    "locallyReproduced": "Exact upstream declaration replayed",
    "reviewedPage": "2 of 3 presentation reviews recorded",
    "upstreamIndexed": "Pinned source bytes verified locally"
  },
  "summary": "For every fixed input, Mathlib's predicate that an encoded program is defined on that input is not computable.",
  "targetId": "target.library.mathlib.halting-problem.v001",
  "title": "Undecidability of the Halting Problem",
  "upstreamOrigin": {
    "declarationName": "ComputablePred.halting_problem",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/Computability/Halting.lean#L241",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:c2a073a05c631e7fc957577a66025e9ac36dac741f9aa865e0f053b17f0c85de",
    "sourceByteLength": 17535,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/Computability/Halting.lean",
    "sourceLine": 241,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
