Documentation

Complexity.Computability.Circuit.Boolean.SemiCircuit.Simplification

Restricting parameters and deleting constraints #

The simplifications of a fair semi-circuit, each preserving well-formedness:

A consistent assignment of a restriction is consistent for the original semi-circuit once the restricted parameter takes the value of its literal (SemiCircuit.consistent_restrict), and consistent assignments of the deletions lift to the original semi-circuit (SemiCircuit.DeleteGateOK.liftsTo, SemiCircuit.DeleteEqnOK.liftsTo, SemiCircuit.DropEqnOK.liftsTo, SemiCircuit.liftsTo_dropTrivialEqn).

Main definitions #

Main results #

References #

Restricting a parameter #

Restrict the parameter x to the literal ℓ: reroute x to ℓ and remove it from the parameters.

Instances For
    theorem Cslib.Circuits.Boolean.SemiCircuit.mem_live_restrict {C : SemiCircuit} {x : ℕ} {ℓ : Lit} {i : ℕ} (hi : i ∈ C.live) (hix : i ≠ x) :
    i ∈ (C.restrict x ℓ).live

    Any live node of C distinct from x remains live in C.restrict x ℓ.

    theorem Cslib.Circuits.Boolean.SemiCircuit.WellFormed.restrict {C : SemiCircuit} (hC : C.WellFormed) {x : ℕ} {ℓ : Lit} (hx : x ∈ C.params) (hℓ : ∀ (y : ℕ), ℓ.Reads y → y ∈ C.params ∧ y ≠ x) :

    Restricting a parameter to a literal reading at most another parameter preserves well-formedness.

    theorem Cslib.Circuits.Boolean.SemiCircuit.consistent_restrict {C : SemiCircuit} (hC : C.WellFormed) {x : ℕ} {ℓ : Lit} (hx : x ∈ C.params) (hℓ : ℓ.arg ≠ Arg.node x) {val : ℕ → Bool} (h : (C.restrict x ℓ).Consistent val) :
    C.Consistent (Function.update val x (ℓ.eval val))

    A consistent assignment of a restriction, with the restricted parameter given the value of its literal, is consistent for the original semi-circuit.

    theorem Cslib.Circuits.Boolean.SemiCircuit.out_restrict {C : SemiCircuit} {x : ℕ} {ℓ : Lit} (hℓ : ℓ.arg ≠ Arg.node x) (val : ℕ → Bool) :
    (C.restrict x ℓ).out.eval val = C.out.eval (Function.update val x (ℓ.eval val))

    Evaluating the output of C.restrict x ℓ under val equals evaluating the output of C after updating x to ℓ.eval val.

    Deleting a gate #

    Delete the gate J, rerouting its uses to the literal ℓ.

    Instances For

      The hypotheses of a gate deletion: J is a gate, ℓ reads at most an input of J, and either J computes ℓ on the solutions of the affine system or nothing reads J.

      Instances For
        theorem Cslib.Circuits.Boolean.SemiCircuit.mem_live_deleteGate {C : SemiCircuit} {J : ℕ} {ℓ : Lit} {i : ℕ} (hi : i ∈ C.live) (hiJ : i ≠ J) :
        i ∈ (C.deleteGate J ℓ).live

        Any live node of C distinct from J remains live in C.deleteGate J ℓ.

        Deleting a gate preserves well-formedness.

        A consistent assignment of a gate deletion lifts, by giving the deleted gate its value.

        Deleting an equation #

        Delete the equation e, which reads v = ℓ, and the auxiliary variable v, rerouting v to ℓ.

        Instances For

          The hypotheses of deleting an equation: e is an equation stating v = ℓ for an auxiliary variable v and a literal ℓ reading at most another term of e.

          Instances For
            theorem Cslib.Circuits.Boolean.SemiCircuit.mem_live_deleteEqn {C : SemiCircuit} {e v : ℕ} {ℓ : Lit} {i : ℕ} (hi : i ∈ C.live) (hiv : i ≠ v) :
            i ∈ (C.deleteEqn e v ℓ).live

            Any live node of C distinct from v remains live in C.deleteEqn e v ℓ.

            theorem Cslib.Circuits.Boolean.SemiCircuit.WellFormed.deleteEqn {C : SemiCircuit} (hC : C.WellFormed) {e v : ℕ} {ℓ : Lit} (h : C.DeleteEqnOK e v ℓ) :
            (C.deleteEqn e v ℓ).WellFormed

            Deleting an equation v = ℓ with its auxiliary variable preserves well-formedness.

            theorem Cslib.Circuits.Boolean.SemiCircuit.DeleteEqnOK.liftsTo {C : SemiCircuit} (hC : C.WellFormed) {e v : ℕ} {ℓ : Lit} (h : C.DeleteEqnOK e v ℓ) :
            (C.deleteEqn e v ℓ).LiftsTo C

            A consistent assignment after deleting v = ℓ lifts, by giving v the value of ℓ.

            Dropping an equation #

            Delete the equation e together with an auxiliary variable v occurring nowhere else.

            Instances For

              The hypotheses of dropping an equation: the auxiliary variable v occurs in the equation e and nowhere else.

              Instances For

                Dropping an equation with an auxiliary variable occurring only there preserves well-formedness.

                A consistent assignment after dropping an equation lifts, by solving the equation for the dropped auxiliary variable.

                Delete an equation without terms.

                Instances For

                  Dropping an equation with no terms preserves well-formedness.

                  Every consistent assignment after dropping an equation with no terms is consistent for the original semi-circuit.