Documentation

CslibFrontier.Algorithms.WordRAM.Refuter4n.PackedStep

Packed steps of the 4n - 9d refuter #

Steps of the refuter applyStep (Cslib.Circuits.Boolean.AffineDisperser4n) on the packed state PackedState, built from the packed primitive operations of PackedOps, and proved to represent the state step (Rep). This is the pure layer of the step programs of issue #4322 (Milestone 4); no program and no running time is claimed here.

The searches of a step read only words. A least name with a property is the ascending scan of List.range N (find?_range_eq_min').

Main definitions #

Main results #

Least names #

theorem Cslib.Algorithms.WordRAM.Refuter4n.find?_range_eq_min' {s : Finset ℕ} {N : ℕ} (hs : ∀ i ∈ s, i < N) (h : s.Nonempty) :
List.find? (fun (i : ℕ) => decide (i ∈ s)) (List.range N) = some (s.min' h)

The ascending scan of List.range N finds the least element of a nonempty set of names below N.

The literal of a degenerate gate row #

The literal codes (argCode, neg) of Gate.lit computed from a gate row.

Gate rows reading a name #

The gate row reads the name G: one of its two argument codes is the node code G + 2.

Deleting a constraint #

State.deleteConstraint of the equation e on the packed state: delete e through its least auxiliary term v and its least other term (the constant right-hand side of e if there is none), or drop e if it has no auxiliary term.

Gates reading a gate #

The least gate other than G reading G, scanned on the gate mask and the gate rows (rowReads).

Pair creation #

Case 5b, pair creation on the gate G (applyStep of .pairCreation G): add the pair of its two arguments with the biases making the gate constant, delete G as that constant, and delete the least other gate reading G. If an argument of G is a constant or no other gate reads G, the state is unchanged, as in applyStep.

Pairs and children #

findPair on the packed state: the candidate pairs pairCandidates of findPair, a pair being present when its record is in the pair list.

getChildren on the packed state: the gates whose row reads p (rowReads), then the alive equations whose word has bit p, in increasing order.

Constraints after a deletion #

A constant literal reads nothing.

theorem Cslib.Algorithms.WordRAM.Refuter4n.forall_reads_node {p : ℕ → Prop} {t : ℕ} (ht : p t) (c : Bool) (y : ℕ) :
{ arg := Circuits.Boolean.SemiCircuit.Arg.node t, neg := c }.Reads y → p y

The literal of a node reads only that node.

theorem Cslib.Algorithms.WordRAM.Refuter4n.elim_mem_of_mem_children {n : ℕ} {S : Circuits.Boolean.AffineDisperser4n.State n} {p : ℕ} {c : ℕ ⊕ ℕ} (hc : c ∈ S.children p) :
Sum.elim (fun (x : ℕ) => x ∈ S.gates) (fun (x : ℕ) => x ∈ S.eqns) c

A child of a name is a constraint of the state: a gate or an equation.

Deleting one constraint keeps every other constraint.

Deleting a constraint preserves boundedness.

Case 2 #

Case 2, a paired parameter p of degree 0 or at least 2 (applyStep of .degeneratePair p): fix the partner of p if p is unused, and otherwise fix p to its bias and delete its first two children.

The fresh equation name #

State.freshEqn on the packed state: one more than the largest alive equation name below E, or 0.

Bit i of the gate mask is membership of i in the gates.

Bit i of the auxiliary mask is membership of i in the auxiliary variables.

Bit i of the parameter mask is membership of i in the parameters.

The alive flag of the equation word e is membership of e in the equations, at every e (also beyond the table).

The packed reader search is the reader search findReader of applyStep.

The packed fresh equation name is State.freshEqn.

Deleting a constraint. On a bounded represented state, pDeleteConstraint represents State.deleteConstraint of a gate or of an equation of a bounded state.

Steps #

Moving an affine gate. Moving the gate J of a represented state into the affine system under the fresh equation name, when that name is below E.

A pair record is in the pair list iff its pair is a pair of the state.

The packed children of a name below N are getChildren.

The packed degree of a name below N is its degree.

In a valid represented state, the partner of any name in a pair is below N.

Case 2. On a valid represented state, for a name p below N, the packed Case 2 represents applyStep of .degeneratePair p.

Pair creation. On a bounded represented state, for a gate G whose first argument is the first member of no pair, the packed pair creation represents applyStep of .pairCreation G.