Documentation

Complexitylib.Classes.PPoly.Uniform.Unrolling.Generator.Primitive.Internal

Direct-unrolling generator primitives -- proof internals #

theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.prepareRecentReference_spaceBoundByWidth_internal (reference : Fin WorkCount) (offset : ℕ) {initialSpace : ℕ → ℕ} {values : ℕ → BinaryValues WorkCount} {width : ℕ → ℕ} (havailable : ∀ (inputLength : ℕ), values inputLength Work.available ≤ width inputLength) (hreference : ∀ (inputLength : ℕ), values inputLength reference ≤ width inputLength) (hoffset : ∀ (inputLength : ℕ), offset ≤ values inputLength Work.available) :
(prepareRecentReference reference offset).SpaceBoundByWidthAt initialSpace values width
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.prepareRecentReference_requires_internal (reference : Fin WorkCount) (offset : ℕ) (values : BinaryValues WorkCount) (havailableReference : Work.available ≠ reference) (havailableCounter : Work.available ≠ Work.copyCounter) (hreferenceCounter : reference ≠ Work.copyCounter) :
(prepareRecentReference reference offset).requires values ↔ values Work.copyCounter = 0 ∧ offset ≤ values Work.available
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitRecentGate_sound_internal (op : AndOrOp) (negated₀ negated₁ : Bool) (offset₀ offset₁ : ℕ) :
(emitRecentGate op negated₀ negated₁ offset₀ offset₁).Sound
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitRecentGate_requires_internal (op : AndOrOp) (negated₀ negated₁ : Bool) (offset₀ offset₁ : ℕ) (values : BinaryValues WorkCount) :
(emitRecentGate op negated₀ negated₁ offset₀ offset₁).requires values ↔ values Work.copyCounter = 0 ∧ offset₀ ≤ values Work.available ∧ offset₁ ≤ values Work.available ∧ values Work.emitCounter = 0
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitRecentGate_effect_internal (op : AndOrOp) (negated₀ negated₁ : Bool) (offset₀ offset₁ : ℕ) (values : BinaryValues WorkCount) :
(emitRecentGate op negated₀ negated₁ offset₀ offset₁).effect values = Function.update (Function.update (Function.update values Work.available (values Work.available + 1)) Work.reference₀ 0) Work.reference₁ 0
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitRecentGate_spaceBoundByWidth_internal (op : AndOrOp) (negated₀ negated₁ : Bool) (offset₀ offset₁ : ℕ) {initialSpace : ℕ → ℕ} {values : ℕ → BinaryValues WorkCount} {width : ℕ → ℕ} (havailable : ∀ (inputLength : ℕ), values inputLength Work.available ≤ width inputLength) (hreference₀ : ∀ (inputLength : ℕ), values inputLength Work.reference₀ ≤ width inputLength) (hreference₁ : ∀ (inputLength : ℕ), values inputLength Work.reference₁ ≤ width inputLength) (hoffset₀ : ∀ (inputLength : ℕ), offset₀ ≤ values inputLength Work.available) (hoffset₁ : ∀ (inputLength : ℕ), offset₁ ≤ values inputLength Work.available) :
(emitRecentGate op negated₀ negated₁ offset₀ offset₁).SpaceBoundByWidthAt initialSpace values width
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitRecentGate_emitted_internal (op : AndOrOp) (negated₀ negated₁ : Bool) (offset₀ offset₁ : ℕ) (values : BinaryValues WorkCount) :
(emitRecentGate op negated₀ negated₁ offset₀ offset₁).emitted values = { op := op, input₀ := values Work.available - offset₀, input₁ := values Work.available - offset₁, negated₀ := negated₀, negated₁ := negated₁ }.encode
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.prepareStateReference_spaceBoundByWidth_internal (stateIndex : ℕ) {initialSpace : ℕ → ℕ} {values : ℕ → BinaryValues WorkCount} {width : ℕ → ℕ} (hvalues : ∀ (inputLength : ℕ) (index : Fin WorkCount), values inputLength index ≤ width inputLength) (hcap : ∀ (inputLength : ℕ), transitionStateRef (values inputLength Work.configBase) stateIndex ≤ width inputLength) :
(prepareStateReference stateIndex).SpaceBoundByWidthAt initialSpace values width
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.prepareHeadReference_spaceBoundByWidth_internal (stateCount : ℕ) {initialSpace : ℕ → ℕ} {values : ℕ → BinaryValues WorkCount} {width : ℕ → ℕ} (hvalues : ∀ (inputLength : ℕ) (index : Fin WorkCount), values inputLength index ≤ width inputLength) (hcap : ∀ (inputLength : ℕ), transitionHeadRef stateCount (values inputLength Work.horizon) (values inputLength Work.configBase) (values inputLength Work.tapeIndex) (values inputLength Work.position) + values inputLength Work.tapeIndex + values inputLength Work.horizon + 1 ≤ width inputLength) :
(prepareHeadReference stateCount).SpaceBoundByWidthAt initialSpace values width
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.prepareCellReference_requires_internal (stateCount tapeCount : ℕ) (values : BinaryValues WorkCount) (hcopy : values Work.copyCounter = 0) (hadd : values Work.addCounter = 0) (hmultiply : values Work.multiplyCounter = 0) :
(prepareCellReference stateCount tapeCount).requires values
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.prepareCellReference_spaceBoundByWidth_internal (stateCount tapeCount : ℕ) {initialSpace : ℕ → ℕ} {values : ℕ → BinaryValues WorkCount} {width : ℕ → ℕ} (hvalues : ∀ (inputLength : ℕ) (index : Fin WorkCount), values inputLength index ≤ width inputLength) (hcap : ∀ (inputLength : ℕ), transitionCellRef stateCount tapeCount (values inputLength Work.horizon) (values inputLength Work.configBase) (values inputLength Work.tapeIndex) (values inputLength Work.position) (values inputLength Work.symbolIndex) + (values inputLength Work.tapeIndex * (values inputLength Work.horizon + 2) + values inputLength Work.position) + (values inputLength Work.horizon + 2) + tapeCount + values inputLength Work.tapeIndex + 4 ≤ width inputLength) :
(prepareCellReference stateCount tapeCount).SpaceBoundByWidthAt initialSpace values width
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitStateReference_spaceBoundByWidth_internal (stateIndex : ℕ) (negated : Bool) {initialSpace : ℕ → ℕ} {values : ℕ → BinaryValues WorkCount} {width : ℕ → ℕ} (hvalues : ∀ (inputLength : ℕ) (index : Fin WorkCount), values inputLength index ≤ width inputLength) (hcap : ∀ (inputLength : ℕ), transitionStateRef (values inputLength Work.configBase) stateIndex ≤ width inputLength) :
(emitStateReference stateIndex negated).SpaceBoundByWidthAt initialSpace values width
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitHeadReference_spaceBoundByWidth_internal (stateCount : ℕ) (negated : Bool) {initialSpace : ℕ → ℕ} {values : ℕ → BinaryValues WorkCount} {width : ℕ → ℕ} (hvalues : ∀ (inputLength : ℕ) (index : Fin WorkCount), values inputLength index ≤ width inputLength) (hcap : ∀ (inputLength : ℕ), transitionHeadRef stateCount (values inputLength Work.horizon) (values inputLength Work.configBase) (values inputLength Work.tapeIndex) (values inputLength Work.position) + values inputLength Work.tapeIndex + values inputLength Work.horizon + 1 ≤ width inputLength) :
(emitHeadReference stateCount negated).SpaceBoundByWidthAt initialSpace values width
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitCellReference_spaceBoundByWidth_internal (stateCount tapeCount : ℕ) (negated : Bool) {initialSpace : ℕ → ℕ} {values : ℕ → BinaryValues WorkCount} {width : ℕ → ℕ} (hvalues : ∀ (inputLength : ℕ) (index : Fin WorkCount), values inputLength index ≤ width inputLength) (hcap : ∀ (inputLength : ℕ), transitionCellRef stateCount tapeCount (values inputLength Work.horizon) (values inputLength Work.configBase) (values inputLength Work.tapeIndex) (values inputLength Work.position) (values inputLength Work.symbolIndex) + (values inputLength Work.tapeIndex * (values inputLength Work.horizon + 2) + values inputLength Work.position) + (values inputLength Work.horizon + 2) + tapeCount + values inputLength Work.tapeIndex + 4 ≤ width inputLength) :
(emitCellReference stateCount tapeCount negated).SpaceBoundByWidthAt initialSpace values width
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitHeadReference_requires_internal (stateCount : ℕ) (negated : Bool) (values : BinaryValues WorkCount) (hadd : values Work.addCounter = 0) (hmultiply : values Work.multiplyCounter = 0) (hemit : values Work.emitCounter = 0) :
(emitHeadReference stateCount negated).requires values
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitCellReference_requires_internal (stateCount tapeCount : ℕ) (negated : Bool) (values : BinaryValues WorkCount) (hcopy : values Work.copyCounter = 0) (hadd : values Work.addCounter = 0) (hmultiply : values Work.multiplyCounter = 0) (hemit : values Work.emitCounter = 0) :
(emitCellReference stateCount tapeCount negated).requires values
theorem Complexity.CircuitUnrolling.Serializer.DirectGenerator.emitCellReference_emitted_internal (stateCount tapeCount : ℕ) (negated : Bool) (values : BinaryValues WorkCount) :
(emitCellReference stateCount tapeCount negated).emitted values = (CircuitCode.RawGate.copy (transitionCellRef stateCount tapeCount (values Work.horizon) (values Work.configBase) (values Work.tapeIndex) (values Work.position) (values Work.symbolIndex)) negated).encode