{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $L$ be a signature.\nThe formulas of second-order logic over $L$ are built like the formulas of [[first-order logic|086QKPF0A6]] over $L$, with these additions.\n\n1. For each $n \\ge 1$ there are relation variables $X, Y, \\dots$ of arity $n$, and $X(t_1, \\dots, t_n)$ is an atomic formula for terms $t_1, \\dots, t_n$.\n2. If $\\varphi$ is a formula and $X$ is a relation variable, then $\\forall X \\, \\varphi$ and $\\exists X \\, \\varphi$ are formulas.\n\nIn the standard semantics, a formula is evaluated in an $L$-[[structure|983GZBQYT4]] $\\mathcal{M}$ with domain $M$ as in first-order logic.\nAn $n$-ary relation variable ranges over the whole [[power set|00E0YZCERH]] of $M^n$.\n\n## Remarks\n\nFunction variables may be added in the same way; they can be expressed by relation variables.\nMonadic second-order logic allows only relation variables of arity $1$, that is, variables for subsets of $M$.\n\nExample: the sentence $\\forall X \\, \\big( (X(0) \\land \\forall x \\, (X(x) \\to X(S(x)))) \\to \\forall x \\, X(x) \\big)$ is a second-order sentence over the signature $\\set{0, S}$.\nIt says that every subset of the domain that contains $0$ and is closed under $S$ is the whole domain.\n\nNon-example: a formula with a quantifier over sets of subsets of $M$ is not second-order, because no clause provides such variables; it belongs to third-order logic.\n\nWith the standard semantics, second-order logic has neither a complete proof system nor the compactness property.\nWith Henkin semantics, in which the relation variables range over a chosen family of relations, both properties return.\n\n## Explanations\n\n### L1 human\n\nSecond-order logic lets formulas speak about all subsets and all relations of the domain, not only about its elements.\nThis makes it much more expressive than first-order logic.\nFor example, finiteness of the domain, or the completeness of the real line, can be written as a single second-order sentence.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "G6X7SZSNC5",
    "kind": "definition",
    "msc": [
      "03B16",
      "03C85"
    ],
    "name": "Second-order logic",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Second-order_logic"
      }
    ],
    "tag": "47XHPD8XE2",
    "uses": [
      "086QKPF0A6",
      "983GZBQYT4",
      "00E0YZCERH"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/47XHPD8XE2/",
  "links": [
    {
      "field": "defines",
      "target": "G6X7SZSNC5"
    },
    {
      "field": "uses",
      "target": "086QKPF0A6"
    },
    {
      "field": "uses",
      "target": "983GZBQYT4"
    },
    {
      "field": "uses",
      "target": "00E0YZCERH"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/47XHPD8XE2.md",
  "msc": [
    "03B16",
    "03C85"
  ],
  "name": "Second-order logic",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/47X/47XHPD8XE2.md",
  "status": null,
  "tag": "47XHPD8XE2",
  "uri": "m2://47XHPD8XE2",
  "url": "https://math2.tamnd.com/wiki/second-order-logic-definition/",
  "writing": {
    "tag": "47XHPD8XE2",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
