{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "KCV8RKBATN"
    }
  ],
  "body": "\n## Definition\n\nA *type theory* is a formal system with these parts.\n\n1. A collection of *types*, built from base types by type constructors.\n2. A collection of *terms*, built from variables and constants by term constructors.\n3. *Judgments*, in particular the typing judgment $\\Gamma \\vdash t : A$, which says that in the context $\\Gamma = (x_1 : A_1, \\dots, x_n : A_n)$ the term $t$ has type $A$.\n4. *Inference rules*, which say which judgments can be derived from which, and a notion of computation or equality on terms.\n\nEvery well-formed term has a type, and a term can only be used where its type allows.\n\n## Remarks\n\nExample: Church's simply typed lambda calculus is a type theory.\nIts types are built from base types by the arrow $A \\to B$.\nIts rules include: if $\\Gamma, x : A \\vdash t : B$, then $\\Gamma \\vdash \\lambda x.\\, t : A \\to B$; and if $\\Gamma \\vdash f : A \\to B$ and $\\Gamma \\vdash a : A$, then $\\Gamma \\vdash f\\, a : B$.\nNon-example: the untyped lambda calculus is not a type theory, because its terms carry no types.\nIn it, the self-application $\\lambda x.\\, x\\, x$ is a legal term, while in the simply typed calculus it has no type.\nIn *dependent* type theories, types may depend on terms, as in the type $\\mathrm{Vec}(n)$ of lists of length $n$.\nUnlike a [[set|0BSJ7RQ9BW]], a term has its type as part of its form, and \"$t$ has type $A$\" is a judgment, not a proposition that can be true or false.\nThis is how type theory avoids [[Russell's paradox|0HESMMSYEG]].\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "Q48KGV33AH",
    "kind": "definition",
    "msc": [
      "03B38",
      "03B16"
    ],
    "name": "Type theory",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Type_theory"
      }
    ],
    "tag": "42A2M9S2C1",
    "uses": [
      "0HESMMSYEG",
      "0BSJ7RQ9BW",
      "0XHDTE5YMZ"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/42A2M9S2C1/",
  "links": [
    {
      "field": "defines",
      "target": "Q48KGV33AH"
    },
    {
      "field": "uses",
      "target": "0HESMMSYEG"
    },
    {
      "field": "uses",
      "target": "0BSJ7RQ9BW"
    },
    {
      "field": "uses",
      "target": "0XHDTE5YMZ"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/42A2M9S2C1.md",
  "msc": [
    "03B38",
    "03B16"
  ],
  "name": "Type theory",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/42A/42A2M9S2C1.md",
  "status": null,
  "tag": "42A2M9S2C1",
  "uri": "m2://42A2M9S2C1",
  "url": "https://math2.tamnd.com/wiki/type-theory-definition/",
  "writing": {
    "tag": "42A2M9S2C1",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
