Existential second-order layout of framed structure encodings #
On the canonical power structure (Fin B, v.powerStructure a B) for a well-formed input
a : EncodedStructure with (frame (encStructure a)).length < B, the Cook–Levin tableau needs the
input tape word u = frame (encStructure a) and its length u.length as unary predicates on
Fin B.
Because encStructure a = frame (encUnary a.1) ++ (a.2.flatMap frame) and
u = frame (encStructure a), every stage of the binary encoding is an application of
Turing.MultiTapeTM.frame at some starting offset base. We therefore axiomatize a single
stride-2 framing step (FO.frameChunkSentence) in first-order logic using the linear order
powerLt on Fin B:
- given a domain formula
inDom(j)(j < w.length), a bit formulainBit(j)(w[j] = true), and a unary relationbaseRelholding of{base}, - a binary relation
mapRel(j, p)tracksp = base + 2 * jforj ≤ w.length, writingtrueatbase + 2 * jandw[j]atbase + 2 * j + 1intooutBitRel, and writing the terminatorfalseatbase + 2 * w.lengthwhile advancingnextBaseRelto{base + 2 * w.length + 1}.
Chaining v.count + 1 instances of frameChunkSentence reconstructs encStructure a and its
length, and one final instance reconstructs frame (encStructure a) and its length.
Main definitions #
Cslib.Logic.FO.frameChunkSentence: the first-order sentence axiomatizing a single stride-2 framing step onFin B.Cslib.Logic.Vocabulary.inputVarLanguage: the two unary relation symbolsuBitSymanduLenSymrepresenting the framed input wordu = frame (encStructure a)and its length onFin B.Cslib.Logic.Vocabulary.layoutESOSentence: the existential second-order sentence overv.powerLanguage.sum inputVarLanguagecharacterizinguandu.length.
Main results #
Cslib.Logic.FO.nextBase_and_getElem?_frame_of_realize_frameChunkSentence,Cslib.Logic.FO.realize_frameChunkSentence_of_canonical: soundness and completeness offrameChunkSentenceonFin B.Cslib.Logic.Vocabulary.realize_layoutESOSentence: for well-formedawith(frame (encStructure a)).length < B,v.layoutESOSentenceholds onFin BiffuLenSymholds solely of(frame (encStructure a)).lengthanduBitSymagrees withframe (encStructure a)below(frame (encStructure a)).length.
References #
Generic stride-2 framing sentence #
The first-order sentence axiomatizing a single stride-2 framing step on Fin B:
starting at baseRel, the binary relation mapRel(j, p) maps j ≤ w.length to base + 2 * j,
writes [true, w[j]] into outBitRel at base + 2 * j and base + 2 * j + 1, writes the
terminator false at base + 2 * w.length, and sets nextBaseRel to
{base + 2 * w.length + 1}.
Soundness of frameChunkSentence: when baseRel holds solely of base and
base + (frame w).length < B, any realization of frameChunkSentence forces nextBaseRel to hold
solely of base + (frame w).length and outBitRel to agree with frame w on
[base, base + (frame w).length).
Completeness of frameChunkSentence: the canonical stride-2 relation
mapRel(j, p) ↔ j ≤ w.length ∧ p = base + 2 * j satisfies frameChunkSentence whenever
baseRel is {base}, nextBaseRel is {base + (frame w).length}, and outBitRel agrees with
frame w on [base, base + (frame w).length).
Prefixes of encStructure a inside the encoding #
The input variable language and layout ESO sentence #
The language of the two unary relations exposed by layoutESOSentence to the Cook–Levin
tableau:
The unary relation symbol uBit(p) in inputVarLanguage.
The unary relation symbol uLen(p) in inputVarLanguage.
The index type of internal relation variables quantified by v.layoutESOSentence:
The combined language of v.layoutESOSentence's first-order matrix.
Binary < inside v.layoutMatrixLanguage.
Unary < n inside v.layoutMatrixLanguage.
Unary < n ^ v.arity i inside v.layoutMatrixLanguage.
Unary relation table bit i inside v.layoutMatrixLanguage.
Unary uBit inside v.layoutMatrixLanguage.
Unary uLen inside v.layoutMatrixLanguage.
Unary base_m (m : Fin (v.count + 2)) inside v.layoutMatrixLanguage.
Unary rawBit inside v.layoutMatrixLanguage.
Binary chunkMap_m (m : Fin (v.count + 1)) inside v.layoutMatrixLanguage.
Binary outerMap inside v.layoutMatrixLanguage.
The domain formula j < rawLen for the outer framing step
(base_{v.count + 1} is rawLen).
The first-order matrix of v.layoutESOSentence:
base_0holds solely of0,- chunk
0framesencUnary a.1(inDom = powerIsElem,inBit = ⊤) frombase_0tobase_1intorawBit, - for each
i : Fin v.count, chunki + 1frames tablei(inDom = powerInTable i,inBit = powerTableBit i) frombase_{i + 1}tobase_{i + 2}intorawBit, and - the outer chunk frames
encStructure a(inDom = layoutInRaw,inBit = rawBit) frombase_0touLenintouBit.
The existential second-order sentence over v.powerLanguage.sum inputVarLanguage that forces
uLenSym to hold solely of (frame (encStructure a)).length and uBitSym to agree with
frame (encStructure a) below (frame (encStructure a)).length.
Characterization of layoutESOSentence: on (Fin B, v.powerStructure a B) for a
well-formed input a with (frame (encStructure a)).length < B, an interpretation I_in of
inputVarLanguage satisfies v.layoutESOSentence iff I_in true (uLenSym) holds solely of
(frame (encStructure a)).length and I_in false (uBitSym) agrees with frame (encStructure a)
on all positions < (frame (encStructure a)).length.