{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe check that the given map is injective and surjective.\n\n1. Each $n \\in \\N$ is either $2k$ or $2k + 1$ for exactly one $k \\in \\N$, by the [[division algorithm|0CHQKZFK5S]] with divisor $2$. So $f(2k) = k$ and $f(2k+1) = -(k+1)$ define a function $f \\colon \\N \\to \\Z$.\n2. For even $n = 2k$, $f(n) = k \\ge 0$. For odd $n = 2k + 1$, $f(n) = -(k + 1) \\le -1$.\n3. The map $f$ is [[injective|0PVG1CRAJN]]. Let $f(n) = f(n')$. By step 2, $n$ and $n'$ are both even or both odd.\n4. If $n = 2k$ and $n' = 2k'$, then $k = k'$, so $n = n'$. If $n = 2k + 1$ and $n' = 2k' + 1$, then $-(k+1) = -(k'+1)$, so $k = k'$ and $n = n'$.\n5. The map $f$ is [[surjective|0XKH881BZ7]]. Let $m \\in \\Z$. If $m \\ge 0$, then $f(2m) = m$.\n6. If $m \u003c 0$, put $k = -m - 1$. Then $k \\in \\N$, and $f(2k + 1) = -(k + 1) = m$.\n7. So $f$ is a [[bijection|0SNQEF7Z53]] from $\\N$ to $\\Z$, and $\\Z$ is [[countably infinite|0SEZ3JGZP7]].\n\n## Idea\n\nList the integers as $0, -1, 1, -2, 2, \\dots$. The even positions hold the nonnegative integers and the odd positions hold the negative ones. Each integer appears exactly once in this list.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "03E10"
    ],
    "name": "Proof that the integers are countable",
    "proves": "066RJJVWH9",
    "sources": [
      {
        "locator": "Introduction",
        "url": "https://en.wikipedia.org/wiki/Countable_set"
      }
    ],
    "tag": "BVDCFVVCJ8",
    "uses": [
      "0SEZ3JGZP7",
      "0SNQEF7Z53",
      "0PVG1CRAJN",
      "0XKH881BZ7",
      "0CHQKZFK5S"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/BVDCFVVCJ8/",
  "links": [
    {
      "field": "proves",
      "target": "066RJJVWH9"
    },
    {
      "field": "uses",
      "target": "0SEZ3JGZP7"
    },
    {
      "field": "uses",
      "target": "0SNQEF7Z53"
    },
    {
      "field": "uses",
      "target": "0PVG1CRAJN"
    },
    {
      "field": "uses",
      "target": "0XKH881BZ7"
    },
    {
      "field": "uses",
      "target": "0CHQKZFK5S"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/BVDCFVVCJ8.md",
  "msc": [
    "03E10"
  ],
  "name": "Proof that the integers are countable",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/BVD/BVDCFVVCJ8.md",
  "status": null,
  "tag": "BVDCFVVCJ8",
  "uri": "m2://BVDCFVVCJ8",
  "url": "https://math2.tamnd.com/wiki/proof-that-the-integers-are-countable/",
  "writing": {
    "tag": "BVDCFVVCJ8",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
