Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Interpreter.Step

One round of the acceleration #

Interpreter.stepF D G p g does one round. It guesses budgets with g, which multiplies by the powers of the constants. It then forms the plain instance Interpreter.zq p z t of WF, cuts it into pieces with the program G, and applies the program D to every piece (the loop Interpreter.LP). Weighted sums of runs are Interpreter.sumF.

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

Main definitions #

Main results #

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.wt_seq {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} (r s : Run A) :
wt κ (r.seq s) = wt κ r * wt κ s
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.wt_tick {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} (r : Run A) (o : Tree) :
wt κ (r.tick o) = wt κ r
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.wt_delay {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} (k : ℕ) (r : Run A) :
wt κ (Run.delay k r) = wt κ r
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.wt_det {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} (k : ℕ) (o : Tree) :
wt κ (Run.det k o) = 1
def Cslib.Circuits.Arithmetic.Separation.Interpreter.sumF {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] (κ : List Bool → R) (l : List (Run A)) (f : Tree → R) :
R

Sums over runs, with a function of the value.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.val_eq_sumF {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} (l : List (Run A)) :
val κ l = sumF κ l fun (x : Tree) => 1
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.sumF_delay {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} (k : ℕ) (l : List (Run A)) (f : Tree → R) :
sumF κ (List.map (Run.delay k) l) f = sumF κ l f
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.sum_rel {A : Type} [CommRing A] {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} {β : Type u_1} {l : List (Run A)} {Q : List β} {c : β → R} {o : β → Tree} {f : Tree → R} (h : List.Forall₂ (fun (r : Run A) (q : β) => wt κ r = c q ∧ r.out = o q) l Q) :
sumF κ l f = (List.map (fun (q : β) => c q * f (o q)) Q).sum
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.Ev.app {A : Type} [CommRing A] {θ : List Bool → A} {p x : Tree} {e : Fm} {le : List (Run A)} (he : Ev θ e x le) (h : ∀ s ∈ le, Hl θ (Fm.ofTree p) s.out) :
Ev θ (Interpreter.app p e) x (List.flatMap (fun (s : Run A) => List.map (fun (t : Run A) => (((Run.det 1 p).seq s).seq t).tick t.out) (Interpreter.evl θ (Fm.ofTree p) s.out)) le)
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.sumF_app {A : Type} [CommRing A] {θ : List Bool → A} {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} {p : Tree} {le : List (Run A)} {f : Tree → R} :
sumF κ (List.flatMap (fun (s : Run A) => List.map (fun (t : Run A) => (((Run.det 1 p).seq s).seq t).tick t.out) (evl θ (Fm.ofTree p) s.out)) le) f = sumF κ le fun (o : Tree) => sumF κ (evl θ (Fm.ofTree p) o) f
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.mem_app {A : Type} [CommRing A] {θ : List Bool → A} {p : Tree} {le : List (Run A)} {u : Run A} (h : u ∈ List.flatMap (fun (s : Run A) => List.map (fun (t : Run A) => (((Run.det 1 p).seq s).seq t).tick t.out) (evl θ (Fm.ofTree p) s.out)) le) :
∃ s ∈ le, ∃ t ∈ evl θ (Fm.ofTree p) s.out, u.cost = s.cost + t.cost + 2 ∧ u.bill = s.bill ++ t.bill ∧ u.out = t.out ∧ u.th = s.th * t.th

Apply the program D to all trees of a list. The argument is (this program, the list).

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.LP_ev {A : Type} [CommRing A] {θ : List Bool → A} {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} {D : Tree} {T : ℕ} {P : List Bool → Prop} (ys : Tree) (h : ∀ y ∈ ys.toList, Hl θ (Fm.ofTree D) y ∧ ∀ r ∈ evl θ (Fm.ofTree D) y, r.cost ≤ T ∧ ∀ p ∈ r.bill, P p) :
∃ (l : List (Run A)), Ev θ (LP D) ((LP D).code.cons ys) l ∧ (∀ r ∈ l, r.cost ≤ (T + 30) * ys.toList.length + 10 ∧ ∀ p ∈ r.bill, P p) ∧ val κ l = (List.map (fun (y : Tree) => val κ (evl θ (Fm.ofTree D) y)) ys.toList).prod

