Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Uni.Prog

A tape program simulating a pointer machine #

Constructs the structured-run tape program Uni.emX P (and its rational-series realization Uni.runs_X of dimension Uni.dimX P) simulating a pointer machine P : Mach A M K. The run type Uni.XP P is a record with named fields covering all six simulation phases: initialization, counter increments, bit-sliced steps, final register/counter tail, lookup append, and the universal radix-sorting / neighbour-comparison loop Uni.XU.

From VP ≠ VNP over every field [Ant26], module Nc.Uni.Prog.

Main definitions #

Main results #

A tape-encoded binary word terminated by a semicolon semi.

def Cslib.Circuits.Arithmetic.Separation.Uni.cont {K : Type} (κ : K) (cs : List (Fin 4 → Bool)) :
List (Bl K)

Record content as a key-letter list: leading kind letter followed by bit-slice columns.

def Cslib.Circuits.Arithmetic.Separation.Uni.rec' {M K : Type} (f : Bool) (κ : K) (cs : List (Fin 4 → Bool)) :
List (Sy M K)

A record serialized onto a tape with leading flag f and trailing rotation mark.

@[reducible, inline]

Channel corresponding to side b of tape s.

The five register-tape channels on side b.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.mem_rgs {K : Type} [DecidableEq K] (b : Bool) (z : Zc K) :
z ∈ rgs b ↔ ∃ (i : Fin 5), z = tp (Tp.rg i) b
theorem Cslib.Circuits.Arithmetic.Separation.Uni.runs_rep {A : Type u_1} [CommRing A] {M K : Type} [Finite M] [Fintype K] [DecidableEq K] (w : Zc K → List (Sy M K)) (hw : ∃ (z : Zc K), w z ≠ []) :
Tape.Runs (2 * ∑ z : Zc K, (w z).length + 1 + 1) (fun (l : List Unit) (z : Zc K) => List.flatMap (fun (x : Unit) => w z) l) fun (x : List Unit) => 1

Repeat a fixed non-empty channel emission w arbitrarily many times.

Counter value before an increment: u ++ false :: true^k.

Counter value after an increment: u ++ true :: false^k.

Emissions of one round of the binary counter increment phase.

Initial register word: 0 of length l.length + 1.

Initial fresh-address word: 1 of length l.length + 1.

def Cslib.Circuits.Arithmetic.Separation.Uni.emIn {M K : Type} [DecidableEq K] (m0 : M) (kN : K) (l : List Unit) :
Zc K → List (Sy M K)

Emissions at program initialization (initial registers, counter 1, record 0, mode m0).

theorem Cslib.Circuits.Arithmetic.Separation.Uni.runs_in {A : Type u_1} [CommRing A] {M K : Type} [Finite M] [Fintype K] [DecidableEq K] (m0 : M) (kN : K) :
Tape.Runs 80 (emIn m0 kN) fun (x : List Unit) => 1

Extract the bit word of step variable i : Fin 9 from a column list.

def Cslib.Circuits.Arithmetic.Separation.Uni.ldc {A M K : Type} (P : Mach A M K) (r : P.Rl) (w : List (Fin 9 → Bool)) :
List (Fin 4 → Bool)

Bit-slice columns of the record loaded by rule r.

def Cslib.Circuits.Arithmetic.Separation.Uni.alc {A M K : Type} (P : Mach A M K) (r : P.Rl) (w : List (Fin 9 → Bool)) :
List (Fin 4 → Bool)

Bit-slice columns of the record allocated by rule r.

def Cslib.Circuits.Arithmetic.Separation.Uni.rgw {A M K : Type} (P : Mach A M K) (s : Bool) (r : P.Rl) (w : List (Fin 9 → Bool)) (i : Fin 5) :

Bit word written by rule r onto side s of register tape i.

def Cslib.Circuits.Arithmetic.Separation.Uni.emSt {A M K : Type} (P : Mach A M K) (x : P.Rl × List (Fin 9 → Bool)) :
Zc K → List (Sy M K)

Complete channel emissions of a single bit-sliced machine step.

