Documentation

CslibFrontier.Logics.Propositional.CSP.PrimitivePositive.ExpansionNames

Ragged auxiliary labels and the numeric replacement namespaces #

The existing semantic expansion concatenates actual auxiliary blocks. Its injection into the existing compiler's padded blocks is derived here from those sizes. Thus separate source occurrences remain separate even when their relation symbols and ordered scopes coincide. No target-label injection is a caller-supplied premise.

Main results #

def Cslib.Logic.PL.CSP.PPGadget.expansionAuxName {Src Rel : Type} {arity : Rel → ℕ} {sem : Rel → List Bool → Bool} {srcArity : Src → ℕ} {srcSem : Src → List Bool → Bool} (gadgets : (r : Src) → PPGadget arity sem (booleanRelation srcArity srcSem r)) (B : ℕ) {k : ℕ} (F : CSP Src (Fin k)) (hF : WellFormed srcArity F) :
Fin (expandList gadgets F hF).numAux → ℕ

Embed actual concatenated auxiliary blocks into blocks of width B. This is an internal representation map, not a new replacement algorithm.

theorem Cslib.Logic.PL.CSP.PPGadget.expansionAuxName_lt {Src Rel : Type} {arity : Rel → ℕ} {sem : Rel → List Bool → Bool} {srcArity : Src → ℕ} {srcSem : Src → List Bool → Bool} (gadgets : (r : Src) → PPGadget arity sem (booleanRelation srcArity srcSem r)) (B : ℕ) (hB : ∀ (r : Src), (gadgets r).numAux ≤ B) {k : ℕ} (F : CSP Src (Fin k)) (hF : WellFormed srcArity F) (i : Fin (expandList gadgets F hF).numAux) :
expansionAuxName gadgets B F hF i < B * List.length F

The actual ragged labels all lie in the finite padded occurrence range. Empty auxiliary blocks require no positivity assumption on B.

theorem Cslib.Logic.PL.CSP.PPGadget.expansionAuxName_injective {Src Rel : Type} {arity : Rel → ℕ} {sem : Rel → List Bool → Bool} {srcArity : Src → ℕ} {srcSem : Src → List Bool → Bool} (gadgets : (r : Src) → PPGadget arity sem (booleanRelation srcArity srcSem r)) (B : ℕ) (hB : ∀ (r : Src), (gadgets r).numAux ≤ B) {k : ℕ} (F : CSP Src (Fin k)) (hF : WellFormed srcArity F) :

Distinct occurrence-local auxiliary labels stay distinct in the existing padded namespace. This includes repeated gadgets and repeated scopes.

def Cslib.Logic.PL.CSP.PPGadget.expansionName {Src Rel : Type} {arity : Rel → ℕ} {sem : Rel → List Bool → Bool} {srcArity : Src → ℕ} {srcSem : Src → List Bool → Bool} (gadgets : (r : Src) → PPGadget arity sem (booleanRelation srcArity srcSem r)) (B : ℕ) {k : ℕ} (F : CSP Src (Fin k)) (hF : WellFormed srcArity F) :
Fin k ⊕ Fin (expandList gadgets F hF).numAux → ℕ

Free source names occupy even numbers; each ragged auxiliary occupies the odd number for its original source-constraint occurrence.

theorem Cslib.Logic.PL.CSP.PPGadget.expansionName_injective {Src Rel : Type} {arity : Rel → ℕ} {sem : Rel → List Bool → Bool} {srcArity : Src → ℕ} {srcSem : Src → List Bool → Bool} (gadgets : (r : Src) → PPGadget arity sem (booleanRelation srcArity srcSem r)) (B : ℕ) (hB : ∀ (r : Src), (gadgets r).numAux ≤ B) {k : ℕ} (F : CSP Src (Fin k)) (hF : WellFormed srcArity F) :

The free/auxiliary injection is constructed from parity and the actual ragged blocks.

theorem Cslib.Logic.PL.CSP.PPGadget.expandList_body_numeric {Src Rel : Type} {arity : Rel → ℕ} {sem : Rel → List Bool → Bool} {srcArity : Src → ℕ} {srcSem : Src → List Bool → Bool} (gadgets : (r : Src) → PPGadget arity sem (booleanRelation srcArity srcSem r)) (B : ℕ) {k : ℕ} (F : CSP Src (Fin k)) (hF : WellFormed srcArity F) :
relabel (expansionName gadgets B F hF) (expandList gadgets F hF).body = replaceGadgets B (fun (r : Src) => (gadgets r).template) (relabel Fin.val F)

The finite semantic expansion, with its actual ragged blocks, is exactly the existing numeric replacement after its internally constructed injective naming map.