Documentation

CslibFrontier.Computability.PolyTime.CSP.CrossTailTransposition

A computed CROSS tail-value transposition #

CrossInsertion.transposeTail inserts one fixed actual CROSS and joins its first two ports to the old tail. The output positions use fresh names 5,7, carrying the two old values in opposite order. This is a value transposition, not a permutation of old names.

The program executes thirteen fixed primitive calls, including eight directed rotations. No raw cycle is canceled: malformed reindexing can pad or discard entries. Inputs with fewer than two ports retain their entire original state before insertion. The long branch agrees with the original assignment on every doubled old name; the short branch has ordinary identity semantics. Closed/nullary rows and repeated raw names remain explicit.

This original one-operation result is a step in #3091. Routing, variable iteration, the full compiler, source criterion and hardness remain open there.

Main definitions #

Main results #

Insert once, move RIGHT five times, fuse/hide, move RIGHT once, fuse/hide, and move LEFT twice. These are thirteen actual calls, not iteration modulo the boundary length. Short inputs return the ENTIRE original state before any tagging or insertion.

theorem Cslib.Complexity.CSP.CrossInsertion.transposeTail_short {Rel : Type} {ar : Rel → ℕ} {sem : Rel → List Bool → Bool} (g : Logic.PL.CSP.PPGadget ar sem BitString.cross) (w : OrderedBoundary.GadgetWitness g) (I : State Rel) (h : I.ports.length < 2) :

Empty and singleton raw boundaries retain all original rows, names and malformed data. The guard is before insertion, so no doubled-name semantic condition is imposed here.

Every executed primitive supplies its own full checker theorem from the preceding accepted state. No target certificate, rotation, order, genus or recognizer is supplied.

Fixed composition is plain polynomial time on EVERY raw State, for any encoded relation alphabet. Actual lists fund the primitive clocks; binary labels/entries remain data. The fixed template and witness are constants outside runtime, not runtime search.

theorem Cslib.Complexity.CSP.CrossInsertion.ports_transposeTail {Rel : Type} {ar : Rel → ℕ} {sem : Rel → List Bool → Bool} (g : Logic.PL.CSP.PPGadget ar sem BitString.cross) (w : OrderedBoundary.GadgetWitness g) (F : Logic.PL.CSP Rel ℕ) (L : List ℕ) (x y : ℕ) (c : Graph.RotationCertificate) :
(transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).ports = List.map (fun (x : ℕ) => 2 * x) L ++ [5, 7]

On a long raw boundary, the final ports have fresh tail names, not swapped old names. Repeated or sparse old names and arbitrary malformed certificates require no hypothesis.

theorem Cslib.Complexity.CSP.CrossInsertion.recover_transposeTail {Rel : Type} {ar : Rel → ℕ} {sem : Rel → List Bool → Bool} (g : Logic.PL.CSP.PPGadget ar sem BitString.cross) (w : OrderedBoundary.GadgetWitness g) (F : Logic.PL.CSP Rel ℕ) (L : List ℕ) (x y : ℕ) (c : Graph.RotationCertificate) (τ : ℕ → Bool) (ht : Logic.PL.CSP.eval sem τ (transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).body = true) :
Logic.PL.CSP.eval sem (fun (z : ℕ) => τ (2 * z)) F = true ∧ List.map τ (transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).ports = List.map (fun (z : ℕ) => τ (2 * z)) L ++ [τ (2 * y), τ (2 * x)]

Recover source satisfaction and reversed tail values from any satisfying output assignment. The recovered source assignment reads EVERY doubled old name, including unused names. No accepted-state, distinctness, arity or prescribed-word premise is needed, including for repeated raw names and malformed certificates.

theorem Cslib.Complexity.CSP.CrossInsertion.eval_transposeTail_iff {Rel : Type} {ar : Rel → ℕ} {sem : Rel → List Bool → Bool} (g : Logic.PL.CSP.PPGadget ar sem BitString.cross) (w : OrderedBoundary.GadgetWitness g) (F : Logic.PL.CSP Rel ℕ) (L : List ℕ) (x y : ℕ) (c : Graph.RotationCertificate) (σ : ℕ → Bool) :
Logic.PL.CSP.eval sem σ F = true ↔ ∃ (τ : ℕ → Bool), Logic.PL.CSP.eval sem τ (transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).body = true ∧ (∀ (z : ℕ), τ (2 * z) = σ z) ∧ List.map τ (transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).ports = List.map σ L ++ [σ y, σ x]

