Documentation

Complexity.Computability.Circuit.Boolean.SemiCircuit.Rewiring

Moving and rewiring gates #

Two changes of the gates of a fair semi-circuit that keep its parameters and the function it computes, as in Mishra and Santhanam, Sections 2.3 and 4.2:

Both preserve well-formedness, and every consistent assignment of the result is consistent for the original semi-circuit (SemiCircuit.MoveOK.liftsTo, SemiCircuit.RewireOK.liftsTo).

Main definitions #

Main results #

References #

Moving an affine gate into the affine system #

Move the affine gate J into the affine system as the auxiliary variable J with the new equation e.

Instances For

    The hypotheses of moving a gate into the affine system: J is an affine gate reading no gates and e is a fresh equation name.

    Instances For
      theorem Cslib.Circuits.Boolean.SemiCircuit.MoveOK.eqn_of_mem {C : SemiCircuit} {J e : ℕ} (h : C.MoveOK J e) {e' : ℕ} (he' : e' ∈ C.eqns) :
      (C.moveAffine J e).eqn e' = C.eqn e'
      theorem Cslib.Circuits.Boolean.SemiCircuit.MoveOK.eqnsHold_iff {C : SemiCircuit} {J e : ℕ} (h : C.MoveOK J e) (val : ℕ → Bool) :
      (C.moveAffine J e).EqnsHold val ↔ C.EqnsHold val ∧ (affEqn (C.gate J) J).Holds val

      The solutions of the new affine system are those of the old one on which the moved gate takes its value.

      theorem Cslib.Circuits.Boolean.SemiCircuit.MoveOK.mem_params_or_aux {C : SemiCircuit} (hC : C.WellFormed) {J e : ℕ} (h : C.MoveOK J e) {i : ℕ} (hi : (C.gate J).Reads i) :

      Moving an affine gate reading no gates into the affine system preserves well-formedness.

      A consistent assignment after moving a gate into the affine system is consistent for the original semi-circuit.

      theorem Cslib.Circuits.Boolean.SemiCircuit.deg_moveAffine_le {C : SemiCircuit} {J e : ℕ} (h : C.MoveOK J e) {z : ℕ} (hzJ : z ≠ J) :
      (C.moveAffine J e).deg z ≤ C.deg z

      Moving a gate into the affine system does not increase the degree of any value other than the gate.

      Rewiring a gate #

      Replace the gate J by the gate g.

      Instances For

        The hypotheses of rewiring: g reads only parameters and computes the value of J whenever all other gates take their values.

        Instances For
          theorem Cslib.Circuits.Boolean.SemiCircuit.rewire_gate_of_ne {C : SemiCircuit} {J K : ℕ} {g : Gate} (hKJ : K ≠ J) :
          (C.rewire J g).gate K = C.gate K

          Rewiring a gate to read only parameters preserves well-formedness.

          A consistent assignment of a rewired semi-circuit is consistent for the original one.