{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\n1. Let $p$ be a prime and let $m, n$ be natural numbers. For a natural number $x$ with base-$p$ digits $x = \\sum_{j \\ge 0} x_j p^j$, $0 \\le x_j \u003c p$, let $s(x) = \\sum_j x_j$ be its digit sum.\n2. Base-$p$ digits are unique. If $\\sum_j a_j p^j = \\sum_j b_j p^j$ with all 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_j = b_j$ for all $j$.\n3. Fix $x$ as in step 1 and $i \\ge 1$. Write $x = p^i A + B$ with $A = \\sum_{j \\ge i} x_j p^{j-i}$ and $B = \\sum_{j \u003c i} x_j p^j$.\n4. Then $0 \\le B \\le \\sum_{j\u003ci} (p-1) p^j = p^i - 1$. So $A \\le x / p^i \u003c A + 1$, and $A = \\lfloor x/p^i \\rfloor$ by the definition of the [[floor function|0YVRNEDSVG]].\n5. By [[Legendre's formula|01WPV9PHN7]] and step 4, $\\nu_p(x!) = \\sum_{i \\ge 1} \\sum_{j \\ge i} x_j p^{j-i} = \\sum_{j \\ge 1} x_j (p^{j-1} + \\dots + p + 1)$.\n6. Since $p^{j-1} + \\dots + 1 = (p^j - 1)/(p - 1)$, this gives $\\nu_p(x!) = \\sum_j x_j (p^j - 1)/(p-1) = (x - s(x))/(p - 1)$.\n7. By the [[factorial formula|033KTKKRV6]], $\\binom{m+n}{m} \\, m! \\, n! = (m+n)!$. By the [[valuation of a product|0850JJMJYZ]] and step 6, $\\nu_p \\binom{m+n}{m} = \\dfrac{s(m) + s(n) - s(m+n)}{p - 1}$.\n8. Now we describe addition in base $p$. Choose $K$ with $m + n \u003c p^K$, and write $m = \\sum_{j=0}^{K} m_j p^j$ and $n = \\sum_{j=0}^{K} n_j p^j$ with digits in $\\set{0, \\dots, p-1}$.\n9. Set $c_{-1} = 0$. For $j = 0, 1, \\dots, K$ in turn, let $c_j = 1$ if $m_j + n_j + c_{j-1} \\ge p$ and $c_j = 0$ otherwise. Put $r_j = m_j + n_j + c_{j-1} - p c_j$.\n10. By induction on $j$, $c_j \\in \\set{0, 1}$ and $0 \\le r_j \\le p - 1$. Indeed $0 \\le m_j + n_j + c_{j-1} \\le 2p - 1$. The carry $c_j = 1$ is exactly a carry at place $j$, so the number of carries is $C = \\sum_{j=0}^{K} c_j$.\n11. Summing $r_j p^j$ over $j$, the carry terms telescope: $\\sum_{j=0}^{K} r_j p^j = m + n + c_{-1} - c_K p^{K+1} = m + n - c_K p^{K+1}$.\n12. The left side is at least $0$. If $c_K = 1$, this gives $m + n \\ge p^{K+1}$, against $m + n \u003c p^K$. So $c_K = 0$, and $\\sum_{j=0}^{K} r_j p^j = m + n$.\n13. By step 2, the $r_j$ are the base-$p$ digits of $m + n$. So $s(m+n) = \\sum_j r_j$.\n14. Summing the definition of $r_j$ over $j$ gives $s(m+n) = s(m) + s(n) + \\sum_{j=0}^{K} c_{j-1} - p \\sum_{j=0}^{K} c_j$.\n15. Since $c_{-1} = 0$ and $c_K = 0$, we have $\\sum_{j=0}^{K} c_{j-1} = C$. So $s(m) + s(n) - s(m+n) = pC - C = (p - 1) C$.\n16. With step 7, $\\nu_p \\binom{m+n}{m} = C$, the number of carries when one adds $m$ and $n$ in base $p$.\n\n## Idea\n\nLegendre's formula can be rewritten as $\\nu_p(x!) = (x - s(x))/(p - 1)$, with $s(x)$ the base-$p$ digit sum. So the valuation of $\\binom{m+n}{m}$ measures how much the digit sum drops when one adds $m$ and $n$. Each carry replaces $p$ in one place by $1$ in the next place, so it lowers the digit sum by exactly $p - 1$.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "11B65"
    ],
    "name": "Proof of Kummer's theorem from Legendre's formula",
    "proves": "0VBWK9XYDG",
    "sources": [
      {
        "locator": "Statement",
        "url": "https://en.wikipedia.org/wiki/Kummer%27s_theorem"
      },
      {
        "locator": "Alternate form",
        "url": "https://en.wikipedia.org/wiki/Legendre%27s_formula"
      }
    ],
    "tag": "9933XVSBPV",
    "uses": [
      "04VCPS30ZE",
      "01WPV9PHN7",
      "033KTKKRV6",
      "0850JJMJYZ",
      "0CHQKZFK5S",
      "0YVRNEDSVG",
      "092GEF38YD"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/9933XVSBPV/",
  "links": [
    {
      "field": "proves",
      "target": "0VBWK9XYDG"
    },
    {
      "field": "uses",
      "target": "04VCPS30ZE"
    },
    {
      "field": "uses",
      "target": "01WPV9PHN7"
    },
    {
      "field": "uses",
      "target": "033KTKKRV6"
    },
    {
      "field": "uses",
      "target": "0850JJMJYZ"
    },
    {
      "field": "uses",
      "target": "0CHQKZFK5S"
    },
    {
      "field": "uses",
      "target": "0YVRNEDSVG"
    },
    {
      "field": "uses",
      "target": "092GEF38YD"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/9933XVSBPV.md",
  "msc": [
    "11B65"
  ],
  "name": "Proof of Kummer's theorem from Legendre's formula",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/993/9933XVSBPV.md",
  "status": null,
  "tag": "9933XVSBPV",
  "uri": "m2://9933XVSBPV",
  "url": "https://math2.tamnd.com/wiki/proof-of-kummers-theorem-from-legendres-formula/",
  "writing": {
    "tag": "9933XVSBPV",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
