Documentation

CslibFrontier.Computability.PolyTime.CSP.CrossTranspositionSchedule

Executing a finite schedule of adjacent CROSS transpositions #

CrossInsertion.transposeSchedule folds the existing positioned program in request order. Only successful binary guards count toward old-name doubling. Raw invalid steps retain the entire current State. The value word follows ordinary adjacent swaps, while actual names follow the existing fresh-name program; no raw cycle or inverse pair is canceled.

This original schedule executor is a step toward #3091, not a sorter, planarization compiler, recognition algorithm or hardness theorem. Atom assembly, trace generation, metadata, group fusion/hiding and final reduction remain separate obligations.

Main definitions #

Main results #

Execute the existing raw positioned program in exactly the listed order. Binary positions remain data; invalid guards execute the existing whole-State identity branch.

theorem Cslib.Complexity.CSP.CrossInsertion.transposeSchedule_eq_self {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) (js : List ℕ) (h : ∀ j ∈ js, I.ports.length ≤ j + 1) :
transposeSchedule g w I js = I

An all-invalid schedule preserves the entire input, including malformed surplus data.

Every executed step supplies the complete checker result for the next fold state.

Exact arity is preserved for every raw schedule, independently of semantics.

The exact component recurrence counts only successful guards. The symbol word keeps all old rows in order and appends one fixed gadget word per successful request.

theorem Cslib.Complexity.CSP.CrossInsertion.recover_transposeSchedule {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) (js : List ℕ) (τ : ℕ → Bool) (ht : Logic.PL.CSP.eval sem τ (transposeSchedule g w I js).body = true) :
have swap := fun (ps : List Bool) (j : ℕ) => if h : j + 1 < ps.length then List.take j ps ++ [ps[j + 1], ps[j]] ++ List.drop (j + 2) ps else ps; have k := List.countP (fun (j : ℕ) => decide (j + 1 < I.ports.length)) js; Logic.PL.CSP.eval sem (fun (z : ℕ) => τ (2 ^ k * z)) I.body = true ∧ List.map τ (transposeSchedule g w I js).ports = List.foldl swap (List.map (fun (z : ℕ) => τ (2 ^ k * z)) I.ports) js

Recover source satisfaction and the entire scheduled value word from ONE satisfying output. The recovered assignment reads every original name at 2^k*z, including unused names. No checker, distinctness or arity hypothesis is needed.

theorem Cslib.Complexity.CSP.CrossInsertion.eval_transposeSchedule_iff {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) (js : List ℕ) (σ : ℕ → Bool) :
have swap := fun (ps : List Bool) (j : ℕ) => if h : j + 1 < ps.length then List.take j ps ++ [ps[j + 1], ps[j]] ++ List.drop (j + 2) ps else ps; have k := List.countP (fun (j : ℕ) => decide (j + 1 < I.ports.length)) js; Logic.PL.CSP.eval sem σ I.body = true ↔ ∃ (τ : ℕ → Bool), Logic.PL.CSP.eval sem τ (transposeSchedule g w I js).body = true ∧ (∀ (z : ℕ), τ (2 ^ k * z) = σ z) ∧ List.map τ (transposeSchedule g w I js).ports = List.foldl swap (List.map σ I.ports) js

Universal old-name extension for the literal schedule. k counts only successful guards; zero successful requests have the ordinary identity lift.

theorem Cslib.Complexity.CSP.CrossInsertion.name_width_transposeSchedule_le {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) (js : List ℕ) (W : ℕ) (hW : ∀ z ∈ I.body.vars ++ I.ports, z.size ≤ W) (z : ℕ) :
z ∈ (transposeSchedule g w I js).body.vars ++ (transposeSchedule g w I js).ports → z.size ≤ max W (2 * g.numAux + 7).size + List.countP (fun (j : ℕ) => decide (j + 1 < I.ports.length)) js

Every successful request increases the maximum binary name width by at most one; invalid requests preserve the whole State. The bound includes unused boundary names.

Execute every raw binary request in plain polynomial time. The actual framed schedule funds the fold and each positioned step caps binary positions by port length. Reachable prefix storage is bounded internally from actual components and encoded symbol payload, not from a caller growth hypothesis or iterated polynomial output-size bound.