Documentation

CslibFrontier.Computability.Circuit.Boolean.AffineDisperser4n.Refuter

Deterministic refuter for 4n - 9d circuits #

The refuter refute takes a full-basis circuit C and a Boolean function f and returns an input. RefuterProofs.lean proves (refute_correct_of_cost_lt, refute_correct) that C and f disagree on that input whenever C.program.cost binaryB2Cost + 9 * d < 4 * n (and hence whenever C.size + 9 * d < 4 * n) and f is a d-affine disperser. The poly(n, 2^d) running time is not formalized here.

refute runs gate elimination from initialState C (ofCircuitBinary C, folding constants and unary gates into literals at zero gate cost). At each state chooseStep? selects one of the cases of State.Valid.exists_step, and applyStep performs the concrete successor that the corresponding lemma proves to be a step (State.deleteConstraint, State.partnersShareChildStep, State.andOnPairStep, …). None of these needs the disperser property. Where the existence proof uses it, chooseStep? stops instead: when the output is a constant, a parameter, an auxiliary variable over no gates, the Case 5a gate (findAndOnPair), or the minimal gate. findCounterexample then searches the 2^d candidate inputs (candidates) of an affine subspace of dimension d on which the output is constant (affine representations of auxiliary variables are computed by dense XORSAT elimination, evaluateAux).

Main definitions #

The step chosen by the refuter.

  • deleteConstantGate (J : ℕ) : StepChoice

    (D1): delete the degenerate gate J.

  • deleteDeadGate (J : ℕ) : StepChoice

    (D2): delete the gate J, which nothing reads.

  • deleteShortEqn (e : ℕ) : StepChoice

    (D3): delete the equation e of at most two terms.

  • deleteUnitParam (x e : ℕ) : StepChoice

    (D4): unit-delete the parameter x, whose only child is the equation e.

  • moveAffine (J : ℕ) : StepChoice

    Move the affine gate J into the affine system.

  • degeneratePair (p : ℕ) : StepChoice

    Case 2: the paired parameter p has degree 0 or at least 2.

  • partnersShareChild (p : ℕ) : StepChoice

    Case 3: p is the first member of a pair whose members share a child.

  • pairInSystem (p : ℕ) : StepChoice

    Case 4: the paired parameter p occurs in an equation.

  • andOnPair (G p : ℕ) : StepChoice

    Case 5a: the non-affine gate G reads the paired parameter p and another parameter.

  • swapAuxIn (G : ℕ) : StepChoice

    Case 5b, preparation: swap an auxiliary argument of the minimal gate G.

  • pairCreation (G : ℕ) : StepChoice

    Case 5b: pair creation on the minimal gate G.

Whether an argument is a gate of S.

Whether a gate is degenerate (Gate.Degenerate): it has a constant argument or two equal arguments.

(D1): the least degenerate gate.

(D2): the least gate that no gate and not the output reads.

(D3): the least equation with at most two terms.

(D4): the least unpaired parameter not read by the output whose only child is an equation, with that equation.

The least affine gate reading no gate.

Case 2: the least paired parameter of degree 0 or at least 2.

Case 3: the least first member of a pair whose members share a child.

Case 4: the least paired parameter occurring in an equation.

Case 5a: the least non-affine gate reading two distinct parameters, one of them paired, with a paired argument.

The step taken by the refuter in S, or none when S is terminal.

The dense XORSAT row of width m of the equation ∑ terms = c.

A strict upper bound on the names of the parameters and auxiliary variables of S: the width of the dense XORSAT systems built by evaluateAux.

The value of a in the solution of the affine system of S extending the parameter values val: false exactly when the system together with a = false is satisfiable.

The affine representation (c, T) of a in the parameters, read off from evaluateAux at the zero assignment and at the unit assignments.

Candidate t of the pairs of p with the partner r, by the low bits of t: bit 2 puts r first, bits 1 and 0 are the biases of the first and the second name.

The candidate pairs of p with the partner r, in the order in which findPair tries them: p first with the four choices of biases, then r first (candidates 0 to 7).

The pair of S containing p, found by searching the possible partners in S.params.

The children of p: the gates reading it, then the equations containing it, in increasing order.

(D4) unit delete of the parameter x with only child the equation e: swap x with the least auxiliary variable whose affine representation contains x, then drop e and x.

A value b of the argument w of a non-affine gate g making g constant, with that constant.

An auxiliary argument a of g with the other argument b.

The reader search of applyStep (Case 5a and pair creation): the least gate of S other than G that reads G.

Apply the step choice to S.

Whether x is the first member of a pair of S.

The parameter values of a terminal state used by findCounterexample: first members of pairs take their bias, the parameters of d_params read A, and the others are false.

The measure decreased by every step of the refuter.

The input Φ(val) for the parameter values σ: every auxiliary variable takes the value of its affine representation over the parameters.

The parameter values searched on a terminal state, one assignment for each list A of d bits, or none when the terminal state has no search.

The candidate inputs of the final search of a terminal state: candidatePoint of each of the 2^d parameter assignments of candidateFamily, in the order of allAssignments d. This list is the specification of the search; findCounterexample does not build it.

The first candidate of a terminal state on which C and f disagree. Each candidate is built only when it is tried, and the search stops at the first disagreement.

Apply refuter steps until a terminal state is reached or fuel runs out, and add the number of steps applied to steps.

Apply refuter steps until a terminal state is reached or fuel runs out.

The refuter: run gate elimination from the initial state of C, then search the terminal state for an input on which C and f disagree.