Batched prefix witnesses remain valid across an arbitrary partition
ProvedPvsNP.batched_prefix_handoffcomplexity-theoryformal-verification
Each code describes a word. A live packet contains a code whose word extends the prefix seen so far. A dead packet means no code extends that prefix. Suppose the local update uses only the current cutoff, the current live code, and the next block to find a code extending the recovered prefix followed by the new block, or correctly reports there is none. After processing any list of blocks, the final cutoff equals the length of the full processed prefix and the packet has the same correctness invariant.
Preamble
import Mathlib.Data.List.Infix set_option autoImplicit false
Formal statement
theorem PvsNP.batched_prefix_handoff {Code Symbol : Type}
(word : Code → List Symbol)
(choose : ℕ → Code → List Symbol → Option Code)
(valid : ∀ cut old block,
match choose cut old block with
| none => ¬ ∃ c, (word old).take cut ++ block <+: word c
| some c => (word old).take cut ++ block <+: word c)
(seen : List Symbol) (packet : Option Code)
(initial : match packet with
| none => ¬ ∃ c, seen <+: word c
| some c => seen <+: word c)
(blocks : List (List Symbol)) :
let terminal := blocks.foldl
(fun (state : ℕ × Option Code) block =>
(state.1 + block.length, state.2.bind (fun old => choose state.1 old block)))
(seen.length, packet)
terminal.1 = (seen ++ blocks.flatten).length ∧
match terminal.2 with
| none => ¬ ∃ c, seen ++ blocks.flatten <+: word c
| some c => seen ++ blocks.flatten <+: word c := by sorrySource
Compatible bounded-size circuit witnesses at many stored-tape MCSP cuts.