Math 2.0

Mathematical logic and foundations Model theory: types, categoricity, stability Theorem

Fagin's theorem

Builds on StructureSecond-order logicSentenceTuring machine

Statement

Let ฯƒ\sigma be a finite relational signature. Let ๐’ฆ\mathcal K be a class of finite ฯƒ\sigma-structures that is closed under isomorphism. Then the following are equivalent.

  1. The class ๐’ฆ\mathcal K is in NP: some nondeterministic Turing machine decides, in time polynomial in the size of a finite ฯƒ\sigma-structure AA, whether Aโˆˆ๐’ฆA \in \mathcal K.
  2. There is an existential second-order sentence โˆƒR1โ‹ฏโˆƒRkโ€‰ฯ†\exists R_1 \cdots \exists R_k \, \varphi such that a finite ฯƒ\sigma-structure belongs to ๐’ฆ\mathcal K if and only if it satisfies this sentence.

Here R1,โ€ฆ,RkR_1, \ldots, R_k are relation variables, and ฯ†\varphi is a first-order sentence in the signature ฯƒโˆช{R1,โ€ฆ,Rk}\sigma \cup \set{R_1, \ldots, R_k}.

Remarks

From 2 to 1: a machine guesses the relations R1,โ€ฆ,RkR_1, \ldots, R_k on the finite universe, which takes polynomially many bits. It then checks the first-order sentence ฯ†\varphi, which takes polynomial time for a fixed ฯ†\varphi. From 1 to 2: the sentence guesses a linear order of the universe and relations that encode an accepting computation of the machine. The computation of length ncn^c is coded with tuples of length cc, and ฯ†\varphi checks that each step follows the transition rules.

Example: the class of finite graphs that admit a proper colouring with three colours is in NP. It is defined by the sentence โˆƒRโ€‰โˆƒGโ€‰โˆƒBโ€‰ฯ†\exists R \, \exists G \, \exists B \, \varphi. Here ฯ†\varphi says that each vertex lies in RR, GG or BB, and that no edge joins two vertices in the same set.

Going deeper

For a student

Fagin's theorem started descriptive complexity, which characterises complexity classes by logics without any reference to machines. It shows that NP is closed under complement if and only if existential second-order logic has the same power as universal second-order logic on finite structures. Other results of this kind characterise P on ordered finite structures by first-order logic with a least fixed point operator. The theorem belongs to finite model theory, where classical tools such as compactness are not available.

Reading path

To understand this page from the ground up, read these 5 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Second-order logic concept
  2. Sentence concept
  3. Structure concept
  4. Turing machine concept
  5. Fagin's theorem statement

Further reading

  1. Web https://en.wikipedia.org/wiki/Fagin's_theorem
About this page
TagBG8Q0BYSQ3
URIm2://BG8Q0BYSQ3
Kindstatement, theorem
WritingW0 stub
MSC03C13, 68Q19, 68Q15
StatusThis copy of the site has no build data. Run m2 status BG8Q0BYSQ3.
AboutFinite model theory
UsesStructure, Second-order logic, Sentence, Turing machine
Same as
Changed2 November 2026

Markdown ยท JSON ยท Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.