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))
      theorem Cslib.Circuits.Boolean.SemiCircuit.reads_lineGate {n g : ℕ} {line : Line (fullSignature 2 Bool) n g} {i : ℕ} (h : (lineGate line).Reads i) :
      ∃ (a : Fin ((fullSignature 2 Bool).Arity line.op)), wireName (line.wires a) = i

      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
        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

        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.