Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Interpreter.Eval

The interpreter #

Interpreter.IF at (IF, (f, (x, t))) simulates the formula f at x with the budgets t; instead of multiplying by a named constant it subtracts 1 from the budget of that name. Its value is the value of the run and the budgets that are left. Interpreter.simS describes the simulated runs.

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

Main definitions #

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.lett_rel {A : Type} [CommRing A] {θ : List Bool → A} {β : Type u_2} {γ : Type u_3} {e body : Fm} {x : Tree} {le : List (Run A)} (he : Ev θ e x le) {Q : List β} {R : Run A → β → Prop} (hR : List.Forall₂ R le Q) {Q2 : β → List γ} {R2 : Run A → γ → Prop} (h : ∀ s ∈ le, ∀ b ∈ Q, R s b → ∃ (l2 : List (Run A)), Ev θ body s.out l2 ∧ List.Forall₂ (fun (t : Run A) (c : γ) => R2 { cost := s.cost + t.cost + 2, th := s.th * t.th, bill := s.bill ++ t.bill, out := t.out } c) l2 (Q2 b)) :
∃ (l : List (Run A)), Ev θ (lett e body) x l ∧ List.Forall₂ R2 l (List.flatMap Q2 Q)

let, for lists that correspond to other lists.

Choose by the length of the value of b.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.selF_ev {A : Type} [CommRing A] {θ : List Bool → A} {cs : List Fm} {b : Fm} {x o : Tree} {k : ℕ} (hb : Dt θ b x o k) {l : List (Run A)} (h : ∀ (c : Fm), cs[o.len]? = some c → Ev θ c x l) (h0 : cs.length ≤ o.len → l = []) :
∃ k' ≤ cs.length * (k + cs.length + 1), Ev θ (selF cs b) x (List.map (Run.delay k') l)

The formula in the environment.

The argument in the environment.

The budgets in the environment.

The arguments of the formula.

First call, with the environment kept.

The environment of the interpreter.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.Dt.fX {A : Type} [CommRing A] {θ : List Bool → A} {b : Fm} {y f x : Tree} {t : Bt} {k : ℕ} (h : Dt θ b y (env f x t) k) :
Dt θ (Interpreter.fX b) y x (k + 3)
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.Dt.fS {A : Type} [CommRing A] {θ : List Bool → A} {b : Fm} {y f x : Tree} {t : Bt} {k : ℕ} (h : Dt θ b y (env f x t) k) :
Dt θ (Interpreter.fS b) y t.enc (k + 3)
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.Dt.fO {A : Type} [CommRing A] {θ : List Bool → A} {b : Fm} {y f x : Tree} {t : Bt} {k : ℕ} (h : Dt θ b y (env f x t) k) :
Dt θ (Interpreter.fO b) y f.hd (k + 3)
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.Dt.fA {A : Type} [CommRing A] {θ : List Bool → A} {b : Fm} {y f x : Tree} {t : Bt} {k : ℕ} (h : Dt θ b y (env f x t) k) :
Dt θ (Interpreter.fA b) y f.tl (k + 3)
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.rec_ev {A : Type} [CommRing A] {θ : List Bool → A} {b a x s : Fm} {y g z f' x' : Tree} {t t' : Bt} {kb ka kx ks : ℕ} (hb : Dt θ b y (env f' x' t') kb) (ha : Dt θ a y g ka) (hx : Dt θ x y z kx) (hs : Dt θ s y t.enc ks) {l : List (Run A)} (h : Ev θ IF (env g z t) l) :
Ev θ (rec' b a x s) y (List.map (Run.delay (2 * kb + ka + kx + ks + 6)) l)

A recursive call.

A simulated run: a run of the formula, together with the budgets left after its bill.

  • run : Run A

    the run of the simulated formula

  • left : Bt

    the budgets left after paying its bill

The simulated runs of l with the budgets t: those whose bill fits into t.

theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.simS_map {A : Type} {t : Bt} {l : List (Run A)} {G : Run A → Run A} (h : ∀ (r : Run A), (G r).bill = r.bill) :
simS t (List.map G l) = List.map (fun (q : SimRun A) => { run := G q.run, left := q.left }) (simS t l)
theorem Cslib.Circuits.Arithmetic.Separation.Interpreter.simS_flatMap {A : Type} {t : Bt} {la : List (Run A)} {L : Run A → List (Run A)} {G : Run A → Run A → Run A} (h : ∀ (r s : Run A), (G r s).bill = r.bill ++ s.bill) :
simS t (List.flatMap (fun (r : Run A) => List.map (G r) (L r)) la) = List.flatMap (fun (q : SimRun A) => List.map (fun (p : SimRun A) => { run := G q.run p.run, left := p.left }) (simS q.left (L q.run))) (simS t la)