Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.ResizableSuccinct.InEpoch

In-Epoch Resizable Succinct Compacted Representation and Primitives #

This module formalizes the compacted epoch representation and live invariants of the resizable succinct dynamic dictionary on the word-granular Resizable Word RAM (Cslib.WordRAM.Resizable).

It establishes:

  1. Static 1 · OPT compacted epoch footprint bounds (compactedEpochWords_le_succinctWords, w_mul_compactedEpochWords_le_bits): under EpochValid U n N, the live compacted epoch footprint formula is at most Dynamic.succinctWords 1355 441 U V w n words (1 · OPT, never 2 · OPT). The constant 1355 decomposes algebraically as 11 + 1344, where 11 = 5 + 6 bounds the quotient-bit slack (5 from Feistel quotient/val vs optBits and 6 from quotientBits U N ≤ quotientBits U n + 6 via N ≤ 4 * n), and 1344 = 16 * 84 bounds the 84 * N * logLogFactor N metadata arrays via N ≤ 4 * n and logLogFactor N ≤ 4 * logLogFactor n.
  2. Dense key reconstruction and live representation invariants (reconstructKeyAt_spec, CompactedSplitRep, CompactedRep, compactedRep_empty): every dense slot $d < n$ reconstructs a live $(u, v)$ in $s_{\mathrm{abs}}$ injectively and surjectively.

Main definitions #

Main results #

References #

Section 1: Compacted Epoch 1 · OPT Word-Space and Bit-Space Bounds #

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.compactedEpochWords_le_succinctWords {U V w N n : ℕ} (hw : 0 < w) (hU : WordRAM.Fits w U) (_hU_pos : 0 < U) (_hV_pos : 0 < V) (hev : EpochValid U n N) :
compactedEpochWords U V w N n ≤ Dynamic.succinctWords 1355 441 U V w n

Static 1 · OPT word-space bound (compactedEpochWords_le_succinctWords): whenever EpochValid U n N (n = 0 ∧ N = 0 or 1 ≤ n ≤ N ≤ 4 * n ∧ N ≤ U), the live compacted footprint compactedEpochWords U V w N n is at most Dynamic.succinctWords 1355 441 U V w n.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.w_mul_compactedEpochWords_le_bits {U V w N n : ℕ} (hw : 0 < w) (hU : WordRAM.Fits w U) (hU_pos : 0 < U) (hV_pos : 0 < V) (hev : EpochValid U n N) :
w * compactedEpochWords U V w N n ≤ Dynamic.optBits U V n + 1355 * n * Dynamic.logLogFactor n + 442 * w

Static 1 · OPT bit-space bound (w_mul_compactedEpochWords_le_bits): multiplying compactedEpochWords U V w N n by w yields at most Dynamic.optBits U V n + 1355 * n * Dynamic.logLogFactor n + 442 * w bits across every valid epoch (EpochValid U n N).

Section 2: Key Reconstruction and Compacted Representation Invariants #

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.reconstructKeyAt_spec {metaBase itemBase U V w N n : ℕ} {θ : Succinct.QuotHashSeed U N} {s_abs : State U} {s_fix s : Memory.State} (hvals : ValuesBounded V s_abs) (hNU : N ≤ U) (hinv : Succinct.DictStateInv U V (ghostW w) N 0 θ s_abs s_fix) (hcpl : FixedCoupled metaBase itemBase U V w N s_fix s) (hn : Succinct.totalSlots N (compGmAt metaBase U w N s.mem) = n) :
(∀ d < n, ∃ (hu : reconstructKeyAt metaBase itemBase U V w N n θ s.mem d < U), s_abs ⟨reconstructKeyAt metaBase itemBase U V w N n θ s.mem d, hu⟩ = some (compValAt itemBase U V w N n s.mem d) ∧ compValAt itemBase U V w N n s.mem d < V) ∧ (∀ d₁ < n, ∀ d₂ < n, reconstructKeyAt metaBase itemBase U V w N n θ s.mem d₁ = reconstructKeyAt metaBase itemBase U V w N n θ s.mem d₂ → d₁ = d₂) ∧ ∀ (u : Fin U), (s_abs u).isSome = true → ∃ d < n, reconstructKeyAt metaBase itemBase U V w N n θ s.mem d = ↑u

Every dense slot d < n reconstructs a live (u, v) in s_abs injectively and surjectively.

structure Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.CompactedSplitRep (metaBase itemBase U V w N n n_init : ℕ) (θ : Succinct.QuotHashSeed U N) (s_abs : State U) (s : Memory.State) :

Active compacted epoch invariant at arbitrary (metaBase, itemBase) (s : Memory.State).

Live resting representation invariant on RData r (metaBase = base, exact x.frontier).

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.compactedRep_empty {r U V w base : ℕ} {x : WordRAM.Resizable.RData r} (hx : WordRAM.Resizable.RData.Bounded w x) (hfr : x.frontier = base + 8) (hhdr : RootHeaderValid U V w 0 0 0 base x.mem) :
CompactedRep U V w 0 0 0 base (empty U) x

An empty dictionary state (n = 0, N = 0) satisfies CompactedRep.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.compactedRep_of_split {r U V w N n n_init base : ℕ} {θ : Succinct.QuotHashSeed U N} {s_abs : State U} {x : WordRAM.Resizable.RData r} (hx : WordRAM.Resizable.RData.Bounded w x) (hfr : x.frontier = base + compactedEpochWords U V w N n) (hepoch : EpochValid U n N) (hsplit : CompactedSplitRep base (base + offCompItems U w N) U V w N n n_init θ s_abs { mem := x.mem, frontier := x.frontier }) :
CompactedRep U V w N n n_init base s_abs x

An active compacted epoch split representation yields a resting CompactedRep.