Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Dealing.Runs

The runs of the dealing program #

After its choices (Codes.choiceSteps), the dealing program of [Ant26] computes deterministically: it checks the row data of every row against the row before (Codes.rowCheckSteps), runs the straight-line program on the numbers of units and the outcomes (Codes.gateSteps), and reads off as trees the numbers of units of the moves, the conditions and whether the units are cut (Codes.readOutSteps). It then rejects unless the row data are valid, the numbers of units valid and the outcomes good (Codes.checkSteps); these are the steps of Codes.dealSteps. The sum over the states after them is the sum over the choices that pass the checks, at states with the values of the end (Final, with no contents yet) that the templates of the scripts read (sum_execAll_dealSteps).

Main definitions #

Main results #

References #

From VP ≠ VNP over every field [Ant26], Appendix J.3: the program G in the proof of Theorem J.3 (p. 54: it rejects unless ρ is valid, the numbers give every node at most N packets, and all outcomes are good; it computes by the binary operations). Ported from the source modules Nc.Dl.Run, Nc.Dl.Run2 and Nc.Dl.Total.

The row data d are those of a row of a staircase after a row whose last party is h, as in ValidRow.

Instances For
    def Cslib.Circuits.Arithmetic.Separation.Dealing.inputName {F : Type} [CommSemiring F] {K A' E U0 U1 pS : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} :
    Fin (K + K) × Fin (K + K) ⊕ M.Channel → PlanName S M U0 U1 pS

    The name that an input of the straight-line program reads: a number of units or an outcome, as a digit.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.rowCheckStep {F : Type} [CommSemiring F] {K A' E U0 U1 D pS : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} (C : Codes S M U0 U1 D pS) (s : Option S) (p : Fin (K + K)) :

    The check of the row data of the party p on the tape s against the last party of the row before (0 for the first row).

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.rowCheckSteps {F : Type} [CommSemiring F] {K A' E U0 U1 D pS : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} [Fintype S] (C : Codes S M U0 U1 D pS) :

    Phase 5: the checks of all rows.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.gateStep {F : Type} [CommSemiring F] {K A' E U0 U1 D nI pS mm : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} (C : Codes S M U0 U1 D pS) {P : Cut.Plan M U0 U1} {grp : PlanInput M U0 U1 → Fin (K + K + A') → Fin mm} (tab : SlpTab P grp D nI pS) (k : Fin pS) :

    Step k of the straight-line program: it reads an input, writes a constant, or applies an operation to two earlier steps (and writes the empty value in no other case, since tab is a straight-line program).

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.gateSteps {F : Type} [CommSemiring F] {K A' E U0 U1 D nI pS mm : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} (C : Codes S M U0 U1 D pS) {P : Cut.Plan M U0 U1} {grp : PlanInput M U0 U1 → Fin (K + K + A') → Fin mm} (tab : SlpTab P grp D nI pS) :

    Phase 6: the straight-line program.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.readOutStep {F : Type} [CommSemiring F] {K A' E U0 U1 D nI pS mm : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} (C : Codes S M U0 U1 D pS) {P : Cut.Plan M U0 U1} {grp : PlanInput M U0 U1 → Fin (K + K + A') → Fin mm} (tab : SlpTab P grp D nI pS) :

    A read-out: the number of units of the move x as a number, and a condition or whether the unit u is cut as a bit.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.readOutSteps {F : Type} [CommSemiring F] {K A' E U0 U1 D nI pS mm : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} (C : Codes S M U0 U1 D pS) {P : Cut.Plan M U0 U1} {grp : PlanInput M U0 U1 → Fin (K + K + A') → Fin mm} (tab : SlpTab P grp D nI pS) :

    Phase 7: the read-outs.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.checkSteps {F : Type} [CommSemiring F] {K A' E U0 U1 D pS : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} [Fintype S] (C : Codes S M U0 U1 D pS) :

    Phase 8: reject unless all rows are valid and all conditions hold.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.dealSteps {F : Type} [CommSemiring F] {K A' E U0 U1 D nI pS mm : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} [Fintype S] (C : Codes S M U0 U1 D pS) {P : Cut.Plan M U0 U1} {grp : PlanInput M U0 U1 → Fin (K + K + A') → Fin mm} (tab : SlpTab P grp D nI pS) {Q : Type} [Fintype Q] (qn : Q → ℕ) (i e : Q) (hU0 : U0 < D) (hU1 : U1 ≤ D) :

    The steps of the dealing program up to its checks: the choices, the checks of the rows, the straight-line program, the read-outs and the checks.

    The deterministic phases #

    All runs #

    theorem Cslib.Circuits.Arithmetic.Separation.Dealing.sum_execAll_dealSteps {F : Type} [CommSemiring F] {K A' E U0 U1 D nI pS mm : ℕ} {M : Cut.Moves F (K + K + A') E} {S : Type} [Fintype S] [DecidableEq S] (C : Codes S M U0 U1 D pS) {P : Cut.Plan M U0 U1} {grp : PlanInput M U0 U1 → Fin (K + K + A') → Fin mm} (tab : SlpTab P grp D nI pS) {m : ℕ} {Q : Type} [Fintype Q] [DecidableEq Q] (pt : Fin K → Interpreter.Tree) (qn : Q → ℕ) (hU0 : U0 < D) (hU1 : U1 ≤ D) [DecidablePred tab.Valid] [(n : Fin (K + K) → Fin (K + K) → Fin (U0 + 1)) → (o : M.Channel → Fin U1) → (x : Fin E) → Decidable (P.Good n o x)] (hK : 0 < K) (i e : Q) :
    ∃ (st : (Fin (K + 1) → Q) → (Option S → Fin (K + K) → Cut.RowData (K + K)) → (Fin (K + K) → Fin (K + K) → Fin (U0 + 1)) → (M.Channel → Fin U1) → PlanName S M U0 U1 pS → Interpreter.Tree), (∀ (q : Fin (K + 1) → Q) (ρ : Option S → Fin (K + K) → Cut.RowData (K + K)) (n : Fin (K + K) → Fin (K + K) → Fin (U0 + 1)) (o : M.Channel → Fin U1), Final C tab qn pt q ρ n o (fun (x : Cut.UnitId (K + K) U0 M.Channel U1) => none) (st q ρ n o) ∧ ∀ (u : Cut.UnitId (K + K) U0 M.Channel U1), st q ρ n o (Name.isCut u) = Interpreter.Tree.bit (decide (u ∈ Play.cutUnits (Cut.UnitId.holder M.channelParty) (grp { counts := n, outcomes := o }) (P.cur n o E)))) ∧ ∀ (B : Type) [inst : CommRing B] (Φ : (List Bool → Interpreter.Tree) → B), (List.map Φ (Interpreter.execAll m (C.dealSteps tab qn i e hU0 hU1) (Function.extend C.name (initialState pt) fun (x : List Bool) => Interpreter.Tree.nil))).sum = ∑ q : Fin (K + 1) → Q, if q 0 = i ∧ q (Fin.last K) = e then ∑ ρ : Option S → Fin (K + K) → Cut.RowData (K + K), ∑ n : Fin (K + K) → Fin (K + K) → Fin (U0 + 1), ∑ o : M.Channel → Fin U1, if Cut.ValidRows ρ ∧ tab.Valid n ∧ ∀ (x : Fin E), P.Good n o x then Φ (Function.extend C.name (st q ρ n o) fun (x : List Bool) => Interpreter.Tree.nil) else 0 else 0

    The runs of the dealing program up to its checks. There are states st q ρ n o with the values of the end (Final, with empty contents) and the bits that say which units are cut, such that the sum over the states after Codes.dealSteps, from the parts pt of the input, is the sum over the states q between the blocks from i to e, the row data ρ, the numbers of units n and the outcomes o that pass the checks, at the states st q ρ n o.