Inmathematical logic, thespectrum of a sentence is theset ofnatural numbers occurring as the size of afinite model in which a givensentence is true. By a result indescriptive complexity, a set of natural numbers is a spectrum if and only if it can be recognized innon-deterministic exponential time.
Letψ be a sentence infirst-order logic. Thespectrum ofψ is the set of natural numbersn such that there is a finite model forψ withn elements.
If the vocabulary forψ consists only of relational symbols, thenψ can be regarded as a sentence inexistential second-order logic (ESOL) quantified over the relations, over the empty vocabulary. Ageneralised spectrum is the set of models of a general ESOL sentence.
is, the set of powers of aprime number. Indeed, with for and for, this sentence describes the set offields; thecardinality of afinite field is the power of a prime number.
Fagin's theorem is a result indescriptive complexity theory that states that the set of all properties expressible in existentialsecond-order logic is precisely thecomplexity classNP. It is remarkable since it is a characterization of the class NP that does not invoke a model of computation such as aTuring machine. The theorem was proven byRonald Fagin in 1974 (strictly, in 1973 in his doctoral thesis).
As a corollary, Jones andSelman showed that a set is a spectrum if and only if it is in the complexity classNEXP.[1]
One direction of the proof is to show that, for every first-order formula, the problem of determining whether there is a model of the formula ofcardinalityn is equivalent to theproblem of satisfying a formula of size polynomial inn, which is in NP(n) and thus in NEXP of the input to the problem (the numbern in binary form, which is a string of size log(n)).
This is done by replacing everyexistential quantifier in withdisjunction over all the elements in the model and replacing everyuniversal quantifier withconjunction over all the elements in the model. Now every predicate is on elements in the model, and finally every appearance of a predicate on specific elements is replaced by a new propositional variable. Equalities are replaced by their truth values according to their assignments.
For example:
For a model of cardinality 2 (i.e.n= 2) is replaced by
Which is then replaced by
where is truth, is falsity, and, are propositional variables.In this particular case, the last formula is equivalent to, which is satisfiable.
The other direction of the proof is to show that, for every set of binary strings accepted by a non-deterministic Turing machine running in exponential time ( for input length x), there is a first-order formula such that the set of numbers represented by these binary strings are the spectrum of.
Jones and Selman mention that the spectrum of first-order formulas without equality is just the set of all natural numbers not smaller than some minimal cardinality.
The set of spectra of a theory is closed underunion,intersection, addition, and multiplication. In full generality, it is not known if the set of spectra of a theory is closed by complementation; this is the so-called Asser's problem. By the result of Jones and Selman, it is equivalent to the problem of whether NEXPTIME = co-NEXPTIME; that is, whether NEXPTIME is closed under complementation.[2]