Documentation

Complexitylib.Circuits.Encoding.FixedWidth.Conversion.Internal

Conversion between raw circuits and fixed-width descriptions -- internals #

theorem Complexity.CircuitCode.FixedWidth.GateSlot.toRawGate_ofRawGate_internal {width : } {gate : RawGate} (hinput0 : gate.input₀ < 2 ^ width) (hinput1 : gate.input₁ < 2 ^ width) :
(ofRawGate width gate).toRawGate = gate
@[simp]
theorem Complexity.CircuitCode.FixedWidth.Description.gateCountNat_ofRawCircuit_internal {inputWidth gateBound : } (circuit : RawCircuit) (hbound : List.length circuit gateBound) :
(ofRawCircuit circuit hbound).gateCountNat = List.length circuit
@[simp]
theorem Complexity.CircuitCode.FixedWidth.Description.slot_ofRawCircuit_of_lt_internal {inputWidth gateBound : } (circuit : RawCircuit) (hbound : List.length circuit gateBound) (index : Fin gateBound) (hindex : index < List.length circuit) :
(ofRawCircuit circuit hbound).slots index = GateSlot.ofRawGate (referenceWidth inputWidth gateBound) circuit[index]
@[simp]
theorem Complexity.CircuitCode.FixedWidth.Description.slot_ofRawCircuit_of_le_internal {inputWidth gateBound : } (circuit : RawCircuit) (hbound : List.length circuit gateBound) (index : Fin gateBound) (hindex : List.length circuit index) :
(ofRawCircuit circuit hbound).slots index = GateSlot.zero (referenceWidth inputWidth gateBound)
theorem Complexity.CircuitCode.FixedWidth.Description.toRawCircuit_ofRawCircuit_internal {inputWidth gateBound : } {circuit : RawCircuit} (htopological : RawCircuit.TopologicallyWellFormed inputWidth circuit) (hbound : List.length circuit gateBound) :
(ofRawCircuit circuit hbound).toRawCircuit = circuit
theorem Complexity.CircuitCode.FixedWidth.Description.ofRawCircuit_wellFormed_internal {inputWidth gateBound : } {circuit : RawCircuit} (hcircuit : RawCircuit.WellFormed inputWidth circuit) (hbound : List.length circuit gateBound) :
(ofRawCircuit circuit hbound).WellFormed
theorem Complexity.CircuitCode.FixedWidth.Description.ofRawCircuit_toRawCircuit_internal {inputWidth gateBound : } {description : Description inputWidth gateBound} (hcanonical : description.CanonicallyPadded) :
ofRawCircuit description.toRawCircuit = description
def Complexity.CircuitCode.FixedWidth.wellFormedEquivInternal (inputWidth gateBound : ) :
ValidDescription inputWidth gateBound BoundedRawCircuit inputWidth gateBound

Internal exact equivalence between valid fixed descriptions and bounded raw circuits.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Complexity.CircuitCode.FixedWidth.wellFormedEquiv_apply_val_internal {inputWidth gateBound : } (description : ValidDescription inputWidth gateBound) :
    ((wellFormedEquivInternal inputWidth gateBound) description) = (↑description).toRawCircuit
    theorem Complexity.CircuitCode.FixedWidth.wellFormedEquiv_symm_val_internal {inputWidth gateBound : } (circuit : BoundedRawCircuit inputWidth gateBound) :
    ((wellFormedEquivInternal inputWidth gateBound).symm circuit) = Description.ofRawCircuit circuit