Documentation

Complexity.Computability.Circuit.Boolean.AffineDisperser.Operations

Restrictions and deletions on states #

The restrictions and deletions of Mishra and Santhanam, Sections 2.4 and 3.1 on states of gate elimination, each with its validity and its effect on the counted quantities and on the children of the parameters:

Each operation acts on the semi-circuit as the corresponding simplification of Complexity.Computability.Circuit.Boolean.SemiCircuit.Simplification, which preserves well-formedness. Validity then follows from the semi-circuit level: an operation keeping the parameter map is valid when consistent assignments lift (State.Valid.of_liftsTo), and in general validity is transported along a map σ from the new assignments to the old ones under the obligations State.Transport (State.Valid.of_transport).

Main definitions #

Main results #

References #

Evaluating a literal ℓ along an affine family of assignments τ defines an affine Boolean function.

Transporting validity #

theorem Cslib.Circuits.Boolean.AffineDisperser.State.Valid.of_liftsTo {n : ℕ} {f : BooleanFunction n} {S S' : State n} (hS : S.Valid f) (hparams : S'.params = S.params) (hpairs : S'.pairs = S.pairs) (hphi : S'.phi = S.phi) (hwf : S'.WellFormed) (hlift : S'.LiftsTo S.toSemiCircuit) :
S'.Valid f

A state with the parameters, pairs and parameter map of a valid state is valid when its semi-circuit is well formed and its consistent assignments lift to the old semi-circuit.

