{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $\\sigma$ be a signature and $X$ a set of variables.\nLet $T(X)$ be the set of terms of $\\sigma$ over $X$, as in the [[term algebra|3YYKGWJJND]].\nA *term rewriting system* is a set $R$ of pairs $(l, r)$ of terms, written $l \\to r$ and called rules.\nEach rule must satisfy two conditions: $l$ is not a variable, and every variable of $r$ occurs in $l$.\nFor terms $s, t$, one writes $s \\to_R t$ if there are a rule $l \\to r$ in $R$ and a [[substitution|NCDZ969V7X]] $\\tau$ with the following property.\nThe term $s$ contains $\\tau(l)$ as a subterm, and $t$ is obtained from $s$ by replacing one occurrence of it by $\\tau(r)$.\nLet $\\leftrightarrow_R^*$ be the smallest equivalence relation that contains $\\to_R$.\nThe system $R$ *presents* the [[equational theory|F1M51B4MDG]] $E$ if, for all terms $s, t$, one has $s \\leftrightarrow_R^* t$ if and only if $s \\approx t$ belongs to $E$.\nThe system $R$ is *convergent* if:\n\n1. it is terminating: there is no infinite chain $t_0 \\to_R t_1 \\to_R t_2 \\to_R \\cdots$;\n2. it is confluent: if $t \\to_R^* u$ and $t \\to_R^* v$, then $u \\to_R^* w$ and $v \\to_R^* w$ for some term $w$.\n\n## Remarks\n\nBy [[Birkhoff's completeness theorem|WDHWCQ6Y2Y]], a system $R$ presents the theory axiomatised by the [[identities|PKD440G2XW]] $\\set{l \\approx r : (l \\to r) \\in R}$.\nIf $R$ is convergent, each term $t$ has a unique normal form $\\operatorname{nf}(t)$, a term with no further rewrite step.\nThen $s \\approx t$ is in the theory if and only if $\\operatorname{nf}(s) = \\operatorname{nf}(t)$.\nFor a finite convergent system, this decides the equational theory.\nExample: $R = \\set{f(f(x)) \\to x}$ is convergent: each step shortens the term, and the only overlap, in $f(f(f(x)))$, rewrites to $f(x)$ in both ways.\nSo $f^m(x) \\approx f^n(x)$ holds in the theory of an involution exactly when $m$ and $n$ have the same parity.\nNon-example: $R = \\set{x \\cdot y \\to y \\cdot x}$ presents the theory of a commutative operation but is not terminating, since $a \\cdot b \\to b \\cdot a \\to a \\cdot b \\to \\cdots$.\nThe Knuth–Bendix completion procedure tries to turn a set of identities into an equivalent convergent system.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "A6J731Y193",
    "kind": "definition",
    "msc": [
      "68Q42",
      "08B05",
      "03B35"
    ],
    "name": "Term rewriting for equational theories",
    "sources": [
      {
        "locator": "Term rewriting systems",
        "url": "https://en.wikipedia.org/wiki/Rewriting"
      }
    ],
    "tag": "HHNJT9CBEJ",
    "uses": [
      "3YYKGWJJND",
      "NCDZ969V7X",
      "PKD440G2XW",
      "F1M51B4MDG",
      "WDHWCQ6Y2Y"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/HHNJT9CBEJ/",
  "links": [
    {
      "field": "defines",
      "target": "A6J731Y193"
    },
    {
      "field": "uses",
      "target": "3YYKGWJJND"
    },
    {
      "field": "uses",
      "target": "NCDZ969V7X"
    },
    {
      "field": "uses",
      "target": "PKD440G2XW"
    },
    {
      "field": "uses",
      "target": "F1M51B4MDG"
    },
    {
      "field": "uses",
      "target": "WDHWCQ6Y2Y"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/HHNJT9CBEJ.md",
  "msc": [
    "68Q42",
    "08B05",
    "03B35"
  ],
  "name": "Term rewriting for equational theories",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/HHN/HHNJT9CBEJ.md",
  "status": null,
  "tag": "HHNJT9CBEJ",
  "uri": "m2://HHNJT9CBEJ",
  "url": "https://tamnd.github.io/math2/wiki/term-rewriting-for-equational-theories-definition/",
  "writing": {
    "tag": "HHNJT9CBEJ",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
