Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.GroupProgram.RoleSums

The instructions of a role do what its step does #

The program GROUP of [Ant26] keeps the contents of the cells of a group in a trie (Stores). Its instructions simulate a step of the group (Simulates) if, from a trie that stores some contents, their weighted list of tries is the sum over the choices of the step of its weight times the trie of the contents that it writes.

This file has what the instructions of base parties and of roles share: writing strings closed by the bit 1 at the keys of lists of cells (putStrings_spec) and comparisons (scriptSem_of_checks); and the simulation of the step of a role by its instruction (simulates_role), through the runs of the transducer of the role.

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 modules Nc.Grp.PutSum, Nc.Grp.SumPut, Nc.Grp.SumRole and Nc.Grp.StepRole.

def Cslib.Circuits.Arithmetic.Separation.GroupProgram.Stores {F : Type} [CommRing F] {A' E K U0 U1 : ℕ} {M : Cut.Moves F (K + K + A') E} (ub : ℕ) (key : Cell M U0 U1 → List Bool) (t : Interpreter.Tree) (σ : Cell M U0 U1 → Cut.UnitContent ub) :

The trie t stores the contents σ of the cells at the keys key: its entries are units of at most ub bits, and the entry at the key of a cell has the bits of its contents.

theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.Stores.nil {F : Type} [CommRing F] {A' E K U0 U1 ub : ℕ} {M : Cut.Moves F (K + K + A') E} (key : Cell M U0 U1 → List Bool) :
Stores ub key Interpreter.Tree.nil fun (x : Cell M U0 U1) => none
def Cslib.Circuits.Arithmetic.Separation.GroupProgram.Simulates {F : Type} [CommRing F] (θ : List Bool → F) {Γ S Q : Type} [Fintype Γ] [Fintype S] [DecidableEq S] [Fintype Q] {A' E K U0 U1 ub c : ℕ} {M : Cut.Moves F (K + K + A') E} (mu : Tape.Letter S Unit Γ → Matrix Q Q F) (cb : Option Γ → Fin c → Bool) (kinds : List ((L : Cut.Law F) × L.Role)) (T : ℕ) (key : Cell M U0 U1 → List Bool) (I : List Instruction) (s : WriteStep F (Cell M U0 U1) (Cut.UnitContent ub)) :

The instructions I simulate the step s: from a trie that stores the contents σ, the weighted sum of Ψ over the tries after the instructions is the sum over the choices of the step of its weight times Ψ' at the contents after it, whenever Ψ and Ψ' agree at tries and the contents that they store.

Writing strings #

theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.putStrings_spec {ub : ℕ} {α : Type u_1} [DecidableEq α] {κ : α → List Bool} (hκ : Function.Injective κ) (hub : 0 < ub) {v : α → Cut.UnitContent ub} (W : List (List α × List Bool)) :
(List.flatMap Prod.fst W).Nodup → (∀ w ∈ W, ∀ (i : ℕ) (h : i < w.1.length), v w.1[i] = Cut.unitsOf ub w.2 i) → ∀ (t : Interpreter.Tree), ∃ (t' : Interpreter.Tree), ((∀ w ∈ W, Cut.unitCount ub w.2 = w.1.length) → (StoreBound ub t → StoreBound ub t') ∧ ∀ (a : α), Interpreter.tget (κ a) t' = if a ∈ List.flatMap Prod.fst W then Interpreter.Tree.ofBits (v a).bits else Interpreter.tget (κ a) t) ∧ putStrings ub (List.map (fun (w : List α × List Bool) => List.map κ w.1) W) (List.map (fun (w : List α × List Bool) => w.2 ++ [true]) W) t = if ∀ w ∈ W, Cut.unitCount ub w.2 = w.1.length then [t'] else []

Writing strings, closed by the bit 1, at the keys of lists of items. If every string has as many units as its list has items, there is one trie after writing, at the key of an item written it has the unit of the item, and at the keys of the other items it is unchanged; otherwise there is none.

Writing strings closed by the bit 1 gives a trie only if every string has as many units as keys.

For units of positive width, a unit is determined by its bits, as a tree.

Comparisons #

theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.scriptSem_of_checks {F : Type} [CommRing F] {θ : List Bool → F} {Γ S Q : Type} [Fintype Γ] [Fintype S] [DecidableEq S] [Fintype Q] {ub c : ℕ} (mu : Tape.Letter S Unit Γ → Matrix Q Q F) (cb : Option Γ → Fin c → Bool) (kinds : List ((L : Cut.Law F) × L.Role)) (T : ℕ) {l : List Instruction} {t : Interpreter.Tree} (P : Instruction → Prop) [DecidablePred P] (h : ∀ i ∈ l, instructionSem θ mu cb kinds T ub i t = if P i then [(1, t)] else []) :
scriptSem θ mu cb kinds T ub l t = if ∀ i ∈ l, P i then [(1, t)] else []

A list of comparisons, each of which keeps the trie if it holds and rejects otherwise, keeps the trie if all hold and rejects otherwise.

Roles #

theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.exists_of_mem_run_roleTable {F : Type} [CommRing F] {θ : List Bool → F} (L : Cut.Law F) (p : L.Role) {B : ℕ} {s : Transducer.State 1 (slotList L p).length (channelList L p).length Bool} {q : F × Transducer.State 1 (slotList L p).length (channelList L p).length Bool} :
q ∈ Transducer.run θ (roleTable θ L p) B s → ∃ (ι : Fin B → L.Index), ∀ (i : Fin (channelList L p).length), (q.2.outputs i).length = ∑ k : Fin B, (L.labelLength + L.length (ι k) ↑((channelList L p).get i)) + (s.outputs i).length

What a run of the transducer of a role adds to a channel has, for some indices of the law for all blocks, the length of the labels and the strings of the indices on the channel.

theorem Cslib.Circuits.Arithmetic.Separation.GroupProgram.simulates_role {F : Type} [CommRing F] {θ : List Bool → F} {Γ S Q : Type} [Fintype Γ] [Fintype S] [DecidableEq S] [Fintype Q] {A' E K U0 U1 ub c : ℕ} {M : Cut.Moves F (K + K + A') E} (mu : Tape.Letter S Unit Γ → Matrix Q Q F) (cb : Option Γ → Fin c → Bool) (kinds : List ((L : Cut.Law F) × L.Role)) (T : ℕ) {G : Type} [DecidableEq G] {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} {tg : M.Role → ℕ} (hkey : Function.Injective key) (hub : 0 < ub) {r : M.Role} (hr : grp (M.roleParty r) = g) (hkind : kinds[tg r]? = some ⟨M.law r.fst, r.snd⟩) (htab : ∀ (i : (M.law r.fst).Index) (v : { e : (M.law r.fst).Slot // Play.Holds (M.law r.fst).slotEnd r.snd e } → Bool) (g' : (ν : { ν : (M.law r.fst).Channel // Play.Holds (M.law r.fst).channelEnd r.snd ν }) → BitString ((M.law r.fst).length i ↑ν)), ∃ (e : Interpreter.WE), Interpreter.WE.val θ e = (M.law r.fst).table r.snd i v g') :
Simulates θ mu cb kinds T key [roleInstruction P n o key tg r] (roleWriteStep P n o grp g r)

The instruction of a role simulates its step.