Exact long-branch assignment extension: the output uses fresh tail names carrying y,x, while agreeing on EVERY doubled old name, including unused names. There is no semantic checker, distinctness, arity, well-formedness or word-length assumption.

Exact arity is preserved on every raw input. Old malformed scopes stay malformed; the fixed actual gadget supplies all new arity obligations.

theorem Cslib.Complexity.CSP.CrossInsertion.length_transposeTail_body {Rel : Type} {ar : Rel → ℕ} {sem : Rel → List Bool → Bool} (g : Logic.PL.CSP.PPGadget ar sem BitString.cross) (w : OrderedBoundary.GadgetWitness g) (F : Logic.PL.CSP Rel ℕ) (L : List ℕ) (x y : ℕ) (c : Graph.RotationCertificate) :
List.length (transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).body = List.length F + List.length g.body

Long-branch rows are exactly the old rows plus the fixed actual gadget rows.

Relabeling seams retains every occurrence, including repeated visits.

theorem Cslib.Complexity.CSP.CrossInsertion.length_transposeTail_ports {Rel : Type} {ar : Rel → ℕ} {sem : Rel → List Bool → Bool} (g : Logic.PL.CSP.PPGadget ar sem BitString.cross) (w : OrderedBoundary.GadgetWitness g) (F : Logic.PL.CSP Rel ℕ) (L : List ℕ) (x y : ℕ) (c : Graph.RotationCertificate) :
(transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).ports.length = L.length + 2

The two seam deletions restore the original number of boundary positions.

theorem Cslib.Complexity.CSP.CrossInsertion.emitted_rotation_lengths_le {Rel : Type} {ar : Rel → ℕ} {sem : Rel → List Bool → Bool} (g : Logic.PL.CSP.PPGadget ar sem BitString.cross) (w : OrderedBoundary.GadgetWitness g) (F : Logic.PL.CSP Rel ℕ) (L : List ℕ) (x y : ℕ) (c : Graph.RotationCertificate) :
have I := { body := F, ports := L ++ [x, y], rotation := c }; have J0 := insert g w I; have J1 := rotateRight J0; have J2 := rotateRight J1; have J3 := rotateRight J2; have J4 := rotateRight J3; have J5 := rotateRight J4; have J6 := fuseHead J5; have J7 := hideHead J6; have J8 := rotateRight J7; have J9 := fuseHead J8; have J10 := hideHead J9; have J11 := rotateLeft J10; have J12 := rotateLeft J11; ∀ K ∈ [J0, J1, J2, J3, J4, J5, J6, J7, J8, J9, J10, J11, J12], K.rotation.successor.length ≤ 2 * (F.occurrences.length + g.body.occurrences.length + (L.length + 2) + 4)

Every table EMITTED by the long branch has the single-insertion dart bound. The original raw table length is separate input data; it is not bounded by this theorem. The displayed list is the actual thirteen-call trace, not an alternate compiler.

theorem Cslib.Complexity.CSP.CrossInsertion.name_width_transposeTail_le {Rel : Type} {ar : Rel → ℕ} {sem : Rel → List Bool → Bool} (g : Logic.PL.CSP.PPGadget ar sem BitString.cross) (w : OrderedBoundary.GadgetWitness g) (F : Logic.PL.CSP Rel ℕ) (L : List ℕ) (x y : ℕ) (c : Graph.RotationCertificate) (W : ℕ) (hW : ∀ z ∈ F.vars ++ (L ++ [x, y]), z.size ≤ W) (z : ℕ) :
z ∈ (transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).body.vars ++ (transposeTail g w { body := F, ports := L ++ [x, y], rotation := c }).ports → z.size ≤ max (W + 1) (2 * g.numAux + 7).size

A safe single-insertion label-width bound. Fusion only selects an existing old label; rotation/hiding introduce no names. This width lemma is not a premise of native runtime.

The original row-symbol word is retained, followed by one fixed template word only when insertion actually executes. No finite target alphabet or arity query is used.

Every long raw tail output has exactly its actual dart count and bounded entry widths. The last executed hiding restriction supplies this bound even for malformed source data.