{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\n1. Let $p$ be a [[prime number|0SN0MAEKYX]] and $m = \\sum_{i=0}^{k} m_i p^i$, $n = \\sum_{i=0}^{k} n_i p^i$ with digits $0 \\le m_i, n_i \u003c p$.\n2. Let $R = (\\mathbb{Z}/p\\mathbb{Z})[x]$ be the [[polynomial ring|0Q9EZS90GY]] over the [[integers modulo p|01N3AYAA6N]]. It is a commutative ring. In $R$, the sum of $j$ copies of $1$ is the class of $j$, which is $0$ for $j = p$ and nonzero for $0 \u003c j \u003c p$.\n3. So $R$ has [[characteristic|0P7CH1CND5]] $p$. By the [[freshman's dream|0396VGFA78]], $(1 + x)^p = 1 + x^p$ in $R$.\n4. By induction on $i$, $(1 + x)^{p^i} = 1 + x^{p^i}$ in $R$. The case $i = 0$ is clear. If it holds for $i$, then $(1+x)^{p^{i+1}} = (1 + x^{p^i})^p = 1 + x^{p^{i+1}}$, by the freshman's dream applied to $1$ and $x^{p^i}$.\n5. By the [[binomial theorem|0EHWPWGHB2]] in $R$, for each natural number $N$, $(1 + x)^N = \\sum_{j=0}^{N} \\overline{\\binom{N}{j}} x^j$. Here the bar is the class modulo $p$ of the [[binomial coefficient|092GEF38YD]].\n6. So the coefficient of $x^n$ in $(1+x)^m$ is the class of $\\binom{m}{n}$. This also holds when $n \u003e m$, since the coefficient is then $0$ and $\\binom{m}{n} = 0$ by convention.\n7. Since $m = \\sum_i m_i p^i$, step 4 gives $(1 + x)^m = \\prod_{i=0}^{k} \\left((1+x)^{p^i}\\right)^{m_i} = \\prod_{i=0}^{k} (1 + x^{p^i})^{m_i}$.\n8. By the binomial theorem, $(1 + x^{p^i})^{m_i} = \\sum_{j=0}^{m_i} \\overline{\\binom{m_i}{j}} x^{j p^i}$.\n9. Multiplying out, $(1 + x)^m$ is the sum, over all tuples $(j_0, \\dots, j_k)$ with $0 \\le j_i \\le m_i$, of $\\overline{\\prod_i \\binom{m_i}{j_i}} \\, x^{\\sum_i j_i p^i}$.\n10. Base-$p$ digits are unique. If $\\sum_i a_i p^i = \\sum_i b_i p^i$ with digits in $\\set{0, \\dots, p-1}$, the [[division algorithm|0CHQKZFK5S]] by $p$ gives $a_0 = b_0$. Subtracting, dividing by $p$ and repeating gives $a_i = b_i$ for all $i$.\n11. In step 9 each $j_i \\le m_i \u003c p$. So by step 10, $\\sum_i j_i p^i = n$ holds exactly when $j_i = n_i$ for every $i$.\n12. If $n_i \\le m_i$ for all $i$, exactly one tuple contributes to $x^n$, and the coefficient of $x^n$ is the class of $\\prod_i \\binom{m_i}{n_i}$.\n13. If $n_i \u003e m_i$ for some $i$, no tuple contributes, and the coefficient of $x^n$ is $0$. In this case $\\binom{m_i}{n_i} = 0$, so the coefficient is again the class of $\\prod_i \\binom{m_i}{n_i}$.\n14. Two equal polynomials have equal coefficients. Comparing steps 6, 12 and 13 gives $\\binom{m}{n} \\equiv \\prod_{i=0}^{k} \\binom{m_i}{n_i} \\pmod p$, a [[congruence modulo p|0TPW25CBN6]].\n\n## Idea\n\nModulo $p$, raising to the power $p$ is additive, so $(1+x)^{p^i} \\equiv 1 + x^{p^i}$. Writing $m$ in base $p$ factors $(1+x)^m$ into pieces, one for each digit. Uniqueness of base-$p$ digits means that $x^n$ arises from exactly one choice in each piece, namely the digit $n_i$.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "11B65"
    ],
    "name": "Proof of Lucas's theorem by generating functions",
    "proves": "0RY4GGMEQG",
    "sources": [
      {
        "locator": "Proof based on generating functions",
        "url": "https://en.wikipedia.org/wiki/Lucas%27s_theorem"
      }
    ],
    "tag": "YTQGZR0744",
    "uses": [
      "0SN0MAEKYX",
      "0TPW25CBN6",
      "092GEF38YD",
      "0EHWPWGHB2",
      "0396VGFA78",
      "0Q9EZS90GY",
      "01N3AYAA6N",
      "0P7CH1CND5",
      "0CHQKZFK5S"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/YTQGZR0744/",
  "links": [
    {
      "field": "proves",
      "target": "0RY4GGMEQG"
    },
    {
      "field": "uses",
      "target": "0SN0MAEKYX"
    },
    {
      "field": "uses",
      "target": "0TPW25CBN6"
    },
    {
      "field": "uses",
      "target": "092GEF38YD"
    },
    {
      "field": "uses",
      "target": "0EHWPWGHB2"
    },
    {
      "field": "uses",
      "target": "0396VGFA78"
    },
    {
      "field": "uses",
      "target": "0Q9EZS90GY"
    },
    {
      "field": "uses",
      "target": "01N3AYAA6N"
    },
    {
      "field": "uses",
      "target": "0P7CH1CND5"
    },
    {
      "field": "uses",
      "target": "0CHQKZFK5S"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/YTQGZR0744.md",
  "msc": [
    "11B65"
  ],
  "name": "Proof of Lucas's theorem by generating functions",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/YTQ/YTQGZR0744.md",
  "status": null,
  "tag": "YTQGZR0744",
  "uri": "m2://YTQGZR0744",
  "url": "https://math2.tamnd.com/wiki/proof-of-lucass-theorem-by-generating-functions/",
  "writing": {
    "tag": "YTQGZR0744",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
