Documentation

Complexitylib.Classes.PPoly.Uniform.Unrolling.Generator.Initialization

Verified direct-unrolling initialization generator #

This module exposes soundness, logarithmic all-prefix space, exact pure effects, exact raw-gate emission, and the positive-input entry contract for the direct initialization phase.

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitConstantGate_spaceBoundByWidth (value : Bool) {initialSpace : } {values : BinaryValues WorkCount} {width : } (havailable : ∀ (inputLength : ), values inputLength Work.available width inputLength) (hreference : ∀ (inputLength : ), values inputLength Work.reference₀ width inputLength) :
(emitConstantGate value).SpaceBoundByWidthAt initialSpace values width

Emitting a constant gate has a pointwise width certificate when the first-unused-wire frontier and the shared constant reference fit the width.

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitCopyGate_spaceBoundByWidth (reference : Fin WorkCount) (negated : Bool) {initialSpace : } {values : BinaryValues WorkCount} {width : } (havailable : ∀ (inputLength : ), values inputLength Work.available width inputLength) (hreference : ∀ (inputLength : ), values inputLength reference width inputLength) :
(emitCopyGate reference negated).SpaceBoundByWidthAt initialSpace values width

Emitting a copy gate has a pointwise width certificate when the first-unused-wire frontier and copied reference fit the width.

Direct initialization uses logarithmic all-prefix space after the positive polynomial preamble has prepared its numeric work-vector entry state.

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.initialization_effect {k : } (tm : TM k) (values : BinaryValues WorkCount) (hreference : values Work.reference₀ = 0) (hloop : values Work.loop₀ = 0) (hinput : values Work.inputLength values Work.horizon + 1) :
(initialization tm).effect values = Function.update (Function.update values Work.available (values Work.available + Fintype.card tm.Q + (values Work.horizon + 1) * (k + 2) + 4 + 4 * (values Work.horizon + 1) + (4 + 4 * (values Work.horizon + 1)) * (k + 1))) Work.limit₀ 0

Exact work-vector effect of initialization on its natural value-level domain. In particular, loop₀ is restored and limit₀ is cleared.

Exact encoded raw-gate stream emitted by initialization.

Exact endpoint after the verified positive preamble.

@[simp]

The positive preamble causes initialization to emit exactly the numeric direct-initialization schedule at the normalized horizon.

The normalized horizon bound discharges every initialization leaf and loop obligation at positive-input entry.