Documentation

Complexitylib.Circuits.Internal.SchnorrDeMorgan

Internal: Schnorr's 3(N - 1) bound via De Morgan gate elimination #

This module translates a straight-line Basis.andOr2 program into a straight-line De Morgan program (Algebraic.DeMorgan.signature) with the same wire values and whose charged binary-gate cost equals the source gate count. Composing with the three-gate elimination theorem Algebraic.GateElimination.Xor.lowerBound for Algebraic.DeMorgan.xorThreeGateEliminator gives parity_size_ge_three_mul_internal, the proof of the public theorem parity_size_ge_three_mul in Complexitylib.Circuits.Schnorr.

A De Morgan program simulating a straight-line Basis.andOr2 program p: every source wire is mapped to a target wire with the same value, and the target's charged binary-gate cost equals the number of source gates.

Instances For
    theorem Complexity.SchnorrDeMorgan.toBinaryOp_eval (op : AndOrOp) (inputs : BitString 2) :
    (toBinaryOp op).eval (inputs 0) (inputs 1) = op.eval 2 inputs

    A fan-in-two AND/OR gate and its De Morgan counterpart agree on every pair of input values.

    Translate a straight-line Basis.andOr2 program gate by gate into a De Morgan program, absorbing input negations into residual wire values.

    Equations
    Instances For

      Schnorr.xorBool agrees with the algebraic library's parity.

      theorem Complexity.parity_size_ge_three_mul_internal (N G : ℕ) [NeZero N] (c : Circuit Basis.andOr2 N 1 G) (comp : Bool) (heval : ∀ (x : BitString N), c.eval x 0 = (comp ^^ Schnorr.xorBool N x)) :
      3 * (N - 1) ≤ c.size

      Internal proof of parity_size_ge_three_mul.