+# Existential second-order queries belong to NP
For each fixed existential-SO sentence, the existing binary certificate checker has a polynomial-time one-bit verdict. Arithmetic table reads, bounded first-order quantifiers, and polynomial-time certificate slicing establish the machine bound. Validation rejects malformed structures; the existing checker also rejects missing or trailing certificate bits.
Combining this verifier with its proved polynomial witness bound and the
library's guess-and-verify NTM proves ExistSODefinable.queryLanguage_mem_NP.
This is the upper direction of Fagin's theorem, following Immerman's
Descriptive Complexity, Section 7.1, Proposition 7.6. The converse tableau
construction is not asserted. Formulas and vocabularies are fixed parameters.
Arithmetic matrix evaluation agrees with semantics on canonical structure and relation bits.
Arithmetic matrix evaluation gives exactly the existing Boolean matrix evaluator's verdict.
A fixed matrix is polynomial-time on polynomial-time structure bits, values, and tables.
Arithmetic certificate consumption agrees with the existing checker on encoded structures.
Checking a fixed existential prefix is polynomial-time on polynomial-time supplied data.
The existing encoded certificate checker is a polynomial-time predicate.
A polynomial-time machine computes the existing encoded checker's one-bit verdict.
Fagin's upper direction: every fixed existential-SO sentence induces a language in NP.
An existential-SO witness places the induced binary query language in machine NP.