Documentation

Complexity.Computability.Circuit.Boolean.SemiCircuit.OfCircuit

The semi-circuit of a circuit #

A circuit over the full binary basis with n inputs and one output is a fair semi-circuit without equations (SemiCircuit.ofCircuit): input i is the parameter i, gate j is the gate n + j, and a constant line becomes a gate with a constant operation. It is well formed (SemiCircuit.wellFormed_ofCircuit), and the output of a consistent assignment is the output of the circuit on the values of the parameters (SemiCircuit.out_eval_ofCircuit).

Main definitions #

Main results #

References #

The name of a wire of a circuit with n inputs: input i is i and gate j is n + j.

Instances For

    The gate of a line of a circuit over the full binary basis; a constant becomes a gate with a constant operation.

    Instances For
      theorem Cslib.Circuits.Boolean.SemiCircuit.eval_lineGate {n g : ℕ} (line : Line (fullSignature 2 Bool) n g) (val : ℕ → Bool) :
      (lineGate line).eval val = fullInterpretation line.op fun (a : Fin ((fullSignature 2 Bool).Arity line.op)) => val (wireName (line.wires a))

      Evaluating lineGate line under val equals applying fullInterpretation line.op to the values of line's input wires.

      The semi-circuit of a circuit over the full binary basis with one output: its inputs are the parameters, its lines the gates, and it has no auxiliary variables and no equations.

      Instances For
        @[simp]

        The semi-circuit ofCircuit C has no auxiliary variables.

        @[simp]

        The gate indices of ofCircuit C are Finset.Ico n (n + C.size).

        @[simp]

        The semi-circuit ofCircuit C has no affine equations.

        The node index wireName w of any wire w of C is live in ofCircuit C.

        theorem Cslib.Circuits.Boolean.SemiCircuit.exists_eq_add_of_mem_gates {n : ℕ} {C : Circuit (fullSignature 2 Bool) n 1} {J : ℕ} (hJ : J ∈ (ofCircuit C).gates) :
        ∃ (k : Fin C.size), J = n + ↑k

        Every gate index of ofCircuit C has the form n + k for some k : Fin C.size.

        The semi-circuit of a circuit is well formed.

        theorem Cslib.Circuits.Boolean.SemiCircuit.out_eval_ofCircuit {n : ℕ} (C : Circuit (fullSignature 2 Bool) n 1) {val : ℕ → Bool} (hval : (ofCircuit C).Consistent val) :
        (ofCircuit C).out.eval val = C.eval fullInterpretation (fun (i : Fin n) => val ↑i) 0

        On a consistent assignment, the output of the semi-circuit of a circuit is the output of the circuit on the values of the parameters.