Descriptive complexity theory

Branch of mathematical logic

Descriptive complexity is a branch of computational complexity theory and of finite model theory that characterizes complexity classes by the type of logic needed to express the languages in them. For example, PH, the union of all complexity classes in the polynomial hierarchy, is precisely the class of languages expressible by statements of second-order logic. This connection between complexity and the logic of finite structures allows results to be transferred easily from one area to the other, facilitating new proof methods and providing additional evidence that the main complexity classes are somehow "natural" and not tied to the specific abstract machines used to define them.

Specifically, each logical system produces a set of queries expressible in it. The queries – when restricted to finite structures – correspond to the computational problems of traditional complexity theory.

The first main result of descriptive complexity was Fagin's theorem, shown by Ronald Fagin in 1974. It established that NP is precisely the set of languages expressible by sentences of existential second-order logic; that is, second-order logic excluding universal quantification over relations, functions, and subsets. Many other classes were later characterized in such a manner.

## The setting

[edit]

When we use the logic formalism to describe a computational problem, the input is a finite structure, and the elements of that structure are the domain of discourse. Usually the input is either a string (of bits or over an alphabet) and the elements of the logical structure represent positions of the string, or the input is a graph and the elements of the logical structure represent its vertices. The length of the input will be measured by the size of the respective structure. Whatever the structure is, we can assume that there are relations that can be tested, for example " E ( x , y ) {\displaystyle E(x,y)} is true if and only if there is an edge from x to y" (in case of the structure being a graph), or " P ( n ) {\displaystyle P(n)} is true if and only if the nth letter of the string is 1." These relations are the predicates for the first-order logic system. We also have constants, which are special elements of the respective structure, for example if we want to check reachability in a graph, we will have to choose two constants s (start) and t (terminal).

In descriptive complexity theory we often assume that there is a total order over the elements and that we can check equality between elements. This lets us consider elements as numbers: the element x represents the number n if and only if there are  ( n − 1 ) {\displaystyle (n-1)} elements y with  y < x {\displaystyle y<x} . Thanks to this we also may have the primitive predicate "bit", where  b i t ( x , k ) {\displaystyle bit(x,k)} is true if only the kth bit of the binary expansion of x is 1. (We can replace addition and multiplication by ternary relations such that  p l u s ( x , y , z ) {\displaystyle plus(x,y,z)} is true if and only if  x + y = z {\displaystyle x+y=z} and  t i m e s ( x , y , z ) {\displaystyle times(x,y,z)} is true if and only if  x ∗ y = z {\displaystyle x*y=z} ).

## Overview of characterisations of complexity classes

[edit]

If we restrict ourselves to ordered structures with a successor relation and basic arithmetical predicates, then we get the following characterisations:

* First-order logic defines the class AC0, the languages recognized by polynomial-size circuits of bounded depth, which equals the languages recognized by a concurrent random access machine in constant time.[1]
* First-order logic augmented with symmetric or deterministic transitive closure operators yield L, problems solvable in logarithmic space.[2]
* First-order logic with a transitive closure operator yields NL, the problems solvable in nondeterministic logarithmic space.[3]
* First-order logic with a least fixed point operator gives P, the problems solvable in deterministic polynomial time.[3]
* Existential second-order logic yields NP.[3]
* Universal second-order logic (excluding existential second-order quantification) yields co-NP.[4]
* Second-order logic corresponds to the polynomial hierarchy PH.[3]
* Second-order logic with a transitive closure (commutative or not) yields PSPACE, the problems solvable in polynomial space.[5]
* Second-order logic with a least fixed point operator gives EXPTIME, the problems solvable in exponential time.[6]
* HO, the complexity class defined by higher-order logic, is equal to ELEMENTARY[7]

## Sub-polynomial time

[edit]

### FO without any operators

[edit]

In circuit complexity, first-order logic with arbitrary predicates can be shown to be equal to AC0, the first class in the AC hierarchy. Indeed, there is a natural translation from FO's symbols to nodes of circuits, with  ∀ , ∃ {\displaystyle \forall ,\exists } being  ∧ {\displaystyle \land } and  ∨ {\displaystyle \lor } of size n. First-order logic in a signature with arithmetical predicates characterises the restriction of the AC0 family of circuits to those constructible in alternating logarithmic time.[1] First-order logic in a signature with only the order relation corresponds to the set of star-free languages.[8][9]

