Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Dealing.Theorem

The dealing program #

The program G of [Ant26] (the proof of Theorem J.3) is a formula of the tree machine of one shape (dealFormula): it writes the word of its argument, cuts it into parts that it writes into a trie at given paths, runs a first list of steps and then a second one, and fills a list of templates. Its weighted values are the filled templates, one list for every state after the steps, and the weighted sum of the products of the plain sums of the filled templates is the sum over those states (dealFormula_does); its cost is the cost of the word, of the parts, of the steps and of the templates. With injective codes of names, the trie after the parts is a state by names (gets_partsT).

Main definitions #

Main results #

References #

From VP ≠ VNP over every field [Ant26], Appendix J.3: the program G in the proof of Theorem J.3 (p. 54). Ported from the source module Nc.Dl.DealThm.

The dealing program: the word of the argument, with t0 for a leaf and t1 for a node, cut into parts of lsbValue nl letters at the paths names; the steps sts and then sts', guessing bit lists of BitString.lsbValue nub bits; and the templates ts.

theorem Cslib.Circuits.Arithmetic.Separation.Dealing.dealFormula_does {A : Type} [CommRing A] {θ : List Bool → A} (t0 t1 : Interpreter.Tree) (names : List (List Bool)) (nl nub : List Bool) (sts sts' : List Interpreter.DStep) (ts : List Interpreter.Tm) (z : Interpreter.Tree) {Ln : ℕ} (hn : ∀ p ∈ names, p.length ≤ Ln) {I : List Interpreter.DStep → (List Bool → Interpreter.Tree) → Prop} {c : Interpreter.DStep → ℕ} {ct c9 : ℕ} (hI : ∀ (st : Interpreter.DStep) (sts' : List Interpreter.DStep) (σ : List Bool → Interpreter.Tree), I (st :: sts') σ → Interpreter.DStep.cost (BitString.lsbValue nub) nub.length st σ ≤ c st ∧ ∀ σ' ∈ Interpreter.DStep.exec (BitString.lsbValue nub) st σ, I sts' σ') (hI0 : I sts (Interpreter.gets (Interpreter.partsT (BitString.lsbValue nl) names Interpreter.Tree.nil (Interpreter.wordT t0 t1 z)))) (h9 : ∀ σ ∈ Interpreter.execAll (BitString.lsbValue nub) sts (Interpreter.gets (Interpreter.partsT (BitString.lsbValue nl) names Interpreter.Tree.nil (Interpreter.wordT t0 t1 z))), (∃ (I' : List Interpreter.DStep → (List Bool → Interpreter.Tree) → Prop) (c' : Interpreter.DStep → ℕ), (∀ (st : Interpreter.DStep) (sts'' : List Interpreter.DStep) (σ : List Bool → Interpreter.Tree), I' (st :: sts'') σ → Interpreter.DStep.cost (BitString.lsbValue nub) nub.length st σ ≤ c' st ∧ ∀ σ' ∈ Interpreter.DStep.exec (BitString.lsbValue nub) st σ, I' sts'' σ') ∧ I' sts' σ ∧ (List.map (fun (st : Interpreter.DStep) => c' st + 30) sts').sum ≤ c9) ∧ ∀ σ' ∈ Interpreter.execAll (BitString.lsbValue nub) sts' σ, ∀ t ∈ ts, Interpreter.Tm.cost σ' t ≤ ct) :
∃ (Q : List (A × Interpreter.Tree)), Interpreter.Does θ (dealFormula t0 t1 names nl nub sts sts' ts) z Q (60 * z.size + (z.size + names.length) * (60 * nl.length + 100) + names.length * (60 * Ln + 130) + (List.map (fun (st : Interpreter.DStep) => c st + 30) sts).sum + c9 + ts.length * (ct + 60) + 300) ∧ (∀ q ∈ Q, ∃ σ ∈ Interpreter.execAll (BitString.lsbValue nub) (sts ++ sts') (Interpreter.gets (Interpreter.partsT (BitString.lsbValue nl) names Interpreter.Tree.nil (Interpreter.wordT t0 t1 z))), q.2 = Interpreter.listT (List.map (fun (t : Interpreter.Tm) => Interpreter.Tm.expand σ t) ts)) ∧ Interpreter.wsum Q (Cut.pvProd θ) = (List.map (fun (σ : List Bool → Interpreter.Tree) => (List.map (fun (t : Interpreter.Tm) => Interpreter.pv θ (Interpreter.Tm.expand σ t)) ts).prod) (Interpreter.execAll (BitString.lsbValue nub) (sts ++ sts') (Interpreter.gets (Interpreter.partsT (BitString.lsbValue nl) names Interpreter.Tree.nil (Interpreter.wordT t0 t1 z))))).sum

The dealing program. Let the steps sts cost at most c each along every run from the trie of the parts of the word of z (an invariant I of the remaining steps and the state), and let every state after them have an invariant for the steps sts' that bounds their costs by c9 in all, and states after which every template costs at most ct. Then the dealing program at z makes, at the stated cost, one list of filled templates for every state after all steps, and the weighted sum of the products of their plain sums is the sum over those states.

theorem Cslib.Circuits.Arithmetic.Separation.Dealing.gets_partsT {ν : Type u_1} {nm : ν → List Bool} (hnm : Function.Injective nm) (m : ℕ) (xs : List ν) (hxs : xs.Nodup) (W : Interpreter.Tree) (l : List Interpreter.Tree) (st : ν → Interpreter.Tree) (hW : Interpreter.gets W = Function.extend nm st fun (x : List Bool) => Interpreter.Tree.nil) :
∃ (st' : ν → Interpreter.Tree), (Interpreter.gets (Interpreter.partsT m (List.map nm xs) W l) = Function.extend nm st' fun (x : List Bool) => Interpreter.Tree.nil) ∧ (∀ (k : ℕ) (h : k < xs.length), st' xs[k] = Interpreter.listT (List.take m (List.drop (k * m) l)).reverse) ∧ ∀ y ∉ xs, st' y = st y

The parts at names. Writing the parts of m elements of l at the codes of the distinct names xs into a trie whose values are the state by names st gives a state by names in which the name xs[k] has the part k, reversed, and the other names keep their values.