Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Cuts.Moves

Moves, units and plans #

The play of the cutting argument of [Ant26] (Appendix H.2 and Appendix J; module Nc.G.Defs) is run by moves. A move has a law (Cut.Law) and a party for every role of the law (Cut.Moves). In a move, units are given at every slot of the law (a slot given fewer units than the move uses reads zeros after them; a move whose given units are not all present contributes zero), and the strings on a channel of the law, a label and the string of the law for every bit, are cut into new units.

Units have names (Cut.UnitId): the initial units of the strings between two base parties, and the new units of the channels of the moves. A plan (Cut.Plan) says which units are given at every slot and how many units a move uses, as functions of the numbers of initial units and of the outcomes of the earlier moves; an outcome gives the number of units of every channel.

Main definitions #

References #

structure Cslib.Circuits.Arithmetic.Separation.Cut.Moves (F : Type u_1) [CommSemiring F] (A E : ℕ) :
Type (max 1 u_1)

The moves: a law for every move, and a party for every role of its law.

@[reducible, inline]

All roles of all moves.

@[reducible, inline]

All slots of all moves.

@[reducible, inline]

All channels of all moves.

The party of a role.

def Cslib.Circuits.Arithmetic.Separation.Cut.Moves.slotRole {F : Type u_1} [CommSemiring F] {A E : ℕ} (M : Moves F A E) (z : M.Slot) (d : Bool) :

The role at an end of a slot.

The role at an end of a channel.

def Cslib.Circuits.Arithmetic.Separation.Cut.Moves.slotParty {F : Type u_1} [CommSemiring F] {A E : ℕ} (M : Moves F A E) (z : M.Slot) (d : Bool) :
Fin A

The party at an end of a slot.

The party at an end of a channel.

def Cslib.Circuits.Arithmetic.Separation.Cut.Moves.setOutcome {F : Type u_1} [CommSemiring F] {A E : ℕ} (M : Moves F A E) {U1 : ℕ} (o : M.Channel → Fin U1) (x : Fin E) (oo : (M.law x).Channel → Fin U1) :
M.Channel → Fin U1

Set the outcome of the move x.

inductive Cslib.Circuits.Arithmetic.Separation.Cut.UnitId (A U0 : ℕ) (N : Type u_1) (U1 : ℕ) :
Type u_1

Names of units. init a b k is unit number k of the string from the party a to the party b (only the A base parties have strings at the beginning); new ν k is unit number k of the channel ν of a move.

  • init {A U0 : ℕ} {N : Type u_1} {U1 : ℕ} (a b : Fin A) (k : Fin U0) : UnitId A U0 N U1

    A unit of a string at the beginning.

  • new {A U0 : ℕ} {N : Type u_1} {U1 : ℕ} (ν : N) (k : Fin U1) : UnitId A U0 N U1

    A unit made by a move.