### Transitive closure logic

[edit]

First-order logic gains substantially in expressive power when it is augmented with an operator that computes the transitive closure of a binary relation. The resulting transitive closure logic is known to characterise non-deterministic logarithmic space (NL) on ordered structures. This was used by Immerman to show that NL is closed under complement (i. e. that NL = co-NL).[10]

When restricting the transitive closure operator to deterministic transitive closure, the resulting logic exactly characterises logarithmic space on ordered structures.

### Second-order Krom formulae

[edit]

On structures that have a successor function, NL can also be characterised by second-order Krom formulae.

SO-Krom is the set of Boolean queries definable with second-order formulae in conjunctive normal form such that the first-order quantifiers are universal and the quantifier-free part of the formula is in Krom form, which means that the first-order formula is a conjunction of disjunctions, and in each "disjunction" there are at most two variables. Every second-order Krom formula is equivalent to an existential second-order Krom formula.

SO-Krom characterises NL on structures with a successor function.[11]

## Polynomial time

[edit]

On ordered structures, first-order least fixed-point logic captures PTIME:

### First-order least fixed-point logic

[edit]

FO[LFP] is the extension of first-order logic by a least fixed-point operator, which expresses the fixed-point of a monotone expression. This augments first-order logic with the ability to express recursion. The Immerman–Vardi theorem, shown independently by Immerman and Vardi, shows that FO[LFP] characterises PTIME on ordered structures.[12][13]

As of 2025[update], it is still open whether there is a natural logic characterising PTIME on unordered structures.[citation needed]

The Abiteboul–Vianu theorem states that FO[LFP]=FO[PFP] on all structures if and only if FO[LFP]=FO[PFP]; hence if and only if P=PSPACE. This result has been extended to other fixpoints.[14]

### Second-order Horn formulae

[edit]

In the presence of a successor function, PTIME can also be characterised by second-order Horn formulae.[citation needed]

SO-Horn is the set of Boolean queries definable with SO formulae in disjunctive normal form such that the first-order quantifiers are all universal and the quantifier-free part of the formula is in Horn form, which means that it is a big AND of OR, and in each "OR" every variable except possibly one are negated.

This class is equal to P on structures with a successor function.[15]

Those formulae can be transformed to prenex formulas in existential second-order Horn logic.[11]

## Non-deterministic polynomial time

[edit]

### Fagin's theorem

[edit]

Ronald Fagin's 1974 proof that the complexity class NP was characterised exactly by those classes of structures axiomatizable in existential second-order logic was the starting point of descriptive complexity theory.[4][16]

Since the complement of an existential formula is a universal formula, it follows immediately that co-NP is characterized by universal second-order logic.[4]

SO, unrestricted second-order logic, is equal to the Polynomial hierarchy PH. More precisely, we have the following generalisation of Fagin's theorem: The set of formulae in prenex normal form where existential and universal quantifiers of second order alternate k times characterise the kth level of the polynomial hierarchy.[17]

Unlike most other characterisations of complexity classes, Fagin's theorem and its generalisation do not presuppose a total ordering on the structures. This is because existential second-order logic is itself sufficiently expressive to refer to the possible total orders on a structure using second-order variables.[18]

## Beyond NP

[edit]

### Partial fixed point is PSPACE

[edit]

The class of all problems computable in polynomial space, PSPACE, can be characterised by augmenting first-order logic with a more expressive partial fixed-point operator.

Partial fixed-point logic, FO[PFP], is the extension of first-order logic with a partial fixed-point operator, which expresses the fixed-point of a formula if there is one and returns 'false' otherwise.

Partial fixed-point logic characterises PSPACE on ordered structures.[19]

### Transitive closure is PSPACE

[edit]

Second-order logic can be extended by a transitive closure operator in the same way as first-order logic, resulting in SO[TC]. The TC operator can now also take second-order variables as argument. SO[TC] characterises PSPACE. Since ordering can be referenced in second-order logic, this characterisation does not presuppose ordered structures.[20]

## Elementary functions

[edit]