structure Cslib.Circuits.Boolean.AffineDisperser.State.Transport {n : ℕ} (S S' : State n) (σ : (ℕ → Bool) → ℕ → Bool) :

The obligations for transporting validity from S to S' along a map σ from the assignments of S' to those of S: σ maps consistent assignments to consistent assignments with the same output, the new parameter map is the old one after σ, σ matches the parameters of both states injectively, and σ maps affine families on which the new pairs are tame to families agreeing on the old parameters with affine families on which the old pairs are tame.

Instances For
    theorem Cslib.Circuits.Boolean.AffineDisperser.State.Valid.of_transport {n : ℕ} {f : BooleanFunction n} {S S' : State n} (hS : S.Valid f) {σ : (ℕ → Bool) → ℕ → Bool} (hwf : S'.WellFormed) (h : S.Transport S' σ) :
    S'.Valid f

    Validity transported along a map σ from the assignments of a new, well-formed state to those of a valid state.

    A gate does not read itself.

    Restrictions (UF) and (PF) #

    Restrict the parameter x to the literal ℓ, a constant or a literal of another parameter, keeping the pairs P.

    Instances For

      The hypotheses of a restriction: x is a parameter, ℓ reads at most another parameter, the kept pairs avoid x, and every dropped pair contains x and the other parameter read by ℓ, if any.

      Instances For
        @[simp]

        Restricting x removes x from the parameters of S.

        @[simp]

        The pairs of S.restrict x ℓ P are P.

        theorem Cslib.Circuits.Boolean.AffineDisperser.State.restrict_children {n : ℕ} (S : State n) (x : ℕ) (ℓ : SemiCircuit.Lit) (P : Finset (ℕ × ℕ)) (z : ℕ) :
        (S.restrict x ℓ P).children z = (S.subst x ℓ).children z

        The children of z in S.restrict x ℓ P are its children after substituting x with ℓ.

        Restricting a parameter preserves the size of the state.

        @[simp]
        theorem Cslib.Circuits.Boolean.AffineDisperser.State.restrict_gate {n : ℕ} (S : State n) (x : ℕ) (ℓ : SemiCircuit.Lit) (P : Finset (ℕ × ℕ)) (J : ℕ) :
        (S.restrict x ℓ P).gate J = (S.gate J).subst x ℓ

        Restricting x to ℓ substitutes x with ℓ in every gate.

        @[simp]
        theorem Cslib.Circuits.Boolean.AffineDisperser.State.restrict_eqn {n : ℕ} (S : State n) (x : ℕ) (ℓ : SemiCircuit.Lit) (P : Finset (ℕ × ℕ)) (e : ℕ) :
        (S.restrict x ℓ P).eqn e = (S.eqn e).subst x ℓ

        Restricting x to ℓ substitutes x with ℓ in every equation.

        theorem Cslib.Circuits.Boolean.AffineDisperser.State.Valid.restrict {n : ℕ} {f : BooleanFunction n} {S : State n} (hS : S.Valid f) {x : ℕ} {ℓ : SemiCircuit.Lit} {P : Finset (ℕ × ℕ)} (h : S.RestrictOK x ℓ P) :
        (S.restrict x ℓ P).Valid f

        Restrictions preserve validity.

        Deleting a gate (D1) and (D2) #

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

        Instances For
          @[simp]

          Deleting a gate preserves the parameters of the state.

          @[simp]

          Deleting a gate preserves the pairs of the state.

          @[simp]

          Deleting a gate preserves the parameter map phi.

          @[simp]
          theorem Cslib.Circuits.Boolean.AffineDisperser.State.deleteGate_gate {n : ℕ} (S : State n) (J : ℕ) (ℓ : SemiCircuit.Lit) (K : ℕ) :
          (S.deleteGate J ℓ).gate K = (S.gate K).subst J ℓ

          Deleting gate J with replacement ℓ substitutes J with ℓ in every gate.

          @[simp]
          theorem Cslib.Circuits.Boolean.AffineDisperser.State.deleteGate_eqn {n : ℕ} (S : State n) (J : ℕ) (ℓ : SemiCircuit.Lit) (e : ℕ) :
          (S.deleteGate J ℓ).eqn e = (S.eqn e).subst J ℓ

          Deleting gate J with replacement ℓ substitutes J with ℓ in every equation.

          @[simp]

          Deleting gate J removes J from S.gates.

          Deleting a gate decreases the size of the state by 1.

          After deleting gate J with replacement ℓ, the children of z are contained in the children of z after substituting J with ℓ with .inl J removed.

          theorem Cslib.Circuits.Boolean.AffineDisperser.State.deleteGate_children_of_ne {n : ℕ} {f : BooleanFunction n} {S : State n} (hS : S.Valid f) {J : ℕ} {ℓ : SemiCircuit.Lit} (h : S.DeleteGateOK J ℓ) {z : ℕ} (hz : z ∈ S.params) (hzℓ : ¬ℓ.Reads z) :
          (S.deleteGate J ℓ).children z ⊆ (S.children z).erase (Sum.inl J)

          Deleting a gate removes it from the children of every parameter other than the target of ℓ.

          theorem Cslib.Circuits.Boolean.AffineDisperser.State.Valid.deleteGate {n : ℕ} {f : BooleanFunction n} {S : State n} (hS : S.Valid f) {J : ℕ} {ℓ : SemiCircuit.Lit} (h : S.DeleteGateOK J ℓ) :
          (S.deleteGate J ℓ).Valid f

          Deleting a gate preserves validity.

          Deleting an equation (D3) #

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

          Instances For
            @[simp]

            Deleting an equation preserves the parameters of the state.

            @[simp]

            Deleting an equation preserves the pairs of the state.

            @[simp]

            Deleting an equation preserves the parameter map phi.

            theorem Cslib.Circuits.Boolean.AffineDisperser.State.deleteEqn_size {n : ℕ} {S : State n} {e v : ℕ} {ℓ : SemiCircuit.Lit} (h : S.DeleteEqnOK e v ℓ) :
            (S.deleteEqn e v ℓ).size + 1 = S.size

            Deleting an equation decreases the size of the state by 1.

            After deleting equation e and auxiliary variable v with replacement ℓ, the children of z are contained in the children of z after substituting v with ℓ with .inr e removed.

            theorem Cslib.Circuits.Boolean.AffineDisperser.State.deleteEqn_children_of_ne {n : ℕ} {f : BooleanFunction n} {S : State n} (hS : S.Valid f) {e v : ℕ} {ℓ : SemiCircuit.Lit} (h : S.DeleteEqnOK e v ℓ) {z : ℕ} (hz : z ∈ S.params) (hzℓ : ¬ℓ.Reads z) :
            (S.deleteEqn e v ℓ).children z ⊆ (S.children z).erase (Sum.inr e)

            Deleting an equation removes it from the children of every parameter other than the target of ℓ.

            theorem Cslib.Circuits.Boolean.AffineDisperser.State.Valid.deleteEqn {n : ℕ} {f : BooleanFunction n} {S : State n} (hS : S.Valid f) {e v : ℕ} {ℓ : SemiCircuit.Lit} (h : S.DeleteEqnOK e v ℓ) :
            (S.deleteEqn e v ℓ).Valid f

            Deleting an equation v = ℓ with its auxiliary variable preserves validity.

            Dropping an equation (D4) #

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

            Instances For
              @[simp]

              Dropping an equation preserves the parameters of the state.

              @[simp]

              Dropping an equation preserves the pairs of the state.

              theorem Cslib.Circuits.Boolean.AffineDisperser.State.dropEqn_size {n : ℕ} {S : State n} {e v : ℕ} (h : S.DropEqnOK e v) :
              (S.dropEqn e v).size + 1 = S.size

              Dropping an equation decreases the size of the state by 1.

              Dropping equation e removes .inr e from the children of z.

              theorem Cslib.Circuits.Boolean.AffineDisperser.State.Valid.dropEqn {n : ℕ} {f : BooleanFunction n} {S : State n} (hS : S.Valid f) {e v : ℕ} (h : S.DropEqnOK e v) :
              (S.dropEqn e v).Valid f

              Dropping an equation with an auxiliary variable occurring only there preserves validity.

              Delete an equation without terms.

              Instances For
                @[simp]

                Dropping a trivial equation preserves the parameters of the state.

                @[simp]

                Dropping a trivial equation preserves the pairs of the state.

                Dropping a trivial equation decreases the size of the state by 1.

                Dropping trivial equation e removes .inr e from the children of z.

                theorem Cslib.Circuits.Boolean.AffineDisperser.State.Valid.dropTrivialEqn {n : ℕ} {f : BooleanFunction n} {S : State n} (hS : S.Valid f) {e : ℕ} (he : e ∈ S.eqns) (hterms : (S.eqn e).terms = ∅) :

                Deleting an equation without terms preserves validity.