{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe argue by [[induction|0ASJVEFA9J]], first for two lemmas and then for the statement.\nLet $S$ be the [[successor function|0832XVR512]].\nThe [[addition|0W5DSDFQ4G]] satisfies $a + 0 = a$ and $a + S(b) = S(a + b)$ for all natural numbers $a$ and $b$.\nWrite $1 = S(0)$. Then $n + 1 = n + S(0) = S(n + 0) = S(n)$ for each natural number $n$.\n\n1. Lemma 1: $0 + a = a$ for every natural number $a$. We use induction on $a$.\n2. For $a = 0$, the definition gives $0 + 0 = 0$.\n3. Suppose that $0 + a = a$. Then $0 + S(a) = S(0 + a) = S(a)$, by the definition and the hypothesis. This proves Lemma 1.\n4. Lemma 2: $S(a) + b = S(a + b)$ for all natural numbers $a$ and $b$. Fix $a$ and use induction on $b$.\n5. For $b = 0$, we have $S(a) + 0 = S(a)$ and $S(a + 0) = S(a)$, so both sides are equal.\n6. Suppose that $S(a) + b = S(a + b)$. Then $S(a) + S(b) = S(S(a) + b) = S(S(a + b))$, by the definition and the hypothesis.\n7. Also $S(a + S(b)) = S(S(a + b))$ by the definition. So $S(a) + S(b) = S(a + S(b))$, which proves Lemma 2.\n8. Now fix $a$. We prove $a + b = b + a$ by induction on $b$.\n9. For $b = 0$, we have $a + 0 = a$ by the definition and $0 + a = a$ by Lemma 1. So $a + 0 = 0 + a$.\n10. Suppose that $a + b = b + a$. Then $a + S(b) = S(a + b) = S(b + a)$, by the definition and the hypothesis.\n11. By Lemma 2, $S(b) + a = S(b + a)$. So $a + S(b) = S(b) + a$.\n12. By induction, $a + b = b + a$ for every natural number $b$. Since $a$ was arbitrary, this holds for all natural numbers $a$ and $b$.\n\n## Idea\n\nThe definition of addition only tells us how to add $0$ or a successor on the right.\nThe two lemmas show that $0$ and successors behave in the same way on the left.\nWith them, an induction on the second number moves each successor from one side to the other.\n",
  "commit": "68a8c3dc73fd55004b2796431c607c30960d1a85",
  "front": {
    "kind": "proof",
    "methods": [
      "0ASJVEFA9J"
    ],
    "msc": [
      "03F30"
    ],
    "name": "Proof of the commutativity of addition by induction",
    "proves": "0DFZNHJ0S2",
    "sources": [
      {
        "locator": "Proof of commutativity",
        "url": "https://en.wikipedia.org/wiki/Proofs_involving_the_addition_of_natural_numbers"
      }
    ],
    "tag": "4EQPCHKEBH",
    "uses": [
      "0W5DSDFQ4G",
      "0832XVR512",
      "0ASJVEFA9J"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/4EQPCHKEBH/",
  "links": [
    {
      "field": "proves",
      "target": "0DFZNHJ0S2"
    },
    {
      "field": "uses",
      "target": "0W5DSDFQ4G"
    },
    {
      "field": "uses",
      "target": "0832XVR512"
    },
    {
      "field": "uses",
      "target": "0ASJVEFA9J"
    },
    {
      "field": "methods",
      "target": "0ASJVEFA9J"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/4EQPCHKEBH.md",
  "msc": [
    "03F30"
  ],
  "name": "Proof of the commutativity of addition by induction",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/4EQ/4EQPCHKEBH.md",
  "status": null,
  "tag": "4EQPCHKEBH",
  "uri": "m2://4EQPCHKEBH",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-commutativity-of-addition-by-induction/",
  "writing": {
    "tag": "4EQPCHKEBH",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
