Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Cuts.Segments

Segments between the parties of a run #

In Lemma I.2 of [Ant26] (modules Nc.Cut.Defs, Nc.Cut.Rows and Nc.Cut.StartA), a run of K blocks on tapes S with one input has K + K parties (the nodes of the paper): the blocks, Fin.castAdd K κ, and K input parties, Fin.natAdd K κ, which hold the parts x κ of the input. The input is treated as one more tape, none, that the input parties write and the blocks read.

What the party a writes on the tape s and the party b reads is the segment X s a b. The concatenation of a row X s a is what a writes on s, the concatenation of a column is what b reads from s, and X s has staircase support (List.StairRefinement.Stair). By the existence and uniqueness of a common refinement, the sum over what the blocks emit, in Cut.runVal_blocks, is a sum over the segments with staircase support, of the product of the weights of the parties (Cut.sum_segments).

All segments between two parties, those of each tape closed by a separator (the end mark of the paper), are put into one bit string (Cut.segmentString), from which they can be recovered.

Main definitions #

Main results #

References #

noncomputable def Cslib.Circuits.Arithmetic.Separation.Cut.joinSegments {Γ : Type u_1} {σ : Type u_2} [Fintype σ] (X : σ → List Γ) :

The segments X s on all tapes s as one word: every segment is followed by the separator none.

The segments on all tapes are determined by their word with separators.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Cut.segmentString {Γ : Type u_1} {σ : Type u_2} [Fintype σ] {c : ℕ} (cb : Option Γ → BitString c) (X : σ → List Γ) :

The bit string of the segments on all tapes, for a code cb of the letters and of the separator.

The segments on all tapes are determined by their bit string.

theorem Cslib.Circuits.Arithmetic.Separation.Cut.length_segmentString {Γ : Type u_1} {σ : Type u_2} [Fintype σ] {c : ℕ} (cb : Option Γ → BitString c) (X : σ → List Γ) :
(segmentString cb X).length = (∑ s : σ, (X s).length + Fintype.card σ) * c
theorem Cslib.Circuits.Arithmetic.Separation.Cut.sum_unitCount_le {Γ : Type u_1} {σ : Type u_2} [Fintype σ] {c A T ub : ℕ} {cb : Option Γ → BitString c} {X : σ → Fin A → List Γ} (h : ∑ s : σ, (List.StairRefinement.cat (X s)).length ≤ T) :
∑ b : Fin A, unitCount ub (segmentString cb fun (s : σ) => X s b) ≤ (T + A * Fintype.card σ) * c / ub + A

The number of units of the bit strings from a party to all parties (or to a party from all parties), if the party writes (or reads) at most T letters on all tapes together.

def Cslib.Circuits.Arithmetic.Separation.Cut.blockEmission {Γ : Type u_2} {S : Type u_3} {A : ℕ} (R C : Option S → Fin A → List Γ) :
Tape.Ch S Unit → List Γ

What a block emits, if R s b is what it writes for the party b on the tape s and C s b is what it reads from the party b on the tape s. The tape none is the input, which a block only reads.

def Cslib.Circuits.Arithmetic.Separation.Cut.parts {Γ : Type u_2} {K : ℕ} (ℓ : ℕ) (u : List Γ) (κ : Fin K) :
List Γ

The parts of a word, of ℓ letters each: the part κ begins at the letter κ * ℓ.

theorem Cslib.Circuits.Arithmetic.Separation.Cut.cat_parts {Γ : Type u_2} {K : ℕ} (ℓ : ℕ) (u : List Γ) :

The first K parts of a word concatenate to its first K * ℓ letters.

theorem Cslib.Circuits.Arithmetic.Separation.Cut.length_parts_le {Γ : Type u_2} {K : ℕ} (ℓ : ℕ) (u : List Γ) (κ : Fin K) :
(parts ℓ u κ).length ≤ ℓ
def Cslib.Circuits.Arithmetic.Separation.Cut.partyWeight {F : Type u_1} {Γ : Type u_2} {S : Type u_3} {Q : Type u_4} {K : ℕ} [Fintype Γ] [DecidableEq Γ] [Fintype S] [DecidableEq S] [Fintype Q] [DecidableEq Q] [Semiring F] (mu : Tape.Letter S Unit Γ → Matrix Q Q F) (T : ℕ) (q : Fin (K + 1) → Q) (x : Fin K → List Γ) (p : Fin (K + K)) (R C : Option S → Fin (K + K) → List Γ) :
F

The weight of what the party p writes for the parties b on the tapes s, R s b, and reads from them, C s b. A block Fin.castAdd K κ does not write on the input tape none, and has the weight of a block from the state q κ to the state q (κ + 1). An input party Fin.natAdd K κ writes its part x κ of the input on the input tape and nothing else, reads nothing, and has the weight 1.