Instances For
    def Cslib.Circuits.Arithmetic.Separation.Cut.instDecidableEqUnitId.decEq {A✝ U0✝ : ℕ} {N✝ : Type u_1} {U1✝ : ℕ} [DecidableEq N✝] (x✝ x✝¹ : UnitId A✝ U0✝ N✝ U1✝) :
    Decidable (x✝ = x✝¹)
    @[instance_reducible]
    instance Cslib.Circuits.Arithmetic.Separation.Cut.instDecidableEqUnitId {A✝ U0✝ : ℕ} {N✝ : Type u_1} {U1✝ : ℕ} [DecidableEq N✝] :
    DecidableEq (UnitId A✝ U0✝ N✝ U1✝)
    @[instance_reducible]
    instance Cslib.Circuits.Arithmetic.Separation.Cut.instFintypeUnitId {A✝ U0✝ : ℕ} {N✝ : Type u_1} {U1✝ : ℕ} [Fintype N✝] :
    Fintype (UnitId A✝ U0✝ N✝ U1✝)
    def Cslib.Circuits.Arithmetic.Separation.Cut.UnitId.holder {A A' U0 U1 : ℕ} {N : Type u_1} (np : N → Bool → Fin (A + A')) :
    UnitId A U0 N U1 → Bool → Fin (A + A')

    The two holders of a unit; np gives the parties at the ends of the channels. There are A base parties and A' extra parties.

    The number of a unit in its string.

    def Cslib.Circuits.Arithmetic.Separation.Cut.UnitId.count {A U0 U1 : ℕ} {N : Type u_1} (n : Fin A → Fin A → Fin (U0 + 1)) (o : N → Fin U1) :
    UnitId A U0 N U1 → ℕ

    The number of units of the string to which a unit belongs: n a b units at the beginning, and o ν + 1 units on the channel ν.

    noncomputable def Cslib.Circuits.Arithmetic.Separation.Cut.UnitId.list (A U0 : ℕ) (N : Type u_2) [Fintype N] (U1 : ℕ) :
    List (UnitId A U0 N U1)

    All units, in a fixed order.

    theorem Cslib.Circuits.Arithmetic.Separation.Cut.UnitId.holds_init {A A' U0 U1 : ℕ} {N : Type u_1} {np : N → Bool → Fin (A + A')} {p : Fin (A + A')} {a b : Fin A} {k : Fin U0} :
    Play.Holds (holder np) p (init a b k) ↔ p = Fin.castAdd A' a ∨ p = Fin.castAdd A' b

    The holders of an initial unit are the two base parties of its string.

    theorem Cslib.Circuits.Arithmetic.Separation.Cut.UnitId.sum_eq {A U0 U1 : ℕ} {N : Type u_1} {M : Type u_2} [Fintype N] [AddCommMonoid M] (f : UnitId A U0 N U1 → M) :
    ∑ u : UnitId A U0 N U1, f u = ∑ a : Fin A, ∑ c : Fin A, ∑ k : Fin U0, f (init a c k) + ∑ ν : N, ∑ k : Fin U1, f (new ν k)

    A sum over all units: the initial units and the new units.

    theorem Cslib.Circuits.Arithmetic.Separation.Cut.UnitId.card_eq {A U0 U1 : ℕ} {N : Type u_1} [Fintype N] :
    Fintype.card (UnitId A U0 N U1) = A * A * U0 + Fintype.card N * U1

    The number of units: A * A * U0 initial units and U1 units of every channel.

    def Cslib.Circuits.Arithmetic.Separation.Cut.initialUnits {A U0 U1 : ℕ} {N : Type u_2} [Fintype N] (n : Fin A → Fin A → Fin (U0 + 1)) :
    Finset (UnitId A U0 N U1)

    The units at the beginning: the first n a b units of the string from a to b.

    @[simp]
    theorem Cslib.Circuits.Arithmetic.Separation.Cut.init_mem_initialUnits {A U0 U1 : ℕ} {N : Type u_2} [Fintype N] {n : Fin A → Fin A → Fin (U0 + 1)} {a b : Fin A} {k : Fin U0} :
    UnitId.init a b k ∈ initialUnits n ↔ ↑k < ↑(n a b)
    @[simp]
    theorem Cslib.Circuits.Arithmetic.Separation.Cut.new_notMem_initialUnits {A U0 U1 : ℕ} {N : Type u_2} [Fintype N] {n : Fin A → Fin A → Fin (U0 + 1)} {ν : N} {k : Fin U1} :
    def Cslib.Circuits.Arithmetic.Separation.Cut.newUnits {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} (M : Moves F (A + A') E) (x : Fin E) (o : M.Channel → Fin U1) :
    Finset (UnitId A U0 M.Channel U1)

    The new units of the move x for the outcome o: the first o ν + 1 units of every channel ν of the move.

    @[simp]
    theorem Cslib.Circuits.Arithmetic.Separation.Cut.new_mem_newUnits {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} {M : Moves F (A + A') E} {x : Fin E} {o : M.Channel → Fin U1} {ν : M.Channel} {k : Fin U1} :
    UnitId.new ν k ∈ newUnits M x o ↔ ν.fst = x ∧ k ≤ o ν
    @[simp]
    theorem Cslib.Circuits.Arithmetic.Separation.Cut.init_notMem_newUnits {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} {M : Moves F (A + A') E} {x : Fin E} {o : M.Channel → Fin U1} {a b : Fin A} {k : Fin U0} :
    UnitId.init a b k ∉ newUnits M x o
    def Cslib.Circuits.Arithmetic.Separation.Cut.slotBits {A U0 U1 ub : ℕ} {N : Type u_2} (t : ℕ) (ids : List (UnitId A U0 N U1)) (y : UnitId A U0 N U1 → UnitContent ub) :

    The bits given at a slot: the bits of the units ids, then zeros for the t - ids.length units that are not given. An absent unit has no bits (UnitContent.bits none = []); roleTable excludes that case.

    def Cslib.Circuits.Arithmetic.Separation.Cut.ChannelOk {A U0 U1 ub : ℕ} {N : Type u_2} (ν : N) (J : ℕ) (str : List Bool) (y : UnitId A U0 N U1 → UnitContent ub) :

    The copies y of the new units of the channel ν are the J + 1 units of the string str.

    Instances For
      @[instance_reducible]
      instance Cslib.Circuits.Arithmetic.Separation.Cut.instDecidableChannelOk {A U0 U1 ub : ℕ} {N : Type u_2} (ν : N) (J : ℕ) (str : List Bool) (y : UnitId A U0 N U1 → UnitContent ub) :
      Decidable (ChannelOk ν J str y)
      def Cslib.Circuits.Arithmetic.Separation.Cut.roleTable {F : Type u_1} [CommSemiring F] {A A' E U0 U1 ub : ℕ} (M : Moves F (A + A') E) (x : Fin E) (p : (M.law x).Role) (t : ℕ) (ids : (M.law x).SlotAt p → List (UnitId A U0 M.Channel U1)) (o : M.Channel → Fin U1) (y : UnitId A U0 M.Channel U1 → UnitContent ub) :
      F

      The table of the role p of the move x. The units ids e are given at the slot e, the move uses t units, and o is the outcome. The table reads the copies y of the units given at the slots of the role and of the new units of its channels: for every one of the t * ub bits there are an index and strings of the law, and the strings on a channel, with the labels of the indices, are the string that is cut into the new units of the channel. The table is zero if a unit given at a slot of the role is absent; otherwise the slots are read through slotBits.

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

      A plan: which units are given at every slot, and the number of units that every move uses (slots given fewer units read zeros after them), as functions of the numbers n of units at the beginning and of the outcomes o of the earlier moves; and which outcomes are allowed.

      def Cslib.Circuits.Arithmetic.Separation.Cut.Plan.seenAt {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} {M : Moves F (A + A') E} (n : Fin A → Fin A → Fin (U0 + 1)) (o : M.Channel → Fin U1) (x : ℕ) :
      Finset (UnitId A U0 M.Channel U1)

      The units seen before the move x (for x = E: in the end).

      def Cslib.Circuits.Arithmetic.Separation.Cut.Plan.used {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} {M : Moves F (A + A') E} (P : Plan M U0 U1) (n : Fin A → Fin A → Fin (U0 + 1)) (o : M.Channel → Fin U1) (x : ℕ) :
      Finset (UnitId A U0 M.Channel U1)

      The units given before the move x.

      def Cslib.Circuits.Arithmetic.Separation.Cut.Plan.cur {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} {M : Moves F (A + A') E} (P : Plan M U0 U1) (n : Fin A → Fin A → Fin (U0 + 1)) (o : M.Channel → Fin U1) (x : ℕ) :
      Finset (UnitId A U0 M.Channel U1)

      The current units before the move x.

      noncomputable def Cslib.Circuits.Arithmetic.Separation.Cut.Plan.ids {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} {M : Moves F (A + A') E} (P : Plan M U0 U1) (n : Fin A → Fin A → Fin (U0 + 1)) (o : M.Channel → Fin U1) (z : M.Slot) :
      List (UnitId A U0 M.Channel U1)

      The units given at a slot, in the order of UnitId.list.

      def Cslib.Circuits.Arithmetic.Separation.Cut.Plan.Possible {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} {M : Moves F (A + A') E} (P : Plan M U0 U1) (n : Fin A → Fin A → Fin (U0 + 1)) (o : M.Channel → Fin U1) (ub : ℕ) (x : Fin E) :

      The outcome of the move x is possible: there is an index for every bit such that the strings on the channels have the numbers of units of the outcome.

      structure Cslib.Circuits.Arithmetic.Separation.Cut.Plan.Ok {F : Type u_1} [CommSemiring F] {A A' E U0 U1 : ℕ} {M : Moves F (A + A') E} (P : Plan M U0 U1) (cap : ℕ) :

      The rules that a plan obeys; cap bounds the number of units that a move uses.

      noncomputable def Cslib.Circuits.Arithmetic.Separation.Cut.roleTableAt {F : Type u_1} [CommSemiring F] {A A' E U0 U1 ub : ℕ} {M : Moves F (A + A') E} (P : Plan M U0 U1) (n : Fin A → Fin A → Fin (U0 + 1)) (o : M.Channel → Fin U1) (r : M.Role) (y : UnitId A U0 M.Channel U1 → UnitContent ub) :
      F

      The table of a role in the play.

      noncomputable def Cslib.Circuits.Arithmetic.Separation.Cut.partyTable {F : Type u_1} [CommSemiring F] {A A' E U0 U1 ub : ℕ} {M : Moves F (A + A') E} (P : Plan M U0 U1) (n : Fin A → Fin A → Fin (U0 + 1)) (o : M.Channel → Fin U1) (init : (UnitId A U0 M.Channel U1 → UnitContent ub) → F) (a : Fin (A + A')) (y : UnitId A U0 M.Channel U1 → UnitContent ub) :
      F

      The table of the party a after all moves, as a function of its copies of all units that it has ever held: its table init at the beginning times the tables of its roles.