Documentation

Complexitylib.Circuits.Encoding.FixedWidth.Evaluation.Gate.Internal

Fixed-width encoded-gate evaluation formulas -- proof internals #

theorem Complexity.CircuitCode.FixedWidth.Description.GateFormula.eval_negateIf_internal (flag value : BoolFormula) (assignment : Bool) :
BoolFormula.eval assignment (negateIf flag value) = (BoolFormula.eval assignment flag ^^ BoolFormula.eval assignment value)
theorem Complexity.CircuitCode.FixedWidth.Description.GateFormula.vars_negateIf_lt_internal (flag value : BoolFormula) (available : ) (hflag : wireflag.vars, wire < available) (hvalue : wirevalue.vars, wire < available) (wire : ) :
wire (negateIf flag value).varswire < available
theorem Complexity.CircuitCode.FixedWidth.Description.GateFormula.eval_applyOperation_internal (operation left right : BoolFormula) (assignment : Bool) :
BoolFormula.eval assignment (applyOperation operation left right) = match BoolFormula.eval assignment operation with | true => BoolFormula.eval assignment left && BoolFormula.eval assignment right | false => BoolFormula.eval assignment left || BoolFormula.eval assignment right
theorem Complexity.CircuitCode.FixedWidth.Description.GateFormula.size_applyOperation_internal (operation left right : BoolFormula) :
(applyOperation operation left right).size = operation.size + 2 * left.size + 2 * right.size + 5
theorem Complexity.CircuitCode.FixedWidth.Description.GateFormula.vars_applyOperation_lt_internal (operation left right : BoolFormula) (available : ) (hoperation : wireoperation.vars, wire < available) (hleft : wireleft.vars, wire < available) (hright : wireright.vars, wire < available) (wire : ) :
wire (applyOperation operation left right).varswire < available
theorem Complexity.CircuitCode.FixedWidth.Description.GateFormula.eval_gate_internal {inputWidth gateBound : } (slot : Fin gateBound) (sources : Fin (inputWidth + slot)BoolFormula) (assignment : Bool) (hslot : (decodedSlot inputWidth gateBound slot assignment).WellFormedAt (inputWidth + slot)) :
BoolFormula.eval assignment (gate inputWidth gateBound slot sources) = (decodedSlot inputWidth gateBound slot assignment).toRawGate.eval (BoolFormula.eval assignment (sources (decodedSlot inputWidth gateBound slot assignment).input0Value, )) (BoolFormula.eval assignment (sources (decodedSlot inputWidth gateBound slot assignment).input1Value, ))
theorem Complexity.CircuitCode.FixedWidth.Description.GateFormula.size_gate_internal {inputWidth gateBound : } (slot : Fin gateBound) (sources : Fin (inputWidth + slot)BoolFormula) (hsources : ∀ (source : Fin (inputWidth + slot)), (sources source).size = 1) :
(gate inputWidth gateBound slot sources).size = gateSize inputWidth gateBound slot
theorem Complexity.CircuitCode.FixedWidth.Description.GateFormula.vars_gate_lt_internal {inputWidth gateBound available : } (slot : Fin gateBound) (sources : Fin (inputWidth + slot)BoolFormula) (hcode : codeWidth inputWidth gateBound available) (hsources : ∀ (source : Fin (inputWidth + slot)), wire(sources source).vars, wire < available) (wire : ) :
wire (gate inputWidth gateBound slot sources).varswire < available