Documentation

Complexitylib.Algebraic.Basis.DeMorgan.CircuitRestriction

Restricting one-output De Morgan circuits #

The source program is restricted directly, and its designated output wire is then materialized in the residual program when necessary. Deleted charged gates are indexed by Fin source.size, the original source-gate type. The exact cost identity is exposed as a standard Circuit.Reduction certificate.

structure Algebraic.DeMorgan.CircuitRestriction {n : ℕ} (source : Circuit signature (n + 1) 1) (selected : Fin (n + 1)) (fixedValue : Bool) :

Restriction of a one-output De Morgan circuit, with the exact set of deleted charged source gates.

Instances For
    @[reducible, inline]
    abbrev Algebraic.DeMorgan.CircuitRestriction.gateCount {n : ℕ} {source : Circuit signature (n + 1) 1} {selected : Fin (n + 1)} {fixedValue : Bool} (restriction : CircuitRestriction source selected fixedValue) :

    Number of internal gates in the residual circuit.

    Equations
    Instances For
      def Algebraic.DeMorgan.CircuitRestriction.ofProgram {n : ℕ} {source : Circuit signature (n + 1) 1} {selected : Fin (n + 1)} {fixedValue : Bool} (program : ProgramRestriction source.program selected fixedValue) :
      CircuitRestriction source selected fixedValue

      Materialize the residual value of the designated source output, using at most one free gate for a constant or a negation.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Algebraic.DeMorgan.CircuitRestriction.toReduction {n : ℕ} {source : Circuit signature (n + 1) 1} {selected : Fin (n + 1)} {fixedValue : Bool} (restriction : CircuitRestriction source selected fixedValue) :

        View an exact circuit restriction as a generic certified reduction.

        Equations
        Instances For
          noncomputable def Algebraic.DeMorgan.restrictCircuit {n : ℕ} (source : Circuit signature (n + 1) 1) (selected : Fin (n + 1)) (fixedValue : Bool) :
          CircuitRestriction source selected fixedValue

          Partial-evaluate a one-output circuit after fixing one input.

          Equations
          Instances For
            @[simp]
            theorem Algebraic.DeMorgan.restrictCircuit_deleted {n : ℕ} (source : Circuit signature (n + 1) 1) (selected : Fin (n + 1)) (fixedValue : Bool) :
            (restrictCircuit source selected fixedValue).deleted = (restrictProgram selected fixedValue source.program).deleted

            Circuit restriction exposes exactly the source program's deletion set.