Documentation

CslibFrontier.Computability.PolyTime.CSP.StateSize

Encoding bounds for raw boundary states #

The component lower bounds and cubic envelope use the existing binary State encoding. Relation-symbol payload is counted in its supplied encoding, including for infinite alphabets. These original bounds are shared by the schedule and metadata-run driver; no validity or runtime premise is part of either statement.

theorem Cslib.Complexity.CSP.CrossInsertion.State.component_size_le_encoding {Rel : Type} (encRel : Rel ↪ List Bool) (I : State Rel) :
have S := ((encState encRel) I).length; List.length I.body ≤ S ∧ I.ports.length ≤ S ∧ I.rotation.successor.length ≤ S ∧ (List.map (fun (r : Rel) => (encRel r).length) (List.map Logic.PL.Constraint.rel I.body)).sum ≤ S ∧ ∀ z ∈ I.body.vars ++ I.ports, z.size ≤ S

The framed State word funds rows, ports, raw table length, relation payload and every binary body/port name. No checker hypothesis is needed.

theorem Cslib.Complexity.CSP.CrossInsertion.State.encoding_length_le {Rel : Type} (encRel : Rel ↪ List Bool) (J : State Rel) (L : ℕ) (hq : List.length J.body ≤ L) (hm : J.body.occurrences.length ≤ L) (hp : J.ports.length ≤ L) (hd : J.rotation.successor.length ≤ L) (hr : (List.map (fun (r : Rel) => (encRel r).length) (List.map Logic.PL.Constraint.rel J.body)).sum ≤ L) (hw : ∀ z ∈ J.body.vars ++ J.ports, z.size ≤ L) (hv : ∀ v ∈ J.rotation.successor, v.size ≤ L) :
((encState encRel) J).length ≤ 64 * (L + 1) ^ 3

Component counts, actual encoded relation payload and binary widths give a cubic bound for the existing State word, without a finite alphabet or table-validity premise.