The time complexity class ELEMENTARY of elementary functions can be characterised by HO, the complexity class of structures that can be recognized by formulas of higher-order logic. Higher-order logic is an extension of first-order logic and second-order logic with higher-order quantifiers. There is a relation between the  i {\displaystyle i} th order and non-deterministic algorithms the time of which is bounded by  i − 1 {\displaystyle i-1} levels of exponentials.[21]

### Definition

[edit]

We define higher-order variables. A variable of order  i > 1 {\displaystyle i>1} has an arity  k {\displaystyle k} and represents any set of  k {\displaystyle k} -tuples of elements of order  i − 1 {\displaystyle i-1} . They are usually written in upper-case and with a natural number as exponent to indicate the order. Higher-order logic is the set of first-order formulae where we add quantification over higher-order variables; hence we will use the terms defined in the FO article without defining them again.

HO i {\displaystyle ^{i}} is the set of formulae with variables of order at most  i {\displaystyle i} . HO j i {\displaystyle _{j}^{i}} is the subset of formulae of the form  ϕ = ∃ X 1 i ¯ ∀ X 2 i ¯ … Q X j i ¯ ψ {\displaystyle \phi =\exists {\overline {X_{1}^{i}}}\forall {\overline {X_{2}^{i}}}\dots Q{\overline {X_{j}^{i}}}\psi } , where  Q {\displaystyle Q} is a quantifier and  Q X i ¯ {\displaystyle Q{\overline {X^{i}}}} means that  X i ¯ {\displaystyle {\overline {X^{i}}}} is a tuple of variable of order  i {\displaystyle i} with the same quantification. So HO j i {\displaystyle _{j}^{i}} is the set of formulae with  j {\displaystyle j} alternations of quantifiers of order  i {\displaystyle i} , beginning with  ∃ {\displaystyle \exists } , followed by a formula of order  i − 1 {\displaystyle i-1} .

Using the standard notation of the tetration,  exp 2 0 ⁡ ( x ) = x {\displaystyle \exp _{2}^{0}(x)=x} and  exp 2 i + 1 ⁡ ( x ) = 2 exp 2 i ⁡ ( x ) {\displaystyle \exp _{2}^{i+1}(x)=2^{\exp _{2}^{i}(x)}} .  exp 2 i + 1 ⁡ ( x ) = 2 2 2 2 … 2 x {\displaystyle \exp _{2}^{i+1}(x)=2^{2^{2^{2^{\dots ^{2^{x}}}}}}} with  i {\displaystyle i} times  2 {\displaystyle 2}

### Normal form

[edit]

Every formula of order  i {\displaystyle i} th is equivalent to a formula in prenex normal form, where we first write quantification over variable of  i {\displaystyle i} th order and then a formula of order  i − 1 {\displaystyle i-1} in normal form.

### Relation to complexity classes

[edit]

HO is equal to the class ELEMENTARY of elementary functions. To be more precise,  H O 0 i = N T I M E ( exp 2 i − 2 ⁡ ( n O ( 1 ) ) ) {\displaystyle {\mathsf {HO}}_{0}^{i}={\mathsf {NTIME}}(\exp _{2}^{i-2}(n^{O(1)}))} , meaning a tower of  ( i − 2 ) {\displaystyle (i-2)} 2s, ending with  n c {\displaystyle n^{c}} , where  c {\displaystyle c} is a constant. A special case of this is that  ∃ S O = H O 0 2 = N T I M E ( n O ( 1 ) ) = N P {\displaystyle \exists {\mathsf {SO}}={\mathsf {HO}}_{0}^{2}={\mathsf {NTIME}}(n^{O(1)})={\color {Blue}{\mathsf {NP}}}} , which is exactly Fagin's theorem. Using oracle machines in the polynomial hierarchy,  H O j i = N T I M E ( exp 2 i − 2 ⁡ ( n O ( 1 ) ) Σ j P ) {\displaystyle {\mathsf {HO}}_{j}^{i}={\color {Blue}{\mathsf {NTIME}}}(\exp _{2}^{i-2}(n^{O(1)})^{\Sigma _{j}^{\mathsf {P}}})}

## Notes

[edit]

