{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $\\Sigma$ be a signature of function symbols and let $K$ be a class of $\\Sigma$-algebras.\nAn algebra $I \\in K$ is *initial in $K$* if for every $A \\in K$ there is exactly one [[homomorphism|KBXSZC6BV1]] $I \\to A$.\nThe [[term algebra|3YYKGWJJND]] $T_\\Sigma$ of ground terms is initial in the class of all $\\Sigma$-algebras.\nIn *initial algebra semantics*, the meaning of a ground term $t$ in a $\\Sigma$-algebra $A$ is $[\\![t]\\!]_A = h_A(t)$, where $h_A \\colon T_\\Sigma \\to A$ is the unique homomorphism.\nLet $E$ be a set of [[equations|PKD440G2XW]].\nThe meaning of the specification $(\\Sigma, E)$ is the initial algebra of the class of $\\Sigma$-algebras that satisfy $E$.\nIt is determined up to isomorphism.\n\n## Remarks\n\nSince $h_A$ is a homomorphism, $[\\![f(t_1, \\dots, t_n)]\\!]_A = f^A([\\![t_1]\\!]_A, \\dots, [\\![t_n]\\!]_A)$, so meanings are compositional.\nThe initial algebra of the algebras satisfying $E$ exists: it is the quotient of $T_\\Sigma$ by the least congruence that contains all ground instances of the equations of $E$.\n\nExample: let $\\Sigma = \\set{0, s, +}$ with arities $0, 1, 2$, and let $E$ consist of $x + 0 = x$ and $x + s(y) = s(x + y)$.\nThe natural numbers $\\N$ with zero, successor and addition satisfy $E$.\nEvery ground term equals some $s^n(0)$ by $E$, and distinct numerals $s^m(0) \\ne s^n(0)$ are separated in $\\N$, so $\\N$ is initial among the models of $E$.\n\nNon-example: $\\N$ is not initial in the class of all $\\Sigma$-algebras.\nIn $T_\\Sigma$ the terms $s(0)$ and $s(0) + 0$ are different, but in $\\N$ they have the same value $1$.\nA homomorphism $\\N \\to T_\\Sigma$ would send $1$ to both terms, so there is none.\n\nThe general notion of an [[initial algebra|R76EC56V9R]] for a functor contains this one: $T_\\Sigma$ is the initial algebra of the polynomial functor of $\\Sigma$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "HVF403PQ4H",
    "kind": "definition",
    "msc": [
      "08A70",
      "68Q55",
      "08B20"
    ],
    "name": "Initial algebra semantics",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Initial_algebra"
      }
    ],
    "tag": "BT7D4VQ6Y0",
    "uses": [
      "3YYKGWJJND",
      "KBXSZC6BV1",
      "R76EC56V9R",
      "PKD440G2XW"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/BT7D4VQ6Y0/",
  "links": [
    {
      "field": "defines",
      "target": "HVF403PQ4H"
    },
    {
      "field": "uses",
      "target": "3YYKGWJJND"
    },
    {
      "field": "uses",
      "target": "KBXSZC6BV1"
    },
    {
      "field": "uses",
      "target": "R76EC56V9R"
    },
    {
      "field": "uses",
      "target": "PKD440G2XW"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/BT7D4VQ6Y0.md",
  "msc": [
    "08A70",
    "68Q55",
    "08B20"
  ],
  "name": "Initial algebra semantics",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/BT7/BT7D4VQ6Y0.md",
  "status": null,
  "tag": "BT7D4VQ6Y0",
  "uri": "m2://BT7D4VQ6Y0",
  "url": "https://tamnd.github.io/math2/wiki/initial-algebra-semantics-definition/",
  "writing": {
    "tag": "BT7D4VQ6Y0",
    "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
      }
    ]
  }
}
