In mathematical logic, the spectrum of a sentence is the set of natural numbers occurring as the size of a finite model in which a given sentence is true. By a result in descriptive complexity, a set of natural numbers is a spectrum if and only if it can be recognized in non-deterministic exponential time.
Let ψ be a sentence in first-order logic. The spectrum of ψ is the set of natural numbers n such that there is a finite model for ψ with n elements.
If the vocabulary for ψ consists only of relational symbols, then ψ can be regarded as a sentence in existential second-order logic (ESOL) quantified over the relations, over the empty vocabulary. A generalised spectrum is the set of models of a general ESOL sentence.
\existsz,o~\foralla,b,c~\existsd,e
a+z=a=z+a~\land~a ⋅ z=z=z ⋅ a~\land~a+d=z
\land~a+b=b+a~\land~a ⋅ (b+c)=a ⋅ b+a ⋅ c~\land~(a+b)+c=a+(b+c)
\land~a ⋅ o=a=o ⋅ a~\land~a ⋅ e=o~\land~(a ⋅ b) ⋅ c=a ⋅ (b ⋅ c)
\{pn\midpprime,n\inN\}
z
0
o
1
\existsS,T~\forallx~\left\{x\inS\iffx\not\inT \land~f(f(x))=x \land~x\inS\ifff(x)\inT\right\}
f
S
T
S
T
Fagin's theorem is a result in descriptive complexity theory that states that the set of all properties expressible in existential second-order logic is precisely the complexity class NP. It is remarkable since it is a characterization of the class NP that does not invoke a model of computation such as a Turing machine. The theorem was proven by Ronald Fagin in 1974 (strictly, in 1973 in his doctoral thesis).
As a corollary, Jones and Selman showed that a set is a spectrum if and only if it is in the complexity class NEXP.[1]
One direction of the proof is to show that, for every first-order formula
\varphi
This is done by replacing every existential quantifier in
\varphi
For example:
\forall{x}\forall{y}\left(P(x)\wedgeP(y)\right) → (x=y)
For a model of cardinality 2 (i.e. n= 2) is replaced by
(\left(P(a1)\wedgeP(a1)\right) → (a1=a1))\wedge(\left(P(a1)\wedgeP(a2)\right) → (a1=a2))\wedge(\left(P(a2)\wedgeP(a1)\right) → (a2=a1))\wedge(\left(P(a2)\wedgeP(a2)\right) → (a2=a2))
Which is then replaced by
(\left(p1\wedgep1\right) → \top)\wedge(\left(p1\wedgep2\right) → \bot)\wedge(\left(p2\wedgep1\right) → \bot)\wedge(\left(p2\wedgep2\right) → \top)
where
\top
\bot
p1
p2
\neg(p1\wedgep2)
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 (
2cx
\varphi
\varphi
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 under union, 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]
. Ronald Fagin . http://www.almaden.ibm.com/cs/people/fagin/genspec.pdf . Generalized First-Order Spectra and Polynomial-Time Recognizable Sets . Complexity of Computation . Richard M. . Karp. Richard M. Karp . Proc. Syp. App. Math. SIAM-AMS Proceedings . 7 . 27–41 . 1974 . 0303.68035 .
. Neil Immerman . Descriptive Complexity. Descriptive Complexity . 1999 . Springer-Verlag . New York . Graduate Texts in Computer Science . 0918.68031 . 0-387-98600-6 . 113–119.