{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe expand both sides, using the laws of a [[commutative ring|0GYGHKX834]].\n\n1. Call the four expressions on the right $z_1, z_2, z_3, z_4$, in the order written. Each $z_k$ is a sum of four terms $\\pm a_i b_j$.\n2. The index pairs $(i, j)$ in the terms are: in $z_1$, $(1,1), (2,2), (3,3), (4,4)$; in $z_2$, $(1,2), (2,1), (3,4), (4,3)$; in $z_3$, $(1,3), (2,4), (3,1), (4,2)$; in $z_4$, $(1,4), (2,3), (3,2), (4,1)$.\n3. So each of the $16$ pairs $(i, j)$ occurs in exactly one $z_k$, and in exactly one term.\n4. For $t_1, \\dots, t_4$ in a commutative ring, $(t_1 + t_2 + t_3 + t_4)^2 = \\sum_i t_i^2 + 2\\sum_{i \u003c l} t_i t_l$.\n5. By steps 3 and 4, the squares of the terms add up to $\\sum_{i, j} a_i^2 b_j^2$. This is the left side $(\\sum_i a_i^2)(\\sum_j b_j^2)$.\n6. It remains to show that the cross terms $2 t_i t_l$ cancel. Each cross term is $\\pm 2\\, a_i a_l b_j b_r$ with $i \\ne l$ and $j \\ne r$. We list the coefficients of each such monomial, without the factor $2$.\n7. $a_1a_2b_1b_2$: $-1$ from $z_1$ and $+1$ from $z_2$. $a_1a_2b_3b_4$: $-1$ from $z_3$ and $+1$ from $z_4$.\n8. $a_1a_3b_1b_3$: $-1$ from $z_1$ and $+1$ from $z_3$. $a_1a_3b_2b_4$: $+1$ from $z_2$ and $-1$ from $z_4$.\n9. $a_1a_4b_1b_4$: $-1$ from $z_1$ and $+1$ from $z_4$. $a_1a_4b_2b_3$: $-1$ from $z_2$ and $+1$ from $z_3$.\n10. $a_2a_3b_2b_3$: $+1$ from $z_1$ and $-1$ from $z_4$. $a_2a_3b_1b_4$: $+1$ from $z_2$ and $-1$ from $z_3$.\n11. $a_2a_4b_2b_4$: $+1$ from $z_1$ and $-1$ from $z_3$. $a_2a_4b_1b_3$: $-1$ from $z_2$ and $+1$ from $z_4$.\n12. $a_3a_4b_3b_4$: $+1$ from $z_1$ and $-1$ from $z_2$. $a_3a_4b_1b_2$: $+1$ from $z_3$ and $-1$ from $z_4$.\n13. Each $z_k$ has $6$ cross terms, so there are $24$ in all. Steps 7 to 12 account for all $24$, in $12$ pairs with opposite signs.\n14. For example, in $z_1$ the terms $a_1b_1$ and $-a_2b_2$ give $-2a_1a_2b_1b_2$. In $z_2$ the terms $a_1b_2$ and $a_2b_1$ give $+2a_1a_2b_1b_2$. The other lines are read off in the same way.\n15. So all cross terms cancel, and $z_1^2 + z_2^2 + z_3^2 + z_4^2$ equals the left side.\n\n## Idea\n\nEach product $a_i b_j$ appears in exactly one of the four squares, so the squared terms give the product of the two sums. The signs are arranged, as in the multiplication of quaternions, so that the cross terms cancel in pairs.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "11E25"
    ],
    "name": "Proof of Euler's four-square identity by expansion",
    "proves": "08WTN6SCQ6",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Euler%27s_four-square_identity"
      }
    ],
    "tag": "BTTJMY7FJ0",
    "uses": [
      "0GYGHKX834"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/BTTJMY7FJ0/",
  "links": [
    {
      "field": "proves",
      "target": "08WTN6SCQ6"
    },
    {
      "field": "uses",
      "target": "0GYGHKX834"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/BTTJMY7FJ0.md",
  "msc": [
    "11E25"
  ],
  "name": "Proof of Euler's four-square identity by expansion",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/BTT/BTTJMY7FJ0.md",
  "status": null,
  "tag": "BTTJMY7FJ0",
  "uri": "m2://BTTJMY7FJ0",
  "url": "https://math2.tamnd.com/wiki/proof-of-eulers-four-square-identity-by-expansion/",
  "writing": {
    "tag": "BTTJMY7FJ0",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
