{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nA *heap* is a [[set|0SJ3RX9TXA]] $H$ with a [[ternary operation|WC47MFR6GW]] $[\\cdot, \\cdot, \\cdot] \\colon H \\times H \\times H \\to H$ such that, for all $a, b, c, d, e \\in H$:\n\n1. $[\\,[a, b, c], d, e] = [a, b, [c, d, e]\\,] = [a, [d, c, b], e]$ (para-associativity);\n2. $[a, a, b] = b$ and $[b, a, a] = b$ (identity law).\n\n## Remarks\n\nExample: a [[group|G5S1M9]] $G$ with $[x, y, z] = x y^{-1} z$.\nFor clause 1, all three expressions equal $a b^{-1} c d^{-1} e$; the third one because $(d c^{-1} b)^{-1} = b^{-1} c d^{-1}$.\nFor clause 2, $a a^{-1} b = b$ and $b a^{-1} a = b$.\n\nNon-example: $\\Z$ with $[x, y, z] = x + y + z$.\nClause 1 holds, since all three expressions equal $a + b + c + d + e$.\nClause 2 fails: $[0, 1, 1] = 2 \\ne 0$.\n\nConversely, let $H$ be a nonempty heap and fix $e \\in H$.\nThen $x \\cdot y = [x, e, y]$ makes $H$ a group with identity $e$ and inverse $x^{-1} = [e, x, e]$, and the heap operation is recovered as $[x, y, z] = x y^{-1} z$.\nDifferent choices of $e$ give isomorphic groups.\nSome authors allow the empty heap, which corresponds to no group.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "V389A4WGH9",
    "kind": "definition",
    "msc": [
      "20N10",
      "08A62"
    ],
    "name": "Heap",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Heap_(mathematics)"
      }
    ],
    "tag": "K9XQKT69WF",
    "uses": [
      "0SJ3RX9TXA",
      "WC47MFR6GW",
      "G5S1M9"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/K9XQKT69WF/",
  "links": [
    {
      "field": "defines",
      "target": "V389A4WGH9"
    },
    {
      "field": "uses",
      "target": "0SJ3RX9TXA"
    },
    {
      "field": "uses",
      "target": "WC47MFR6GW"
    },
    {
      "field": "uses",
      "target": "G5S1M9"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/K9XQKT69WF.md",
  "msc": [
    "20N10",
    "08A62"
  ],
  "name": "Heap",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/K9X/K9XQKT69WF.md",
  "status": null,
  "tag": "K9XQKT69WF",
  "uri": "m2://K9XQKT69WF",
  "url": "https://tamnd.github.io/math2/wiki/heap-definition/",
  "writing": {
    "tag": "K9XQKT69WF",
    "kind": "definition",
    "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
      }
    ]
  }
}
