Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.GroupProgram.GroupScript

The script of a group #

The evaluator of [Ant26] computes the value of a group of parties after the moves of a plan (Cut.Plan.groupValue) by the program GROUP, at a script (groupScript) that lists, in order:

A copy of a unit at a party is a cell (Cell); the script puts the cell c at the key key c of the trie of GROUP, and the second copy of unit k from the base party p to itself at the key dkey (p, k).

Main definitions #

Main results #

References #

From VP ≠ VNP over every field [Ant26], Appendix J.3: the evaluator described in the proof of Theorem J.3 (the theorem on p. 53, the evaluator on p. 54). Ported from the source module Nc.Grp.Script (its script half) and Nc.Grp.GrpSteps.

structure Cslib.Circuits.Arithmetic.Separation.GroupProgram.Cell {F : Type u_1} [CommSemiring F] {A' E K : ℕ} (M : Cut.Moves F (K + K + A') E) (U0 U1 : ℕ) :

A cell: the copy of a unit at a party.

Instances For
    def Cslib.Circuits.Arithmetic.Separation.GroupProgram.Cell.equivProd {F : Type u_1} [CommSemiring F] {A' E K : ℕ} (M : Cut.Moves F (K + K + A') E) (U0 U1 : ℕ) :
    Cell M U0 U1 ≃ Fin (K + K + A') × Cut.UnitId (K + K) U0 M.Channel U1

    A cell as the pair of its party and its unit.

    @[instance_reducible]
    instance Cslib.Circuits.Arithmetic.Separation.GroupProgram.instDecidableEqCell {F : Type u_1} [CommSemiring F] {A' E K : ℕ} (M : Cut.Moves F (K + K + A') E) (U0 U1 : ℕ) :
    DecidableEq (Cell M U0 U1)
    @[instance_reducible]
    instance Cslib.Circuits.Arithmetic.Separation.GroupProgram.instFintypeCell {F : Type u_1} [CommSemiring F] {A' E K : ℕ} (M : Cut.Moves F (K + K + A') E) (U0 U1 : ℕ) :
    Fintype (Cell M U0 U1)
    def Cslib.Circuits.Arithmetic.Separation.GroupProgram.baseParties {A' K : ℕ} {G : Type u_2} [DecidableEq G] (grp : Fin (K + K + A') → G) (g : G) :
    List (Fin (K + K))

    The base parties of the group g, in their order.

    theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.mem_baseParties {A' K : ℕ} {G : Type u_2} [DecidableEq G] {grp : Fin (K + K + A') → G} {g : G} {p : Fin (K + K)} :
    p ∈ baseParties grp g ↔ grp (Fin.castAdd A' p) = g
    theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.nodup_baseParties {A' K : ℕ} {G : Type u_2} [DecidableEq G] (grp : Fin (K + K + A') → G) (g : G) :
    theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.baseParties_eq_filter {A' K : ℕ} {G : Type u_2} [DecidableEq G] (grp : Fin (K + K + A') → G) (g : G) :
    baseParties grp g = List.filter (fun (p : Fin (K + K)) => decide (grp (Fin.castAdd A' p) = g)) (List.finRange (K + K))

    The base parties of the group g are the base parties in g, in their order.

    All roles of all moves, in the order of the moves.

    The roles of all moves are distinct, and listed in the order of the moves.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.GroupProgram.groupRoles {F : Type u_1} [CommSemiring F] {A E : ℕ} {G : Type u_2} [DecidableEq G] (grp : Fin A → G) (g : G) (M : Cut.Moves F A E) :

    The roles of the group g, in the order of the moves.

    theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.groupRoles_eq_filter {F : Type u_1} [CommSemiring F] {A E : ℕ} {G : Type u_2} [DecidableEq G] (grp : Fin A → G) (g : G) (M : Cut.Moves F A E) :
    groupRoles grp g M = List.filter (fun (r : M.Role) => decide (grp (M.roleParty r) = g)) (allRoles M)

    The roles of the group g are the roles whose party is in g, in the order of allRoles.

    theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.mem_groupRoles {F : Type u_1} [CommSemiring F] {A E : ℕ} {G : Type u_2} [DecidableEq G] {grp : Fin A → G} {g : G} {M : Cut.Moves F A E} {r : M.Role} :
    r ∈ groupRoles grp g M ↔ grp (M.roleParty r) = g
    theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.pairwise_groupRoles {F : Type u_1} [CommSemiring F] {A E : ℕ} {G : Type u_2} [DecidableEq G] (grp : Fin A → G) (g : G) (M : Cut.Moves F A E) :
    List.Pairwise (fun (r r' : M.Role) => r ≠ r' ∧ r.fst ≤ r'.fst) (groupRoles grp g M)
    theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.nodup_groupRoles {F : Type u_1} [CommSemiring F] {A E : ℕ} {G : Type u_2} [DecidableEq G] (grp : Fin A → G) (g : G) (M : Cut.Moves F A E) :
    (groupRoles grp g M).Nodup

    The indices below m, for m ≤ U, in increasing order: the numbers of the first m units of a string.

    The flag of the partner b in a row with the data d: 0 for every partner if the party writes nothing, and otherwise 1 for the first and the last partner, 2 for a partner strictly between them, and 0 for the others.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.GroupProgram.baseBody {F : Type} [CommRing F] {S : Type} [Fintype S] {A' E K U0 U1 : ℕ} {M : Cut.Moves F (K + K + A') E} (ρ : Option S → Fin (K + K) → Cut.RowData (K + K)) (n : Fin (K + K) → Fin (K + K) → Fin (U0 + 1)) (key : Cell M U0 U1 → List Bool) (dkey : Fin (K + K) × Fin U0 → List Bool) (p : Fin (K + K)) :

    The body of the instruction of the base party p: for every tape, the flags of the partners in its row, the last partner first; for every partner b, the keys of the copies at p of the first n p b units of the string from p to b, and those of the first n b p units of the string from b to p, where the units from p to itself are read at the keys dkey.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.GroupProgram.baseInstructions {F : Type} [CommRing F] {Γ S : Type} [Fintype S] {A' E K U0 U1 c : ℕ} {M : Cut.Moves F (K + K + A') E} {Q : Type} (qn : Q → ℕ) (cb : Option Γ → Fin c → Bool) (q : Fin (K + 1) → Q) (x : Fin K → List Γ) (ρ : Option S → Fin (K + K) → Cut.RowData (K + K)) (n : Fin (K + K) → Fin (K + K) → Fin (U0 + 1)) (key : Cell M U0 U1 → List Bool) (dkey : Fin (K + K) × Fin U0 → List Bool) (p : Fin (K + K)) :

    The instructions of the base party p: the block from the state q κ to the state q (κ + 1) (numbered by qn) for the block κ, or the input part x κ with the codes cb of the letters, in reverse order, for the input party κ; then the comparisons of the two copies of the units from p to itself.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.GroupProgram.roleInstruction {F : Type} [CommRing F] {A' E K U0 U1 : ℕ} {M : Cut.Moves F (K + K + A') E} (P : Cut.Plan M U0 U1) (n : Fin (K + K) → Fin (K + K) → Fin (U0 + 1)) (o : M.Channel → Fin U1) (key : Cell M U0 U1 → List Bool) (tg : M.Role → ℕ) (r : M.Role) :

    The instruction of the role r, number tg r in a list of roles of laws: for every slot, the keys of the units given, in reverse order, and for every channel the keys of its new units at the party of the role.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.GroupProgram.endInstructions {F : Type} [CommRing F] {A' E K U0 U1 ub : ℕ} {G : Type} [DecidableEq G] {M : Cut.Moves F (K + K + A') E} (P : Cut.Plan M U0 U1) (n : Fin (K + K) → Fin (K + K) → Fin (U0 + 1)) (o : M.Channel → Fin U1) (grp : Fin (K + K + A') → G) (g : G) (key : Cell M U0 U1 → List Bool) (b : Cut.UnitId (K + K) U0 M.Channel U1 → Cut.UnitContent ub) :

    The instructions of the end, for every current unit in the end that the group g holds: the copies at its two holders agree if both are in the group, and the copy at the holder in the group has the bits of the unit b if only one is.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.GroupProgram.groupScript {F : Type} [CommRing F] {Γ S : Type} [Fintype S] {A' E K U0 U1 ub c : ℕ} {G : Type} [DecidableEq G] {M : Cut.Moves F (K + K + A') E} {Q : Type} (qn : Q → ℕ) (cb : Option Γ → Fin c → Bool) (P : Cut.Plan M U0 U1) (q : Fin (K + 1) → Q) (x : Fin K → List Γ) (ρ : Option S → Fin (K + K) → Cut.RowData (K + K)) (n : Fin (K + K) → Fin (K + K) → Fin (U0 + 1)) (o : M.Channel → Fin U1) (grp : Fin (K + K + A') → G) (g : G) (key : Cell M U0 U1 → List Bool) (dkey : Fin (K + K) × Fin U0 → List Bool) (tg : M.Role → ℕ) (b : Cut.UnitId (K + K) U0 M.Channel U1 → Cut.UnitContent ub) :

    The script of a group: the instructions of its base parties, of its roles and of the end.