theorem Cslib.Circuits.Arithmetic.Separation.Cut.partyWeight_block {F : Type u_1} {Γ : Type u_2} {S : Type u_3} {Q : Type u_4} {K : ℕ} [Fintype Γ] [DecidableEq Γ] [Fintype S] [DecidableEq S] [Fintype Q] [DecidableEq Q] [Semiring F] {mu : Tape.Letter S Unit Γ → Matrix Q Q F} {T : ℕ} {q : Fin (K + 1) → Q} {x : Fin K → List Γ} {R C : Option S → Fin (K + K) → List Γ} (κ : Fin K) :
partyWeight mu T q x (Fin.castAdd K κ) R C = if ∀ (b : Fin (K + K)), R none b = [] then blockWeight mu T (q κ.castSucc) (q κ.succ) (blockEmission R C) else 0
theorem Cslib.Circuits.Arithmetic.Separation.Cut.partyWeight_input {F : Type u_1} {Γ : Type u_2} {S : Type u_3} {Q : Type u_4} {K : ℕ} [Fintype Γ] [DecidableEq Γ] [Fintype S] [DecidableEq S] [Fintype Q] [DecidableEq Q] [Semiring F] {mu : Tape.Letter S Unit Γ → Matrix Q Q F} {T : ℕ} {q : Fin (K + 1) → Q} {x : Fin K → List Γ} {R C : Option S → Fin (K + K) → List Γ} (κ : Fin K) :
partyWeight mu T q x (Fin.natAdd K κ) R C = if (∀ (s : S) (b : Fin (K + K)), R (some s) b = []) ∧ (∀ (s : Option S) (b : Fin (K + K)), C s b = []) ∧ List.StairRefinement.cat (R none) = x κ then 1 else 0
theorem Cslib.Circuits.Arithmetic.Separation.Cut.sum_length_le_of_partyWeight_ne_zero {F : Type u_1} {Γ : Type u_2} {S : Type u_3} {Q : Type u_4} {K : ℕ} [Fintype Γ] [DecidableEq Γ] [Fintype S] [DecidableEq S] [Fintype Q] [DecidableEq Q] [Semiring F] {mu : Tape.Letter S Unit Γ → Matrix Q Q F} {T : ℕ} {q : Fin (K + 1) → Q} {x : Fin K → List Γ} {R C : Option S → Fin (K + K) → List Γ} (hx : ∀ (κ : Fin K), (x κ).length ≤ T) {p : Fin (K + K)} (h : partyWeight mu T q x p R C ≠ 0) :

A party writes at most T letters on all tapes together.

def Cslib.Circuits.Arithmetic.Separation.Cut.segmentWeight {F : Type u_1} {Γ : Type u_2} {S : Type u_3} {Q : Type u_4} {K : ℕ} [Fintype Γ] [DecidableEq Γ] [Fintype S] [DecidableEq S] [Fintype Q] [DecidableEq Q] [CommSemiring F] (mu : Tape.Letter S Unit Γ → Matrix Q Q F) (T : ℕ) (q : Fin (K + 1) → Q) (x : Fin K → List Γ) (X : Option S → Fin (K + K) → Fin (K + K) → List Γ) :
F

The product of the weights of the parties, for the segments X s a b that the party a writes on the tape s and the party b reads.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Cut.segments (Γ : Type u_5) (S : Type u_6) [Fintype Γ] [Fintype S] [DecidableEq S] (K T : ℕ) :
Finset (Option S → Fin (K + K) → Fin (K + K) → List Γ)

The segments of at most T letters each, between K + K parties on the tapes S and the input.

@[simp]
theorem Cslib.Circuits.Arithmetic.Separation.Cut.mem_segments {Γ : Type u_2} {S : Type u_3} {K : ℕ} [Fintype Γ] [Fintype S] [DecidableEq S] {T : ℕ} {X : Option S → Fin (K + K) → Fin (K + K) → List Γ} :
X ∈ segments Γ S K T ↔ ∀ (s : Option S) (a b : Fin (K + K)), (X s a b).length ≤ T
theorem Cslib.Circuits.Arithmetic.Separation.Cut.sum_segments {F : Type u_1} {Γ : Type u_2} {S : Type u_3} {Q : Type u_4} {K : ℕ} [Fintype Γ] [DecidableEq Γ] [Fintype S] [DecidableEq S] [Fintype Q] [DecidableEq Q] [CommSemiring F] {mu : Tape.Letter S Unit Γ → Matrix Q Q F} {T : ℕ} (q : Fin (K + 1) → Q) {x : Fin K → List Γ} (hx : ∀ (κ : Fin K), (x κ).length ≤ T) (u : Unit → List Γ) (hu : List.StairRefinement.cat x = u ()) :
(∑ v ∈ Fintype.piFinset fun (x : Fin K) => Fintype.piFinset fun (x : Tape.Ch S Unit) => List.wordsLe Γ T, if (∀ (s : S), (List.StairRefinement.cat fun (k : Fin K) => v k (Tape.Ch.tp s false)) = List.StairRefinement.cat fun (k : Fin K) => v k (Tape.Ch.tp s true)) ∧ ∀ (j : Unit), (List.StairRefinement.cat fun (k : Fin K) => v k (Tape.Ch.inp j)) = u j then ∏ k : Fin K, blockWeight mu T (q k.castSucc) (q k.succ) (v k) else 0) = ∑ X ∈ segments Γ S K T, if ∀ (s : Option S), List.StairRefinement.Stair (X s) then segmentWeight mu T q x X else 0

Segments. For given states q between the blocks, the sum over the words that the blocks emit, restricted to those for which the two sides of every tape carry the same concatenation and the input channel carries the concatenation of the parts x of the input, is the sum over the segments with staircase support, of the product of the weights of the parties.