Documentation

CslibFrontier.Computability.WordRAM.Realization.Result

Reinterpreting faithfully encoded results #

Changing a semantic result costs no native instructions only when its complete encoded word vector stays identical. This rule covers adding a uniquely determined type-level operation tag; it does not allow host computation to change runtime output words for free.

Main results #

theorem Cslib.WordRAM.Realization.Realizes.result {B : Basis} {δ α β : Type} {k l : ℕ} {p : δ → DataStructure.Memory.Prog α} {input : δ ↪ Fin k → ℕ} {output : α ↪ Fin l → ℕ} {output' : β ↪ Fin l → ℕ} {safe : ℕ → δ → DataStructure.Memory.State → Prop} {work : δ → DataStructure.Memory.State → ℕ} (h : Realizes B p input output safe work) (f : δ → α → β) (hf : ∀ (d : δ) (a : α), output a = output' (f d a)) :
Realizes B (fun (d : δ) => PFunctor.FreeM.bind (p d) fun (a : α) => PFunctor.FreeM.pure (f d a)) input output' safe work

Relabel results only if their entire faithfully encoded register vectors are unchanged. All witnesses, native instructions, safety hypotheses and local-work charges are preserved.