Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Interpreter.Postpone

Postponing the named constants #

Interpreter.WF at (p, (d, t)) runs the interpreter on the program p at d with the budgets t and accepts only if the budgets are used up exactly. Its runs are plain: they name no constants. Their weights are those of the runs of p whose bill uses each name exactly as often as t allows (Interpreter.ok). Constants are tries Interpreter.KT R of values in a ring R over A. Summed over all budgets KT.budg J K with J digits, weighted by the products of the powers of the constants, these plain sums give back the value of the program with the named constants evaluated in K (Interpreter.val_eq_sum_budg).

From VP ≠ VNP over every field [Ant26], module NS1.Postpone.

Main definitions #

Main results #

A trie with constants of R at its leaves.

  • none {R : Type} : KT R

    no constant

  • leaf {R : Type} (c : R) : KT R

    one constant

  • node {R : Type} (l r : KT R) : KT R

    constants whose names begin with 0, constants whose names begin with 1

The height: a bound for the length of names.

The constant with a given name (0 if there is none).

All budgets with J digits for the names of a trie, with the products of the powers of its constants.

The bill uses up the budgets.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.ok_cons (t : Bt) (p : List Bool) (b : List (List Bool)) :
ok t (p :: b) = (Option.map (fun (t' : Bt) => ok t' b) (Bt.dec p t)).getD false

The names that begin with a given bit.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.sum_budg {R : Type} [CommRing R] (J : ℕ) (K : KT R) (b : List (List Bool)) (hb : b.length < 2 ^ J) :
(List.map (fun (q : Bt × R) => if ok q.1 b = true then q.2 else 0) (KT.budg J K)).sum = (List.map K.lookup b).prod

All budgets together.

def Cslib.Circuits.Arithmetic.Separation.Interpreter.wt {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] (κ : List Bool → R) (r : Run A) :
R

The weight of a run, if the named constants are κ.

The value of a list of runs.

The value of a list of runs without named constants.

Apply a program; then check that the budgets are used up. The argument is (program, (argument, budgets)).

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.sum_filter_th {A : Type} [CommRing A] (t : Bt) (l : List (Run A)) :
(List.map Run.th (List.filter (fun (r : Run A) => ok t r.bill) l)).sum = (List.map (fun (r : Run A) => if ok t r.bill = true then r.th else 0) l).sum
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.WF_ev {A : Type} [CommRing A] {θ : List Bool → A} {H T : ℕ} {p d : Tree} {l : List (Run A)} (h : Ev θ (Fm.ofTree p) d l) (hT : ∀ r ∈ l, r.cost ≤ T) {t : Bt} (ht : t.ht ≤ H) :
∃ (l' : List (Run A)), Ev θ WF (p.cons (d.cons t.enc)) l' ∧ (∀ r ∈ l', r.bill = [] ∧ r.cost ≤ MM H * T + 40 * t.nds + 40) ∧ List.map Run.th l' = List.map Run.th (List.filter (fun (r : Run A) => ok t r.bill) l)

Lemma 1, one bill: WF is plain; it has the runs whose bill is the budget.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.val_eq_sum_budg {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] {J : ℕ} {K : KT R} {κ : List Bool → R} {l : List (Run A)} (hJ : ∀ r ∈ l, r.bill.length < 2 ^ J) (hκ : ∀ r ∈ l, ∀ p ∈ r.bill, κ p = K.lookup p) :
val κ l = (List.map (fun (q : Bt × R) => q.2 * (algebraMap A R) (List.map (fun (r : Run A) => if ok q.1 r.bill = true then r.th else 0) l).sum) (KT.budg J K)).sum

Lemma 1 (postponing). The value of a list of runs is the sum, over all budgets, of the powers of the constants times the sums of the weights of the runs that use up the budgets.