def Cslib.Circuits.Arithmetic.Separation.Uni.st0 {A M K : Type} (P : Mach A M K) (r : P.Rl) :
Zc K → List (Sy M K)

Opening header emission of rule r before its bit-slice columns.

def Cslib.Circuits.Arithmetic.Separation.Uni.st1 {A M K : Type} (P : Mach A M K) (r : P.Rl) (v : Fin 9 → Bool) :
Zc K → List (Sy M K)

Single bit-slice column emission of rule r at bit vector v.

Closing terminator emission of a step after its bit-slice columns.

Dimension upper bound for the single-step automaton of P.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.runs_st {A M K : Type} (P : Mach A M K) [CommRing A] [Finite M] [Fintype K] [DecidableEq K] :
Tape.Runs (dimSt P) (emSt P) fun (x : P.Rl × List (Fin 9 → Bool)) => P.wt x.1
def Cslib.Circuits.Arithmetic.Separation.Uni.emEd {M K : Type} (mh : M) (x : List (Fin 5 → Bool) × List Bool) :
Zc K → List (Sy M K)

Emissions at program termination: final registers, halting mode mh, and true :: u on the counter read side.

def Cslib.Circuits.Arithmetic.Separation.Uni.ed1 {M K : Type} (v : Fin 5 → Bool) :
Zc K → List (Sy M K)

Single final-register bit-slice emission.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.runs_ed {A : Type u_1} [CommRing A] {M K : Type} [Finite M] [Fintype K] [DecidableEq K] (mh : M) :
Tape.Runs (∑ v : Fin 5 → Bool, (2 * ∑ z : Zc K, (ed1 v z).length + 1) + 1 + 30) (emEd mh) fun (x : List (Fin 5 → Bool) × List Bool) => 1

Emissions copying the lookup tape onto the list tape followed by the block separator bar.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.runs_ap {A : Type u_1} [CommRing A] {M K : Type} [Fintype M] [Fintype K] [DecidableEq K] :
Tape.Runs (Fintype.card (Sy M K) * 5 + 1 + 3) emAp fun (x : List (Sy M K)) => 1

A complete structured run of the universal tape program simulating pointer machine P.

  • init : List Unit

    unary witness fixing the bit-width L = init.length + 1

  • counter : List (List Bool × List Unit)

    sequence of binary counter increment rounds

  • steps : List (P.Rl × List (Fin 9 → Bool))

    sequence of bit-sliced machine steps

  • finalRegs : List (Fin 5 → Bool)

    final register values (bit-sliced columns)

  • finalCounter : List Bool

    tail bits of the halting counter true :: finalCounter

  • lookups : List (Sy M K)

    copied word of lookup records appended to lsF

  • sort : XU M K

    radix-sorting and neighbour-comparison phase run

theorem Cslib.Circuits.Arithmetic.Separation.Uni.XP.ext {A M K : Type} {P : Mach A M K} {x y : XP P} (init : x.init = y.init) (counter : x.counter = y.counter) (steps : x.steps = y.steps) (finalRegs : x.finalRegs = y.finalRegs) (finalCounter : x.finalCounter = y.finalCounter) (lookups : x.lookups = y.lookups) (sort : x.sort = y.sort) :
x = y
noncomputable def Cslib.Circuits.Arithmetic.Separation.Uni.emX {A M K : Type} [Fintype K] [DecidableEq K] (P : Mach A M K) (x : XP P) :
Zc K → List (Sy M K)

Channel emissions of a full universal tape program run x : XP P.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Uni.dimX {A M K : Type} [Fintype M] [Fintype K] (P : Mach A M K) :

Dimension upper bound for the rational series realizing emX P.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.runs_X {A : Type} [CommRing A] {M K : Type} [Fintype M] [Fintype K] [DecidableEq K] (P : Mach A M K) :
Tape.Runs (dimX P) (emX P) fun (x : XP P) => (List.map (fun (s : P.Rl × List (Fin 9 → Bool)) => P.wt s.1) x.steps).prod