Grädel's characterization of polynomial time #
Grädel's theorem says that SO∃-Horn logic captures polynomial time on ordered structures with
successor. On the library's canonically ordered finite structures (Fin n with n ≥ 2), this
module proves the full equivalence between HornDefinable and native P over the source-only
binary structure encoding encStructure:
- Upper bound (
SO∃-Horn ⊆ P): everyHornDefinablequery translates into FO(LFP) (HornDefinable.lfpDefinable) and is decided in polynomial time by the FO(LFP) model checker (LFPDefinable.encodedLanguage_mem_P). - Converse (
P ⊆ SO∃-Horn): every native deterministic polynomial-time machine has a uniform SO∃-Horn acceptance tableau (Gradel.Tableau.acceptanceHornSentence) over a fixed tuple-power universeFin (n ^ k). Pulling that sentence back alongVocabulary.orderedPowerInterpretationviaFullTupleInterpretation.onHornSentenceand eliminating first-order quantifiers from clause guards on successor structures (HornDefinable.of_sentence) yields a quantifier-free guarded SO∃-Horn sentence oversuccLanguage L.
It also places HornDefinable inside ordered ESO definability: the SO∃-Horn sentence translates
into an existential second-order sentence with the same meaning (ESO.Horn.Sentence.toESO).
Main results #
Cslib.Logic.FO.Ordered.HornDefinable.encodedLanguage_mem_P: SO∃-Horn definable ordered queries are in nativeP.Cslib.Logic.FO.Ordered.HornDefinable.of_encodedLanguage_mem_P: native polynomial-time ordered queries areHornDefinable.Cslib.Logic.FO.Ordered.hornDefinable_iff_encodedLanguage_mem_P: Grädel's theorem —SO∃-Horncaptures native polynomial time on canonically ordered finite structures.Cslib.Logic.FO.Ordered.ESODefinable.of_horn,Cslib.Logic.FO.Ordered.HornDefinable.esoDefinable: SO∃-Horn definability implies ordered ESO definability.
References #
- E. Grädel, Finite Model Theory and Descriptive Complexity, Theorems 3.2.17–3.2.18 (pp. 147–148) and Exercise 3.2.20 (p. 148), for the upper bound, the Horn computation tableau on ordered structures, and guard quantifier elimination using successor.
- E. Grädel, Capturing complexity classes by fragments of second-order logic, for the SO∃-Horn characterization of polynomial time on successor structures. Section and theorem locators are unverified.
- N. Immerman, Relational Queries Computable in Polynomial Time, Theorem 1, for the FO(LFP) step.
SO∃-Horn definable queries are in polynomial time. This is the upper bound of Grädel's theorem, for the existing source-only structure encoding.
Every native polynomial-time ordered query is SO∃-Horn definable. This is the converse
direction of Grädel's theorem: the deterministic polynomial-time tableau is expressed as an
SO∃-Horn sentence over Fin (M.size ^ k), pulled back along the full-tuple power interpretation,
and lowered to quantifier-free guards over succLanguage L.
Grädel's theorem (SO∃-Horn = P): an ordered query is SO∃-Horn definable if and only if
its source-only encoded language is decidable in native polynomial time.
A query defined by an SO∃-Horn sentence over the ordered vocabulary is ESO definable.
SO∃-Horn definability is a special case of ESO definability. Successor is eliminated from the guards first, so the ESO sentence uses only the ordered vocabulary.