Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Uni.SpecU2

The sorting loop: the number of passes is forced #

Matching the tape equations Uni.IMU on an encoded block of rotated records forces the sorting loop Uni.XU to execute the exact n radix-sort passes Uni.canon l n 0, terminating uniquely when and only when every lookup key is present in the table (Uni.imu_table, Uni.imu_unique).

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

Main definitions #

Main results #

def Cslib.Circuits.Arithmetic.Separation.Uni.rst {K : Type} {n : ℕ} (j : ℕ) (x : Fin n → Bl K) :
List (Option (Bl K))

The letters of a key x after j rotations, omitting the leading entry.

def Cslib.Circuits.Arithmetic.Separation.Uni.rot {K : Type} {n : ℕ} (j : ℕ) (x : Fin n → Bl K) :
List (Option (Bl K))

The letters of a key x after j cyclic rotations past the none mark.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.rot_cons {K : Type} {n j : ℕ} (hj : j < n) (x : Fin n → Bl K) :
rot j x = some (x ⟨j, hj⟩) :: rst j x
theorem Cslib.Circuits.Arithmetic.Separation.Uni.rot_succ {K : Type} {n j : ℕ} (hj : j < n) (x : Fin n → Bl K) :
rot (j + 1) x = rst j x ++ [some (x ⟨j, hj⟩)]

Encode a list of records after j key rotations.

def Cslib.Circuits.Arithmetic.Separation.Uni.dl {K : Type} {n : ℕ} (j : ℕ) (hj : j < n) (l : List (List.RadixSort.Rc n (Bl K))) :
List (Dr K)

The canonical distribution rounds for radix pass j.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.dIn_dl {K : Type} {n : ℕ} (j : ℕ) (hj : j < n) (l : List (List.RadixSort.Rc n (Bl K))) :
dIn (dl j hj l) = recs j l
theorem Cslib.Circuits.Arithmetic.Separation.Uni.dOut_dl {K : Type} [DecidableEq K] {n : ℕ} (j : ℕ) (hj : j < n) (l : List (List.RadixSort.Rc n (Bl K))) (b : Bl K) :
dOut b (dl j hj l) = recs (j + 1) (List.filter (fun (r : List.RadixSort.Rc n (Bl K)) => decide (r.2 ⟨j, hj⟩ = b)) l)
def Cslib.Circuits.Arithmetic.Separation.Uni.toNB {M K : Type} (w : List (Sy M K)) (h : Sy.bar ∉ w) :
List (NB M K)

Wrap a tape word free of bar into List (NB M K).

def Cslib.Circuits.Arithmetic.Separation.Uni.cps {M K : Type} [DecidableEq K] {n : ℕ} (j : ℕ) (hj : j < n) (l : List (List.RadixSort.Rc n (Bl K))) :
Ps M K

The canonical sorting pass j on record list l.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Uni.canon {M K : Type} [Fintype K] [DecidableEq K] {n : ℕ} (l : List (List.RadixSort.Rc n (Bl K))) :
ℕ → ℕ → List (Ps M K)

All k canonical radix-sort passes starting from coordinate j.

noncomputable def Cslib.Circuits.Arithmetic.Separation.Uni.finL {K : Type} [Fintype K] [DecidableEq K] {n : ℕ} (l : List (List.RadixSort.Rc n (Bl K))) :
List (Rk K)

The sorted list of records with keys materialized as lists.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.passes_iff {M K : Type} [Fintype K] [DecidableEq K] {n : ℕ} {l : List (List.RadixSort.Rc n (Bl K))} (hl : l ≠ []) (k j : ℕ) (hjk : j + k = n) (ps : List (Ps M K)) (fin : List (Rk K)) :
(encW (recs j (List.RadixSort.srt (bsl K) l j)) :: List.map (fun (p : Ps M K) => cOut p.2) ps = List.map (fun (p : Ps M K) => encW (dIn p.1)) ps ++ [encW (fIn fin)] ∧ ∀ p ∈ ps, ∀ (b : Bl K), encW (dOut b p.1) = List.map Subtype.val (p.2 b)) ↔ ps = canon l k j ∧ fin = finL l

Tape-matching on the passes and final read forces both to be the canonical ones.

structure Cslib.Circuits.Arithmetic.Separation.Uni.IMU {M K : Type} [Fintype K] [DecidableEq K] (x : XU M K) (w : List (Sy M K)) :

Matched-tape condition for the sorting loop starting from initial block w on ls.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.imu_iff {M K : Type} [Fintype K] [DecidableEq K] {n : ℕ} {l : List (List.RadixSort.Rc n (Bl K))} (hl : l ≠ []) (x : XU M K) :
IMU x (encW (recs 0 l)) ↔ x.passes = canon l n 0 ∧ x.final = finL l ∧ PlG x.cmp = finL l ∧ QlG x.cmp = finL l
theorem Cslib.Circuits.Arithmetic.Separation.Uni.imu_unique {M K : Type} [Fintype K] [DecidableEq K] {n : ℕ} {l : List (List.RadixSort.Rc n (Bl K))} (hl : l ≠ []) {x x' : XU M K} (h : IMU x (encW (recs 0 l))) (h' : IMU x' (encW (recs 0 l))) :
x = x'
theorem Cslib.Circuits.Arithmetic.Separation.Uni.imu_table {M K : Type} [Fintype K] [DecidableEq K] {n : ℕ} (T L : List (Fin n → Bl K)) (hT : T ≠ []) :
(∃ (x : XU M K), IMU x (encW (recs 0 (List.map (fun (x : Fin n → Bl K) => (false, x)) T ++ List.map (fun (x : Fin n → Bl K) => (true, x)) L)))) ↔ ∀ x ∈ L, x ∈ T

Table entries followed by lookups: a valid matched sorting run exists iff every lookup key belongs to the table T.