Fair semi-circuits over the full binary basis #
Following Mishra and Santhanam, Section 2.3, a fair semi-circuit is an
affine system of equations over 𝔽₂ followed by an acyclic circuit over the full binary basis
B₂. Its internal values are parameters, auxiliary variables and gates, all named by
natural numbers. The affine system consists of equations ∑ terms = rhs in the parameters and
auxiliary variables, each with at most three terms; it is fair when every assignment to the
parameters extends to exactly one assignment of the auxiliary variables satisfying all equations
(SemiCircuit.WellFormed.solvable, SemiCircuit.WellFormed.unique), which is equivalent to the
invertibility of the auxiliary matrix of the source. Each gate applies an arbitrary operation
Bool → Bool → Bool to two arguments, each a constant or an internal value with a smaller name,
so the order of names is a topological order. The output is a literal.
Equations are named separately from internal values. A child of an internal value t is a gate
reading t or an equation containing t (SemiCircuit.children); a gate reading t twice is a
single child. The degree of t is its number of children (SemiCircuit.deg).
Rerouting replaces every occurrence of an internal value v by a literal
(SemiCircuit.subst), absorbing negations into the operations of gates and the right-hand sides
of equations. It preserves the value of every gate and the truth of every equation on assignments
giving v the value of the literal (Gate.eval_subst, Equation.holds_subst), and it changes no
child of any value other than v and the target of the literal (SemiCircuit.children_subst).
A gate with a constant argument or two equal arguments is degenerate and computes a constant or
a literal of an argument (Gate.eval_lit). Of the sixteen operations of B₂, the affine ones
(IsAffineOp) have no product term; every other operation has the form (a + α)(b + β) + γ
(exists_and_form). An affine gate whose arguments are parameters or auxiliary variables can be
moved into the affine system as an equation (affEqn_holds).
Main definitions #
Cslib.Circuits.Boolean.SemiCircuit: semi-circuits, withSemiCircuit.Consistentassignments,SemiCircuit.WellFormed,SemiCircuit.children,SemiCircuit.degandSemiCircuit.size(building onSemiCircuit.Lit,SemiCircuit.GateandSemiCircuit.IsAffineOpinComplexity/Computability/Circuit/Boolean/SemiCircuit/Gate.lean, andSemiCircuit.EquationinComplexity/Computability/Circuit/Boolean/SemiCircuit/Equation.lean).Cslib.Circuits.Boolean.SemiCircuit.subst: rerouting an internal value to a literal.Cslib.Circuits.Boolean.SemiCircuit.AffineIn,Cslib.Circuits.Boolean.SemiCircuit.LiftsTo: affine dependence on the parameters and lifting consistent assignments.
Main results #
Cslib.Circuits.Boolean.SemiCircuit.consistent_subst,Cslib.Circuits.Boolean.SemiCircuit.consistent_of_subst: rerouting preserves consistency.Cslib.Circuits.Boolean.SemiCircuit.children_subst: rerouting changes no other children.Cslib.Circuits.Boolean.SemiCircuit.WellFormed.exists_affineIn: on the solutions of the affine system, every auxiliary variable is an affine function of the parameters.
References #
Semi-circuits #
A semi-circuit: parameters, auxiliary variables and gates named by natural numbers, the gates
and the equations of the affine system, and an output literal. Only the gates in gates and the
equations in eqns belong to the semi-circuit; gate and eqn are arbitrary elsewhere.
The parameters.
The auxiliary variables of the affine system.
The gates of the acyclic part.
The gate with each name.
The names of the equations of the affine system.
The equation with each name.
- out : Lit
The output.
Instances For
The internal values: parameters, auxiliary variables and gates.
Instances For
All equations of the affine system hold.
Instances For
Every gate has the value of its operation on its arguments.
Instances For
A consistent assignment of the internal values satisfies every equation and every gate.
Instances For
The size: the number of gates plus the number of equations.
Instances For
The gates reading t.
Instances For
The equations containing t.
Instances For
The children of t: the gates reading it (on the left) and the equations containing it (on
the right).
Instances For
The degree of t: its number of children.
Instances For
A semi-circuit is well formed when its roles are disjoint, gates read constants or internal values (gates only with smaller names), equations have at most three terms among the parameters and auxiliary variables, the output reads a constant or an internal value, and the affine system is fair: every assignment of the parameters extends to a solution, whose auxiliary values are unique.
Parameters and auxiliary variables are distinct.
Parameters and gates are distinct.
Auxiliary variables and gates are distinct.
A gate reads only gates with smaller names.
A gate reads only constants and internal values.
Equations contain only parameters and auxiliary variables.
Every equation has at most three terms.
The output reads a constant or an internal value.
Every assignment of the parameters extends to a solution of the affine system.
- unique (val val' : ℕ → Bool) : (∀ j ∈ C.params, val j = val' j) → C.EqnsHold val → C.EqnsHold val' → ∀ v ∈ C.aux, val v = val' v
The solution determines the auxiliary variables (fairness).
Instances For
Gates do not occur in equations.
A gate does not read itself.
Rerouting #
Reroute the internal value v to the literal ℓ in every gate, equation and the output.
Instances For
Solutions of the affine system #
Every assignment of the parameters of a well-formed semi-circuit extends to a consistent assignment of all internal values: solve the affine system, then evaluate the gates in the order of their names.
On the solutions of the affine system, the internal value t is the affine function
c + ∑ j ∈ T, u j of the parameters u.
Instances For
Every parameter is an affine function of the parameters.
The affine expression of an internal value in the parameters is unique.
Affine functions of finitely many bits #
A function of bits that depends only on the coordinates in M and preserves sums of three
points is affine: a constant plus the sum of the coordinates in some T ⊆ M.
Every auxiliary variable of a well-formed semi-circuit is an affine function of the parameters on the solutions of the affine system.
An auxiliary variable can depend only on parameters occurring in the affine system.
A parameter occurring in the affine system is a summand of some auxiliary variable.
Changing unread values #
Changing the value of a name that no gate or equation reads and that is not a gate keeps consistency.
After rerouting x, which is not a gate, to a literal not reading it, a consistent assignment
gives a consistent assignment of the original semi-circuit once x takes the value of the
literal.
Lifting consistent assignments #
Every consistent assignment of C' agrees on the parameters of C with a consistent
assignment of C having the same output.