Decoding, and well-formed evaluation is NP-complete
Lax420092.DecodingAndWellFormed · concepts/Lax420092/DecodingAndWellFormed.lean · lax-420092
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
The decoder is sound: an instance it reads off a presented structure has a satisfied query exactly when the presented structure is a yes-instance of CQEval. It is total on well-formed structures: every nonempty presented structure with a constant decodes to an instance. And well-formed evaluation, whose yes-instances are exactly the structures with a constant whose query holds, is NP-complete, so the restriction the decoder needs loses nothing.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Lax904597.Problems |
| 2 | import Lax904597.Interpretations |
| 3 | import Lax904597.Classes |
| 4 | import Lax799700.Problems |
| 5 | import Lax420092.QueryDatabases |
| 6 | import Lax420092.Evaluation |
| 7 | import Lax420092.QueryPairs |
| 8 | import Lax420092.PackagedInstances |
| 9 | |
| 10 | /-! |
| 11 | --- |
| 12 | title: Decoding, and well-formed evaluation is NP-complete |
| 13 | type: theorem |
| 14 | --- |
| 15 | The decoder is sound: an instance it reads off a presented structure has a |
| 16 | satisfied query exactly when the presented structure is a yes-instance of |
| 17 | CQEval. It is total on well-formed structures: every nonempty presented |
| 18 | structure with a constant decodes to an instance. And well-formed |
| 19 | evaluation, whose yes-instances are exactly the structures with a constant |
| 20 | whose query holds, is NP-complete, so the restriction the decoder needs |
| 21 | loses nothing. |
| 22 | -/ |
| 23 | |
| 24 | namespace Lax420092.DecodingAndWellFormed |
| 25 | |
| 26 | open FirstOrder FirstOrder.Language |
| 27 | open Lax904597.Problems Lax904597.Interpretations Lax904597.Classes Lax799700.Problems |
| 28 | open Lax420092.QueryDatabases Lax420092.Evaluation Lax420092.QueryPairs Lax420092.PackagedInstances |
| 29 | |
| 30 | /-- The decoder is sound. -/ |
| 31 | axiom cqDecode_sound : ∀ (S : FinPresentation queryDb) (i : CQInstance), |
| 32 | i ∈ cqDecode S → (ConcreteCQHolds i ↔ CQEval (Fin S.card)) |
| 33 | |
| 34 | /-- The decoder is total on well-formed structures. -/ |
| 35 | axiom cqDecode_total : ∀ S : FinPresentation queryDb, |
| 36 | 0 < S.card → Fin S.card ⊨ cqWFSentence → (cqDecode S).isSome |
| 37 | |
| 38 | /-- The yes-instances of WFCQEval are exactly the structures with a constant |
| 39 | whose query holds. -/ |
| 40 | axiom wfCQEval_iff : ∀ (A : Type) [queryDb.Structure A], |
| 41 | WFCQEval A ↔ (A ⊨ cqWFSentence ∧ QueryHolds A) |
| 42 | |
| 43 | /-- WFCQEval is NP-complete. -/ |
| 44 | axiom wfCQEval_NP_complete : NP.Complete WFCQEval |
| 45 | |
| 46 | end Lax420092.DecodingAndWellFormed |
| 47 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments