Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Uni.CmpU

Neighbour comparison on duplicate tapes #

Checks whether adjacent records in a sorted list agree whenever the second record is a lookup (Uni.chkG), by streaming two shifted copies (Uni.PlG, Uni.QlG) across comparison tapes cm false and cm true (Uni.emCm).

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

Main definitions #

Main results #

Generic check of neighbours: every lookup (r.1 = true) shares its key with p.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.chkG_map {n : ℕ} {B : Type u_2} {κ : Type u_3} (φ : (Fin n → B) → κ) (hφ : Function.Injective φ) (p : Option (Fin n → B)) (l : List (List.RadixSort.Rc n B)) :
chkG (Option.map φ p) (List.map (fun (r : List.RadixSort.Rc n B) => (r.1, φ r.2)) l) ↔ List.RadixSort.chk p l
@[reducible, inline]

One round of the shifted neighbour comparison: either an entry/arbitrary step (.inl (r, x)) or a matching lookup step (.inr r).

The record read on the second copy (cQ).

The record read on the first copy (cP): the succeeding record.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.RdG.ext {κ : Type u_1} {d d' : RdG κ} (h1 : d.fst = d'.fst) (h2 : d.snd = d'.snd) :
d = d'
theorem Cslib.Circuits.Arithmetic.Separation.Uni.RdG.exists_iff {κ : Type u_1} (r r' : Bool × κ) :
(∃ (d : RdG κ), d.fst = r ∧ d.snd = r') ↔ r'.1 = false ∨ some r.2 = some r'.2
theorem Cslib.Circuits.Arithmetic.Separation.Uni.cmpG_iff {κ : Type u_1} (r : Bool × κ) (l : List (Bool × κ)) :
(∃ (ds : List (RdG κ)) (r' : Bool × κ), List.map RdG.snd ds = l ∧ List.map RdG.fst ds ++ [r'] = r :: l) ↔ chkG (some r.2) l

A run of the shifted neighbour comparison between the two copies of the sorted list.

  • head : κ

    key of the leading table entry on the first copy

  • rounds : List (RdG κ)

    sequence of adjacent-pair comparison rounds

  • last : Bool × κ

    trailing record on the second copy

theorem Cslib.Circuits.Arithmetic.Separation.Uni.XG.ext {κ : Type u_2} {x y : XG κ} (head : x.head = y.head) (rounds : x.rounds = y.rounds) (last : x.last = y.last) :
x = y

The record list reconstructed on the first comparison copy (cP).

The record list reconstructed on the second comparison copy (cQ).

theorem Cslib.Circuits.Arithmetic.Separation.Uni.exists_cmpG {κ : Type u_1} {l : List (Bool × κ)} (hl : l ≠ []) :
(∃ (y : XG κ), PlG y = l ∧ QlG y = l) ↔ chkG none l
theorem Cslib.Circuits.Arithmetic.Separation.Uni.cmpG_unique {κ : Type u_1} {y y' : XG κ} (h1 : PlG y = PlG y') (h2 : QlG y = QlG y') :
y = y'
@[reducible, inline]

Records stripped of rotation marks.

Tape encoding of a record without the rotation mark.

@[reducible, inline]

The read side of the first comparison tape copy.

@[reducible, inline]

The read side of the second comparison tape copy.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.runs_rk {A : Type u_1} [CommRing A] {M K : Type} [Finite M] [Fintype K] [DecidableEq K] (zs : Finset (Zc K)) (hz : zs.Nonempty) :
Tape.Runs (2 * (2 * zs.card + 1) + (Fintype.card (Bl K) * (2 * zs.card + 1) + 1) + (2 * zs.card + 1)) (fun (r : Rk K) => Tape.on zs (rk r)) fun (x : Rk K) => 1

Emissions of a single comparison round on cP and cQ.

theorem Cslib.Circuits.Arithmetic.Separation.Uni.runs_rdG {A : Type u_1} [CommRing A] {M K : Type} [Finite M] [Fintype K] [DecidableEq K] :
Tape.Runs (9 + (Fintype.card (Bl K) * 3 + 1) + (3 + (Fintype.card (Bl K) * 3 + 1) + 3) + (6 + 3 + (Fintype.card (Bl K) * 5 + 1) + 5)) emRd fun (x : RdG (List (Bl K))) => 1

Emissions of a full comparison run on cP and cQ.

Dimension upper bound for the neighbour-comparison automaton with bucket count k.