Reductions and potential accounting for gate elimination #
Shared reduction abstraction and potential-change accounting for the 3.5n (AffineDisperser)
and 4n (AffineDisperser4n) gate-elimination developments.
A reduction State.Reduction f S S' F D T from S to S' restricts the parameters in F, drops
all pairs meeting F, and deletes the gates and equations in D, ensuring that only deletions of
constraints in T can reroute to a remaining parameter and that non-deleted deletable constraints
remain deletable.
Main definitions #
Cslib.Circuits.Boolean.AffineDisperserCore.State.Deletable: constraints deletable by(D1)or(D3).Cslib.Circuits.Boolean.AffineDisperserCore.State.Reduction: composable reductions.Cslib.Circuits.Boolean.AffineDisperserCore.State.deleteConstraint: the deletion of a deletable gate or equation.
Main results #
Cslib.Circuits.Boolean.AffineDisperserCore.State.Reduction.W_le: the potential inequality parameterized bycfg.cs,cfg.cq, andcfg.weight.Cslib.Circuits.Boolean.AffineDisperserCore.State.Reduction.step: reductions as steps of gate elimination parameterized bycfg.ca.Cslib.Circuits.Boolean.AffineDisperserCore.State.Valid.reduction_deleteConstraint,Cslib.Circuits.Boolean.AffineDisperserCore.State.Valid.exists_reduction_deleteAll: deleting deletable constraints.
Deletable constraints #
The children of a parameter fixed to a constant are deletable.
Reductions #
A reduction from S to S': the parameters of F are restricted, the pairs meeting F are
dropped, and the constraints of D are deleted. The children of a remaining parameter lose the
deleted constraints and gain none, unless a deletion of a constraint of T that was one of its
children reroutes to it; and the other constraints stay deletable.
- valid : S'.Valid f
The new state is valid.
- subset : F ⊆ S.params
The restricted names are parameters.
The restricted parameters are removed.
The pairs meeting the restricted parameters are dropped.
The deleted constraints are removed.
- children (u : ℕ) : u ∈ S'.params → S'.children u ⊆ S.children u \ D.toFinset ∨ ∃ N ∈ T, N ∈ S.children u
A remaining parameter gains no child, unless a deletion of
Treroutes to it. The other constraints stay deletable.
A reduction followed by a reduction restricting nothing.
A reduction may record more deletions as possibly rerouting to parameters.
Accounting #
Under a reduction restricting F, S'.a + |F| = S.a + (S.pairsMeeting F).card.
The unpaired parameters after a reduction: the unpaired parameters outside F and the
partners of members of F.
A paired parameter that is not the partner of a member of F stays paired.
A parameter that no deletion of T reroutes to keeps at most its children outside D.
A parameter that no deletion of T reroutes to keeps at most its children outside D.
A parameter all of whose children are deleted, and that no deletion reroutes to, becomes unused.
The potential of a reduction. If every parameter outside F gains at most gain and
loses at least loss in weight, then
W' + cfg.cs * |D| + cfg.cq * k + ∑_{x ∈ F} wt(x) + ∑ loss ≤ W + ∑ gain, where k is the
number of pairs meeting F.
A reduction restricting at most k + 2 parameters (so Δa ≥ -2), and at least one parameter
or constraint, with W' + cfg.ca * |F| ≤ W + cfg.ca * k, is a step of gate elimination.
Generic restriction reduction #
Generic reduction for restricting a parameter x to a constant or to a literal of a remaining
parameter y having at least x's children, given cfg.phiOK and locus preservation.
Deletions #
Deleting a gate is a reduction; it may reroute only to the parameter read by the literal.
Deleting a gate that is constant on admissible equation solutions is a reduction rerouting nothing.
Deleting an equation v = ℓ is a reduction; it may reroute only to the parameter read by the
literal.
In a valid state, an equation whose terms are all parameters has no terms.
The deletion of a constraint used by Valid.reduction_deleteConstraint. A gate is rerouted to
its literal Gate.lit. An equation containing an auxiliary variable is deleted as v = U + rhs,
where v is its least auxiliary variable and U its least other term, or as v = rhs if it has
no other term. An equation without auxiliary variables is dropped.
A deletable constraint of a valid state is deleted by the reduction S.deleteConstraint N.
A deletable constraint of a valid state is deleted by a reduction.
Distinct deletable constraints of a valid state are deleted by a reduction.