Width-five branching-program codec internals #
This module proves round-trip and length properties of the canonical codec.
Public statements are re-exported by
Complexitylib.Circuits.BranchingProgramEncoding.
Internal cardinality check for the explicit S₅ table.
Internal completeness of the fixed permutation table.
Internal proof that every canonical permutation rank fits in seven bits.
Internal exact length of a permutation field.
theorem
Complexity.BPCode.Perm5.decodePrefix?_encode_append_internal
(permutation : Equiv.Perm (Fin 5))
(suffix : List Bool)
:
Internal permutation-prefix round trip.
theorem
Complexity.BPCode.Program.decodeInstructions?_flatMap_encode_append_internal
(program : BP 5)
(suffix : List Bool)
:
decodeInstructions? (List.length program) (List.flatMap Instr.encode program ++ suffix) = some (program, suffix)
Internal fixed-count instruction-list round trip.
Internal proof that canonical program serialization is injective.
theorem
Complexity.BPCode.Program.length_encode_le_internal
(program : BP 5)
(variableBound : ℕ)
(hvars : ∀ instruction ∈ program, instruction.var ≤ variableBound)
:
Internal polynomial bound when every referenced variable is bounded.