Documentation

CslibFrontier.Computability.Circuit.SpanProgram.Basic

Monotone Span Programs #

A monotone span program over a field F for a party type Party ([BS23], Definition 22.21, p. 978) assigns to each party i : Party a rowDim i × (tailDim + 1) matrix matrix i over F. The book's column count d is tailDim + 1 ≥ 1 so that the target row vector e₁ = (1, 0, …, 0) ∈ F^{tailDim + 1} is always well-defined and nonzero. A coalition s is accepted iff target = e₁ lies in the F-linear span of all rows of {matrix i}_{i ∈ s}.

Main definitions #

Main results #

References #

structure Cslib.Circuits.MonotoneSpanProgram (F : Type u_1) (Party : Type u_2) :
Type (max u_1 u_2)

A monotone span program over a field F for party/input type Party ([BS23], Definition 22.21, p. 978).

Each party i holds a rowDim i × (tailDim + 1) matrix matrix i over F. The book's column dimension d is tailDim + 1 ≥ 1 so that target = e₁ = (1, 0, …, 0) is well-defined and nonzero.

  • tailDim : ℕ

    Number of auxiliary columns beyond the first (target) coordinate (d = tailDim + 1).

  • rowDim : Party → ℕ

    Number of rows d_i assigned to each party i.

  • matrix (i : Party) : Matrix (Fin (self.rowDim i)) (Fin (self.tailDim + 1)) F

    Matrix M_i of size d_i × (tailDim + 1) for each party i.

def Cslib.Circuits.MonotoneSpanProgram.target {F : Type u_1} {Party : Type u_2} [Field F] (P : MonotoneSpanProgram F Party) :
Fin (P.tailDim + 1) → F

The target row vector e₁ = (1, 0, …, 0) ∈ F^{tailDim + 1} ([BS23], Definition 22.21, p. 978).

@[simp]
theorem Cslib.Circuits.MonotoneSpanProgram.target_zero {F : Type u_1} {Party : Type u_2} [Field F] (P : MonotoneSpanProgram F Party) :
P.target 0 = 1
def Cslib.Circuits.MonotoneSpanProgram.rowSpan {F : Type u_1} {Party : Type u_2} [Field F] (P : MonotoneSpanProgram F Party) (s : Finset Party) :
Submodule F (Fin (P.tailDim + 1) → F)

The F-linear span of all rows of {P.matrix i}_{i ∈ s} for coalition s ([BS23], Definition 22.21, p. 978).

def Cslib.Circuits.MonotoneSpanProgram.Accepts {F : Type u_1} {Party : Type u_2} [Field F] (P : MonotoneSpanProgram F Party) (s : Finset Party) :

A monotone span program P accepts coalition s iff P.target ∈ P.rowSpan s ([BS23], Definition 22.21, p. 978).

Acceptance by a monotone span program is monotone under coalition inclusion ([BS23], Definition 22.21, p. 978).

The empty coalition is never accepted by a monotone span program over a field.

theorem Cslib.Circuits.MonotoneSpanProgram.accepts_iff_exists_vecMul {F : Type u_1} {Party : Type u_2} [Field F] (P : MonotoneSpanProgram F Party) (s : Finset Party) :
P.Accepts s ↔ ∃ (w : (i : ↥s) → Fin (P.rowDim ↑i) → F), ∑ i : ↥s, Matrix.vecMul (w i) (P.matrix ↑i) = P.target

A coalition s is accepted iff there exist per-party row coefficient vectors w i whose weighted sum of rows equals P.target = e₁ ([BS23], Construction 22.2, p. 980).

theorem Cslib.Circuits.MonotoneSpanProgram.not_accepts_of_exists_nullVector {F : Type u_1} {Party : Type u_2} [Field F] (P : MonotoneSpanProgram F Party) {s : Finset Party} (v : Fin (P.tailDim + 1) → F) (hv0 : v 0 = 1) (hv_null : ∀ i ∈ s, (P.matrix i).mulVec v = 0) :

Sufficient certificate of non-acceptance: any column vector v with v 0 = 1 in the right kernel of P.matrix i for all i ∈ s witnesses ¬ P.Accepts s.

theorem Cslib.Circuits.MonotoneSpanProgram.exists_nullVector_of_not_accepts {F : Type u_1} {Party : Type u_2} [Field F] (P : MonotoneSpanProgram F Party) {s : Finset Party} (hs : ¬P.Accepts s) :
∃ (v : Fin (P.tailDim + 1) → F), v 0 = 1 ∧ ∀ i ∈ s, (P.matrix i).mulVec v = 0

For every unauthorized coalition s, there exists a column vector v : Fin (P.tailDim + 1) → F with v 0 = 1 that lies in the right kernel of P.matrix i for every i ∈ s.