Documentation

CslibFrontier.Computability.Circuit.SlpStep

Straight-line programs as lists of steps #

A straight-line program over Fin D is a cslib Program over fullSignature 2 (Fin D), which has one constant symbol for every element of Fin D and one binary symbol for every operation on Fin D, with fullInterpretation. The source VP ≠ VNP over every field [Ant26] (module Nc.Cut.Slp, IsSlpStep) describes such programs instead as lists of functions, each of which is an input, a constant, or a binary operation of two earlier ones.

The two descriptions agree up to the inputs: a list of p such steps is computed by a program with p gates (Cslib.Circuits.exists_program_of_isSlpStep), and a program with p gates on n inputs gives a list of n + p steps (Cslib.Circuits.exists_isSlpStep_of_program). Steps stay steps when the inputs are read through a map (Cslib.Circuits.IsSlpStep.comp).

Main definitions #

Main results #

References #

def Cslib.Circuits.IsSlpStep {D : ℕ} {Inp : Type} {n : ℕ} (inp : Fin n → Inp → Fin D) (fn : ℕ → Inp → Fin D) (k : ℕ) :

Step k of the list fn: an input coordinate, a constant, or a binary operation of two earlier steps.

theorem Cslib.Circuits.IsSlpStep.comp {D : ℕ} {Inp : Type} {n : ℕ} {Inp' : Type} {inp : Fin n → Inp → Fin D} {fn : ℕ → Inp → Fin D} {k : ℕ} (f : Inp' → Inp) (h : IsSlpStep inp fn k) :
IsSlpStep (fun (i : Fin n) (x : Inp') => inp i (f x)) (fun (k : ℕ) (x : Inp') => fn k (f x)) k

A step of the list fn is a step of the functions fn k ∘ f, from the inputs inp i ∘ f.

theorem Cslib.Circuits.exists_program_of_isSlpStep {D : ℕ} {Inp : Type} {n : ℕ} (inp : Fin n → Inp → Fin D) (fn : ℕ → Inp → Fin D) {p : ℕ} (h : ∀ k < p, IsSlpStep inp fn k) :
∃ (P : Program (fullSignature 2 (Fin D)) n p), ∀ (k : Fin p) (x : Inp), P.eval fullInterpretation (fun (i : Fin n) => inp i x) k = fn (↑k) x

A list of p steps is computed by a program with p gates, gate k computing step k.

theorem Cslib.Circuits.exists_isSlpStep_of_program {D : ℕ} {Inp : Type} {n : ℕ} [NeZero D] (inp : Fin n → Inp → Fin D) {p : ℕ} (P : Program (fullSignature 2 (Fin D)) n p) :
∃ (fn : ℕ → Inp → Fin D), (∀ k < n + p, IsSlpStep inp fn k) ∧ (∀ (i : Fin n), fn ↑i = inp i) ∧ ∀ (k : Fin p) (x : Inp), fn (n + ↑k) x = P.eval fullInterpretation (fun (i : Fin n) => inp i x) k

A program with p gates on n inputs gives a list of n + p steps: first the inputs, then the gates.