{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\n1. Let $n$ be a positive integer. For an integer $a$, write $\\overline{a}$ for its [[residue class|0QRV8FPK5M]] modulo $n$. Then $\\overline{a} = \\overline{b}$ if and only if $a \\equiv b \\pmod n$.\n2. The classes $\\overline{1}, \\overline{2}, \\dots, \\overline{n}$ are distinct. Indeed, two different integers in $\\{ 1, \\dots, n \\}$ differ by a number between $1$ and $n - 1$, which $n$ does not divide.\n3. Since $n \\equiv 0 \\pmod n$, we have $\\overline{n} = \\overline{0}$. So by the definition of [[integers modulo n|01N3AYAA6N]], $\\mathbb{Z}/n\\mathbb{Z} = \\{ \\overline{1}, \\overline{2}, \\dots, \\overline{n} \\}$.\n4. Let $a$ be an integer. The class $\\overline{a}$ is a [[unit|019NFGFPR5]] if there is an integer $x$ with $\\overline{a} \\cdot \\overline{x} = \\overline{1}$. The ring is commutative, so one side suffices.\n5. Since $\\overline{a} \\cdot \\overline{x} = \\overline{a x}$, step 1 shows that $\\overline{a} \\cdot \\overline{x} = \\overline{1}$ if and only if $a x \\equiv 1 \\pmod n$.\n6. So $\\overline{a}$ is invertible if and only if $a$ has a [[modular multiplicative inverse|00GXTQMY8Z]] modulo $n$.\n7. By the [[existence of inverses modulo n|0M67FWZWPQ]], this holds if and only if $a$ and $n$ are [[coprime|0GFKP8F8AG]].\n8. By steps 3 and 7, the invertible elements are the classes $\\overline{a}$ with $1 \\le a \\le n$ and $a$ coprime to $n$. By step 2, these classes are distinct.\n9. By the definition of [[Euler's totient function|0VV04M41AN]], there are $\\varphi(n)$ such integers $a$. Hence $\\mathbb{Z}/n\\mathbb{Z}$ has exactly $\\varphi(n)$ invertible elements.\n\n## Idea\n\nEach class modulo $n$ has exactly one representative among $1, \\dots, n$. A class is invertible exactly when its representative is coprime to $n$, so counting the invertible classes is counting the integers that $\\varphi(n)$ counts.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "methods": [
      "0NTF6DMVAP"
    ],
    "msc": [
      "11A07"
    ],
    "name": "Proof of the number of invertible residues modulo n",
    "proves": "06RJWZCG95",
    "sources": [
      {
        "locator": "Integers modulo m",
        "url": "https://en.wikipedia.org/wiki/Modular_multiplicative_inverse"
      }
    ],
    "tag": "X5KJ580184",
    "uses": [
      "01N3AYAA6N",
      "0QRV8FPK5M",
      "019NFGFPR5",
      "0TPW25CBN6",
      "00GXTQMY8Z",
      "0M67FWZWPQ",
      "0VV04M41AN",
      "0GFKP8F8AG"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/X5KJ580184/",
  "links": [
    {
      "field": "proves",
      "target": "06RJWZCG95"
    },
    {
      "field": "uses",
      "target": "01N3AYAA6N"
    },
    {
      "field": "uses",
      "target": "0QRV8FPK5M"
    },
    {
      "field": "uses",
      "target": "019NFGFPR5"
    },
    {
      "field": "uses",
      "target": "0TPW25CBN6"
    },
    {
      "field": "uses",
      "target": "00GXTQMY8Z"
    },
    {
      "field": "uses",
      "target": "0M67FWZWPQ"
    },
    {
      "field": "uses",
      "target": "0VV04M41AN"
    },
    {
      "field": "uses",
      "target": "0GFKP8F8AG"
    },
    {
      "field": "methods",
      "target": "0NTF6DMVAP"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/X5KJ580184.md",
  "msc": [
    "11A07"
  ],
  "name": "Proof of the number of invertible residues modulo n",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/X5K/X5KJ580184.md",
  "status": null,
  "tag": "X5KJ580184",
  "uri": "m2://X5KJ580184",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-number-of-invertible-residues-modulo-n/",
  "writing": {
    "tag": "X5KJ580184",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
