{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe count the units of $\\Z/n\\Z$ through a bijection.\n\n1. Let $n \\geq 1$. Write $[b] = b + n\\Z$ for the [[residue class|0QRV8FPK5M]] of an integer $b$ modulo $n$.\n2. Let $S$ be the set of integers $a$ with $0 \\leq a \\leq n - 1$ and $\\gcd(a, n) = 1$. By definition, $S$ has $\\varphi(n)$ elements.\n3. Each class of [[$\\Z/n\\Z$|01N3AYAA6N]] is $[b]$ for an integer $b$. By the [[division algorithm|0CHQKZFK5S]], $b = nq + r$ with integers $q$ and $0 \\leq r \\leq n - 1$.\n4. Then $b + n\\Z = r + n\\Z$, so $[b] = [r]$. Thus each class is $[r]$ for some $r$ with $0 \\leq r \\leq n - 1$.\n5. Let $0 \\leq r \u003c s \\leq n - 1$. If $[r] = [s]$, then $s \\in [s] = r + n\\Z$, so $n$ divides $s - r$.\n6. But $0 \u003c s - r \u003c n$, so $n$ does not divide $s - r$. Hence the classes $[0], [1], \\ldots, [n-1]$ are pairwise distinct.\n7. The group [[$(\\Z/n\\Z)^\\times$|0F8X8ZRQ53]] is the set of the units of $\\Z/n\\Z$. By [[the characterisation of units|0GXNHEHQNA]], $[a]$ is a unit if and only if $\\gcd(a, n) = 1$.\n8. Define $f \\colon S \\to (\\Z/n\\Z)^\\times$ by $f(a) = [a]$. By step 7, $f(a)$ is a unit for each $a \\in S$.\n9. The map $f$ is injective by step 6.\n10. Let $u$ be a unit. By step 4, $u = [r]$ with $0 \\leq r \\leq n - 1$. By step 7, $\\gcd(r, n) = 1$. So $r \\in S$ and $f(r) = u$, and $f$ is surjective.\n11. So $f$ is a bijection, and the [[order|0SEX9F9J5Z]] of $(\\Z/n\\Z)^\\times$ is the number of elements of $S$, which is $\\varphi(n)$.\n\n## Idea\n\nEach residue class modulo $n$ has exactly one representative between $0$ and $n - 1$. A class is a unit exactly when its representative is coprime to $n$. So counting units is the same as counting these representatives, and $\\varphi(n)$ counts them.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "11A07",
      "11A25"
    ],
    "name": "Proof that the order of the group of units of Z/nZ is Euler's totient",
    "proves": "0S7495H4HM",
    "sources": [
      {
        "locator": "Group axioms",
        "url": "https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n"
      }
    ],
    "tag": "A9SEXWS278",
    "uses": [
      "01N3AYAA6N",
      "0QRV8FPK5M",
      "0F8X8ZRQ53",
      "0GXNHEHQNA",
      "0CHQKZFK5S",
      "0SEX9F9J5Z"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/A9SEXWS278/",
  "links": [
    {
      "field": "proves",
      "target": "0S7495H4HM"
    },
    {
      "field": "uses",
      "target": "01N3AYAA6N"
    },
    {
      "field": "uses",
      "target": "0QRV8FPK5M"
    },
    {
      "field": "uses",
      "target": "0F8X8ZRQ53"
    },
    {
      "field": "uses",
      "target": "0GXNHEHQNA"
    },
    {
      "field": "uses",
      "target": "0CHQKZFK5S"
    },
    {
      "field": "uses",
      "target": "0SEX9F9J5Z"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/A9SEXWS278.md",
  "msc": [
    "11A07",
    "11A25"
  ],
  "name": "Proof that the order of the group of units of Z/nZ is Euler's totient",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/A9S/A9SEXWS278.md",
  "status": null,
  "tag": "A9SEXWS278",
  "uri": "m2://A9SEXWS278",
  "url": "https://math2.tamnd.com/wiki/proof-that-the-order-of-the-group-of-units-of-z-nz-is-eulers-totient/",
  "writing": {
    "tag": "A9SEXWS278",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