The plain instance for a program p, an argument z and budgets t.

Form the plain instance: fp gives the program, g guesses the budgets.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.ZE_ev {A : Type} [CommRing A] {θ : List Bool → A} {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} {fp g : Fm} {p z : Tree} {k cg : ℕ} {P : List Bool → Prop} {lg : List (Run A)} {Q : List (Bt × R)} (hp : Dt θ fp z p k) (hg : Ev θ g z lg) (rg : List.Forall₂ (RelG κ P cg) lg Q) :
∃ (l : List (Run A)), Ev θ (ZE fp g) z l ∧ List.Forall₂ (fun (r : Run A) (q : Bt × R) => wt κ r = q.2 ∧ r.out = zq p z q.1 ∧ (∀ n ∈ r.bill, P n) ∧ r.cost ≤ cg + k + 5) l Q
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.ZE_app_ev {A : Type} [CommRing A] {θ : List Bool → A} {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} {fp g : Fm} {D p z : Tree} {k cg : ℕ} {P : List Bool → Prop} {lg : List (Run A)} {Q : List (Bt × R)} (hp : Dt θ fp z p k) (hg : Ev θ g z lg) (rg : List.Forall₂ (RelG κ P cg) lg Q) (hD : ∀ q ∈ Q, Hl θ (Fm.ofTree D) (zq p z q.1)) :
∃ (lZ : List (Run A)), List.Forall₂ (fun (r : Run A) (q : Bt × R) => wt κ r = q.2 ∧ r.out = zq p z q.1 ∧ (∀ n ∈ r.bill, P n) ∧ r.cost ≤ cg + k + 5) lZ Q ∧ Ev θ (app D (ZE fp g)) z (List.flatMap (fun (s : Run A) => List.map (fun (t : Run A) => (((Run.det 1 D).seq s).seq t).tick t.out) (evl θ (Fm.ofTree D) s.out)) lZ)

Form the plain instance and apply the program D to it: the runs of ZE fp g (each for one guessed budget), and the runs of app D (ZE fp g).

One round: guess budgets, multiply, form the plain instance, cut it with G, apply D to the pieces.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.stepF_ev {A : Type} [CommRing A] {θ : List Bool → A} {R : Type} [CommRing R] [Algebra A R] {κ : List Bool → R} {D G p z : Tree} {g : Fm} {cg tG tD Ln : ℕ} {P : List Bool → Prop} {lg : List (Run A)} {Q : List (Bt × R)} (hg : Ev θ g z lg) (rg : List.Forall₂ (RelG κ P cg) lg Q) (hG : ∀ q ∈ Q, Hl θ (Fm.ofTree G) (zq p z q.1) ∧ ∀ r ∈ evl θ (Fm.ofTree G) (zq p z q.1), r.bill = [] ∧ r.cost ≤ tG ∧ r.out.toList.length ≤ Ln ∧ ∀ y ∈ r.out.toList, Hl θ (Fm.ofTree D) y ∧ ∀ r ∈ evl θ (Fm.ofTree D) y, r.cost ≤ tD ∧ ∀ n ∈ r.bill, P n) :
∃ (l : List (Run A)), Ev θ (stepF D G p g) z l ∧ (∀ r ∈ l, r.cost ≤ cg + tG + (tD + 30) * Ln + 30 ∧ ∀ n ∈ r.bill, P n) ∧ val κ l = (List.map (fun (q : Bt × R) => q.2 * sumF κ (evl θ (Fm.ofTree G) (zq p z q.1)) fun (o : Tree) => (List.map (fun (y : Tree) => val κ (evl θ (Fm.ofTree D) y)) o.toList).prod) Q).sum