1. ^ a b Immerman 1999, p. 86
2. ^ Grädel, Erich; Schalthöfer, Svenja (2019). Choiceless Logarithmic Space. Leibniz International Proceedings in Informatics (LIPIcs). Vol. 138\. pp. 31:1–31:15. doi:10.4230/LIPICS.MFCS.2019.31. ISBN 9783959771177.
3. ^ a b c d Immerman 1999, p. 242
4. ^ a b c Fagin, Ron (1974). "Generalized first-order spectra and polynomial-time recognizable sets". In Karp, Richard (ed.). Complexity of Computation. pp. 43–73.
5. ^ Immerman 1999, p. 243
6. ^ Abiteboul, Serge; Vardi, Moshe Y.; Vianu, Victor (1997-01-15). "Fixpoint logics, relational machines, and computational complexity". Journal of the ACM. 44 (1): 30–56\. doi:10.1145/256292.256295. ISSN 0004-5411. S2CID 11338470.
7. ^ Hella, Lauri; Turull-Torres, José María (2006). "Computing queries with higher-order logics". Theoretical Computer Science. 355 (2). Essex, UK: Elsevier Science Publishers Ltd.: 197–214\. doi:10.1016/j.tcs.2006.01.009. ISSN 0304-3975.
8. ^ Robert., McNaughton (1971). Counter-free automata. M.I.T. Press. ISBN 0-262-13076-9. OCLC 651199926.
9. ^ Immerman 1999, p. 22
10. ^ Immerman, Neil (1988). "Nondeterministic Space is Closed under Complementation". SIAM Journal on Computing. 17 (5): 935–938\. doi:10.1137/0217058. ISSN 0097-5397.
11. ^ a b Immerman 1999, p. 153–4
12. ^ Immerman, Neil (1986). "Relational queries computable in polynomial time". Information and Control. 68 (1–3): 86–104\. doi:10.1016/s0019-9958(86)80029-8.1–3&rft.pages=86-104&rft.date=1986&rft_id=info:doi/10.1016/s0019-9958(86)80029-8&rft.aulast=Immerman&rft.aufirst=Neil&rft_id=https://doi.org/10.1016%2Fs0019-9958%2886%2980029-8&rfr_id=info:sid/en.wikipedia.org:Descriptive+complexity+theory" class="Z3988">
13. ^ Vardi, Moshe Y. (1982). "The complexity of relational query languages (Extended Abstract)". Proceedings of the fourteenth annual ACM symposium on Theory of computing - STOC '82. New York, NY, USA: ACM. pp. 137–146\. CiteSeerX 10.1.1.331.6045. doi:10.1145/800070.802186. ISBN 978-0897910705. S2CID 7869248.
14. ^ Serge Abiteboul, Moshe Y. Vardi, Victor Vianu: Fixpoint logics, relational machines, and computational complexity Journal of the ACM archive, Volume 44, Issue 1 (January 1997), Pages: 30-56, ISSN 0004-5411
15. ^ Grädel, Erich (1992-07-13). "Capturing complexity classes by fragments of second-order logic". Theoretical Computer Science. 101 (1): 35–57\. doi:10.1016/0304-3975(92)90149-A. ISSN 0304-3975.
16. ^ Immerman 1999, p. 115
17. ^ Immerman 1999, p. 121
18. ^ Immerman 1999, p. 181
19. ^ Abiteboul, S.; Vianu, V. (1989). "Fixpoint extensions of first-order logic and datalog-like languages". [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science. IEEE Comput. Soc. Press. pp. 71–79\. doi:10.1109/lics.1989.39160. ISBN 0-8186-1954-6. S2CID 206437693.
20. ^ Harel, D.; Peleg, D. (1984-01-01). "On static logics, dynamic logics, and complexity classes". Information and Control. 60 (1): 86–102\. doi:10.1016/S0019-9958(84)80023-6. ISSN 0019-9958.
21. ^ Hella, Lauri; Turull-Torres, José María (2006). "Computing queries with higher-order logics". Theoretical Computer Science. 355 (2). Essex, UK: Elsevier Science Publishers Ltd.: 197–214\. doi:10.1016/j.tcs.2006.01.009. ISSN 0304-3975.

## References

[edit]

* Immerman, Neil (1999). Descriptive complexity. Springer. ISBN 0-387-98600-6. OCLC 901297152.

## External links

[edit]

* Neil Immerman's descriptive complexity page, including a diagram