Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Sort.Runs

Programs given by their structured runs #

A series on channels is described by a family of structured runs: every run emits words on the channels (em : X → Z → List Γ) and carries a weight (wt : X → F). Tape.IsRuns P em wt says that hat P v equals the sum of weights of the runs that emit v, and Tape.Runs n em wt states that some series of dimension at most n represents (em, wt).

From VP ≠ VNP over every field [Ant26], module Nc.Sort.Runs.

Main definitions #

Main results #

def Cslib.Circuits.Arithmetic.Separation.Tape.IsRuns {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] (P : Automata.Weighted.Series F (Z × Γ)) {X : Type u_4} (em : X → Z → List Γ) (wt : X → F) :

The series P is described by runs with emissions em and weights wt.

def Cslib.Circuits.Arithmetic.Separation.Tape.Runs {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] (n : ℕ) {X : Type u_4} (em : X → Z → List Γ) (wt : X → F) :

There is a rational series of dimension at most n with runs (em, wt).

theorem Cslib.Circuits.Arithmetic.Separation.Tape.IsRuns.exists_run {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {P : Automata.Weighted.Series F (Z × Γ)} {X : Type u_4} {em : X → Z → List Γ} {wt : X → F} (h : IsRuns P em wt) {v : Z → List Γ} (hv : Automata.Weighted.hat P v ≠ 0) :
∃ (x : X), em x = v ∧ wt x ≠ 0
theorem Cslib.Circuits.Arithmetic.Separation.Tape.IsRuns.of_fib {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {P : Automata.Weighted.Series F (Z × Γ)} {X : Type u_4} {em : X → Z → List Γ} {wt : X → F} (h : IsRuns P em wt) {v : Z → List Γ} (R : Finset X) (hR : ∀ (x : X), x ∈ R ↔ em x = v) :
Automata.Weighted.hat P v = ∑ x ∈ R, wt x
theorem Cslib.Circuits.Arithmetic.Separation.Tape.IsRuns.mul {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {f g : Automata.Weighted.Series F (Z × Γ)} {X : Type u_4} {Y : Type u_5} {em : X → Z → List Γ} {wt : X → F} {em' : Y → Z → List Γ} {wt' : Y → F} (hf : IsRuns f em wt) (hg : IsRuns g em' wt') :
IsRuns (f.mul g) (fun (x : X × Y) (z : Z) => em x.1 z ++ em' x.2 z) fun (x : X × Y) => wt x.1 * wt' x.2
theorem Cslib.Circuits.Arithmetic.Separation.Tape.IsRuns.sum {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {ι : Type u_4} [Fintype ι] {X : ι → Type u_5} {P : ι → Automata.Weighted.Series F (Z × Γ)} {em : (i : ι) → X i → Z → List Γ} {wt : (i : ι) → X i → F} (h : ∀ (i : ι), IsRuns (P i) (em i) (wt i)) :
IsRuns (∑ i : ι, P i) (fun (x : (i : ι) × X i) => em x.fst x.snd) fun (x : (i : ι) × X i) => wt x.fst x.snd
theorem Cslib.Circuits.Arithmetic.Separation.Tape.IsRuns.congr {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {P : Automata.Weighted.Series F (Z × Γ)} {X : Type u_4} {Y : Type u_5} {em : X → Z → List Γ} {wt : X → F} {em' : Y → Z → List Γ} {wt' : Y → F} (h : IsRuns P em wt) (e : Y ≃ X) (h1 : ∀ (y : Y) (z : Z), em (e y) z = em' y z) (h2 : ∀ (y : Y), wt (e y) = wt' y) :
IsRuns P em' wt'
theorem Cslib.Circuits.Arithmetic.Separation.Tape.IsRuns.one {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] :
IsRuns Automata.Weighted.Series.one (fun (x : Unit) (x_1 : Z) => []) fun (x : Unit) => 1
theorem Cslib.Circuits.Arithmetic.Separation.Tape.IsRuns.kstar {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {f : Automata.Weighted.Series F (Z × Γ)} {X : Type u_4} {em : X → Z → List Γ} {wt : X → F} (hf : IsRuns f em wt) (hne : ∀ (x : X), em x ≠ fun (x : Z) => []) :
IsRuns f.kstar (fun (l : List X) (z : Z) => List.flatMap (fun (x : X) => em x z) l) fun (l : List X) => (List.map wt l).prod

The star: runs of Series.kstar f are finite lists of non-empty runs of f.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Tape.chanWord {Z : Type u_1} {Γ : Type u_2} [Fintype Z] (w : Z → List Γ) :
List (Z × Γ)

The channel word concatenating each channel's assignment in order.

theorem Cslib.Circuits.Arithmetic.Separation.Tape.length_chanWord {Z : Type u_1} {Γ : Type u_2} [Fintype Z] (w : Z → List Γ) :
(chanWord w).length = ∑ z : Z, (w z).length
theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.mono {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {n m : ℕ} {X : Type u_4} {em : X → Z → List Γ} {wt : X → F} (h : Runs n em wt) (hm : n ≤ m) :
Runs m em wt
theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.congr {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {n : ℕ} {X : Type u_4} {Y : Type u_5} {em : X → Z → List Γ} {wt : X → F} {em' : Y → Z → List Γ} {wt' : Y → F} (h : Runs n em wt) (e : Y ≃ X) (h1 : ∀ (y : Y) (z : Z), em (e y) z = em' y z) (h2 : ∀ (y : Y), wt (e y) = wt' y) :
Runs n em' wt'
theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.mul {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {n m : ℕ} {X : Type u_4} {Y : Type u_5} {em : X → Z → List Γ} {wt : X → F} {em' : Y → Z → List Γ} {wt' : Y → F} (hf : Runs n em wt) (hg : Runs m em' wt') :
Runs (n + m) (fun (x : X × Y) (z : Z) => em x.1 z ++ em' x.2 z) fun (x : X × Y) => wt x.1 * wt' x.2
theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.sum {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {ι : Type u_4} [Fintype ι] {n : ι → ℕ} {X : ι → Type u_5} {em : (i : ι) → X i → Z → List Γ} {wt : (i : ι) → X i → F} (h : ∀ (i : ι), Runs (n i) (em i) (wt i)) :
Runs (∑ i : ι, n i) (fun (x : (i : ι) × X i) => em x.fst x.snd) fun (x : (i : ι) × X i) => wt x.fst x.snd
theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.add {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {n m : ℕ} {X : Type u_4} {Y : Type u_5} {em : X → Z → List Γ} {wt : X → F} {em' : Y → Z → List Γ} {wt' : Y → F} (hf : Runs n em wt) (hg : Runs m em' wt') :
Runs (n + m) (Sum.elim em em') (Sum.elim wt wt')
theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.kstar {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {n : ℕ} {X : Type u_4} {em : X → Z → List Γ} {wt : X → F} (hf : Runs n em wt) (hne : ∀ (x : X), ∃ (z : Z), em x z ≠ []) :
Runs (n + 1) (fun (l : List X) (z : Z) => List.flatMap (fun (x : X) => em x z) l) fun (l : List X) => (List.map wt l).prod
theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.one {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] :
Runs 1 (fun (x : Unit) (x_1 : Z) => []) fun (x : Unit) => 1
theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.pick {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {κ : Type u_4} [Fintype κ] (w : κ → Z → List Γ) (c : κ → F) :
Runs (∑ k : κ, (2 * ∑ z : Z, (w k z).length + 1)) w c

One of finitely many families of channel words, with weights c.

theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.const {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] (w : Z → List Γ) :
Runs (2 * ∑ z : Z, (w z).length + 1) (fun (x : Unit) => w) fun (x : Unit) => 1

Fixed channel words w with weight 1.

theorem Cslib.Circuits.Arithmetic.Separation.Tape.Runs.pi {F : Type u_1} [CommRing F] {Z : Type u_2} {Γ : Type u_3} [Fintype Z] [DecidableEq Z] [Finite Γ] {k : ℕ} {n : Fin k → ℕ} {X : Fin k → Type u_4} {em : (i : Fin k) → X i → Z → List Γ} {wt : (i : Fin k) → X i → F} (h : ∀ (i : Fin k), Runs (n i) (em i) (wt i)) :
Runs (∑ i : Fin k, n i + 1) (fun (x : (i : Fin k) → X i) (z : Z) => (List.ofFn fun (i : Fin k) => em i (x i) z).flatten) fun (x : (i : Fin k) → X i) => ∏ i : Fin k, wt i (x i)

A sequence of k independent run choices.