{
  "id": "compactness-theorem",
  "title": "Compactness Theorem",
  "lang": "en",
  "source_lang": "en",
  "summary": "The compactness theorem states that a set of first-order sentences has a model exactly when every finite subset has a model.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Logical compactness theorem",
    "First-order compactness theorem"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/compactness-theorem/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/compactness-theorem/",
      "json": "https://aiwiki.page/zh/compactness-theorem.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The compactness theorem is a fundamental result in first-order logic: a set of sentences can be satisfied simultaneously if every finite subset can be satisfied simultaneously. It connects finite collections of logical requirements with potentially infinite theories and is a central tool of model theory. The theorem concerns the existence of models, not their uniqueness or an effective procedure for constructing them. (math.berkeley.edu)"
    },
    {
      "heading": "Statement and interpretation",
      "text": "Let \\(L\\) be a first-order language, and let \\(T\\) be a set of \\(L\\)-sentences, called a theory. A sentence is a formula with no free variables. A model of \\(T\\) is an \\(L\\)-structure in which every sentence belonging to \\(T\\) is true. The compactness theorem states:\n\n\\[T\\text{ has a model} \\quad\\Longleftrightarrow\\quad \\text{every finite }T_0\\subseteq T\\text{ has a model}.\\]\n\nThe right-hand condition is called finite satisfiability. The model satisfying one finite subset need not satisfy another; compactness guarantees a single model satisfying the entire theory. The forward implication is immediate, whereas the reverse implication is the substantive result. The theorem applies to arbitrary set-sized languages, including uncountable ones. (math.berkeley.edu)\n\nTwo equivalent formulations are particularly useful:\n\n- If a theory has no model, some finite subset already has no model.\n- If \\(T\\models\\varphi\\), then \\(T_0\\models\\varphi\\) for some finite \\(T_0\\subseteq T\\).\n\nHere \\(T\\models\\varphi\\) denotes semantic consequence: every model of \\(T\\) satisfies \\(\\varphi\\). Thus even a consequence of infinitely many assumptions follows semantically from finitely many of them. The equivalence follows by applying compactness to \\(T\\cup\\{\\neg\\varphi\\}\\). (math.berkeley.edu)"
    },
    {
      "heading": "Proof methods",
      "text": "From the completeness theorem\n\nGödel’s completeness theorem identifies semantic consequence with formal derivability. Suppose \\(T\\) is unsatisfiable. Completeness gives a formal proof of a contradiction from \\(T\\). Because a proof is finite, it uses only finitely many assumptions, forming a subset \\(T_0\\). By soundness, this subset is itself unsatisfiable. Taking the contrapositive establishes compactness. (math.berkeley.edu)\n\nThis argument distinguishes two kinds of finiteness: individual first-order formulas are finite expressions, and ordinary formal proofs contain finitely many steps. A theory, however, may contain infinitely many sentences. (math.berkeley.edu)\n\nHenkin construction\n\nA direct proof uses a Henkin construction. The language is enlarged by adding constants that provide witnesses for existential assertions. The finitely satisfiable theory is extended so that sentences are decided consistently and existential assertions have witnesses. A model is then built from closed terms, identifying terms when the extended theory asserts their equality. An induction on formulas establishes that this term model satisfies the original theory. (math.berkeley.edu)\n\nUltraproduct proof\n\nA model-theoretic proof uses ultraproducts and Łoś’s theorem. Index structures \\(M_F\\) by the finite subsets \\(F\\subseteq T\\), choosing each \\(M_F\\) to satisfy \\(F\\). For every sentence \\(\\sigma\\in T\\), consider\n\n\\[I_\\sigma=\\{F\\subseteq T:F\\text{ is finite and }\\sigma\\in F\\}.\\]\n\nThese sets have the finite intersection property and can be included in an ultrafilter \\(U\\). Łoś’s theorem then implies that\n\n\\[\\prod_F M_F/U\\]\n\nsatisfies every sentence of \\(T\\): the indices at which each sentence holds form a set belonging to \\(U\\). (personalpages.manchester.ac.uk)"
    },
    {
      "heading": "Principal applications",
      "text": "Infinite and larger models\n\nSuppose a theory \\(T\\) has arbitrarily large finite models. Introduce constants \\(c_0,c_1,\\ldots\\) and add all sentences\n\n\\[c_i\\ne c_j\\qquad(i\\ne j).\\]\n\nEvery finite subset of the enlarged theory is satisfiable in a sufficiently large finite model of \\(T\\). Compactness produces a model interpreting all the constants as distinct elements, so its domain is infinite. (people.math.sc.edu)\n\nMore generally, if \\(T\\) has an infinite model, constants indexed by any prescribed infinite cardinal can be required to be pairwise distinct. Compactness gives a model of at least that cardinality. Together with the Löwenheim–Skolem theorem, this yields models of every infinite cardinality at least as large as the language. (people.math.sc.edu)\n\nNonstandard arithmetic\n\nA standard application constructs nonstandard models of arithmetic. Add to the Peano axioms a new constant \\(c\\) and the sentences\n\n\\[c>\\overline{0},\\quad c>\\overline{1},\\quad c>\\overline{2},\\quad\\ldots,\\]\n\nwhere \\(\\overline n\\) is the numeral denoting the ordinary natural number \\(n\\). Any finite collection is satisfiable in ordinary arithmetic by interpreting \\(c\\) as a sufficiently large number. Compactness therefore gives a model containing an element larger than every standard numeral. Such a model cannot be isomorphic to the ordinary natural-number structure. The same argument works with the complete first-order theory of that structure, not merely the Peano axioms. (plato.stanford.edu)\n\nGraph coloring\n\nIn graph theory, compactness establishes a finite-to-infinite coloring principle: for a fixed positive integer \\(k\\), a graph is \\(k\\)-colorable if every finite subgraph is \\(k\\)-colorable. Encode the possible colors of each vertex using sentences of propositional logic, requiring exactly one color per vertex and different colors at adjacent vertices. Every finite collection of constraints concerns finitely many vertices and is satisfiable by hypothesis. Propositional compactness supplies a coloring of the whole graph. (math.berkeley.edu)"
    },
    {
      "heading": "Connection with topological compactness",
      "text": "The name reflects a connection with topology. For a set \\(P\\) of propositional variables, truth assignments form the space\n\n\\[\\{0,1\\}^{P}\\]\n\nwith the product topology, where \\(\\{0,1\\}\\) is discrete. A formula involves only finitely many variables, so its satisfying assignments form a set that is both open and closed. Finite satisfiability says that these sets have the finite intersection property. Compactness of the assignment space then implies that their total intersection is nonempty. This is precisely the logical compactness theorem for propositional logic. (iep.utm.edu)\n\nA related first-order formulation uses spaces of complete theories: sentences determine basic open-and-closed sets, and logical compactness corresponds to compactness of the resulting topological space. (pages.jh.edu)"
    },
    {
      "heading": "Scope and limitations",
      "text": "Compactness applies to first-order logic with its usual semantics; it does not assert compactness for every stronger logical system. For example, second-order logic with full semantics can express that a domain is finite. Combining such a sentence with assertions that there are at least \\(n\\) elements, for every positive integer \\(n\\), gives a finitely satisfiable but unsatisfiable set. (iep.utm.edu)\n\nEven within first-order logic, restricting attention to finite models destroys compactness. The sentences asserting “there are at least \\(n\\) elements” have finite models for every finite subset, but their totality has only infinite models. Consequently, no first-order theory can have exactly all finite structures as its models, although infinitude can be axiomatized by this infinite collection of sentences. (math.berkeley.edu)\n\nThe theorem also need not produce a model inside a specified structure. In the arithmetic example, every finite collection is satisfiable in the ordinary natural numbers, but the entire collection requires a different structure. (plato.stanford.edu)"
    },
    {
      "heading": "Historical development",
      "text": "Kurt Gödel obtained compactness for countable languages in work associated with his 1929 dissertation and published it in 1930 alongside his completeness theorem. Anatoly Mal’cev extended compactness to arbitrary languages in 1936 and developed applications in algebra. Leon Henkin subsequently introduced a model-building proof that became a standard approach to completeness and compactness. These developments helped establish compactness as a principal method of model theory. (people.math.sc.edu)"
    }
  ],
  "links": [
    "first-order-logic",
    "model-theory",
    "godels-completeness-theorem",
    "formal-proof",
    "soundness",
    "cardinality",
    "lowenheim-skolem-theorem",
    "peano-axioms",
    "natural-number",
    "graph-theory",
    "propositional-logic",
    "topology",
    "product-topology",
    "compact-space",
    "second-order-logic",
    "kurt-godel"
  ],
  "sources": [
    {
      "title": "Math 225A – Model Theory, Lecture 16: Compactness",
      "url": "https://math.berkeley.edu/~scanlon/225af13lectures/20132510Lec16.pdf"
    },
    {
      "title": "Mathematical Logic for Mathematicians, Part I",
      "url": "https://math.berkeley.edu/~antonio/math125A/mathlogicP1.pdf"
    },
    {
      "title": "Model Theory — George F. McNulty",
      "url": "https://people.math.sc.edu/mcnulty/modeltheory/fall2011.pdf"
    },
    {
      "title": "The Compactness Theorem and Ultraproducts — Mike Prest",
      "url": "https://personalpages.manchester.ac.uk/staff/mike.prest/LMSSS.pdf"
    },
    {
      "title": "Math 225A – Model Theory, Lecture 17: Compactness Continued",
      "url": "https://math.berkeley.edu/~scanlon/225af13lectures/20132910Lec17.pdf"
    },
    {
      "title": "Kurt Gödel — Stanford Encyclopedia of Philosophy",
      "url": "https://plato.stanford.edu/entries/goedel/index.html"
    },
    {
      "title": "The Compactness Theorem — Internet Encyclopedia of Philosophy",
      "url": "https://iep.utm.edu/compactness/"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}