Descriptive complexity characterizes computational complexity classes using the expressive power of logical languages over finite structures, without reference to machines or time bounds. Fagin's theorem (1974) established the founding result: NP is exactly the class of properties expressible in existential second-order logic. Immerman and Szelepcsényi independently proved that nondeterministic space classes are closed under complement, yielding NL = co-NL. Further results include: first-order logic with a least fixed-point operator captures P on ordered structures, and second-order logic captures the polynomial hierarchy. These characterizations reveal that complexity is not merely about machines — it is a structural property of the logical resources needed to define a property.
Start with Fagin's theorem: express graph 3-colorability in existential second-order logic (existentially quantify over three color sets, then state the first-order constraint that no edge has same-colored endpoints). This makes the connection between "guessing a certificate" (NP) and "existentially quantifying over a relation" (ESO) concrete. Then study how adding fixed-point operators to first-order logic captures P.
You already know that NP is the class of problems solvable in polynomial time on a nondeterministic machine — equivalently, problems where a solution can be *verified* in polynomial time. Descriptive complexity asks a completely different question: can we characterize NP not by how fast we can solve it, but by *what logical language is powerful enough to express its properties*? The answer, given by Fagin's theorem in 1974, is yes. Existential second-order logic (ESO) — where you can existentially quantify over relations in addition to individuals — captures NP exactly. This is a machine-free, purely logical characterization of a computational complexity class.
The connection becomes concrete when you think about how NP problems work. Consider 3-colorability: is there an assignment of three colors to the vertices of a graph such that no two adjacent vertices share a color? In ESO, you write this directly: "there exist three sets R, G, B (the red, green, blue vertices) such that every vertex is in exactly one set, and for every edge (u, v), u and v are not both in R, both in G, or both in B." The existential quantification over the color sets is precisely the "nondeterministic guess" that NP computation performs — you're existentially quantifying over the certificate. Every NP problem follows this pattern: existentially quantify over the witness structure, then check it with a first-order condition.
Least fixed-point logic (LFP) extends first-order logic with an operator that computes the least fixed point of a monotone operator — essentially, it lets you iterate a definition until it stabilizes. This captures reachability, transitive closure, and other inductive constructions. On ordered structures (structures where the universe comes with a built-in linear order), LFP captures P exactly: a property is polynomial-time computable if and only if it is definable in LFP. The ordering is crucial — without it, a machine can use the order to index time steps into the structure, but pure logic over unordered structures cannot count, and the connection breaks.
The broader picture is that the entire polynomial hierarchy corresponds to alternating second-order quantifiers. Σ₁¹ (ESO) = NP; Π₁¹ (universal second-order) = co-NP; alternating second-order logic captures PH. This reveals something deep: the structural complexity of a problem — how hard it is to describe — is the same as its computational complexity. Complexity classes are not just about running times; they are about the logical resources needed to *define* a property in the first place. Descriptive complexity does not give new algorithms, but it gives a new lens: to understand why a problem is hard, ask what kind of logical quantification is needed to express it.