Native raw successor-table reindexing #
Forward and inverse index maps operate on binary naturals, including arbitrarily large malformed entries. The only enumeration uses a computed unary count, supplied from actual graph or list lengths by callers. No abstract dart inverse executes at runtime. Exchanging two outgoing table entries is a specialization of the same raw program.
theorem Cslib.Complexity.Graph.RotationCertificate.computableInPolyTime_reindex {α : Type} {input : α ↪ List Bool} {table : α → RotationCertificate} {count : α → ℕ} {forward back : α → ℕ → ℕ} (hc : Turing.MultiTapeTM.ComputableInPolyTime table input encRotationCertificate) (hn : Turing.MultiTapeTM.ComputableInPolyTime count input Turing.MultiTapeTM.encUnary) (hf :
Turing.MultiTapeTM.ComputableInPolyTime (fun (p : α × ℕ) => forward p.1 p.2)
(Turing.MultiTapeTM.encPair input Turing.MultiTapeTM.encNat) Turing.MultiTapeTM.encNat) (hb :
Turing.MultiTapeTM.ComputableInPolyTime (fun (p : α × ℕ) => back p.1 p.2)
(Turing.MultiTapeTM.encPair input Turing.MultiTapeTM.encNat) Turing.MultiTapeTM.encNat) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : α) => (table x).reindex (count x) (forward x) (back x)) input
encRotationCertificate
Native reindexing composes the supplied binary programs around saturating binary table lookup. The output clock is unary and independent of source entry magnitudes.
theorem Cslib.Complexity.Graph.RotationCertificate.computableInPolyTime_swapSuccessors {α : Type} {input : α ↪ List Bool} {table : α → RotationCertificate} {left right : α → ℕ} (hc : Turing.MultiTapeTM.ComputableInPolyTime table input encRotationCertificate) (hl : Turing.MultiTapeTM.ComputableInPolyTime left input Turing.MultiTapeTM.encNat) (hr : Turing.MultiTapeTM.ComputableInPolyTime right input Turing.MultiTapeTM.encNat) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : α) => (table x).swapSuccessors (left x) (right x)) input
encRotationCertificate
Exchange two computed binary-indexed outgoing entries. Even invalid corner indices are only compared and read; the actual table length funds the iteration.