{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\n1. Let $p$ be a [[prime number|0SN0MAEKYX]]. Let $G = (\\mathbb{Z}/p\\mathbb{Z})^\\times$ be the [[group of units|05THZKR9AN]] of $\\mathbb{Z}/p\\mathbb{Z}$.\n2. The ring $\\mathbb{Z}/p\\mathbb{Z}$ [[is a field|0R8YXRC9AJ]]. So $G$ consists of the $p - 1$ nonzero classes $\\overline{1}, \\dots, \\overline{p-1}$.\n3. For $a \\in \\set{1, \\dots, p-1}$, the [[multiplicative order|0SBRX5CZ5R]] $\\operatorname{ord}_p(a)$ is the order of $\\overline{a}$ in $G$. By the [[corollary on orders modulo p|0Y4B7P0GS8]], it divides $p - 1$.\n4. For each positive divisor $d$ of $p - 1$, let $\\psi(d)$ be the number of $a \\in \\set{1, \\dots, p-1}$ with $\\operatorname{ord}_p(a) = d$.\n5. Each of the $p - 1$ elements is counted for exactly one $d$, by step 3. So $\\sum_{d \\mid p-1} \\psi(d) = p - 1$.\n6. Claim: $\\psi(d) \\le \\varphi(d)$ for each $d \\mid p - 1$, where $\\varphi$ is [[Euler's totient function|0VV04M41AN]]. If $\\psi(d) = 0$, this holds. So let $a$ be an element of order $d$.\n7. The classes $\\overline{a}^0, \\overline{a}^1, \\dots, \\overline{a}^{d-1}$ are distinct. Indeed, if $\\overline{a}^i = \\overline{a}^j$ with $0 \\le i \u003c j \u003c d$, then $\\overline{a}^{j-i} = \\overline{1}$ with $0 \u003c j - i \u003c d$. This contradicts $\\operatorname{ord}_p(a) = d$.\n8. Each $\\overline{a}^i$ is a root of $x^d - 1$ in $\\mathbb{Z}/p\\mathbb{Z}$, because $(\\overline{a}^i)^d = (\\overline{a}^d)^i = \\overline{1}$.\n9. The polynomial $x^d - 1$ has degree $d$ over a field. So it has [[at most $d$ roots|0KJVQV3E0F]]. By steps 7 and 8, its roots are exactly $\\overline{a}^0, \\dots, \\overline{a}^{d-1}$.\n10. Let $b$ have order $d$. Then $\\overline{b}$ is a root of $x^d - 1$. By step 9, $\\overline{b} = \\overline{a}^i$ for some $i$ with $0 \\le i \u003c d$.\n11. By the formula for the [[order of a power|0VVPQNVM8S]], the order of $\\overline{a}^i$ is $d / \\gcd(d, i)$. This equals $d$ exactly when $\\gcd(d, i) = 1$.\n12. So the elements of order $d$ are among the $\\overline{a}^i$ with $0 \\le i \u003c d$ and $\\gcd(i, d) = 1$. For $d = 1$ this is $i = 0$; for $d \u003e 1$ it is $1 \\le i \u003c d$. In both cases there are $\\varphi(d)$ such $i$. This proves the claim.\n13. By steps 5 and 6 and the [[sum of the totient over the divisors|09JXE6XMCC]], $p - 1 = \\sum_{d \\mid p-1} \\psi(d) \\le \\sum_{d \\mid p-1} \\varphi(d) = p - 1$.\n14. So equality holds in each term: $\\psi(d) = \\varphi(d)$ for every $d \\mid p - 1$.\n15. In particular $\\psi(p - 1) = \\varphi(p - 1) \\ge 1$, since $1$ is coprime to $p - 1$. So some $g$ has $\\operatorname{ord}_p(g) = p - 1$.\n16. By the [[totient of a prime|0HY1MXMEN9]], $\\varphi(p) = p - 1$. So $g$ is a [[primitive root|0KM2CJ80G7]] modulo $p$.\n17. The group $G$ has order $\\varphi(p) = p - 1$, by the [[order of the group of units|0S7495H4HM]]. By step 7 with $d = p - 1$, the powers of $\\overline{g}$ give $p - 1$ distinct elements of $G$.\n18. So the powers of $\\overline{g}$ fill $G$, and $G$ is a [[cyclic group|0B85Q41RP6]] of order $p - 1$ generated by $\\overline{g}$.\n\n## Idea\n\nOver a field, the polynomial $x^d - 1$ has at most $d$ roots. So once one element of order $d$ exists, all elements of order $d$ are among its powers, and there are exactly $\\varphi(d)$ of them. The counts must add up to $p - 1 = \\sum_{d \\mid p - 1} \\varphi(d)$, so no order can be missing, not even $p - 1$.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "11A07"
    ],
    "name": "Proof of the existence of primitive roots modulo a prime by counting elements of each order",
    "proves": "04XGKK8WQW",
    "sources": [
      {
        "locator": "Theorem 2.6",
        "url": "https://kconrad.math.uconn.edu/blurbs/grouptheory/cyclicmodp.pdf"
      }
    ],
    "tag": "Q83MS5FFZB",
    "uses": [
      "0KM2CJ80G7",
      "0SBRX5CZ5R",
      "0SN0MAEKYX",
      "0Y4B7P0GS8",
      "0R8YXRC9AJ",
      "0KJVQV3E0F",
      "0VVPQNVM8S",
      "09JXE6XMCC",
      "0VV04M41AN",
      "0HY1MXMEN9",
      "0S7495H4HM",
      "05THZKR9AN",
      "0B85Q41RP6"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/Q83MS5FFZB/",
  "links": [
    {
      "field": "proves",
      "target": "04XGKK8WQW"
    },
    {
      "field": "uses",
      "target": "0KM2CJ80G7"
    },
    {
      "field": "uses",
      "target": "0SBRX5CZ5R"
    },
    {
      "field": "uses",
      "target": "0SN0MAEKYX"
    },
    {
      "field": "uses",
      "target": "0Y4B7P0GS8"
    },
    {
      "field": "uses",
      "target": "0R8YXRC9AJ"
    },
    {
      "field": "uses",
      "target": "0KJVQV3E0F"
    },
    {
      "field": "uses",
      "target": "0VVPQNVM8S"
    },
    {
      "field": "uses",
      "target": "09JXE6XMCC"
    },
    {
      "field": "uses",
      "target": "0VV04M41AN"
    },
    {
      "field": "uses",
      "target": "0HY1MXMEN9"
    },
    {
      "field": "uses",
      "target": "0S7495H4HM"
    },
    {
      "field": "uses",
      "target": "05THZKR9AN"
    },
    {
      "field": "uses",
      "target": "0B85Q41RP6"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/Q83MS5FFZB.md",
  "msc": [
    "11A07"
  ],
  "name": "Proof of the existence of primitive roots modulo a prime by counting elements of each order",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/Q83/Q83MS5FFZB.md",
  "status": null,
  "tag": "Q83MS5FFZB",
  "uri": "m2://Q83MS5FFZB",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-existence-of-primitive-roots-modulo-a-prime-by-counting-elements-of-each-order/",
  "writing": {
    "tag": "Q83MS5FFZB",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
