{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $\\sigma$ be a [[signature|WDVVEYD6AT]] with only function symbols and let $X$ be a set of variables.\nLet $T_\\sigma(X)$ be the set of [[terms|6D3WA7N2W4]] over $\\sigma$ and $X$.\nAssume that $T_\\sigma(X)$ is nonempty, that is, $X$ is nonempty or $\\sigma$ has a constant symbol.\nThe *term algebra* $\\mathbf{T}_\\sigma(X)$ is the algebra of signature $\\sigma$ with universe $T_\\sigma(X)$.\nIts operations are\n$$f^{\\mathbf{T}}(t_1, \\ldots, t_n) = f(t_1, \\ldots, t_n)$$\nfor each function symbol $f$ of arity $n$ and all terms $t_1, \\ldots, t_n$.\n\n## Remarks\n\nThe term algebra is absolutely free over $X$.\nFor every algebra $A$ of signature $\\sigma$ and every map $\\alpha \\colon X \\to A$, there is a unique [[homomorphism|KBXSZC6BV1]] $\\bar\\alpha \\colon \\mathbf{T}_\\sigma(X) \\to A$ extending $\\alpha$, namely $\\bar\\alpha(t) = t^A[\\alpha]$, the [[value|DH30WTA26T]] of $t$.\nWhen $X$ is empty, it is the algebra of closed terms, also called the Herbrand universe.\n\nExample: let $\\sigma$ have one binary symbol $\\cdot$ and let $X = \\set{x}$.\nThe elements $x$, $x \\cdot x$, $(x \\cdot x) \\cdot x$, $x \\cdot (x \\cdot x)$, … are pairwise distinct, and the operation sends $(s, t)$ to the term $s \\cdot t$.\nThis is the free magma on one generator.\n\nNon-example: the positive integers with $\\cdot$ read as addition are not isomorphic to this term algebra, even though they are generated by $1$.\nIn the term algebra, $s \\cdot t = s' \\cdot t'$ implies $s = s'$ and $t = t'$, because terms have a unique reading.\nIn the positive integers $1 + 2 = 2 + 1$ while $1 \\ne 2$, so this property fails.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "3YYKGWJJND",
    "kind": "definition",
    "msc": [
      "08B20",
      "08A40"
    ],
    "name": "Term algebra",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Term_algebra"
      }
    ],
    "tag": "V288YS2F5W",
    "uses": [
      "6D3WA7N2W4",
      "WDVVEYD6AT",
      "KBXSZC6BV1",
      "DH30WTA26T"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/V288YS2F5W/",
  "links": [
    {
      "field": "defines",
      "target": "3YYKGWJJND"
    },
    {
      "field": "uses",
      "target": "6D3WA7N2W4"
    },
    {
      "field": "uses",
      "target": "WDVVEYD6AT"
    },
    {
      "field": "uses",
      "target": "KBXSZC6BV1"
    },
    {
      "field": "uses",
      "target": "DH30WTA26T"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/V288YS2F5W.md",
  "msc": [
    "08B20",
    "08A40"
  ],
  "name": "Term algebra",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/V28/V288YS2F5W.md",
  "status": null,
  "tag": "V288YS2F5W",
  "uri": "m2://V288YS2F5W",
  "url": "https://tamnd.github.io/math2/wiki/term-algebra-definition/",
  "writing": {
    "tag": "V288YS2F5W",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
