{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $A \\subseteq \\N$ be a [[subset|0BJR9QR08E]] of the natural numbers.\nThe characteristic function of $A$ is $\\chi_A \\colon \\N \\to \\set{0, 1}$, with $\\chi_A(n) = 1$ if $n \\in A$ and $\\chi_A(n) = 0$ if $n \\notin A$.\nThe set $A$ is *computable*, or *recursive*, or *decidable*, if $\\chi_A$ is a total [[computable function|KZSB5E471K]].\nThe same definition applies to subsets of $\\N^k$.\n\n## Remarks\n\nExample: the set of prime numbers is computable.\nA machine can test $n \\ge 2$ for divisors $d$ with $2 \\le d \u003c n$, which takes finitely many steps, and so computes $\\chi_A$.\n\nNon-example: the set $K = \\set{e : \\text{program } e \\text{ halts on input } e}$ is not computable, by the undecidability of the [[halting problem|Z7TN2B35B0]].\nIts characteristic function is total but not computable.\n\nA set $A$ is computable if and only if both $A$ and $\\N \\setminus A$ are [[computably enumerable|TN9G24VABN]].\nThe computable sets are closed under union, intersection and complement.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "PPGD5KW8JC",
    "kind": "definition",
    "msc": [
      "03D25",
      "03D20"
    ],
    "name": "Computable set",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Computable_set"
      }
    ],
    "tag": "DN5G4NAF95",
    "uses": [
      "KZSB5E471K",
      "0BJR9QR08E"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/DN5G4NAF95/",
  "links": [
    {
      "field": "defines",
      "target": "PPGD5KW8JC"
    },
    {
      "field": "uses",
      "target": "KZSB5E471K"
    },
    {
      "field": "uses",
      "target": "0BJR9QR08E"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/DN5G4NAF95.md",
  "msc": [
    "03D25",
    "03D20"
  ],
  "name": "Computable set",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/DN5/DN5G4NAF95.md",
  "status": null,
  "tag": "DN5G4NAF95",
  "uri": "m2://DN5G4NAF95",
  "url": "https://math2.tamnd.com/wiki/computable-set-definition/",
  "writing": {
    "tag": "DN5G4NAF95",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
