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 #

Transporting validity #

theorem Cslib.Circuits.Boolean.AffineDisperser.State.Valid.of_phi {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) (hcomp : ∀ (val : ℕ → Bool), S'.Consistent val → S'.out.eval val = f (S'.phi val)) :
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 computes f.

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]
        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 ℓ
        @[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 ℓ
        theorem Cslib.Circuits.Boolean.AffineDisperser.State.RestrictOK.pairTame {n : ℕ} {S : State n} {x : ℕ} {ℓ : SemiCircuit.Lit} {P : Finset (ℕ × ℕ)} (h : S.RestrictOK x ℓ P) {k : ℕ} {τ : BitString k → ℕ → Bool} (htame : ∀ pr ∈ P, PairTame τ pr) (pr : ℕ × ℕ) :
        pr ∈ S.pairs → PairTame (fun (u : BitString k) => Function.update (τ u) x (ℓ.eval (τ u))) pr

        Along an affine family on which the kept pairs are tame, the restricted family is affine and every pair is tame: a dropped pair has a constant member, or a constant sum when x is restricted to a literal of its partner.

        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]
          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 ℓ
          @[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 ℓ
          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
            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
            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)
            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
              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
                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.