Lably
Skip to content

Fagin's theorem

Existential second order logic captures NP

  • 2 min read
  • 2 chapters

Explore on Lably

ToursExplore Lably’s 3D tours

It was proven by Ronald Fagin in 1973 in his doctoral thesis, and appears in his 1974 paper. The arity required by the second-order formula was improved (in one direction) by James Lynch in 1981, and several results of Étienne Grandjean have provided tighter bounds on nondeterministic random-access machines.

Example

For example, consider the problem of deciding if a graph is 3-colorable. This is NP-complete. By Fagin’s theorem, there is a second order existential formula ϕ, such that a graph is 3-colorable if and only if the graph, as a finite model for ϕ, semantically implies ϕ. Explicitly, here is one such formula:

(∃A, B, C)(∀v)[(A(v) ∨ B(v) ∨ C(v)) ∧ (∀w)(E(v, w) → ¬(A(v) ∧ A(w)) ∧ ¬(B(v) ∧ B(w)) ∧ ¬(C(v) ∧ C(w)))]

In this formula, A, B, or C are to be interpreted as the sets of vertices colored with the 3 colors, and E(v, w) is to be interpreted as saying the vertices v, w share an edge. The formula then states that no two adjacent vertices have the same color.

Note that there is no need to explicitly enforce each vertex to have exactly 1 color, just at least 1 color. Since, if we allow more than 1 color per vertex, and no two adjacent vertices have the same color, then we certainly can have each vertex to have exactly 1 color, and still no two adjacent vertices have the same color.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Computing and communication