Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Dealing.Templates

The templates of the scripts #

In the end, the dealing program of [Ant26] writes the script of every group by filling a template (Interpreter.Tm) from its state (Codes.scriptTm). The template lists, in the order of groupScript, the instructions of the base parties, of the roles and of the end; an instruction is in the script if the group of its party, a step of the straight-line program, has the number of the group, and a unit is compared in the end if it is current. If the state has the values that the dealing program computes (Final), the filled template is the script of the group (expand_scriptTm). The templates of lists and of conditional lists expand to lists (expand_listTm, toList_expand_ifTm).

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 writes for each piece its script). Ported from the source module Nc.Dl.Scr.

A template of a list: its expansion is the list of the expansions.

A template of a concatenation: its expansion is the concatenation of the expansions, which are lists.

The template a if the value at p is t, and the empty list otherwise.

def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.valueTm {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) (x : PlanName S M U0 U1 pS) :

The template of the value at a name.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.bodyTm {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) (p : Fin (K + K)) :

The template of the body of the base party p (baseBody).

noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.baseTm {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) (p : Fin (K + K)) :

The template of the block or of the input part of the base party p.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.basesTm {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) (p : Fin (K + K)) :

The template of the instructions of the base party p (baseInstructions).

noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.slotTm {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) (hD : 1 < D) (z : M.Slot) (a : Fin (K + K + A')) :

The template of the keys at the party a of the units given at the slot z, in reverse order: the units whose step of givenGate is the digit 1.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.roleTm {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) (tg : M.Role → ℕ) (hD : 1 < D) (r : M.Role) :

The template of the instruction of the role r (roleInstruction), number tg r in a list of roles of laws.

def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.fixedTm {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) (k : List Bool) (u : Cut.UnitId (K + K) U0 M.Channel U1) :

The template of the comparison of the contents at the key k with the contents of the unit u.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.endTm {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) (hD : 1 < D) (hmm : mm ≤ D) (g : Fin mm) (u : Cut.UnitId (K + K) U0 M.Channel U1) :

The template of the instructions of the end for the unit u and the group g (endInstructions).

noncomputable def Cslib.Circuits.Arithmetic.Separation.Dealing.Codes.scriptTm {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) (tg : M.Role → ℕ) (bT bub : List Bool) (hD : 1 < D) (hmm : mm ≤ D) (g : Fin mm) :

The template of the script of the group g (groupScript), with the binary numbers bT of steps and bub of bits of a unit.

structure Cslib.Circuits.Arithmetic.Separation.Dealing.Final {F : Type} [CommSemiring F] {K A' E U0 U1 D nI pS mm ub : ℕ} {M : Cut.Moves F (K + K + A') E} {S Q : 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) (qn : Q → ℕ) (pt : Fin K → 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) (b : Cut.UnitId (K + K) U0 M.Channel U1 → Cut.UnitContent ub) (st : PlanName S M U0 U1 pS → Interpreter.Tree) :

The values of the dealing program in the end that the templates of the scripts read, for the parts pt of the input, the states q between the blocks (numbered by qn), the row data ρ, the numbers of units n, the outcomes o and the contents b of the units.

theorem Cslib.Circuits.Arithmetic.Separation.Dealing.expand_scriptTm {F : Type} [CommRing F] {K A' E U0 U1 D nI pS mm ub c : ℕ} {M : Cut.Moves F (K + K + A') E} {Γ S Q : 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} {qn : Q → ℕ} {pt : Fin K → 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} {b : Cut.UnitId (K + K) U0 M.Channel U1 → Cut.UnitContent ub} {st : PlanName S M U0 U1 pS → Interpreter.Tree} {hD : 1 < D} {hmm : mm ≤ D} (h : Final C tab qn pt q ρ n o b st) {cb : Option Γ → Fin c → Bool} {x : Fin K → List Γ} (hpt : ∀ (κ : Fin K), pt κ = GroupProgram.wordsEnc (List.map (GroupProgram.letterCode cb) (x κ)).reverse) (tg : M.Role → ℕ) (bT bub : List Bool) (g : Fin mm) :
Interpreter.Tm.expand (Function.extend C.name st fun (x : List Bool) => Interpreter.Tree.nil) (C.scriptTm tab tg bT bub hD hmm g) = GroupProgram.scriptEnc bT bub (GroupProgram.groupScript qn cb P q x ρ n o (grp { counts := n, outcomes := o }) g C.key C.dkey tg b)

The script of a group. If the state by names st has the values of the dealing program in the end (Final), and the parts pt of the input are the codes of the letters of x, then the template of the script of the group g gives its script groupScript.